Shinydashboard某些字体真棒图标无法正常工作 [英] shinydashboard some Font Awesome Icons Not Working

查看:144
本文介绍了Shinydashboard某些字体真棒图标无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用shinydashboard时,我发现有些图标似乎可以工作,而有些则不能.在下面的示例中,电池已满"图标无法正常工作,而时钟"图标可以正常工作.我不知道为什么会这样.

When using shinydashboard I find that some icons seem to work while some don't. In the below example, the battery-full icon doesn't work while the clock-o icon works fine. I'm unable to figure out why this should happen.

library(shiny)
library(shinydashboard)

header <- dashboardHeader(title="Some Icons Not Working?")

# No sidebar --------------------------------------------------------------

sm <- sidebarMenu(

  sm <- sidebarMenu(
    menuItem(
      text="asdf",
      tabName="asdfasdf",
      icon=icon("battery-full")),
    menuItem(
      text="qwer",
      tabName="qwerqwer",
      icon=icon("clock-o"))
  )
)

sidebar <- dashboardSidebar(sm)

# Compose dashboard body --------------------------------------------------

body <- dashboardBody(

  tabItems(

  )
)

# Setup Shiny app UI components -------------------------------------------

ui <- dashboardPage(header, sidebar, body, skin="black")

# Setup Shiny app back-end components -------------------------------------

server <- function(input, output) {


}

# Render Shiny app --------------------------------------------------------

shinyApp(ui, server)

推荐答案

好吧,我认为4.4版中的新版本未更新.您可能可以请求shiny团队进行更新,他们将非常容易地做到这一点.另外,您也可以自己下载它们并替换以前的内容...

Ok, I think the new ones in version 4.4 are not updated. You can probably request shiny team to update them and they will do it very easily. Alternatively you can do it yourself by downloading them and replacing the previous content...

1..转到 Font Awesome下载页面,然后得到它

1. Go to the Font Awesome download page and get it

2..找到安装shiny软件包的 font awesome 文件夹.这应该在这里~\Documents\R\win-library\3.1\shiny\www\shared\font-awesome

2. Locate your font awesome folder where you installed shiny package. This should be somewhere like here ~\Documents\R\win-library\3.1\shiny\www\shared\font-awesome

3..用新内容替换此文件夹的内容(如果需要,可以删除以前的内容).下面是我放在那里的东西

3. Replace the content of this folder with new contents (you can delete the previous content if you want). Below is what I put in there

4..现在,您的应用应该可以使用新字体了

4. Now your app should work fine with new fonts

这篇关于Shinydashboard某些字体真棒图标无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆