Remarks
Incremental hints can be used for specifying how a subset of nodes (called incremental nodes) should be added to an existing graph layout. They allow defining how much nodes may change.
The INCREMENTAL hint specifies that both a node's layer and its position within the layer are freely determined.
Nodes with other hints are called non-incremental or sketch-based. Their original coordinates are considered at least to some degree. There are multiple types of sketch-based nodes. The hints FROM_SKETCH and KEEP_RELATIVE_ORDER consider relative locations. The EXACT_COORDINATES hint additionally tries to keep the node on the exact input coordinates.
The INCREMENTAL_WITH_LAYERS_FROM_SKETCH hint has both incremental and sketch-based aspects. It specifies that the algorithm should consider the current layer of a node while in the sequencing phase its position within the layer is freely determined.
To define a collection of incremental nodes, use layout data property HierarchicalLayoutData<TNode, TEdge, TNodeEdge, TNodeLabel, TEdgeLabel>.incrementalNodes. To define a more fine-grained mapping of nodes to hints, use the property HierarchicalLayoutData<TNode, TEdge, TNodeEdge, TNodeLabel, TEdgeLabel>.incrementalNodeHints.
This class cannot be instantiated
See Also
Developer's Guide
API
- IncrementalEdgeHint
Members
Properties
Methods
Constants
A hint for a node that should be placed at its current coordinates if possible.
Nodes with this hint may be moved from their current coordinates if this is necessary to ensure minimum distances between graph elements, to get a valid grouping structure, or to adhere to the LayoutGrid structure.
This predefined hint considers both layer and sequence coordinates (x and y), does not allow distance violations, and does not allow node overlaps. To create a hint with a different configuration (e.g., allow distance violations), use factory method createExactCoordinatesHint.
As for nodes with hint FROM_SKETCH, the algorithm uses the HierarchicalLayoutCore.fixedElementsLayerAssigner instance to determine the layer of such nodes and the HierarchicalLayoutCore.fixedElementsSequencer instance to determine the position within the layer. By default, both implementations use the current coordinates of the nodes to derive the layer/position. However, for nodes marked with this hint, the algorithm should also preserve the exact coordinates if this is possible.
See Also
Developer's Guide
API
- createExactCoordinatesHint
A hint that a node should keep the relative layer and sequence order like KEEP_RELATIVE_ORDER, and additionally the algorithm tries to preserve more relations to other sketch nodes.
This is the default hint applied when running the algorithm with HierarchicalLayout.fromSketchMode enabled, but not defining another hint for a node.
The following relationships are preserved if possible without violating general constraints of the hierarchical layout.
- Separation: Nodes that are close to one another but do not overlap w.r.t. their sequence coordinates remain separated.
- Straight edges: If two nodes are connected by a straight edge whose ports have the same sequence coordinate in the sketch, the relative position of those nodes to one another is preserved.
This means the layout algorithm should not treat the corresponding element as an incrementally added element.
See Also
Developer's Guide
A hint that a node should be inserted incrementally during the layering phase and subsequently the position inside the layer is freely determined by the sequencing phase.
This will place the node in a suitable layer, possibly creating new layers.
To only insert a node incrementally and freely during the sequencing phase but keep the layering stable, hint INCREMENTAL_WITH_LAYERS_FROM_SKETCH can be defined instead.
Neighbors of this node may also be marked such that they are laid out incrementally. This makes it possible to incrementally add whole subgraphs to the current layout.
See Also
Developer's Guide
A hint for a group node that should be inserted incrementally during the layering phase.
The group will be placed in a suitable position. The non-group descendants of the group may be INCREMENTAL or INCREMENTAL_WITH_LAYERS_FROM_SKETCH. Inner group nodes may get this incremental group hint as well.
All hints of the descendants of a group are interpreted relative to the group node. Descendants that are not incremental maintain their relative order within the group node (but not with elements outside the group).
The positions of groups without this hint depend on the position of their descendants (i.e., the group itself has no explicit positioning behavior - it adapts to its descendants).
See Also
Developer's Guide
A hint for a node that should be inserted incrementally during the sequencing phase but stay on its current layer, that is, layered based on the sketch.
See Also
Developer's Guide
A hint that a node should keep the relative layer and sequence order fixed with respect to other nodes.
See Also
Developer's Guide