Diagrams / Mermaid Sankey Diagram: Syntax & Examples
Mermaid Sankey Diagram: Syntax & Examples
Create a Mermaid Sankey diagram from source, destination and quantity rows. Check units and totals with an editable flow example before exporting.
When to use Sankey Diagram
Use a Mermaid Sankey diagram to show quantities moving between categories. Flow widths help readers see how an amount splits or combines. Define one unit throughout the diagram and distinguish actual transfers from correlations or simple relationships.
- Start with the example in the editor and identify the elements that answer your question.
- Replace the sample labels and values, previewing after each structural change.
- Review the diagram at its intended reading size, then keep the source and export the format your document accepts.
Read the Sankey Diagram example
Diagram source
sankey-beta
Input,Useful work,70
Input,Heat loss,20
Input,Other loss,10Syntax and interpretation
| Concept | How to apply it |
|---|---|
| Rows | Each row supplies a source, destination, and numeric quantity. Keep node names consistent across rows. |
| Accounting | Check totals at intermediate nodes. An unexplained mismatch can mislead readers about conservation or missing categories. |
| Scope | Avoid too many small flows. A detailed accounting table can accompany a simpler diagram. |
Common questions
Is a Sankey appropriate for ordinary dependencies?
Usually not. Sankey widths imply quantities. Use a flowchart or architecture diagram when relationships have no meaningful amount attached.