Commit a11186f4 authored by Stephanie's avatar Stephanie

CoCoQuest import first steps in the right direction

parent 014baa05
...@@ -50,34 +50,52 @@ server <- function(input, output) { ...@@ -50,34 +50,52 @@ server <- function(input, output) {
#CoCOQuest Data import and showing into data site #CoCOQuest Data import and showing into data site
output$lastLoadedQuest <- renderText({ output$lastLoadedQuest <- renderText({
lastCoCoQuest
}) })
output$quest <- renderDataTable({
output$questTimes <- renderDataTable({
inFile <- input$quest inFile <- input$quest
if (is.null(inFile)) if (is.null(inFile))
return(NULL) return(NULL)
#loading CoConUT data #loading CoCoQuest data
json_data_quest <- fromJSON(paste(inFile$datapath, sep = ""), flatten = TRUE) json_data_quest <<- fromJSON(paste(inFile$datapath, sep = ""), flatten = TRUE)
cocoquest.df <<- json_data_quest[["data"]] #print("json_data_qest")
#print(json_data_quest)
#lastCoCoQuest <<- inFile$name
lastCoCoQuest <<- inFile$name json_data_quest$unix_starttime <- as.numeric(json_data_quest$startTime)/1000
json_data_quest$unix_endtime <- as.numeric(json_data_quest$endTime)/1000
starttime <- anytime(json_data_quest$unix_starttime)
endtime <- anytime(json_data_quest$unix_endtime)
#unix parsed
questTimes <<- c(starttime ,endtime)
print("questTime")
print(questTimes)
# setting the table style mat <- matrix(questTimes,1,2)
#mat <- matrix(as.Date(questTimes),1,2)
print("mat")
print(mat)
colnames(mat)<-c("Starttime", "Endtime")
#setting the table style
datatable( datatable(
cbind(cocoquest.df), cbind(mat),
options = list( options = list(
searching = TRUE, searching = FALSE,
autoWidth = TRUE, #autoWidth = TRUE,
rownames = FALSE, rownames = TRUE,
scroller = TRUE, #scroller = TRUE,
scrollX = TRUE, #scrollX = TRUE,
scrollY = "500px", # scrollY = "500px",
fixedHeader = TRUE,
class = 'cell-border stripe' class = 'cell-border stripe'
) )
) )
}) })
......
...@@ -29,13 +29,13 @@ ui <- dashboardPage( ...@@ -29,13 +29,13 @@ ui <- dashboardPage(
tabItem(tabName = "upload", tabItem(tabName = "upload",
h2("Upload here:"), h2("Upload here:"),
fileInput("nut", "Select CoConUT Data (*.json):", fileInput("nut", "Select CoConUT Data (*.json):",
multiple = FALSE, multiple = TRUE,
accept = c( accept = c(
"text/json", "text/json",
"text/comma-separated-values,text/plain", "text/comma-separated-values,text/plain",
".json")), ".json")),
fileInput("quest", "Select CoCoQuest Data (*.json):", fileInput("quest", "Select CoCoQuest Data (*.json):",
multiple = FALSE, multiple = TRUE,
accept = c( accept = c(
"text/json", "text/json",
"text/comma-separated-values,text/plain", "text/comma-separated-values,text/plain",
...@@ -56,7 +56,7 @@ ui <- dashboardPage( ...@@ -56,7 +56,7 @@ ui <- dashboardPage(
h2("CoCoQuest Data here:"), h2("CoCoQuest Data here:"),
"Last Loaded CoCoQuest Data: ", "Last Loaded CoCoQuest Data: ",
textOutput("lastLoadedQuest"), textOutput("lastLoadedQuest"),
dataTableOutput("quest") dataTableOutput("questTimes")
), ),
......
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