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

No points shown for Streamlit 1.42.0 #16

Open
cteeuwendatacation opened this issue Feb 13, 2025 · 2 comments
Open

No points shown for Streamlit 1.42.0 #16

cteeuwendatacation opened this issue Feb 13, 2025 · 2 comments

Comments

@cteeuwendatacation
Copy link

I've upgraded to the latest version of Streamlit, which is 1.42.0

Loading the example from the README gives the following:

import streamlit as st
from streamlit_plotly_events import plotly_events
import plotly.express as px

# Writes a component similar to st.write()
fig = px.line(x=[1], y=[1])
selected_points = plotly_events(fig, key = "i")

# Can write inside of things using with!
fig = px.line(x=[1], y=[1])
selected_points = plotly_events(fig, key = "j")

# Select other Plotly events by specifying kwargs
fig = px.line(x=[1], y=[1])
selected_points = plotly_events(fig, click_event=False, hover_event=True, key = "k")

Image

Is there a way to mitigate this issue?

@ohjho
Copy link

ohjho commented Feb 17, 2025

plotly events are natively supported in streamlit starting from version 1.35:

https://discuss.streamlit.io/t/coming-soon-chart-selections/66544

you can get your points like so:

event_dict = st.plotly_chart(fig, on_select="rerun",selection_mode="points")
selected_points = event_dict['selection']['points']

@cteeuwendatacation
Copy link
Author

plotly events are natively supported in streamlit starting from version 1.35:

https://discuss.streamlit.io/t/coming-soon-chart-selections/66544

you can get your points like so:

event_dict = st.plotly_chart(fig, on_select="rerun",selection_mode="points")
selected_points = event_dict['selection']['points']

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants