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

Tip labels should only count visible tips #915

Closed
jameshadfield opened this issue Mar 4, 2020 · 1 comment · Fixed by #1043
Closed

Tip labels should only count visible tips #915

jameshadfield opened this issue Mar 4, 2020 · 1 comment · Fixed by #1043
Labels
good first issue A relatively isolated issue appropriate for first-time contributors please take this issue

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.

In auspice we refer to nodes / branches which are displayed on the screen as "in view". These tips may be "unselected" (e.g. filtering is applied), so that they are rendered but appear skeletal (very thin lines). This is referred to in the code to whether a tip is visible or not.

(Potentially see #237 for further information)

This issue

The hardcoded # of branches selected should only count "visibile" tips which are also in-view. For instance, filtering a large tree (many "in-view" nodes) to only have a few tips visible (e.g. select USA on the nCoV tree) should result in tip labels being displayed.

@frogsquire
Copy link
Contributor

frogsquire commented Apr 5, 2020

@jameshadfield I'd like to take this.

The fix, I believe, is in labels.js, line 14:

const inViewTerminalNodes = this.nodes .filter((d) => d.terminal) .filter((d) => d.inView);

should be

const inViewTerminalNodes = this.nodes .filter((d) => d.terminal) .filter((d) => d.inView) .filter((d) => d.visibility == NODE_VISIBLE);

As I understand it, this will make the number of nodes being checked to determine whether to show the tips calculate based only on nodes which are fully "visible", not nodes which are visible, but unselected.

If this looks acceptable to you, I have made a PR.

frogsquire added a commit to frogsquire/auspice that referenced this issue Apr 5, 2020
…count of fully visible nodes, not all in-view nodes
frogsquire added a commit to frogsquire/auspice that referenced this issue Apr 5, 2020
jameshadfield added a commit that referenced this issue Apr 8, 2020
* pr-1043:
  Improve tree label font sizes
  #915: using triple equals
  #915: determine whether tip label should be shown based on count of fully visible nodes, not all in-view nodes
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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants