generateSankeyLayout function
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;
}