Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All images can be downloaded as static image #7

Open
5 tasks
statnmap opened this issue Oct 29, 2020 · 1 comment
Open
5 tasks

All images can be downloaded as static image #7

statnmap opened this issue Oct 29, 2020 · 1 comment

Comments

@statnmap
Copy link
Collaborator

statnmap commented Oct 29, 2020

A button allows to download image presented.

  • The image is downloaded as a static plot (not a screenshot of interactive)
    • The interactive tmaps are downloaded as image
  • A message will warn the user that output can be different due to dimensions of the figure depending on the size of their screen, and non interactivity
  • Eventually, a modal can present the real image that will be downloaded before download (not a priority)

Les pages

  • Page 1: leaflet
  • Page 3: leaflet
  • Page 3: ggplot evolution
  • Page 4: leaflet
  • Page 4: ggplot evolution
@ColinFay
Copy link
Collaborator

ColinFay commented Nov 2, 2020

Note to self:

library(shiny)
ui <- function(request){
  tagList(
    plotOutput("plop") %>% 
      tagAppendAttributes(
        onclick = 'var a = document.createElement("a"); a.href = $(this).find("img").attr("src"); a.download = "Image.png"; a.click(); '
      )
  )
}
server <- function(
  input, 
  output, 
  session
){
  output$plop <- renderPlot({
    plot(mtcars)
  })
}
shinyApp(ui, server)

@statnmap statnmap changed the title All images can be downloaded as static image All images + tables? can be downloaded as static image Dec 1, 2021
@statnmap statnmap changed the title All images + tables? can be downloaded as static image All images can be downloaded as static image Dec 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants