Appending Graph/Merging Tables

Extensions and customization
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
robmctague
Posts:4
Joined:09 Aug 2010 12:33
[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
Appending Graph/Merging Tables

Post by robmctague » 09 Aug 2010 12:42

Hi,

I'm trying to customize some features of Gephi and am having a little difficulty with some aspects of the loading of a graph and/or the merging of tables.

I wish to append a loaded graph onto a workspace that already has a graph. I've been trying to use this:
importController.process(container, processor, workspace);
but so far I've only been able to get the graph loaded into a new workspace, not appended to the original.

An alternative I've been trying is to load the second graph into the Container and then take the attribute table from it, and merge it with the other attribute table for the already loaded graph, using this:
AttributeModel BPAttributeModel = container.getUnloader().getAttributeModel();
AttributeTable[] BPTables = BPAttributeModel.getTables();
attributeModel.getTables()[0].mergeTable(BPTables[0]);

While this successfully adds new columns to the original attribute table, all of the new columns are empty, i.e. they contain no values.

Any ideas on where I'm going wrong here?

Rob

User avatar
mbastian
Gephi Architect
Posts:728
Joined:10 Dec 2009 10:11
Location:San Francisco, CA
[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: Appending Graph/Merging Tables

Post by mbastian » 10 Aug 2010 13:32

Hello,

did you try to use the append processor?

Code: Select all

importController.process(container, new AppendProcessor(), workspace);
This processor uses elements ids to merge with old elements. It should be fine merging new columns and values with existing elements. If not it could be a bug...

robmctague
Posts:4
Joined:09 Aug 2010 12:33
[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: Appending Graph/Merging Tables

Post by robmctague » 10 Aug 2010 14:29

Just tried that now, works perfectly!

Thanks for the help.

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