documentationfor yFiles for HTML 3.0.0.2

NodePortCandidates

This class associates LayoutPortCandidates with the nodes of a graph.

Inheritance Hierarchy
NodePortCandidates

Remarks

LayoutPortCandidates 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 LayoutPortCandidates are specified too). Each node LayoutPortCandidate has a capacity, i.e., a maximum number of edges allowed to connect to it.

It is recommended to set the NodePortCandidates using the corresponding properties nodePortCandidates and nodePortCandidates. Alternatively, NodePortCandidates can be specified for each node by an IMapper<K,V> that is registered with the graph using the keys NODE_PORT_CANDIDATES_DATA_KEY.

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 provide equal support for port candidates. Layout and routing algorithms that support both port candidates at nodes and at edges, typically try to match the candidates at the edges with candidates at the nodes. An edge port candidate matches a node port candidate if

  • Their matchingIds are equal or one type is null,
  • They belong to a common side or at least one side is ANY, and
  • If both candidates are fixed, they describe the same positions.

The position of a port candidate is defined by offset or the actual offset of the edge endpoint for fixed-from-sketch candidates. For more details, see the respective algorithms.

Type Details

yFiles module
algorithms

See Also

Constructors

Methods

Constants