[TODO] Preset x and y coordinates

Get help with your data
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
rlight
Posts:2
Joined:20 Apr 2012 21:54
[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
[TODO] Preset x and y coordinates

Post by rlight » 20 Apr 2012 22:00

Greetings all.

I have a task that seems simple enough but I'm having a hard time figuring out how to do it.

My data is being imported via csv files, one for nodes and one for edges. What I want to do is set two of the attributes that I import from my csv as my x and y coordinates, hardcoding in the location of the nodes so I can focus on the edges that are really my focus of interest.

I just can't figure out how to do it. I feel like I'm missing something obvious here, but I can't find what I need in the documentation for the life of me.

Any tips or pointers in the right direction would be greatly appreciated.

Thanks!

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: Preset x and y coordinates

Post by eduramiba » 21 Apr 2012 12:12

Hi,
This is not directly supported in the spreadsheet import. But you can include x,y columns in your nodes data and then use this plugin https://gephi.org/plugins/recast-column to use this data for nodes position.

Eduardo

georgeu2000
Posts:3
Joined:23 Apr 2012 01:12
[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: Preset x and y coordinates

Post by georgeu2000 » 23 Apr 2012 15:21

From the plugin page:
Useful when imported column has default type string, but contains numbers, or booleans, or chars. Has autoconvert option and gui. Also can get any or set any standart column, which is currently impossible to do with standart interface. Installed in Data Laboratory -> More actions.
How do you use this to set the nodes position?

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: Preset x and y coordinates

Post by eduramiba » 23 Apr 2012 21:31

I will describe the necessary steps:
  • Install the plugin (you can find it in Gephi third party plugins named as 'Data Laboratory Helper'
  • Import your CSV data with the position columns
  • In data lab, click on more actions, then click on 'Set standard column'
  • Select your X position column in the first field, and 'X-Coordinate(Node table)' in the second field. Then click on 'Set column'
  • Repeat last step for Y position
Eduardo

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: Preset x and y coordinates

Post by admin » 25 Apr 2012 09:53

We really need a way to simply import X and Y coordinates. This should be direct, in a user's point of view.

rlight
Posts:2
Joined:20 Apr 2012 21:54
[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: [TODO] Preset x and y coordinates

Post by rlight » 25 Apr 2012 13:33

This is exactly what I needed. Thank you very much.

claudiomartella
Posts:7
Joined:18 Sep 2012 12:27
[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: [TODO] Preset x and y coordinates

Post by claudiomartella » 02 Oct 2012 19:29

I tried with DynamicInteger for an X column defined as this <[1,1,34];[2,2,44];[3,3,55]...> and same for Y hoping i could then use these X and Y columns with coordinate layout, but these columns, even after this procedure, are still not selectable from the Coordinate Layout. Any idea?

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: [TODO] Preset x and y coordinates

Post by eduramiba » 04 Oct 2012 18:06

I think Coordinate Layout doesn't support dynamic columns.
But that would not be very difficult to achieve.

Eduardo

talayeh
Posts:1
Joined:20 Feb 2014 19:00
[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: [TODO] Preset x and y coordinates

Post by talayeh » 20 Feb 2014 19:08

I have the same problem and I have followed the steps above, but I still can't get it to work. In both my csv files for edge list and node coordinates, the nodes are some strings. When I import the file with node coordinates, ID's are assigned to each of the nodes. Then I import the edge list, but Gephi does not recognize the nodes as the same ones (maybe because it's looking for the same ID's in the second file). So, I end up with every node duplicated. Or if I choose the option "do not create missing nodes" I end up with no nodes. How can I solve this?

Gustavo Soldati
Posts:2
Joined:25 Jun 2014 20:30
[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: [TODO] Preset x and y coordinates

Post by Gustavo Soldati » 25 Jun 2014 20:54

Hello, I am Brazilian, so I apologize for any mistakes in my English.

As "rlike", I am having problems with importing the geographic coordinates of my network. I followed all the steps described here, but still could not organize my graph following the coordinates of my nodes. When I use "GeoAtlas" algorithm, nothing happens. I've tried three ways:

1)
- I imported my data in the format "cvs." Including two columns of coordinates, "longitude" and "latitude";
- I tried to use the "Date Lab/More Actions" and click in "Set Standard Column" and assign each column as X and Y coordinates;
- but without success with GeoAtlas.

2) Acknowledging that in the database "airlines.sample" (available here in Gephi page) the two coordinate columns were designated as "double", I tried to use the "Date Lab / More Actions" tool and "Recast Column "to change my column type. I changed the type "String" to "Double". This step resulted in two new columns, "Latitude Double" and "Longitude Double".
- I tried to use these two columns in GeoAltlas, but again without success.

3) Finally, I tried to assign these two new columns, "Latitude Doble " and "Longitude Doble", the status of standar column by "Date Lab / More Actions" click "Set Standard Column" option.
- Again it still fails.

I think I must be missing some detail because, despite trying many options, the use of Geo Atlas algorithm does not follow me any graph organized by the coordinates of the nodes.

Best regars

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