Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

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
8 changes: 7 additions & 1 deletion R/geom_half_point.R
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,13 @@ GeomHalfPoint <- ggproto(
# ggplot2::resolution(data$point_y[[1]], zero = FALSE) * 0.4
# }

if (is(transformation, "PositionIdentity") || is(transformation, "PositionJitter")) {
# Practical test if ggplot2 is at version 4.x.x+
ggplot2_version_400 <- "class_ggplot" %in% getNamespaceExports("ggplot2")

if (
is(transformation, "PositionIdentity") ||
(is(transformation, "PositionJitter") && !ggplot2_version_400)
) {
trans_positions <- transformation$compute_layer(
transformation_df,
transformation_params_new
Expand Down
8 changes: 7 additions & 1 deletion R/geom_half_point_panel.R
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,13 @@ GeomHalfPointPanel <- ggproto(
ggplot2::resolution(data$y, zero = FALSE) * 0.4
}

if (is(transformation, "PositionIdentity") || is(transformation, "PositionJitter")) {
# Practical test if ggplot2 is at version 4.x.x+
ggplot2_version_400 <- "class_ggplot" %in% getNamespaceExports("ggplot2")

if (
is(transformation, "PositionIdentity") ||
(is(transformation, "PositionJitter") && !ggplot2_version_400)
) {
trans_positions <- transformation$compute_layer(
transformation_df,
transformation_params
Expand Down