Skip to content

Commit a2c6cf1

Browse files
committed
check_linewidth() performs an update
1 parent 8533322 commit a2c6cf1

13 files changed

+55
-12
lines changed

R/geom-.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ check_aesthetics <- function(x, n) {
271271
))
272272
}
273273

274-
check_linewidth <- function(data, name) {
274+
update_linewidth <- function(data, name) {
275275
if (is.null(data$linewidth) && !is.null(data$size)) {
276276
deprecate_soft0("3.4.0", I(paste0("Using the `size` aesthetic with ", name)), I("the `linewidth` aesthetic"))
277277
data$linewidth <- data$size

R/geom-boxplot.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ GeomBoxplot <- ggproto("GeomBoxplot", Geom,
227227
outlier.size = NULL, outlier.stroke = 0.5,
228228
outlier.alpha = NULL, notch = FALSE, notchwidth = 0.5,
229229
staplewidth = 0, varwidth = FALSE, flipped_aes = FALSE) {
230-
data <- check_linewidth(data, snake_class(self))
230+
data <- update_linewidth(data, snake_class(self))
231231
data <- flip_data(data, flipped_aes)
232232
# this may occur when using geom_boxplot(stat = "identity")
233233
if (nrow(data) != 1) {

R/geom-crossbar.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ GeomCrossbar <- ggproto("GeomCrossbar", Geom,
5555
draw_panel = function(self, data, panel_params, coord, lineend = "butt",
5656
linejoin = "mitre", fatten = 2.5, width = NULL,
5757
flipped_aes = FALSE) {
58-
data <- check_linewidth(data, snake_class(self))
58+
data <- update_linewidth(data, snake_class(self))
5959
data <- flip_data(data, flipped_aes)
6060

6161
middle <- transform(data, x = xmin, xend = xmax, yend = y, linewidth = linewidth * fatten, alpha = NA)

R/geom-errorbar.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ GeomErrorbar <- ggproto("GeomErrorbar", Geom,
6060

6161
draw_panel = function(self, data, panel_params, coord, lineend = "butt",
6262
width = NULL, flipped_aes = FALSE) {
63-
data <- check_linewidth(data, snake_class(self))
63+
data <- update_linewidth(data, snake_class(self))
6464
data <- flip_data(data, flipped_aes)
6565
x <- vec_interleave(data$xmin, data$xmax, NA, data$x, data$x, NA, data$xmin, data$xmax)
6666
y <- vec_interleave(data$ymax, data$ymax, NA, data$ymax, data$ymin, NA, data$ymin, data$ymin)

R/geom-errorbarh.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ GeomErrorbarh <- ggproto("GeomErrorbarh", Geom,
7474
},
7575

7676
draw_panel = function(self, data, panel_params, coord, height = NULL, lineend = "butt") {
77-
data <- check_linewidth(data, snake_class(self))
77+
data <- update_linewidth(data, snake_class(self))
7878
GeomPath$draw_panel(data_frame0(
7979
x = vec_interleave(data$xmax, data$xmax, NA, data$xmax, data$xmin, NA, data$xmin, data$xmin),
8080
y = vec_interleave(data$ymin, data$ymax, NA, data$y, data$y, NA, data$ymin, data$ymax),

R/geom-hex.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ geom_hex <- function(mapping = NULL, data = NULL,
5858
GeomHex <- ggproto("GeomHex", Geom,
5959
draw_group = function(self, data, panel_params, coord, lineend = "butt",
6060
linejoin = "mitre", linemitre = 10) {
61-
data <- check_linewidth(data, snake_class(self))
61+
data <- update_linewidth(data, snake_class(self))
6262
if (empty(data)) {
6363
return(zeroGrob())
6464
}

R/geom-path.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ GeomPath <- ggproto("GeomPath", Geom,
165165
draw_panel = function(self, data, panel_params, coord, arrow = NULL, arrow.fill = NULL,
166166
lineend = "butt", linejoin = "round", linemitre = 10,
167167
na.rm = FALSE) {
168-
data <- check_linewidth(data, snake_class(self))
168+
data <- update_linewidth(data, snake_class(self))
169169
if (!anyDuplicated(data$group)) {
170170
cli::cli_inform(c(
171171
"{.fn {snake_class(self)}}: Each group consists of only one observation.",

R/geom-polygon.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ geom_polygon <- function(mapping = NULL, data = NULL,
109109
GeomPolygon <- ggproto("GeomPolygon", Geom,
110110
draw_panel = function(self, data, panel_params, coord, rule = "evenodd",
111111
lineend = "butt", linejoin = "round", linemitre = 10) {
112-
data <- check_linewidth(data, snake_class(self))
112+
data <- update_linewidth(data, snake_class(self))
113113
n <- nrow(data)
114114
if (n == 1) return(zeroGrob())
115115

R/geom-rect.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ GeomRect <- ggproto("GeomRect", Geom,
6969
},
7070

7171
draw_panel = function(self, data, panel_params, coord, lineend = "butt", linejoin = "mitre") {
72-
data <- check_linewidth(data, snake_class(self))
72+
data <- update_linewidth(data, snake_class(self))
7373
if (!coord$is_linear()) {
7474
aesthetics <- setdiff(
7575
names(data), c("x", "y", "xmin", "xmax", "ymin", "ymax")

R/geom-ribbon.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ GeomRibbon <- ggproto("GeomRibbon", Geom,
133133
draw_group = function(self, data, panel_params, coord, lineend = "butt",
134134
linejoin = "round", linemitre = 10, na.rm = FALSE,
135135
flipped_aes = FALSE, outline.type = "both") {
136-
data <- check_linewidth(data, snake_class(self))
136+
data <- update_linewidth(data, snake_class(self))
137137
data <- flip_data(data, flipped_aes)
138138
if (na.rm) data <- data[stats::complete.cases(data[c("x", "ymin", "ymax")]), ]
139139
data <- data[order(data$group), ]

0 commit comments

Comments
 (0)