Skip to content

Commit 5eb0f1c

Browse files
committed
add ellipses to theme_sub_*() family
1 parent ab3bf1a commit 5eb0f1c

File tree

1 file changed

+22
-10
lines changed

1 file changed

+22
-10
lines changed

R/theme-sub.R

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,49 +54,57 @@ subtheme <- function(elements, prefix = "", suffix = "", call = caller_env()) {
5454

5555
#' @export
5656
#' @describeIn subtheme Theme specification for all axes.
57-
theme_sub_axis <- function(title, text, ticks, ticks.length, line, minor.ticks.length) {
57+
theme_sub_axis <- function(..., title, text, ticks, ticks.length, line, minor.ticks.length) {
58+
warn_dots_empty()
5859
subtheme(find_args(), "axis.")
5960
}
6061

6162
#' @export
6263
#' @describeIn subtheme Theme specification for both x axes.
63-
theme_sub_axis_x <- function(title, text, ticks, ticks.length, line, minor.ticks.length) {
64+
theme_sub_axis_x <- function(..., title, text, ticks, ticks.length, line, minor.ticks.length) {
65+
warn_dots_empty()
6466
subtheme(find_args(), "axis.", ".x")
6567
}
6668

6769
#' @export
6870
#' @describeIn subtheme Theme specification for both y axes.
69-
theme_sub_axis_y <- function(title, text, ticks, ticks.length, line, minor.ticks.length) {
71+
theme_sub_axis_y <- function(..., title, text, ticks, ticks.length, line, minor.ticks.length) {
72+
warn_dots_empty()
7073
subtheme(find_args(), "axis.", ".y")
7174
}
7275

7376
#' @export
7477
#' @describeIn subtheme Theme specification for the bottom x axis.
75-
theme_sub_axis_bottom <- function(title, text, ticks, ticks.length, line, minor.ticks, minor.ticks.length) {
78+
theme_sub_axis_bottom <- function(..., title, text, ticks, ticks.length, line, minor.ticks, minor.ticks.length) {
79+
warn_dots_empty()
7680
subtheme(find_args(), "axis.", ".x.bottom")
7781
}
7882

7983
#' @export
8084
#' @describeIn subtheme Theme specification for the top x axis.
81-
theme_sub_axis_top <- function(title, text, ticks, ticks.length, line, minor.ticks, minor.ticks.length) {
85+
theme_sub_axis_top <- function(..., title, text, ticks, ticks.length, line, minor.ticks, minor.ticks.length) {
86+
warn_dots_empty()
8287
subtheme(find_args(), "axis.", ".x.top")
8388
}
8489

8590
#' @export
8691
#' @describeIn subtheme Theme specification for the left y axis.
87-
theme_sub_axis_left <- function(title, text, ticks, ticks.length, line, minor.ticks, minor.ticks.length) {
92+
theme_sub_axis_left <- function(..., title, text, ticks, ticks.length, line, minor.ticks, minor.ticks.length) {
93+
warn_dots_empty()
8894
subtheme(find_args(), "axis.", ".y.left")
8995
}
9096

9197
#' @export
9298
#' @describeIn subtheme Theme specification for the right y axis.
93-
theme_sub_axis_right <- function(title, text, ticks, ticks.length, line, minor.ticks, minor.ticks.length) {
99+
theme_sub_axis_right <- function(..., title, text, ticks, ticks.length, line, minor.ticks, minor.ticks.length) {
100+
warn_dots_empty()
94101
subtheme(find_args(), "axis.", ".y.right")
95102
}
96103

97104
#' @export
98105
#' @describeIn subtheme Theme specification for the legend.
99106
theme_sub_legend <- function(
107+
...,
100108
# Text stuff
101109
text, text.position, title, title.position,
102110
# Drawn elements
@@ -114,32 +122,36 @@ theme_sub_legend <- function(
114122
# Box
115123
box, box.just, box.margin, box.background, box.spacing
116124
) {
125+
warn_dots_empty()
117126
subtheme(find_args(), "legend.")
118127
}
119128

120129
#' @export
121130
#' @describeIn subtheme Theme specification for the panels.
122-
theme_sub_panel <- function(background, border,
131+
theme_sub_panel <- function(..., background, border,
123132
widths, heights, spacing, spacing.x, spacing.y,
124133
grid, grid.major, grid.minor, grid.major.x,
125134
grid.major.y, grid.minor.x, grid.minor.y, ontop) {
135+
warn_dots_empty()
126136
subtheme(find_args(), "panel.")
127137
}
128138

129139
#' @export
130140
#' @describeIn subtheme Theme specification for the whole plot.
131-
theme_sub_plot <- function(background, title, title.position, subtitle, caption,
141+
theme_sub_plot <- function(..., background, title, title.position, subtitle, caption,
132142
caption.position, tag, tag.position, tag.location,
133143
margin) {
144+
warn_dots_empty()
134145
subtheme(find_args(), "plot.")
135146
}
136147

137148
#' @export
138149
#' @describeIn subtheme Theme specification for facet strips.
139-
theme_sub_strip <- function(background, background.x, background.y, clip,
150+
theme_sub_strip <- function(..., background, background.x, background.y, clip,
140151
placement, text, text.x, text.x.bottom, text.x.top,
141152
text.y, text.y.left, text.y.right,
142153
switch.pad.grid, switch.pad.wrap) {
154+
warn_dots_empty()
143155
subtheme(find_args(), "strip.")
144156
}
145157

0 commit comments

Comments
 (0)