Help with creating a layout plugin

Once it's running
suryanash
Posts:11
Joined:19 May 2016 13:11
[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
Help with creating a layout plugin

Post by suryanash » 19 May 2016 13:22

Hi there,

I have been using Gephi-Toolkit for the past couple of months on a university project to layout some network graphs but now I have been trying to create a modification of the ForceAtlas2 layout. I have tried to fork both the gephi-plugins and gephi-plugins-bootcamp code to start my work however I run into a lot of issues with maven. I am currently trying to work off of the gephi-plugins-bootcamp code, but when I try to run

Code: Select all

mvn clean package
I get the following error:

Code: Select all

Failed to execute goal org.gephi:gephi-maven-plugin:1.1.2-SNAPSHOT:validate (validate-plugin) on project gephi-plugins: Multiple module suites have been found, this is not supported -> [Help 1]
I have tried commenting out the other plugins but then I get other errors. Could someone help me get started with writing my own gephi plugin? I want to start my modification from the existing ForceAtlas2 modification, so my plan was to copy over the implementation in gephi and after identical plugin works to then build upon it.

Thanks,

Surya

User avatar
eduramiba
Gephi Code Manager
Posts:1064
Joined:22 Mar 2010 15:30
Location:Madrid, Spain
[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: Help with creating a layout plugin

Post by eduramiba » 19 May 2016 14:16

Hi,
In your modules section there can be only one module that other modules do not depend on. Also try to use gephi-plugins instead, not sure if the bootcamp is completely updated.

suryanash
Posts:11
Joined:19 May 2016 13:11
[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: Help with creating a layout plugin

Post by suryanash » 19 May 2016 14:55

Thanks, I am trying to work from just the gephi-plugins fork now. I have created my own module (GravityPlugin) now but am having trouble adding in the grid layout code from the bootcamp (the files I downloaded/copy pasted were GridLayout.java and GridLayoutBuilder.java). I have placed the code in the path of ../gephi-plugins/modules/GravityPlugin/src/main/ but initially had them in ../gephi-plugins/modules/GravityPlugin/src/main/java/ but ran into wrong package issues. However I am still unable to to use/see this layout when I run the plugin project.

I am fairly unfamiliar with maven and the structuring of the project as I have only really used POOJ when using Java, so I apologise.

Is there some a guide or another forum post that I should look at on how to get my custom layout set up? I imagine for people with more experience with maven the gephi-plugins-bootcamp should suffice but I found I am finding it hard to replicate.

Thanks,

Surya

User avatar
eduramiba
Gephi Code Manager
Posts:1064
Joined:22 Mar 2010 15:30
Location:Madrid, Spain
[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: Help with creating a layout plugin

Post by eduramiba » 19 May 2016 16:15

You can check how it should be done in the Geolayout plugin, which is working correctly: https://github.com/gephi/gephi-plugins/ ... /GeoLayout

suryanash
Posts:11
Joined:19 May 2016 13:11
[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: Help with creating a layout plugin

Post by suryanash » 19 May 2016 18:17

Ah I see, I have now set up my directories like that. Thanks, I now have no errors in Netbeans. When I run gephi by right clicking gephi-plugins and running it, I can't seem to see the layout listed anywhere. However I can see the plugin when I go to Tools > Plugins in Installed.

User avatar
eduramiba
Gephi Code Manager
Posts:1064
Joined:22 Mar 2010 15:30
Location:Madrid, Spain
[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: Help with creating a layout plugin

Post by eduramiba » 19 May 2016 19:32

Cool, make sure you have a layout builder like https://github.com/gephi/gephi-plugins/ ... ilder.java and is annotated with the @ServiceProvider(service = LayoutBuilder.class) annotation.

suryanash
Posts:11
Joined:19 May 2016 13:11
[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: Help with creating a layout plugin

Post by suryanash » 23 May 2016 11:34

I do have the annotation, however it still was not working so I tried to start using the geo plugin instead of the grid one, however I ended up getting stuck in the same place. Here is my current repo: https://github.com/suryanash/gephi-plugins

Does anything stick out as incorrectly done to you?

User avatar
eduramiba
Gephi Code Manager
Posts:1064
Joined:22 Mar 2010 15:30
Location:Madrid, Spain
[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: Help with creating a layout plugin

Post by eduramiba » 23 May 2016 11:48

Looks fine, are you runing it from your gephi-plugins root folder with this command?

mvn org.gephi:gephi-maven-plugin:run

That or just click Run in Netbeans from the root (gephi-plugins) maven project.

suryanash
Posts:11
Joined:19 May 2016 13:11
[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: Help with creating a layout plugin

Post by suryanash » 23 May 2016 11:54

Okay I will try running it through the console instead, I have been running it through netbeans by running the gephi-plugins project.

When gephi runs, is the plugin layout supposed to appear in the drop down with the other layouts? Also I just realised when I click on Plugins in the menu bar (not Tools > Plugins, just Plugins) nothing happens. Not sure if thats related though.

User avatar
eduramiba
Gephi Code Manager
Posts:1064
Joined:22 Mar 2010 15:30
Location:Madrid, Spain
[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: Help with creating a layout plugin

Post by eduramiba » 23 May 2016 11:57

Yes it should appear in layouts.
The plugins menu is only a place holder for possible plugins, so it's normally empty.

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