This routing algorithm applies orthogonal routes to the edges within a channel.
Remarks
Each edge that should be routed has to be specified by a unique key (e.g., the edge itself) as well as two points that represent the two endpoints of this edge, see addSegment. The orthogonal route of each edge consists of three segments. More precisely, for an edge with source point (sx,sy)
, target point (tx,ty)
and vertical channel orientation, the algorithm calculates the x-coordinate of the vertical middle segment (called mx
) that can be obtained with method getChannelCoordinate after routing the edges. Hence, the actual route consists of points (sx,sy), (mx,sy), (mx,ty)
and (tx,ty)
. Analogously, if the channel orientation is horizontal, the route consists of the points (sx,sy), (sx,my), (tx,my)
and (tx,ty)
.
Besides the orientation, each channel is restricted by a smallest and largest assignable coordinate. If, for example, the orientation is vertical, the calculated x-coordinate of the middle segment lies between these two values. Both values can be changed by means of method setChannel.
All edges assigned to the same coordinate are said to lie in the same sub-channel. In general, the routing algorithm tries to assign coordinates such the number of sub-channels as well as the number of edge crossings is small.
Default Values of Properties
epsilon | 0.5 | |
ignoreEpsilonChannel | true |
Type Details
- yfiles module
- layout-core
- yfiles-umd modules
- All layout modules, view-layout-bridge
- Legacy UMD name
- yfiles.router.ChannelRoutingTool
Constructors
Creates a new instance of ChannelRoutingTool.
Parameters
A map of options to pass to the method.
- min - number
- The smallest assignable coordinate within the channel.
- max - number
- The largest assignable coordinate within the channel.
- orientation - ChannelOrientation
- The orientation of the channel. If omitted, the default value is HORIZONTAL.
Properties
Gets or sets the current epsilon value.
Remarks
Default Value
0.5
.See Also
Gets or sets whether or not middle segments with lengths smaller than epsilon are ignored.
Methods
Adds an edge object that belongs to an edge group to the set of elements that should be routed within the channel.
Remarks
Parameters
A map of options to pass to the method.
Returns the calculated channel coordinate for an added edge object.
Parameters
A map of options to pass to the method.
Returns
- ↪number
- the channel coordinate of the associated edge object
See Also
Returns the sub-channel rank for the specified edge group within the channel.
Parameters
A map of options to pass to the method.
Returns
- ↪number
- the sub-channel rank of the edge group
See Also
Returns the sub-channel rank of the specified edge object within the channel.
Parameters
A map of options to pass to the method.
Returns
- ↪number
- the sub-channel rank of the given edge object
See Also
Routes all added edge objects within the specified channel.
Remarks
See Also
Specifies the channel bounds and orientation.
Remarks
Parameters
A map of options to pass to the method.
- min - number
- The smallest assignable coordinate within the channel.
- max - number
- The largest assignable coordinate within the channel.
- orientation - ChannelOrientation
- The orientation of the channel. If omitted, the default value is HORIZONTAL.