-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Add 'touch' handlers for panning on mobile devices #480
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Is there a way to add the compatibility to our scripts? Or how can I help to include this feature into the library? |
Pulled this off successfully once (requires mobile device for full effect, obv). Here's the code. Unfortunately it's not very isolated into something reusable. Useful utilities:
I won't list them all but long story short, there are good isolated utilities that can hopefully handle as much as possible and straighten out browser kinks, hopefully leaving the rest pretty short. Bonus features:
|
Although, that said, |
I tried this: I thought it would have been nice to have the touch work as the mouse (before implementing new features like pinch, etc.). But it doesn't seem to work. Another thing, I can't have relayout work for camera changes.
I get the title updated but not the camera, any idea why? Edit : |
The Bokeh plotting library supports this, all the tools (pan, zoom, box zoom, box select, lasso select) work really well using touch gestures. If I understand correctly, Bokeh uses the hammer.js library for handling touch events. |
Any news/plans on this front? Would really love to manipulate plotly.js graphs in a touch-based cordova app. |
Used touch-position and touch-pinch in pan-zoom, should say these two cover both mouse and touch interactions neatly. |
Any updates on this? The touch functionality is not working at me, is someone working on it? We need touch support in our project. |
@etpinard Is this still a part of the roadmap for Plotly 1.x? |
There are actually ready patches for that mikolalysenko/3d-view-controls#1 and gl-vis/gl-plot3d#6 |
Merged. |
3d chart touch is working now thanks to @dfcreative 🙇 |
This example seems to work also for 2d scattergl plots by adding those modifications to plots->gl2d->camera.js. However, to be useful for more complex cases (mine has a mixture of bars and scatter in the same graph), similar modifications would be needed elsewhere, but there is no camera.js equalent for generic 2d cases. In ideas how to implement this more generally (e.g. without Webgl)? |
@jackparmer , 2d support is for cartesian as well as webgl? I wonder what's the scope of work. |
Any plan to support pinch-to-zoom in the future? |
PR #1804 correctly changed some of plotly's behavior when the device does not have hover capabilities. When the device does not have hover, many interactions normally triggered by mouseover are now triggered by click. As linked earlier in this thread, it's relatively straightforward to intercept touch events and re-emit them as mouse events, here's a working CodePen example (interact with it in your mobile device). This should get you most of the way towards using touch in plotly, though pinch-to-zoom and two-finger scroll don't work. Note that the |
@malina-kirn The CodePen example you provided seems not to work anymore. Maybe related to #1967? |
Closing. Parts of this tickets were either:
|
https://developer.mozilla.org/en-US/docs/Web/API/Touch_events
why not?
The text was updated successfully, but these errors were encountered: