-
Notifications
You must be signed in to change notification settings - Fork 2k
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
non-standard params / geom-specific metadata #1694
Comments
It makes a bit more sense now, though I'm still unsure if this is the best approach. Is there any sense in different layers having different settings for chunk_vars? What I'm getting at is, couldn't this option be set globally rather than through each geom? |
yes each layer has a different value of chunk_vars for global options we already have a PR accepted for non-standard theme options #1121 |
hey @thomasp85 @hadley can you please comment on this approach for adding geom-specific metadata? If this is not appropriate can you please explain why, and suggest and alternative? |
Well, the good news is that you'll no longer get an error, but you'll now get a warning for both the aesthetic and the parameter. Can you remind me why you don't want to provide your own geom functions with extra parameters? |
Thanks! That solves this issue then. I guess we could provide our own geom functions with extra parameters, but I did not want to have to copy all the geom code to animint, and make users have to learn new geom functions. |
Hello, this is continuing the discussion from #1649 and #1585 our equivalent animint issue is tdhock/animint#159
For https://github.com/tdhock/animint we need some way of specifying
chunk_vars
which is a geom-specific parameter that has nothing to do with how it appears. With old ggplot2 (pre-2.0) the following was working fineWith current ggplot2 that now results in an error
Basically we just need a way for ggplot2 to store that information in the geom, ideally without throwing any errors/warnings/messages. The use case is described by @faizan-khan-iit 's excellent test case from his PR 017b0f3 -- we want the geom to store whatever information is provided in those non-standard parameters, so it can be accessed later by our animint code.
One way to achieve this would be to use Faizan's
validate_params=FALSE
method #1649 but that PR was rejected by @hadleyLet me propose another way:
meta
should be recognized by ggplot2 as a special meta-data parameter (no warnings or messages about meta being an unknown parameter). whatever was specified asmeta
should be accessible vial$meta
Comments?The text was updated successfully, but these errors were encountered: