我正在尝试创建一个动态图并使用 Gephi 工具包对其进行流式传输。到目前为止,我已经按照工具包和流插件教程创建了一个普通图并将其流式传输到 Gephi GUI。
我很难弄清楚如何使图表动态化 - 我已经设法使用 将TimeInterval
列添加到节点和边缘表,AttributeModel
但是当我在 GUI 中打开时间轴窗口时,它说图表不是动态的。模型/控制器让我有点困惑。
这是我现在拥有的代码:
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);