Packagecom.yworks.yfiles.layout.radial
Classpublic class RadialLayouter
InheritanceRadialLayouter Inheritance CanonicMultiStageLayouter Inheritance YObject Inheritance Object

Radial style layouter. This layouter places all nodes on circles around a common center.

A virtual tree structure is created for the graph whose root node is placed on the center of the circles. All children of a tree node are on a higher layer (i.e. larger circles) than their parent. A sector is calculated for each node so the sector of each child in the virtual tree is a sub-sector of its parent's sector. The radii of the circles are calculated taking the sector size needed by the whole subtree into account.

There are different center nodes policies (centerNodesPolicy) that can be used to determine which nodes shall be placed on the center (single center node) or on the innermost circle (several center nodes). How the nodes are distributed over the circles can be specified by a layering strategy (layeringStrategy).

The way in which edges are routed in this layout is specified by an edge routing strategy (edgeRoutingStrategy). Note that the edge routing cannot always prevent node-edge overlaps.

See also

center nodes policies
layering strategy
edge routing strategy


Public Properties
 PropertyDefined By
  centerNodesDpKey : Object
Specifies the data provider key used to look up the selected nodes that shall be placed in the center with center node policy (centerNodesPolicy) set to CENTER_NODES_POLICY_SELECTED_NODES.
RadialLayouter
  centerNodesPolicy : int
Specifies the center node policy that determines which node is chosen as (virtual) tree root for the layout process and is set in the center of the circles.
RadialLayouter
 InheritedcomponentLayouter : LayoutStage
Specifies the LayoutStage responsible for laying out the connected components of the graph.
CanonicMultiStageLayouter
  componentLayouterEnabled : Boolean
[override] Getter: Returns whether or not ComponentLayouter is enabled.
RadialLayouter
  considerNodeLabels : Boolean
Specifies whether or not node labels are taken into account when calculating node positions.
RadialLayouter
  edgeRoutingStrategy : int
Specifies the edge routing strategy.
RadialLayouter
 InheritedgroupNodeHider : LayoutStage
Specifies the LayoutStage that is responsible for hiding away grouping information for the layout algorithm.
CanonicMultiStageLayouter
 InheritedhideGroupNodes : Boolean
Specifies whether or not to hide away group nodes before the layout begins.
CanonicMultiStageLayouter
 InheritedlabelLayouter : LayoutStage
Getter: Returns the algorithm used for placing labels.
CanonicMultiStageLayouter
 InheritedlabelLayouterEnabled : Boolean
Getter: Returns whether or not LabelLayouter is enabled.
CanonicMultiStageLayouter
  layeringStrategy : int
Getter: Returns the layering strategy that determines how nodes are distributed to different layers.
RadialLayouter
  layerSpacing : Number
Specifies the spacing value for the circles.
RadialLayouter
 InheritedlayoutOrientation : int
Specifies the main layout orientation.
CanonicMultiStageLayouter
  maximalChildSectorAngle : Number
Specifies the maximal sector angle in degrees around a node where the children of the node may be placed.
RadialLayouter
  minimalBendAngle : Number
Getter: Returns the minimal kink angle in degrees between two adjacent edge segments.
RadialLayouter
  minimalLayerDistance : Number
Specifies the minimal distance between two circles.
RadialLayouter
  minimalNodeToNodeDistance : Number
Specifies the minimum distance between two neighboring nodes on a circle.
RadialLayouter
 InheritedorientationLayouter : LayoutStage
Specifies the LayoutStage that is responsible for changing the orientation of the computed layout.
CanonicMultiStageLayouter
 InheritedorientationLayouterEnabled : Boolean
Getter: Returns whether or not the OrientationLayouter is enabled.
CanonicMultiStageLayouter
 InheritedparallelEdgeLayouter : LayoutStage
Getter: Returns the LayoutStage responsible for routing parallel edges.
CanonicMultiStageLayouter
 InheritedparallelEdgeLayouterEnabled : Boolean
Getter: Returns whether or not the ParallelEdgeLayouter is enabled.
CanonicMultiStageLayouter
 InheritedselfLoopLayouter : LayoutStage
Getter: Returns the LayoutStage used for routing Self-loops.
CanonicMultiStageLayouter
 InheritedselfLoopLayouterEnabled : Boolean
Getter: Returns whether or not the SelfLoopLayouter is enabled.
CanonicMultiStageLayouter
 InheritedsubgraphLayouter : LayoutStage
Specifies the LayoutStage that is responsible for constraining the layout process to a subgraph of the target graph.
CanonicMultiStageLayouter
 InheritedsubgraphLayouterEnabled : Boolean
Getter: Returns whether or not the SubgraphLayouter is enabled.
CanonicMultiStageLayouter
Public Methods
 MethodDefined By
  
RadialLayouter(init:Boolean = true)
Creates a new instance.
RadialLayouter
 Inherited
Appends a stage to the layout pipeline.
CanonicMultiStageLayouter
 Inherited
Returns a layout for the given layout graph.
CanonicMultiStageLayouter
 Inherited
Returns a layout for the given graph interface and layout.
CanonicMultiStageLayouter
 Inherited
canLayout(graph:LayoutGraph):Boolean
Tests whether or not the given graph can be laid out by this layouter.
CanonicMultiStageLayouter
  
canLayoutCore(graph:LayoutGraph):Boolean
[override]
RadialLayouter
 Inherited
doLayout(layoutGraph:LayoutGraph):void
Calculates a layout for the given graph.
CanonicMultiStageLayouter
 Inherited
Calculates a layout for the given graph interface and layout.
CanonicMultiStageLayouter
  
[override]
RadialLayouter
 Inherited
Disables all layout stages and performs only the core layouter.
CanonicMultiStageLayouter
 Inherited
equals(o:Object):Boolean
YObject
  
getClass():Class
[override]
RadialLayouter
 Inherited
hashCode():int
YObject
  
[static] Creates a new instance.
RadialLayouter
 Inherited
Prepends a stage to the layout pipeline.
CanonicMultiStageLayouter
 Inherited
Removes a LayoutStage that has been previously added by the methods appendStage() or prependStage().
CanonicMultiStageLayouter
Protected Methods
 MethodDefined By
 Inherited
checkGroupNodeSize(layout:GraphLayout, node:Object):void
This method throws an com.yworks.bridge.util.IllegalArgumentException if the width/height of the given group node object is zero.
CanonicMultiStageLayouter
 Inherited
checkNodeSize(layout:GraphLayout, node:Object):void
This method throws an com.yworks.bridge.util.IllegalArgumentException if the width/height of the given node object is zero.
CanonicMultiStageLayouter
  
Determines the center nodes of the graph according to the chosen center node policy.
RadialLayouter
  
getNodeDiameter(graph:LayoutGraph, node:Node):Number
Returns the diameter of the circular space around the given node's center that shall be reserved for the node.
RadialLayouter
 Inherited
CanonicMultiStageLayouter
  
Initializes this object.
RadialLayouter
Public Constants
 ConstantDefined By
  CENTER_NODES_POLICY_CENTRALITY : int = 1
[static] Specifier for a center nodes policy which chooses the node with the highest centrality as center node.
RadialLayouter
  CENTER_NODES_POLICY_DIRECTED : int = 0
[static] Specifier for a center nodes policy which chooses all nodes with indegree 0 as center nodes.
RadialLayouter
  CENTER_NODES_POLICY_SELECTED_NODES : int = 3
[static] Specifier for a center nodes policy which uses user specified center nodes.
RadialLayouter
  CENTER_NODES_POLICY_WEIGHTED_CENTRALITY : int = 2
[static] Specifier for a center nodes policy which chooses the node with the highest weighted centrality as center node.
RadialLayouter
  EDGE_ROUTING_STRATEGY_ARC : int = 5
[static] Specifier for an edge routing strategy that will route edges as an arc.
RadialLayouter
  EDGE_ROUTING_STRATEGY_POLYLINE : int = 1
[static] Specifier for an edge routing strategy that will route edges as a polyline from source to target with one bend on each spanned circle.
RadialLayouter
  LAYERING_STRATEGY_BFS : int = 4
[static] Specifier for a layering strategy that uses breadth first search (bfs) to determine a layering for the graph.
RadialLayouter
  LAYERING_STRATEGY_HIERARCHICAL : int = 1
[static] Specifier for a layering strategy that uses an optimal hierarchical layering strategy.
RadialLayouter
  NODE_INFO_DPKEY : Object = y.layout.radial.NODE_INFO_DPKEY
[static] com.yworks.yfiles.base.DataProvider key used to provide additional data for nodes about the circle they are placed on as well as the sector they are placed in.
RadialLayouter
Property Detail
centerNodesDpKeyproperty
centerNodesDpKey:Object

Specifies the data provider key used to look up the selected nodes that shall be placed in the center with center node policy (centerNodesPolicy) set to CENTER_NODES_POLICY_SELECTED_NODES. By default, com.yworks.yfiles.layout.LayouterKeys.SELECTED_NODES is used.


Implementation
    public function get centerNodesDpKey():Object
    public function set centerNodesDpKey(value:Object):void

Throws
IllegalArgumentException — when the new key is null

See also

centerNodesPolicyproperty 
centerNodesPolicy:int

Specifies the center node policy that determines which node is chosen as (virtual) tree root for the layout process and is set in the center of the circles.

By default CENTER_NODES_POLICY_WEIGHTED_CENTRALITY is set.


Implementation
    public function get centerNodesPolicy():int
    public function set centerNodesPolicy(value:int):void

Throws
IllegalArgumentException — when setting an invalid center node policy.

See also

componentLayouterEnabledproperty 
componentLayouterEnabled:Boolean[override]

Getter: Returns whether or not ComponentLayouter is enabled. By default it is disabled.

Setter: Specifies whether or not to enable the ComponentLayouter. By default it is disabled.


Implementation
    public function get componentLayouterEnabled():Boolean
    public function set componentLayouterEnabled(value:Boolean):void
considerNodeLabelsproperty 
considerNodeLabels:Boolean

Specifies whether or not node labels are taken into account when calculating node positions. Thereby preventing possible node/node label or node label/node label overlaps.

Default value is false.

Note that this option only works correctly if the layout orientation (layoutOrientation) is set to com.yworks.yfiles.layout.LayoutOrientation.TOP_TO_BOTTOM (which is the default). Changing the layout orientation for an undirected layout algorithm like the com.yworks.yfiles.layout.radial.RadialLayouter doesn't make sense.


Implementation
    public function get considerNodeLabels():Boolean
    public function set considerNodeLabels(value:Boolean):void

See also

edgeRoutingStrategyproperty 
edgeRoutingStrategy:int

Specifies the edge routing strategy.

Must be one of EDGE_ROUTING_STRATEGY_POLYLINE or EDGE_ROUTING_STRATEGY_ARC. By default EDGE_ROUTING_STRATEGY_ARC is used.

Note that the edge routing cannot always prevent node-edge overlaps.


Implementation
    public function get edgeRoutingStrategy():int
    public function set edgeRoutingStrategy(value:int):void

Throws
IllegalArgumentException — when setting an invalid edge routing strategy.

See also

layeringStrategyproperty 
layeringStrategy:int

Getter: Returns the layering strategy that determines how nodes are distributed to different layers. All nodes of one layer will be placed on the same circle later. By default, LAYERING_STRATEGY_BFS is set.

Setter: Sets the layering strategy that determines how nodes are distributed to different layers. All nodes of one layer will be placed on the same circle later.

Must be either LAYERING_STRATEGY_BFS or LAYERING_STRATEGY_HIERARCHICAL. By default, LAYERING_STRATEGY_BFS is set.


Implementation
    public function get layeringStrategy():int
    public function set layeringStrategy(value:int):void

Throws
IllegalArgumentException — when setting an invalid layering strategy.

See also

layerSpacingproperty 
layerSpacing:Number

Specifies the spacing value for the circles. The radius of each circle will be a multiple of this value.

If the spacing value is set 0, no spacing will be considered.

Default value is 25.0d


Implementation
    public function get layerSpacing():Number
    public function set layerSpacing(value:Number):void

Throws
IllegalArgumentException — when setting a negative spacing value.
maximalChildSectorAngleproperty 
maximalChildSectorAngle:Number

Specifies the maximal sector angle in degrees around a node where the children of the node may be placed.

The child sector of a node has the node's center as center. The sector points away from the center of the circle the node is placed on.

Valid values range from 0 to 360.


Implementation
    public function get maximalChildSectorAngle():Number
    public function set maximalChildSectorAngle(value:Number):void

Throws
IllegalArgumentException — when setting a negative angle or an angle greater than 360 degrees.
minimalBendAngleproperty 
minimalBendAngle:Number

Getter: Returns the minimal kink angle in degrees between two adjacent edge segments.

Increasing this value reduces the number of bends so the edge path gets less smooth.

Valid values are between 0.0d and 90.0d.

Setter: Sets the minimal kink angle in degrees between two adjacent edge segments.

Increasing this value reduces the number of bends so the edge path gets less smooth.

Default value is 5.0d. Valid angles range from 0 to 90 degrees.


Implementation
    public function get minimalBendAngle():Number
    public function set minimalBendAngle(value:Number):void

Throws
IllegalArgumentException — when setting a negative angle or an angle greater than 90 degrees.
minimalLayerDistanceproperty 
minimalLayerDistance:Number

Specifies the minimal distance between two circles. Default value is 100.0d.


Implementation
    public function get minimalLayerDistance():Number
    public function set minimalLayerDistance(value:Number):void

Throws
IllegalArgumentException — when setting a negative distance.
minimalNodeToNodeDistanceproperty 
minimalNodeToNodeDistance:Number

Specifies the minimum distance between two neighboring nodes on a circle. The default is 10.0d.


Implementation
    public function get minimalNodeToNodeDistance():Number
    public function set minimalNodeToNodeDistance(value:Number):void

Throws
IllegalArgumentException — when setting a negative distance.
Constructor Detail
RadialLayouter()Constructor
public function RadialLayouter(init:Boolean = true)

Creates a new instance.

Parameters
init:Boolean (default = true) — An internally used switch to help handle proper instance initialization in inheritance chains where classes can have multiple constructor-like factory methods. This parameter can safely be ignored/omitted when calling the constructor.
Method Detail
canLayoutCore()method
override public function canLayoutCore(graph:LayoutGraph):Boolean

Parameters

graph:LayoutGraph

Returns
Boolean
determineCenter()method 
protected function determineCenter(graph:LayoutGraph):NodeList

Determines the center nodes of the graph according to the chosen center node policy.

This method may be overwritten to introduce a custom policy to choose center nodes.

Parameters

graph:LayoutGraph — The graph to return the central node for.

Returns
NodeList — A list of center nodes of the given graph.

See also

doLayoutCore()method 
override public function doLayoutCore(graph:LayoutGraph):void

Parameters

graph:LayoutGraph

getClass()method 
override public function getClass():Class

Returns
Class
getNodeDiameter()method 
protected function getNodeDiameter(graph:LayoutGraph, node:Node):Number

Returns the diameter of the circular space around the given node's center that shall be reserved for the node.

By default the actual diameter of the given node extended by minimalNodeToNodeDistance (minimalNodeToNodeDistance) is used as diameter of the space to reserve. That way the nodes keep enough distance to the nodes around.

This method may be overwritten to keep more or different amounts of space around each node in the graph.

Parameters

graph:LayoutGraph — The graph to which the node belongs.
 
node:Node — The node to return the diameter for.

Returns
Number — The diameter of the circle around the given node's center that shall be reserved for the node.

See also

initRadialLayouter()method 
protected final function initRadialLayouter():void

Initializes this object. See the documentation of the corresponding factory method newRadialLayouter() for details.

See also

newRadialLayouter()method 
public static function newRadialLayouter():RadialLayouter

Creates a new instance.

Returns
RadialLayouter
Constant Detail
CENTER_NODES_POLICY_CENTRALITYConstant
public static const CENTER_NODES_POLICY_CENTRALITY:int = 1

Specifier for a center nodes policy which chooses the node with the highest centrality as center node.

See also

CENTER_NODES_POLICY_DIRECTEDConstant 
public static const CENTER_NODES_POLICY_DIRECTED:int = 0

Specifier for a center nodes policy which chooses all nodes with indegree 0 as center nodes. If no node with that property is present, an arbitrary node is chosen.

See also

CENTER_NODES_POLICY_SELECTED_NODESConstant 
public static const CENTER_NODES_POLICY_SELECTED_NODES:int = 3

Specifier for a center nodes policy which uses user specified center nodes. The center nodes have to be specified using a data provider registered with the centerNodesDpKey key that returns true for these nodes.

If there are several center nodes, they are placed on the first circle while the center position stays empty.

See also

CENTER_NODES_POLICY_WEIGHTED_CENTRALITYConstant 
public static const CENTER_NODES_POLICY_WEIGHTED_CENTRALITY:int = 2

Specifier for a center nodes policy which chooses the node with the highest weighted centrality as center node.

See also

EDGE_ROUTING_STRATEGY_ARCConstant 
public static const EDGE_ROUTING_STRATEGY_ARC:int = 5

Specifier for an edge routing strategy that will route edges as an arc. The source and target of an edge as well as one bend on each spanned circle are used as main control points. An easing function is used to calculate additional control points between the polar coordinates of the main control points.

See also

EDGE_ROUTING_STRATEGY_POLYLINEConstant 
public static const EDGE_ROUTING_STRATEGY_POLYLINE:int = 1

Specifier for an edge routing strategy that will route edges as a polyline from source to target with one bend on each spanned circle.

See also

LAYERING_STRATEGY_BFSConstant 
public static const LAYERING_STRATEGY_BFS:int = 4

Specifier for a layering strategy that uses breadth first search (bfs) to determine a layering for the graph. All edges will span at most one layer in the resulting drawing. Edges between nodes that belong to the same layer are possible.

See also

LAYERING_STRATEGY_HIERARCHICALConstant 
public static const LAYERING_STRATEGY_HIERARCHICAL:int = 1

Specifier for a layering strategy that uses an optimal hierarchical layering strategy. The layer distance of an edge is the absolute difference between the layer numbers of its source and target node. Layer assignment will be done in such a way that the overall sum of the layer distances of all edges in the layout is minimal.

See also

NODE_INFO_DPKEYConstant 
public static const NODE_INFO_DPKEY:Object = y.layout.radial.NODE_INFO_DPKEY

com.yworks.yfiles.base.DataProvider key used to provide additional data for nodes about the circle they are placed on as well as the sector they are placed in.

Only if a data provider with this key is registered at the graph and returns a com.yworks.yfiles.layout.radial.RadialLayouter_NodeInfo object for each node, the properties of these com.yworks.yfiles.layout.radial.RadialLayouter_NodeInfo objects will be updated during the layout.

See also