Skip to content

Commit 0b1fbe9

Browse files
authored
Apply suggestions from code review
1 parent 8a94f66 commit 0b1fbe9

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

R/ggplotly.R

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1460,7 +1460,10 @@ getAesMap <- function(plot, layer) {
14601460
}
14611461
}
14621462

1463-
# Handle compatibility for changes in ggplot2 >v3.4.2 (#5144)
1463+
# ------------------------------------------------------------------
1464+
# Handle compatibility for changes in ggplot2 >v3.4.2 (#5144),
1465+
# which removed these functions in favor of scale/plot methods
1466+
# ------------------------------------------------------------------
14641467
scales_transform_df <- function(scales, df) {
14651468
if (is.function(scales$transform_df)) {
14661469
scales$transform_df(df)
@@ -1486,7 +1489,7 @@ scales_map_df <- function(scales, df) {
14861489
}
14871490

14881491
scales_add_missing <- function(plot, aesthetics) {
1489-
if (length(plot$scales$add_missing)) {
1492+
if (is.function(plot$scales$add_missing)) {
14901493
plot$scales$add_missing(c("x", "y"), plot$plot_env)
14911494
} else {
14921495
ggfun("scales_add_missing")(plot, aesthetics, plot$plot_env)

0 commit comments

Comments
 (0)