[SOLVED] Initial layout

Algorithms and parameters to put data in space
WACMemphis
Posts:10
Joined:07 Oct 2011 13:24
[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
[SOLVED] Initial layout

Post by WACMemphis » 07 Oct 2011 13:29

Hi,

I'm trying to achieve the following: I have 4 files containing the same graph, but with different labels for the nodes (different clustering).
I want to import them, color them according to labels and export to pdf. Problem is the initial layout. It's always different. Thus, I'm not able to get all graphs (which are the same) in the same layout. So the resulting images aren't comparable.

Is there a possibility to change the initial layout to use the same random seed? If you could tell me which class does the initial layout, maybe I would be able to change it myself.

Cheers,
Memphis

admin
Gephi Community Manager
Posts:964
Joined:09 Dec 2009 14:41
[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: Initial layout

Post by admin » 07 Oct 2011 18:46

Hi,

The OpenOrd layout has a seed parameter. Otherwise, you could create just one graph with 4 different attributes to encode your labels. In the UI, it's possible to display a node attribute instead of the default label.

WACMemphis
Posts:10
Joined:07 Oct 2011 13:24
[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: Initial layout

Post by WACMemphis » 08 Oct 2011 13:20

Hi,

using multiple attributes would be a workaround, but since i have the graphs in four separate files i'd rather like to change the initial layout. Can you tell me which class i would have to change to get the same initial layout, given the same graph?
I will also try openord tomorrow, maybe this would generate a starting point from which i can use one of the other layouts...

admin
Gephi Community Manager
Posts:964
Joined:09 Dec 2009 14:41
[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: Initial layout

Post by admin » 08 Oct 2011 13:43

Force-directed layouts are non-deterministic by nature, so it's not a matter of changing a class.

Let's consider this workaround: one you've done a layour with a graph, go to the Data Lab, erase the Label column, then import the second graph with the option "Append Graph" set on the Import Report. This will affect the new labels to the current graph.

WACMemphis
Posts:10
Joined:07 Oct 2011 13:24
[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: Initial layout

Post by WACMemphis » 08 Oct 2011 15:43

ah, i see. didn't know they were non-deterministic. the latest workaround seems to be the best solution for me. i will try tomorrow.
still, i think a possibility to compare multiple graphs (or at least layout them in the same way) would be a nice feature. maybe i have some time after my thesis to work on sth like this.

thanks a lot :)

admin
Gephi Community Manager
Posts:964
Joined:09 Dec 2009 14:41
[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: Initial layout

Post by admin » 08 Oct 2011 16:01

yeah, comparing static or dynamic graphs is a _hard_ research problem :)

WACMemphis
Posts:10
Joined:07 Oct 2011 13:24
[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: Initial layout

Post by WACMemphis » 08 Oct 2011 18:05

yeah, it's really hard. what i meant was the thing in the brackets e.g. to layout graphs in a deterministic (or to be precise: the same) way

WACMemphis
Posts:10
Joined:07 Oct 2011 13:24
[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: Initial layout

Post by WACMemphis » 09 Oct 2011 12:12

Hi again,

i tried your advice with deleting labels and appending other graph.
Unfortunately appending the other graph results in the initial random layout, so the layout i used before is gone...
Any ideas?

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: Initial layout

Post by eduramiba » 09 Oct 2011 13:23

Hi,
The best would be to have all the labels in 4 columns in the same graph file, so you can visualize the column you want at any time.
Since you have 4 separated files, you can try the following if your nodes have the same ids in every graph:

Export each file to csv with data laboratory.
Import again in data laboratory from each csv in the same workspace, so columns will be joined by id to existing nodes.

This csv join can also be done with R for example.
Eduardo

WACMemphis
Posts:10
Joined:07 Oct 2011 13:24
[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: Initial layout

Post by WACMemphis » 09 Oct 2011 14:21

Hi,

since all other suggestions didn't work the way i expected, i wrote some code which combines all graphs into one having the original graph-labels as attributes.

one last thing i want to ask: i can now select each "original-graph" in the partitioning section and color the graph accodingly. Let's say each one has 10 partitions numbered from 0 to 9. can i ensure that for each "original-graph" the partition "0" gets the same color?

up till now, each time i change the node attribute ("original-graph") the colors change randomly

thanks for all the help!!

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