From 3aa50746fb362b3fbb789f81c2f4b4934b105618 Mon Sep 17 00:00:00 2001 From: Stephanie Date: Mon, 23 Jul 2018 14:42:13 +0200 Subject: [PATCH] getting selectInput for each vis, updating help and data sites --- dashboard/server.R | 45 +++++++++++++++++++++++++++++++++++++++++---- dashboard/ui.R | 23 +++++++++++++---------- 2 files changed, 54 insertions(+), 14 deletions(-) diff --git a/dashboard/server.R b/dashboard/server.R index cc74b13..7f277dc 100644 --- a/dashboard/server.R +++ b/dashboard/server.R @@ -21,9 +21,12 @@ server <- function(input, output) { return(NULL) #loading CoConUT data - json_data_coco <<- fromJSON(paste(inFile$datapath, sep = ""), flatten = TRUE) + json_data_coco <- fromJSON(paste(inFile$datapath, sep = ""), flatten = TRUE) coconut.df <<- json_data_coco[["data"]] - print(inFile$datapath) + + lastCoConUT <<- inFile$name + + # setting the table style datatable( cbind(coconut.df), @@ -39,15 +42,48 @@ server <- function(input, output) { ) ) }) + + output$lastLoadedNut<- renderText({ + lastCoConUT + + }) + + output$lastLoadedQuest <- renderText({ + lastCoCoQuest + }) + # Getting - output$dataSelector_x <- renderUI({ + output$input_hist_x <- renderUI({ + selectInput("in1", "x-axis:", as.list(coconut.df),multiple=TRUE, selectize=TRUE) + }) + + output$input_hist_y <- renderUI({ + selectInput("in1", "y-axis:", as.list(coconut.df),multiple=TRUE, selectize=TRUE) + }) + + output$input_time_x <- renderUI({ selectInput("in1", "x-axis:", as.list(coconut.df),multiple=TRUE, selectize=TRUE) }) - output$dataSelector_y <- renderUI({ + output$input_time_y <- renderUI({ selectInput("in1", "y-axis:", as.list(coconut.df),multiple=TRUE, selectize=TRUE) }) + output$input_map_x <- renderUI({ + selectInput("in1", "x-axis:", as.list(coconut.df),multiple=TRUE, selectize=TRUE) + }) + + output$input_map_y <- renderUI({ + selectInput("in1", "y-axis:", as.list(coconut.df),multiple=TRUE, selectize=TRUE) + }) + + output$input_line_x <- renderUI({ + selectInput("in1", "x-axis:", as.list(coconut.df),multiple=TRUE, selectize=TRUE) + }) + + output$input_line_y <- renderUI({ + selectInput("in1", "y-axis:", as.list(coconut.df),multiple=TRUE, selectize=TRUE) + }) #TODO: CoCoQuest Output --> Ansätze data[] raus nehmen oder flatten richtig funken @@ -60,6 +96,7 @@ server <- function(input, output) { simplifyVector <- c("studyID", "studyName", "description", "tasks$endTime" , "id", "startTime", "endTime") json_data_quest <- fromJSON(paste(inFile$datapath, sep = ""), simplifyVector = TRUE, simplifyDataFrame = simplifyVector, simplifyMatrix = simplifyVector, flatten = TRUE) + lastLoadedQuest<<-inFile$name print("with simplify: ") print(json_data_quest) diff --git a/dashboard/ui.R b/dashboard/ui.R index 96d003e..a1f65ce 100644 --- a/dashboard/ui.R +++ b/dashboard/ui.R @@ -48,11 +48,14 @@ ui <- dashboardPage( tabItem(tabName = "data", h2("CoConUT Data here:"), - + "Last Loaded CoConUT Data: ", + textOutput("lastLoadedNut"), dataTableOutput("file1"), h2("CoCoQuest Data here:"), + "Last Loaded CoCoQuest Data: ", + textOutput("lastLoadedQuest"), dataTableOutput("file2") ), @@ -64,17 +67,17 @@ ui <- dashboardPage( #TODO: SelectInput --> Get data out of loaded json to select it checkboxInput("histogram", "Histogram", FALSE), - uiOutput("dataSelector_x"), - uiOutput("dataSelector_y"), + uiOutput("input_hist_x"), + uiOutput("input_hist_y"), checkboxInput("timeline", "Timeline", FALSE), - selectInput('in2', "x-Axis: " , "Bluetoothdevices", multiple=TRUE, selectize=TRUE), - selectInput('in4', "y-Axis: " , "Bluetoothdevices", multiple=TRUE, selectize=TRUE), + uiOutput("input_time_x"), + uiOutput("input_time_y"), checkboxInput("map", "Map", FALSE), - selectInput('in3', "x-Axis: " , "Bluetoothdevices", multiple=TRUE, selectize=TRUE), - selectInput('in4', "y-Axis: " , "Bluetoothdevices", multiple=TRUE, selectize=TRUE), + uiOutput("input_map_x"), + uiOutput("input_map_y"), checkboxInput("lingegraph","Linegraph",FALSE), - selectInput('in4', "x-Axis: " , "Bluetoothdevices", multiple=TRUE, selectize=TRUE), - selectInput('in4', "y-Axis: " , "Bluetoothdevices", multiple=TRUE, selectize=TRUE) + uiOutput("input_line_x"), + uiOutput("input_line_y") ), # Dashboard tab content @@ -123,7 +126,7 @@ ui <- dashboardPage( "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(), + "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(), "First field: CoConUT and second field: CoCoQuest. Otherwise the visualization won't work.", 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(), -- 2.22.0