Skip to content

Commit e445ecc

Browse files
committed
Add support for withCache
1 parent 51e444d commit e445ecc

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Imports:
3535
viridisLite,
3636
base64enc,
3737
htmltools (>= 0.3.6),
38-
htmlwidgets (>= 1.3),
38+
htmlwidgets (>= 1.5.2.9001),
3939
tidyr,
4040
hexbin,
4141
RColorBrewer,

R/shiny.R

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,10 @@ renderPlotly <- function(expr, env = parent.frame(), quoted = FALSE) {
5555
# objects to renderPlotly() (e.g., ggplot2, promises). It also is used
5656
# to inform event_data about what events have been registered
5757
shiny::installExprFunction(expr, "func", env, quoted)
58-
expr <- quote(getFromNamespace("prepareWidget", "plotly")(func()))
59-
local_env <- environment()
60-
renderFunc <- shinyRenderWidget(expr, plotlyOutput, local_env, quoted)
58+
expr2 <- quote(getFromNamespace("prepareWidget", "plotly")(func()))
59+
renderFunc <- shinyRenderWidget(expr2, plotlyOutput, environment(), quoted,
60+
cacheHint = list(userExpr = expr, "renderPlotly")
61+
)
6162
# remove 'internal' plotly attributes that are known to cause false
6263
# positive test results in shinytest (snapshotPreprocessOutput was added
6364
# in shiny 1.0.3.9002, but we require >= 1.1)

0 commit comments

Comments
 (0)