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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

netwulf visualize ignores edge colors #45

Open
dbau-igenomix opened this issue Sep 11, 2020 · 4 comments
Open

netwulf visualize ignores edge colors #45

dbau-igenomix opened this issue Sep 11, 2020 · 4 comments

Comments

@dbau-igenomix
Copy link

Hi,

When I create a graph from pandas as:
G = nx.from_pandas_edgelist(df, "node1", "node2", edge_attr=['weight', 'color'])

Properties are correctly set, e.g.:
('node1', 'node2', {'weight': 0.01, 'color': 'red'})

However, when running:
network, config = visualize(G, port=port)

the weight attribute is correctly visualized, but the color one is not (all edges are grey).

How can I get around this issue?

Thanks,
Davide

@benmaier
Copy link
Owner

Hi, netwulf does not support individually colored edges in the interactive version atm. It does for the reproduced figure though, see https://netwulf.readthedocs.io/en/latest/reference/tools.html#netwulf.tools.draw_netwulf.

You could produce a positions and layout in the interactive session and then pass the color attribute to the links in the returned visualized network. Here's an example of the stylized network's data structure: https://netwulf.readthedocs.io/en/latest/python_api/post_back.html

You could inject the color attribute into the entries in stylized_network['links'] before redrawing with matplotlib.

@dbau-igenomix
Copy link
Author

Hi,

Thanks for the quick reply.

Davide

@ulfaslak
Copy link
Collaborator

This is a reasonable feature request. I think we will implement in the next version of Netwulf.

@dbau-igenomix
Copy link
Author

Great news!

Thanks a lot,
Davide

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants