OrthogonalSegmentDistributionStage distributes overlapping edge segments of orthogonally routed edges.
Remarks
The edge segments are assigned to the so-called channels within which they are distributed. Those channels are defined by the surrounding graph elements.
The algorithm will not distribute the segments, whose endpoints connect to a node using a port that has a strong PortConstraint or a fixed PortCandidate.
Features
It is possible to define a preferred distance between distributed edge segments. This distance will only be applied if there is enough space in the according channel. In the case where there is not enough space, the preferred distance may be reduced for the edges. If the layout algorithm is not allowed to reduce the preferred distance, these edges won't be distributed.
Edges can be distributed on grid coordinates. The grid can only be considered if there is enough space in the according channel for at least as many grid lines as the number of segments. In the case where there is not enough space, the grid spacing may be reduced in this channel. If the layout algorithm is not allowed to reduce the grid spacing, these edges won't be distributed.
Method lockFirstAndLastSegment can be used to guarantee that the first and last segment of an edge won't be distributed. So, ports can easily be maintained without setting explicit strong PortConstraints or fixed PortCandidates.
Default Values of Properties
affectedEdgesDpKey | DEFAULT_AFFECTED_EDGES_DP_KEY
| |
flexibleGridSpacing | true | The layout algorithm is allowed to reduce the grid spacing. |
flexiblePreferredDistance | true | The preferred distance will be reduced if necessary. |
gridRouting | false | Edges are distributed where there is enough space. |
gridSpacing | 10 | |
lockFirstAndLastSegment | false | The first and last segments will be distributed. |
preferredDistance | 10.0 |
Type Details
- yfiles module
- router-other
- yfiles-umd modules
- layout-familytree, layout-multipage, layout-orthogonal-compact, layout, router-bus, router-other
- Legacy UMD name
- yfiles.router.OrthogonalSegmentDistributionStage
See Also
Constructors
Creates a new instance of OrthogonalSegmentDistributionStage with default settings.
Parameters
A map of options to pass to the method.
- affectedEdgesDpKey - Object
The key to register a IDataProvider which determines the edges that shall be routed by this algorithm. This option sets the affectedEdgesDpKey property on the created object.
- flexiblePreferredDistance - boolean
Whether or not the preferred distance between edges can be reduced if there is not enough space. This option sets the flexiblePreferredDistance property on the created object.
- flexibleGridSpacing - boolean
Whether or not the grid spacing can be reduced if there is not enough space. This option sets the flexibleGridSpacing property on the created object.
- gridRouting - boolean
Whether or not the orthogonal segments are distributed on grid coordinates. This option sets the gridRouting property on the created object.
- gridSpacing - number
The spacing between two grid lines. This option sets the gridSpacing property on the created object.
- lockFirstAndLastSegment - boolean
Whether or not the first and last segment of an edge will be distributed. This option sets the lockFirstAndLastSegment property on the created object.
- preferredDistance - number
The preferred distance between each two segments. This option sets the preferredDistance property on the created object.
- coreLayout - ILayoutAlgorithm
The core layout algorithm that is wrapped by this stage. This option sets the coreLayout property on the created object.
Properties
Gets or sets the key to register a IDataProvider which determines the edges that shall be routed by this algorithm.
Default Value
DEFAULT_AFFECTED_EDGES_DP_KEY.Throws
- Exception({ name: 'ArgumentError' })
- if the specified
key is null
Gets or sets the core layout algorithm that is wrapped by this stage.
Gets or sets whether or not the grid spacing can be reduced if there is not enough space.
Remarks
2
as long as there are not enough grid lines on which the segments can be distributed, otherwise the grid spacing remains unchanged.Default Value
true
.The layout algorithm is allowed to reduce the grid spacing.
Gets or sets whether or not the preferred distance between edges can be reduced if there is not enough space.
Remarks
Default Value
true
.The preferred distance will be reduced if necessary.
Gets the x-coordinate of the origin of the grid.
Remarks
See Also
Gets the y-coordinate of the origin of the grid.
Remarks
See Also
Gets or sets whether or not the orthogonal segments are distributed on grid coordinates.
Default Value
false
.Edges are distributed where there is enough space.
See Also
Gets or sets the spacing between two grid lines.
Remarks
0
.Default Value
10
.Throws
- Exception({ name: 'ArgumentError' })
- if the specified spacing is negative
See Also
Gets or sets whether or not the first and last segment of an edge will be distributed.
Default Value
false
.The first and last segments will be distributed.
Gets or sets the preferred distance between each two segments.
Remarks
This value also applies to the distance between a segment and the border of the containing channel.
The preferred distance should be at least 0
.
Default Value
10.0
.Throws
- Exception({ name: 'ArgumentError' })
- if the specified distance is negative
See Also
Methods
Distributes overlapping orthogonal segments after the core layout has been calculated.
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- the input graph
See Also
Implements
Invokes the layout process of the core layout algorithm.
Remarks
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- the input graph
See Also
Defined in
Specifies the coordinates of the origin of the grid.
Remarks
Parameters
A map of options to pass to the method.
- offsetX - number
- the x-coordinate of the grid origin
- offsetY - number
- the y-coordinate of the grid origin
See Also
Constants
A data provider key for determining which edges are distributed.
Domain | Edge | |
Values | boolean | true if the edge should be distributed, false otherwise |