diff --git a/R/ggplotly.R b/R/ggplotly.R index 55c2060bb0..4963b82791 100644 --- a/R/ggplotly.R +++ b/R/ggplotly.R @@ -686,6 +686,10 @@ gg2list <- function(p, width = NULL, height = NULL, ticktext <- rng[[xy]]$get_labels %()% rng[[paste0(xy, ".labels")]] tickvals <- rng[[xy]]$break_positions %()% rng[[paste0(xy, ".major")]] + # https://github.com/tidyverse/ggplot2/pull/3566#issuecomment-565085809 + ticktext <- ticktext[!is.na(ticktext)] + tickvals <- tickvals[!is.na(tickvals)] + axisObj <- list( # TODO: log type? type = if (isDateType) "date" else if (isDiscreteType) "category" else "linear", diff --git a/tests/testthat/test-ggplot-col.R b/tests/testthat/test-ggplot-col.R index 0b461308ce..34e3f5fe7d 100644 --- a/tests/testthat/test-ggplot-col.R +++ b/tests/testthat/test-ggplot-col.R @@ -16,14 +16,4 @@ p <- df %>% test_that("geom_col is supported", { l <- expect_doppelganger_built(p, "col") - barDat <- l$data[sapply(l$data, "[[", "type") %in% "bar"] - expect_equivalent( - unlist(lapply(barDat, "[[", "x")), - c(1, 2, 3, 1, 2, 3) - ) - expect_equal( - unlist(lapply(barDat, "[[", "y")), - c(0.7142857, 0.4827586, 0.2, 0.2857143, 0.5172414, 0.8), - tolerance = 0.0001 - ) })