-
Notifications
You must be signed in to change notification settings - Fork 0
/
crime_nibrs.html
150 lines (131 loc) · 6.35 KB
/
crime_nibrs.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
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-99359926-4"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag('js', new Date());
gtag('config', 'UA-99359926-4');
</script>
<title>Crimes in the United States | Jacob Kaplan</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="author" content="Jacob Kaplan">
<meta name="description" content="Explore crime and clearances by
arrest data in the United States. All of the data comes from the
FBI's National Incident-Based Reporting System (NIBRS)">
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.13.0/moment.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/chart.js@2.8.0"></script>
<script src="https://cdn.jsdelivr.net/npm/hammerjs@2.0.8"></script>
<script src="data/data.js"></script>
<script src="js/utils.js"></script>
<script src="js/change_funs.js"></script>
<script src="js/graph.js"></script>
<script src="js/table.js"></script>
<script src="js/graph_table.js"></script>
<script src="js/datatool.js"></script>
<script src="js/dynamic_url.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.9.1/underscore-min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/v/dt/dt-1.10.16/b-1.5.1/b-html5-1.5.1/fc-3.2.4/r-2.2.1/datatables.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<script src="js/chosen.jquery.js"></script>
<link href='//fonts.googleapis.com/css?family=PT+Sans+Narrow:400,700%7CPT+Serif:400,700,400italic' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="css/test.css" />
<link rel="stylesheet" href="css/misc.css" />
<link type="text/css" rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" />
<link type="text/css" rel="stylesheet" href="http://gregfranko.com/jquery.selectBoxIt.js/css/jquery.selectBoxIt.css" />
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
<script src="http://gregfranko.com/jquery.selectBoxIt.js/js/jquery.selectBoxIt.min.js"></script>
<link rel="stylesheet" href="css/style.css" />
</head>
<body>
<div class="navigation-wrapper"></div>
<script>
ks()
$(function() {
$('.footer-wrap').load("reusable_js.html .foot");
$('.navigation-wrapper').load("reusable_js.html #navigation-wrapper");
})
</script>
<div class="column sidebar">
<h2>Crime (NIBRS)</h2>
<p>Enter a police agency to see its crime over time.</p>
<h3>State:</h3>
<br>
<select id="state_dropdown" onchange="stateChangeFun('nibrs', nibrs_state_values, nibrs_crime_values['offense'])">
</select>
<br><br>
<h3>Agency:</h3>
<br>
<select class="simple-select" id="agency_dropdown" onchange="agencyChangeFun('nibrs', nibrs_state_values, nibrs_crime_values['offense'])">
</select>
<br><br>
<h3>Crime:</h3>
<br>
<select class="simple-select" id="crime_dropdown" onchange="agencyChangeFun('nibrs', nibrs_state_values, nibrs_crime_values['offense'])">
</select>
<br><br>
<input type="checkbox" id="rate" name="rate" value="rate" onchange="nibrsPopBoxChange(rate)">
<label class="label-text fa" for="rate">Rate per 100,000 Population</label>
<hr>
<br><br>
<input type="checkbox" id="percent_of_crimes" name="percent_of_crimes" value="percent_of_crimes"
onchange="nibrsPopBoxChange(percent_of_crimes)">
<label class="label-text fa" for="percent_of_crimes">% of Crimes</label>
<hr>
<br><br>
<h3>Category:</h3>
<br>
<select class="simple-select" id="category_dropdown" onchange="nibrcategoryChange()"></select>
<br>
<h3>Subcategory:</h3>
<br>
<select class="simple-select" id="subcategory_dropdown" onchange = "nibrsubcategoryChange()"></select>
<br><br>
<input type="checkbox" checked id="checkbox_1" onchange="checkboxesUpdate('nibrs', '#checkbox_1')"></input>
<label class="hint--right" for="checkbox_1"></label>
<br>
<input type="checkbox" id="checkbox_2" onchange="checkboxesUpdate('nibrs', '#checkbox_1')"></input>
<label class="hint--right" for="checkbox_2"></label>
<br>
<input type="checkbox" id="checkbox_3" onchange="checkboxesUpdate('nibrs', '#checkbox_1')"></input>
<label class="hint--right" for="checkbox_3"></label>
<br>
<input type="checkbox" id="checkbox_4" onchange="checkboxesUpdate('nibrs', '#checkbox_1')"></input>
<label class="hint--right" for="checkbox_4"></label>
<br>
<input type="checkbox" id="checkbox_5" onchange="checkboxesUpdate('nibrs', '#checkbox_1')"></input>
<label class="hint--right" for="checkbox_5"></label>
<br>
<input type="checkbox" id="checkbox_6" onchange="checkboxesUpdate('nibrs', '#checkbox_1')"></input>
<label class="hint--right" for="checkbox_6"></label>
<br>
<input type="checkbox" id="checkbox_7" onchange="checkboxesUpdate('nibrs', '#checkbox_1')"></input>
<label class="hint--right" for="checkbox_7"></label>
<hr>
<input type="checkbox" id="monthly" onchange="agencyChangeFun('nibrs', nibrs_state_values, nibrs_crime_values['offense'])"></input>
<label class="label-text fa" for="monthly">Monthly Data (large file size)</label>
<hr>
<button type="button" onclick="exportToCsv(all_data, 'nibrs', nibrs_state_values)">Download All Agency Data as CSV</button>
<br>
<p>Please note that data are only available for agencies that report all 12 months of the year.</p>
</div>
<div class="column main">
<div id="loader"></div>
<canvas id="graph" style="width:95%;height:500px;"></canvas>
<div>
<table id="table" class="display cell-border"></table>
</div>
<script>
main("nibrs", nibrs_state_values, 3, nibrs_crime_values['offense'], "murder_nonnegligent_manslaughter");
</script>
</div>
<div class="footer-wrap"></div>
</body>
</html>