图标不出现在ShinyDashboardPlus :: BoxDropdown()中

发布于 2025-02-11 00:02:58 字数 1595 浏览 1 评论 0原文

我试图将以下图标实现到闪亮的应用程序中。

但图标正在出现。我正在尝试以下闪亮的代码。

library(shiny)
library(shinydashboard)

shinyApp(fluidPage(    
  
  # Give the page a title
  titlePanel("Telephones by region"),
  
  # Generate a row with a sidebar
  sidebarLayout(      
    
    # Define the sidebar with one input
    sidebarPanel(
      selectInput("region", "Region:", 
                  choices=colnames(WorldPhones)),
      hr(),
      helpText("Data from AT&T (1961) The World's Telephones.")
    ),
    
    # Create a spot for the barplot
    mainPanel(
      shinydashboardPlus::box(
        # Analysis UI Module function and arguments from JSON file
        plotOutput("phonePlot"),
        title = "Hi!",
        width = 12,
        closable = TRUE,
        collapsible = TRUE,
        dropdownMenu = shinydashboardPlus::boxDropdown(
          shinydashboardPlus::boxDropdownItem("Hi!"),
          shinydashboardPlus::boxDropdownItem("Hello!"),
          icon = icon("circle-ellipsis")
        )
      ) 
    )
    
  )
),

# Define a server for the Shiny app
function(input, output) {
  
  # Fill in the spot we created for a plot
  output$phonePlot <- renderPlot({
    
    # Render a barplot
    barplot(WorldPhones[,input$region]*1000, 
            main=input$region,
            ylab="Number of Telephones",
            xlab="Year")
  })
})

我正在尝试使用“ Circle-ellipsis”图标,它也不适用于唯一的“省略号”图标。任何建议都得到高度赞赏。

I was trying to implement the below icon into the shiny app.

enter image description here

But the icon is appearing. I was trying with the below shiny code.

library(shiny)
library(shinydashboard)

shinyApp(fluidPage(    
  
  # Give the page a title
  titlePanel("Telephones by region"),
  
  # Generate a row with a sidebar
  sidebarLayout(      
    
    # Define the sidebar with one input
    sidebarPanel(
      selectInput("region", "Region:", 
                  choices=colnames(WorldPhones)),
      hr(),
      helpText("Data from AT&T (1961) The World's Telephones.")
    ),
    
    # Create a spot for the barplot
    mainPanel(
      shinydashboardPlus::box(
        # Analysis UI Module function and arguments from JSON file
        plotOutput("phonePlot"),
        title = "Hi!",
        width = 12,
        closable = TRUE,
        collapsible = TRUE,
        dropdownMenu = shinydashboardPlus::boxDropdown(
          shinydashboardPlus::boxDropdownItem("Hi!"),
          shinydashboardPlus::boxDropdownItem("Hello!"),
          icon = icon("circle-ellipsis")
        )
      ) 
    )
    
  )
),

# Define a server for the Shiny app
function(input, output) {
  
  # Fill in the spot we created for a plot
  output$phonePlot <- renderPlot({
    
    # Render a barplot
    barplot(WorldPhones[,input$region]*1000, 
            main=input$region,
            ylab="Number of Telephones",
            xlab="Year")
  })
})

I am trying with 'circle-ellipsis' icon, it is also not working with the only 'ellipsis' icon. Any suggestion is highly appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

吹泡泡o 2025-02-18 00:02:58

您可以改用图标(“ Ellipsis-H”)Shiny :: Icon支持Fontawesome版本4和5的图标。您可以在此处搜索这些图标:

You can use icon("ellipsis-h") instead. shiny::icon supports icons from FontAwesome versions 4 and 5. You can search for these icons here:

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文