| 5914 | return a.depth - b.depth; |
| 5915 | } |
| 5916 | function d3_layout_treeVisitAfter(node, callback) { |
| 5917 | function visit(node, previousSibling) { |
| 5918 | var children = node.children; |
| 5919 | if (children && (n = children.length)) { |
| 5920 | var child, previousChild = null, i = -1, n; |
| 5921 | while (++i < n) { |
| 5922 | child = children[i]; |
| 5923 | visit(child, previousChild); |
| 5924 | previousChild = child; |
| 5925 | } |
| 5926 | } |
| 5927 | callback(node, previousSibling); |
| 5928 | } |
| 5929 | visit(node, null); |
| 5930 | } |
| 5931 | function d3_layout_treeShift(node) { |
| 5932 | var shift = 0, change = 0, children = node.children, i = children.length, child; |
| 5933 | while (--i >= 0) { |