Skip to content

Commit 13b8fec

Browse files
committed
Quick and dirty fix proposal for tidyverse/ggplot2#5343
1 parent 922bea4 commit 13b8fec

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

R/ggplotly.R

+5-3
Original file line numberDiff line numberDiff line change
@@ -725,11 +725,13 @@ gg2list <- function(p, width = NULL, height = NULL,
725725
call. = FALSE
726726
)
727727
}
728-
# determine axis types (note: scale_name may go away someday)
728+
# determine axis types (note: scale_name went away in ggplot2 v3.4.3)
729729
# https://github.com/hadley/ggplot2/issues/1312
730-
isDate <- isTRUE(sc$scale_name %in% c("date", "datetime"))
730+
isDate <- isTRUE(sc$scale_name %in% c("date", "datetime")) ||
731+
inherits(sc, c("ScaleContinuousDatetime", "ScaleContinuousDate"))
731732
isDateType <- isDynamic && isDate
732-
isDiscrete <- identical(sc$scale_name, "position_d")
733+
isDiscrete <- identical(sc$scale_name, "position_d") ||
734+
inherits(sc, "ScaleDiscretePosition")
733735
isDiscreteType <- isDynamic && isDiscrete
734736

735737
# In 3.2.x .major disappeared in favor of break_positions()

0 commit comments

Comments
 (0)