-
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
Map improvements including transmission ribbons #712
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This jitters the height of the Bezier curve of each transmission line based on the the specific count of deme A to deme B. This causes lines to become ribbons with thickness proportional to the number of transmission events.
Previously, deme circle area was directly proportional to tip count. This caused bigger datasets to have too large circles and smaller datasets to have too small circles. This commit adds a factor based on total node count to equilibrate. Testing across existing datasets suggests an improvement.
This improves initial fit of map bounds, mainly by setting "zoomSnap" parameter to 0.5, rather than the 1.0 default.
I like it. looks much better IMO! |
I'm going to go ahead and merge this as well. |
There is one aspect that looks a little strange: |
Thanks for catching this Richard. I know what this is (stroke color not updating on colorBy change). Edit: Fixed in: cefef4a |
Looks great! |
cool! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR includes a few separate map improvements.
Here's current Ebola:
Here's an animation of flu spread:
This just adds an additional
extend
parameter that is propagated down through the map code to the underlyingbezier
math that pushes the arc out byextend
number of pixels.extend
for a particular pair of demes starts at 0 and increments with each transmission event.This was mainly motivated by the ugliness of current regional flu view, but I think made a big difference overall. Compare before:
To after:
This mostly addresses #280. Initial deme radii look good. Zooming out too far on a narrow set of regions (like Ebola in West Africa or H7N9 in China) doesn't look great, but it's really not bad.
Improve initial map bounds logic. This is a small fix to make initial zoom bounds better fit to the lat/longs that are present. Essentially we just needed to set Leaflet's
zoomSnap
to something more granular than the default 1.Don't show error for missing lat/longs if deme is labeled "Unknown" or "unknown". This was apparent in https://nextstrain.org/community/inrb-drc/ebola-nord-kivu, where the samples that are labeled as "unknown" really should not have an associated lat/long.
Add very slight border to deme circles. I think this looks stronger and more grounded.
Resolves #425.
Resolves #369.