Day04: D3

Posted by csiu on February 28, 2017 | with: 100daysofcode,

I passed! And so, to do something different, I decided to visualize data in D3. The product of this project is found at bl.ocks.org/csiu.

25 drinks and counting

One of the things that I keep track of is the number of drinks I had. Near the start of my thesis, I remember someone mentioning that it’s hard to find someone (outside personal/cultural/religious reasons) who did not have more than 10 drinks. At that point I was at less than 10, but now I’m at 25.

What happened?

Calendars in D3

After referring to my list of drinks, calendar of events, and trip down memory lane, I compiled a list of dates and drinks. Since this is time series data, I decided to visualize this as one would in a calendar.

Looking online, I based my code on the following examples:

  1. bl.ocks.org/mbostock/4063318 for the foundation of the code
  2. bl.ocks.org/eesur/5fbda7f410d31da35e42 for adding in the months of the year and days of the week

Note: The chunk of drinks in Oct 2016 were from free drinks at a conference.

More references

In producing the visualization, I went through the code line by line to try and understand what was being done. In the code at bl.ocks.org/csiu, I made comments on what each chunk does. Furthermore, a couple of references I thought were useful are:

Selection

Rollups