Implements
- I
Remarks
Ports are either CENTERed on the node, distributed at one side of the node, or placed considering LayoutPortCandidates.
Default Values of Properties
| Name | Default | Description |
|---|---|---|
| borderToPortGapRatio | 0.5 | |
| mode | TreeLayoutPortAssignmentMode.CENTER | |
| reversedPortOrder | false | The normal order is used for the ports. |
See Also
Developer's Guide
Members
Show:
Constructors
Creates a new TreeLayoutPortAssigner instance.
Creates a new TreeLayoutPortAssigner instance.
Parameters
- mode?: TreeLayoutPortAssignmentMode
- An optional port assignment specifier. The default value is CENTER.
- ratio?: number
- The ratio of the distance between outer ports and the border to the distance between any two ports. The default value is
0.5.
Throws
- Exception ({ name: 'ArgumentError' })
- if an unknown mode is specified or if the specified ratio is negative
Properties
The ratio must have a positive value. When the ratio is
0, the ports will be distributed along the whole side of the node without a gap between the last port and the corner.This setting only affects DISTRIBUTED port assignment.
final
Property Value
the ratio of the border gap (gap between ports and border) to the port gap (gap between two ports)
Throws
- Exception ({ name: 'ArgumentError' })
- if the specified ratio is negative
Default Value
The default value is: 0.5
Sample Graphs
ShownSetting:
0.5Gets or sets the mode that describes how ports are placed.
Gets or sets the mode that describes how ports are placed.
While ISubtreePlacer implementations preserve the assigned ports, some may not generate suitable edge routes when ports are distributed. For distributed ports, SingleLayerSubtreePlacer typically yields the best results.
conversionfinal
Property Value
one of the predefined port assignment specifiers
Default Value
The default value is: TreeLayoutPortAssignmentMode.CENTER
See Also
Developer's Guide
The normal order is from left to right and from top to bottom. It will be reversed if this option is enabled.
This setting only affects DISTRIBUTED port assignment.
final
Property Value
true if the order of the ports is reversed, false otherwiseDefault Value
The default value is: false
The normal order is used for the ports.
Sample Graphs
ShownSetting:
falseMethods
This method is called by assignPorts for each outgoing edge of the given node. It may be overridden to assign a custom location to the source port of outgoing edges.
This implementation considers LayoutPortCandidates despite the port assignment mode.
protected
Parameters
- graph: LayoutGraph
- the input graph
- node: LayoutNode
- the node
- edge: LayoutEdge
- the edge to the child node
- index: number
- the zero-based index of the child edge
See Also
Assigns relative coordinates to the target port of the incoming edge from the parent of the given node.
Assigns relative coordinates to the target port of the incoming edge from the parent of the given node.
This method is called by assignPorts if the given node has a parent node. It may be overridden to assign a custom location to the target port of the incoming edge.
This implementation considers LayoutPortCandidates despite the port assignment mode.
protected
Parameters
- graph: LayoutGraph
- the input graph
- node: LayoutNode
- the node
- edge: LayoutEdge
- the edge from the parent node
See Also
Places the ports of edges connecting to the given node according to the port assignment mode.
Places the ports of edges connecting to the given node according to the port assignment mode.
Parameters
- graph: LayoutGraph
- the input graph
- node: LayoutNode
- the node whose adjacent edges' ports should be placed
See Also
API
- mode