covidtrends
covidtrends copied to clipboard
add per capita and population density controls
I've had another punt at this by initially stealing @jwosty's code and merging it into the newer code, and adding in a population density option which I was intrigued by.
Note; I might have got it all wrong, I won't be offended by a rejection! This was mainly done as a learning exercise for myself :-)
I would love to see this running somewhere. Per Capita would give a great view of relative risk between countries that doesn't exist anywhere right now.
I would love to see this running somewhere. Per Capita would give a great view of relative risk between countries that doesn't exist anywhere right now.
Ah, found it finally! The holy grail of visualizations for estimating relative risk between countries (which I very much need for business purposes). Obviously will never be perfect, but a lot better than trying to do it in your head!
http://raw.githack.com/jwosty/covidtrends/per-capita/index.html
Edit: hmm, not sure that's actually working...
It's running here: https://covidtrends.eu-gb.mybluemix.net/ though if it gets too much traffic I'll have to take it down :-)
I feel that this Pull Request probably won’t be merged by the repository owner until some discussion and consensus. See https://github.com/aatishb/covidtrends/issues/30#issuecomment-607927252.
It's running here: https://covidtrends.eu-gb.mybluemix.net/ though if it gets too much traffic I'll have to take it down :-)
Hi Andreas, thanks for keeping this up and running for so long, it's been very valuable to me over the course of the pandemic. I've noticed it's not working at the moment, will it continue or is there any alternative? I'd be happy to donate to your hosting fund if needed ;-)
Works Partially For Me!
Maybe give it a little time after loading, there's quite a lot of data now that the browser needs to interpret...
I do see a warning regarding the Summer Olympics 2020 in the browser console which might be causing some problems... I'll take a look later (hopefully) vue-definitions.js:635
Works Partially For Me!
It works for me if I stay on the Absolute numbers only, but when I switch to Per Capita, the numbers never refresh, even after half an hour. If I open a link with per capita specified in the link, no graph appears at all, not even the axes and again I can leave it in this state for half an hour or more with no change. Is it possible I'm using a different url than you? One I'm using that's not working is this for example:
https://covidtrends.eu-gb.mybluemix.net/?unit=per%2Bcapita&location=Czechia&location=Hungary&location=Israel&location=Serbia&location=US&location=United+Arab+Emirates&location=United+Kingdom
It would be awesome if you could fix the problem. Your site was my first choice for checking covid statistics as well, as the per capita feature made it easy to compare Switzerland and Germany. The fix doesn't look to hard either, you could probably just add the Summer Olympics manually like you did for Kosovo. Though I'm not sure which values best to use for PopTotal and PopDensity.
popByCountry.push({Location: "Summer Olympics 2020", PopTotal: 11_000/1000, PopDensity: 1000});
The honest answer was that I wasn't sure where I'd stuck the repo on my filesystem and has forgotten all about how it was written... I dusted it off with my friend mlocate
and fixed the Olympics, but I don't think that was the problem. I think the data-set is just too hunking big to be evaluated in the browser. If you load a URL like https://covidtrends.eu-gb.mybluemix.net/?unit=per%2Bcapita&location=Australia&location=Brazil&location=China&location=Norway&location=US&location=United+Kingdom and go get a cuppa it will load...
So keep the selected countries small and give it time and lots of RAM and it'll get there.
Ahem, yeah, a quick logout and login later... What he said --^
So keep the selected countries small and give it time and lots of RAM and it'll get there.
Now it works perfectly and almost instantly with selections of all countries in Europe, so whatever you did, it fixed it. Thanks.
Hi @andreas-ibm. Unfortunately it looks like something happened to the per capita numbers again. They won't pull up at all, even after an hour, though the non per-capita numbers still work. Any chance of fixing it? And again, thank you so much for keeping this valuable resource up.
@scstraus @andreas-ibm
There were two new countries added:
Adding those lines to vue-definitions.js:598 fixes it:
popByCountry.push({Location: "Antarctica", PopTotal: 5_000/1000, PopDensity: 0.01});
popByCountry.push({Location: "Winter Olympics 2022", PopTotal: 60_000/1000, PopDensity: 1000});
Though you might want to use different values for population / density.
Thanks, copied your values verbatim, I should review those values I know...
@andreas-ibm
There was another country added:
Adding this line to vue-definitions.js:600 fixes it:
popByCountry.push({Location: "Korea, North", PopTotal: 25_549_604/1000, PopDensity: 212});
I took the values from Wikipedia (estimates of 2018).
Fixed, thanks :-)