官方参考网站如下:https://antv-x6.gitee.io/zh/docs/tutorial/about
目录
安装x6
输入以下命令
npm install @antv/x6 --save
引用插件代码如下:
import { Graph } from '@antv/x6';
创建绘制区域
this.guiX6 = new Graph({
container: document.querySelector('.guix6'),
width: 800,
height: 600,
background: {
color: '#fffbe6', // 设置画布背景颜色
},
grid: {
size: 10, // 网格大小 10px
visible: true, // 渲染网格背景
},
});
插入数据并渲染
this.guiX6.fromJSON({
// 节