Skip to main content
100%

SANKEY Experiment

✓ Published0🌍 Public
Dd3noob
Last edited Jun 19, 2021
Created on Jun 19, 2021

This Sankey diagram visualizes the flow of values between five named nodes (Barry, Frodo, Elvis, Sarah, and Alice) using the d3-sankey extension for D3 v7. The SVG rendering uses `d3.json` to load node and link data where links reference nodes by name rather than index. Each node appears as a colored rectangle with text labels, while curved link paths show the magnitude of flow with stroke widths and hover effects. The code builds the diagram by mapping link sources and targets to node objects before applying the Sankey layout algorithm.

AI-generated description

The 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.

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

mit Licensed

Similar vizzes