WhatfettleOne CSV, thirty stories: 11. Calendar

This is day 11 of One CSV, 30 stories a series of articles exploring price paid data from the Land Registry found on GOV.UK. The code for this and the other articles is available as open source from GitHub

Yesterday I confessed to being blocked exploring the distribution of prices, so today I’m going to return to looking at the distribution of transactions over time. Whilst the histograms on day 9 were interesting, they didn’t reveal much about busiest days of the week, or months of the year. A good way to see such patterns is with a calendar.

Whilst it’s possible to code a heatmap calendar in R, I think it’s time we moved away from generating images to creating Web pages. Mike Bostock has an extensive gallery of example visualisations for his d3 JavaScript library which includes a heatmap calendar.

I tweaked this example to parse the date.tsv we made on day 2 and played with the colours giving a calendar of twenty years of transactions:

d3 calendar

The calendar has Sunday as the first and Saturday as the last day of the week, highlighting Fridays as the busiest day of the week, and the last Friday being the busiest day in a month. And I quite like how you can see which Fridays are Good Fridays. The year is busiest from Summer to Christmas, and once again we can see the fall in volumes following the crash of 2008.

As quick as this hack was to make (it took me less than an hour), it seems like a poor use of SVG and client-side JavaScript where some nicely marked-up, accessible HTML would do. I may return to this hack later, but probably not tomorrow.