Sankey class
A Sankey layout generator that computes the positions and dimensions for the nodes and links in a Sankey diagram
The layout algorithm follows several steps:
- Initialize node links
- Compute node values based on incoming and outgoing flows
- Assign horizontal positions (depths/layers)
- Compute node heights (reverse assignment via incoming links)
- Position nodes vertically
- Compute the widths of the links
- Return a SankeyGraph containing the positioned nodes and links
The bounds of the layout are defined by [x0, y0]
and [x1, y1]
,
while nodeWidth
and nodePadding
determine the size and spacing of nodes
Constructors
- Sankey.new({double x0 = 0, double y0 = 0, double x1 = 1, double y1 = 1, double nodeWidth = 24, double nodePadding = 8, NodeAlign? align, int iterations = 6, int nodeSort(SankeyNode a, SankeyNode b)?, int linkSort(SankeyLink a, SankeyLink b)?})
- Creates a Sankey layout generator with customizable bounds, node sizing, alignment, and iteration count
Properties
- align ↔ NodeAlign
-
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- iterations ↔ int
-
getter/setter pair
- linkSort ↔ int Function(SankeyLink a, SankeyLink b)?
-
getter/setter pair
- nodePadding ↔ double
-
getter/setter pair
- nodeSort ↔ int Function(SankeyNode a, SankeyNode b)?
-
getter/setter pair
- nodeWidth ↔ double
-
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- x0 ↔ double
-
getter/setter pair
- x1 ↔ double
-
getter/setter pair
- y0 ↔ double
-
getter/setter pair
- y1 ↔ double
-
getter/setter pair
Methods
-
layout(
List< SankeyNode> nodes, List<SankeyLink> links) → SankeyGraph -
Computes the layout for the given
nodes
andlinks
and returns a SankeyGraph containing the computed positions -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited