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

Function addPt

src/lib/polygon.js:220–236  ·  view source on GitHub ↗
(pt)

Source from the content-addressed store, hash-verified

218 var doneFilteredIndex = 0;
219
220 function addPt(pt) {
221 pts.push(pt);
222 var prevFilterLen = ptsFiltered.length;
223 var iLast = doneRawIndex;
224 ptsFiltered.splice(doneFilteredIndex + 1);
225
226 for(var i = iLast + 1; i < pts.length; i++) {
227 if(i === pts.length - 1 || polygon.isSegmentBent(pts, iLast, i + 1, tolerance)) {
228 ptsFiltered.push(pts[i]);
229 if(ptsFiltered.length < prevFilterLen - 2) {
230 doneRawIndex = i;
231 doneFilteredIndex = ptsFiltered.length - 1;
232 }
233 iLast = i;
234 }
235 }
236 }
237
238 if(pts.length > 1) {
239 var lastPt = pts.pop();

Callers 1

polygon.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…