[BUG]: scattergl hover freezes with more than 100.000 points all with different x but same y
还没有人认领这个 Issue。
- 主要语言
- JavaScript
- 星标
- 18.3k
- 派生
- 2k
- 平均合并
- 2 天 12 小时
- 30 天内合并 PR
- 28
描述
Description
In scattergl, when you have more than 100.000 points the scattergl freezes when trying to hover, more informations in the steps to reproduce.
Steps to reproduce
In version 4.0.0
Create a scattergl with 100.000 points with x just the index of the point and y all the same.
you can use this snipper
const n = 100000;
Plotly.newPlot('graph', [{
type: 'scattergl',
mode: 'markers',
x0: 0,
dx: 1,
y: Array(n).fill(0)
}]);
The default hovermode will be ok, no need to change it.
Try hovering on the point: the app freezes immediately.
Staying in the horizontal line of the points will make it look a little slow but normal, but when you exit from the line it freezes again.
Try removing one point (99.999 points): the freeze is gone.
Notes
Probably related to #6792 and #5790 but can't confirm if it's completely the same, this is more specific.
It is probably due to to the collapsation of the algorithm that comes in in a scattergl when there are TOO_MANY_POINTS (exactly 100.000).
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先使用 Plotly.js 4.0.0 中提供的 scattergl JavaScript 代码片段重现该问题,比较 100,000 个点和 99,999 个点时的悬停行为。跟踪 scattergl 的悬停路径以及报告中提到的 TOO_MANY_POINTS 处理逻辑,并参考 issues #6792 和 #5790。对于报告中的数据,悬停不再冻结或变得异常缓慢,即表示完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- javascript
- 领域
- data-visualization
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 活跃
- 描述清晰度
- 基本清楚
- 新手友好度
- 68/100