ChrisDelClea / streamlit-agraph

A Streamlit Graph Vis
MIT License
387 stars 52 forks source link

DuplicateWidgetID Error when re-rendering in loop #36

Closed ym259 closed 1 year ago

ym259 commented 1 year ago

Hi, I'm using clickevent & while loop to re-render the graph as the user selects a node to filter data. With my code, I got DuplicateWidgetID error, which I can normally fix by simply supplying the 'key' to widget. However, I cannot find how I can set the key for agraph, so need help how I could resolve this.


Error details

streamlit.errors.DuplicateWidgetID: There are multiple identical st.streamlit_agraph.agraph widgets with the same generated key.

When a widget is created, it's assigned an internal key based on its structure. Multiple widgets with an identical structure will result in the same internal key, which causes this error.

To fix this error, please pass a unique key argument to st.streamlit_agraph.agraph.


Error I get when I supply a unique key to agraph

TypeError: agraph() got an unexpected keyword argument 'key'