Hi,
I was under the impression the fluidRow will shrink its heights to fit the elements in the row. The code below shows 2 rows all with 200 height plots but the fluidrows show a lot of white space in between. What is happening and how can you reduce/control the space between rows?
Thank you.
library(shiny)
library(plotly)ui = navbarPage("header1",
tabPanel("header2",
fluidRow(
column(2, wellPanel(
dateInput("Date", "Select a Date", value = "2005-01-01"))
),
column(10, tabsetPanel(type = "tabs",
tabPanel("Tab1",fluidRow( column(width = 4,plotly::plotlyOutput("plot1")%>% layout( title = "", xaxis=list(title=""), yaxis=list(title="") ) ), column(width = 4,plotly::plotlyOutput("plot2")%>% layout( title = "", xaxis=list(title=""), yaxis=list(title="")) ), column(width = 4,plotly::plotlyOutput("plot3")%>% layout( title = "", xaxis=list(title=""), yaxis=list(title="")) ) ), fluidRow( column(width = 4,plotly::plotlyOutput("plot4")%>% layout( title = "", xaxis=list(title=""), yaxis=list(title="") ) ), column(width = 4,plotly::plotlyOutput("plot5")%>% layout( title = "", xaxis=list(title=""), yaxis=list(title="")) ), column(width = 4,plotly::plotlyOutput("plot6")%>% layout( title = "", xaxis=list(title=""), yaxis=list(title="")) ) ) ) ) ) ) )
)
server = shinyServer(function(input, output) {
output$plot1 = renderPlotly({
plotly::plot_ly(data.frame(x = 1:3, y = 1:3), x = ~x, y =~y, type = 'bar',height=200)
})output$plot2 = renderPlotly({
plotly::plot_ly(data.frame(x = 1:3, y = 1:3), x = ~x, y =~y, type = 'bar',height=200)
})output$plot3 = renderPlotly({
plotly::plot_ly(data.frame(x = 1:3, y = 1:3), x = ~x, y =~y, type = 'bar',height=200)
})output$plot4 = renderPlotly({
plotly::plot_ly(data.frame(x = 1:3, y = 1:3), x = ~x, y =~y, type = 'bar',height=200)
})output$plot5 = renderPlotly({
plotly::plot_ly(data.frame(x = 1:3, y = 1:3), x = ~x, y =~y, type = 'bar',height=200)
})output$plot6 = renderPlotly({
plotly::plot_ly(data.frame(x = 1:3, y = 1:3), x = ~x, y =~y, type = 'bar',height=200)
})})
shinyApp(ui, server)