guyabel
guyabel

Reputation: 8366

Full size shiny app in an ioslides markdown presentation slide

Trying to figure out how to have a full size shiny app in an ioslides markdown. I have something almost working, but it is a bit ad-hoc. I am also not confident it will reproduce when I show the presentation on a larger resolution screen (as I use px in the div)?:

---
title: "My Title"
author: "My Name"
date: "29 March 2016"
runtime: shiny
output: 
  ioslides_presentation
---
##  

<div style="margin-left:-50px; margin-top:-50px; width:80%; height:100%">
```{r, echo=FALSE, message=FALSE, fig.width=8}
inputPanel(
  selectInput("n_breaks", label = "Number of bins:",
              choices = c(10, 20, 35, 50), selected = 20),

  sliderInput("bw_adjust", label = "Bandwidth adjustment:",
              min = 0.2, max = 2, value = 1, step = 0.2)
)

renderPlot({
  hist(faithful$eruptions, probability = TRUE, breaks = as.numeric(input$n_breaks),
       xlab = "Duration (minutes)", main = "Geyser eruption duration")

  dens <- density(faithful$eruptions, adjust = input$bw_adjust)
  lines(dens, col = "blue")
})
```
</div>

giving:

enter image description here

which kind of uses up some of the large margin space (as desired) but still does not cover the whole slide.

Upvotes: 4

Views: 1272

Answers (1)

Paul
Paul

Reputation: 338

Try playing around with the values in your div<>. You can go over 100% and also set the size in pixels, e.g. <div style="margin-left:-120px; margin-top:-50px; width:900px">

Upvotes: 3

Related Questions