Charts

Sankey

Flow diagrams showing the magnitude of flow between nodes

Sankey diagrams visualize flow quantities between a set of nodes, where the width of each link is proportional to its value. They are ideal for showing energy flows, user journeys, budget allocations, and similar many-to-many relationships.

Simple Sankey

A basic Sankey diagram with nodes and weighted links. The layout is computed by d3-sankey.

Custom Node

Use the #node slot to fully customize how each node is rendered. The slot receives coordinates, dimensions, and the node payload.

Props

PropTypeDefaultDescription
data{ nodes, links }requiredGraph data with nodes and links arrays. Links use numeric source/target indices and a value.
name-keystring'name'Node field used for tooltip names
data-keystring'value'Data key reported on tooltip entries. Link widths always come from value
width / height / aspectnumberfills the parentSize. See chart size
initial-dimension{ width, height }{ width: 640, height: 360 }Size before the first measurement. See chart size
titlestring'Sankey diagram'Accessible name of the chart
descstring—Accessible description of the chart
node-widthnumber10Width of each node rectangle
node-paddingnumber10Vertical space between nodes in the same column
iterationsnumber32Number of layout relaxation passes
margin{ top, right, bottom, left }{ top: 5, right: 5, bottom: 5, left: 5 }Space around the diagram
node-fillstringseries 1 tokenFill of node rectangles
node-strokestring'var(--v-charts-background, #fff)'Stroke of node rectangles
link-fillstringseries 1 tokenFill of link paths
link-strokestring'none'Stroke of link paths
is-animation-activebooleantrueAnimate entrance and data changes
transitionChartTransitionmotion tokensTiming and easing of data changes

Events

EventPayloadDescription
@node-click(node, index, event: MouseEvent | KeyboardEvent)A node is clicked, or Enter is pressed on the focused node
@node-mouseenter, @node-mouseleave(node, index, event: MouseEvent)The pointer enters or leaves a node
@link-click(link, index, event: MouseEvent)A link is clicked
@link-mouseenter, @link-mouseleave(link, index, event: MouseEvent)The pointer enters or leaves a link
@animation-start, @animation-end()An animation starts or ends

node is a SankeyLayoutNode and link a SankeyLayoutLink; both are exported types. The chart pointer events (@click, @mousemove, …) are also available. See Events and v-model.

Slots

SlotPropsDescription
#node{ payload, index, x, y, width, height, fill }Replace a node rectangle
#link{ payload, index, d, linkWidth, fill }Replace a link path. d is the path data; draw it with a stroke of linkWidth
default—Place <Tooltip> or other child components here

Data structure

const data = {
  nodes: [
    { name: 'A' },
    { name: 'B' },
    { name: 'C' },
  ],
  links: [
    { source: 0, target: 1, value: 10 },
    { source: 1, target: 2, value: 6 },
  ],
}

source and target are numeric indices into the nodes array. value determines the link width. Both nodes and links support <Tooltip> hover interaction.

Copyright © 2026