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:

  1. Initialize node links
  2. Compute node values based on incoming and outgoing flows
  3. Assign horizontal positions (depths/layers)
  4. Compute node heights (reverse assignment via incoming links)
  5. Position nodes vertically
  6. Compute the widths of the links
  7. Return a SankeyGraph containing the positioned nodes and links

The bounds of the layout are defined by [leftBound, topBound] and [rightBound, bottomBound], while nodeWidth and nodePadding determine the size and spacing of nodes

Constructors

Sankey({double leftBound = 0, double topBound = 0, double rightBound = 1, double bottomBound = 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
bottomBound double
Bottom edge of the layout area
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
iterations int
getter/setter pair
leftBound double
Left edge of the layout area
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
rightBound double
Right edge of the layout area
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
topBound double
Top edge of the layout area
getter/setter pair

Methods

layout(List<SankeyNode> nodes, List<SankeyLink> links) SankeyGraph
Computes the layout for the given nodes and links 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