Layout class sealed

How to lay out a graph: one of five layouts, each with its own options.

await controller.layout(Layout.tree(direction: TreeDirection.right));

Every layout keeps pinned (locked) nodes where they are and places the other nodes around them. gap is the minimum clearance between nodes.

Constructors

Layout.circular({double? radius, double gap = 60})
Nodes on one circle, in input order. A null radius is the smallest that keeps gap between neighbours.
factory
Layout.force({int iterations = 300, double gap = 60})
A force-directed layout of iterations simulation steps, with at least gap between nodes.
factory
Layout.grid({int? columns, int? rows, GridFlow flow = GridFlow.rows, double gap = 60, double? rowGap, double? columnGap, Map<String, GridCell> cells = const {}})
Nodes in grid cells that fill in flow order, wrapping after columns cells of a row or rows cells of a column. Rows and columns size to their largest node. cells places nodes by id in a row, a column or a cell; the others fill the free cells.
factory
Layout.layered({LayoutDirection direction = LayoutDirection.down, double gap = 60, double layerGap = 100})
A layered (Sugiyama) layout: nodes on layers along direction, edge crossings reduced, gap between nodes of a layer and layerGap between layers.
factory
Layout.tree({TreeDirection direction = TreeDirection.down, double gap = 60, double levelGap = 100})
A tidy tree: each parent centred over its children, subtrees packed without overlap, gap between siblings and levelGap between levels. TreeDirection.radial places the levels on concentric rings.
factory

Properties

gap → double
The minimum clearance between nodes.
final
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

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