documentationfor yFiles for HTML 2.6

PortCandidateSet

This class associates PortCandidates with the nodes of a graph.

Inheritance Hierarchy
PortCandidateSet

Remarks

PortCandidates defined on nodes specify sides or even exact locations at which edges can be connected. This means that an edge can be connected to any of the available node ports (unless edge PortCandidates are specified too). Each node PortCandidate has a capacity, i.e., a maximum number of edges allowed to connect to it.

Information about PortCandidates on nodes is held by a IDataProvider that stores a PortCandidateSet for each node and is registered with the graph using key NODE_PORT_CANDIDATE_SET_DP_KEY.

The PortCandidates are retrieved from the PortCandidateSet through a IPortCandidateSetEntry that holds the information about the actual PortCandidate. This object is also used for retrieving the best candidate from a PortCandidateSet based on the cost (lower costs are considered first) and the available capacity of each candidate. Custom searching for the best PortCandidate can be achieved by implementing IPortCandidateMatcher interface.

Example of node port candidates. Circular ports represent node port candidates on source nodes of each edge. Square and rectangular ports are possible port candidates on the target node. Rectangular ports have zero cost of usage and unit capacity whereas square rectangles have unit cost and capacity.

Not all layout and routing algorithms are able to handle PortCandidates. Major layout algorithms that obey them are HierarchicLayout, EdgeRouter, ChannelEdgeRouter and BusRouter.

Type Details

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

See Also

PortPlacementStage can be appended to any layout algorithm that cannot handle port constraints in order to assign edges to the ports specified by PortConstraints or PortCandidates after calling the core layout algorithm.
In case that both PortConstraints and PortCandidates (on edges and/or nodes) are defined for a graph, the layout or the routing algorithm will try to match both of them in order to find an appropriate port. The matching process depends on the actual algorithm.

Constructors

Properties

Methods

Constants