Abandoned Wig
Hi, I'm Martin.
I work on the Web Platform at Igalia.

Node.js Knockout

30 August 2010
I participated in the Node.js Knockout this year, kindly hosted by Fortnight Labs. Our team became a bit smaller as we neared the competition, so we decided to make something dead simple. When you're making software, it's good to have a vision statement. Even if you don't finish the software, you'll at least have a well-constructed sentence, which is progress. Frankly, I was too embarrassed to mention my vision statement to my teammate, Josh.

Each tweet is a tiny burst of light illuminating a cold, dark world.

My opinion is that if you're not inspired after reading that, you've probably lost the ability to feel actual human emotions such as hope, rage, and yellow. We decided to make a Twitter visualization for people like you.

I'd never written anything on node.js before this competition and it did nothing but impress me. Node.js is built from the ground up with asynchronicity in mind, so ideally you aren't bound by the overhead of creating one thread per connection. Think Twisted. We also used Socket.IO, which made WebSockets sinfully pleasant.

My partner, Josh, handled the server-side part of the application and I generally worked on the client-side1. My favorite challenge was calculating the Robinson Projection for mapping latitude and longitude onto the map surface. It turns out that Robinson, unlike most projection progenitors, relied on lookup tables and interpolation rather than providing a set of formulas only. I was easily able to port some Robinson Projection code from Java (which had itself been ported from C). It was some time later that I realized I had to scale the resulting numbers by the limits of projection output. It all seemed so obvious later on.

In any case, I hope this amuses you for a couple seconds. The code will be on github after it's been cleaned up and licensed.


  1. I clumsily contributed a last minute cache optimization which had a negligible effect on the output.