Show Sidebar Log in

How to Import Spreadsheets into Gephi

Gephi

“Gephi is an open-source software for visualizing and analysing large networks graphs. Gephi uses a 3D render engine to display graphs in real-time and speed up the exploration. You can use it to explore, analyse, spatialise, filter, cluterize, manipulate and export all types of graphs.”

Gephi is a program downloaded from the internet, and can be found here.

First your group should decide what instances/variable/interactions you will be collecting information about. This could be who talks to who in the novel, who directly interacts with each other, or who as a character is given direct speech rather than internal dialogue. Whether or not these interactions are directed or undirected becomes important when you create the edges within the Data Lab, and it will be easier to keep the two edges separate so you know who directly interacts with each other.

For example, Character A initiates a conversation with Character B, making this “edge” a directed one. You’ll be able to make your own distinctions about what network you are plotting, but it helps to have an concrete idea so that you don’t lose track of what your network is illustrating.

Once you have your data collected you can put it in an Excel Spreadsheet so that you can keep the data incase you ever need to use it, or alter the data that is being placed into the Gephi Data Lab.

How to import data into the Data Lab in Gephi using an Excel Spreadsheet:

Node Spreadsheet

Step 1: Open an Excel Spreadsheet

Step 2: Save it as a .csv file (Comma Separated Values); This will allow Gephi to separate the columns from the spreadsheet into the format that Gephi uses in the Data Laboratory.

Step 3: Set up your columns for your nodes like this:

Screen Shot 2013-11-06 at 9.53.14 PM

Id is the assigned number you’ve given to your Label.

The Label is the name/variable you’re keeping track of, and is the Node Label.”

The Eccentricity “measure captures the distance between a node and the node that is furthest from it; so a high eccentricity means that the furthest away node in the network is a long way away, and a low eccentricity means that the furthest away node is actually quite close.”

Closeness centrality “is a measure that indicates how close a node is to all the other nodes in a network, whether or not the node lays on a shortest path between other nodes. A high closeness centrality means that there is a large average distance to other nodes in the network.”

Betweenness centrality “is a measure based on the number of shortest paths between any two nodes that pass through a particular node. Nodes around the edge of the network would typically have a low betweenness centrality. A high betweenness centrality might suggest that the individual is connecting various different parts of the network together.”

Edges Spreadsheet

Step 1: Open an Excel Spreadsheet

Step 2: Save it as a .csv file (Comma Separated Values)>> This will allow Gephi to separate the columns from the spreadsheet into the format that Gephi uses in the Data Laboratory.

Step 3: Set up your columns for your edges like this:

Screen Shot 2013-11-06 at 9.53.43 PM

Source refers to the relationship between two nodes; whether an edge is directed or undirected is important to identify because the source is where the directed edge originates. Target refers to the node the edge is directed towards. If Character A talks to Character B, Character A is the source node, and Character B is the target node.

Type refers to whether an edge is directed or undirected.

Id is the assigned number, associated with the Label from the Node’s List.

Weight is the number of times the two nodes interact. The edges will be thicker for the nodes that have the most interaction.

Back to Gephi!

Once all of the data is in your spreadsheet open a new Gephi project. Click on the Tab called “Data Laboratory;” then click the tab that says “Import Spreadsheet;” a menu will pop up that has a search bar for you to browse your computer to locate the .csv file with your data. Within the browser window make sure that the File Format is set to “CSV/ *csv.”

Data Lab 1

First, we will import the Nodes List:

Data Lab 2 Data Lab 3

These settings are default, but just to make sure the drop down menus should read as: Separator: “Comma;” As table: “Nodes table;” Charset: “UTF-8.” In the Preview window, your data should look like what you’ve saved in the spreadsheet. If all of this is correct, click “Next.” Import settings: Imported columns (the Id box should be checked, and set to string; the Label box should be checked, and set to string, and “Force nodes to be created as new ones” should also be checked. “Finish” You will now see your data in the Gephi Data Laboratory.

Data Lab 4

Now, we’ll add the Edges List:

Data Lab 1

Data Lab 5 Data Lab 6

Overview Tab

To make your character network easier to read you’ll want to work first in the Overview tab, There will be multiple sectioned screens like “Partition,” “Rank,” “Layout,” “Statistics,” and “Filters.” To highlight the number of interactions between characters you can change the “weight” of the nodes and edges within the “Rank” tab.

Overview 1

Adjust the nodes on the Overview screen so they are located where you want them, now you can start adjusting the colors of edges and nodes within the Preview Tab.

Preview

Check the Preview window to view your progress.

Preview 1

To show Node Labels check the box to the left to make them appear. Then press “Refresh.”

There will be multiple compressed and expanded menus reading “Nodes,” “Node Labels,” “Edges,” “Edge Labels,” and “Edge Arrows.” adjust the settings to your liking, and remember to hit the “Refresh” button at the bottom of the screen. Remember to save the settings when you’re all finished.

Hopefully this will help if you get snagged!

For a more in-depth tutorial about how to change the layout and appearance of your graphs, you can find that here, back on the Tutorials page.

Attachments

  • Overview-1.jpeg
  • Preview-1.jpeg
  • Data-Lab-6.jpeg
  • Data-Lab-5.jpeg
  • Data-Lab-4.jpeg
  • Data-Lab-3.jpeg
  • Data-Lab-2.jpeg
  • Data-Lab-1.jpeg
  • Screen-Shot-2013-11-06-at-9.53.43-PM.jpeg
  • Screen-Shot-2013-11-06-at-9.53.14-PM.jpeg

Tags: gbdh, Tutorials

Discussion (0)

There are no comments for this doc yet.

Comment posting has been disabled on this doc.

Skip to toolbar