plotly / plotly/react-plotly.js

Clickmode "event+select" activated and Clicking outside of Graph calls onUpdate incorrectly

未关闭
#341 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
JavaScript
星标
1.1k
派生
138
平均合并
3 天 2 小时
30 天内合并 PR
4

描述

Hi, currently working on Streamlit + Plotly selections! I noticed this bug that didn't seem like a bug on Streamlit's side.

It seems like onUpdate gets called and graph gets updated visually incorrectly when clickmode: "event+select" and dragmode: "select" and doing selection clicks. I would expect onDeselect to be called and layout.selections to remove the selection because selectedpoints in data has []

Reproducible example: https://codesandbox.io/p/sandbox/react-forked-6rypkr?file=%2Fsrc%2FApp.tsx

Steps to reproduce:

  1. Click on a single point
  2. Click outside of a point

Expectation: Graph is not less than 100% opaque
Actual: Graph is less than 100% opaque and weird and onUpdate is not called

Video to show actual:

https://github.com/plotly/react-plotly.js/assets/16749069/632b9ef7-c213-4a27-a7c7-08f5b8c9417e

I read that most issues here are likely Plotly.js problems but not sure if that's the case because I went to check plotly.js code and onUpdate is a callback while plotly.js contains an update function as far as I can tell.

贡献指南

这个仓库没有索引到贡献指南

从这里开始

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

调研方向

从链接的 CodeSandbox 复现开始,检查 react-plotly.js 对使用 dragmode "select" 时 clickmode "event+select" 的处理。比较点击某个点后再点击其外部时的 callbacks 和图表状态,并确定该行为应归属于此 wrapper 还是 Plotly.js。完成的标准是:报告取消选择、移除选择,并且图表保持完全不透明。

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

评估

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

把新 issue 发到你的邮箱

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