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

Function node_sum

external/.d3.js:13070–13078  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

13068}
13069
13070function node_sum(value) {
13071 return this.eachAfter(function(node) {
13072 var sum = +value(node.data) || 0,
13073 children = node.children,
13074 i = children && children.length;
13075 while (--i >= 0) sum += children[i].value;
13076 node.value = sum;
13077 });
13078}
13079
13080function node_sort(compare) {
13081 return this.eachBefore(function(node) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected