| 6525 | } |
| 6526 | } |
| 6527 | function stickify(node) { |
| 6528 | var children = node.children; |
| 6529 | if (children && children.length) { |
| 6530 | var rect = pad(node), remaining = children.slice(), child, row = []; |
| 6531 | scale(remaining, rect.dx * rect.dy / node.value); |
| 6532 | row.area = 0; |
| 6533 | while (child = remaining.pop()) { |
| 6534 | row.push(child); |
| 6535 | row.area += child.area; |
| 6536 | if (child.z != null) { |
| 6537 | position(row, child.z ? rect.dx : rect.dy, rect, !remaining.length); |
| 6538 | row.length = row.area = 0; |
| 6539 | } |
| 6540 | } |
| 6541 | children.forEach(stickify); |
| 6542 | } |
| 6543 | } |
| 6544 | function worst(row, u) { |
| 6545 | var s = row.area, r, rmax = 0, rmin = Infinity, i = -1, n = row.length; |
| 6546 | while (++i < n) { |