Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentarelbundock committed Jul 24, 2024
1 parent 1bb4ceb commit 5a2b246
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 16 deletions.
10 changes: 0 additions & 10 deletions R/sanitize.R
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 3 additions & 1 deletion R/tinyplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions inst/tinytest/helpers.R
Original file line number Diff line number Diff line change
Expand Up @@ -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")))
options("tinysnapshot_device_args" = list(user_fonts = fontquiver::font_families("Liberation")))

0 comments on commit 5a2b246

Please sign in to comment.