Generate Sankey diagrams to visualize flow and distribution of data. Part of the DevTools Surf developer suite. Browse more tools in the Data / SQL collection.
Use Cases
Visualize customer journey flows through a funnel from acquisition to conversion.
Show national or organizational energy consumption from sources to end uses.
Map budget allocation from departments to projects and line items.
Display user flow through an application from entry points to key actions.
Tips
Order source nodes by total flow volume — largest flows at the top — to make the diagram readable without visual crossing.
Use meaningful node labels, not internal IDs — Sankey diagrams are primarily a communication tool, not an analysis tool.
Keep the diagram to 4–6 layers maximum; more layers create visual complexity that obscures the flow story.
Fun Facts
The Sankey diagram was named after Irish engineer Matthew Henry Phineas Riall Sankey, who created one in 1898 to show energy losses in a steam engine — it is still cited as the canonical example.
Charles Minard's 1869 map of Napoleon's Russian campaign, often called 'the best statistical graphic ever drawn,' combines a Sankey flow with geographic and temporal data on a single chart.
Sankey diagrams became widely used in energy analysis in the 1970s during the oil crisis, when governments needed to visualize national energy flows from source to consumption.
FAQ
What data format does a Sankey diagram require?
A list of directed links with source, target, and value fields. Each row represents a flow quantity between two nodes. Nodes are inferred from the unique source and target values.
When is a Sankey diagram the wrong choice?
When you have too many nodes (more than 15–20 creates visual noise), when flows are circular (Sankeys assume directed acyclic graphs), or when precise values matter more than proportional visual comparison.