-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconnection_10.html
155 lines (106 loc) · 17.1 KB
/
connection_10.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
<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: 600px;
background-color: #ffffff;
border: 1px solid lightgray;
position: relative;
float: left;
}
</style>
</head>
<body>
<div class="card" style="width: 100%">
<div id="mynetwork" class="card-body"></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": "0.69", "label": "Level 0.69", "shape": "dot"}, {"color": "#97c2fc", "id": "0.555", "label": "Level 0.555", "shape": "dot"}, {"color": "#97c2fc", "id": "2.4", "label": "Level 2.4", "shape": "dot"}, {"color": "#97c2fc", "id": "1.5", "label": "Level 1.5", "shape": "dot"}, {"color": "#97c2fc", "id": "0.8", "label": "Level 0.8", "shape": "dot"}, {"color": "#97c2fc", "id": "6.05", "label": "Level 6.05", "shape": "dot"}, {"color": "#97c2fc", "id": "9.4", "label": "Level 9.4", "shape": "dot"}, {"color": "#97c2fc", "id": "4.1", "label": "Level 4.1", "shape": "dot"}, {"color": "#97c2fc", "id": "9", "label": "Level 9", "shape": "dot"}, {"color": "#97c2fc", "id": "1.13", "label": "Level 1.13", "shape": "dot"}, {"color": "#97c2fc", "id": "8.2e-10", "label": "Level 8.2e-10", "shape": "dot"}, {"color": "#97c2fc", "id": "9.11", "label": "Level 9.11", "shape": "dot"}, {"color": "#97c2fc", "id": "0.15", "label": "Level 0.15", "shape": "dot"}, {"color": "#97c2fc", "id": "1", "label": "Level 1", "shape": "dot"}, {"color": "#97c2fc", "id": "0.5", "label": "Level 0.5", "shape": "dot"}, {"color": "#97c2fc", "id": "0.4", "label": "Level 0.4", "shape": "dot"}, {"color": "#97c2fc", "id": "9.6", "label": "Level 9.6", "shape": "dot"}, {"color": "#97c2fc", "id": "4.04", "label": "Level 4.04", "shape": "dot"}, {"color": "#97c2fc", "id": "0.74", "label": "Level 0.74", "shape": "dot"}, {"color": "#97c2fc", "id": "0", "label": "Level 0", "shape": "dot"}, {"color": "#97c2fc", "id": "0.04", "label": "Level 0.04", "shape": "dot"}, {"color": "#97c2fc", "id": "0.02", "label": "Level 0.02", "shape": "dot"}, {"color": "#97c2fc", "id": "5.01", "label": "Level 5.01", "shape": "dot"}, {"color": "#97c2fc", "id": "4.3", "label": "Level 4.3", "shape": "dot"}, {"color": "#97c2fc", "id": "1.1", "label": "Level 1.1", "shape": "dot"}, {"color": "#97c2fc", "id": "0.9", "label": "Level 0.9", "shape": "dot"}, {"color": "#97c2fc", "id": "5.3", "label": "Level 5.3", "shape": "dot"}, {"color": "#97c2fc", "id": "0.99", "label": "Level 0.99", "shape": "dot"}, {"color": "#97c2fc", "id": "6.3", "label": "Level 6.3", "shape": "dot"}, {"color": "#97c2fc", "id": "6.1", "label": "Level 6.1", "shape": "dot"}, {"color": "#97c2fc", "id": "5.4", "label": "Level 5.4", "shape": "dot"}, {"color": "#97c2fc", "id": "6.7", "label": "Level 6.7", "shape": "dot"}, {"color": "#97c2fc", "id": "0.556", "label": "Level 0.556", "shape": "dot"}, {"color": "#97c2fc", "id": "9.1", "label": "Level 9.1", "shape": "dot"}, {"color": "#97c2fc", "id": "0.6", "label": "Level 0.6", "shape": "dot"}, {"color": "#97c2fc", "id": "0.01", "label": "Level 0.01", "shape": "dot"}, {"color": "#97c2fc", "id": "7.8", "label": "Level 7.8", "shape": "dot"}, {"color": "#97c2fc", "id": "2.1", "label": "Level 2.1", "shape": "dot"}, {"color": "#97c2fc", "id": "8", "label": "Level 8", "shape": "dot"}, {"color": "#97c2fc", "id": "3.14", "label": "Level 3.14", "shape": "dot"}, {"color": "#97c2fc", "id": "6", "label": "Level 6", "shape": "dot"}, {"color": "#97c2fc", "id": "0.11", "label": "Level 0.11", "shape": "dot"}, {"color": "#97c2fc", "id": "0.22", "label": "Level 0.22", "shape": "dot"}, {"color": "#97c2fc", "id": "4.5", "label": "Level 4.5", "shape": "dot"}, {"color": "#97c2fc", "id": "6.2", "label": "Level 6.2", "shape": "dot"}, {"color": "#97c2fc", "id": "9.9", "label": "Level 9.9", "shape": "dot"}, {"color": "#97c2fc", "id": "1.05", "label": "Level 1.05", "shape": "dot"}, {"color": "#97c2fc", "id": "10", "label": "Level 10", "shape": "dot"}, {"color": "#97c2fc", "id": "2.5", "label": "Level 2.5", "shape": "dot"}, {"color": "#97c2fc", "id": "3.2", "label": "Level 3.2", "shape": "dot"}, {"color": "#97c2fc", "id": "3.3", "label": "Level 3.3", "shape": "dot"}, {"color": "#97c2fc", "id": "1.8", "label": "Level 1.8", "shape": "dot"}, {"color": "#97c2fc", "id": "5.7", "label": "Level 5.7", "shape": "dot"}, {"color": "#97c2fc", "id": "0.3", "label": "Level 0.3", "shape": "dot"}, {"color": "#97c2fc", "id": "7.7", "label": "Level 7.7", "shape": "dot"}, {"color": "#97c2fc", "id": "2.3", "label": "Level 2.3", "shape": "dot"}, {"color": "#97c2fc", "id": "4.66", "label": "Level 4.66", "shape": "dot"}, {"color": "#97c2fc", "id": "0.03", "label": "Level 0.03", "shape": "dot"}, {"color": "#97c2fc", "id": "7", "label": "Level 7", "shape": "dot"}, {"color": "#97c2fc", "id": "5.5", "label": "Level 5.5", "shape": "dot"}, {"color": "#97c2fc", "id": "4.6", "label": "Level 4.6", "shape": "dot"}, {"color": "#97c2fc", "id": "2.7", "label": "Level 2.7", "shape": "dot"}, {"color": "#97c2fc", "id": "6.56", "label": "Level 6.56", "shape": "dot"}, {"color": "#97c2fc", "id": "4.4", "label": "Level 4.4", "shape": "dot"}, {"color": "#97c2fc", "id": "5.1", "label": "Level 5.1", "shape": "dot"}, {"color": "#97c2fc", "id": "0.1", "label": "Level 0.1", "shape": "dot"}, {"color": "#97c2fc", "id": "0.85", "label": "Level 0.85", "shape": "dot"}, {"color": "#97c2fc", "id": "5.2", "label": "Level 5.2", "shape": "dot"}, {"color": "#97c2fc", "id": "4", "label": "Level 4", "shape": "dot"}, {"color": "#97c2fc", "id": "1.7", "label": "Level 1.7", "shape": "dot"}, {"color": "#97c2fc", "id": "9.7", "label": "Level 9.7", "shape": "dot"}, {"color": "#97c2fc", "id": "5", "label": "Level 5", "shape": "dot"}, {"color": "#97c2fc", "id": "4.7", "label": "Level 4.7", "shape": "dot"}, {"color": "#97c2fc", "id": "0.111", "label": "Level 0.111", "shape": "dot"}, {"color": "#97c2fc", "id": "0.666", "label": "Level 0.666", "shape": "dot"}, {"color": "#97c2fc", "id": "2.2", "label": "Level 2.2", "shape": "dot"}, {"color": "#97c2fc", "id": "9.3", "label": "Level 9.3", "shape": "dot"}, {"color": "#97c2fc", "id": "3", "label": "Level 3", "shape": "dot"}, {"color": "#97c2fc", "id": "8.8", "label": "Level 8.8", "shape": "dot"}, {"color": "#97c2fc", "id": "7.1", "label": "Level 7.1", "shape": "dot"}, {"color": "#97c2fc", "id": "0.2", "label": "Level 0.2", "shape": "dot"}, {"color": "#97c2fc", "id": "0.39", "label": "Level 0.39", "shape": "dot"}, {"color": "#97c2fc", "id": "4.11", "label": "Level 4.11", "shape": "dot"}, {"color": "#97c2fc", "id": "8.6", "label": "Level 8.6", "shape": "dot"}, {"color": "#97c2fc", "id": "9.5", "label": "Level 9.5", "shape": "dot"}, {"color": "#97c2fc", "id": "1.001", "label": "Level 1.001", "shape": "dot"}, {"color": "#97c2fc", "id": "4.12", "label": "Level 4.12", "shape": "dot"}, {"color": "#97c2fc", "id": "7.2", "label": "Level 7.2", "shape": "dot"}, {"color": "#97c2fc", "id": "3.4", "label": "Level 3.4", "shape": "dot"}, {"color": "#97c2fc", "id": "2", "label": "Level 2", "shape": "dot"}, {"color": "#97c2fc", "id": "6.4", "label": "Level 6.4", "shape": "dot"}, {"color": "#97c2fc", "id": "9.2", "label": "Level 9.2", "shape": "dot"}, {"color": "#97c2fc", "id": "2.6", "label": "Level 2.6", "shape": "dot"}, {"color": "#97c2fc", "id": "7.3", "label": "Level 7.3", "shape": "dot"}, {"color": "#97c2fc", "id": "7.4", "label": "Level 7.4", "shape": "dot"}, {"color": "#97c2fc", "id": "0.7", "label": "Level 0.7", "shape": "dot"}, {"color": "#97c2fc", "id": "5.98", "label": "Level 5.98", "shape": "dot"}, {"color": "#97c2fc", "id": "1.85", "label": "Level 1.85", "shape": "dot"}, {"color": "#97c2fc", "id": "1.3", "label": "Level 1.3", "shape": "dot"}, {"color": "#97c2fc", "id": "9.8", "label": "Level 9.8", "shape": "dot"}]);
edges = new vis.DataSet([{"from": "6", "to": "4.6"}, {"from": "1.8", "to": "1.5"}, {"from": "1.05", "to": "2"}, {"from": "9", "to": "9.5"}, {"from": "0", "to": "0.5"}, {"from": "9", "to": "6.7"}, {"from": "4.12", "to": "4"}, {"from": "0.4", "to": "1.1"}, {"from": "5", "to": "0.6"}, {"from": "0.03", "to": "0.9"}, {"from": "2.6", "to": "2"}, {"from": "0.11", "to": "1"}, {"from": "0.04", "to": "0"}, {"from": "7.3", "to": "7.7"}, {"from": "0.03", "to": "1.001"}, {"from": "9.6", "to": "9"}, {"from": "0.11", "to": "0.111"}, {"from": "6", "to": "8"}, {"from": "0.2", "to": "0.1"}, {"from": "2", "to": "2.1"}, {"from": "0", "to": "0.69"}, {"from": "1.13", "to": "4"}, {"from": "5.1", "to": "5"}, {"from": "1.8", "to": "9"}, {"from": "6", "to": "6.1"}, {"from": "0.01", "to": "0"}, {"from": "0.69", "to": "6.1"}, {"from": "6.3", "to": "7"}, {"from": "4.1", "to": "0"}, {"from": "9.4", "to": "10"}, {"from": "0", "to": "0.15"}, {"from": "0.11", "to": "7"}, {"from": "1.5", "to": "1"}, {"from": "0", "to": "6.3"}, {"from": "0.4", "to": "0"}, {"from": "3", "to": "0.22"}, {"from": "0", "to": "1"}, {"from": "1", "to": "0.7"}, {"from": "0.99", "to": "0"}, {"from": "0", "to": "0.111"}, {"from": "0.01", "to": "0.03"}, {"from": "5", "to": "3"}, {"from": "3", "to": "1"}, {"from": "4", "to": "4.11"}, {"from": "2", "to": "2.5"}, {"from": "1", "to": "0.6"}, {"from": "2.3", "to": "2"}, {"from": "1.8", "to": "2"}, {"from": "6", "to": "6.05"}, {"from": "2.4", "to": "0.1"}, {"from": "9.2", "to": "6.1"}, {"from": "1.13", "to": "5"}, {"from": "2", "to": "7.3"}, {"from": "0.2", "to": "0"}, {"from": "0", "to": "0.666"}, {"from": "7.7", "to": "6"}, {"from": "4.3", "to": "4"}, {"from": "9.1", "to": "9.9"}, {"from": "0.2", "to": "0.11"}, {"from": "4", "to": "1.3"}, {"from": "2", "to": "3"}, {"from": "6.05", "to": "6.1"}, {"from": "0.01", "to": "0.02"}, {"from": "2.4", "to": "2.2"}, {"from": "0", "to": "0.1"}, {"from": "10", "to": "9.5"}, {"from": "0", "to": "0.7"}, {"from": "1", "to": "1.13"}, {"from": "4.3", "to": "0.11"}, {"from": "0.74", "to": "7.4"}, {"from": "0.1", "to": "1.1"}, {"from": "6.56", "to": "7"}, {"from": "0.1", "to": "0.7"}, {"from": "7", "to": "7.3"}, {"from": "2.3", "to": "3"}, {"from": "4", "to": "4.04"}, {"from": "10", "to": "2.1"}, {"from": "7", "to": "9.3"}, {"from": "9.8", "to": "9"}, {"from": "8", "to": "6.7"}, {"from": "0", "to": "0.39"}, {"from": "2", "to": "2.2"}, {"from": "4", "to": "6.1"}, {"from": "5.7", "to": "6.1"}, {"from": "3", "to": "4"}, {"from": "0", "to": "0.555"}, {"from": "0.04", "to": "0.111"}, {"from": "0.2", "to": "0.02"}, {"from": "4.6", "to": "5"}, {"from": "0.2", "to": "0.3"}, {"from": "0.1", "to": "0.555"}, {"from": "0.03", "to": "2.2"}, {"from": "2.4", "to": "2.6"}, {"from": "0.74", "to": "8.6"}, {"from": "0.74", "to": "0"}, {"from": "0.02", "to": "0"}, {"from": "1", "to": "0.15"}, {"from": "0.01", "to": "1"}, {"from": "7", "to": "7.8"}, {"from": "0", "to": "0.11"}, {"from": "2.1", "to": "0"}, {"from": "4.1", "to": "1"}, {"from": "9", "to": "9.4"}, {"from": "9", "to": "10"}, {"from": "9.9", "to": "10"}, {"from": "4", "to": "4.1"}, {"from": "10", "to": "9.3"}, {"from": "4.12", "to": "9"}, {"from": "1", "to": "1.3"}, {"from": "5.3", "to": "5.4"}, {"from": "2", "to": "2.4"}, {"from": "4.12", "to": "0"}, {"from": "5.5", "to": "6"}, {"from": "5.98", "to": "6.1"}, {"from": "0.03", "to": "0"}, {"from": "1.05", "to": "3"}, {"from": "1.13", "to": "1.8"}, {"from": "9.11", "to": "9"}, {"from": "0.2", "to": "0.22"}, {"from": "4", "to": "0.6"}, {"from": "1", "to": "1.05"}, {"from": "0.2", "to": "1"}, {"from": "0.74", "to": "0.01"}, {"from": "0.666", "to": "9.3"}, {"from": "7", "to": "7.1"}, {"from": "0.11", "to": "8"}, {"from": "7", "to": "8"}, {"from": "0.2", "to": "0.4"}, {"from": "2", "to": "4"}, {"from": "4", "to": "4.7"}, {"from": "1", "to": "1.1"}, {"from": "5.4", "to": "5.7"}, {"from": "0.11", "to": "0.7"}, {"from": "0", "to": "1.85"}, {"from": "9", "to": "9.3"}, {"from": "4", "to": "0.01"}, {"from": "4.6", "to": "6.1"}, {"from": "7.8", "to": "10"}, {"from": "5.5", "to": "9"}, {"from": "9", "to": "9.2"}, {"from": "0.555", "to": "0.666"}, {"from": "0.01", "to": "0.555"}, {"from": "6", "to": "7"}, {"from": "1.13", "to": "2"}, {"from": "6.1", "to": "0.15"}, {"from": "5.5", "to": "7"}, {"from": "5", "to": "5.7"}, {"from": "4.1", "to": "4.5"}, {"from": "8", "to": "7.8"}, {"from": "0.11", "to": "4"}, {"from": "5", "to": "0.01"}, {"from": "1", "to": "1.8"}, {"from": "9", "to": "9.1"}, {"from": "0.555", "to": "0.556"}, {"from": "3.4", "to": "0.99"}, {"from": "3", "to": "1.1"}, {"from": "4", "to": "5"}, {"from": "2.5", "to": "2.1"}, {"from": "2.3", "to": "2.1"}, {"from": "0.02", "to": "0.22"}, {"from": "0", "to": "0.22"}, {"from": "9", "to": "9.7"}, {"from": "0.74", "to": "1"}, {"from": "0", "to": "0.8"}, {"from": "8", "to": "9"}, {"from": "3", "to": "0.2"}, {"from": "3.3", "to": "3"}, {"from": "7", "to": "7.7"}, {"from": "3.4", "to": "2.2"}, {"from": "5.2", "to": "5.3"}, {"from": "3.2", "to": "1.1"}, {"from": "1.85", "to": "1.8"}, {"from": "4.7", "to": "3"}, {"from": "2", "to": "1.3"}, {"from": "1", "to": "2"}, {"from": "0.11", "to": "2"}, {"from": "7.1", "to": "8"}, {"from": "5.4", "to": "5.5"}, {"from": "8", "to": "2.1"}, {"from": "1.5", "to": "0"}, {"from": "5", "to": "6"}, {"from": "2.1", "to": "9"}, {"from": "6", "to": "6.56"}, {"from": "9.9", "to": "0"}, {"from": "1.05", "to": "4"}, {"from": "2.1", "to": "7"}, {"from": "0.74", "to": "0.7"}, {"from": "0.1", "to": "0.11"}, {"from": "1", "to": "0.02"}, {"from": "0", "to": "2.6"}, {"from": "8", "to": "8.8"}, {"from": "9.2", "to": "9.5"}, {"from": "2", "to": "1.1"}, {"from": "0.02", "to": "0.03"}, {"from": "4.3", "to": "3"}, {"from": "9", "to": "0.03"}, {"from": "4.12", "to": "7"}, {"from": "9.4", "to": "7"}, {"from": "4.6", "to": "3"}, {"from": "4.12", "to": "0.7"}, {"from": "2", "to": "0.2"}, {"from": "6.3", "to": "6"}, {"from": "2.6", "to": "8.6"}]);
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);
return network;
}
drawGraph();
</script>
</body>
</html>