Lightweight Programming
Richard Brath, David Jonker · 2015
In graph analysis, programming typically becomes useful in a few areas. This chapter provides some code examples for both Python and JavaScript. Each section starts with a simple introductory example and then builds progressively to more detailed examples. Python is a good programming tool for programming novices and experts to quickly create some code to manipulate graph data. Examples in the first part of the chapter include cleaning data—extracting nodes from a data set with only links, and extracting both nodes and links from a data set not organized as a graph (for example, e-mail). The second part of the chapter focuses on JavaScript, the drawing format Scalable Vector Graphics (SVG), and the visualization library D3. The discussion builds incrementally from simple geometry, through simple graphs with rectangular and circular layouts, to interactive force-directed graphs.