From 13b8fecd5946344c96afb624aabbfa2d1af15549 Mon Sep 17 00:00:00 2001 From: Carson Date: Fri, 6 Oct 2023 17:56:07 -0500 Subject: [PATCH] Quick and dirty fix proposal for tidyverse/ggplot2#5343 --- R/ggplotly.R | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/R/ggplotly.R b/R/ggplotly.R index 7239ad529d..fe146641d4 100644 --- a/R/ggplotly.R +++ b/R/ggplotly.R @@ -725,11 +725,13 @@ gg2list <- function(p, width = NULL, height = NULL, call. = FALSE ) } - # determine axis types (note: scale_name may go away someday) + # determine axis types (note: scale_name went away in ggplot2 v3.4.3) # https://github.com/hadley/ggplot2/issues/1312 - isDate <- isTRUE(sc$scale_name %in% c("date", "datetime")) + isDate <- isTRUE(sc$scale_name %in% c("date", "datetime")) || + inherits(sc, c("ScaleContinuousDatetime", "ScaleContinuousDate")) isDateType <- isDynamic && isDate - isDiscrete <- identical(sc$scale_name, "position_d") + isDiscrete <- identical(sc$scale_name, "position_d") || + inherits(sc, "ScaleDiscretePosition") isDiscreteType <- isDynamic && isDiscrete # In 3.2.x .major disappeared in favor of break_positions()