1.1.1 • Published 1 year ago

wx-g6-editor v1.1.1

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

wx-g6-editor

安装教程

npm install wx-g6-editor

全局引入

import G6Editor from "wx-g6-editor";
import "../node_modules/wx-g6-editor/G6Editor.css";
Vue.use(G6Editor)

局部引入

<g6-Editor class="box” />

import {G6Editor} from "wx-g6-editor";

components: {
	G6Editor,
  },
  
  .box {
  	width: 500px;
  	height: 500px;
  	box-sizing: border-box;
  	position: relative;
  	overflow: hidden;
}

属性与使用

pageName:String ------------ canvas标题

nodes:Array ------------ 节点数据,各项通用属性如下

名称是否必须类型备注
idtrueString节点唯一 ID,必须是唯一的 string
xfalseNumberx 坐标
yfalseNumbery 坐标
typefalseString指定节点类型,默认为 'circle'
sizefalseNumber / Array节点的大小

edges:Array ------------ 边数据

combos:Array ------------ 分组节点数据

graphData :Object------------构建用例图数据如下所示

const nodes_data = {
  nodes: [
    {
      id: "0",
      x: 776,
      y: -5,
      type: "rect-zdy",
      label: "《Problem》",
    },
    {
      id: "120",
      x: -276,
      y: -57,
      type: "rect-zdy",
    },
    {
      id: "03",
      x: -588,
      y: -56,
      type: "rect-zdy",
      label: "《Problem3》",
      description: '描述文字'
    },
    {
      id: "1",
      x: 350,
      y: 400,
      type: "card-node",
      label: "UserCase" + '30',
      comboId: "combo",
    },
    {
      id: "11",
      x: 228,
      y: 137,
      type: "card-node",
      label: "UserCase" + '31',
      comboId: "combo",
    },
    {
      id: "111",
      x: 529,
      y: -61,
      type: "card-node",
      label: "UserCase" + '32',
      points: 'points',
      content: 'content'
    },
    {
      id: "2",
      x: 911,
      y: 216,
      type: "img-actor",
      label: "Actor23",
    },
    {
      id: "Actor25",
      x: -217,
      y: 274,
      type: "img-actor",
      label: "Actor25",
    },
  ],
  edges: [
    {
      source: "0",
      target: "1",
      type:'edge-d'
    },
    {
      source: "120",
      target: "111",
    },
    {
      source: "Actor25",
      target: "03",
      type:'edge-s-d',
    },
    {
      source: "1",
      target: "2",
      type:'edge-d-s',
    },
  ],
  combos: [
    {
      id: "combo",
      type: 'cRect',
      label: "默认combo",
    },
  ],
};
export {
  nodes_data
}
1.1.1

1 year ago

1.1.0

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago