Skip to content
↑↓ to navigate↵ to openesc to close

Menu

Sankey Chart

Preview

Income statement, Q3 data
FlowValueShare of source
Subscriptions to Revenue$70M100.0%
Services to Revenue$17M100.0%
Marketplace to Revenue$14M100.0%
Revenue to Cost of revenue$36M35.6%
Revenue to Gross profit$65M64.4%
Gross profit to R&D$22M33.8%
Gross profit to Sales & marketing$17M26.2%
Gross profit to G&A$7M10.8%
Gross profit to Operating profit$19M29.2%

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

bunx --bun shadcn-vue@latest add @beui-vue/sankey-chart

Import the shared styles once in your application.

TSUsage
import SankeyChart from '@/components/beui/charts/SankeyChart.vue'
import '@/components/beui/styles.css'

API Reference

SankeyChart

nodes
readonly SankeyNode[]
Default—
links
readonly SankeyLink[]

Weighted flows between node ids. Links that would close a loop are left out.

Default—
label?
string
Default—
formatValue?
(value: number) => string
Default—
colors?
readonly string[]

Palette for nodes without their own color, in node order.

Default—
nodeWidth?
number

Node bar width in px.

Default—
nodePadding?
number

Space between nodes in a column, in px.

Default—
v-model:activeId?
string | null

Highlighted node or link id. Controlled. Link ids default to `source:target`.

Default—
defaultActiveId?
string | null
Default—
@active-change?
(id: string | null) => void
Default—
labels?
Partial<SankeyChartMessages>

Override any built-in string.

Default—
class?
string
Default—
#default?
slot

Compose `SankeyChartPlot` and `SankeyChartTooltip`; omit it for the complete chart. ```vue <SankeyChart :nodes="nodes" :links="links" :format-value="usd"> <SankeyChartPlot /> <SankeyChartTooltip /> </SankeyChart> ```

Default—

SankeyChartPlot

class?
string

Sets the plot height; default 20rem. The layout follows its measured size.

Default—
showValues?
boolean

Show each node's value under its label when there is room.

Defaulttrue

SankeyChartTooltip

class?
string
Default—
side?
"top" | "right" | "bottom" | "left"
Defaulttop
#default?
{ active: SankeyActive }

Custom content for the highlighted node or flow.

Default—

Updated