MCPcopy Create free account
hub / github.com/idank/explainshell / depth

Function depth

explainshell/web/static/js/d3.v3.js:5504–5511  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

5502 }
5503 }
5504 function depth(node) {
5505 var children = node.children, d = 0;
5506 if (children && (n = children.length)) {
5507 var i = -1, n;
5508 while (++i < n) d = Math.max(d, depth(children[i]));
5509 }
5510 return 1 + d;
5511 }
5512 function partition(d, i) {
5513 var nodes = hierarchy.call(this, d, i);
5514 position(nodes[0], 0, size[0], size[1] / depth(nodes[0]));

Callers 1

partitionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected