Destroy charts before the layout removes them from the DOM

This commit is contained in:
Jacob Brandt 2017-01-04 13:55:22 -07:00
parent f4cbc1e5da
commit e4e773c10c

View file

@ -84,6 +84,12 @@ export default function MapsFactory(Private) {
}
draw() {
// Destroy the charts before they get removed from the DOM on the new
// layout render.
if(this.charts !== undefined) {
this.charts.forEach(chart => chart.destroy());
}
this.layout.render();
// todo: title
const self = this;