Commit 2935ac86 authored by Stephanie Wegscheidl's avatar Stephanie Wegscheidl

barchart working with selected data and svenjas dataset, first trys of...

barchart working with selected data and svenjas dataset, first trys of timeline and minor comments and renaming things
parent 2e722c28
......@@ -7,6 +7,7 @@ library(knitr)
library(leaflet)
library(mapview)
library(ggplot2)
library(timevis)
server <- function(input, output, session) {
......@@ -37,6 +38,8 @@ 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)){}
......@@ -178,7 +181,7 @@ server <- function(input, output, session) {
})
#CONTROLLS PAGE
#View PAGE
#Title Input
output$title <- renderText({ input$title })
......@@ -219,17 +222,18 @@ server <- function(input, output, session) {
return(NULL)
selectInput("in5", "Data:", cbind("unixTime", "speed", "gps.acc","lux", "light.acc","acc.coordinates", "acc.acc","bluetooth","ble.bpm","ble.bpmlist","ble.hrv","ble.hrvlist","activity.name", "acctivity.confidence","screen.status" ,"touch"),multiple=TRUE, selectize=TRUE)
})
#output$input_map_x <- renderUI({
# if (is.null(input$nut))
# return(NULL)
# selectInput("in5", "x-axis:", cbind("unixTime", "longitude", "latitude", "speed", "gps.acc","lux", "light.acc","acc.coordinates", "acc.acc","bluetooth","ble.bpm","ble.bpmlist","ble.hrv","ble.hrvlist","activity.name", "acctivity.confidence","screen.status" ,"touch"),multiple=TRUE, selectize=TRUE)
#})
# output$input_map_y <- renderUI({
# if (is.null(input$nut))
# return(NULL)
# selectInput("in6", "y-axis:", cbind("unixTime", "longitude", "latitude", "speed", "gps.acc","lux", "light.acc","acc.coordinates", "acc.acc","bluetooth","ble.bpm","ble.bpmlist","ble.hrv","ble.hrvlist","activity.name", "acctivity.confidence","screen.status" ,"touch"),multiple=TRUE, selectize=TRUE)
#})
output$input_map_x <- renderUI({
if (is.null(input$nut))
return(NULL)
selectInput("in5", "x-axis:", cbind("unixTime", "longitude", "latitude", "speed", "gps.acc","lux", "light.acc","acc.coordinates", "acc.acc","bluetooth","ble.bpm","ble.bpmlist","ble.hrv","ble.hrvlist","activity.name", "acctivity.confidence","screen.status" ,"touch"),multiple=TRUE, selectize=TRUE)
})
output$input_map_y <- renderUI({
if (is.null(input$nut))
return(NULL)
selectInput("in6", "y-axis:", cbind("unixTime", "longitude", "latitude", "speed", "gps.acc","lux", "light.acc","acc.coordinates", "acc.acc","bluetooth","ble.bpm","ble.bpmlist","ble.hrv","ble.hrvlist","activity.name", "acctivity.confidence","screen.status" ,"touch"),multiple=TRUE, selectize=TRUE)
})
#linechart
......@@ -266,30 +270,45 @@ server <- function(input, output, session) {
plotOutput("hist", height = 250))
})
#HIS VIEW
#BAR VIEW
output$hist <- renderPlot({
print("hist wird aufgerufen")
a=1
for(a in 1:length(coconut.df$bluetooth.numOfBTDevices)){
print("x")
print(input$bar_x)
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,
xlab=input$bar_x)
## ALTES PLOT
#a=1
#for(a in 1:length(coconut.df$bluetooth.numOfBTDevices)){
#g <-geom_bar(mapping = NULL, data = , stat = "count",
# position = "stack", width = NULL, binwidth = NULL, na.rm = FALSE,
# show.legend = NA, inherit.aes = TRUE)
g <- ggplot(coconut.df, aes("timestamp","bluetooth"))
#g <- ggplot(coconut.df, aes("timestamp","bluetooth"))
#g + geom_bar()
a=a+1}
# a=a+1}
g
#g
#hist(bluetooth)
})
......@@ -297,6 +316,43 @@ server <- function(input, output, session) {
output$time_box <- renderUI({
if(input$check_time)
box( title="Timeline",
status= "warning",
solidHeader = TRUE,
collapsible = TRUE,
plotOutput("time", height = 250))
})
#Timelineview
output$time <- renderPlot({
print("TIME wird aufgerufen")
timevisOutput("timeline")
})
#linechart
output$line_box <- renderUI({
if(input$check_line)
box( title="Linechart",
status= "warning",
solidHeader = TRUE,
collapsible = TRUE,
plotOutput("plot1", height = 250))
})
#TODO: Scatterplot
output$scat_box <- renderUI({
if(input$check_scat)
box( title="Scatterplot",
status= "warning",
solidHeader = TRUE,
collapsible = TRUE,
plotOutput("plot1", height = 250))
})
#TODO: Boxplot
output$box_box <- renderUI({
if(input$check_box)
box( title="Boxplot",
status= "warning",
solidHeader = TRUE,
collapsible = TRUE,
......@@ -326,15 +382,7 @@ server <- function(input, output, session) {
})
#linechart
output$line_box <- renderUI({
if(input$check_line)
box( title="Linechart",
status= "warning",
solidHeader = TRUE,
collapsible = TRUE,
plotOutput("plot1", height = 250))
})
......@@ -344,9 +392,11 @@ server <- function(input, output, session) {
#if(input$check_line|input$check_time|input$check_map|input$check_hist)
#disable("screenshot")
#webshot::install_phantomjs()
cdat <<- session$clientData
url <- paste0(cdat$url_hostname,":", cdat$url_port,"/")
print(url)
#URL <- "http://rstudio.github.io/leaflet/"
#appshot("cocoVisR/", file = "dashboard.png", port = getOption("shiny.port"), envvars = NULL)
#webshot(url,delay = 5.0)
......
......@@ -76,23 +76,43 @@ ui <- dashboardPage(
tabPanel("Barchart",
#Barchart
checkboxInput("check_hist", "Barchart", FALSE),
#uiOutput("check_hist"),
uiOutput("input_hist_x"),
uiOutput("input_hist_y")),
selectInput("bar_x", "x-axis", choices=colnames(coconut.df)),
selectInput("bar_y", "y-axis", choices=colnames(coconut.df))
#uiOutput("input_hist_x"),
#uiOutput("input_hist_y")
),
#TIMELINE
tabPanel("Timeline",
checkboxInput("check_time", "Timeline", FALSE),
uiOutput("input_time_x"),
uiOutput("input_time_y")),
selectInput("time_data", "data", choices=colnames(coconut.df))
#uiOutput("input_time_x"),
#uiOutput("input_time_y")
),
#Linechart
tabPanel("Linechart",
checkboxInput("check_line", "Linechart", FALSE),
uiOutput("input_line_x"),
uiOutput("input_line_y")),
selectInput("line_x", "x-axis", choices=colnames(coconut.df)),
selectInput("line_y", "y-axis", choices=colnames(coconut.df))
#uiOutput("input_line_x"),
#uiOutput("input_line_y")
),
#Scatterplot
tabPanel("Scatterplot",
checkboxInput("check_scat", "Scatterplot", FALSE),
selectInput("scat_x", "x-axis", choices=colnames(coconut.df)),
selectInput("scat_y", "y-axis", choices=colnames(coconut.df))
),
#Boxplot
tabPanel("Boxplot",
checkboxInput("check_box", "Boxplot", FALSE),
selectInput("box_x", "x-axis", choices=colnames(coconut.df)),
selectInput("box_y", "y-axis", choices=colnames(coconut.df))
),
#MAP
tabPanel("Map",
checkboxInput("check_map", "Map", FALSE),
uiOutput("input_map"))
selectInput("map_data", "data", choices=colnames(coconut.df))
)
)
),
mainPanel(column(width = 12,
......@@ -102,6 +122,8 @@ ui <- dashboardPage(
uiOutput("hist_box"),
uiOutput("time_box"),
uiOutput("line_box"),
uiOutput("scat_box"),
uiOutput("box_box"),
uiOutput("map_box"),
actionButton("screenshot","Download")))
......
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