load image from file on user selection dropdown

I have a folder full with rendered images from a previous step. Building a dashboard to load any chosen image from user input via dropdown.

I have tried crosstalk package to no avail.

library(crosstalk)
library(magrittr)
library(png)
    
df <- list.files("plots/", full.names = TRUE) %>%
      as_tibble() %>%
      magrittr::set_names("path") 
    
    shared_data <- SharedData$new(df,  key = ~path)
    
    p <- shared_data %>% readPNG(source = path)
    
    bscols( filter_select(id = "file_id", 
                         label = "CHOOSE", 
                         sharedData = shared_data, 
                         group = ~path), 
           p)

maybe there is a simpler approach. Just choose a filename from dropdown and load it.

any hint?

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.