antvis / antvis/G6

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

Open
#6,964 1 comment 1 reaction 0 assignees View on GitHub
bug 🐛
Dominant language
TypeScript
Stars
12.3k
Forks
1.6k
PR merge metrics
No merged PRs in 30d

Description

### Describe the bug / 问题描述

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

### Reproduction link / 复现链接

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 / 操作系统

- [x] macOS
- [ ] Windows
- [ ] Linux
- [ ] Others / 其他

### Browser / 浏览器

- [ ] Chrome
- [ ] Edge
- [x] Firefox
- [ ] Safari (Limited support / 有限支持)
- [ ] IE (Nonsupport / 不支持)
- [ ] Others / 其他

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the graph.zoomBy calls and the linked CodeSandbox reproduction, comparing animation enabled with animation disabled and an origin of [100, 100]. Trace the zoomBy animation path and verify that the origin is respected during animated zooming as well as immediate zooming.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
data-visualization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.