Formatting data for Sankey diagrams in d3.js

This blog is a place for presenting information from the books D3 Tips and tricks, Leaflet Tips and Tricks and Raspberry Pi: Measure, Record, Explore.