MCPcopy Create free account
hub / github.com/breck7/scroll / packChildrenRandom

Function packChildrenRandom

external/.d3.js:13581–13596  ·  view source on GitHub ↗
(padding, k, random)

Source from the content-addressed store, hash-verified

13579}
13580
13581function packChildrenRandom(padding, k, random) {
13582 return function(node) {
13583 if (children = node.children) {
13584 var children,
13585 i,
13586 n = children.length,
13587 r = padding(node) * k || 0,
13588 e;
13589
13590 if (r) for (i = 0; i < n; ++i) children[i].r += r;
13591 e = packSiblingsRandom(children, random);
13592 if (r) for (i = 0; i < n; ++i) children[i].r -= r;
13593 node.r = e + r;
13594 }
13595 };
13596}
13597
13598function translateChild(k) {
13599 return function(node) {

Callers 1

packFunction · 0.85

Calls 1

packSiblingsRandomFunction · 0.85

Tested by

no test coverage detected