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

Improve ability to zoom out in the tree #1392

Merged
merged 4 commits into from
Sep 16, 2021
Merged

Improve ability to zoom out in the tree #1392

merged 4 commits into from
Sep 16, 2021

Conversation

jameshadfield
Copy link
Member

See commit messages for details.

The clipping introduced in v2.30.0 often obscured the stem of the root node for rectangular trees, resulting in it being hard to click on this branch to zoom out. Here we modify the domain of the x axis to allow space for such a branch to be rendered, iff the tree is zoomed.

Note that this does not solve the bigger issue of hard-to-find root branches!
Our previous method for zooming out worked well when the root-branch of the clade itself had some horizontal length (i.e. it wasn't a very short temporal branch, or a branch with ~zero divergence). This proved problematic in many situations, especially when viewing outbreak trees which often had clades with little divergence.

The solution here adds a small icon button to the current row of buttons above the tree. This icon becomes active when the tree is zoomed.

Note that this is only implemented for the main (left) tree at the current time. A second (tangle) tree can still be zoomed by the previous method.
@jameshadfield jameshadfield temporarily deployed to auspice-up-branch-emvlsu2xkqmm September 14, 2021 07:45 Inactive
Use an icon that is more universally interpreted as "zoom out".
The zoom out button also zooms out of the second tree if its root index
is not 0. This means the zoom out button will affect both trees if they
are both zoomed in. If the user wants to zoom out of one specific tree,
they would have to use the old method of clicking on the root branch
of the tree.

This pattern makes sense to me since the user already has to click on
each tree individually to zoom in. The previously existing buttons for
zoom to selected and reset layout also affects both trees.
@jameshadfield jameshadfield temporarily deployed to auspice-up-branch-emvlsu2xkqmm September 14, 2021 19:49 Inactive
Copy link
Contributor

@joverlee521 joverlee521 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works great! There's the added bonus of being able to zoom out after clicking the "zoom to selected" button as well! Previously this was not possible since the root branch was "inactivated" with the filter.

I updated the icon to be clear that the button is a "zoom out" button. I also added zoom out for the second tree. This means the zoom out button affects both trees, so if the user wants to zoom out of a specific tree they would have to use the old method of clicking the root branch. This pattern makes sense to me since the user already has to click on each tree individually in order to zoom in.

@joverlee521
Copy link
Contributor

This should close #1348 and maybe #1390?

@trvrb
Copy link
Member

trvrb commented Sep 14, 2021

This is great! Based on current behavior, I'd be supportive of merging. A couple brief thoughts however:

  1. I had pictured the icon appearing over the root node when mousing over the tree. However, I really like having the icon in the row at the top, it makes it discoverable and not too in the way.
  2. It slightly bugs me that the map zoom out is just a minus icon, while the tree zoom out is the magnifying glass minus icon. However, I would think just minus would be confusing and "zoom out" would take up too much space.

@emmahodcroft
Copy link
Member

After playing with this a bit, I really like it! I agree with Trevor that I'd pictured the button differently but I actually find that position very neat and tidy and accessible.

@jameshadfield
Copy link
Member Author

Thanks for the feedback and the improvements @joverlee521 - I think the icons can still be improved a bit in the future, but merging this now as it's immediately useful.

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.

4 participants