MCPcopy Create free account
hub / github.com/plotly/plotly.js / getHVEdgeIntersections

Function getHVEdgeIntersections

src/traces/scatter/line_points.js:191–200  ·  view source on GitHub ↗
(pt1, pt2)

Source from the content-addressed store, hash-verified

189 // for line shapes hv and vh, movement in the two dimensions is decoupled,
190 // so all we need to do is constrain each dimension independently
191 function getHVEdgeIntersections(pt1, pt2) {
192 var out = [];
193 var ptInt1 = onlyConstrainedPoint(pt1);
194 var ptInt2 = onlyConstrainedPoint(pt2);
195 if(ptInt1 && ptInt2 && sameEdge(ptInt1, ptInt2)) return out;
196
197 if(ptInt1) out.push(ptInt1);
198 if(ptInt2) out.push(ptInt2);
199 return out;
200 }
201
202 // hvh and vhv we sometimes have to move one of the intersection points
203 // out BEYOND the clipping rect, by a maximum of a factor of 2, so that

Callers

nothing calls this directly

Calls 2

onlyConstrainedPointFunction · 0.85
sameEdgeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…