Hello everyone, im using streamlit agraph to visualize my graph, but i want add for each node in the graph a hyperlink where when i double click on it a new web page is opened, is there a way to make it possible?

If you’re creating a debugging post, please include the following info:

  1. Are you running your app locally or is it deployed?
  2. If your app is deployed:
    a. Is it deployed on Community Cloud or another hosting platform?
    b. Share the ink to the public deployed app.
  3. Share the link to your app’s public GitHub repository (including a requirements file).
  4. Share the full text of the error message (not a screenshot).
  5. Share the Streamlit and Python versions.

Hi @Yazeed_Mohammed :wave:

Could you try adding hyperlinks to nodes by adding a URL attribute to each node’s metadata?

Best,
Charly

A link to your repo would also help, if that’s something you could share with us.

Thank you,
Charly

i couldnt find a parameter called metadata in the node function

Thanks for sending the code, @Yazeed_Mohammed! :pray:

To enable the functionality where double-clicking a node in your graph opens a new webpage, you’ll likely need to incorporate JavaScript handling. Since Streamlit does not support adding JavaScript directly due to its sandboxed nature, and streamlit-agraph does not out of the box handle double-click events for opening URLs, you might need to modify the component to achieve this.

You may want to reach out to the creator of streamlit-agraph, @chris_klose, to discuss the possibility of adding this feat, or perhaps consider adding it yourself if you’re comfortable with JavaScript! :wink:

Best,
Charly

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.