R Shiny: how to use fontawesome pro version with the icon function?

你离开我真会死。 提交于 2019-12-07 14:47:23

问题


I'm using fontawesome icons throughout my Shiny app via the icon function.

I've downloaded the pro version of fontawesome, and used the instructions here: shinydashboard some Font Awesome Icons Not Working to replace the free version that Shiny is using by default (inside shiny\www\shared\font-awesome) with my paying version. This works very well locally, and all the pro icons show in my app.

However, when I deploy to shinyapps.io, it seems like Shiny goes back to using the default version. I did try including my pro directory inside the /www/ folder of my app, but without success. Seems like there is no way to tell the icon() function to look at a local version of fontawesome, something like icon(...,lib=local), or icon(...,lib=path_to_fa)...

Any help would be very welcome.


回答1:


The trick was, inside the htmlDependency call (in icon() function), to remove package = "shiny" and replace "www/shared/fontawesome" by the absolute path to my FA folder (I also updated the version number).



来源:https://stackoverflow.com/questions/55163719/r-shiny-how-to-use-fontawesome-pro-version-with-the-icon-function

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!