Skip to content

Commit

Permalink
don't hook graphics device option for fig_mobile if it's a data chunk
Browse files Browse the repository at this point in the history
  • Loading branch information
jjallaire committed Mar 8, 2017
1 parent 0a88a91 commit 1f848f7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
7 changes: 7 additions & 0 deletions R/flex_dashboard.R
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
9 changes: 8 additions & 1 deletion inst/NEWS
Original file line number Diff line number Diff line change
@@ -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")
Expand Down

0 comments on commit 1f848f7

Please sign in to comment.