Repository navigation
Expand file tree
/
Copy pathchart_ec.html
More file actions
335 lines (327 loc) · 8.28 KB
/
Copy pathchart_ec.html
File metadata and controls
335 lines (327 loc) · 8.28 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<!--Load plotly.js into the DOM -->
<script src='https://cdn.plot.ly/plotly-2.9.0.min.js'></script>
<meta charset="utf-8" />
</head>
<body style="font-family: 'Open Sans'; font-size: 13px;">
<div class="wrapper" style="width: 26em; height: 10em; float: left;">
<div>
<input type="checkbox" id="l5" onclick="choose(this)"> <label
for="landsat5">GPW v4.0</label> <input type="checkbox" id="l6"
onclick="choose(this)"> <label for="landsat6">Dataset
B</label> <input type="checkbox" id="l7" onclick="choose(this)"> <label
for="landsat7">GAEZ v3.0</label>
</div>
<fieldset style="width: 22em">
<div>
<input type="radio" id="om" name="Quality Metric" value="Omission"
onclick="choose(this)"> <label for="om"> Omission
as rate</label>
</div>
<div>
<input type="radio" id="com" name="Quality Metric"
value="Commission" onclick="choose(this)"> <label for="com">
Quantitative Attribute Accuracy as R²</label>
</div>
<div>
<input type="radio" id="qaa" name="Quality Metric"
value="Quantitative attribute accuracy" onclick="choose(this)">
<label for="qaa"> Quantitative Attribute Accuracy as RMSE</label>
</div>
<div>
<input type="radio" id="tcc" name="Quality Metric"
value="Thematic classification correctness" onclick="choose(this)">
<label for="tcc"> Spatial Resolution</label>
</div>
</fieldset>
</div>
<div id='myDiv' style="float: left">
<!--Plotly chart will be drawn inside this DIV -->
</div>
</body>
<script>
//define data and labels for each Dataset/Quality Metric comination
var sat5om = {
y : [ 0.1, 0.4, 1 ],
name : 'GPW v4.0',
marker : {
color : '#a1240b'
},
type : 'box'
};
var sat5com = {
y : [ 1, 0.5, 2 ],
name : 'GPW v4.0',
marker : {
color : '#a1240b'
},
type : 'box'
};
var sat5qaa = {
y : [ 0.5, 0.1, 0.3, 0.8 ],
name : 'GPW v4.0',
marker : {
color : '#a1240b'
},
type : 'box'
};
var sat5tcc = {
y : [ 0.1, 1, 0.7 ],
name : 'GPW v4.0',
marker : {
color : '#a1240b'
},
type : 'box'
};
var sat6om = {
y : [ 0.8, 1, 0.25 ],
name : 'WDPA v1.6',
marker : {
color : '#f17a2d'
},
type : 'box'
};
var sat6com = {
y : [ 1, 0.4, 0.2, 0.9, 0.4 ],
name : 'WDPA v1.6',
marker : {
color : '#f17a2d'
},
type : 'box'
};
var sat6qaa = {
y : [ 0.3, 0.21, 0.34, 0.89 ],
name : 'WDPA v1.6',
marker : {
color : '#f17a2d'
},
type : 'box'
};
var sat6tcc = {
y : [ 0.3, 1, 0.6, 0.2, 0.4 ],
name : 'WDPA v1.6',
marker : {
color : '#f17a2d'
},
type : 'box'
};
var sat7om = {
y : [ 1, 0.5, 0.7 ],
name : 'GAEZ v3.0',
marker : {
color : '#2e78f1'
},
type : 'box'
};
var sat7com = {
y : [ 0.2, 0.4 ],
name : 'GAEZ v3.0',
marker : {
color : '#2e78f1'
},
type : 'box'
};
var sat7qaa = {
y : [ 0.9, 1, 0.1 ],
name : 'GAEZ v3.0',
marker : {
color : '#2e78f1'
},
type : 'box'
};
var sat7tcc = {
y : [ 0.1, 0.2, 0.5, 1, 0.7 ],
name : 'GAEZ v3.0',
marker : {
color : '#2e78f1'
},
type : 'box'
};
var omission = [];
var commission = [];
var quantitative = [];
var thematic = [];
var layout = {};
//add predefined data and labels depending on the id of selected buttons
function choose(e) {
if (document.getElementById("om").checked) {
layout = {
autosize : false,
width : 650,
height : 200,
margin : {
t : 20,
b : 20
},
yaxis : {
title : 'Omission as rate',
showlegend : false,
zeroline : false
},
boxmode : 'group'
};
if (document.getElementById("l5").checked
&& omission.indexOf(sat5om) == -1) {
omission.push(sat5om);
} else if (document.getElementById("l5").checked == false
&& omission.indexOf(sat5om) > -1) {
var del1 = omission.indexOf(sat5om);
omission.splice(del1, 1);
}
if (document.getElementById("l6").checked
&& omission.indexOf(sat6om) == -1) {
omission.push(sat6om);
} else if (document.getElementById("l6").checked == false
&& omission.indexOf(sat6om) > -1) {
var del2 = omission.indexOf(sat6om);
omission.splice(del2, 1);
}
if (document.getElementById("l7").checked
&& omission.indexOf(sat7om) == -1) {
omission.push(sat7om);
} else if (document.getElementById("l7").checked == false
&& omission.indexOf(sat7om) > -1) {
var del3 = omission.indexOf(sat7om);
omission.splice(del3, 1);
}
Plotly.newPlot('myDiv', omission, layout, {
displayModeBar : false
});
}
if (document.getElementById("com").checked) {
layout = {
autosize : false,
width : 650,
height : 200,
margin : {
t : 20,
b : 20
},
yaxis : {
title : 'QAA as R²',
showlegend : false,
zeroline : false
},
boxmode : 'group'
};
if (document.getElementById("l5").checked
&& commission.indexOf(sat5com) == -1) {
commission.push(sat5com);
} else if (document.getElementById("l5").checked == false
&& commission.indexOf(sat5com) > -1) {
var del1 = commission.indexOf(sat5com);
commission.splice(del1, 1);
}
if (document.getElementById("l6").checked
&& commission.indexOf(sat6com) == -1) {
commission.push(sat6com);
} else if (document.getElementById("l6").checked == false
&& commission.indexOf(sat6com) > -1) {
var del2 = commission.indexOf(sat6com);
commission.splice(del2, 1);
}
if (document.getElementById("l7").checked
&& commission.indexOf(sat7com) == -1) {
commission.push(sat7com);
} else if (document.getElementById("l7").checked == false
&& commission.indexOf(sat7com) > -1) {
var del3 = commission.indexOf(sat7com);
commission.splice(del3, 1);
}
Plotly.newPlot('myDiv', commission, layout, {
displayModeBar : false
});
}
if (document.getElementById("qaa").checked) {
layout = {
autosize : false,
width : 650,
height : 200,
margin : {
t : 20,
b : 20
},
yaxis : {
title : 'QAA as RMSE',
showlegend : false,
zeroline : false
},
boxmode : 'group'
};
if (document.getElementById("l5").checked
&& quantitative.indexOf(sat5qaa) == -1) {
quantitative.push(sat5qaa);
} else if (document.getElementById("l5").checked == false
&& quantitative.indexOf(sat5qaa) > -1) {
var del1 = quantitative.indexOf(sat5qaa);
quantitative.splice(del1, 1);
}
if (document.getElementById("l6").checked
&& quantitative.indexOf(sat6qaa) == -1) {
quantitative.push(sat6qaa);
} else if (document.getElementById("l6").checked == false
&& quantitative.indexOf(sat6qaa) > -1) {
var del2 = quantitative.indexOf(sat6qaa);
quantitative.splice(del2, 1);
}
if (document.getElementById("l7").checked
&& quantitative.indexOf(sat7qaa) == -1) {
quantitative.push(sat7qaa);
} else if (document.getElementById("l7").checked == false
&& quantitative.indexOf(sat7qaa) > -1) {
var del3 = quantitative.indexOf(sat7qaa);
quantitative.splice(del3, 1);
}
Plotly.newPlot('myDiv', quantitative, layout, {
displayModeBar : false
});
}
if (document.getElementById("tcc").checked) {
layout = {
autosize : false,
width : 650,
height : 200,
margin : {
t : 20,
b : 20
},
yaxis : {
title : 'Spatial Resolution',
showlegend : false,
zeroline : false
},
boxmode : 'group'
};
if (document.getElementById("l5").checked
&& thematic.indexOf(sat5tcc) == -1) {
thematic.push(sat5tcc);
} else if (document.getElementById("l5").checked == false
&& thematic.indexOf(sat5tcc) > -1) {
var del1 = thematic.indexOf(sat5tcc);
thematic.splice(del1, 1);
}
if (document.getElementById("l6").checked
&& thematic.indexOf(sat6tcc) == -1) {
thematic.push(sat6tcc);
} else if (document.getElementById("l6").checked == false
&& thematic.indexOf(sat6tcc) > -1) {
var del2 = thematic.indexOf(sat6tcc);
thematic.splice(del2, 1);
}
if (document.getElementById("l7").checked
&& thematic.indexOf(sat7tcc) == -1) {
thematic.push(sat7tcc);
} else if (document.getElementById("l7").checked == false
&& thematic.indexOf(sat7tcc) > -1) {
var del3 = thematic.indexOf(sat7tcc);
thematic.splice(del3, 1);
}
Plotly.newPlot('myDiv', thematic, layout, {
displayModeBar : false
});
}
}
</script>
</html>