Zoom/pan events for charts #8655
Labels
area:events
feature:st.altair_chart
feature:st.plotly_chart
feature:st.vega_lite_chart
type:enhancement
Requests for feature enhancements or new features
Checklist
Summary
We will soon add selections to charts (
st.plotly_chart
andst.altair_chart
). At some point, we should also add a way to react to zoom/pan events on charts and return the bounding box of the displayed chart.Why?
Let us know in the comments if you have specific use cases in mind!
How?
We should probably add a new event parameter (e.g.
on_zoom_pan
oron_relayout
oron_move
). Or we could think about integrating it withon_select
in some way (which would make the implementation a lot easier but might be a bit less obvious from UX perspective).Additional Context
Altair already supports this via selections events: using
.interactive()
in Altair adds a selection interval event (https://altair-viz.github.io/user_guide/interactions.html#scale-binding) and is a shortcut foralt.selection_interval(bind='scales')
. You can use that to get the area the user is currently viewing.The text was updated successfully, but these errors were encountered: