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

tree branch visibility is incorrect #473

Closed
jameshadfield opened this issue Oct 24, 2017 · 5 comments
Closed

tree branch visibility is incorrect #473

jameshadfield opened this issue Oct 24, 2017 · 5 comments
Labels
bug Something isn't working

Comments

@jameshadfield
Copy link
Member

jameshadfield commented Oct 24, 2017

As it stands, any branch that is present within the selected time slice is "visible". E.g. the branch joining a tip from 2016 with a parent in 2013 will be selected if the max date is 2014.

Furthermore, as both tips & branches use the same visibility array, the 2016 tip (in the above example) is shown as visible.

This screenshot indicates zika filtered to a max date of 2014:
image

@jameshadfield jameshadfield added bug Something isn't working help wanted labels Oct 24, 2017
@trvrb
Copy link
Member

trvrb commented Oct 24, 2017

I've been annoyed by this as well. My only thought for a solution has been to break up branches into multiple subbranches, each with 1 parent and 1 child node. However, I was worried about this for performance reasons as it would significantly increase the number of SVG objects, which has already shown to be a performance bottleneck.

Alternatively, there could be some way to change x-values for nodes dynamically based on time interval selected. This would give more of a growing tree effect than the current approach.

@jameshadfield
Copy link
Member Author

jameshadfield commented Oct 24, 2017

You could do it with one extra SVG line per branch and using stroke-dasharray or changing the d attribute. With the way phylotree works, this isn't easy.

@trvrb
Copy link
Member

trvrb commented Oct 24, 2017

Yes. I'm afraid of digging too deep into Phylotree and would instead be thinking of solutions that change the "data" supplied to phylotree.

@jameshadfield
Copy link
Member Author

@evogytis and I have a possible solution to this:

  • On the initial rendering of a tree (or after layout changes, zoom into clade etc etc) draw the skeleton tree - the entire tree with thin branches - what's currently the "not visible" state.
  • When rendering "true" branches, only render those which are visible.
  • If a branch is visible, but intersects the time slice, only draw the portion of the branch which is in view (i.e. modify the x co-ordinates)

This should actually make animation, filtering etc much faster, as the skeleton tree is left unchanged and so we are rendering far fewer branches at each time point.

This was referenced Aug 24, 2018
@jameshadfield
Copy link
Member Author

Closed in #639

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants