inst/abcdmetrics/app.R

source("www/packages.R", local = TRUE)
source("www/theming.R", local = TRUE)
source("www/data.R", local = TRUE)

# Define UI for application that draws a histogram
ui <- page(
  theme = abcd_theme,
  includeCSS("www/styles.css"),
  
  page_navbar(
    title = "ABCD Metrics",
    id = "tabs",
    position = "static-top",
    window_title = "ABCD Metrics Dashboard",
    collapsible = TRUE, 
    inverse = FALSE,  # important for CSS!
    nav("Visit Status", value = "visit_status",
        fluidRow(
          column(3,
                 div(id = "welcome",
                 a(img(src = "ABCD_logo.png", style = "height: 55px; position: relative;")),
                 h3("Welcome to ABCD Metrics Dashboard!"),
                 p("We will add some important content here...")
                 ),
                 h1("User Inputs:"),
                 sliderInput("binwidth",
                             "Width of bins:",
                             min = 1,
                             max = 50,
                             value = 30),
                 pickerInput("site_selection", choices = c("ABCD Overall", study_sites),
                             selected = "ABCD Overall",
                             multiple = TRUE, options = list(`actions-box` = TRUE),
                             choicesOpt = list(icon = c("glyphicon glyphicon-globe")))
          ),
          
          column(9,
                 h1("Viz:"),
                 plotOutput("distPlot")
          )
        )
    ),
    nav("FAQ", value = "faq",
        p("TODO")
    )
  )
)
  
  # Define server logic required to draw a histogram
  server <- function(input, output, session) {
    
    output$distPlot <- renderPlot({
      ggplot(data = faithful, aes(x = waiting)) + 
        geom_histogram(binwidth = input$binwidth)
    })
  }
  
  # Run the application 
  shinyApp(ui = ui, server = server)
  
ocelhay/abcd-metrics documentation built on April 23, 2022, 12:39 a.m.