antvis/G6

Do you want to work on this issue?

You can request for a bounty in order to promote it!

[Bug]: zoomBy origin only works when animation is turned off #6964

louisch posted onGitHub

Describe the bug / é—®é¢˜ęčæ°

Calling zoomBy with origin set will only work if animation is off.

https://codesandbox.io/p/devbox/vite-react-forked-qryx9c

Steps to Reproduce the Bug or Issue / é‡ēŽ°ę­„éŖ¤

Call graph.zoomBy with animation on, and an origin.

e.g.

const graph = new Graph({
   animation: { duration: 300 } // set something here
  ...
});
graph.zoomBy(1.1, undefined, [100, 100]);

or

graph.zoomBy(1.1, { duration: 300 }, [100, 100]);

The origin parameter is ignored. If you then turn animations off, e.g. with graph.zoomBy(1.1, false, [100, 100]), the origin will be respected.

Version / ē‰ˆęœ¬

šŸ†• 5.x

OS / ę“ä½œē³»ē»Ÿ

  • macOS
  • Windows
  • Linux
  • Others / 其他

Browser / ęµč§ˆå™Ø

  • Chrome
  • Edge
  • Firefox
  • Safari (Limited support / ęœ‰é™ę”ÆęŒ)
  • IE (Nonsupport / äøę”ÆęŒ)
  • Others / 其他

Fund this Issue

$0.00
Funded
Only logged in users can fund an issue

Pull requests