documentationfor yFiles for HTML 2.6

ComponentLayout

A ComponentLayout arranges the connected components of a graph.

Inheritance Hierarchy
Implemented Interfaces

Remarks

Layout Style

The components can be arranged using different styles. All styles except NONE place the components without overlaps.

Layout with orthogonal components using MULTI_ROWS_COMPACT

Concept

ComponentLayout is a ILayoutStage that can wrap another layout algorithm. That way, it allows handling disconnected graphs for the wrapped core layout algorithm.

The following steps outline the concept of ComponentLayout:

  1. Determine the connected components of the graph
  2. Hide all graph components
  3. Apply the following steps to each component separately
    1. Unhide the component
    2. Apply the core layout algorithm to the component
    3. Hide the component
  4. Unhide all graph components
  5. Optionally arrange the components

Features

To arrange the subgraphs of the components, ComponentLayout uses the specified core layout algorithm. If there is no core layout algorithm specified, it will keep the locations in the subgraph and arrange the components as they are.

Hierarchically grouped graphs are handled in a special way. The contents of a group node will always belong to the same component as the group node itself. To change that behavior grouping can be disabled.

By default, the components consist of the connected nodes in a graph. To choose custom subgraphs to form components, register a IDataProvider with COMPONENT_ID_DP_KEY and assign component IDs to the nodes.

When arranging components, node types (see NODE_TYPE_DP_KEY) can be considered. If all nodes of a component have the same node type, the component is considered to be of that type. Components with same type are preferably put next to each other. Note, however, that only the styles ROWS, SINGLE_ROW, SINGLE_COLUMN and MULTI_ROWS_TYPE_SEPARATED handle types such that an ordering by type is realized. Other styles aim at more important optimization criteria (e.g. compactness) such that components of the same type are not guaranteed to be close to each other.

Default Values of Properties

componentArrangementtrueThe components are arranged relative to each other.
componentSpacing45
considerGroupingtrueGrouping information is considered for determining the components.
considerLabelstrueNode and edge labels are included in the bounds of the components.
gridSpacing0No grid is considered.
preferredSizeYDimensionBoth preferred width and height are 400.
styleROWS

Type Details

yfiles module
layout-core
yfiles-umd modules
All layout modules, view-layout-bridge
Legacy UMD name
yfiles.layout.ComponentLayout

See Also

Constructors

Properties

Methods

Constants