MCPcopy
hub / github.com/jasondavies/d3-cloud / cloudBounds

Function cloudBounds

index.js:352–359  ·  view source on GitHub ↗
(bounds, d)

Source from the content-addressed store, hash-verified

350}
351
352function cloudBounds(bounds, d) {
353 var b0 = bounds[0],
354 b1 = bounds[1];
355 if (d.x + d.x0 < b0.x) b0.x = d.x + d.x0;
356 if (d.y + d.y0 < b0.y) b0.y = d.y + d.y0;
357 if (d.x + d.x1 > b1.x) b1.x = d.x + d.x1;
358 if (d.y + d.y1 > b1.y) b1.y = d.y + d.y1;
359}
360
361function collideRects(a, b) {
362 return a.x + a.x1 > b[0].x && a.x + a.x0 < b[1].x && a.y + a.y1 > b[0].y && a.y + a.y0 < b[1].y;

Callers 1

stepFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…