Commit b98c9128 authored by Stephanie Wegscheidl's avatar Stephanie Wegscheidl
Browse files

Barchart (with selected data)

Map and Timeline (not selecting data) working

first trys with scatterplot and linechart
parent 2935ac86
......@@ -8,6 +8,7 @@ library(leaflet)
library(mapview)
library(ggplot2)
library(timevis)
library(plotly)
server <- function(input, output, session) {
......@@ -38,8 +39,7 @@ server <- function(input, output, session) {
#print("coconut:")
#coconut.df$timestamp <- format(coconut.df$timestamp, format="%d-%B-%Y %H:%M:%S")
print("HERE!!!!!!")
print(as.numeric(coconut.df[["timestamp"]]))
#print(coconut.df)
if(is.null(coconut.df$timestamp)){}
......@@ -133,11 +133,12 @@ server <- function(input, output, session) {
#unix parsed
dat <- do.call(rbind, json_data_quest$tasks$data)
endtimes <<- c(anytime(dat$endtime))
endtimes <<- c(dat$endtime)
parsedEndtimes <<- anytime(endtimes/1000)
#endtimes <<- format(dat$endtime, format="%d-%B-%Y %H:%M:%S")
print("endtime quest")
print(endtimes)
print(parsedEndtimes)
tasks <- rep(1:length(json_data_quest$tasks$data), sapply(json_data_quest$tasks$data, nrow))
#questions
#print("Questions:", questions)
......@@ -272,17 +273,11 @@ server <- function(input, output, session) {
#BAR VIEW
output$hist <- renderPlot({
print("x")
print(input$bar_x)
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")
print("y")
print(data$V1)
#Neues Plot
barplot(data$V1,data$V2,
ylab= input$bar_y,
......@@ -303,12 +298,8 @@ server <- function(input, output, session) {
# a=a+1}
#g
#hist(bluetooth)
})
......@@ -319,15 +310,32 @@ server <- function(input, output, session) {
status= "warning",
solidHeader = TRUE,
collapsible = TRUE,
plotOutput("time", height = 250))
timevisOutput("time", height = 250)
)
})
#Timelineview
output$time <- renderPlot({
#TODO: Timelineview
output$time <- renderTimevis({
print("TIME wird aufgerufen")
timevisOutput("timeline")
print("Length:")
print(length(parsedEndtimes))
print("combined")
print( c(anytime(totalST), head(parsedEndtimes, -1)))
print("endtimes")
print(parsedEndtimes)
data <- data.frame(
id = 1:length(parsedEndtimes),
content= c(1:length(parsedEndtimes)),
start = c(anytime(totalST), head(parsedEndtimes, -1)),
end = parsedEndtimes
)
timevis(data)
})
#linechart
output$line_box <- renderUI({
......@@ -336,27 +344,48 @@ server <- function(input, output, session) {
status= "warning",
solidHeader = TRUE,
collapsible = TRUE,
plotOutput("plot1", height = 250))
plotOutput("line", height = 250))
})
#TODO: linechart View
output$line <- renderPlot({
print("LINE wird aufgerufen")
})
#TODO: Scatterplot
# Scatterplot
output$scat_box <- renderUI({
if(input$check_scat)
box( title="Scatterplot",
status= "warning",
solidHeader = TRUE,
collapsible = TRUE,
plotOutput("plot1", height = 250))
plotOutput("scat", height = 250))
})
#TODO: Boxplot
#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]])),
.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")
})
# Boxplot
output$box_box <- renderUI({
if(input$check_box)
box( title="Boxplot",
status= "warning",
solidHeader = TRUE,
collapsible = TRUE,
plotOutput("plot1", height = 250))
plotOutput("box", height = 250))
})
#TODO: Boxplot View
output$box <- renderPlot({
print("BOX wird aufgerufen")
})
#MAP
......@@ -371,7 +400,7 @@ server <- function(input, output, session) {
# MAP VIEW
output$map <- renderLeaflet({
print("map wird aufgerufen")
print("MAP wird aufgerufen")
m <<- leaflet()
x=1
m <- addTiles(m)
......
......@@ -121,6 +121,7 @@ ui <- dashboardPage(
uiOutput("hist_box"),
uiOutput("time_box"),
#timevisOutput("time"),
uiOutput("line_box"),
uiOutput("scat_box"),
uiOutput("box_box"),
......
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