on click, display plot in popup window

373 views
Skip to first unread message

Erica Fary

unread,
Nov 25, 2015, 3:02:23 PM11/25/15
to Shiny - Web Framework for R
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)
Reply all
Reply to author
Forward
0 new messages