-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path01_pyvis_default.html
250 lines (194 loc) · 23.9 KB
/
01_pyvis_default.html
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
<html>
<head>
<meta charset="utf-8">
<script src="lib/bindings/utils.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/vis-network/9.1.2/dist/dist/vis-network.min.css" integrity="sha512-WgxfT5LWjfszlPHXRmBWHkV2eceiWTOBvrKCNbdgDYTHrT2AeLCGbF4sZlZw3UMN3WtL0tGUoIAKsu8mllg/XA==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/vis-network/9.1.2/dist/vis-network.min.js" integrity="sha512-LnvoEWDFrqGHlHmDD2101OrLcbsfkrzoSpvtSQtxK3RMnRV0eOkhhBN2dXHKRrUU8p2DGRTk35n4O8nWSVe1mQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<center>
<h1></h1>
</center>
<!-- <link rel="stylesheet" href="../node_modules/vis/dist/vis.min.css" type="text/css" />
<script type="text/javascript" src="../node_modules/vis/dist/vis.js"> </script>-->
<link
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
rel="stylesheet"
integrity="sha384-eOJMYsd53ii+scO/bJGFsiCZc+5NDVN2yr8+0RDqr0Ql0h+rP48ckxlpbzKgwra6"
crossorigin="anonymous"
/>
<script
src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
integrity="sha384-JEW9xMcG8R+pH31jmWH6WWP0WintQrMb4s7ZOdauHnUtxwoG2vI5DkLtS3qm9Ekf"
crossorigin="anonymous"
></script>
<center>
<h1></h1>
</center>
<style type="text/css">
#mynetwork {
width: 100%;
height: 100%;
background-color: #ffffff;
border: 1px solid lightgray;
position: relative;
float: left;
}
#loadingBar {
position:absolute;
top:0px;
left:0px;
width: 100%;
height: 100%;
background-color:rgba(200,200,200,0.8);
-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-ms-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
transition: all 0.5s ease;
opacity:1;
}
#bar {
position:absolute;
top:0px;
left:0px;
width:20px;
height:20px;
margin:auto auto auto auto;
border-radius:11px;
border:2px solid rgba(30,30,30,0.05);
background: rgb(0, 173, 246); /* Old browsers */
box-shadow: 2px 0px 4px rgba(0,0,0,0.4);
}
#border {
position:absolute;
top:10px;
left:10px;
width:500px;
height:23px;
margin:auto auto auto auto;
box-shadow: 0px 0px 4px rgba(0,0,0,0.2);
border-radius:10px;
}
#text {
position:absolute;
top:8px;
left:530px;
width:30px;
height:50px;
margin:auto auto auto auto;
font-size:22px;
color: #000000;
}
div.outerBorder {
position:relative;
top:400px;
width:600px;
height:44px;
margin:auto auto auto auto;
border:8px solid rgba(0,0,0,0.1);
background: rgb(252,252,252); /* Old browsers */
background: -moz-linear-gradient(top, rgba(252,252,252,1) 0%, rgba(237,237,237,1) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(252,252,252,1)), color-stop(100%,rgba(237,237,237,1))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, rgba(252,252,252,1) 0%,rgba(237,237,237,1) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, rgba(252,252,252,1) 0%,rgba(237,237,237,1) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, rgba(252,252,252,1) 0%,rgba(237,237,237,1) 100%); /* IE10+ */
background: linear-gradient(to bottom, rgba(252,252,252,1) 0%,rgba(237,237,237,1) 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fcfcfc', endColorstr='#ededed',GradientType=0 ); /* IE6-9 */
border-radius:72px;
box-shadow: 0px 0px 10px rgba(0,0,0,0.2);
}
</style>
</head>
<body>
<div class="card" style="width: 100%">
<div id="mynetwork" class="card-body"></div>
</div>
<div id="loadingBar">
<div class="outerBorder">
<div id="text">0%</div>
<div id="border">
<div id="bar"></div>
</div>
</div>
</div>
<script type="text/javascript">
// initialize global variables.
var edges;
var nodes;
var allNodes;
var allEdges;
var nodeColors;
var originalNodes;
var network;
var container;
var options, data;
var filter = {
item : '',
property : '',
value : []
};
// This method is responsible for drawing the graph, returns the drawn network
function drawGraph() {
var container = document.getElementById('mynetwork');
// parsing and collecting nodes and edges from the python
nodes = new vis.DataSet([{"color": "#97c2fc", "id": "1", "label": "1", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "884", "label": "884", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "10", "label": "10", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "8317", "label": "8317", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "8520", "label": "8520", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "100", "label": "100", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "3472", "label": "3472", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "9954", "label": "9954", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "9995", "label": "9995", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "101", "label": "101", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "1000", "label": "1000", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "1782", "label": "1782", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "183", "label": "183", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "7208", "label": "7208", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "8094", "label": "8094", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "9102", "label": "9102", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "1001", "label": "1001", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "1441", "label": "1441", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "2383", "label": "2383", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "368", "label": "368", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "9202", "label": "9202", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "9886", "label": "9886", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "1002", "label": "1002", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "4944", "label": "4944", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "7464", "label": "7464", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "8068", "label": "8068", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "9402", "label": "9402", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "9986", "label": "9986", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "1003", "label": "1003", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "3897", "label": "3897", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "40", "label": "40", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "6578", "label": "6578", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "8524", "label": "8524", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "9910", "label": "9910", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "1004", "label": "1004", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "1811", "label": "1811", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "4244", "label": "4244", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "5125", "label": "5125", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "8237", "label": "8237", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "9801", "label": "9801", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "1005", "label": "1005", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "1663", "label": "1663", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "5291", "label": "5291", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "8693", "label": "8693", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "9585", "label": "9585", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "9875", "label": "9875", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "1006", "label": "1006", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "4410", "label": "4410", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "6711", "label": "6711", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "7820", "label": "7820", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "7974", "label": "7974", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "9945", "label": "9945", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "1016", "label": "1016", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "1007", "label": "1007", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "2924", "label": "2924", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "5831", "label": "5831", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "8659", "label": "8659", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "8810", "label": "8810", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "9407", "label": "9407", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "1008", "label": "1008", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "2303", "label": "2303", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "7880", "label": "7880", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "9426", "label": "9426", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "9748", "label": "9748", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "9765", "label": "9765", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "1009", "label": "1009", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "4006", "label": "4006", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "4582", "label": "4582", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "6430", "label": "6430", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "9545", "label": "9545", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "9884", "label": "9884", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "4010", "label": "4010", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "8447", "label": "8447", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "1010", "label": "1010", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "7527", "label": "7527", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "7536", "label": "7536", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "917", "label": "917", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "9658", "label": "9658", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "9916", "label": "9916", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "1011", "label": "1011", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "4853", "label": "4853", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "7565", "label": "7565", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "8916", "label": "8916", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "922", "label": "922", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "9740", "label": "9740", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "1012", "label": "1012", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "6980", "label": "6980", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "8453", "label": "8453", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "8465", "label": "8465", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "8889", "label": "8889", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "9489", "label": "9489", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "1013", "label": "1013", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "1478", "label": "1478", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "3623", "label": "3623", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "5990", "label": "5990", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "8116", "label": "8116", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "9981", "label": "9981", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "1014", "label": "1014", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "1293", "label": "1293", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "8514", "label": "8514", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "8712", "label": "8712", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "9226", "label": "9226", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "9308", "label": "9308", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "1015", "label": "1015", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "3647", "label": "3647", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "3872", "label": "3872", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "8653", "label": "8653", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "8967", "label": "8967", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "9865", "label": "9865", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "5598", "label": "5598", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "6287", "label": "6287", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "6321", "label": "6321", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "9932", "label": "9932", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "1017", "label": "1017", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "1760", "label": "1760", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "4185", "label": "4185", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "7378", "label": "7378", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "7990", "label": "7990", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "9896", "label": "9896", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "1018", "label": "1018", "shape": "dot", "size": 10}, {"color": "#97c2fc", "id": "1071", "label": "1071", "shape": "dot", "size": 10}]);
edges = new vis.DataSet([{"arrows": "to", "from": "1", "to": "884", "width": 1}, {"arrows": "to", "from": "10", "to": "8317", "width": 1}, {"arrows": "to", "from": "10", "to": "8520", "width": 1}, {"arrows": "to", "from": "100", "to": "3472", "width": 1}, {"arrows": "to", "from": "100", "to": "9954", "width": 1}, {"arrows": "to", "from": "100", "to": "9995", "width": 1}, {"arrows": "to", "from": "9954", "to": "101", "width": 1}, {"arrows": "to", "from": "1000", "to": "1782", "width": 1}, {"arrows": "to", "from": "1000", "to": "183", "width": 1}, {"arrows": "to", "from": "1000", "to": "7208", "width": 1}, {"arrows": "to", "from": "1000", "to": "8094", "width": 1}, {"arrows": "to", "from": "1000", "to": "9102", "width": 1}, {"arrows": "to", "from": "1001", "to": "1441", "width": 1}, {"arrows": "to", "from": "1001", "to": "2383", "width": 1}, {"arrows": "to", "from": "1001", "to": "368", "width": 1}, {"arrows": "to", "from": "1001", "to": "9202", "width": 1}, {"arrows": "to", "from": "1001", "to": "9886", "width": 1}, {"arrows": "to", "from": "1002", "to": "4944", "width": 1}, {"arrows": "to", "from": "1002", "to": "7464", "width": 1}, {"arrows": "to", "from": "1002", "to": "8068", "width": 1}, {"arrows": "to", "from": "1002", "to": "9402", "width": 1}, {"arrows": "to", "from": "1002", "to": "9986", "width": 1}, {"arrows": "to", "from": "1003", "to": "3897", "width": 1}, {"arrows": "to", "from": "1003", "to": "40", "width": 1}, {"arrows": "to", "from": "1003", "to": "6578", "width": 1}, {"arrows": "to", "from": "1003", "to": "8524", "width": 1}, {"arrows": "to", "from": "1003", "to": "9910", "width": 1}, {"arrows": "to", "from": "1004", "to": "1811", "width": 1}, {"arrows": "to", "from": "1004", "to": "4244", "width": 1}, {"arrows": "to", "from": "1004", "to": "5125", "width": 1}, {"arrows": "to", "from": "1004", "to": "8237", "width": 1}, {"arrows": "to", "from": "1004", "to": "9801", "width": 1}, {"arrows": "to", "from": "1005", "to": "1663", "width": 1}, {"arrows": "to", "from": "1005", "to": "5291", "width": 1}, {"arrows": "to", "from": "1005", "to": "8693", "width": 1}, {"arrows": "to", "from": "1005", "to": "9585", "width": 1}, {"arrows": "to", "from": "1005", "to": "9875", "width": 1}, {"arrows": "to", "from": "1006", "to": "4410", "width": 1}, {"arrows": "to", "from": "1006", "to": "6711", "width": 1}, {"arrows": "to", "from": "1006", "to": "7820", "width": 1}, {"arrows": "to", "from": "1006", "to": "7974", "width": 1}, {"arrows": "to", "from": "1006", "to": "9945", "width": 1}, {"arrows": "to", "from": "9945", "to": "1016", "width": 1}, {"arrows": "to", "from": "1007", "to": "2924", "width": 1}, {"arrows": "to", "from": "1007", "to": "5831", "width": 1}, {"arrows": "to", "from": "1007", "to": "8659", "width": 1}, {"arrows": "to", "from": "1007", "to": "8810", "width": 1}, {"arrows": "to", "from": "1007", "to": "9407", "width": 1}, {"arrows": "to", "from": "1008", "to": "2303", "width": 1}, {"arrows": "to", "from": "1008", "to": "7880", "width": 1}, {"arrows": "to", "from": "1008", "to": "9426", "width": 1}, {"arrows": "to", "from": "1008", "to": "9748", "width": 1}, {"arrows": "to", "from": "1008", "to": "9765", "width": 1}, {"arrows": "to", "from": "1009", "to": "4006", "width": 1}, {"arrows": "to", "from": "1009", "to": "4582", "width": 1}, {"arrows": "to", "from": "1009", "to": "6430", "width": 1}, {"arrows": "to", "from": "1009", "to": "9545", "width": 1}, {"arrows": "to", "from": "1009", "to": "9884", "width": 1}, {"arrows": "to", "from": "101", "to": "4010", "width": 1}, {"arrows": "to", "from": "101", "to": "8447", "width": 1}, {"arrows": "to", "from": "1010", "to": "7527", "width": 1}, {"arrows": "to", "from": "1010", "to": "7536", "width": 1}, {"arrows": "to", "from": "1010", "to": "917", "width": 1}, {"arrows": "to", "from": "1010", "to": "9658", "width": 1}, {"arrows": "to", "from": "1010", "to": "9916", "width": 1}, {"arrows": "to", "from": "1011", "to": "4853", "width": 1}, {"arrows": "to", "from": "1011", "to": "7565", "width": 1}, {"arrows": "to", "from": "1011", "to": "8916", "width": 1}, {"arrows": "to", "from": "1011", "to": "922", "width": 1}, {"arrows": "to", "from": "1011", "to": "9740", "width": 1}, {"arrows": "to", "from": "1012", "to": "6980", "width": 1}, {"arrows": "to", "from": "1012", "to": "8453", "width": 1}, {"arrows": "to", "from": "1012", "to": "8465", "width": 1}, {"arrows": "to", "from": "1012", "to": "8889", "width": 1}, {"arrows": "to", "from": "1012", "to": "9489", "width": 1}, {"arrows": "to", "from": "1013", "to": "1478", "width": 1}, {"arrows": "to", "from": "1013", "to": "3623", "width": 1}, {"arrows": "to", "from": "1013", "to": "5990", "width": 1}, {"arrows": "to", "from": "1013", "to": "8116", "width": 1}, {"arrows": "to", "from": "1013", "to": "9981", "width": 1}, {"arrows": "to", "from": "1014", "to": "1293", "width": 1}, {"arrows": "to", "from": "1014", "to": "8514", "width": 1}, {"arrows": "to", "from": "1014", "to": "8712", "width": 1}, {"arrows": "to", "from": "1014", "to": "9226", "width": 1}, {"arrows": "to", "from": "1014", "to": "9308", "width": 1}, {"arrows": "to", "from": "1015", "to": "3647", "width": 1}, {"arrows": "to", "from": "1015", "to": "3872", "width": 1}, {"arrows": "to", "from": "1015", "to": "8653", "width": 1}, {"arrows": "to", "from": "1015", "to": "8967", "width": 1}, {"arrows": "to", "from": "1015", "to": "9865", "width": 1}, {"arrows": "to", "from": "1016", "to": "5598", "width": 1}, {"arrows": "to", "from": "1016", "to": "6287", "width": 1}, {"arrows": "to", "from": "1016", "to": "6321", "width": 1}, {"arrows": "to", "from": "1016", "to": "9932", "width": 1}, {"arrows": "to", "from": "1017", "to": "1760", "width": 1}, {"arrows": "to", "from": "1017", "to": "4185", "width": 1}, {"arrows": "to", "from": "1017", "to": "7378", "width": 1}, {"arrows": "to", "from": "1017", "to": "7990", "width": 1}, {"arrows": "to", "from": "1017", "to": "9896", "width": 1}, {"arrows": "to", "from": "1018", "to": "1071", "width": 1}]);
nodeColors = {};
allNodes = nodes.get({ returnType: "Object" });
for (nodeId in allNodes) {
nodeColors[nodeId] = allNodes[nodeId].color;
}
allEdges = edges.get({ returnType: "Object" });
// adding nodes and edges to the graph
data = {nodes: nodes, edges: edges};
var options = {
"configure": {
"enabled": false
},
"edges": {
"color": {
"inherit": true
},
"smooth": {
"enabled": true,
"type": "dynamic"
}
},
"interaction": {
"dragNodes": true,
"hideEdgesOnDrag": false,
"hideNodesOnDrag": false
},
"physics": {
"enabled": true,
"stabilization": {
"enabled": true,
"fit": true,
"iterations": 1000,
"onlyDynamicEdges": false,
"updateInterval": 50
}
}
};
network = new vis.Network(container, data, options);
network.on("stabilizationProgress", function(params) {
document.getElementById('loadingBar').removeAttribute("style");
var maxWidth = 496;
var minWidth = 20;
var widthFactor = params.iterations/params.total;
var width = Math.max(minWidth,maxWidth * widthFactor);
document.getElementById('bar').style.width = width + 'px';
document.getElementById('text').innerHTML = Math.round(widthFactor*100) + '%';
});
network.once("stabilizationIterationsDone", function() {
document.getElementById('text').innerHTML = '100%';
document.getElementById('bar').style.width = '496px';
document.getElementById('loadingBar').style.opacity = 0;
// really clean the dom element
setTimeout(function () {document.getElementById('loadingBar').style.display = 'none';}, 500);
});
return network;
}
drawGraph();
</script>
</body>
</html>