Skip to content

Commit b5d4c12

Browse files
authored
Merge pull request #319 from teunbrand/compat_ggplot2_400
Compatibility with ggplot2 4.0.0
2 parents 6b8cdda + 7e33227 commit b5d4c12

File tree

5 files changed

+8
-17
lines changed

5 files changed

+8
-17
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ URL: https://davidgohel.github.io/ggiraph/
2424
BugReports: https://github.com/davidgohel/ggiraph/issues
2525
Imports:
2626
cli,
27-
ggplot2 (>= 3.5.1),
27+
ggplot2 (>= 3.5.2),
2828
grid,
2929
htmltools,
3030
htmlwidgets (>= 1.5),

R/geom_bar_interactive.R

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ GeomInteractiveBar <- ggproto(
2727
default_aes = add_default_interactive_aes(GeomBar),
2828
parameters = interactive_geom_parameters,
2929
draw_key = interactive_geom_draw_key,
30-
draw_panel = function(self, data, panel_params, coord,
31-
width = NULL, flipped_aes = FALSE,
30+
draw_panel = function(self, data, panel_params, coord, ...,
3231
.ipar = IPAR_NAMES) {
3332
GeomInteractiveRect$draw_panel(data, panel_params, coord, .ipar = .ipar)
3433
}

R/geom_path_interactive.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ GeomInteractiveStep <-
129129
default_aes = add_default_interactive_aes(GeomStep),
130130
parameters = interactive_geom_parameters,
131131
draw_key = interactive_geom_draw_key,
132-
draw_panel = function(data, panel_params, coord, direction = "hv", .ipar = IPAR_NAMES) {
132+
draw_panel = function(data, panel_params, coord, direction = "hv", .ipar = IPAR_NAMES, ...) {
133133
ldata <- split(data, data$group)
134134
ldata <- lapply(ldata, stairstep, direction = direction)
135135
data <- do.call(rbind, ldata)

inst/tinytest/setup.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ test_geom_layer <- expression({
7474
}
7575
# has that class default interactive params?
7676
geom_class_ipar <- unclass(ggiraph:::get_interactive_attrs(result$geom$default_aes))
77-
expect_equal(geom_class_ipar, ggiraph:::IPAR_DEFAULTS, info = name)
77+
expect_equal(geom_class_ipar, ggiraph:::IPAR_DEFAULTS, info = name, check.attributes = FALSE)
7878
# has the layer the passed interactive params in aes?
7979
geom_aes_ipar <- unclass(ggiraph:::get_interactive_attrs(result$mapping))
8080
expect_equal(geom_aes_ipar, unclass(mapping), info = name)
@@ -112,7 +112,7 @@ test_annot_layer <- expression({
112112
expect_false(is.null(nse[[cl]]), info = cl)
113113
# has that class default interactive params?
114114
geom_class_ipar <- unclass(ggiraph:::get_interactive_attrs(result$geom$default_aes))
115-
expect_equal(geom_class_ipar, ggiraph:::IPAR_DEFAULTS, info = name)
115+
expect_equal(geom_class_ipar, ggiraph:::IPAR_DEFAULTS, info = name, check.attributes = FALSE)
116116
# has the layer the passed interactive params in aes_params?
117117
geom_aes_par_ipar <- unclass(ggiraph:::get_interactive_attrs(result$aes_params))
118118
expect_equal(geom_aes_par_ipar, mapping, info = name)

inst/tinytest/test-utils.R

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,8 @@ library(ggplot2)
4242
unclass(ggiraph:::add_default_interactive_aes(GeomPoint,
4343
defaults = list(tooltip = NULL, foo = "bar")
4444
)),
45-
list(
46-
shape = 19,
47-
colour = "black",
48-
size = 1.5,
49-
fill = NA,
50-
alpha = NA,
51-
stroke = 0.5,
52-
tooltip = NULL,
53-
foo = "bar"
54-
)
45+
c(unclass(GeomPoint$default_aes), aes(tooltip = NULL, foo = "bar")),
46+
check.attributes = FALSE
5547
)
5648
}
5749

@@ -95,7 +87,7 @@ library(ggplot2)
9587
layer <- geom_point_interactive(aes(tooltip = "tooltip"))
9688
geom <- layer$geom
9789
data <- as.data.frame(c(
98-
ggiraph:::compact(unclass(geom$default_aes)),
90+
ggiraph:::compact(get_geom_defaults(geom)),
9991
ggiraph:::compact(unclass(layer$mapping))
10092
))
10193
gr <- ggiraph:::interactive_geom_draw_key(geom, data = data, params = geom$parameters(), size = 3)

0 commit comments

Comments
 (0)