简体   繁体   English

哑铃字形不适用于闪亮的仪表板

[英]dumbbell glyphicon not working with shinydashboard

Though plenty of glyphicons work, the dumbell is not one of them.尽管有很多字形图标可以工作,但哑铃不是其中之一。 Any ideas?有任何想法吗?

server.r服务器文件

library(shinydashboard)
shinyServer(function(input, output) {})

ui.r用户界面

dashboardPage(
      title = "O8 Trainer",
      dashboardHeader(
        title = "Train!"
      ),
      dashboardSidebar(
        sidebarMenu(
          menuItem("Trainer", 
          tabName = "trainTab", 
          icon = icon("dumbbell", lib = "glyphicon")) #"cog" works here, for instance.
        )
      )
    )

Original answer: the dumbbell icon is not available from the free iconset 原始答案:免费图标集中没有哑铃图标

The comments below are correct: using icon() is shiny only gives you access to whatever glyphicons are made available through bootstrap as per http://getbootstrap.com/components/#glyphicons下面的评论是正确的:使用icon()是闪亮的,只能让您访问通过引导程序提供的任何字形,如http://getbootstrap.com/components/#glyphicons

Most answers link to the getbootstrap.com components page (including the icon vignette), but it is not clear where the list is on that page.大多数答案链接到 getbootstrap.com 组件页面(包括图标小插图),但不清楚该列表在该页面上的位置。 The icons list on getbootstrap.com mostly contains icons that will not work with Shiny. getbootstrap.com 上的图标列表主要包含不适用于 Shiny 的图标。 Instead, I use this list and they all work well.相反,我使用 这个列表,它们都运行良好。

On that page only include the tail of the name of the icon.在该页面上只包含图标名称的尾部。 For instance, for icon name "glyphicon glyphicon-music", proper shiny code is:例如,对于图标名称“glyphicon glyphicon-music”,正确的闪亮代码是:

icon("music", lib = "glyphicon")

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM