documentationfor yFiles for HTML 3.0.0.3

PartialLayout

This class represents a partial layout algorithm which changes the coordinates for a given set of graph elements (called partial elements) only.

Inheritance Hierarchy
LayoutStageBase
PartialLayout
Implemented Interfaces

Remarks

The location and size of the remaining elements (called fixed elements) is not allowed to be changed.

Layout Style

This partial layout algorithm offers a kind of generic partial layout support for other existing layout algorithms. Hence, its layout style heavily depends on the selected coreLayout as well as the specified edgeRouter or edgeRoutingStyle.

The partial layout is suitable for applications where users may incrementally add new elements to an existing drawing. The added elements should be arranged so that they fit best possible into the given diagram without making any changes to the already existing layout. Hence, the so-called mental map of the existing drawing is preserved.

The input graph where marked nodes denote the partial elements that were incrementally added to the existing diagram.

The result of a partial layout run with componentAssignmentStrategy set to SINGLE and with node alignment enabled.

Features

Similar to the layout style, the supported feature set mainly depends on the features supported by the specified coreLayout as well as the specified edgeRouter or edgeRoutingStyle. The internal step that places the components can handle group nodes and is able to consider minimum distance constraints and node labels.

Furthermore, the algorithm tries to place a subgraph component within the associated cell of the LayoutGrid. For this feature to work properly it is required that the values of the properties position, position, width and height are correctly specified. Note that the algorithm does not guarantee that the calculated subgraph layout fits into the grid cell.

Concept

The layout algorithm tries to place the partial elements such that the resulting drawing (including the fixed elements) has a good quality with respect to common graph drawing aesthetics.

The layout algorithm handles each selected graph element as partial element. Selected graph elements can be defined using properties scope. Partial node elements can be assigned to the so-called subgraph components. During the layout process each subgraph induced by the nodes of a component is first laid out using the specified coreLayout. Then, the different components are placed one-by-one onto the drawing area such that the number of overlaps among graph elements is small. The user can specify different objectives for finding 'good' positions for subgraph components (see subgraphPlacement), e.g., BARYCENTER specifies that the component should be placed close to the barycenter of its graph neighbors and FROM_SKETCH specifies that the component should be placed close to its original position.

Method componentAssignmentStrategy allows to specify the strategy that assigns partial nodes to subgraph components. Possible values are CLUSTERING, CONNECTED, and SINGLE. Note that nodes of a component cannot be assigned to different group nodes.

Furthermore, the user can specify the edge routing style (see edgeRoutingStyle) that is used for routing partial edges and edges between different subgraph components (so-called inter-edges). Possible values are ORGANIC, ORTHOGONAL, STRAIGHT_LINE, OCTILINEAR and AUTOMATIC.

Default Values of Properties

allowMirroringfalseMirroring is disabled.
allowMovingFixedElementsfalseThe algorithm doesn't move fixed elements.
componentAssignmentStrategySINGLEEach partial node is assigned to a separate subgraph component.
componentCompactiontrueSubgraph component may be placed within another subgraph component.
considerNodeAlignmentfalseNodes are not aligned.
edgeRouterStraightLineEdgeRouter
edgeRoutingStyleSTRAIGHT_LINE
layoutOrientationNONEThe layout orientation is completely ignored.
minimumNodeDistance10
optimizeOrientationtrueThis postprocessing step is enabled.
resizeFixedGroupsfalseFixed group nodes may not be resized.
routeInterEdgesImmediatelyfalseEdges are not routed immediately.
stopDurationMAX_VALUEThe time is not limited.
subgraphPlacementBARYCENTEREach subgraph component is placed close to the barycenter of its graph neighbors.

Type Details

yFiles module
algorithms
When a partial node should be placed inside a fixed group node, it is important that there is enough free space inside the group. Otherwise, there may be overlapping node elements.

Constructors

Properties

Methods

Constants