-
Notifications
You must be signed in to change notification settings - Fork 162
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
Temporal visibility #639
Temporal visibility #639
Conversation
I agree with the intention, but I don't think this works as implemented. It breaks the logic of how we calculate map transitions. Compare: http://localhost:4000/zika?dmax=2014-05-11&dmin=2013-08-13 You can see that the transition from Brazil to Haiti is definitely in the window. However, on the PR branch the map does not show this transition. Consequently, if you click to play the animation, it appears quite broken. Same for Ebola. I think this requires deeper changes to get working. |
Hmm, yeah the map animation looks much worse with this. But I also think the tree, as it currently stands, is extremely misleading (e.g. the first screenshot). So in that time slice, there's a branch from an ancestral state of Dom. Rep. (which is within the selected time slice) to Haiti (outside of the slice). The migration event could have occurred anywhere on that branch (and included unsampled intermediates). For the tree, I think this PR is better than the current release, i.e. this branch shouldn't be displayed. But for the For the map, where we infer a gradual missile from Dom. Rep to Haiti over the branch length, this PR is terrible. I wonder if a solution which changes the One alternative would be to move the map slicing of these "partially in-selection" branches to redux state and changing the tree to draw those branches as partially in-selection, which is much more involved. |
This allows better representation of "visible" nodes across the tree (w.r.t the selected time slice), whilst preserving the desired map behavior.
This PR now extends the |
This is a really fantastic change. I didn't realize how broken the tree visibility really was until you added the gray boxing. With this in place, the animation looks substantially better on the tree. Definitely a hacky solution, but one that seems to work really well in practice. My only code issue is the use of |
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 is great. I have avoided showing animations so far because their behavior was so odd. regarding Trevor's proposal: having integers as states might be good for performance reasons (I doubt it makes a big difference though) but reduce readability.
What about defining states like HIDDEN=0
, 'MAPONLY=1,
VISIBLE=2` or similar and use these names in the code (akin to preprocessor directives in C)
Good ideas - now implemented using named constants |
This PR changes the temporal branch filtering to only highlight branches whose end-points (tips for terminal nodes) are within the current time slice (previously it was highlighted if any time point between the tip and the parent node intersected with the selected time slice).
Before:
After:
This isn't perfect, and doesn't address all the concerns in #473, but I think it's an improvement.