Example Input
Example Output
1. Basic Sankey Diagram
// this is a comment and completely ignored // each diagram-flow is specified in the format: // "SOURCE [AMOUNT] TARGET" source [100] target source two [30] target target [65] target two
- You can specify one flow per line.
- SOURCE_NODE [AMOUNT] TARGET_NODE is the basic syntax for a flow / link.
- Lines starting with a "//" are treated as comments and completely ignored in the output.
- Names are case-sensitive. ("a" is treated different as "A")
2. Auto-Calculating Flow Amounts ([?]-operator)
salary [20] budget // the "?" operator automatically sums-up all outgoing values budget [?] groceries groceries [3] vegetables groceries [?] fruits fruits [10] apples fruits [5] bananas
- You can use "[?]" as the amount to automatically sum-up all the outgoing amounts of this flow.
- You can chain multiple "[?]" as long as there are some numeric values to sum-up in the end.
3. Sankey Diagram with Custom Colors
source red1 [100] target [red] source red2 [10] target [red] source red3 [10] target [red] source green [30] target [green] target [65] target orange [orange] target [20] target pink [#f1337f]
- You can optionally specify a custom color for each flow.
- Colors are specified at the end of each line inside square-brackets.
- You can use a set of common pre-defined color names like "red", "blue", "green", or even enter custom hex-color-codes like "#FF0000".
- Find a list of all supported shorthand color names here: list of css color names with hex codees
4. Sankey Diagram with Loops
// sankeys may have loops a [10] b b [10] c c [5] b c [5] d
- Loops referencing previous nodes are allowed.
5. Color Flows Based on Source's First Word
source one [10] target one source two [10] target one source three [10] target one source three [5] middle middle [2.5] target two middle [2.5] end target one [10] target two target one [10] target three target one [10] target four target two [15] target five target three [10] target five target four [10] target five
- If the setting "Pick color based on first word only" is checked, all flows where the source starts with the same word, will have the same color.
By using SankeyDiagram.net as a Sankey Chart creator, you can easily create Sankey Charts without sign-up for free.
If you want to know what exactly Sankey Diagrams / Sankey Charts are, read "What is a Sankey Diagram" and find out more about this useful data-visualization method.