Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow passing node labels to visualize_graph #8770

Open
vahanhov opened this issue Jan 15, 2024 · 1 comment
Open

Allow passing node labels to visualize_graph #8770

vahanhov opened this issue Jan 15, 2024 · 1 comment
Labels

Comments

@vahanhov
Copy link
Contributor

vahanhov commented Jan 15, 2024

馃殌 The feature, motivation and pitch

Graph visualisation takes node labels from edge_index and doesn't allow replacing them with text names. This is limiting and easy to improve by adding a node_labels argument to torch_geometric.visualization.graph.visualize_graph().

Alternatives

This could also be solved by allowing string node indexes in edge_index, but that requires too much effort playing with Torch.Tensor types.

Additional context

This would be particularly useful for explain.Explanation.visualize_graph(), to help identify the nodes in the explanation graph.

I am happy to open a PR with these changes, if I am granted an appropriate permission.

@rusty1s
Copy link
Member

rusty1s commented Jan 17, 2024

Related PR: #8743

rusty1s added a commit that referenced this issue Jan 29, 2024
Addresses #8770

Note that these are used only with graphviz backend.

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: rusty1s <matthias.fey@tu-dortmund.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants