Plotly.restyle breaks onClick handlers

未關閉
#330 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
3/5
預估耗時
1-2 天
新手友好度
48/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
停滯
技術堆疊
javascript, react

研究方向

首先在連結的 CodeSandbox 中重現該行為,重點關注 chart.tsx 和 Plotly.restyle 按鈕流程。將 React 元件的行為與連結的基礎 Plotly CodePen 進行比較,然後確認 restyling 後柱狀圖和折線圖的 click callbacks 是否仍會觸發。

由索引模型根據 Issue 內容生成。

描述

Issue: After calling Plotly.restyle on a rendered chart, onClick callback fail to be called.

Reproduction: https://codesandbox.io/s/youthful-ganguly-kt5pq7?file=/src/chart.tsx Using this example, you are able to click the line points or the bar and see the selection updated at the bottom. this works indefinitely, and as expected. By clicking the restyle button, the bars will change color from orange to blue. After this, click events cease to work on both the bar and the line plots.

Base Plotly: this DOES work as expected in base plotly using the same data and same reproduction steps https://codepen.io/swalsh81/pen/gOqaxeP

Expected functionality: Click events should continue to work after a Plotly.restyle event is called and function like the base plotly does as demonstrated

主要語言
JavaScript
星號
1.1k
分支
138
PR 合併指標
30 天內沒有已合併 PR

環境準備

這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

plotly/react-plotly.js 的其他 Issue

查看 plotly/react-plotly.js 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。