Specifies the layout data for the CurveRoutingStage.
Type Details
- yfiles module
- view-layout-bridge
- yfiles-umd modules
- view-layout-bridge
- Legacy UMD name
- yfiles.router.CurveRoutingStageData
Constructors
Creates a new instance of CurveRoutingStageData which helps configuring the CurveRoutingStage.
Parameters
A map of options to pass to the method.
- affectedEdges - DpKeyItemCollection<IEdge>
The collection of affected edges whose paths will be replaced by curved paths. This option sets the affectedEdges property on the created object.
- affectedNodes - DpKeyItemCollection<INode>
The collection of affected nodes, meaning that the paths of all edges adjacent to an affected node will be replaced by curved paths. This option sets the affectedNodes property on the created object.
- edgeLayoutDescriptors - ItemMapping<IEdge,CurveEdgeLayoutDescriptor>
The mapping of edges to their CurveEdgeLayoutDescriptor This option sets the edgeLayoutDescriptors property on the created object.
- abortHandler - AbortHandler
The AbortHandler used during the layout. This option sets the abortHandler property on the created object.
- partitionGridData - PartitionGridData
The partition grid layout data. This option sets the partitionGridData property on the created object.
- nodeHalos - ItemMapping<INode,NodeHalo>
- edgeLabelPreferredPlacement - ItemMapping<ILabel,PreferredPlacementDescriptor>
The mapping that provides a PreferredPlacementDescriptor instance for edge ILabels. This option sets the edgeLabelPreferredPlacement property on the created object.
- sourceGroupIds - ItemMapping<IEdge,Object>
A mapping from edges to an object representing their source edge group. This option sets the sourceGroupIds property on the created object.
- targetGroupIds - ItemMapping<IEdge,Object>
A mapping from edges to an object representing their target edge group. This option sets the targetGroupIds property on the created object.
Properties
Gets or sets the AbortHandler used during the layout.
Remarks
An AbortHandler can be used to gracefully stop or cancel a running layout and offers options for automatically doing so after a predetermined time.
An AbortHandler configured or set here overrides the one on LayoutExecutor.
Examples
The most common use case would be to just configure the AbortHandler here, e.g. to set timeouts for a graceful stop or canceling the running layout:
layoutData.abortHandler.stopDuration = TimeSpan.fromSeconds(10) layoutData.abortHandler.cancelDuration = TimeSpan.fromSeconds(30)
layoutData.abortHandler!.stopDuration = TimeSpan.fromSeconds(10) layoutData.abortHandler!.cancelDuration = TimeSpan.fromSeconds(30)
If there's already an AbortHandler instance that's pre-configured or will be used in a different place to, e.g., cancel the layout when the user presses a button, you can also set one explicitly:
layoutData.abortHandler = abortHandler
See Also
Gets or sets the collection of affected edges whose paths will be replaced by curved paths.
Remarks
Examples
Defining the subset of edges that should be laid out can be done in various ways, mostly depending on which option is more convenient for a particular use case. You can use the ItemCollection<TItem>'s source property to use any .NET collection or IEnumerable<T>:
Alternatively, ItemCollection<TItem> also has an items property, which is a collection that already exists, in case the items may have to be added one by one. This can be more convenient than defining an own list and setting it to source:
A powerful option that doesn't use a collection is to use the delegate to set a custom delegate that returns for every edge whether it is contained in the set or not:
See Also
Gets or sets the collection of affected nodes, meaning that the paths of all edges adjacent to an affected node will be replaced by curved paths.
Remarks
Examples
Defining the subset of nodes that should be laid out can be done in various ways, mostly depending on which option is more convenient for a particular use case. You can use the ItemCollection<TItem>'s source property to use any .NET collection or IEnumerable<T>:
Alternatively, ItemCollection<TItem> also has an items property, which is a collection that already exists, in case the items may have to be added one by one. This can be more convenient than defining an own list and setting it to source:
A powerful option that doesn't use a collection is to use the delegate to set a custom delegate that returns for every node whether it is contained in the set or not:
See Also
Gets or sets the mapping that provides a PreferredPlacementDescriptor instance for edge ILabels.
Remarks
Examples
Depending on how much customization is needed, some ways of setting PreferredPlacementDescriptors are more convenient than others. For example, to set the same descriptor for all labels, you can just use the constant property:
If some labels should use custom placement or this has to be configured ahead of time, you can use the mapper instead:
When the preferred placement can be inferred from the label itself, a delegate is usually the easiest choice:
Note that the preferred placement can also be inferred from an arbitrary ILabelModelParameter:
See Also
Gets or sets the mapping of edges to their CurveEdgeLayoutDescriptor
Remarks
A descriptor provides additional routing information and allows to, e.g., specify individual minimum distance values that must be considered when routing an edge.
If an edge is mapped to null
, the CurveRoutingStage uses the the default descriptor.
See Also
Gets or sets the mapping from nodes to their NodeHalo.
Remarks
See Also
Gets or sets the partition grid layout data.
Remarks
Gets or sets a mapping from edges to an object representing their source edge group.
Remarks
Examples
One simple way to use source groups is to use the edge's source node as group ID which effectively groups all edges with the same source together:
Another useful way to use a delegate here would be grouping edges by some commonality, such as the same color:
If only certain edges should be grouped it may sometimes be easier to use the mapper to set the group IDs:
See Also
Gets or sets a mapping from edges to an object representing their target edge group.
Remarks
Examples
One simple way to use source groups is to use the edge's target node as group ID which effectively groups all edges with the same target together:
Another useful way to use a delegate here would be grouping edges by some commonality, such as the same color:
If only certain edges should be grouped it may sometimes be easier to use the mapper to set the group IDs:
See Also
Methods
Combines this instance with the given layout data.
Remarks
Parameters
A map of options to pass to the method.
- data - LayoutData
- The LayoutData to combine this instance with.
Returns
- ↪LayoutData
- The combined layout data.