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

Function activateShape

src/components/shapes/draw.js:727–743  ·  view source on GitHub ↗
(gd, path)

Source from the content-addressed store, hash-verified

725}
726
727function activateShape(gd, path) {
728 if (!couldHaveActiveShape(gd)) return;
729
730 var element = path.node();
731 var id = +element.getAttribute('data-index');
732 if (id >= 0) {
733 // deactivate if already active
734 if (id === gd._fullLayout._activeShapeIndex) {
735 deactivateShape(gd);
736 return;
737 }
738
739 gd._fullLayout._activeShapeIndex = id;
740 gd._fullLayout._deactivateShape = deactivateShape;
741 draw(gd);
742 }
743}
744
745function deactivateShape(gd) {
746 if (!couldHaveActiveShape(gd)) return;

Callers 1

drawShapeFunction · 0.85

Calls 3

couldHaveActiveShapeFunction · 0.85
deactivateShapeFunction · 0.85
drawFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…