Skip to main content

Sankey Chart

A Sankey diagram component built using Recharts v3. Visualize flow data between nodes with customizable links, gradients, and glow effects.

Installation

$ npx shadcn@latest add @orecus/sankey-chart
Registry:
@orecus/chart@orecus/color-utils@orecus/chart-utils@orecus/card

Component

User Flow

Conversion paths from visit to subscription

Energy Distribution

Power generation to consumption flow

Props

PropTypeDefaultDescription
data*{ nodes: { name: string }[]; links: { source: number; target: number; value: number }[] }Sankey data with nodes and links arrays
colorsThemeColor[]Colors for nodes
colorStyle'default' | 'gradient''gradient'Node fill style
glowbooleanfalseAdd glow effect behind nodes
nodeWidthnumber10Width of nodes in pixels
nodePaddingnumber20Vertical padding between nodes
linkCurvaturenumber0.5Link curve amount (0-1)
iterationsnumber32Number of layout iterations
showTooltipbooleantrueShow tooltip on hover
cardPropsCardPropsProps to pass to the underlying Card component