gravis
gravis copied to clipboard
Edge length
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.
Any reason why this is happening?