Outlier slows down zooming in scattergl
未关闭
还没有人认领这个 Issue。
bug
P3
- 主要语言
- JavaScript
- 星标
- 18.3k
- 派生
- 2k
- 平均合并
- 2 天 12 小时
- 30 天内合并 PR
- 28
描述
I have large data sets, which have a fat tail, i.e. looks like having an outlier.
I use scattergl aiming for fast zooming. As shown in https://plotly.com/javascript/webgl-vs-svg
or in the example below, one million points can be done. However, if one point is set as an outlier, then zooming becomes very
slow. I don't understand this, and spent quite some time to pin down the problem.
<!DOCTYPE html>
<html>
<div id="plotly-div1"></div>
<div id="plotly-div2"></div>
<script src='https://cdn.plot.ly/plotly-latest.min.js'></script>
<script>
function gaussianRand() {
var rand = 0
for (var i=0; i < 3; ++i) {
rand += Math.random()
}
return (rand / 3) - 0.5
}
function plot(y, divnum){
trace1 = {
type: "scattergl",
y: y,
}
layout = {
height: 250,
margin: {l: 40, r: 10, b: 30, t: 10}
}
Plotly.plot('plotly-div'+divnum, {
data: [trace1],
layout: layout,
})
}
Y = []
for (var i=0; i < 1000000; i++) {
Y.push(gaussianRand())
}
plot(Y, 1)
Y[800000] = 100. // adding an outlier slows down zoom
plot(Y, 2)
delete Y
</script>
</html>
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先运行链接的 JSFiddle 复现,并比较包含和不包含单个异常值时百万点 scattergl 数据的缩放效果。调查示例所涉及的 scattergl 缩放路径和 WebGL 行为。当存在一个异常值时缩放性能不再明显下降,即表示完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- javascript
- 领域
- data-visualization, performance
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100