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

per-million -> permillion

parent ed96840b
...@@ -1336,7 +1336,7 @@ let updateChartData = (siteSelect) => { ...@@ -1336,7 +1336,7 @@ let updateChartData = (siteSelect) => {
// population_ratio is also used as an indicator that we're doing a per-million chart // population_ratio is also used as an indicator that we're doing a per-million chart
var population_ratio = false var population_ratio = false
if ( (dataset !== 'cfr') && document.querySelector('input[type=radio][name=chart-values]:checked').value === 'per-million') { if ( (dataset !== 'cfr') && document.querySelector('input[type=radio][name=chart-values]:checked').value === 'permillion') {
population_ratio = (siteData[siteSelect.value].population / 1000000) population_ratio = (siteData[siteSelect.value].population / 1000000)
} }
...@@ -1575,12 +1575,12 @@ let updateChartSettings = () => { ...@@ -1575,12 +1575,12 @@ let updateChartSettings = () => {
if (chart_start_setting === "date") { if (chart_start_setting === "date") {
theChart.options.scales.xAxes[0].scaleLabel.labelString = "Date" theChart.options.scales.xAxes[0].scaleLabel.labelString = "Date"
} else if (chart_start == 1) { } else if (chart_start == 1) {
if ( (chart_dataset != 'cfr') && (document.querySelector('input[type=radio][name=chart-values]:checked').value === 'per-million')) { if ( (chart_dataset != 'cfr') && (document.querySelector('input[type=radio][name=chart-values]:checked').value === 'permillion')) {
theChart.options.scales.xAxes[0].scaleLabel.labelString = "Days since one confirmed case per million people" theChart.options.scales.xAxes[0].scaleLabel.labelString = "Days since one confirmed case per million people"
} else { } else {
theChart.options.scales.xAxes[0].scaleLabel.labelString = "Days since 1st confirmed case" theChart.options.scales.xAxes[0].scaleLabel.labelString = "Days since 1st confirmed case"
} }
} else if ( (chart_dataset != 'cfr') && (document.querySelector('input[type=radio][name=chart-values]:checked').value === 'per-million') ) { } else if ( (chart_dataset != 'cfr') && (document.querySelector('input[type=radio][name=chart-values]:checked').value === 'permillion') ) {
theChart.options.scales.xAxes[0].scaleLabel.labelString = `Days since ${chart_start} confirmed cases per million people` theChart.options.scales.xAxes[0].scaleLabel.labelString = `Days since ${chart_start} confirmed cases per million people`
} else { } else {
theChart.options.scales.xAxes[0].scaleLabel.labelString = `Days since ${chart_start}th confirmed case` theChart.options.scales.xAxes[0].scaleLabel.labelString = `Days since ${chart_start}th confirmed case`
...@@ -1940,7 +1940,7 @@ document.addEventListener('DOMContentLoaded', (e)=>{ ...@@ -1940,7 +1940,7 @@ document.addEventListener('DOMContentLoaded', (e)=>{
"site-menu-button-percentage": ()=>{ "site-menu-button-percentage": ()=>{
document.getElementById('chart-data-confirmed').checked = true document.getElementById('chart-data-confirmed').checked = true
document.getElementById('chart-cases-cumulative').checked = true document.getElementById('chart-cases-cumulative').checked = true
document.getElementById('chart-values-per-million').checked = true document.getElementById('chart-values-permillion').checked = true
document.getElementById('chart-type-logarithmic').checked = true document.getElementById('chart-type-logarithmic').checked = true
}, },
"site-menu-button-deaths": ()=>{ "site-menu-button-deaths": ()=>{
......
...@@ -335,7 +335,7 @@ ...@@ -335,7 +335,7 @@
.chart-config-container input#chart-data-cfr:checked ~ input#chart-cases-delta:checked ~ .chart-config-group label[for=chart-type-linear], .chart-config-container input#chart-data-cfr:checked ~ input#chart-cases-delta:checked ~ .chart-config-group label[for=chart-type-linear],
.chart-config-container input#chart-values-absolute:checked ~ .chart-config-group label[for=chart-values-absolute], .chart-config-container input#chart-values-absolute:checked ~ .chart-config-group label[for=chart-values-absolute],
.chart-config-container input#chart-data-cfr:checked ~ .chart-config-group label[for=chart-values-absolute], .chart-config-container input#chart-data-cfr:checked ~ .chart-config-group label[for=chart-values-absolute],
.chart-config-container input#chart-data-cfr:not(:checked) ~ input#chart-values-per-million:checked ~ .chart-config-group label[for=chart-values-per-million], .chart-config-container input#chart-data-cfr:not(:checked) ~ input#chart-values-permillion:checked ~ .chart-config-group label[for=chart-values-permillion],
.chart-config-container input#chart-start-date:checked ~ .chart-config-group label[for=chart-start-date], .chart-config-container input#chart-start-date:checked ~ .chart-config-group label[for=chart-start-date],
.chart-config-container input#chart-start-first:checked ~ .chart-config-group label[for=chart-start-first], .chart-config-container input#chart-start-first:checked ~ .chart-config-group label[for=chart-start-first],
.chart-config-container input#chart-start-tenth:checked ~ .chart-config-group label[for=chart-start-tenth], .chart-config-container input#chart-start-tenth:checked ~ .chart-config-group label[for=chart-start-tenth],
...@@ -347,7 +347,7 @@ ...@@ -347,7 +347,7 @@
} }
.chart-config-container input#chart-data-active:checked ~ input#chart-cases-delta:checked ~ .chart-config-group label[for=chart-type-logarithmic], .chart-config-container input#chart-data-active:checked ~ input#chart-cases-delta:checked ~ .chart-config-group label[for=chart-type-logarithmic],
.chart-config-container input#chart-data-cfr:checked ~ input#chart-cases-delta:checked ~ .chart-config-group label[for=chart-type-logarithmic], .chart-config-container input#chart-data-cfr:checked ~ input#chart-cases-delta:checked ~ .chart-config-group label[for=chart-type-logarithmic],
.chart-config-container input#chart-data-cfr:checked ~ .chart-config-group label[for=chart-values-per-million] { .chart-config-container input#chart-data-cfr:checked ~ .chart-config-group label[for=chart-values-permillion] {
opacity:0.5; opacity:0.5;
pointer-events: none; pointer-events: none;
} }
...@@ -406,13 +406,13 @@ ...@@ -406,13 +406,13 @@
.chart-config-container input#chart-data-cfr:checked ~ .chart-config-group .delta-change { .chart-config-container input#chart-data-cfr:checked ~ .chart-config-group .delta-change {
display:inline; display:inline;
} }
.chart-config-group .per-million, .chart-config-group .permillion,
.chart-config-group .data-confirmed, .chart-config-group .data-confirmed,
.chart-config-group .data-recovered, .chart-config-group .data-recovered,
.chart-config-group .data-deaths { .chart-config-group .data-deaths {
display:none; display:none;
} }
.chart-config-container input#chart-values-per-million:checked ~ .chart-config-group .per-million, .chart-config-container input#chart-values-permillion:checked ~ .chart-config-group .permillion,
.chart-config-container input#chart-data-confirmed:checked ~ .chart-config-group .data-confirmed, .chart-config-container input#chart-data-confirmed:checked ~ .chart-config-group .data-confirmed,
.chart-config-container input#chart-data-recovered:checked ~ .chart-config-group .data-recovered, .chart-config-container input#chart-data-recovered:checked ~ .chart-config-group .data-recovered,
.chart-config-container input#chart-data-deaths:checked ~ .chart-config-group .data-deaths, .chart-config-container input#chart-data-deaths:checked ~ .chart-config-group .data-deaths,
...@@ -421,7 +421,7 @@ ...@@ -421,7 +421,7 @@
display:inline; display:inline;
} }
/* doesn't make any sense for CFR */ /* doesn't make any sense for CFR */
.chart-config-container input#chart-data-cfr:checked ~ .chart-config-group .per-million { .chart-config-container input#chart-data-cfr:checked ~ .chart-config-group .permillion {
display:none display:none
} }
.chart-config-group.chart-average { .chart-config-group.chart-average {
...@@ -503,7 +503,7 @@ ...@@ -503,7 +503,7 @@
<input type="radio" id="chart-type-logarithmic" name="chart-type" value="logarithmic" checked="checked"/> <input type="radio" id="chart-type-logarithmic" name="chart-type" value="logarithmic" checked="checked"/>
<input type="radio" id="chart-type-linear" name="chart-type" value="linear"/> <input type="radio" id="chart-type-linear" name="chart-type" value="linear"/>
<input type="radio" id="chart-values-absolute" name="chart-values" value="absolute" checked="checked"/> <input type="radio" id="chart-values-absolute" name="chart-values" value="absolute" checked="checked"/>
<input type="radio" id="chart-values-per-million" name="chart-values" value="per-million"/> <input type="radio" id="chart-values-permillion" name="chart-values" value="permillion"/>
<input type="radio" id="chart-start-date" name="chart-start" value="date"/> <input type="radio" id="chart-start-date" name="chart-start" value="date"/>
<input type="radio" id="chart-start-first" name="chart-start" value="1"/> <input type="radio" id="chart-start-first" name="chart-start" value="1"/>
<input type="radio" id="chart-start-tenth" name="chart-start" value="10" checked="checked"/> <input type="radio" id="chart-start-tenth" name="chart-start" value="10" checked="checked"/>
...@@ -536,7 +536,7 @@ ...@@ -536,7 +536,7 @@
<div class="chart-config-group"> <div class="chart-config-group">
<p>Values:</p> <p>Values:</p>
<label for="chart-values-absolute">absolute</label> <label for="chart-values-absolute">absolute</label>
<label for="chart-values-per-million">per 1M</label> <label for="chart-values-permillion">per 1M</label>
</div> </div>
<div class="break"></div> <div class="break"></div>
<div class="chart-config-group"> <div class="chart-config-group">
...@@ -547,7 +547,7 @@ ...@@ -547,7 +547,7 @@
<label for="chart-start-tenth">10th</label> <label for="chart-start-tenth">10th</label>
<label for="chart-start-hundredth">100th</label> <label for="chart-start-hundredth">100th</label>
<label for="chart-start-thousandth">1000th</label> <label for="chart-start-thousandth">1000th</label>
<p><span class="data-confirmed">confirmed case</span><span class="data-recovered">recovery</span><span class="data-deaths">death</span><span class="per-million"> per 1M</span></p> <p><span class="data-confirmed">confirmed case</span><span class="data-recovered">recovery</span><span class="data-deaths">death</span><span class="permillion"> per 1M</span></p>
</div> </div>
<div class="break"></div> <div class="break"></div>
<div class="chart-config-group"> <div class="chart-config-group">
......
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