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

Function eraseActiveSelection

src/components/shapes/display_outlines.js:378–411  ·  view source on GitHub ↗
(gd)

Source from the content-addressed store, hash-verified

376}
377
378function eraseActiveSelection(gd) {
379 // Do not allow removal of selections on other dragmodes.
380 // This ensures the user could still double click to
381 // deselect all trace.selectedpoints,
382 // if that's what they wanted.
383 // Also double click to zoom back won't result in
384 // any surprising selection removal.
385 if(!selectMode(gd._fullLayout.dragmode)) return;
386
387 clearOutlineControllers(gd);
388
389 var id = gd._fullLayout._activeSelectionIndex;
390 var selections = (gd.layout || {}).selections || [];
391 if(id < selections.length) {
392 var list = [];
393 for(var q = 0; q < selections.length; q++) {
394 if(q !== id) {
395 list.push(selections[q]);
396 }
397 }
398
399 delete gd._fullLayout._activeSelectionIndex;
400
401 var erasedSelection = gd._fullLayout.selections[id];
402 gd._fullLayout._deselect = {
403 xref: erasedSelection.xref,
404 yref: erasedSelection.yref
405 };
406
407 Registry.call('_guiRelayout', gd, {
408 selections: list
409 });
410 }
411}

Callers 1

clickGroupControllerFunction · 0.85

Calls 1

clearOutlineControllersFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…