0
$\begingroup$

I want to draw directed graphs using networkx, followed by manual tuning of the visualization with the use of NETWOLF.

Here is the example of a network.

G =nx.DiGraph()
G.add_edges_from([(1, 2), (1, 3),(1, 4),(2, 3)])
network, config = nw.visualize(G,config={'zoom':3})

However, the graph shown in NETWOLF was undirected graph.

enter image description here

Do you know if you can style network visualizations of directed graphs using NETWULF?

$\endgroup$

1 Answer 1

3
$\begingroup$

I'm the author of gravis, an open-source package for interactive graph visualization in Python. It allows to draw directed graphs from NetworkX and the resulting visualization can be modified by user interaction (e.g. node positions, edge curvature and various other visual properties).

Here's a minimal example based on your code:

import gravis as gv
import networkx as nx

g = nx.DiGraph()
g.add_edges_from([(1, 2), (1, 3), (1, 4), (2, 3)])
gv.d3(g)

Output: NetworkX DiGraph visualized with gravis inside a Jupyter notebook: enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.