Skip to content

Commit

Permalink
Quick and dirty fix proposal for tidyverse/ggplot2#5343
Browse files Browse the repository at this point in the history
  • Loading branch information
cpsievert committed Oct 6, 2023
1 parent 922bea4 commit 13b8fec
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions R/ggplotly.R
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 13b8fec

Please sign in to comment.