-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
115 lines (95 loc) · 4.24 KB
/
index.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
<!DOCTYPE html>
<html lang="en">
<!-- Metadata -->
<head>
<meta charset="utf-8">
<!-- Title -->
<title>Assignment: Brushing & Linking in D3</title>
<!-- CSS Styling -->
<link rel="stylesheet" href="style.css">
<!-- Favicons -->
<link rel="apple-touch-icon" sizes="180x180" href="favicons/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="favicons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="favicons/favicon-16x16.png">
<link rel="manifest" href="favicons/site.webmanifest">
<link rel="shortcut icon" href="favicons/favicon.ico">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="msapplication-config" content="favicons/browserconfig.xml">
<meta name="theme-color" content="#ffffff">
</head>
<!-- Main page content -->
<body>
<!-- Update this with your GitHub repo URL -->
<span id="forkongithub"><a href="https://github.com/phly95/brushNLink">Fork me on GitHub</a></span>
<!-- Writeup -->
<div class="content-column">
<h1>Assignment: Brushing & Linking in D3</h1>
<p>
In this assignment you will learn about how to implement brushing and linking.
</p>
<h2>Murder, Poverty, and Unemployment in Texas</h2>
<p>
The line chart and scatterplot below show murder, poverty, and unemployment rates from 1996 to 2017 in Texas, USA.
They are interactively connected via <strong><a href="https://infovis-wiki.net/wiki/Linking_and_Brushing">brushing and linking</a></strong>.
</p>
<p>
If you drag a brush across the marks in one view the marks are selected and highlighted.
This is an example of brushing.
In general, <strong>brushing</strong> means selecting as subset of the data marks with an input device which is usually paired with adding a pop-out channel to the marks to highlight them.
</p>
<p>
You will notice that brushing in one visualization causes marks in the other view to be highlighed too.
This is an example of brushing and linking working together.
In <strong>linking</strong>, the same brush effect (pop-out, highlighting) is applied to marks in other visualizations that correspond to the same datums.
</p>
<p>
What interesting patterns can you see in the data using brushing and linking?
How is year related to unemployment rate?
</p>
</div>
<!-- Visualization goes here -->
<div class="vis-holder" style="max-width:1024px; margin: auto;">
<div class="linechart-holder" id="linechart"></div>
<div class="scatterplot-holder" id="scatterplot"></div>
</div>
<div class="table-holder" id="table">
<table class="noselect">
<thead>
<tr>
<th>Year</th>
<th>Poverty</th>
<th>Unemployment</th>
<th>Murder</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
<!-- Further writeup -->
<div class="content-column">
<h2>Acknowledgments</h2>
<p>
<em>List here where any code, packages/libraries, text, images, designs, etc. that you leverage come from.</em>
</p>
<ul>
<li><a href="https://d3js.org/">D3: Data-Driven Documents</a> by Mike Bostock. In particular:
<ul>
<li><a href="https://github.com/d3/d3-brush">d3-brush</a>, which let you select a one- or two-dimensional
region using the mouse or touch. We use it for brushing.</li>
<li><a href="https://github.com/d3/d3-dispatch">d3-dispatch</a>, which lets you register named callbacks and
call them with arguments. We use it for linking.</li>
</ul>
</li>
<li><a href="https://codepo8.github.io/css-fork-on-github-ribbon/#">Pure CSS responsive "Fork me on GitHub" ribbon</a> by Chris Heilmann.</li>
<li>Data from Truth in Accounting's <a href="https://www.statedatalab.org/state_data_and_comparisons/">State Data Lab</a>.</li>
</ul>
</div>
<!-- Scripts at the end avoid need for dealing with async, defer, or onload event handlers -->
<script src="lib/d3.v5.12.0/d3.min.js"></script>
<script src="js/scatterplot.js"></script>
<script src="js/linechart.js"></script>
<script src="js/visualization.js"></script>
<script src="js/table.js"></script>
</body>
</html>