SeriesParallelLayoutPortAssigner implements the default port assignment strategy for SeriesParallelLayout.
Remarks
Ports are either placed at the CENTER or get DISTRIBUTED at the sides of the node.
If LayoutPortCandidates are specified, the fixed LayoutPortCandidates are handled separately and keep their initial location relative to the node while free LayoutPortCandidates just influence on which side of the node the port is placed.
If there are edge groups specified, the edges which belong to the same group get the same port locations.
Default Values of Properties
borderToPortGapRatio | 0.5 | |
mode | CENTER
|
Type Details
- yFiles module
- algorithms
See Also
Constructors
Creates a new SeriesParallelLayoutPortAssigner instance.
Parameters
A map of options to pass to the method.
- mode - SeriesParallelLayoutPortAssignmentMode
- An optional port assignment mode. 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 and the node border) to the port gap (distance between adjacent ports). This option sets the borderToPortGapRatio property on the created object.
Properties
Gets or sets the ratio of the border gap (distance between the outer ports and 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.
Methods
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