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

feat: add "others" as a variant #342

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

Conversation

ivan-aksamentov
Copy link
Member

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

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

vercel bot commented Aug 9, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
covariants ✅ Ready (Inspect) Visit Preview Aug 9, 2022 at 0:06AM (UTC)

Comment on lines +2513 to +2523
"others": {
"build_name": "others",
"cluster_data": [],
"col": "#222222",
"snps": [],
"display_name": "others",
"graphing": False,
"important": False,
"nextstrain_build": False,
"type": "variant"
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the definition of the "others" variant in clusters.py. This object will be emitted into clusters.json along with other variants.

It should be the last object in the list to keep the display order of area segments on the plot the same. However you can play with the order to your liking.

Comment on lines +33 to 35
"S:677P.Pelican",
"others"
],
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"others" needs to be added into the list of cluster_names in json data. Here I illustrate what the result should look like for cases data. This is a manual addition and is not enforced in code. Python scripts will need to be changed for that (for cases and other plots if applicable).

<Area
type="monotone"
dataKey={CLUSTER_NAME_OTHERS}
stackId="1"
stroke="none"
fill={theme.clusters.color.others}
fillOpacity={1}
isAnimationActive={false}
/>

<CartesianGrid stroke={theme.plot.cartesianGrid.stroke} />
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here I remove the additional ad-hoc area segment from the cases plot. The same should be done for the other plot(s), when they get their own "others" data.

@emmahodcroft
Copy link
Collaborator

Thanks Ivan! This is working really well from my playing around. I will try to get to editing the code so that these additions are permanent so we can merge this in

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.

equal Y axis for cases by country charts
3 participants