diff --git a/NEWS.md b/NEWS.md index b7e897436..8a8dbacbb 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 diff --git a/R/render-plot.R b/R/render-plot.R index 71e4bda96..28297d47e 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