-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvisualization.js
67 lines (59 loc) · 1.04 KB
/
visualization.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
function startGraph(cont) {
return cytoscape({
container: $(cont),
boxSelectionEnabled: false,
autounselectify: true,
wheelSensitivity: 0.15,
style: null,
elements: null
});
}
var graphLayout = {
grid: {
name: 'grid',
cols: 20,
spacingFactor: 1.5
},
cose: {
name: 'cose',
animate: true,
animationThreshold: 250,
refresh: 20,
randomize: true,
idealEdgeLength: 100,
nodeOverlap: 20,
fit: true,
padding: 30,
componentSpacing: 100,
nodeRepulsion: 400000,
edgeElasticity: 100,
nestingFactor: 5,
gravity: 80,
numIter: 1000,
initialTemp: 200,
coolingFactor: 0.95,
minTemp: 1.0
},
current: {}
};
var graphStyle = [{
selector: "node",
style: {
"height": 40,
"width": 40,
"background-color": "#333",
"label": "data(name)",
"text-valign": "center",
"text-halign": "center",
"text-wrap": "none",
"min-zoomed-font-size": "5px"
}
}, {
selector: "edge",
style: {
"width": 3,
"opacity": 0.666,
"line-color": "#888"
}
}];
graphLayout.current = Object.assign({}, graphLayout.cose);