sigilUI

Sankey Diagram

An SVG Sankey flow diagram showing weighted connections between source and target nodes.

@sigil-ui/componentsReact

Preview

Live preview Interactive

Import

import { SankeyDiagram } from "@sigil-ui/components";

Usage

<SankeyDiagram sources={[{ label: "Search", value: 64 }, { label: "Direct", value: 36 }]} targets={[{ label: "Docs", value: 58 }, { label: "Components", value: 42 }]} links={[{ source: 0, target: 0, value: 42 }, { source: 0, target: 1, value: 22 }, { source: 1, target: 0, value: 16 }, { source: 1, target: 1, value: 20 }]} />

Custom size

<SankeyDiagram width={600} height={300} sources={[...]} targets={[...]} links={[...]} />

Props

PropTypeDefaultDescription
sourcesSankeyNode[]—Array of { label, value, color? } source nodes (required)
targetsSankeyNode[]—Array of { label, value, color? } target nodes (required)
linksSankeyLink[]—Array of { source, target, value } index-based links (required)
widthnumber400SVG width in pixels
heightnumber200SVG height in pixels
classNamestring—Additional CSS classes

Plus all standard <svg> HTML attributes.