![](/img/trans.png)
[英]Can I set html class dynamically? Or how does Shiny set 'html'.hasClass('Shiny-busy')?
[英]How can I display a local html file in Shiny UI dynamically?
另一個腳本在本地目錄中創建了一個 example.html。 在那之前,Shiny UI 應該顯示一個空屏幕,當 example.html 生成時,它應該反映在 Shiny UI 中。
example.html 已加載到 Shiny UI 中,但未得到反映。
這是我試過的代碼,至少用於顯示文件
代碼:
ui = shinyUI(fluidPage(titlePanel("Generated Report"),
mainPanel(htmlOutput("showfile"))
)
)
server = function(input, output, session){
output$showfile <- renderUI({
includeHTML("C://Users//DELL//Desktop//abc_files//www//report.html")
# HTML(readLines(file_to_show))
})
}
shinyApp(ui, server)
如果您想在閃亮的應用程序中顯示 ...report.html 文件,則文件路徑中的//
不正確。
此腳本(帶有單個/
)將顯示 HTML 文件。
ui = shinyUI(fluidPage(titlePanel("Generated Report"),
mainPanel(htmlOutput("showfile"))
)
)
server = function(input, output, session){
output$showfile <- renderUI({
includeHTML("C:/Users/DELL/Desktop/abc_files/www/report.html")
# HTML(readLines(file_to_show))
})
}
shinyApp(ui, server)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.