Skip to content

Commit a60517c

Browse files
committed
add de facto clean up of gl and geo container in Plots.purge:
- this makes Plotly.newPlot not pile up scenes and geos
1 parent dfe7091 commit a60517c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

shelly/plotlyjs/static/plotlyjs/src/graph_obj.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1908,6 +1908,12 @@ plots.purge = function(gd) {
19081908
// note: we DO NOT remove _context because it doesn't change when we insert
19091909
// a new plot, and may have been set outside of our scope.
19101910

1911+
// clean up the gl and geo containers
1912+
// TODO unify subplot creation/update with d3.selection.order
1913+
// and/or subplot ids
1914+
gd._fullLayout._glcontainer.remove();
1915+
gd._fullLayout._geocontainer.remove();
1916+
19111917
// data and layout
19121918
delete gd.data;
19131919
delete gd.layout;
@@ -1919,6 +1925,7 @@ plots.purge = function(gd) {
19191925

19201926
delete gd.fid;
19211927

1928+
19221929
delete gd.undoqueue; // action queue
19231930
delete gd.undonum;
19241931
delete gd.autoplay; // are we doing an action that doesn't go in undo queue?

0 commit comments

Comments
 (0)