Plotly click events in streamlit

I am using streamlit library for simple dashboard. Is it possible to use plotly click events in streamlit. Is there any other way to get click events on bar chart, scatter plots, etc, in streamlit?

The code that i tried :

import plotly.graph_objects as go
import streamlit as st
import numpy as np

def update_point(trace, points, state):
print(trace, points, state)

def main():
np.random.seed(1)
x = np.random.rand(10)
y = np.random.rand(10)
f = go.FigureWidget([go.Scatter(x=x, y=y)])
s = f.data[0]

st.plotly_chart(f)
s.on_click(update_point)

if name == ‘main’:
main()

1 Like

Hi @sandesh_more

That kind of interactivity is currently not supported. See https://github.com/streamlit/streamlit/issues/455

Thanks for the reply.