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

Function insertChild

explainshell/web/static/js/d3.v3.js:4560–4567  ·  view source on GitHub ↗
(n, d, x, y, x1, y1, x2, y2)

Source from the content-addressed store, hash-verified

4558 }
4559 }
4560 function insertChild(n, d, x, y, x1, y1, x2, y2) {
4561 var sx = (x1 + x2) * .5, sy = (y1 + y2) * .5, right = x >= sx, bottom = y >= sy, i = (bottom << 1) + right;
4562 n.leaf = false;
4563 n = n.nodes[i] || (n.nodes[i] = d3_geom_quadtreeNode());
4564 if (right) x1 = sx; else x2 = sx;
4565 if (bottom) y1 = sy; else y2 = sy;
4566 insert(n, d, x, y, x1, y1, x2, y2);
4567 }
4568 var root = d3_geom_quadtreeNode();
4569 root.add = function(d) {
4570 insert(root, d, +fx(d, ++i), +fy(d, i), x1_, y1_, x2_, y2_);

Callers 1

insertFunction · 0.85

Calls 2

d3_geom_quadtreeNodeFunction · 0.85
insertFunction · 0.85

Tested by

no test coverage detected