Commit c6cc694c authored by Michał Woźniak's avatar Michał Woźniak
Browse files

minor bugfixes

parent c78863de
......@@ -595,6 +595,10 @@ let getCovidData = () => {
return acc
}, [])
// Global data needs a source too!
siteData['Global'].source_link = "https://github.com/pomber/covid19"
siteData['Global'].source_title = "pomber / covid19"
var cleaned_data = siteData['Global'].data.slice(-1)[0]
cleaned_data.mortality = cleaned_data.deaths / cleaned_data.confirmed
console.log(`+-- got global covid data:`
......@@ -1614,16 +1618,25 @@ document.addEventListener('DOMContentLoaded', (e)=>{
})
//
/*document.getElementById('site-menu-button-rate').addEventListener('click', (e)=>{
Object.keys(siteData).map((site)=>{
try {
var data = siteData[site].data.slice(-2); return Math.round(((data[1].confirmed / data[0].confirmed) - 1) * 10000) / 100
} catch (e) {
console.log(site)
}
})
document.getElementById('menu-shown').checked = false;
})*/
// document.getElementById('site-menu-button-rate').addEventListener('click', (e)=>{
// Object.keys(siteData).reduce((acc, site)=>{
// try {
// var data = siteData[site].data.slice(-2)
// var ratio = Math.round(((data[1].confirmed / data[0].confirmed) - 1) * 10000) / 100
// if (acc.length < 6) {
// acc.push({
// site: site,
// ratio: ratio
// })
// } else {
//
// }
// } catch (e) {
// console.log(`+-- no data for ${site}`)
// }
// })
// document.getElementById('menu-shown').checked = false;
// }, [])
// fill out the covid data box
getCovidData()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment