From 5a2b246649d3a3f98f14cfedc498fc1989d3d20e Mon Sep 17 00:00:00 2001 From: Vincent Arel-Bundock Date: Tue, 23 Jul 2024 21:39:41 -0400 Subject: [PATCH] fixup --- R/sanitize.R | 10 ---------- R/tinyplot.R | 4 +++- inst/tinytest/helpers.R | 10 +++++----- 3 files changed, 8 insertions(+), 16 deletions(-) diff --git a/R/sanitize.R b/R/sanitize.R index f9b92f91..87395955 100644 --- a/R/sanitize.R +++ b/R/sanitize.R @@ -5,16 +5,6 @@ sanitize_ribbon.alpha <- function(ribbon.alpha) { } -sanitize_legend <- function(x, add = FALSE) { - # no legend if adding to the previous plot - if (isTRUE(add)) return(FALSE) - if (is.character(x)) { - valid <- c("bottomright", "bottom", "bottomleft", "left", "topleft", "top", "topright", "right", "center") - valid <- c(valid, paste0(valid, "!")) - assert_choice(x, valid, name = "legend") - } - return(x) -} sanitize_type <- function(type, x, y) { diff --git a/R/tinyplot.R b/R/tinyplot.R index 87fdfba7..5943aa48 100644 --- a/R/tinyplot.R +++ b/R/tinyplot.R @@ -508,9 +508,11 @@ tinyplot.default = function( dots = list(...) ribbon.alpha = sanitize_ribbon.alpha(ribbon.alpha) - legend = sanitize_legend(substitute(legend), add) type = sanitize_type(type, x, y) + if (isTRUE(add)) legend = FALSE + + xlabs = NULL # Write plot to output file or window with fixed dimensions diff --git a/inst/tinytest/helpers.R b/inst/tinytest/helpers.R index 4563afaa..c1c6ff1b 100755 --- a/inst/tinytest/helpers.R +++ b/inst/tinytest/helpers.R @@ -2,9 +2,9 @@ library(tinytest) library(tinysnapshot) # Skip tests if not on Linux -ON_LINUX = Sys.info()["sysname"] == "Linux" -if (!ON_LINUX) exit_file("Linux snapshots") - -options("tinysnapshot_os" = "Linux") +# ON_LINUX = Sys.info()["sysname"] == "Linux" +# if (!ON_LINUX) exit_file("Linux snapshots") +# +# options("tinysnapshot_os" = "Linux") options("tinysnapshot_device" = "svglite") -options("tinysnapshot_device_args" = list(user_fonts = fontquiver::font_families("Liberation"))) \ No newline at end of file +options("tinysnapshot_device_args" = list(user_fonts = fontquiver::font_families("Liberation")))