plotly (version 4.8.0)

event_data: Access plotly user input event data in shiny

Description

This function must be called within a reactive shiny context.

Usage

event_data(event = c("plotly_hover", "plotly_click", "plotly_selected",
  "plotly_relayout"), 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).

Examples

Run this code
# NOT RUN {
plotly_example("shiny", "event_data")
# }

Run the code above in your browser using DataCamp Workspace