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

Stephanie's avatar
Stephanie committed
8

Stephanie's avatar
Stephanie committed
9
ui <- dashboardPage(
10
11
  skin="purple",
  
Stephanie's avatar
Stephanie committed
12
13
14
15
  dashboardHeader(title="CoCoVisR"),
  dashboardSidebar(
    sidebarMenu(
      menuItem("Upload", tabName = "upload", icon =icon("upload")),
16
      menuItem("Data", tabName = "data", icon =icon("list")),
Stephanie's avatar
Stephanie committed
17
18
19
20
21
22
      menuItem("Contolls", tabName = "controlls", icon = icon("cog")),
      menuItem("Dashboard", tabName = "dashboard", icon = icon("dashboard")),
      menuItem("Help", tabName = "help", icon = icon("book"))
    )
  ),
  dashboardBody(
23
24
25
26
    #tags$head(
    #  tags$link(rel = "stylesheet", type = "text/css", href = "custom.css")
    #),
    
Stephanie's avatar
Stephanie committed
27
28
29
    tabItems(
      # Upload tab content
      tabItem(tabName = "upload",
30
31
32
33
34
35
36
37
38
39
40
41
42
43
              h2("Upload here:"),
              fileInput("file1", "Select CoConUT Data (*.json):",
                        multiple = FALSE,
                        accept = c(
                          "text/json",
                          "text/comma-separated-values,text/plain",
                          ".json")),
              fileInput("file2", "Select CoCoQuest Data (*.json):",
                        multiple = FALSE,
                        accept = c(
                          "text/json",
                          "text/comma-separated-values,text/plain",
                          ".json"))
              
44
              
Stephanie's avatar
Stephanie committed
45
46
      ),
      
47
48
49
50
51
52
53
54
55
56
      #show data tab content
      tabItem(tabName = "data",
              h2("CoConUT Data here:"),
              textOutput("data"),
              h2("CoCoQuest Data here:")
              
              
      ),
      
      
Stephanie's avatar
Stephanie committed
57
58
      # Controlls tab content
      tabItem(tabName = "controlls",
59
60
61
62
63
64
65
66
67
              h2("Controlls here:"),
              checkboxInput("histogram", "Histogram", FALSE),
              #selectInput('in6', 'Data', data.name, multiple=TRUE, selectize=TRUE),
              checkboxInput("timeline", "Timeline", FALSE),
              #selectInput('in6', 'Data', data.name, multiple=TRUE, selectize=TRUE),
              checkboxInput("map", "Map", FALSE),
              #selectInput('in6', 'Data', data.name, multiple=TRUE, selectize=TRUE),
              checkboxInput("lingegraph","Linegraph",FALSE)
              #selectInput('in6', 'Data', data.name, multiple=TRUE, selectize=TRUE)
Stephanie's avatar
Stephanie committed
68
69
70
71
72
73
      ),
      
      # Dashboard tab content
      tabItem(tabName = "dashboard",
              h2("This is the Dashboard"),
              fluidRow(
74
75
76
77
78
79
80
81
82
                #tabBox(
                  #title = "First tabBox",
                  # The id lets us use input$tabset1 on the server to find the current tab
                  #id = "tabset1", height = "250px",
                  #tabPanel("Tab1", "First tab content"),
                  #tabPanel("Tab2", "Tab content 2")
                #),
                
                #if(menuitem$controls$histogram ==TRUE){
Stephanie's avatar
Stephanie committed
83
                box(  title="Histogram",
84
                      status= "warning",
Stephanie's avatar
Stephanie committed
85
86
87
                      solidHeader = TRUE,
                      collapsible = TRUE,
                      plotOutput("plot1", height = 250)),
88
89
                #},

Stephanie's avatar
Stephanie committed
90
                box(title="Map",
91
                    status = "warning",
Stephanie's avatar
Stephanie committed
92
93
                    solidHeader = TRUE,
                    collapsible = TRUE,
94
                    plotOutput("plot2", height = 250)),
Stephanie's avatar
Stephanie committed
95
                box(title="Timeline",
96
                    status = "warning",
Stephanie's avatar
Stephanie committed
97
98
99
                    solidHeader = TRUE,
                    collapsible = TRUE,plotOutput("plot3", height = 250)),
                box(title="Linechart",
100
                    status = "warning",
Stephanie's avatar
Stephanie committed
101
102
                    solidHeader = TRUE,
                    collapsible = TRUE,plotOutput("plot4", height = 250))
103
            
Stephanie's avatar
Stephanie committed
104
105
106
107
108
              )
      ),
      
      # Help tab content
      tabItem(tabName = "help",
109
110
111
112
113
114
115
116
117
118
119
120
121
              h2("I am here to Help."),
              "This tool was created to help visualize and analyse data which is recorded with the CoConUT and CoCoQuest Applications.",
              h3("Uploading Data"),
              "Please make sure the files you want to upload are *.json files  Otherwise the upload won't work.", br(),
              "For uploading you have to click on the 'Browse'-Button and an explorer-window will open.", br(),
              "Please navigate to the wanted file, select it and click on 'open'. 
              Then the name of the selected file and a loadingbar will apear. 'Upload complete' will show you that the upload worked and is finished.", br(),
              "Please make sure, that you upload the right data into the right field.", br(),
              "First field: CoConUT and second field: CoCoQuest. Otherwise the visualization won't work.",
              h3("Controlls"),
              "", br(),
              h3("Dashboard"),
              "", br()
Stephanie's avatar
Stephanie committed
122
123
      )
    
124
    
Stephanie's avatar
Stephanie committed
125
    ))
126
)