forked from dataarts/armsglobe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
executable file
·226 lines (197 loc) · 8.56 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
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
<!doctype html>
<html lang="en">
<head>
<title>Interactive Globe: Small Arms Imports & Exports</title>
<meta charset="utf-8">
<meta name="viewport" content="user-scalable=no, minimum-scale=1.0, maximum-scale=1.0, initial-scale=1">
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body onload="start()" id="dataviz" class="">
<div id="wrapper">
<div id="loading">
<h2>Loading Small Arms and Ammunition Trade Data from 1992 to 2010. Please wait...</h2>
</div>
<div >
<table id="marker_template" class="marker" style="left:'0px';top:'0px'"><tr><td><span id="countryText" class="country">
</span></td><td class="detail" id="detailText">
<!--<span id="detailText" class="detail">
</span>--></td></tr></table>
</div>
<div id="visualization" >
<!-- 2D overlay elements go in here -->
<div id="glContainer">
<!-- 3D webgl canvas here -->
</div>
</div>
<script src="js/Detector.js"></script>
<script src="js/Tween.js"></script>
<script src="js/dat.gui.min.js"></script>
<script src="js/Three.js"></script>
<script src="js/THREEx.KeyboardState.js"></script>
<script src="js/THREEx.WindowResize.js"></script>
<script src="js/Stats.js"></script>
<script src="js/jquery-1.7.1.min.js"></script>
<script src="js/jquery-ui-1.8.21.custom.min.js"></script>
<script src="js/RequestAnimationFrame.js"></script>
<script src="js/ShaderExtras.js"></script>
<script src="js/canvg.js"></script>
<script src="js/rgbcolor.js"></script>
<script src="js/innersvg.js"></script>
<script src="js/util.js"></script>
<script src="js/mousekeyboard.js"></script>
<script src="js/datguicontrol.js"></script>
<script src="js/dataloading.js"></script>
<script src="js/camerastates.js"></script>
<script src="js/geopins.js"></script>
<script src="js/visualize.js"></script>
<script src="js/visualize_lines.js"></script>
<script src="js/markers.js"></script>
<script src="js/svgtoy.js" type="text/javascript"></script>
<script src="js/d3.v2.min.js"></script>
<script src="js/ui.controls.js"></script>
<script type="x-shader/x-vertex" id="vertexshader">
uniform float amplitude;
attribute float size;
attribute vec3 customColor;
varying vec3 vColor;
void main() {
vColor = customColor;
vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );
gl_PointSize = size;
gl_Position = projectionMatrix * mvPosition;
}
</script>
<script type="x-shader/x-fragment" id="fragmentshader">
uniform vec3 color;
uniform sampler2D texture;
varying vec3 vColor;
void main() {
gl_FragColor = vec4( color * vColor, 1.0 );
gl_FragColor = gl_FragColor * texture2D( texture, gl_PointCoord );
}
</script>
<script id="globeVertexShader" type="x-shader/x-vertex">
varying vec3 vNormal;
varying vec2 vUv;
void main() {
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0);
vNormal = normalize( normalMatrix * normal );
vUv = uv;
}
</script>
<script id="globeFragmentShader" type="x-shader/x-fragment">
uniform sampler2D mapIndex;
uniform sampler2D lookup;
uniform sampler2D outline;
uniform float outlineLevel;
varying vec3 vNormal;
varying vec2 vUv;
void main() {
vec4 mapColor = texture2D( mapIndex, vUv );
float indexedColor = mapColor.x;
vec2 lookupUV = vec2( indexedColor, 0. );
vec4 lookupColor = texture2D( lookup, lookupUV );
float mask = lookupColor.x + (1.-outlineLevel) * indexedColor;
mask = clamp(mask,0.,1.);
float outlineColor = texture2D( outline, vUv ).x * outlineLevel;
float diffuse = mask + outlineColor;
gl_FragColor = vec4( vec3(diffuse), 1. );
// gl_FragColor = vec4( lookupColor );
// gl_FragColor = vec4(texture2D( lookup, vUv ).xyz,1.);
}
</script>
<script src="js/main.js" type="text/javascript"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-7963116-1']);
_gaq.push(['_setDomainName', 'chromeexperiments.com']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<!-- All other hud can go here-->
<div id="hudHeader" class="overlayCountries noPointer">
<h1 class="noPointer">Small Arms and Ammunition — Imports & Exports
<div class="subtitle">An interactive visualization of government-authorized small arms and ammunition transfers from 1992 to 2010. </div>
</h1>
</div>
<div class="overlayCountries noPointer" id="hudButtons">
<input type="button" value="SEARCH" class="searchBtn armsBtn pointer">
<input type="text" name="country" class="countryTextInput pointer noMapDrag" value="UNITED STATES">
<input type="button" value="—" class="zoomBtn zoomOutBtn armsBtn pointer noMapDrag">
<input type="button" value="+" class="zoomBtn zoomInBtn armsBtn pointer noMapDrag">
<input type="button" value="ABOUT" class="aboutBtn armsBtn pointer"><br class="clear" />
</div>
<div id="history" class="overlayCountries noPointer">
<div class="graph">
<div class="close"></div>
<div class="labels">
<div class="change">RELATIVE PERCENT CHANGE</div>
<div class="exports">EXPORTS</div>
<div class="imports">IMPORTS</div><br class="clear" />
</div>
<div class="container noPointer"></div>
</div>
<ul class="timeline pointer">
<li>1992</li>
<li>93</li>
<li>94</li>
<li>95</li>
<li>96</li>
<li>97</li>
<li>98</li>
<li>99</li>
<li>2000</li>
<li>01</li>
<li>02</li>
<li>03</li>
<li>04</li>
<li>05</li>
<li>06</li>
<li>07</li>
<li>08</li>
<li>09</li>
<li>2010</li>
<div id="handle" class="noMapDrag"></div>
</ul>
</div>
<div id="graphIcon" class="overlayCountries"></div>
<div id="importExportBtns" class="overlayCountries">
<div class="typeLabels">
<div class="mil">Military</div>
<div class="civ">Civilian</div>
<div class="ammo">Ammo</div><br class="clear">
</div>
<div class="imports imex">
<div class="mil"><div class="check"></div></div>
<div class="civ"><div class="check"></div></div>
<div class="ammo"><div class="check"></div></div>
<div class="label">Imports</div><br class="clear">
</div>
<div class="exports imex">
<div class="mil"><div class="check"></div></div>
<div class="civ"><div class="check"></div></div>
<div class="ammo"><div class="check"></div></div>
<div class="label">Exports</div><br class="clear">
</div>
<br class="clear" />
</div>
<div id="aboutContainer" class='overlayCountries'>
<div class="arrowUp"></div>
<div id="aboutBox">
<div class="title">Information about the data</div>
<div class="text">
This data visualization was produced by Google as part of the <a href="http://www.google.com/ideas" target="_blank">Google Ideas</a> INFO (Illicit Networks, Forces in Opposition) Summit with support from the <a href="http://igarape.org.br/" target="_blank">Igarape Institute</a> and data provided by the <a href="http://www.prio.no/" target="_blank">Peace Research Institute Oslo (PRIO)</a> small arms database. The visualization includes >1 million individual import and export data points from annual custom reports and maps the transfer of small arms, light weapons and ammunition across 250 nation states and territories around the world between 1992 and 2010.
</div>
<div class="links">
<br>
For more info, please see the <a href="http://igarape.org.br/armsglobe" target="_blank">FAQs</a>.
</div>
</div>
</div>
</div>
</body>
</html>