when Itrying to pass some parameters into a callback function I got an error :
import streamlit as st
import plotly.express as px
def _update_session_state(df):
st.dataframe(df)
def plot():
totot="sfsdfg"
df = px.data.iris()
fig = px.scatter(
df,
x="sepal_width",
y="sepal_length",
color="species",
size="petal_length",
hover_data=["petal_width"],
)
event=st.plotly_chart(fig,
key="plotgraph",on_select=_update_session_state,args=(df,))
event
plot()
when I try to select a bubble I got this error :
TypeError: _update_session_state() missing 1 required positional argument: ‘df’
any idea please ?