antvis / antvis/X6

使用@antv/layout中的gridlayout布局,参数无效

Open
#4,301 5 comments 0 reactions 0 assignees View on GitHub
help wanted
Dominant language
TypeScript
Stars
6.7k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

### 问题描述

```
const gridLayout = new GridLayout({
type: "grid",
width: 1000,
height: 1000,
// begin: [0, 0],
preventOverlap: true,
preventOverlapPadding: 10,
nodeSize: 20,
rows: 5,
cols: 5,
workerEnabled: true
});

const newCells = gridLayout.layout({ nodes, edges });
graph.fromJSON(newCells);
```
使用@antv/layout中的grid布局,定义的width/height/rows/cols好像都不生效

### 重现链接

https://stackblitz.com/

### 重现步骤

### 预期行为

期望参数生效,如width/height/rows/cols

### 平台

- 操作系统: [macOS, Windows, Linux, React Native ...]
- 网页浏览器: [Google Chrome, Safari, Firefox ...]
- X6 版本: [2.11.1 ...]

### 屏幕截图或视频(可选)

_No response_

### 补充说明(可选)

_No response_

Contributor guide

Open the contributing guide

Research direction

Start from the GridLayout configuration and layout call shown in the issue, then inspect the behavior using the linked StackBlitz reproduction. Verify how width, height, rows, and cols are handled; the issue is done when these parameters affect the resulting layout as expected.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.