SANKEY Experiment
This Sankey diagram shows the flow of "Widgets" between five named nodes, with link thickness indicating the quantity transferred. Built with D3.js v5 and a custom `d3.sankey` plugin, it loads JSON data with node names, maps links accordingly, and lays out the graph automatically. The diagram supports interactive dragging of node rectangles, which triggers a `relayout()` to update link paths. Rendering uses SVG elements with semi-transparent curved paths and categorical color fills per node.
AI-generated descriptionThe above example is intended to demonstrate drawing a simple Sankey diagram using JSON with names for the nodes instead of relying on d3 to index them. It uses Jason Davies' version of the Sankey plugin.
This is one of the code samples for the update to the book D3 Tips and Tricks to version 5 of d3.js.