Black Lives Matter. Please consider donating to Black Girls Code today.

Get datapoints in currently zoomed view in Python

Hello, I am looking for a way to get information in table form for the zoomed view of the scatter plot.

Could anyone provide pointers regarding that?

Thanks :slight_smile:

zooming will trigger a relayoutData event of the dcc.Graph. This relayoutData contains the x- and y-axis range (see You can select the data points which fit inside this bounds and display them in a table.

thanks @Emmanuelle for sharing this. But, is there any way to get more information other than x- and y-axis by manipulating this code? Like text and any user field described in data dictionary?

The initial figure is stored in in the figure property of the dcc.Graph. Events (such as hover, click, relayout etc.) are only populated (by design) with the part of the figure which has changed.

1 Like