2D Spatial Map
MAT 259, 2012
David Gordon

Introduction
I wanted to investigate hourly patterns in the frequency of checkout transactions at the SPL. I used a 2D spatial map to plot all transactions by hour and Dewey category for April 12, 2011.

Search Terms:
Money
Real Estate
Invest(ing)
Debt
Stock(s)

Background
and Sketches
I decided to use small boxes to represent transaction frequencies, where darker boxes represent higher frequencies, and gaps between boxes represent areas with zero transactions. Users can click the mouse to display the Dewey category for that location on the grid.


Query
select week(cout) as week,count(*) from inraw where title like '%invest%' and deweyClass != 'null' and year(cout) >= '2006' group by week order by week;
Explanation
This query returns all checkout transactions on the April 12th, 2011, grouped and ordered by Dewey class and checkout hour.

Process
I began by writing a Processing script that goes through each hour of data and draws a small box for each transaction at the corresponding Dewey category. Next I added the labeling and user interactivity. Based on feedback from the class, I increased the size of the boxes and rearranged the labeling to reduce visual distractions.

Result and
Analysis
I thought the 2D spatial map worked well as a format for visualizing transactions according to Dewey category and hour of day. The graph clearly displays an increase in checkouts during peak library hours and reveals the most popular and unpopular hour Dewey categories. I thought the use of small boxes created a unified and aesthetically pleasing result.


Code
I used Processing.

Run in Browser

First Draft Source Code

Source Code

Control
Clicking the mouse reveals Dewey numbers for that location. The user can also turn on and off the grid using the spacebar.