ui.R 2.32 KB
Newer Older
Stephanie's avatar
Stephanie committed
1 2 3 4 5
## app.R ##
library(shiny)
library(shinydashboard)
library(leaflet)

Stephanie's avatar
Stephanie committed
6
ui <- dashboardPage(
Stephanie's avatar
Stephanie committed
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
  dashboardHeader(title="CoCoVisR"),
  dashboardSidebar(
    sidebarMenu(
      menuItem("Upload", tabName = "upload", icon =icon("upload")),
      menuItem("Contolls", tabName = "controlls", icon = icon("cog")),
      menuItem("Dashboard", tabName = "dashboard", icon = icon("dashboard")),
      menuItem("Help", tabName = "help", icon = icon("book"))
    )
  ),
  dashboardBody(
    tabItems(
      # Upload tab content
      tabItem(tabName = "upload",
              h2("Upload here")
      ),
      
      # Controlls tab content
      tabItem(tabName = "controlls",
              h2("Controlls here")
      ),
      
      # Dashboard tab content
      tabItem(tabName = "dashboard",
              h2("This is the Dashboard"),
              fluidRow(
                box(  title="Histogram",
Stephanie's avatar
Stephanie committed
33
                      status = "primary",
Stephanie's avatar
Stephanie committed
34 35 36 37 38 39 40 41
                      solidHeader = TRUE,
                      collapsible = TRUE,
                      plotOutput("plot1", height = 250)),
                box(title="Map",
                    status = "primary",
                    solidHeader = TRUE,
                    collapsible = TRUE,
                    plotOutput("plot1", height = 250)),
Stephanie's avatar
Stephanie committed
42 43 44 45 46 47 48 49
                box(title="Timeline",
                    status = "primary",
                    solidHeader = TRUE,
                    collapsible = TRUE,plotOutput("plot3", height = 250)),
                box(title="Linechart",
                    status = "primary",
                    solidHeader = TRUE,
                    collapsible = TRUE,plotOutput("plot4", height = 250))
Stephanie's avatar
Stephanie committed
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
                #box(
                 # title = "Controls",
                  #sliderInput("slider", "Number of observations:", 1, 100, 50)
                #)
              )
      ),
      
      # Help tab content
      tabItem(tabName = "help",
              h2("I am here to Help.")
      )
    
      
    ))
)

Stephanie's avatar
Stephanie committed
66 67 68
#server <- function(input, output) {
#  set.seed(122)
  #histdata <- rnorm(500)
Stephanie's avatar
Stephanie committed
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
  
  #output$plot1 <- renderPlot({
    #data <- histdata[seq_len(input$slider)]
    #hist(data)
  #})
 
  ##MAP 
  
  #m <- leaflet()
  #m <- addTiles(m)
  #x=1
  #for(x in 1:2019){
    #m <- addMarkers(m,lng=longitude[x], lat=latitude[x]) #addPolylines does not work
    #x=x+1}
  #m
Stephanie's avatar
Stephanie committed
84 85
#}
#shinyApp(ui, server)