Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# 4.10.0.9000

## Improvements

* `ggplotly()` does not issue warnings with `options(warnPartialMatchArgs = TRUE)` any longer. (#2046, @bersbersbers)

# 4.10.0

Expand Down
4 changes: 2 additions & 2 deletions R/ggplotly.R
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ gg2list <- function(p, width = NULL, height = NULL,
} else if (capabilities("jpeg")) {
grDevices::jpeg
} else if (system.file(package = "Cairo") != "") {
Cairo::Cairo
function(filename, ...) Cairo::Cairo(file = filename, ...)
} else {
stop(
"No Cairo or bitmap device is available. Such a graphics device is required to convert sizes correctly in ggplotly().\n\n",
Expand All @@ -198,7 +198,7 @@ gg2list <- function(p, width = NULL, height = NULL,
height <- height %||% default(grDevices::dev.size("px")[2])
}
# open the device and make sure it closes on exit
dev_fun(file = tempfile(), width = width %||% 640, height = height %||% 480)
dev_fun(filename = tempfile(), width = width %||% 640, height = height %||% 480)
on.exit(grDevices::dev.off(), add = TRUE)

# check the value of dynamicTicks
Expand Down
7 changes: 7 additions & 0 deletions tests/testthat/test-ggplot-warnings.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@


test_that("ggplotly does not issue partial-argument-match warning", {
p <- ggplot(data.frame())
rlang::scoped_options(warnPartialMatchArgs = TRUE)
expect_warning(ggplotly(p), regexp = NA)
})