How to draw a shape on a graph?

Please use a mailing-list, see http://gephi.org/developers/
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
julietzhang
Posts:4
Joined:08 Mar 2012 06:38
[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
How to draw a shape on a graph?

Post by julietzhang » 08 Mar 2012 08:28

I want to draw some shapes on a graph by editing the source code.
Where can I find the class that generates the canvas of graph?

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: How to draw a shape on a graph?

Post by eduramiba » 08 Mar 2012 13:48

Hi,
While you can't extend the OpenGL graph visualization (that is VisualizationModule) with plugins, you can create new renderers for Preview visualization.

Check this http://wiki.gephi.org/index.php/HowTo_w ... w_renderer and some examples https://github.com/gephi/gephi-plugins-bootcamp
Also the default renderers are in Preview Plugin module.

Eduardo

julietzhang
Posts:4
Joined:08 Mar 2012 06:38
[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: How to draw a shape on a graph?

Post by julietzhang » 09 Mar 2012 03:14

Thanks, but I need to draw some shapes under overview perspective...

Is there anyway to get the canvas that those nodes on under overview perspective?

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: How to draw a shape on a graph?

Post by eduramiba » 09 Mar 2012 22:30

Sorry that is not possible. But you always can modify VisualizationModule to draw what you need even though there is no plugin support.

Eduardo

julietzhang
Posts:4
Joined:08 Mar 2012 06:38
[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: How to draw a shape on a graph?

Post by julietzhang » 10 Mar 2012 10:09

So, I can draw on the graph same with those nodes on?
I first try to get the "drawable" by using VizController.getInstance().getDrawable() and then using drawable.getGL() get the GL, draw a triangle on it but nothing shown up.
So, how can I draw?

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: How to draw a shape on a graph?

Post by eduramiba » 11 Mar 2012 17:29

Well remember that if you customize Visualization module you are making a fork of it, not plugins, and the module is quite complex.
About the GL, you can't just retrieve it and use it for drawing anywhere. Looking at the code, I think you should implement your extra graphics at display method of org.gephi.visualization.opengl.compatibility.CompatibilityEngine class.

Eduardo

julietzhang
Posts:4
Joined:08 Mar 2012 06:38
[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: How to draw a shape on a graph?

Post by julietzhang » 12 Mar 2012 10:09

Thanks a lot. :D
Can you tell me the process, the functions it calls, that when an edge is drawn on the graph? Just the visualization part is OK.

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: How to draw a shape on a graph?

Post by eduramiba » 12 Mar 2012 17:01

You will need to know at least some OpenGL to add new graphics.
It uses JOGL which is simply java bindings to it.

Eduardo

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