This class is used by EdgeRouter to provide routing details for the edges of the graph.
Remarks
An EdgeRouterEdgeLayoutDescriptor instance can be specified individually for single edges using a IDataProvider that returns an EdgeRouterEdgeLayoutDescriptor instance for each edge of the graph, or null
if no EdgeRouterEdgeLayoutDescriptor is bound to an edge. The IDataProvider is registered with the graph using key EDGE_LAYOUT_DESCRIPTOR_DP_KEY.
This class is designed such that it allows future additions of new getter methods.
Default Values of Properties
curveShortcuts | false | Curved edges do not shortcut. |
curveUTurnSymmetry | 0 | The symmetry of u-turns is not specifically optimized. |
minimumEdgeToEdgeDistance | 3.0 | |
minimumFirstSegmentLength | 5.0 | |
minimumLastSegmentLength | 10.0 | |
minimumNodeCornerDistance | 3.0 | |
monotonicPathRestriction | NONE
| No path restrictions are used. |
preferredOctilinearSegmentLength | 30 | |
routingPolicy | ALWAYS
| The edge is routed, ignoring the existing sketch. |
routingStyle | ORTHOGONAL
|
Type Details
- yfiles module
- layout-core
- yfiles-umd modules
- All layout modules, view-layout-bridge
- Legacy UMD name
- yfiles.router.EdgeLayoutDescriptor
See Also
Constructors
Creates a new instance of an EdgeRouterEdgeLayoutDescriptor with the default settings.
Parameters
A map of options to pass to the method.
- minimumFirstSegmentLength - number
The minimum length of the first segment of the edge path (at the source node). This option sets the minimumFirstSegmentLength property on the created object.
- minimumLastSegmentLength - number
The minimum length of the last segment of the edge path (at the target node). This option sets the minimumLastSegmentLength property on the created object.
- minimumEdgeToEdgeDistance - number
The minimum distance between a pair of edges. This option sets the minimumEdgeToEdgeDistance property on the created object.
- minimumNodeCornerDistance - number
The minimum distance that the edge should maintain from node corners when entering or leaving the node. This option sets the minimumNodeCornerDistance property on the created object.
- monotonicPathRestriction - MonotonicPathRestriction
The monotonic path restrictions that should be applied. This option sets the monotonicPathRestriction property on the created object.
- routingStyle - EdgeRouterEdgeRoutingStyle
The routing style for the edge associated with this descriptor. This option sets the routingStyle property on the created object.
- routingPolicy - RoutingPolicy
The routing policy indicating if the edge associated with this descriptor is unconditionally routed or if the existing route determines whether a routing is even necessary. This option sets the routingPolicy property on the created object.
- penaltySettings - PenaltySettings
The PenaltySettings used for this edge. This option sets the penaltySettings property on the created object.
- directGroupContentEdgeRouting - boolean
Whether or not this edge is routed directly to a group node's border if it connects the group node with one of its descendants. This option sets the directGroupContentEdgeRouting property on the created object.
- intermediateRoutingPoints - IList<Object>
The list of intermediate YPoints that need to lie on the edge route. This option sets the intermediateRoutingPoints property on the created object.
- createControlPoints - boolean
Whether or not the points of the resulting edge path represent cubic bezier control points. This option sets the createControlPoints property on the created object.
- curveShortcuts - boolean
Whether or not curved edges may shortcut and introduce additional edge crossings to make curves more direct and smoother. This option sets the curveShortcuts property on the created object.
- curveUTurnSymmetry - number
How symmetric u-turn parts of curved routes should preferably be. This option sets the curveUTurnSymmetry property on the created object.
- sourceCurveConnectionStyle - CurveConnectionStyle
The style which determines how curved edge paths connect at the source side of the edge. This option sets the sourceCurveConnectionStyle property on the created object.
- targetCurveConnectionStyle - CurveConnectionStyle
The style using which determines how edge paths connect at the target side of the edge. This option sets the targetCurveConnectionStyle property on the created object.
- preferredOctilinearSegmentLength - number
The preferred length of non-orthogonal, octilinear segments. This option sets the preferredOctilinearSegmentLength property on the created object.
- maximumOctilinearSegmentRatio - number
The maximum ratio between the horizontal/vertical part of a segment and the non-orthogonal, octilinear part. This option sets the maximumOctilinearSegmentRatio property on the created object.
Properties
Gets or sets whether or not the points of the resulting edge path represent cubic bezier control points.
Remarks
- Disabled (default): Each point of the path represents a normal polyline bend point.
- Enabled: Four consecutive points p1, p2, p3, p4 of the resulting edge path need to be interpreted such that p1 is the start point of the cubic bezier curve, p4 is the end point of it and p2, p3 are the two intermediate control points. If p4 is not the last point of the edge path it is at the same time the start point of the next curve. For example, points p1, p2, p3, p4, p5, p6, p7 form a path that consists of two curves: the curve defined by p1, p2, p3, p4 and the curve defined by p4, p5, p6, p7.
Default Value
false
.Each point is a normal polyline bend point.
Gets or sets whether or not curved edges may shortcut and introduce additional edge crossings to make curves more direct and smoother.
Remarks
In relation to nodes, labels and other edges, the curved and non-curved edges take the same route, for example, both might cross a certain other edge or pass a certain node on its left side. If this property is disabled (default), the curved edges adhere to this.
If enabled, however, curved edges may shortcut and cross additional edges. This can yield to a direct and possibly smoother curved route. Still, intersections with nodes, node labels and edge labels are not allowed.
Default Value
false
.Curved edges do not shortcut.
See Also
Sample Graphs
Gets or sets how symmetric u-turn parts of curved routes should preferably be.
Remarks
If this property is greater than zero
, the algorithm tries to achieve a more symmetric path for 180-degree turns (u-turns) by specifically handling them. Symmetric turns likely require more space compared to more direct variants. The value of this property must be within interval [0,1]
, where a higher value indicates more emphasis on symmetry and lower values that symmetry is not important.
This setting influences the symmetry of a single curved route and does not affect symmetry of multiple curves in relation to each other.
Default Value
0
.The symmetry of u-turns is not specifically optimized.
Throws
- Exception({ name: 'ArgumentError' })
- if the given symmetry value is negative or larger than one
See Also
Sample Graphs
0
might be perceived as being greater than the difference between other values. The reason is that with 0
, u-turns are not handled specifically at all.Gets or sets whether or not this edge is routed directly to a group node's border if it connects the group node with one of its descendants.
Remarks
When enabled, the edge will connect to the inner side of the group node's border instead of leaving the group node and connect from outside.
PortCandidates as well as PortConstraints are supported for direct content edges, including fixed PortCandidates and strong PortConstraints. Note that, for example, a constraint with direction NORTH at the side of the enclosing group node means that the edge connects to the upper group node border from inside and never leaves the group node.
Default Value
false
.Sample Graphs
Gets or sets the list of intermediate YPoints that need to lie on the edge route.
Remarks
Default Value
null
.The route does not obey any intermediate points.
See Also
Gets or sets the maximum ratio between the horizontal/vertical part of a segment and the non-orthogonal, octilinear part.
Remarks
When octilinear segments are added to an edge path, corners between horizontal and vertical segments are cut and replaced by the new segment. This ratio describes the cutting points on a segment. If it is zero, the route stays orthogonal. The value cannot be larger than 0.5
because there may be another non-orthogonal segment at the other side of the segment. For long orthogonal segments the length of the octilinear segment is determined by the value of property preferredOctilinearSegmentLength.
The maximum octilinear segment ratio must be between 0
and 0.5
.
Default Value
0.3
.Throws
- Exception({ name: 'ArgumentError' })
- if the maximum ratio is negative or greater than
0.5
See Also
Sample Graphs
Gets or sets the minimum distance between a pair of edges.
Remarks
0
. If a negative value is given as input, the default value, i.e., 3.0
, will be used instead.Default Value
3.0
.See Also
Sample Graphs
Gets or sets the minimum length of the first segment of the edge path (at the source node).
Remarks
0
. If a negative value is given as input, the default value, i.e., 5.0
, will be used instead.Default Value
5.0
.See Also
Sample Graphs
Gets or sets the minimum length of the last segment of the edge path (at the target node).
Remarks
0
. If a negative value is given as input, the default value, i.e., 10.0
, will be used instead.Default Value
10.0
.See Also
Sample Graphs
Gets or sets the minimum distance that the edge should maintain from node corners when entering or leaving the node.
Remarks
0
. If a negative value is given as input, the default value, i.e., 3.0
, will be used instead.Default Value
3.0
.See Also
Sample Graphs
Gets or sets the monotonic path restrictions that should be applied.
Remarks
Monotonic path restrictions imply that (ideally) the vertical and/or horizontal segments of an edge path are directed from the source node towards the target node without ever changing their direction back towards the source node.
If an unknown restriction is specified, NONE will be used instead.
Default Value
See Also
Gets or sets the PenaltySettings used for this edge.
Remarks
Throws
- Exception({ name: 'ArgumentError' })
- if the given penalty settings are
null
See Also
Gets or sets the preferred length of non-orthogonal, octilinear segments.
Remarks
If there is not enough space to use this preferred length, the segments may also be shorter.
The preferred length of non-orthogonal, octilinear segments has to be greater than or equal to 0
.
Default Value
30
.Throws
- Exception({ name: 'ArgumentError' })
- if the preferred octilinear segment length is negative
See Also
Sample Graphs
Gets or sets the routing policy indicating if the edge associated with this descriptor is unconditionally routed or if the existing route determines whether a routing is even necessary.
Default Value
Throws
- Exception({ name: 'ArgumentError' })
- if an unknown routing policy is given
See Also
Gets or sets the routing style for the edge associated with this descriptor.
Default Value
ORTHOGONAL.Throws
- Exception({ name: 'ArgumentError' })
- if an unknown routing style is given
See Also
Gets or sets the style which determines how curved edge paths connect at the source side of the edge.
Throws
- Exception({ name: 'ArgumentError' })
- if an unknown connection style is given
See Also
Sample Graphs
Gets or sets the style using which determines how edge paths connect at the target side of the edge.
Throws
- Exception({ name: 'ArgumentError' })
- if an unknown connection style is given
See Also
Sample Graphs
Methods
Creates a copy of this EdgeRouterEdgeLayoutDescriptor instance.
Returns
- ↪EdgeRouterEdgeLayoutDescriptor
- a copy of this EdgeRouterEdgeLayoutDescriptor instance