diff --git a/DESCRIPTION b/DESCRIPTION index c6c345a384..dd25a04809 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: plotly Title: Create Interactive Web Graphics via 'plotly.js' -Version: 4.9.4.9000 +Version: 4.9.4.1 Authors@R: c(person("Carson", "Sievert", role = c("aut", "cre"), email = "cpsievert1@gmail.com", comment = c(ORCID = "0000-0002-4958-2844")), person("Chris", "Parmer", role = "aut", @@ -36,7 +36,7 @@ Imports: base64enc, htmltools (>= 0.3.6), htmlwidgets (>= 1.5.2.9001), - tidyr, + tidyr (>= 1.0.0), RColorBrewer, dplyr, vctrs, diff --git a/NEWS.md b/NEWS.md index 5fdba8a80a..f431876032 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# 4.9.4.9000 +# 4.9.4.1 ## BUG FIXES diff --git a/R/ggplotly.R b/R/ggplotly.R index 93ac3b9e49..a766bceacd 100644 --- a/R/ggplotly.R +++ b/R/ggplotly.R @@ -346,7 +346,7 @@ gg2list <- function(p, width = NULL, height = NULL, x <- reComputeGroup(x, z) tib <- tibble::as_tibble(x[c("PANEL", "group")]) tib[["key"]] <- key - nested <- tidyr::nest(tib, key, .key = key) + nested <- tidyr::nest(tib, key = key) # reduce the dimensions of list column elements from 2 to 1 nested$key <- lapply(nested$key, function(x) x[[1]]) nested diff --git a/tests/testthat/test-ggplot-bar.R b/tests/testthat/test-ggplot-bar.R index b52a7377c3..5910331280 100644 --- a/tests/testthat/test-ggplot-bar.R +++ b/tests/testthat/test-ggplot-bar.R @@ -127,7 +127,7 @@ test_that('guides(colour="none") does not affect fill legend', { test_that("guides(fill=FALSE) does not affect colour legend", { gg <- ggplot(data = df, aes(x = time, y = total_bill, colour = time)) + geom_bar(fill = "grey", stat = "identity") + - guides(fill = FALSE) + guides(fill = "none") info <- expect_traces(gg, 2, "aes-colour-guides-fill-FALSE") for(tr in info$data){ expect_equivalent(tr$marker$color, toRGB("grey")) diff --git a/tests/testthat/test-ggplot-quantile.R b/tests/testthat/test-ggplot-quantile.R index d129b9d2c5..426c9984a4 100644 --- a/tests/testthat/test-ggplot-quantile.R +++ b/tests/testthat/test-ggplot-quantile.R @@ -10,7 +10,8 @@ test_that("Basic geom_quantile() works", { geom_point() + geom_quantile() - l <- plotly_build(p)$x + # partial match of 'coef' to 'coefficients' + l <- suppressWarnings(plotly_build(p)$x) expect_length(l$data, 4) @@ -35,7 +36,8 @@ test_that("Can specify gpar() in geom_quantile()", { geom_point() + geom_quantile(colour = "red", alpha = 0.5) - l <- plotly_build(p)$x + # partial match of 'coef' to 'coefficients' + l <- suppressWarnings(plotly_build(p)$x) expect_length(l$data, 4) diff --git a/tests/testthat/test-plotly-data.R b/tests/testthat/test-plotly-data.R index 0186454964..19d56790d1 100644 --- a/tests/testthat/test-plotly-data.R +++ b/tests/testthat/test-plotly-data.R @@ -15,7 +15,7 @@ test_that("plotly_data returns data frame", { }) test_that("plotly_data preserves groups in data", { - d <- plotly_data(group_by_(plot_ly(mtcars), c("vs", "am"))) + d <- plotly_data(group_by(plot_ly(mtcars), vs, am)) expect_true(dplyr::groups(d)[[1]] == "vs") }) diff --git a/tests/testthat/test-plotly-filename.R b/tests/testthat/test-plotly-filename.R index 9dd73fb7f3..fa2babf725 100644 --- a/tests/testthat/test-plotly-filename.R +++ b/tests/testthat/test-plotly-filename.R @@ -11,7 +11,7 @@ test_that("filename supports names with paths included ", { endpt <- sprintf("files/%s/trash", file$fid) res <- api(endpt, "POST") } - f <- plotly_POST(p, filename = filename) + f <- api_create(p, filename = filename) expect_match(f$filename, "awesome") expect_true(f$parented) }) diff --git a/tests/testthat/test-plotly-getfigure.R b/tests/testthat/test-plotly-getfigure.R index 4a58417d6a..e8e1ca3fb8 100644 --- a/tests/testthat/test-plotly-getfigure.R +++ b/tests/testthat/test-plotly-getfigure.R @@ -1,10 +1,10 @@ -context("get_figure") +context("api_download_plot") test_that("requests made by a user who doesn't exist error a 404", { skip_on_cran() skip_if_not_master() expect_error({ - get_figure("klmadslfjdfljdsf", 0) + api_download_plot(0, "klmadslfjdfljdsf") }, ".*404.*") }) @@ -12,20 +12,20 @@ test_that("requests made to retrieve a figure that doesn't exist returns a 404", skip_on_cran() skip_if_not_master() expect_error({ - get_figure("get_test_user", 18324823) + api_download_plot(18324823, "get_test_user") }, ".*404.*") }) test_that("requests made to retrieve some elses private file errors", { skip_on_cran() skip_if_not_master() - expect_error(get_figure("get_test_user", 1)) + expect_error(api_download_plot(1, "get_test_user")) }) test_that("retrieving a public figure ... works.", { skip_on_cran() skip_if_not_master() - fig <- get_figure("get_test_user", 0) + fig <- api_download_plot(0, "get_test_user") # get the data behind the hash p <- plotly_build(fig)$x expect_equivalent(p$data[[1]]$x, c("1", "2", "3")) @@ -34,7 +34,7 @@ test_that("retrieving a public figure ... works.", { test_that("can add traces to a subplot figure", { skip_on_cran() skip_if_not_master() - fig <- get_figure('chelsea_lyn', 6366) + fig <- api_download_plot(6366, 'chelsea_lyn') p <- add_lines(fig, x = c(1, 2, 3), y = c(4, 2, 4)) expect_equivalent( length(plotly_build(fig)$x$data) + 1, @@ -45,7 +45,7 @@ test_that("can add traces to a subplot figure", { test_that("posting a hidden plot returns a secret key", { skip_on_cran() skip_if_not_master() - res <- plotly_POST(plot_ly(), sharing = "secret") + res <- api_create(plot_ly(), sharing = "secret") expect_true(res$share_key_enabled) expect_true(nchar(res$share_key) > 1) })