ui.R 5.54 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
              h2("Upload here:"),
31
              fileInput("nut", "Select CoConUT Data (*.json):",
32
                        multiple = TRUE,
33 34 35 36
                        accept = c(
                          "text/json",
                          "text/comma-separated-values,text/plain",
                          ".json")),
37
              fileInput("quest", "Select CoCoQuest Data (*.json):",
38
                        multiple = TRUE,
39 40 41 42 43
                        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
                h4("Last Loaded CoConUT Data: "),
52
                textOutput("lastLoadedNut"),
53
                dataTableOutput("nut"),
54 55 56
               
                
                h2("CoCoQuest Data here:"),
57
                h4("Last Loaded CoCoQuest Data: "),
58
                textOutput("lastLoadedQuest"),
59 60
                h4("Starttime: "),
                textOutput("totalStarttime"),
61
                dataTableOutput("quest")
62 63 64 65
              
      ),
      
      
Stephanie's avatar
Stephanie committed
66 67
      # Controlls tab content
      tabItem(tabName = "controlls",
68
              h2("Controlls here:"),
69
              textInput("title", "Title", " "),
70 71 72
              #HISTOGRAM
              checkboxInput("check_hist", "Histogram", FALSE),
              #uiOutput("check_hist"),
73 74
              uiOutput("input_hist_x"),
              uiOutput("input_hist_y"),
75 76
              #TIMELINE
              checkboxInput("check_time", "Timeline", FALSE),
77 78
              uiOutput("input_time_x"),
              uiOutput("input_time_y"),
79 80
              #MAP
              checkboxInput("check_map", "Map", FALSE),
81 82
              uiOutput("input_map_x"),
              uiOutput("input_map_y"),
83 84
              #LINEGRAPH
              checkboxInput("check_line", "Linegraph", FALSE),
85 86
              uiOutput("input_line_x"),
              uiOutput("input_line_y")
Stephanie's avatar
Stephanie committed
87 88 89 90
      ),
      
      # Dashboard tab content
      tabItem(tabName = "dashboard",
91
              h2(textOutput("text")),
Stephanie's avatar
Stephanie committed
92
              fluidRow(
93 94 95 96 97 98 99 100
                #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")
                #),
                
101 102 103 104 105 106
               
                uiOutput("hist_box"),
                uiOutput("time_box"),
                uiOutput("map_box"),
                uiOutput("line_box")
                
107
              ),
108
              actionButton("screenshot","Download")
109
              
110
              #downloadButton("downButton", "Download")
111
              
Stephanie's avatar
Stephanie committed
112 113 114 115
      ),
      
      # Help tab content
      tabItem(tabName = "help",
116 117 118 119 120 121 122
              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(),
123
              "Please make sure, that you upload the right data into the right field. If not please upload the correct file in the right fields. ", br(),
124
              "First field: CoConUT and second field: CoCoQuest. Otherwise the visualization won't work.",
125
              h3("Data"),
126
              "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. Also the names of the loaded files will apear, here you can check again, if the uploaded files where the right ones.", br(),
127
              h3("Controlls"),
128
              "On this page you are able to select the visualizations you want to use and which data should be in them.", br(), "Also you can enter the title of your dashboard.",
129
              "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. ",
130
              h3("Dashboard"),
131
              "Here you can now find your selected visualizations. Also there is a download button which will create a screenshot which you can save on your device.", br()
Stephanie's avatar
Stephanie committed
132 133
      )
    
134
    
Stephanie's avatar
Stephanie committed
135
    ))
136
)