antvis/G6

关于g6使用zoomTo元素位置问题 #4912

lclong posted onGitHub

问题描述

在id为circle的元素x、y位置使用zoomTo,但是缩放后id为circle的元素会偏移到其他位置,而不是以id为circle的元素进行缩放

重现链接

https://stackblitz.com/edit/react-wvaxr6?file=index.js

重现步骤

如上面问题描述所述

预期行为

期望看到:以id为circle的元素为中心进行缩放 实际看到:id为circle的元素在缩放后跑到了其他位置

平台

  • 操作系统: Windows
  • 网页浏览器: Google Chrome
  • G6 版本: 4.8

屏幕截图或视频(可选)

No response

补充说明(可选)

No response


需要做一下坐标转换,zoomTo 接受的缩放中心是视口坐标系

image

https://stackblitz.com/edit/react-wvaxr6-gq8k79?file=index.js

posted by Yanyan-Wang over 1 year ago

好的,谢谢

posted by lclong over 1 year ago

Fund this Issue

$0.00
Funded

Pull requests