Skip to main content
100%

SANKEY Experiment

✓ Published0🌍 Public
PPragyagarg
Last edited Nov 30, 2018
Created on Nov 30, 2018

This example demonstrates a repurposable Sankey diagram, which visualizes the flow of quantities between interconnected nodes. Built with D3 v4, it loads node and link data from an external JSON file and renders the diagram as SVG, using the `d3.sankey` plugin for layout and `d3.drag` for interactive node repositioning. The code also employs `d3.scaleOrdinal` for node coloring and `d3.format` for display values, with links drawn as cubic Bézier curves via `sankey.link()`.

AI-generated description

The 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 is one of the code samples for the update to the book D3 Tips and Tricks to version 4 of d3.js.

forked from <a href='http://bl.ocks.org/d3noob/'>d3noob</a>'s block: <a href='http://bl.ocks.org/d3noob/013054e8d7807dff76247b81b0e29030'>Sankey Diagram with v4</a>

mit Licensed

Similar vizzes