| 138263 | } |
| 138264 | TreeNode.prototype = Object.create((0, _indexJs.Node).prototype); |
| 138265 | function treeRoot(root) { |
| 138266 | var tree = new TreeNode(root, 0), node, nodes = [ |
| 138267 | tree |
| 138268 | ], child, children, i, n; |
| 138269 | while(node = nodes.pop())if (children = node._.children) { |
| 138270 | node.children = new Array(n = children.length); |
| 138271 | for(i = n - 1; i >= 0; --i){ |
| 138272 | nodes.push(child = node.children[i] = new TreeNode(children[i], i)); |
| 138273 | child.parent = node; |
| 138274 | } |
| 138275 | } |
| 138276 | (tree.parent = new TreeNode(null, 0)).children = [ |
| 138277 | tree |
| 138278 | ]; |
| 138279 | return tree; |
| 138280 | } |
| 138281 | // Node-link tree diagram using the Reingold-Tilford "tidy" algorithm |
| 138282 | exports.default = function() { |
| 138283 | var separation = defaultSeparation, dx = 1, dy = 1, nodeSize = null; |