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

Navigator.maxTouchPoints is always 0 and should not be used #260

Open danielzgtg opened 1 year ago

danielzgtg commented 1 year ago

d3-zoom does not detect my touchscreen tablet. I have always had navigator.maxTouchPoints === 0`. Other websites such as Steam, Google Maps, and Bing Maps all accept touch input properly. Just nothing that uses d3-zoom accept my touches properly.

One example https://observablehq.com/@d3/pan-zoom-axes?collection=@d3/d3-zoom . The whole page zooms instead of the graph, until I put zoom.touchable(true) after const zoom =[^;]+;. That workaround becomes hard when using d3-zoom through a third-party library such as react-flow which controls the d3-zoom initialization itself.