SankeyMATIC Manual

Syntax Reference

Term Definitions

[Amount]:

An integer or decimal number greater than 0.

Use no commas or unit type indicators.

Examples: [17]; [10.456]; [2039247.2].

#Color:

An HTML Color, in the form #RGB or #RRGGBB

Examples: #3CF, #009A00

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

NodeName:

A string of characters that can contain nearly anything except:

  • strings that look like an [Amount]
  • strings that look like a #Color

.Opacity:

A decimal fragment which controls an item’s transparency/opacity.

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

The default Flow Opacity is 0.4.

SankeyMATIC Source Data Syntax

Flow Definition Lines:

Syntax for a basic Flow:

Source NodeName [Amount] Target NodeName

  • Amount flows from the Source NodeName to the Target NodeName, using the default Flow Color and default Flow Opacity (as specified in the “Colors” control section).

Example: Prior Cash On Hand [72954.53] Total Funds

  • Shows 72,954.53 flowing:
    • FROM the Node “Prior Cash On Hand” TO the Node “Total Funds”
    • Uses the default Flow Color and Flow Opacity

Syntax for a Flow with a custom Color:

Source NodeName [Amount] Target NodeName #Color

  • Amount flows from Source NodeName to Target NodeName, using the specified Color and the default Flow Opacity (as specified in the “Colors” control section).

Example: Borrowing to cover deficit [366.6] 1993 Budget #990000

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

Syntax for a Flow with a custom Color and custom Opacity:

Source NodeName [Amount] Target NodeName #Color.Opacity

  • Amount flows from Source NodeName to Target NodeName, using the specified Color and the specified Opacity.

Example: Electricity grid [7.863] Rail transport #F90.7

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

:NodeName #Color

  • Set the Color for a specific Node (referenced by NodeName).

Example: :Surplus Energy #090

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

:NodeName #Color >>

  • Set a Node’s Color and use the same color for all Flows FROM the Node.

:NodeName #Color <<

  • Set a Node’s Color and use the same color for all Flows TO the Node.

:NodeName #Color << >>

  • Set a Node’s Color and use the same color for all Flows TO AND FROM the Node.

Example: :Surplus Energy #090 >>

  • The Node named “Surplus Energy” will be colored bright green (#090).
  • Any Flows FROM the Node named “Surplus Energy” will also be colored bright green, using the default Flow Opacity.
Additional Line Types:

Comment line:

// 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 a source line without deleting it.)
  • Note: The comment indicator used to be a single quote mark, not two slashes.
    A single quote mark will still act as a comment indicator today, but is not guaranteed to work in the future.

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

Blank line:

         
  • Blank lines are ignored.
  • Use blank lines to separate sections of your source data to make it easier to read.