dkapur17 / streamlit-flow

Streamlit Component to quickly create Interactive Flow Diagrams using React Flow
https://stflow.streamlit.app
52 stars 6 forks source link

Feature Request - Custom Node Properties #5

Closed ttinh closed 1 week ago

ttinh commented 4 weeks ago

Hello,

Great project and awesome work. I'm very happy with this component and have had a lot of fun playing around with it.

One feature I'd love to see is the ability to define custom properties (in addition to the node_name, node_type) for a Node and the EditNode Component. Wondering if there are any workarounds other than modifying the frontend component.

dkapur17 commented 3 weeks ago

Hey @ttinh. Thanks. You can store custom node properties on the data attribute of the node next to the label property. For example, StreamlitFlowNode(id='1', pos=(100, 100), data={'label': 'Node 1', 'att1': 'att1 value', 'att2': 'att2 value'}). However, there is no way to add/edit this value using the edit node modal. It can only be done from within Streamlit.