On Using Gephi

Working with Networks

Instructions on how to work with Gephi

Before you start:  Gephi’s  sigma.js plugin uses the HTML canvas element to display static graphs like those generated in Gephi in a dynamic interface in a browser–Firefox works well]

  1. To download and install the Sigma.js plugin, open Gephi.  Click on the “Tools” tab and click “plugins” from the drop-down menu.
  2. Click on the “Available Plugins” tab and scroll down nearly to the bottom of the list to find the “Sigma Exporter” plugin.
  3. Click the check box next to the “Sigma Exporter” plugin, then click the “Install” button at the bottom left corner of the window.
  4. Once the plugin is downloaded and installed, close and re-open Gephi to complete the plugin installation.

——

Wednesday, March 25

We are going to get to know Gephi by running a program available through Facebook.

  1. Go to your Facebook account and in the search window, type “netvizz”.
  2. Because of Facebook’s new privacy policy, you can no longer create a file of your personal network.  You can create a file of the group/page network.   You will have to type in your Facebook ID.  This you can find at Lookup-ID.com
  3. It will find the application and tell it to save a “gdf” file to the desktop.  This file will be zipped so you have to unzip it.
  4. Now open Gephi and “open” the gdf file you just saved.
  5. This will open the “Import Report” window.  Make sure the “Create Missing Nodes” box is clicked, then hit OK.

Now click on the “Overview” tab to tinker with your graph’s spatial/visual layout.

Click on the “Choose a layout” tab on the lower-left part of the window to determine how you want to display your nodes and edges.  A popular choice is either of the “ForceAtlas” templates, but I’d recommend tweaking the value of the “gravity” input to expand/contract the spread of your nodes to your liking.  Click “run” to watch the graph recalculate.

If you want to identify clusters in your Facebook graph, you can try “Modularity” algorithm to detect communities:

  • 1. Go to Statistics module and “Modularity”
  • 2. Check Randomize option when asked and click on Run
  • 
3. When finished go to “Partition” module, click on the green refresh button
  • 4. Select “Modularity Class”, that is the result of the algorithm

To change size of node based on “degree”, go to Statistics panel and run the “average degree” calculation.  Then go to left hand panel to the red diamond next to “Nodes” and click on drop down menu and choose a rank parameter (indegree or outdegree).

If you like what you see, and what to export the graph you can go to the “Preview” mode and then choose the labels and edges.  You can choose to export your graph as a .pdf or as a Sigma.js template.

Click the “File” tab, scroll down to “Export” and select your preferred format for exportation.  If you choose to export using the Sigma.js template, Gephi will create a folder containing files ready to be uploaded to your server/webpage.  If you want to view the graph in a browser, click on the “index” file in the folder.

  • You can color your clusters, right-click on Partition module (in the blank area) and select “Randomize color” to change colors.

[Useful Facebook visualization video: http://youtu.be/kbLFMObmLNQ]

If you like what you see, and what to export the graph you can go to the “Preview” mode and then choose the labels and edges.  You can choose to export your graph as a .pdf or as a Sigma.js template.

Click the “File” tab, scroll down to “Export” and select your preferred format for exportation.  If you choose to export using the Sigma.js template, Gephi will create a folder containing files ready to be uploaded to your server/webpage.  If you want to view the graph in a browser, click on the “index” file in the folder.

Friday, March 27

Now we are going to import our own data into Gephi to try to visualize networks.

There are two ways to do this:

The first is to import a list of nodes from a csv file and then to create the edges by hand.  This is obviously much easier to do with a smaller network than a Facebook network.

  • To do this save your person database in a Google spreadsheet that has only one column named “source”.  You can then save this as a csv file (Sometimes it’s better to make an Excel spreadsheet and save as csv and import.)
  • Open Gephi, click the “File” tab, then click “Open” from the drop-down menu.  Browse for your .csv file, and click the open button at the bottom of the window.
  • This will open the “Import Report” window.  Make sure the “Create Missing Nodes” box is clicked, then hit OK.
  • To label your nodes in the graph, click on the “Data Laboratory” tab.
  • At the bottom of the screen, click the “Copy data to other column” button, then select “ID” from the drop-down menu.
  • In the pop-up box, select “Label,” then OK. (See screenshot below.)
  • To add edges, click on “Add edge”.  You will see a window that allows you to create edges between the nodes in your spreadsheet.  Enter an edge for every relationship that exists between the nodes in your database.

SAVE !

—————————————————-

The other method is to create the nodes and edges in a Google spreadsheet and then import it.

This will open the “Import Report” window.  Make sure the “Create Missing Nodes” box is clicked, then hit OK.

To label your nodes in the graph, click on the “Data Laboratory” tab.

  • At the bottom of the screen, click the “Copy data to other column” button, then select “ID” from the drop-down menu.  (See screenshot below.)In Google Spreadsheet, create a two column data set.
  • The specific format for the data needs to be divided into one column as SOURCE and the second column as TARGET.
  • The SOURCE column on the left determines the number of nodes your graph will contain and the TARGET column will determine the number of edges (or connections) between nodes.  Repeat the node-edge/source-target pattern in these two columns for each connection between nodes you wish to visualize.
  • Once you’ve entered in your data and saved it as a .csv file, you’re ready to import the file into Gephi.
  • Open Gephi, click the “File” tab, then click “Open” from the drop-down menu.  Browse for your .csv file, and click the open button at the bottom of the window.
  • In the pop-up box, select “Label,” then OK. (See screenshot below.)
  • Now click on the “Overview” tab to tinker with your graph’s spatial/visual layout.
  • Click on the “Choose a layout” tab on the lower-left part of the window to determine how you want to display your nodes and edges.  A popular choice is either of the “ForceAtlas” templates, but I’d recommend tweaking the value of the “gravity” input to expand/contract the spread of your nodes to your liking.

In Gephi to group by clusters

  • In Gephi, you can try “Modularity” algorithm to detect communities:
  • 1. Go to Statistics module and “Modularity”
  • 2. Check Randomize option when asked and click on Run
  • 
3. When finished go to “Partition” module, click on the green refresh button
  • 4. Select “Modularity Class”, that is the result of the algorithm
  • You can color your clusters, right-click on Partition module (in the blank area) and select “Randomize color” to change colors.

To change size of node based on “degree”, go to Statistics panel and run the “average degree” calculation.  Then go to left hand panel to the red diamond next to “Nodes” and click on drop down menu and choose a rank parameter (indegree or outdegree).

If you like what you see, and what to export the graph you can go to the “Preview” mode and then choose the labels and edges.  You can choose to export your graph as a .pdf or as a Sigma.js template.

Click the “File” tab, scroll down to “Export” and select your preferred format for exportation.  If you choose to export using the Sigma.js template, Gephi will create a folder containing files ready to be uploaded to your server/webpage.  If you want to view the graph in a browser, click on the “index” file in the folder.

——————————-

Interpretation:  THIS IS NOT JUST A PRETTY PICTURE!

Remember that a network visualization should contain important and useful information about the relationships between the “nodes” in your database.  If we think back to Monday’s class and the terms we learned about in Network Analysis, look for these concepts in your  network visualization(s). Think about how you read your FB network visualizations on Wednesday and how groups and connections were revealed to you through the visualization.

In this network visualization of the archival materials you have been working with,  which nodes have the strongest connectivity?  Are there interesting “weak” links that reveal pathways of information?  (Remember, weak links tell us more about how groups connect than do strong ones.)  Are there clear modularities?

If you have produced a person — person network, try creating a person–place network.  Take your person nodes and then connect them with places from the original spreadsheet.

 

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *