-
Notifications
You must be signed in to change notification settings - Fork 111
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
base: master
Are you sure you want to change the base?
Conversation
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
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
"others": { | ||
"build_name": "others", | ||
"cluster_data": [], | ||
"col": "#222222", | ||
"snps": [], | ||
"display_name": "others", | ||
"graphing": False, | ||
"important": False, | ||
"nextstrain_build": False, | ||
"type": "variant" | ||
} |
There was a problem hiding this comment.
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.
"S:677P.Pelican", | ||
"others" | ||
], |
There was a problem hiding this comment.
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} /> |
There was a problem hiding this comment.
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.
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 |
Resolves #316
Treating "others" as a variant allows: