d3 的双指缩放在 IE/Edge 中不起作用?

d3's pinch-to-zoom not working in IE/Edge?

我在 official documention of d3.zoom but apparently pinch zooming of an area does work in Google Chrome and Mozilla Firefox but not Microsoft Internet Explorer or Edge. This can be already seen in one of the official demos: https://bl.ocks.org/mbostock/d1f7b58631e71fbf9c568345ee04a60e

中没有找到这方面的信息

当在 IE11/Edge 中进行双指缩放时,页面缩放将被触发,可以使用 -ms-content-zooming: none 禁用(奇怪的是不是 touch-action)但这不是我想要的。

我的评估正确吗?有什么可以做的吗?是否存在一些 polyfill?

d3 页面上似乎有一个长期存在的错误报告(从 2013 年开始):

https://github.com/d3/d3/issues/989

从源代码看来,d3 使用事件 touchstart.zoomtouchmove.zoomtouchend.zoomtouchcancel.zoom.

根据我在网上找到的信息,IE 不支持那些触摸事件at all, while Edge supports it only . If it does, it needs to be

因此您不能依赖 IE 或 Edge 中的 d3 正确处理触摸事件。

但是有很多 polyfill 旨在解决这个问题。由于我没有任何启用触控功能的 Windows 设备,因此我无法测试这些设备是否正常工作,但也许可以试试这些设备: