Search code examples
javascriptjavad3.jswebsocketgraphstream

GraphStream: Interactive Web Application


I'm trying to develop an interactive web application using GraphStream. The idea is to run a couple of community detection algorithms on graphs and visualize them. I wish to use D3.js as graph rendering framework and use GraphStream library in a java websocket server ( Tomcat ) that runs the algorithms. I wish to know if GraphStream already has websocket capabilities that could directly talk to client ( browser ) websocket endpoint. Suggestions for a more correct or feasbile architecture are also welcome.


Solution

  • Great idea. There is a WebSocket implementation that provides GraphStream's event model to the browser. It implements a network protocol, GS-NetStream.

    The actual version is compatible with gs-core v1.3.

    You can run the exemples from the test/ folder.

    In the test folder, run these commands in that order:

    1. Install dependencies : npm install ws express
    2. Compile the Test1.java with gs-core-1.3 in the classpath: javac -cp path/to/gs-core-1.3.jar:. Test1.java
    3. Run the node server : node Test1server.js
    4. Run the Java app :java -cp path/to/gs-core-1.3.jar Test1
    5. go to http://localhost:8080/Test1.html
    6. Use the code in Test1.html as an example for your project