Hi,
We are very impressed with Gephi at our company.
We need to write our own modules for Gephi; basically, I need to write a filter and a metric/statistics/visualization.
I have downloaded the Gephi source code and loaded it in NetBeans - I can see all the different modules and open each one I want to look in as a project - no problem.
Say I wish to start writing my own filter, there are 4 modules with the work 'filter' in them:
1. Filters API
2. Filters Impl
3. Filters Plugin
4. Filters Plugin UI
What is the suggested workflow/approach to start extending the filters plugin to do one extra thing?
Thank you,
Warlax.
Writing custom module/plugin
- 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: Writing custom module/plugin
Hi
Welcome here!
Gephi has a modular architecture and therefore features are splitted in separate modules as you can see. Existing filters can be found in the FiltersPlugin and FiltersPluginUI.
For adding a new filter you just add a new module and implement a Filter interface there. First create a new module, it's explained on this page.
I updated the documentation how to create a new filter implementation on the javadoc. See the instructions down. It's not so much for the moment so I can help if you come with some questions.
Once you have written your FilterBuilder and Filter implementations and you declared them with @ServiceProvider it's automatically recognized and your filter will appear in the UI.
Welcome here!
Gephi has a modular architecture and therefore features are splitted in separate modules as you can see. Existing filters can be found in the FiltersPlugin and FiltersPluginUI.
For adding a new filter you just add a new module and implement a Filter interface there. First create a new module, it's explained on this page.
I updated the documentation how to create a new filter implementation on the javadoc. See the instructions down. It's not so much for the moment so I can help if you come with some questions.
Once you have written your FilterBuilder and Filter implementations and you declared them with @ServiceProvider it's automatically recognized and your filter will appear in the UI.
-
- Posts:18
- Joined:19 May 2010 20:45 [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: Writing custom module/plugin
Hi.
I am following your instructions.
Making my own plugin is definitely a better approach than modifying an existing one.
I have two questions:
Question 1: on the Javadoc page it says:
Question 2: on the Javadoc page it says:
Thanks for your help.
Very impressive framework.
I am following your instructions.
Making my own plugin is definitely a better approach than modifying an existing one.
I have two questions:
Question 1: on the Javadoc page it says:
What do you mean by "Set instantiation code in LayoutBuilder.buildLayout()"? Do I need an inner class in my *Filter implementation named LayoutBuilder?4. Create a new class that implements either NodeFilter, EdgeFilter or ComplexFilter. Set instantiation code in LayoutBuilder.buildLayout().
Question 2: on the Javadoc page it says:
So I did that. But here in this message you said:3. Add @ServiceProvider annotation to your builder, that it can be found by the system. Set FilterBuilder as the annotation parameter.
Do you mean the Filter implementation also needs to be annotated with @ServiceProvider? I am looking at the EgoBuilder and EgoFilter classes as examples. The EgoFilter is actually a static inner class inside EgoBuilder and is not annotated with @ServiceProvider. Is it not annotated just because it's inside the Builder class which is annotated? That being said, if I put my Filter implementation in a separate java file, do I need to annotate it?Once you have written your FilterBuilder and Filter implementations and you declared them with @ServiceProvider it's automatically recognized and your filter will appear in the UI.
Thanks for your help.
Very impressive framework.
-
- Posts:18
- Joined:19 May 2010 20:45 [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: Writing custom module/plugin
By the way:
In your guide for creating a filter, you should mention that the Swing Layout Extension integration library wrapper should be added as a fourth dependency for the new plugin.
In your guide for creating a filter, you should mention that the Swing Layout Extension integration library wrapper should be added as a fourth dependency for the new plugin.
- 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: Writing custom module/plugin
Don't pay attention to this sentence, it's a stupid copy-paste mistake...What do you mean by "Set instantiation code in LayoutBuilder.buildLayout()"? Do I need an inner class in my *Filter implementation named LayoutBuilder?
No sorry if I wasn't precise, but only FilterBuilder has to have the @ServiceProvider annotation, as you can observe it with existing filters.Do you mean the Filter implementation also needs to be annotated with @ServiceProvider? I
The EgoFilter is an inner class just because I found it more convenient, you can put your filter in another class, no problem.Is it not annotated just because it's inside the Builder class which is annotated?
To sum up, the builder's role is to create filters. The annotation's role is to say "hey! system...I'm a builder and you can ask me if you need a filter". The system's role is to maintain a list of all builders and ask them to return a filter instance when needed. The filter's role is to filter
-
- Posts:18
- Joined:19 May 2010 20:45 [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: Writing custom module/plugin
Thank you for the quick response.
I am already creating my own filter and am running my build of Gephi to test it out as I write these words.
Another question: is there access to anything like an adjacency matrix for the nodes of the graph?
Adjacency Matrix on Wikipedia:
http://en.wikipedia.org/wiki/Adjacency_matrix
I am already creating my own filter and am running my build of Gephi to test it out as I write these words.
Another question: is there access to anything like an adjacency matrix for the nodes of the graph?
Adjacency Matrix on Wikipedia:
http://en.wikipedia.org/wiki/Adjacency_matrix
- 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: Writing custom module/plugin
Cool!
No that is not possible in the Graph API for the moment. I added it to Ideas.Another question: is there access to anything like an adjacency matrix for the nodes of the graph?
-
- Posts:4
- Joined:06 Apr 2011 10:58
- Location:Paris, France [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: Writing custom module/plugin
Any further development on adjacent matrices topic or it's still an idea to be developed?
If there's no adjacency matrices - there is, probably, no matrices libraries (for eigenvalues computation) attached to Gephi?
Thanks,
Artem
If there's no adjacency matrices - there is, probably, no matrices libraries (for eigenvalues computation) attached to Gephi?
Thanks,
Artem