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

Function getDistToPlot

src/lib/geometry2d.js:150–160  ·  view source on GitHub ↗
(len)

Source from the content-addressed store, hash-verified

148 var pt0, ptTotal;
149
150 function getDistToPlot(len) {
151 var pt = path.getPointAtLength(len);
152
153 // hold on to the start and end points for `closed`
154 if(len === 0) pt0 = pt;
155 else if(len === pTotal) ptTotal = pt;
156
157 var dx = (pt.x < left) ? left - pt.x : (pt.x > right ? pt.x - right : 0);
158 var dy = (pt.y < top) ? top - pt.y : (pt.y > bottom ? pt.y - bottom : 0);
159 return Math.sqrt(dx * dx + dy * dy);
160 }
161
162 var distToPlot = getDistToPlot(pMin);
163 while(distToPlot) {

Callers 1

geometry2d.jsFile · 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…