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

Function addTester

src/components/selections/select.js:1330–1348  ·  view source on GitHub ↗
(layoutPolygons, xRef, yRef, selectionTesters)

Source from the content-addressed store, hash-verified

1328}
1329
1330function addTester(layoutPolygons, xRef, yRef, selectionTesters) {
1331 var mergedPolygons;
1332
1333 for(var i = 0; i < layoutPolygons.length; i++) {
1334 var currentPolygon = layoutPolygons[i];
1335 if(xRef !== currentPolygon.xref || yRef !== currentPolygon.yref) continue;
1336
1337 if(mergedPolygons) {
1338 var subtract = !!currentPolygon.subtract;
1339 mergedPolygons = mergePolygons(mergedPolygons, currentPolygon, subtract);
1340 selectionTesters = multiTester(mergedPolygons);
1341 } else {
1342 mergedPolygons = [currentPolygon];
1343 selectionTesters = polygonTester(currentPolygon);
1344 }
1345 }
1346
1347 return selectionTesters;
1348}
1349
1350function getLayoutPolygons(gd, onlyActiveOnes) {
1351 var allPolygons = [];

Callers 1

reselectFunction · 0.85

Calls 2

mergePolygonsFunction · 0.85
multiTesterFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…