-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy path-edit-me.js
executable file
·128 lines (104 loc) · 2.49 KB
/
-edit-me.js
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
var cy; // global so you can play with it in the debugger console easily
// you can find the documentation for cytoscape.js at
// http://js.cytoscape.org
document.addEventListener( 'DOMContentLoaded', function() { // on dom ready
cy = cytoscape( {
container: document.getElementById('cy'),
style: [
{
selector: 'node',
style: {
'height': 20,
'width': 20
// fill in some style for nodes here
}
},
{
selector: 'edge',
style: {
'width': 2,
'opacity': 0.333,
'curve-style': 'haystack'
// fill in some style for edges here
}
},
// some selector blocks you may want to use with the sample data:
{
selector: 'node:selected',
style: {
'background-color': 'black'
}
},
{
selector: 'edge:selected',
style: {
'line-color': 'black'
}
},
{
selector: 'node[?query]',
style: {
// try adding some style to query genes
}
},
{
selector: 'edge[group="coexp"]',
style: {
// style for coexpression interactions
}
},
{
selector: 'edge[group="coloc"]',
style: {
// style for colocation interactions
}
},
{
selector: 'edge[group="gi"]',
style: {
// style for genetic interactions
}
},
{
selector: 'edge[group="predict"]',
style: {
// style for predicted interactions
}
},
{
selector: 'edge[group="spd"]',
style: {
// style for shared protein domain interactions
}
},
{
selector: 'edge[group="reg"]',
style: {
// style for regulatory interactions
}
}
// try creating your own selector blocks and style
],
// use the sample data
// node.data('score') ranges on 0 to ~0.0067
elements: elements
// replace this with your own data if you like, e.g.:
/*
elements: [
{ // node n1
data: { id: 'n1' }
},
{ // node n2
data: { id: 'n2' }
},
{ // edge e1
data: { id: e1, source: 'n1', target: 'n2' }
}
]
*/
} );
// now you can play with the graph here, e.g.:
cy.nodes()[0].select();
// play with extensions, add features to the graph etc.
// have fun :)
} ); // on dom ready