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

Allow node traits to define URLs #1308

Merged
merged 3 commits into from
Mar 29, 2021
Merged

Allow node traits to define URLs #1308

merged 3 commits into from
Mar 29, 2021

Conversation

jameshadfield
Copy link
Member

@jameshadfield jameshadfield commented Mar 19, 2021

This PR extends traits defined on nodes to allow an optional url property, which results in a link being rendered in the tip-clicked panel.

As an example, this allows the following node structure to be rendered as follows:

"node_attrs": {
  "originating_lab": {
    "value": "Area of Virology, Serology and Virology Division (SAViD), New South Wales Health Pathology Randwick"
  },
  "pangolin_lineage": {
    "value": "B.1.1.7",
    "url": "https://cov-lineages.org/lineages/lineage_B.1.1.7.html"
  },
  "recency": {
    "value": "Older"
  },

image

(P.S. colorings in the dataset JSON provides a title for pangolin_lineage, recency and originating_lab, which results in them being rendered as PANGO Lineage, Submission Date and Originating Lab).

Additionally the code around processing URL strings has been improved and tests added.

Closes #1307

The schema defines these as "special" property, and we use them to render the value and link to be rendered via `<AccessionAndUrl>` within the tip-clicked panel.

These should not be available as valid traits for general display.
This extends our interpretation of dataset-supplied traits to allow them to define a URL as well as a value. If a url is specified, then the value (in the tip-clicked panel) is rendered as a link.

Closes #1307
This improves our validation of URLs which should improve app stability.
@jameshadfield jameshadfield temporarily deployed to auspice-node-attrs-urls-15dwbs March 19, 2021 01:08 Inactive
@AngieHinrichs
Copy link

Fantastic, thanks for doing this so quickly! Can you fire up another heroku so I can give it a try? (Or better yet, merge it! :)

@jameshadfield jameshadfield merged commit 3a0bc84 into master Mar 29, 2021
@jameshadfield jameshadfield deleted the node-attrs-urls branch March 29, 2021 01:11
jameshadfield added a commit that referenced this pull request Mar 29, 2021
Following on from #1308
which allowed node attrs to be links, this allows them to load
different datasets.

The code here isn't well tested, but provides a starting point
for linking together trees.
@trvrb
Copy link
Member

trvrb commented Mar 29, 2021

Awesome! This is a nice addition.

@AngieHinrichs
Copy link

Thanks again for adding this -- super-useful.

Maybe it's my JSON, maybe I need to wait a bit longer for nextstrain.org to update? but this isn't working for me yet on nextstrain.org, i.e. the value appears but isn't a link to url:

"subtree": { "value": "Subtree", "url": "https://nextstrain.org/fetch/hgwdev-angie.gi.ucsc.edu/cgi-bin/../trash/ct/subtreeAuspice1_hgwdev_angie_99be_256c80.json"}

https://nextstrain.org/fetch/hgwdev.gi.ucsc.edu/~angie/subtreeUrl.json?label=nuc%20mutations:T23155C
(click on red sample)

image

@jameshadfield
Copy link
Member Author

This functionality is available in the latest auspice release (v2.25.0) but this hasn't made it to nextstrain.org yet.

It's currently available at dev.nextstrain.org for final testing, and should arrive in nextstrain.org over the next day or two.

@AngieHinrichs
Copy link

AngieHinrichs commented Mar 31, 2021 via email

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.

Allow urls to be set & displayed for node attrs
3 participants