A Web Interface for Accessing Intermediate Results in R, Using Network Graphs with vis.js

My title says it all. I wanted to give those running our model, myself included, a way to visualise how it works, and to access and check intermediate results. At the top level, the model consists of a few rather large functions sending chunks of data from one to another. These chunks are not conceptually complicated, being rectangular tables of data. Spreadsheet users can think of them as worksheets or CSV files. A natural way to display all this was as a network of data nodes and processing nodes, where the data nodes are the tables. I was able to implement this using the excellent network-drawing JavaScript code written by visjs.org.

Here’s my display, showing how data flows between parts of the model. It consists of circular or diamond-shaped nodes connected by arrows. Each circle represents a chunk of data: usually, a complete collection of households, benefit units, or whatever. Each diamond represents a transformation. Clicking on a circle opens a new “viewlet” web page that explains its data and, below that, shows a data viewer. Clicking on a diamond opens a viewlet that shows and explains the code that carried out the transformation. Using the buttons on the left of the display moves up or down; using those on the right zooms in or out.

Before jumping in to my system, it’s worth looking at vis.js’s examples. You need to know JavaScript to understand how to code them. But if you do, the structure is fairly simple, and you start your experiments by copying the page sources into your own web pages. A good starting point is the Basic Usage page . I’ll explain in a later post how I went beyond that.

Leave a Reply

Your email address will not be published. Required fields are marked *