Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6e21c47

Browse files
committed
Moved removeAllListeners and added existence check
1 parent 5621969 commit 6e21c47

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/plot_api/plot_api.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -941,7 +941,6 @@ Plotly.redraw = function(gd) {
941941
Plotly.newPlot = function (gd, data, layout, config) {
942942
gd = getGraphDiv(gd);
943943
plots.purge(gd);
944-
gd.removeAllListeners();
945944
return Plotly.plot(gd, data, layout, config);
946945
};
947946

src/plots/plots.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -712,6 +712,9 @@ plots.purge = function(gd) {
712712
delete gd.numboxes;
713713
delete gd._hoverTimer;
714714
delete gd._lastHoverTime;
715+
716+
// remove all event listeners
717+
if(gd.removeAllListeners) gd.removeAllListeners();
715718
};
716719

717720
plots.style = function(gd) {

0 commit comments

Comments
 (0)