Considerations for event_register with shiny modules #2416
Unanswered
john-harrold
asked this question in
Q&A
Replies: 2 comments 1 reply
-
|
Have you found a solution for handling a click event in a module? I cannot get rid of |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
This is how I'm creating the ui element for shingy: uiele = plotly::ggplotly(fobj[["ggplot"]], source=paste0(id, "-results_fig"), tooltip=c("text"))
uiele = plotly::event_register(uiele, "plotly_click")To react to the clicks I'm doing this: observe({
clk = plotly::event_data("plotly_click", source=paste0(id, "-results_fig"), priority="event")
do_something_with_click(clk)
}) |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm looking to include a plotly element in a shiny module and I want to react to it. The way I'm doing that is using the
event_registerfunction. The event register seems like a UI ID. Is there any kind of best practices when using plotly/event_register in a shiny module to prevent namespace issues? Like should I reference it using NS:NS("mod_id", "my_plot")?Beta Was this translation helpful? Give feedback.
All reactions