fix(renderPlot): get interactive plotting working with ggplot2 v4.0 #4228
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This update gets
renderPlot()
interactive ggplot2 feature working with ggplot2's upcoming transition from S3 to S7 (tidyverse/ggplot2#6364).Note that #4226 fixed a similar issue, but only for our unit tests. The same problem exists in
renderPlot()
's interactive feature, which we don't have any automated tests for.For a minimal example, with this app, no brushed points are returned when brushing the plot.
With this change, you'll get the expected behavior:
Testing notes
remotes::install_github("tidyverse/ggplot2#6364")
remotes::install_github("rstudio/shiny#4228")
More generally, we should do more testing of shiny's interactive ggplot2 plot feature to make sure there isn't more changes that we're missing. We still have a handful of apps that we designed for manually testing, but never got automated tests:
093-plot-interaction-basic
094-image-interaction-basic
095-plot-interaction-advanced
096-plot-interaction-article-1
097-plot-interaction-article-2
098-plot-interaction-article-3
099-plot-interaction-article-4
100-plot-interaction-article-5
101-plot-interaction-article-6
102-plot-interaction-article-7
103-plot-interaction-article-8
104-plot-interaction-select
105-plot-interaction-zoom
106-plot-interaction-exclude
It'd also be great to verify that these apps are working as intended with the latest ggplot2 (plus this change). Testing across different environments isn't that important (we're just looking for changes in ggplot2's R code that we're not accounting for).