robert-haas / gravis

Interactive graph visualizations with Python and HTML/CSS/JS.
https://robert-haas.github.io/gravis-docs/
Other
103 stars 8 forks source link

Edge length #9

Open PaschalisAthan opened 1 year ago

PaschalisAthan commented 1 year ago

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 commented 8 months ago

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.