-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.njk
831 lines (806 loc) · 62.5 KB
/
index.njk
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
---
title: "COVID-19 Status"
layout: layouts/home.njk
---
<header>
<h1 class="home">
<a href="{{ '/' | url }}">{{ title or metadata.title }}</a><a href="#vaccinations"> 💉 </a><a href="#infections"> 🦠 </a>
</h1>
<span class="links">
<a href="https://github.com/colinbendell/covid19.ca/" title="Github Source">
<img src="img/github.svg" width="64" height="64" alt="">
</a>
<a href="/data.json" title="{raw} source data"><img src="img/analytics.svg" width="64" height="64" alt=""></a>
</span>
</header>
<main{% if templateClass %} class="{{ templateClass }}"{% endif %}>
{% macro cssSort(name='#sort-half', descOrder = true, section="#vaccinations", sortProperty='today.first_vaccination_per_5plus') %}
{% set css %}
{% set index = 1 %}
{%- for province in canada | sort(descOrder, false, sortProperty) %}
{{ name }}:checked ~ {{ section }} .province.{{ province.iso3166 | lower }} { order: {{ index }}; }
{% set subindex = 1 %}
{%- for region in province.regions | sort(true, false, sortProperty) %}
{{ name }}:checked ~ {{ section }} .healthregion.{{ (region.short or region.name) | handle }} { order: {{ subindex }}; }
{% set subindex = subindex + 1 %}
{%- endfor %}
{% set index = index + 1 %}
{%- endfor %}
{% endset %}
{{ css | cssmin | safe }}
{% endmacro %}
<style>{{ cssSort('#sort-vacc-name-pop', true, 'details', 'population')}}</style>
{#<style>{{ cssSort('#sort-vacc-name', false, 'details', 'name')}}</style>#}
<style>{{ cssSort('#sort-vacc-trend', true, 'details', 'lastWeekExclusive.change_vaccinations_avg') }}</style>
<style>{{ cssSort('#sort-vacc-pop', true, 'details', 'today.sort_change_vaccinations_per_1k')}}</style>
<style>{{ cssSort('#sort-vacc-today', true, 'details', 'today.sort_change_vaccinations')}}</style>
<style>{{ cssSort('#sort-complete', false, 'details', 'today.days_to_complete_first_vaccination')}}</style>
{#<style>{{ cssSort('#sort-vacc-total', true, 'details', 'today.total_vaccinations')}}</style>#}
<style>{{ cssSort('#sort-half', true, 'details', 'today.first_vaccination_per_5plus')}}</style>
<style>{{ cssSort('#sort-full', true, 'details', 'today.vaccinated_per_5plus')}}</style>
<style>{{ cssSort('#sort-full-pop', true, 'details', 'today.vaccinated_per_person')}}</style>
<style>{{ cssSort('#sort-freezer-trend', true, 'details', 'lastWeekExclusive.available_doses_avg')}}</style>
<style>{{ cssSort('#sort-freezer-today', true, 'details', 'today.available_doses')}}</style>
<style>{{ cssSort('#sort-freezer-population', true, 'details', 'today.available_doses_per_5plus')}}</style>
<style>{{ cssSort('#sort-time-to-arm', false, 'details', 'lastWeekInclusive.available_doses_days')}}</style>
<style>{{ cssSort('#sort-infect-name-pop', true, 'details', 'population')}}</style>
<style>{{ cssSort('#sort-hospital-trend', true, 'details', 'lastWeekExclusive.total_hospitalizations_sum')}}</style>
<style>{{ cssSort('#sort-hospital', true, 'details', 'today.hospitalizations_per_1000k')}}</style>
<style>{{ cssSort('#sort-icu-trend', true, 'details', 'lastWeekExclusive.total_criticals_sum')}}</style>
<style>{{ cssSort('#sort-icu', true, 'details', 'today.criticals_per_1000k')}}</style>
<style>{{ cssSort('#sort-deaths-trend', true, 'details', 'lastWeekExclusive.change_fatalities_sum')}}</style>
<style>{{ cssSort('#sort-deaths', true, 'details', 'today.fatalities_per_100k')}}</style>
<style>{{ cssSort('#sort-deaths-year', true, 'details', 'lastYear.change_fatalities_per_100k')}}</style>
<style>{{ cssSort('#sort-infect-cost-pop', true, 'details', 'population')}}</style>
<style>{{ cssSort('#sort-cost-pop', true, 'details', 'sinceJuly.total_cost_hospitalization_per_person_sum')}}</style>
<style>{{ cssSort('#sort-cost-history', true, 'details', 'today.total_cost_hospitalization')}}</style>
<style>{{ cssSort('#sort-cost-hospitalization', true, 'details', 'sinceJuly.total_cost_hospitalization_sum')}}</style>
<style>{{ cssSort('#sort-cost-income', true, 'details', 'today.cost_income_sum')}}</style>
<style>{{ cssSort('#sort-cost-total', true, 'details', 'sinceJuly.total_cost_hospitalization_sum')}}</style>
{#{% macro cssFilter(name='#sort-half', descOrder = true, section="#vaccinations", sortProperty='today.first_vaccination_per_12plus') %}#}
{# {% set css %}#}
{# {% set index = 1 %}#}
{# {%- for province in canada | sort(descOrder, false, sortProperty) %}#}
{# {{ name }}[value="{{ province.name }}"] ~ {{ section }} .province:not(.{{ province.iso3166 | lower }}) { visibility: hidden }#}
{#{% set subindex = 1 %}#}
{# {%- for region in province.regions | sort(true, false, sortProperty) %}#}
{# {{ name }}:checked ~ {{ section }} .healthregion.{{ (region.short or region.name) | handle }} { order: {{ subindex }}; }#}
{#{% set subindex = subindex + 1 %}#}
{# {%- endfor %}#}
{# {% set index = index + 1 %}#}
{# {%- endfor %}#}
{# {% endset %}#}
{# {{ css | cssmin | safe }}#}
{#{% endmacro %}#}
{#<style>{{ cssFilter('#vaccine-search', true, 'details', 'today.total_fatalities_per_person')}}</style>#}
<svg xmlns="http://www.w3.org/2000/svg" style="display: none" aria-hidden="true">
<g id="in-progress" viewBox="0 0 512 512">
<path fill="currentColor" d="M497 273L329 441c-15 15-41 4.5-41-17v-96H152c-13.3 0-24-10.7-24-24v-96c0-13.3 10.7-24 24-24h136V88c0-21.4 25.9-32 41-17l168 168c9.3 9.4 9.3 24.6 0 34zM192 436v-40c0-6.6-5.4-12-12-12H96c-17.7 0-32-14.3-32-32V160c0-17.7 14.3-32 32-32h84c6.6 0 12-5.4 12-12V76c0-6.6-5.4-12-12-12H96c-53 0-96 43-96 96v192c0 53 43 96 96 96h84c6.6 0 12-5.4 12-12z"/>
</g>
<g id="no-report-expected-today" viewBox="0 0 512 512">
<path fill="currentColor" d="M553.5 231.8c8.7 14.9 8.7 33.4 0 48.4l-112 192c-8.6 14.7-24.4 23.8-41.5 23.8H176c-17.1 0-32.9-9.1-41.5-23.8l-112-192c-8.7-14.9-8.7-33.4 0-48.4l112-192C143.1 25.1 158.9 16 176 16h224c17.1 0 32.9 9.1 41.5 23.8l112 192zM420 296c6.6 0 12-5.4 12-12v-56c0-6.6-5.4-12-12-12H156c-6.6 0-12 5.4-12 12v56c0 6.6 5.4 12 12 12h264z"/>
</g>
<g id="reported" viewBox="0 0 512 512">
<path fill="currentColor" d="M504 256c0 136.967-111.033 248-248 248S8 392.967 8 256 119.033 8 256 8s248 111.033 248 248zM227.314 387.314l184-184c6.248-6.248 6.248-16.379 0-22.627l-22.627-22.627c-6.248-6.249-16.379-6.249-22.628 0L216 308.118l-70.059-70.059c-6.248-6.248-16.379-6.248-22.628 0l-22.627 22.627c-6.248 6.248-6.248 16.379 0 22.627l104 104c6.249 6.249 16.379 6.249 22.628.001z"/>
</g>
<g id="waiting-for-report" viewBox="0 0 512 512">
<path fill="currentColor" d="M256,8C119,8,8,119,8,256S119,504,256,504,504,393,504,256,393,8,256,8Zm92.49,313h0l-20,25a16,16,0,0,1-22.49,2.5h0l-67-49.72a40,40,0,0,1-15-31.23V112a16,16,0,0,1,16-16h32a16,16,0,0,1,16,16V256l58,42.5A16,16,0,0,1,348.49,321Z"/>
</g>
</svg>
<section id="main">
{%- for country in canada | filterProp("name", "eq", "Canada") %}
{% set vaccinePopulation = country.population %}
<div class="summary">
<p>
As of <span data-time="{{ country.updated_at }}" class="date">{{ country.updated_at | readableTime }} PT {{ country.updated_at | readableDate | lower}}</span>,
over <strong><span class="number" title="{{ country.total.total_cases | format }}"><a href="#infections">{{ country.total.total_cases | formatNumber(false, 0) }}</a></span> Canadians have tested positive</strong> for COVID-19.
{# or <span class="number ratio"><a href="#infections">{{ (((country.today.total_cases / country.population * 100 * 10) | round) / 10 )| format }} %</a></span> of the population.#}
Sadly, <strong><span class="number" title="{{ country.today.total_fatalities | format }}"><a href="#infections">{{ country.today.total_fatalities | formatNumber(false, 0) }}</a></span> have died</strong>.
</p>
<p>
In the last day, <strong><span class="number" title="{{ (country.today.change_cases or country.yesterday.change_cases) | format }}"><a href="#vaccinations">{{ (country.today.change_cases or country.yesterday.change_cases) | formatNumber(false, 0) }}</a></span> new infections</strong>
were reported and <strong><span class="number"><a href="#vaccinations">{{ country.today.change_fatalities or country.yesterday.change_fatalities }}</a></span> deaths</strong>.
Currently <strong><span class="number">{{ country.today.total_hospitalizations | format}}</span></strong> are in the hospital and <strong><span class="number">{{ country.today.total_criticals | format }}</span></strong> are in the ICU.
This is trending <strong><span class="editorial {{ "negative" if country.today.change_cases_rate > 0 else "positive" }}">{{ "downwards" if country.today.change_cases_rate < 0 else "upwards" }}</span></strong>.
</p>
<p>
Fortunately, <strong><span class="number" title="{{ country.today.total_vaccinations | format }}"><a href="#vaccinations">{{ country.today.total_vaccinations | formatNumber(false, 0) }}</a></span> doses</strong> of the vaccine have been administered.
For those 5 years and older, <span class="number"><a href="#vaccinations">{{ country.today.first_vaccination_per_5plus | round(1) }}%</a></span> have their 1st shot
and <span class="number"><a href="#vaccinations">{{ country.today.vaccinated_per_5plus | round(1) }}%</a></span> are fully vaccinated!
</p>
<p>
Vaccination is <span class="editorial {{ "positive" if country.lastWeekInclusive.change_change_vaccinations_avg > 0 else "negative" }}">{{ "speeding up" if country.lastWeekInclusive.change_change_vaccinations_avg > 0 else "slowing down" }}</span>,
but there are <strong><span class="number" title="{{ country.today.available_doses | format }}"><a href="#vaccinations">{{ country.today.available_doses | formatNumber(false, 0) }}</a></span> doses in the freezer</strong>.
It currently takes ~<strong><span class="number"><a href="#vaccinations">{{ (country.lastWeekExclusive.available_doses_sum / country.lastWeekExclusive.change_vaccinations_sum + 0.5) | round | format }}</a></span> days</strong>
for new deliveries to get into arms.
</p>
<p>
At the current rate, Canadians should achieve herd immunity around <span class="number"><a href="#vaccinations">{{ country.today.complete_vaccinated_date | readableDate }}</a></span> when 80% of the entire population is fully vaccinated.
There is no approved vaccine for children under 5.
</p>
</div>
{%- for province in canada | sort(false, false, "sort_name")%}
<ul id="{{ province.code }}" class="stats flex nowrap hover-parent">
<li class="grid alignstart">
{% set vaccinePopulation = province.population %}
{% set thirdDosePerPopulation = (province.today.total_boosters_1 / vaccinePopulation * 100) | round %}
{% set secondDosePerPopulation = (province.today.total_vaccinated / vaccinePopulation * 100) | round %}
{% set firstDosePerPopulation = (province.today.total_first_vaccination / vaccinePopulation * 100) | round %}
{% set adultPopulation = ((province.population5plus / vaccinePopulation) * 100) | round %}
{% set potentialDosePerPopulation = (province.today.available_doses / vaccinePopulation * 100) | round %}
{% set potentialfirstDosePerPopulation = (firstDosePerPopulation + potentialDosePerPopulation) | min(adultPopulation)%}
{% set potentialSecondDoesPerPopulation = (secondDosePerPopulation + (potentialDosePerPopulation - (potentialfirstDosePerPopulation - firstDosePerPopulation))) | min(adultPopulation)%}
{% set potentialThirdDoesPerPopulation = (secondDosePerPopulation + (potentialDosePerPopulation - (potentialfirstDosePerPopulation - firstDosePerPopulation))) | min(adultPopulation)%}
<div style="--repeat-y: 5; --repeat-x:20; --repeat-color: rgba(0,0,0,0);" class="grid onexone ratiostats">
<div style="--repeat-y: 5; --repeat-x:{{ 20 }}; --repeat-color: #E2E3E5;" class="onexone ratiostats child"></div>
<div style="--repeat-y: 5; --repeat-x:{{ (adultPopulation / 5) | int }}; --repeat-color: #E2E3E5;" class="onexone ratiostats"></div>
<div style="--repeat-y: {{ adultPopulation % 5 }}; --repeat-x:{{ ((adultPopulation / 5) + 0.5) | round }}; --repeat-color: #E2E3E5;" class="onexone ratiostats"></div>
<div style="--repeat-y: 5; --repeat-x:{{ (firstDosePerPopulation / 5) | int}}; --repeat-color: repeating-linear-gradient(135deg, var(--light) 0 1.5px, var(--gray-dark) 2px 3px);" class="onexone ratiostats"></div>
<div style="--repeat-y: {{ firstDosePerPopulation % 5 }}; --repeat-x:{{ ((firstDosePerPopulation / 5) + 0.5) | round}}; --repeat-color: repeating-linear-gradient(135deg, var(--light) 0 1.5px, var(--gray-dark) 2px 3px);" class="onexone ratiostats"></div>
<div style="--repeat-y: 5; --repeat-x:{{ (secondDosePerPopulation / 5) | int }}; --repeat-color: repeating-linear-gradient(135deg, var(--blue) 0 2px, var(--light) 2px 3px);" class="onexone ratiostats"></div>
<div style="--repeat-y: {{ secondDosePerPopulation % 5 }}; --repeat-x:{{ ((secondDosePerPopulation / 5) + 0.5) | round}}; --repeat-color: repeating-linear-gradient(135deg, var(--blue) 0 2px, var(--light) 2px 3px);" class="onexone ratiostats"></div>
<div style="--repeat-y: 5; --repeat-x:{{ (thirdDosePerPopulation / 5) | int }}; --repeat-color: var(--blue);" class="onexone ratiostats"></div>
<div style="--repeat-y: {{ thirdDosePerPopulation % 5 }}; --repeat-x:{{ ((thirdDosePerPopulation / 5) + 0.5) | round}}; --repeat-color: var(--blue);" class="onexone ratiostats"></div>
</div>
<div style="width:85%; border-right: 2px dashed var(--green); margin-bottom: -0.3rem; margin-top: -0.3rem; " class="onexone"></div>
<div style="max-width:20rem;line-height: 1; padding-top: 0.25rem; white-space: nowrap;"><strong style="color: #000;">{{ firstDosePerPopulation }} in 100</strong> have at least one vaccine dose,
<br/><strong style="color: var(--blue);">{{ (secondDosePerPopulation) }} in 100</strong> are fully vaccinated.
<br/><strong style="color: var(--blue);">{{ thirdDosePerPopulation }} in 100</strong> have been boosted.
</div>
<div style="max-width:20rem;line-height: 1; padding-top: 0.25rem;">
Herd immunity is estimated at ~<strong style="color: var(--green);">85%</strong>
</div>
</li>
<li>
<table cellpadding="0" cellspacing="0">
{% set total = province.vaccineByAge.total %}
{% for data in province.vaccineByAge.ages %}
{% set waffleWidth = 15 %}
{% set vaccinePopulation = province[data.key]/100 * province.population | round %}
{% set thirdDosePerPopulation = ((data.third / total.first * province.today.total_first_vaccination ) / vaccinePopulation * (province[data.key]/100) * 100) | round %}
{% set secondDosePerPopulation = ((data.second / total.second * province.today.total_vaccinated ) / vaccinePopulation * (province[data.key]/100) * 100) | round %}
{% set firstDosePerPopulation = ((data.first / total.first * province.today.total_first_vaccination ) / vaccinePopulation * (province[data.key]/100) * 100) | round %}
<tr>
<td>
{{data.key}}
</td>
<td>
<div style="--repeat-y: {{ (province[data.key] / waffleWidth) | round | max(1) }}; --repeat-x:{{ province[data.key] | min(waffleWidth) | round}}" class="ratiostats {{ "child" if data.key === "0-4"}}">
<div style="position: absolute; --repeat-y: {{ ( firstDosePerPopulation / waffleWidth) | int }}; --repeat-x:{{ waffleWidth }}; --repeat-color: repeating-linear-gradient(135deg, var(--light) 0 1.5px, var(--gray-dark) 2px 3px);" class="ratiostats"></div>
<div style="position: absolute; --repeat-y: {{ ( firstDosePerPopulation / waffleWidth + 0.5) | round }}; --repeat-x:{{ (firstDosePerPopulation % waffleWidth) | round}}; --repeat-color: repeating-linear-gradient(135deg, var(--light) 0 1.5px, var(--gray-dark) 2px 3px);" class="ratiostats"></div>
<div style="position: absolute; --repeat-y: {{ (secondDosePerPopulation / waffleWidth) | int }}; --repeat-x:{{ waffleWidth }}; --repeat-color: repeating-linear-gradient(135deg, var(--blue) 0 2px, var(--light) 2px 3px);" class="ratiostats"></div>
<div style="position: absolute; --repeat-y: {{ ( secondDosePerPopulation / waffleWidth + 0.5) | round }}; --repeat-x:{{ (secondDosePerPopulation % waffleWidth) | round }}; --repeat-color: repeating-linear-gradient(135deg, var(--blue) 0 2px, var(--light) 2px 3px);" class="ratiostats"></div>
<div style="position: absolute; --repeat-y: {{ (thirdDosePerPopulation / waffleWidth) | int }}; --repeat-x:{{ waffleWidth }}; --repeat-color: var(--blue);" class="ratiostats"></div>
<div style="position: absolute; --repeat-y: {{ ( thirdDosePerPopulation / waffleWidth + 0.5) | round }}; --repeat-x:{{ (thirdDosePerPopulation % waffleWidth) | round }}; --repeat-color: var(--blue);" class="ratiostats"></div>
</div>
</td>
</tr>
{% endfor %}
</table>
<div style="max-width:20rem;line-height: 1; padding-top: 0.25rem; white-space: nowrap;"><strong>{{ province.name }}</strong> <em>(age data projected {{ country.vaccineByAge.date.replace('2021-06-', 'June ') }})</em>
<br>
<span class="reveal-on-hover">
{%- for province in canada | sort(false, false, "sort_name")%}
<a class="small-detail switch-province" href="#{{ province.code }}">{{ province.code }}</a>
{% endfor %}
</span>
</div>
</li>
</ul>
{% endfor %}
{%- endfor %}
</section>
<input id="dummy" type="checkbox" style="display: none;">
<section id="vaccinations">
{# <label for="population40plus">40+</label> <label for="population18plus">18+</label> <label for="population12plus">12+</label> <label for="population2plus">2+</label> <label for="population">All</label>#}
{# <label for="population12plus">12+</label> <label for="population">All</label>#}
<h2><a href="#vaccinations">Vaccine Status</a></h2>
{# <input id="population40plus" name="vaccine-pop" type="radio" style="display: none;">#}
{# <input id="population18plus" name="vaccine-pop" type="radio" style="display: none;">#}
{# <input id="population12plus" name="vaccine-pop" type="radio" style="display: none;" checked>#}
{# <input id="population2plus" name="vaccine-pop" type="radio" style="display: none;">#}
{# <input id="population" name="vaccine-pop" type="radio" style="display: none;">#}
<input id="sort-vacc-name-pop" name="vaccine-sort" type="radio" style="display: none;">
<input id="sort-vacc-name" name="vaccine-sort" type="radio" style="display: none;">
<input id="sort-vacc-trend" name="vaccine-sort" type="radio" style="display: none;">
<input id="sort-vacc-pop" name="vaccine-sort" type="radio" style="display: none;">
<input id="sort-vacc-today" name="vaccine-sort" type="radio" style="display: none;" checked>
<input id="sort-complete" name="vaccine-sort" type="radio" style="display: none;">
{# <input id="sort-vacc-total" name="vaccine-sort" type="radio"style="display: none;">#}
<input id="sort-half" name="vaccine-sort" type="radio" style="display: none;">
<input id="sort-full" name="vaccine-sort" type="radio" style="display: none;">
<input id="sort-full-pop" name="vaccine-sort" type="radio" style="display: none;">
<input id="sort-freezer-trend" name="vaccine-sort" type="radio" style="display: none;">
<input id="sort-freezer-today" name="vaccine-sort" type="radio" style="display: none;">
<input id="sort-freezer-population" name="vaccine-sort" type="radio" style="display: none;">
<input id="sort-time-to-arm" name="vaccine-sort" type="radio" style="display: none;">
<div class="flex tr thead">
<div class="th toggle"><label class="sort" style="height:2.6rem;" for="sort-vacc-name-pop"></label></div>
<div class="th name"><label class="sort" style="height:2.6rem;" for="sort-vacc-name"></label></div>
<div class="th history"><label class="sort" for="sort-vacc-trend">Doses In Arms<br/>Last 15 weeks</label></div>
<div class="th"><label class="sort" for="sort-vacc-pop">Doses In Arms<br/>7day avg/₁₀₀₀</label></div>
<div class="th"><label class="sort" for="sort-vacc-today">Doses In Arms<br/>Today</label></div>
{# <div class="th complete"><label class="sort" for="sort-complete">Projected<br/>Completion</label></div>#}
{# <div class="th total"><label class="sort" for="sort-vacc-total">Total<br/>Doses</label></div>#}
<div class="th"><label class="sort" for="sort-half">1st Dose /<br/>Eligible (5+)</label></div>
<div class="th"><label class="sort" for="sort-full">Fully Vacc. /<br/>Eligible (5+)</label></div>
<div class="th complete"><label class="sort" for="sort-full-pop">Total<br/>Population</label></div>
<div class="th history"><label class="sort" for="sort-freezer-trend">In Freezers<br/>Last 15 weeks</label></div>
<div class="th today"><label class="sort" for="sort-freezer-today">In Freezers<br/>Today</label></div>
<div class="th"><label class="sort" for="sort-freezer-population">In Freezers /<br/>Population</label></div>
<div class="th"><label class="sort" for="sort-time-to-arm">Time to Arm<br/>from Delivery</label></div>
</div>
{% macro vaccineRow(data, type='province') %}
{% if data.today.total_vaccinations > 0 %}
{% set vaccinePopulation = data.population %}
<div class="flex tr vaccine {{ type }} {{ (data.iso3166 or data.short or data.name or data.province) | handle }} {{ data.today.date | readableDate | lower }}"
title="Total: {{ data.today.total_vaccinations | d(0) | format }} ({{ data.today.date | readableDate }}: {{ data.today.change_vaccinations | format}}, {{ data.yesterday.date | readableDate }}: {{ data.yesterday.change_vaccinations | format }}) Population: {{ data.population | format }}">
<div class="td toggle"></div>
<div class="td name" title="{{ data.data_status }} @ {{ data.updated_at | readableTime }} PT {{ data.updated_at | readableDate | lower}}">
{% if type === 'province' or type === 'country' %}
<label class="label-toggle">
<span class="name long" data-short="{{ data.iso3166 or data.name.en }}">{{ data.name.en or data.name }}</span>
<span class="name short">{{ data.iso3166 or data.name.en }}</span>
<svg viewBox="0 0 512 512" class="province-update-status"><use href="#{{ data.data_status | handle }}"></use></svg>
</label>
{% else %}
{# <span class="name long">{{ data.name.en or data.name }}</span>#}
<label for="dummy" class="label-toggle">
<span class="name">{{ data.iso3166 or data.short or data.name.en or data.name }}</span>
</label>
{% endif %}
<div class="small-detail reveal-on-hover">{{ data.population | formatNumber(false, 0) }} </div>
</div>
<div class="td dose history">
<div>
<table class="charts-css column" style="--size: {{ (data.lastWeekExclusive.change_vaccinations_avg / data.today.change_vaccinations_max) | format }}" data-trendline="{{ data.lastWeekInclusive.change_vaccinations_avg |formatNumber }} /day">
<tbody>
<tr>
{%- for week in data.previousWeeks | head(-18) | head(14)%}
<td class="blue20alpha" style="--size:{{ (week.change_vaccinations_avg / data.today.change_vaccinations_max) | max(0.03) | format}};"><span class="tooltip">Week of {{ week.start | readableDate }}<br/>Avg: {{ week.change_vaccinations_avg | formatNumber }}/day<br/>Total: {{ week.change_vaccinations_sum | d(0) | formatNumber }}</span></td>
{%- endfor %}
{%- for week in data.previousWeeks | head(-4) %}
<td class="blue60alpha" style="--size:{{ (week.change_vaccinations_avg / data.today.change_vaccinations_max) | max(0.03) | format}};"><span class="tooltip">Week of {{ week.start | readableDate }}<br/>Avg: {{ week.change_vaccinations_avg | formatNumber }}/day<br/>Total: {{ week.change_vaccinations_sum | d(0) | formatNumber }}</span></td>
{%- endfor %}
<td style="--size:{{ (data.today.change_vaccinations / data.today.change_vaccinations_max) | max(0.03) | format }};"><span class="tooltip">{{ data.today.date | readableDate }}{% if data.today.change_first_vaccination > data.today.change_vaccinations %}<br/>1st: {{ data.today.change_first_vaccination | d(0) | formatNumber }}<br/>2nd: {{ data.today.change_vaccinationed | d(0) | formatNumber }}{% endif %}<br/>Total: {{ data.today.change_vaccinations | d(0) | formatNumber }}</span></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="td dose last7d per1k"
title="There were {{ (data.today.change_vaccinations | format) if data.today.change_vaccinations else "NO"}} doses {{ data.today.date | readableDate | lower }}. With a 7 day average of {{ data.lastWeekExclusive.change_vaccinations_avg | format }} doses per day."
>
{% set week = data.lastWeekExclusive %}
{% if data.today.change_vaccinations > 0 %}
{% set week = data.lastWeekInclusive %}
{% endif %}
<div class="progressbar per1k green"
style="--width: {{ (week.change_vaccinations_per_1k_avg/15*100) | min(100) }}"
aria-valuenow="{{ week.change_vaccinations_per_1k_avg | round(1) }}"
data-change="{{week.change_change_vaccinations_per_1k_avg | round | format }}"
>
<span class="value" aria-hidden="true"></span>
<div class="absolute perday" data-value="{{ week.change_vaccinations_avg | round | formatNumber }}" data-change="{{ week.change_change_vaccinations_avg | round | formatNumber }}"></div>
</div>
</div>
<div class="td dose current"
title="{{ data.today.date | readableDate | lower }}, {{ (data.today.change_vaccinations | format) if data.today.change_vaccinations else "NO"}} doses were administered. The 7 day average is {{ data.lastWeekExclusive.change_vaccinations_avg | format }} doses per day."
>
<div class="data-rate" data-rate="{{ data.today.change_vaccinations_rate }}">{{ (data.today.change_vaccinations if data.today.change_vaccinations > 0 and data.yesterday.change_vaccinations > 0 else data.lastWeekExclusive.change_vaccinations_avg) | formatNumber }}</div>
<div class="small-detail reveal-on-hover">Total: {{ data.today.total_vaccinations | d(0) | formatNumber }}</div>
</div>
{# <div class="td supply complete {{ "bad" if data.today.days_to_complete_first_vaccination > 10*7 else ( "ok" if data.today.days_to_complete_first_vaccination > 5*7 else "good") }}"#}
{# title="First dose expected to be completed around {{ data.today.complete_first_vaccination_date | readableDate }} and full vaccination around {{ data.today.complete_vaccinated_date | readableDate }} based on a trailing average of {{ data.lastWeekExclusive.change_first_vaccination_avg | formatNumber }} and {{ data.lastWeekExclusive.change_vaccinated_avg | formatNumber }} doses per day, respectively."#}
{# >#}
{# <div>{{ data.today.complete_first_vaccination_date | readableDate(false) if data.today.days_to_complete_first_vaccination > 0 }}</div>#}
{# <div class="small-detail reveal-on-hover">({{ data.today.complete_vaccinated_date | readableDate(false) if data.today.days_to_complete_first_vaccination > 0 }})</div>#}
{# </div>#}
<div class="td dose one"
title="{{ ((data.today.total_first_vaccination / vaccinePopulation * 100) | round(1)) or "N/A" }}% of {{ vaccinePopulation | formatNumber(false, 0) }} aged 4+ have their first dose.">
{# {% for key in ["40plus", "18plus", "12plus", "2plus", "person"] %}#}
{# {% for key in ["12plus", "person"] %}#}
{% for key in ["5plus"] %}
{% set percent = data.today["first_vaccination_per_" + key] | round(1) | min(100) %}
{% set percent_change = data.today["change_first_vaccination_per_" + key] %}
{% set abs = data.today.total_first_vaccination %}
{% set abs_change = data.today.change_first_vaccination %}
<div class="progressbar percent per{{key}}" role="progressbar"
style="--width: {{ percent | round}}"
aria-valuenow="{{ percent or "N/A" }}"
data-change="{{ percent_change | format }}"
>
<span class="value" aria-hidden="true"></span>
<div class="absolute" data-value="{{ abs | formatNumber }}" data-change="{{ abs_change | formatNumber }}"></div>
</div>
{% endfor %}
</div>
<div class="td dose full"
title="{{ ((data.today.total_vaccinated / vaccinePopulation * 100) | round(1)) or "N/A" }}% of {{ vaccinePopulation | formatNumber(false, 0) }} aged 4+ are fully vaccinated.">
{# {% for key in ["40plus", "18plus", "12plus", "2plus", "person"] %}#}
{# {% for key in ["12plus", "person"] %}#}
{% for key in ["5plus"] %}
{% set percent = data.today["vaccinated_per_" + key] | min(100) | round(1)%}
{% set percent_change = data.today["change_vaccinated_per_" + key] %}
{% set abs = data.today.total_vaccinated %}
{% set abs_change = data.today.change_vaccinated %}
<div class="progressbar percent per{{key}}" role="progressbar"
style="--width: {{ percent | round}}"
aria-valuenow="{{ percent or "N/A" }}"
data-change="{{ percent_change | format }}"
>
{% if (percent) %}
<span class="value" aria-hidden="true"></span>
<div class="absolute" data-value="{{ abs | formatNumber }}" data-change="{{ abs_change | formatNumber }}"></div>
{% endif %}
</div>
{% endfor %}
</div>
<div class="td dose population grid" style="padding-left:0; padding-right: 0;line-height: 0.75rem;"
title="{{ data.today.first_vaccination_per_person | round}}% of the total population have at least one dose and {{ data.today.vaccinated_per_person | round}}% are fully vaccinated. {{ (((data.population - data.population5plus) / data.population) * 100) | round }}% are children under 5."
>
<div class="grid" style="margin: 0 auto; grid-area: 1 / 1 / auto / span 3;">
<div style="--repeat-y: 1; --repeat-x:10; --repeat-color: rgba(0,0,0,0);" class="grid onexone ratiostats narrow">
<div style="--repeat-y: 1; --repeat-x:{{ 10 }}; --repeat-color: #E2E3E5; " class="onexone ratiostats narrow child"></div>
<div style="--repeat-y: 1; --repeat-x:{{ ((data.population5plus / data.population) * 10) | round }}; --repeat-color: #E2E3E5;" class="onexone ratiostats narrow"></div>
<div style="--repeat-y: 1; --repeat-x:{{ (data.today.first_vaccination_per_person / 10) | round }}; --repeat-color: repeating-linear-gradient( 135deg, var(--blue), var(--blue) 2px, var(--light) 2px, var(--light) 3px );" class="onexone ratiostats narrow"></div>
<div style="--repeat-y: 1; --repeat-x:{{ (data.today.vaccinated_per_person / 10) | round }}; --repeat-color: var(--blue);" class="onexone ratiostats narrow"></div>
</div>
<div style="margin-bottom: -0.3rem; margin-top: -0.3rem;width:90%; border-right: 1px solid var(--green); " class="onexone"></div>
</div>
<div style="grid-area: 2/1;" class="small-detail">{{ data.today.vaccinated_per_person | round}}%<br>Fully</div>
<div style="grid-area: 2/2;" class="small-detail">{{ data.today.first_vaccination_per_person | round}}%<br>1+Dose</div>
<div style="grid-area: 2/3;" class="small-detail">{{ (((data.population - data.population5plus) / data.population) * 100) | round }}%<br>kids</div>
</div>
<div class="td supply history">
{% if data.today.available_doses > 0 %}
<div>
<table class="charts-css column" style="--size: {{ (data.lastWeekExclusive.available_doses_avg / data.today.available_doses_max) | format }}" data-trendline="{{ data.lastWeekInclusive.available_doses_avg |formatNumber }}">
<tbody>
<tr>
{%- for week in data.previousWeeks | head(-18) | head(14) %}
<td class="gray20alpha" style="--size:{{ (week.available_doses_avg / data.today.available_doses_max) | max(0.03) | format}};"><span class="tooltip">Week of {{ week.start | readableDate }}<br/>Avg in freezer: {{ week.available_doses_avg | formatNumber }}/day</span></td>
{%- endfor %}
{%- for week in data.previousWeeks | head(-4) %}
<td class="gray60alpha" style="--size:{{ (week.available_doses_avg / data.today.available_doses_max) | max(0.03) | format}};"><span class="tooltip">Week of {{ week.start | readableDate }}<br/>Avg in freezer: {{ week.available_doses_avg | formatNumber }}/day</span></td>
{%- endfor %}
{# {%- for day in data.previous7Days %}#}
{# <td style="--size:{{ (day.available_doses / data.today.available_doses_max) | max(0.03) | format }};"><span class="tooltip">{{ day.date | readableDate }}<br/>In Freezer: {{ day.available_doses | d(0) | formatNumber }}</span></td>#}
{# {%- endfor %}#}
<td style="--size:{{ (data.today.available_doses / data.today.available_doses_max) | max(0.03) | format }};"><span class="tooltip">{{ data.today.date | readableDate }}<br/>In Freezer: {{ data.today.available_doses | d(0) | formatNumber }}</span></td>
</tr>
</tbody>
</table>
</div>
{% endif %}
</div>
<div class="td supply available today center"
{% if data.today.available_doses > 0 %}
title="{{ data.today.available_doses | formatNumber }} doses are in freezers, waiting to be administered"
{% endif %}
>{{ data.today.available_doses | formatNumber }}</div>
<div class='td supply population'>
{% if data.today.available_doses > 0 %}
{% set change_available_doses_per_capita = (data.today.available_doses / vaccinePopulation * 100) - (data.yesterday.available_doses / vaccinePopulation * 100) %}
<div class="progressbar percent supply darkgray" role="progressbar"
style="--width: {{ ((data.today.available_doses / vaccinePopulation * 100) / 25 * 100) | min (100) }}"
aria-valuenow="{{ ((data.today.available_doses / vaccinePopulation * 100) | round(1)) }}"
data-change="{{ change_available_doses_per_capita | round(1) | format }}"
title="{{ data.today.available_doses | formatNumber }} doses provides 1 dose for {{ (data.today.available_doses / vaccinePopulation * 100) | round(1) }}% of the population"
>
<span class="value" aria-hidden="true"></span>
<div class="absolute" data-value="{{ data.today.available_doses | formatNumber }}" data-change="{{ data.today.change_available_doses | formatNumber }}"></div>
</div>
{% endif %}
</div>
<div class='td supply days'>
{% if data.today.available_doses > 0 %}
{% set days %}{{ data.lastWeekInclusive.available_doses_days | round }}{% endset %}
{% set previousDays %}{{ data.lastWeekExclusive.available_doses_days | round }}{% endset %}
<div class="progressbar supply days {{ "red" if days > 10 else ( "orange" if days > 7 else "green") }}" role="progressbar"
title="It takes {{ days }} days for new vaccine deliveries to be administered to waiting arms. The target should be 7 days with regular weekly shipments."
style="--width: {{ (days/20*100) | min (100) }}"
aria-valuenow="{{ days }}"
data-change="{{ (days - previousDays) | round | format }}"
>
<span class="value" aria-hidden="true"></span>
</div>
{% endif %}
</div>
</div>
{% endif %}
{% endmacro %}
<details open>
<summary>
{%- for province in canada | filterProp("name", "eq", "Canada") %}
{{ vaccineRow(province, "country") }}
{%- endfor %}
</summary>
<div class="flex column">
{%- for province in canada | filterProp("name", "neq", "Canada") | sort(false, false, attribute="name") %}
{% set regionLength %}{% for region in province.regions %}{% if region.today.total_vaccinations > 0 %}1{% endif %}{% endfor %}{% endset %}
{% if regionLength > 0 %}
<details class="province {{ province.iso3166 | lower}}"><summary>{{ vaccineRow(province) }}</summary>
<div class="flex column">
{%- for region in province.regions | sort(false, false, attribute="short") %}
{{ vaccineRow(region, "healthregion") }}
{%- endfor %}
</div>
</details>
{% else %}
{{ vaccineRow(province) }}
{% endif %}
{%- endfor %}
</div>
</details>
</section>
<section id="infections">
<h2><a href="#infections">Infection Status</a></h2>
<sup><small>Cost projections based on <a href="https://www.cihi.ca/en/covid-19-hospitalization-and-emergency-department-statistics">Canadian Institute for Health Information</a></small></sup>
<input id="sort-infect-name-pop" name="infection-sort" type="radio" style="display: none;">
<input id="sort-infect-name" name="infection-sort" type="radio" style="display: none;">
<input id="sort-hospital-trend" name="infection-sort" type="radio" style="display: none;">
<input id="sort-hospital" name="infection-sort" type="radio" style="display: none;" checked>
<input id="sort-icu-trend" name="infection-sort" type="radio" style="display: none;">
<input id="sort-icu" name="infection-sort" type="radio" style="display: none;">
<input id="sort-deaths-trend" name="infection-sort" type="radio" style="display: none;">
<input id="sort-deaths-year" name="infection-sort" type="radio" style="display: none;">
<input id="sort-deaths" name="infection-sort" type="radio" style="display: none;">
<input id="sort-cost-pop" name="costs-sort" type="radio" style="display: none;">
<input id="sort-cost-hospitalization" name="costs-sort" type="radio" style="display: none;" checked>
<div class="flex tr thead">
<div class="th toggle"><label class="sort" for="sort-infect-name-pop"><br/><br/></label></div>
<div class="th name"><label class="sort" for="sort-infect-name"><br/><br/></label></div>
<div class="th history"><label class="sort" for="sort-hospital-trend">Hospital<br/>Last 18 weeks</label></div>
<div class="th hospitalized"><label class="sort" for="sort-hospital">Current<br>Hospital/₁ ₀₀₀ₖ</label></div>
<div class="th history"><label class="sort" for="sort-icu-trend">Intensive Care<br/>Last 18 weeks</label></div>
<div class="th icu"><label class="sort" for="sort-icu">Current<br>ICU/₁₀ ₀₀₀ₖ</label></div>
<div class="th history"><label class="sort" for="sort-deaths-trend">Deaths<br/>Last 18 weeks</label></div>
<div class="th deaths"><label class="sort" for="sort-deaths-year">365d<br>Deaths/₁₀₀ₖ</label></div>
<div class="th deaths"><label class="sort" for="sort-deaths">Total<br>Deaths/₁₀₀ₖ</label></div>
<div class="th nogrow"><label class="sort" for="sort-cost-pop">Hospital + ICU<br>$ Cost /pop.</label></div>
<div class="th wide nogrow"><label class="sort" for="sort-cost-hospitalization">COVID Hospital + ICU<br/>Total $ Cost Since July 2021</label></div>
</div>
{% macro selectColour(data) %}{{ "green" if data < 10 else ("yellow" if data < 25 else ("orange" if data < 40 else ("red" if data < 100 else "darkgray"))) }}{% endmacro %}
{% macro selectBase(data) %}{{ 10 if data < 10 else (25 if data < 25 else (40 if data < 40 else (100 if data < 100 else 150))) }}{% endmacro %}
{% macro infectionRow(data, type='province') %}
<div class="flex tr infection {{ type }} {{ (data.iso3166 or data.short or data.name or data.province) | handle }} {{ data.today.date | readableDate | lower }}" title="Total: {{ data.total.total_cases | format }} ({{ data.total.date | readableDate }}: {{ data.total.change_cases | format }}, {{ data.yesterday.date | readableDate }}: {{ data.yesterday.change_cases | format }}) Population: {{ data.population | format }}">
<div class="td toggle"></div>
<div class="td name" title="{{ data.data_status }} @ {{ data.updated_at | readableTime }} PT {{ data.updated_at | readableDate | lower}}">
{% if type === 'province' or type === 'country' %}
<label class="label-toggle">
<span class="name long">{{ data.name.en or data.name }}</span>
<span class="name short">{{ data.iso3166 or data.name.en }}</span>
<svg viewBox="0 0 512 512" class="province-update-status"><use href="#{{ data.data_status | handle }}"></use></svg>
</label>
{% else %}
{# <span class="name long">{{ data.name.en or data.name }}</span>#}
<label for="dummy" class="label-toggle">
<span class="name">{{ data.iso3166 or data.short or data.name.en or data.name }}</span>
</label>
{% endif %}
<div class="small-detail reveal-on-hover">{{ data.population | formatNumber(false, 0) }}</div>
</div>
<div class="td hospitalized history">
{% if data.today.total_hospitalizations_max > 0 %}
<div>
<table class="charts-css column" style="--size: {{ (data.lastWeekExclusive.total_hospitalizations_avg / data.today.total_hospitalizations_max) | format }}" data-trendline="{{ data.lastWeekExclusive.total_hospitalizations_avg |formatNumber }} /day">
<tbody>
<tr>
{%- for week in data.previousWeeks | head(-18) | head(14) %}
<td class="orange20alpha" style="--size:{{ (week.total_hospitalizations_avg / data.today.total_hospitalizations_max) | max(0.03) | format}};"><span class="tooltip">Week of {{ week.start | readableDate }}<br/>Hospitalizations Avg: {{ week.total_hospitalizations_avg | formatNumber }}/day</span></td>
{%- endfor %}
{%- for week in data.previousWeeks | head(-4) %}
<td class="orange60alpha" style="--size:{{ (week.total_hospitalizations_avg / data.today.total_hospitalizations_max) | max(0.03) | format}};"><span class="tooltip">Week of {{ week.start | readableDate }}<br/>Hospitalizations Avg: {{ week.total_hospitalizations_avg | formatNumber }}/day</span></td>
{%- endfor %}
<td class="orange" style="--size:{{ (data.today.total_hospitalizations / data.today.total_hospitalizations_max) | max(0.03) | format }};"><span class="tooltip">{{ data.today.date | readableDate }}<br/>Hospitalizations: {{ data.today.total_hospitalizations | d(0) | formatNumber }}</span></td>
</tr>
</tbody>
</table>
</div>
{% endif %}
</div>
<div class="td hospitalized per1000k"
title="{{ data.today.total_hospitalizations | format }}"
>
<div class="progressbar per1000k {{ selectColour(data.today.hospitalizations_per_1000k) }}"
style="--width: {{ (data.today.hospitalizations_per_1000k/selectBase(data.today.hospitalizations_per_1000k)*100) | min(100) }}"
aria-valuenow="{{ data.today.hospitalizations_per_1000k if data.today.total_hospitalizations >= 0 else "N/A"}}"
data-change="{{ data.today.change_hospitalizations_per_1000k |d(0) | format }}"
>
{% if data.today.total_hospitalizations %}
<span class="value" aria-hidden="true"></span>
<div class="absolute" data-value="{{ data.today.total_hospitalizations | format }}" data-change="{{ data.today.change_hospitalizations | format }}"></div>
{% endif %}
</div>
</div>
<div class="td icu history">
{% if data.today.total_criticals_max > 0 %}
<div>
<table class="charts-css column" style="--size: {{ (data.lastWeekExclusive.total_criticals_avg / data.today.total_criticals_max) | format }}" data-trendline="{{ data.lastWeekExclusive.total_criticals_avg |formatNumber }} /day">
<tbody>
<tr>
{%- for week in data.previousWeeks | head(-18) | head(14) %}
<td class="red20alpha" style="--size:{{ (week.total_criticals_avg / data.today.total_criticals_max) | max(0.03) | format}};"><span class="tooltip">Week of {{ week.start | readableDate }}<br/>Intensive Care Unit Avg: {{ week.total_criticals_avg | formatNumber }}/day</span></td>
{%- endfor %}
{%- for week in data.previousWeeks | head(-4) %}
<td class="red60alpha" style="--size:{{ (week.total_criticals_avg / data.today.total_criticals_max) | max(0.03) | format}};"><span class="tooltip">Week of {{ week.start | readableDate }}<br/>Intensive Care Unit Avg: {{ week.total_criticals_avg | formatNumber }}/day</span></td>
{%- endfor %}
<td class="red" style="--size:{{ (data.today.total_criticals / data.today.total_criticals_max) | max(0.03) | format }};"><span class="tooltip">{{ data.today.date | readableDate }}<br/>Intensive Care Unit: {{ data.today.total_criticals | d(0) | formatNumber }}</span></td>
</tr>
</tbody>
</table>
</div>
{% endif %}
</div>
<div class="td icu per1000k"
title="{{ data.today.total_hospitalizations | format }}"
>
<div class="progressbar per1000k {{ selectColour(data.today.criticals_per_1000k) }}"
style="--width: {{ (data.today.criticals_per_1000k/selectBase(data.today.criticals_per_1000k)*100) | min(100) }}"
aria-valuenow="{{ data.today.criticals_per_1000k if data.today.total_criticals >= 0 else "N/A"}}"
data-change="{{ data.today.change_criticals_per_1000k |d(0) | format }}"
>
{% if data.today.total_criticals %}
<span class="value" aria-hidden="true"></span>
<div class="absolute" data-value="{{ data.today.total_criticals | format }}" data-change="{{ data.today.change_criticals | format }}"></div>
{% endif %}
</div>
</div>
<div class="td deaths history">
<div>
<table class="charts-css column" style="--size: {{ (data.lastWeekExclusive.change_fatalities_avg / data.today.change_fatalities_max) | format }}" data-trendline="{{ data.lastWeekExclusive.change_fatalities_avg |formatNumber }} /day">
<tbody>
<tr>
{%- for week in data.previousWeeks | head(-18) | head(14) %}
<td class="gray60alpha" style="--size:{{ (week.change_fatalities_avg / data.today.change_fatalities_max) | max(0.03) | format}};"><span class="tooltip">Week of {{ week.start | readableDate }}<br/>New Deaths: {{ week.change_fatalities_sum | formatNumber }}</span></td>
{%- endfor %}
{%- for week in data.previousWeeks | head(-4) %}
<td class="black" style="--size:{{ (week.change_fatalities_avg / data.today.change_fatalities_max) | max(0.03) | format}};"><span class="tooltip">Week of {{ week.start | readableDate }}<br/>New Deaths: {{ week.change_fatalities_sum | formatNumber }}</span></td>
{%- endfor %}
<td class="red" style="--size:{{ (data.today.change_fatalities / data.today.change_fatalities_max) | max(0.03) | format }};"><span class="tooltip">{{ data.today.date | readableDate }}<br/>New Deaths: {{ data.today.change_fatalities | d(0) | formatNumber }}</span></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="td deaths per100k"
title="{{ data.lastYear.change_fatalities_sum | format }}"
>
<div class="progressbar per100k {{ selectColour(data.lastYear.change_fatalities_per_100k) }}"
style="--width: {{ (data.lastYear.change_fatalities_per_100k/selectBase(data.lastYear.change_fatalities_per_100k)*100) | min(100) }}"
aria-valuenow="{{ data.lastYear.change_fatalities_per_100k if data.lastYear.change_fatalities_per_100k >= 0 else "N/A"}}"
data-change="{{ data.lastYear.change_fatalities_per_100k |d(0) | format }}"
>
<span class="value" aria-hidden="true"></span>
{% if data.lastYear.change_fatalities_sum %}
<div class="absolute" data-value="{{ data.lastYear.change_fatalities_sum | format }}" data-change="{{ data.today.change_fatalities | format }}"></div>
{% endif %}
</div>
</div>
<div class="td deaths per100k"
title="{{ data.today.total_hospitalizations | format }}"
>
<div class="progressbar per100k {{ selectColour(data.today.fatalities_per_100k) }}"
style="--width: {{ (data.today.fatalities_per_100k/selectBase(data.today.fatalities_per_100k)*100) | min(100) }}"
aria-valuenow="{{ data.today.fatalities_per_100k if data.today.total_fatalities >= 0 else "N/A"}}"
data-change="{{ data.today.change_fatalities_per_100k |d(0) | format }}"
>
<span class="value" aria-hidden="true"></span>
{% if data.today.total_fatalities %}
<div class="absolute" data-value="{{ data.today.total_fatalities | format }}" data-change="{{ data.today.change_fatalities | format }}"></div>
{% endif %}
</div>
</div>
<div class="td costs nogrow"
>
<div class="progressbar nogrow cad red"
style="--width: {{ ((data.sinceJuly.total_cost_hospitalization_sum/data.population/20)*100) | min(100) }}"
aria-valuenow="{{ data.sinceJuly.total_cost_hospitalization_per_person_sum | round(0)}}"
data-change="/resident"
>
<span class="value" aria-hidden="true"></span>
<div class="absolute" data-value="" data-change="{{data.today.total_cost_hospitalization_per_person | round(2) }}"></div>
</div>
</div>
<div class="td icu wide left nogrow">
<div class="progressbar cad red"
style="text-shadow: -0.5px -0.5px 0 #fff, 0.5px -0.5px 0 #fff, -0.5px 0.5px 0 #fff, 0.5px 0.5px 0 #fff; color: var(--black); margin-left: 0; --pb-width: {{ (data.sinceJuly.total_cost_hospitalization_sum/canada.CA.sinceJuly.total_cost_hospitalization_sum*100) | round(1) }}%; --pb-background: var(--red); --width: 100"
aria-valuenow="{{ data.sinceJuly.total_cost_hospitalization_sum | d(0) | formatNumber(false, 0) }}"
>
<span class="value" aria-hidden="true" ></span>
{% if data.today.total_cost_hospitalization %}
<div class="absolute" data-value="{{ data.today.total_cost_hospitalization | formatNumber(false, 0) }} today"></div>
{% endif %}
</div>
</div>
</div>
{% endmacro %}
{%- for province in canada | filterProp("name", "eq", "Canada") %}
<details open><summary>{{ infectionRow(province, "country") }}</summary>
{%- endfor %}
<div class="flex column">
{%- for province in canada | filterProp("name", "neq", "Canada") | sort(false, false, attribute="name") %}
{% set regionLength %}{% for region in province.regions %}1{% endfor %}{% endset %}
{% if regionLength > 0 %}
<details class="province {{ province.iso3166 | lower}}"><summary>{{ infectionRow(province) }}</summary>
<div class="flex column">
{%- for region in province.regions | sort(false, false, attribute="short") %}
{{ infectionRow(region, "healthregion") }}
{%- endfor %}
</div>
</details>
{% else %}
{{ infectionRow(province) }}
{% endif %}
{%- endfor %}
</div>
</details>
</section>
<section id="costs">
<h2><a href="#costs">COVID Impact by Age</a></h2>
<sup><small>Age breakdown from <a href="https://health-infobase.canada.ca/covid-19/epidemiological-summary-covid-19-cases.html">PHAC</a></small></sup>
<input id="sort-cost-name-pop" name="costs-sort" type="radio" style="display: none;">
<input id="sort-cost-name" name="costs-sort" type="radio" style="display: none;">
<input id="sort-cost-history" name="costs-sort" type="radio" style="display: none;" checked>
<input id="sort-cost-income" name="costs-sort" type="radio" style="display: none;">
<input id="sort-cost-total" name="costs-sort" type="radio" style="display: none;">
<div class="flex tr thead">
<div class="th toggle"><label class="sort" for="sort-cost-name-pop"><br/><br/></label></div>
<div class="th name nogrow"><label class="sort" for="sort-cost-name"><br/><br/></label></div>
<div class="th history nogrow"><label class="sort" for="sort-hospital-trend">Hospitalizations<br/>Last 18 weeks</label></div>
<div class="th history nogrow"><label class="sort" for="sort-hospital-trend">Hospitalizations<br/>Since July, 2021</label></div>
<div class="th history nogrow"><label class="sort" for="sort-hospital-trend">In CU<br/>Last 18 weeks</label></div>
<div class="th history nogrow"><label class="sort" for="sort-hospital-trend">In ICU<br/>Since July, 2021</label></div>
<div class="th history nogrow"><label class="sort" for="sort-hospital-trend">Deaths<br/>Last 18 weeks</label></div>
<div class="th history nogrow"><label class="sort" for="sort-hospital-trend">Deaths<br/>Since 2021-July</label></div>
<div class="th"></div>
</div>
{% macro costsRow(data, age='0-11') %}
<div class="flex tr costs {{ type }} {{ (data.iso3166 or data.short or data.name or data.province) | handle }} {{ data.today.date | readableDate | lower }}" title="Hospitalization + ICY Costs for Covid Patients (Since July): ${{ data.sinceJuly.total_cost_hospitalization_sum | formatNumber(false, 0) }} ({{ data.total.date | readableDate }}: ${{ data.total.total_cost_hospitalization | formatNumber(false, 0) }}, {{ data.yesterday.date | readableDate }}: ${{ data.yesterday.total_cost_hospitalization | formatNumber(false, 0) }}) Population: {{ data.population | format }}">
<div class="td toggle"></div>
<div class="td name nogrow" title="{{ data.data_status }} @ {{ data.updated_at | readableTime }} PT {{ data.updated_at | readableDate | lower}}">
<label for="dummy" class="label-toggle">
<span class="name">{{ age }}</span>
</label>
<div class="small-detail reveal-on-hover">{{ data.population | formatNumber(false, 0) }}</div>
</div>
{% set ageData = "change_infobase_hospitalization_" + age %}
{% set ageDataMax = "change_infobase_hospitalization_" + age + "_max" %}
{% set ageDataAvg = "change_infobase_hospitalization_" + age + "_avg" %}
{% set ageDataSum = "change_infobase_hospitalization_" + age + "_sum" %}
{% set totalDataSum = "change_infobase_hospitalization_total_sum" %}
<div class="td hospitalized history nogrow">
{% if data.today[ageDataMax] > 0 %}
<div>
<table class="charts-css column" style="--size: {{ (data.lastWeekExclusive[ageDataAvg] / data.today[ageDataMax]) | format }}" data-trendline="{{ data.lastWeekExclusive[ageDataAvg] |formatNumber }} /day">
<tbody>
<tr>
{%- for week in data.previousWeeks | head(-18) | head(14) %}
<td style="--size:{{ (week[ageDataAvg] / data.today[ageDataMax]) | max(0.03) | format}};"><span class="tooltip">Week of {{ week.start | readableDate }}<br/>Hospitalization: {{ week[ageDataSum] | formatNumber }}</span></td>
{%- endfor %}
{%- for week in data.previousWeeks | head(-4) %}
<td style="--size:{{ (week[ageDataAvg] / data.today[ageDataMax]) | max(0.03) | format}};"><span class="tooltip">Week of {{ week.start | readableDate }}<br/>Hospitalization: {{ week[ageDataSum] | formatNumber }}</span></td>
{%- endfor %}
{% if data.today[ageData] > 0 %}
<td style="--size:{{ (data.today[ageData] / data.today[ageDataMax]) | max(0.03) | format }};"><span class="tooltip">{{ data.today.date | readableDate }}<br/>Hospitalization: {{ data.today[ageData] | d(0) | formatNumber }}</span></td>
{% endif %}
</tr>
</tbody>
</table>
</div>
{% endif %}
</div>
<div class="td hospitalized nogrow"
title="{{ data.sinceJuly[ageDataSum] | format }}"
>
<div class="progressbar {{ selectColour(data.sinceJuly[ageDataSum]) }}"
style="--width: {{ (data.sinceJuly[ageDataSum]/data.sinceJuly[totalDataSum]*100) | min(100) | max(5)}}"
aria-valuenow="{{ ( data.sinceJuly[ageDataSum] | formatNumber ) if data.sinceJuly[ageDataSum] >= 0 else "N/A" }}"
data-change="{{ data.lastMonth[ageDataSum] |d(0) | format }}"
>
{% if data.sinceJuly[ageDataSum] %}
<span class="value" aria-hidden="true"></span>
<div class="absolute" data-value="365d Total: {{ data.lastYear[ageDataSum] | formatNumber }}" data-change=""></div>
{% endif %}
</div>
</div>
{% set ageData = "change_infobase_icu_" + age %}
{% set ageDataMax = "change_infobase_icu_" + age + "_max" %}
{% set ageDataAvg = "change_infobase_icu_" + age + "_avg" %}
{% set ageDataSum = "change_infobase_icu_" + age + "_sum" %}
{% set totalDataSum = "change_infobase_icu_total_sum" %}
<div class="td icu history nogrow">
{% if data.today[ageDataMax] > 0 %}
<div>
<table class="charts-css column" style="--size: {{ (data.lastWeekExclusive[ageDataAvg] / data.today[ageDataMax]) | format }}" data-trendline="{{ data.lastWeekExclusive[ageDataAvg] |formatNumber }} /day">
<tbody>
<tr>
{%- for week in data.previousWeeks | head(-18) | head(14) %}
<td style="--size:{{ (week[ageDataAvg] / data.today[ageDataMax]) | max(0.03) | format}};"><span class="tooltip">Week of {{ week.start | readableDate }}<br/>In ICU: {{ week[ageDataSum] | formatNumber }}</span></td>
{%- endfor %}
{%- for week in data.previousWeeks | head(-4) %}
<td style="--size:{{ (week[ageDataAvg] / data.today[ageDataMax]) | max(0.03) | format}};"><span class="tooltip">Week of {{ week.start | readableDate }}<br/>In ICU: {{ week[ageDataSum] | formatNumber }}</span></td>
{%- endfor %}
{% if data.today[ageData] > 0 %}
<td style="--size:{{ (data.today[ageData] / data.today[ageDataMax]) | max(0.03) | format }};"><span class="tooltip">{{ data.today.date | readableDate }}<br/>In ICU: {{ data.today[ageData] | d(0) | formatNumber }}</span></td>
{% endif %}
</tr>
</tbody>
</table>
</div>
{% endif %}
</div>
<div class="td icu nogrow"
title="{{ data.sinceJuly[ageDataSum] | format }}"
>
<div class="progressbar {{ selectColour(data.sinceJuly[ageDataSum]) }}"
style="--width: {{ (data.sinceJuly[ageDataSum]/data.sinceJuly[totalDataSum]*100) | min(100) | max(5)}}"
aria-valuenow="{{ ( data.sinceJuly[ageDataSum] | formatNumber ) if data.sinceJuly[ageDataSum] >= 0 else "N/A" }}"
data-change="{{ data.lastMonth[ageDataSum] |d(0) | format }}"
>
{% if data.sinceJuly[ageDataSum] %}
<span class="value" aria-hidden="true"></span>
<div class="absolute" data-value="365d Total: {{ data.lastYear[ageDataSum] | formatNumber }}" data-change=""></div>
{% endif %}
</div>
</div>
{% set ageData = "change_infobase_deaths_" + age %}
{% set ageDataMax = "change_infobase_deaths_" + age + "_max" %}
{% set ageDataAvg = "change_infobase_deaths_" + age + "_avg" %}
{% set ageDataSum = "change_infobase_deaths_" + age + "_sum" %}
{% set totalDataSum = "change_infobase_deaths_total_sum" %}
<div class="td deaths history nogrow">
{% if data.today[ageDataMax] > 0 %}
<div>
<table class="charts-css column" style="--size: {{ (data.lastWeekExclusive[ageDataAvg] / data.today[ageDataMax]) | format }}" data-trendline="{{ data.lastWeekExclusive[ageDataAvg] |formatNumber }} /day">
<tbody>
<tr>
{%- for week in data.previousWeeks | head(-18) | head(14) %}
<td style="--size:{{ (week[ageDataAvg] / data.today[ageDataMax]) | max(0.03) | format}};"><span class="tooltip">Week of {{ week.start | readableDate }}<br/>New Deaths: {{ week[ageDataSum] | formatNumber }}</span></td>
{%- endfor %}
{%- for week in data.previousWeeks | head(-4) %}
<td style="--size:{{ (week[ageDataAvg] / data.today[ageDataMax]) | max(0.03) | format}};"><span class="tooltip">Week of {{ week.start | readableDate }}<br/>New Deaths: {{ week[ageDataSum] | formatNumber }}</span></td>
{%- endfor %}
{% if data.today[ageData] > 0 %}
<td style="--size:{{ (data.today[ageData] / data.today[ageDataMax]) | max(0.03) | format }};"><span class="tooltip">{{ data.today.date | readableDate }}<br/>Deaths: {{ data.today[ageData] | d(0) | formatNumber }}</span></td>
{% endif %}
</tr>
</tbody>
</table>
</div>
{% endif %}
</div>
<div class="td deaths nogrow"
title="{{ data.sinceJuly[ageDataSum] | format }}"
>
<div class="progressbar {{ selectColour(data.sinceJuly[ageDataSum]) }}"
style="--width: {{ (data.sinceJuly[ageDataSum]/data.sinceJuly[totalDataSum]*100) | min(100) | max(5)}}"
aria-valuenow="{{ ( data.sinceJuly[ageDataSum] | formatNumber ) if data.sinceJuly[ageDataSum] >= 0 else "N/A" }}"
data-change="{{ data.lastMonth[ageDataSum] |d(0) | format }}"
>
{% if data.sinceJuly[ageDataSum] %}
<span class="value" aria-hidden="true"></span>
<div class="absolute" data-value="365d Total: {{ data.lastYear[ageDataSum] | formatNumber }}" data-change=""></div>
{% endif %}
</div>
</div>
<div class="td"></div>
</div>
{% endmacro %}
{% set ageGroups = [ '0-11', '12-19','20-29','30-39','40-49','50-59','60-69','70-79','80+'] %}
{%- for province in canada | filterProp("name", "eq", "Canada") %}
{%- for age in ageGroups %}
<details open><summary>{{ costsRow(province, age) }}</summary>
{%- endfor %}
{%- endfor %}
</details>
</section>
</main>
<footer>
<p class="fineprint">This is for informational purposes only. It relies on community efforts like <a href="https://covid19tracker.ca">covid19tracker.ca</a> to aggregate government data sources.</p>
<div class="bling">
<span>built by <a href="https://twitter.com/colinbendell">Colin</a></span>
<span>proudly <noscript></span>
</div>
</footer>