Commit efeb1cd3 authored by Christopher S Barnett's avatar Christopher S Barnett
Browse files

Merge branch 'merge-layers'

# Conflicts:
#	app/data/world_50m.json
#	app/dist/js/app.js
parents 518c0914 9baf6660
......@@ -27,6 +27,7 @@ html, body /*, and all other map parent selectors*/
width: auto;
height: 100%;
margin: 0;
border-right: 1px solid rgb(38, 38, 38);
}
div#legend {
......@@ -239,7 +240,9 @@ div#splash-screen h1 {
.result-row .selection {
color: #eeeeee;
/*
white-space: nowrap;
*/
}
.result-row .result-counter {
......
This diff is collapsed.
This diff is collapsed.
......@@ -8,6 +8,14 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<!--
<meta property="og:url" content="https://streams-dev.it.tufts.edu/wpf/index.html" />
<meta property="og:title" content="Corrupt Arms Deals" />
<meta property="og:description" content="This map presents a compendium of cases of corruption in the international
arms trade and broader military sector, as part of World Peace Foundation’s ongoing program on the
Global Arms Trade and Corruption." />
<meta property="og:image" content="https://streams-dev.it.tufts.edu/wpf/images/preview_image.jpg" />
-->
<title>Corrupt Arms Deals</title>
......@@ -125,8 +133,13 @@
<script type="text/template" id="sel-label-template">
<div><%= val %> <% if (showRemove) { %><span class="glyphicon glyphicon-remove-circle remove-selection"></span> <% }
%>
<div><% if (showRemove) { var tokens = val.match(/\S+/g); var last = tokens.pop(); %>
<%= tokens.join(' ') %>
<span style="white-space: nowrap"><%= last %><span
class="glyphicon glyphicon-remove-circle remove-selection"></span></span>
<% } else { %>
<%= val %>
<% } %>
</div>
</script>
......@@ -181,7 +194,7 @@
</div>
<% } %>
<div class="row detail-row">
<div class="col-md-3 detail-label">year(s):</div>
<div class="col-md-3 detail-label">years:</div>
<div class="col-md-9 detail-value"><%= v.years %></div>
</div>
<div class="row detail-row">
......
This diff is collapsed.
......@@ -172,6 +172,52 @@ class ExcelToJSON:
return self.data_json
class AddSimplifiedBounds:
"""
adds bbox from simplified geometry to country geojson
"""
simplified = None
conv = None
def __init__(self, simpl_path='./world_110m.geojson', geojson_path=None):
self.geojson_path = geojson_path
self.simpl_path = simpl_path
def load_simplified(self):
with open(self.simpl_path, 'r') as json_data:
self.simplified = json.load(json_data)
def get_simplified_country(self, iso_code):
if self.simplified is None:
self.load_simplified()
for c in self.simplified['features']:
if c['properties']['ADM0_A3'] == iso_code:
return c
def get_bounds_from_feature(self, f):
if 'bbox' in f:
return f['bbox']
def add_simplified_bounds(self):
with open(self.geojson_path, 'r') as gj_data:
geojson = json.load(gj_data)
for f in geojson['features']:
fid = f['id']
c = self.get_simplified_country(fid)
if c is None:
print(fid, 'no match')
continue
bbox = self.get_bounds_from_feature(c)
if bbox is None:
print(fid, 'no bbox')
continue
f['bbox'] = bbox
with open(self.geojson_path, 'w') as outfile:
json.dump(geojson, outfile)
def convert_countries(json_data):
rows = json_data['data']
for row in rows:
......
......@@ -629,17 +629,15 @@
// window.onresize = function () {
// that._resize();
// };
// this._map.on('movestart ', function () {
// that.migration.pause();
// });
/* this._map.on('moveend', function () {
that.migration.play();
that._draw();
});*/
this._map.on('movestart ', function () {
that.migration.pause();
});
this._map.on('zoomstart ', function () {
that.container.style.display = 'none';
});
this._map.on('zoomend', function () {
this._map.on('moveend', function () {
that.migration.play();
if (that._show) {
that.container.style.display = '';
that._draw();
......
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment