Skip to content

Commit 1fda7a9

Browse files
committed
remove gtable_ggplot() in favour of ggplot_gtable()
1 parent 6632574 commit 1fda7a9

File tree

3 files changed

+5
-22
lines changed

3 files changed

+5
-22
lines changed

NAMESPACE

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ S3method(fortify,tbl_df)
5959
S3method(ggplot,"function")
6060
S3method(ggplot,default)
6161
S3method(ggplot_add,default)
62-
S3method(ggplot_gtable,default)
6362
S3method(grid.draw,absoluteGrob)
6463
S3method(grobHeight,absoluteGrob)
6564
S3method(grobHeight,zeroGrob)
@@ -443,7 +442,6 @@ export(ggproto)
443442
export(ggproto_parent)
444443
export(ggsave)
445444
export(ggtitle)
446-
export(gtable_ggplot)
447445
export(guide_axis)
448446
export(guide_axis_logticks)
449447
export(guide_axis_stack)

R/plot-build.R

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -196,12 +196,12 @@ layer_grob <- get_layer_grob
196196
#' @keywords internal
197197
#' @param data plot data generated by [ggplot_build()]
198198
#' @export
199-
gtable_ggplot <- S7::new_generic("gtable_ggplot", "data", function(data) {
199+
ggplot_gtable <- function(data) {
200200
attach_plot_env(data@plot@plot_env)
201-
S7::S7_dispatch()
202-
})
201+
UseMethod("ggplot_gtable")
202+
}
203203

204-
S7::method(gtable_ggplot, class_ggplot_built) <- function(data) {
204+
S7::method(ggplot_gtable, class_ggplot_built) <- function(data) {
205205
plot <- data@plot
206206
layout <- data@layout
207207
data <- data@data
@@ -302,18 +302,6 @@ S7::method(gtable_ggplot, class_ggplot_built) <- function(data) {
302302
plot_table
303303
}
304304

305-
# TODO: the S3 generic should be phased out once S7 is adopted more widely
306-
#' @rdname gtable_ggplot
307-
#' @export
308-
ggplot_gtable <- function(data) {
309-
UseMethod("ggplot_gtable")
310-
}
311-
312-
#' @export
313-
ggplot_gtable.default <- function(data) {
314-
gtable_ggplot(data)
315-
}
316-
317305
#' Generate a ggplot2 plot grob.
318306
#'
319307
#' @param x ggplot2 object

man/gtable_ggplot.Rd renamed to man/ggplot_gtable.Rd

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

0 commit comments

Comments
 (0)