event_data: Access plotly user input event data in shiny

Description Usage Arguments Author(s) Examples

View source: R/shiny.R

Description

This function must be called within a reactive shiny context.

Usage

1
2
3
4
5
event_data(event = c("plotly_hover", "plotly_unhover", "plotly_click",
  "plotly_doubleclick", "plotly_selected", "plotly_selecting",
  "plotly_brush", "plotly_brushing", "plotly_deselect", "plotly_relayout",
  "plotly_legendclick", "plotly_legenddoubleclick", "plotly_afterplot"),
  source = "A", session = shiny::getDefaultReactiveDomain())

Arguments

event

The type of plotly event. Currently 'plotly_hover', 'plotly_click', 'plotly_selected', and 'plotly_relayout' are supported.

source

a character string of length 1. Match the value of this string with the source argument in plot_ly() to retrieve the event data corresponding to a specific plot (shiny apps can have multiple plots).

session

a shiny session object (the default should almost always be used).

Author(s)

Carson Sievert

Examples

1
2
3
4
## Not run: 
plotly_example("shiny", "event_data")

## End(Not run)

trafficonese/plotly_mini documentation built on Sept. 14, 2019, 9:51 p.m.