Update( ) fails if the user is interacting with the plot
See original GitHub issueHi !
I use an heatmap to represent large datasets. After plotly_relayout events I download and process data (asynchronous, can take some time), then display them. However Plotly will return an undefined error from a promise if the update is done while dragging. I used a setTimeout in the codepen to copy the behavior of my program.
CodePen : https://codepen.io/watashiku/pen/pKJJNW?editors=1010 Error message :
plotly-latest.js:128472 Uncaught TypeError: Cannot read property 'length' of undefined
at exports.drawData (VM750 plotly-latest.js:128472)
at Object.lib.syncOrAsync (VM750 plotly-latest.js:119125)
at relayout (VM750 plotly-latest.js:125433)
at Object.exports.call (VM750 plotly-latest.js:153164)
at VM750 plotly-latest.js:133800
at Object.lib.syncOrAsync (VM750 plotly-latest.js:119125)
at Object.dragTail [as doneFn] (VM750 plotly-latest.js:133798)
at HTMLDocument.onDone (VM750 plotly-latest.js:102144)
Steps to reproduce : drag the plot once, then quickly start dragging again and hold it one second - the bug appears if you are dragging during the update triggered by the previous drag.
It creates two major problems :
- The plot will be “locked” on the screen : panning or zooming will not affect the plot (only the axes in the background),
- There is no plotly_afterplot event triggered by Plotly which means there is no way for me to tell the user that the plot is ready nor somehow handling the situation by myself (and the error cannot be catched outside of Plotly due to the way it is raise I think?).
Notes :
- When the bug happens clicking on the graph fixes it
- The behavior is similar for react, restyle and addtrace. It does not appear with plot (but this creates traces for every relayout)
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:6 (2 by maintainers)
Top Results From Across the Web
r - Interact_plot keeps coming back with Error: data must be ...
I have been trying to solve this for days, so any help would be appreciated! I am trying to make an interaction plot...
Read more >Understand how visuals interact in a report - Power BI
Documentation for Power BI end users that explains how visuals interact on a report page.
Read more >Backends — Matplotlib 3.6.2 documentation
To save plots using the non-interactive backends, use the matplotlib.pyplot.savefig('filename') method. These are the user interfaces and renderer combinations ...
Read more >A Guide To User Story Mapping (With Examples) - AHA.io
User story mapping is a visual exercise that helps product teams define the work that will create a delightful user experience. Learn how...
Read more >How to build Interactive Excel Dashboards that Update with ...
Introduction, what to expect and keys to building dashboards fast - don't skip this if it's your first time watching ;-).
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Merged into https://github.com/plotly/plotly.js/issues/3305
Yes those issues are very similar !
Is there a way for us to detect when the issue happens until it is fixed ? I did not find a catch case on the promise that fails. The only thing I found is catching all the document.windows error and look for an undefined one 😕