多边
目前 Graphin 支持多边,通过设置 options.autoPolyEdge = true 开启
演示
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/* eslint-disable no-undef */
import React from 'react';
import ReactDOM from 'react-dom';
import Graphin, { Utils } from '@antv/graphin';
import '@antv/graphin/dist/index.css'; // 引入Graphin CSS
import '@antv/graphin-components/dist/index.css'; // 引入Graphin CSS
const data = Utils.mock(5).circle().graphin();
// 5边 MOCK
const polyEdge1 = (c) => {
const item = { source: 'node-0', target: 'node-1', label: `edge-0_1_${c}` };
return {
...item,
data: {
...item,
properties: [],
},
};
};
for (let i = 0; i < 3; i++) data.edges.push(polyEdge1(i));
// 4边 MOCK
const polyEdge2 = (c) => {
const item = { source: 'node-0', target: 'node-2', label: `edge-0_2_${c}` };
return {
...item,
data: {
...item,
properties: [],
},
Enter to Rename, Shift+Enter to Preview