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

Hide branch labels for inactive branches #1335

Closed
trvrb opened this issue Apr 10, 2021 · 6 comments · Fixed by #1370
Closed

Hide branch labels for inactive branches #1335

trvrb opened this issue Apr 10, 2021 · 6 comments · Fixed by #1370
Labels
enhancement New feature or request

Comments

@trvrb
Copy link
Member

trvrb commented Apr 10, 2021

Context
Currently, branch labels are always drawn regardless of whether branches are active or inactive. In some ways this is helpful to always provide context like in the following:

https://nextstrain.org/ncov/global?f_clade_membership=20H/501Y.V2
tree

However, in clock and scatterplot views it gets confusing really quickly which branch labels apply to which branches. See for example:
https://nextstrain.org/staging/ncov/global-with-dfreq?d=tree,frequencies&l=scatter&p=full&scatterY=logistic_growth
logistic

where it really looks like the subclade within 20H is actually 20J/501Y.V3.

Description
I'd like branch labels to be hidden if the branch / node that they are attached to is hidden. I think this will generally result in less confusion.

@trvrb trvrb added enhancement New feature or request easy problem labels Apr 10, 2021
@emmahodcroft
Copy link
Member

I'd perhaps like this to be toggleable. I use the branch labels a lot when navigating the tree in various filtered & zoomed nodes, and it would be inconvenient if any level of hidden meant the branch label didn't show. Perhaps we can add a toggle under the branch-label drop-down saying 'show if branch hidden' which could turn to 'off' when switching to scatterplot mode? As I'd vote to keep it in tree mode - it's very useful.

@trvrb
Copy link
Member Author

trvrb commented Jul 4, 2021

Interesting. This is a bit surprising to me. I think I'd almost always prefer for branch labels to be hidden when attached branches are hidden. For example, here's AA mutations for a subclade Delta filtered to samples from India as app currently works:

filtered

I find it odd to have AA mutations for all these inactive branches. Close to text hovering in thin air for me.

I see what you mean about clade labels providing orientation, but this also looks slightly odd to me:

clades

I'd expect 21B to not show up if 21B is not in the data at hand.

@emmahodcroft
Copy link
Member

For me this is tied into the fact that it's not so easy to hit intermediate zoom levels when filtering, since all ancestral branches are 'minimized'. (So, if you have a couple of sequences that you want to look at with some neighbours, this is a practice of turning on/off filters while trying to hit the right intermediate zoom you're seeking.) For this, having branch labels even when minimized gives you some 'landmarks' to use to orient yourself on the tree.
I agree it isn't 100% canonical to have branch labels visible when the branch isn't, but until we've resolved making intermediate zoom easier with filters on, I'm loathe to make it more difficult!

@jameshadfield
Copy link
Member

In order to test the behavior where branch labels are hidden we can use this review app: https://nextstrain-s-auspice-pr-r6szjr.herokuapp.com/ncov/open/global

@trvrb
Copy link
Member Author

trvrb commented Jul 9, 2021

Thanks James. This is really helpful. I, of course, like this functionality. If you do something like filter to Alpha, Beta, Gamma and Delta you get shown just the branch labels that are relevant and can see that 20A and 20B are the immediate common ancestors to these clades. I find:

hidden

to be visually cleaner and I can parse what's going on better than:

visible

Notice that hiding these labels makes the behavior of the legend mirror the behavior of the branch labels.

Likewise, if I filter to just South Africa, it makes it clearer what's circulating in South Africa (by having legend and branch labels signal):

south-africa-hidden

Compared to:

south-africa-visible

And of course, the original inclination with scatterplots like the above filtering to Alpha, Beta, Gamma, Delta gives a comparison of logistic growth rates that is parsable when filtered:

logistic-growth-hidden

Compared to:

logistic-growth-visible

which I have trouble visually parsing.

Emma, can you try out this PR and see how it feels for you? I'm very much in favor, but I think I don't fully understand your use case.

@emmahodcroft
Copy link
Member

My main concern here was just navigating with filters on, particularly when you've selected a bunch of tips (so that the time it takes to turn them on/off is long enough that you can totally forget where you were aiming to click). I think the merging of #1371 and #1372 will make navigating & zooming a lot easier, so that this won't be such an issue anymore - you can easily make all the branch labels visible again with a click or two. If all these can get merged in together, I think all will be working well and looking good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants