r - 在 Shiny 中插入 bspopover
问题描述
我想在文本旁边插入一个 bspopover:“Shapefile Import”。对于我能够插入的过滤器选项,如下面的代码所示,但是对于 fileImput 没有。可执行代码如下。有谁能够帮助我?
谢谢!
library(shinyBS)
library(shiny)
popoverTempate <-
'<div class="popover popover-lg" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
DES_filter1<-paste("Text text text text text text.", sep = "<br>")
ui <- fluidPage(
tags$head(
tags$style(HTML(".popover.popover-lg {width: 500px; max-width: 500px;}"))
),
titlePanel("Old Faithful Geyser Data"),
sidebarLayout(
sidebarPanel(
fileInput("shp", h3("Shapefile import"), multiple = TRUE, accept = c('.shp', '.dbf','.sbn', '.sbx', '.shx', '.prj')),
radioButtons(
"filter1",
h3("Select properties"),
choiceValues = c(1, 2),
choiceNames = list(
tagList(
tags$span("All properties"),
tags$span(icon("info-circle"), id = "icon1", style = "color: blue;")
),
tagList(
tags$span("Exclude properties"),
tags$span(icon("info-circle"), id = "icon2", style = "color: blue;")
)
),
selected = 1
),
bsPopover("icon1", "TITLE1", DES_filter1, placement = "right",
options = list(template = popoverTempate)),
bsPopover("icon2", "TITLE2", "CONTENT2", placement = "right"),
radioButtons("filter2", h3("Select"),
choices = list("All" = 1,
"Exclude" = 2),
selected = 1),
),
mainPanel(
)
)
)
server <- function(input, output) {
}
shinyApp(ui = ui, server = server)
解决方案
您可以在fileInput
标题中添加图标:
sidebarPanel(
fileInput("shp",
h3(
span("Shapefile import"),
span(icon("info-circle"), id = "icon3", style = "color: blue")
),
multiple = TRUE,
accept = c('.shp', '.dbf','.sbn', '.sbx', '.shx', '.prj')
),
bsPopover("icon3", "TITLE3", "CONTENT3", placement = "right"),
...
推荐阅读
- python - 如何计算熊猫日期时间对象的均值和方差?
- python-3.x - 如何在数据帧之间进行多逻辑值比较?
- node.js - 创建从 api 获取数据并使用该数据在 html 文件中创建表的 Node.js 应用程序
- javascript - 使用 Netlify 将环境变量导入 HTML
- powershell - 从哈希表中获取随机项,但值的总和必须等于设定的数字
- c - Swift 到 C 的桥接:字符串到 UnsafePointer
? 是不是自动桥接? - php - PHP:使用 CURLOPT_POST、CURLOPT_HTTPGET 和 CURLOPT_CUSTOMREQUEST 这三个?
- java - 将 SQL 转换为 CriteriaBuilder 语句
- mysql - 为断开连接的节点启用数据库写入的 Galera 集群
- android - Firebase 已删除用户未删除元数据或 Firebase 元数据不起作用