ui.R 5.69 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
ui <- dashboardPage(
9
10
  skin="purple",
  
Stephanie's avatar
Stephanie committed
11
12
13
14
  dashboardHeader(title="CoCoVisR"),
  dashboardSidebar(
    sidebarMenu(
      menuItem("Upload", tabName = "upload", icon =icon("upload")),
15
      menuItem("Data", tabName = "data", icon =icon("list")),
Stephanie's avatar
Stephanie committed
16
17
18
19
20
      menuItem("Contolls", tabName = "controlls", icon = icon("cog")),
      menuItem("Dashboard", tabName = "dashboard", icon = icon("dashboard")),
      menuItem("Help", tabName = "help", icon = icon("book"))
    )
  ),
21
  
Stephanie's avatar
Stephanie committed
22
  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
      #show data tab content
      tabItem(tabName = "data",
              
50
                h2("CoConUT Data here:"),
51
52
                "Last Loaded CoConUT Data: ",
                textOutput("lastLoadedNut"),
53
                dataTableOutput("file1"),
54
55
56
               
                
                h2("CoCoQuest Data here:"),
57
58
                "Last Loaded CoCoQuest Data: ",
                textOutput("lastLoadedQuest"),
59
                dataTableOutput("file2")
60
61
62
63
              
      ),
      
      
Stephanie's avatar
Stephanie committed
64
65
      # Controlls tab content
      tabItem(tabName = "controlls",
66
              h2("Controlls here:"),
67
68
              
              #TODO: SelectInput --> Get data out of loaded json to select it
69
              checkboxInput("histogram", "Histogram", FALSE),
70
71
              uiOutput("input_hist_x"),
              uiOutput("input_hist_y"),
72
              checkboxInput("timeline", "Timeline", FALSE),
73
74
              uiOutput("input_time_x"),
              uiOutput("input_time_y"),
75
              checkboxInput("map", "Map", FALSE),
76
77
              uiOutput("input_map_x"),
              uiOutput("input_map_y"),
78
              checkboxInput("lingegraph","Linegraph",FALSE),
79
80
              uiOutput("input_line_x"),
              uiOutput("input_line_y")
Stephanie's avatar
Stephanie committed
81
82
83
84
85
86
      ),
      
      # Dashboard tab content
      tabItem(tabName = "dashboard",
              h2("This is the Dashboard"),
              fluidRow(
87
88
89
90
91
92
93
94
95
                #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
96
                box(  title="Histogram",
97
                      status= "warning",
Stephanie's avatar
Stephanie committed
98
99
100
                      solidHeader = TRUE,
                      collapsible = TRUE,
                      plotOutput("plot1", height = 250)),
101
102
                #},

Stephanie's avatar
Stephanie committed
103
                box(title="Map",
104
                    status = "warning",
Stephanie's avatar
Stephanie committed
105
106
                    solidHeader = TRUE,
                    collapsible = TRUE,
107
                    plotOutput("plot2", height = 250)),
Stephanie's avatar
Stephanie committed
108
                box(title="Timeline",
109
                    status = "warning",
Stephanie's avatar
Stephanie committed
110
111
112
                    solidHeader = TRUE,
                    collapsible = TRUE,plotOutput("plot3", height = 250)),
                box(title="Linechart",
113
                    status = "warning",
Stephanie's avatar
Stephanie committed
114
115
                    solidHeader = TRUE,
                    collapsible = TRUE,plotOutput("plot4", height = 250))
116
            
Stephanie's avatar
Stephanie committed
117
118
119
120
121
              )
      ),
      
      # Help tab content
      tabItem(tabName = "help",
122
123
124
125
126
127
128
              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(),
129
              "Please make sure, that you upload the right data into the right field. If not please restart the Application and upload the correct file. Reloading within one session is not possible. ", br(),
130
              "First field: CoConUT and second field: CoCoQuest. Otherwise the visualization won't work.",
131
132
              h3("Data"),
              "After correctly loading up the right json files, in this vies will apear a table that shows the data that were red from the jsons.", br(),
133
              h3("Controlls"),
134
135
              "On this page you are able to select the visualizations you want to use and which data should be in them.", br(),
              "To show a visualization on the dashboard you have to enable the right checkbox. After that you need to select the x- and y-axis for this visualisation and then it will be added to the dashboard. ",
136
137
              h3("Dashboard"),
              "", br()
Stephanie's avatar
Stephanie committed
138
139
      )
    
140
    
Stephanie's avatar
Stephanie committed
141
    ))
142
)