2013-05-03-D3
Table of Contents
1 Develop a Visualization
- Learn D3
- Extract data from your project
- Build a visualization of it
2 Deliverable
- HTML with visualization
- Dependencies
3 Example
code/histogram.html
# extract 2000 reviews
grep 'type": "review' ../yelp_phoenix_academic_dataset/yelp_academic_dataset_review.json | head -n 200 > reviews-200.json
import json with open("reviews-200.json") as f: r = map(json.loads, f) # extract star ratings [rev['stars'] for rev in r]
3.1 Notes notes
- Include notes on how you extracted your data
- Notes can be in a separate files, or comments in the code
- My notes might be these shell/python commands
4 Partners
- If you've never written JS on your own:
- Find someone familiar with D3
- Still must turn in separate homeworks
- Cite your sources
4.1 Javascript notes
- Since this class is not teaching Javascript, you'll need to learn on your own
- Special case: find someone to help you learn
- Folks who know D3: this assignment is not a challenge, so please find someone to help. Teaching is a great way to learn
5 Extra Credit
- [[http://trifacta.github.io/vega/][Vega] is a JS visualization Grammer
- Write homework in Vega instead
5.1 Closer to Grammar notes
- Vega is a declarative way of specifying a graphic
- Uses D3 underneath