diff --git a/DESCRIPTION b/DESCRIPTION index f32a09d427..babb6dc79e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -35,7 +35,7 @@ Imports: viridisLite, base64enc, htmltools (>= 0.3.6), - htmlwidgets (>= 1.3), + htmlwidgets (>= 1.5.2.9001), tidyr, hexbin, RColorBrewer, diff --git a/R/shiny.R b/R/shiny.R index 818f2094c4..3b0a3a50ce 100644 --- a/R/shiny.R +++ b/R/shiny.R @@ -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)