-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Remove all event listeners from gd #117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -941,6 +941,7 @@ Plotly.redraw = function(gd) { | |||
Plotly.newPlot = function (gd, data, layout, config) { | |||
gd = getGraphDiv(gd); | |||
plots.purge(gd); | |||
gd.removeAllListeners(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd would put this in plots.purge
and maybe (cc @alexcjohnson ) we could expose purge
on Plotly
? It sounds to me like something users might want to use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call on moving removeAllListeners
. Not sure if we should expose the purge method though - I can't think of too many use cases where that's what a user would want to clear the node and reuse it - if they want to "purge", they'll just delete the node. Better to keep the user surface area of plotly.js as small as possible.
@alexcjohnson thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there are still some client installations that use |
I'd like to use something similar to |
💃 |
Remove all event listeners from gd
Piece of 🍰