ui.R 5.68 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
  dashboardHeader(title="CoCoVisR"),
  dashboardSidebar(
    sidebarMenu(
14
      id="tabs",
Stephanie's avatar
Stephanie committed
15
      menuItem("Upload", tabName = "upload", icon =icon("upload")),
16
      menuItem("Data", tabName = "data", icon =icon("list")),
17
      menuItem("Views", tabName = "views", icon = icon("cog")),
Stephanie's avatar
Stephanie committed
18 19 20 21
      menuItem("Dashboard", tabName = "dashboard", icon = icon("dashboard")),
      menuItem("Help", tabName = "help", icon = icon("book"))
    )
  ),
22
  
Stephanie's avatar
Stephanie committed
23
  dashboardBody(
24 25 26 27
    #tags$head(
    #  tags$link(rel = "stylesheet", type = "text/css", href = "custom.css")
    #),
    
Stephanie's avatar
Stephanie committed
28 29 30
    tabItems(
      # Upload tab content
      tabItem(tabName = "upload",
31
              h2("Upload here:"),
32
              fileInput("nut", "Select CoConUT Data (*.json):",
33
                        multiple = TRUE,
34 35 36 37
                        accept = c(
                          "text/json",
                          "text/comma-separated-values,text/plain",
                          ".json")),
38
              fileInput("quest", "Select CoCoQuest Data (*.json):",
39
                        multiple = TRUE,
40 41 42
                        accept = c(
                          "text/json",
                          "text/comma-separated-values,text/plain",
43
                          ".json")),
44
              actionButton("dataSite", "Go to Data")
45
              
Stephanie's avatar
Stephanie committed
46 47
      ),
      
48 49 50
      #show data tab content
      tabItem(tabName = "data",
              
51
                h2("CoConUT Data here:"),
52
                h4("Last Loaded CoConUT Data: "),
53
                textOutput("lastLoadedNut"),
54
                dataTableOutput("nut"),
55 56 57
               
                
                h2("CoCoQuest Data here:"),
58
                h4("Last Loaded CoCoQuest Data: "),
59
                textOutput("lastLoadedQuest"),
60 61
                #h4("Starttime: "),
                #textOutput("totalStarttime"),
62
                dataTableOutput("quest"),
63
              actionButton("viewSite", "go to Views")
64 65 66
      ),
      
      
67
      # Controls tab content
68 69
      tabItem(tabName = "views",
              h2("Views here:"),
70
              textInput("title", "Title", " "),
71 72
              #Barchart
              checkboxInput("check_hist", "Barchart", FALSE),
73
              #uiOutput("check_hist"),
74 75
              uiOutput("input_hist_x"),
              uiOutput("input_hist_y"),
76 77
              #TIMELINE
              checkboxInput("check_time", "Timeline", FALSE),
78 79
              uiOutput("input_time_x"),
              uiOutput("input_time_y"),
80 81 82 83
              #Linechart
              checkboxInput("check_line", "Linechart", FALSE),
              uiOutput("input_line_x"),
              uiOutput("input_line_y"),
84
              #MAP
85 86 87
              checkboxInput("check_map", "Map", TRUE),
              uiOutput("input_map"),
              #uiOutput("input_map_y"),
88
              actionButton("dashboardSite", "go to dashboard")
Stephanie's avatar
Stephanie committed
89 90 91 92
      ),
      
      # Dashboard tab content
      tabItem(tabName = "dashboard",
93
              h2(textOutput("text")),
Stephanie's avatar
Stephanie committed
94
              fluidRow(
95 96 97 98 99 100 101 102
                #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")
                #),
                
103 104 105
               
                uiOutput("hist_box"),
                uiOutput("time_box"),
106 107
                uiOutput("line_box"),
                uiOutput("map_box")
108
                
109
              ),
110
              actionButton("screenshot","Download")
111
              
112
              #downloadButton("downButton", "Download")
113
              
Stephanie's avatar
Stephanie committed
114 115 116 117
      ),
      
      # Help tab content
      tabItem(tabName = "help",
118 119 120 121 122 123 124
              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(),
125
              "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(),
126
              "First field: CoConUT and second field: CoCoQuest. Otherwise the visualization won't work.",
127
              h3("Data"),
128
              "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(),
129
              h3("Controlls"),
130
              "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.",
131
              "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. ",
132
              h3("Dashboard"),
133
              "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
134 135
      )
    
136
    
Stephanie's avatar
Stephanie committed
137
    ))
138
)