UNPKG
@nepwork/dashboards
Version:
latest (0.0.2)
0.0.2
Dashboards for emergencies and monitoring
github.com/nepwork/admin-ui
nepwork/admin-ui
@nepwork/dashboards
/
hgraph
/
node_modules
/
d3-hierarchy
/
src
/
hierarchy
/
count.js
13 lines
(11 loc)
•
263 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
function
count
(
node
) {
var
sum =
0
, children = node.
children
, i = children && children.
length
;
if
(!i) sum =
1
;
else
while
(--i >=
0
) sum += children[i].
value
; node.
value
= sum; }
export
default
function
(
) {
return
this
.
eachAfter
(count); }