GitHubGitHub
← All widgets
Charts / widget

Sankey chart

Flow distribution diagram for traffic, cost, and conversion breakdowns.

Adjacency emphasis
import { SankeyChart } from '@chanrg/4ui/echarts';<SankeyChart {nodes} {links} unit="/s" />

Installation

pnpm add @chanrg/4ui

Import the stylesheet once, at the root of your app:

import '@chanrg/4ui/styles.css';

Usage

import { SankeyChart } from '@chanrg/4ui';import { SankeyChart } from '@chanrg/4ui/echarts';<SankeyChart {nodes} {links} unit="/s" />

API reference

Props

PropTypeDefaultDescription
nodes{ name, color? }[][]Flow nodes.
links{ source, target, value }[][]Directed flows.

CSS variables

VariableDescription
--4ui-surfacePrimary component surface.
--4ui-textPrimary foreground color.
--4ui-borderDefault control and panel border.

Accessibility

  • Hover highlights adjacency; provide the same totals as a table for assistive tech.

Dependencies

echarts (optional peer — install alongside)