[BUG]: 3D scatter plot randomly freezes or heavily lags after hovering in plot
還沒有人認領這個 Issue。
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 66/100
- Issue 類型
- 缺陷
- 描述清晰度
- 基本清楚
- 活躍度
- 活躍
- 技術堆疊
- javascript
研究方向
從 plotly.js/src/plots/gl3d/scene.js 和 plotly.js/src/plots/gl3d/project.js 開始,接著檢查所參照的 gl-plot3d/scene.js 中如何初始化選取。執行所描述的、頻繁更新的 Scatter3d 重現案例,同時進行懸停並移動相機。完成的標準是互動始終保持回應,且不會發生未捕捉的選取或投影錯誤,包括停用 hovermode 的情況。
由索引模型根據 Issue 內容生成。
描述
Description
I'm using Python but decided to post an issue here because I tracked the issue back to the source javascript code, so please bear with this description.
I created a 3D scatter plot using the plotly.express line_3d function in Python Dash that gets updated in real time every 3 seconds. The data that gets plotted is from multiple dataframes where individual points of the same dataframe are generally very close together and linear. When I go to interact with the plot initially, everything works fine. The camera is able to rotate, pan, etc., and the hover text shows up as you would expect. However, after some amount of time (not consistent, but usually happens for me anywhere between 3-30sec of interacting with the plot), an error will trigger in the dev console and then the plot will suddenly stop allowing user interaction (this was the case when I was re-rendering the plot every update) or it will take 5+ seconds to render an interaction (this is the case when using Dash's Patch() feature to make updates to the plot). It seems to trigger from hovering over the graph regardless of if hovermode=False is set in the layout or not.
Screenshots/Video
Here is the error:
Code tracing:
I was able to trace the minified code back to the plotly.js/src/plots/gl3d/scene.js and plotly.js/src/plots/gl3d/project.js files:
Also helpful is gl-plot3d/scene.js from the gl-plot3d GitHub that shows how MouseSelect is initialized:
From what I can see, it seems like the selection variable was initialized but never set to a proper value before being used, which causes this error to be thrown & the plot to freeze up.
Steps to reproduce
- Create a Scatter3d plot populated with over 100 traces where most data points are very close (+-0.0001 or so) and linear
- Update the plot with new data every 1-5 seconds -> in my case, this includes appending data, adding new traces, and setting some existing traces to visible=False
- Make sure Pause on uncaught exceptions is set in your DevTools
- Interact with the plot while it updates, including moving the camera, zooming in, and hovering over the traces quickly for up to 30 seconds
Notes
Side note: I realized that the var pdata = project(scene.glplot.cameraParams, selection.dataCoordinate) line is declared outside of the if(scene.fullSceneLayout.hovermode) check but only used within the Fx.loneHover call, which may be the reason why this error triggers regardless of if hovermode=False is set.
- 主要語言
- JavaScript
- 星號
- 18.3k
- 分支
- 2k
- 平均合併
- 2 天 10 小時
- 30 天內合併 PR
- 30
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
plotly/plotly.js 的其他 Issue
-
bug
難度 1/5 1 小時以內 新手友好度 85/100
-
chore P3 plotly-internal size: 3 task
難度 2/5 1-3 小時 新手友好度 77/100
-
chore P1 plotly-internal size: 1 task
難度 1/5 1 小時以內 新手友好度 82/100
-
chore P3 plotly-internal size: 1 task
難度 2/5 1-3 小時 新手友好度 65/100
-
bug
難度 2/5 1-3 小時 新手友好度 65/100
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 70/100
-
難度 2/5 1-3 小時 新手友好度 75/100
mksglu/context-mode#1200 ·
-
難度 2/5 1-3 小時 新手友好度 75/100
neondatabase/website#5944 ·
-
module: core
難度 2/5 1-3 小時 新手友好度 75/100
bigbluebutton/bigbluebutton#25849 ·
-
難度 2/5 1-3 小時 新手友好度 75/100
jaegertracing/jaeger-ui#4506 ·