ChrisDelClea / streamlit-agraph

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

Click events #27

Closed TudorAndrei closed 2 years ago

TudorAndrei commented 2 years ago

Hi.

Is there a way of selecting a node and then use the information saved in it to display it in another streamlit container?

I see that in the AgraphComponent.tsx there is onClick functionality but how would this be used, and where would the contents be saved?

ChrisDelClea commented 2 years ago

Hi @TudorAndrei ,

you can have a return value from the AgraphComponent.tsx and receive it in the init.py and pass it back from the component. However, you'd have to implement the functionallity yourself. Does that help?

Best regards Chris

ChrisDelClea commented 2 years ago

@TudorAndrei, made some major update. You get the id of the element back with return_value = agraph(nodes, edges, config=config). If this is the kinda information you are talking about, you can than use the id as you wish.

TudorAndrei commented 2 years ago

@TudorAndrei, made some major update. You get the id of the element back with return_value = agraph(nodes, edges, config=config). If this is the kinda information you are talking about, you can than use the id as you wish.

This is what I was looking for. Tyvm

mayurankv commented 3 months ago

Is it possible to also have click events for edges?