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

Function d3_layout_packPlace

explainshell/web/static/js/d3.v3.js:6089–6102  ·  view source on GitHub ↗
(a, b, c)

Source from the content-addressed store, hash-verified

6087 }
6088 }
6089 function d3_layout_packPlace(a, b, c) {
6090 var db = a.r + c.r, dx = b.x - a.x, dy = b.y - a.y;
6091 if (db && (dx || dy)) {
6092 var da = b.r + c.r, dc = dx * dx + dy * dy;
6093 da *= da;
6094 db *= db;
6095 var x = .5 + (db - da) / (2 * dc), y = Math.sqrt(Math.max(0, 2 * da * (db + dc) - (db -= dc) * db - da * da)) / (2 * dc);
6096 c.x = a.x + x * dx + y * dy;
6097 c.y = a.y + x * dy - y * dx;
6098 } else {
6099 c.x = a.x + db;
6100 c.y = a.y;
6101 }
6102 }
6103 d3.layout.cluster = function() {
6104 var hierarchy = d3.layout.hierarchy().sort(null).value(null), separation = d3_layout_treeSeparation, size = [ 1, 1 ];
6105 function cluster(d, i) {

Callers 1

d3_layout_packSiblingsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected