-
Notifications
You must be signed in to change notification settings - Fork 61
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 secondary clade-like values #985
base: master
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Example tree: tree_.json.gz |
Nice - this is really good. A definitive improvement - we could all sorts of info in the toolbox - beyond unaliased stuff. Right now this is a simple lookup from "clade" to "value". At some point we may want to add placement certainty - that would not map straightforwardly from "clade" to "value" because "clade" is no longer the right key here, every row could have different attributes, in the same way we show normal columns right now. So we may also want to add a different extension type that acts as a column but instead of being shown as column, the value is put into a tooltip. Does that make sense? This extension here will still be useful so this is just to keep you up to date about further extension needs that may arise. |
This is in fact how I implemented it initially. But then you'd need to tell which primary attribute's tooltip you want to target for each secondary attribute. That is quite complex, and error prone, because it involves matching values in 3 places. But column to tooltip is a one-to-many mapping (constrained by how results table is constructed), so I later simplified it to a nested array. Nextclade does not care what values you put, it only cares where you want to put them, i.e. the format describes placement, not meaning. You can display different sets of attributes for different rows already, by:
If value is described in meta, but not found under Does that work for you? |
I'm not quite sure I understand your explanation of being able to display different sets of attributes, involving meta descriptions and Could we go through a concrete example? Imagine I create a new custom node attribute But instead, I seem to be able to add the country annotation to the clade annotation as an extra meta description? Bit confused how that would look in practice. |
@corneliusroemer In the first message of the PR, in JSON examples, replace "foo" with "country". Then "country: " will be shown in the tooltips of table cells of "Pango_lineage" column. Try to follow instructions in the first message of the PR. Create a tree, try it in the app and let me know how it goes. And once you understand simple case, and if you need more complex cases, we can talk in details. |
93f31a9
to
edefa32
Compare
27d4a31
to
9010d85
Compare
Resolves #984
Adds secondary (nested under primary) attributes for custom clade-like node attributes.
The secondary key-value pairs will appear in the Nextclade Web in tooltips of primary custom clade-like columns (displayed in the cells).
How to:
Modify reference tree as follows:
Add array of descriptions of secondary attributes under
meta.extensions.nextclade.clade_node_attrs[].secondaryAttrs[]
:Add values (strings) to the node attribute object with the keys matching
clade_node_attrs[].secondaryAttrs[].name
:Compatibility
These changes are backwards compatible: previous versions of Nextclade don't know about
secondaryAttrs
field and will ignore it.These changes are forward compatible: new versions ignore secondary attributes if
secondaryAttrs
property is missing, an empty array, or (for each node) ifnode_attrs
does not contain a value for a given attributive.