flexdashboard icon indicating copy to clipboard operation
flexdashboard copied to clipboard

Size of produced HTML

Open McCompexpert opened this issue 6 years ago • 2 comments

I created an simple dashboard with 3 value Boxes and two 12 row x 6 column tables. The resulted HTML size is five MB! Can I control somehow the size of the HTML?

McCompexpert avatar Jan 24 '19 14:01 McCompexpert

@McCompexpert same question, unfortunately no answer yet - I asked the question on stackoverflow as well

tidyeval avatar Feb 12 '19 06:02 tidyeval

By default, flexdashboard produce self contained document. All the data are encoded into the html file to produce a standalone file. This is why it is of big size. If you choose to not produce standalone file, the size will reduce. You need self_contained = FALSE in the flex_dashboard function. In the yaml, add the option self_contained: false for this format. This is the same option as in other format.

This should produce a html file (small size) and a resource folder with all the information needed for the html to render. You can then publish all this somewhere.

I let you try.

For reference, there are already some question about this topic in https://community.rstudio.com where it is a great place to ask such questions.

cderv avatar Feb 12 '19 07:02 cderv