This site is part of a d3.js workshop taking place May 2nd in San Francisco. The workshop is geared towards people who are comfortable with data but haven't gotten deep into web programming. We only have 15 spots total and there will be 5 instructors/TAs supporting you.Click here to apply. If you're accepted, the ticket costs $99.
Just like tributary.io, the demos in this document are explorable! Any text section with a black background is editable. It's an "explorable workshop" and is not intended to stand alone but some may still find it useful. You can find the code for this page at on github.
Find the fullscreen html playground here.
JavaScript lets us change the DOM tree we created with SVG.
Two examples in pseudo code of a non-chainable and chainable API
We can now change SVG styles programmably
Same for SVG attributes
A new way of adding elements.
Documentation: selector.enter()
Documentation: transitions
Documentation: d3.range()
Time to eat!
Assuming our server has a /data/setosa.csv file.
Documentation: d3.csv(), JSON.stringify()
Documentation: d3.nest()
Documentation: d3.layout.pie(), d3.svg.arc()
The result
The result
"A shape generator, such as that returned by d3.svg.arc, is both an object and a function. That is: you can call the shape like any other function, and the shape has additional methods that change its behavior. Like other classes in D3, shapes follow the method chaining pattern where setter methods return the shape itself, allowing multiple setters to be invoked in a concise statement." - D3 Documentation
Documentation: d3.scales.linear()
Documentation: d3.svg.axis()
Documentation: d3.layout.histogram()
See the original by Mike Bostock on bl.ocks.org
Chillax
Now that we know enough D3 to get by, let's setup a D3 project outside of this workshop. (If your computer doesn't already have python, you can download it from: here.)
python -m SimpleHTTPServer
This will start up a local webserver that you can access at: http://localhost:8000/. This your own little private website that only you can access.
Any scripts or data files you load will need to be relative to the directory your server is running from. If we ran our server from ~/Documents/projects/workshop and we had a file called setosa.csv in it, we could load it by using: d3.csv('/setosa.csv', ...);.
The remaining workshop will be more open ended. Pick a data set below to try and visualize.
Here are a few blocks to use as inspiration.