plotly / plotly/plotly.js

why Plotly.react() is as slow as Plotly.newPlot()? updating single trace of many

未关闭
#5,674 2 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

bug P3 performance
主要语言
JavaScript
星标
18.3k
派生
2k
平均合并
2 天 12 小时
30 天内合并 PR
28

描述

Hi, I am trying to redraw only single trace in a plot of many traces (biophysical data). I tried to follow instructions in react-plotly and plotlyjs documentation:
https://plotly.com/javascript/plotlyjs-function-reference/#plotlyreact
Plot is updated but I don't see any performance improvement if I change only single element of data or all data elements:
Here is MWE in codepen
Briefly, I generated sample data 100 traces of 10000 points and changing only first trace with:

  data[0].x =  [...Array(10).keys()].map( c=> c/10) //change only first trace
  data[0].y =  [...Array(10).keys()].map( c=> Math.random())
  Plotly.react('myDiv', data, layout);

Drawing plot containing single trace takes just a split of second, but if I had already drawn many traces and I want to redraw only single trace, it takes same time as to redraw all traces (few seconds).
Am I doing something wrong?

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从链接的 CodePen MWE 开始,使用所述的 100 条 trace、10,000 个点的数据比较 Plotly.react() 和 Plotly.newPlot()。阅读链接的 Plotly.react 文档,并跟踪仓库中的更新路径;issue 未指明源文件或测试。完成这项工作需要找出产生相近计时结果的原因,并定义预期的优化或文档变更。

由索引模型根据 Issue 内容生成。

评估

技术栈
javascript
领域
data-visualization, frontend, performance
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
需要澄清
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。