Skip to content

Commit 728f4e8

Browse files
committed
more strategic placement of ..., thanks for the suggestion @schloerke!
1 parent 28033f6 commit 728f4e8

File tree

5 files changed

+22
-22
lines changed

5 files changed

+22
-22
lines changed

R/all-classes.R

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -205,10 +205,10 @@ class_derive <- S7::new_S3_class("derive")
205205
#' is through the [`theme()`] function.
206206
#'
207207
#' @param elements A named list containing theme elements.
208+
#' @param ... Reserved for future expansion.
208209
#' @param complete A boolean value stating whether a theme is complete.
209210
#' @param validate A boolean value stating whether a theme should still be
210211
#' validated.
211-
#' @param ... Reserved for future expansion.
212212
#'
213213
#' @keywords internal
214214
#' @export
@@ -218,7 +218,7 @@ class_theme <- S7::new_class(
218218
complete = S7::class_logical,
219219
validate = S7::class_logical
220220
),
221-
constructor = function(elements, complete, validate, ...) {
221+
constructor = function(elements, ..., complete, validate) {
222222
warn_dots_empty()
223223
S7::new_object(
224224
elements,
@@ -276,14 +276,14 @@ class_labels <- S7::new_class(
276276
#' constructed using the [`aes()`] function.
277277
#'
278278
#' @param x A list of quosures and constants.
279-
#' @param env An environment for symbols that are not quosures or constants.
280279
#' @param ... Reserved for future expansion.
280+
#' @param env An environment for symbols that are not quosures or constants.
281281
#'
282282
#' @keywords internal
283283
#' @export
284284
class_mapping <- S7::new_class(
285285
"mapping", parent = class_S3_gg,
286-
constructor = function(x, env = globalenv(), ...) {
286+
constructor = function(x, ..., env = globalenv()) {
287287
warn_dots_empty()
288288
check_object(x, is.list, "a {.cls list}")
289289
x <- lapply(x, new_aesthetic, env = env)
@@ -301,6 +301,7 @@ class_mapping <- S7::new_class(
301301
#' This class can be constructed using the [`ggplot()`] function.
302302
#'
303303
#' @param data A property containing any data coerced by [`fortify()`].
304+
#' @param ... Reserved for future expansion.
304305
#' @param layers A list of layer instances created by [`layer()`].
305306
#' @param scales A ScalesList ggproto object.
306307
#' @param guides A Guides ggproto object created by [`guides()`].
@@ -315,7 +316,6 @@ class_mapping <- S7::new_class(
315316
#' @param meta A list for additional metadata. This will be deprecated in the
316317
#' future.
317318
#' @param plot_env An environment.
318-
#' @param ... Reserved for future expansion.
319319
#'
320320
#' @keywords internal
321321
#' @export
@@ -337,6 +337,7 @@ class_ggplot <- S7::new_class(
337337
),
338338
constructor = function(
339339
data = waiver(),
340+
...,
340341
layers = list(),
341342
scales = NULL,
342343
guides = NULL,
@@ -347,8 +348,7 @@ class_ggplot <- S7::new_class(
347348
layout = NULL,
348349
labels = labs(),
349350
meta = list(),
350-
plot_env = parent.frame(),
351-
...
351+
plot_env = parent.frame()
352352
) {
353353
warn_dots_empty()
354354
S7::new_object(
@@ -379,10 +379,10 @@ class_ggplot <- S7::new_class(
379379
#' instantiated directly. The class can be rendered to a gtable object by
380380
#' calling the [`ggplot_gtable()`] function on a ggplot built class object.
381381
#'
382+
#' @param ... Reserved for future expansion.
382383
#' @param data A list of plain data frames; one for each layer.
383384
#' @param layout A Layout ggproto object.
384385
#' @param plot A completed ggplot class object.
385-
#' @param ... Reserved for future expansion.
386386
#'
387387
#' @keywords internal
388388
#' @export
@@ -393,7 +393,7 @@ class_ggplot_built <- S7::new_class(
393393
layout = class_layout,
394394
plot = class_ggplot
395395
),
396-
constructor = function(data = NULL, layout = NULL, plot = NULL, ...) {
396+
constructor = function(..., data = NULL, layout = NULL, plot = NULL) {
397397
warn_dots_empty()
398398
if (is.null(data) || is.null(layout) || is.null(plot)) {
399399
cli::cli_abort(

man/class_ggplot.Rd

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/class_ggplot_built.Rd

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/class_mapping.Rd

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/class_theme.Rd

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)