SANKEY Experiment
A Sankey diagram visualizes the flow of quantities between five nodes, with node colors distinguishing categories and link thickness representing value. The diagram supports interactive dragging of nodes in both axes, recalculating link paths during movement. Built with D3 v4, it uses the d3.sankey plugin for layout and d3.drag for interaction. Data comes from a static JSON file, and the SVG rendering includes hover tooltips showing source, target, and formatted values in "Widgets" units.
AI-generated descriptionThe above example is intended to demonstrate drawing a simple Sankey diagram using v4 of d3.js. It uses Jason Davies' version of the Sankey plugin.
This particular version allows the dragging of nodes in the x and y direction. Have a play!
This is one of the code samples for the update to the book D3 Tips and Tricks to version 4 of d3.js.