antvis / X6

🚀 JavaScript diagramming library that uses SVG and HTML for rendering.
https://x6.antv.antgroup.com
MIT License
5.61k stars 1.68k forks source link

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

Open BlaStone opened 3 months ago

BlaStone commented 3 months ago

问题描述

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

平台

屏幕截图或视频(可选)

No response

补充说明(可选)

No response

x6-bot[bot] commented 3 months ago

👋 @BlaStone

Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. To help make it easier for us to investigate your issue, please follow the contributing guidelines. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.