TemporaryGroupInsertionStage is useful if nodes should be treated by layout algorithms as if they were actually grouped without the need to manually create a grouped graph for the layout process.
Remarks
This stage converts given TemporaryGroupDescriptors into a valid, temporary grouping structure that is visible for the coreLayout and is obeyed by it if it supports grouped graphs.
This stage works as follows:
- A graph grouping is derived from the given temporary group descriptors . All nodes with the same descriptor are assigned to a newly created group node that is inserted into the graph.
- The coreLayout is executed. It works on the graph containing the inserted group nodes.
- The temporarily inserted group nodes are removed, restoring the original graph structure.
In case that the input graph is already grouped, the following should be noted:
- All nodes in a temporary group must be on the same hierarchy level, except for the case that group nodes are themselves part of the temporary group. However, if a group node is in a temporary group, then all its descendants need to be assigned to the same temporary group too. Otherwise, an exception is thrown.
- For hierarchically nested temporary groups, all nodes that belong to a group of this hierarchy have to be either contained within the same original group or no group at all. The resulting structure containing the original group nodes and temporary groups inserted by this stage is always hierarchically nested, i.e., there are no partly intersecting group nodes.
- The coreLayout sees both, the newly inserted groups and the old, existing ones and does not distinguish among them.
Type Details
- yFiles module
- algorithms
See Also
Constructors
Creates a new TemporaryGroupInsertionStage with the given layout algorithm as coreLayout.
Parameters
A map of options to pass to the method.
- coreLayout - ILayoutAlgorithm
- The core layout algorithm
- enabled - boolean
Properties
Gets or sets the core ILayoutAlgorithm that is wrapped by this stage.
Gets or sets a value that determines whether this stage should do anything but execute the coreLayout.
Remarks
By default, when constructed, stages should be enabled. Users may disable a stage's functionality by setting this property to false
.
Stages that can guarantee that the graph will not change can choose to not even execute the coreLayout when disabled.
Implements
Methods
Implementation of the ILayoutAlgorithm interface and main entry point for the layout calculation.
Remarks
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- The graph to apply the layout to.
Implements
Creates temporary group nodes based on the sub-graphs defined by the temporary group descriptors , executes the core layout algorithm, and, finally, removes the temporary group nodes.
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- the input graph
Implements
createLayoutData
(graph: LayoutGraph) : TemporaryGroupInsertionData<LayoutNode,LayoutEdge,LayoutNodeLabel,LayoutEdgeLabel>Returns an instance of LayoutData<TNode,TEdge,TNodeLabel,TEdgeLabel> that can be used to perform item-specific configurations for the TemporaryGroupInsertionStage.
Remarks
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- the graph that determines the generic type arguments of the created layout data
Returns
- ↪TemporaryGroupInsertionData<LayoutNode,LayoutEdge,LayoutNodeLabel,LayoutEdgeLabel>
- an instance of layout data that can be used to perform item-specific configurations for the given TemporaryGroupInsertionStage.
Returns an instance of LayoutData<TNode,TEdge,TNodeLabel,TEdgeLabel> that can be used to perform item-specific configurations for the TemporaryGroupInsertionStage.
Remarks
Parameters
A map of options to pass to the method.
- graph - IGraph
- the graph that determines the generic type arguments of the created layout data
Returns
- ↪TemporaryGroupInsertionData<INode,IEdge,ILabel,ILabel>
- an instance of layout data that can be used to perform item-specific configurations for the given TemporaryGroupInsertionStage.
LayoutExecutor
type is available at runtime.Constants
A data key that this stage uses for marking the inserted group nodes.
Remarks
true
is assigned to a group node if it was inserted by this stage, or false
otherwise.
The algorithm temporarily adds an IMapper<K,V> that is registered with this key and marks inserted group nodes. More precisely, for each inserted group node get returns true
. It is only available during the processing of this stage and automatically removed at the end.
A data key for specifying temporary groups of the input graph.