Intro Thoughts
Status Quo
library(tidyverse)
Experiment
library(ggforce)
combine_aes <- function(aes1, aes2) {
aes_all <- c(aes1[setdiff(names(aes1), names(aes2))], aes2)
class(aes_all) <- class(aes1)
aes_all
}
GeomShape$default_aes
## Aesthetic mapping:
## * `colour` -> NA
## * `fill` -> `from_theme(col_mix(ink, paper, 0.2))`
## * `linewidth` -> `from_theme(borderwidth)`
## * `linetype` -> `from_theme(bordertype)`
## * `alpha` -> NA
## * `subgroup` -> NULL
GeomCircle <- ggproto('GeomCircle', GeomShape,
default_aes = combine_aes(GeomShape$default_aes,
aes(colour = 'black',
fill = NA)) )
combine_aes(GeomShape$default_aes, aes(colour = 'black', fill = NA))
## Aesthetic mapping:
## * `linewidth` -> `from_theme(borderwidth)`
## * `linetype` -> `from_theme(bordertype)`
## * `alpha` -> NA
## * `subgroup` -> NULL
## * `colour` -> "black"
## * `fill` -> NA
modifyList(GeomShape$default_aes, aes(colour = 'black', fill = NA))
## Aesthetic mapping:
## * `colour` -> "black"
## * `fill` -> NA
## * `linewidth` -> `from_theme(borderwidth)`
## * `linetype` -> `from_theme(bordertype)`
## * `alpha` -> NA
## * `subgroup` -> NULL