d3 / d3-zoom

Pan and zoom SVG, HTML or Canvas using mouse or touch input.
https://d3js.org/d3-zoom
ISC License
501 stars 144 forks source link

macOS trackpad pinch zoom on Safari is not working #229

Closed moklick closed 4 weeks ago

moklick commented 3 years ago

Hey!

I can not use pinch zoom on a macbook trackpad on Safari. The issue is reproducible with this example: https://observablehq.com/@d3/delaunay-find-zoom?collection=@d3/d3-zoom

It seems that Safari is not using event.ctrlKey + event.type === 'wheel' for identifying a pinch zoom but uses gesturestart, gesturechange and gestureend. Are you planing to implement listeners for these events or should we implement them on our own?

Fil commented 3 years ago

Thanks for the report. Yes, we would want to implement this — contributions are welcome.

moklick commented 3 years ago

Thanks for the fast reply! I'm not sure if I can help here but I'll look into it.

Richard-Mlynarik commented 2 years ago

Looks like https://github.com/antimatter15/d3-pinch-zoom was an attempt at this.

moklick commented 4 weeks ago

This seems to be fixed. The example above is now working in Safari.