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

performance fix

parent 90275fe4
Pipeline #212 passed with stage
in 1 second
...@@ -1030,13 +1030,7 @@ let selectSite = (e) => { ...@@ -1030,13 +1030,7 @@ let selectSite = (e) => {
data[data.length-1].ratio = calculateAverageRate(data.slice(-4).map(d=>d.confirmed)) data[data.length-1].ratio = calculateAverageRate(data.slice(-4).map(d=>d.confirmed))
} }
var confirmed = data[data.length-1].confirmed var confirmed = data[data.length-1].confirmed
console.log(`+-- covid data for: ${site}` console.log(`+-- got covid data for: ${site}`)
+ `\n date : ${data[data.length-1].date}`
+ `\n cases : ${confirmed}`
+ `\n cases day prior : ${data[data.length-2].confirmed}`
+ `\n ratio : ${data[data.length-1].ratio}`
+ `\n source link : ${wikiData.source_link}`
+ `\n source title : ${wikiData.source_title}`)
getSitePopulation(site) getSitePopulation(site)
.then((population)=>{ .then((population)=>{
siteDataNode.innerHTML = ` siteDataNode.innerHTML = `
...@@ -1439,7 +1433,7 @@ let updateChartData = (siteSelect) => { ...@@ -1439,7 +1433,7 @@ let updateChartData = (siteSelect) => {
// update the chart settings // update the chart settings
clearTimeout(theChart.updateTimeout) clearTimeout(theChart.updateTimeout)
theChart.updateTimeout = setTimeout(updateChartSettings(), 750) theChart.updateTimeout = setTimeout(updateChartSettings, 250)
} }
......
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