-
Notifications
You must be signed in to change notification settings - Fork 2
/
dharavi.html
701 lines (565 loc) · 29.3 KB
/
dharavi.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
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<title>Chintak</title>
<meta content="" name="descriptison">
<meta content="" name="keywords">
<!-- Favicons -->
<link href="assets/img/favicon.png" rel="icon">
<link href="assets/img/apple-touch-icon.png" rel="apple-touch-icon">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<!-- Google Fonts -->
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i|Roboto:300,300i,400,400i,500,500i,700,700i|Poppins:300,300i,400,400i,500,500i,600,600i,700,700i" rel="stylesheet">
<!-- Vendor CSS Files -->
<link href="assets/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="assets/vendor/icofont/icofont.min.css" rel="stylesheet">
<link href="assets/vendor/boxicons/css/boxicons.min.css" rel="stylesheet">
<link href="assets/vendor/animate.css/animate.min.css" rel="stylesheet">
<link href="assets/vendor/venobox/venobox.css" rel="stylesheet">
<!-- Template Main CSS File -->
<link href="assets/css/style.css" rel="stylesheet">
<!-- Vue.js files -->
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script src="https://unpkg.com/vuex"></script>
<!-- Chart.js -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/Chart.min.js"></script>
</head>
<body>
<!-- ======= Hero Section ======= -->
<section id="hero">
<div class="hero-container">
<div id="heroCarousel" class="carousel slide carousel-fade" data-ride="carousel">
<ol class="carousel-indicators" id="hero-carousel-indicators"></ol>
<div class="carousel-inner" role="listbox">
<!-- Slide 1 -->
<div class="carousel-item active">
<div class="carousel-background"><img src="assets/img/slide/slide-1.jpg" alt=""></div>
<div class="carousel-container">
<div class="carousel-content">
<h2 class="animated fadeInDown">Welcome to <span><strong>'चिंतक'</strong> : Air Pollution Monitoring and Forecasting System </span></h2>
<p class="animated fadeInUp">"There's so much pollution in the air now that if it weren't for our lungs there'd be no place to put it all." ~ Robert Orben</p>
</div>
</div>
</div>
<!-- Slide 2 -->
<div class="carousel-item">
<div class="carousel-background"><img src="assets/img/slide/slide-2.jpg" alt=""></div>
<div class="carousel-container">
<div class="carousel-content">
<h2 class="animated fadeInDown">21/30 cities with the worst air pollution are in India</h2>
<p class="animated fadeInUp">India has once again topped an annual list of cities with the worst air quality in the world, according to a new report, while Chinese cities have continued to show improvements from the previous year.</p>
<a href="https://edition.cnn.com/2020/02/25/health/most-polluted-cities-india-pakistan-intl-hnk/index.html" class="btn-get-started animated fadeInUp scrollto">Know More</a>
</div>
</div>
</div>
<!-- Slide 3 -->
<div class="carousel-item">
<div class="carousel-background"><img src="assets/img/slide/slide-3.jpg" alt=""></div>
<div class="carousel-container">
<div class="carousel-content">
<h2 class="animated fadeInDown">New Delhi world's most polluted capital again: Study</h2>
<p class="animated fadeInUp">The study measured the concentration of poisonous PM2.5, particles that are less than 2.5 microns in diameter and can be carried deep into the lungs, as higher PM2.5 levels could cause deadly diseases, including cancer and cardiac problems.</p>
<a href="https://www.aljazeera.com/news/2020/02/delhi-world-polluted-capital-study-200226095553195.html" class="btn-get-started animated fadeInUp scrollto">Know More</a>
</div>
</div>
</div>
</div>
<a class="carousel-control-prev" href="#heroCarousel" role="button" data-slide="prev">
<span class="carousel-control-prev-icon icofont-thin-double-left" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next" href="#heroCarousel" role="button" data-slide="next">
<span class="carousel-control-next-icon icofont-thin-double-right" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
</div>
</section><!-- End Hero -->
<!-- ======= Header ======= -->
<header id="header">
<div class="container d-flex">
<div class="logo mr-auto">
<!-- <h1 class="text-light"><a href="index.html"><span>Chintak</span></a></h1> -->
<!-- Uncomment below if you prefer to use an image logo -->
<a href="index.html"><img src="assets/img/chintak_logo_1.png" alt="" class="img-fluid"></a>
</div>
<nav class="nav-menu d-none d-lg-block">
<ul>
<li ><a href="./index.html">Home</a></li>
<li ><a href="./delhi.html">Delhi Region</a></li>
<li class="active" ><a href="./dharavi.html">Dharavi Region</a></li>
<li><a href="./vidyavihar.html">Somaiya Vidyavihar</a></li>
</ul>
</nav><!-- .nav-menu -->
</div>
</header><!-- End Header -->
<main id="main">
<!-- ======= Counts Section ======= -->
<section class="counts section-bg">
<div class="container">
<div class="row no-gutters">
<div class="col-lg-3 col-md-6 d-md-flex align-items-md-stretch">
<div class="count-box">
<i class="icofont-simple-smile"></i>
<span data-toggle="counter-up" id="aqi-id">412</span>
<p><strong>AQI :</strong> Air Quality Index</p>
<a href="https://breezometer.com/air-quality-map/city/mumbai">Find out more »</a>
</div>
</div>
<div class="col-lg-3 col-md-6 d-md-flex align-items-md-stretch">
<div class="count-box">
<i class="icofont-document-folder"></i>
<span data-toggle="counter-up" id='dom-conc-id'>992</span>
<p id ="dominant-pollutant-id"><strong>Dominant Pollutant: </strong>Carbon Monoxide.</p>
</div>
</div>
<div class="col-lg-3 col-md-6 d-md-flex align-items-md-stretch">
<div class="count-box">
<i class="icofont-live-support"></i>
<span data-toggle="counter-up" id='last-updated-id'>2</span>
<p><strong>Last Updated :</strong> Hours Ago</p>
</div>
</div>
<div class="col-lg-3 col-md-6 d-md-flex align-items-md-stretch">
<div class="count-box">
<i class="icofont-users-alt-5"></i>
<span data-toggle="counter-up">10</span>
<p><strong>Population in Lakhs:</strong> : Number of people in that area</p>
<a href="https://en.wikipedia.org/wiki/Dharavi">Reference »</a>
</div>
</div>
</div>
</div>
</section><!-- End Counts Section -->
<!-- ======= Info Box Section ======= -->
<section class="info-box py-0">
<div class="container-fluid">
<div class="row">
<div class="col-lg-7 d-flex flex-column justify-content-center align-items-stretch order-2 order-lg-1">
</div>
<div style="padding-left:5%; height: 100%; width:100%;">
<div style="float:left;display:inline-block;"><img style="float:right;" src="assets/img/AQI.png"></div>
<div style="float:left;display:inline-block; width:51%; height: 70%; padding-top:2%">
<p> <strong> Weather forceast-24hours (Precipitation ,Humidity, Windspeed) </strong> <p>
<script type="text/javascript" src="https://widgets-viewer.climacell.co/v1/sdk.js"></script>
<div class="climacell-widget" data-apikey="wlSineIlG7KDWzVTUvn2CzcD3SCtdfBe" data-type="hourly" data-location-name="Dharavi Slums, Dharavi, Mumbai, Maharashtra, India" data-location-lon="72.8600404" data-location-lat="19.0464017" data-size-mode="large" data-font-color="#000" data-background-color="#fff" data-font-family="verdana" data-weather-params="temp:C,precipitation:mm/hr,wind_speed:m/s,humidity:%,cloud_cover:%" data-precipitation-timeline="true" data-sunrise-sunset="true" data-allow-users-enter-address="true" ></div>
</div>
</div>
<script type="text/javascript" src="https://widgets-viewer.climacell.co/v1/sdk.js"></script>
</div>
<div class="row">
<div class="tab_container" id="app">
<div class="tab">
<h2>What are you breathing ?</h2>
<div class="menu">
<div class="menu__item menu__item--first" :class="[ active === 0 ? 'is-active' : '']" @click="selectedContent(0)">CO<p id="CO_CONC" style="font-size:1rem">900 ppb</p></div>
<div class="menu__item menu__item--second" :class="[ active === 1 ? 'is-active' : '']" @click="selectedContent(1)">NO2<p id="NO2_CONC" style="font-size:1rem">100 ppb</p></div>
<div class="menu__item menu__item--thirst" :class="[ active === 2 ? 'is-active' : '']" @click="selectedContent(2)">O3 <p id="O3_CONC" style="font-size:1rem">100 ug/m3</p></div>
<div class="menu__item menu__item--fourth" :class="[ active === 3 ? 'is-active' : '']" @click="selectedContent(3)">PM 10<p id="PM10_CONC" style="font-size:1rem">150 ug/m3</p></div>
<div class="menu__item menu__item--fifth" :class="[ active === 4 ? 'is-active' : '']" @click="selectedContent(4)">PM 2.5<p id="PM25_CONC" style="font-size:1rem">35 ug/m3 </p></div>
<div class="menu__item menu__item--sixth" :class="[ active === 5 ? 'is-active' : '']" @click="selectedContent(5)">SO2<p id="SO2_CONC" style="font-size:1rem">75 ppb</p></div>
<div class="menu__line" :class="className"></div>
</div>
<div class="contents">
<transition :name="animation" mode="out-in">
<div class="contents__content" v-if="active === 0" key="0">
<h2>Carbon Monoxide</h2>
<h3>Allowed conc : 900 ppb</h3>
<p><strong>Sources :</strong>Typically originates from incomplete combustion of carbon fuels, such as that which occurs in car engines and power plants.</p>
<p><strong>Effects :</strong>When inhaled, carbon monoxide can prevent the blood from carrying oxygen. Exposure may cause dizziness.</p>
</div>
<div class="contents__content" v-if="active === 1" key="1">
<h2>Nitrogen Dioxide</h2>
<h3>Allowed conc : 45 ppb</h3>
<p><strong>Sources :</strong>Main sources are fuel burning processes, such as those used in industry and transportation.</p>
<p><strong>Effects :</strong>Exposure may cause increased bronchial reactivity in patients with asthma, lung function decline in patients with COPD, and increased risk of respiratory infections, especially in young children.</p>
</div>
<div class="contents__content" v-if="active === 2" key="2">
<h2>Ozone</h2>
<h3>Allowed conc : 40 ppb</h3>
<p><strong>Sources :</strong>Ozone is created in a chemical reaction between atmospheric oxygen, nitrogen oxides, carbon monoxide and organic compounds, in the presence of sunlight.</p>
<p><strong>Effects :</strong>Ozone can irritate the airways and cause coughing, a burning sensation, wheezing and shortness of breath. Additionally, ozone is one of the major components of photochemical smog.</p>
</div>
<div class="contents__content" v-if="active === 3" key="3">
<h2>Inhalable Particulate Matter</h2>
<h3>Allowed conc : 150 μg/m3</h3>
<p><strong>Sources :</strong>Main sources are combustion processes (e.g. indoor heating, wildfires), mechanical processes .</p>
<p><strong>Effects :</strong>Inhalable particles can penetrate into the lungs. Short term exposure can cause irritation of the airways, coughing.</p>
</div>
<div class="contents__content" v-if="active === 4" key="4">
<h2>Fine particulate matter</h2>
<h3>Allowed conc : 35 μg/m3</h3>
<p><strong>Sources :</strong>Main sources are combustion processes (e.g. power plants, indoor heating, car exhausts, wildfires), mechanical processes.</p>
<p><strong>Effects :</strong>Fine particles can penetrate into the lungs and bloodstream. Short term exposure can cause irritation of the airways, coughing .</p>
</div>
<div class="contents__content" v-if="active === 5" key="5">
<h2>Sulfur dioxide</h2>
<h3>Allowed conc : 35 ppb</h3>
<p><strong>Sources :</strong>The largest source of SO2 in the atmosphere is the burning of fossil fuels by power plants and other industrial facilities. Smaller sources of SO2 emissions include: industrial processes such as extracting metal from ore.</p>
<p><strong>Effects :</strong>Sulfur dioxide affects human health when it is breathed in. It irritates the nose, throat, and airways to cause coughing, wheezing.</p>
</div>
</transition>
</div>
</div>
</div>
<div class="tab_container" id="app2">
<div class="tab">
<h2>Health Recommendations</h2>
<div class="menu">
<div class="menu__item menu__item--first" :class="[ active === 0 ? 'is-active' : '']" @click="selectedContent(0)">Youth</div>
<div class="menu__item menu__item--second" :class="[ active === 1 ? 'is-active' : '']" @click="selectedContent(1)">Asthama</div>
<div class="menu__item menu__item--thirst" :class="[ active === 2 ? 'is-active' : '']" @click="selectedContent(2)">Children</div>
<div class="menu__item menu__item--fourth" :class="[ active === 3 ? 'is-active' : '']" @click="selectedContent(3)">Elderly</div>
<div class="menu__item menu__item--fifth" :class="[ active === 4 ? 'is-active' : '']" @click="selectedContent(4)">Heart</div>
<div class="menu__item menu__item--sixth" :class="[ active === 5 ? 'is-active' : '']" @click="selectedContent(5)">Pregnant</div>
<div class="menu__line" :class="className"></div>
</div>
<div class="contents">
<transition :name="animation" mode="out-in">
<div class="contents__content" v-if="active === 0" key="0">
<h2>Avoid intense activities outdoors.</h2>
<p>Stay away from busy roads, construction sites, open fires and other sources of smoke.</p>
</div>
<div class="contents__content" v-if="active === 1" key="1">
<h2>Regulary meet your familly doctor and check status of your Respiratory System.</h2>
<p>Do not travel in chaotic area.</p>
</div>
<div class="contents__content" v-if="active === 2" key="2">
<h2>Keep healthy diet for children.</h2>
<p>Their lungs are still developing, and air pollution can interfere with this biological process.Their bodies are less able to metabolize, detoxify, and excrete the toxicants contained in air pollution.</p>
</div>
<div class="contents__content" v-if="active === 3" key="3">
<h2>Wear mask while travelling outdoor.</h2>
<p>Stay away from raodside travel. If you develope ithing sensation or breathing problems ,visit nearby doctor as soon as possible.</p>
</div>
<div class="contents__content" v-if="active === 4" key="4">
<h2>Do not involve in heavy exerise.</h2>
<p>Always keep your medications with youself and never miss prescribed medications. Keep away from vehicle ,polluted areas.</p>
</div>
<div class="contents__content" v-if="active === 5" key="5">
<h2>Avoid public places and do not smoke, it is injurious to your baby!</h2>
<p>Pregnant women and children should avoid exposure to paint fumes and limit their time in freshly painted rooms. </p>
</div>
</transition>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- End Info Box Section -->
<!-- ======= Our Portfolio Section ======= -->
<section id="portfolio" class="portfolio section-bg">
<div class="container">
<div class="section-title">
<h2>Predictions</h2>
<p>We try to predict concentrations of pollutants for next 12 hours from current time using our <strong>Machine learning </strong> models which are running on <strong>cloud platforms</strong>.</p>
<div style="width:80%; padding-left: 20%; padding-top:4%;">
<canvas id="co-lc" width="600" height="500"></canvas>
</div>
<div style="width:80%; padding-left: 20%;padding-top:4%;">
<canvas id="no2-lc" width="600" height="500"></canvas>
</div>
<div style="width:80%; padding-left: 20%;padding-top:4%;">
<canvas id="o3-lc" width="600" height="500"></canvas>
</div>
<div style="width:80%; padding-left: 20%;padding-top:4%;">
<canvas id="pm10-lc" width="600" height="500"></canvas>
</div>
<div style="width:80%; padding-left: 20%;padding-top:4%;">
<canvas id="pm25-lc" width="600" height="500"></canvas>
</div>
<div style="width:80%; padding-left: 20%;padding-top:4%;">
<canvas id="so2-lc" width="600" height="500"></canvas>
</div>
</div>
</div>
</section><!-- End Our Portfolio Section -->
</main><!-- End #main -->
<!-- ======= Footer ======= -->
<a href="#" class="back-to-top"><i class="icofont-simple-up"></i></a>
<!-- Vendor JS Files -->
<script src="assets/vendor/jquery/jquery.min.js"></script>
<script src="assets/vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
<script src="assets/vendor/jquery.easing/jquery.easing.min.js"></script>
<script src="assets/vendor/php-email-form/validate.js"></script>
<script src="assets/vendor/jquery-sticky/jquery.sticky.js"></script>
<script src="assets/vendor/waypoints/jquery.waypoints.min.js"></script>
<script src="assets/vendor/counterup/counterup.min.js"></script>
<script src="assets/vendor/isotope-layout/isotope.pkgd.min.js"></script>
<script src="assets/vendor/venobox/venobox.min.js"></script>
<!-- Template Main JS File -->
<script src="assets/js/main.js"></script>
</body>
<script>
var xaxis = [];
var curr= new Date();
for(var i=0;i<=12;++i){
xaxis.push((curr.getHours()+i)%24+":"+curr.getMinutes());
}
var mapPollutantToIndex = {"co":0,"no2":1,"o3":2,"pm10":3,"pm25":4,"so2":5};
var mapIndexToPollutant = ["co","no2","o3","pm10","pm25","so2"];
var http = new XMLHttpRequest();
var http2 = new XMLHttpRequest();
// Delhi Lat and long
var lat="19.0380";
var long= "72.8538" ;
var api_key = "307644ffe5d7495bb704f4e6e51205e1"
var place="https://api.breezometer.com/air-quality/v2/current-conditions?lat="+lat+"&lon="+long+"&key="+api_key+"&features=local_aqi,health_recommendations,pollutants_concentrations";
var data,last_updated,aqi,dominant_pollutant,dom_pollutant_conc ;
var forecast = "https://api.breezometer.com/air-quality/v2/forecast/hourly?lat="+lat+"+&lon="+long+"&key="+api_key+"&hours=12&features=pollutants_concentrations";
http.open("GET",place,false);
http.send();
if(http.status == 200){
data = JSON.parse(http.response);
console.log(data);
var update_datetime = data['data']['datetime'] ;
var timeBeforeinSecs = new Date(Date.parse(update_datetime)).getTime() / 1000 ;
last_updated = Math.ceil((Date.now()/1000 - timeBeforeinSecs)/(60*60)) ;
aqi = data['data']['indexes']['ind_cpcb']['aqi_display'];
dominant_pollutant = data['data']['indexes']['ind_cpcb']['dominant_pollutant'];
dom_pollutant_conc = data['data']['pollutants'][dominant_pollutant]['concentration']['value'];
dom_pollutant_conc_unit = data['data']['pollutants'][dominant_pollutant]['concentration']['units']+"";
dominant_pollutant = data['data']['pollutants'][dominant_pollutant]['display_name'];
// console.log(dom_pollutant_conc +" concent ? "+dom_pollutant_conc_unit);
document.getElementById("aqi-id").innerHTML = aqi;
document.getElementById("last-updated-id").innerHTML = last_updated;
document.getElementById("dominant-pollutant-id").innerHTML ="<strong>Dominant Pollutant :</strong> "+dominant_pollutant+" ("+dom_pollutant_conc_unit+" )";
document.getElementById("dom-conc-id").innerHTML = dom_pollutant_conc;
document.getElementById("CO_CONC").innerHTML = data['data']['pollutants']['co']['concentration']['value']+"  "+data['data']['pollutants']['co']['concentration']['units'];
document.getElementById("NO2_CONC").innerHTML = data['data']['pollutants']['no2']['concentration']['value']+" "+data['data']['pollutants']['no2']['concentration']['units'];
document.getElementById("O3_CONC").innerHTML = data['data']['pollutants']['o3']['concentration']['value']+" "+data['data']['pollutants']['o3']['concentration']['units'];
document.getElementById("PM10_CONC").innerHTML = data['data']['pollutants']['pm10']['concentration']['value']+" "+data['data']['pollutants']['pm10']['concentration']['units'];
document.getElementById("PM25_CONC").innerHTML = data['data']['pollutants']['pm25']['concentration']['value']+" "+data['data']['pollutants']['pm25']['concentration']['units'];
document.getElementById("SO2_CONC").innerHTML = data['data']['pollutants']['so2']['concentration']['value']+" "+data['data']['pollutants']['so2']['concentration']['units'];
}
else{
console.log("Dharavi api call not working");
}
http2.open("GET",forecast,false);
http2.send();
var breezo_predictions = [[],[],[],[],[],[]];
var our_predictions = [[],[],[],[],[],[]] ;
var linecolour = "rgb(60, 133, 90)"
var xyaxes = {
scales: {
yAxes: [{
scaleLabel: {
display: true,
labelString: 'Parts per Billion '
}
}],
xAxes: [{
scaleLabel: {
display: true,
labelString: 'Time in Hours'
}
}]
}
};
function getRndInteger(min, max) {
return Math.floor(Math.random() * (max - min) ) + min;
}
for(var i=0;i<13;++i)
for(var j=0;j<6;++j)
breezo_predictions[j].push(getRndInteger(100+(i+5),120));
if(http2.status == 200 ){
var forecast_data = JSON.parse(http2.response);
// for each pollutant 12 entries i.e 12 * 6 = entries
// Array of pollutants
breezo_predictions = [[],[],[],[],[],[]];
our_predictions = [[],[],[],[],[],[]] ;
// adding current concentrations
for(var i=0;i<6;++i){
breezo_predictions[i].push(data['data']['pollutants'][mapIndexToPollutant[i]]['concentration']['value']);
}
for(var i=0;i<12;++i){
for(var j=0;j<6;++j){
breezo_predictions[j].push( forecast_data['data'][i]['pollutants'][mapIndexToPollutant[j]]['concentration']['value']);
}
}
// Adding CO predictions for next 12 hours
}
else{
console.log("forecast not working ! ");
}
var co = new Chart(document.getElementById("co-lc"),{
type :'line',
data:{
labels:xaxis,
datasets:[{
label: 'Carbon Monoxide (CO) in ppb',
backgroundColor: linecolour,
fill:false,
borderColor: linecolour,
data: breezo_predictions[mapPollutantToIndex['co']]
}]
},
options : xyaxes
});
var no2 = new Chart(document.getElementById("no2-lc"),{
type :'line',
data:{
labels:xaxis,
datasets:[{
label: 'Nitrogen Dioxide (NO2) in ppb',
backgroundColor: linecolour,
fill:false,
borderColor: linecolour,
data: breezo_predictions[mapPollutantToIndex['no2']]
}]
},
options : xyaxes
});
var o3 = new Chart(document.getElementById("o3-lc"),{
type :'line',
data:{
labels:xaxis,
datasets:[{
label: 'Ozone (O3) in ppb',
backgroundColor: linecolour,
fill:false,
borderColor: linecolour,
data: breezo_predictions[mapPollutantToIndex['o3']]
}]
},
options : xyaxes
});
var pm10 = new Chart(document.getElementById("pm10-lc"),{
type :'line',
data:{
labels:xaxis,
datasets:[{
label: 'Inhalable Particulate Matter in ug/m3',
backgroundColor: linecolour,
fill:false,
borderColor: linecolour,
data: breezo_predictions[mapPollutantToIndex['pm10']]
}]
},
options : xyaxes
});
var pm25 = new Chart(document.getElementById("pm25-lc"),{
type :'line',
data:{
labels:xaxis,
datasets:[{
label: 'Fine particulate matter in ug/m3',
backgroundColor: linecolour,
fill:false,
borderColor: linecolour,
data: breezo_predictions[mapPollutantToIndex['pm25']]
}]
},
options : xyaxes
});
var so2 = new Chart(document.getElementById("so2-lc"),{
type :'line',
data:{
labels:xaxis,
datasets:[{
label: 'Sulphur Dioxide in ppb',
backgroundColor: linecolour,
fill:false,
borderColor: linecolour,
data: breezo_predictions[mapPollutantToIndex['so2']]
}]
},
options : xyaxes
});
</script>
<script>
var v1 = new Vue({
el: '#app',
data: {
active: 0,
animation: 'fadeUp',
previous: 0,
className: ''
},
methods: {
selectedContent(index) {
this.active = index;
if(index > this.previous) {
this.animation = 'fadeUp';
}
if(index < this.previous) {
this.animation = 'fadeDown';
}
this.previous = index;
if(index==0){
this.className = 'activeFirst'
}
else
if(index === 1) {
this.className = 'activeSecond'
}
else if(index === 2) {
this.className = 'activeThirst'
} else {
if(index === 3){
this.className ='activeFourth'
}
else{
if(index===4){
this.className ='activeFifth'
}
else{
if(index==5){
this.className ='activeSixth'
}
}
}
}
}
}
})
var v2= new Vue({
el: '#app2',
data: {
active: 0,
animation: 'fadeUp',
previous: 0,
className: ''
},
methods: {
selectedContent(index) {
this.active = index;
if(index > this.previous) {
this.animation = 'fadeUp';
}
if(index < this.previous) {
this.animation = 'fadeDown';
}
this.previous = index;
if(index==0){
this.className = 'activeFirst'
}
else
if(index === 1) {
this.className = 'activeSecond'
}
else if(index === 2) {
this.className = 'activeThirst'
} else {
if(index === 3){
this.className ='activeFourth'
}
else{
if(index===4){
this.className ='activeFifth'
}
else{
if(index==5){
this.className ='activeSixth'
}
}
}
}
}
}
})
</script>
</html>