Package | com.yworks.yfiles.layout.radial |
Class | public class RadialLayouter |
Inheritance | RadialLayouter CanonicMultiStageLayouter YObject Object |
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
Property | Defined 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 | ||
componentLayouter : 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 | ||
groupNodeHider : LayoutStage
Specifies the LayoutStage that is responsible for hiding away grouping information for the layout algorithm. | CanonicMultiStageLayouter | ||
hideGroupNodes : Boolean
Specifies whether or not to hide away group nodes before the layout begins. | CanonicMultiStageLayouter | ||
labelLayouter : LayoutStage
Getter:
Returns the algorithm used for placing labels. | CanonicMultiStageLayouter | ||
labelLayouterEnabled : 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 | ||
layoutOrientation : 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 | ||
orientationLayouter : LayoutStage
Specifies the LayoutStage that is responsible for changing the orientation of the computed layout. | CanonicMultiStageLayouter | ||
orientationLayouterEnabled : Boolean
Getter:
Returns whether or not the OrientationLayouter is enabled. | CanonicMultiStageLayouter | ||
parallelEdgeLayouter : LayoutStage
Getter:
Returns the LayoutStage responsible for routing parallel edges. | CanonicMultiStageLayouter | ||
parallelEdgeLayouterEnabled : Boolean
Getter:
Returns whether or not the ParallelEdgeLayouter is enabled. | CanonicMultiStageLayouter | ||
selfLoopLayouter : LayoutStage
Getter:
Returns the LayoutStage used for routing Self-loops. | CanonicMultiStageLayouter | ||
selfLoopLayouterEnabled : Boolean
Getter:
Returns whether or not the SelfLoopLayouter is enabled. | CanonicMultiStageLayouter | ||
subgraphLayouter : LayoutStage
Specifies the LayoutStage that is responsible for constraining the layout process to a subgraph of the target graph. | CanonicMultiStageLayouter | ||
subgraphLayouterEnabled : Boolean
Getter:
Returns whether or not the SubgraphLayouter is enabled. | CanonicMultiStageLayouter |
Method | Defined By | ||
---|---|---|---|
RadialLayouter(init:Boolean = true)
Creates a new instance. | RadialLayouter | ||
appendStage(stage:LayoutStage):void
Appends a stage to the layout pipeline. | CanonicMultiStageLayouter | ||
Returns a layout for the given layout graph. | CanonicMultiStageLayouter | ||
Returns a layout for the given graph interface and layout. | CanonicMultiStageLayouter | ||
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 | ||
doLayout(layoutGraph:LayoutGraph):void
Calculates a layout for the given graph. | CanonicMultiStageLayouter | ||
Calculates a layout for the given graph interface and layout. | CanonicMultiStageLayouter | ||
doLayoutCore(graph:LayoutGraph):void [override] | RadialLayouter | ||
enableOnlyCore():void
Disables all layout stages and performs only the core layouter. | CanonicMultiStageLayouter | ||
equals(o:Object):Boolean | YObject | ||
getClass():Class [override] | RadialLayouter | ||
hashCode():int | YObject | ||
[static]
Creates a new instance. | RadialLayouter | ||
prependStage(stage:LayoutStage):void
Prepends a stage to the layout pipeline. | CanonicMultiStageLayouter | ||
removeStage(stage:LayoutStage):void
Removes a LayoutStage that has been previously added by the methods appendStage() or prependStage(). | CanonicMultiStageLayouter |
Method | Defined By | ||
---|---|---|---|
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 | ||
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 | ||
Returns the diameter of the circular space around the given node's center that shall be reserved for the node. | RadialLayouter | ||
CanonicMultiStageLayouter | |||
initRadialLayouter():void
Initializes this object. | RadialLayouter |
Constant | Defined 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 |
centerNodesDpKey | property |
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.
public function get centerNodesDpKey():Object
public function set centerNodesDpKey(value:Object):void
IllegalArgumentException — when the new key is null
|
See also
centerNodesPolicy | property |
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. public function get centerNodesPolicy():int
public function set centerNodesPolicy(value:int):void
IllegalArgumentException — when setting an invalid center node policy.
|
See also
componentLayouterEnabled | property |
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. public function get componentLayouterEnabled():Boolean
public function set componentLayouterEnabled(value:Boolean):void
considerNodeLabels | property |
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.
public function get considerNodeLabels():Boolean
public function set considerNodeLabels(value:Boolean):void
See also
edgeRoutingStrategy | property |
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.
public function get edgeRoutingStrategy():int
public function set edgeRoutingStrategy(value:int):void
IllegalArgumentException — when setting an invalid edge routing strategy.
|
See also
layeringStrategy | property |
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.
public function get layeringStrategy():int
public function set layeringStrategy(value:int):void
IllegalArgumentException — when setting an invalid layering strategy.
|
See also
layerSpacing | property |
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.
25.0d
public function get layerSpacing():Number
public function set layerSpacing(value:Number):void
IllegalArgumentException — when setting a negative spacing value.
|
maximalChildSectorAngle | property |
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 from0
to 360
.
public function get maximalChildSectorAngle():Number
public function set maximalChildSectorAngle(value:Number):void
IllegalArgumentException — when setting a negative angle or an angle greater than 360 degrees.
|
minimalBendAngle | property |
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 between0.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 is5.0d
. Valid angles range from 0 to 90 degrees.
public function get minimalBendAngle():Number
public function set minimalBendAngle(value:Number):void
IllegalArgumentException — when setting a negative angle or an angle greater than 90 degrees.
|
minimalLayerDistance | property |
minimalLayerDistance:Number
Specifies the minimal distance between two circles.
Default value is 100.0d
.
public function get minimalLayerDistance():Number
public function set minimalLayerDistance(value:Number):void
IllegalArgumentException — when setting a negative distance.
|
minimalNodeToNodeDistance | property |
minimalNodeToNodeDistance:Number
Specifies the minimum distance between two neighboring nodes on a circle.
The default is 10.0d
.
public function get minimalNodeToNodeDistance():Number
public function set minimalNodeToNodeDistance(value:Number):void
IllegalArgumentException — when setting a negative distance.
|
RadialLayouter | () | Constructor |
public function RadialLayouter(init:Boolean = true)
Creates a new instance.
Parametersinit: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.
|
canLayoutCore | () | method |
override public function canLayoutCore(graph:LayoutGraph):Boolean
Parameters
graph:LayoutGraph |
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.
|
NodeList — A list of center nodes of the given graph.
|
See also
doLayoutCore | () | method |
getClass | () | method |
override public function getClass():Class
ReturnsClass |
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.
|
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.
ReturnsRadialLayouter |
CENTER_NODES_POLICY_CENTRALITY | Constant |
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_DIRECTED | Constant |
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_NODES | Constant |
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_CENTRALITY | Constant |
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_ARC | Constant |
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_POLYLINE | Constant |
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_BFS | Constant |
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_HIERARCHICAL | Constant |
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_DPKEY | Constant |
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