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

equal Y axis for cases by country charts #316

Open
yuval-harpaz opened this issue Jun 14, 2022 · 6 comments · May be fixed by #342
Open

equal Y axis for cases by country charts #316

yuval-harpaz opened this issue Jun 14, 2022 · 6 comments · May be fixed by #342
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@yuval-harpaz
Copy link

Please add a field for setting a high limit for Y-axis to all the charts in the cases page. It would make a fairer comparison between countries and allow zooming in when looking at a new variant. Thanks.
image

@yuval-harpaz yuval-harpaz added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed needs triage Pending maintainers' attention labels Jun 14, 2022
@emmahodcroft
Copy link
Collaborator

Interactive axes would be a great addition to CoVariants. Unfortunately we haven't had time to look into this, but we are looking to perhaps switch to a new charting library soon. This may open up more options! In the meantime, happy to take PRs that may improve this functionality!

@emmahodcroft emmahodcroft removed the needs triage Pending maintainers' attention label Jul 22, 2022
@yuval-harpaz
Copy link
Author

Unfortunately I've got zero experience with Recharts, so I cannot add a user input box. But it may be simple to make "other" also disappear when "deselect all". This seems to be what's keeping Y up there

@emmahodcroft
Copy link
Collaborator

Ah, that's a good point @yuval-harpaz . @ivan-aksamentov would it be possible to add 'other' to the left-hand selection bar on the 'Cases' page, so it can be deselected - and if someone wants, not selected back in again?

@ivan-aksamentov
Copy link
Member

ivan-aksamentov commented Jul 28, 2022

@emmahodcroft It's not easy to do in the app. There is no "other" variant. Instead, it is currently computed ad-hoc as a difference between the sum of all variants and total. It is computed for every user on each their visit for every country being displayed, for every time point. And, as any computation done in the covariants frontend, it's a very silly thing to do, because it's constant data.

If you want "other" to behave as a variant, then the right thing to do is to add it as a variant named "other" to the data in the backend scripts. And it will appear automagically, on the plot and in the side panel. We could then remove the ad-hoc computation in javascript and the corresponding grey areas on the plot.

This should hopefully allow Y axis to rescale.

Depending on the priorities of this, compared to other tasks, you think you or Moira can adjust the data? And then ping me and I'll see what needs to be removed in the app, to avoid having the "other" twice.

@yuval-harpaz
Copy link
Author

Unless you need "other" separately for other uses, I'd consider making a shortcut, leave it there, just compute max for Yaxis ignoring it.

@emmahodcroft
Copy link
Collaborator

Hi @ivan-aksamentov - that makes sense to me. I'll see if we can work that in!

ivan-aksamentov added a commit that referenced this issue Aug 9, 2022
Resolves #316

Treating "others" as a variant allows:
 -  to remove unnecessary computation from web app - the data for "others" is immutable, should be precomputed in advance and be stored along with other variant data
 - to have a checkbox which allows toggling it on the plots
@ivan-aksamentov ivan-aksamentov linked a pull request Aug 9, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants