1

This is not a duplicate of neither Shiny app size in ioslides nor Full size shiny app in an ioslides markdown presentation slide as they seem not to answer my question.

I have a Shiny app built with airquality and having a long sidebar panel, and it is saved as "airquality_app.R":

library(shiny)
library(ggplot2)

ui <- fluidPage(
  # Application title
  titlePanel("New York Air Quality Measurements, May to September 1973"),
  sidebarLayout(
    sidebarPanel(
      helpText("1. Select one month and one variable which interest you"),
      helpText("2. Click \"Confirm\""),
      helpText("3. The line graph (with a blue trend curve) of the chosen variable versus days of the month will be showed"),
      selectInput(
        "month", "Select the month",
        choices = month.name[5:9]
      ),
      selectInput(
        "obs", "Select one variable",
        choices = names(airquality)[1:4]
      ),
      h5("Ozone:"),
      "Mean ozone in parts per billion from 1300 to 1500 hours at Roosevelt Island",
      h5("Solar.R:"),
      "Solar radiation in Langleys in the frequency band 4000-7700 Angstroms from 0800 to 1200 hours at Central Park",
      h5("Wind:"),
      "Average wind speed in miles per hour at 0700 and 1000 hours at LaGuardia Airport",
      h5("Temp:"),
      "Maximum daily temperature in degrees Fahrenheit at La Guardia Airport",
      tags$i(helpText("Data from R built-in airquality data set")),
      submitButton("Confirm")
    ),
    # Show a plot of the selected condition
    mainPanel(
       plotOutput("airplot")
    )
  )
)

ylab_list <- list(
  Ozone = "Mean Ozone (ppb)",
  Solar.R = "Solar Radiation (Langleys)",
  Wind = "Average Wind Speed (miles/hour)",
  Temp = expression(paste("Maximun Daily Temperature (", degree ~ F, ")", sep = ""))
)

# Define server logic required to draw a line chart
server <- function(input, output) {
  month_selected <- reactive({match(input$month, month.name)})
  output$airplot <- renderPlot({
    ggplot(aes_string(x = "Day", y = input$obs),
                data = subset(airquality, Month == month_selected())) +
      geom_line(size = 1) + geom_smooth() +
      labs(list(x = "Day of Month", y = ylab_list[[input$obs]]))
  })
}

shinyApp(ui = ui, server = server)

Now, in an ioslides presentation, I'd like to embed this app like Embedded Shiny Apps - External Applications introduced, so I've done:

```{r, echo = FALSE}
shinyAppFile("airquality_app.R",
             options = list(width = "100%", height = 7))
```

However, the sidebar panel is so long that I have to scroll to see the rest of UI even when I set the height as merely 7:

airquality_app

Why is that and how can I see the whole app without scrolling it in a slide with the options?

ytu
  • 1,822
  • 3
  • 19
  • 42
  • any way you can share the data or create some sample data? Usually these issues come from a crappy resolution in the css part of the html, try to add `` directly under the yaml-header in markdown – 5th May 11 '18 at 16:01
  • @5th I use `airquality` as the data as I mentioned above. BTW I added that and it says "Error in yaml::yaml.load(string, ...) : Scanner error: mapping values are not allowed in this context at line 6, column 6 Calls: ... parse_yaml_front_matter -> yaml_load_utf8 -> -> .Call" – ytu May 11 '18 at 17:03
  • sorry my bad. One of those R-datasets I didnt know. The error comes because the identation is not correct. For starters: What you're doing is very difficult. I just played around for more than half an hour and I only managed to completely distort the ioslides-css. Just try using `.current` instead of `.main-container` and add e.g. `height=900px`. However this isn't helping; You need to change the attributes from the standard ioslides-css - no idea how to even do that. The only way I know how to implement an interactive presentaion is using `plotly`-dropdowns and the `reveal.js`-slides. – 5th May 11 '18 at 19:04
  • So the short answer to your question is likely that you can't see the whole app because of `ioslides`-styling and actually the `options`-list won't help you. – 5th May 11 '18 at 19:06

0 Answers0