diff --git a/dashboard/server.R b/dashboard/server.R index c22e52ec0103fe675874c9df2ea15f4663c7f43a..6261afdb63f776fffc150bf5f00a008dd22b2bb4 100644 --- a/dashboard/server.R +++ b/dashboard/server.R @@ -33,13 +33,12 @@ server <- function(input, output, session) { #loading CoConUT data json_data_coco <- fromJSON(paste(inFile$datapath, sep = ""), flatten = TRUE) coconut.df <<- json_data_coco[["data"]] - - + lastCoConUT <<- inFile$name #print("coconut:") #coconut.df$timestamp <- format(coconut.df$timestamp, format="%d-%B-%Y %H:%M:%S") - + #print(coconut.df) if(is.null(coconut.df$timestamp)){} @@ -94,6 +93,7 @@ server <- function(input, output, session) { else{touch<<-coconut.df$interaction.touch} + # setting the table style datatable( cbind(coconut.df), @@ -268,13 +268,12 @@ server <- function(input, output, session) { status= "warning", solidHeader = TRUE, collapsible = TRUE, - plotOutput("hist", height = 250)) + plotOutput("bar", height = 250)) }) #BAR VIEW - output$hist <- renderPlot({ + output$bar <- renderPlot({ print("BAR wird aufgerufen.") - print(coconut.df) data<- structure(list(V1=as.numeric(coconut.df[[input$bar_y]]), V2=as.numeric(coconut.df[[input$bar_x]])), .Names=c("V1","V2"), row.names=c(NA,6L), class = "data.frame") @@ -336,6 +335,11 @@ server <- function(input, output, session) { }) + output$texttimeline <- renderText({ + "Check Timeline for getting a Timeline about CoCoQuest Tasks and Questions." + }) + + #linechart output$line_box <- renderUI({ @@ -350,6 +354,13 @@ server <- function(input, output, session) { #TODO: linechart View output$line <- renderPlot({ print("LINE wird aufgerufen") + data<- structure(list(V1=as.numeric(coconut.df[[input$line_x]]), + V2=as.numeric(coconut.df[[input$line_y]])), + .Names=c("V1","V2"), row.names=c(NA,6L), class = "data.frame") + plot(data$V1,data$V2, type="l", ylab=input$line_y, xlab=input$line_x) + + + }) @@ -365,12 +376,12 @@ server <- function(input, output, session) { #TODO: Scatterplot View output$scat <- renderPlot({ - data<- structure(list(V1=as.numeric(coconut.df[[input$scat_y]]), - V2=as.numeric(coconut.df[[input$scat_x]])), + data<- structure(list(V1=as.numeric(coconut.df[[input$scat_x]]), + V2=as.numeric(coconut.df[[input$scat_y]])), .Names=c("V1","V2"), row.names=c(NA,6L), class = "data.frame") print("SCAT wird aufgerufen") - plot(data, x= data$V2, y= data$V1, type="p") + plot(data$V1, data$V2, type="p", labx=input$scat_x, laby=input$scat_y ) }) # Boxplot diff --git a/dashboard/ui.R b/dashboard/ui.R index 13ac3d14984da9e81ba9f91de473894798a178ba..9046a276e6ee9c2514b963b53d412cca0dc24041 100644 --- a/dashboard/ui.R +++ b/dashboard/ui.R @@ -84,7 +84,8 @@ ui <- dashboardPage( #TIMELINE tabPanel("Timeline", checkboxInput("check_time", "Timeline", FALSE), - selectInput("time_data", "data", choices=colnames(coconut.df)) + textOutput("texttimeline") + #selectInput("time_data", "data", choices=colnames(coconut.df)) #uiOutput("input_time_x"), #uiOutput("input_time_y") ),