Commit 0145b675 authored by Stephanie Wegscheidl's avatar Stephanie Wegscheidl

first trys for download

multiple still not working
parent 9d93cf1b
...@@ -398,7 +398,7 @@ server <- function(input, output, session) { ...@@ -398,7 +398,7 @@ server <- function(input, output, session) {
collapsible = TRUE, collapsible = TRUE,
#add_tooltip(data_tooltip, "hover"), #add_tooltip(data_tooltip, "hover"),
plotOutput("line", height = 250)) line_plot<<-plotOutput("line", height = 250))
}) })
#TODO: linechart View #TODO: linechart View
...@@ -420,7 +420,7 @@ server <- function(input, output, session) { ...@@ -420,7 +420,7 @@ server <- function(input, output, session) {
solidHeader = TRUE, solidHeader = TRUE,
collapsible = TRUE, collapsible = TRUE,
plotOutput("scat", height = 250)) scat_plot<<- plotOutput("scat", height = 250))
}) })
#TODO: Scatterplot View #TODO: Scatterplot View
...@@ -442,7 +442,7 @@ server <- function(input, output, session) { ...@@ -442,7 +442,7 @@ server <- function(input, output, session) {
solidHeader = TRUE, solidHeader = TRUE,
collapsible = TRUE, collapsible = TRUE,
plotOutput("box", height = 250)) box_plot<<- plotOutput("box", height = 250))
}) })
#TODO: Boxplot View #TODO: Boxplot View
...@@ -463,7 +463,7 @@ server <- function(input, output, session) { ...@@ -463,7 +463,7 @@ server <- function(input, output, session) {
solidHeader = TRUE, solidHeader = TRUE,
collapsible = TRUE, collapsible = TRUE,
leafletOutput("map", height = 250)) map_plot<<-leafletOutput("map", height = 250))
}) })
# MAP VIEW # MAP VIEW
...@@ -512,15 +512,52 @@ server <- function(input, output, session) { ...@@ -512,15 +512,52 @@ server <- function(input, output, session) {
} }
#DownloadButton #DownloadButton
plotinput <- function() {
#df<-data.frame(q=c(1,3,5,7,9),w=c(2,4,6,8,10),z=c(1,2,3,4,5))
list(p1 = map_plot,
p2 = line_plot,
p3 = scat_plot)
}
output$down.pdf <- downloadHandler(
##FIRST TRY
# print("download wird aufgerufen"),
# filename = function() { paste('plot', '.png', sep='') },
# content = function() {
# ggsave(plot=map_plot, file=input$nut$datapath)
#}
#SECOND TRY
filename = function(){paste("Graphs","pdf", sep=".")},
content = function(file) {
cairo_pdf(file = file, width=12, height=8)
#boxplot(data$V1, type="box", xlab=input$box_x)
map_plot
dev.off()
})
##THIRD TRY
# observeEvent(input$down.pdf, {
#
# pdf("www/myreport.pdf")
# plotinput()
# dev.off()
# tags$iframe(style="height:600px; width:100%", src="myreport.pdf")
#
# })
#TODO: MAKE IT WORK! #TODO: MAKE IT WORK!
observeEvent(input$screenshot,{ #observeEvent(input$screenshot,{
#if(input$check_line|input$check_time|input$check_map|input$check_hist) #if(input$check_line|input$check_time|input$check_map|input$check_hist)
#disable("screenshot") #disable("screenshot")
#webshot::install_phantomjs() #webshot::install_phantomjs()
cdat <<- session$clientData # cdat <<- session$clientData
url <- paste0(cdat$url_hostname,":", cdat$url_port,"/") # url <- paste0(cdat$url_hostname,":", cdat$url_port,"/")
print(url) # print(url)
#URL <- "http://rstudio.github.io/leaflet/" #URL <- "http://rstudio.github.io/leaflet/"
#appshot("cocoVisR/", file = "dashboard.png", port = getOption("shiny.port"), envvars = NULL) #appshot("cocoVisR/", file = "dashboard.png", port = getOption("shiny.port"), envvars = NULL)
...@@ -543,7 +580,7 @@ server <- function(input, output, session) { ...@@ -543,7 +580,7 @@ server <- function(input, output, session) {
}) #})
# url <- paste0(cdat$url_protocol,"//",cdat$url_hostname,":", cdat$url_port, cdat$url_pathname,cdat$url_search) # url <- paste0(cdat$url_protocol,"//",cdat$url_hostname,":", cdat$url_port, cdat$url_pathname,cdat$url_search)
#output$downButton <- downloadHandler( #output$downButton <- downloadHandler(
# filename="dashboard.png", # filename="dashboard.png",
......
...@@ -134,8 +134,9 @@ ui <- dashboardPage( ...@@ -134,8 +134,9 @@ ui <- dashboardPage(
uiOutput("scat_box"), uiOutput("scat_box"),
uiOutput("box_box"), uiOutput("box_box"),
uiOutput("map_box"), uiOutput("map_box"),
uiOutput("pdfview"),
actionButton("screenshot","Download"))) downloadButton("down.pdf","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