Skip to main content
100%

SANKEY Experiment

✓ Published0🌍 Public
Dd3noob
Last edited Dec 5, 2020
Created on Oct 2, 2020

A Sankey diagram shows the flow of values between five nodes (node0 through node4) across three stages, with links varying in thickness according to their assigned weights. The example uses d3.v6 with the d3-sankey plugin (v0.12.3) to compute the layout, generating SVG paths via `d3.sankeyLinkHorizontal()` for the links and rectangles for the nodes. A categorical color scale (`d3.scaleOrdinal` with `d3.schemeCategory10`) colors each node, and hover effects increase link opacity. Data comes from a static `sankey.json` file, demonstrating a basic multi-stage flow visualization.

AI-generated description

The above example is intended to demonstrate drawing a simple Sankey diagram using v6 of d3.js. It uses the 0.12.3 version of the Sankey plugin.

This is one of the code samples for the update to the book D3 Tips and Tricks to version 6 of d3.js.

mit Licensed

Similar vizzes