r - 如何在 R Shiny 的选择输入中修改多个选定值的显示
解决方案
您可以使用此 css 更改选择框中项目的颜色
.selectize-control.multi .selectize-input > div {
background: #d8544c;
color: #fdfdfd;
}
示例应用程序代码:
library(shiny)
ui <- fluidPage(
tags$head(
tags$style(HTML("
.selectize-control.multi .selectize-input > div {
background: #d8544c;
color: #fdfdfd;
}
"))
),
sidebarLayout(
sidebarPanel(
selectInput("select1",
"Choices:",
choices = names(mtcars), multiple = TRUE)
),
mainPanel(
verbatimTextOutput("out")
)
)
)
server <- function(input, output) {
output$out <- renderPrint({
input$select1
})
}
shinyApp(ui = ui, server = server)
推荐阅读
- jwt - 如何在 multer 中包含 JWT?
- ansible - 如何可视化我的应用程序生态系统?
- bash - 带有一个附加前置参数的 Bash 调用 exec
- python - Python/Flask - 从文件输入显示图像
- docker - Docker 副本不适用于 Windows 上的通配符
- javascript - 使用 javascript regex 或 react-router 从 queryparams 和 urlParams 中清除 url
- flutter - 自动对焦二维码扫描仪
- haskell - 制作自定义类型类:得到 `cannot deduced from
` 错误 - spring-boot - 使用 Spring Boot 进行自定义更新查询的控制器
- json - Sorting and filtering for elements in list for documents containing list