Skip to content

Modebar not destroyed correctly #120

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

Closed
emackey opened this issue Dec 16, 2015 · 5 comments
Closed

Modebar not destroyed correctly #120

emackey opened this issue Dec 16, 2015 · 5 comments
Assignees
Labels
bug something broken

Comments

@emackey
Copy link

emackey commented Dec 16, 2015

Try this in the test environment:

Plotly.newPlot(Tabs.fresh(),    [{x:[1,2,3], y:[2,1,2]}]);
Plotly.newPlot(Tabs.getGraph(), [{x:[1,2,3], y:[2,1,2]}]);
Plotly.newPlot(Tabs.getGraph(), [{x:[1,2,3], y:[2,1,2]}]);
Plotly.newPlot(Tabs.getGraph(), [{x:[1,2,3], y:[2,1,2]}]);
Plotly.newPlot(Tabs.getGraph(), [{x:[1,2,3], y:[2,1,2]}]);

Now, inspect the DOM tree near the modebar(s). Each newPlot has its own overlapping modebar.

@mdtusz mdtusz added the bug something broken label Dec 16, 2015
@mdtusz
Copy link
Contributor

mdtusz commented Dec 16, 2015

Confirmed. It is on the div with class="modebar modebar--hover".

@etpinard
Copy link
Contributor

probably a one-line fix in Plots.purge.

@mdtusz
Copy link
Contributor

mdtusz commented Dec 16, 2015

Yep. My thinking as well - just need to destroy the node.

@etpinard
Copy link
Contributor

Adding:

gd._fullLayout._modebar.destroy();

https://github.com/plotly/plotly.js/blob/master/src/components/modebar/index.js#L262

should do it.

@emackey
Copy link
Author

emackey commented Dec 17, 2015

This is fixed, thanks!

@mdtusz mdtusz reopened this Dec 17, 2015
@mdtusz mdtusz closed this as completed Dec 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken
Projects
None yet
Development

No branches or pull requests

4 participants