SankeyMATIC Manual

Topic Index

Syntax Reference

Term Definitions

Terms Examples

NodeName

A string of characters naming a unique Node. It can contain nearly anything, including emoji, with the exception of strings that look like an [Amount] or a #Color (see below).

Budget

2023/06 Amount

️🎉 Profit 🎉

[Amount]

An integer or decimal number greater than 0.

Use no commas or unit type indicators.

[17]

[209247.2712]

[Calculation]

A special symbol indicating that the Amount of a flow should be calculated automatically depending on the value of another Node.

Note: No calculation will result in a value less than 0.

  • [*] indicates that this flow should consume any amount from its source Node that is not being consumed by other flows.
  • [?] is the opposite of [*]: it indicates that this flow should provide any amount to its target Node that is not being provided by other flows.

See the section below on "Flows (Calculated)" for examples.

[*]

[?]

#Color

An HTML Color, in the form #rgb or #rrggbb (case insensitive).

For the specific precedence rules which will determine the color of each Flow and Node, see the Colors manual page.

#3cf

#009A00

.Opacity

A decimal suffix for a Color which controls the color's opacity.

Allowable values range from .0 (transparent) to .9999 (solid/opaque).

The default Flow Opacity is 0.45.

#3cf.3

#009A00.85

SankeyMATIC Input Line Types

Comments: // any content

  • Annotate your source data by starting a line with two slashes.
  • Comment lines are skipped and do not affect the diagram.
  • (Comments are also useful if you want to temporarily hide or disable a source line without deleting it.)

Example: // Source URL for this data: http://example.com/

Blanks:          

  • Blank lines are ignored. You can use them to separate sections of your source data, to make it easier to read.

Flows (with Amounts):

In each Flow line, Amount flows from the SourceNodeName to the TargetNodeName.

SourceNodeName [Amount] TargetNodeName = A basic Flow, using the default Flow Color & Opacity

SourceNodeName [Amount] TargetNodeName #Color = A Flow with a custom Color, using the default Flow Opacity

SourceNodeName [Amount] TargetNodeName #Color.Opacity = A Flow with a custom Color & Opacity

Examples:

Prior Cash On Hand [72954.53] Total Funds

  • This line means that 72,954.53 is flowing FROM “Prior Cash On Hand” TO “Total Funds”.
  • The default Flow Color and default Flow Opacity will be used.

Deficit Borrowing [366.6] 1993 Budget #990000

  • Indicates that 366.6 is flowing FROM “Borrowing to cover deficit” TO “1993 Budget
  • The Flow is colored dark red (#990000)
  • Uses the default Flow Opacity

Electricity grid [7.863] Rail transport #F90.7

  • Shows 7.863 flowing FROM “Electricity grid” TO “Rail transport
  • The Flow is colored orange (#F90)
  • The Flow’s Opacity is 0.7 (near-solid).

Flows (Calculated):

When a Flow uses a special calculation symbol * or ? in place of a literal Amount, its size is derived from one of the Nodes it is connected to.

  • [*] consumes any excess amount from its source Node.
  • [?] provides any missing amount to its target Node.

Examples:

A [10] B
B [6] C
[*] D

  • The flow from B to D will consume everything from node B which is not already flowing somewhere else.
  • In this case, the calculated result will be equivalent to B [4] D.

[?] C
B [4] C
C [10] D

  • The flow from A to C will provide everything to node C which is not already present in other Flows.
  • In this case, the calculated result will be equivalent to A [6] C.

In all other ways, calculated Flows behave like ordinary Flows — you can set their Color and Opacity in the same ways described above.

Node declarations:

Node declaration lines are optional. At this time they are only used to declare a custom color for a Node and (optionally) to paint the flows in/out of the Node with that color.

:NodeName #Color

Sets a custom Color for NodeName

:NodeName #Color >>

Paints all Flows FROM this Node with the same color

:NodeName #Color <<

Paints all Flows TO this Node with the same color

:NodeName #Color << >>

Paints all Flows TO and FROM this Node with the same color

Examples:

:Surplus Energy #090

  • The Node named “Surplus Energy” will be colored bright green (#090).

:Surplus Energy #090 >>

  • Any Flows FROM “Surplus Energy” will also be colored bright green, using the default Flow Opacity.

Topic Index