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

Function draw

src/components/shapes/draw.js:43–68  ·  view source on GitHub ↗
(gd)

Source from the content-addressed store, hash-verified

41};
42
43function draw(gd) {
44 var fullLayout = gd._fullLayout;
45
46 // Remove previous shapes before drawing new in shapes in fullLayout.shapes
47 fullLayout._shapeUpperLayer.selectAll('path').remove();
48 fullLayout._shapeLowerLayer.selectAll('path').remove();
49 fullLayout._shapeUpperLayer.selectAll('text').remove();
50 fullLayout._shapeLowerLayer.selectAll('text').remove();
51
52 for (var k in fullLayout._plots) {
53 var shapelayer = fullLayout._plots[k].shapelayer;
54 if (shapelayer) {
55 shapelayer.selectAll('path').remove();
56 shapelayer.selectAll('text').remove();
57 }
58 }
59
60 for (var i = 0; i < fullLayout.shapes.length; i++) {
61 if (fullLayout.shapes[i].visible === true) {
62 drawOne(gd, i);
63 }
64 }
65
66 // may need to resurrect this if we put text (LaTeX) in shapes
67 // return Plots.previousPromises(gd);
68}
69
70function shouldSkipEdits(gd) {
71 return !!gd._fullLayout._outlining;

Callers 6

activateShapeFunction · 0.70
deactivateShapeFunction · 0.70
plot.jsFile · 0.50
plot.jsFile · 0.50
reactFunction · 0.50
manage_arrays.jsFile · 0.50

Calls 1

drawOneFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…