问题
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:
which kind of uses up some of the large margin space (as desired) but still does not cover the whole slide.
回答1:
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">
来源:https://stackoverflow.com/questions/36287791/full-size-shiny-app-in-an-ioslides-markdown-presentation-slide