Skip to content

Commit 230ec50

Browse files
committed
use ink/paper bypass in defaults
1 parent 1eff185 commit 230ec50

29 files changed

+59
-86
lines changed

R/annotation-logticks.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ GeomLogticks <- ggproto("GeomLogticks", Geom,
229229
},
230230

231231
default_aes = aes(
232-
colour = from_theme(ink),
232+
colour = from_theme(colour %||% ink),
233233
linewidth = from_theme(linewidth),
234234
linetype = from_theme(linetype),
235235
alpha = 1

R/geom-abline.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ GeomAbline <- ggproto("GeomAbline", Geom,
147147
},
148148

149149
default_aes = aes(
150-
colour = from_theme(ink),
150+
colour = from_theme(colour %||% ink),
151151
linewidth = from_theme(linewidth),
152152
linetype = from_theme(linetype),
153153
alpha = NA

R/geom-boxplot.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -395,8 +395,8 @@ GeomBoxplot <- ggproto("GeomBoxplot", Geom,
395395
draw_key = draw_key_boxplot,
396396

397397
default_aes = aes(
398-
weight = 1, colour = from_theme(col_mix(ink, paper, 0.2)),
399-
fill = from_theme(paper), size = from_theme(pointsize),
398+
weight = 1, colour = from_theme(colour %||% col_mix(ink, paper, 0.2)),
399+
fill = from_theme(fill %||% paper), size = from_theme(pointsize),
400400
alpha = NA, shape = from_theme(pointshape), linetype = from_theme(bordertype),
401401
linewidth = from_theme(borderwidth),
402402
width = 0.9

R/geom-contour.R

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,7 @@ geom_contour_filled <- function(mapping = NULL, data = NULL,
124124
#' @export
125125
#' @include geom-path.R
126126
GeomContour <- ggproto("GeomContour", GeomPath,
127-
default_aes = aes(
128-
weight = 1,
129-
colour = from_theme(accent),
130-
linewidth = from_theme(linewidth),
131-
linetype = from_theme(linetype),
132-
alpha = NA
133-
)
127+
default_aes = aes(weight = 1, !!!GeomPath$default_aes)
134128
)
135129

136130
#' @rdname ggplot2-ggproto

R/geom-crossbar.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ GeomCrossbar <- ggproto("GeomCrossbar", Geom,
7979
},
8080

8181
default_aes = aes(
82-
colour = from_theme(ink),
83-
fill = NA,
82+
colour = from_theme(colour %||% ink),
83+
fill = from_theme(fill %||% NA),
8484
linewidth = from_theme(borderwidth),
8585
linetype = from_theme(bordertype),
8686
alpha = NA

R/geom-curve.R

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,6 @@ geom_curve <- function(mapping = NULL, data = NULL,
4141
#' @export
4242
GeomCurve <- ggproto("GeomCurve", GeomSegment,
4343

44-
default_aes = aes(
45-
colour = from_theme(ink),
46-
linewidth = from_theme(linewidth),
47-
linetype = from_theme(linetype),
48-
alpha = NA
49-
),
50-
5144
draw_panel = function(data, panel_params, coord, curvature = 0.5, angle = 90,
5245
ncp = 5, arrow = NULL, arrow.fill = NULL, lineend = "butt", na.rm = FALSE) {
5346

R/geom-density.R

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,12 @@ geom_density <- function(mapping = NULL, data = NULL,
9292
#' @export
9393
#' @include geom-ribbon.R
9494
GeomDensity <- ggproto("GeomDensity", GeomArea,
95-
default_aes = defaults(
96-
aes(fill = NA, weight = 1, colour = from_theme(ink), alpha = NA),
97-
GeomArea$default_aes
95+
default_aes = aes(
96+
colour = from_theme(colour %||% ink),
97+
fill = from_theme(fill %||% NA),
98+
weight = 1,
99+
alpha = NA,
100+
linewidth = from_theme(borderwidth),
101+
linetype = from_theme(bordertype)
98102
)
99103
)

R/geom-density2d.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ geom_density2d <- geom_density_2d
107107
#' @export
108108
GeomDensity2d <- ggproto("GeomDensity2d", GeomPath,
109109
default_aes = aes(
110-
colour = from_theme(accent),
110+
colour = from_theme(colour %||% accent),
111111
linewidth = from_theme(linewidth),
112112
linetype = from_theme(linetype),
113113
alpha = NA

R/geom-dotplot.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,8 @@ GeomDotplot <- ggproto("GeomDotplot", Geom,
189189
non_missing_aes = c("size", "shape"),
190190

191191
default_aes = aes(
192-
colour = from_theme(ink),
193-
fill = from_theme(ink),
192+
colour = from_theme(colour %||% ink),
193+
fill = from_theme(fill %||% ink),
194194
alpha = NA,
195195
stroke = from_theme(borderwidth * 2),
196196
linetype = from_theme(linetype),

R/geom-errorbar.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ geom_errorbarh <- function(mapping = NULL, data = NULL,
5959
GeomErrorbar <- ggproto("GeomErrorbar", Geom,
6060

6161
default_aes = aes(
62-
colour = from_theme(ink),
62+
colour = from_theme(colour %||% ink),
6363
linewidth = from_theme(linewidth),
6464
linetype = from_theme(linetype),
6565
width = 0.9,

0 commit comments

Comments
 (0)