From faf813581f42f1f6e4ef3f172b7a6a1538c66aa0 Mon Sep 17 00:00:00 2001 From: Toby Dylan Hocking Date: Tue, 17 Sep 2024 13:25:29 -0400 Subject: [PATCH] @export internal S3 methods --- DESCRIPTION | 2 +- NAMESPACE | 6 ++++++ NEWS.md | 4 ++++ R/z_facets.R | 6 ++++++ 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 2bcb621a..442eacb9 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: animint2 Title: Animated Interactive Grammar of Graphics -Version: 2024.8.29 +Version: 2024.9.17 URL: https://animint.github.io/animint2/ BugReports: https://github.com/animint/animint2/issues Authors@R: c( diff --git a/NAMESPACE b/NAMESPACE index c6dc730f..d0bab8ad 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -32,6 +32,9 @@ S3method(facet_vars,grid) S3method(facet_vars,null) S3method(facet_vars,wrap) S3method(finite.cases,data.frame) +S3method(flag_axis,grid) +S3method(flag_axis,null) +S3method(flag_axis,wrap) S3method(format,facet) S3method(format,gganimintproto) S3method(format,gganimintproto_method) @@ -48,6 +51,9 @@ S3method(fortify,data.frame) S3method(fortify,default) S3method(fortify,lm) S3method(fortify,map) +S3method(getStrips,grid) +S3method(getStrips,null) +S3method(getStrips,wrap) S3method(ggplot,data.frame) S3method(ggplot,default) S3method(grid.draw,absoluteGrob) diff --git a/NEWS.md b/NEWS.md index 86347c21..7d91e4fe 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,7 @@ +# Changes in version 2024.9.17 + +- @export for internal S3 methods, to quiet roxygen2::document() messages. + # Changes in version 2024.8.29 (PR#147) - animint2pages initial commit README.md uses viz title. diff --git a/R/z_facets.R b/R/z_facets.R index 937025f3..26c72a40 100644 --- a/R/z_facets.R +++ b/R/z_facets.R @@ -5,6 +5,7 @@ getStrips <- function(facet, panel, ...) # themes or special options later UseMethod("getStrips") +#' @export getStrips.grid <- function(facet, panel, ...) { npanels <- nrow(panel$layout) # preallocate strip labels to a default of "" @@ -39,6 +40,7 @@ build_strip <- function(panel, label_df, labeller, side = "right", ...) { apply(labels, 1, paste, collapse = "; ") } +#' @export getStrips.wrap <- function(facet, panel, ...) { labels_df <- panel$layout[names(facet$facets)] labels_df[] <- plyr::llply(labels_df, format, justify = "none") @@ -50,6 +52,7 @@ getStrips.wrap <- function(facet, panel, ...) { strips } +#' @export getStrips.null <- function(facet, panel, ...) { list(top = list(""), right = list(""), n = list(top = 0, right = 0)) } @@ -61,6 +64,7 @@ getStrips.null <- function(facet, panel, ...) { flag_axis <- function(facet, layout) UseMethod("flag_axis") +#' @export flag_axis.grid <- function(facet, layout) { # 'grid rules' are to draw y-axis on panels with COL == 1 # and ROW == max(ROW). @@ -69,12 +73,14 @@ flag_axis.grid <- function(facet, layout) { layout } +#' @export flag_axis.wrap <- function(facet, layout) { if (sum(grepl("^AXIS_[X-Y]$", names(layout))) != 2) stop("Expected 'AXIS_X' and 'AXIS_Y' to be in panel layout") layout } +#' @export flag_axis.null <- function(facet, layout) { cbind(layout, AXIS_X = TRUE, AXIS_Y = TRUE) }