Skip to content

Commit

Permalink
Use new clean up method
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Jeffery committed Sep 13, 2016
1 parent e75155e commit 9c8d6ca
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions src/PlotlyComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,7 @@ var PlotlyComponent = React.createClass({
},

componentWillUnmount: function() {
//Remove some cruft left behind by plotly
var cruft = document.getElementById("js-plotly-tester");
if (cruft !== null) {
cruft.parentNode.removeChild(cruft);
}

this.container.removeAllListeners('plotly_click');
this.container.removeAllListeners('plotly_beforehover');
this.container.removeAllListeners('plotly_hover');
this.container.removeAllListeners('plotly_unhover');
this.container.removeAllListeners('plotly_selected');
Plotly.purge(this.container);
},

resize: function() {
Expand Down

0 comments on commit 9c8d6ca

Please sign in to comment.