(parent, x0, y0, x1, y1)
| 14276 | var resquarify = (function custom(ratio) { |
| 14277 | |
| 14278 | function resquarify(parent, x0, y0, x1, y1) { |
| 14279 | if ((rows = parent._squarify) && (rows.ratio === ratio)) { |
| 14280 | var rows, |
| 14281 | row, |
| 14282 | nodes, |
| 14283 | i, |
| 14284 | j = -1, |
| 14285 | n, |
| 14286 | m = rows.length, |
| 14287 | value = parent.value; |
| 14288 | |
| 14289 | while (++j < m) { |
| 14290 | row = rows[j], nodes = row.children; |
| 14291 | for (i = row.value = 0, n = nodes.length; i < n; ++i) row.value += nodes[i].value; |
| 14292 | if (row.dice) treemapDice(row, x0, y0, x1, value ? y0 += (y1 - y0) * row.value / value : y1); |
| 14293 | else treemapSlice(row, x0, y0, value ? x0 += (x1 - x0) * row.value / value : x1, y1); |
| 14294 | value -= row.value; |
| 14295 | } |
| 14296 | } else { |
| 14297 | parent._squarify = rows = squarifyRatio(ratio, parent, x0, y0, x1, y1); |
| 14298 | rows.ratio = ratio; |
| 14299 | } |
| 14300 | } |
| 14301 | |
| 14302 | resquarify.ratio = function(x) { |
| 14303 | return custom((x = +x) > 1 ? x : 1); |
nothing calls this directly
no test coverage detected