I use plotly_chart which fits perfect to the window dimensions as I put in figure a large width. I need to have a on_click callbak to catch everytime a user click a point on the chart.
I have tried using plotly_events but it destroys all figure format, making the graph smaller, no matter what parameters I give it.
Any other way to use streamlit with a graph but with ability to have on_click callback function?
import streamlit as st
import plotly.graph_objects as go
from plotly.subplots import make_subplots
from streamlit_plotly_events import plotly_events
You can try the code below one time as it is as now and one time with st.plotly_chart (in comment below) instead of plotly_events.
You can see there difference. I want plotly_events to be the same as with st.plotly_chart in chart width without cutting it in the middle. How to do it?
also override_width as True/False did not help. I would be happy to any help.
import streamlit as st
import plotly.graph_objects as go
from plotly.subplots import make_subplots
from streamlit_plotly_events import plotly_events
We don’t support chart selections yet but we’re working on it. See my update here. There’s also a prototype you can have a look at to see how it will work. I’ll update that GitHub issue once we are getting closer to a release.