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

Sidebar toggle to show labels for all tips in tree #916

Open
jameshadfield opened this issue Mar 4, 2020 · 8 comments
Open

Sidebar toggle to show labels for all tips in tree #916

jameshadfield opened this issue Mar 4, 2020 · 8 comments
Assignees
Labels
good first issue A relatively isolated issue appropriate for first-time contributors please take this issue source: discussion forum Issue mentioned on Nextstrain Discussions source: office hours Issue mentioned during office hours

Comments

@jameshadfield
Copy link
Member

Background:

Currently we only display tip labels when the total number of tips in-view is below a certain threshold. This prevents hundreds of tips being displayed on big trees, and allows small trees, or zoomed in sections of trees, to display labels.

(Potentially see #237 for further information)

This issue

There should be a toggle in the sidebar (such as we have for "Show Confidence Intervals") which results in tips being displayed for all visible nodes. It's initial state should be defined by the threshold discussed above.

@jameshadfield jameshadfield added please take this issue good first issue A relatively isolated issue appropriate for first-time contributors labels Mar 4, 2020
@ntaft
Copy link

ntaft commented Mar 14, 2020

@jameshadfield New to the repo, and i'd be happy to take this on - just thought I would confirm the approach. I mocked this up so far on the zika dataset:

show all labels

Questions:

  • Toggle placement / labeling?
  • Would we show/hide the toggle on certain conditions, such as if all the labels are already in view etc.?
  • Should font size be scaled dynamically to prevent overflow? Granted, this may result in some microscopic font sizes in some cases.

Let me know if there is anything else I missed, thanks!

@jameshadfield
Copy link
Member Author

Thanks @ntaft ⭐️ Your mock looks along the right directions 👍

  • Placement: It should be directly below the toggle for "Show confidence intervals"
  • Wording: It should read "Display all tip labels"
  • Its shouldn't be hidden when (e.g) we're showing all tip labels (using our current logic for toggling them on/off, which Tip labels should only count visible tips #915 aims to improve). Rather it should update the toggle state in the sidebar. This involves more complicated state management as we have to keep track of whether the toggle has been modified by the user, and if so then we don't apply our existing logic to change this state.
  • Re: "Should font size be scaled dynamically to prevent overflow? Granted, this may result in some microscopic font sizes in some cases." Yes, I would be in favor of exploring this, but there will be many different cases to take care of, as some tip names can be very long. If possible (and you're interested) could you do this on a separate PR?

@cassiawag
Copy link
Contributor

cassiawag commented Apr 23, 2020

Thanks for the awesome work on this @ntaft! In addition to a text box that can be toggled on or off, can you also add a url option that toggles it on or off? @jameshadfield suggested ?tipLabels=on and ?tipLabels=off?

@ntaft
Copy link

ntaft commented Apr 24, 2020

Sorry for the delay on this - and yes, we should be able to add a url-based toggle as well without too much trouble, sounds like a good idea. Will work on wrapping this up this weekend, thanks!

@sidneymbell
Copy link
Contributor

+1 for this issue -- we've gotten a lot of requests from public health departments.

@ntaft -- is this something you're still interested in working on, or would it be useful to have someone else help or take this on? No worries either way, just wanted to follow up and update the issue :)

@ammaraziz
Copy link

ammaraziz commented Jan 27, 2022

Hi there,

I took a look at @ntaft fork. The code works well except there are a few instances when the tips either disappear or the toggle is not reset. I think this is due to the way the phyloTree.labels.updateTipLabels() was modified by ntaft to take in an argument alwaysDisplayTipLabels. There are 4 instances of phyloTree.labels.updateTipLabels() being called throughout the code.

Where I am stuck is knowning if this is the correct approach and if it is how to modify the calls to phyloTree.labels.updateTipLabels() to pass the argument alwaysDisplayTipLabels ( which is connected to state).

To be honest, I am completely new to react-redux and I'm not really sure the current implementation is correct. I think that updateTipLabels() should be left to take no arguments (except dt which is never passed).

To see the changes: ammaraziz@8016c8c

Thanks,

Ammar

@huddlej
Copy link
Contributor

huddlej commented Aug 31, 2023

A request for this feature came up at office hours today. A user was frustrated/confused when they turned on the tip labels from the Auspice control panel and no tip labels got displayed in the tree because there were too many samples in the tree. They only realized the tip labels had actually been enabled when they zoomed in.

Beyond providing a toggle to show all tip labels, could we also alert users to the constraint on how many tip labels can be shown at once?

@huddlej huddlej added the source: office hours Issue mentioned during office hours label Aug 31, 2023
@joverlee521
Copy link
Contributor

Discussion forum post of another user not expecting tip labels to be lost in a bigger tree.

@joverlee521 joverlee521 added the source: discussion forum Issue mentioned on Nextstrain Discussions label Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue A relatively isolated issue appropriate for first-time contributors please take this issue source: discussion forum Issue mentioned on Nextstrain Discussions source: office hours Issue mentioned during office hours
Projects
No open projects
Development

No branches or pull requests

7 participants