A layout that arranges nodes in a tree radially around a center node.
var display = new thinkmap.display.Display(document.getElementById('mydiv'));
var tree = new thinkmap.graph.Tree();
tree.root(tree.createNode({label:"Root Node"}))
.add(tree.createEdge(tree.root(),tree.createNode({label:"Child 1"})))
.add(tree.createEdge(tree.root(),tree.createNode({label:"Child 2"})));
display.add(tree);
display.template('edge').as(thinkmap.display.edgestyle.linear());
thinkmap.layout.radialLayout(display).tree(tree).spacing(200).layout();
Sets (or gets) the angle that this layout will center on. The default is zero degrees.
If called with zero arguments, returns the current value of angle.
Sets (or gets) the rectangle that will be used as the bounding box of each node.
This is either a thinkmap.geom.Rectangle, or a function returns a rectangle.
The default is a function that calls display.bbox(node).
If called with zero arguments, returns the current value of bbox.
Returns the last transition created calling the layout method.
This will be null if the layout() method was never called.
Sets (or gets) the duration (in milliseconds) of the transition that will be used for animating the layout.
If called with zero arguments, returns the current value of duration
Sets (or gets) the easing function of the transition that will be used for animating the layout.
If called with zero arguments, returns the current value of easing
Sets (or gets) the entity that should be "focused" in the tree - this entity will be at the angle specified by the angle parameter (typically 0 degrees). The default is null.
If called with zero arguments, returns the current value of focus.
Applies this layout to the configured display. By default, this creates and returns an animated selection that is configured to apply the layout in the default way.
If you wish to customize how the layout is applied, you have two choices:
an optional function to apply the layout to
a transitioned display selection (or a regular Display Selection if an apply function was passed)
Sets (or gets) the margin that will be maintained between siblings (or cousins) in the tree. This is either a number, or a function that takes the two nodes and returns a number.
If called with zero arguments, returns the current value of margin.
Sets (or gets) a function that will be called for each node in the tree. This function take two arguments, the current node being layed out and the angle (in degrees) that the node will be placed at. The function must return an angle that the node will be rotated. The default is to return the input angle.
If called with zero arguments, returns the current value of rotateFn.
Sets (or gets) the number of radial degrees available to this layout. The default is 360 degrees (the whole circle). This useful for reserving portions of the circle for other layouts.
If called with zero arguments, returns the current value of opening.
Sets (or gets) the point where the root of the tree will be placed. The default is 0,0 This is either a thinkmap.geom.Point, or a function returns a point.
If called with zero arguments, returns the current value of position.
Sets (or gets) whether to rotate the root of the tree to the angle parameter (if an angle was specified).
If called with zero arguments, returns the current value of rotateRoot.
Sets (or gets) the sorting function that will be used to sort child nodes. The function is passed two nodes and must return -1 if the first is less than the second, 0 if they are equal, or 1 if the second is greater than the first.
If called with zero arguments, returns the current value of sort
Sets (or gets) the spacing that will be maintained between parents and their children in the tree. This is either a number, or a function that takes the two nodes and returns a number.
If called with zero arguments, returns the current value of spacing.
Gets the target position of the given node given the last layout state of this tree layout.
Gets the target rotation (in degrees) of the given node given the last layout state of this radial tree layout.
Sets (or gets) the tree that this layout will layout.
If called with zero arguments, returns the current value of tree.
Enables or disables this layout.
If called with zero arguments, returns true if this layout is enabled.
true to enable this layout
this layout, or a boolean if called with zero arguments.