Sankey diagram

Flow diagram with nodes and curved weighted links. Self-contained SVG (no ChartRoot).

Primitive: ChartSankey· Standalone (no ChartRoot needed)

Interactive demo

Usage

import { ChartSankey } from '@ramtt/charts'

<ChartSankey
  data={{
    nodes: [{ id: 'intake', label: 'kJ Intake' }, { id: 'z2', label: 'Z2' }],
    links: [{ source: 'intake', target: 'z2', value: 800 }],
  }}
  colors={['var(--chart-1)', 'var(--chart-2)']}
/>

Props

PropTypeDefaultDescription
data*{ nodes: SankeyNodeInput[]; links: SankeyLinkInput[] }Nodes + weighted links
widthnumber600SVG width in px
heightnumber400SVG height in px
nodeWidthnumber18Node bar width in px
nodePaddingnumber10Vertical padding between nodes
colorsstring[]Color palette for nodes/links