Hi,
I was wondering if it was programmatically possible (e.g. without user interaction) to apply a layout to a pruned graph (post-filtering) to order the nodes?
More specifically, my filter is similar to the ego filter but displays all nodes 0, 1, 2, and to the 'depth' setting away from the ego node - it also color codes each node and edge with a color according to the distance from the ego node.
Given this filter, is there a layout I could use to center the ego node and put all of its 1st degree neighbors in a circle around it, all of its 2nd degree neighbors in a circle around the first circle etc?
Also, after it is done and the user depresses the filter button to return to the regular view, where can I put code to reset the colors and positioning (layout) of the nodes so they return to the original view?
Maybe I am getting this all wrong and I should just export my filtered graph to a second view or workspace somehow? Can this be done programmatically? How do you do this via user interaction?
Thank you.
Displaying filtered nodes in certain layout
- 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: Displaying filtered nodes in certain layout
Yes that is possible. When you execute your filter through the FilterController and the filterVisible method the pruned graph is set as the current visible view. That has the consequence to become the graph currently visualized but also to become the graph that will be used when layout is executed.I was wondering if it was programmatically possible (e.g. without user interaction) to apply a layout to a pruned graph (post-filtering) to order the nodes?
There is no layout such that in Gephi, but it would be something similar to Radial Layout like below. It would be nice to implement this layout in Gephi, we can help you to do such a plugin.Given this filter, is there a layout I could use to center the ego node and put all of its 1st degree neighbors in a circle around it, all of its 2nd degree neighbors in a circle around the first circle etc?
Ah I think I understand better what you want to achieve. it is basically a better integration of the Ego (or your alternative) filter. In a way its easy to have the global and the local view. In that case what I would do is create a plugin that adds a new menu item when users right-click on a node and do everything from there. The action would asks the filter controller to filter and the layout controller to layout (or layout directly without the help of the controller). When done with this view, the user would right-click on the graph window and the menu would propose to "go back" to the unfiltered view. As the action would command the filter controller properly, users could change filter settings. What do you think ?Maybe I am getting this all wrong and I should just export my filtered graph to a second view or workspace somehow? Can this be done programmatically? How do you do this via user interaction?
Currently there is no interface to extend the window right-click but it's something I could add quickly if needed.
-
- 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: Displaying filtered nodes in certain layout
Mr. Bastian,
Thank you very much for that informative reply.
I can tell that you're a passionate developer that truly cares about his project.
The radial layout does not exist? How was that screenshot taken? If it doesn't exist, would you give a few pointers to get me started on creating it?
Although the right-click feature would be nice, it is easier to find the ego node in a label/id list then to look for it using the mouse - so the answer is no, don't bother implementing anything for us - you are already busy enough and doing a great job.
As for my question, it looks like there is no programmatic way of applying a layout to a pruned graph.
You said:
Thank you very much for that informative reply.
I can tell that you're a passionate developer that truly cares about his project.
The radial layout does not exist? How was that screenshot taken? If it doesn't exist, would you give a few pointers to get me started on creating it?
Although the right-click feature would be nice, it is easier to find the ego node in a label/id list then to look for it using the mouse - so the answer is no, don't bother implementing anything for us - you are already busy enough and doing a great job.
As for my question, it looks like there is no programmatic way of applying a layout to a pruned graph.
You said:
But there is no way to execute a layout from code, is there? Maybe there is if there exists a LayoutController similar to the FilterController you mention.Yes that is possible. When you execute your filter through the FilterController and the filterVisible method the pruned graph is set as the current visible view. That has the consequence to become the graph currently visualized but also to become the graph that will be used when layout is executed.
- 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: Displaying filtered nodes in certain layout
No the Radial Layout doesn't exist, I found this picture on internet. That would be cool you work on this layout implementation. Follow the HowTo for creating the layout plugin.The radial layout does not exist? How was that screenshot taken? If it doesn't exist, would you give a few pointers to get me started on creating it?
On the picture I put, the graph is a tree, it's a good approach at first I think. You can find implementation of such a layout on the web, for instance on JUNG, Prefuse. JUNG has a nice demo of it here.
Yes there is a LayoutController. On the second page on this thread I give an example how to execute layout from pluginBut there is no way to execute a layout from code, is there? Maybe there is if there exists a LayoutController similar to the FilterController you mention.