CS494/594 -- Lab 1: Jgraph


Not your normal Dr. Plank Lab

The point of this lab is for you to do something interesting with jgraph, that would likely be very difficult to do with another graphing package. I will give you options below. However, if you want to do your own thing, now is the time to do it.

Here are the requirements:


What you hand in

Your lab should be a git repository that contains: The TA should be able pull, then make, and be looking at PDF or JPG files.

Examples of projects that have been done

The link above contains examples of good student projects that have been done for this lab.

Examples of projects that you can do


The Happy QR Code

I haven't implemented this, but here's the idea. Download the QR generator from https://github.com/nayuki/QR-Code-generator. You can use this to generate QR codes into PPM files:
UNIX> echo "Jim Plank" | QR-Code-generator-master/cpp/make_qr_code | convert - junk.ppm
Here's a jpg of the QR code:

Now, write a program that reads the PPM file, and distills the QR code into a grid of squares. You'll note that the QR code above is a 21x21 grid of black or white squares. You can figure out how big the squares are by reading those boxes in the three corners. You don't need a QR reader for this -- just read the PPM. Have your program emit the jgraph for the squares. However, it should emit a "happy" QR code, where:

This should work efficiently, even with decently large messages in the QR codes, which make them more complex, or large pictures that you should shrink so the eps is not bloated.

Spirograph

If you never played with a spirograph game when you were young, you missed out. If you don't know what it is, check out its wikipedia page in https://en.wikipedia.org/wiki/Spirograph.

Write a program spiro, that takes the following command line arguments:

It will then emit jgraph for the drawing -- you'll have to do this by generating lines in jgraph that have points really close together, so that they can emulate curves.

How fun is that?


I have too much data to plot

I'll give you the data for graphs like: http://web.eecs.utk.edu/~jplank/plank/classes/cs494/494/notes/Jgraph/2019-IJCNN.jpg Basically, each data file is 24,000 lines of input where each of these is a data point for one of 240 parameter settings. First you have to cull 10 of the parameter settings, because they don't make sense, and then you have to organize the data for each parameter into a tukey plot, then create the jgraph with the proper labeling.

Will this help me next week on DraftKings?

The PGA (professional golf) tour keeps track of four "Shots Gained" statistics: The sum of these measures is their "Shots Gained: Total". For example, let's take a look at the 2020 US open championship. What I have below is the each web page that has the stats for the tournament, plus the stat for five golfers:
  1. The winner, Bryson DeChambeau, who hits his drives a mile.
  2. The runner up, Matthew Wolff, who also hits his drives a mile.
  3. Zach Johnson, who came in 8th and is well known for scoring well despite not driving the ball well.
  4. Lee Westwood, who came it 8th despite being 100 years old.
  5. Siugo Imahira, who came in last of all players who played all four rounds.
The numbers shown are totals for the four rounds of the tournament.

There's a really nice graphic that you can build to display shots gained, where you have four boxes for each golfer, which contains the positive and negative stats, and with a black bar for the total. Here's the graphic for those five golfers:

It's a great graphic, because you can easily see how Wolff and DeChambeau excelled in Approach-the-green, while Zach Johnson had a monster tournament with his putter.

Your program should take some form of input files that has Shots-Gained statistics, (ideally pulled off the web automatically), and then create this graphic as jgraph. Again, this is ideal, but if you have more golfers than will fit on a page, have it produce multiple pages. Of course, have it sort the golfers from best total to worst.