fix(renderPlot): get interactive plotting working with ggplot2 v4.0 (#4228)

* fix(renderPlot): get interactive plotting working with ggplot2 v4.0

* Update NEWS.md
This commit is contained in:
Carson Sievert
2025-06-12 16:23:38 -05:00
committed by GitHub
parent 219fbc6819
commit 57bb3a12d3
2 changed files with 3 additions and 1 deletions

View File

@@ -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

View File

@@ -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