C

GenericLayoutGridStage

This stage offers generic support for LayoutGrid structures so that a grid can be considered even when running a layout algorithm that natively does not support it.

Remarks

It is not required to apply this stage when executing a layout algorithm that already supports the LayoutGrid natively, for example, HierarchicalLayout, OrganicLayout or EdgeRouter.

The stage performs the following steps:

  1. First it determines sub-components such that each component only contains nodes associated with the same grid cell. Nodes without associated grid cell are temporarily assigned to a suitable cell.
  2. Now this stage applies the specified coreLayout to each sub-component and, afterwards, reassembles the global layout grid structure. Since the sub-components do not contain nodes of different cells, the core layout algorithm doesn't require support for layout grid on its own.
  3. Finally, this stage routes edges that connect nodes of different sub-components by means of the specified inter-edge router. Note that such edges are temporarily hidden during the core layout runs.

Disabling property splitMultiCellComponents allows to switch to a mode where connected components are not split into smaller sub-components. Hence, a component may contain nodes of different grid cells and, thus, the specified coreLayout has to support layout grid structures by itself. In this case, this stage doesn't offer a generic layout grid support (since the core layout algorithm already has to support such structures). Instead it may speed up the layout calculation since the core layout algorithm is applied to different smaller graphs instead of a single, larger input graph.

Default Values of Properties

NameDefaultDescription
coreLayoutnull
interEdgeRouternull
Inter-edges are routed as straight lines.
nodeLabelPlacementBasicNodeLabelPlacement.CONSIDER
Node labels are included in the bounds of the grid cells.
splitMultiCellComponentstrue
Components with nodes of different layout grid cells are split.

See Also

Developer's Guide

API

LayoutGrid

Members

Show:

Constructors

Creates a new instance using the given 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 whether or not to take edge labels into account when calculating the bounds of the layout grid cells.
The labels are only considered if option splitMultiCellComponents is enabled. Otherwise, the proper calculation of the layout grid cell box is up to the coreLayout.
conversionfinal

Property Value

CONSIDER if edge labels are taken into account, IGNORE otherwise

Default Value

The default value is: BasicEdgeLabelPlacement.CONSIDER
Edge labels are included in the bounds of the grid cells.

See Also

API
splitMultiCellComponents
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
Gets or sets the current edge routing algorithm for handling inter-edges.
If option splitMultiCellComponents is enabled, components that contain nodes associated with different LayoutGridCellDescriptors are split into sub-components. Edges that connect nodes of different sub-components are called inter-edges and routed with this edge routing algorithm.
If no router is set, all inter-edges are routed as straight lines.
final

Property Value

the edge routing algorithm for inter-edges or null if edges are routed as straight lines

Default Value

The default value is: null
Inter-edges are routed as straight lines.
Gets or sets whether or not to take node labels into account when calculating the bounds of the layout grid cells.
The labels are only considered if option splitMultiCellComponents is enabled. Otherwise, the proper calculation of the layout grid cell box is up to the coreLayout.
conversionfinal

Property Value

CONSIDER if node labels are taken into account, IGNORE otherwise

Default Value

The default value is: BasicNodeLabelPlacement.CONSIDER
Node labels are included in the bounds of the grid cells.

See Also

API
splitMultiCellComponents
Gets or sets whether or not the algorithm should split connected components that have nodes associated with different layout grid cells.

If this option is enabled, such components are split into sub-components that only include nodes associated with the same grid cell. Hence, the coreLayout doesn't see the LayoutGrid at all. Edges that connect nodes of different sub-components are temporarily hidden and routed afterwards by means of the inter-edge router.

If this option is disabled, the layout algorithm determines independent components and calls the coreLayout for each of them. Note that two connected components are only independent if there is no group node that contains a node of each of them and if the two sub-layout grids induced by the connected components do not have a common LayoutGridColumn or LayoutGridRow. The core layout algorithm is called once for each independent component and, thus, has to support layout grid structures.

If this option is disabled, the coreLayout has to support layout grid structures by itself.
final

Property Value

true if connected components with nodes of different layout grid cells are split, false otherwise

Default Value

The default value is: true
Components with nodes of different layout grid cells are split.

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.
Starts the layout.
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 GenericLayoutGridStage.
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

GenericLayoutGridStageData<LayoutNode, LayoutEdge, LayoutNodeLabel, LayoutEdgeLabel>
an instance of layout data that can be used to perform item-specific configurations for the given GenericLayoutGridStage.
Returns an instance of LayoutData<TNode, TEdge, TNodeLabel, TEdgeLabel> that can be used to perform item-specific configurations for the GenericLayoutGridStage.
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

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

See Also

Developer's Guide

Constants

An IMapper<K, V> key for marking the inter-edges to be routed.
If a settable IMapper<K, V> is registered with this key, this stage uses that map to mark inter-edges as true and regular edges as false.
static