Layout Features Tutorial

Recursive Group Layout

This demo shows how to use the Recursive Group Layout.

The Recursive Group Layout algorithm recursively traverses a hierarchically organized graph in a bottom-up fashion and applies a specified layout algorithm to the contents (direct children) of each group node.

In this demo for every group node a different layout algorithm is used:

  • Hierarchic Layout for group node 1
  • Organic Layout for group node 2
  • Radial Layout for group node 3
  • RecursiveGroupLayout#NULL_LAYOUT for group node 4

As the child nodes of group node 4 already have fixed layout values in the graph source, RecursiveGroupLayout#NULL_LAYOUT is used, as it does not alter the layout of the child nodes and is only used to calculate the size of the group node itself.

The content of groups without an assigned layout algorithm and the toplevel hierarchy is arranged with the core layout algorithm, if one has been specified.

The configuration of which algorithm to use for which group node is done by setting an Item Mapping to the groupNodeLayouts property of RecursiveGroupLayoutData.

Code Snippet

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

Demos

You can also take a look at the Recursive Group Layout demo for more elaborate applications of this layout algorithm..