Hello,
I would like to put an action button, to zoom and enlarge image on my shiny app. See the code below, the shiny app render two images "space_1.jpg" and "space_2.jpg" (already created), according to the choice of the user. The idea would be to allow the user the user to enlarge image in a popup window. I don't know how to make it possible. Many thanks for your help,
library(shiny)
library(shinyWidgets)
ui <- fluidPage(
sidebarPanel(width=6,
radioButtons("choice", label = h4("Choose"),choices = c("space_1","space_2"), selected = "space_1"),
dropdown(downloadButton(outputId = "down_image_test",label = "Download plot"),size = "xs",icon = icon("download", class = "opt"), up = TRUE),
actionBttn(inputId = "zoom_image_test",icon = icon("search-plus", class = "opt"),style = "fill",color = "danger",size = "xs")
),
mainPanel(h2("main panel"),imageOutput('image_test'))
)
server <- function(input, output){
output$image_test <- renderImage({
nam=paste0(getwd(),"/",input$choice,".jpg")
list(src = nam,height = 200)}, deleteFile = FALSE)
output$down_image_test <- downloadHandler(
filename = "test.jpg",
content = function(file) {
nam=paste0(getwd(),"/",input$choice,".jpg")
file.copy(nam, file)
})
}
shinyApp(ui,server)