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) {
set.seed(122)
#CoConUT Data import and showing into data site
output$file1 <- renderDataTable({
inFile <- input$file1
output$nut <- renderDataTable({
inFile <- input$nut
if (is.null(inFile))
return(NULL)
......@@ -48,10 +48,71 @@ server <- function(input, output) {
})
#CoCOQuest Data import and showing into data site
output$lastLoadedQuest <- renderText({
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
output$input_hist_x <- renderUI({
selectInput("in1", "x-axis:", as.list(coconut.df),multiple=TRUE, selectize=TRUE)
......@@ -86,36 +147,6 @@ 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)
......
......@@ -28,13 +28,13 @@ ui <- dashboardPage(
# Upload tab content
tabItem(tabName = "upload",
h2("Upload here:"),
fileInput("file1", "Select CoConUT Data (*.json):",
fileInput("nut", "Select CoConUT Data (*.json):",
multiple = FALSE,
accept = c(
"text/json",
"text/comma-separated-values,text/plain",
".json")),
fileInput("file2", "Select CoCoQuest Data (*.json):",
fileInput("quest", "Select CoCoQuest Data (*.json):",
multiple = FALSE,
accept = c(
"text/json",
......@@ -50,13 +50,13 @@ ui <- dashboardPage(
h2("CoConUT Data here:"),
"Last Loaded CoConUT Data: ",
textOutput("lastLoadedNut"),
dataTableOutput("file1"),
dataTableOutput("nut"),
h2("CoCoQuest Data here:"),
"Last Loaded CoCoQuest Data: ",
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