forked from rwth-acis/OCD-Web-Client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
centralities.html
179 lines (179 loc) · 8.97 KB
/
centralities.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
<!DOCTYPE html>
<html>
<!-- Displays basic/meta information on all centralities. -->
<head>
<title>Centralities</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="node_modules/bootstrap/dist/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="CSS/layout.css">
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="//npmcdn.com/[email protected]/dist/js/tether.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js"></script>
<script src="node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
<script src="JS/contentHandler.js"></script>
<script src="node_modules/js-base64/base64.js"></script>
<script src="JS/ServiceAPI/moduleHelper.js"></script>
<script src="JS/ServiceAPI/serviceAPI.js"></script>
<script src="JS/requestHandler.js"></script>
<script src="node_modules/tablesorter/dist/js/jquery.tablesorter.min.js"></script>
<script src="JS/centralityTableHandler.js"></script>
<script type="text/javascript">
/*
* Defines current page and page size.
*/
var ENTRIES_PER_PAGE = 20;
var pageNumber = 0;
var graphId;
/*
* Executed after page loading.
*/
$(document).ready(function() {
/* Maximum number of the centrality maps to display on each table page */
pageNumber = getUrlVar("page");
if(!pageNumber) {
pageNumber = 0;
}
$('.pageNumWrapper').append(pageNumber);
/* Index of the first entry to be displayed */
var firstIndex = ENTRIES_PER_PAGE * pageNumber;
/* Identifiers for the centrality map information to display */
var cells = ["Name", "Graph", "Creation Method", "Execution Time", "R"];
// If specified only centralities on one specific graph are shown
graphId = getUrlVar("graphId");
var graphIdQueryExtension = "";
if(graphId) {
graphIdQueryExtension = "&graphId=" + graphId;
}
/* Requests the centrality maps information */
sendRequest("get", "maps?executionStatuses=COMPLETED&includeMeta=TRUE&"
+ "firstIndex=" + firstIndex + "&length=" + ENTRIES_PER_PAGE + graphIdQueryExtension, "",
/* Response handler */
function(mapMetasXml) {
/*
* Centrality map metas request succeeded
*/
if($(mapMetasXml).find("Id").length === 0 && pageNumber > 0) {
pageNumber--;
var newUrl = "centralities.html?";
if(graphId) {
newUrl = newUrl + "graphId=" + graphId + "&";
}
newUrl = newUrl + "page=" + pageNumber;
window.location.href = newUrl;
}
$(mapMetasXml).find("CentralityMap").each(function() {
appendCentralityMapRow($('#centralityTable'), $(this), cells);
});
/*
* Sort Table
*/
try {
$("#centralityTable").tablesorter({sortList: [[1,0],[0,0]],
headers: { 6: {sorter: false}}});
} catch(err) { /* table empty */ }
/*
* Register event handlers
*/
registerCentralityTable();
},
/* Error handler */
function(errorData) {
/*
* GraphIds request failed
*/
showConnectionErrorMessage("Centrality map metas were not received.", errorData);
});
/* Page control for the centrality map page to be displayed */
$('.pageLeft').click(function(){
if(pageNumber > 0) {
pageNumber--;
var newUrl = "centralities.html?";
if(graphId) {
newUrl = newUrl + "graphId=" + graphId + "&";
}
newUrl = newUrl + "page=" + pageNumber;
window.location.href = newUrl;
}
});
$('.pageRight').click(function(){
pageNumber++;
var newUrl = "centralities.html?";
if(graphId) {
newUrl = newUrl + "graphId=" + graphId + "&";
}
newUrl = newUrl + "page=" + pageNumber;
window.location.href = newUrl;
});
$('#evaluate').click(function(){
var specificGraphId = getUrlVar("graphId");
if(!specificGraphId) {
window.location.href = "centralities_evaluation.html";
}
else {
window.location.href = "centralities_evaluation.html?graphId=" + specificGraphId;
}
});
});
</script>
</head>
<body>
<div id="wrapper">
<div id="contentWrapper">
<div id="content">
<!-- Displays error messages -->
<div id="errorMessageWrapper">
<div id="errorMessage"></div>
</div>
<div class="buttonWrapper">
<button id="evaluate" type="button" class="btn btn-secondary btn-lg">Enter Evaluation Mode</button>
</div>
<!-- Page control for the centrality table -->
<div class = "pageControlWrapper">
<div class="pageControl">
<div class="pageLeftWrapper">
<img class="icon iconBtn pageLeft" src="IMG/open-iconic/svg/chevron-left.svg" alt="r">
</div>
<div class = "pageNumWrapper">
</div>
<div class="pageRightWrapper">
<img class="icon iconBtn pageRight" src="IMG/open-iconic/svg/chevron-right.svg" alt="r">
</div>
</div>
</div>
<!-- Centrality map meta information table -->
<div class="tableWrapper table-responsive">
<table id="centralityTable" class="table table-striped">
<thead>
<tr>
<th class="hidden" title="CentralityMapId"></th>
<th class="hidden" title="GraphId"></th>
<th width="300" title="Name" class="sortable">
Name
<img class="icon iconBtn" src="IMG/open-iconic/svg/sort-ascending.svg" alt="d">
</th>
<th width="300" title="Graph Name" class="sortable">
Graph
<img class="icon iconBtn" src="IMG/open-iconic/svg/sort-ascending.svg" alt="d">
</th>
<th width="200" title="Creation Method" class="sortable">
Creation Method
<img class="icon iconBtn" src="IMG/open-iconic/svg/sort-ascending.svg" alt="d">
</th>
<th width="200" title="Execution Time" class="sortable">
Execution Time (ms)
<img class="icon iconBtn" src="IMG/open-iconic/svg/sort-ascending.svg" alt="d">
</th>
<th width="20" title="Remove Centrality">
R
</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
</div>
</div>
</div>
</body>
</html>