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) => {
// population_ratio is also used as an indicator that we're doing a per-million chart
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)
}
......@@ -1575,12 +1575,12 @@ let updateChartSettings = () => {
if (chart_start_setting === "date") {
theChart.options.scales.xAxes[0].scaleLabel.labelString = "Date"
} 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"
} else {
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`
} else {
theChart.options.scales.xAxes[0].scaleLabel.labelString = `Days since ${chart_start}th confirmed case`
......@@ -1940,7 +1940,7 @@ document.addEventListener('DOMContentLoaded', (e)=>{
"site-menu-button-percentage": ()=>{
document.getElementById('chart-data-confirmed').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
},
"site-menu-button-deaths": ()=>{
......
......@@ -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-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: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-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],
......@@ -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-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;
pointer-events: none;
}
......@@ -406,13 +406,13 @@
.chart-config-container input#chart-data-cfr:checked ~ .chart-config-group .delta-change {
display:inline;
}
.chart-config-group .per-million,
.chart-config-group .permillion,
.chart-config-group .data-confirmed,
.chart-config-group .data-recovered,
.chart-config-group .data-deaths {
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-recovered:checked ~ .chart-config-group .data-recovered,
.chart-config-container input#chart-data-deaths:checked ~ .chart-config-group .data-deaths,
......@@ -421,7 +421,7 @@
display:inline;
}
/* 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
}
.chart-config-group.chart-average {
......@@ -503,7 +503,7 @@
<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-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-first" name="chart-start" value="1"/>
<input type="radio" id="chart-start-tenth" name="chart-start" value="10" checked="checked"/>
......@@ -536,7 +536,7 @@
<div class="chart-config-group">
<p>Values:</p>
<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 class="break"></div>
<div class="chart-config-group">
......@@ -547,7 +547,7 @@
<label for="chart-start-tenth">10th</label>
<label for="chart-start-hundredth">100th</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 class="break"></div>
<div class="chart-config-group">
......
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