ChrisDelClea / streamlit-agraph

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

Allow to pass key to an agraph #53

Open mojzis opened 5 months ago

mojzis commented 5 months ago

when I create 2 agraphs on a page, streamlit complains:

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`.

but trying to do so ends up in an Uncaught app exception - TypeError: agraph() got an unexpected keyword argument 'key'

can we please allow agraph to accept the key argument ? does it make sense to have 2 agraphs on a page ?

ChrisDelClea commented 4 months ago

This is currently not a supported feature. However, if you find a way to pass a key, feel free to make a pull request!