2D Spatial Map
MAT 259, 2012
Ankit Srivastava

Introduction
What kind of patterns are observed in checkouts of various media types (books, cds and dvds) across Dewey categories?

The idea was to visualize the checkout patterns of users across Dewey categories and the media type it belonged to. The visualization type used for this visualization is a Split Bar Graph. Each layer has been color coded (HSV format) to visualize a different media type - 180,100,60 for CDs; 0,75,80 for Books and 40,75,80 for DVDs. The length of each layer signifies the number of transactions for that media type and the overall length of the bar signifies the total checkouts for that Dewey Category.

Query
select FLOOR(deweyClass/100)*100, count(case when itemtype like '%bk' then ckoutDateTime end) book, count(case when itemtype like '%cd%' then ckoutDateTime end) cd, count(case when itemtype like '%dvd' then ckoutDateTime end) dvd, count(ckoutDateTime) total from transactions2011 where deweyClass <> 'null' and month(ckoutDateTime) = "+ monthIndex + " group by FLOOR(deweyClass/100)*100 order by FLOOR(deweyClass/100)*100";

where monthIndex signifies the month for which the query is executing.

Result and
Analysis
It is interesting to see that the Dewey category Arts dominates overall with the maximum number of transactions, followed by Technology. It is also important to see how various media types compare against each other. For many categories especially Computer Science, Philosophy, Literature, etc book seem to be the main choice of media type for users. Although CDs and DVDs together dominate books when it comes to Arts, which shows what kind media preferences users have for each Dewey category.


Code
I used Processing.

Run in Browser

Source Code

Control
Some basic interactivity has been embedded into this project so as to enable user to browse through the various data sets and be able to compare them against each other. Left Mouse Click enables a user to go forth (from January to February) and the right click allows the user to go back (from February to January). Each block displays the individual numbers for each media type when the mouse is over that bar.