Visit Homepage
Skip to content

Gephi timeline: the pimped out version

Random introduction (no Gephi timeline)

Ok, finally got over mourning Dumbledore a little, and I have to confess: the new James Bond trailer helped BIG TIME. I’ve gotmixed feelings about this one though. Well, just one major bummed feeling, actually. Because this is probably Daniel Craig’s last Bond movie. But! But, but, butt! Booty. Ass. Derrière. Cheeks. Fart. Eine feuchter Furz. There. Now I can finally use that expression.Gephi Timeline 10003928_786152508139121_1571855404_n.jpg

So, back to Bond (I bet his farts smell like expensive cologne. Not sure if that’s a good thing though). If you think about it, this is going to be THE ultimate movie. Now, I don’t know if many people who saw the last one really grasped what was going on there. Everyone was so focused on Silva and how in the end Bond fails and M gets killed anyway (oops, perhaps I should have added a ‘spoiler alert’ at the beginning again…), that they missed the developments that really matter. But, as is so often the case, Silva was actually just another straw puppet, a minuscule link in a master plan genially devised by no other than our very worst enemy and nightmare: VOLDEMORT. You fools! He-Who-Must-Not-Be-Named was not killed by Harry Potter!

‘But he burst into little bits of charred paper at the end of the last movie’.

Balderdash! Voldemort isn’t stupid! With all his Horcruxes destroyed and a jittery Elder Wand, he knew it would be reckless to face Harry again. So he did a neat disapparating trick and moved on to plan B: take over the Muggle community first. After casting an Imperius curse on Silva to trick him into hating M and wanting to kill her for personal reasons, he wormed his way into MI6, cunningly disguised as the roguish Garreth Mallory with the help of a beautification potion. They’re not leaking it in the trailers, but wizards are going to come swooping in from all sides to help DC save the day. It’s going to be AWESOME.

Gephi Timeline voldemort_x_james_bond_skyfall_by_shadowblade1990-d5wle5o.jpg

Gephi Timeline

But as much as I love giving away movie plots, I need to tell you a bit more about time intervals in Gephi and the Gephi timeline. Last week we saw the simple version. Like I said though, there’s a second way to create dynamic networks in Gephi, by constructing the time intervals in your database yourself, so they can be uploaded directly into Gephi. But why do it yourself, if Gephi can do it for you, you ask? Well, the first option only works if you don’t have recurring relationships: if within the time frame you’re studying, the links between your nodes only appear once, either for the whole duration of the time frame, or for a single interval within this time frame. So this option won’t work if you’re studying the on-and-off relationship of Justin Bieber and Selena Gomez, for example (the last I heard was that they’re so totally definitely over each other now).

If you’re dealing with nodes and/or relations that disappear and reappear at different stages in your time frame, you need to format the time intervals yourself in your spreadsheet or database. This means a little more work for you, but the upside is, you can easily add attributes to your edges to visualize changes in these relationships.

Gephi Timeline: Time Intervals

Time intervals are specified between brackets. An interval between [square brackets] means that you want to include the start and end time, while an interval between (round brackets) means the interval starts after and ends before the specified date. Combinations are also possible, like [1990, 1991). As you can see, the start and end dates are separated by a simple comma. To combine the different time slots of a specific node or edge, all you need to do is add the second time interval, between new brackets, separating it from the first one with a semicolon: so by adding the time interval [1981, 1981]; [1991, 1998] to an edge in your edgelist, you’re specifying that that edge appears in 1981, then disappears again once 1982 starts, and reappears again in 1991 until the end of 1998. Let’s illustrate this magical feature with another wonderful Harry Potter example.
This is what a basic nodelist and edgelist would look like:

Gephi Timeline TI_dynamic.png
The nodelist

Gephi Timeline The edgelist
The edgelist

In this Gephi timeline example, only edges can reappear. So once a wizard is born, his or her node appears in the network and stays there until he or she kicks the bucket. So you have just a single time interval in the nodelist. Depending on what you’re studying though, it might be interesting to make nodes disappear as long as they don’t have any links. That’s up to you. In that case, you’ll need to make a time interval with multiple time slots in your nodelist as well.

In the edgelist, however, there are some nodes with multiple time slots. Some of them aren’t successive: Harry (1), for example, only has a brief tie to Voldemort (41) in 1981, when Voldemort tries to kill him as a baby. Their next link starts in 1991, when Voldemort is bobbing around Hogwarts while stuck to Professor Quirell’s head. Other ties are successive here, like Harry and Ginny’s, but I didn’t put them in a single time interval, because the nature of their relationship changes, and to indicate this, you need to split it up. This is only necessary if you want to add an attribute to your edges, like the type of relationship. In that case, you have to add an extra column, which I called ‘DynamicValue’, and which basically repeats your time interval, but in each time slot a third element is added after another comma to define the type of relationship. I coded the relationships in this example, so 1 = friend, 2 = family, 3 = ho, and so on. But apparently you can also just write ‘friend’, ‘family’, ‘ho’, etc (so [1991, 1996, friend]; [1997, 1999, ho] for Harry (1) and Ginny (4)). But again: if you don’t want to add attributes to your edges, you don’t need this ‘DynamicValue’ shizzle, then you’re good to go with just the time interval.

Importing Your Data for the Gephi Timeline

Once you’ve got this information in your nodelist and edgelist, you’re actually all set to enable that timeline, since you won’t need to manipulate any columns in Gephi anymore. Importing these files is, as always, pretty straightforward. There’s just one thing you need to take care of: that’s making sure Gephi recognizes the type of information these special columns contain. And you do this in the second pop-up you get when importing your spreadsheets. This is the first one, remember:

Gephi Timeline import.png

And when you’ve clicked Ok, you get this:

Gephi Timeline set%2Bfield.png

Gephi Timeline set%2Bfield%2Bedge.png

Normally, you ignore this part and just click ‘ok’ again. Not this time though! Scroll down to your time interval column, and check if it is marked as ‘TimeInterval’, both for your nodelist and for your edgelist. If your edgelist also contains a dynamic value, this should be marked as ‘DynamicInteger’.
And that’s all there is to it. Once both are imported, the ‘enable timeline’ button should appear at the bottom of your Gephi window, and you can start playing around with the Gephi timeline. You can check out the video on the Trismegistos site.

Did you see how the size of the nodes also changes over time according the their degree?

Gephi Timeline dynamic%2Bdegree.png

Once you’ve run the degree statistics as you would with a regular network, go to the ranking tab, set the minimum and maximum size for your nodes, and make sure to select the ‘auto transformation’ (∞) and ‘local scale’ buttons. Then simply click on ‘auto apply’ before you play your timeline, and presto! I also colored the edges according to the different types of relationships, but we already got that covered in another post!

*For those of you not familiar with text editing programs such as TextWrangler (or Notepad on Windows), the default application I use to edit .csv files as you can see in the screenshot: Excel also allows you to save (and edit) .csv files, where your data is more neatly organized into clearly outlined columns, like you can see in the screenshots.


Be First to Comment

Leave a Reply

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