CurveRoutingStage replaces polyline edge paths with curved segments using cubic bezier splines.
Remarks
This layout stage provides a generic way to add curved edge paths for a layout with polyline routes. It first calls the coreLayout and converts the edge routes as a post-processing step. Note that HierarchicalLayout and EdgeRouter offer an integrated curve routing, making the usage of this layout stage unnecessary (see routing styles CURVED and CURVED).
Using the scope, it is possible to select for which edges the path is converted to a curved one. This allows to only change a subset of edges. Furthermore, the CurveRoutingEdgeDescriptor class allows to individually configure settings for edges.
This stage is able to consider node and edge labels, see the respective properties nodeLabelPlacement and edgeLabelPlacement. If edge labels are considered, the EdgeLabelPreferredPlacement is respected too, such that the preferred placement remains correct if it is already correct after the core layout execution.
This stage also supports edge grouping such that edges that are correctly grouped by the core layout algorithm remain grouped in the curved layout result. However, it will not create new groupings. The same applies for other features like, e.g., LayoutPortCandidates. They are only respected if they are already respected by the coreLayout.
Default Values of Properties
defaultEdgeDescriptor | CurveRoutingEdgeDescriptor
| |
edgeLabelPlacement | CONSIDER
| Edge labels are considered |
nodeLabelPlacement | CONSIDER
| Node labels are considered. |
Type Details
- yFiles module
- algorithms
Constructors
Creates a new CurveRoutingStage instance using the given optional coreLayout.
Parameters
A map of options to pass to the method.
- coreLayout - ILayoutAlgorithm
- The core layout algorithm
- defaultEdgeDescriptor - CurveRoutingEdgeDescriptor
- The default CurveRoutingEdgeDescriptor which provides settings that are considered when adding curves to the edge path for edges that have no individual descriptor assigned. This option either sets the value directly or recursively sets properties to the instance of the defaultEdgeDescriptor property on the created object.
- edgeLabelPlacement - BasicEdgeLabelPlacement
- Whether or not edge labels are considered when determining curved edge routes. This option sets the edgeLabelPlacement property on the created object.
- nodeLabelPlacement - BasicNodeLabelPlacement
- Whether or not node labels are considered by the layout stage. This option sets the nodeLabelPlacement property on the created object.
- enabled - boolean
Properties
Gets or sets the core ILayoutAlgorithm that is wrapped by this stage.
Gets or sets the default CurveRoutingEdgeDescriptor which provides settings that are considered when adding curves to the edge path for edges that have no individual descriptor assigned.
Default Value
CurveRoutingEdgeDescriptor.Property Value
Throws
- Exception({ name: 'ArgumentError' })
- if the specified
is null
See Also
Gets or sets whether or not edge labels are considered when determining curved edge routes.
Remarks
Default Value
Property Value
See Also
Gets or sets a value that determines whether this stage should do anything but execute the coreLayout.
Remarks
By default, when constructed, stages should be enabled. Users may disable a stage's functionality by setting this property to false
.
Stages that can guarantee that the graph will not change can choose to not even execute the coreLayout when disabled.
Implements
Gets or sets whether or not node labels are considered by the layout stage.
Remarks
Default Value
Property Value
Methods
Implementation of the ILayoutAlgorithm interface and main entry point for the layout calculation.
Remarks
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- The graph to apply the layout to.
Implements
Adds curved segments to the edge routes produced by the coreLayout.
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- the input graph
Implements
createLayoutData
(graph: LayoutGraph) : EdgeScopeData<LayoutNode,LayoutEdge,LayoutNodeLabel,LayoutEdgeLabel,boolean>Returns an instance of LayoutData<TNode,TEdge,TNodeLabel,TEdgeLabel> that can be used to define the edges affected by the CurveRoutingStage.
Remarks
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- the graph that determines the generic type arguments of the created layout data
Returns
- ↪EdgeScopeData<LayoutNode,LayoutEdge,LayoutNodeLabel,LayoutEdgeLabel,boolean>
- an instance of layout data that can be used to perform item-specific configurations for the given CurveRoutingStage.
Returns an instance of LayoutData<TNode,TEdge,TNodeLabel,TEdgeLabel> that can be used to define the edges affected by the CurveRoutingStage.
Remarks
Parameters
A map of options to pass to the method.
- graph - IGraph
- the graph that determines the generic type arguments of the created layout data
Returns
- ↪EdgeScopeData<INode,IEdge,ILabel,ILabel,boolean>
- an instance of layout data that can be used to perform item-specific configurations for the given CurveRoutingStage.
LayoutExecutor
type is available at runtime.Constants
A data key for specifying individual edge layout information.
Remarks
Assign a CurveRoutingEdgeDescriptor to an edge to provide routing information for the edge, or null
if the defaultEdgeDescriptor should be used.
If the IMapper<K,V> registered with this key does not contain a CurveRoutingEdgeDescriptor for an edge, then the default descriptor is used.