Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

sanky

Public visualization

Viewing a saved revision (read-only)

f3b6b9258ea249f3948e5a7ebda6146b

sanky

0 stars1🌍 Public
AAnimesh Nautiyal
Last edited Aug 3, 2025
Created on Aug 3, 2025
Forked from React Starter

This Sankey diagram visualizes the flow of production values from three economic sectors—Agriculture, Manufacturing, and Services—into Domestic Consumption and Exports. The code uses the `d3-sankey` library's `d3.sankey()` generator and `d3.sankeyLinkHorizontal()` function to compute node and link positions, rendered as SVG paths and rectangles. Node labels are positioned left or right based on their x-coordinate. The bundled React component initializes the D3 chart inside a `useEffect` hook and uses an ordinal color scale for node and link coloring.

AI-generated description
MIT Licensed