Skip to content

Instantly share code, notes, and snippets.

@brendansudol
Created July 23, 2012 13:04
Show Gist options
  • Save brendansudol/3163521 to your computer and use it in GitHub Desktop.
Save brendansudol/3163521 to your computer and use it in GitHub Desktop.
Learning D3 - a (possibly) helpful roadmap

Learning D3

1. Read Up

Spend a few hours (minimum) going through these materials. It's okay if you don't understand half of it on your first time through (75% is way too much though). I found it super helpful to write out the code snippets and test them out while following along. There are now quite a few D3 tutorials out there, but I found these particularly helpful:

  1. Intro by Mike Bostock, D3 Creator
  2. D3 Workshop (just skim through)
  3. Three Little Circles
  4. A Bar Chart
  5. Tutorial by Scott Murray

And plenty more tutorials can be found here

2. Get Some Code

Open Terminal and let's download the d3 library

git clone https://github.com/mbostock/d3.git

Open up folder in your favorite editor (textmate example below)

cd d3/
mate .

Now, let's fire up our local web server (examples won't properly otherwise)

python -m SimpleHTTPServer

In Chrome/FF/Safari, navigate to this page

http://127.0.0.1:8000/examples/

Go through most/all of them so you can see what d3 can do (short answer: anything!)

3. Tweaking

The examples are awesome, but also pretty complicated. I'd suggest:

  1. Focus on a few of the simpler examples (line chart, bar chart)
  2. In your editor, make some small tweaks to the file (e.g., try to adjust colors, change width of bars, radius of circles, etc.) and see what happens in your browser.

4. Pick an example and personalize

Go through D3 Gallery (or examples from above) and pick one that you want to use Etsy data with.

Try to sub out current data with Etsy data (either csv or json format for now), change around variables names, and try to get it to work (this can sometimes take awhile)

Make enhancements and improvise (transitions, tooltips, anything!), debug, and repeat!

Ask Questions!

D3 is hard and takes a looong time to feel comfortable with (I'm not there yet either). The API Reference and Google Group are your friends.

And of course feel free to ask Chuck, Wil, or Bren about anything and we can try to help :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment