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) {
collapsible = TRUE,
#add_tooltip(data_tooltip, "hover"),
plotOutput("line", height = 250))
line_plot<<-plotOutput("line", height = 250))
})
#TODO: linechart View
......@@ -420,7 +420,7 @@ server <- function(input, output, session) {
solidHeader = TRUE,
collapsible = TRUE,
plotOutput("scat", height = 250))
scat_plot<<- plotOutput("scat", height = 250))
})
#TODO: Scatterplot View
......@@ -442,7 +442,7 @@ server <- function(input, output, session) {
solidHeader = TRUE,
collapsible = TRUE,
plotOutput("box", height = 250))
box_plot<<- plotOutput("box", height = 250))
})
#TODO: Boxplot View
......@@ -463,7 +463,7 @@ server <- function(input, output, session) {
solidHeader = TRUE,
collapsible = TRUE,
leafletOutput("map", height = 250))
map_plot<<-leafletOutput("map", height = 250))
})
# MAP VIEW
......@@ -512,15 +512,52 @@ server <- function(input, output, session) {
}
#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!
observeEvent(input$screenshot,{
#observeEvent(input$screenshot,{
#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)
# 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)
......@@ -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)
#output$downButton <- downloadHandler(
# filename="dashboard.png",
......
......@@ -134,8 +134,9 @@ ui <- dashboardPage(
uiOutput("scat_box"),
uiOutput("box_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