plotly / plotly/react-plotly.js

onRelayout does not work with scrollwheel zoom on 3d plots

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

還沒有人認領這個 Issue。

主要語言
JavaScript
星號
1.1k
分支
138
平均合併
3 天 2 小時
30 天內合併 PR
4

描述

When using the scroll wheel to zoom, onRelayout seems to output the tiniest initial change rather than the layout at the end of the event (as using Zoom mode and clicking/dragging does), meaning the event better reflects the camera before the action rather than after, e.g:

  1. zooming in one 'click' of the scroll wheel will output with event.scene.camera.eye.x = 1.2499999999999998, only a tiny change from the default of 1.25
  2. zooming in again will output with event.scene.camera.eye.x = 0.94622499477157, a change of ~0.3 inwards
  3. then zooming out will output with event.scene.camera.eye.x = 0.7210090673130023, a change of ~0.2 inwards, representing another zoom in rather than out, when in theory we should be back to the position we were in after 1 zoom in

Also, if you click on the plot, then use the scroll wheel to zoom, the onRelayout event will often (but not always) be {}

Example (interact with plot as above and see console logs): https://codesandbox.io/s/compassionate-sara-hl4k9m

貢獻指南

這個儲存庫沒有索引到貢獻指南

從這裡開始

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

研究方向

從連結的 CodeSandbox 開始,在觀察 onRelayout 主控台輸出的同時,重現 3D 繪圖上的滾輪縮放。比較放大、縮小以及捲動前按一下時發出的相機值;當事件反映最終的相機狀態且沒有意外為空時,即視為完成。

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

評估

技術堆疊
javascript, react
領域
data-visualization, frontend
Issue 類型
缺陷
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
35/100

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

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