Scattergl plot is sometimes slow to interact with even with moderate number of points
还没有人认领这个 Issue。
- 主要语言
- JavaScript
- 星标
- 18.3k
- 派生
- 2k
- 平均合并
- 2 天 12 小时
- 30 天内合并 PR
- 28
描述
With constant number of points and other settings, I see that Scattergl rendering times vary a lot. With 100,000 points, there are cases where it is virtually impossible to interact with the plot (e.g. zoom), and just moving the mouse seem to cause lengthy calculations.
For example, the following code from the doc works well:
import plotly.graph_objects as go
import numpy as np
N = 100000
fig = go.Figure(data=go.Scattergl(
x = np.random.randn(N),
y = np.random.randn(N),
mode='markers',
marker=dict(
color=np.random.randn(N),
colorscale='Viridis',
line_width=1
)
))
fig.show()
but if I replace the x data by zeros,
x = np.zeros(N),
performance is significantly degraded (so much that using Scatter instead of Scattergl becomes better when trying to zoom in a box).
Any ideas where the difference is coming from and how performance could be improved in this case?
Thanks.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从链接的 large-data-sets 文档中的 Scattergl 示例开始,先使用 100,000 个随机 x 值复现该示例,然后将 x 设置为零。比较这两种情况下 zoom-box 和鼠标交互的性能,并确定需要更改哪种行为;当退化的 x 数据不再导致报告中的长时间交互延迟时,即视为完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- javascript
- 领域
- data-visualization, performance
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 38/100