covidtrends icon indicating copy to clipboard operation
covidtrends copied to clipboard

add per capita and population density controls

Open andreas-ibm opened this issue 4 years ago • 16 comments

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 :-)

andreas-ibm avatar Apr 16 '20 13:04 andreas-ibm

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.

scstraus avatar Jul 10 '20 15:07 scstraus

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...

scstraus avatar Jul 10 '20 16:07 scstraus

It's running here: https://covidtrends.eu-gb.mybluemix.net/ though if it gets too much traffic I'll have to take it down :-)

andreas-ibm avatar Jul 10 '20 16:07 andreas-ibm

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.

FranklinYu avatar Feb 01 '21 04:02 FranklinYu

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 ;-)

scstraus avatar Jun 29 '21 14:06 scstraus

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

andreas-ibm avatar Jun 29 '21 14:06 andreas-ibm

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

scstraus avatar Jul 01 '21 11:07 scstraus

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});

KoenigsKind avatar Jul 08 '21 23:07 KoenigsKind

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.

etweek avatar Jul 09 '21 08:07 etweek

Ahem, yeah, a quick logout and login later... What he said --^

andreas-ibm avatar Jul 09 '21 08:07 andreas-ibm

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.

scstraus avatar Jul 09 '21 15:07 scstraus

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 avatar Feb 11 '22 13:02 scstraus

@scstraus @andreas-ibm
There were two new countries added:
image

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.

KoenigsKind avatar Feb 12 '22 15:02 KoenigsKind

Thanks, copied your values verbatim, I should review those values I know...

andreas-ibm avatar Feb 14 '22 09:02 andreas-ibm

@andreas-ibm
There was another country added:
image

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).

KoenigsKind avatar Jun 12 '22 23:06 KoenigsKind

Fixed, thanks :-)

andreas-ibm avatar Jun 13 '22 08:06 andreas-ibm