-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathscript.js
61 lines (53 loc) · 1.03 KB
/
script.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
var network;
function redrawAll() {
// remove positoins
for (var i = 0; i < nodes.length; i++) {
delete nodes[i].x;
delete nodes[i].y;
}
// create a network
var container = document.getElementById("mynetwork");
var data = {
nodes: nodes,
edges: edges
};
var options = {
nodes: {
shape: "dot",
borderWidthSelected:10,
scaling: {
min: 10,
max: 30
},
font: {
size: 19,
face: "Tahoma"
}
},
edges: {
width: 0.15,
selectionWidth: 18,
color: { inherit: "from" },
smooth: {
type: "continuous"
}
},
physics: {
stabilization: false,
timestep:2.6,
maxVelocity:70,
barnesHut: {
gravitationalConstant: -80000,
springConstant: 0.001,
springLength: 200
}
},
interaction: {
tooltipDelay: 200,
hideEdgesOnDrag: true,
hideEdgesOnZoom: true,
}
};
network = new vis.Network(container, data, options);
}
redrawAll();