Processing, week 2

Originally published February 28, 2009.
Information provided in this post may be out of date.

<p>Today marks the second week I have been learning Processing, a Java-based language for “program[ming] images, animation, and interactions.” In other words, I want to learn how to make useful, pretty graphics. :)</p>

Over the past year I had seen Processing mentioned here-and-there in various articles, but what piqued my interest was a visualization of US zipcodes. Check it out; it's awesome.

My guide, at least for now, is Visualizing Data by Ben Fry. I just completed reading the third chapter and thought I'd share an example program.

Oops, your browser does not have a Java Plug-in. Get the latest Java Plug-in here. Or, if you have Java but can't use the Plug-in, feel free to download the program as an executable jar.

The above Processing program plots data on a US map. The data are random numbers, associated with each state, which are displayed as colored circles of varying sizes. Colors are based on sign; size based on magnitude. Moving the mouse cursor over a circle displays the state name and the random value.

Obviously, this is a very simple visualization but it's not hard to see the potential for powerful visualizations. I'm already coming up with other data to visualize with this... such as displaying the difference between the current and average daily temperature for a state.

Oh, before you get to comfortable with that static graphic, click anywhere on the map. Neat, huh? A new random number is generated and the graphic is animated from the old value.

Over the course of this coming week I will read the fourth chapter, "Time Series," about displaying data which changes over time. I can't wait to see what program the book will have me work on.