MCPcopy Create free account
hub / github.com/breck7/scroll / count

Function count

external/.d3.js:13011–13018  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

13009}
13010
13011function count(node) {
13012 var sum = 0,
13013 children = node.children,
13014 i = children && children.length;
13015 if (!i) sum = 1;
13016 else while (--i >= 0) sum += children[i].value;
13017 node.value = sum;
13018}
13019
13020function node_count() {
13021 return this.eachAfter(count);

Callers 1

timeIntervalFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected