Game Of Thrones network visualization

I was watching the season finale of Game of Thrones the other day and wondered—with so many characters in the series what does the interaction network look like? Well, as it turns out I was not the first person to get this thought. In fact A. Beveridge and J. Shan read through Storm Of Swords (third book in the series) and mapped all the interactions between characters, and released the data. You can read more about their cool project here. They are, further, planning to release data regarding the others books as well.

While A. Beveridge and J. Shan used Gephi to draw their network I wanted to do something more interactive, so chose to do it in D3js. I you haven’t already heard of D3 you should definitely check it out! There are many great example on the D3 homepage, and I especially like Bostok force-directed network visualization [see here]. Being very lazy, I borrowed the code from here, wrote a python script that modified the Game Of Thrones data into the correct format, scaled node-size according to their degree (number if connections), and assigned nice colors to each person. The result is visible below. The plot is interactive meaning you drag nodes and if you hover your cursor over a node it will display the name of the character.