Sankey Chart
Preview
Install
Add it with your package manager, or copy the source manually.
Run it in a project set up with shadcn-vue. The source is copied to components/beui and its dependencies are added to your package.json. Read the shadcn-vue guide
Download the release archive to your project root, then install the local file.
Import the shared styles once in your application.
API Reference
SankeyChart
nodesreadonly SankeyNode[]—linksreadonly SankeyLink[]Weighted flows between node ids. Links that would close a loop are left out.
—label?string—formatValue?(value: number) => string—colors?readonly string[]Palette for nodes without their own color, in node order.
—nodeWidth?numberNode bar width in px.
—nodePadding?numberSpace between nodes in a column, in px.
—v-model:activeId?string | nullHighlighted node or link id. Controlled. Link ids default to `source:target`.
—defaultActiveId?string | null—@active-change?(id: string | null) => void—labels?Partial<SankeyChartMessages>Override any built-in string.
—class?string—#default?slotCompose `SankeyChartPlot` and `SankeyChartTooltip`; omit it for the complete chart. ```vue <SankeyChart :nodes="nodes" :links="links" :format-value="usd"> <SankeyChartPlot /> <SankeyChartTooltip /> </SankeyChart> ```
—SankeyChartPlot
class?stringSets the plot height; default 20rem. The layout follows its measured size.
—showValues?booleanShow each node's value under its label when there is room.
trueSankeyChartTooltip
class?string—side?"top" | "right" | "bottom" | "left"top#default?{ active: SankeyActive }Custom content for the highlighted node or flow.
—Updated