簡體   English   中英

增加ShinyBS中工具提示/彈出窗口的長度

[英]Increase length of tooltip/popover in ShinyBS

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) {}
)

實際上,在第二個工具提示的標題中存在一個未轉義的' ,這會導致問題,而不是標題的長度。 鍵入\\\\'代替每個'將解決問題。

嘗試運行此(或者,就此而言,在?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) {}
)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM