This is a test version of Biostars. For the public version, visit https://www.biostars.org.
minimalistic network representation for web page (static image sufficient)

Can someone recommend an easy to use tool for displaying (small) networks on a web page? I don't need anything fancy, it would be totally sufficient to produce a static bitmap image of the network. A dynamic display would also be ok, but it should be light on computing resources and easy to use. I am not a rocket scientist.

The networks that need to be displayed are relavtively small (5-30 nodes maybe) . I don't really care about display style or layout. The list of edges is generated by a program on the fly. Ideally, a program would then convert this file to a network image and display it on the web page (which will also provide some additional information on the nodes in HTML format)

network cytoscape

1 answer

You can generate a plot in R with the igraph package. The tkplot function allows you to manually adjust node position. Here is something to get you started, assuming you have an igraph object G:

coords <- layout_(G, with_fr())  # generate node coordinates with the Fruchterman-Reingold algorithm
tkid <- tkplot(G, layout = coords) # manually adjust nodes in a new window
coords <- tkplot.getcoords(tkid) # obtain new node coordinates
plot.igraph(G, layout = coords) # plot using the manually-adjusted coordinates

For more on how to use igraph for visualization, see this tutorial.

Log in to answer this question.