Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add per capita and population density controls #94

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

andreas-ibm
Copy link

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

@scstraus
Copy link

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
Copy link

scstraus commented Jul 10, 2020

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

@andreas-ibm
Copy link
Author

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

@FranklinYu
Copy link

I feel that this Pull Request probably won’t be merged by the repository owner until some discussion and consensus. See #30 (comment).

@scstraus
Copy link

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

@andreas-ibm
Copy link
Author

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

@scstraus
Copy link

scstraus commented Jul 1, 2021

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

@KoenigsKind
Copy link

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

@etweek
Copy link

etweek commented Jul 9, 2021

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.

@andreas-ibm
Copy link
Author

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

@scstraus
Copy link

scstraus commented Jul 9, 2021

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
Copy link

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.

@KoenigsKind
Copy link

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

@andreas-ibm
Copy link
Author

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

@KoenigsKind
Copy link

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

@andreas-ibm
Copy link
Author

Fixed, thanks :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants