Hi everyone,
I am trying to build a web app with shiny and I would like to display the resulting plot of a R function in a popup
window rather than in mainPanel.
For instance, for the below example (from http://shiny.rstudio.com/articles/action-buttons.html), clicking on "Go" button
would show the same plot but in a popup window.
I tried to add some javascript, but I have not succeeded yet... Can anyone help ?
Thank you in advance !
library(shiny)
ui <- fluidPage(
actionButton("go", "Go"),
numericInput("n", "n", 50),
plotOutput("plot")
)
server <- function(input, output) {
randomVals <- eventReactive(input$go, {
runif(input$n)
})
output$plot <- renderPlot({
hist(randomVals())
})
}
shinyApp(ui, server)