(ui.R)
library(shiny)
shinyUI(fluidPage(
tags$head(
tags$script(
HTML("
Shiny.addCustomMessageHandler ('resize',function (message) {
$('#allmaps').css('height', message);
});
")
)
),
selectInput("total", "Total Plots", list("1" = "1", "2" = "2", "3" = "3"))
...
(server.R)
shinyServer(function(input, output, session) {
observeEvent(input$action,{
session$sendCustomMessage(type = 'resize', message = paste0(100 * getTotal(), 'vh'))
})
getTotal <- reactive({
return (as.numeric(input$total))
})
output$allmaps <- renderPlot({
do.call("grid.arrange", c(plotObjects(), nrow = ceiling(getTotal() / getNumCols()), ncol = getNumCols()))
})
...--
You received this message because you are subscribed to the Google Groups "Shiny - Web Framework for R" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shiny-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/shiny-discuss/33a0f854-2012-4f2b-a2e1-097a77e5a53b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
$('#allmaps').css('height', 100vh).trigger('shown');
(ui.R)
library(shiny)
shinyUI(fluidPage(
tags$head(
tags$script(
HTML("
Shiny.addCustomMessageHandler ('resize',function (message) {
$('#allmaps').css('height', message);
});
")
),
tags$style("#allmaps{height:200vh !important;}")
),
selectInput("total", "Total Plots", list("1" = "1", "2" = "2", "3" = "3"))
...