plotly / plotly/plotly.js

Plotly `selected` event infinity loop when using selection 'handles'

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

还没有人认领这个 Issue。

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

描述

Problem description:
It seems that when selecting data, having the data or layout change dynamically (using restyle or relayout respectively) and then selecting additional data (by moving the 'handles') the event handler then goes into an infinite loop.
Likely, the relayout due to the reselect causes a reselect which causes a relayout which causes a reselect, etc. etc.

Plotly v2.13+ goes into infinite loop when selecting additional data using the 'handles'.
Notice how the 'handles' do not reappear after moving one at the end of gif (has gone into infinite loop):
event2 gif

Plotly below v2.13 has no issues because it is not possible to reselect data using the 'handles':
event1 gif

Minimum working example: MWE
Taken from the example documentation for select-event
Note that this is a problem for Plotly v2.13+, the original example uses v1.58 (as illustrated on that page) which doesn't seem to have the problem (because the selection 'handles' to select data in the plot are not implemented prior to v2.13)
So this seems to be a regression of some kind.

Steps to reproduce:

  1. Run provided MWE
  2. Using lasso select (or other select tool) select some data (first time should not give any problems)
  3. When using Plotly v2.13+, in the selected data use the 'handles' to select additional data points
  4. Plotly now enters an infinite loop

贡献指南

打开贡献指南

从这里开始

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

调研方向

首先运行提供的 MWE,并将 v2.13+ 的行为与 select-event 文档示例进行比较。跟踪在 restyle 或 relayout 后触发的选择句柄流程,并在移动句柄不再导致无限循环且句柄正常重新出现时,认为该 issue 已解决。

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

评估

技术栈
javascript
领域
data-visualization
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
38/100

把新 issue 发到你的邮箱

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