//
you're reading...
data visualisation

D3 – another acronym to learn

D3 (which stands for data driven documents ) has been getting a lot of traction over the last few months, with more and more interactive and animated visualisations using this JavaScript library. The author of the library, Mike Bostock, is very active in both developing the library and also in providing a constant stream of examples using the language.

For anyone coming from a ggplot2 background, there are a lot of similarities with certain parts of D3 and the attributes that can be given to objects. There is a fair amount more code to write, but there are a lot of great tutorials out there which give very good introductions to creating good looking visualisations. There’s a bit of a learning curve to using it, but there are lots of tutorials out there which make it easy to get started, for example, here, here and here.

The general idea behind the language is to encode objects, for example, a circle, with various attributes like colour, size and  location. These could either be hard coded, based on a function (e.g. the sine function) or based on a dataset. The additional nice feature of the software is the built in ability to transition between states (e.g. moving a circle from location A to location B) which would normally be difficult to do, and probably appear quite jerky.

For anyone coming from a Tableau background, D3 provides a lot more flexibility in what can be achieved, but is a very code based solution and not a BI solution.

From my experience so far, a specialist HTML editor like Astana Studio is a good place to start for a few reasons, including colour coding for the HTML and also having a built in local web server so that you can quickly preview the results of your code writing.

As an aside, you’ll need a web server of some sort for any D3 code to work (It took me a frustrating hour to figure this out). The alternative to using the built in Astana server is something like using the python simple http server, but I find this a lot more cumbersome.

Oh, and sorry for not having any examples built into the post – WordPress.com doesn’t like having custom JavaScript in posts.

About these ads

Discussion

2 thoughts on “D3 – another acronym to learn

  1. Astana Studio? By any chance to you mean Aptana Studio?

    Posted by Keith | August 18, 2012, 7:56 pm

Trackbacks/Pingbacks

  1. Pingback: Lazy D3 on some astronomical data « Drunks&Lampposts - January 3, 2013

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog Stats

  • 289,986 hits

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 484 other followers

Follow

Get every new post delivered to your Inbox.

Join 484 other followers

%d bloggers like this: