// 思路是 zoom方法在svg上面,transform在svg下面的g上
// svg 是d3创建的svg元素
this.g = svg.append("g");
svg.call(
d3
.zoom()
.scaleExtent([0.5, 3])
.on("zoom", (e) => {
if (this.is_zoom) {
this.g.attr("transform", e.transform);
}
})
);
d3 zoom 抖动解决方案
最新推荐文章于 2024-04-19 09:35:51 发布