documentationfor yFiles for HTML 2.6

PortCalculator

A PortCalculator can be applied to move ports from the nodes' rectangular bounds to the actual outline.

Inheritance Hierarchy
LayoutStageBase
PortCalculator
Implemented Interfaces

Remarks

Layout algorithms only consider rectangular nodes even though the actual shape of a node is, for example, circular. Hence, without adding specific strong PortConstraints, the ports are usually placed at the border of the nodes' bounding boxes (except for some layout algorithms that produce straight-line edge routes and place the ports at the nodes' center). A PortCalculator may wrap a core layout algorithm to adjust the port assignment after the layout calculation. For the calculation of the new port offsets, the PortCalculator delegates to instances of interface IIntersectionCalculator. To specify such an instance for the source/target of an edge, use a IDataProvider that is registered to the graph with key SOURCE_INTERSECTION_CALCULATOR_DP_KEY and TARGET_INTERSECTION_CALCULATOR_DP_KEY, respectively. Note that the intersection point (i.e., port) of an edge and the associated source/target node provided by method calculateIntersectionPoint will be added to the edge's IEdgeLayout.

Default Values of Properties

coreLayoutnull

Type Details

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

See Also

This class will not change the coordinates of a port if it is associated with a strong port constraint.
A PortCalculator will automatically be applied if the layout is executed using a LayoutExecutor and the portAdjustmentPolicy is set to another value than NEVER.

Constructors

Properties

Methods

Fields