antvis / antvis/Graphin

fitView=true not working 图没有自动适配画布大小

Open
#160 4 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
1.1k
Forks
275
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
添加了options={{fitView: true}},但是画布并没有缩放到显示所有节点。

参考链接:https://www.yuque.com/antv/g6/graph#2VtUQ

**To Reproduce**
比如这个示例:
https://codesandbox.io/s/layout-selector-le6s4?file=/src/index.js

**Expected behavior**
添加了options={{fitView: true}}后,画布缩放到显示所有节点。

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser: chrome
- Version: 83.0.4103.116

Contributor guide

Open the contributing guide

Research direction

Start with the reproduced example in the linked CodeSandbox, especially src/index.js, and compare its options={{fitView: true}} behavior with the referenced G6 documentation. Trace how the Graphin example handles fitView and verify the result in Chrome. Done means the canvas automatically scales to display all nodes when fitView is enabled.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.