I’ve recently been working with PyVis for my digital history project on Alcuin’s letters. PyVis is a Python module that reads in network data and then outputs a dynamic network graph that is coded in HTML, CSS, and Javascript. The outputted HTML file is based around the VIS.js library, a powerful library for producing Javascript graphs.
I have found this to be a nice alternative to NetworkX and Matplotlib because it allows digital humanists to create dynamic graphs, or graphs that allow users to interact with the graph. While NetworkX and Matplotlib are certainly useful and have their place in digital humanities projects, Matplotlib’s data visualizations have their limits. Javascript-based libraries provide a way around this.
In addition to this, the graphs produced are in html, which makes for easy web implementation. I can, for example, embed any graph in a website using that html code. See the image below:
In the image above, you can see ten of Alcuin’s letters (represented by blue ellipses) and the manuscripts that contain those letters (represented by purple triangles). These nodes in the graph are movable. The user can, therefore, interact with that data in a browser.
I have started a Youtube tutorial series on PyVis. For those of you who are interested in following along, here is the requisite JSON file of Alcuin’s letters: alcuin_letters.json