Skip to content

Commit 69f103c

Browse files
committed
fix logic in purge in case newPlot is called with a blank gd
1 parent d606511 commit 69f103c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1914,8 +1914,9 @@ plots.purge = function(gd) {
19141914
// clean up the gl and geo containers
19151915
// TODO unify subplot creation/update with d3.selection.order
19161916
// and/or subplot ids
1917-
gd._fullLayout._glcontainer.remove();
1918-
gd._fullLayout._geocontainer.remove();
1917+
var fullLayout = gd._fullLayout || {};
1918+
if(fullLayout._glcontainer !== undefined) fullLayout._glcontainer.remove();
1919+
if(fullLayout._geocontainer !== undefined) fullLayout._geocontainer.remove();
19191920

19201921
// data and layout
19211922
delete gd.data;

0 commit comments

Comments
 (0)