polm23
polm23

Reputation: 15621

How to send data to Streamlit from Javascript?

I embedded a bokeh chart in Streamlit and I'd like to be able to select points from it and send them to the Streamlit backend. I can add a JS click handler to the Bokeh chart and it works, but I can't figure out a way to get the information back to Streamlit.

I tried setting the value of a text_input made with Streamlit, but it doesn't trigger any events. The text shows up, but if I click on the input then it goes away.

Is there some way I can send a message to the Streamlit backend from JS?

Upvotes: 2

Views: 2179

Answers (1)

Thiago Teixeira
Thiago Teixeira

Reputation: 46

I just answered this on the Strealit forums, but I'll post the answer here too :D

Right now it’s not possible to grab data like selected points from a chart in a Streamlit app. We’re actually working right now on an API design to support that, but my guess is it will be a couple of months before we’re able to release it.

If you’d like to follow the progress on this work, please subscribe to the issue here: https://github.com/streamlit/streamlit/issues/455

Upvotes: 3

Related Questions