hover_data: Retrieve the data for the current hover location

Description Usage Arguments Value Examples

Description

Retrieve the data for the current hover location

Usage

1
hover_data(chart_data, hover_object, chart_type, max_distance = 10)

Arguments

chart_data

A data frame. The same data used to create the chart.

hover_object

The Shiny input object containing the hover info.

chart_type

Either "line" or "bar". For scatterplot, use "line", for area or stacked bar use "bar". Other types are not currently supported and will require manual tips.

max_distance

For line and scatter charts: a distance, in pixels. If the mouse is more than this distance from any point, the function will return a null data frame.

Value

A data frame of

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
output$hover_info <- renderUI({

  shown <- hover_data(
    chart_data = dataset(),
    hover_object = input$plot_hover,
    chart_type = "stacked bar")
})

## End(Not run)

CSISdefense/hamre documentation built on May 31, 2019, 7:58 a.m.