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
Appending Graph/Merging Tables
-
- 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
- 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
Hello,
did you try to use the append processor?
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...
did you try to use the append processor?
Code: Select all
importController.process(container, new AppendProcessor(), workspace);
-
- 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
Just tried that now, works perfectly!
Thanks for the help.
Thanks for the help.