Capture events in shiny.
capture_event(g, event, callback = NULL, when = c("on", "once", "off"))
g | An object of class |
---|---|
event | Name of event to trigger the callback. |
callback | A callback function to run when the |
when | When the event should be triggered. |
The callback
function should accept a single
argument; the event data. If no callback function is passed
(NULL
) then one is generated. The generated callback function
sets a shiny input <chartId>_<eventName>
with the event data.
g2(iris, asp(Sepal.Width, Sepal.Length)) %>% fig_point() %>% capture_event("point:click")