Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
417 lines (387 loc) · 21.6 KB
/
Copy pathindex.html
File metadata and controls
417 lines (387 loc) · 21.6 KB
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
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>The Office — Character Importance Dashboard</title>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link href="https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Lora:ital,wght@0,400;0,700;1,700&family=Open+Sans:wght@400;600;700&display=swap" rel="stylesheet" />
<link rel="stylesheet" href="css/style.css" />
</head>
<body>
<header class="site-header">
<div class="brand">
<h1>THE OFFICE</h1>
<p class="tagline">a character importance dashboard</p>
</div>
<div class="brand-meta">
<span>NBC · 2005–2013 · 9 Seasons · 186 Episodes</span>
</div>
</header>
<section class="overview">
<div class="overview-text">
<h2>About the show</h2>
<p>
<em>The Office</em> (US) is a mockumentary sitcom, Created by <strong>Greg Daniels</strong>, that aired on
<strong>NBC</strong> from <strong>March 24, 2005</strong> to
<strong>May 16, 2013</strong>. Adapted from the British series of the same name,
the show follows the day-to-day lives of the employees at the
<strong>Dunder Mifflin Paper Company</strong> branch in Scranton, Pennsylvania,
filmed in faux-documentary style.
</p>
<p>
Across <strong>9 seasons and 186 episodes</strong>, the ensemble is anchored by
regional manager <strong>Michael Scott</strong> (Steve Carell, S1–7),
salesman <strong>Jim Halpert</strong>, receptionist (later artist/sales rep)
<strong>Pam Beesly</strong>, and eccentric beet-farming salesman
<strong>Dwight Schrute</strong>. Around them rotates a deep cast of
accountants, salespeople, warehouse staff, and corporate types —
Andy, Angela, Kevin, Oscar, Stanley, Phyllis, Kelly, Ryan, Toby, Erin,
Darryl and many more.
</p>
</div>
<aside class="overview-stats">
<div class="stat"><div class="stat-num">9</div><div class="stat-lbl">Seasons</div></div>
<div class="stat"><div class="stat-num">186</div><div class="stat-lbl">Episodes</div></div>
<div class="stat"><div class="stat-num">2005–13</div><div class="stat-lbl">On Air</div></div>
<div class="stat"><div class="stat-num">NBC</div><div class="stat-lbl">Network</div></div>
<div class="stat stat-wide"><div class="stat-num">Mockumentary Sitcom</div><div class="stat-lbl">Genre</div></div>
</aside>
</section>
<section class="controls">
<div class="control-group">
<label for="season-select">Season filter</label>
<select id="season-select">
<option value="all">All seasons</option>
<option value="1">Season 1</option>
<option value="2">Season 2</option>
<option value="3">Season 3</option>
<option value="4">Season 4</option>
<option value="5">Season 5</option>
<option value="6">Season 6</option>
<option value="7">Season 7</option>
<option value="8">Season 8</option>
<option value="9">Season 9</option>
</select>
</div>
<div class="control-group">
<span class="control-label">Rank characters by</span>
<div class="metric-toggle" role="radiogroup" aria-label="Rank characters by">
<label><input type="radio" name="metric" value="lines" checked /> Lines spoken</label>
<label><input type="radio" name="metric" value="words" /> Words spoken</label>
<label><input type="radio" name="metric" value="episodes" /> Episodes appeared</label>
</div>
</div>
<div class="control-group control-actions">
<button id="reset-btn" type="button">Reset selection</button>
</div>
</section>
<section class="viz">
<div class="panel panel-bar">
<h3>Character importance <span class="panel-sub" id="bar-subtitle">— all seasons</span></h3>
<p class="caption">
Click any bar (or character name) to spotlight that character in the heatmap.
Use the toggle above to rank by lines, words, or episode appearances.
</p>
<div id="bar-chart" class="chart"></div>
</div>
<div class="panel panel-heatmap">
<h3>Episode-by-episode appearances</h3>
<p class="caption">
Each cell is one episode (left → right = chronological).
Color intensity shows how many lines that character spoke. Click a season label to filter; hover any cell for details.
</p>
<div id="heatmap" class="chart"></div>
</div>
</section>
<section class="level-2">
<h2 class="section-title">What do characters say? <span class="level-badge">Level 2</span></h2>
<div class="controls">
<div class="control-group">
<label for="char-select-l2">Character</label>
<select id="char-select-l2">
<option value="">— Choose a character —</option>
</select>
</div>
<div class="control-group">
<label for="season-select-l2">Season</label>
<select id="season-select-l2">
<option value="all">All seasons</option>
<option value="1">Season 1</option>
<option value="2">Season 2</option>
<option value="3">Season 3</option>
<option value="4">Season 4</option>
<option value="5">Season 5</option>
<option value="6">Season 6</option>
<option value="7">Season 7</option>
<option value="8">Season 8</option>
<option value="9">Season 9</option>
</select>
</div>
<div class="control-group control-actions">
<label> </label>
<button id="reset-l2-btn" type="button">Clear selection</button>
</div>
</div>
<div class="viz-level2">
<div class="panel panel-wordcloud">
<h3>Word frequency cloud</h3>
<p class="caption">
Most frequently used words (stop words removed). Word size represents frequency.
Hover for exact counts.
</p>
<div id="wordcloud" class="chart"></div>
</div>
<div class="panel panel-topwords">
<h3>Top 20 words by frequency</h3>
<p class="caption">
Ranked list showing word counts and percentage of character's total dialogue.
</p>
<div id="top-words-list" class="chart"></div>
</div>
</div>
<div class="viz-level2">
<div class="panel panel-phrases">
<h3>Most common phrases</h3>
<p class="caption">
Frequently repeated multi-word phrases and catchphrases.
Shows count and first episode of appearance.
</p>
<div id="phrases" class="chart"></div>
</div>
<div class="panel panel-seasonal">
<h3>Word frequency by season</h3>
<p class="caption">
How the character's top words change across seasons.
Select a season to focus on word frequency patterns.
</p>
<div class="seasonal-controls">
<label for="season-select-seasonal">Filter by season:</label>
<select id="season-select-seasonal">
<option value="all">All seasons</option>
<option value="1">Season 1</option>
<option value="2">Season 2</option>
<option value="3">Season 3</option>
<option value="4">Season 4</option>
<option value="5">Season 5</option>
<option value="6">Season 6</option>
<option value="7">Season 7</option>
<option value="8">Season 8</option>
<option value="9">Season 9</option>
</select>
</div>
<div id="seasonal-chart" class="chart"></div>
</div>
</div>
</section>
<section class="level-3">
<h2 class="section-title">Who shares the screen? <span class="level-badge">Level 3</span></h2>
<div class="controls">
<div class="control-group">
<label for="season-select-l3">Season filter</label>
<select id="season-select-l3">
<option value="all">All seasons</option>
<option value="1">Season 1</option>
<option value="2">Season 2</option>
<option value="3">Season 3</option>
<option value="4">Season 4</option>
<option value="5">Season 5</option>
<option value="6">Season 6</option>
<option value="7">Season 7</option>
<option value="8">Season 8</option>
<option value="9">Season 9</option>
</select>
</div>
<div class="control-group control-actions">
<button id="reset-l3-btn" type="button">Reset</button>
</div>
</div>
<div class="viz-level3">
<div class="panel panel-chord">
<h3>Character co-occurrence <span class="panel-sub" id="chord-subtitle">— all seasons</span></h3>
<p class="caption">
Chord thickness shows how often two characters share a scene.
Hover a character arc to isolate their connections; hover a chord for details.
</p>
<div id="chord-chart" class="chart"></div>
</div>
<div class="panel panel-pairs">
<h3>Strongest character pairs</h3>
<p class="caption">
Top 10 character pairs ranked by number of shared scenes.
</p>
<div id="top-pairs" class="chart"></div>
</div>
</div>
</section>
<section class="level-4">
<h2 class="section-title">Inside The Office <span class="level-badge">Level 4</span></h2>
<p class="section-intro">
Two views that look at <em>what is said</em> across the whole show and <em>who is said it with</em>:
a phrase tracker (when a catchphrase first appears, how it spreads, and who repeats it most),
and a 25×25 co-scene matrix (which character pairs actually share scenes — click a cell
to see what they talk about when they're both there).
</p>
<div class="viz-level4">
<div class="panel panel-phrase-tracker">
<h3>Phrase tracker <span class="panel-sub">— when does a line catch on?</span></h3>
<p class="caption">
Search any word or phrase, or pick a famous Office catchphrase. See its first &
last appearance, frequency over the run of the show, and who said it most.
</p>
<div class="phrase-controls">
<input id="phrase-input" type="text" placeholder='e.g. "that's what she said", "false", "parkour"' />
<button id="phrase-go" type="button">Search</button>
</div>
<div class="phrase-presets">
<span class="preset-label">Quick picks:</span>
<button class="preset-btn" data-q="that's what she said">"that's what she said"</button>
<button class="preset-btn" data-q="false">"false"</button>
<button class="preset-btn" data-q="bears">"bears"</button>
<button class="preset-btn" data-q="identity theft">"identity theft"</button>
<button class="preset-btn" data-q="parkour">"parkour"</button>
<button class="preset-btn" data-q="bankruptcy">"bankruptcy"</button>
<button class="preset-btn" data-q="schrute">"schrute"</button>
<button class="preset-btn" data-q="pretzel">"pretzel"</button>
</div>
<div id="phrase-stats" class="phrase-stats"></div>
<h4 class="sub-h">Frequency over time (one dot = one episode)</h4>
<div id="phrase-timeline" class="chart"></div>
<h4 class="sub-h">Top speakers of this phrase</h4>
<div id="phrase-speakers" class="chart"></div>
</div>
<div class="panel panel-coscene">
<h3>Character co-scene matrix <span class="panel-sub">— who shares a scene with whom?</span></h3>
<p class="caption">
Each cell is a pair of characters; color shows the number of distinct scenes they both
appear in across all 186 episodes. Click any cell to see the words those two characters
use most when they’re in the same scene.
</p>
<div id="coscene-matrix" class="chart"></div>
<h4 class="sub-h"><span id="pair-title">Click a cell above to inspect a pair</span></h4>
<div id="pair-words" class="chart"></div>
</div>
</div>
</section>
<section class="design-notes">
<details>
<summary><strong>Design notes & justification</strong> (click to expand)</summary>
<div class="notes-body">
<h4>Tasks supported</h4>
<ol>
<li><strong>Show overview</strong> — the header and stats panel give the network, run dates, season/episode counts, genre, and a short prose intro to the central characters.</li>
<li><strong>Importance overall & per-season</strong> — the bar chart ranks characters by either lines, words, or episodes appeared. The season dropdown (and clicking a season label in the heatmap) re-computes the ranking for just that season, so a viewer can compare e.g. Andy in S8 vs. the show as a whole.</li>
<li><strong>Per-episode appearances for major characters</strong> — the heatmap shows one row per major character and one column per episode, color-encoded by lines spoken in that episode. Empty (gray) cells = the character didn’t speak that episode. Season dividers segment the timeline.</li>
<li><strong>Character co-occurrence</strong> — the chord diagram shows which characters share scenes most often. Each arc is a character, and each chord connecting two arcs is sized by how many scenes they both spoke in. The season dropdown re-builds the diagram for just that season, so you can see e.g. how Michael’s scene partners shift from S1 to S7, or who fills the gap in S8–9. The top-10 pairs bar chart gives the exact counts.</li>
</ol>
<h4>Visual encoding choices</h4>
<ul>
<li><strong>Horizontal bar chart</strong> for ranked importance: bar length is the most accurate visual channel for quantitative comparison, and horizontal bars give long character names room to breathe.</li>
<li><strong>Heatmap</strong> for character × episode: with ~25 characters × 186 episodes (~4,650 cells), a heatmap is the most space-efficient way to expose appearance patterns — you can see seasons where a character vanishes (Michael after S7), recurring guests, and standout episodes (high-line bursts) at a glance.</li>
<li><strong>Square-root color scale</strong> on the heatmap so a few high-line "Michael episodes" don’t crush the rest of the palette into invisibility.</li>
<li><strong>Brushing & linking</strong>: selecting a character in the bar chart highlights its row in the heatmap; choosing a season in the dropdown both re-ranks the bar chart and dims non-matching episodes in the heatmap. This keeps the two views consistent and supports answering "who matters in S6?" and "where in S6 did Andy actually show up?" together.</li>
<li><strong>Tooltips</strong> for details-on-demand instead of cluttering the chart with labels.</li>
<li><strong>Wikipedia link</strong> next to each bar (the small <span class="wiki-icon-inline">w</span>) for the optional "link out" requirement.</li>
<li><strong>Chord diagram</strong> for co-occurrence: character interactions form a weighted network (who shares scenes with whom), and a chord diagram is a natural fit, since arc length encodes how connected a character is overall, and chord thickness encodes the strength of a specific pairing. Hovering an arc dims all unrelated chords so you can isolate one character’s connections without losing context.</li>
<li><strong>Top pairs bar chart</strong> alongside the chord diagram: chords are good for seeing the overall shape of the network but hard to rank precisely. For example, is the Michael to Jim chord thicker than Michael toDwight? The bar chart answers that a little more directly.</li>
</ul>
<h4>Who is included</h4>
<p>
The dataset has hundreds of named speakers, most of whom appear once.
To keep the dashboard about meaningful characters we include only speakers
with <strong>≥ 100 total lines</strong> AND appearing in
<strong>≥ 5 episodes</strong>, then take the top characters by total lines
(capped at 25 to keep the heatmap readable).
Compound speakers like “Jim & Pam” and group labels (“Everyone”,
“All”) are excluded; small typo variants
(“Michael:”, “DeAngelo”) are normalized to their canonical
form. This excludes one-line guest characters but keeps every recurring
character with a meaningful presence in at least a few episodes.
</p>
<h4>Theme</h4>
<p>
The cream/mustard/dark-brown palette and Bebas Neue title evoke the
show’s opening titles and Dunder Mifflin’s drab office aesthetic.
</p>
<h4>Level 4 — Inside The Office</h4>
<p>
Two new views were added that exploit two pieces of the dataset Levels 1&2
ignored: the raw <code>line</code> text (for free-text search) and the per-episode
<code>scene</code> column (for co-presence analysis).
</p>
<p><strong>Phrase tracker.</strong> The Office is a show built on running gags
("That’s what she said", "False", "Bears, beets…", "Identity theft is not
a joke, Jim"). The user wants to know:
<em>when did this gag start? when did it die? and which characters carry it?</em>
The view answers all three:</p>
<ul>
<li><strong>Stat strip</strong> — total uses, # episodes that contain it,
first appearance (S?E?), last appearance, and the peak season — details on
demand without reading the chart.</li>
<li><strong>Timeline dot/area chart</strong> — one mark per episode along the
chronological X axis (with season dividers carried over from the heatmap so users
can map between views). Empty episodes are visible as gaps, which is the whole point
when you’re asking "when does it disappear?".</li>
<li><strong>Top-speakers bar</strong> — bars are the right channel for
"who said it most" because the question is a strict ranking.</li>
<li><strong>Quick-pick buttons</strong> for famous catchphrases avoid making the
user remember exact spellings; a free-text search box covers everything else.</li>
</ul>
<p class="sketch">Sketch:
<code>[ search box ] [Go]</code><br/>
<code>[ catchphrase chips… ]</code><br/>
<code>[ stat: 142 uses · S2E2 first · S9E20 last · in 76 eps ]</code><br/>
<code>timeline: · ·· ····· · · ·· · ·</code><br/>
<code>speakers: Michael ████████ Dwight ███ Andy ██ …</code>
</p>
<p><strong>Character co-scene matrix.</strong> "Who actually talks to whom?" is the
natural follow-up to Level 1’s "who’s important?". Two characters can both
appear in many episodes without ever sharing a scene (e.g. corporate visitors vs the
warehouse), and the show has clear sub-cliques (the salespeople, the accountants, the
warehouse). A 25×25 matrix is the right encoding because:</p>
<ul>
<li>It shows <strong>all</strong> pairs at once — cliques pop out as bright
rectangular blocks, isolates as dim rows.</li>
<li>The diagonal (a character paired with themselves) is set to "all scenes the
character is in" so the row/column can be read as marginal totals as well.</li>
<li>Both axes are sorted by total importance (same order as the Level 1 bar chart),
so the eye finds Michael at the top-left automatically.</li>
<li><strong>Click any cell</strong> to drill in: a small bar list shows the most
common (non-stopword) words that <em>either</em> character speaks <em>only when both
are in the scene together</em>. This is how the user answers "do Jim and Pam say
different things to each other than Jim and Michael do?" — they click two cells
and compare.</li>
</ul>
<p class="sketch">Sketch:
<code> M D J P A…</code><br/>
<code>Michael ░ █ █ █ █ ← row reads as "everyone Michael shares scenes with"</code><br/>
<code>Dwight █ ░ █ █ █</code><br/>
<code>Jim █ █ ░ █ █</code><br/>
<code>Pam █ █ █ ░ ▓</code><br/>
<code>… (click a cell → below: top words for that pair)</code>
<h4>Why option 2 (co-occurrence) for Level 3</h4>
<p>
Level 2 already covers what characters say, so Level 3 picks up option 2
— who speaks with whom. The Office is an ensemble show and character
pairings drive most of the comedy (Jim to Dwight, Michael to Toby,
Jim to Pam), so a co-occurrence view felt more revealing than duplicating
text analysis. The transcript data includes scene numbers per episode, which
gives a clean way to infer who appears together without guessing from
adjacent lines.
</p>
</div>
</details>
</section>
<footer class="site-footer">
<p>
Data: <code>The-Office-Lines-V4.csv</code> ·
Built with <a href="https://d3js.org">D3.js</a> ·
CS5124 Project 3
</p>
</footer>
<div id="tooltip" class="tooltip" style="opacity:0"></div>
<script src="js/d3.v6.min.js"></script>
<script src="js/main.js"></script>
</body>
</html>