Skip to content
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

reduce scope of nonstandard aesthetics #76

Open
corybrunson opened this issue Jan 7, 2025 · 1 comment
Open

reduce scope of nonstandard aesthetics #76

corybrunson opened this issue Jan 7, 2025 · 1 comment

Comments

@corybrunson
Copy link
Owner

geom_boxplot() demonstrates how nonstandard aesthetics for specific plot components can be scoped and handled within the layer constructor rather than built in to the ggproto. Several geometric objects in {ordr} are composite and should probably be refactored in this way.

@corybrunson
Copy link
Owner Author

Based on further tinkering, i think nonstandard aesthetic variables should be handled in two distinct ways, depending on their behavior:

  1. Variables that are not transformed before being passed to a $draw_*() function: Most commonly, these expect character strings; the stratum aesthetic in {ggalluvial} is an example. For all i know, errors might arise when they are passed the wrong kind of data, but for most use settings they should not require special handling.
  2. Variables that are transformed before being passed to a Geom*$draw_*() function: Color aesthetics are the most conspicuous examples, but these also include aesthetics like shape and linetype that accept only special codes in a limited number of types. I believe they also include positional aesthetics, which are pre-processed at least during Stat*$compute_*(). To encourage the coherent treatment of plot layers, i think these should be treated somewhat as in the boxplot ggprotos and shortcuts: They should default to agree with their primary component counterparts and be customizable only to fixed aesthetic values, not variable values in the data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant