BendConverter replaces edge bends with dummy nodes for the core layout algorithm.
Remarks
Concept
Replacing the bends works in three steps:
- Replacing the bends and the edge segments between them with dummy nodes and edges
- Invoking the core layout algorithm on the altered graph
- Recreating the bends and removing all dummy elements
When the dummy elements have been inserted, edge information about port constraints, edge groups and selection state can be adopted from the original edges. That way, the core layout algorithm can access the mentioned information.
Default Values of Properties
adoptAffectedEdges | true | The selection state of the original edge is applied to all corresponding dummy edges. |
adoptEdgeGroups | true | Original edge grouping information is applied to the dummy edges. |
adoptPortConstraints | true | |
affectedEdgesDpKey | AFFECTED_EDGES_DP_KEY
| |
coreLayout | null |
Type Details
- yfiles module
- layout-core
- yfiles-umd modules
- All layout modules, view-layout-bridge
- Legacy UMD name
- yfiles.layout.BendConverter
Constructors
Creates a new BendConverter instance with default settings.
Creates a new instance of BendConverter with the given core layout algorithm.
Parameters
A map of options to pass to the method.
- core - ILayoutAlgorithm
- the core layout algorithm
Creates a new BendConverter instance with the given size as the width and height for the dummy nodes.
Parameters
A map of options to pass to the method.
- size - number
- the size for the dummy nodes
Throws
- Exception({ name: 'ArgumentError' })
- if the given size is negative
Properties
Gets or sets whether or not the selection state of the original edge should be adopted by its replacement edges.
Remarks
Default Value
true
.The selection state of the original edge is applied to all corresponding dummy edges.
See Also
Gets or sets whether or not edge grouping information of the original edge should be adopted by its replacement edges.
Default Value
true
.Original edge grouping information is applied to the dummy edges.
See Also
Gets or sets whether or not the associated PortConstraints of the original edge should be adopted by its replacement edges.
Default Value
true
.See Also
Gets or sets the key to register a IDataProvider which identifies edges as selected.
Remarks
Default Value
AFFECTED_EDGES_DP_KEY.Throws
- Exception({ name: 'ArgumentError' })
- if the specified key is
null
See Also
Gets or sets the core layout algorithm that is wrapped by this ILayoutStage.
Methods
Adds information to newly created dummy nodes.
Remarks
This is a callback method that will be invoked after new elements for the given edge have been added to the given graph by prepare. At this point, the original edge is still in the graph.
The current implementation does nothing.
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- the input graph
- edge - Edge
- the edge whose bends were replaced by the given dummy nodes
- dummyNodes - YNodeList
- the dummy nodes representing the bends of the edge
Replaces all bends in the current scope with dummy nodes before invoking the core layout algorithm.
Remarks
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- the input graph
See Also
Implements
Prepares the graph before calling the core layout algorithm.
Remarks
The bends of the edges belonging to the current scope are replaced by dummy nodes and the segments between those dummy nodes are replaced by dummy edges.
Edge-specific information like PortConstraints, edge groups or selection state can be applied to the dummy edges to keep this information for the core layout algorithm.
This method is called by applyLayout before invoking the core layout algorithm. It may be overridden to extend the edge-specific information that should be adopted by the dummy edges.
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- the input graph
See Also
Restores the structure of the graph after the core layout algorithm has finished.
Remarks
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- the graph arranged by the core layout algorithm
See Also
Constants
A data provider key for specifying the set of edges for which this stage will replace bends.
Remarks
Domain | Edge | |
Values | boolean | true if the bends of the edge should be replaced by dummy nodes, false otherwise |