-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path2013-05-03-D3.html
237 lines (176 loc) · 6.36 KB
/
2013-05-03-D3.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>2013-05-03-D3</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<meta name="title" content="2013-05-03-D3"/>
<meta name="generator" content="Org-mode"/>
<meta name="generated" content="2013-05-03 09:41:43 PDT"/>
<meta name="author" content="Jim Blomo"/>
<meta name="description" content=""/>
<meta name="keywords" content=""/>
<link rel="stylesheet" type="text/css" href="production/common.css" />
<link rel="stylesheet" type="text/css" href="production/screen.css" media="screen" />
<link rel="stylesheet" type="text/css" href="production/projection.css" media="projection" />
<link rel="stylesheet" type="text/css" href="production/color-blue.css" media="projection" />
<link rel="stylesheet" type="text/css" href="production/presenter.css" media="presenter" />
<link href='http://fonts.googleapis.com/css?family=Lobster+Two:700|Yanone+Kaffeesatz:700|Open+Sans' rel='stylesheet' type='text/css'>
</head>
<body>
<div id="preamble">
</div>
<div id="content">
<h1 class="title">2013-05-03-D3</h1>
<div id="table-of-contents">
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#sec-1">1 Develop a Visualization</a></li>
<li><a href="#sec-2">2 Deliverable</a></li>
<li><a href="#sec-3">3 Example</a>
<ul>
<li><a href="#sec-3-1">3.1 Notes</a></li>
</ul>
</li>
<li><a href="#sec-4">4 Partners</a>
<ul>
<li><a href="#sec-4-1">4.1 Javascript</a></li>
</ul>
</li>
<li><a href="#sec-5">5 Extra Credit</a>
<ul>
<li><a href="#sec-5-1">5.1 Closer to Grammar</a></li>
</ul>
</li>
<li><a href="#sec-6">6 D3 Intro</a></li>
</ul>
</div>
</div>
<div id="outline-container-1" class="outline-2">
<h2 id="sec-1"><span class="section-number-2">1</span> Develop a Visualization <span class="tag"><span class="slide">slide</span></span></h2>
<div class="outline-text-2" id="text-1">
<ul>
<li>Learn D3
</li>
<li>Extract data from your project
</li>
<li>Build a visualization of it
</li>
</ul>
</div>
</div>
<div id="outline-container-2" class="outline-2">
<h2 id="sec-2"><span class="section-number-2">2</span> Deliverable <span class="tag"><span class="slide">slide</span></span></h2>
<div class="outline-text-2" id="text-2">
<ul>
<li>HTML with visualization
</li>
<li>Dependencies
</li>
</ul>
</div>
</div>
<div id="outline-container-3" class="outline-2">
<h2 id="sec-3"><span class="section-number-2">3</span> Example <span class="tag"><span class="slide">slide</span></span></h2>
<div class="outline-text-2" id="text-3">
<ul>
<li><code>code/histogram.html</code>
</li>
</ul>
<pre class="src src-shell"># extract 2000 reviews
grep 'type<span style="color: #8b2252;">": "</span>review' ../yelp_phoenix_academic_dataset/yelp_academic_dataset_review.json | head -n 200 > reviews-200.json
</pre>
<pre class="src src-python"><span style="color: #a020f0;">import</span> json
<span style="color: #a020f0;">with</span> <span style="color: #7a378b;">open</span>(<span style="color: #8b2252;">"reviews-200.json"</span>) <span style="color: #a020f0;">as</span> f:
r = <span style="color: #7a378b;">map</span>(json.loads, f)
<span style="color: #b22222;"># extract star ratings</span>
[rev[<span style="color: #8b2252;">'stars'</span>] <span style="color: #a020f0;">for</span> rev <span style="color: #a020f0;">in</span> r]
</pre>
</div>
<div id="outline-container-3-1" class="outline-3">
<h3 id="sec-3-1"><span class="section-number-3">3.1</span> Notes <span class="tag"><span class="notes">notes</span></span></h3>
<div class="outline-text-3" id="text-3-1">
<ul>
<li>Include notes on how you extracted your data
</li>
<li>Notes can be in a separate files, or comments in the code
</li>
<li>My notes might be these shell/python commands
</li>
</ul>
</div>
</div>
</div>
<div id="outline-container-4" class="outline-2">
<h2 id="sec-4"><span class="section-number-2">4</span> Partners <span class="tag"><span class="slide">slide</span></span></h2>
<div class="outline-text-2" id="text-4">
<ul>
<li>If you've <b>never</b> written JS on your own:
</li>
<li>Find someone familiar with D3
</li>
<li>Still must turn in separate homeworks
</li>
<li>Cite your sources
</li>
</ul>
</div>
<div id="outline-container-4-1" class="outline-3">
<h3 id="sec-4-1"><span class="section-number-3">4.1</span> Javascript <span class="tag"><span class="notes">notes</span></span></h3>
<div class="outline-text-3" id="text-4-1">
<ul>
<li>Since this class is not teaching Javascript, you'll need to learn on your
own
</li>
<li>Special case: find someone to help you <b>learn</b>
</li>
<li>Folks who know D3: this assignment is not a challenge, so please find
someone to help. Teaching is a great way to learn
</li>
</ul>
</div>
</div>
</div>
<div id="outline-container-5" class="outline-2">
<h2 id="sec-5"><span class="section-number-2">5</span> Extra Credit <span class="tag"><span class="slide">slide</span></span></h2>
<div class="outline-text-2" id="text-5">
<ul>
<li>[[http://trifacta.github.io/vega/][Vega] is a JS visualization Grammer
</li>
<li>Write homework in Vega instead
</li>
</ul>
</div>
<div id="outline-container-5-1" class="outline-3">
<h3 id="sec-5-1"><span class="section-number-3">5.1</span> Closer to Grammar <span class="tag"><span class="notes">notes</span></span></h3>
<div class="outline-text-3" id="text-5-1">
<ul>
<li>Vega is a declarative way of specifying a graphic
</li>
<li>Uses D3 underneath
</li>
</ul>
</div>
</div>
</div>
<div id="outline-container-6" class="outline-2">
<h2 id="sec-6"><span class="section-number-2">6</span> D3 Intro <span class="tag"><span class="slide">slide</span></span></h2>
<div class="outline-text-2" id="text-6">
<ul>
<li><a href="http://vogievetsky.github.io/IntroD3">D3 Intro</a>
</li>
</ul>
<script type="text/javascript" src="production/org-html-slideshow.js"></script>
</div>
</div>
</div>
<div id="postamble">
<p class="date">Date: 2013-05-03 09:41:43 PDT</p>
<p class="author">Author: Jim Blomo</p>
<p class="creator">Org version 7.8.02 with Emacs version 23</p>
<a href="http://validator.w3.org/check?uri=referer">Validate XHTML 1.0</a>
</div>
</body>
</html>