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

Overlapping nodes Fix #89

Open
anisdismail opened this issue May 6, 2024 · 1 comment
Open

Overlapping nodes Fix #89

anisdismail opened this issue May 6, 2024 · 1 comment

Comments

@anisdismail
Copy link

First of all, kudos on making a very neat and clean library for generating beautiful graphs in python. I have a question regarding my current implementation. I have a weighted raph of node communities, each colored by their community membership. My issue is with the text label I have for every node and its corresponding size, since some of the nodes have different sizes and therefore are overlapping with each other. This is part of the code I am using for the Graph class:
Graph(G,node_labels=node_labels, node_color=node_color, node_edge_width=0, node_layout='community', node_layout_kwargs=dict(node_to_community=unique_total_nodes.set_index("src_idx")["Cluster"].to_dict()), node_label_fontdict=dict(size=7), node_size=node_sizes, edge_layout='bundled',edge_layout_kwargs=dict(k=5000), edge_width=1,edge_alpha=0.1,ax=ax
Is there any way to control the way the nodes "repel" each other? Thank you!

@paulbrodersen
Copy link
Owner

Nodes should not overlap, if at all possible (i.e. if there is enough space given the node sizes). In the community layout, nodes are grouped together within a community-reserved sub-region of the canvas, so this layout runs out of space much quicker than others. So this may be the issue, but it is difficult to know without access to the data. Could you

  1. show what the figure currently looks like, and
  2. upload the data required to construct the graph?

The latter could be done in two CSV files:

a) The edge list (columns: source, target), and
b) the node properties (columns: node ID, node label, cluster, node size).

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

No branches or pull requests

2 participants