UNPKG

@antv/f2

Version:

Charts for mobile visualization.

27 lines (26 loc) 530 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = _default; function _default(callback, that) { var node = this, nodes = [node], next = [], children, i, n, index = -1; while (node = nodes.pop()) { next.push(node); if (children = node.children) { for (i = 0, n = children.length; i < n; ++i) { nodes.push(children[i]); } } } while (node = next.pop()) { callback.call(that, node, ++index, this); } return this; }