You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
import { Graph } from '@antv/x6';
import data from './formateData';
import { DagreLayout } from '@antv/layout';
const initGraph = (dom: HTMLDivElement) => {
const graph = new Graph({
container: dom,
autoResize: true,
background: {
color: '#F2F7FA',
},
panning: true,
mousewheel: true,
grid: {
visible: true,
type: 'doubleMesh',
args: [
{
color: '#eee', // 主网格线颜色
thickness: 1, // 主网格线宽度
},
{
color: '#ddd', // 次网格线颜色
thickness: 1, // 次网格线宽度
factor: 4, // 主次网格线间隔
},
],
},
});
const dagreLayout = new DagreLayout({
type: 'dagre',
rankdir: 'LR',
align: 'UR',
ranksep: 35,
nodesep: 15,
})
const model = dagreLayout.layout(data)
graph.fromJSON(model);
graph.centerContent();
};
export { initGraph };
type:'dagre'提示对象字面量只能指定已知属性,并且“type”不在类型“Partial”中
dagreLayout.layout(data)提示:类型“DagreLayout”上不存在属性“layout”
不管提示,直接运行,浏览器控制台报错,layout方法不存在
Beta Was this translation helpful? Give feedback.
All reactions