I have a saved html widget (from leaflet) that I want to display in a shiny app.
Using includeHTML()
works when it is given in ui.R, but not when dynamically called using renderUI()
. I have many .html files that I would like a user to choose from with a select input so I need a dynamic solution.
The accepted answer from this popular post Display HTML file in Shiny App has a dynamic solution, but it does not work for me. No error is given, and nothing is rendered.
In summary:
Works
ui <- fluidPage(
includeHTML("foo.html")
)
Does Not Work
ui <- fluidPage(
htmlOutput("map")
)
server <- function(input,output){
output$map <- renderUI({
includeHTML(path = "foo.html")
})
}
This post is also related, but no solution was found.