Adding date in subplots is slow
未关闭
还没有人认领这个 Issue。
P3
performance
- 主要语言
- Python
- 星标
- 18.8k
- 派生
- 2.8k
- 平均合并
- 16 小时 26 分钟
- 30 天内合并 PR
- 21
描述
Hi everyone!
I'm currently trying to create 50 subplots which will update each second like real time. I don't use dash because visualizing with Jupiter is more important for me.
Well, here is an example of a pseudocode
rows = 50
fig = go.FigureWidget(make_subplots(rows = rows, cols = 1, vertical_spacing = 0.005))
for i in range(1,rows+1):
fig.add_trace(go.Scatter(line_color = ...), row = i, col=1)
After, I update my subplots by signals. I decimated date and added in fig
with fig.batch_update():
for j in range(rows):
fig.data[j].x = trace['Date'][START:END]
fig.data[j].y = trace.iloc[START:END, col_st:col_end][str(col_end)]
And this procedure takes 3 seconds each loop, which is a very long time for my tasks. My question is how I can add more faster date.
If anyone wants to repeat the code, create date with size 100 and add to each subplots.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
该 issue 提供了使用 FigureWidget、make_subplots 和 batch_update 的伪代码,但没有指出任何 repository 文件或测试。首先,使用包含 100 个点的日期数组复现 50 个子图,并对更新循环进行性能分析。只有确认性能有所提升,或对限制路径给出有文档记录的解释,才算完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- jupyter-notebook, python
- 领域
- data-visualization, performance
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 需要澄清
- 新手友好度
- 25/100