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

Legend no longer obscures branches/tips. #1302

Merged
merged 1 commit into from
Mar 10, 2021
Merged

Conversation

jameshadfield
Copy link
Member

Shifts the top of the tree down slightly so that tips and branches cannot be hidden behind the (closed) legend, which prevents interacting with them. This only happens in rectangular / unrooted trees, as radial / clock views almost never have tips rendered in the top-left corner.

image
Note that the horizontal position of the tips in this screenshot has been changed for testing purposes

This PR is a trade off -- we reduce the available display space for all (rectangular & unrooted) trees to prevent the (rare) cases of tips being rendered in the top-left corner and thus obscured by the legend. A more intelligent solution would be to make mapToScreen() aware of when tips are rendered behind the legend and only increase the margin in this case.

Closes #1295

Shifts the top of the tree down slightly so that tips and branches cannot be hidden behind the (closed) legend, which prevents interacting with them. This only happens in rectangular / unrooted trees, as radial / clock views almost never have tips rendered in the top-left corner.
@jameshadfield jameshadfield temporarily deployed to auspice-tree-behind-leg-pejttn March 10, 2021 00:09 Inactive
@trvrb trvrb self-requested a review March 10, 2021 00:19
@trvrb
Copy link
Member

trvrb commented Mar 10, 2021

This looks great to me. I think this can be merged. Testing suggests that 6px is a good amount of padding for this purpose.

@jameshadfield jameshadfield merged commit e880ea2 into master Mar 10, 2021
@jameshadfield jameshadfield deleted the tree-behind-legend branch March 10, 2021 00:21
@emmahodcroft
Copy link
Member

Late to the party but this looks great @jameshadfield ! While this is a bit of a rare case, certainly for me it's come up more often when looking at smaller clusters in 'divergence' view - if they're identical at the base, it's not uncommon to get some up in the top-left! So this will be very handy in those cases 😁

@jameshadfield jameshadfield mentioned this pull request Mar 30, 2021
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.

Legend masks branches and tips in upper left of tree panel
3 participants