Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Importing Nodes with Coordinates to Gephi from CSV

Tags:

graph

csv

gephi

This question seems pretty stupid but I actually fail to find a simple solution to this. I have a csv file that is structured like this:

0 21 34.00 34.00
1 23 35.00 25.00
2 25 45.00 65.00

The first column is the node's id, the second is an unimportant attribute. The 3rd and 4th attribute are supposed to be the x and y position of the nodes. I can import the file into the Data Laboratory without problems, but I fail to explain to Gephi to use the x y attributes as the corresponding properties. All I want to achieve is that Gephi sets the x Property to the value of the x Attribute (and y respectively). Also see picture.

Thanks for your help!

like image 916
schubakah Avatar asked Jun 30 '16 13:06

schubakah


People also ask

How do I import a CSV file into Gephi?

Import the CSV Files into GephiChoose the Kung I-Chi_Nodes. csv file to import. Make sure you choose “Nodes table” in the “As table” dropdown list. Follow the prompts to finish importing.

What is adjacency list in Gephi?

Adjacency List. All edges can be written as node pairs. It's also possible to write all node's connection on the same line. The example below represents a graph with 3 edges: “a” -> “b”, “b” -> “c” and “b” -> “d” a;b.

What is source and target in Gephi?

Source refers to a node that you've identified and labeled in your nodes. csv file. Target also refers to a node you've listed in your nodes. csv file. Type refers to how the two nodes are connected.

What are nodes and edges in Gephi?

Nodes tables and edge tables are the file formats used in the Data Laboratory to import data from Excel. It is a convenient way to transform any Excel data for Gephi without programming. The file extension is CSV thought it should not be confused with the CSV file format itself. Each row is a node or edge entry.


2 Answers

In the Layout window, you can select "Geo Layout" and define which columns are used as Latitude and Longitude.

The projection might come in weird if you do not actually have GeoData, but for me, this is fine.

like image 87
schubakah Avatar answered Oct 19 '22 06:10

schubakah


In Gephi 0.8 there was a plugin called Recast column. This plugin is unfortunately not ported to Gephi 0.9 yet, but it allowed you to set Standard (hidden) Columns in the Node Table, from visible values in the nodes table. Thus if you have two columns of type Float or Decimal that represent your coordinates, you could set the coordinate values of your nodes.

like image 38
Yannis P. Avatar answered Oct 19 '22 05:10

Yannis P.