documentationfor yFiles for HTML 2.6

PortPlacementStage

The PortPlacementStage assigns edges to the ports specified by PortConstraints or PortCandidates after calling the core layout algorithm.

Inheritance Hierarchy
LayoutStageBase
PortPlacementStage
Implemented Interfaces

Remarks

It can be used for adjusting ports for layout algorithms that cannot handle PortConstraints.

If PortCandidates are assigned for edges and nodes, this stage tries to match them. When there is no match, the PortCandidate with the lowest costs specified for the edge is chosen. While PortConstraints are also matched to PortCandidates at nodes and edges, it is not recommended to mix them because they belong to different concepts.

This stage also considers port groups (see SOURCE_PORT_GROUP_ID_DP_KEY and TARGET_PORT_GROUP_ID_DP_KEY). It assigns the same port to edges that are port-grouped at a common node. Importantly, port grouping is prioritized over other constraints, for example, if two port-grouped edges do not have at least one common PortCandidate or the same PortConstraint, then the port of one of the edges will be chosen for both, violating the constraint of the other edge.

Furthermore, option pathCorrection allows to specify whether the edge path should be corrected after correcting a port.

It is recommended that the PortPlacementStage is prepended to the core layout algorithm in order to be able to process all the edges and especially, self-loops and parallel edges. Note that edges that might be hidden by other ILayoutStages cannot be handled by PortPlacementStage.

Default Values of Properties

pathCorrectionfalseEdge paths are not orthogonally corrected.

Type Details

yfiles module
router-other
yfiles-umd modules
layout-familytree, layout-multipage, layout-orthogonal-compact, layout, router-bus, router-other
Legacy UMD name
yfiles.layout.PortPlacementStage

See Also

This stage can not properly deal with the case that the current ports are outside of the bounds of the adjacent nodes. The current ports are expected to be on the border or inside the node (e.g. center).

Constructors

Properties

Methods