generateSankeyLayout function

Sankey generateSankeyLayout({
  1. double width = 1000,
  2. double height = 600,
  3. double nodeWidth = 20,
  4. double nodePadding = 15,
})

Generates a configured Sankey layout engine

The width and height parameters define the drawing area dimensions nodeWidth is the width of each node, and nodePadding sets the space between nodes The returned Sankey object is pre-configured with the specified dimensions and properties for use in computing the layout

Example:

final sankey = generateSankeyLayout(
  width: 1000,
  height: 600,
  nodeWidth: 20,
  nodePadding: 15,
);

Implementation

Sankey generateSankeyLayout({
  double width = 1000,
  double height = 600,
  double nodeWidth = 20,
  double nodePadding = 15,
}) {
  return Sankey()
    ..nodeWidth = nodeWidth
    ..nodePadding = nodePadding
    ..x0 = 0
    ..y0 = 0
    ..x1 = width
    ..y1 = height;
}