Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Michał Woźniak
covid
Commits
d395bfdc
Commit
d395bfdc
authored
Apr 12, 2020
by
Michał Woźniak
Browse files
stylistic fixes in the load-six-sites menu
parent
956251fb
Pipeline
#176
passed with stage
in 0 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
covid.js
View file @
d395bfdc
...
...
@@ -1727,15 +1727,18 @@ document.addEventListener('DOMContentLoaded', (e)=>{
// first, filter out sites without data
// and sites with less than 100 cases
.
reduce
((
acc
,
site
)
=>
{
// ignore the ignored sites
if
(
ignored_sites
.
includes
(
site
))
{
console
.
log
(
`+--
${
site
}
is specifically ignored; not taking into account`
)
// ignore sites for which we have no data yet
}
else
if
(
!
(
'
data
'
in
siteData
[
site
])
)
{
console
.
log
(
`+-- no cases data for
${
site
}
; not taking into account`
)
// ignore sites for which we have no population yet
}
else
if
(
!
(
'
population
'
in
siteData
[
site
])
)
{
console
.
log
(
`+-- no population data for
${
site
}
; not taking into account`
)
}
else
if
(
siteData
[
site
].
data
[
siteData
[
site
].
data
.
length
-
1
].
confirmed
<
100
)
{
console
.
log
(
`+-- not enough confirmed cases for
${
site
}
; not taking into account`
)
}
else
{
// we only want sites with 100 or more
confirmed
cases,
// otherwise the data is all over the place and meaningless
}
else
if
(
siteData
[
site
].
data
[
siteData
[
site
].
data
.
length
-
1
].
confirmed
>
100
)
{
acc
.
push
(
site
)
}
return
acc
...
...
index.html
View file @
d395bfdc
...
...
@@ -111,18 +111,17 @@
flex-wrap
:
wrap
;
justify-content
:
center
;
}
#internal-main-menu-container
h2
{
#internal-main-menu-container
p
{
font-size
:
100%
;
font-variant
:
all-small-caps
;
margin
:
0.3em
0.2em
;
padding
:
0.5em
1em
0.5em
0.2em
;
}
#internal-main-menu-container
input
[
type
=
button
]
{
margin
:
0.3em
;
flex-grow
:
1
;
flex-shrink
:
1
;
padding-left
:
2
em
;
padding-right
:
2
em
;
flex-grow
:
1
;
flex-shrink
:
1
;
padding-left
:
1
em
;
padding-right
:
1
em
;
}
.sources
{
font-size
:
80%
;
...
...
@@ -384,7 +383,7 @@
<div
class=
"sources"
><a
href=
"https://github.com/CSSEGISandData/COVID-19"
>
source
</a></div>
<div
id=
"main-menu-container"
>
<div
id=
"internal-main-menu-container"
>
<
h2
>
Load 6 sites with at least 100 confirmed cases and:
</
h2
>
<
p
>
Load 6 sites with at least 100 confirmed cases and:
</
p
>
<input
type=
"button"
id=
"site-menu-button-rate"
value=
"largest growth rate"
/>
<input
type=
"button"
id=
"site-menu-button-percentage"
value=
"highest percentage of population infected"
/>
<input
type=
"button"
id=
"site-menu-button-deaths"
value=
"most deaths"
/>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment