I’d like to let the community know about this new component I’m working on called Streamlit Flow. It is a streamlit component wrapper over the Flow diagram library React Flow.
For some project that I was working on, I needed the ability to create interactive flow diagrams. I had a look at graphviz, but that doesn’t have intractability from what I saw. Barfi looked promising, but it didn’t quite hit the right spot. I came across React Flow, that has an absolutely stunning UI and a lot of interactive capabilities. Turns out that there already exists a streamlit-react-flow component, but it doesn’t have a lot of the features I needed, and is not currently maintained. As such, I decided it was time to get my hands dirty
I think I have made decent progress in porting a lot of the functionality of React Flow into Streamlit Flow, but being the mature and complex ecosystem that React Flow is, a full (or nearly full) port is going to take significant time and effort.
Some features include:
Super fast flow building
Flexible node and edge elements
Built-in layout engine (ElkJS)
Capturing Component Interaction within Python
There are a lot more details in the README file of the repo:
The Component is now available on PyPI. Install it using
pip install streamlit-flow-component
Would love to hear some feedback from the community, to see what direction to drive this project in. Cheers!
I like it a lot! Could you explain how you capture the component interaction within python? I would to launch a function whenever I click on one of the nodes
Hi! You can find the example here: https://stflow.streamlit.app/Interactions#1-getting-interaction-element. The component returns the element id of the element that has been clicked and None if no element has been clicked, or the pane has been clicked. You can use a conditional statement on the return value to trigger the function as required.
Ok thanks, sorry I had missed it. It works very smoothly, thanks for the component!
A feature I’d love is a more complex customization of the nodes, ideally to be able to replace them by images.
But this version is already very cool, I was really looking for this kind of component!
I am planning to build a “Kanban” like app to track workflow, including planning, working in progress, complete, etc. I think Streamlit Flow can be the basic engine.
If you have other suggestions, please let me know.
Tell me that if I need a table, for example, on the left or below of Canvas, in which nodes and connections would be recorded? And when adding the same data to this table - nodes and connections would also appear on the canvas? Were there any ideas to implement this?
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.