This layout algorithm places all nodes of a graph on a single cycle.
Remarks
Layout Style
All nodes of a graph are placed on one common circle, generating circular layouts. The edges are drawn as simple, straight lines. The resulting layouts look like a ring. Edges connecting nodes which are not next to each other on the ring are routed inside of the circle.
Single-cycle circular layouts are suitable for the visualization of networks such as ring networks or smaller social networks. They are also useful to layout cyclic subgraphs of a larger graph.
Concept
First, the nodes are sorted by applying either a custom or some default INodeSequencer. Then, all nodes are placed on a circle with an appropriate radius according to the calculated order.
Features
The order in which the nodes are placed on the circle is a crucial aspect of this algorithm. By specifying a INodeSequencer instance via nodeSequencer, the order can be customized.
There are two options to determine the radius of the circle on which nodes are placed:
- The radius can be determined automatically. A specified minimum radius will be obeyed when choosing the radius.
- The radius can be chosen manually. To do so, disable the automatic radius selection and specify the custom radius via fixedRadius.
Default Values of Properties
automaticRadius | true | The radius will be chosen automatically. |
fixedRadius | 200 | |
fromSketchMode | false | The coordinates of the input diagram are not considered. |
minimumNodeDistance | 30 | |
orientationLayoutEnabled | true | The orientation |
selfLoopRouterEnabled | true | The stage that routes self-loops is activated. |
Type Details
- yfiles module
- layout-organic
- yfiles-umd modules
- layout-multipage, layout-organic, layout
- Legacy UMD name
- yfiles.circular.SingleCycleLayout
See Also
Constructors
Creates a new SingleCycleLayout instance with default settings.
Parameters
A map of options to pass to the method.
- initialAngle - number
The angle that describes the location on the circle of the first node. This option sets the initialAngle property on the created object.
- fromSketchMode - boolean
Whether or not to consider the coordinates of the input diagram when arranging the graph. This option sets the fromSketchMode property on the created object.
- minimumNodeDistance - number
The minimum distance between nodes that are next to each other on the circle. This option sets the minimumNodeDistance property on the created object.
- fixedRadius - number
A fixed radius for the circle on which the nodes will be placed. This option sets the fixedRadius property on the created object.
- minimumRadius - number
The minimum radius for the circle on which the nodes are placed. This option sets the minimumRadius property on the created object.
- automaticRadius - boolean
Whether or not the radius of the circle should be determined automatically. This option sets the automaticRadius property on the created object.
- nodeSequencer - INodeSequencer
The custom INodeSequencer that will be used for determining the order of the nodes for the circle placement. This option sets the nodeSequencer property on the created object.
- orientationLayoutEnabled - boolean
Whether or not the ILayoutStage that modifies the orientation of the layout is activated. This option sets the orientationLayoutEnabled property on the created object.
- selfLoopRouterEnabled - boolean
Whether or not the ILayoutStage used for routing self-loops is activated. This option sets the selfLoopRouterEnabled property on the created object.
- labeling - ILayoutStage
The ILayoutStage that places the labels of the input graph. This option sets the labeling property on the created object.
- selfLoopRouter - ILayoutStage
The ILayoutStage that routes self-loops. This option sets the selfLoopRouter property on the created object.
- parallelEdgeRouter - ILayoutStage
The ILayoutStage that routes parallel edges. This option sets the parallelEdgeRouter property on the created object.
- componentLayout - ILayoutStage
The ILayoutStage that arranges the connected components of an input graph. This option sets the componentLayout property on the created object.
- subgraphLayout - ILayoutStage
The ILayoutStage that constrains the layout process to a subgraph of the input graph. This option sets the subgraphLayout property on the created object.
- hideGroupsStage - ILayoutStage
The ILayoutStage that hides the group nodes of the input graph. This option sets the hideGroupsStage property on the created object.
- orientationLayout - ILayoutStage
The ILayoutStage that modifies the orientation of a computed layout. This option sets the orientationLayout property on the created object.
- layoutOrientation - LayoutOrientation
The main orientation of the layout. This option sets the layoutOrientation property on the created object.
- labelingEnabled - boolean
Whether or not the ILayoutStage used for placing the labels of the input graph is activated. This option sets the labelingEnabled property on the created object.
- hideGroupsStageEnabled - boolean
Whether or not the ILayoutStage used for hiding group nodes is activated. This option sets the hideGroupsStageEnabled property on the created object.
- componentLayoutEnabled - boolean
Whether or not the ILayoutStage used for arranging the components of the graph is activated. This option sets the componentLayoutEnabled property on the created object.
- parallelEdgeRouterEnabled - boolean
Whether or not the ILayoutStage used for routing parallel edges is activated. This option sets the parallelEdgeRouterEnabled property on the created object.
- subgraphLayoutEnabled - boolean
Whether or not the ILayoutStage used for constraining the layout process to a subgraph of the input graph is activated. This option sets the subgraphLayoutEnabled property on the created object.
Properties
Gets or sets whether or not the radius of the circle should be determined automatically.
Remarks
If enabled, the radius will be chosen such that the distance between nodes which are next to each other on the circle is approximately the same as the minimum node distance.
If this feature is disabled, the radius specified via fixedRadius will be applied.
Default Value
true
.The radius will be chosen automatically.
See Also
Gets or sets the ILayoutStage that arranges the connected components of an input graph.
Default Value
ComponentLayout.See Also
Defined in
Gets or sets whether or not the ILayoutStage used for arranging the components of the graph is activated.
Remarks
Default Value
true
.The stage that arranges connected graph components is activated.
See Also
Defined in
Gets or sets a fixed radius for the circle on which the nodes will be placed.
Default Value
200
.Throws
- Exception({ name: 'ArgumentError' })
- if the given radius is negative
See Also
Sample Graphs
Gets or sets whether or not to consider the coordinates of the input diagram when arranging the graph.
Remarks
Default Value
false
.The coordinates of the input diagram are not considered.
Sample Graphs
Gets or sets the ILayoutStage that hides the group nodes of the input graph.
Default Value
HideGroupsStage.See Also
Defined in
Gets or sets whether or not the ILayoutStage used for hiding group nodes is activated.
Remarks
Default Value
true
.The stage responsible for hiding group nodes is activated.
See Also
Defined in
Gets or sets the angle that describes the location on the circle of the first node.
Remarks
0
means east, Pi/2
means south.Default Value
0.0
.The first node is placed east.
Sample Graphs
Gets or sets the ILayoutStage that places the labels of the input graph.
Default Value
See Also
Defined in
Gets or sets whether or not the ILayoutStage used for placing the labels of the input graph is activated.
Remarks
Default Value
false
.The stage responsible for label placement is deactivated.
See Also
Defined in
Gets or sets the main orientation of the layout.
Remarks
Default Value
TOP_TO_BOTTOM.Throws
- Exception({ name: 'ArgumentError' })
- if the specified orientation does not match a default layout orientation
See Also
Defined in
Gets or sets the minimum distance between nodes that are next to each other on the circle.
Default Value
30
.Throws
- Exception({ name: 'ArgumentError' })
- if the given distance is negative
See Also
Sample Graphs
Gets or sets the minimum radius for the circle on which the nodes are placed.
Default Value
5.0
.Throws
- Exception({ name: 'ArgumentError' })
- if the given minimum radius is negative
See Also
Gets or sets the custom INodeSequencer that will be used for determining the order of the nodes for the circle placement.
null
.Gets or sets the ILayoutStage that modifies the orientation of a computed layout.
Default Value
OrientationLayout.See Also
Defined in
Sets whether or not the ILayoutStage that modifies the orientation of the layout is activated.
Default Value
true
.The orientation
See Also
Overrides
Gets or sets the ILayoutStage that routes parallel edges.
Default Value
ParallelEdgeRouter.See Also
Defined in
Gets or sets whether or not the ILayoutStage used for routing parallel edges is activated.
Remarks
Default Value
true
.The stage that routes parallel edges is activated.
See Also
Defined in
Gets or sets the ILayoutStage that routes self-loops.
Default Value
SelfLoopRouter.See Also
Defined in
Sets whether or not the ILayoutStage used for routing self-loops is activated.
Default Value
true
.The stage that routes self-loops is activated.
See Also
Overrides
Gets or sets the ILayoutStage that constrains the layout process to a subgraph of the input graph.
Default Value
SubgraphLayout.See Also
Defined in
Gets or sets whether or not the ILayoutStage used for constraining the layout process to a subgraph of the input graph is activated.
Remarks
Default Value
false
.The stage that constrains the input graph to a subgraph is deactivated.
See Also
Defined in
Methods
Appends the given ILayoutStage to the layout pipeline.
Remarks
Parameters
A map of options to pass to the method.
- stage - ILayoutStage
- the ILayoutStage instance to be added
See Also
Defined in
Calculates a layout for the given graph and applies it directly to the graph.
Remarks
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- the input graph
See Also
Implements
Arranges the nodes of the given graph such that they all lie on a common circle.
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- the input graph
Implements
Checks the sizes of the nodes to be non-zero.
Parameters
A map of options to pass to the method.
- g - LayoutGraph
- The graph to check.
Defined in
Deactivates all predefined ILayoutStages so that upon applyLayout only the layout algorithm will be executed.
See Also
Defined in
Prepends the given ILayoutStage to the layout pipeline.
Remarks
Parameters
A map of options to pass to the method.
- stage - ILayoutStage
- the ILayoutStage instance to be added
See Also
Defined in
Removes the given ILayoutStage from the layout pipeline.
Remarks
Parameters
A map of options to pass to the method.
- stage - ILayoutStage
- a ILayoutStage to be removed from the layout pipeline