Skip to content

Add support for shiny::bindCache #1879

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 16, 2020
Merged
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
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Imports:
viridisLite,
base64enc,
htmltools (>= 0.3.6),
htmlwidgets (>= 1.3),
htmlwidgets (>= 1.5.2.9001),
tidyr,
hexbin,
RColorBrewer,
Expand Down
7 changes: 4 additions & 3 deletions R/shiny.R
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,10 @@ renderPlotly <- function(expr, env = parent.frame(), quoted = FALSE) {
# objects to renderPlotly() (e.g., ggplot2, promises). It also is used
# to inform event_data about what events have been registered
shiny::installExprFunction(expr, "func", env, quoted)
expr <- quote(getFromNamespace("prepareWidget", "plotly")(func()))
local_env <- environment()
renderFunc <- shinyRenderWidget(expr, plotlyOutput, local_env, quoted)
expr2 <- quote(getFromNamespace("prepareWidget", "plotly")(func()))
renderFunc <- shinyRenderWidget(expr2, plotlyOutput, environment(), quoted,
cacheHint = list(label = "renderPlotly", userExpr = expr)
)
# remove 'internal' plotly attributes that are known to cause false
# positive test results in shinytest (snapshotPreprocessOutput was added
# in shiny 1.0.3.9002, but we require >= 1.1)
Expand Down