Caleb Madrigal

Programming, Hacking, Math, and Art

 

Simple D3 demos

I've been playing with d3 recently, and it awesome! I'm especially amazed by the ease of animating transitions with it.

There are plenty of amazing d3 demos out there, but I wanted to write some simpler ones to help me understand the basics of d3. You can find them here:

http://calebmadrigal.github.io/d3-demos/

For example, here's how to draw a circle with d3:

Code:

  var width = 200;
  var height = 200;

  var x = width/2;
  var y = height/2;
  var ...