Markdown Sankey diagram maker
Show how quantities flow between stages with a Sankey diagram. Describe the links and weights in Mermaid to visualise budgets, energy or traffic.
Mermaid Sankey syntax
A Sankey diagram is a list of flows written as comma-separated rows: source, target and a number. The band width follows the number. Here is each piece you can write.
Flows
Write each flow as source, target and a value on its own line.
You write
sankey-beta
Salary,Housing,1200
Salary,Food,600
Salary,Savings,400
You get
Chaining flows
Use a name as a target and again as a source to carry a flow onward.
You write
sankey-beta
Salary,Savings,400
Savings,Stocks,250
Savings,Bonds,150
You get
Cheat sheet
| Write this | You get |
|---|---|
sankey-beta | Start a Sankey diagram |
| blank line | Leave one blank line after the header |
Source,Target,10 | A flow of size 10 from source to target |
| reuse a name | Use a target as a later source to chain flows |