Specifies custom data for the CircularLayout.
Examples
The following example shows how to create a new instance of CircularLayoutData and use it with an CircularLayout:
In many cases the complete initialization of CircularLayoutData 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.circular.CircularLayoutData
See Also
Constructors
Creates a new instance of CircularLayoutData which helps configuring CircularLayout.
Parameters
A map of options to pass to the method.
- circleIds - IMapper<INode,number>
The mapper from nodes to their circle id. This option sets the circleIds property on the created object.
- customGroups - ItemMapping<INode,Object>
The mapping from nodes to their custom group object. This option sets the customGroups property on the created object.
- nodeHalos - ItemMapping<INode,NodeHalo>
- nodeTypes - ItemMapping<INode,Object>
The mapping from nodes to an object defining the node type which is considered during the layout. This option sets the nodeTypes property on the created object.
- abortHandler - AbortHandler
The AbortHandler used during the layout. This option sets the abortHandler property on the created object.
- edgeBundleDescriptors - ItemMapping<IEdge,EdgeBundleDescriptor>
The mapping of edges to their EdgeBundleDescriptor. This option sets the edgeBundleDescriptors property on the created object.
- exteriorEdges - ItemCollection<IEdge>
The collection of edges that are routed around the exterior of circle formed by each partition. This option sets the exteriorEdges property on the created object.
- edgeDirectedness - ItemMapping<IEdge,number>
The mapping from edges to their directedness. This option sets the edgeDirectedness 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 mapper from nodes to their circle id.
Remarks
Examples
See Also
Gets or sets the mapping from nodes to their custom group object.
Remarks
These groups will form the circles in the layout.
Nodes that are mapped to null
(or not explicitly mapped when using the mapper) will not be part of any circle.
Examples
Often you might already have some way of grouping nodes into specific circles, in which case the delegate property is usually the easiest, which allows you to derive the group identifier directly from each node:
Another option would be to explicitly assign nodes that should appear on a given circle their respective group identifier via the mapper property:
Finally, a rather pointless option would be to assign the same custom group identifier to all nodes, effectively forcing all nodes to be on the same circle:
As can be seen, there's an easier option for that.
See Also
Gets or sets the mapping of edges to their EdgeBundleDescriptor.
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.
If an edge is marked for exterior routing (see exteriorEdges), it is not bundled anymore.
See Also
Gets or sets the mapping from edges to their directedness.
Remarks
Generally, the circular layout algorithm doesn't consider the edge direction. Nevertheless, this property allows the user to specify hints on the directedness of edges. More precisely, a value of 1
(default) indicates that the edge should be considered to be directed from source to target, a value of -1
that it is directed from target to source, and a value of 0
means that it is undirected.
Currently, the specified values are only considered during the detection of star substructures if the substructure style is set to SEPARATED_RADIAL. Then, all edges forming a star substructure must have the same directedness (negative, zero or positive).
Examples
The easiest option is to define all edges with the same directedness:
Handling only certain edges differently can be done easily by using the mapper property:
In cases where the directedness for each edge can be determined by looking at the edge itself it's often easier to just set a delegate instead of preparing a mapper:
See Also
Gets or sets the collection of edges that are routed around the exterior of circle formed by each partition.
Remarks
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 an object defining the node type which is considered during the layout.
Remarks
Node types influence the layout in the following way:
If the style is SINGLE_CYCLE, or if property partitionStyle is set to CYCLE, the nodes of the cycles can be sorted by their type such that all nodes of the same type are consecutive. Therefore, the NodeTypeAwareSequencer must be specified as nodeSequencer of the singleCycleLayout. The specified node types also influence the layout of the cycle partitions which is done with an instance of the BalloonLayout.
In addition, node types also influence the detection of substructures. Currently, if a star substructure style is set (i.e., the property is not set to NONE), each detected substructure only contain nodes of the same type or only nodes without a type. Note that besides the node type, the substructure detection is also influenced by the EDGE_DIRECTEDNESS_DP_KEY.
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.