tidyverse / tidyverse/ggplot2

Discourage use of `optional_aes` field

Open
#6,393 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

API change 😈 internals :mag_right: layers :chart_with_upwards_trend:
Dominant language
R
Stars
7k
Forks
2.1k
Avg merge
59m
Merged PRs (30d)
2

Description

The Geom$optional_aes and Stat$optional_aes fields seem redundant to me.
Instead of having these fields, we can declare default_aes = aes(optional_aesthetic = NULL).
While I would like to see these fields go in their entirety, that seems like backward incompatible, so instead I propose to discourage these fields. We can (i) remove any references to that field in the extension vignette (ii) ensure we adopt the NULL-aesthetic approach within ggplot2 and (iii) check if the ggplot book would need to be adapted.
If we're in a violent mood we can start throwing deprecation warnings about that field, but it seems sensible to discourage first and reconsider the next release cycle.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Search the extension vignette and ggplot book for references to Geom$optional_aes and Stat$optional_aes, then inspect ggplot2's default_aes declarations for the NULL-aesthetic approach. Done means the documentation no longer promotes optional_aes and ggplot2's own declarations consistently use the proposed approach; deprecation warnings are explicitly optional.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
data-visualization, documentation
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.