arlas-d3 / Exports / DonutNode
Interface: DonutNode
Hierarchy
HierarchyRectangularNode
<any
>
↳ DonutNode
Table of contents
Properties
- children
- data
- depth
- endAngle
- height
- id
- innerRadius
- isSelected
- outerRadius
- parent
- startAngle
- value
- x0
- x1
- y0
- y1
Methods
- [iterator]
- ancestors
- copy
- count
- descendants
- each
- eachAfter
- eachBefore
- find
- leaves
- links
- path
- sort
- sum
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:53
data
• data: any
The associated data, as specified to the constructor.
Inherited from
HierarchyRectangularNode.data
Defined in
node_modules/@types/d3-hierarchy/index.d.ts:33
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:38
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:43
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:63
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:48
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:58
x0
• x0: number
The left edge of the rectangle.
Inherited from
HierarchyRectangularNode.x0
Defined in
node_modules/@types/d3-hierarchy/index.d.ts:409
x1
• x1: number
The right edge of the rectangle.
Inherited from
HierarchyRectangularNode.x1
Defined in
node_modules/@types/d3-hierarchy/index.d.ts:419
y0
• y0: number
The top edge of the rectangle
Inherited from
HierarchyRectangularNode.y0
Defined in
node_modules/@types/d3-hierarchy/index.d.ts:414
y1
• y1: number
The bottom edge of the rectangle.
Inherited from
HierarchyRectangularNode.y1
Defined in
node_modules/@types/d3-hierarchy/index.d.ts:424
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@157
Defined in
node_modules/@types/d3-hierarchy/index.d.ts:128
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:68
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:163
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:112
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:73
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 |
(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:138
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 |
(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:148
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 |
(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:157
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:84
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:78
links
▸ links(): HierarchyRectangularLink
<any
>[]
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
<any
>[]
Inherited from
HierarchyRectangularNode.links
Defined in
node_modules/@types/d3-hierarchy/index.d.ts:430
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:92
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:123
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 : any ) => 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:106