source: node_modules/d3-hierarchy/src/hierarchy/eachAfter.js@ ba17441

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

Prototype 1.1

  • Property mode set to 100644
File size: 405 bytes
Line 
1export default function(callback, that) {
2 var node = this, nodes = [node], next = [], children, i, n, index = -1;
3 while (node = nodes.pop()) {
4 next.push(node);
5 if (children = node.children) {
6 for (i = 0, n = children.length; i < n; ++i) {
7 nodes.push(children[i]);
8 }
9 }
10 }
11 while (node = next.pop()) {
12 callback.call(that, node, ++index, this);
13 }
14 return this;
15}
Note: See TracBrowser for help on using the repository browser.