Commit 014baa05 authored by Stephanie's avatar Stephanie

little fixes and trying loading quest data

parent 7bfb667d
...@@ -15,8 +15,8 @@ server <- function(input, output) { ...@@ -15,8 +15,8 @@ server <- function(input, output) {
set.seed(122) set.seed(122)
#CoConUT Data import and showing into data site #CoConUT Data import and showing into data site
output$file1 <- renderDataTable({ output$nut <- renderDataTable({
inFile <- input$file1 inFile <- input$nut
if (is.null(inFile)) if (is.null(inFile))
return(NULL) return(NULL)
...@@ -47,11 +47,72 @@ server <- function(input, output) { ...@@ -47,11 +47,72 @@ server <- function(input, output) {
lastCoConUT lastCoConUT
}) })
#CoCOQuest Data import and showing into data site
output$lastLoadedQuest <- renderText({ output$lastLoadedQuest <- renderText({
lastCoCoQuest lastCoCoQuest
}) })
output$quest <- renderDataTable({
inFile <- input$quest
if (is.null(inFile))
return(NULL)
#loading CoConUT data
json_data_quest <- fromJSON(paste(inFile$datapath, sep = ""), flatten = TRUE)
cocoquest.df <<- json_data_quest[["data"]]
lastCoCoQuest <<- inFile$name
# setting the table style
datatable(
cbind(cocoquest.df),
options = list(
searching = TRUE,
autoWidth = TRUE,
rownames = FALSE,
scroller = TRUE,
scrollX = TRUE,
scrollY = "500px",
fixedHeader = TRUE,
class = 'cell-border stripe'
)
)
})
#TODO: CoCoQuest Output --> Ansätze data[] raus nehmen oder flatten richtig funken
##output$file2 <- renderDataTable({
# inFile <- input$file2
#if (is.null(inFile))
# return(NULL)
#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)
## ANSATZ zum rauslesen der Times: --> not working now
#questLength <<- length(json_data_quest)
#print("length")
#print(questLength)
#data <- c(json_data_quest$tasks[[1]]$`data`[[1]]$endtime, json_data_quest$tasks[[1]]$`data`[[2]]$endtime, json_data_quest$tasks[[1]]$startTime, json_data_quest$tasks[[1]]$endTime, json_data_quest$tasks[[2]]$`data`[[1]]$endtime, json_data_quest$tasks[[2]]$`data`[[2]]$endtime, json_data_endtime$tasks[[2]]$`data`[[3]]$endtime)
#data<-c(json_data_quest$tasks[[1]]$startTime, json_data_quest$tasks[[1]]$endTime, json_data_quest$tasks[[2]]$startTime, json_data_quest$tasks[[2]]$endTime )
#x<<-0
#for(x in x:questLength)
#{data<<-c(json_data_quest$tasks[[x]]$startTime, json_data_quest$tasks[[x]]$endTime)
#x=x+1}
#print("data: ")
#print(data)
##})
#TODO: Getting HEADER out of json to select it #TODO: Getting HEADER out of json to select it
output$input_hist_x <- renderUI({ output$input_hist_x <- renderUI({
selectInput("in1", "x-axis:", as.list(coconut.df),multiple=TRUE, selectize=TRUE) selectInput("in1", "x-axis:", as.list(coconut.df),multiple=TRUE, selectize=TRUE)
...@@ -86,37 +147,7 @@ server <- function(input, output) { ...@@ -86,37 +147,7 @@ server <- function(input, output) {
}) })
#TODO: CoCoQuest Output --> Ansätze data[] raus nehmen oder flatten richtig funken
output$file2 <- renderDataTable({
inFile <- input$file2
if (is.null(inFile))
return(NULL)
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)
## ANSATZ zum rauslesen der Times: --> not working now
#questLength <<- length(json_data_quest)
#print("length")
#print(questLength)
#data <- c(json_data_quest$tasks[[1]]$`data`[[1]]$endtime, json_data_quest$tasks[[1]]$`data`[[2]]$endtime, json_data_quest$tasks[[1]]$startTime, json_data_quest$tasks[[1]]$endTime, json_data_quest$tasks[[2]]$`data`[[1]]$endtime, json_data_quest$tasks[[2]]$`data`[[2]]$endtime, json_data_endtime$tasks[[2]]$`data`[[3]]$endtime)
#data<-c(json_data_quest$tasks[[1]]$startTime, json_data_quest$tasks[[1]]$endTime, json_data_quest$tasks[[2]]$startTime, json_data_quest$tasks[[2]]$endTime )
#x<<-0
#for(x in x:questLength)
#{data<<-c(json_data_quest$tasks[[x]]$startTime, json_data_quest$tasks[[x]]$endTime)
#x=x+1}
#print("data: ")
#print(data)
})
#histdata <- rnorm(500) #histdata <- rnorm(500)
......
...@@ -28,13 +28,13 @@ ui <- dashboardPage( ...@@ -28,13 +28,13 @@ ui <- dashboardPage(
# Upload tab content # Upload tab content
tabItem(tabName = "upload", tabItem(tabName = "upload",
h2("Upload here:"), h2("Upload here:"),
fileInput("file1", "Select CoConUT Data (*.json):", fileInput("nut", "Select CoConUT Data (*.json):",
multiple = FALSE, multiple = FALSE,
accept = c( accept = c(
"text/json", "text/json",
"text/comma-separated-values,text/plain", "text/comma-separated-values,text/plain",
".json")), ".json")),
fileInput("file2", "Select CoCoQuest Data (*.json):", fileInput("quest", "Select CoCoQuest Data (*.json):",
multiple = FALSE, multiple = FALSE,
accept = c( accept = c(
"text/json", "text/json",
...@@ -50,13 +50,13 @@ ui <- dashboardPage( ...@@ -50,13 +50,13 @@ ui <- dashboardPage(
h2("CoConUT Data here:"), h2("CoConUT Data here:"),
"Last Loaded CoConUT Data: ", "Last Loaded CoConUT Data: ",
textOutput("lastLoadedNut"), textOutput("lastLoadedNut"),
dataTableOutput("file1"), dataTableOutput("nut"),
h2("CoCoQuest Data here:"), h2("CoCoQuest Data here:"),
"Last Loaded CoCoQuest Data: ", "Last Loaded CoCoQuest Data: ",
textOutput("lastLoadedQuest"), textOutput("lastLoadedQuest"),
dataTableOutput("file2") dataTableOutput("quest")
), ),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment