Basic Examples (3)
A simple diamond-shaped flow network: one source splits two ways, then re-merges:
A many-to-one-to-many network: four power sources feed a single grid hub, which fans out to four consumer categories:
A four-layer manufacturing network (raw materials -> processing -> assembly -> products), with cross-wiring between layers:
Scope (3)
SankeyChart will interpret a square matrix of integers as a WeightedAdjacenecyGraph, with zero or Infinity indicating no flow. The vertices will be labeled 1,2,…,n unless you provide a "VertexLabels":
SankeyChart can also accept OptimimFlowData objects generated by FundMaximalFlow:
"Backflow" is supported:
Options (20)
EdgeOrigin (1)
Controls which side sources are drawn on -- Left, Right, Top, or Bottom -- and hence which direction flow travels across the page:
"VertexLabelPosition" (2)
By default only the vertex name is shown (centered) but "VertexLabelPosition" can take values None, Above, Below, Top, Bottom or a number:
"VertexLabelPositon" can also take a second value for the alternate dimension:
VertexValuePosition (1)
The value of the vertex flow can be placed with the same settings as VertexLabelPosition:
EdgeValuePosition (1)
Label edges with the value of the flow through it.
The values Above, Below, Top, Bottom, Center, None and numerical values are supported, as well as {val1,val2} pairs:
VertexSpacing (1)
The fraction of each column's rendered height taken up by gaps between its vertices:
VertexColors (3)
The color of vertices and the corresponding outflows are controlled by "VertexColors".
A list of colors can be provided:
A named color theme from ColorData can be used:
A numbered "Indexed" color theme can be used from ColorData:
VertexRenderingFunction (1)
A custom Function[{centerX, centerY, width, height}, …] can draw each vertex as something other than a rectangle; the color set by "VertexColors" is prepended automatically:
EdgeOffset (1)
The edge flows meet behind the vertex but you can choose to space them around the vertex:
VertexLabels (2)
When the input is a matrix, vertices are labelled by the index number. You can override those with "VertexLabels":
"VertexLabels" can be used to specify more complex labels that can be specified by "LabelStyle":
LayerSpacing (2)
The coordinate system places vertices at integer x-positions with y-values that correspond to the flow values:
Space the vertices differently with "LayerSpacing":
VertexWidth (1)
Control the width of vertices:
OrderIterations
SankeyChart attempts to minimize the times that flows cross over each other. In complex graphs this can take time. "OrderIterations" limits the computation. The default is 8 iterations but any integer value can be used.
EdgeOpacity (1)
Outflow edges are colored the same as their source vertex but are distinguished by Opacity:
LabelStyle (1)
Control the appearance of text labels:
VertexPositions (2)
Vertices are placed automatically:
But one or more can be placed manually:
Possible Issues (1)
Vertices with only outflow are treated as sources, vertices with only inflow are treated as destinations. All other vertices must have balanced inflow and outflow must match. For example this graph has an inflow of 5 and an outflow of 10 on vertex 2: