Open ben-gineer opened 4 days ago
I see if I name the streamlit_flow IDs with the name of the node, then this appears to work, i.e.
descendant_event = streamlit_flow(
"flow_" + stack.iloc[0].StackName,
flow_state,
layout=TreeLayout(direction='down'),
fit_view=True,
hide_watermark=True,
height=700,
get_node_on_click=True
)
How can I ensure I'm not caching the different trees for all the nodes between reloads?
Many thanks for this component. Much more suitable for my needs than the GraphViz one! I have an issue however.
I'm using version 1.5.0.
I have an app that renders a tree structure, based upon a starting node. When it first runs, it renders an entire tree from the root.
Each time the app runs, it recalculates the flow correctly based upon the provided starting node.
The user can then click on a child node, and use that as the new starting node (i.e. I want to render a subtree).
My problem is that when the flow is rendered, it's remembering the nodes from the first call, even though the input flow is correctly only including the subtree. i.e. this code is always rendering the same after the first call:
I've tried clearing the stack_layout from session state - which appears to work OK.
I'm assuming the front-end code is caching something. What's the best way to fix this? I could programatically remove all the existing nodes prior to reloading from a new descendant node - but this seems like a hack.
Many thanks.