plotly / plotly/plotly.js

3D surface plotly_relayout does not trigger with touch drag. Scroll zoom reports older camera vector.

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

还没有人认领这个 Issue。

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

描述

This is probably similar to https://github.com/plotly/plotly.js/issues/134
The plotly_relayout do trigger with mouse drag correctly.
However, this is not the case for touch drag.

To reproduce the problem please try open
https://plotly.com/javascript/3d-surface-plots/
and execute
document.getElementById("myDiv_1").on('plotly_relayout',()=>{console.log("relayout")});
you can see that the console doesn’t log when using touch emulator.

I also tested with https://cdn.plot.ly/plotly-latest. The problem is still reproducible.

plotly2

Another problem is mouse scroll zoom. The plotly report older camera vector. After subscribe to plotly_relayout, please then do mouse scroll zoom and execute

Plotly.relayout(document.getElementById("myDiv_1"), document.getElementById("myDiv_1")._fullLayout.scene.camera );

You will notice this the camera position is not always current. This is not problem when pan (right click drag) or rotate view.

贡献指南

打开贡献指南

从这里开始

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

调研方向

https://plotly.com/javascript/3d-surface-plots/ 中的 3D 曲面图示例开始,使用提供的 plotly_relayout 监听器重现这两种行为。检查元素的 _fullLayout.scene.camera,将触摸拖动事件和鼠标滚轮缩放与平移和旋转进行比较。触摸拖动触发 plotly_relayout,且滚轮缩放报告当前相机向量,即表示完成。

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

评估

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

把新 issue 发到你的邮箱

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