Filter by partition

Visual manipulations and refinements
Post Reply [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
antropoiese
Posts:1
Joined:21 May 2016 00:01
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
Filter by partition

Post by antropoiese » 21 May 2016 00:14

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

Odett171993
Posts:2
Joined:05 Apr 2017 12:46
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: Filter by partition

Post by Odett171993 » 01 May 2017 12:39

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);  

User avatar
seinecle
Gephi Community Support
Posts:546
Joined:08 Feb 2010 16:55
Location:Lyon, France
Contact:

Re: Filter by partition

Post by seinecle » 14 Jun 2017 10:18

Very useful thanks!

Post Reply
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable