- I
- I
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:
- 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.
- 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.
- 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
| Name | Default | Description |
|---|---|---|
| coreLayout | null | |
| interEdgeRouter | null | Inter-edges are routed as straight lines. |
| nodeLabelPlacement | BasicNodeLabelPlacement.CONSIDER | Node labels are included in the bounds of the grid cells. |
| splitMultiCellComponents | true | Components with nodes of different layout grid cells are split. |
See Also
Developer's Guide
API
- LayoutGrid
Members
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.
Property Value
Default Value
Defined in
LayoutStageBase.coreLayoutGets or sets whether or not to take edge labels into account when calculating the bounds of the layout grid cells.
Property Value
Default Value
See Also
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.
Defined in
LayoutStageBase.enabledGets or sets the current edge routing algorithm for handling inter-edges.
Property Value
null if edges are routed as straight linesDefault Value
Gets or sets whether or not to take node labels into account when calculating the bounds of the layout grid cells.
Property Value
Default Value
See Also
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.
Property Value
true if connected components with nodes of different layout grid cells are split, false otherwiseDefault Value
Methods
Implementation of the ILayoutAlgorithm interface and main entry point for the layout calculation.
Parameters
- graph: LayoutGraph
- The graph to apply the layout to.
Defined in
LayoutStageBase.applyLayoutStarts the layout.
createLayoutData
(graph: LayoutGraph): GenericLayoutGridStageData<LayoutNode, LayoutEdge, LayoutNodeLabel, LayoutEdgeLabel>Returns an instance of LayoutData<TNode, TEdge, TNodeLabel, TEdgeLabel> that can be used to perform item-specific configurations for the GenericLayoutGridStage.
createLayoutData
(graph: LayoutGraph): GenericLayoutGridStageData<LayoutNode, LayoutEdge, LayoutNodeLabel, LayoutEdgeLabel>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.
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.
true and regular edges as false.