Streamlit Component Wrapper for React Flow
Project description
Streamlit Flow
Build beautiful, interactive flow diagrams: Powered by React Flow, Simplified by Streamlit.
🎉 Version 1.0.0 is out now! 🎉
While originally, Streamlit Flow was intended to be a way to visualize static flow diagrams, with limited interactivity (like moving nodes around, panning and zooming), it seemed like a wasted opportunity.
Streamlit Flow Version 1.0.0 introduces a significant re-engineering of the library, which allows state management within the component itself, allowing you to not just visualize flows, but create them from within the canvas itself! Added features include:
-
Overhauled State Management: The component now manages the state of the flow diagram automatically. As such, it keeps track of changes to node positions, connections, and more.
-
Pane Context Menu: Right-clicking on the canvas now opens a context menu, allowing you to add new nodes or reset the layout.
-
Node Context Menu: Right-clicking on a node now opens a context menu, allowing you to edit or delete the node.
-
Edge Context Menu: Right-clicking on an edge now opens a context menu, allowing you to edit or delete the edge.
-
Way more Layouts: The layouts are now more extensive, including Tree, Layered, Force, Stress, Radial, Random and Manual. One can also make a custom layout by inheriting from the
Layout
class. -
Hackable Python State: The primary state management is done within the component, and the state can be read by Python. This is the intended usage. However, while not recommended, it is possible to modify the state from Python as well if the user wishes to.
A demo for all these features can be found here.
Installation
pip install streamlit-flow-component
Running the example
Install the dependencies
git clone https://github.com/dkapur17/streamlit-flow.git
cd streamlit-flow
npm install --prefix streamlit_flow/frontend
Run the frontent
On the first terminal, run from the root of the repository
cd streamlit_flow/frontend
npm start
Run this Example Streamlit App
On the second terminal, run from the root of the repository
streamlit run example.py
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for streamlit-flow-component-1.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | af14452ef3ff2e387192a8ae02a3b98813a8ce41f6871dcde8cfef7df9e73495 |
|
MD5 | b3a21392a5e0eb1fbc851d59d96929f2 |
|
BLAKE2b-256 | a8ccfa3346addd2073f9273f57f201b7bd07f7c954b9af98e576130b32366423 |
Hashes for streamlit_flow_component-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d1829821d9dc49d89fa355ec78e79c1740ccda49e30280ce1a97cc2f3a7eaf51 |
|
MD5 | a78b37f10c7cf633970eaa85dc330f76 |
|
BLAKE2b-256 | 86744a0ad694d1a4d56a546bc2e29af57660971af44dfba5537baa42a10f34ca |