source: node_modules/d3-hierarchy/src/hierarchy/iterator.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: 367 bytes
RevLine 
[e4c61dd]1export default function*() {
2 var node = this, current, next = [node], children, i, n;
3 do {
4 current = next.reverse(), next = [];
5 while (node = current.pop()) {
6 yield node;
7 if (children = node.children) {
8 for (i = 0, n = children.length; i < n; ++i) {
9 next.push(children[i]);
10 }
11 }
12 }
13 } while (next.length);
14}
Note: See TracBrowser for help on using the repository browser.