C

HierarchicalLayoutPortAssigner

This class is a default IHierarchicalLayoutPortAssigner implementation.

Remarks

It is used by HierarchicalLayout after the sequencing phase.

Default Values of Properties

NameDefaultDescription
considerFixedPortstrue
Edges with strong/fixed ports are considered.
defaultBorderToPortGapRatio0.5d
Ports are distributed along the side of the node.

Members

No filters for this type

Constructors

Creates a new instance of HierarchicalLayoutPortAssigner with default settings.

Parameters

See Also

API
defaultBorderToPortGapRatio

Properties

Gets or sets whether this IHierarchicalLayoutPortAssigner considers edges with fixed LayoutPortCandidates.
If these edges are ignored, the ports of the other edges are uniformly distributed on the sides of the nodes which may lead to intersections with the ignored edges. On the other hand, if these edges are considered, the port assignment of the other edges may no longer be uniform.
final

Property Value

true if the port assigner takes edges with strong/fixed ports into account, false otherwise

Default Value

The default value is: true
Edges with strong/fixed ports are considered.
Gets or sets the default ratio of the border gap (distance between the outer ports and the node border) to the port gap (distance between adjacent ports).

The ratio should be at least 0.

A value of 0.0d results in ports being placed directly on the corner of the node (if there is more than one port).

A value of 0.5d results in ports being distributed along the side of the node so that the distance between the corner of the node and the first port is half as wide as the distance between two adjacent ports.

A value of Double.POSITIVE_INFINITY results in all ports being centered at the side in one point.

final

Property Value

the border gap ratio

Throws

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

Default Value

The default value is: 0.5d
Ports are distributed along the side of the node.

Sample Graphs

ShownSetting: Port border gap ratio 0.0d - node 1 has a port candidate BOTTOM while nodes 2,3,4 have port candidates TOP.

See Also

API
borderToPortGapRatio

Methods

Assigns source and target port coordinates to each edge of the graph.

This method assigns:

  • ANY ports to appropriate sides.
  • Free ports to appropriate positions between fixed ones.

This method is called by HierarchicalLayout after the sequencing phase.

Parameters

graph: LayoutGraph
the input graph
layoutContext: HierarchicalLayoutContext
The HierarchicalLayoutContext containing context information about the nodes and edges of the graph, as well as the ItemFactory instance.