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

some UI and chart fixes for active cases mode

parent a78a9f96
......@@ -1339,7 +1339,7 @@ let updateChartData = (siteSelect) => {
var dataset = document.querySelector('input[type=radio][name=chart-data]:checked').value
// dataset name used for start-at comparisons
if (dataset === 'cfr') {
if ( (dataset === 'cfr') || (dataset === 'active') ) {
// when showing CFR data, we want to start at nth confirmed case
// since CFR by definition cannot go above 1
var start_at_dataset = 'confirmed'
......@@ -1521,7 +1521,7 @@ let updateChartSettings = () => {
// move the y-axis zero point depending on whether we're showing cumulative or new cases
if (document.querySelector('input[type=radio][name=chart-cases]:checked').value === 'cumulative') {
if ( (chart_dataset !== "cfr" ) && (document.querySelector('input[type=radio][name=chart-values]:checked').value === 'absolute') ) {
if ( (chart_dataset !== "cfr" ) && (chart_dataset !== "active" ) && (document.querySelector('input[type=radio][name=chart-values]:checked').value === 'absolute') ) {
theChart.options.scales.yAxes[0].ticks.min = chart_start
} else {
theChart.options.scales.yAxes[0].ticks.min = 0
......
......@@ -355,15 +355,15 @@
.chart-config-group .per-million,
.chart-config-group .data-confirmed,
.chart-config-group .data-recovered,
.chart-config-group .data-deaths,
.chart-config-group .data-active {
.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-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,
.chart-config-container input#chart-data-active:checked ~ .chart-config-group .data-active {
.chart-config-container input#chart-data-active:checked ~ .chart-config-group .data-confirmed,
.chart-config-container input#chart-data-cfr:checked ~ .chart-config-group .data-confirmed {
display:inline;
}
.chart-config-group.chart-average {
......@@ -488,7 +488,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">case</span><span class="data-recovered">recovery</span><span class="data-deaths">death</span><span class="data-active">active case</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="per-million"> 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