forked from aatishb/covidtrends
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
201 lines (150 loc) · 8.54 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Covid Trends</title>
<link rel="stylesheet" type="text/css" href="normalize.css">
<link rel="stylesheet" type="text/css" href="style.css?1">
<script src="libraries/plotly-basic.min.js"></script>
<script src="libraries/vue.min.js"></script>
<script src="https://d3js.org/d3.v5.min.js"></script>
<script src="https://d3js.org/d3-dsv.v1.min.js"></script>
<script src="https://d3js.org/d3-fetch.v1.min.js"></script>
<script lang="javascript" src="https://oss.sheetjs.com/sheetjs/xlsx.full.min.js"></script>
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<link rel="icon" href="favicon.ico" type="image/x-icon">
<!-- 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." />
</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(s) 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://covid19.felipequintella.com">Covid Trends</a></h1>
<div v-if="!isHidden" id="logos">
<a href="https://aatishb.com/"><img src="logos/aatishb-bw.png" height="40"></a>
<a href="https://www.youtube.com/user/minutephysics"><img src="logos/minutephysics-invert.png" height="40"></a>
</div>
</div>
</div>
<div id="content">
<div id="left-column">
<graph v-if="covidData.length > 0" :graph-data="graphData" :day="day" :resize="isHidden" v-bind.sync="graphAttributes"></graph>
<div v-if="covidData.length > 0" 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>{{ formatDate(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">
</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 v-if="!firstLoad && covidData.length == 0" id="nodata"><span>Not enough data for these parameters.</span></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> · World data provided by <a href="https://github.com/CSSEGISandData/COVID-19">Johns Hopkins University</a> (updated daily around 00:00 UTC / 20:00 ET) · US state data provided by <a href="https://github.com/nytimes/covid-19-data">NYTimes</a> (updated daily around 16:00 UTC / 12:00 ET)· 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>
<br>Adapted to include Brazilian breakdown by <a href="https://felipequintella.com/">Felipe Quintella</a> · Brazilian data provided by <a href="https://covid.saude.gov.br">Ministério da Saúde</a> · <a href="https://github.com/felipequintella/covidtrends">Source</a> · <a href="https://github.com/felipequintella/covid19-brazil-scraper">Data Source Scraper</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="selectedRegion" @mousedown="pause">
<option v-for="s in regions" v-bind:value="s">
{{ s }}
</option>
</select>
<select v-model="selectedScale" @mousedown="pause">
<option v-for="s in scale" v-bind:value="s">
{{ s }}
</option>
</select>
<div>
<label for="lookbackTime">Show Past
<select style="margin-top: 0.75rem; width: 3rem; min-width: 2rem; padding: 0rem; font-size: 0.75rem;" v-model="lookbackTime" @mousedown="pause">
<option v-for="d in lookbackTimes" v-bind:value="d">
{{ d }}
</option>
</select>
Days of New Cases</label>
</div>
<div>
<input type="checkbox" style="margin-top: 0.75rem;" id="showLabels" v-model="showLabels">
<label for="showLabels">Show Labels</label>
</div>
<div>
<input type="checkbox" style="margin-top: 0.75rem;" id="showTrendLine" v-model="showTrendLine">
<label for="showTrendLine">Show
<select style="width: 3rem; min-width: 2rem; padding: 0rem; font-size: 0.75rem;" v-model="doublingTime" @mousedown="pause">
<option v-for="d in doublingTimes" v-bind:value="d">
{{ d }}
</option>
</select>
Day Doubling Time</label>
</div>
</div>
<div id="countries">
<h2>{{regionType}}</h2>
<p>{{regionType}} with at least {{minCasesInCountry}} {{selectedData}}</p>
<div id="search">
<input v-model="searchField" placeholder="Search">
</div>
<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 visibleCountries">
<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?3"></script>
</body>
</html>