A IPortCandidateMatcher retrieves the best matching entries from a PortCandidateSet.
Inheritance Hierarchy
IPortCandidateMatcher
Remarks
How well a candidate is matching can be decided based on its cost, its currently available capacity, its offsets or whether or not its direction is consistent with the desired one.
To use custom implementations of this interface, method createMatcher should be overridden.
Type Details
- yfiles module
- layout-core
- yfiles-umd modules
- All layout modules, view-layout-bridge
- Legacy UMD name
- yfiles.layout.IPortCandidateMatcher
While the EdgeRouter supports PortCandidateSets, it doesn't support custom IPortCandidateMatcher implementations.
The HierarchicLayout supports PortCandidateSets but uses the IPortCandidateMatcher only to determine fallback candidates within class PortCandidateOptimizer. For an advanced customization of the port assignment strategy users may implement a custom PortConstraintOptimizerBase.
Methods
findMatchingCandidate
(edge: Edge, source: boolean, xOffset: number, yOffset: number, directionMask: PortDirections) : IPortCandidateSetEntryReturns the next best matching IPortCandidateSetEntry for the given parameters.
Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- edge - Edge
- the edge for which to find a candidate
- source - boolean
true
if the given edge connects to its source node,false
otherwise- xOffset - number
- the preferred X-offset of the port relative to the center of the node
- yOffset - number
- the preferred Y-offset of the port relative to the center of the node
- directionMask - PortDirections
- any combination of default directions defined in PortCandidate
Returns
- ↪IPortCandidateSetEntry
- a matching IPortCandidateSetEntry instance
findMatchingCandidate
(edge: Edge, source: boolean, directionMask: PortDirections) : IPortCandidateSetEntryReturns the next best matching IPortCandidateSetEntry for the given parameters.
Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- edge - Edge
- the edge for which to find a candidate
- source - boolean
true
if the given edge connects to its source node,false
otherwise- directionMask - PortDirections
- any combination of default directions defined in PortCandidate
Returns
- ↪IPortCandidateSetEntry
- a matching IPortCandidateSetEntry instance
Returns the next best matching IPortCandidateSetEntry.
Returns
- ↪IPortCandidateSetEntry
- a matching IPortCandidateSetEntry instance