Get startedGet started for free

Interactive network visualizations

1. Interactive network visualizations

2. R network visualization packages

Up until now in this course you have been using igraph to make network visualizations. The visualizations are quick and relatively easy to make. However, there are many other R packages that also make network visualizations. Some of them are listed here. Each has its own strengths and weakness. Some are useful for larger networks, others for smaller networks. Some are very good for making static graphs, whereas others are better for making visualizations that the user can interact with. For example, by hovering over vertices to get extra information about individuals or by being able to actively move the network around. Several of these are integrated with javascript libraries to make this possible. There are also packages for converting igraph objects to files that can be used in other specialized network visualization softwares. One example is the rgexf package that allows you to work with the open-source visualization software Gephi.

3. threejs

In this final exercise you will learn how to make interactive network plots using the threejs package. This package is especially useful for visualizing large networks and integrates very well with igraph. When you create these visualizations you will be able to use your mouse to rotate and zoom in and out of the network as well as move vertices around. Hovering over vertices will also reveal that individual's identity via pop up text.

4. Creating a threejs visualization

Creating the basic visualization is as easy as applying the function graphjs() to the igraph object. This creates a fully interactive network. The example on the right is the visualization created when using the graph object for the plot on the left.

5. Adding attributes

To add names to vertices and to change colors, all you need to do is set the appropriate vertex attributes to the igraph object. Within the graphjs() function many aspects of the plot can be changed also. Here we are changing the vertex size. By hovering over the top vertex we see that its label is E.

6. Coloring communities

Visualizing the communities in a network is also possible in threejs by adding a color attribute to each vertex that is unique to their individual community. This network is now fully interactive. In the following exercises, try making your own!

7. Let's practice!

Time to put this into practice.