Skip to content

Commit 22e9519

Browse files
committed
ensure plotinfo in axes redraw
1 parent 8a34a95 commit 22e9519

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

src/plots/cartesian/axes.js

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1927,21 +1927,23 @@ axes.draw = function(gd, arg, opts) {
19271927
fullLayout._paper.selectAll('g.subplot').each(function(d) {
19281928
var id = d[0];
19291929
var plotinfo = fullLayout._plots[id];
1930-
var xa = plotinfo.xaxis;
1931-
var ya = plotinfo.yaxis;
1932-
1933-
plotinfo.xaxislayer.selectAll('.' + xa._id + 'tick').remove();
1934-
plotinfo.yaxislayer.selectAll('.' + ya._id + 'tick').remove();
1935-
plotinfo.xaxislayer.selectAll('.' + xa._id + 'tick2').remove();
1936-
plotinfo.yaxislayer.selectAll('.' + ya._id + 'tick2').remove();
1937-
plotinfo.xaxislayer.selectAll('.' + xa._id + 'divider').remove();
1938-
plotinfo.yaxislayer.selectAll('.' + ya._id + 'divider').remove();
1939-
1940-
if(plotinfo.gridlayer) plotinfo.gridlayer.selectAll('path').remove();
1941-
if(plotinfo.zerolinelayer) plotinfo.zerolinelayer.selectAll('path').remove();
1942-
1943-
fullLayout._infolayer.select('.g-' + xa._id + 'title').remove();
1944-
fullLayout._infolayer.select('.g-' + ya._id + 'title').remove();
1930+
if(plotinfo) {
1931+
var xa = plotinfo.xaxis;
1932+
var ya = plotinfo.yaxis;
1933+
1934+
plotinfo.xaxislayer.selectAll('.' + xa._id + 'tick').remove();
1935+
plotinfo.yaxislayer.selectAll('.' + ya._id + 'tick').remove();
1936+
plotinfo.xaxislayer.selectAll('.' + xa._id + 'tick2').remove();
1937+
plotinfo.yaxislayer.selectAll('.' + ya._id + 'tick2').remove();
1938+
plotinfo.xaxislayer.selectAll('.' + xa._id + 'divider').remove();
1939+
plotinfo.yaxislayer.selectAll('.' + ya._id + 'divider').remove();
1940+
1941+
if(plotinfo.gridlayer) plotinfo.gridlayer.selectAll('path').remove();
1942+
if(plotinfo.zerolinelayer) plotinfo.zerolinelayer.selectAll('path').remove();
1943+
1944+
fullLayout._infolayer.select('.g-' + xa._id + 'title').remove();
1945+
fullLayout._infolayer.select('.g-' + ya._id + 'title').remove();
1946+
}
19451947
});
19461948
}
19471949

0 commit comments

Comments
 (0)