You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to filter a graph by node degree using the toolkit 0.9.1.
The number of nodes is ok after filtered, but after exporting the graph, I can find the filtered nodes in the gexf file.
So how I can output the filtered graph?
Thanks.
GraphModel graphModel = Lookup.getDefault().lookup(GraphController.class).getGraphModel();
FilterController filterController = Lookup.getDefault().lookup(FilterController.class);
DegreeRangeFilter degreeFilter = new DegreeRangeFilter();
degreeFilter.init(graphModel.getGraph());
degreeFilter.setRange(new Range(1, Integer.MAX_VALUE)); //Remove isolated nodes
Query query = filterController.createQuery(degreeFilter);
GraphView view = filterController.filter(query);
graphModel.setVisibleView(view); //Set the filter result as the visible view
// See if graph is well imported and filtered
graph = graphModel.getDirectedGraphVisible();
System.out.println("Nodes: " + graph.getNodeCount()); // number of nodes is ok after filtered
System.out.println("Edges: " + graph.getEdgeCount())
ExportController ec = Lookup.getDefault().lookup(ExportController.class)
ec.exportFile(new File(outputFile)) ; // filtered nodes is still in outputFile
The text was updated successfully, but these errors were encountered:
ZhitongLei
changed the title
How I can output the filtered graph using the toolkit 0.9.1
How can I output the filtered graph using the toolkit 0.9.1
Oct 16, 2016
I'm trying to filter a graph by node degree using the toolkit 0.9.1.
The number of nodes is ok after filtered, but after exporting the graph, I can find the filtered nodes in the gexf file.
So how I can output the filtered graph?
Thanks.
The text was updated successfully, but these errors were encountered: