- I
Remarks
Layout Style
The nodes are placed based on an underlying LayoutGrid structure. Only nodes are arranged, edges are not routed, but their bend points are cleared. Therefore, this algorithm is suitable if nodes should be arranged in rows and columns in a regular fashion.
8 nodes organized in a 3x3 grid
8 nodes organized in a 2x6 grid with some gaps (empty cells)
Concept
The table consists of LayoutGridCellDescriptors which form rows and columns. Each cell contains a single node or might also be empty. Note that it is not required that the input graph already contains a LayoutGrid for this algorithm to properly work. It is, however, useful if the resulting row and column geometry should be retrieved (e.g. to visualize the table). It is mandatory to register a LayoutGrid when using layout policy FIXED_SIZE.
Rows/columns do not overlap and are not compacted: nodes that belong to different rows are strictly separated with respect to the covered y-coordinate range and nodes that belong to different columns are strictly separated with respect to the covered x-coordinate range.
Features
It is possible to define in which cell of the table a certain node should be placed when using policy FIXED_SIZE. See the policy documentation for more details.
The algorithm considers the following properties associated with LayoutGridRows and LayoutGridColumns of a LayoutGrid registered with the input graph:
Group nodes are supported but only top-level groups are handled like an actual node in the table. The content of top-level groups is kept fixed. That means that the content keeps the relative location with respect to the top-level group but it is not recursively arranged in a tabular fashion. To achieve recursive layouts where the content is a tabular layout too, use RecursiveGroupLayout with TabularLayout as core layout algorithm. Generally, it is recommended that group nodes already have proper bounds enclosing all content (and their labels). Otherwise, overlaps may occur, as group node sizes are not changed by this algorithm. RecursiveGroupLayout with FIX_CONTENT_LAYOUT as core algorithm can be used to recursively assign group node sizes.
Layout Stages
This class provides a configurable pipeline that contains various ILayoutStages. Each ILayoutStage can incorporate preprocessing or postprocessing steps into the layout calculation to streamline the input graph and enhance the resulting layout. Additionally, custom ILayoutStages can be added and executed either before or after the predefined ones.
The following default ILayoutStages are included:
- GenericLabeling: Efficiently places node and edge labels. The property fillEmptyScope is set to
falseand stopDuration is set to ZERO.
With these layoutStages the layout algorithm is configured well, so they usually don't need to be changed.
Default Values of Properties
| Name | Default | Description |
|---|---|---|
| considerEdges | false | Edges are not considered. |
| defaultNodeDescriptor | TabularLayoutNodeDescriptor | Descriptor instance with default settings. |
| edgeLabelPlacement | TabularLayoutEdgeLabelPlacement.GENERIC | Edge labels are placed by an independent labeling algorithm. |
| layoutMode | TabularLayoutMode.AUTO_SIZE | |
| nodeLabelPlacement | NodeLabelPlacement.CONSIDER | Node labels are considered. |
| stopDuration | TimeSpan.MAX_VALUE | The layout algorithm runs unrestricted. |
See Also
Developer's Guide
API
- LayoutGrid
Members
Constructors
Initializes a new instance of the TabularLayout class with default settings.
Parameters
Properties
Property Value
true if edges should be considered, false otherwiseDefault Value
Sample Graphs
true - edges are consideredSee Also
Developer's Guide
API
- layoutMode, freeNodeComparator
Gets or sets the TabularLayoutNodeDescriptor instance that defines settings for those nodes that do not have an individual descriptor specified.
Property Value
Throws
- Exception ({ name: 'ArgumentError' })
- if the specified descriptor is
null
Default Value
See Also
Developer's Guide
API
- nodeDescriptors
Gets or sets how the layout handles the position of edge labels.
Property Value
Default Value
See Also
Developer's Guide
Gets the GenericLabeling helper class from the layoutStages of this instance.
Throws
- Exception ({ name: 'InvalidOperationError' })
- If there is no instance of the respective type in the layoutStages
Gets or sets the policy defining the size of the resulting tabular layout and the mapping of the nodes to the table cells.
- AUTO_SIZE: no LayoutGrid instance required. The size of the table is chosen automatically and nodes are sorted using a comparison function specified with property freeNodeComparator.
- FIXED_SIZE: requires a registered LayoutGrid instance that defines the size of the tabular layout and, optionally, the mapping of nodes to specific cells.
- FROM_SKETCH: no LayoutGrid instance required. The size of the table and the positioning of the nodes is solely derived from the coordinates of the input graph (sketch).
Property Value
Default Value
See Also
Developer's Guide
Gets or sets how the layout handles the position of node labels.
Property Value
Default Value
Sample Graphs
See Also
Developer's Guide
Gets or sets the time limit set for the layout algorithm.
Property Value
Throws
- Exception ({ name: 'ArgumentError' })
- if the stop duration is negative
Default Value
Methods
Calculates a tabular layout of the graph.
Parameters
- graph: LayoutGraph
- the input graph
Implements
ILayoutAlgorithm.applyLayoutArranges the input graph in a tabular fashion.
createLayoutData
(graph: LayoutGraph): TabularLayoutData<LayoutNode, LayoutEdge, LayoutNodeLabel, LayoutEdgeLabel>Returns an instance of LayoutData<TNode, TEdge, TNodeLabel, TEdgeLabel> that can be used to perform item-specific configurations for the TabularLayout.
createLayoutData
(graph: LayoutGraph): TabularLayoutData<LayoutNode, LayoutEdge, LayoutNodeLabel, LayoutEdgeLabel>Parameters
- graph: LayoutGraph
- the graph that determines the generic type arguments of the created layout data
Return Value
- TabularLayoutData<LayoutNode, LayoutEdge, LayoutNodeLabel, LayoutEdgeLabel>
- an instance of layout data that can be used to perform item-specific configurations for the given TabularLayout.
Returns an instance of LayoutData<TNode, TEdge, TNodeLabel, TEdgeLabel> that can be used to perform item-specific configurations for the TabularLayout.
LayoutExecutor type is available at runtime.Parameters
- graph?: IGraph
- the graph that determines the generic type arguments of the created layout data
Return Value
- TabularLayoutData<INode, IEdge, ILabel, ILabel>
- an instance of layout data that can be used to perform item-specific configurations for the given TabularLayout.
See Also
Developer's Guide