The RemoveCollinearBendsStage removes all collinear bends found in a graph.
Remarks
The algorithm traverses each edge path from source to target and removes for each triple of consecutive collinear bends the middle one.
A collinear bend forms a straight line with its preceding bend and its subsequent bend. The angle between the connecting edge segments is either 0
or 180
degrees.
Default Values of Properties
removeStraightOnly | false | All collinear bends are removed from the edges. |
scale | 2 | Bend coordinates are rounded to the second decimal position before comparing. |
Type Details
- yfiles module
- layout-core
- yfiles-umd modules
- All layout modules, view-layout-bridge
- Legacy UMD name
- yfiles.layout.RemoveCollinearBendsStage
Constructors
Creates a new RemoveCollinearBendsStage instance with default settings.
Parameters
A map of options to pass to the method.
- scale - number
The scale that defines how accurate the algorithm is when it comes to comparing the coordinates of two bends. This option sets the scale property on the created object.
- removeStraightOnly - boolean
Whether the algorithm removes only collinear bends which lie in the middle of their neighbors or all collinear bends. This option sets the removeStraightOnly 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 core layout algorithm that is wrapped by this stage.
Gets or sets whether the algorithm removes only collinear bends which lie in the middle of their neighbors or all collinear bends.
Remarks
180
degrees, while in the second case, the angle can be either 180
degrees or 0
degrees.Default Value
false
.All collinear bends are removed from the edges.
Gets or sets the scale that defines how accurate the algorithm is when it comes to comparing the coordinates of two bends.
Remarks
- Positive scale values: the value denotes the number of decimal positions that are considered (e.g.
10.2345
becomes10.23
for a scale factor of2
). - Scale value zero: coordinates are rounded to the next integer coordinates (e.g.
10.2345
becomes10
). - Negative scale values: the coordinates are rounded to the next multiple of
10
,100
and so on (e.g.10.2345
becomes0
for a scale factor of-2
).
Default Value
2
.Bend coordinates are rounded to the second decimal position before comparing.
Methods
Removes collinear bends of the edges in the given graph.
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