Commit 4d4e3ab9 authored by Stephanie Wegscheidl's avatar Stephanie Wegscheidl

updating Help, inserting title possible, all selectfields work, fixing...

updating Help, inserting title possible, all selectfields work, fixing reuploading issues within one session, downloadbutton not working yet --> causes crash
parent d6fa0877
...@@ -4,7 +4,7 @@ library(jsonlite) ...@@ -4,7 +4,7 @@ library(jsonlite)
library(DT) library(DT)
library(webshot) library(webshot)
server <- function(input, output) { server <- function(input, output, session) {
set.seed(122) set.seed(122)
#CoConUT Data import and showing into data site #CoConUT Data import and showing into data site
...@@ -99,13 +99,13 @@ server <- function(input, output) { ...@@ -99,13 +99,13 @@ server <- function(input, output) {
}) })
output$questTimes <- renderDataTable({ output$questTimes <- renderDataTable({
inFile <- input$quest inFile <- input$quest
if (is.null(inFile)) if (is.null(inFile))
return(NULL) return(NULL)
#loading CoCoQuest data #loading CoCoQuest data
json_data_quest <<- fromJSON(paste(inFile$datapath, sep = ""), flatten = TRUE) json_data_quest <<- fromJSON(paste(inFile$datapath, sep = ""), flatten = TRUE)
...@@ -165,8 +165,9 @@ server <- function(input, output) { ...@@ -165,8 +165,9 @@ server <- function(input, output) {
print(totalStarttime) print(totalStarttime)
}) })
output$text <- renderText({ input$title })
#TODO: Getting HEADER out of json to select it output$check_histogram <- renderPrint({input$checkbox_hist })
#Not sure if so smart but it should work that way --> mit if schaun welches ausgewählt worden ist und die daten dann für dashboard ausgeben #Not sure if so smart but it should work that way --> mit if schaun welches ausgewählt worden ist und die daten dann für dashboard ausgeben
output$input_hist_x <- renderUI({ output$input_hist_x <- renderUI({
...@@ -178,63 +179,64 @@ server <- function(input, output) { ...@@ -178,63 +179,64 @@ server <- function(input, output) {
output$input_hist_y <- renderUI({ output$input_hist_y <- renderUI({
if (is.null(input$nut)) if (is.null(input$nut))
return(NULL) return(NULL)
selectInput("in2", "y-axis:", as.list(coconut.df),multiple=TRUE, selectize=TRUE) selectInput("in2", "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$check_time <- renderUI({checkboxInput("timeline", "Timeline", FALSE) })
output$input_time_x <- renderUI({ output$input_time_x <- renderUI({
if (is.null(input$nut)) if (is.null(input$nut))
return(NULL) return(NULL)
selectInput("in3", "x-axis:", as.list(coconut.df),multiple=TRUE, selectize=TRUE) selectInput("in3", "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_time_y <- renderUI({ output$input_time_y <- renderUI({
if (is.null(input$nut)) if (is.null(input$nut))
return(NULL) return(NULL)
selectInput("in4", "y-axis:", as.list(coconut.df),multiple=TRUE, selectize=TRUE) selectInput("in4", "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$check_map <- renderUI({checkboxInput("map", "Map", FALSE) })
output$input_map_x <- renderUI({ output$input_map_x <- renderUI({
if (is.null(input$nut)) if (is.null(input$nut))
return(NULL) return(NULL)
selectInput("in5", "x-axis:", as.list(coconut.df),multiple=TRUE, selectize=TRUE) 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({ output$input_map_y <- renderUI({
if (is.null(input$nut)) if (is.null(input$nut))
return(NULL) return(NULL)
selectInput("in6", "y-axis:", as.list(coconut.df),multiple=TRUE, selectize=TRUE) 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$check_line <- renderUI({checkboxInput("linegraph", "Linegraph", FALSE) })
output$input_line_x <- renderUI({ output$input_line_x <- renderUI({
if (is.null(input$nut)) if (is.null(input$nut))
return(NULL) return(NULL)
selectInput("in7", "x-axis:", as.list(coconut.df),multiple=TRUE, selectize=TRUE) selectInput("in7", "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_line_y <- renderUI({ output$input_line_y <- renderUI({
if (is.null(input$nut)) if (is.null(input$nut))
return(NULL) return(NULL)
selectInput("in8", "y-axis:", as.list(coconut.df),multiple=TRUE, selectize=TRUE) selectInput("in8", "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$download <- downloadHandler({
filename=function(){ #download dashboard button
dashbord.png #TODO: MAKE IT WORK!
paste("dashboard", "png", sep=".") observeEvent(input$screenshot,{
} cdat <<- session$clientData
content=function(file){ #print(cdat)
#open divice url <- paste0(cdat$url_protocol,"//",cdat$url_hostname,":", cdat$url_port, cdat$url_pathname,cdat$url_search)
png(file) print(url)
#create image webshot::webshot(url, "webshot.png")
appshot(cocoVisR, file = "dashboard.png", ..., port = getOption("shiny.port"), envvars = NULL)
#close divice
dev.off()
}
}) })
#output$downButton <- downloadHandler( #output$downButton <- downloadHandler(
# filename="dashboard.png", # filename="dashboard.png",
#content=function(file){ #content=function(file){
...@@ -244,10 +246,7 @@ server <- function(input, output) { ...@@ -244,10 +246,7 @@ server <- function(input, output) {
#}) #})
#} #}
#) #)
#appshot(cocoVisR, file = "dashboard.png", ..., port = getOption("shiny.port"),
#envvars = NULL)
#histdata <- rnorm(500) #histdata <- rnorm(500)
#output$plot1 <- renderPlot({ #output$plot1 <- renderPlot({
......
...@@ -66,24 +66,24 @@ ui <- dashboardPage( ...@@ -66,24 +66,24 @@ ui <- dashboardPage(
# Controlls tab content # Controlls tab content
tabItem(tabName = "controlls", tabItem(tabName = "controlls",
h2("Controlls here:"), h2("Controlls here:"),
textInput("title", "Title", " "),
checkboxInput("histogram", "Histogram", FALSE), checkboxInput("checkbox_hist", label = "Histogram", value = FALSE),
uiOutput("input_hist_x"), uiOutput("input_hist_x"),
uiOutput("input_hist_y"), uiOutput("input_hist_y"),
checkboxInput("timeline", "Timeline", FALSE), uiOutput("check_time"),
uiOutput("input_time_x"), uiOutput("input_time_x"),
uiOutput("input_time_y"), uiOutput("input_time_y"),
checkboxInput("map", "Map", FALSE), uiOutput("check_map"),
uiOutput("input_map_x"), uiOutput("input_map_x"),
uiOutput("input_map_y"), uiOutput("input_map_y"),
checkboxInput("lingegraph","Linegraph",FALSE), uiOutput("check_line"),
uiOutput("input_line_x"), uiOutput("input_line_x"),
uiOutput("input_line_y") uiOutput("input_line_y")
), ),
# Dashboard tab content # Dashboard tab content
tabItem(tabName = "dashboard", tabItem(tabName = "dashboard",
h2("This is the Dashboard"), h2(textOutput("text")),
fluidRow( fluidRow(
#tabBox( #tabBox(
#title = "First tabBox", #title = "First tabBox",
...@@ -93,13 +93,13 @@ ui <- dashboardPage( ...@@ -93,13 +93,13 @@ ui <- dashboardPage(
#tabPanel("Tab2", "Tab content 2") #tabPanel("Tab2", "Tab content 2")
#), #),
#if(menuitem$controls$histogram ==TRUE){ #if(verbatimTextOutput("check_histogram")){
box( title="Histogram", box( title="Histogram",
status= "warning", status= "warning",
solidHeader = TRUE, solidHeader = TRUE,
collapsible = TRUE, collapsible = TRUE,
plotOutput("plot1", height = 250)), plotOutput("plot1", height = 250)),
#}, # },
box(title="Map", box(title="Map",
status = "warning", status = "warning",
...@@ -113,12 +113,11 @@ ui <- dashboardPage( ...@@ -113,12 +113,11 @@ ui <- dashboardPage(
box(title="Linechart", box(title="Linechart",
status = "warning", status = "warning",
solidHeader = TRUE, solidHeader = TRUE,
collapsible = TRUE,plotOutput("plot4", height = 250))#, collapsible = TRUE,plotOutput("plot4", height = 250))
#downloadButton("downButton", "Download")
), ),
actionButton("screenshot","Download")
downloadButton("downButton", "Download") #downloadButton("downButton", "Download")
), ),
...@@ -131,15 +130,15 @@ ui <- dashboardPage( ...@@ -131,15 +130,15 @@ ui <- dashboardPage(
"For uploading you have to click on the 'Browse'-Button and an explorer-window will open.", br(), "For uploading you have to click on the 'Browse'-Button and an explorer-window will open.", br(),
"Please navigate to the wanted file, select it and click on 'open'. "Please navigate to the wanted file, select it and click on 'open'.
Then the name of the selected file and a loadingbar will apear. 'Upload complete' will show you that the upload worked and is finished.", br(), Then the name of the selected file and a loadingbar will apear. 'Upload complete' will show you that the upload worked and is finished.", br(),
"Please make sure, that you upload the right data into the right field. If not please restart the Application and upload the correct file. Reloading within one session is not possible. ", br(), "Please make sure, that you upload the right data into the right field. If not please upload the correct file in the right fields. ", br(),
"First field: CoConUT and second field: CoCoQuest. Otherwise the visualization won't work.", "First field: CoConUT and second field: CoCoQuest. Otherwise the visualization won't work.",
h3("Data"), h3("Data"),
"After correctly loading up the right json files, in this vies will apear a table that shows the data that were red from the jsons.", br(), "After correctly loading up the right json files, in this vies will apear a table that shows the data that were red from the jsons. Also the names of the loaded files will apear, here you can check again, if the uploaded files where the right ones.", br(),
h3("Controlls"), h3("Controlls"),
"On this page you are able to select the visualizations you want to use and which data should be in them.", br(), "On this page you are able to select the visualizations you want to use and which data should be in them.", br(), "Also you can enter the title of your dashboard.",
"To show a visualization on the dashboard you have to enable the right checkbox. After that you need to select the x- and y-axis for this visualisation and then it will be added to the dashboard. ", "To show a visualization on the dashboard you have to enable the right checkbox. After that you need to select the x- and y-axis for this visualisation and then it will be added to the dashboard. ",
h3("Dashboard"), h3("Dashboard"),
"Here you can now find your selected visualizations. ", br() "Here you can now find your selected visualizations. Also there is a download button which will create a screenshot which you can save on your device.", br()
) )
......
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