From 4b0eb8494c74536f09209671f247bb13f767fd52 Mon Sep 17 00:00:00 2001 From: Carson Date: Tue, 10 Jun 2025 09:47:36 -0500 Subject: [PATCH 1/2] fix(renderPlot): get interactive plotting working with ggplot2 v4.0 --- R/render-plot.R | 2 ++ 1 file changed, 2 insertions(+) diff --git a/R/render-plot.R b/R/render-plot.R index 71e4bda965..28297d47e1 100644 --- a/R/render-plot.R +++ b/R/render-plot.R @@ -266,6 +266,8 @@ drawPlot <- function(name, session, func, width, height, alt, pixelratio, res, . # addition to ggplot, and there's a print method for that class, that we # won't override that method. https://github.com/rstudio/shiny/issues/841 print.ggplot <- custom_print.ggplot + # For compatibility with ggplot2 >v4.0.0 + `print.ggplot2::ggplot` <- custom_print.ggplot # Use capture.output to squelch printing to the actual console; we # are only interested in plot output From 522fe88f4a09fc93e8b125c3818060f9c74f7725 Mon Sep 17 00:00:00 2001 From: Carson Date: Thu, 12 Jun 2025 16:11:17 -0500 Subject: [PATCH 2/2] Update NEWS.md --- NEWS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index b7e8974363..8a8dbacbb9 100644 --- a/NEWS.md +++ b/NEWS.md @@ -25,7 +25,7 @@ * `ExtendedTask` now catches synchronous values and errors and returns them via `$result()`. Previously, the extended task function was required to always return a promise. This change makes it easier to use `ExtendedTask` with a function that may return early or do some synchronous work before returning a promise. (#4225) -* Updated a test for compatibility with ggplot2 4.0.0. (#4226) +* `renderPlot()` was updated to accomodate changes in ggplot2 v4.0.0. (#4226) ## Bug fixes