forked from unhcr-xborder-turkey/ISIMM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
517 lines (391 loc) · 20.7 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
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
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0" name="viewport">
<meta name="author" content="Mattia Zanazzi (credit for original dashboard to: Edouard Legoupil)">
<title>ISIMM - CCCM Cluster Syria (Northern Governorates)</title>
<link rel="shortcut icon" href="images/favicon.ico" type="image/vnd.microsoft.icon" />
<meta itemprop="name" content="ISIMM - CCCM Cluster Syria (Northern Governorates)"/>
<meta itemprop="description" content="ISIMM - CCCM Cluster Syria (Northern Governorates)"/>
<meta property="og:title" content="ISIMM - CCCM Cluster Syria (Northern Governorates)">
<meta property="og:type" content="article">
<meta property="og:url" content="https://zanmat.github.io/ISIMM/">
<meta property="og:image" content="https://zanmat.github.io/ISIMM/ISIMM.jpg">
<meta property="og:site_name" content="ISIMM - CCCM Cluster Syria (Northern Governorates)">
<meta property="og:description" content="ISIMM - CCCM Cluster Syria (Northern Governorates)">
<link type="text/css" href="css/leaflet.css" rel="stylesheet"/>
<link type="text/css" href="css/leaflet.markercluster.css" rel="stylesheet"/>
<!-- Bootstrap -->
<link rel="stylesheet" href="css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="css/dc.css">
<!-- Add IntroJs styles -->
<link rel="stylesheet" type="text/css" href="css/introjs.css">
<link rel="stylesheet" type="text/css" href="css/dashboard.css">
</head>
<body>
<div style="display: none;" class="col-sm-4 col-md-offset4" id="loading">
<h1>Patience: We are wrapping up the data... </h1><small>This webpage does not work on IE8 or older... Upgrade your browser if needed</small>
</div>
<div style="display: block;" class="container" id="dashboard">
<div class="col-xs-12">
<a href="https://www.humanitarianresponse.info/en/operations/stima/camp-coordination-management" target="_blank">
<img src="images/ISIMM.png" style="width: 100%"></a>
</div>
<div class="col-xs-12"><!--Explore the profile of IDP sites in Northern Syria. You can download the data <a href="data/dataviz.tsv" target="_blank">here</a> and access the full map <a href="https://ona.io/iraqcccm/forms/baseline/map" target="_blank" >here</a> -->
<div class="socialmedia" data-step="9" data-intro="Share this visualisation on twitter!" data-position="left">
</div>
<div class="row" >
<div class="col-md-2" align="center">
<a class="btn btn btn-success" href="javascript:void(0);" onclick="javascript:introJs().start();">How-To</a>
</div>
<div class="col-md-5" align="center">
<h4>Filter on conditions within the sites (December 2016)</h4>
</div>
<div class="col-md-2" data-step="1" data-intro="Use the reset button at any time to delete all your filters" data-position="center">
<div class="col-md-1" align="center">
<a class="reset btn btn-primary btn-sm" id="reset" href="#">Reset All</a>
</div>
</div>
</div>
<!--
-->
<div class="row" id="cccm" data-step="2" data-intro="Click on the pie charts to filter the sites per condition type. You can select more than one criteria to filter! Just click one after the other." align="center">
<p style="font-size:85%;"> % of total IDP population:
<span style="color: #2572ad;"> 1. Fully covered </span>/ <span style="color: #4D9CD8;">2. Mostly covered </span> / <span style="color: #FC7E77;">3. Partially covered </span> / <span style="color: #de4c44;">4. Not covered - Information unavailable</span> </p>
<div class="col-md-15" >
<div class="shelter" id="cccm" class="dc-chart" >
<p><small>Shelter</small></p>
</div>
</div>
<div class="col-md-15" >
<div class="waterp" id="cccm" class="dc-chart" >
<p><small>Water</small></p>
</div>
</div>
<div class="col-md-15" >
<div class="sanitation" id="cccm" class="dc-chart" >
<p><small>Sanitation</small></p>
</div>
</div>
<div class="col-md-15" >
<div class="waster" id="cccm" class="dc-chart" >
<p><small>Waste Removal</small></p>
</div>
</div>
<div class="col-md-15" >
<div class="NFI" id="cccm" class="dc-chart" >
<p><small>NFI</small></p>
</div>
</div>
<div class="col-md-15" >
<div class="food" id="cccm" class="dc-chart" >
<p><small>Food</small></p>
</div>
</div>
</div>
<div class="row" align="center" data-step="3" data-intro="All of these charts display information based on the number of individuals by location. Again, you can combine as many filters as you want."> <h4>Filter on location, status and composition of the sites </h4>
<p style="font-size:85%;" align="center">
<i>All charts relate to number of individuals. </i> </p>
<div class="row" id="cccm">
<div class="col-md-2 colheightbars" >
<div class="governoratep" class="col-xs-6 dc-chart" data-step="4" data-intro="Click on this bar chart to filter by governorate." data-position="right" align="center">
<h4>Governorates</h4>
</div>
<div class="districtp" class="dc-chart" data-step="5" data-intro="Click on this bar chart to filter by district" >
<h4>Districts</h4>
</div>
</div>
<div class="col-md-2" data-step="6" data-intro="Click on this bar chart to filter by Camp Cluster" align="center">
<div class="cluster" id="cccm" class="dc-chart" align="center">
<h4>Camp Clusters</h4>
<p style="font-size:75%;" align="center"><i>A Camp Cluster refers to a group of IDP sites in close proximity with high levels of collaboration among member agencies. </i></p>
</div>
</div>
<div class="col-md-13" >
<div class="type_site" id="cccm" class="dc-chart" align="center" data-step="7" data-intro="Click on this pie chart to filter by number of individuals residing in Informal Settlements, Transit Centres or Planned camps." data-position="center">
<h4>Site type</h4>
<p style="font-size:75%;"><i>IS: Informal Settlement, TC: Transit Centre,<br> PC: Planned camp </i></p>
</div>
<div id="count-info" align="center" data-step="8" data-intro="As you select your categories for filtering, this field will provide the total individuals with a breakdown by men, women, boys and girls in your selection. This breakdown does not necessarily add up to the sum, as some data might be missing.">
<br><br>
<h4>Current Selection</h4>
<p>
<span style="font-size:90%">
<strong> <span class="filter-count"></span></strong> sites selected out of <strong><span class="total-count"></span></strong>. <br> <br>
<span id="totalind" class="number-display"></span> individuals, of which: <br>
<!--
<span id="totalhou" class="number-display"></span> household, -->
<span id="totalmen" class="number-display" ></span> men <br>
<span id="totalwom" class="number-display"></span> women <br>
<span id="totalboy" class="number-display"></span> boys <br>
<span id="totalgirl" class="number-display"></span> girls
<br><br>
</span>
</p>
</div>
</div>
<div class="col-md-14" data-step="9" data-intro="Click or zoom on the map to filter by site">
<div align="center"> <h4>Map: Location of the sites</h4>
<p><small><i>For security reasons, please note that site coordinates are purposely imprecise. <br>
All site locations are in Syria, independently of their location on the map. For further information, please contact the <a href="mailto:syria.cross.border@cccmcluster.org?Subject=ISIMM%20Information%20Request" target="_top"> CCCM Cluster</a>.
</i></small></p></div>
<div class="map" id="cccm" align="left"> </div>
</div>
</div>
</div>
<div class="row">
<div align="left"> <small><a href="https://github.com/unhcr-iraq/Site-Assessment" target="_blank">Credit (original dashboard)</a></small></div>
<a href="https://twitter.com/intent/tweet?url=https://unhcr-xborder-turkey.github.io/ISIMM/&text=%23CCCM %23IDP Sites Monitoring Matrix %20@CCCMCluster" target="_blank"><img src="images/Twitter.png" style="height: 20px; width: 20px"></a>
</div>
</div>
<script type="text/javascript" src="js/intro.js"></script>
<script type="text/javascript" src="js/d3_002.js"></script>
<script type="text/javascript" src="js/d3.js"></script>
<script type="text/javascript" src="js/crossfilter.js"></script>
<script type="text/javascript" src="js/dc.js"></script>
<script type="text/javascript" src="js/jquery.js"></script>
<!--maps-->
<script type="text/javascript" src="js/leaflet.js"></script>
<script type="text/javascript" src="js/leaflet.markercluster.js"></script>
<script type="text/javascript" src="js/dc.leaflet.js"></script>
<script type="text/javascript">
/* Markers */
var numberFormat = d3.format(",f");
d3.csv("data/ISIMM5.csv", function(data) {
// drawMarkerSelect(data);
drawMarkerArea(data);
});
function drawMarkerArea(data) {
function remove_empty_bins(source_group) {
return {
all:function () {
return source_group.all().filter(function(d) {
return d.value != 0;
});
}
};
}
var xf = crossfilter(data);
var groupname = "marker-select";
var all = xf.groupAll();
dc.dataCount("#count-info",groupname)
.dimension(xf)
.group(all);
var byIndividual = xf.dimension(function(d) { return d.individual; });
var byIndividualGroup = byIndividual.groupAll().reduceSum(function (d) { return d.individual; });
dc.numberDisplay("#totalind",groupname)
.valueAccessor(function(d){return +d})
.group(byIndividualGroup);
var byMen = xf.dimension(function(d) { return d.men; });
var byMenGroup = byMen.groupAll().reduceSum(function (d) { return d.men; });
dc.numberDisplay("#totalmen",groupname)
.valueAccessor(function(d){return +d})
.group(byMenGroup);
var byWomen = xf.dimension(function(d) { return d.women; });
var byWomenGroup = byWomen.groupAll().reduceSum(function (d) { return d.women; });
dc.numberDisplay("#totalwom",groupname)
.valueAccessor(function(d){return +d})
.group(byWomenGroup);
var byBoy = xf.dimension(function(d) { return d.boys; });
var byBoyGroup = byBoy.groupAll().reduceSum(function (d) { return d.boys; });
dc.numberDisplay("#totalboy",groupname)
.valueAccessor(function(d){return +d})
.group(byBoyGroup);
var byGirl = xf.dimension(function(d) { return d.girls; });
var byGirlGroup = byGirl.groupAll().reduceSum(function (d) { return d.girls; });
dc.numberDisplay("#totalgirl",groupname)
.valueAccessor(function(d){return +d})
.group(byGirlGroup);
var colorScale = d3.scale.ordinal()
.domain(["1. Fully covered", "2. Mostly covered", "3. Partially covered", "4. Not covered - N/A"])
.range(["#2572ad", "#4D9CD8", "#FC7E77", "#de4c44"]);
var colorScale2 = d3.scale.ordinal()
.domain(["IS", "PC", "TC", "CC"])
.range(["#2a87cf", "#56A2DC", "#88BEE7", "#BBDAF1"]);
var openelements = xf.dimension(function(d) { return d.shelter_cat; });
var openelementsGroup = openelements.group().reduceSum(function (d) { return d.individual; });
dc.pieChart("#cccm .shelter",groupname)
.dimension(openelements)
.group(openelementsGroup)
.width(75)
.height(75)
.renderLabel(false)
.label(function(d) { return Math.round((d.endAngle - d.startAngle) / Math.PI * 50) + '%';})
.renderTitle(true)
.colors(colorScale)
;
var waters = xf.dimension(function(d) { return d.water_cat; });
var watersGroup = waters.group().reduceSum(function (d) { return d.individual; });
dc.pieChart("#cccm .waterp",groupname)
.dimension(waters)
.group(watersGroup)
.width(75)
.height(75)
.renderLabel(true)
.label(function(d) { return Math.round((d.endAngle - d.startAngle) / Math.PI * 50) + '%';})
.renderTitle(true)
.colors(colorScale)
.colorDomain([0,3,4]) ;
// .ordering(function (p) { return -p.value; });
var waterqs = xf.dimension(function(d) { return d.sanitation_cat; });
var waterqsGroup = waterqs.group().reduceSum(function (d) { return d.individual; });
dc.pieChart("#cccm .sanitation",groupname)
.dimension(waterqs)
.group(waterqsGroup)
.width(75)
.height(75)
.renderLabel(true)
.label(function(d) { return Math.round((d.endAngle - d.startAngle) / Math.PI * 50) + '%';})
.renderTitle(true)
.colors(colorScale)
.colorDomain(colorScale);
// .ordering(function (p) { return -p.value; });
var hazardss = xf.dimension(function(d) { return d.waste_cat; });
var hazardssGroup = hazardss.group().reduceSum(function (d) { return d.individual; });
dc.pieChart("#cccm .waster",groupname)
.dimension(hazardss)
.group(hazardssGroup)
.width(75)
.height(75)
.renderLabel(true)
.label(function(d) { return Math.round((d.endAngle - d.startAngle) / Math.PI * 50) + '%';})
.renderTitle(true)
.colors(colorScale)
.colorDomain(colorScale);
// .ordering(function (p) { return -p.value; });
var electrics = xf.dimension(function(d) { return d.NFI_cat; });
var electricsGroup = electrics.group().reduceSum(function (d) { return d.individual; });
dc.pieChart("#cccm .NFI",groupname)
.dimension(electrics)
.group(electricsGroup)
.width(75)
.height(75)
.renderLabel(true)
.label(function(d) { return Math.round((d.endAngle - d.startAngle) / Math.PI * 50) + '%';})
.renderTitle(true)
.colors(colorScale)
.colorDomain([0,3,4]) ;
// .ordering(function (p) { return -p.value; });
var miness = xf.dimension(function(d) { return d.Food_cat; });
var minessGroup = miness.group().reduceSum(function (d) { return d.individual; });
dc.pieChart("#cccm .food",groupname)
.dimension(miness)
.group(minessGroup)
.width(75)
.height(75)
.renderLabel(true)
.label(function(d) { return Math.round((d.endAngle - d.startAngle) / Math.PI * 50) + '%';})
.renderTitle(true)
.colors(colorScale)
.colorDomain(colorScale);
var governorates = xf.dimension(function(d) { return d.governorate; });
var governoratesByIndividual = governorates.group().reduceSum(function (d) { return d.individual; });
dc.rowChart("#cccm .governoratep",groupname)
.dimension(governorates)
.group(governoratesByIndividual)
.width(190)
.height(150)
.elasticX(true)
.renderLabel(true)
.ordering(function (p) { return -p.value;})
.colors(['#2a87cf'])
.colorDomain([0,0])
.colorAccessor(function(d, i){return 1;})
.xAxis().ticks(4).tickFormat(d3.format("s"));
var districts = xf.dimension(function(d) { return d.district; });
var districtsByIndividual = districts.group().reduceSum(function (d) { return d.individual; });
dc.rowChart("#cccm .districtp",groupname)
.dimension(districts)
.group(districtsByIndividual)
.width(190)
.height(340)
.renderLabel(true)
.ordering(function (p) { return -p.value;})
.colors(['#2a87cf'])
.elasticX(true)
.colorDomain([0,0])
.colorAccessor(function(d, i){return 1;})
.xAxis().ticks(4).tickFormat(d3.format("s"));
var cluster = xf.dimension(function(d) { return d.cluster; });
var clusterGroup = cluster.group().reduceSum(function (d) { return d.individual;});
dc.rowChart("#cccm .cluster",groupname)
.dimension(cluster)
.group(clusterGroup)
.width(250)
.height(445)
.renderLabel(true)
.renderTitle(true)
.colors(['#2a87cf'])
.colorDomain([0,0])
.elasticX(true)
.ordering(function (p) { return -p.value;})
.colorAccessor(function(d, i){return 1;})
//.ordering(function (p) { return -p.value;})
.xAxis().ticks(4).tickFormat(d3.format("s"));
var typeSite = xf.dimension(function(d) { return d.TypeSite; });
var typeSiteGroup = typeSite.group().reduceSum(function (d) { return d.individual; }); //var governoratesByIndividual = governorates.group().reduceSum(function (d) { return d.individual; });
dc.pieChart("#cccm .type_site",groupname)
.dimension(typeSite)
.group(typeSiteGroup)
.width(175)
.height(175)
.renderLabel(true)
.renderTitle(true)
.colors(colorScale2)
.ordering(function (p) { return -p.value; });
// Map
var camps = xf.dimension(function(d) { return d.camp_name; });
var campsGroup = camps.group().reduce(
function(p, v) { // add
p.individual = v.individual;
p.geo = v.geo;
++p.count;
return p;
},
function(p, v) { // remove
--p.count;
return p;
},
function() { // init
return {count: 0};
}
);
dc.leafletMarkerChart("#cccm .map",groupname)
.dimension(camps)
.group(campsGroup)
.width(540)
.height(440)
.center([36.0503,37.6385])
.zoom(7)
.cluster(true)
// .filterByArea(true)
// .featureKeyAccessor(function(feature) {return feature.properties.geo; })
.renderPopup(true)
.valueAccessor(function(kv) {
return kv.value.count;
})
.locationAccessor(function(kv) {
return kv.value.geo;
})
.popup(function(kv) {
return kv.key + " Camp : " + kv.value.individual + " individuals.";
});
$('#reset').on('click', function (){
dc.filterAll(groupname);
dc.redrawAll(groupname);
return false;
})
// dc.renderAll();
dc.renderAll(groupname);
}
</script>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
<script src="js/bootstrap.js"></script>
<script>
!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");
</script>
<div class="d3-tip n" style="position: absolute; display: none; box-sizing: border-box; top: 186.9px; left: 727.5px;"></div><div class="d3-tip" style="position: absolute; display: none; box-sizing: border-box;"></div>
</body>
</html>