-
Notifications
You must be signed in to change notification settings - Fork 166
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
Conversation
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.
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.
There was a problem hiding this 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.
This is great! Based on current behavior, I'd be supportive of merging. A couple brief thoughts however:
|
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. |
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. |
See commit messages for details.