Incremental Hierarchical Layout
This demo shows how to run the hierarchical layout algorithm on a predefined subset of
nodes (and edges) in a graph.
To achieve this, two setup steps are necessary:
First, the algorithm has to be told to work on a subset only. To do so,
HierarchicalLayout's
from sketch mode property has to be set to
true
.
Second, the algorithm has to be told which set of nodes (and edges) to rearrange. The
class HierarchicalLayoutData offers the property
incrementalNodes and
incrementalEdges for this
purpose.
In this demo, the algorithm works on the subset of
turquoise nodes only.
Click the button in the toolbar to run the layout and see the effect.
Code Snippet
You can copy the code snippet to configure the layout from
GitHub.
Demos
You can also take a look at more extensive demos that take advantage of this feature:
Documentation
The Developer's Guide has detailed information about the
hierarchical layout algorithm in general and
about
how to run the algorithm on a subset of nodes
specifically.