The uploaded data could include several data set for plotting.
I have created a module, which is to take data and ggplot.
I do not know how to dynamically insert UI (module) based on user's data.
# server.R
function(input, output, session){
# data process
dat.with.unkn <- reactive ({
# get data from user's upload
})
# insert UI (module)
observeEvent(input$plot.button, {
a <- lapply(names(dat.with.unkn), function(indx){
id <- paste0("id_", indx)
insertUI(selector = "#placeholder", where = "beforeBegin", ui = heatmapUI(id) )
})
})
# module server
# because I do not know how many data set will be uploaded,
# so I have to loop through the dat.with.unkn with lapply.
# But dat.with.unkn is an reactive value, it is not OK to be put here I guess.
lapply(names(dat.with.unkn), function(x){
id <- paste0("id_", indx)
dat <- dat.with.unkn[[indx]]
headmapServer(id, dat)
})
}