documentationfor yFiles for HTML 3.0.0.2

EdgePortCandidates

This class associates LayoutPortCandidates with the endpoints of edges of a graph.

Inheritance Hierarchy
EdgePortCandidates

Remarks

LayoutPortCandidates defined for an endpoint of an edge specify sides or even exact locations at which the edge can be connected. This means that the edge can be connected to any of its associated LayoutPortCandidates (unless NodePortCandidates are specified for the incident node). In this case a candidate is selected that matches both with the candidates at the edges and the node.

Information about edge LayoutPortCandidates is specified using EdgePortCandidates. It is recommended to set the EdgePortCandidates using the corresponding properties sourcePortCandidates and targetPortCandidates, respectively. Alternatively, the EdgePortCandidates can be given via IMapper<K,V>s that are registered with the graph using the keys SOURCE_PORT_CANDIDATES_DATA_KEY (to specify EdgePortCandidates on the source node) and TARGET_PORT_CANDIDATES_DATA_KEY (to specify EdgePortCandidates on the target node).

Example of using edge port candidates. Edge port candidates are colored uniquely based on the edge with which they are associated.

Not all layout and routing algorithms provide equal support for port candidates. Layout and routing algorithms that support both port candidates at edges and at nodes, 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 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