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

Support clicking on barplots to show details #308

Open
1 of 4 tasks
fedarko opened this issue Aug 6, 2020 · 2 comments
Open
1 of 4 tasks

Support clicking on barplots to show details #308

fedarko opened this issue Aug 6, 2020 · 2 comments

Comments

@fedarko
Copy link
Collaborator

fedarko commented Aug 6, 2020

Analogously to how collapsed clades can be clicked on to show the clade's root node. Doing something similar here -- where clicked-on bars pop open a menu for their corresponding tip node -- would be really useful, esp. for datasets like the moving pictures tree where there are a few silly long branches that push out the barplots away from the rest of the tree.

Probably less important than #299, but would still be nice.

  • Pop up node selection menu when clicking on a bar
  • Anchor node selection menu to the clicked-on position, rather than having it jump over to the position of the corresponding node
  • Ensure that precision issues from before (where the wrong tip was selected when clicking close to the border of the bar) are resolved. I can't easily replicate these any more, but they may still be lurking in the code.
  • Draw "selection" outline on the clicked-on bar? (not necessary.)
    • This would be really useful if we can't immediately resolve the precision issues; showing the selected bar will make it clear if the selection was slightly "off" from what the user expected.
@fedarko
Copy link
Collaborator Author

fedarko commented Sep 3, 2020

may be good to defer this until #318 is addressed, since there will likely be similar performance problems with this for large trees that'd benefit from some fancy math.

@fedarko
Copy link
Collaborator Author

fedarko commented Sep 8, 2020

This came up at this morning's meeting as another way (along with #366) to make barplots easier to explore.

It may be possible to make this somewhat faster than the "compute distance to all nodes" solution used for determining which node a user selected; since rectangular layout barplots are all at the same x-axis position (for a given layer anyway), and since circular layout barplots for a given layer are all at the same radius, we can just look at the y-coordinate (rect) or angle (circular: we can determine this for an arbitrary clicked position by computing arccos(x / radius)) and use that to figure out which tip to select.

I guess we can (when a click event happens) look at the position and check that it's past the first barplot layer? i.e. past the leftmost barplot layer's leftmost x-coordinate in the rect layout, or past the innermost barplot layer's innermost radius in the circular layout -- and use that to determine whether to pick the closest node or the closest barplot layer.

...hopefully shouldn't be too bad :)

@kwcantrell kwcantrell added this to the Third Beta Release milestone Oct 20, 2020
fedarko added a commit to fedarko/empress that referenced this issue Oct 20, 2020
Bugs:

- for some reason this selects internal nodes sometimes? even though
  it should be filtering to leaves. not sure.
- menu isn't positioned correctly (at barplot)
- menu doesn't show up until tree is zoomed or panned, implying
  that the drawtree call somehow isn't working
@fedarko fedarko self-assigned this Oct 20, 2020
@ElDeveloper ElDeveloper modified the milestones: 1.1 Release, Pre-Refactor Nov 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants