forked from markmarkoh/datamaps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbombs.js
274 lines (265 loc) · 6.97 KB
/
bombs.js
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
var bombs = [
{
name: 'Gerboise Bleue',
radius: 0,
yeild: 70,
country: 'France',
significance: 'First fission weapon test by France',
date: '1960-02-13',
fillKey: 'FRA',
latitude: -0.325,
longitude: 26.1840
}, {
name: 'Canopus',
radius: 0,
yeild: 2600,
country: 'France',
significance: 'First "staged" thermonuclear test by France',
fillKey: 'FRA',
date: '1968-08-24',
latitude: -22.15,
longitude: -138.45
}, {
name: 'Smiling Buddha',
radius: 0,
yeild: 12,
country: 'India',
significance: 'First fission nuclear explosive test by India',
fillKey: 'IND',
date: '1974-05-18',
latitude: 27.095,
longitude: 71.753
}, {
name: 'Pokhran-II',
radius: 0,
yeild: 60,
country: 'India',
fillKey: 'IND',
significance: 'First potential fusion/boosted weapon test by India; first deployable fission weapon test by India',
date: '1998-05-11',
latitude: 27.07884,
longitude: 71.72211
}, {
name: '2006 North Korean nuclear test',
radius: 0,
yeild: 1,
country: 'North Korea',
fillKey: 'PRK',
significance: 'First fission plutonium-based device tested by North Korea; likely resulted as a fizzle',
date: '2006-10-09',
latitude: 40.5743,
longitude: 129.2012
}, {
name: '2009 North Korean nuclear test',
radius: 0,
yeild: 15,
country: 'North Korea',
significance: 'First successful fission device tested by North Korea',
date: '2009-05-25',
fillKey: 'PRK',
latitude: 41.306,
longitude: 129.029
}, {
name: 'Chagai-I',
radius: 0,
yeild: 40,
country: 'Pakistan',
significance: 'First fission weapon (boosted) test by Pakistan',
fillKey: 'PAK',
date: '1998-05-28',
latitude: 30.12,
longitude: 67.01
}, {
name: 'Chagai-II',
radius: 0,
yeild: 20,
country: 'Pakistan',
significance: 'Second fission weapon (boosted) test by Pakistan',
fillKey: 'PAK',
date: '1998-05-30',
latitude: 30.22,
longitude: 67.11
}, {
name: '596',
radius: 0,
yeild: 22,
country: 'PR China',
significance: 'First fission weapon test by the People\'s Republic of China',
fillKey: 'PRC',
date: '1964-10-16',
latitude: 42.35,
longitude: 88.30
}, {
name: 'Test No. 6',
radius: 0,
yeild: 3300,
country: 'PR China',
fillKey: 'PRC',
significance: 'First "staged" thermonuclear weapon test by the People\'s Republic of China',
date: '1967-06-17',
latitude: 40.10,
longitude: 90.35
}, {
name: 'Hurricane',
radius: 0,
yeild: 25,
country: 'UK',
significance: 'First fission weapon test by the UK',
fillKey: 'GBR',
date: '1952-10-03',
latitude: -20.25,
longitude: 115.33
}, {
name: 'Grapple X',
radius: 0,
yeild: 1800,
country: 'UK',
fillKey: 'GBR',
significance: 'First (successful) "staged" thermonuclear weapon test by the UK',
date: '1957-11-08',
latitude: 1.53,
longitude: -157.24
},
{
name: 'Trinity',
radius: 0,
yeild: 19,
country: 'USA',
fillKey: 'USA',
significance: 'First fission device test, first plutonium implosion detonation ',
date: '1945-07-16',
latitude: 33.4038,
longitude: -106.2831
},{
name: 'Little Boy',
radius: 0,
yeild: 13,
country: 'USA',
fillKey: 'USA',
significance: 'Bombing of Hiroshima, Japan, first detonation of an enriched uranium gun-type device, first use of a nuclear device in military combat.',
date: '1945-08-06',
latitude: 34.237,
longitude: 132.2719
},{
name: 'Fat Man',
radius: 0,
yeild: 20,
fillKey: 'USA',
country: 'USA',
significance: 'Bombing of Nagasaki, Japan, second and last use of a nuclear device in military combat.',
date: '1945-08-09',
latitude: 32.4625,
longitude: 129.5147
},{
name: 'Ivy Mike',
radius: 0,
yeild: 10400,
country: 'USA',
fillKey: 'USA',
significance: 'First cryogenic fusion fuel "staged" thermonuclear weapon, primarily a test device and not weaponized',
date: '1952-11-01',
latitude: 11.40,
longitude: 162.1113
},{
name: 'Castle Bravo',
radius: 0,
yeild: 15000,
country: 'USA',
significance: 'First dry fusion fuel "staged" thermonuclear weapon; a serious nuclear fallout accident occurred',
fillKey: 'USA',
date: '1954-03-01',
latitude: 11.415,
longitude: 165.1619
},{
name: 'RDS-1',
radius: 0,
yeild: 22,
country: 'USSR',
fillKey: 'RUS',
significance: 'First fission weapon test by the USSR',
date: '1949-08-29',
latitude: 50.2615,
longitude: 77.4851
},{
name: 'Joe 4',
radius: 0,
yeild: 400,
country: 'USSR',
fillKey: 'RUS',
significance: 'First fusion weapon test by the USSR (not "staged")',
date: '1953-08-12',
latitude: 50.07,
longitude: 78.43
},{
name: 'RDS-37',
radius: 0,
yeild: 1600,
country: 'USSR',
fillKey: 'RUS',
significance: 'First "staged" thermonuclear weapon test by the USSR (deployable)',
date: '1955-11-22',
latitude: 50.07,
longitude: 78.43
},{
name: 'Tsar Bomba',
radius: 0,
yeild: 50000,
country: 'USSR',
fillKey: 'RUS',
significance: 'Largest thermonuclear weapon ever tested—scaled down from its initial 100 Mt design by 50%',
date: '1961-10-31',
latitude: 73.482,
longitude: 54.5854
}
];
//prep the data
var yields = bombs.map(function(bomb) {
return bomb['yeild'];
});
var min = d3.min( yields );
var max = d3.max( yields );
var scale = d3.scale.pow()
.domain([min, max])
.range([10, 45]);
bombs.each(function(bomb) {
bomb['radius'] = scale( bomb['yeild']);
});
console.log(bombs);
new Datamap({
element: document.getElementById('map_bombs'),
scope: 'world',
bubbles: bombs,
bubbleConfig: {
popupTemplate:function (geography, data) {
return ['<div class="hoverinfo"><strong>' + data.name + '</strong>',
'<br/>Payload: ' + data.yeild + ' kilotons',
'<br/>Country: ' + data.country + '',
'<br/>Date: ' + data.date + '',
'</div>'].join('');
},
geographyConfig: {
popupOnHover: false,
highlightOnHover: false
},
fills: {
'USA': '#1f77b4',
'RUS': '#9467bd',
'PRK': '#ff7f0e',
'PRC': '#2ca02c',
'IND': '#e377c2',
'GBR': '#8c564b',
'FRA': '#d62728',
'PAK': '#7f7f7f',
defaultFill: '#EDDC4E'
},
data: {
'RUS': {fillKey: 'RUS'},
'PRK': {fillKey: 'PRK'},
'PRC': {fillKey: 'PRC'},
'IND': {fillKey: 'IND'},
'GBR': {fillKey: 'GBR'},
'FRA': {fillKey: 'FRA'},
'PAK': {fillKey: 'PAK'},
'USA': {fillKey: 'USA'}
}
});