2

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.

OwlieW
  • 217
  • 6
  • 13
  • Which part is your header in this example? – MrFlick May 30 '17 at 13:00
  • The first line, which at the moment is the title of the application. Basically I need a way of adding a box of some kind to contain some text (description of the application) as well as a logo in png format – OwlieW May 30 '17 at 13:12
  • Did you try adding something like `img(src='image.png', align = "right")` in one of your `box` statements? – krish May 30 '17 at 15:13
  • Yes, but I need it at the top of the application. A placeholder for some text and a logo – OwlieW May 30 '17 at 15:30
  • Possible duplicate of [How can I add logo besides project name in shiny dashboard?](https://stackoverflow.com/questions/43849942/how-can-i-add-logo-besides-project-name-in-shiny-dashboard) – Tonio Liebrand May 30 '17 at 22:53

1 Answers1

2

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

enter image description here

shosaco
  • 5,915
  • 1
  • 30
  • 48