Skip to content
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

Uncaught Error: Resize must be passed a displayed plot div element. #38

Open
slaweet opened this issue Oct 18, 2021 · 2 comments
Open

Comments

@slaweet
Copy link

slaweet commented Oct 18, 2021

I'm getting this error randomly:

vue-plotly.umd.js?04d1:151220 Uncaught (in promise) Error: Resize must be passed a displayed plot div element.
    at eval (vue-plotly.umd.js?04d1:151220)
    at new Promise (<anonymous>)
    at Object.bb71.plots.resize (vue-plotly.umd.js?04d1:151218)
    at VueComponent.onResize (vue-plotly.umd.js?04d1:210184)
    at EventQueue.eval (vue-plotly.umd.js?04d1:54385)
    at invokeFunc (vue-plotly.umd.js?04d1:208299)
    at trailingEdge (vue-plotly.umd.js?04d1:208346)
    at timerExpired (vue-plotly.umd.js?04d1:208334)

My guess is that it's because

<div :id="id" v-resize:debounce.100="onResize" />

has the debounce and
onResize() {
Plotly.Plots.resize(this.$el);
},

doesn't check if the component wasn't unmounted in the meantime.

@aurium
Copy link

aurium commented Jan 25, 2023

Why there is a v-resize:debounce.100="onResize" and not only a :responsive="true"?

@slaweet
Copy link
Author

slaweet commented Jan 31, 2023

Why there is a v-resize:debounce.100="onResize" and not only a :responsive="true"?

@aurium What do you mean exactly by your suggestion? Just plain replacing v-resize:debounce.100="onResize" with :responsive="true" makes no sense to me as the former is processed by https://www.npmjs.com/package/vue-resize-directive whereas for the latter there's no implementation of what does the attribute do.

Moreover, with no debounce a page can become unresponsive for a long time when you drag window edge to resize the browser window and there are many complex charts on the page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants