Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zoom/pan events for charts #8655

Open
2 tasks done
jrieke opened this issue May 13, 2024 · 1 comment
Open
2 tasks done

Zoom/pan events for charts #8655

jrieke opened this issue May 13, 2024 · 1 comment

Comments

@jrieke
Copy link
Collaborator

jrieke commented May 13, 2024

Checklist

  • I have searched the existing issues for similar feature requests.
  • I added a descriptive title and summary to this issue.

Summary

We will soon add selections to charts (st.plotly_chart and st.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 or on_relayout or on_move). Or we could think about integrating it with on_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 for alt.selection_interval(bind='scales'). You can use that to get the area the user is currently viewing.

Copy link

To help Streamlit prioritize this feature, react with a 👍 (thumbs up emoji) to the initial post.

Your vote helps us identify which enhancements matter most to our users.

Visits

@jrieke jrieke changed the title Zoom/pan events for charts (st.plotly_chart and st.altair_chart) Zoom/pan events for charts May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants