-
Notifications
You must be signed in to change notification settings - Fork 0
/
innovation.html
376 lines (349 loc) · 19.2 KB
/
innovation.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
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Disrupt</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.3/css/all.css" integrity="sha384-UHRtZLI+pbxtHCWp1t77Bi1L4ZtiqrqD80Kn4Z8NTSRyMA2Fd33n5dQ8lWUE00s/" crossorigin="anonymous">
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/bootstrap-table.min.css">
</head>
<body>
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<ul class="nav">
<li class="nav-item">
<a class="nav-link active" href="home.html">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="overall.html">Overall scores</a>
</li>
<li class="nav-item">
<a class="nav-link" href="ethiopia.html">Ethiopia scores</a>
</li>
<li class="nav-item">
<a class="nav-link" href="mozambique.html">Mozambique scores</a>
</li>
<li class="nav-item">
<a class="nav-link" href="bangladesh.html">Bangladesh scores</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Enhancing diets and planet scores</a>
</li>
</ul>
</div>
</div>
<div class="row">
<div class="col-md-12">
<h3 align="center">
Innovation information
</h3>
<h5>
<span style="color: #ff0000">Red scores</span> indicate that the score is under median value for a given criteria
</h5>
</div>
</div>
<div class="row">
<div class="col-md-12">
<h6 align="center">
Overall
</h6>
<div class="table-responsive">
<table id="table_all"
data-search="true"
data-custom-search="customSearch"
data-filter-control="true"
data-show-search-clear-button="true"
data-show-columns="true">
<thead>
<tr>
<th data-sortable="true" data-field="Innovation">Innovation</th>
<th data-sortable="true" data-field="Cluster">Cluster</th>
<th data-sortable="true" data-field="freq" data-cell-style="cellStyleOverall">Freq</th>
<th data-sortable="true" data-field="Number Context" data-visible="false">CTX</th>
<th data-sortable="true" data-field="QUALITY" data-cell-style="cellStyleOverall">QUA</th>
<th data-sortable="true" data-field="SAFETY" data-cell-style="cellStyleOverall">SAF</th>
<th data-sortable="true" data-field="AVAILABILITY" data-cell-style="cellStyleOverall">AV</th>
<th data-sortable="true" data-field="AFFORDABILITY" data-cell-style="cellStyleOverall">AFF</th>
<th data-sortable="true" data-field="DESIRABILITY" data-cell-style="cellStyleOverall">DES</th>
<th data-sortable="true" data-field="CLIMATE MITIGATION" data-cell-style="cellStyleOverall">CM</th>
<th data-sortable="true" data-field="CLIMATE ADAPTATION" data-cell-style="cellStyleOverall">CA</th>
<th data-sortable="true" data-field="WATER USE" data-cell-style="cellStyleOverall">WU</th>
<th data-sortable="true" data-field="SOIL HEALTH" data-cell-style="cellStyleOverall">SH</th>
<th data-sortable="true" data-field="REDUCING BIODIVERSITY LOSS" data-cell-style="cellStyleOverall">RBL</th>
<th data-sortable="true" data-field="INCREASING BIODIVERSITY" data-cell-style="cellStyleOverall">IB</th>
<th data-sortable="true" data-field="REDUCING POLLUTION" data-cell-style="cellStyleOverall">RP</th>
<th data-sortable="true" data-field="Nutrition_total" data-cell-style="cellStyleOverall">NUT</th>
<th data-sortable="true" data-field="Planet_total" data-cell-style="cellStyleOverall">PLA</th>
<th data-sortable="true" data-field="LEAPFROGGING" data-cell-style="cellStyleOverall">LEAP</th>
<th data-sortable="true" data-field="EQUITY" data-cell-style="cellStyleOverall">EQU</th>
<th data-sortable="true" data-field="score_9" data-cell-style="cellStyleOverall">Score</th>
</tr>
</thead>
</table>
</div>
<h6 id="ti_eth" align="center">
Ethiopia
</h6>
<div class="table-responsive">
<table id="table_eth"
data-search="true"
data-custom-search="customSearch"
data-filter-control="true"
data-show-search-clear-button="true"
data-show-columns="true">
<thead>
<tr>
<th data-sortable="true" data-field="Innovation">Innovation</th>
<th data-sortable="true" data-field="Cluster">Cluster</th>
<th data-sortable="true" data-field="freq" data-cell-style="cellStyleEth">Freq</th>
<th data-sortable="true" data-field="Number Context" data-visible="false">CTX</th>
<th data-sortable="true" data-field="QUALITY" data-cell-style="cellStyleEth">QUA</th>
<th data-sortable="true" data-field="SAFETY" data-cell-style="cellStyleEth">SAF</th>
<th data-sortable="true" data-field="AVAILABILITY" data-cell-style="cellStyleEth">AV</th>
<th data-sortable="true" data-field="AFFORDABILITY" data-cell-style="cellStyleEth">AFF</th>
<th data-sortable="true" data-field="DESIRABILITY" data-cell-style="cellStyleEth">DES</th>
<th data-sortable="true" data-field="CLIMATE MITIGATION" data-cell-style="cellStyleEth">CM</th>
<th data-sortable="true" data-field="CLIMATE ADAPTATION" data-cell-style="cellStyleEth">CA</th>
<th data-sortable="true" data-field="WATER USE" data-cell-style="cellStyleEth">WU</th>
<th data-sortable="true" data-field="SOIL HEALTH" data-cell-style="cellStyleEth">SH</th>
<th data-sortable="true" data-field="REDUCING BIODIVERSITY LOSS" data-cell-style="cellStyleEth">RBL</th>
<th data-sortable="true" data-field="INCREASING BIODIVERSITY" data-cell-style="cellStyleEth">IB</th>
<th data-sortable="true" data-field="REDUCING POLLUTION" data-cell-style="cellStyleEth">RP</th>
<th data-sortable="true" data-field="Nutrition_total" data-cell-style="cellStyleEth">NUT</th>
<th data-sortable="true" data-field="Planet_total" data-cell-style="cellStyleEth">PLA</th>
<th data-sortable="true" data-field="LEAPFROGGING" data-cell-style="cellStyleEth">LEAP</th>
<th data-sortable="true" data-field="EQUITY" data-cell-style="cellStyleEth">EQU</th>
<th data-sortable="true" data-field="score_9" data-cell-style="cellStyleEth">Score</th>
</tr>
</thead>
</table>
</div>
<h6 id="ti_moz" align="center">
Mozambique
</h6>
<div class="table-responsive">
<table id="table_moz"
data-search="true"
data-custom-search="customSearch"
data-filter-control="true"
data-show-search-clear-button="true"
data-show-columns="true">
<thead>
<tr>
<th data-sortable="true" data-field="Innovation">Innovation</th>
<th data-sortable="true" data-field="Cluster">Cluster</th>
<th data-sortable="true" data-field="freq" data-cell-style="cellStyleMoz">Freq</th>
<th data-sortable="true" data-field="Number Context" data-visible="false">CTX</th>
<th data-sortable="true" data-field="QUALITY" data-cell-style="cellStyleMoz">QUA</th>
<th data-sortable="true" data-field="SAFETY" data-cell-style="cellStyleMoz">SAF</th>
<th data-sortable="true" data-field="AVAILABILITY" data-cell-style="cellStyleMoz">AV</th>
<th data-sortable="true" data-field="AFFORDABILITY" data-cell-style="cellStyleMoz">AFF</th>
<th data-sortable="true" data-field="DESIRABILITY" data-cell-style="cellStyleMoz">DES</th>
<th data-sortable="true" data-field="CLIMATE MITIGATION" data-cell-style="cellStyleMoz">CM</th>
<th data-sortable="true" data-field="CLIMATE ADAPTATION" data-cell-style="cellStyleMoz">CA</th>
<th data-sortable="true" data-field="WATER USE" data-cell-style="cellStyleMoz">WU</th>
<th data-sortable="true" data-field="SOIL HEALTH" data-cell-style="cellStyleMoz">SH</th>
<th data-sortable="true" data-field="REDUCING BIODIVERSITY LOSS" data-cell-style="cellStyleMoz">RBL</th>
<th data-sortable="true" data-field="INCREASING BIODIVERSITY" data-cell-style="cellStyleMoz">IB</th>
<th data-sortable="true" data-field="REDUCING POLLUTION" data-cell-style="cellStyleMoz">RP</th>
<th data-sortable="true" data-field="Nutrition_total" data-cell-style="cellStyleMoz">NUT</th>
<th data-sortable="true" data-field="Planet_total" data-cell-style="cellStyleMoz">PLA</th>
<th data-sortable="true" data-field="LEAPFROGGING" data-cell-style="cellStyleMoz">LEAP</th>
<th data-sortable="true" data-field="EQUITY" data-cell-style="cellStyleMoz">EQU</th>
<th data-sortable="true" data-field="score_9" data-cell-style="cellStyleMoz">Score</th>
</tr>
</thead>
</table>
</div>
<h6 id="ti_ban" align="center">
Bangladesh
</h6>
<div class="table-responsive">
<table id="table_ban"
data-search="true"
data-custom-search="customSearch"
data-filter-control="true"
data-show-search-clear-button="true"
data-show-columns="true">
<thead>
<tr>
<th data-sortable="true" data-field="Innovation">Innovation</th>
<th data-sortable="true" data-field="Cluster">Cluster</th>
<th data-sortable="true" data-field="freq" data-cell-style="cellStyleBan">Freq</th>
<th data-sortable="true" data-field="Number Context" data-visible="false">CTX</th>
<th data-sortable="true" data-field="QUALITY" data-cell-style="cellStyleBan">QUA</th>
<th data-sortable="true" data-field="SAFETY" data-cell-style="cellStyleBan">SAF</th>
<th data-sortable="true" data-field="AVAILABILITY" data-cell-style="cellStyleBan">AV</th>
<th data-sortable="true" data-field="AFFORDABILITY" data-cell-style="cellStyleBan">AFF</th>
<th data-sortable="true" data-field="DESIRABILITY" data-cell-style="cellStyleBan">DES</th>
<th data-sortable="true" data-field="CLIMATE MITIGATION" data-cell-style="cellStyleBan">CM</th>
<th data-sortable="true" data-field="CLIMATE ADAPTATION" data-cell-style="cellStyleBan">CA</th>
<th data-sortable="true" data-field="WATER USE" data-cell-style="cellStyleBan">WU</th>
<th data-sortable="true" data-field="SOIL HEALTH" data-cell-style="cellStyleBan">SH</th>
<th data-sortable="true" data-field="REDUCING BIODIVERSITY LOSS" data-cell-style="cellStyleBan">RBL</th>
<th data-sortable="true" data-field="INCREASING BIODIVERSITY" data-cell-style="cellStyleBan">IB</th>
<th data-sortable="true" data-field="REDUCING POLLUTION" data-cell-style="cellStyleBan">RP</th>
<th data-sortable="true" data-field="Nutrition_total" data-cell-style="cellStyleBan">NUT</th>
<th data-sortable="true" data-field="Planet_total" data-cell-style="cellStyleBan">PLA</th>
<th data-sortable="true" data-field="LEAPFROGGING" data-cell-style="cellStyleBan">LEAP</th>
<th data-sortable="true" data-field="EQUITY" data-cell-style="cellStyleBan">EQU</th>
<th data-sortable="true" data-field="score_9" data-cell-style="cellStyleBan">Score</th>
</tr>
</thead>
</table>
</div>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
<script src="https://unpkg.com/[email protected]/dist/bootstrap-table.min.js"></script>
<script src="https://unpkg.com/[email protected]/dist/extensions/filter-control/bootstrap-table-filter-control.min.js"></script>
<script>
$(function() {
function getUrlParameter(search_param){
// get string of paramters
var url_part = window.location.search.substring(1);
// decode string
var decoded_url_part = decodeURIComponent(url_part);
// split on the basis of "&"
var params = decoded_url_part.split('&&');
//iterate throw each param and find if it matches required component
for(i = 0; i < params.length; i++){
param = params[i].split('=');
if(search_param == param[0]){
return param[1];
}
}
// console.log(splitted);
}
var message_param = getUrlParameter("a");
$.getJSON("js/data_all.json", function(json) {
var result = json.filter(obj => {
return obj.Innovation === message_param
})
var $table = $('#table_all')
$table.bootstrapTable({data: result})
});
$.getJSON("js/data_eth.json", function(json) {
var result = json.filter(obj => {
return obj.Innovation === message_param
})
var $table = $('#table_eth')
if(!result.length == 0) {
$table.bootstrapTable({data: result})
} else {
$table.hide()
$('#ti_eth').hide()
}
});
$.getJSON("js/data_moz.json", function(json) {
var result = json.filter(obj => {
return obj.Innovation === message_param
})
var $table = $('#table_moz')
if(!result.length == 0) {
$table.bootstrapTable({data: result})
} else {
$table.hide()
$('#ti_moz').hide()
}
});
$.getJSON("js/data_ban.json", function(json) {
var result = json.filter(obj => {
return obj.Innovation === message_param
})
var $table = $('#table_ban')
if(!result.length == 0) {
$table.bootstrapTable({data: result})
} else {
$table.hide()
$('#ti_ban').hide()
}
});
})
function customSearch(data, text) {
return data.filter(function (row) {
return row.Innovation.indexOf(text) > -1
})
}
function LinkFormatter(value, row, index) {
return "<a href='innovation.html?a="+row.Innovation+"'>"+value+"</a>";
}
</script>
<script>
function cellStyleOverall(value, row, index, field) {
var median = {
"freq": 5, "Number Context": 2, "QUALITY": 0.75, "SAFETY": 0.5, "AVAILABILITY": 0.75, "AFFORDABILITY": 0.54, "DESIRABILITY": 0.58, "CLIMATE MITIGATION": 0.53, "CLIMATE ADAPTATION": 0.58, "WATER USE": 0.5, "SOIL HEALTH": 0.33, "REDUCING BIODIVERSITY LOSS": 0.4, "INCREASING BIODIVERSITY": 0.44, "REDUCING POLLUTION": 0.5, "Nutrition_total": 3, "Planet_total": 3.12, "LEAPFROGGING": 0.67, "EQUITY": 0.62, "score_9": 49.12
}
if (value < median[field]) {
return {
css: {
"color": 'red'
}
}
}
return {
css: {
color: 'black'
}
}
}
function cellStyleEth(value, row, index, field) {
var median = {
"freq": 2, "QUALITY": 0.75, "SAFETY": 0.5, "AVAILABILITY": 0.71, "AFFORDABILITY": 0.5, "DESIRABILITY": 0.5, "CLIMATE MITIGATION": 0.5, "CLIMATE ADAPTATION": 0.5, "WATER USE": 0.5, "SOIL HEALTH": 0.355, "REDUCING BIODIVERSITY LOSS": 0.425, "INCREASING BIODIVERSITY": 0.38, "REDUCING POLLUTION": 0.5, "Nutrition_total": 3.085, "Planet_total": 3, "LEAPFROGGING": 0.62, "EQUITY": 0.645, "score_9": 47.38
}
if (value < median[field]) {
return {
css: {
"color": 'red'
}
}
}
return {
css: {
color: 'black'
}
}
}
function cellStyleMoz(value, row, index, field) {
var median = {
"freq": 2, "QUALITY": 0.83, "SAFETY": 0.58, "AVAILABILITY": 0.83, "AFFORDABILITY": 0.7, "DESIRABILITY": 0.5, "CLIMATE MITIGATION": 0.5, "CLIMATE ADAPTATION": 0.75, "WATER USE": 0.5, "SOIL HEALTH": 0.5, "REDUCING BIODIVERSITY LOSS": 0.5, "INCREASING BIODIVERSITY": 0.5, "REDUCING POLLUTION": 0.5, "Nutrition_total": 3.5, "Planet_total": 3.5, "LEAPFROGGING": 0.75, "EQUITY": 0.75, "score_9": 56.39
}
if (value < median[field]) {
return {
css: {
"color": 'red'
}
}
}
return {
css: {
color: 'black'
}
}
}
function cellStyleBan(value, row, index, field) {
var median = {
"freq": 2, "QUALITY": 0.645, "SAFETY": 0.5, "AVAILABILITY": 0.75, "AFFORDABILITY": 0.5, "DESIRABILITY": 0.5, "CLIMATE MITIGATION": 0.5, "CLIMATE ADAPTATION": 0.5, "WATER USE": 0.355, "SOIL HEALTH": 0.25, "REDUCING BIODIVERSITY LOSS": 0.25, "INCREASING BIODIVERSITY": 0.25, "REDUCING POLLUTION": 0.29, "Nutrition_total": 2.815, "Planet_total": 2.415, "LEAPFROGGING": 0.685, "EQUITY": 0.5, "score_9": 45.535
}
if (value < median[field]) {
return {
css: {
"color": 'red'
}
}
}
return {
css: {
color: 'black'
}
}
}
</script>
</body>
</html>