Week 1 at RC

d3 funtimez

During my first week at RC I’ve been getting to grips with d3.js, the javascript library for data visualisation. Almost everything about javascript and d3 is new to me, but I’ve decided that making pretty things that execute in your browser is FUN. A great resource for learning d3 is the book Interactive Data Visualization, which is available for free online.

In the visualisation above, I’ve generated some random numbers between 0 and 100 and stuck them in an array. The heights of the bars are proportional to the size of the numbers in the array; in d3 this is achieved using a technique called binding, which is essentially a way of mapping data to visuals. Then I applied some transitions; this is where some action, like a colour change or a movement, is applied smoothly over time. There are three transitions here:

  1. The bars grow to their initial height at the start
  2. The colours transition to purple when you hover your mouse over them
  3. The bars shrink when you hover over them

Finally, I’ve used a linear colour scale to colour the bars from red to blue horizontally from left to right. Obviously this chart isn’t very useful right now, but pretty soon I’ll be applying what I’ve learned to some real data. Code for this visualisation is available here.


Week 1 at RC

In truth, I put that d3 animation at the top because I couldn’t figure out how to initialise it when you scroll to it :p. I meant to start this post with: how is RC going? In a sentence, I’d say:

“It’s a bit overwhelming but I’m learning a lot, and it’s a lot of fun!”

In list form, I’d say I’ve achieved these things:

At the start I felt a bit lost and like I was scrabbling around trying to decide what to do. However, that seems to have abated a bit since I got started on something. What I really want is to come up with a bigger project idea that’ll keep me busy for a few weeks. I also want to try and pair more, because I really enjoy working collaboratively on coding projects.

I’m excited for tomorrow and to get programming again. Bring on Week 2!