default_aes not used in compute_*() methods
Nobody has claimed this yet.
- Dominant language
- R
- Stars
- 7k
- Forks
- 2.1k
- Avg merge
- 59m
- Merged PRs (30d)
- 2
Description
While writing about extensions I noticed that the content of default_aes in a stat is not added to the data before it is passed through the compute_*() mill. This effectively renders it useless for anything but defining mappings for the geom.
The current code reflects this as it has all sorts of code around extracting non-required aesthetics from the data, e.g. in StatBinHex
we set a default weight, but still has to guard it with data$weight %||% rep(1L, nrow(data)) when using it in compute_group()
I cannot see any meaningful reason why this is so, and the fix seems obvious. Have I missed an underlying reason @hadley?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with R/stat-binhex.r, especially the default weight handling around the linked lines, and trace how default_aes data reaches compute_*() methods. Compare the current StatBinHex behavior with other Stat implementations and existing tests; done means defaults are available during computation without breaking aesthetic mappings or required-aesthetic handling.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100