Commit 4fc943f9 authored by Stephanie's avatar Stephanie

getting dropdown choices -> not finished, trying stuff with quest import

parent 2711e1a3
......@@ -14,14 +14,17 @@ library(DT)
server <- function(input, output) {
set.seed(122)
#CoConUT Data import and showing into data site
output$file1 <- renderDataTable({
inFile <- input$file1
if (is.null(inFile))
return(NULL)
json_data_coco <- fromJSON(paste(inFile$datapath, sep = ""), flatten = TRUE)
coconut.df <- json_data_coco[["data"]]
#loading CoConUT data
json_data_coco <<- fromJSON(paste(inFile$datapath, sep = ""), flatten = TRUE)
coconut.df <<- json_data_coco[["data"]]
print(inFile$datapath)
# setting the table style
datatable(
cbind(coconut.df),
options = list(
......@@ -35,30 +38,48 @@ server <- function(input, output) {
class = 'cell-border stripe'
)
)
})
# Getting
output$dataSelector_x <- renderUI({
selectInput("in1", "x-axis:", as.list(coconut.df),multiple=TRUE, selectize=TRUE)
})
#coconut.df$timestamp <- anytime((as.numeric(coconut.df$timestamp)/1000))
output$dataSelector_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
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 = FALSE)
#flatten(json_data_quest)
#json_data <-map() <-- ansatz zum parsen?
simplifyMatrix = simplifyVector, flatten = TRUE)
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)
})
#data<-reactive({
#file1 <- input$file1
#if(is.null(file1)){return()}
#read_json(file1=file1$datapath)
#})
#histdata <- rnorm(500)
......
......@@ -5,7 +5,6 @@ library(shinydashboard)
library(anytime)
#library(leaflet)
ui <- dashboardPage(
skin="purple",
......@@ -65,8 +64,8 @@ ui <- dashboardPage(
#TODO: SelectInput --> Get data out of loaded json to select it
checkboxInput("histogram", "Histogram", FALSE),
selectInput('in1', "x-Axis: " , "Bluetoothdevices", multiple=TRUE, selectize=TRUE),
selectInput('in4', "y-Axis: " , "Bluetoothdevices", multiple=TRUE, selectize=TRUE),
uiOutput("dataSelector_x"),
uiOutput("dataSelector_y"),
checkboxInput("timeline", "Timeline", FALSE),
selectInput('in2', "x-Axis: " , "Bluetoothdevices", multiple=TRUE, selectize=TRUE),
selectInput('in4', "y-Axis: " , "Bluetoothdevices", multiple=TRUE, selectize=TRUE),
......
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