The TreeLayoutPortAssigner provides some simple port assignment styles for the TreeLayout.
Remarks
Default Values of Properties
borderToPortGapRatio | 0.5 | |
mode | CENTER
| |
reversedPortOrder | false | The normal order is used for the ports. |
Type Details
- yFiles module
- algorithms
Constructors
Creates a new TreeLayoutPortAssigner instance.
Parameters
A map of options to pass to the method.
- 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
. - borderToPortGapRatio - number
- The ratio of the border gap (distance between the outer ports to the node border) to the port gap (distance between adjacent ports). This option sets the borderToPortGapRatio property on the created object.
- reversedPortOrder - boolean
- Whether or not the port assignment should reverse the order of the ports. This option sets the reversedPortOrder property on the created object.
Throws
- Exception({ name: 'ArgumentError' })
- if an unknown mode is specified or if the specified ratio is negative
Properties
Gets or sets the ratio of the border gap (distance between the outer ports to the node border) to the port gap (distance between adjacent ports).
Remarks
0
, the ports will be distributed along the whole side of the node without a gap between the last port and the corner.Default Value
0.5
.Property Value
Throws
- Exception({ name: 'ArgumentError' })
- if the specified ratio is negative
Sample Graphs
Gets or sets the mode that describes how ports are placed.
Default Value
CENTER.Property Value
Gets or sets whether or not the port assignment should reverse the order of the ports.
Remarks
Default Value
false
.The normal order is used for the ports.
Property Value
true
if the order of the ports is reversed, false
otherwiseSample Graphs
Methods
Assigns relative coordinates to the source port of the outgoing edge to a child of the given node.
Remarks
Parameters
A map of options to pass to the method.
- 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.
Remarks
Parameters
A map of options to pass to the method.
- 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.
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- the input graph
- node - LayoutNode
- the node whose adjacent edges' ports should be placed
See Also
Implements
Retrieves the source LayoutPortCandidate for the given edge.
Remarks
Parameters
A map of options to pass to the method.
- edge - LayoutEdge
- the edge
Returns
See Also
Retrieves the target LayoutPortCandidate for the given edge.
Remarks
Parameters
A map of options to pass to the method.
- edge - LayoutEdge
- the edge