Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JavaScript network visualization?

I'm looking for a library to visualize a network.

I just need to add some nodes(node has text on them), add edges between them, (edges are directed and have text on them).I don't want to set the position of anything by hand.

I'd like API simple as:

var node1 = X.addNode(1, "Hello"),
    node2 = X.addNode(2, "World");
X.addEdge(node1, node2, "helloworld");

I've searched for hours, looked after arborjs, sigma.js, d3.js, JavaScript InfoVis Toolkit, none of them satisfied me.

Is there anything else I can try?

like image 518
wong2 Avatar asked Jun 04 '12 18:06

wong2


3 Answers

We produce mxGraph, but note this is a commercial library, not open source. I'm not sure exactly why the open source libraries you listed failed, but certainly forming the graph, setting the geometry and labels are all fairly trivial function calls.

like image 43
Thomas the Tank Engine Avatar answered Oct 11 '22 13:10

Thomas the Tank Engine


Check out VivaGraphJS.
Amazon Visualization sample by VivaGraphJS.

Layout configuration sample, uses WebGL as a renderer.

like image 147
Li0liQ Avatar answered Oct 11 '22 14:10

Li0liQ


What's the problem with sigma.js? The library's website has a very simple example to draw the nodes and edges:

var sigRoot = document.getElementById('sig');
var sigInst = sigma.init(sigRoot);
sigInst.addNode('hello',{
label: 'Hello',
color: '#ff0000'
}).addNode('world',{
label: 'World !',
color: '#00ff00'
}).addEdge('hello_world','hello','world').draw();
like image 41
Aerodynamika Avatar answered Oct 11 '22 15:10

Aerodynamika