-
Notifications
You must be signed in to change notification settings - Fork 50
/
index_xu.html
1523 lines (1299 loc) · 70.7 KB
/
index_xu.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
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="authors" content="Bo Zhao, Fengyu Xu, Lola Kang, Joshua Ji, and Steven Bao">
<!-- <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" /> -->
<title>Novel Coronavirus Infection Map</title>
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/leaflet.css" />
<link rel="stylesheet" href="css/MarkerCluster.Default.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css">
<link href="https://fonts.googleapis.com/css?family=Titillium+Web|Oswald" rel="stylesheet">
<link href="css/c3.min.css" rel="stylesheet">
<link rel="stylesheet" href="css/simplebar.css" />
<link rel="stylesheet" href="css/animate.min.css">
<link href="css/bootstrap4-toggle.min.css" rel="stylesheet">
<link rel="stylesheet" href="css/main.css">
<link rel="stylesheet" href="css/mobile.css">
<link rel="icon" href="img/favicon.ico" type="image/x-icon">
<script src="js/d3.js"></script>
<script src="js/c3.min.js"></script>
<script src="js/leaflet.js"></script>
<script src="js/leaflet.markercluster.js"></script>
<script src="js/leaflet-polygon.fillPattern.js"></script>
<script src="js/topojson.v1.min.js"></script>
<script src="js/chroma.min.js"></script>
<script src="js/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="js/jquery.sparkline.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/bootstrap4-toggle.min.js"></script>
<script src="js/bootstrap.bundle.min.js"></script>
<script src="js/simplebar.min.js"></script>
</head>
<body>
<main>
<div class="loader"></div>
<div id="mobiledeck">
<p>
<span class="mobile-title">Aggr. Confirmed</span>
<span class="confirmed-count"></span>
<span class="confirmed-new-count "></span>
<p>
<p>
<span class="mobile-title">Active Confirmed</span>
<span class="active-count"></span>
<span class="active-new-count"></span>
<p>
<p>
<span class="mobile-title">Recovered</span>
<span class="recovered-count"></span>
<span class="recovered-new-count"></span>
<p>
<p>
<span class="mobile-title">Death</span>
<span class="death-count"></span>
<span class="death-new-count"></span>
<p>
</div>
<div id="info" data-simplebar data-simplebar-auto-hide="true">
<div id="title" style="font-size:19px"><img src="img/virus_logo.png" width="28px"> Novel Coronavirus (COVID-19) Infection Map
<span><a href="https://twitter.com/UW" target="_blank"><i class="fab fa-twitter-square"></i></a></span>
<span><a href="https://github.com/jakobzhao/virus" target="_blank"><i class="fab fa-github-square"></i></a></span>
<span><a data-toggle="modal" data-target="#resourcewindow"><i class="far fa-newspaper"></i></a></span>
<span><a data-toggle="modal" data-target="#infowindow"><i class="nav fas fa-question-circle"></i></a></span>
</div>
<p><span id="placename">GLOBAL TREND</span> </p>
<div><span id="last-date">Last update: </span><span id="date"></span> <span id="hint"> Click a place to review local trend.</span></div>
<p><span id="source">Source: </span><span id="source-website" href="" target="_blank"></span></p>
<div id="deck-1" class="card-deck counts">
<div class="card">
<div class="card-body confirmed">
<h5 class="card-title">Aggregated Confirmed
<i class="nav fas fa-exclamation-circle tooltip">
<span class="tooltiptext">All the confirmed cases ever since the discovery of the COVID-19 in the statistical area.</span>
</i>
</h5>
</div>
<p class="card-text">
<span class="confirmed-count"></span><span class="confirmed-new-count">
</span>
</p>
</div>
<div class="card">
<div class="card-body active">
<h5 class="card-title">Active Confirmed
<i class="nav fas fa-exclamation-circle tooltip">
<span class="tooltiptext">The remaining confirmed cases. The active confirmed cases excludes the recovered and death cases.</span>
</i>
</h5>
</div>
<p class="card-text">
<span class="active-count"></span>
<span class="active-new-count"></span>
<i id="counticon" class="nav fas fa-exclamation-circle tooltip counticon active-new-count-tooltip">
<span class="tooltiptext">The newly increased/decreased confirmed cases: the # of today's active confirmed cases subtract the # of yesterday's.</span>
</i>
</p>
</div>
</div>
<div id="deck-2" class="card-deck counts">
<div class="card">
<div class="card-body recovered">
<h5 class="card-title">Recovered</h5>
<p class="card-text"><span class="recovered-count"></span><span class="recovered-new-count"></span></p>
</div>
</div>
<div class="card">
<div class="card-body death">
<h5 class="card-title">Death</h5>
<p class="card-text"><span class="death-count"></span><span class="death-new-count"></span></p>
</div>
</div>
</div>
<div class="dropdown">
<button class="btn btn-secondary btn-sm dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
linear type
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item" id = "linear">linear</a>
<a class="dropdown-item" id = "logarithm">logarithm</a>
</div>
</div>
<p class="chart-legend"> toggle on/off the curve or scroll on the curves to change the date range </P>
<div id="timeline-chart"></div>
<div id="total-chart"></div>
<div id="rank-chart"></div>
<div id="footer">
<div id="mtToggle">
<span id="rankingText"> <b> World or U.S. Rankings</b> </span>
<!-- #e8e3d3; -->
<!-- #dc3545; -->
<span id="rankingIcon"><i style="margin-left:10px;color:#dc3545" class="fas fa-angle-double-right animated infinite slideInLeft delay-2s" style="gray"></i></span>
<span id="rankingSpace" style="margin-right:1px"> </span>
<input type="checkbox" id="panelSwitcher" unchecked data-toggle="toggle" data-off="Situational Heatmap" data-width="180" data-size="xs" data-on="Back to Map" data-onstyle="secondary" data-offstyle="outline-secondary">
<span style="margin-right:25px"> </span>
<span id="rankingToggle"><input type="checkbox" id="areaSwitcher" unchecked data-toggle="toggle" data-on="Global Rank" data-width="100" data-size="xs" data-off="U.S. Rank" data-onstyle="secondary" data-offstyle="outline-secondary">
</span>
</div>
<div id="content-explain"> In the main map, an country or region's inflection level is measured by the # of today's active/remaining confirmed cases. The gray slash texture indicates no previous cases are discovered;
the green
texture means the region in which all the infected cases have recovered.</div>
<div><i class='fas fa-users' style="color:#dc3545"></i> Infection Case(s) indicates one or several confirmed infected individual(s) in the U.S., excluding those were identified from the Diamond Princess.
The dataset of the infected cases are continuously enriched from different data portals such as
<a href="https://coronavirus.1point3acres.com/en" target="_blank">1point3acres</a> and state officials. Notably, <span class="emphasis"> each case was geocoded to an
approximate location within the county
which reported the case. The location is by no means identical to the exact address where the case was discovered.</span>
</div>
<!--
<div> <i class="fas fa-procedures" style="color:#dc3545"> </i> An Infected Community indicates a community or village where confirmed cases were found. The local governments in China have taken strict measures to isolate the residents
of
these
places from the outside. The dataset of infected community can be found at <a href="https://lab.ahusmart.com/nCoV/api/detail" target="_blank">ahusmart</a>.
</div>
-->
<div>This map is made by the <a href="http://hgis.uw.edu" target="_blank">Humanistic GIS Lab at University of Washington - Seattle</a>.
The data are mainly collected from <a href="https://www.who.int/emergencies/diseases/novel-coronavirus-2019/situation-reports/" target="_blank">WHO</a>,
<a href="https://www.cdc.gov/coronavirus/2019-ncov/cases-in-us.html" target="_blank">CDC</a>,
<a href="https://www.canada.ca/en/public-health/services/diseases/2019-novel-coronavirus-infection.html" target="_blank">PHA</a> ,
<a href="http://2019ncov.chinacdc.cn/2019-nCoV/" target="_blank">China CDC</a>,
<a href="https://www.nbcnews.com/health/health-news/coronavirus-u-s-map-where-virus-has-been-confirmed-across-n1124546" target="_blank">NBC News</a>,
<a href="https://en.wikipedia.org/wiki/Template:2019%E2%80%9320_coronavirus_pandemic_data" target="_blank">Wikipedia</a>,
and <a href="https://voice.baidu.com/act/newpneumonia/newpneumonia" target="_blank">Baidu</a>. Regarding the state level data in the U.S., they are collected from CDC, state officials and <a
href="https://www.nbcnews.com/health/health-news/coronavirus-u-s-map-where-virus-has-been-confirmed-across-n1124546" target="_blank">NBC News</a>.
The computational resources are provided by <a href="https://csde.washington.edu/" target="_blank">UW's Center for Studies in Demography and Ecology</a>. The base maps are from <a target="_blank"
href="https://github.com/CartoDB/cartodb/wiki/BaseMaps-available">Carto</a> and <a href="https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/" target="_blank">ESRI</a>, and the geospatial data for the base maps
are acquired from the <a href="openstreetmap.org/copyright" target="_blank"> OpenStreetMap</a>.
<span class="emphasis">The timely updated dataset of the virus infection can be downloaded <a href="http://hgis.uw.edu/virus/assets/virus.csv" target="_blank">here.</a></span> Details
about this interactive
map can be found <a data-toggle="modal" data-target="#infowindow"> here</a>. If you have any questions or
concerns, please contact <a href="mailto:zhaobo@uw.edu">Bo Zhao</a>.
</div>
<p align="right" style="margin-right:20px; margin-top:-25px"><a href="https://hgis.uw.edu/2020/03/18/covid-19-novel-coronavirus-infection-map/" target="_blank"><img src="img/logo.png" width="120px"></img></a></p>
</div>
</div>
<div id="table">
<div id="table-container" data-simplebar data-simplebar-auto-hide="true">
<table id="table-container-div" class="table table-bordered table-fixed table-hover">
<thead>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
<div id="legend-panel" class="card-deck legend">
<div class="card">
<div class="card-body">
<h5 class="card-title grey-circles" style="color:black">no case</h5>
</div>
</div>
<div class="card">
<div class="card-body legend-color-1">
<h5 class="card-title" style="color:black">1</h5>
</div>
</div>
<div class="card">
<div class="card-body legend-color-2">
<h5 class="card-title" style="color:black">10</h5>
</div>
</div>
<div class="card">
<div class="card-body legend-color-3">
<h5 class="card-title" style="color:black">100</h5>
</div>
</div>
<div class="card">
<div class="card-body legend-color-4">
<h5 class="card-title" style="color:black">250</h5>
</div>
</div>
<div class="card">
<div class="card-body legend-color-5">
<h5 class="card-title" style="color:black">1,000</h5>
</div>
</div>
<div class="card">
<div class="card-body legend-color-6">
<h5 class="card-title" style="color:black">10,000+</h5>
</div>
</div>
</div>
<div id="map"></div>
</main>
<div id="infowindow" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document" style="width:1250px!important">
<div class="modal-content">
<div class="modal-header">
<strong class="modal-title" id="exampleModalLongTitle">Info</strong>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<div id="demo" class="carousel " data-ride="carousel">
<p>This online interactive map enables users to track both the global and local trends of Novel Coronavirus infection since Jan 21st, 2020. The supporting dataset is timely collected from multiple official sources and then plotted onto
this map.</p>
<h5>Data Sources</h5>
<p>The data are mainly collected from 1. <a href="http://www.nhc.gov.cn" target="_blank">National Health Commission</a> (NHC) of the People’s Republic of China
2. China’s Provincial & Municipal Health Commission, China’s Provincial & Municipal government database
3. Public data published from Hongkong, Macau, and Taiwan official channels
4. <a href="https://www.who.int/emergencies/diseases/novel-coronavirus-2019/situation-reports/" target="_blank">World Health Organization</a> (WHO)
5. <a href="https://www.cdc.gov/coronavirus/2019-ncov/cases-in-us.html" target="_blank">Centers for Disease Control and Prevention</a> (CDC)
6. <a href="https://www.canada.ca/en/public-health/services/diseases/2019-novel-coronavirus-infection.html" target="_blank">Public Health Agency of Canada</a> (PHAC)
7. <a href="https://voice.baidu.com/act/newpneumonia/newpneumonia" target="_blank">Baidu</a>.
<!--
8. <a href="https://lab.ahusmart.com/nCoV/api/detail" target="_blank">ahusmart</a> - the infected community in China.
-->
8. the state officals of different states in the U.S.
9. <a href="https://www.nbcnews.com/health/health-news/coronavirus-u-s-map-where-virus-has-been-confirmed-across-n1124546" target="_blank">NBC News</a>.
The dataset (in SQLite format) can be downloaded from <a href="http://hgis.uw.edu/virus/assets/virus.db" target="_blank">here</a>.
You can view the data (in CSV format) at <a href="http://hgis.uw.edu/virus/assets/virus.csv" target="_blank">here</a>.</p>
<p>In the data table, each entry indicates the infection status in the format of "#-#-#-#" -- a 4-sequel entry divided by dashes. The first sequel represents the number of confirmed cases, the second sequel represents suspected
cases, the third sequel represents cured cases, the fourth sequel represents death cases.</p>
<h5>Update Procedure</h5>
<p>The country-level data is collected from WHO, while the data of each province in China is collected from multiple sources such as China's NHC,Mapmiao and Baidu. Notably, we also refer to CDC to verify the virus spreading status in the
U.S. To
make a timely data and map updates, we collect the data every 4 hours, and verify the data quality per day. In addition, we plan to provide finer-scale data from China (the county level), U.S. (the state level) and Canada (the province
level) in the next version.</p>
<h5>Acknowledgment</h5>
<p>
<li>Team members: Bo Zhao, Fengyu Xu, Lola Kang, Joshua Ji, and Steven Bao.</li>
<li>The Server is hosted at UW’s <a href="https://https://csde.washington.edu/" target="_blank">Center for Studies in Demography and Ecology (CSDE)</a>.</li>
</p>
</div>
</div>
</div>
</div>
</div>
<div id="resourcewindow" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document" style="width:1250px!important">
<div class="modal-content">
<div class="modal-header">
<strong class="modal-title" id="exampleModalLongTitle">Resource</strong>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<div id="demo" class="carousel " data-ride="carousel">
<h5>Coronavirus information resources</h5>
<!-- <br><b> China - Official Websites</b> -->
<table style="width:100%">
<tr>
<td><a href="http://wjw.beijing.gov.cn/xwzx_20031/wnxw/" target="_blank"> Beijing</a></td>
<td><a href="http://wsjkw.hebei.gov.cn/list/more_newlist_14.html" target="_blank"> Hebei</a></td>
<td><a href="http://wsjk.ln.gov.cn/wst_zdzt/xxgzbd/yqtb/" target="_blank"> Liaoning</a></td>
<td><a href=" http://www.jl.gov.cn/szfzt/jlzxd/yqtb/" target="_blank"> Jilin</a></td>
</tr>
<tr>
<td><a href="http://wjw.jiangsu.gov.cn/col/col7290/index.html" target="_blank"> Jiangsu</a></td>
<td><a href="http://wsjkw.sh.gov.cn/yqfk2020/" target="_blank"> Shanghai</a></td>
<td><a href="http://hc.jiangxi.gov.cn/ztxx/xxgzbdgrdfyyqfk/yqtb/index.shtml" target="_blank"> Jiangxi</a></td>
<td><a href="http://wsjkw.gd.gov.cn/zwyw_yqxx/" target="_blank"> Guangdong</a></td>
</tr>
<tr>
<td><a href="http://wjw.hunan.gov.cn/wjw/qwfb/yqfkgz_list.html" target="_blank"> Hunan</a></td>
<td><a href="http://wst.hainan.gov.cn/yqfk/" target="_blank"> Hainan</a></td>
<td><a href="https://www.zjwjw.gov.cn/col/col1202112/index.html" target="_blank"> Zhejiang</a></td>
<td><a href="http://www.hnwsjsw.gov.cn/channels/854.shtml" target="_blank"> Henan</a></td>
</tr>
<tr>
<td><a href="http://hc.jiangxi.gov.cn/ztxx/xxgzbdgrdfyyqfk/yqtb/index.shtml" target="_blank"> Jiangxi</a></td>
<td><a href="http://wjw.hubei.gov.cn/bmdt/ztzl/fkxxgzbdgrfyyq/xxfb/" target="_blank"> Hubei</a></td>
<td><a href=" http://sxwjw.shaanxi.gov.cn/col/col9/index.html" target="_blank"> Shaanxi</a></td>
<td><a href="http://wjw.shanxi.gov.cn/wjywl02/index.hrh" target="_blank"> Shanxi</a></td>
</tr>
<tr>
<td><a href="http://wsjkw.nx.gov.cn/yqfkdt/yqsd1.htm" target="_blank"> Ningxia</a></td>
<td><a href="https://wsjkw.qinghai.gov.cn/ztbd/yqjk/fkdt/2020/02/18/1582009147575.html" target="_blank"> Qinghai</a></td>
<td><a href="http://wsjk.gansu.gov.cn/channel/11217/index.html" target="_blank"> Gansu</a></td>
<td><a href="http://xjhfpc.gov.cn/ztzl/fkxxgzbdfygz/yqtb.htm" target="_blank"> Xinjiang</a></td>
</tr>
<tr>
<td><a href="http://www.gzhfpc.gov.cn/ztzl_500663/xxgzbdgrdfyyqfk/" target="_blank"> Guizhou</a></td>
<td><a href="http://ynswsjkw.yn.gov.cn/wjwWebsite/web/col?id=UU157976428326282067&cn=xxgzbd&pcn=ztlm&pid=UU145102906505319731" target="_blank"> Yunnan</a></td>
<td><a href="http://wsjkw.cq.gov.cn/topic/25.jspx" target="_blank"> Chongqing</a></td>
<td><a href="http://wjw.xizang.gov.cn/xwzx/wsjkdt/" target="_blank"> Xizang</a></td>
</tr>
<tr>
<td><a href="http://wjw.nmg.gov.cn/xwzx/xwfb/index.shtml" target="_blank"> Neimenggu</a></td>
<td><a href="http://wsjkw.sc.gov.cn/scwsjkw/gzbd01/ztwzlmgl.shtml" target="_blank"> Sichuan</a></td>
<td><a href="http://wsjkw.hlj.gov.cn/index.php/Home/Zwgk/all/typeid/42" target="_blank"> Heilongjiang</a></td>
<td><a href="https://v.gxnews.com.cn/zt/2020yq" target="_blank"> Guangxi</a></td>
</tr>
<tr>
<td><a href="http://wjw.ah.gov.cn/news_list_477_1.html" target="_blank"> Anhui</a></td>
<td><a href="https://www.ssm.gov.mo/apps1/PreventWuhanInfection/ch.aspx#clg17046" target="_blank"> Macau</a></td>
<td><a href="https://sites.google.com/cdc.gov.tw/2019ncov/taiwan" target="_blank"> Taiwan</a></td>
<td><a href="https://www.chp.gov.hk/files/pdf/enhanced_sur_pneumonia_wuhan_chi.pdf" target="_blank"> Hongkong</a></td>
</tr>
<!-- </table>
<br><b> the US - Official Websites</b>
<table style="width:100%"> -->
<tr>
<td><a href="http://www.alabamapublichealth.gov/infectiousdiseases/2019-coronavirus.html" target="_blank">Alabama</a></td>
<td><a href="https://dphhs.mt.gov/publichealth/cdepi/diseases/coronavirusmt" target="_blank">Montana</a></td>
<td><a href="http://dhss.alaska.gov/dph/Epi/id/Pages/COVID-19/monitoring.aspx" target="_blank">Alaska</a></td>
<td><a href="http://dhhs.ne.gov/Pages/Coronavirus.aspx" target="_blank">Nebraska</a></td>
</tr>
<tr>
<td><a href="https://www.azdhs.gov/preparedness/epidemiology-disease-control/infectious-disease-epidemiology/index.php#novel-coronavirus-home" target="_blank">Arizona</a></td>
<td><a href="http://dpbh.nv.gov/Programs/OPHIE/dta/Hot_Topics/Coronavirus/" target="_blank">Nevada</a></td>
<td><a href="https://www.healthy.arkansas.gov/programs-services/topics/novel-coronavirus" target="_blank">Arkansas</a></td>
<td><a href="https://www.dhhs.nh.gov/dphs/cdcs/2019-ncov.htm" target="_blank">New Hampshire</a></td>
</tr>
<tr>
<td><a href="https://www.cdph.ca.gov/Programs/CID/DCDC/Pages/Immunization/ncov2019.aspx" target="_blank">California</a></td>
<td><a href=" https://www.colorado.gov/pacific/cdphe/2019-novel-coronavirus" target="_blank">Colorado</a></td>
<td><a href="https://cv.nmhealth.org/" target="_blank">New Mexico</a></td>
<td><a href=" https://portal.ct.gov/coronavirus" target="_blank">Connecticut</a></td>
</tr>
<tr>
<td><a href=" https://health.ny.gov/diseases/communicable/coronavirus/" target="_blank">New York</a></td>
<td><a href="https://www.dhss.delaware.gov/dhss/dph/epi/2019novelcoronavirus.html" target="_blank">Delaware</a></td>
<td><a href="https://coronavirus.dc.gov/page/coronavirus-surveillance-data" target="_blank">The District of Columbia</a></td>
<td><a href="https://www.health.nd.gov/diseases-conditions/coronavirus/north-dakota-coronavirus-cases" target="_blank">North Dakota</a></td>
</tr>
<tr>
<td><a href="http://www.floridahealth.gov/diseases-and-conditions/COVID-19/index.html" target="_blank">Florida</a></td>
<td><a href="https://coronavirus.ohio.gov/wps/portal/gov/covid-19/" target="_blank">Ohio</a></td>
<td><a href="https://dph.georgia.gov/" target="_blank">Georgia</a></td>
<td><a href="https://www.ok.gov/health/Prevention_and_Preparedness/Acute_Disease_Service/Disease_Information/Coronavirus_Disease_2019/Oklahoma_Response_to_Coronavirus_Disease_2019/index.html" target="_blank">Oklahoma</a></td>
</tr>
<tr>
<td><a href="https://www.oregon.gov/oha/PH/DISEASESCONDITIONS/DISEASESAZ/Pages/emerging-respiratory-infections.aspx" target="_blank">Oregon</a></td>
<td><a href="https://health.hawaii.gov/docd/advisories/novel-coronavirus-2019/#situation" target="_blank">Hawaii</a></td>
<td><a href="https://coronavirus.idaho.gov/" target="_blank">Idaho</a></td>
<td><a href="https://www.health.pa.gov/topics/disease/Pages/Coronavirus.aspx" target="_blank">Pennsylvania</a></td>
</tr>
<tr>
<td><a href="http://dph.illinois.gov/topics-services/diseases-and-conditions/diseases-a-z-list/coronavirus" target="_blank">Illinois</a></td>
<td><a href="https://www.scdhec.gov/index.php/health/infectious-diseases/viruses/coronavirus-disease-2019-covid-19" target="_blank">South Carolina</a></td>
<td><a href="https://idph.iowa.gov/Emerging-Health-Issues/Novel-Coronavirus" target="_blank">Iowa</a></td>
<td><a href="https://doh.sd.gov/news/Coronavirus.aspx" target="_blank">South Dakota</a></td>
</tr>
<tr>
<td><a href="https://chfs.ky.gov/agencies/dph/pages/covid19.aspx" target="_blank">Kentucky</a></td>
<td><a href="https://www.dshs.state.tx.us/coronavirus/#casecounts" target="_blank">Texas</a></td>
<td><a href="https://coronavirus.utah.gov/coronavirus-latest-information/" target="_blank">Utah</a></td>
<td><a href="https://www.maine.gov/dhhs/mecdc/infectious-disease/epi/airborne/coronavirus.shtml" target="_blank">Maine</a></td>
</tr>
<tr>
<td><a href="https://www.healthvermont.gov/response/infectious-disease/2019-novel-coronavirus" target="_blank">Vermont</a></td>
<td><a href="https://phpa.health.maryland.gov/Pages/Novel-coronavirus.aspx" target="_blank">Maryland</a></td>
<td><a href="http://www.vdh.virginia.gov/surveillance-and-investigation/novel-coronavirus/" target="_blank">Virginia</a></td>
<td><a href="https://www.mass.gov/info-details/covid-19-cases-quarantine-and-monitoring" target="_blank">Massachusetts</a></td>
</tr>
<tr>
<td><a href="https://www.doh.wa.gov/Emergencies/Coronavirus" target="_blank">Washington</a></td>
<td><a href="https://www.michigan.gov/coronavirus" target="_blank">Michigan</a></td>
<td><a href=" https://dhhr.wv.gov/Coronavirus%20Disease-COVID-19/Pages/default.aspx" target="_blank">West Virginia</a></td>
<td><a href="https://www.health.state.mn.us/diseases/coronavirus/situation.html" target="_blank">Minnesota</a></td>
</tr>
<tr>
<td><a href="https://www.dhs.wisconsin.gov/outbreaks/index.htm" target="_blank">Wisconsin</a></td>
<td><a href=" https://msdh.ms.gov/msdhsite/_static/14,0,420.html" target="_blank">Mississippi</a></td>
<td><a href="https://health.wyo.gov/publichealth/infectious-disease-epidemiology-unit/disease/novel-coronavirus/" target="_blank">Wyoming</a></td>
<td><a href="https://health.mo.gov/living/healthcondiseases/communicable/novel-coronavirus/" target="_blank">Missouri</a></td>
</tr>
</table>
<br><b>Other Official Websites</b>
<table style="width:100%">
<tr>
<td><a href="https://www.cdc.gov/coronavirus/2019-ncov/cases-in-us.html" target="_blank"> the U.S.</a></td>
<td><a href=" https://www.canada.ca/en/public-health/services/diseases/2019-novel-coronavirus-infection.html" target="_blank"> Canada</a></td>
<td><a href="https://www.cdc.go.kr/board/board.es?mid=a20501000000&bid=0015" target="_blank"> Republic of Korean</a></td>
</tr>
<tr>
<td><a href="https://www.mhlw.go.jp/stf/newpage_09571.html" target="_blank"> Japan</a></td>
<td><a href="https://www.health.gov.au/news/health-alerts/novel-coronavirus-2019-ncov-health-alert#current-status" target="_blank"> Australia</a></td>
<td><a href="https://www.moh.gov.sg/covid-19" target="_blank"> Singapore</a></td>
</tr>
<tr>
<td><a href="http://www.salute.gov.it/nuovocoronavirus" target="_blank"> Italy</a></td>
<td><a href="https://www.gov.uk/guidance/coronavirus-covid-19-information-for-the-public" target="_blank"> the UK</a></td>
<td><a href="http://irangov.ir/cat/509" target="_blank"> Iran</a></td>
</tr>
</table>
<br><b>Other Resources:</b>
<ul>
<li><a href="https://www.cdc.gov/coronavirus/2019-ncov/symptoms-testing/testing.html" target="_blank"> CDC-selfchecker</a></li> (coronavirus self-test tool)
<li><a href="https://covid19.healthdata.org/projections" target="_blank"> Coronavirus Data</a></li> (The cisualization shows the data of coronavirus for all 50 states, so that cities and states can best prepare)
<li><a href="https://ncov.dxy.cn/" target="_blank"> Dingxiangyuan</a></li> (Update national daily data and educate Coronavirus knowledge)
<li><a href="http://zhongxinzhiyuan.cn/yiqing_real_time_map.html" target="_blank"> Zhongxinzhiyuan</a></li> (Update the latest news and data visualization)
<li><a href="http://2019ncov.nosugartech.com/search.html" target="_blank"> Tongchengchaxun</a></li> (Coronavirus confirmed patients' trips query tool)
<li><a href="https://voice.baidu.com/act/newpneumonia/newpneumonia" target="_blank"> Baidu Coronavirus Data Report</a></li> (Update Global daily data and hot topics about Coronavirus)
<li><a href="https://www.nejm.org/coronavirus" target="_blank"> The New England Journal of Medicine</a></li> (A collection of articles and other resources on the Coronavirus (Covid-19) outbreak, including clinical reports, management
guidelines, and commentary)
<li><a href="http://www.nhc.gov.cn/xcs/pfzs/list_gzbd.shtml" target="_blank"> National Health Commission of the People's Republic of China </a></li> (Coronavirus(Covid-19) legal knowledge)
</ul>
</p>
</div>
</div>
</div>
</div>
</div>
<!-- <script src="js/main.js"></script> -->
<script>
///////////////////////////////accessary//////////////////////////////////
$(window).ready(function() {
$('.loader').fadeOut("slow");
});
var d3locale = d3.formatDefaultLocale({
"thousands": ",",
"grouping": [3],
});
L.TopoJSON = L.GeoJSON.extend({
addData: function(jsonData) {
if (jsonData.type === 'Topology') {
for (key in jsonData.objects) {
geojson = topojson.feature(jsonData, jsonData.objects[key]);
L.GeoJSON.prototype.addData.call(this, geojson);
}
} else {
L.GeoJSON.prototype.addData.call(this, jsonData);
}
}
});
// Copyright (c) 2013 Ryan Clark
// var createLabelIcon = function(labelClass, labelText) {
// return L.divIcon({
// className: labelClass,
// html: labelText
// })
// }
//
var worldBounds = L.latLngBounds(
L.latLng(-60, -100), //Southwest
L.latLng(80, 15) //Northeast
);
//return the totalConfirmed number of given country
function tc(country) {
if (country == undefined) {
country = 0
} else {
country = +country.split("-")[0];
}
return country;
}
//return the totalRecovered number of given country
function tr(country) {
if (country.split("-")[2] == undefined) {
country = 0
} else {
country = +country.split("-")[2];
}
return country;
}
//return the totalDeath number of given country
function td(country) {
if (country.split("-")[3] == undefined) {
country = 0
} else {
country = +country.split("-")[3];
}
return country;
}
//////////////////////////////////////////////////////////////////////////
//create the base map and set the initial view point
var mymap = L.map('map', {
center: [38, -120],
zoomControl: false,
zoom: 4,
maxZoom: 10,
minZoom: 2,
worldCopyJump: true
}).fitBounds(worldBounds);
// .fitWorld()
new L.Control.Zoom({
position: 'topright'
}).addTo(mymap);
var gray = L.tileLayer('https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}@2x.png');
// var dark = L.tileLayer('https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}@2x.png').addTo(mymap);
var voyager =
L.tileLayer('https://{s}.basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}@2x.png').addTo(mymap);
var satellite =
L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}');
var baseLayers = {
'CARTO Light': gray,
// 'Dark': dark,
'CARTO Voyager': voyager,
'ESRI Satellite': satellite
}
var chart, rchart;
//create colot scale for both region and legend,and insert the "style" into the "head" tag
var colors = chroma.scale('YlOrRd').mode('lch').colors(6);
for (i = 0; i < 6; i++) {
$('head').append($("<style> .region-color-" + (i + 1).toString() + " { color: " + colors[i] + "; font-size: 15px; text-shadow: 0 0 3px #ffffff;} </style>"));
$('head').append($("<style> .legend-color-" + (i + 1).toString() + " { background: " + colors[i] + "; font-size: 15px; text-shadow: 0 0 3px #ffffff;} </style>"));
}
//create communities object that can add community icon to the map through leaflet
//chinese cases
var communities = new L.MarkerClusterGroup({
spiderfyOnMaxZoom: false,
singleMarkerMode: true,
// showCoverageOnHover: false,
// zoomToBoundsOnClick: false,
iconCreateFunction: function(cluster) {
return L.divIcon({
// html: '<i class="fas fa-procedures community community-marker"> <b>' + cluster.getChildCount() + '</b></i>'
html: '<i class="fas fa-procedures community community-marker"> <b>' + cluster.getChildCount() + '</b></i>'
});
}
});
//create cases object that can add community icon to the map through leaflet, the size of the icon is based on the number of cases in that area
// <20 cases return small size icon, >20 & <100 ruturn large size, >100 return 2x size
//for america and canada cases
var cases = new L.MarkerClusterGroup({
spiderfyOnMaxZoom: true,
singleMarkerMode: true,
polygonOptions: {
fillColor: "red",
color: 'red',
weight: 0.5,
opacity: 0.6,
fillOpacity: 0.2
},
showCoverageOnHover: true,
// zoomToBoundsOnClick: false,
iconCreateFunction: function(cluster) {
cnt = cluster.getChildCount()
if (cnt >= 100) {
return L.divIcon({
// html: '<i class="fas fa-users community community-marker"> <b>' + cluster.getChildCount() + '</b></i>'
html: '<i class="fas fa-users community community-marker fa-2x "> <b>' + "" + '</b></i>'
});
} else if (cnt >= 20 && cnt < 100) {
return L.divIcon({
// html: '<i class="fas fa-users community community-marker"> <b>' + cluster.getChildCount() + '</b></i>'
html: '<i class="fas fa-users community community-marker fa-lg "> <b>' + "" + '</b></i>'
});
} else {
return L.divIcon({
// html: '<i class="fas fa-users community community-marker"> <b>' + cluster.getChildCount() + '</b></i>'
html: '<i class="fas fa-users community community-marker fa-sm "> <b>' + "" + '</b></i>'
});
}
}
}).addTo(mymap);
//load all datasets through d3 and store them in an array
Promise.all([
d3.csv('assets/virus.csv'), //datasets[0]
d3.json("assets/all-topo-15.json"), //datasets[1]
//d3.csv('assets/communities.csv'), //chinese cases
d3.csv('assets/timestamp.txt'), //datasets[3]
d3.csv('assets/cases.csv'), //America cases
d3.csv('assets/united-states.txt'), //datasets[5]
d3.csv('assets/canada-city.txt'), //datasets[6]
d3.csv('assets/old-name.csv'), //datasets[7] chinese provinces
d3.csv('assets/cases-canada.csv') //datasets[8]
]).then(function(datasets) {
//read the timestamp in timestamp.txt and add it to map
$("#date").text(datasets[2][0].timestamp.split(".")[0] + " PST");
//read data from communities.csv and add each case on to the map with given information
//cases in china
//datasets[2].forEach(function(d) {
// L.marker([parseFloat(d.lat), parseFloat(d.lng)]).bindPopup(d.name + " (<a target='_blank' href='https://translate.google.com/#view=home&op=translate&sl=zh-CN&tl=en&text=" + d.name + "'>Translate to English</a>)").addTo(
// communities);
//})
//read data from cases.csv and add each case on to the map with given information
//cases in America
datasets[3].forEach(function(d) {
//console.log(d.id)
L.marker([parseFloat(d.lat), parseFloat(d.lng)]).bindPopup("<b>" + d.no + "</b> <p>" + d.note + " identified on " + d.date + ", <a href='https://" + d.reference + "' target='_blank'>" + d.reference + "</a>.</p>").addTo(
cases);
})
//cases in Canada
datasets[7].forEach(function(d) {
//console.log(d.id)
L.marker([parseFloat(d.lat), parseFloat(d.lng)]).bindPopup("<b>" + d.no + "</b> <p>" + d.note + " identified on " + d.date + ", <a href='https://" + d.reference + "' target='_blank'>" + d.reference + "</a>.</p>").addTo(
cases);
})
var latest = datasets[0][datasets[0].length - 1];
//delete latest["datetime"];
//get latest data for every country/city
var top = {},
ustop = {},
cntop = {};
top["china"] = 0;
//this fucntion read the latest data from virus.csv and write the country name and it's latest active confirmed value into dictionary
Object.keys(latest).forEach(function(d) {
value = tc(datasets[0][datasets[0].length - 1][d]) - tr(datasets[0][datasets[0].length - 1][d]) - td(datasets[0][datasets[0].length - 1][d]);
// value = tc(datasets[0][datasets[0].length - 1][d]);
if (datasets[6]["columns"].includes(d)) { //china
// console.log(value);
// console.log(top["china"]);
top["china"] += +value;
cntop[d] = value;
} else if (datasets[5]["columns"].includes(d)) { //canada
;
} else if (datasets[4]["columns"].includes(d)) { //us
ustop[d] = value;
} else if (d != "datetime") { //else
top[d] = value;
}
})
// this function take a dictionary [country:active confirmed case], return a dictionary that sorted by the number of active confired case
function sortJsObject(obj) {
items = Object.keys(obj).map(function(key) {
return [key, obj[key]];
});
items.sort(function(first, second) {
return second[1] - first[1];
});
sorted_obj = {}
$.each(items, function(k, v) {
use_key = v[0]
use_value = v[1]
sorted_obj[use_key] = use_value
})
return (sorted_obj)
}
stop = sortJsObject(top); //sort globally
sustop = sortJsObject(ustop); //sort US states
var places = {};
//this function take a string of country/place name and calculate the data for it
//return place[name] which is a dictonary that has everyday's dataset
function calPlace(name) {
var place = {}
place[name] = {
't': ['t'], //date
'c': ['Aggr. Confirmed'],
's': ['s'],
'r': ['Recovered'],
'd': ['Death'],
'a': ['Active Confirmed']
}
// cf = 0, sp = 0, rc = 0, dd = 0, active = 0;
datasets[0].forEach(function(d) {
var USTd = new Date(d["datetime"]);
place[name].t.push(USTd.setHours(USTd.getHours() + 8)); //convert to American time zone
cf = 0, sp = 0, rc = 0, dd = 0, active = 0;
current = d;
delete current["datetime"];
if (name == "Global Trend") {
Object.values(current).forEach(function(d) {
if (d == undefined) {
d = "0"
};
items = d.split("-");
switch (items.length) {
case 4:
dd += +items[3];
case 3:
rc += +items[2];
case 2:
sp += +items[1];
case 1:
cf += +items[0];
break;
};
active = cf - dd - rc;
});
cf -= (tc(current["alabama"]) + tc(current["alaska"]) + tc(current["arizona"]) + tc(current["arkansas"]) + tc(current["california"]) + tc(current["colorado"]) + tc(current["connecticut"]) + tc(current["delaware"]) + tc(current[
"florida"]) + tc(current["georgia usa"]) + tc(current["hawaii"]) + tc(current["idaho"]) + tc(current["illinois"]) + tc(current["indiana"]) + tc(current["iowa"]) + tc(current["kansas"]) + tc(current["kentucky"]) + tc(current[
"louisiana"]) + tc(current["maine"]) + tc(current["maryland"]) + tc(current["massachusetts"]) + tc(current["michigan"]) + tc(current["minnesota"]) + tc(current["mississippi"]) + tc(current["missouri"]) + tc(current[
"montana"]) + tc(
current["nebraska"]) + tc(current["nevada"]) + tc(current["new hampshire"]) + tc(current["new jersey"]) + tc(current["new mexico"]) + tc(current["new york"]) + tc(current["north carolina"]) + tc(current["north dakota"]) +
tc(current[
"ohio"]) + tc(current["oklahoma"]) + tc(current["oregon"]) + tc(current["pennsylvania"]) + tc(current["rhode island"]) + tc(current["south carolina"]) + tc(current["south dakota"]) + tc(current["tennessee"]) + tc(current[
"texas"]) +
tc(current["utah"]) + tc(current["vermont"]) + tc(current["virginia"]) + tc(current["washington"]) + tc(current["west virginia"]) + tc(current["canada"]));
rc -= (tr(current["alabama"]) + tr(current["alaska"]) + tr(current["arizona"]) + tr(current["arkansas"]) + tr(current["california"]) + tr(current["colorado"]) + tr(current["connecticut"]) + tr(current["delaware"]) + tr(current[
"florida"]) + tr(current["georgia usa"]) + tr(current["hawaii"]) + tr(current["idaho"]) + tr(current["illinois"]) + tr(current["indiana"]) + tr(current["iowa"]) + tr(current["kansas"]) + tr(current["kentucky"]) + tr(current[
"louisiana"]) + tr(current["maine"]) + tr(current["maryland"]) + tr(current["massachusetts"]) + tr(current["michigan"]) + tr(current["minnesota"]) + tr(current["mississippi"]) + tr(current["missouri"]) + tr(current[
"montana"]) + tc(
current["nebraska"]) + tr(current["nevada"]) + tr(current["new hampshire"]) + tr(current["new jersey"]) + tr(current["new mexico"]) + tr(current["new york"]) + tr(current["north carolina"]) + tr(current["north dakota"]) +
tr(current[
"ohio"]) + tr(current["oklahoma"]) + tr(current["oregon"]) + tr(current["pennsylvania"]) + tr(current["rhode island"]) + tr(current["south carolina"]) + tr(current["south dakota"]) + tr(current["tennessee"]) + tr(current[
"texas"]) +
tr(current["utah"]) + tr(current["vermont"]) + tr(current["virginia"]) + tr(current["washington"]) + tr(current["west virginia"]) + tr(current["canada"]));
dd -= (td(current["alabama"]) + td(current["alaska"]) + td(current["arizona"]) + td(current["arkansas"]) + td(current["california"]) + td(current["colorado"]) + td(current["connecticut"]) + td(current["delaware"]) + td(current[
"florida"]) + td(current["georgia usa"]) + td(current["hawaii"]) + td(current["idaho"]) + td(current["illinois"]) + td(current["indiana"]) + td(current["iowa"]) + td(current["kansas"]) + td(current["kentucky"]) + td(current[
"louisiana"]) + td(current["maine"]) + td(current["maryland"]) + td(current["massachusetts"]) + td(current["michigan"]) + td(current["minnesota"]) + td(current["mississippi"]) + td(current["missouri"]) + td(current[
"montana"]) + tc(
current["nebraska"]) + td(current["nevada"]) + td(current["new hampshire"]) + td(current["new jersey"]) + td(current["new mexico"]) + td(current["new york"]) + td(current["north carolina"]) + td(current["north dakota"]) +
td(current[
"ohio"]) + td(current["oklahoma"]) + td(current["oregon"]) + td(current["pennsylvania"]) + td(current["rhode island"]) + td(current["south carolina"]) + td(current["south dakota"]) + td(current["tennessee"]) + td(current[
"texas"]) +
td(current["utah"]) + td(current["vermont"]) + td(current["virginia"]) + td(current["washington"]) + td(current["west virginia"]) + td(current["canada"]));
} else if (name == "china") {
for (const [key, value] of Object.entries(current)) {
if (datasets[6]["columns"].includes(key)) {
if (value == undefined) {
value = "0"
};
items = value.split("-");
switch (items.length) {
case 4:
dd += +items[3];
case 3:
rc += +items[2];
case 2:
sp += +items[1];
case 1:
cf += +items[0];
break;
};
active = cf - dd - rc;
}
}
} else {
d = current[name];
if (d == undefined) {
d = "0"
};
items = d.split("-");
switch (items.length) {
case 4:
dd += +items[3];
case 3:
rc += +items[2];
case 2:
sp += +items[1];
case 1:
cf += +items[0];
break;
};
active = cf - dd - rc;
}
active = cf - dd - rc;
place[name].c.push(cf);
//place[name].s.push(sp);
place[name].r.push(rc);
place[name].d.push(dd);
place[name].a.push(active);
});
return place[name];
}
//this function take a place name and diaplay the data to the info panel
function showPlace(name) {
len = places[name].t.length;
$(".confirmed-count").text(places[name].c[len - 1].toLocaleString());
$(".recovered-count").text(places[name].r[len - 1].toLocaleString());
$(".death-count").text(places[name].d[len - 1].toLocaleString());
$(".active-count").text(places[name].a[len - 1].toLocaleString());
nc = places[name].c[len - 1] - places[name].c[len - 2]; //new aggregate confirmed cases of the day
nr = places[name].r[len - 1] - places[name].r[len - 2]; //new recovered confirmed cases of the day
nd = places[name].d[len - 1] - places[name].d[len - 2]; //new death of the day
na = places[name].a[len - 1] - places[name].a[len - 2]; //new active cases of the days
if (nc > 0) {
$(".confirmed-new-count").text("+" + nc.toLocaleString());
} else if (nc == 0) {
$(".confirmed-new-count").text("");
} else {
$(".confirmed-new-count").text(nc.toLocaleString());
}
if (nr > 0) {
$(".recovered-new-count").text("+" + nr.toLocaleString());
} else if (nr == 0) {
$(".recovered-new-count").text("")
} else {
$(".recovered-new-count").text(nr.toLocaleString());
}
if (nd > 0) {
$(".death-new-count").text("+" + nd.toLocaleString());
} else if (nd == 0) {
$(".death-new-count").text("")
} else {
$(".death-new-count").text(nd.toLocaleString());
}
if (na > 0) { //only display info icon when there's change
document.getElementById("counticon").style.display = "initial";
$(".active-new-count").text("+" + na.toLocaleString());
} else if (na < 0) {
document.getElementById("counticon").style.display = "initial";
$(".active-new-count").text("" + na.toLocaleString());
} else if (na == 0) {
document.getElementById("counticon").style.display = "none";
$(".active-new-count").text("")
} else {
document.getElementById("counticon").style.display = "none";
$(".active-new-count").text(na.toLocaleString());
}
//add ",CHINA" to every provinces in China
if (datasets[6]["columns"].includes(name)) { //add ",CHINA" to every provinces in China
$("#placename").text(name.toUpperCase() + ", CHINA");
if (name == "taiwan") {
$("#placename").text("Taiwan");
}
if (name == "hongkong") {
$("#placename").text("Hong Kong");
}
if (name == "macau") {
$("#placename").text("Macau");
}
} else {
$("#placename").text(name.toUpperCase());
}
//add reference source for each place
if (datasets[4]["columns"].includes(name)) {
$("#source-website").html( //Unisted states
'<a target="_blank" href="https://www.who.int/emergencies/diseases/novel-coronavirus-2019/situation-reports/"> WHO</a>, <a target="_blank" href="https://www.cdc.gov/coronavirus/2019-ncov/cases-updates/cases-in-us.html?CDC_AA_refVal=https%3A%2F%2Fwww.cdc.gov%2Fcoronavirus%2F2019-ncov%2Fcases-in-us.html">CDC</a> and <a target="_blank" href="https://www.nbcnews.com/health/health-news/coronavirus-u-s-map-where-virus-has-been-confirmed-across-n1124546">NBC News</a>.'
);
} else if (datasets[5]["columns"].includes(name)) { //Canada
$("#source-website").html('<a target="_blank" href="https://www.canada.ca/en/public-health/services/diseases/2019-novel-coronavirus-infection.html">Public Health Agency of Canada.</a>');
} else if (datasets[6]["columns"].includes(name)) { //China
$("#source-website").html(
'<a target="_blank" href="https://www.who.int/emergencies/diseases/novel-coronavirus-2019/situation-reports/"> WHO</a>, <a target="_blank" href="http://www.nhc.gov.cn/xcs/xxgzbd/gzbd_index.shtml">China CDC</a>, and <a target="_blank" href="https://voice.baidu.com/act/newpneumonia/newpneumonia">Baidu</a>.'
);
} else if (name == "Global Trend") { //global
$("#source-website").html(
'<a target="_blank" href="https://www.who.int/emergencies/diseases/novel-coronavirus-2019/situation-reports/"> WHO</a>, <a target="_blank" href="https://www.nbcnews.com/health/health-news/coronavirus-u-s-map-where-virus-has-been-confirmed-across-n1124546">NBC News</a>, <a target="_blank" href="https://www.cdc.gov/coronavirus/2019-ncov/cases-updates/cases-in-us.html?CDC_AA_refVal=https%3A%2F%2Fwww.cdc.gov%2Fcoronavirus%2F2019-ncov%2Fcases-in-us.html">CDC</a>, <a target="_blank" href="https://voice.baidu.com/act/newpneumonia/newpneumonia">Baidu</a>, <a target="_blank" href="https://en.wikipedia.org/wiki/2019%E2%80%9320_coronavirus_pandemic">Wikipedia</a>, and etc.'
);
} else if (name == "japan") { //japan
$("#source-website").html(
'<a target="_blank" href="https://www.who.int/emergencies/diseases/novel-coronavirus-2019/situation-reports/"> WHO</a>, <a target="_blank" href="https://en.wikipedia.org/wiki/2019%E2%80%9320_coronavirus_pandemic">Wikipedia</a>, and <a target="_blank" href="https://voice.baidu.com/act/newpneumonia/newpneumonia">Baidu</a>. The discrepancy on the data in Japan between March 11th and March 12th comes from the disagreement of whether to include cases from the Princess Diamond cruise.'
);
} else { //Other countries
$("#source-website").html(
'<a target="_blank" href="https://www.who.int/emergencies/diseases/novel-coronavirus-2019/situation-reports/"> WHO</a>, <a target="_blank" href="https://en.wikipedia.org/wiki/2019%E2%80%9320_coronavirus_pandemic">Wikipedia</a>, and <a target="_blank" href="https://voice.baidu.com/act/newpneumonia/newpneumonia">Baidu</a>.'
);
}
}
//this funciton take a place name and check the status of that place, then fill the background based on its status
//grey slash for non-case country, zero aggregate confirmed case
//green slash for country that had cases before but now has zero active confirmed case
//other countries remain blank background
function setFill(enname) {
var pop = datasets[0][datasets[0].length - 1][enname];
if (pop == "" || pop == undefined || pop.toString().split("-")[0] == "0") {
return 'url(img/texture-s.png)';
} else {
pop = +pop.toString().split("-")[0] - +pop.toString().split("-")[2] - +pop.toString().split("-")[3];
// return "#00000000";
}
if (pop == 0) {
return 'url(img/texture-sg.png)';
// return 'url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHdpZHRoPScxMCcgaGVpZ2h0PScxMCc+CiAgPHJlY3Qgd2lkdGg9JzEwJyBoZWlnaHQ9JzEwJyBmaWxsPSd3aGl0ZScgLz4KICA8cmVjdCB4PScwJyB5PScwJyB3aWR0aD0nMScgaGVpZ2h0PScxJyBmaWxsPSdibGFjaycgLz4KPC9zdmc+")';
} else {
return 'url()';
}
}
//this function take a place name, return a color that fills the place area on the maps
//the color is based on the number of active confirmed case
function setColor(enname) {
var id = 0;