CS 404/504: Program Monitoring and Visualization HW#2

Due: Wednesday February 13, 11:59pm

In this assignment, you will learn and practice Unicon's 2D graphics facilities. Write a Unicon program that reads in your output JSON file from HW#1, and renders it graphically in 2D in a Unicon window. Graph layout is a whole mini-industry for which many Ph.D. dissertations have been written. For this assignment we will use dot (see graphviz.org and this manual) to do the graph layout for you.

Part One: Read Your JSON and Write .dot

If only we had anticipated that we were going to use dot.
  1. Use the Unicon JSON library and read in a JSON file (should be about one line of code) given in the format that your HW#1 output.
  2. Write it out as a .dot file (same basename, file extension changed from .json to .dot). Example .dot file:
    digraph mygraph {
       a -> b -> c;
       b -> d;
      }
    

Part Two: Run Dot and Read/Parse the Output Layout

Although there are nice descriptions of The DOT Language and its attributes, we are interested in reading only that subset that is what the dot program writes out by way of specifying the layout of the graph.

Part Three: Open a Window and Draw the Graph