Skip to main content

Sankey Diagram

One month of website visits: where visitors came from, which page they landed on and what they did next.

Hover the charts, click the legends, switch the site theme or resize the window
Pick a preset to reconfigure every chart
AG Chartsv14.2.0
Only in the paid edition

The Sankey series is part of AG Charts Enterprise.

Source
Observable Plotv0.6.17
Not available

No sankey mark. The link and arrow marks only connect points you position yourself, and the tree mark lays out hierarchies.

Source
Vega-Litev6.5.0
Not available

No sankey layout. Vega-Lite's transforms stop at stack, window and pivot, so the node positions and link ribbons would have to be computed by hand.

Source

What to look for​

  • Labels. Unovis labels every node on its inner side (labelPosition), adds its value underneath (subLabel) and trims or wraps labels that don't fit. Recharts draws no labels at all; the code adds them with a custom node, the way its docs do.
  • Hover. Unovis shows the value of the flow under the pointer and, after a short delay, highlights every path through the node it leads to (highlightSubtreeOnHover). ECharts highlights the nodes and flows next to the one you hover.
  • Randomize the data. Unovis moves nodes and flows to their new sizes in one transition.
  • TanStack Charts. Lays out the diagram (sankeyDiagram), but you draw the nodes, links and labels with ordinary marks, and links are straight unless you pass a d3-shape curve through d3Curve().
  • Colors. Unovis draws nodes in one color and keeps the flows neutral, so the structure reads first; nodeColor and linkColor color them when you need to. ECharts and Nivo color every node, and the Chart.js sankey plugin colors flows red to green unless you set colors yourself.
  • Presets. Colored flows paints the nodes with the palette and each flow with its source node's color (nodeColor, linkColor). ECharts, Chart.js and TanStack Charts have options for it and Nivo does it by default; Recharts' link object styles every link alike, so coloring each flow takes a custom link function that draws the path itself. Sorted nodes orders each column biggest first (nodeSort), which only Nivo and TanStack Charts also have an option for; Recharts (sort={false}), ECharts (layoutIterations: 0) and Chart.js (priority) keep an order you give them, so there you sum each node's flows and sort the nodes yourself. Thin nodes (nodeWidth, nodePadding) works everywhere.

Feature comparison​

FeatureUnovis1.8.0Recharts3.10.1Chart.js4.5.1ECharts6.1.0Nivo0.99.0AG Charts14.2.0Observable Plot0.6.17Vega-Lite6.5.0TanStack Charts1.1.0
Sankey
Chord diagram
Data labels
Label overlap avoidance
Animated data updates
Dark mode
RenderingSVGSVGSourceCanvasSourceCanvas or SVGSourceSVG, Canvas or HTMLSourceCanvasSourceSVGSourceCanvas or SVGSourceSVG or CanvasSource

Every cell links to its source. See how we compare for the rules we followed.