documentationfor yFiles for HTML 3.0.0.3

TabularLayout

This layout algorithm places nodes in a tabular fashion.

Inheritance Hierarchy
TabularLayout
Implemented Interfaces

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.

A tabular layout of 8 nodes organized in a 3x3 grid

A tabular layout of 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:

With these layoutStages the layout algorithm is configured well, so they usually don't need to be changed.

Default Values of Properties

considerEdgesfalseEdges are not considered.
defaultNodeDescriptorTabularLayoutNodeDescriptorDescriptor instance with default settings.
edgeLabelPlacementGENERICEdge labels are placed by an independent labeling algorithm.
layoutModeAUTO_SIZE
nodeLabelPlacementCONSIDERNode labels are considered.
stopDurationMAX_VALUEThe layout algorithm runs unrestricted.

Type Details

yFiles module
algorithms

See Also

The minimum distance between nodes can either be influenced by specifying suitable column/row padding as described above or by specifying node margins.
The settings optimizeRowOrder and optimizeColumnOrder of a given grid instance are not considered by this layout algorithm. Furthermore, the following properties of rows and columns are ignored as well: tightness, indexFixed, tightness and indexFixed.

Constructors

Properties

Methods

Constants