name: inverse layout: true class: left, top, inverse
- Learn D3
- Extract data from your project
- Build a visualization of it
- HTML with visualization
- Dependencies
.tight-code[
code/histogram.html
# extract 2000 reviews
grep 'type": "review' 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]
]
???
- 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
- If you've never written JS on your own:
- Find someone familiar with D3
- Still must turn in separate homeworks
- Cite your sources
???
- 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
- Vega is a JS visualization Grammer
- Write homework in Vega instead
???
- Vega is a declarative way of specifying a graphic
- Uses D3 underneath