Shiny: plot results in popup window

前端 未结 3 925
[愿得一人]
[愿得一人] 2020-12-28 22:19

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 b

3条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-28 22:30

    You could use a conditional panel to show/hide an absolute panel containing your plot, setting the condition to some js variable toggled by a function attached to your button .

    e.g.

    conditionalPanel("popupActive==1",
                            absolutePanel(id = "popup", class = "modal", 
                                          fixed = FALSE, draggable = TRUE,
                                          top = 200, right = "auto", left = 400, 
                                          bottom = "auto",
                                          width = 500, height = 500,
                            plotOutput(#output plot stuff#)
                            )
                            )
    

    Then toggle the value of popupActive in js to show/hide

      HTML(''), HTML(''),
    

提交回复
热议问题