-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
238 lines (233 loc) · 9.43 KB
/
index.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
<html>
<head>
<!-- Import Vis.js & Tau-Prolog & Swal2 -->
<script type="text/javascript" src="https://unpkg.com/vis-network/standalone/umd/vis-network.min.js"></script>
<script type="text/javascript" src="js/tau-prolog.js"></script>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script src="https://cdn.jsdelivr.net/npm/jquery@3.6.1/dist/jquery.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.bundle.min.js"></script>
<!-- Import Bootstrap & Style-->
<link rel="icon" type="image/x-icon" href="favicon.ico">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.4.1/dist/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.1/css/all.min.css" integrity="sha512-MV7K8+y+gLIBoVD59lQIYicR65iaqukzvf/nwasF0nqhPay5w/9lJmVM2hMDcnK1OnMGCdVK+iQrJ7lzPJQd1w==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<script type="text/javascript" src="js/function.js"></script>
<title>Graphlog</title>
</head>
<body>
<nav class="navbar" data-bs-theme="dark" style="color:#98c1d9;background-color:#3d5a80;">
<div class="container-fluid">
<i class="fa-solid fa-dragon"> Alchemists</i>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
</div>
</nav>
<div class="d-flex center-block m-3">
<img src="assets/img/logo-trasnparent.png" class=" my-auto" width="150px">
<h1 align="center" class="m-3 my-auto title d-inline"><span style="color:#54B8D0">Graph</span><i style="color:#D6E1F2">Log</i></h1>
</div>
<div class="container-fluid mx-2">
<div class="row d-flex">
<div class="col-xl-6">
<h4 align="center" style="font-weight: 600;">Graph Visualization</h4>
<p style="text-align: center;">The visualization of the graph with Vis.js</p>
<div id="mynetwork" class="center-block my-5"></div>
</div>
<div class="col-xl-6 pr-5" id="action">
<h5 style="font-weight: 600;" align="center">Action</h5>
<p style="text-align: center;">Specify edges and nodes in JSON notation</p>
<div class="row">
<!-- Action for nodes -->
<div class="col-6">
<div class="form-group">
<label for="nodes">Nodes</label>
<textarea
class="form-control"
name="nodes"
id="nodes"
rows="10"
placeholder='[ { "id": 1, "label": "Node 1" }, { "id": 2, "label": "Node 2" }, { "id": 3, "label": "Node 3" }, { "id": 4, "label": "Node 4" } ]'
></textarea>
</div>
</div>
<!-- Action for edges -->
<div class="col-6">
<div class="form-group">
<label for="nodes">Edges</label>
<textarea
class="form-control"
name="edges"
id="edges"
rows="10"
placeholder='[ { "from": 1, "to": 3 }, { "from": 1, "to": 2 }, { "from": 2, "to": 4 }, { "from": 2, "to": 3 }, ]'
></textarea>
</div>
</div>
<div class="center-block my-3">
<button
class="btn btn-primary mx-2"
onclick="submit(document.getElementById('nodes').value, document.getElementById('edges').value)"
>
<i class="fa-solid fa-circle-check"></i> Done
</button>
<button
class="btn btn-secondary"
onclick="randomGraph()"
>
<i class="fa-solid fa-shuffle"></i> Random
</button>
</div>
</div>
</div>
<div class="col-xl-5 pr-5 m-5" id="query" style="display: none;">
<ul class="nav nav-pills mb-3" id="pills-tab" role="tablist">
<li class="nav-item">
<a class="nav-link active" id="pills-home-tab" data-toggle="pill" href="#pills-home" role="tab" aria-controls="pills-home" aria-selected="true"><i class="fa-solid fa-circle-nodes"></i> Structure</a>
</li>
<li class="nav-item">
<a class="nav-link"
id="pills-profile-tab"
data-toggle="pill"
href="#pills-profile"
role="tab"
aria-controls="pills-profile"
aria-selected="false"
>
<i class="fa-solid fa-question"></i>
Query
</a>
</li>
<li class="nav-item">
<a class="nav-link" id="pills-contact-tab" data-toggle="pill" href="#pills-contact" role="tab" aria-controls="pills-contact" aria-selected="false"> <i class="fa-solid fa-otter"></i> Other</a>
</li>
</ul>
<div class="tab-content" id="pills-tabContent">
<!--
##################################
# Structure
##################################
-->
<div class="tab-pane fade show active" id="pills-home" role="tabpanel" aria-labelledby="pills-home-tab">
<div class="alert alert-info d-flex" role="alert" id="n_nodes">
<p class="my-auto">Numero di nodi:</p>
<span id="result_nodes" class="ml-auto mr-3 mt-auto"></span>
</div>
<div class="alert alert-info d-flex" role="alert" id="n_edges">
<p class="my-auto">Numero di archi:</p>
<span id="result_edges" class="ml-auto mr-3 mt-auto"></span>
</div>
<div class="alert alert-info d-flex" role="alert" id="n_edges">
<p class="my-auto">Nodo con stella massimo:</p>
<span id="node_max_star" class="ml-auto mr-3 mt-auto"></span>
<span id="max_star" class="mr-3 mt-auto"></span>
</div>
<div class="alert alert-info d-flex" role="alert" id="n_edges">
<p class="my-auto">Nodo con stella minima:</p>
<span id="node_min_star" class="ml-auto mr-3 mt-auto"></span>
<span id="min_star" class="mr-3 mt-auto"></span>
</div>
<div class="alert alert-info d-flex" role="alert">
<p class="my-auto">Densità del Grafo: </p>
<span id="result_density" class="ml-auto mr-3 mt-auto"></span>
</div>
<div class="alert alert-info d-flex" role="alert">
<p class="my-auto">Massimo Insieme Stabile: </p>
<span id="stable_set" class="ml-auto mr-3 mt-auto"></span>
<button
class="btn btn-success"
onclick=""
>
<i class="fa-solid fa-eye"></i>
</button>
</div>
<div class="alert alert-info d-flex" role="alert">
<p class="my-auto">Massimo Abbinamento:</p>
<span id="matching" class="ml-auto mr-3 mt-auto"></span>
<button class="btn btn-success"><i class="fa-solid fa-eye"></i></button>
</div>
<div class="alert alert-info d-flex" role="alert">
<p class="my-auto">Minima Copertuna con Archi:</p>
<span id="edge_cover" class="ml-auto mr-3 mt-auto"></span>
<button class="btn btn-success"><i class="fa-solid fa-eye"></i></button>
</div>
<div class="alert alert-info d-flex" role="alert">
<p class="my-auto">Minima Copertura con Nodi:</p>
<span id="vertex_cover" class="ml-auto mr-3 mt-auto"></span>
</div>
</div>
<!--
##################################
# Query
##################################
-->
<div class="tab-pane fade" id="pills-profile" role="tabpanel" aria-labelledby="pills-profile-tab">
<div class="alert alert-info d-flex" role="alert">
<p class="my-auto">Cammino minimo tra due nodi </p>
<span id="min_path"
class="ml-auto my-auto mr-3"
></span>
<button class="btn btn-primary" onclick="path()">
<i class="fa-solid fa-bezier-curve"></i>
Path
</button>
</div>
<div class="alert alert-info d-flex" role="alert">
<p class="my-auto">Ammette ciclo Euleriano?</p>
<span id="eulerian"
class="ml-auto mr-3 my-auto"
></span>
<button
class="btn btn-primary"
onclick="eulerian()"
>
<i class="fa-solid fa-person-walking-arrow-loop-left"></i>
Check
</button>
</div>
<div class="alert alert-info d-flex" role="alert">
<p class="my-auto">Ammette ciclo Hamiltoniano?</p>
<span id="hamiltonian"
class="ml-auto mr-3 my-auto"
></span>
<button
class="btn btn-primary"
onclick="hamiltonian()"
>
<i class="fa-solid fa-bicycle"></i>
Check
</button>
</div>
<div class="alert alert-info d-flex" role="alert">
<p class="my-auto">Il grafo é un Albero?</p>
<span class="ml-auto mr-3 my-auto" id="tree"></span>
<button class="btn btn-primary" onclick="tree()">
<i class="fa-solid fa-tree"></i>
Check
</button>
</div>
<div class="alert alert-info d-flex" role="alert">
<p class="my-auto">Bipartito?</p>
<span id="biparted"
class="ml-auto mr-3 my-auto"
></span>
<button
class="btn btn-primary"
onclick="biparted()"
>
<i class="fa-solid fa-pause"></i>
Check
</button>
</div>
</div>
<div class="tab-pane fade" id="pills-contact" role="tabpanel" aria-labelledby="pills-contact-tab">
Some space for future implementations. Plus "Other" look like "Otter". Otters are cute.
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript" src="js/function.js"></script>
</body>
</html>