Set image size in flexdashboard multipage layout

Viewed 32

I am attempting to make a multipage flexdashboard document where an image is shown on one of the pages, but all of my attempts to fix the image size have failed. Each time the image auto-resizes to fit on the screen of the user viewing the page, and I necessarily need to the image to be at least a certain size so users can see specific details in the image. Ideally the user would be able to scroll up/down to view the whole image (and sometimes left/right, depending on the use case).

My syntax framework is:


image_name <- "long_dynamic_file_path.png"


Section A
=====================================
![](`r image_name`)

Section B
=====================================     
   
Row {.tabset .tabset-fade}
-------------------------------------

### B_0
stuff

### B_1
more stuff

Things I have tried that have not worked: Adding a width or size setting to the syntax above:

![](`r image_name`){width=200%}

![](`r image_name`){width=750px}

Wrapping the call to the image in an R block and specifying the size:

{r, fig.width=12, echo=FALSE}
knitr::include_graphics(image_name)

Setting the ccs style to specify the size and/or object-fit setting:

img {
  min-width:750px;
  object-fit: none;
}

(also have just tried "width:750px;")

I'm guessing there is some underlying syntax / argument that I haven't changed that needs changed. Any help or suggestions are welcome. Thank you!

1 Answers

Instead of using the flexdown package I was able to achieve the desired result by first displaying the image and then using native # Section {.tabset} functionality described here. While not exactly what I wanted, it was clean enough to use instead of over-complicating this use case with flexdown.

Related