javascriptgraphvis.jsvis.js-network

Is there a way to build an interactive node graph in JavaScript?


I'm looking to build an interactive node graph on a webpage where you can add nodes with various inputs and outputs and connect them together.

This is an example of what I'm looking to do:

enter image description here

I started to play around with vis.js but I'm not sure it will be able to do the above.

Any suggestions would be appreciated!


Solution

  • Generally, such broad questions in form of "is it possible to ...?" are frowned upon at StackOverflow, but the direct answer would be "yes, it is possible" and moreover, vis.js has an example of a manipulatable graph so I recommend you to read the manupulation methods docs and the manipulation module docs which describe methods like addNode, editNode, deleteNode etc.

    However, you should note that all the interfaces are usually implemented outside the graph-containing canvas, in html (+js) because it's not trivial to put them inside canvas and, say, show attached to all nodes.