Sankey
A flow diagram layout, with nodes in columns and links as thick as their values.
Static preview; loading the interactive plot
<script>
import { Plot, Sankey, Edges, Nodes, Flow, Rect, GraphData } from "hmplot";
const data = {
source: ["in", "in", "a", "b"],
target: ["a", "b", "out", "out"],
value: [3, 2, 3, 2],
};
</script>
<Plot {data} height={300}>
<GraphData source="source" target="target"
><Sankey value="value">
<Edges>
<Flow
startLower="startLower"
endLower="endLower"
startUpper="startUpper"
endUpper="endUpper"
/>
</Edges>
<Nodes><Rect x0="x0" x1="x1" y0="y0" y1="y1" /></Nodes>
</Sankey></GraphData
>
</Plot>
Usage
Sankey consumes GraphData and lays out nonnegative flows in an acyclic directed graph. Nodes expose x0, x1, y0, y1, x, y, position, depth, and throughput. Edges expose four attachment corners for Flow, plus the original edge columns. Explicit GraphData node tables can include isolated nodes.