0
$\begingroup$

I want to visualise a network in a way that the nodes are along a line (and the edges are not on that line). I have included a simple example below.

Network on a line

Which network visualisation programs (Cytoscape, Gephi, R igraph etc) do have this layout option?

$\endgroup$

2 Answers 2

2
$\begingroup$

That plot is called an Arc diagram you can google that and use the package or program that best suits you.

Here are 2 examples of the use of Arc diagrams in R:
Example 1: enter image description here

Example 2: enter image description here

$\endgroup$
2
$\begingroup$

I'm the author of gravis, an open source package for interactive network visualization in Python. It supports many ways to influence visual properties with data, such as node size, color or location. It also allows to control edge curvature. Therefore it's possible to place all nodes along a line (or another form) and have edges with a chosen degree of curvature between them.

Edit: Python code that reproduces your image with NetworkX and gravis

import gravis as gv
import networkx as nx

g = nx.Graph()
g.add_node(1, x=0, y=0)
g.add_node(2, x=50, y=0)
g.add_node(3, x=100, y=0)
g.add_node(4, x=150, y=0)
g.add_edge(1, 2)
g.add_edge(1, 3)
g.add_edge(3, 4)
g.graph['node_color'] = 'blue'
g.graph['node_size'] = 15
gv.d3(g, edge_curvature=1.5, show_node_label=False)

Result inside a Jupyter notebook (optional, just for convenience): enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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