This layout algorithm arranges graphs in a radial fashion.
Remarks
Layout Style
The nodes are distributed into circles (layers) around a common center based on predefined layering strategies. Some potential applications include visualization of social networks, data clustering and bioinformatics.
360
.
Concept
The layout algorithm creates a virtual tree structure for the input graph whose root node is placed in the center of the circles. All children of a tree node are placed on a higher layer (i.e. on a circle of larger radius) than their parent. A sector is calculated for each node such that the sector of each child node in the virtual tree is a sub-sector of its parent's sector. The radii of the circles are calculated based on the sizes of the sectors required to accommodate each whole subtree.
Features
There are different center nodes policies that can be applied in order to determine the nodes that will be placed in the center (single center node) or on the innermost circle (more than one center node). The distribution of the nodes to the circles is specified by a layeringStrategy.
The edges are routed based on the edgeRoutingStyle. Note that the edge routing cannot always prevent node-edge overlaps.
The minimum distance between nodes of the same circle is specified using minimumNodeDistance. If there are too many nodes assigned to a circle, the radius of the particular circle will be increased until all nodes fit onto it.
The distance between consecutive layers is specified using layerSpacing. The radii of the circles are a multiple of this spacing value. If the layer spacing is 0
, the radii are chosen such that all nodes fit on their corresponding circles. A minimum layer distance is specified by minimumLayerDistance.
The RadialLayout also supports nodeTypes as a subordinate criterion for nodes of the same circle. More precisely, for nodes of the same circle (i.e., within the same layer), the algorithm prefers to place nodes of the same type next to each other if this does not induce additional crossings or conflicts with other constraints. Note that the algorithm uses an additional local optimization heuristic to improve the placement with respect to node types and, thus, does not guarantee optimal results. Furthermore, this additional step may increase the required runtime. The layer assignment is not affected by the node types.
The ordering of successor nodes can be specified by means of a mapper, see childOrder. This ordering criterion is stronger than the node types. This feature is especially suitable for tree-like graphs to sort child nodes.
This layout algorithm handles port placement constraints by applying the PortPlacementStage as a postprocessing step.
Layout Stages
This class provides a configurable pipeline that contains various ILayoutStages. Each ILayoutStage can incorporate preprocessing or postprocessing steps into the layout calculation to streamline the input graph and enhance the resulting layout. Additionally, custom ILayoutStages can be added and executed either before or after the predefined ones.
The following default ILayoutStages are included:
- PortPlacementStage
- GroupHidingStage
- ComponentLayout (disabled per default)
- GenericLabeling (disabled per default)
- SelfLoopRouter
- ParallelEdgeRouter
- TreeReductionStage (disabled per default)
With these layoutStages the layout algorithm is configured well, so they usually don't need to be changed.
Performance
The RadialLayout algorithm is a fast algorithm that is generally well-suited to handle even large graphs.
With disconnected graphs containing large unconnected components, it can be beneficial to change the component arrangement style of the used componentLayout from the default style PACKED_CIRCLE to the faster ROWS style.
With graphs containing a large number of edges, applying edgeBundling can cause the algorithm to take noticeably longer to arrive at a result.
Default Values of Properties
centerNodesPolicy | WEIGHTED_CENTRALITY
| The node determined using weighted centrality is placed in the center. |
edgeLabelPlacement | IGNORE
| Edge labels are placed by an independent labeling algorithm. |
edgeRoutingStyle | ARC
| The edges will be routed as arcs. |
layeringStrategy | BFS
| The layers are determined using BFS. |
layerSpacing | 25 | |
minimumEdgeDistance | 50 | |
minimumLayerDistance | 100 | |
minimumNodeDistance | 10 | |
nodeLabelPlacement | CONSIDER
| Node labels are considered. |
Type Details
- yFiles module
- algorithms
Constructors
Creates a new RadialLayout instance with the default settings.
Parameters
A map of options to pass to the method.
- minimumNodeDistance - number
- The minimum distance between two neighboring nodes of the same circle. This option sets the minimumNodeDistance property on the created object.
- layerSpacing - number
- The spacing between two consecutive circles (layers). This option sets the layerSpacing property on the created object.
- minimumLayerDistance - number
- The minimum distance between two circles. This option sets the minimumLayerDistance property on the created object.
- maximumChildSectorAngle - number
- The maximum angle in degrees of the sector around a node within which the node's children will be placed. This option sets the maximumChildSectorAngle property on the created object.
- minimumBendAngle - number
- The minimum bend angle (in degrees) between two adjacent edge segments. This option sets the minimumBendAngle property on the created object.
- centerNodesPolicy - CenterNodesPolicy
- The policy that determines which nodes are selected as roots of the (virtual) tree for the layout process and are set in the center of the circles. This option sets the centerNodesPolicy property on the created object.
- layeringStrategy - RadialLayeringStrategy
- The layering strategy that determines how nodes are distributed into different layers. This option sets the layeringStrategy property on the created object.
- edgeRoutingStyle - RadialLayoutRoutingStyle
- The edge routing style. This option sets the edgeRoutingStyle property on the created object.
- nodeLabelPlacement - RadialNodeLabelPlacement
- How the layout algorithm handles node labels. This option sets the nodeLabelPlacement property on the created object.
- edgeLabelPlacement - RadialEdgeLabelPlacement
- How the layout handles the position of edge labels. This option sets the edgeLabelPlacement property on the created object.
- minimumSectorDistance - number
- The distance between neighboring nodes on the outermost circle that do not share the same predecessor on the previous circle. This option sets the minimumSectorDistance property on the created object.
- createControlPoints - boolean
- Whether or not the points of the resulting edge path represent cubic bezier control points. This option sets the createControlPoints property on the created object.
- nodeLabelSpacing - number
- The distance between node labels belonging to the same node. This option sets the nodeLabelSpacing property on the created object.
- minimumEdgeDistance - number
- The minimum distance between two neighboring edges of the same circle. This option sets the minimumEdgeDistance property on the created object.
Properties
Gets or sets the policy that determines which nodes are selected as roots of the (virtual) tree for the layout process and are set in the center of the circles.
Remarks
Default Value
WEIGHTED_CENTRALITY.The node determined using weighted centrality is placed in the center.
Property Value
Gets the ComponentLayout from the layoutStages of this instance.
Remarks
Throws
- Exception({ name: 'InvalidOperationError' })
- If there is no instance of the respective type in the
Gets or sets whether or not the points of the resulting edge path represent cubic bezier control points.
Remarks
- Disabled (default): Each point of the path represents a normal polyline bend point.
- Enabled: Four consecutive points p1, p2, p3, p4 of the resulting edge path need to be interpreted such that p1 is the start point of the cubic bezier curve, p4 is the end point of it and p2, p3 are the two intermediate control points. If p4 is not the last point of the edge path it is at the same time the start point of the next curve. For example, points p1, p2, p3, p4, p5, p6, p7 form a path that consists of two curves: the curve defined by p1, p2, p3, p4 and the curve defined by p4, p5, p6, p7.
Default Value
false
.Each point is a normal polyline bend point.
Property Value
true
if the bends are interpreted as cubic bezier control points, false
otherwiseGets the EdgeBundling instance that defines the settings of the edge bundling feature.
Remarks
Property Value
Gets or sets how the layout handles the position of edge labels.
Default Value
Property Value
Gets or sets the edge routing style.
Default Value
Property Value
Gets or sets the layering strategy that determines how nodes are distributed into different layers.
Remarks
All nodes of a given layer will be placed on the same circle.
If the predefined strategies for assigning layers or circles are not suitable for your specific use case, you can use layerIds to define your own strategy. In this case the layeringStrategy will be ignored.
Default Value
Property Value
Gets or sets the spacing between two consecutive circles (layers).
Remarks
The spacing is a non-negative value, where 0
means that no spacing is considered.
The radius of each circle will be a multiple of this value.
Default Value
25
.Property Value
Throws
- Exception({ name: 'ArgumentError' })
- if the spacing value is negative
Sample Graphs
Gets the mutable stack of ILayoutStage that will be applied to this layout.
Gets or sets the maximum angle in degrees of the sector around a node within which the node's children will be placed.
Remarks
Default Value
180
.Property Value
[0,360]
Throws
- Exception({ name: 'ArgumentError' })
- if the sector angle is negative or greater than
360
degrees
Sample Graphs
Gets or sets the minimum bend angle (in degrees) between two adjacent edge segments.
Remarks
0
and 90
degrees.Default Value
5
.Property Value
[0,90]
Throws
- Exception({ name: 'ArgumentError' })
- if the given minimum bend angle is negative or greater than
90
Sample Graphs
Gets or sets the minimum distance between two neighboring edges of the same circle.
Default Value
50
.Property Value
Throws
- Exception({ name: 'ArgumentError' })
- if the given minimum distance is negative
Sample Graphs
Gets or sets the minimum distance between two circles.
Default Value
100
.Property Value
Throws
- Exception({ name: 'ArgumentError' })
- if the minimum layer distance is negative
Sample Graphs
Gets or sets the minimum distance between two neighboring nodes of the same circle.
Default Value
10
.Property Value
Throws
- Exception({ name: 'ArgumentError' })
- if the given minimum distance is negative
Sample Graphs
Gets or sets the distance between neighboring nodes on the outermost circle that do not share the same predecessor on the previous circle.
Remarks
Default Value
0
.The nodes are distributed evenly.
Property Value
See Also
Sample Graphs
Gets or sets how the layout algorithm handles node labels.
Default Value
Property Value
- IGNORE if node label positions relative to their owner should be maintained and ignored during the layout process.
- CONSIDER if node label positions relative to their owner should be maintained and considered for the placement of other graph elements to avoid overlaps.
- HORIZONTAL if horizontal node label positions should be calculated by this layout algorithm, assuring that no overlaps occur.
- RAY_LIKE if ray-like node label positions should be calculated by this layout algorithm, assuring that no overlaps occur.
- RAY_LIKE_LEAVES if a mix of horizontal and ray-like node label positions should be calculated by this layout algorithm, assuring that no overlaps occur.
- GENERIC if the node labels should be placed by an independent labeling algorithm. The used generic labeling algorithm can be accessed for further configuration on the layoutStages, using get.
See Also
Sample Graphs
Gets or sets the distance between node labels belonging to the same node.
Remarks
It also defines the distance between labels and the node they belong to in case of label placement outside of the node (e.g. for ray-like label placement).
The spacing must have a non-negative value.
Default Value
2.0
.Property Value
Throws
- Exception({ name: 'ArgumentError' })
- if the given spacing value is negative
See Also
Sample Graphs
0
, node labels will be maximally close to each other and to their node.Gets the ParallelEdgeRouter from the layoutStages of this instance.
Remarks
Throws
- Exception({ name: 'InvalidOperationError' })
- If there is no instance of the respective type in the
Gets the SelfLoopRouter from the layoutStages of this instance.
Remarks
Throws
- Exception({ name: 'InvalidOperationError' })
- If there is no instance of the respective type in the
Gets the TreeReductionStage from the layoutStages of this instance.
Remarks
Throws
- Exception({ name: 'InvalidOperationError' })
- If there is no instance of the respective type in the
Methods
Calculates a radial arrangement for the given graph.
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- the input graph
Implements
Calculates a radial arrangement for the given graph.
createLayoutData
(graph: LayoutGraph) : RadialLayoutData<LayoutNode,LayoutEdge,LayoutNodeLabel,LayoutEdgeLabel>Returns an instance of LayoutData<TNode,TEdge,TNodeLabel,TEdgeLabel> that can be used to perform item-specific configurations for the RadialLayout.
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
- ↪RadialLayoutData<LayoutNode,LayoutEdge,LayoutNodeLabel,LayoutEdgeLabel>
- an instance of layout data that can be used to perform item-specific configurations for the given RadialLayout.
Returns an instance of LayoutData<TNode,TEdge,TNodeLabel,TEdgeLabel> that can be used to perform item-specific configurations for the RadialLayout.
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
- ↪RadialLayoutData<INode,IEdge,ILabel,ILabel>
- an instance of layout data that can be used to perform item-specific configurations for the given RadialLayout.
LayoutExecutor
type is available at runtime.Constants
A data key for marking custom nodes that should be placed in the center.
Remarks
See Also
A data key for providing user-defined layer/circle IDs.
Remarks
If the predefined strategies for assigning layers or circles are not suitable for your specific use case, you can use this data key to define your own strategy.
Assign a non-negative integer value to a node for representing its layer/circle ID.
The IMapper<K,V> registered with this key provides for each node the layer/circle ID to which it belongs. Nodes with the same ID are placed on the same circle while the circles are sorted according to their IDs such that a smaller ID means that the circle has a smaller radius and is closer to the center of the radial layout.
When providing user-defined IDs, the center nodes (nodes on the innermost circle) are not determined by the specified centerNodesPolicy anymore. Instead, the nodes with the smallest given ID (i.e. 0
) define the set of center nodes.
See Also
A data key for publishing the circle ID and sector data.
Remarks
See Also
A data key for specifying the comparator for the outgoing edges which ultimately orders the successor nodes of a node.