Intent: I have 7 images, which can be switched through
output$image <- renderImage({
if (is.null(input$chooseImg))
return(NULL)
if (input$chooseImg == "pump1 vs all")
return(list(src = "images/roc_1vsall.png", width = "80%", height = "520"))
else if (input$chooseImg == "pump2 vs all")
return(list(src = "images/roc_2vsall.png", width = "80%", height = "520"))
else if (input$chooseImg == "pump3 vs all")
return(list(src = "images/roc_3vsall.png", width = "80%", height = "520"))
else if (input$chooseImg == "pump4 vs all")
return(list(src = "images/roc_4vsall.png", width = "80%", height = "520"))
else if (input$chooseImg == "pump5 vs all")
return(list(src = "images/roc_5vsall.png", width = "80%", height = "520"))
else if (input$chooseImg == "pump6 vs all")
return(list(src = "images/roc_6vsall.png", width = "80%", height = "520"))
else if (input$chooseImg == "pump7 vs all")
return(list(src = "images/roc_7vsall.png", width = "80%", height = "520"))
}, deleteFile = FALSE)
I wanna switch the image to a special one, when user click on a button. And this special image is not an option of the selectInput
box. And user can reset to any default images(the 7 images) by clicking the selectInput
box.
Problem: While my code works well on displaying the special image, when I try to reset to any of the 7 images, the image simply does not change. My later code after those in the "intent" part:
observeEvent(input$submit_par, {
user_parameters <- reactiveValues()
user_parameters$eps <- input$epsilon_in
user_parameters$minPts <- input$minPts_in
output$image <- isolate(renderImage({return(list(src = "images/surprise.jpg"))}, deleteFile = FALSE))
})
Thank you in advance for any idea!