Enhancement of https://github.com/panisson/pygephi_graphstreaming to make a simple Graph Stream Server.
Main change is to use Flask Framework instead of the low-level Python to manage HTTP Streams.
When the server receive a stream event , it will broadcast this event to all current Gephi Client connected.
- Python
- See req.txt for libraries
Git clone the project or Download it.
Run python graphStreamServer.py
.
The default configuration bind to 0.0.0.0:5000. The server should be accessible as :
http://localhost:5000/
: Good for testhttp://<yourIP>:5000/
: Good to share across same networkhttp://<hostname>:5000/
: Good to share acress internetAdapt examples bellow to your situation.
You already have the Graph Streaming Plug-in installed in Gephi.
You already started a Graph Stream Server on at http://localhost:5000/
In the Streaming tab, click-right on Client and choose Connect to Stream.
On source Url, put http://localhost:5000/stream and click Ok.
On the Streaming tab, you should see your Url with a Green Point.
The server by itself isn't generating any data. It exposes Web Services that can be used to send graph data that will be broadcasted to all current listeners.
Because it's based on REST web service, there is no restriction about the language, as long as it can handle HTTP Request .
Full description of data format : https://wiki.gephi.org/index.php/Graph_Streaming
This service is a wrapper of the http://localhost:5000/action
service to automatically handle the action overhead directly on the service. It makes the data to send more accessible.
- Url Parameter
<actionToPerform>
an
: Add Nodecn
: Change Nodedn
: Delete Nodeae
: Add Edgece
: Change Edgede
: Delete Edge
Request Data :
{"<entityID>":
{
"<property1>":"<stringValue>",
"<property2>":<numericValue>,
[....]
}
}
Example : Add a node with id "Node A"
- Url:
http://localhost:5000/an
- Data:
{"Node A":{"label":"Node A"}}
This service is more close to the original streaming behaviour.
Request Data :
{"<actionToPerform>":
{"<entityID>":
{
"<property1>":"<stringValue>",
"<property2>":<numericValue>,
[....]
}
}
}
Example : Add a node with id "Node A"
- Url:
http://localhost:5000/action
- Data:
{"an":{"Node A":{"label":"Node A"}}}
Endless possibilites of advanced Pub/Sub mechanism with Redis or RabbitMQ coupled with the Graph Stream Server (tested with Redis and works perfectly).
Possibility to plug it into a Web Socket / WAMP.ws mainly to dispatch to web browser.
Security enhancement, History when (re)connected, etc ...
Did not perform any " Scaling / Stress Test ". Let's organise a worldwide test one day.