如何解决闪亮的showshowification不再与dashboardthemes一起使用
加载dashboardthemes
后,引导通知样式似乎不再起作用(它们都显示为灰色,即默认值)。
在2 Shiny应用程序下面,第一个似乎运行正常,第二个显示问题。
有人知道如何管理/修复此问题吗?
注意:dashboardthemes
似乎对按钮有相同的影响,请参见this SO post
require(shiny)
require(shinydashboardPlus)
require(dashboardthemes)
# APP #1: WORKING
shinyApp(
ui = fluidPage(
actionButton("show_default","Show Default"),actionButton("show_message","Show Message"),actionButton("show_warning","Show Warning"),actionButton("show_error","Show Error")
),server = function(input,output) {
observeEvent(input$show_default,{
showNotification("This is a notification.")
})
observeEvent(input$show_message,{
showNotification("This is a notification.",type = "message")
})
observeEvent(input$show_warning,type = "warning")
})
observeEvent(input$show_error,type = "error")
})
}
)
# APP #2: WITH STYLING ISSUE
shinyApp(
ui = dashboardPagePlus(
title = "hello",header = dashboardHeaderPlus(title = "hello"),sidebar = dashboardSidebar(),body = dashboardBody(
shinyDashboardThemes(
theme = "grey_light"
),fluidPage(
actionButton("show_default","Show Error")
)
)
),type = "error")
})
}
)
解决方法
问题在于,dashboardthemes程序包为所有通知设置了单一背景色,即使它们的状态不同。 我已经在该软件包的最新v1.1.2版本中修复了该问题,该版本现在可以在GitHub上找到。在CRAN上发布需要几天的时间。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。