public class TreeLayout extends Layout<TreeLayout>
| Modifier | Constructor and Description |
|---|---|
protected |
TreeLayout() |
| Modifier and Type | Method and Description |
|---|---|
TreeLayout |
children(DatumFunction<Array<Node>> df)
Sets the specified children accessor function.
|
Array<Link> |
links(Array<Node> n)
Given the specified array of nodes, such as those returned by nodes,
returns an array of objects representing the from parent to child for
each node.
|
Array<Node> |
nodes(Node r)
Runs the tree layout, returning the array of nodes associated with the
specified root node.
|
Array<Double> |
nodeSize()
Returns the current node size, which defaults to null, meaning that the
layout has an overall fixed size, which
can be retrieved using
size(). |
TreeLayout |
nodeSize(double width,
double height)
Sets a fixed size for each node as a two-element array of numbers
representing x and y.
|
TreeLayout |
separation(Sort sort)
Uses the specified function to compute separation between neighboring
nodes.
|
Array<Double> |
size()
Returns the current tree size, which defaults to 1×1.
|
TreeLayout |
size(double width,
double height)
Sets the available layout size to the specified two-element array of
numbers representing x and y.
|
TreeLayout |
sort(Sort sort)
Sets the sort order of sibling nodes for the layout using the specified
comparator function.
|
DatumFunction<?> |
value()
Returns the current value accessor which defaults to null, meaning that
the value attribute is not computed.
|
TreeLayout |
value(DatumFunction<?> df)
Sets the value accessor to the specified function.
|
public final Array<Node> nodes(Node r)
Node, or null for the root.
root - of the the treeNode in the tree stemming from rootpublic final Array<Link> links(Array<Node> n)
Diagonal shape
generator.array - of nodes in treeLink connecting nodespublic final TreeLayout size(double width, double height)
a - two-element array of width and height of treepublic final Array<Double> size()
public final TreeLayout nodeSize(double width, double height)
width - height - public final Array<Double> nodeSize()
size().public final TreeLayout sort(Sort sort)
D3#ascending() or D3#descending().{@link - Sort} a predefined sorting conventionpublic final TreeLayout separation(Sort sort)
df - a datum function describing how to calculate separation of
nodespublic final TreeLayout children(DatumFunction<Array<Node>> df)
df - a datum function describing how to compute childrenpublic final TreeLayout value(DatumFunction<?> df)
df - a datum function describing how to access node valuespublic final DatumFunction<?> value()
Copyright © 2013 gwt-d3. All Rights Reserved.