antvis / antvis/G6

[Bug]: resize行为异常

Open
#7,596 1 comment 0 reactions 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 / 问题描述

以下代码会导致画布异常。
```javascript
size.value = _size
graphParent.value?.setAttribute('style',`width:${size.value[0] + 40}px;height:${size.value[1] + 40}px`)
refContainer.value?.setAttribute('style',`width:${size.value[0]}px;height:${size.value[1]}px`)
GraphEditor.graph.resize(size.value[0],size.value[1])
```
可以重置画布大小,但是不能添加图元了,也不能滚轮缩放画布了,都也没报错

### Reproduction link / 复现链接

### Steps to Reproduce the Bug or Issue / 重现步骤

_No response_

### Version / 版本

Please select / 请选择

### OS / 操作系统

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

### Browser / 浏览器

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

Contributor guide

No contributing guide indexed for this repository

Research direction

Start from the GraphEditor.graph.resize call and the related size, graphParent, and refContainer updates shown in the report. Reproduce the state after resizing where adding elements and wheel zoom stop working, then trace the resize path. Done means resizing preserves both element insertion and canvas wheel zoom; no reproduction link or test file is provided.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
data-visualization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.