Trying to add a box to a shiny R app at the top to house a short description and a logo

风格不统一 提交于 2020-02-15 22:53:53

问题


I am trying to add a box to a shiny R app at the top to house a short description and a logo. I have been unable to find any code that works. My thinking was to include a horizontal box and pass some text/image for the logo into it, but have not found any solutions. Any help appreciated. Some structural code below.

header <- dashboardHeader(title = "May 2017", 
                          titleWidth = 525)



sidebar <- dashboardSidebar(disable = TRUE)




frow2 <- fluidRow(

  box(
    title = ""
    ,status = "primary"
    ,solidHeader = TRUE 
    ,collapsible = TRUE 
    ,dataTableOutput("topTen")
    , height = 640
    , width = 6


  )

  ,box(
    title = ""
    ,status = "primary"
    ,solidHeader = TRUE 
    ,collapsible = TRUE 
    ,dataTableOutput("topTenMostVuln")
    , height = 640
    , width = 6
  )

)


frow3 <- fluidRow(

  box(
    title = ""
    ,status = "primary"
    ,solidHeader = TRUE 
    ,collapsible = TRUE 
    ,plotOutput("zscore_chart")
    , height = 600
    , width = 6
  )



  ,box(
    title = "Probabilities by Country and Crisis Type"
    ,status = "primary"
    ,solidHeader = TRUE 
    ,collapsible = TRUE 
    ,plotOutput("probability_chart")
    , height = 600
    , width = 6


  )
)



frow4 <- fluidRow(

  box(
    title = "Output"
    ,tabBox(
      width = 18
      ,height = 60
      ,id = "dataTabBox"
      ,tabPanel(
        title = ""
        ,dataTableOutput("")
      )
      ,tabPanel(
        title = ""
        ,dataTableOutput("")
      )
      ,tabPanel(
        title = ""
        ,dataTableOutput("")
      )
      ,tabPanel(
        title = ""
        ,dataTableOutput("")
      )
      ,tabPanel(
        title = ""
        ,dataTableOutput("")
      )

    )
    ,status = "primary"
    ,solidHeader = TRUE 
    ,collapsible = TRUE 
    , height = 880
    , width = 12
  )



)




body <- dashboardBody(frow4, frow3, frow2)

ui <- dashboardPage(header, sidebar, body, skin = "black")


server <- function(input, output) { 

  })



shinyApp(ui, server)

Edit: I need to add a box to house some text to act as a description as to what the application does as well as a logo, right aligned.


回答1:


Have a look at the answer to this question, a text and image in a box, would this be what you need?



来源:https://stackoverflow.com/questions/44262563/trying-to-add-a-box-to-a-shiny-r-app-at-the-top-to-house-a-short-description-and

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!