Custom widgets development

Hi, today I stumbled upon Streamlit and it looks decently rad! Well done!

I also peaked into its source code a little and get that the state is synced using protobufs between the backend and the frontend. However I wonder how easy it is to create my own widgets.

What I would like to try is integrating a Bokeh widget that can provide information about events that happen in the plot like panning/zooming/clicking etc.

I’m using Bokeh/Holoviews rather extensively at my organization and have quite a few data intensive plots to do that requires lazy loading data when the plot is panned, otherwise the browser will crash because of too much memory usage.

Is there any documentation on how the widgets work internally where I could start when trying this?
Or if there is no documentation, is there any chance to get the JS pipeline for compiling the react components running easily for widgets that are not part of the core?

Thanks already, I’m really intrigued to play more with the project.

1 Like

Hi @gregmuellegger. Welcome to the community!

This document shows you how to build Streamlit from scratch, including compiling all the React etc. I’m don’t there’s much documentation beyond that but you can feel free to ask here!

Also, we are in the early stages of designing a plug-in architecture for Streamlit. To help solicit community feedback, I created this issue. Please feel free to follow or comment with thoughts or requirements.

Hope that helps. Please feel free to reach out with further questions.

2 Likes

+1 on propagating clicks/events from graphs.

1 Like

There is now a hack showing how to create custom widgets at awesome-streamlit.org.

See Awesome-streamlit.org Change Log

1 Like