C

TemporaryGroupInsertionStage

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:

  1. 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.
  2. The coreLayout is executed. It works on the graph containing the inserted group nodes.
  3. 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.

Default Values of Properties

NameDefault
coreLayoutnull

See Also

Developer's Guide

API

temporaryGroups, TemporaryGroupDescriptor, INSERTED_GROUP_NODE_DATA_KEY

Members

Show:

Constructors

Creates a new TemporaryGroupInsertionStage with the given layout algorithm as coreLayout.

Parameters

coreLayout?: ILayoutAlgorithm
The core layout algorithm

Properties

Gets or sets the core ILayoutAlgorithm that is wrapped by this stage.
final

Property Value

the core layout routine

Default Value

The default value is: null
Gets or sets a value that determines whether this stage should do anything but execute the coreLayout.

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.

final

Methods

Implementation of the ILayoutAlgorithm interface and main entry point for the layout calculation.
This implementation checks the enabled state and when it's not enabled, will delegate to the coreLayout, directly. When the stage is enabled, all the work will be delegated to applyLayoutImpl, instead.
final

Parameters

graph: LayoutGraph
The graph to apply the layout to.
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.
protected

Parameters

graph: LayoutGraph
the input graph
Returns an instance of LayoutData<TNode, TEdge, TNodeLabel, TEdgeLabel> that can be used to perform item-specific configurations for the TemporaryGroupInsertionStage.
The generic type arguments of the created layout data are compatible with instances of LayoutGraph, but the layout data is not bound to a specific graph instance. Therefore, the created layout data still has to be passed as an argument of applyLayout in order to be applied.

Parameters

graph: LayoutGraph
the graph that determines the generic type arguments of the created layout data

Return Value

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.
The generic type arguments of the created layout data are compatible with instances of IGraph, but the layout data is not bound to a specific graph instance. Therefore, the created layout data still has to be passed as an argument of applyLayout in order to be applied.
This method is not available unless the module view-layout-bridge is loaded. Either load the module 'view-layout-bridge' explicitly or ensure that the LayoutExecutor type is available at runtime.

Parameters

graph?: IGraph
the graph that determines the generic type arguments of the created layout data

Return Value

TemporaryGroupInsertionData<INode, IEdge, ILabel, ILabel>
an instance of layout data that can be used to perform item-specific configurations for the given TemporaryGroupInsertionStage.

Constants

A data key that this stage uses for marking the inserted group nodes.

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.

static