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

'r.scatter2d.destroy is not a function' error when updating a plot using scattergl and Plotly.react #3004

Closed
rhamner opened this issue Sep 13, 2018 · 8 comments

Comments

@rhamner
Copy link

rhamner commented Sep 13, 2018

I am getting

'Uncaught TypeError: r.scatter2d.destroy is not a function
at Object.E.e._scene.r.destroy (plotly.min.js:7)
at Object.r.clean (plotly.min.js:7)
at Object.v.cleanPlot (plotly.min.js:7)
at e (plotly.min.js:7)
at Object.l.syncOrAsync (plotly.min.js:7)
at r.plot (plotly.min.js:7)
at Object.l.syncOrAsync (plotly.min.js:7)
at Object.r.react (plotly.min.js:7)'

when trying to update a plot with new data using Plotly.react. I have a codepen that reproduces it:

https://codepen.io/rhamner/pen/GXdzLg

What should happen in the codepen is:

  • first plot shows data set 2
  • second plot shows data set 1 for 5 seconds, then data set 2, then data set 1 again

Instead, it stays on data set 1 and throws the error above. I thought at first data set 2 was bad, but the first plot seems to work just fine and it's identical data. Further, after throwing that error, even trying to plot the original data seems to fail.

Switching to Plotly.newPlot seems to work fine, but it's quite slow so I would really like to avoid that.

This is plotly.js 1.40.1 and I am using chrome. It also happens with firefox for me.

@etpinard
Copy link
Contributor

Hmm. I can't replicate. I don't see any console errors.

@arlowhite
Copy link

arlowhite commented Sep 18, 2018

Plotly.js 1.41.1 and also using the react() API.
I also have this error. I can only reproduce it on Windows.
Not quite sure on the trigger, but I only get it when plotting a large number of points (100k) with 'scattergl' along with some other plots.

EDIT: Just confirmed that you can avoid this bug by using 'scatter' instead of 'scattergl'

For my particular reproduction case with my App:
No error with:

  • Linux Firefox 62.0
  • Linux Chrome 69.0.3497.100

Error with:

  • Windows Firefox 62.0
  • Windows Chrome 69.0.3497.100

@rhamner
Copy link
Author

rhamner commented Sep 19, 2018

It reproduces on 3 of 5 machines I've tried it on. All are windows machines, so I'm not sure what the difference is on the two that don't show the error.

I forgot to note in the original post...I do not get it on the opening draw in the codepen link. I have to let it draw, then click run again to get the error.

As arlowhite noted, using 'scatter' instead of 'scattergl' avoids it. Like newplot though, scatter is very slow for large amounts of data for me so I would like to avoid it.

@etpinard
Copy link
Contributor

@antoinerg can you try this out on Windows? Thanks!

@mikk351
Copy link

mikk351 commented Sep 20, 2018

This bug appeared when i updated from 1.38.1 to 1.41.1. Tested on two mashines using Chrome 69.0.3497.100 and linux Ubuntu 18.04. Bug appears when changing layout and calling Plotly.react.

@etpinard
Copy link
Contributor

etpinard commented Oct 5, 2018

Bug appears when changing layout and calling Plotly.react.

Can you be more specific? Could share a minimal reproducible example in a codepen to help us out?

@slishak
Copy link

slishak commented Oct 24, 2018

The Dash app here can reliably reproduce this issue: plotly/dash-core-components#313 (comment). Also potentially related to #2999?

@etpinard
Copy link
Contributor

Most likely a duplicate of #2999 and thus most likely solved in #3132

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

5 participants