-
Notifications
You must be signed in to change notification settings - Fork 181
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
Add framework for animation options #18
Closed
Closed
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
And demonstrates usage with the tidyr gather/spread animators. In essence, user-facing functions take an argument `anim_opts = anim_options()` as a last argument (after ... if applicable). These options should be passed through to lower level functions and should be given to `animate_plot()` and `static_plot()`. This implementation actually doesn't break previous functions, but the join and set families will need to be updated to match.
And update documentation for both options
Set option "tidyexplain.strict_dots" to TRUE for checking for issues with extra arguments being passed in ... to the _plot() functions.
ggproto objects like those created by enter_fade() or exit_appear() evaluate to enviroments making it impossible to compare two ggproto objects to determine if they are the same (both will be different environments). To get around this, I store the expression used to create the enter/exit arguments so that we can later compare two objects created by anim_options().
Lets us define default animation options by animation family that can be overridden by the user at runtime. Demonstration of usage with animate_gather() and animate_spread()
- Sets global defaults in plot_settings environment - Adds ability to set animation options, similar to theme_set() from ggplot2 - Adds getters for current (if set) or default animation options Merge branch 'pkg-add-anim-options' into pkg-add-anim-options-merge
And demonstrates usage with the tidyr gather/spread animators. In essence, user-facing functions take an argument `anim_opts = anim_options()` as a last argument (after ... if applicable). These options should be passed through to lower level functions and should be given to `animate_plot()` and `static_plot()`. This implementation actually doesn't break previous functions, but the join and set families will need to be updated to match.
And update documentation for both options
Set option "tidyexplain.strict_dots" to TRUE for checking for issues with extra arguments being passed in ... to the _plot() functions.
ggproto objects like those created by enter_fade() or exit_appear() evaluate to enviroments making it impossible to compare two ggproto objects to determine if they are the same (both will be different environments). To get around this, I store the expression used to create the enter/exit arguments so that we can later compare two objects created by anim_options().
- Collected in animate_options.R - Sets global defaults in plot_settings environment - Adds ability to set animation options, similar to theme_set() from ggplot2 - Adds getters for current (if set) or default animation options Merge branch 'pkg-add-anim-options-merge' into pkg-add-anim-options # Conflicts: # NAMESPACE # R/animate_tidyr.R # R/plot_helpers.R # man/anim_options.Rd # man/animate_gather.Rd # man/animate_spread.Rd # man/static_plot.Rd
I fixed the commit history in the new PR #19 |
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 is an extension of #16 and that will help us move towards resolving #17.
It sets up a framework for creating, setting and transporting the animation options that may need to be passed through several helper functions to get to the final
animate_plot()
orstatic_plot()
call.It also lets
theme_set()
in ggplot2I've created a more detailed explanation in this gist that also demonstrates some of the work from #16.
I'm bundling this as a PR to a PR in hopes that it's a little easier to review 😄
Note: somehow I ended up with duplicate commits because I tried to do something complicated with git locally. This PR should definitely be squash-merged into
pkg-updates
.