Skip to content

Commit 6d642cc

Browse files
committed
resolve merge conflict
Merge branch 'main' into watch_partial_matches # Conflicts: # R/stat-manual.R # R/stat-ydensity.R
2 parents 7c1743e + f340b1a commit 6d642cc

File tree

223 files changed

+11132
-5287
lines changed

Some content is hidden

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

223 files changed

+11132
-5287
lines changed

DESCRIPTION

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Imports:
3939
isoband,
4040
lifecycle (> 1.0.1),
4141
rlang (>= 1.1.0),
42-
scales (>= 1.3.0),
42+
scales (>= 1.4.0),
4343
stats,
4444
vctrs (>= 0.6.0),
4545
withr (>= 2.5.0)
@@ -98,6 +98,9 @@ Collate:
9898
'geom-.R'
9999
'annotation-custom.R'
100100
'annotation-logticks.R'
101+
'scale-type.R'
102+
'layer.R'
103+
'make-constructor.R'
101104
'geom-polygon.R'
102105
'geom-map.R'
103106
'annotation-map.R'
@@ -142,6 +145,7 @@ Collate:
142145
'geom-col.R'
143146
'geom-path.R'
144147
'geom-contour.R'
148+
'geom-point.R'
145149
'geom-count.R'
146150
'geom-crossbar.R'
147151
'geom-segment.R'
@@ -160,7 +164,6 @@ Collate:
160164
'geom-jitter.R'
161165
'geom-label.R'
162166
'geom-linerange.R'
163-
'geom-point.R'
164167
'geom-pointrange.R'
165168
'geom-quantile.R'
166169
'geom-rug.R'
@@ -186,7 +189,6 @@ Collate:
186189
'guide-colorbar.R'
187190
'guide-colorsteps.R'
188191
'guide-custom.R'
189-
'layer.R'
190192
'guide-none.R'
191193
'guide-old.R'
192194
'guides-.R'
@@ -236,7 +238,6 @@ Collate:
236238
'scale-shape.R'
237239
'scale-size.R'
238240
'scale-steps.R'
239-
'scale-type.R'
240241
'scale-view.R'
241242
'scale-viridis.R'
242243
'scales-.R'

NAMESPACE

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ S3method(limits,character)
9595
S3method(limits,factor)
9696
S3method(limits,numeric)
9797
S3method(makeContext,dotstackGrob)
98+
S3method(make_constructor,Geom)
99+
S3method(make_constructor,Stat)
98100
S3method(merge_element,default)
99101
S3method(merge_element,element)
100102
S3method(merge_element,element_blank)
@@ -168,6 +170,7 @@ export(CoordQuickmap)
168170
export(CoordRadial)
169171
export(CoordSf)
170172
export(CoordTrans)
173+
export(CoordTransform)
171174
export(Facet)
172175
export(FacetGrid)
173176
export(FacetNull)
@@ -322,6 +325,7 @@ export(coord_quickmap)
322325
export(coord_radial)
323326
export(coord_sf)
324327
export(coord_trans)
328+
export(coord_transform)
325329
export(cut_interval)
326330
export(cut_number)
327331
export(cut_width)
@@ -474,7 +478,6 @@ export(is.facet)
474478
export(is.ggplot)
475479
export(is.ggproto)
476480
export(is.theme)
477-
export(is.waiver)
478481
export(is_coord)
479482
export(is_facet)
480483
export(is_geom)
@@ -490,6 +493,7 @@ export(is_scale)
490493
export(is_stat)
491494
export(is_theme)
492495
export(is_theme_element)
496+
export(is_waiver)
493497
export(label_both)
494498
export(label_bquote)
495499
export(label_context)
@@ -505,6 +509,7 @@ export(layer_grob)
505509
export(layer_scales)
506510
export(layer_sf)
507511
export(lims)
512+
export(make_constructor)
508513
export(map_data)
509514
export(margin)
510515
export(margin_auto)

NEWS.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# ggplot2 (development version)
22

3+
* New `make_constructor()` function that builds a standard constructor for
4+
Geom and Stat classes (@teunbrand, #6142).
5+
* In continuous scales, when `breaks` is a function and `n.breaks` is set, the
6+
`n.breaks` will be passed to the `breaks` function. Previously, `n.breaks`
7+
only applied to the default break calculation (@teunbrand, #5972)
8+
* (internal) New `Facet$draw_panel_content()` method for delegating panel
9+
assembly (@Yunuuuu, #6406).
310
* Facet gains a new method `setup_panel_params` to interact with the
411
panel_params setted by Coord object (@Yunuuuu, #6397, #6380)
512
* `position_fill()` avoids stacking observations of zero (@teunbrand, #6338)
@@ -87,7 +94,7 @@
8794
@yutannihilation's prior work, #3120)
8895
* When discrete breaks have names, they'll be used as labels by default
8996
(@teunbrand, #6147).
90-
* The helper function `is.waiver()` is now exported to help extensions to work
97+
* The helper function `is_waiver()` is now exported to help extensions to work
9198
with `waiver()` objects (@arcresu, #6173).
9299
* Date(time) scales now throw appropriate errors when `date_breaks`,
93100
`date_minor_breaks` or `date_labels` are not strings (@RodDalBen, #5880)
@@ -278,6 +285,7 @@
278285
(@teunbrand, #5938, #4327).
279286
* Fixed bug where empty discrete scales weren't recognised as such
280287
(@teunbrand, #5945).
288+
* `coord_trans()` renamed to `coord_transform()` (@nmercadeb, #5825).
281289
* (internal) The summary function of `stat_summary()` and `stat_summary_bin()`
282290
is setup once in total instead of once per group (@teunbrand, #5971)
283291
* `facet_grid(space = "free")` can now be combined with `coord_fixed()`

R/aes.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ aes_ <- function(x, y, ...) {
302302
caller_env <- parent.frame()
303303

304304
as_quosure_aes <- function(x) {
305-
if (is.formula(x) && length(x) == 2) {
305+
if (is_formula(x) && length(x) == 2) {
306306
as_quosure(x)
307307
} else if (is.null(x) || is.call(x) || is.name(x) || is.atomic(x)) {
308308
new_aesthetic(x, caller_env)

R/annotation-custom.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ annotation_custom <- function(grob, xmin = -Inf, xmax = Inf, ymin = -Inf, ymax =
5858
)
5959
}
6060

61-
#' @rdname ggplot2-ggproto
61+
#' @rdname Geom
6262
#' @format NULL
6363
#' @usage NULL
6464
#' @export

R/annotation-logticks.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#' @param scaled is the data already log-scaled? This should be `TRUE`
2525
#' (default) when the data is already transformed with `log10()` or when
2626
#' using `scale_y_log10()`. It should be `FALSE` when using
27-
#' `coord_trans(y = "log10")`.
27+
#' `coord_transform(y = "log10")`.
2828
#' @param colour Colour of the tick marks.
2929
#' @param linewidth Thickness of tick marks, in mm.
3030
#' @param linetype Linetype of tick marks (`solid`, `dashed`, etc.)
@@ -36,7 +36,7 @@
3636
#' @export
3737
#' @seealso [scale_y_continuous()], [scale_y_log10()] for log scale
3838
#' transformations.
39-
#' @seealso [coord_trans()] for log coordinate transformations.
39+
#' @seealso [coord_transform()] for log coordinate transformations.
4040
#'
4141
#' @examples
4242
#' # Make a log-log plot (without log ticks)
@@ -75,7 +75,7 @@
7575
#' # Using a coordinate transform requires scaled = FALSE
7676
#' t <- ggplot(msleep, aes(bodywt, brainwt)) +
7777
#' geom_point() +
78-
#' coord_trans(x = "log10", y = "log10") +
78+
#' coord_transform(x = "log10", y = "log10") +
7979
#' theme_bw()
8080
#' t + annotation_logticks(scaled = FALSE)
8181
#'
@@ -123,7 +123,7 @@ annotation_logticks <- function(base = 10, sides = "bl", outside = FALSE, scaled
123123
)
124124
}
125125

126-
#' @rdname ggplot2-ggproto
126+
#' @rdname Geom
127127
#' @format NULL
128128
#' @usage NULL
129129
#' @export

R/annotation-map.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ annotation_map <- function(map, ...) {
7676
)
7777
}
7878

79-
#' @rdname ggplot2-ggproto
79+
#' @rdname Geom
8080
#' @format NULL
8181
#' @usage NULL
8282
#' @export

R/annotation-raster.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ annotation_raster <- function(raster, xmin, xmax, ymin, ymax,
6161

6262
}
6363

64-
#' @rdname ggplot2-ggproto
64+
#' @rdname Geom
6565
#' @format NULL
6666
#' @usage NULL
6767
#' @export

R/axis-secondary.R

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -124,19 +124,19 @@ dup_axis <- function(transform = identity, name = derive(), breaks = derive(),
124124
sec_axis(transform, trans = trans, name, breaks, labels, guide)
125125
}
126126

127-
is.sec_axis <- function(x) {
127+
is_sec_axis <- function(x) {
128128
inherits(x, "AxisSecondary")
129129
}
130130

131131
set_sec_axis <- function(sec.axis, scale) {
132-
if (!is.waiver(sec.axis)) {
132+
if (!is_waiver(sec.axis)) {
133133
if (scale$is_discrete()) {
134134
if (!identical(.subset2(sec.axis, "trans"), identity)) {
135135
cli::cli_abort("Discrete secondary axes must have the {.fn identity} transformation.")
136136
}
137137
}
138-
if (is.formula(sec.axis)) sec.axis <- sec_axis(sec.axis)
139-
if (!is.sec_axis(sec.axis)) {
138+
if (is_formula(sec.axis)) sec.axis <- sec_axis(sec.axis)
139+
if (!is_sec_axis(sec.axis)) {
140140
cli::cli_abort("Secondary axes must be specified using {.fn sec_axis}.")
141141
}
142142
scale$secondary.axis <- sec.axis
@@ -150,7 +150,7 @@ set_sec_axis <- function(sec.axis, scale) {
150150
derive <- function() {
151151
structure(list(), class = "derived")
152152
}
153-
is.derived <- function(x) {
153+
is_derived <- function(x) {
154154
inherits(x, "derived")
155155
}
156156
#' @rdname ggplot2-ggproto
@@ -182,9 +182,9 @@ AxisSecondary <- ggproto("AxisSecondary", NULL,
182182
if (!is.function(transform)) {
183183
cli::cli_abort("Transformation for secondary axes must be a function.")
184184
}
185-
if (is.derived(self$name) && !is.waiver(scale$name)) self$name <- scale$name
186-
if (is.derived(self$breaks)) self$breaks <- scale$breaks
187-
if (is.waiver(self$breaks)) {
185+
if (is_derived(self$name) && !is_waiver(scale$name)) self$name <- scale$name
186+
if (is_derived(self$breaks)) self$breaks <- scale$breaks
187+
if (is_waiver(self$breaks)) {
188188
if (scale$is_discrete()) {
189189
self$breaks <- setNames(nm = scale$get_breaks())
190190
} else {
@@ -197,8 +197,8 @@ AxisSecondary <- ggproto("AxisSecondary", NULL,
197197
}
198198
}
199199
}
200-
if (is.derived(self$labels)) self$labels <- scale$labels
201-
if (is.derived(self$guide)) self$guide <- scale$guide
200+
if (is_derived(self$labels)) self$labels <- scale$labels
201+
if (is_derived(self$guide)) self$guide <- scale$guide
202202
},
203203

204204
transform_range = function(self, range) {

0 commit comments

Comments
 (0)