Hunch

22

Easy data visualization with WebKit

November 26 by Rasmus Andersson, tagged cocui, spotify, visualization and real-time, filed under software

At Spotify, we recently put up two large TV screens on the walls of our Stockholm office (most R&D is done there). The idea is to visualize & communicate that “stuff is happening” without actually revealing any critical data (since a lot of external people are visiting the office).

Today me, Andreas Öman and Emil Hesslow — fellow Spotifiers — kicked off a cozy little Hack Night at the office, trying to create something simple yet impressive to have running on one of the TV screens.

We ended up writing a real-time search query visualization in just about a few hours. It looks like this and is smoothly animated:

Screen shot

Try a demo version here… (Tested in Safari, iPhone, Firefox and Chrome).

How did we manage to build a real-time scalable system and high-performance viz in such an awfully short time?!

Hack nightWell, for starters we used WebKit through Cocui which instantly gave us full screen high-performance hardware-accelerated drawing (yes, it’s a long sentence with cool words but those things shouldn’t be taken for granted).

But… where does the data come from? From the internets? — Not really, but it sure travels in internets-style. We use a dumb pub/sub message queue. In one end a client (the WebKit/Cocui app in HTML/JavaScript) is listening (subscribing). In the other end one of our search servers are pushing messages into the queue in batches.

[batch of search queries during last minute]
                   ||
                   ||
                   \/
             [message queue]
              ||        ||
              ||        ||
              \/        \/
           [client]  [client]

The client simply enqueues these search queries when they are delivered while at the same time dequeueing search queries. We do it this way (batches and a queue) because we simply have too high rate of searches. It would be almost impossible to read anything if we actually sent every single message. To give the feeling of real time we use a random delay when dequeueing queries.

When a query is dequeued it’s formatted into a chunk of HTML (a div and an a tag) and then prepended to the body using jQuery with animated effects.

Don’t forget to try the demo version (Does not work in Internet Explorer) which is simply the client without any real-time data. Note that this demo uses static data for demonstration purposes, not an actual real-time stream. The real-time data stream is only available within our office and thus not available for public use.

Update: Successfully tested with iPhone, Firefox and Chrome — thank you readers!

Here’s the full Cocui demo application: sptv1-demo-cocui-app.zip (for Mac OS X 10.5 and newer).

The Hidden Cost of War

October 28, 2008 by Rasmus, tagged politics, video, visualization and war

Volumeone worked with Good Magazine to develop this motion piece on the 3 Trillion Dollar Iraq War for the Transparency section of their new website. The overall concept of a diagrammatic “War Machine” takes the viewer through the ten stages of aggregated war costs.

The Hidden Cost of War on Good.is →

Hunch Timeline

September 7, 2008 by Rasmus, tagged aggregation, hunch, timeline and visualization


Hunch Timeline displays events in the beginning of August 2008

Since the first deployment of Hunch Aggregator I’ve had the idea of visualizing the aggregated data in a timeline. Since then I’ve written some timeline visualizations and backends – none of them really good. Today I found out about MIT SIMILE Timeline. I’ve used this piece of open source software to create the Hunch Timeline.

By passing any ISO 8601 date with the URL hash/anchor, you can initiate the viewport at a specific time. Examples:

Please note that the timeline data sets are huge, which might result in long loading times.

You navigate and scroll the timeline simply by clicking and dragging with your mouse, or by using the arrow keys on your keyboard.

Google Trends – The Big Picture

August 13, 2008 by Rasmus, tagged trends, visualization and web

bigpicture

An aggregate collection of activity graphs from Google Trends for Websites. A mashup by Jim Bumgardner of krazydad.com and coverpop.com.

1

Britain visualized from above

August 5, 2008 by Rasmus, tagged bbc, britain and visualization

Amazing data visualization of daily Britain. The upcoming series Britain from Above makes use of satellite technology to create stunning images of Britain from above. Mark Sanders reports.

Andrew Marr presents the series Britain from Above, the first episode of which will be broadcast on Sunday 10 August at 2100 on BBC One.

Via BBC News

Flight Patterns Visualization

June 3, 2008 by Rasmus, tagged animation, aviation, data, usa and visualization

Flight Patterns Visualization

Aaron Koblin presents “Flight Patterns”, originally developed as a series of expirments for the project “Celestial Mechanics” by collegues Scott Hessels and Gabriel Dunne at UCLA. FAA data was parsed and plotted using the Processing programming environment.

More information on Aarons UCLA website.