Layout Features Tutorial

Hierarchic Layout with Layer Constraints

This demo shows how to customize the assignment of nodes to layers (layering) when using the Hierarchic Layout.

Layer constraints

Nodes 9 is placed in the topmost layer with the placeAtTop method.

Nodes 7 is placed in the bottommost layer with the placeAtBottom method.

Nodes 0 is placed at least one layer below node 9 with the placeBelow method.

Nodes 2 is placed in the same layer as node 0 with the placeInSameLayer method.

Click the button in the toolbar to toggle between Hierarchic Layout with and without configured constraints.

Code Snippet

You can copy the code snippet to configure the layout from GitHub.

Demos

See the Layer Constraints demo for a more elaborate example of the constraints functionality.

Documentation

See the Constrained Node Sequencing section in the Developer's Guide for an in-depth discussion of the relevant concepts.

See the LayerConstraintData API documentation for detailed information on all available constraints.