有没有办法将弹出窗口或工具提示添加到
output$Text <- renderText({ c("TestText") })
元素,然后使用shinyBS?
renderUI
呈现
答案 0 :(得分:4)
这样的事情吗?
rm(list=ls())
library(shiny)
ui <- basicPage(
headerPanel("Tooltip test"),
mainPanel(
column(3,tags$div(title="Tooltip works",verbatimTextOutput("Text")))
)
)
server <- shinyServer(function(input, output,session) {
output$Text <- renderText({ c("TestText") })
})
shinyApp(ui = ui, server = server)
rm(list=ls())
library(shiny)
library(shinyBS)
ui <- basicPage(
headerPanel("Tooltip test"),
bsTooltip("Text", "Tooltip works", placement = "bottom", trigger = "hover",
options = NULL),
mainPanel(
column(3,verbatimTextOutput("Text"))
)
)
server <- shinyServer(function(input, output,session) {
output$Text <- renderText({ c("TestText") })
})
shinyApp(ui = ui, server = server)
答案 1 :(得分:1)
通常,您可以使用其ID在任何Input和Output对象上提供工具提示。例如,我在用户界面的ID为 downloadData 的downloadButton
上添加了工具提示。
sidebarPanel(
downloadButton("downloadData",
label = "Save and check the Employee List"),
bsTooltip("downloadData",
'This is the tooltip where you can add double quotes "like this"'),
placement = "bottom", trigger = "hover")
)