-
Notifications
You must be signed in to change notification settings - Fork 23
Update path color and legend handling #151
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
Open
robe2037
wants to merge
22
commits into
16EAGLE:master
Choose a base branch
from
robe2037:color-by-var
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or 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
Makes `frames_spatial()` consistent with `frames_graph()` after fixing label mapping
This allows for color scale to dynamically adapt to levels in attribute data
Uses scales package to simplify color mapping
For consistency with `path_colours`
Have not updated anything currently listed as out-of-date
int64 common in move2 objects
Makes legend mapping more robust and reduces skew in continuous legends
Speeds up animations that color by continuous vars
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 revises the way color palettes are handled for path coloring. The main updates are:
color_paths_byargument toframes_spatial(),frames_graph(), andview_spatial(). This argument accepts a variable name (either for a track attribute or event attribute) to use for coloring tracks. This replaces the need/option to manually generate acolourcolumn in the input data prior to generating the animation frames. Instead, users can provide the variable name and the color mapping is handled internally.path_coloursnow also accepts a palette function in addition to a vector of colors. This allows users to flexibly color tracks without needing prior knowledge about the number of levels that exist in the attribute being used for coloring.frames_graph()because of seemingly limited utility for this use-case.)One downside to the current approach is that the legend construction is somewhat decoupled from the coloring of the tracks (i.e. we don't use the palettes that are passed for construction of the legend directly when generating track colors). This is a consequence of the fact that track coloring requires additional detail to correctly color tails/traces, but it does make the code less internally consistent. Still, the legend construction does reliably reflect the track colors using this approach.
As a note, this branch also depends directly on the
legend-lbls-fixbranch, which has a separate PR. This is because it wouldn't have been possible to check whether legend behavior was correct without having already fixed the baseline legend ordering.