source: node_modules/d3-hierarchy/src/hierarchy/sum.js@ e4c61dd

Last change on this file since e4c61dd was e4c61dd, checked in by istevanoska <ilinastevanoska@…>, 6 months ago

Prototype 1.1

  • Property mode set to 100644
File size: 264 bytes
Line 
1export default function(value) {
2 return this.eachAfter(function(node) {
3 var sum = +value(node.data) || 0,
4 children = node.children,
5 i = children && children.length;
6 while (--i >= 0) sum += children[i].value;
7 node.value = sum;
8 });
9}
Note: See TracBrowser for help on using the repository browser.