forked from aatishb/covidtrends
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
172 lines (114 loc) · 6.27 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
<!DOCTYPE html>
<html lang="en">
<head>
<title>Covid Trends</title>
<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
<meta content="utf-8" http-equiv="encoding">
<script src="libraries/plotly.min.js"></script>
<script src="libraries/vue.js"></script>
<link rel="stylesheet" type="text/css" href="normalize.css">
<link rel="stylesheet" type="text/css" href="style.css">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<link rel="icon" href="favicon.ico" type="image/x-icon">
</head>
<body>
<div id="root">
<div id="header">
<div id="explainer">
<p>This interactive charts the <b><i>new</i></b> {{selectedData.toLowerCase()}} of COVID-19 in the past week vs. the <b><i>total</i></b> {{selectedData.toLowerCase()}} to date. When plotted in this way, exponential growth is represented as a straight line that slopes upwards. Notice that almost all countries follow a very similar path of exponential growth. <i>We're all in this together.</i> <span v-if="isHidden"><a @click="toggleHide">Learn more.</a></span></p>
<span v-if="!isHidden">
<p>To learn more about this graph, watch this video created by Minute Physics.</p>
<br>
<iframe width="560" height="315" src="https://www.youtube.com/embed/54XLXg4fYsc" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<p><i><b>Note:</b> The x-axis of this graph is not time</i>, but is instead the total number of cases or deaths.</p>
<p><b>Tips:</b> Press Space (or the play button) to Play/Pause. Press +/- keys (or drag the slider) to see daily changes. Hover over the graph for more info. Drag your mouse to zoom in, doubleclick to zoom back out. And don't forget to wash your hands!</p>
<a id="hide" @click="toggleHide">Hide</a>
</span>
</div>
<div id="logowrapper">
<h1><a href="https://aatishb.com/covidtrends">Covid Trends</a></h1>
<div v-if="!isHidden" id="logos">
<a href="https://aatishb.com/"><img src="logos/aatishb-bw.png" height="40"></img></a>
<a href="https://www.youtube.com/user/minutephysics"><img src="logos/minutephysics-invert.png" height="40"></img></a>
</div>
</div>
</div>
<div id="content">
<div id="left-column">
<graph v-if="covidData.length > 0" :data="filteredCovidData" :dates="dates" :day.sync="day" :selected-data="selectedData" :scale="selectedScale" :resize="isHidden" @graph-mounted="graphMounted = true"></graph>
<div id="nav">
<div class="navelement">
<img v-if="paused" @click="play" src="icons/play.svg" style="width: 3rem;">
<img v-if="!paused" @click="play" src="icons/pause.svg" style="width: 3rem;">
</div>
<div class="navelement">
<h2>{{minDay > 0 ? dates[day - 1] : dates[dates.length - 1] }}</h2>
</div>
<div class="navelement" id="slidercontainer">
<input v-if="dates.length > 7" type="range" :min="minDay > 0 ? minDay : dates.length" :max="dates.length" step="1" v-model="day" id="slider" @mousedown="pause"></input>
</div>
<div class="navelement">
<select v-model="selectedScale" @mousedown="pause">
<option v-for="s in scale" v-bind:value="s">
{{ s }}
</option>
</select>
</div>
</div>
<div id="footer">
Created by <a href="https://aatishb.com/">Aatish Bhatia</a> in collaboration with <a href="https://www.youtube.com/user/minutephysics">Minute Physics</a> · Data provided by <a href="https://github.com/CSSEGISandData/COVID-19">Johns Hopkins University</a> · Shortcuts: +/- for daily changes, space to play/pause · <a href="https://github.com/aatishb/covidtrends#credits">Credits & Source</a> · <a href="https://www.cdc.gov/coronavirus/2019-ncov/prepare/prevention.html">Stay safe!</a>
</div>
</div>
<div id="right-column">
<div>
<h2>Customize</h2>
<select v-model="selectedData" @mousedown="pause">
<option v-for="d in dataTypes" v-bind:value="d">
{{ d }}
</option>
</select>
<select v-model="selectedScale" @mousedown="pause">
<option v-for="s in scale" v-bind:value="s">
{{ s }}
</option>
</select>
</div>
<div id="countries">
<h2>Countries</h2>
<p>Countries with at least {{minCasesInCountry}} {{selectedData}}</p>
<div id="buttonwrapper">
<button @click="deselectAll">Deselect All</button>
<button @click="selectAll">Select All</button>
</div>
<ul style="padding-top: 0.5rem;">
<li v-for="country in countries">
<input type="checkbox" :id="country" :value="country" v-model="selectedCountries">
<label :for="country">{{country}}</label>
</li>
</ul>
</div>
<div>
<div id="buttonwrapper">
<button @click="createURL" @mousedown="pause">{{copied ? 'Link Copied to Clipboard!' : 'Create Shareable Link'}}</button>
</div>
</div>
</div>
</div>
</div>
<!-- page code -->
<script src="vue-definitions.js"></script>
</body>
<!-- Twitter Card data -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="Covid Trends">
<meta name="twitter:description" content="Visualizing the exponential growth of COVID-19 across the world.">
<meta name="twitter:site" content="@aatishb">
<!-- Twitter Summary card images must be at least 120x120px -->
<meta name="twitter:image" content="https://aatishb.com/covidtrends/logos/covid-trends-logo-nowords.png">
<!-- Open Graph data -->
<meta property="og:title" content="Covid Trends" />
<meta property="og:type" content="article" />
<meta property="og:url" content="https://aatishb.com/covidtrends/" />
<meta property="og:image" content="https://aatishb.com/covidtrends/logos/covid-trends-logo-nowords.png" />
<meta property="og:description" content="Visualizing the exponential growth of COVID-19 across the world." />
</html>