This graph visualisation shows how New Zealand Members of Parliament are connected on Twitter as at 19/11/17. It can be viewed here: http://jayniehaka.github.io/nz-mp-tweeters/
MP Twitter accounts were sourced from a list of MPs on Twitter owned by NZ Parliament, using the Twitter API. MPs were assigned to parties by searching their profile descriptions for party names, and then by manually adding party names for those who did not mention one in their profile.
To access and process the data I used the httr and jsonlite packages in R. mp_tweets.R contains functions to get the data, create the nodes and edges, and write these to a json file. Twitter allows 15 user requests per 15 minute window, so be warned: the make_edges_table function will take a loooooong time to run.
This force-directed graph visualisation uses the D3.js JavaScript library. It is based on Mike Bostock's Les Misérables character graph as well as this Stack Overflow post.