# Shiny plotly\_zoom and plotly\_relayout not working in R (event\_data)

**URL:** <https://community.plotly.com/t/shiny-plotly-zoom-and-plotly-relayout-not-working-in-r-event-data/1567>\
**Category:** Plotly R\
**Created:** [July 18, 2016, 8:45am UTC](https://community.plotly.com/t/shiny-plotly-zoom-and-plotly-relayout-not-working-in-r-event-data/1567 "2016-07-18T08:45:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![emilyduffy31](https://avatars.discourse-cdn.com/v4/letter/e/77aa72/32.png) [@emilyduffy31](https://community.plotly.com/u/emilyduffy31)\
**Post date:** [July 18, 2016, 8:45am UTC](https://community.plotly.com/t/shiny-plotly-zoom-and-plotly-relayout-not-working-in-r-event-data/1567/1 "2016-07-18T08:45:45Z")

</div>

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: [http://stackoverflow.com/questions/38357575/plotly-in-shiny-problems](http://stackoverflow.com/questions/38357575/plotly-in-shiny-problems))

---

<div class="post-metadata">

**Author:** ![rbrowne](https://avatars.discourse-cdn.com/v4/letter/r/c0e974/32.png) [@rbrowne](https://community.plotly.com/u/rbrowne)\
**Post date:** [November 7, 2016, 10:40am UTC](https://community.plotly.com/t/shiny-plotly-zoom-and-plotly-relayout-not-working-in-r-event-data/1567/2 "2016-11-07T10:40:12Z")

</div>

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?

Thanks,
