inst/waittimeapp/ui.R

library(markdown)

shinyUI(fluidPage(theme = "bootstrap.css",
                  pageWithSidebar(
  headerPanel('NUMBER26 & Twitter', windowTitle = "NUMBER26 Dashboard"),
  sidebarPanel(width = 5,
   includeHTML("twittercard.html"),
    includeMarkdown("purpose.md"),
    selectInput('date_range', 'Date Range', list("All-time" = as.Date("2014-12-01"),
                                                 "Past 30 Days" = Sys.Date() - 30)),
   includeMarkdown("analysis.md"),
   p(strong(textOutput("people_served", inline = TRUE), " people", style = "color:#d9230f"),
       "(", textOutput("pct_served", inline = TRUE), "%)", " were served within the ideal response time, but ",
       strong(textOutput("people_waiting", inline = TRUE), " people", style = "color:#d9230f"),
       " were kept waiting a total of",
       strong(textOutput("time_waited", inline = TRUE), " hours", style = "color:#d9230f"),
       " beyond the desired response time",
     br(), br()),
   sliderInput('target_wait_time', "Choose the ideal response time to check out NUMBER26's current performance:",
               0, 360, 45, post = " min", step = 15),
   h4("Getting even better:"),
   p("NUMBER26 could add additional social media support at key times to improve performance, especially on weekday evenings and during the day on the weekend.",
   br(), br(), "By optimizing both weekend and weekday hours:",
   strong(textOutput("additional_people_served_intervention", inline = TRUE),
             " additional people", style = "color:#d9230f"),
   " would have been served within the ideal response time given additional availability, saving a total of ",
   strong(textOutput("less_time_waiting_intervention", inline = TRUE), " hours", style = "color:#d9230f"),
   "of waiting.", br(), br(),
   "Play around with the settings below to see how much users would benefit from expanded service:"),
    sliderInput('addl_hours_weekday', 'Additional Hours (Weekday)', 8, 24, post = ":00", c(19,21)),
    sliderInput('addl_hours_weekend', 'Additional Hours (Weekend)', 8, 24, post = ":00", c(11,15)),
    includeMarkdown("metrics.md"),
    includeMarkdown("commentary.md")
  ),
  mainPanel(width = 7,
    tabsetPanel(
      tabPanel("Overall Performance", taucharts::tauchartsOutput("plot2", width = "500px", height = "300px")),
      tabPanel("Trends by Time of Day & Day of Week", taucharts::tauchartsOutput("plot1", width = "600px", height = "100%"))
      )

  )
)))
jlewis91/datascience documentation built on May 19, 2019, 12:46 p.m.