3D surface plotly_relayout does not trigger with touch drag. Scroll zoom reports older camera vector.
Nobody has claimed this yet.
- 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.

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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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