Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

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_unhover", "plotly_click", "plotly_doubleclick",
    "plotly_selected", "plotly_selecting", "plotly_brushed", "plotly_brushing",
    "plotly_deselect", "plotly_relayout", "plotly_restyle", "plotly_legendclick",
    "plotly_legenddoubleclick", "plotly_clickannotation", "plotly_afterplot",
    "plotly_sunburstclick"),
  source = "A",
  session = shiny::getDefaultReactiveDomain(),
  priority = c("input", "event")
)

Arguments

event

The type of plotly event. All supported events are listed in the function signature above (i.e., the usage section).

source

a character string of length 1. Match the value of this string with the source argument in plot_ly() (or ggplotly()) to respond to events emitted from that specific plot.

session

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

priority

the priority of the corresponding shiny input value. If equal to "event", then event_data() always triggers re-execution, instead of re-executing only when the relevant shiny input value changes (the default).

Author(s)

Carson Sievert

References

See Also

Examples

## Not run: 
plotly_example("shiny", "event_data")

## End(Not run)

plotly

Create Interactive Web Graphics via 'plotly.js'

v4.10.0
MIT + file LICENSE
Authors
Carson Sievert [aut, cre] (<https://orcid.org/0000-0002-4958-2844>), Chris Parmer [aut], Toby Hocking [aut], Scott Chamberlain [aut], Karthik Ram [aut], Marianne Corvellec [aut] (<https://orcid.org/0000-0002-1994-3581>), Pedro Despouy [aut], Salim Brüggemann [ctb] (<https://orcid.org/0000-0002-5329-5987>), Plotly Technologies Inc. [cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.