55# ' keeping theme declarations more organised.
66# '
77# ' @eval subtheme_param_doc()
8+ # ' @param ... Not in use, expected to be empty.
89# '
910# ' @return A `theme`-class object that can be added to a plot.
1011# ' @name subtheme
@@ -54,49 +55,57 @@ subtheme <- function(elements, prefix = "", suffix = "", call = caller_env()) {
5455
5556# ' @export
5657# ' @describeIn subtheme Theme specification for all axes.
57- theme_sub_axis <- function (title , text , ticks , ticks.length , line , minor.ticks.length ) {
58+ theme_sub_axis <- function (... , title , text , ticks , ticks.length , line , minor.ticks.length ) {
59+ warn_dots_empty()
5860 subtheme(find_args(), " axis." )
5961}
6062
6163# ' @export
6264# ' @describeIn subtheme Theme specification for both x axes.
63- theme_sub_axis_x <- function (title , text , ticks , ticks.length , line , minor.ticks.length ) {
65+ theme_sub_axis_x <- function (... , title , text , ticks , ticks.length , line , minor.ticks.length ) {
66+ warn_dots_empty()
6467 subtheme(find_args(), " axis." , " .x" )
6568}
6669
6770# ' @export
6871# ' @describeIn subtheme Theme specification for both y axes.
69- theme_sub_axis_y <- function (title , text , ticks , ticks.length , line , minor.ticks.length ) {
72+ theme_sub_axis_y <- function (... , title , text , ticks , ticks.length , line , minor.ticks.length ) {
73+ warn_dots_empty()
7074 subtheme(find_args(), " axis." , " .y" )
7175}
7276
7377# ' @export
7478# ' @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 ) {
79+ theme_sub_axis_bottom <- function (... , title , text , ticks , ticks.length , line , minor.ticks , minor.ticks.length ) {
80+ warn_dots_empty()
7681 subtheme(find_args(), " axis." , " .x.bottom" )
7782}
7883
7984# ' @export
8085# ' @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 ) {
86+ theme_sub_axis_top <- function (... , title , text , ticks , ticks.length , line , minor.ticks , minor.ticks.length ) {
87+ warn_dots_empty()
8288 subtheme(find_args(), " axis." , " .x.top" )
8389}
8490
8591# ' @export
8692# ' @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 ) {
93+ theme_sub_axis_left <- function (... , title , text , ticks , ticks.length , line , minor.ticks , minor.ticks.length ) {
94+ warn_dots_empty()
8895 subtheme(find_args(), " axis." , " .y.left" )
8996}
9097
9198# ' @export
9299# ' @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 ) {
100+ theme_sub_axis_right <- function (... , title , text , ticks , ticks.length , line , minor.ticks , minor.ticks.length ) {
101+ warn_dots_empty()
94102 subtheme(find_args(), " axis." , " .y.right" )
95103}
96104
97105# ' @export
98106# ' @describeIn subtheme Theme specification for the legend.
99107theme_sub_legend <- function (
108+ ... ,
100109 # Text stuff
101110 text , text.position , title , title.position ,
102111 # Drawn elements
@@ -114,32 +123,36 @@ theme_sub_legend <- function(
114123 # Box
115124 box , box.just , box.margin , box.background , box.spacing
116125) {
126+ warn_dots_empty()
117127 subtheme(find_args(), " legend." )
118128}
119129
120130# ' @export
121131# ' @describeIn subtheme Theme specification for the panels.
122- theme_sub_panel <- function (background , border ,
132+ theme_sub_panel <- function (... , background , border ,
123133 widths , heights , spacing , spacing.x , spacing.y ,
124134 grid , grid.major , grid.minor , grid.major.x ,
125135 grid.major.y , grid.minor.x , grid.minor.y , ontop ) {
136+ warn_dots_empty()
126137 subtheme(find_args(), " panel." )
127138}
128139
129140# ' @export
130141# ' @describeIn subtheme Theme specification for the whole plot.
131- theme_sub_plot <- function (background , title , title.position , subtitle , caption ,
142+ theme_sub_plot <- function (... , background , title , title.position , subtitle , caption ,
132143 caption.position , tag , tag.position , tag.location ,
133144 margin ) {
145+ warn_dots_empty()
134146 subtheme(find_args(), " plot." )
135147}
136148
137149# ' @export
138150# ' @describeIn subtheme Theme specification for facet strips.
139- theme_sub_strip <- function (background , background.x , background.y , clip ,
151+ theme_sub_strip <- function (... , background , background.x , background.y , clip ,
140152 placement , text , text.x , text.x.bottom , text.x.top ,
141153 text.y , text.y.left , text.y.right ,
142154 switch .pad.grid , switch .pad.wrap ) {
155+ warn_dots_empty()
143156 subtheme(find_args(), " strip." )
144157}
145158
@@ -150,6 +163,7 @@ subtheme_param_doc <- function() {
150163 theme_sub_panel , theme_sub_plot , theme_sub_strip
151164 )
152165 args <- sort(unique(unlist(lapply(funs , fn_fmls_names ), use.names = FALSE )))
166+ args <- setdiff(args , " ..." )
153167 paste0(
154168 " @param " ,
155169 paste0(args , collapse = " ," ),
0 commit comments