C

CircularLayout

This layout algorithm arranges graphs in a circular fashion.
ImplementsInheritance Hierarchy

Remarks

Layout Style

The nodes are arranged in circles and stars which emphasize group and tree structures inside a graph. Circular layout algorithms find applications in many areas such as social networking, network management, WWW visualization, eCommerce, telecommunications.

Circular layout with default settings

Circular layout with SINGLE_CYCLE partitioning policy

Circular layout with SINGLE_CYCLE partitioning policy and exterior edge routing

Concept

The layout algorithm performs three steps when calculating a circular arrangement for a graph:

  1. It searches for partitions in the input graph depending on connectivity and on the given partitioningPolicy. Considering each partition as a node, the resulting graph has a tree-like structure.
  2. The partitions are laid out as circles using the selected style.
  3. The algorithm delegates the layout calculation for the underlying tree (in which each node corresponds to a partition) to a specialized layout algorithm accessible by backboneLayout. The partitions are moved to their final location.

Features

The layout algorithm places the nodes in circles that represent a partition. There are several ways to find partitions in the input graph. Which one is applied is defined using partitioningPolicy.

The nodes in a partition can either lie on or in the interior of a circle. The placement of the nodes affects the compactness of the layout and can be specified using partitionDescriptor.

Since edges are routed as straight lines, they may overlap with nodes or node labels. To resolve these overlaps, an edge routing algorithm (e.g. EdgeRouter or OrganicEdgeRouter) can be appended.

Edges that belong to the same circle partition can be routed around the exterior of the circle. The edgeRoutingPolicy determines which edges are exterior and routing details of these edges can be configured via exteriorEdgeDescriptor. Exterior edge routes consist of smooth arcs. Edges that are routed externally can significantly improve the readability of the circular layout by reducing the edge clutter in the interior of the circle. This holds true especially for graph with a large number of edges. On the other hand, it significantly increases the amount of required space and, thus, is not recommended when maximally compact layouts are desired.

This layout algorithm supports edgeBundling. In order to bundle the edges, the nodes of the graph are clustered in groups. Edge bundling is supported only if the partition style is set to CYCLE and partitioningPolicy is other than BCC_ISOLATED.

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:

With these layoutStages the layout algorithm is configured well, so they usually don't need to be changed.

Performance

The CircularLayout algorithm is a fast algorithm that is generally well-suited to handle even large graphs.

With disconnected graphs that contain 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

NameDefaultDescription
edgeLabelPlacementRadialEdgeLabelPlacement.GENERIC
Edge labels are placed by an independent labeling algorithm.
edgeRoutingPolicyCircularLayoutEdgeRoutingPolicy.INTERIOR
Edges are routed as simple straight lines on the interior.
fromSketchModefalse
The layout algorithm does not consider the initial coordinates of the nodes.
maximumDeviationAngle90
nodeLabelPlacementRadialNodeLabelPlacement.CONSIDER
Node labels are considered.
partitioningPolicyCircularLayoutPartitioningPolicy.BCC_COMPACT
placeChildrenOnCommonRadiustrue
Children are placed on a common radius.

See Also

Developer's Guide

Members

Show:

Constructors

Creates a new CircularLayout instance with the default settings.

Parameters

Properties

Gets the RadialTreeLayout instance used for arranging multiple partitions.
Configuring this layout algorithm affects the arrangement of the partitions within the overall layout.
readonlyfinal

Property Value

the RadialTreeLayout instance that arranges the partitions

See Also

Developer's Guide
API
partitioningPolicy
Gets the ComponentLayout from the layoutStages of this instance.
If you need to replace the instance, modify the layoutStages stack using replace.
readonlyfinal

Throws

Exception ({ name: 'InvalidOperationError' })
If there is no instance of the respective type in the layoutStages
Gets the EdgeBundling instance that defines the settings of the edge bundling feature.
The specified EdgeBundling defines global bundling properties. Settings for individual edges can be defined by assigning an EdgeBundleDescriptor to an edge with edgeBundleDescriptors.
To enable bundling for all edges, set a defaultBundleDescriptor which has bundling enabled.
When using custom partitions, edge bundles between different groups might in some cases intersect with other groups.
Edge bundling is supported only if partition layout style is set to CYCLE and the partitioningPolicy is other than BCC_ISOLATED.
Edges that are routed in an exterior fashion (see edgeRoutingPolicy) are never bundled, even when they are associated with a bundling descriptor.
readonlyfinal

Property Value

the EdgeBundling instance defining the edge bundling setup

See Also

Developer's Guide
Gets or sets the descriptor that defines settings for the non-exterior edges, that is, edges that are routed within or between circle partitions.
The affected edges are the ones routed within circles (source and target node are in the same partition) or between circles (source and target node are in different partitions). Exterior edges are not affected. The edgeRoutingPolicy determines which edges are not exterior (if any).
final

Property Value

the descriptor which defines settings for edges

Throws

Exception ({ name: 'ArgumentError' })
if the given descriptor is null

See Also

API
edgeRoutingPolicy, exteriorEdgeDescriptor
Gets or sets how the layout handles the position of edge labels.
conversionfinal

Property Value

IGNORE if the edge labels are ignored by the layout algorithm, and GENERIC if the edge labels are placed by an independent labeling algorithm. The used generic labeling algorithm can be accessed for further configuration on the layoutStages, using get.

Default Value

The default value is: RadialEdgeLabelPlacement.GENERIC
Edge labels are placed by an independent labeling algorithm.

See Also

Developer's Guide
Gets or sets the edge routing policy that determines whether edges are routed internally or externally with respect to a single partition circle.

There are two types of supported edges, exterior and non-exterior edges.

  1. Non-exterior edges are routed as simple straight lines that directly connect the source and target node. This is the default style for the circular layout.
  2. Exterior edges get an arc-like curved path around the exterior of the circle. Only edges between nodes of the same partition (i.e. on the same circle) can be exterior edges. These edges may be beneficial in cases with a large number of edge crossings inside the circle: by moving some edges out, the number of crossings is reduced and the layout may become more readable. The drawback is the larger space that is required.

If the predefined routing policies for controlling the routing of edges inside and outside of circles are not suitable for your specific use case, you can use the exteriorEdges property to define your own policy.

Only exterior edges contain bends to model the arc-like edge path on the exterior of the circle.
conversionfinal

Property Value

one of the predefined edge routing policies

Default Value

Edges are routed as simple straight lines on the interior.

See Also

Developer's Guide
Gets or sets the descriptor that defines settings for the exterior edges.
Exterior edges are routed around the exterior of a circle partition. Only edges connecting nodes of the same partition can be exterior. The edgeRoutingPolicy determines which edges are exterior (if any).
The descriptor is completely ignored when using routing policy INTERIOR, which is the default policy.
final

Property Value

the descriptor which defines settings for exterior edges

Throws

Exception ({ name: 'ArgumentError' })
if the given descriptor is null

See Also

Developer's Guide
API
edgeRoutingPolicy, edgeDescriptor
Gets or sets whether or not to take the coordinates of the input diagram into account when arranging the nodes of the partitions and the partitions themselves.

If enabled:

  • For complex partitions (those consisting of more than one node), the layout algorithm tries to keep peripheral nodes and maintain their circular order around the center of the disk/circle. Other partitions that connect to this node are moved accordingly, if possible.
  • For multiple partitions that connect to the same node, the layout algorithm tries to keep their circular order around this node. This only works as expected for BCC_COMPACT as partitioning policy, since otherwise the underlying tree structure is not well-defined.

This setting has no effect if there is a user-defined nodeComparator set or edge bundling is enabled. nodeTypes are not considered for the node order if fromSketchMode enabled.

Switching between different partitioning policies or partition layout styles can lead to unexpected results.
final

Property Value

true if the initial coordinates of the nodes are used, false otherwise

Default Value

The default value is: false
The layout algorithm does not consider the initial coordinates of the nodes.

Sample Graphs

ShownSetting: Order of nodes when From Sketch mode is disabled

See Also

Developer's Guide
Gets or sets the maximum deviation angle in degrees allowed for an edge.
The deviation angle for an edge is the difference between its optimal angle away from the parent cycle and its actual angle.
Using a small maximum deviation angle may significantly increase the length of the edges. The same holds if a small preferredChildSectorAngle is set on the backboneLayout.
final

Property Value

the maximum deviation angle given in degrees

Default Value

The default value is: 90

Sample Graphs

ShownSetting: Maximum deviation angle is 20 degrees.

See Also

Developer's Guide
Gets or sets how the layout handles the position of node labels.
Optimal label placement with integrated labeling can be achieved using a label model which allows free placement of node labels.
conversionfinal

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.

Default Value

The default value is: RadialNodeLabelPlacement.CONSIDER
Node labels are considered.

Sample Graphs

ShownSetting: IGNORE

See Also

Developer's Guide
Gets or sets the distance between node labels belonging to the same node.

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.

With a spacing of 0, node labels will be maximally close to each other and to their node.
The spacing value has an effect only if nodeLabelPlacement is set to one of HORIZONTAL, RAY_LIKE or RAY_LIKE_LEAVES.
final

Property Value

the non-negative node label spacing

Throws

Exception ({ name: 'ArgumentError' })
if the given spacing value is negative

Default Value

The default value is: 2.0

Sample Graphs

ShownSetting: Default node label spacing of 2.0

See Also

API
nodeLabelPlacement
Gets the ParallelEdgeRouter from the layoutStages of this instance.
If you need to replace the instance, modify the layoutStages stack using replace.
readonlyfinal

Throws

Exception ({ name: 'InvalidOperationError' })
If there is no instance of the respective type in the layoutStages
Gets or sets the descriptor that defines settings for the layouts of the circle partitions.
final

Property Value

The descriptor that defines settings for the layouts of the circle partitions.

See Also

Developer's Guide
API
partitioningPolicy
Gets or sets the global partitioning policy for this layout algorithm.

This property allows to define how nodes within the input graph are partitioned by the CircularLayout. Each policy dictates a different method of partitioning nodes.

The arrangement of individual partitions can be controlled with the partitionDescriptor property.

If the predefined policies do not suit specific needs, custom partitions can be defined using the partitions property. In this case, the value of partitioningPolicy will be ignored.

conversionfinal

Property Value

one of the predefined partitioning policies

Default Value

See Also

Developer's Guide
API
partitionDescriptor
Gets or sets whether or not, in the underlying tree, the children of a tree node are placed on a common radius.
Disabling this feature may produce more compact layout results.
final

Property Value

true if a common radius is used, false otherwise

Default Value

The default value is: true
Children are placed on a common radius.

Sample Graphs

ShownSetting: false

See Also

Developer's Guide
Gets the SelfLoopRouter from the layoutStages of this instance.
If you need to replace the instance, modify the layoutStages stack using replace.
readonlyfinal

Throws

Exception ({ name: 'InvalidOperationError' })
If there is no instance of the respective type in the layoutStages
Gets or sets the minimum size (number of nodes including the root) a star needs to have to be detected and handled as a star substructure.
This setting has no effect if style NONE is specified.
final

Property Value

the minimum number of nodes, including the root, a star structure needs to contain to be detected as a substructure

Throws

Exception ({ name: 'ArgumentError' })
if the given minimum size is less than 3

Default Value

The default value is: 4

See Also

Developer's Guide
API
starSubstructureStyle
Gets or sets the layout style for star substructures.

A star consists of a set of nodes with degree one that are all connected to the same node (called the root of the star). Use property starSubstructureSize to define the minimum number of nodes, including the root, a star must contain to be detected as a substructure.

If there are user-defined nodeTypes, by default, a star substructure only contains nodes of the same type or only nodes without a type (i.e. null as type). This way, node types can be used to control which elements are allowed to form a substructure.

If the directedness of edges is defined with edgeDirectedness and the style is set to SEPARATED_RADIAL, all edges of the star must have the same direction. Otherwise, the edge directedness is ignored.
conversionfinal

Property Value

one of the predefined styles for star substructures

Default Value

Stars are not detected and not handled in a special way.

See Also

Developer's Guide
API
starSubstructureSize, edgeDirectedness
Gets or sets whether star substructures should be separated by the node type.
If this option is enabled and there are nodeTypes specified, all star substructures only contain nodes of the same type. Otherwise, if this option is disabled, a star substructure may contain nodes of different type. The algorithm still tries to highlight the different types by choosing a suitable layout for these components (e.g., placing nodes of the same type closer together or on the same circle).
This setting only has an effect if nodeTypes are specified and if the star substructure style is not set to NONE.
If this property is enabled and there are star substructures of different type incident to the same root node the behavior is as follows: if the substructure style is set to SEPARATED_RADIAL, the algorithm creates a separate star substructure for each type that is connected to the root. Otherwise, for substructure style RADIAL, only the nodes of the largest substructure receive special handling while the other nodes are handled like common nodes that are not part of a star substructure.
final

Property Value

true if star substructures are separated by node type, false if they may contain nodes of different types

Default Value

The default value is: true
Star substructures are strictly separated by node type.

Sample Graphs

ShownSetting: Type separation is enabled, yielding two star structures

See Also

Developer's Guide
API
starSubstructureStyle, nodeTypes

Methods

Calculates a circular layout for the given graph.

The given graph will not be copied during the layout process and the layout will be immediately applied to the given graph.

This method is not side effect-free in the sense that the order of edges or nodes in the input graph may change during the layout process.

Parameters

graph: LayoutGraph
the input graph
Arranges the given graph in a circular fashion.
protectedfinal

Parameters

graph: LayoutGraph
the input graph
Returns an instance of LayoutData<TNode, TEdge, TNodeLabel, TEdgeLabel> that can be used to perform item-specific configurations for the CircularLayout.
The generic type arguments of the created layout data are compatible with instances of LayoutGraph, but the layout data is not bound to a specific graph instance. Therefore, the created layout data still has to be passed as an argument of applyLayout in order to be applied.

Parameters

graph: LayoutGraph
the graph that determines the generic type arguments of the created layout data

Return Value

CircularLayoutData<LayoutNode, LayoutEdge, LayoutNodeLabel, LayoutEdgeLabel>
an instance of layout data that can be used to perform item-specific configurations for the given CircularLayout.
Returns an instance of LayoutData<TNode, TEdge, TNodeLabel, TEdgeLabel> that can be used to perform item-specific configurations for the CircularLayout.
The generic type arguments of the created layout data are compatible with instances of IGraph, but the layout data is not bound to a specific graph instance. Therefore, the created layout data still has to be passed as an argument of applyLayout in order to be applied.
This method is not available unless the module view-layout-bridge is loaded. Either load the module 'view-layout-bridge' explicitly or ensure that the LayoutExecutor type is available at runtime.

Parameters

graph?: IGraph
the graph that determines the generic type arguments of the created layout data

Return Value

CircularLayoutData<INode, IEdge, ILabel, ILabel>
an instance of layout data that can be used to perform item-specific configurations for the given CircularLayout.

Constants

All constants are filtered. Go to Filters.