2.16 BiVariate 2D Spatial Map Project

Post Reply
Posts: 160
Joined: Wed Sep 22, 2010 12:26 pm

2.16 BiVariate 2D Spatial Map Project

Post by glegrady » Thu Feb 16, 2012 11:55 am

Place the completed project here with an image, brief description, and code
George Legrady

Posts: 7
Joined: Tue Jan 17, 2012 4:08 pm

Re: 2.16 BiVariate 2D Spatial Map Project

Post by ansh2201 » Thu Feb 16, 2012 12:16 pm

The idea behind this visualization is to leverage the fact that data can visualize itself beautifully. I feel that letting data visualize can lead us to patterns that exist in the Seattle public library database. Patterns like long term checkouts, multiple checkouts and varied check-in patterns, and much more.
The bivariate graph consists of Time of day one Y-Axis and Day of the Year on X-Axis. The X-Axis data was collected for a period of 3 years - 2009-2011. I wanted to see if there exists patterns when we consider the Least popular dewey subcategory for each dewey category. For each library item that matches the query criteria, a line with x1,y1 corresponding to the checkout time and x2,y2 corresponding to the checkin time is drawn. The lightness of the line is decided corresponding to the duration of the checkout. The longer the checkout, the darker the line is.
1. General History and other related areas has the maximum amount of long term activity whereas General Statistics has the least.
2. In the category, Italian and Latin Literature, we can see that a lot of transactions were checked out at the same time but have very different checkin durations.
3. Also, the overall concentration of activity between 10am to 8pm correspond to the library working hours. Although we can see some anomalies to this that can either correspond to online checkouts or renewal.
Query to Fetch Smallest Sub group in each dewey category
FLOOR(deweyClass/10)*10 subgroup,
from spl0.inraw
where deweyClass <> "null" OR deweyClass <> NULL
group by 1
order by 2 asc;
Query to extract data from Database
FLOOR(deweyClass/10)*10 subgroup,
from spl0.inraw
where (deweyClass <> 'null' OR deweyClass <> NULL)
and itemtype like "%bk"
and (TIMESTAMPDIFF(HOUR, cout, cin)) > 0
and year(cout) >= 2009
and year(cin) <= 2011
and FLOOR(deweyClass/10)*10 in ('0','150','290','300','420','590','640','780','810','910');
The visualization has the following interactions
1. Filter each dewey category with numbers 0-9.
2. Toggle between legend and graph using L.
3. Filtering out threshold data (duration less than 120 days) using T.
4. Clearing the graph with ~.
5. Toggle grid using G.

(2.73 MiB) Downloaded 1019 times
Last edited by ansh2201 on Tue Feb 21, 2012 12:05 am, edited 1 time in total.

Posts: 9
Joined: Tue Jan 17, 2012 4:40 pm

Re: 2.16 BiVariate 2D Spatial Map Project

Post by hanyoonjung » Sat Feb 18, 2012 6:31 pm

Project 2: 2D Bivariate Spatial Visualization
By Yoon Chung Han

"Who is the most popular classical musician in Seattle?"

In this visualization graph, 10 musicians is listed vertically on y axis, and every months from 2005 to 2011 are listed on x axis. Basically, it's a bar graph, but the number of checked out items related to each musician is expressed by changes of color and color brightness. There are 4 color themes: black/white, HSB, yellow, red. Users can change the color theme by pressing keys and see the query results easily and intuitively with the color depth. If users roll over mouse on each bar, the number of checked out items per month is appeared. The sliding animation delivers a enjoyable feeling when navigating each color theme.

<Final design>

Final design applet is here: http://www.yoonchunghan.com/MAT259/Project2/index.html
(please be patient to load all the contents...)
Source code is here: http://www.yoonchunghan.com/MAT259/Proj ... _Final.zip

Posts: 14
Joined: Tue Jan 17, 2012 4:40 pm

Re: 2.16 BiVariate 2D Spatial Map Project

Post by rjduranjr » Sun Feb 19, 2012 11:56 am

RJ Duran
MAT259 Winter 2012
Data Visualization
Project 2

The goal of this project is to utilize a bi-variate spatial map to visualize data answering the question: How “Green” is Seattle?

The inspiration for this question came from a genuine interest to understand how knowledgeable the general library going population of Seattle is when it comes to topics of sustainability, pollution, health and wellness, conservation, social issues, economic issues, and politics. I feel that this is an important question to address because the general public needs to have an understanding of what’s happening locally and globally today.

Through the library data I tried to illustrate the reading habits of people based on the number of checkouts per hour per day within 7 categories: Conservation, Economic, Political, Social, Sustainability, Science, and Technology. By grouping titles into these categories I was able to make sense of the large amount of information.

Technically the project involved one query to search for titles within a set list of keywords and filter out the desirable titles from the undesirable. I then looked through each month displayed and counted the total books marked with a specific category for each hour of each day. While this approach produces some interesting results, there is still some error in the counting and data requested itself. Mainly, duplicate entries and marking items for more than one category.

There is a simple amount of interaction to allow the user to navigate through the data for each month within 2011 shown in the bottom left. The mouse was used to provide basic hover functionality showing the total checkouts per day for a given hour. A secondary color palette was also implemented to show dark and light palettes. I used a simple grid to do the layout of elements. The code itself is a little crude since we had somewhat of a short time frame to implement a design but I tried to keep things organized.

This is the query used for collecting information.
keyword = keywords used to search for in titles and subjects
category-keyword = keywords used to classify items into categories based on title and subject
ignore-keywords = keywords to ignore in titles and subjects

SELECT date(cout), time(cout), title,
IF(title like '%category-keyword%' or..., '1', '0') as cat1,
IF(title like '%category-keyword%' or…, '1', '0') as cat2,
IF(title like '%category-keyword%' or…, '1', '0') as cat3,
IF(title like '%category-keyword%' or…, '1', '0') as cat4,
IF(title like '%category-keyword%' or…, '1', '0') as cat5,
IF(title like '%category-keyword%' or…, '1', '0') as cat6,
IF(title like '%category-keyword%' or…, '1', '0') as cat7
FROM inraw WHERE (year(cout) = '2011' AND month(cout) > 0 AND month(cout) < 13)
AND ((title like '%keyword%' or...) AND NOT (title like '%ignore-keyword%' or...)
AND (subj like '%keyword%' or...) AND NOT (subj like '%ignore-keyword%' or...))
AND (itemtype = 'acbk' or itemtype = 'arbk' or itemtype = 'acper' or itemtype = 'arper' or itemtype = 'arnp')
ORDER BY date(cout) ASC, hour(cout) ASC;

http://rjduran.net/MAT/259/project2/p2_ ... ywords.txt
http://rjduran.net/MAT/259/project2/p2_ ... ywords.txt

http://rjduran.net/MAT/259/project2/gre ... l-0223.png (Permanent)
http://rjduran.net/MAT/259/project2/gre ... l-0364.png (Permanent)

(335.16 KiB) Downloaded 337 times
http://rjduran.net/MAT/259/project2/gre ... _final.zip (Permanent)
Last edited by rjduranjr on Mon Feb 20, 2012 4:44 pm, edited 1 time in total.

Posts: 10
Joined: Tue Jan 17, 2012 4:41 pm

Re: 2.16 BiVariate 2D Spatial Map Project

Post by anisbharon » Mon Feb 20, 2012 10:29 am

Keyboard input switches between queries and highlights a curve of checkout frequency of the selected query. Rollover reveals total number of transactions in a given month.
(169.88 KiB) Downloaded 230 times

Posts: 7
Joined: Tue Jan 17, 2012 4:42 pm

Re: 2.16 BiVariate 2D Spatial Map Project

Post by davidgordonartist » Sun Feb 26, 2012 1:24 pm

Final Version Screenshots:
This spatial map plots the number of Seattle Public Library transactions for April 12, 2011 by hour checked out and Dewey category. The user clicks the mouse to reveal Dewey numbers for that location.

Final Version:
(8.34 KiB) Downloaded 300 times
First version screenshot:
First version code:
(8.27 KiB) Downloaded 292 times
Last edited by davidgordonartist on Mon Mar 19, 2012 2:27 pm, edited 1 time in total.

Posts: 7
Joined: Tue Jan 17, 2012 4:43 pm

Re: 2.16 BiVariate 2D Spatial Map Project

Post by dallasmercer » Tue Feb 28, 2012 2:00 am

Here is how my final visualization and process finally turned out after my sketch/hypothesis was altered and made into a visual graph.

Here is my query:
Select year(cout), month(cout), count(*) from inraw where title like "%pregnan%" and cout > "2005-01-01" and cout < '2012-01-01' group by month(cout), year(cout) order by year(cout), month(cout);

*** --> I decided to use the word %pregnan% so I captured both "pregnancy" and "pregnant" in the title names***

The results were quite interesting in my opinion. To begin, I had trouble choosing the color scheme of this visualization. I ultimately just chose the rectangular cells to have a hue of 127 (the max. MIDI input number in digital audio). I then thought I'd match this green it produced to a tan and go with a somewhat "Army" theme...
As you scroll over a cell, the number of items checked out that month will popup in white, and the higher the number the darker the cell. In my observations, I definitely see some kind of relationship here. It seems that in January, the 1st of the year, these items are checked out the most frequent. I also see that years 2008-2010 stand out the most on the darkness scale. Does that mean there were more pregnancies in just 3 years versus the others? This is the kind of information I would like to examine and see if it has any truth to it.

Here is an update of the feedback I received while presenting this during class.
I am going to change this visual graph a little bit in a few ways:
1) Invert the color scheme of dark vs. light ( have the most data heavy cells be light and the less be dark)
2) Exclude 2005 from the graph in total (not an accurate representation of the full year's data)
3) Find a background color that is more friendly to the looker's eye (I'm new to graphic visualization so I am still trying to figure out what works best for overall visual aesthetics)
4) I am going to query another data set based on the title "birth" and have it represented as a different color on the graph. I might see some relation (like an 8 to 9 month difference) to the 2 colors in the graph.
Screen Shot 2012-02-28 at 1.40.23 AM.png
Screen Shot 2012-03-12 at 7.58.50 AM.png
All of my work for this project
(717.7 KiB) Downloaded 306 times

Post Reply