多个图的闪亮布局

时间:2019-06-01 02:34:23

标签: r shiny

我正在开发一个带有侧面滚动条的闪亮应用程序,以垂直方式显示我的作品。

我有多个情节,我想每行显示两个。像下面的草图一样:

enter image description here

我设法并排放置了两个地块。但是我无法为其他2开始新的一行。这是我的代码:

    #ui
shinyUI(
  pageWithSidebar(
    headerPanel("NYC Flights Delays 2013"),
    splitLayout(
      plotlyOutput("networkgraph"),
      plotlyOutput("map")
    ),
    sidebarPanel(
      selectInput('select','Sort airline delay rate',
                  c('Alphabetically','Delay Rate')),
      br(),
      helpText('Please hover over the graphs to view details')
)))

如果我继续向splitLayout函数中添加绘图,我最终将所有绘图都排在不需要的水平视图中。

谢谢

+ ----- UPDATE ----- +

我找到了解决方案。对于面临同样问题的任何人。我用了FluidPage

shinyUI(
    fluidPage(
      headerPanel("NYC Flights Delays 2013"),
      br(),
      helpText("please hover over plots to view details"),
      fluidRow(
        column(6,plotlyOutput("networkgraph")),
        column(6,plotlyOutput("map"))
      ),
      fluidRow(
        column(6,plotlyOutput("origin_airport_delay")),
        column(6,plotlyOutput("origin_airport_flight"))
    ),
    fluidRow(
      column(6,plotlyOutput("monthdelay")),
      column(6,plotlyOutput("flight_month_count"))
    ),
    fluidRow(
      column(6,plotlyOutput("daydelay")),
      column(6,plotlyOutput("flight_day_count"))
    ),
    fluidRow(
      column(7,plotlyOutput("airlinesrate")),
      column(7,plotlyOutput("airlinesratesort"))
    )
))

我仍在努力使侧边栏面板适合于此。

0 个答案:

没有答案
相关问题