2017-09-13 129 views
0

我正在开发Shiny应用程序,我用HTML,CSS和js创建了UI代码,并将它们保存在www子文件夹和app.R主文件夹中。RShiny无法加载具有外部HTML文件的css文件

和我的应用程序在如下

runApp(
shinyApp(
    ui = shinyUI(
     htmlTemplate("www/index.html") 
    ), 
    server = shinyServer(function(input, output) { 
    }) 
)) 

当我试图运行的应用程序的代码,它是附加CSS和JS代码。

请帮我解决这个问题。 谢谢。

回答

0

这是我template.html

<!DOCTYPE html> 
<html> 
    <head> 
    <script src="//d3js.org/d3.v3.min.js" charset="utf-8"></script> 
    {{ headContent() }} 
    </head> 
    <body> 
    <!-- JavaScript code that uses D3 here --> 

    {{ d3heatmap::d3heatmap(mtcars, scale="column", colors="Blues") }} 
    </body> 
</html> 

app.R文件

shinyApp(
    ui = shinyUI(
     htmlTemplate("template.html") 
    ), 
    server = shinyServer(function(input, output) { 
    }) 
) 

template.html只是应用程序文件夹,app.R也位于里面!

希望它有帮助!