forked from sgratzl/cytoscape.js-layers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
edgeTypes.ts
70 lines (69 loc) · 1.59 KB
/
edgeTypes.ts
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/* eslint-disable @typescript-eslint/no-namespace */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
namespace EdgeTypes {
declare const cytoscape: typeof import('cytoscape');
// declare const CytoscapeLayers: typeof import('../build');
export const cy = cytoscape({
container: document.getElementById('app'),
layout: {
name: 'cose',
},
elements: [
...Array.from('abcdefg').map((d) => ({ data: { id: d } })),
...['ab', 'ac', 'ad', 'ae', 'af', 'ag', 'ga', 'fa', 'ea', 'da', 'ca', 'ba'].map((d) => ({
data: { id: d, source: d[0], target: d[1] },
})),
],
style: [
{
selector: 'edge',
style: {
'line-color': 'black',
opacity: 0.5,
},
},
{
selector: '#ab,#ba',
style: {
label: 'haystack',
'curve-style': 'haystack',
},
},
{
selector: '#ac,#ca',
style: {
label: 'bezier',
'curve-style': 'bezier',
},
},
{
selector: '#ad,#da',
style: {
label: 'segments',
'curve-style': 'segments',
},
},
{
selector: '#ae,#ea',
style: {
label: 'straight',
'curve-style': 'straight',
},
},
{
selector: '#af,#fa',
style: {
label: 'taxi',
'curve-style': 'taxi',
},
},
{
selector: '#ag,#ga',
style: {
label: 'unbundled-bezier',
'curve-style': 'unbundled-bezier',
},
},
],
});
}