Specifies custom data for the CactusGroupLayout.
Examples
The following example shows how to create a new instance of CactusGroupLayoutData and use it with a CactusGroupLayout:
In many cases the complete initialization of CactusGroupLayoutData can also be done in a single object initializer:
Type Details
- yfiles module
- view-layout-bridge
- yfiles-umd modules
- view-layout-bridge
- Legacy UMD name
- yfiles.layout.CactusGroupLayoutData
See Also
Constructors
Creates a new instance of this class.
Parameters
A map of options to pass to the method.
- abortHandler - AbortHandler
The AbortHandler used during the layout. This option sets the abortHandler property on the created object.
- nodeHalos - ItemMapping<INode,NodeHalo>
- collapsedSubtreeRoots - ItemCollection<INode>
The roots of collapsed subtrees in the hierarchy. This option sets the collapsedSubtreeRoots property on the created object.
- parentOverlapRatios - ItemMapping<INode,number>
The mapping from nodes to the overlap they have with their parent in the hierarchy. This option sets the parentOverlapRatios property on the created object.
- edgeBundleDescriptors - ItemMapping<IEdge,EdgeBundleDescriptor>
The mapping of edges to their EdgeBundleDescriptor when using edgeBundling. This option sets the edgeBundleDescriptors property on the created object.
- nodeComparer - function(INode, INode):number
A comparison function used to sort the child nodes of parent nodes. This option sets the nodeComparer 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 roots of collapsed subtrees in the hierarchy.
Remarks
Examples
The items property can be used to easily define several nodes as roots of collapsed subtrees:
Alternatively, a delegate can be used to decide which nodes are roots of collapsed subtrees based on custom user data:
See Also
Sample Graphs
Gets or sets the mapping of edges to their EdgeBundleDescriptor when using edgeBundling.
Remarks
Bundling together multiple edges means that their common parts are to some degree merged into a bundled part. At the source and target point, the edges are again clearly split.
If an edge is mapped to null
, the default descriptor is used.
See Also
Gets or sets a comparison function used to sort the child nodes of parent nodes.
Remarks
Setting a comparison function sorts child nodes in the same way as the nodeComparer property on the CactusGroupLayout itself, with the difference that the comparison function is conveniently defined for INode instances instead of YNode instances.
If no comparison function is specified, the child nodes are sorted according to the value of property nodeComparer.
See Also
Gets or sets the mapping from nodes to their NodeHalo.
Remarks
Examples
The easiest option is to reserve the same space around all nodes, by setting a constant NodeHalo:
Handling only certain nodes differently can be done easily by using the mapper property:
In cases where the NodeHalo for each node can be determined by looking at the node itself it's often easier to just set a delegate instead of preparing a mapper:
See Also
Gets or sets the mapping from nodes to the overlap they have with their parent in the hierarchy.
Remarks
Examples
The overlap ratio can be changed globally for all nodes by using a constant as follows:
Handling only certain nodes differently can be done by using the mapper property:
See Also
Sample Graphs
0.2
.[0, 1]
.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.