relabeled stuff

This commit is contained in:
tmont 2020-04-28 18:17:03 -07:00
parent adf702ada9
commit 0bebcf6bfd

View File

@ -155,14 +155,13 @@ html
th(data-col="name"): +sortableLinks("name")= label th(data-col="name"): +sortableLinks("name")= label
if hasPopulation if hasPopulation
th.text-center(data-col="population"): +sortableLinks("population") Population th.text-center(data-col="population"): +sortableLinks("population") Population
th.text-center(data-col="total"): +sortableLinks("total") Deaths th.text-center(data-col="million"): +sortableLinks("million") per 1M
if hasPopulation th.text-center(data-col="total"): +sortableLinks("total") Total
th.text-center(data-col="million"): +sortableLinks("million") …/1M th.text-center.sorted(data-col="today"): +sortableLinks("today") Today
th.text-center.sorted(data-col="yesterday"): +sortableLinks("yesterday") …since yesterday th.text-center(data-col="last7"): +sortableLinks("last7") Last 7 days
th.text-center(data-col="week"): +sortableLinks("week") …since last week th.text-center(data-col="last30"): +sortableLinks("last30") Last 30 days
th.text-center(data-col="month"): +sortableLinks("month") …month-to-date th.text-center(data-col="growth"): +sortableLinks("growth") Growth Rate
th.text-center(data-col="growth"): +sortableLinks("growth") …growth rate th.text-center Trend
th.text-center Last 14 days
- -
items.sort((a, b) => { items.sort((a, b) => {
@ -176,31 +175,33 @@ html
}); });
tbody: each item, i in items tbody: each item, i in items
- const yesterday = item.timeSeriesDaily[item.timeSeriesDaily.length - 1].delta || 0; -
- const lastWeek = item.timeSeriesDaily[item.timeSeriesDaily.length - 1].value - item.timeSeriesDaily[item.timeSeriesDaily.length - 7].value; const getValue = offset => (item.timeSeriesDaily[item.timeSeriesDaily.length - offset] || {}).value || 0;
- const lastMonth = item.timeSeriesMonthly[item.timeSeriesMonthly.length - 1].delta || 0; const getDelta = offset => (item.timeSeriesDaily[item.timeSeriesDaily.length - offset] || {}).delta || 0;
const today = getDelta(1);
const last7 = getValue(1) - getValue(7);
const last30 = getValue(1) - getValue(30);
tr( tr(
id=("row-" + item.safeName) id=("row-" + item.safeName)
data-name=item.name data-name=item.name
data-population=item.population data-population=item.population
data-total=item.total data-total=item.total
data-million=item.deathsPerMillion data-million=item.deathsPerMillion
data-yesterday=yesterday data-today=today
data-week=lastWeek data-last7=last7
data-month=lastMonth data-last30=last30
data-growth=item.deathGrowthRate data-growth=item.deathGrowthRate
) )
td.sort-order= i + 1 td.sort-order= i + 1
td: +renderItemName(item) td: +renderItemName(item)
if hasPopulation if hasPopulation
td.text-right: +formatNumber(item.population) td.text-right: code: +formatNumber(item.population)
td.text-right: +formatNumber(item.total) td.text-right: code: +formatNumber(Math.round(item.deathsPerMillion))
if hasPopulation td.text-right: code: +formatNumber(item.total)
td.text-right: +formatNumber(Math.round(item.deathsPerMillion)) td.text-right.sorted: code: +formatNumber(today)
td.text-right.sorted: +formatNumber(yesterday) td.text-right: code: +formatNumber(last7)
td.text-right: +formatNumber(lastWeek) td.text-right: code: +formatNumber(last30)
td.text-right: +formatNumber(lastMonth) td.text-right: code= Number(item.deathGrowthRate * 100).toFixed(2) + '%'
td.text-right= Number(item.deathGrowthRate * 100).toFixed(2) + '%'
td td
canvas.mx-auto(id="sparkline-" + i width="200" height="50") canvas.mx-auto(id="sparkline-" + i width="200" height="50")
script. script.
@ -305,9 +306,9 @@ html
resortTable('name'); resortTable('name');
break; break;
case 'total': case 'total':
case 'yesterday': case 'today':
case 'week': case 'last7':
case 'month': case 'last30':
case 'population': case 'population':
case 'million': case 'million':
case 'growth': case 'growth':