dkapur17 / streamlit-flow

Streamlit Component to quickly create Interactive Flow Diagrams using React Flow
https://stflow.streamlit.app
MIT License
124 stars 12 forks source link

Updating the streamlit flow state and visualisation #24

Open julienbaj-marshmallow opened 1 month ago

julienbaj-marshmallow commented 1 month ago

Hello,

I am using the streamlit-flow package. When I first run my streamlit app, I can see a nice layout, the nodes are visualised properly in a layered layout. Once I change a parameter in my streamlit python code (i.e. I re-run the python script), I would like to reset and re-run the visualisation to update the nodes and edges. For context, a change in the parameter means a change in the data and the nodes are dynamically created based on the data. I managed to find a way to reset the nodes and edges to match the "new data" but the nodes are all on top of each other, i.e. the layout does not work.

Is there any way to reset the layout with new nodes and edges or force the visualisation to update the layout?

Thank you very much

dkapur17 commented 1 month ago

Hey @julienbaj-marshmallow. Could you share some sample code? I'd like to understand how you're going about passing new arguments to the component.