documentationfor yFiles for HTML 2.6

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 core layout algorithm as well as the specified edge router or edge routing strategy.

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 component assignment strategy 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 core layout algorithm as well as the specified edge router or edge routing strategy. The internal step that places the components can handle group nodes and is able to consider minimum distance constraints.

Furthermore, the algorithm tries to place a subgraph component within the associated cell of the PartitionGrid. For this feature to work properly it is required that the values of the properties originalPosition, originalPosition originalWidth and originalHeight 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. For this, it looks up the IDataProvider keys AFFECTED_NODES_DP_KEY and AFFECTED_EDGES_DP_KEY. 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 core layout algorithm. 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, SINGLE and CUSTOMIZED. The last value allows to use a customized component assignment. Note that nodes of a component cannot be assigned to different group nodes.

Furthermore, the user can specify the edge routing strategy (see edgeRoutingStrategy) that is used for routing partial edges and edges between different subgraph components (so-called inter-edges). Possible values are ORGANIC, ORTHOGONAL, STRAIGHTLINE, 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
edgeRoutingStrategySTRAIGHTLINE
layoutOrientationNONEThe layout orientation is completely ignored.
maximumDuration<code>0x7FFFFFFF</code>The time is not limited.
minimumNodeDistance10
optimizeOrientationtrueThis postprocessing step is enabled.
resizeFixedGroupsfalseFixed group nodes may not be resized.
routeInterEdgesImmediatelyfalseEdges are not routed immediately.
subgraphPlacementBARYCENTEREach subgraph component is placed close to the barycenter of its graph neighbors.

Type Details

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

See Also

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