C

PortCandidateSelector

This class is an implementation of the IPortCandidateSelector interface that tries to select suitable LayoutPortCandidates considering the specified NodePortCandidates and EdgePortCandidates.
ImplementsInheritance Hierarchy

Remarks

Instances of this class can be set using property portCandidateSelector.

This implementation will query sourcePortCandidates, targetPortCandidates and nodePortCandidates. It will try to assign each edge one of the matching LayoutPortCandidates considering their cost without introducing too many crossings and without violating the capacity constraints.

Default Values of Properties

NameDefaultDescription
backLoopCost1.0
crossingCost10.0d
deterministictrue
A deterministic algorithm will be applied.
overUsageCost100.0d

See Also

API

cost, selectedSourcePortCandidate, selectedTargetPortCandidate

Members

Show:

Constructors

Creates a new instance of PortCandidateSelector with the default settings.

Properties

Gets or sets the cost associated with each back-loop.
Values should be non-negative.
final

Property Value

the cost for a back-loop

Throws

Exception ({ name: 'ArgumentError' })
if the back-loop cost is negative

Default Value

The default value is: 1.0
Gets or sets the cost associated with a crossing that would occur if a given combination of LayoutPortCandidates would be chosen.
Values should be non-negative.
final

Property Value

the cost for a produced edge crossing

Throws

Exception ({ name: 'ArgumentError' })
if the crossing cost is negative

Default Value

The default value is: 10.0d
Gets or sets whether this implementation uses a deterministic algorithm to assign the LayoutPortCandidates.
final

Property Value

true if a deterministic algorithm should be applied, false otherwise

Default Value

The default value is: true
A deterministic algorithm will be applied.
Gets or sets the cost associated with each edge being assigned to a port which has already reached its capacity.
Values should be non-negative.
When having port candidates with high costs, it may be necessary to increase the over-usage cost to avoid extending the maximum connections.
final

Property Value

the cost for over-saturated LayoutPortCandidates

Throws

Exception ({ name: 'ArgumentError' })
if the cost is negative

Default Value

The default value is: 100.0d

See Also

API
capacity

Methods

Inserts a same-layer edge structure for each same-layer edge of the original graph.
In this phase of the layout, the graph does not contain same-layer edges. The structure for a same-layer edge (s,t) consists of a temporary node w and edges (s,w) and (t,w).
protected

Parameters

graph: LayoutGraph
the input graph
layoutContext: HierarchicalLayoutContext
The HierarchicalLayoutContext implementation which provides context information for the graph elements, as well as the ItemFactory that sets the temporary port constraints.

Return Value

PortCandidateSelectorSameLayerData
An object that provides information about the inserted same-layer structures.

See Also

API
selectedSourcePortCandidate, selectedTargetPortCandidate
Removes the same-layer edge structure created using insertSameLayerStructures.
protected

Parameters

sameLayerData: PortCandidateSelectorSameLayerData
A given PortCandidateSelectorSameLayerData instance holding the information about the same-layer structures.
graph: LayoutGraph
The input graph
layoutContext: HierarchicalLayoutContext
The HierarchicalLayoutContext implementation which provides context information for the graph elements, as well as the ItemFactory that sets the temporary port constraints.

See Also

API
selectedSourcePortCandidate, selectedTargetPortCandidate
Assigns new selected port candidates after the layering information has been determined.

Parameters

graph: LayoutGraph
The input graph
layoutContext: HierarchicalLayoutContext
The HierarchicalLayoutContext containing information about the elements, as well as the ItemFactory instance to set the selected port candidates with.
Assigns new selected port candidates after the sequence of the nodes has been determined.

Parameters

graph: LayoutGraph
the input graph
layoutContext: HierarchicalLayoutContext
The HierarchicalLayoutContext providing context information about the graph elements, as well as the ItemFactory instance to set the selected port candidates with.
Assigns new temporary port constraints to a given node of the graph after the order of the nodes in each layer has been determined.

More precisely, it is called after the sequence of the nodes has been determined.

Incoming and outgoing edges are sorted using comparison instances which define the preferred ordering of the incoming and outgoing edges from left to right.

In this phase, it is not allowed to create back-loops, i.e., incoming edges must not connect to the bottom side and outgoing edges must not connect to the top side of a node.
protected

Parameters

node: LayoutNode
the original node to set temporary port constraints
inEdgeOrder: function(LayoutEdge, LayoutEdge): number
a given comparison instance for incoming edges
outEdgeOrder: function(LayoutEdge, LayoutEdge): number
a given comparison instance for outgoing edges
graph: LayoutGraph
the input graph
layoutContext: HierarchicalLayoutContext
The HierarchicalLayoutContext implementation which provides context information for the graph elements, as well as the ItemFactory that sets the temporary port constraints.

See Also

API
selectAfterSequencingWithOrders
Assigns new temporary port constraints after the order of the nodes in each layer has been determined.

More precisely, it is called after the sequence of the nodes has been determined.

Incoming and outgoing edges are sorted using comparison instances which define the preferred ordering of the incoming and outgoing edges from left to right.

In this phase, it is not allowed to create back-loops, i.e., incoming edges must not connect bottom side and outgoing edges must not connect to the top side of a node.
protected

Parameters

inEdgeOrder: function(LayoutEdge, LayoutEdge): number
a given comparison instance for incoming edges
outEdgeOrder: function(LayoutEdge, LayoutEdge): number
a given comparison instance for outgoing edges
graph: LayoutGraph
the input graph
layoutContext: HierarchicalLayoutContext
The HierarchicalLayoutContext implementation which provides context information for the graph elements, as well as the ItemFactory that sets the temporary port constraints.

See Also

API
selectAfterSequencing