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

Edge length #9

Open
PaschalisAthan opened this issue Apr 27, 2023 · 1 comment
Open

Edge length #9

PaschalisAthan opened this issue Apr 27, 2023 · 1 comment

Comments

@PaschalisAthan
Copy link

I am trying to create a network graph with different edge length. However, the edge length is not changing.
My code:

G = nx.Graph()
for i in range(df.shape[0]):
    G.add_node(df.iloc[i,0], size=20, group='Compound', color='purple')
    G.add_node(df.iloc[i,1], size=14, group='Target', color='red')
    G.add_edge(df.iloc[i,0], df.iloc[i,1], weight=df.iloc[i,3])
figure = gv.d3(G, graph_height=1000, zoom_factor=1.5, show_details=False, show_details_toggle_button=False, show_menu = False, show_menu_toggle_button=True, node_hover_neighborhood=True, show_node_label=True, layout_algorithm_active=True)

I also tried using length instead of weight.
Example
Any reason why this is happening?

@MrTomKimber
Copy link

TypeError: d3() got an unexpected keyword argument 'edge_length'

So the d3 layout api doesn't appear to have the ability to individually set edge length.

I think adding such a capability would significantly usage and layout options and I would be interested in seeing something similar.

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