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

Keep sources of the root of the zoomed-subtree in sync. Closes #1139 #1156

Merged
merged 1 commit into from
Jun 9, 2020

Conversation

jameshadfield
Copy link
Member

We keep track of the root-node of the currently selected subtree within auspice via two pieces of state: idxOfInViewRootNode (redux state) and zoomNode (phylotree state). They were out-of-sync when loading a tree in a zoomed state, which resulted in the inability to zoom out via clicking on a basal branch. This commit fixes this bug.

Long term, it would be better to only store this state in one place. This would involve some refactoring in order to expose the relevant redux state to callbacks such as onBranchClick.

We keep track of the root-node of the currently selected subtree within auspice via two pieces of state: `idxOfInViewRootNode` (redux state) and `zoomNode` (phylotree state). They were out-of-sync when loading a tree in a zoomed state, which resulted in the inability to zoom out via clicking on a basal branch. This commit fixes this bug. It would be better to only store this state in one place.
@jameshadfield jameshadfield temporarily deployed to auspice-improve-tree-zo-xzeexb June 5, 2020 00:57 Inactive
Copy link
Contributor

@eharkins eharkins left a comment

Choose a reason for hiding this comment

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

Looks good, fixes the issue as described in the original issue as well as in at least one other dataset I tested using a query like ?label=clade:DENV1/I. I was confused how to set the label query using something other than a clade name, after reading the view settings doc - perhaps the dataset needs explicitly labeled branches to do that? Happy to help extend the doc if necessary.

Should I open another issue for the long term state consolidation here?

@jameshadfield jameshadfield merged commit aa9e36a into master Jun 9, 2020
@jameshadfield jameshadfield deleted the improve-tree-zoom-logic branch June 9, 2020 04:16
@jameshadfield
Copy link
Member Author

perhaps the dataset needs explicitly labeled branches to do that?

Correct, the dataset JSON itself defines branch labels (a common label key is "clade").

Should I open another issue for the long term state consolidation here?

I feel as this should be noted somewhere, but not as an issue. This is an example of the broader topic of phylotree-state vs redux-state. Sometimes they are duplicated (like here), and sometimes they are separate but in complex ways. Any attempts to address this should be part of a higher-level direction decision.

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.

2 participants