You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to make a "realtime" (updates ever 5 - 10 seconds) application where I use setTimout to update traces and call Plotly.newPlot on the target div. If I happen to be in the midst of using the zoom controls when the timer executes, I get some exceptions in the console the first of which is "Uncaught (in promise)" once while keeping my mouse clicked in a zoom selection state. Then when I release the mouse button completing my zoom selection, I get "Cannot read property 'xaxis' of undefined" once, then "Uncaught TypeError: Cannot read property '_plots' of undefined" a few dozen times (56), then "Uncaught TypeError: Cannot read property '_hoverlayer' of undefined" once.
This originates within plotly.js, and I can provide traces from the non-minified source, I think this is pretty easy to reproduce. I was thinking if I could capture "begin zoom selection" and "end zoom selection" events then I could guard against calling Plotly.newPlot when a user is in the middle of a zoom selection, but I couldn't figure out / find any documentation of that event being registered by the library.
Is this an omission, or did I just miss it in my research? Is there a known workaround? I guess a trivial workaround would be to surround the call to Plotly.newPlot in a try/catch block, but that seems a bit heavy handed... scratch that, surrounding in try/catch has no effect, I guess due to an asynchronous nature.
The text was updated successfully, but these errors were encountered:
Depending on what you're doing, you may want to use Plotly.addTraces, Plotly.relayout or one of the other Plotly.____ methods rather than Plotly.newPlot as newPlot creates a brand new plot.
That said, this is indeed a bug and it applies to the other methods listed above as well. Thanks for reporting!
I'm also running into this issue. The example link in the previous comment seems to be broken.
If you mousedown on the plot in the example below you will see the errors in the chrome console. For whatever reason they do not show up in the codepen console.
I'm trying to make a "realtime" (updates ever 5 - 10 seconds) application where I use setTimout to update traces and call Plotly.newPlot on the target div. If I happen to be in the midst of using the zoom controls when the timer executes, I get some exceptions in the console the first of which is "Uncaught (in promise)" once while keeping my mouse clicked in a zoom selection state. Then when I release the mouse button completing my zoom selection, I get "Cannot read property 'xaxis' of undefined" once, then "Uncaught TypeError: Cannot read property '_plots' of undefined" a few dozen times (56), then "Uncaught TypeError: Cannot read property '_hoverlayer' of undefined" once.
This originates within plotly.js, and I can provide traces from the non-minified source, I think this is pretty easy to reproduce. I was thinking if I could capture "begin zoom selection" and "end zoom selection" events then I could guard against calling Plotly.newPlot when a user is in the middle of a zoom selection, but I couldn't figure out / find any documentation of that event being registered by the library.
Is this an omission, or did I just miss it in my research? Is there a known workaround? I guess a trivial workaround would be to surround the call to Plotly.newPlot in a try/catch block, but that seems a bit heavy handed... scratch that, surrounding in try/catch has no effect, I guess due to an asynchronous nature.
The text was updated successfully, but these errors were encountered: