MCPcopy Index your code
hub / github.com/plotly/plotly.js / boundEdges

Function boundEdges

stackgl_modules/index.js:8894–8908  ·  view source on GitHub ↗
(points, edges)

Source from the content-addressed store, hash-verified

8892
8893// Convert a list of edges in a pslg to bounding boxes
8894function boundEdges (points, edges) {
8895 var bounds = new Array(edges.length)
8896 for (var i = 0; i < edges.length; ++i) {
8897 var e = edges[i]
8898 var a = points[e[0]]
8899 var b = points[e[1]]
8900 bounds[i] = [
8901 nextafter(Math.min(a[0], b[0]), -Infinity),
8902 nextafter(Math.min(a[1], b[1]), -Infinity),
8903 nextafter(Math.max(a[0], b[0]), Infinity),
8904 nextafter(Math.max(a[1], b[1]), Infinity)
8905 ]
8906 }
8907 return bounds
8908}
8909
8910// Convert a list of points into bounding boxes by duplicating coords
8911function boundPoints (points) {

Callers 1

snapRoundFunction · 0.85

Calls 1

nextafterFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…