arlas-d3 / Exports / DonutNode
Interface: DonutNode
Hierarchy
HierarchyRectangularNode
<TreeNode
>
↳ DonutNode
Table of contents
Constructors
Properties
- children
- data
- depth
- endAngle
- height
- id
- innerRadius
- isSelected
- outerRadius
- parent
- startAngle
- value
- x
- x0
- x1
- y
- y0
- y1
Methods
- [iterator]
- ancestors
- copy
- count
- descendants
- each
- eachAfter
- eachBefore
- find
- leaves
- links
- path
- sort
- sum
Constructors
constructor
• new DonutNode(data
)
Parameters
Name | Type |
---|---|
data |
TreeNode |
Inherited from
HierarchyRectangularNode<TreeNode>.constructor
Defined in
node_modules/@types/d3-hierarchy/index.d.ts:20
Properties
children
• Optional
children: DonutNode
[]
An array of child nodes, if any; undefined for leaf nodes.
Inherited from
HierarchyRectangularNode.children
Defined in
node_modules/@types/d3-hierarchy/index.d.ts:45
data
• data: TreeNode
The associated data, as specified to the constructor.
Inherited from
HierarchyRectangularNode.data
Defined in
node_modules/@types/d3-hierarchy/index.d.ts:25
depth
• Readonly
depth: number
Zero for the root node, and increasing by one for each descendant generation.
Inherited from
HierarchyRectangularNode.depth
Defined in
node_modules/@types/d3-hierarchy/index.d.ts:30
endAngle
• endAngle: number
Defined in
src/donuts/utils/DonutUtils.ts:62
height
• Readonly
height: number
Zero for leaf nodes, and the greatest distance from any descendant leaf for internal nodes.
Inherited from
HierarchyRectangularNode.height
Defined in
node_modules/@types/d3-hierarchy/index.d.ts:35
id
• Optional
Readonly
id: string
Optional node id string set by StratifyOperator
, if hierarchical data was created from tabular data using stratify().
Inherited from
HierarchyRectangularNode.id
Defined in
node_modules/@types/d3-hierarchy/index.d.ts:55
innerRadius
• innerRadius: number
Defined in
src/donuts/utils/DonutUtils.ts:59
isSelected
• isSelected: boolean
Defined in
src/donuts/utils/DonutUtils.ts:58
outerRadius
• outerRadius: number
Defined in
src/donuts/utils/DonutUtils.ts:60
parent
• parent: DonutNode
The parent node, or null for the root node.
Inherited from
HierarchyRectangularNode.parent
Defined in
node_modules/@types/d3-hierarchy/index.d.ts:40
startAngle
• startAngle: number
Defined in
src/donuts/utils/DonutUtils.ts:61
value
• Optional
Readonly
value: number
Aggregated numeric value as calculated by sum(value)
or count()
, if previously invoked.
Inherited from
HierarchyRectangularNode.value
Defined in
node_modules/@types/d3-hierarchy/index.d.ts:50
x
• Optional
x: number
The x position of this node. Set after a tree has been laid out by tree
or cluster
.
const root = d3.hierarchy(datum);
const treeLayout = d3.tree();
treeLayout(root);
// x and y are now set on root and its descendants
Inherited from
HierarchyRectangularNode.x
Defined in
node_modules/@types/d3-hierarchy/index.d.ts:67
x0
• x0: number
The left edge of the rectangle.
Inherited from
HierarchyRectangularNode.x0
Defined in
node_modules/@types/d3-hierarchy/index.d.ts:427
x1
• x1: number
The right edge of the rectangle.
Inherited from
HierarchyRectangularNode.x1
Defined in
node_modules/@types/d3-hierarchy/index.d.ts:437
y
• Optional
y: number
The y position of this node. Set after a tree has been laid out by tree
or cluster
.
const root = d3.hierarchy(datum);
const treeLayout = d3.tree();
treeLayout(root);
// x and y are now set on root and its descendants
Inherited from
HierarchyRectangularNode.y
Defined in
node_modules/@types/d3-hierarchy/index.d.ts:79
y0
• y0: number
The top edge of the rectangle
Inherited from
HierarchyRectangularNode.y0
Defined in
node_modules/@types/d3-hierarchy/index.d.ts:432
y1
• y1: number
The bottom edge of the rectangle.
Inherited from
HierarchyRectangularNode.y1
Defined in
node_modules/@types/d3-hierarchy/index.d.ts:442
Methods
[iterator]
▸ [iterator](): Iterator
<DonutNode
, any
, undefined
>
Returns an iterator over the node’s descendants in breadth-first order.
Returns
Iterator
<DonutNode
, any
, undefined
>
Inherited from
HierarchyRectangularNode.__@iterator@474
Defined in
node_modules/@types/d3-hierarchy/index.d.ts:144
ancestors
▸ ancestors(): DonutNode
[]
Returns the array of ancestors nodes, starting with this node, then followed by each parent up to the root.
Returns
Inherited from
HierarchyRectangularNode.ancestors
Defined in
node_modules/@types/d3-hierarchy/index.d.ts:84
copy
▸ copy(): DonutNode
Return a deep copy of the subtree starting at this node. The returned deep copy shares the same data, however. The returned node is the root of a new tree; the returned node’s parent is always null and its depth is always zero.
Returns
Inherited from
HierarchyRectangularNode.copy
Defined in
node_modules/@types/d3-hierarchy/index.d.ts:178
count
▸ count(): DonutNode
Computes the number of leaves under this node and assigns it to node.value
, and similarly for every descendant of node.
If this node is a leaf, its count is one. Returns this node.
Returns
Inherited from
HierarchyRectangularNode.count
Defined in
node_modules/@types/d3-hierarchy/index.d.ts:128
descendants
▸ descendants(): DonutNode
[]
Returns the array of descendant nodes, starting with this node, then followed by each child in topological order.
Returns
Inherited from
HierarchyRectangularNode.descendants
Defined in
node_modules/@types/d3-hierarchy/index.d.ts:89
each
▸ each<T
>(func
, that?
): DonutNode
Invokes the specified function for node and each descendant in breadth-first order, such that a given node is only visited if all nodes of lesser depth have already been visited, as well as all preceding nodes of the same depth.
Type parameters
Name | Type |
---|---|
T |
undefined |
Parameters
Name | Type | Description |
---|---|---|
func |
(this : T , node : DonutNode , index : number , thisNode : DonutNode ) => void |
The specified function is passed the current descendant, the zero-based traversal index, and this node. |
that? |
T |
If that is specified, it is the this context of the callback. |
Returns
Inherited from
HierarchyRectangularNode.each
Defined in
node_modules/@types/d3-hierarchy/index.d.ts:154
eachAfter
▸ eachAfter<T
>(func
, that?
): DonutNode
Invokes the specified function for node and each descendant in post-order traversal, such that a given node is only visited after all of its descendants have already been visited.
Type parameters
Name | Type |
---|---|
T |
undefined |
Parameters
Name | Type | Description |
---|---|---|
func |
(this : T , node : DonutNode , index : number , thisNode : DonutNode ) => void |
The specified function is passed the current descendant, the zero-based traversal index, and this node. |
that? |
T |
If that is specified, it is the this context of the callback. |
Returns
Inherited from
HierarchyRectangularNode.eachAfter
Defined in
node_modules/@types/d3-hierarchy/index.d.ts:163
eachBefore
▸ eachBefore<T
>(func
, that?
): DonutNode
Invokes the specified function for node and each descendant in pre-order traversal, such that a given node is only visited after all of its ancestors have already been visited.
Type parameters
Name | Type |
---|---|
T |
undefined |
Parameters
Name | Type | Description |
---|---|---|
func |
(this : T , node : DonutNode , index : number , thisNode : DonutNode ) => void |
The specified function is passed the current descendant, the zero-based traversal index, and this node. |
that? |
T |
If that is specified, it is the this context of the callback. |
Returns
Inherited from
HierarchyRectangularNode.eachBefore
Defined in
node_modules/@types/d3-hierarchy/index.d.ts:172
find
▸ find(filter
): DonutNode
Returns the first node in the hierarchy from this node for which the specified filter returns a truthy value. undefined if no such node is found.
Parameters
Name | Type | Description |
---|---|---|
filter |
(node : DonutNode ) => boolean |
Filter. |
Returns
Inherited from
HierarchyRectangularNode.find
Defined in
node_modules/@types/d3-hierarchy/index.d.ts:100
leaves
▸ leaves(): DonutNode
[]
Returns the array of leaf nodes in traversal order; leaves are nodes with no children.
Returns
Inherited from
HierarchyRectangularNode.leaves
Defined in
node_modules/@types/d3-hierarchy/index.d.ts:94
links
▸ links(): HierarchyRectangularLink
<TreeNode
>[]
Returns an array of links for this node, where each link is an object that defines source and target properties. The source of each link is the parent node, and the target is a child node.
Returns
HierarchyRectangularLink
<TreeNode
>[]
Inherited from
HierarchyRectangularNode.links
Defined in
node_modules/@types/d3-hierarchy/index.d.ts:448
path
▸ path(target
): DonutNode
[]
Returns the shortest path through the hierarchy from this node to the specified target node. The path starts at this node, ascends to the least common ancestor of this node and the target node, and then descends to the target node.
Parameters
Name | Type | Description |
---|---|---|
target |
DonutNode |
The target node. |
Returns
Inherited from
HierarchyRectangularNode.path
Defined in
node_modules/@types/d3-hierarchy/index.d.ts:108
sort
▸ sort(compare
): DonutNode
Sorts the children of this node, if any, and each of this node’s descendants’ children, in pre-order traversal using the specified compare function, and returns this node.
Parameters
Name | Type | Description |
---|---|---|
compare |
(a : DonutNode , b : DonutNode ) => number |
The compare function is passed two nodes a and b to compare. If a should be before b, the function must return a value less than zero; if b should be before a, the function must return a value greater than zero; otherwise, the relative order of a and b are not specified. See array.sort for more. |
Returns
Inherited from
HierarchyRectangularNode.sort
Defined in
node_modules/@types/d3-hierarchy/index.d.ts:139
sum
▸ sum(value
): DonutNode
Evaluates the specified value function for this node and each descendant in post-order traversal, and returns this node.
The node.value
property of each node is set to the numeric value returned by the specified function plus the combined value of all descendants.
Parameters
Name | Type | Description |
---|---|---|
value |
(d : TreeNode ) => number |
The value function is passed the node’s data, and must return a non-negative number. |
Returns
Inherited from
HierarchyRectangularNode.sum
Defined in
node_modules/@types/d3-hierarchy/index.d.ts:122