layout method

SankeyGraph layout(
  1. List<SankeyNode> nodes,
  2. List<SankeyLink> links
)

Computes the layout for the given nodes and links and returns a SankeyGraph containing the computed positions

The layout algorithm performs internal steps such as establishing node links, computing node values, assigning depths and heights, distributing nodes horizontally and vertically, and finally computing link positions

Implementation

SankeyGraph layout(List<SankeyNode> nodes, List<SankeyLink> links) {
  _computeNodeLinks(nodes, links);
  _computeNodeValues(nodes);
  _computeNodeDepths(nodes);
  _computeNodeHeights(nodes);
  _computeNodeBreadths(nodes);
  _computeLinkBreadths(nodes);
  return SankeyGraph(nodes: nodes, links: links);
}