antvis / layout

Layout algorithms for graphs.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

X6, 2.0.8 使用报错

MusicDataFeTeam opened this issue · comments

x6: 版本2.0.8
layout 版本:0.3.23

` const handleLayoutChange = () => {
const { graph } = data;
const gridLayout = new GridLayout({
type: 'grid',
width: 600,
height: 400,
center: [300, 200],
rows: 4,
cols: 4
});

console.log({nodes: graph.getNodes(), edges: graph.getEdges()})

const newModel = gridLayout.layout({ nodes: graph.getNodes(), edges: graph.getEdges() });

// console.log(newModel);
graph.fromJSON(newModel);`

报错
image

node 里面是不是数据结构变了?