Page 1 of 1

Filter by partition

Posted: 21 May 2016 00:14
by antropoiese
I'm trying to filter a graph by partition using the toolkit 0.9.1.
Running the example (https://github.com/gephi/gephi-toolkit- ... ering.java) the filter by partition does not work.

Code: Select all

//Filter, keep partition 'Blogarama'. Build partition with 'source' column in the data
NodePartitionFilter partitionFilter = new NodePartitionFilter(graphModel.getNodeTable().getColumn("source"), appearanceModel);
partitionFilter.unselectAll();
partitionFilter.addPart("Blogarama");
Query query2 = filterController.createQuery(partitionFilter);
GraphView view2 = filterController.filter(query2);
graphModel.setVisibleView(view2);    //Set the filter result as the visible view
There is something wrong in the query parameters?

many thanx

Re: Filter by partition

Posted: 01 May 2017 12:39
by Odett171993
Try this...

Code: Select all

	PartitionBuilder pb = new PartitionBuilder();
        FilterBuilder[] fb = pb.getBuilders(workspace);
        FilterBuilder filterBuilder = fb[0];
        PartitionBuilder.NodePartitionFilter partitionFilter = (PartitionBuilder.NodePartitionFilter) filterBuilder.getFilter(workspace);
        partitionFilter.unselectAll();
        partitionFilter.addPart("Blogarama");
        Query query2 = filterController.createQuery(partitionFilter);

        GraphView view2 = filterController.filter(query2);
        graphModel.setVisibleView(view2);  

Re: Filter by partition

Posted: 14 Jun 2017 10:18
by seinecle
Very useful thanks!