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

moved the highest-cfr button a bit

parent b6709f95
Pipeline #206 passed with stage
in 0 seconds
......@@ -1778,6 +1778,28 @@ document.addEventListener('DOMContentLoaded', (e)=>{
// return deaths comparison
return (bdata[bdata.length-1].deaths / bdata[bdata.length-1].confirmed) - (adata[adata.length-1].deaths / adata[adata.length-1].confirmed);
},
"site-menu-button-highest-cfr": (a, b)=>{
// make the formulas easier on the eyes
var adata = siteData[a].data
var bdata = siteData[b].data
// we can assume active is there if new_active is, right?.. right?..
if (! ("cfr" in adata[adata.length - 1]) ) {
if ( (adata[adata.length - 1].recovered + adata[adata.length - 1].deaths) === 0) {
adata[adata.length - 1].cfr = 0
} else {
adata[adata.length - 1].cfr = adata[adata.length - 1].deaths / (adata[adata.length - 1].recovered + adata[adata.length - 1].deaths)
}
}
if (! ("cfr" in bdata[bdata.length - 1]) ) {
if ( (bdata[bdata.length - 1].recovered + bdata[bdata.length - 1].deaths) === 0) {
bdata[bdata.length - 1].cfr = 0
} else {
bdata[bdata.length - 1].cfr = bdata[bdata.length - 1].deaths / (bdata[bdata.length - 1].recovered + bdata[bdata.length - 1].deaths)
}
}
// return new_active comparison
return bdata[bdata.length-1].cfr - adata[adata.length-1].cfr;
},
"site-menu-button-recovered": (a, b)=>{
// make the formulas easier on the eyes
var adata = siteData[a].data
......@@ -1802,28 +1824,6 @@ document.addEventListener('DOMContentLoaded', (e)=>{
}
// return new_active comparison
return adata[adata.length-1].new_active - bdata[bdata.length-1].new_active;
},
"site-menu-button-highest-cfr": (a, b)=>{
// make the formulas easier on the eyes
var adata = siteData[a].data
var bdata = siteData[b].data
// we can assume active is there if new_active is, right?.. right?..
if (! ("cfr" in adata[adata.length - 1]) ) {
if ( (adata[adata.length - 1].recovered + adata[adata.length - 1].deaths) === 0) {
adata[adata.length - 1].cfr = 0
} else {
adata[adata.length - 1].cfr = adata[adata.length - 1].deaths / (adata[adata.length - 1].recovered + adata[adata.length - 1].deaths)
}
}
if (! ("cfr" in bdata[bdata.length - 1]) ) {
if ( (bdata[bdata.length - 1].recovered + bdata[bdata.length - 1].deaths) === 0) {
bdata[bdata.length - 1].cfr = 0
} else {
bdata[bdata.length - 1].cfr = bdata[bdata.length - 1].deaths / (bdata[bdata.length - 1].recovered + bdata[bdata.length - 1].deaths)
}
}
// return new_active comparison
return bdata[bdata.length-1].cfr - adata[adata.length-1].cfr;
}
}
......@@ -1855,6 +1855,12 @@ document.addEventListener('DOMContentLoaded', (e)=>{
document.getElementById('chart-values-absolute').checked = true
document.getElementById('chart-type-logarithmic').checked = true
},
"site-menu-button-highest-cfr": ()=>{
document.getElementById('chart-data-cfr').checked = true
document.getElementById('chart-cases-cumulative').checked = true
document.getElementById('chart-values-absolute').checked = true
document.getElementById('chart-type-linear').checked = true
},
"site-menu-button-recovered": ()=>{
console.log('site-menu-button-recovered')
document.getElementById('chart-data-recovered').checked = true
......@@ -1867,12 +1873,6 @@ document.addEventListener('DOMContentLoaded', (e)=>{
document.getElementById('chart-cases-new').checked = true
document.getElementById('chart-values-absolute').checked = true
document.getElementById('chart-type-linear').checked = true
},
"site-menu-button-highest-cfr": ()=>{
document.getElementById('chart-data-cfr').checked = true
document.getElementById('chart-cases-cumulative').checked = true
document.getElementById('chart-values-absolute').checked = true
document.getElementById('chart-type-linear').checked = true
}
}
......
......@@ -468,9 +468,9 @@
<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"/>
<input type="button" id="site-menu-button-death-to-case" value="highest death-to-case ratio"/>
<input type="button" id="site-menu-button-highest-cfr" value="highest case fatality rate"/>
<input type="button" id="site-menu-button-recovered" value="most recoveries"/>
<input type="button" id="site-menu-button-active-drop" value="greatest daily drop of number of active cases"/>
<input type="button" id="site-menu-button-highest-cfr" value="highest case fatality rate"/>
</div>
</div>
<div id="sites-data-container">
......
Markdown is supported
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