-
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 (fixed) #19
Conversation
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
Leads to better documentation where it is easier to understand how to use the anim_opts parameter
And no need to filter out NULL elements
Loving the idea with the animation options and all the other work you have put into this. Some thoughts that I had while reading through the code:
Otherwise I didn't find anything that needed changing. |
I think I'd rather just take this out. Initially, I was thinking we could use For now, you can run
data <- make_named_data(x, y, c(get_input_text(x), get_input_text(y))) and then
Yup, the join/set functions haven't been updated yet. I was using the tidy family as the example of how the |
Fixed version of #18
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 #16 in hopes that it's a little easier to review 😄