8000 Fixes/workaround for upcoming (> v3.4.3) ggplot2 release by cpsievert · Pull Request #2301 · plotly/plotly.R · GitHub
[go: up one dir, main page]

Skip to content

Fixes/workaround for upcoming (> v3.4.3) ggplot2 release #2301

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Oct 11, 2023
Merged
Changes from 1 commit
Commits
File filter
10000

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Simplify scale type detection logic (since new approach works with ol…
…d versions; use it across the board)
  • Loading branch information
cpsievert committed Oct 10, 2023
commit 7f2d96f5a1302c2b3c49687cdeac3f89e1cd547f
10 changes: 4 additions & 6 deletions R/ggplotly.R
Original file line number Diff line number Diff line change
Expand Up @@ -725,13 +725,11 @@ gg2list <- function(p, width = NULL, height = NULL,
call. = FALSE
)
}
# 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")) ||
inherits(sc, c("ScaleContinuousDatetime", "ScaleContinuousDate"))

# determine axis types
isDate <- inherits(sc, c("ScaleContinuousDatetime", "ScaleContinuousDate"))
isDateType <- isDynamic && isDate
isDiscrete <- identical(sc$scale_name, "position_d") ||
inherits(sc, "ScaleDiscretePosition")
isDiscrete <- inherits(sc, "ScaleDiscretePosition")
isDiscreteType <- isDynamic && isDiscrete

# In 3.2.x .major disappeared in favor of break_positions()
Expand Down
0