Hi there,
I’m making a simple app taking Curran’s Datavis 2020 - Episode 29 as starting point.
Here’s a minimal example on VizHub.
I’m using d3-drag abstraction on a globe world map to set the rotation of the map.
The rotation itself is saved as a React state (an array).
versorDrag.js contains the business logic that updates the rotation state. It uses versor dragging.
It works nicely on my desktop browsers, but not on mobiles.
After hooking up a console to my phone, I found that (this is my guess) the state update of the rotation prevents all touch events (except the first) from firing and also that the dragEnd function is not called at the end of a drag gesture.
If I comment out line 29 in versorDrag.js (the rotation state update), all touch events are fired.
I’m not sure why this happens.
How can I update the rotation without missing the touch events? Should I update the rotation state only after a drag gesture end (on mobile)?
Thanks for any help