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

download button --> not working yet

mini update in help
parent 5d69fcdb
Loading
Loading
Loading
Loading
+30 −1
Original line number Original line Diff line number Diff line
@@ -2,6 +2,7 @@
library(shiny)
library(shiny)
library(jsonlite)
library(jsonlite)
library(DT)
library(DT)
library(webshot)


server <- function(input, output) {
server <- function(input, output) {
  set.seed(122)
  set.seed(122)
@@ -167,7 +168,7 @@ server <- function(input, output) {
  
  
  #TODO: Getting HEADER out of json to select it
  #TODO: Getting HEADER out of json to select it
  
  
  #Not sure if so smart but it should work that way
  #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({
    if (is.null(input$nut))
    if (is.null(input$nut))
      return(NULL)
      return(NULL)
@@ -217,6 +218,34 @@ server <- function(input, output) {
  })
  })
  
  
  
  
  output$download <- downloadHandler({
    filename=function(){
      dashbord.png
      paste("dashboard", "png", sep=".")
    }
    content=function(file){
      #open divice
      png(file)
      #create image
      appshot(cocoVisR, file = "dashboard.png", ..., port = getOption("shiny.port"), envvars = NULL)
      #close divice
      dev.off()
    }
    
  })
  
  
  #output$downButton <- downloadHandler(
   # filename="dashboard.png",
    #content=function(file){
     # observeEvent(input$downButton, {
      #appshot("cocoVisR/dashboard", file = "dashboard.png", port = getOption("shiny.port"), envvars = NULL)
 
      #}) 
    #}
  #)
  #appshot(cocoVisR, file = "dashboard.png", ..., port = getOption("shiny.port"),
  #envvars = NULL)
  
  
  
  
  #histdata <- rnorm(500)
  #histdata <- rnorm(500)
+7 −3
Original line number Original line Diff line number Diff line
@@ -113,9 +113,13 @@ 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")
              ),
              
              downloadButton("downButton", "Download")
              
              
              )
      ),
      ),
      
      
      # Help tab content
      # Help tab content
@@ -135,7 +139,7 @@ ui <- dashboardPage(
              "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(),
              "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"),
              "", br()
              "Here you can now find your selected visualizations. ", br()
      )
      )