ShinyBS软件包提供了一种简单易用的方法,可以为Shiny应用程序的元素添加工具提示和弹出窗口。然而,这些的长度被严格限制在大约40个字符。我真的需要增加这些工具提示中允许的字符数。
一个例子:
library(shiny)
library(shinyBS)
shinyApp(
ui = fluidPage(
column(5,sliderInput("n", "Short tooltip", 5, 100, 20),
bsTooltip("n",title="This is a short tooltip, so it works."),
sliderInput("n2", "Long tooltip", 5, 100, 20),
bsTooltip("n2",title="This is a longer tooltip, so it doesn't work."))
),
server = function(input, output) {}
)
答案 0 :(得分:3)
实际上,在第二个工具提示的标题中存在未转义的'
,这会导致问题,而不是标题的长度。键入\\'
代替每个'
将解决问题。
尝试运行此功能(或者,就此而言,?bsTooltip
中的示例),看看带有长标题的工具提示是否正常工作:
library(shiny)
library(shinyBS)
shinyApp(
ui = fluidPage(
column(5,
sliderInput("n", "Short tooltip", 5, 100, 20),
bsTooltip("n",title="This is a short tooltip, so it works."),
sliderInput("n2", "Long tooltip", 5, 100, 20),
bsTooltip("n2",title="This is a longer tooltip, which\\'ll still work, as long as each special character is escaped with a \\\\\\\\."))
),
server = function(input, output) {}
)