ui.R 5.71 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("Contols", tabName = "controls", 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 44 45
                          ".json")),
              actionButton("dataSite", "next
                           ")
46
              
Stephanie's avatar
Stephanie committed
47 48
      ),
      
49 50 51
      #show data tab content
      tabItem(tabName = "data",
              
52
                h2("CoConUT Data here:"),
53
                h4("Last Loaded CoConUT Data: "),
54
                textOutput("lastLoadedNut"),
55
                dataTableOutput("nut"),
56 57 58
               
                
                h2("CoCoQuest Data here:"),
59
                h4("Last Loaded CoCoQuest Data: "),
60
                textOutput("lastLoadedQuest"),
61 62
                h4("Starttime: "),
                textOutput("totalStarttime"),
63 64
                dataTableOutput("quest"),
              actionButton("controlSide", "next")
65 66 67
      ),
      
      
68 69 70
      # Controls tab content
      tabItem(tabName = "controls",
              h2("Controls here:"),
71
              textInput("title", "Title", " "),
72 73 74
              #HISTOGRAM
              checkboxInput("check_hist", "Histogram", FALSE),
              #uiOutput("check_hist"),
75 76
              uiOutput("input_hist_x"),
              uiOutput("input_hist_y"),
77 78
              #TIMELINE
              checkboxInput("check_time", "Timeline", FALSE),
79 80
              uiOutput("input_time_x"),
              uiOutput("input_time_y"),
81 82
              #MAP
              checkboxInput("check_map", "Map", FALSE),
83 84
              uiOutput("input_map_x"),
              uiOutput("input_map_y"),
85 86
              #LINEGRAPH
              checkboxInput("check_line", "Linegraph", FALSE),
87
              uiOutput("input_line_x"),
88 89
              uiOutput("input_line_y"),
              actionButton("dashboardSite", "go to dashboard")
Stephanie's avatar
Stephanie committed
90 91 92 93
      ),
      
      # Dashboard tab content
      tabItem(tabName = "dashboard",
94
              h2(textOutput("text")),
Stephanie's avatar
Stephanie committed
95
              fluidRow(
96 97 98 99 100 101 102 103
                #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")
                #),
                
104 105 106 107 108 109
               
                uiOutput("hist_box"),
                uiOutput("time_box"),
                uiOutput("map_box"),
                uiOutput("line_box")
                
110
              ),
111
              actionButton("screenshot","Download")
112
              
113
              #downloadButton("downButton", "Download")
114
              
Stephanie's avatar
Stephanie committed
115 116 117 118
      ),
      
      # Help tab content
      tabItem(tabName = "help",
119 120 121 122 123 124 125
              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(),
126
              "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(),
127
              "First field: CoConUT and second field: CoCoQuest. Otherwise the visualization won't work.",
128
              h3("Data"),
129
              "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(),
130
              h3("Controlls"),
131
              "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.",
132
              "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. ",
133
              h3("Dashboard"),
134
              "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
135 136
      )
    
137
    
Stephanie's avatar
Stephanie committed
138
    ))
139
)