plotOutput inside wellPanel with multiple columns

371 views
Skip to first unread message

António M. Rodrigues

unread,
Jan 6, 2016, 10:08:14 AM1/6/16
to Shiny - Web Framework for R
hi

Hi,

I'd like to have a wellPanel with two columns, one of which is a plot. The problem is that the plot does not render. The following illustrates the problem:

library(shiny)

shiny
::runApp(list(
##########
  ui
= basicPage(
   
    wellPanel
(plotOutput(outputId = "plot1")),
   
    wellPanel
(
      div
(style="display:inline-block;","qwert"),
      div
(style="display:inline-block;",
          wellPanel
("The quick brown fox jumps over the lazy dog"))
   
),
   
    wellPanel
(
    div
(style="display:inline-block;",
            wellPanel
(plotOutput(outputId = "plot2"))),
    div
(style="display:inline-block;",
          wellPanel
(style="border-color: #8b8b8b; background-color: #ffffff;","qwerty"))
   
)
 
),

##########
server
= function(input, output, session) {

    output$plot1
<- renderPlot({
      plot
(rnorm(10))
   
})

    output$plot2
<- renderPlot({
      plot
(1)
   
})    
 
}
))

For some reason, the last wellpanel is empty.
Any help?
Thanks,
António

Winston Chang

unread,
Jan 6, 2016, 11:33:32 AM1/6/16
to António M. Rodrigues, Shiny - Web Framework for R
I think the problem is that the div needs a width specified - otherwise it defaults to 0 width. For example, this fixes it:

    div(style="display:inline-block; width: 100%",
            wellPanel(plotOutput(outputId = "plot2"))),


--
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/22f85519-148b-45c3-a1c0-6fd63731359c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

António M. Rodrigues

unread,
Jan 6, 2016, 11:44:25 AM1/6/16
to Shiny - Web Framework for R, amcrgro...@gmail.com
Yes, that solved the problem...
Thanks!
Reply all
Reply to author
Forward
0 new messages