Question

I'm trying to create a dynamic graph and stream it using the Gephi toolkit. So far, I've followed the toolkit and the streaming plugin tutorials to create a normal graph and stream it to the Gephi GUI.

I'm having a hard time figuring out how to make the graph dynamic - I have managed to add TimeInterval columns to the Node and Edge tables using the AttributeModel but when I open the Timeline window in the GUI, it says that the graph is not dynamic. The models/controllers are a bit confusing to me.

Here's the code that I have right now:

ProjectController pc = Lookup.getDefault().lookup(ProjectController.class);
pc.newProject();
Workspace workspace = pc.getCurrentWorkspace();
AttributeController attributeController = Lookup.getDefault().lookup(AttributeController.class);
AttributeModel attributeModel = attributeController.getModel();
AttributeColumn nodeTimeColumn = attributeModel.getNodeTable().addColumn(DynamicModel.TIMEINTERVAL_COLUMN, AttributeType.TIME_INTERVAL, AttributeOrigin.PROPERTY);
AttributeColumn edgeTimeColumn = attributeModel.getEdgeTable().addColumn(DynamicModel.TIMEINTERVAL_COLUMN, AttributeType.TIME_INTERVAL, AttributeOrigin.PROPERTY);
GraphController graphController = Lookup.getDefault().lookup(GraphController.class);
GraphModel graphModel = graphController.getModel();
DirectedGraph graph = graphModel.getDirectedGraph();

// At this point, I want to make the graph dynamic so that I can use
// the Timeline feature when I stream to the GUI.

StreamingServer server = Lookup.getDefault().lookup(StreamingServer.class);
ServerControllerFactory controllerFactory = Lookup.getDefault().lookup(ServerControllerFactory.class);
ServerController serverController = controllerFactory.createServerController(graph);
String context = "/testing";
server.register(serverController, context);
Was it helpful?

Solution

The Gephi Graph Streaming, in principle, is an alternative to visualize in real time changes in a graph using much less memory than loading a big dynamic graph. So, at each point in time, you don't have the full dynamic graph in memory, but a static graph representing the current state of the graph. That's why, by default, the plugin creates and updates just a static graph.

Unfortunately, updating a dynamic graph using graph streaming is not possible yet. We are planning to support it in a near future, and such operations will be available by changing operations the following class:

https://github.com/gephi/gephi-plugins/blob/graph-streaming/StreamingAPI/src/org/gephi/streaming/api/GraphUpdaterEventHandler.java

As you can see in this file, there's no handling of dynamic attributes; new nodes/edges/attributes are added, changed or removed, but there's no update to dynamic columns.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top