Black Lives Matter. Please consider donating to Black Girls Code today.
Learn how to use COVID-19 data in open source Dash apps. Register for the Sept 23rd webinar with IQT!

Shiny plotly_zoom and plotly_relayout not working in R (event_data)

I am using Plotly within Shiny. I have a scatter plot and a data table presenting the details of each of the points in the scatter plot.

I would like to get the data table to adjust to show just the points that are zoomed in on the scatter plot, does anyone know how to do this?

I can get it to work for plotly_click (adjust to a single click of the user - can it be done for multiple clicks of the user?) but not for plotly_relayout or plotly_zoom.

An alternative I was thinking was to try use the zoomed points to order the points in the datatable (i.e. zoomed points at the top of the displayed table) rather than trying to have the table only showing the zoomed points?

(Code can be found here:

Hi Emily,

I am stuck with the same problem. And google searching reveals this to be the only relevant link I’ve found so far.

Did you manage to solve it?