Description Usage Arguments Value Examples
Create a tooltip for a ggplot in a Shiny application
1 | hover_tip(input$plot_hover, "<b> Hello World </b>")
|
hover_object |
The Shiny input object containing the hover info. |
content |
*Either* a single-row data frame from which to automatically generate a tooltip, *or* a string with the full contents of a custom tooltip, formatted for HTML. |
background_color |
A hex value, as string, to form the background color of the tooltip |
alpha |
A number between 0 and 1, to set the opacity of the tooltip background |
preferred_side |
One of c("right", "left") |
h_just |
The horizontal distance, in pixels, to move the tooltip to the right. Negative values will move the tooltip to the left. |
v_just |
The vertical distance, in pixels, to move the tooltip up. Negative values will move the tooltip down. |
minimum_h |
The minimum horizonal width, in pixels, of the tooltip panel. The panel will squish to be smaller as the cursor approaches the edge of the plotting area, but will not squish smaller than minimum_h. |
minimum_v |
The minimum vertical width, in pixels, of the tooltip panel. The panel will "squish" to be smaller as the cursor approaches the bottom of the plotting area, but will not squish smaller than minimum_v. |
A wellPanel-based on-hover tooltip
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ## Not run:
output$hover_info <- renderUI({
hover_tip(
hover_object = input$plot_hover,
content = paste0(
"<b> Fiscal Year: </b>", shown$Fiscal.Year, "<br/>",
"<b> Vendor Size: </b>", shown$Vendor.Size, "<br/>",
"<b> Amount: </b>", money_label(shown$Action.Obligation)))
})
output$hover_info <- renderUI({
hover_tip(
hover_object = input$plot_hover,
content = hover_data(
chart_data = dataset(),
hover_object = input$plot_hover,
chart_type = "bar"))
})
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.