MCPcopy Index your code
hub / github.com/microsoft/SandDance / positionNode

Function positionNode

docs/app/js/sanddance-app.js:138092–138103  ·  view source on GitHub ↗
(dy, n)

Source from the content-addressed store, hash-verified

138090 return root;
138091 }
138092 function positionNode(dy, n) {
138093 return function(node) {
138094 if (node.children) (0, _diceJsDefault.default)(node, node.x0, dy * (node.depth + 1) / n, node.x1, dy * (node.depth + 2) / n);
138095 var x0 = node.x0, y0 = node.y0, x1 = node.x1 - padding, y1 = node.y1 - padding;
138096 if (x1 < x0) x0 = x1 = (x0 + x1) / 2;
138097 if (y1 < y0) y0 = y1 = (y0 + y1) / 2;
138098 node.x0 = x0;
138099 node.y0 = y0;
138100 node.x1 = x1;
138101 node.y1 = y1;
138102 };
138103 }
138104 partition.round = function(x) {
138105 return arguments.length ? (round = !!x, partition) : round;
138106 };

Callers 1

partitionFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected