tooltip on shiny R?

前端 未结 2 1110
-上瘾入骨i
-上瘾入骨i 2020-12-12 14:50

I want to have a tool-tip in my Shiny R application. Is there any easy way to achieve that? For now, I am creating a density map and I want a simpl

相关标签:
2条回答
  • 2020-12-12 15:18

    This is slightly easier and more elegant way.

    library(shinyBS) # Additional Bootstrap Controls
    
    ## From ui.R: Adds a tooltip to element with inputId = "someInput" 
    ## with text, "This is an input.", that appears to the left on hover.
    bsTooltip(id = "someInput", title = "This is an input", 
              placement = "left", trigger = "hover")
    
    ## From server.R: Add the same tooltip as above
    addTooltip(session, id = "someInput", title = "This is an input.",
               placement = "left", trigger = "hover")
    

    You can add the Tooltip in ui.R or server.R, Additional you can also use Popover.

    0 讨论(0)
  • 2020-12-12 15:41

    I think you should be able to replace this:

    sliderInput("slider_year", "YEAR:", 
                min = 2001, max = 2011, value = 2009, 
                format="####", locale="us"
    )
    

    with this:

    tags$div(title="Click here to slide through years",
        sliderInput("slider_year", "YEAR:", 
                    min = 2001, max = 2011, value = 2009, 
                    format="####", locale="us"
        )
    )
    
    0 讨论(0)
提交回复
热议问题