plotly / plotly/plotly.js

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

Open
#5,698 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug P3
Dominant language
JavaScript
Stars
18.3k
Forks
2k
Avg merge
2d 12h
Merged PRs (30d)
28

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the 3D surface plot example at https://plotly.com/javascript/3d-surface-plots/ and reproduce both behaviors using the provided plotly_relayout listener. Compare touch-drag events and mouse scroll zoom with pan and rotate, inspecting the element’s _fullLayout.scene.camera. Done means touch drag triggers plotly_relayout and scroll zoom reports the current camera vector.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
data-visualization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.