是否有可能延迟工具提示并在几秒钟后过期?
require(shiny)
require(shinyBS)
shinyApp(ui = fluidPage(
shinyjs::useShinyjs(),
bsTooltip(id = 'input', title = "Lets delay this appearing for 1s and force disappear after 5s",
placement = "bottom", trigger = "hover", options = list(delay = list(show=1000, hide=3000))),
sidebarLayout(
sidebarPanel(
selectInput(inputId = 'input', label = 'input', choices = c('cats','dogs'))
),
mainPanel()
)
)
, server = function(input, output){})

发布于 2017-11-24 18:41:47
shinyBS::bsTooltip未能正确序列化Popovers.R#L129中嵌套的options列表
options对象最后看起来像{ delay: "list(show = 1000, hide = 3000)" }
不幸的是,shinyBS似乎不再被维护,或者一个补丁是值得提交的。
我建议一个解决办法--使用shinyBS::addTooltip,它可以正确地序列化options。
require(shiny)
require(shinyBS)
shinyApp(
ui = fluidPage(
# shinyjs::useShinyjs(),
shinyBS:::shinyBSDep,
sidebarLayout(
sidebarPanel(
selectInput(inputId = 'input', label = 'input', choices = c('cats','dogs'))
),
mainPanel()
)
),
server = function(input, output, session) {
addTooltip(session, id = 'input', title = "Lets delay this appearing for 1s and force disappear after 5s",
placement = "bottom", trigger = "hover", options = list(delay = list(show=1000, hide=3000)))
}
)或者直接用靴带。
发布于 2019-01-14 17:48:36
我用了tipify。所以我的代码是:
tipify(
element,
title = "some title",
options = list("delay" = 1000)
)问题是:延迟确实是数字的,但是函数createTooltipOrPopoverOnUI (Popovers.R)将围绕所有参数设置商号:
options = paste0("{'", paste(names(options), options, sep = "': '", collapse = "', '"), "'}")所以我做了这件事:我不以它为荣,但它起了作用:
options = list("delay': 1000, 'it" = "sucks")https://stackoverflow.com/questions/47477237
复制相似问题