diff --git a/R/flex_dashboard.R b/R/flex_dashboard.R index 6689e676..1ab19f6f 100644 --- a/R/flex_dashboard.R +++ b/R/flex_dashboard.R @@ -237,6 +237,13 @@ flex_dashboard <- function(fig_width = 6.0, if (!is.null(fig_mobile)) { next_figure_id <- 1 knitr_options$opts_hooks$dev <- function(options) { + + # don't provide an extra 'png' device for context=data chunks + # used in shiny_prerendered (it breaks data chunk caching) + if (identical(options$label, "data") || identical(options$context, "data")) { + return(options) + } + if (identical(options$dev, 'png')) { figure_id <- paste0('fig', next_figure_id) options$dev <- c('png', 'png') diff --git a/inst/NEWS b/inst/NEWS index 5fb348d5..03ac59b2 100644 --- a/inst/NEWS +++ b/inst/NEWS @@ -1,5 +1,12 @@ -flexdashboard 0.4 (unreleased) +flexdashboard 0.5 +----------------------------------------------------------------------- + +- Don't hook graphics device option for fig_mobile if it's a data + chunk (this broke knitr caching for shiny_prerendered data chunks) + + +flexdashboard 0.4 ----------------------------------------------------------------------- - Add support for `target` field in navbar links (e.g. target: "_blank")