krz/world-incarceration

An interactive map of world incarceration statistics.

clone: git clone https://gitbay.org/krz/world-incarceration.git

v1: index.html · raw

  1<!DOCTYPE html>
  2<html lang="en">
  3	<head>
  4		<title>World Incarceration</title>
  5		<meta charset="UTF-8" />
  6		<meta name="viewport" content="width=device-width, initial-scale=1" />
  7		<meta
  8			name="description"
  9			content="An interactive world map of incarceration statistics with optional choropleth overlays. Explore the map, compare countries, and dive into the source data."
 10		/>
 11		<link
 12			rel="apple-touch-icon"
 13			sizes="57x57"
 14			href="./assets/images/icons/apple-icon-57x57.png"
 15		/>
 16		<link
 17			rel="apple-touch-icon"
 18			sizes="60x60"
 19			href="./assets/images/icons/apple-icon-60x60.png"
 20		/>
 21		<link
 22			rel="apple-touch-icon"
 23			sizes="72x72"
 24			href="./assets/images/icons/apple-icon-72x72.png"
 25		/>
 26		<link
 27			rel="apple-touch-icon"
 28			sizes="76x76"
 29			href="./assets/images/icons/apple-icon-76x76.png"
 30		/>
 31		<link
 32			rel="apple-touch-icon"
 33			sizes="114x114"
 34			href="./assets/images/icons/apple-icon-114x114.png"
 35		/>
 36		<link
 37			rel="apple-touch-icon"
 38			sizes="120x120"
 39			href="./assets/images/icons/apple-icon-120x120.png"
 40		/>
 41		<link
 42			rel="apple-touch-icon"
 43			sizes="144x144"
 44			href="./assets/images/icons/apple-icon-144x144.png"
 45		/>
 46		<link
 47			rel="apple-touch-icon"
 48			sizes="152x152"
 49			href="./assets/images/icons/apple-icon-152x152.png"
 50		/>
 51		<link
 52			rel="apple-touch-icon"
 53			sizes="180x180"
 54			href="./assets/images/icons/apple-icon-180x180.png"
 55		/>
 56		<link
 57			rel="icon"
 58			type="image/png"
 59			sizes="192x192"
 60			href="./assets/images/icons/android-icon-192x192.png"
 61		/>
 62		<link
 63			rel="icon"
 64			type="image/png"
 65			sizes="32x32"
 66			href="./assets/images/icons/favicon-32x32.png"
 67		/>
 68		<link
 69			rel="icon"
 70			type="image/png"
 71			sizes="96x96"
 72			href="./assets/images/icons/favicon-96x96.png"
 73		/>
 74		<link
 75			rel="icon"
 76			type="image/png"
 77			sizes="16x16"
 78			href="./assets/images/icons/favicon-16x16.png"
 79		/>
 80		<link rel="manifest" href="./assets/images/icons/manifest.json" />
 81		<meta name="msapplication-TileColor" content="#ffffff" />
 82		<meta
 83			name="msapplication-TileImage"
 84			content="./assets/images/icons/ms-icon-144x144.png"
 85		/>
 86		<meta name="theme-color" content="#ffffff" />
 87		<link rel="stylesheet" href="./assets/css/bootstrap-5.0.0.min.css" />
 88		<link rel="stylesheet" href="./assets/css/fontawesome-5.1.10.min.css" />
 89		<link rel="stylesheet" href="./assets/css/app.css" />
 90	</head>
 91
 92	<body>
 93		<!-- navbar -->
 94		<nav class="navbar navbar-expand-lg navbar-dark">
 95			<div class="container-fluid">
 96				<a class="navbar-brand mx-2" href="./">World Incarceration</a>
 97				<button
 98					class="navbar-toggler"
 99					type="button"
100					data-bs-toggle="collapse"
101					data-bs-target="#navbarSupportedContent"
102					aria-controls="navbarSupportedContent"
103					aria-expanded="false"
104					aria-label="Toggle navigation"
105				>
106					<span class="navbar-toggler-icon"></span>
107				</button>
108				<div
109					class="collapse navbar-collapse"
110					id="navbarSupportedContent"
111				>
112					<ul class="navbar-nav ms-auto me-0 mb-2 mb-lg-0">
113						<li class="nav-item dropdown">
114							<button
115								class="btn btn-warning"
116								data-toggle="dropdown"
117								role="button"
118								aria-haspopup="true"
119								aria-expanded="false"
120							>
121								<svg
122									xmlns="http://www.w3.org/2000/svg"
123									width="24"
124									height="24"
125									viewBox="0 0 24 24"
126								>
127									<path
128										id="settings-icon"
129										d="M24 14.187v-4.374c-2.148-.766-2.726-.802-3.027-1.529-.303-.729.083-1.169 1.059-3.223l-3.093-3.093c-2.026.963-2.488 1.364-3.224 1.059-.727-.302-.768-.889-1.527-3.027h-4.375c-.764 2.144-.8 2.725-1.529 3.027-.752.313-1.203-.1-3.223-1.059l-3.093 3.093c.977 2.055 1.362 2.493 1.059 3.224-.302.727-.881.764-3.027 1.528v4.375c2.139.76 2.725.8 3.027 1.528.304.734-.081 1.167-1.059 3.223l3.093 3.093c1.999-.95 2.47-1.373 3.223-1.059.728.302.764.88 1.529 3.027h4.374c.758-2.131.799-2.723 1.537-3.031.745-.308 1.186.099 3.215 1.062l3.093-3.093c-.975-2.05-1.362-2.492-1.059-3.223.3-.726.88-.763 3.027-1.528zm-4.875.764c-.577 1.394-.068 2.458.488 3.578l-1.084 1.084c-1.093-.543-2.161-1.076-3.573-.49-1.396.581-1.79 1.693-2.188 2.877h-1.534c-.398-1.185-.791-2.297-2.183-2.875-1.419-.588-2.507-.045-3.579.488l-1.083-1.084c.557-1.118 1.066-2.18.487-3.58-.579-1.391-1.691-1.784-2.876-2.182v-1.533c1.185-.398 2.297-.791 2.875-2.184.578-1.394.068-2.459-.488-3.579l1.084-1.084c1.082.538 2.162 1.077 3.58.488 1.392-.577 1.785-1.69 2.183-2.875h1.534c.398 1.185.792 2.297 2.184 2.875 1.419.588 2.506.045 3.579-.488l1.084 1.084c-.556 1.121-1.065 2.187-.488 3.58.577 1.391 1.689 1.784 2.875 2.183v1.534c-1.188.398-2.302.791-2.877 2.183zm-7.125-5.951c1.654 0 3 1.346 3 3s-1.346 3-3 3-3-1.346-3-3 1.346-3 3-3zm0-2c-2.762 0-5 2.238-5 5s2.238 5 5 5 5-2.238 5-5-2.238-5-5-5z"
130									/>
131								</svg>
132							</button>
133							<div class="dropdown-menu">
134								<a
135									class="dropdown-item"
136									href="#"
137									onclick="countryLabels()"
138									>Labels</a
139								>
140								<a
141									class="dropdown-item"
142									href="#"
143									onclick="reset()"
144									>Reset Map</a
145								>
146							</div>
147						</li>
148						<li class="nav-item">
149							<button
150								id="gradientbtn"
151								type="button"
152								class="btn selected"
153								data-toggle="collapse"
154								data-target="#gbar"
155								title="Gradient Maps"
156								onclick="gradientPrep()"
157							>
158								<svg
159									xmlns="http://www.w3.org/2000/svg"
160									width="24"
161									height="24"
162									viewBox="0 0 24 24"
163								>
164									<path
165										d="M13.144 8.171c-.035-.066.342-.102.409-.102.074.009-.196.452-.409.102zm-2.152-3.072l.108-.031c.064.055-.072.095-.051.136.086.155.021.248.008.332-.014.085-.104.048-.149.093-.053.066.258.075.262.085.011.033-.375.089-.304.171.096.136.824-.195.708-.176.225-.113.029-.125-.097-.19-.043-.215-.079-.547-.213-.68l.088-.102c-.206-.299-.36.362-.36.362zm13.008 6.901c0 6.627-5.373 12-12 12-6.628 0-12-5.373-12-12s5.372-12 12-12c6.627 0 12 5.373 12 12zm-8.31-5.371c-.006-.146-.19-.284-.382-.031-.135.174-.111.439-.184.557-.104.175.567.339.567.174.025-.277.732-.063.87-.025.248.069.643-.226.211-.381-.355-.13-.542-.269-.574-.523 0 0 .188-.176.106-.166-.218.027-.614.786-.614.395zm6.296 5.371c0-1.035-.177-2.08-.357-2.632-.058-.174-.189-.312-.359-.378-.256-.1-1.337.597-1.5.254-.107-.229-.324.146-.572.008-.12-.066-.454-.515-.605-.46-.309.111.474.964.688 1.076.201-.152.852-.465.992-.038.268.804-.737 1.685-1.251 2.149-.768.694-.624-.449-1.147-.852-.275-.211-.272-.66-.55-.815-.124-.07-.693-.725-.688-.813l-.017.166c-.094.071-.294-.268-.315-.321 0 .295.48.765.639 1.001.271.405.416.995.748 1.326.178.178.858.914 1.035.898.193-.017.803-.458.911-.433.644.152-1.516 3.205-1.721 3.583-.169.317.138 1.101.113 1.476-.029.433-.37.573-.693.809-.346.253-.265.745-.556.925-.517.318-.889 1.353-1.623 1.348-.216-.001-1.14.36-1.261.007-.094-.256-.22-.45-.353-.703-.13-.248-.015-.505-.173-.724-.109-.152-.475-.497-.508-.677-.002-.155.117-.626.28-.708.229-.117.044-.458.016-.656-.048-.354-.267-.646-.53-.851-.389-.299-.188-.537-.097-.964 0-.204-.124-.472-.398-.392-.564.164-.393-.44-.804-.413-.296.021-.538.209-.813.292-.346.104-.7-.082-1.042-.125-1.407-.178-1.866-1.786-1.499-2.946.037-.19-.114-.542-.048-.689.158-.352.48-.747.762-1.014.158-.15.361-.112.547-.229.287-.181.291-.553.572-.781.4-.325.946-.318 1.468-.388.278-.037 1.336-.266 1.503-.06 0 .038.191.604-.019.572.433.023 1.05.749 1.461.579.211-.088.134-.736.567-.423.262.188 1.436.272 1.68.069.15-.124.234-.93.052-1.021.116.115-.611.124-.679.098-.12-.044-.232.114-.425.025.116.055-.646-.354-.218-.667-.179.131-.346-.037-.539.107-.133.108.062.18-.128.274-.302.153-.53-.525-.644-.602-.116-.076-1.014-.706-.77-.295l.789.785c-.039.025-.207-.286-.207-.059.053-.135.02.579-.104.347-.055-.089.09-.139.006-.268 0-.085-.228-.168-.272-.226-.125-.155-.457-.497-.637-.579-.05-.023-.764.087-.824.11-.07.098-.13.201-.179.311-.148.055-.287.126-.419.214l-.157.353c-.068.061-.765.291-.769.3.029-.075-.487-.171-.453-.321.038-.165.213-.68.168-.868-.048-.197 1.074.284 1.146-.235.029-.225.046-.487-.313-.525.068.008.695-.246.799-.36.146-.168.481-.442.724-.442.284 0 .223-.413.354-.615.131.053-.07.376.087.507-.01-.103.445.057.489.033.104-.054.684-.022.594-.294-.1-.277.051-.195.181-.253-.022.009.34-.619.402-.413-.043-.212-.421.074-.553.063-.305-.024-.176-.52-.061-.665.089-.115-.243-.256-.247-.036-.006.329-.312.627-.241 1.064.108.659-.735-.159-.809-.114-.28.17-.509-.214-.364-.444.148-.235.505-.224.652-.476.104-.178.225-.385.385-.52.535-.449.683-.09 1.216-.041.521.048.176.124.104.324-.069.19.286.258.409.099.07-.092.229-.323.298-.494.089-.222.901-.197.334-.536-.374-.223-2.004-.672-3.096-.672-.236 0-.401.263-.581.412-.356.295-1.268.874-1.775.698-.519-.179-1.63.66-1.808.666-.065.004.004-.634.358-.681-.153.023 1.247-.707 1.209-.859-.046-.18-2.799.822-2.676 1.023.059.092.299.092-.016.294-.18.109-.372.801-.541.801-.505.221-.537-.435-1.099.409l-.894.36c-1.328 1.411-2.247 3.198-2.58 5.183-.013.079.334.226.379.28.112.134.112.712.167.901.138.478.479.744.74 1.179.154.259.41.914.329 1.186.108-.178 1.07.815 1.246 1.022.414.487.733 1.077.061 1.559-.217.156.33 1.129.048 1.368l-.361.093c-.356.219-.195.756.021.982 1.818 1.901 4.38 3.087 7.22 3.087 5.517 0 9.989-4.472 9.989-9.989zm-11.507-6.357c.125-.055.293-.053.311-.22.015-.148.044-.046.08-.1.035-.053-.067-.138-.11-.146-.064-.014-.108.069-.149.104l-.072.019-.068.087.008.048-.087.106c-.085.084.002.139.087.102z"
166									/>
167								</svg>
168							</button>
169						</li>
170						<li class="nav-item" data-toggle="modal">
171							<button
172								id="comparebtn"
173								type="button"
174								class="btn btn-success text-white"
175								data-toggle="tooltip"
176								data-placement="bottom"
177								title="Compare"
178								onclick="compare()"
179							>
180								<svg
181									xmlns="http://www.w3.org/2000/svg"
182									width="24"
183									height="24"
184									viewBox="0 0 24 24"
185								>
186									<path
187										d="M6 11v-4l-6 5 6 5v-4h12v4l6-5-6-5v4z"
188									/>
189								</svg>
190							</button>
191						</li>
192						<li
193							class="nav-item"
194							data-toggle="modal"
195							data-target="#graphModal"
196						>
197							<button
198								id="graphsbtn"
199								type="button"
200								class="btn btn-secondary text-dark"
201								data-toggle="tooltip"
202								data-placement="bottom"
203								title="Graphs"
204							>
205								<svg
206									xmlns="http://www.w3.org/2000/svg"
207									width="24"
208									height="24"
209									viewBox="0 0 24 24"
210								>
211									<path
212										d="M13.012 5.007v-1.668l2.802-2.771c.409.136.809.293 1.197.471l-3.999 3.968zm7.089-1.93l-7.089 7.058v.853h.877l7.044-7.076c-.263-.292-.541-.57-.832-.835zm-7.089-1.468l1.437-1.406c-.46-.094-.96-.163-1.437-.203v1.609zm10.789 7.962l-1.386 1.417h1.585c-.04-.47-.106-.964-.199-1.417zm-.363-1.366c-.135-.41-.292-.81-.469-1.199l-3.951 3.982h1.668l2.752-2.783zm-1.063-2.337c-.205-.346-.426-.682-.664-1.004l-6.093 6.124h1.668l5.089-5.12zm-3.225-3.57c-.322-.238-.657-.459-1.003-.665l-5.135 5.104v1.668l6.138-6.107zm-8.15 10.702v-13c-6.161.519-11 5.683-11 11.978 0 6.639 5.382 12.022 12.021 12.022 6.296 0 11.46-4.839 11.979-11h-13z"
213									/>
214								</svg>
215							</button>
216						</li>
217						<li
218							class="nav-item"
219							data-toggle="modal"
220							data-target="#infoModal"
221						>
222							<button
223								id="infobtn"
224								type="button"
225								class="btn btn-primary text-white"
226								data-toggle="tooltip"
227								data-placement="bottom"
228								title="Information"
229							>
230								<svg
231									xmlns="http://www.w3.org/2000/svg"
232									width="24"
233									height="24"
234									viewBox="0 0 24 24"
235								>
236									<path
237										d="M13.25 7c0 .69-.56 1.25-1.25 1.25s-1.25-.56-1.25-1.25.56-1.25 1.25-1.25 1.25.56 1.25 1.25zm10.75 5c0 6.627-5.373 12-12 12s-12-5.373-12-12 5.373-12 12-12 12 5.373 12 12zm-2 0c0-5.514-4.486-10-10-10s-10 4.486-10 10 4.486 10 10 10 10-4.486 10-10zm-13-2v2h2v6h2v-8h-4z"
238									/>
239								</svg>
240							</button>
241						</li>
242						<li
243							class="nav-item"
244							data-toggle="modal"
245							data-target="#alertModal"
246						>
247							<button
248								id="alertbtn"
249								type="button"
250								class="btn btn-danger text-white"
251								data-toggle="tooltip"
252								data-placement="bottom"
253								title="Precautions"
254							>
255								<svg
256									xmlns="http://www.w3.org/2000/svg"
257									width="24"
258									height="24"
259									viewBox="0 0 24 24"
260								>
261									<path
262										d="M12 5.177l8.631 15.823h-17.262l8.631-15.823zm0-4.177l-12 22h24l-12-22zm-1 9h2v6h-2v-6zm1 9.75c-.689 0-1.25-.56-1.25-1.25s.561-1.25 1.25-1.25 1.25.56 1.25 1.25-.561 1.25-1.25 1.25z"
263									/>
264								</svg>
265							</button>
266						</li>
267					</ul>
268				</div>
269			</div>
270		</nav>
271
272		<!-- gradient bar menu -->
273		<nav id="gbar" class="collapse-navbar collapse">
274			<div class="d-flex flex-row-reverse">
275				<button
276					id="totPop"
277					type="button"
278					class="btn selected"
279					data-toggle="tooltip"
280					title="Total Prison Populations"
281					onclick="gradient(0)"
282				>
283					Total Prison Population
284				</button>
285				<button
286					id="perCapita"
287					type="button"
288					class="btn"
289					data-toggle="tooltip"
290					title="Prisoners Per Capita"
291					onclick="gradient(1)"
292				>
293					Prisoners Per Capita
294				</button>
295				<button
296					id="women"
297					type="button"
298					class="btn"
299					data-toggle="tooltip"
300					title="Percent Women Imprisoned"
301					onclick="gradient(2)"
302				>
303					Percent Women Imprisoned
304				</button>
305				<button
306					id="juveniles"
307					type="button"
308					class="btn"
309					data-toggle="tooltip"
310					title="Percent Juveniles Imprisoned"
311					onclick="gradient(3)"
312				>
313					Percent Juveniles Imprisoned
314				</button>
315				<button
316					id="occupancy"
317					type="button"
318					class="btn"
319					data-toggle="tooltip"
320					title="Prison Occupancy Level"
321					onclick="gradient(4)"
322				>
323					Prison Occupancy Level
324				</button>
325			</div>
326		</nav>
327
328		<!-- infomation modal -->
329		<div class="modal fade" id="infoModal" role="dialog">
330			<div class="modal-dialog modal-lg">
331				<!-- Modal content-->
332				<div class="modal-content">
333					<div class="modal-header bg-primary">
334						<h4 class="modal-title">Information</h4>
335					</div>
336					<div class="modal-body">
337						<p>
338							Hover over any country to view its name and click to
339							see its statistics!
340						</p>
341						<p>
342							To reset the map, please click the
343							<b>Reset Map</b> button.
344						</p>
345						<p>
346							If you'd like to compare two countries' statistics,
347							please use the <b>Compare</b> button.
348						</p>
349						<p>
350							If you are wondering how to go back to the pie chart
351							in the <b>Graphs</b> modal: all you have to do is
352							click on the line and it will return to the pie
353							chart!
354						</p>
355						<hr />
356						<p><b>References:</b></p>
357						<div class="row">
358							<div class="col-sm-6">
359								<a
360									class="btn btn-primary w-100"
361									href="http://www.prisonstudies.org"
362									target="_blank"
363									>World Prison Brief</a
364								>
365							</div>
366							<div class="col-sm-6">
367								<a
368									class="btn btn-primary w-100"
369									href="https://en.wikipedia.org/wiki/List_of_countries_by_system_of_government"
370									target="_blank"
371									>Wikipedia</a
372								>
373							</div>
374						</div>
375					</div>
376					<div class="modal-footer">
377						<button
378							type="button"
379							class="btn btn-outline-primary"
380							data-dismiss="modal"
381						>
382							Close
383						</button>
384					</div>
385				</div>
386			</div>
387		</div>
388
389		<!-- alert modal -->
390		<div class="modal fade" id="alertModal" role="dialog">
391			<div class="modal-dialog modal-lg">
392				<!-- Modal content-->
393				<div class="modal-content">
394					<div class="modal-header bg-danger">
395						<h4 class="modal-title">Precautions</h4>
396					</div>
397					<div class="modal-body">
398						<p>
399							If any part of this site is inaccurate or confusing,
400							<a class="text-danger" href="#"
401								>send me an email</a
402							>!
403						</p>
404					</div>
405					<div class="modal-footer">
406						<button
407							type="button"
408							class="btn btn-outline-danger"
409							data-dismiss="modal"
410						>
411							Close
412						</button>
413					</div>
414				</div>
415			</div>
416		</div>
417
418		<!-- graph modal -->
419		<div class="modal fade" id="graphModal" role="dialog">
420			<div class="modal-dialog modal-lg">
421				<!-- Modal content-->
422				<div class="modal-content">
423					<div class="modal-header bg-secondary text-dark">
424						<h4 class="modal-title">Top Five Prison Populations</h4>
425					</div>
426					<div class="modal-body">
427						<div id="myChart2"></div>
428						<div id="myNextChart"></div>
429					</div>
430					<div class="modal-footer">
431						<button
432							type="button"
433							class="btn btn-primary"
434							data-dismiss="modal"
435							onclick="graphInfoBtn()"
436						>
437							Help!
438						</button>
439						<button
440							type="button"
441							class="btn btn-secondary"
442							data-dismiss="modal"
443						>
444							Close
445						</button>
446					</div>
447				</div>
448			</div>
449		</div>
450
451		<!-- map area -->
452		<div id="myChart"></div>
453
454		<!-- js -->
455		<script src="./assets/js/jquery-3.5.1.min.js"></script>
456		<script src="./assets/js/bootstrap.bundle.min.js"></script>
457		<script src="./assets/js/zingchart-2.9.2.min.js"></script>
458		<script src="./assets/js/zingchart-maps-2.9.2.min.js"></script>
459		<script src="./assets/js/zingchart-maps-world-countries-2.9.2.min.js"></script>
460		<script src="./assets/js/app.js"></script>
461	</body>
462</html>