David-Desmaisons / vue-plotly

📈 vue wrapper for plotly.js
https://david-desmaisons.github.io/vue-plotly/
MIT License
255 stars 74 forks source link

Resize handler for plotly called even when destroying the Plotly Vue component #37

Open purvil12c opened 3 years ago

purvil12c commented 3 years ago

Error faced: Resize must be passed a displayed plot div element.

Investigation: If plotly vue component is dynamically rendered (hidden / destroyed), the resize handler setup here - https://github.com/David-Desmaisons/vue-plotly/blob/master/src/components/Plotly.vue#L83 gets called even though the next action the component is its destruction.

Probably, there needs to be some validation to that resize handler and only pass-through to plotly's resize handler if the component is visible on the UI