rstudio / flexdashboard

Easy interactive dashboards for R
https://pkgs.rstudio.com/flexdashboard/
Other
812 stars 301 forks source link

Suddenly cannot use thematic with svg devices #342

Closed py9mrg closed 3 years ago

py9mrg commented 3 years ago

Hello,

I have a dashboard for which I have been using the svg device for plots and thematic for automatic theming of the plots. It has worked fine but between the last generation of the dashboard (11th May) and now, something has broken. I've tried rolling back package versions of flexdashboard, knitr, thematic, bslib, ggplot2, but I can't seem to find the culprit.

Here's an MWE illustrating the problem:

    ---
    title: "Untitled" 
    output: 
      flexdashboard::flex_dashboard:
        theme:
          bootswatch: cosmo
          base_font:
            google: Open Sans
        orientation: columns
        vertical_layout: fill
    ---

    ```{r setup, include=FALSE}
    knitr::opts_chunk$set(echo = TRUE, dev = "svg")
    library(flexdashboard)
    library(ggplot2)
    library(thematic)
    thematic_rmd(font = "auto")
### Chart A

```{r}
ggplot(iris, (aes(Sepal.Width, Sepal.Length))) +
  geom_point()
```


This will cause knitr compilation to hang. But if you comment out either the knitr line that set the device as svg (or change it to png) **or** the thematic_rmd call, then it will compile perfectly fine. So there must be some recent change that means thematic doesn't play well with svg devices.
py9mrg commented 3 years ago

Actually, I just tried an html_document instead of a flexdashboard and the same problem. So I think this is more of an rmarkdown issue than flexdashboard. WIll close here and open there.