Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
749 views
in Technique[技术] by (71.8m points)

r - shinydashboard some Font Awesome Icons Not Working

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)
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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. Go to the Font Awesome download page and get it enter image description here

2. Locate your font awesome folder where you installed shiny package. This should be somewhere like here ~DocumentsRwin-library3.1shinywwwsharedfont-awesome

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 enter image description here

4. Now your app should work fine with new fonts enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...