Skip to content

Commit bb9fc8f

Browse files
authored
Merge branch 'main' into convert_linetype_nas
2 parents fd9830e + ffdfc23 commit bb9fc8f

File tree

119 files changed

+20037
-24696
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

119 files changed

+20037
-24696
lines changed

DESCRIPTION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@ Collate:
247247
'stat-bindot.R'
248248
'stat-binhex.R'
249249
'stat-boxplot.R'
250+
'stat-connect.R'
250251
'stat-contour.R'
251252
'stat-count.R'
252253
'stat-density-2d.R'

NAMESPACE

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,7 @@ export(StatBin2d)
257257
export(StatBindot)
258258
export(StatBinhex)
259259
export(StatBoxplot)
260+
export(StatConnect)
260261
export(StatContour)
261262
export(StatContourFilled)
262263
export(StatCount)
@@ -684,6 +685,7 @@ export(stat_bin_2d)
684685
export(stat_bin_hex)
685686
export(stat_binhex)
686687
export(stat_boxplot)
688+
export(stat_connect)
687689
export(stat_contour)
688690
export(stat_contour_filled)
689691
export(stat_count)
@@ -741,7 +743,6 @@ export(theme_sub_panel)
741743
export(theme_sub_plot)
742744
export(theme_sub_strip)
743745
export(theme_test)
744-
export(theme_transparent)
745746
export(theme_update)
746747
export(theme_void)
747748
export(transform_position)

NEWS.md

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
# ggplot2 (development version)
22

3-
* `linetype = NA` is now interpreted to mean 'no line' instead of raising errors
4-
(@teunbrand, #6269).
3+
* New `stat_connect()` to connect points via steps or other shapes
4+
(@teunbrand, #6228)
5+
* Fixed regression with incorrectly drawn gridlines when using `coord_flip()`
6+
(@teunbrand, #6293).
7+
* Deprecated functions and arguments prior to ggplot2 3.0.0 throw errors instead
8+
of warnings.
9+
* Functions and arguments that were soft-deprecated up to ggplot2 3.4.0 now
10+
throw warnings.
511
* (internal) layer data can be attenuated with parameter attributes
612
(@teunbrand, #3175).
713
* Date scales silently coerce <POSIXct> to <Date> and datetime scales silently
@@ -245,8 +251,8 @@
245251
and (non-text) margins inherit from (@teunbrand, #5622).
246252
* `geom_ribbon()` can have varying `fill` or `alpha` in linear coordinate
247253
systems (@teunbrand, #4690).
248-
* `geom_tile()` computes default widths and heights per panel instead of
249-
per layer (@teunbrand, #5740).
254+
* `geom_tile()` and `position_jitter()` computes default widths and heights
255+
per panel instead of per layer (@teunbrand, #5740, #3722).
250256
* The `fill` of the `panel.border` theme setting is ignored and forced to be
251257
transparent (#5782).
252258
* `stat_align()` skips computation when there is only 1 group and therefore
@@ -276,8 +282,11 @@
276282
is setup once in total instead of once per group (@teunbrand, #5971)
277283
* `facet_grid(space = "free")` can now be combined with `coord_fixed()`
278284
(@teunbrand, #4584).
279-
* `theme_classic()` now has black ticks and text instead of dark gray. In
280-
addition, `theme_classic()`'s axis line end is `"square"` (@teunbrand, #5978).
285+
* `theme_classic()` has the following changes (@teunbrand, #5978 & #6320):
286+
* Axis ticks are now black (`ink`-coloured) instead of dark gray.
287+
* Axis line ends are now `"square"`.
288+
* The panel grid is now blank at the `panel.grid` hierarchy level instead of
289+
the `panel.grid.major` and `panel.grid.minor` levels.
281290
* {tibble} is now suggested instead of imported (@teunbrand, #5986)
282291
* The ellipsis argument is now checked in `fortify()`, `get_alt_text()`,
283292
`labs()` and several guides (@teunbrand, #3196).
@@ -316,6 +325,13 @@
316325
(@teunbrand, #4335).
317326
* `ggsave()` can write a multi-page pdf file when provided with a list of plots
318327
(@teunbrand, #5093).
328+
* (internal) When `validate_subclass()` fails to find a class directly, it tries
329+
to retrieve the class via constructor functions (@teunbrand).
330+
* (internal) The ViewScale class has a `make_fixed_copy()` method to permit
331+
copying trained position scales (#3441).
332+
* Improved consistency of curve direction in `geom_curve()` (@teunbrand, #5069)
333+
* `linetype = NA` is now interpreted to mean 'no line' instead of raising errors
334+
(@teunbrand, #6269).
319335

320336
# ggplot2 3.5.1
321337

R/aes.R

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ is_position_aes <- function(vars) {
290290
#'
291291
#' @export
292292
aes_ <- function(x, y, ...) {
293-
deprecate_soft0(
293+
deprecate_warn0(
294294
"3.0.0",
295295
"aes_()",
296296
details = "Please use tidy evaluation idioms with `aes()`"
@@ -317,7 +317,7 @@ aes_ <- function(x, y, ...) {
317317
#' @rdname aes_
318318
#' @export
319319
aes_string <- function(x, y, ...) {
320-
deprecate_soft0(
320+
deprecate_warn0(
321321
"3.0.0",
322322
"aes_string()",
323323
details = c(
@@ -360,7 +360,7 @@ aes_all <- function(vars) {
360360
# refer to the data mask
361361
structure(
362362
lapply(vars, function(x) new_quosure(as.name(x), emptyenv())),
363-
class = "uneval"
363+
class = c("unlabelled_uneval", "uneval")
364364
)
365365
}
366366

@@ -374,29 +374,7 @@ aes_all <- function(vars) {
374374
#' @keywords internal
375375
#' @export
376376
aes_auto <- function(data = NULL, ...) {
377-
deprecate_warn0("2.0.0", "aes_auto()")
378-
379-
# detect names of data
380-
if (is.null(data)) {
381-
cli::cli_abort("{.fn aes_auto} requires a {.cls data.frame} or names of data.frame.")
382-
} else if (is.data.frame(data)) {
383-
vars <- names(data)
384-
} else {
385-
vars <- data
386-
}
387-
388-
# automatically detected aes
389-
vars <- intersect(ggplot_global$all_aesthetics, vars)
390-
names(vars) <- vars
391-
aes <- lapply(vars, function(x) parse(text = x)[[1]])
392-
393-
# explicitly defined aes
394-
if (length(match.call()) > 2) {
395-
args <- as.list(match.call()[-1])
396-
aes <- c(aes, args[names(args) != "data"])
397-
}
398-
399-
structure(rename_aes(aes), class = "uneval")
377+
lifecycle::deprecate_stop("2.0.0", "aes_auto()")
400378
}
401379

402380
mapped_aesthetics <- function(x) {

R/annotation-custom.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ GeomCustomAnn <- ggproto("GeomCustomAnn", Geom,
8080
editGrob(grob, vp = vp, name = paste(grob$name, annotation_id()))
8181
},
8282

83-
default_aes = aes_(xmin = -Inf, xmax = Inf, ymin = -Inf, ymax = Inf)
83+
default_aes = aes(xmin = -Inf, xmax = Inf, ymin = -Inf, ymax = Inf)
8484
)
8585

8686
annotation_id <- local({

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/bin.R

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -240,18 +240,24 @@ bin_loc <- function(x, id) {
240240
)
241241
}
242242

243-
fix_bin_params = function(params, fun, version) {
243+
fix_bin_params <- function(params, fun, version) {
244+
245+
if (package_version(version) < "3.0.0") {
246+
deprecate <- lifecycle::deprecate_stop
247+
} else {
248+
deprecate <- deprecate_warn0
249+
}
244250

245251
if (!is.null(params$origin)) {
246252
args <- paste0(fun, c("(origin)", "(boundary)"))
247-
deprecate_warn0(version, args[1], args[2])
248-
params$boudnary <- params$origin
253+
deprecate(version, args[1], args[2])
254+
params$boundary <- params$origin
249255
params$origin <- NULL
250256
}
251257

252258
if (!is.null(params$right)) {
253259
args <- paste0(fun, c("(right)", "(closed)"))
254-
deprecate_warn0(version, args[1], args[2])
260+
deprecate(version, args[1], args[2])
255261
params$closed <- if (isTRUE(params$right)) "right" else "left"
256262
params$right <- NULL
257263
}

R/facet-grid-.R

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,9 @@ facet_grid <- function(rows = NULL, cols = NULL, scales = "fixed",
132132
switch = NULL, drop = TRUE, margins = FALSE,
133133
axes = "margins", axis.labels = "all",
134134
facets = deprecated()) {
135-
# `facets` is deprecated and renamed to `rows`
135+
# `facets` is deprecated
136136
if (lifecycle::is_present(facets)) {
137-
deprecate_warn0("2.2.0", "facet_grid(facets)", "facet_grid(rows)")
138-
rows <- facets
137+
lifecycle::deprecate_stop("2.2.0", "facet_grid(facets)", "facet_grid(rows)")
139138
}
140139

141140
# Should become a warning in a future release
@@ -177,7 +176,7 @@ facet_grid <- function(rows = NULL, cols = NULL, scales = "fixed",
177176
facets_list <- grid_as_facets_list(rows, cols)
178177

179178
# Check for deprecated labellers
180-
labeller <- fix_labeller(labeller)
179+
check_labeller(labeller)
181180

182181
ggproto(NULL, FacetGrid,
183182
shrink = shrink,

R/facet-wrap.R

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,14 +174,15 @@ facet_wrap <- function(facets, nrow = NULL, ncol = NULL, scales = "fixed",
174174
)
175175

176176
# Check for deprecated labellers
177-
labeller <- fix_labeller(labeller)
177+
check_labeller(labeller)
178178

179179
# Flatten all facets dimensions into a single one
180180
facets <- compact_facets(facets)
181181

182182
if (lifecycle::is_present(switch) && !is.null(switch)) {
183-
deprecate_warn0("2.2.0", "facet_wrap(switch)", "facet_wrap(strip.position)")
184-
strip.position <- if (switch == "x") "bottom" else "left"
183+
lifecycle::deprecate_stop(
184+
"2.2.0", "facet_wrap(switch)", "facet_wrap(strip.position)"
185+
)
185186
}
186187
strip.position <- arg_match0(strip.position, c("top", "bottom", "left", "right"))
187188

R/fortify-map.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,6 @@ map_data <- function(map, region = ".", exact = FALSE, ...) {
159159
borders <- function(database = "world", regions = ".", fill = NA,
160160
colour = "grey50", xlim = NULL, ylim = NULL, ...) {
161161
df <- map_data(database, regions, xlim = xlim, ylim = ylim)
162-
geom_polygon(aes_(~long, ~lat, group = ~group), data = df,
162+
geom_polygon(aes(.data$long, .data$lat, group = .data$group), data = df,
163163
fill = fill, colour = colour, ..., inherit.aes = FALSE)
164164
}

0 commit comments

Comments
 (0)