Skip to content

Instantly share code, notes, and snippets.

@darosh
Last active October 30, 2015 11:36
Show Gist options
  • Save darosh/14e2e4e14898f13e13c7 to your computer and use it in GitHub Desktop.
Save darosh/14e2e4e14898f13e13c7 to your computer and use it in GitHub Desktop.
Planetary Grid Browser I
function Config() {
'use strict';
return {
shift: 31.2,
lineWidth: 1,
symbolLine: 4,
dash: [2, 3],
fontSize: 16,
lineMid: 11,
titleSize: 18,
lineHeight: 19,
durationScale: 1.2,
durationSpeed: 1.5,
durationMin: 750,
durationMax: 2000,
frameLineWidth: 3,
mraf: !window.chrome,
filter: {
map: {},
graticule: {off: true},
'cool-line': {},
'hot-line': {},
'balanced-line': {},
'cool-point': {off: true},
'hot-point': {off: true},
'balanced-point': {off: true},
megalith: {},
mound: {},
pyramid: {},
temple: {},
volcano: {},
place: {}
},
colors: {
water: '#def4ff',
graticule: '#999',
land: '#ffffff',
border: 'rgba(0,0,0,0.5)',
cool: '#1f78b4',
hot: '#e31a1c',
balanced: '#333',
frame: '#333',
focus: 'rgba(0,0,0,0.87)',
selection: 'rgba(255,255,255,0.58)',
shape: '#333',
bg: '#fff'
},
shapes: {
megalith: '#299ae6',
mound: '#90de43',
pyramid: '#ffff4d',
temple: '#ff7f00',
volcano: '#e31a1c',
place: '#ccc'
},
sizes: {
megalith: 80,
mound: 66,
pyramid: 66,
temple: 80,
volcano: 48,
place: 48,
'hot-line': 80,
'cool-line': 80,
'balanced-line': 80,
'cool-point': 80,
'hot-point': 80,
'balanced-point': 80,
'map': 100
},
symbols: {
megalith: 'square',
mound: 'triangle-up',
pyramid: 'triangle-up',
temple: 'cross',
volcano: 'circle',
place: 'circle'
}
};
}
function SvgGlobe(root, width, height, cfg) {
'use strict';
var maxScale = 3;
var self;
var round = d3.geo.transform({
point: function (x, y) {
this.stream.point(~~x, ~~y);
}
});
var projectionGlobe = d3.geo
.orthographic()
.clipAngle(90)
.precision(0)
.translate([height / 2, height / 2])
.scale(height / 2);
var projectionRaw = d3.geo
.orthographic()
.precision(2)
.clipAngle(90)
.translate([height / 2, height / 2])
.scale(height / 2);
var projectionRawZero = d3.geo
.orthographic()
.precision(0)
.clipAngle(90)
.translate([height / 2, height / 2])
.scale(height / 2);
var projectionRawZeroRound = {
stream: function (s) {
return projectionRawZero.stream(round.stream(s));
}
};
var projectionGlobeCalc = d3.geo
.orthographic()
.clipAngle(90)
.translate([height / 2, height / 2])
.scale(height / 2);
var projectionLinesGlobe = d3.geo
.orthographic()
.rotate([cfg.shift, 0, 0])
.precision(10)
.clipAngle(90)
.translate([height / 2, height / 2])
.scale(height / 2);
var pathRaw = d3.geo.path()
.projection(projectionRaw);
var pathRawZero = d3.geo.path()
.projection(projectionRawZero);
var pathRawZeroRound = d3.geo.path()
.projection(projectionRawZeroRound);
var pathLinesGlobe = d3.geo.path()
.projection(projectionLinesGlobe);
var zoom = d3.behavior.zoom().scaleExtent([1, maxScale])
.on('zoomstart', zoomed)
.on('zoom', zoomed)
.on('zoomend', zoomed);
root.append('circle')
.attr('class', 'overlay-white')
.attr('cx', width / 2)
.attr('cy', height / 2)
.attr('r', height / 2);
root.append('circle')
.attr('class', 'map water')
.attr('cx', width / 2)
.attr('cy', height / 2)
.attr('r', height / 2);
var graticuleGlobe = root.append('path').datum(d3.geo.graticule()())
.attr('class', 'graticule')
.style('display', 'none')
.attr('d', pathRaw);
var landGlobe = root.append('path').attr('class', 'map land country');
var lineGlobeG = root.append('g').attr('stroke-width', 1);
root.call(zoom);
root.append('circle')
.attr('class', 'border')
.style('stroke-width', cfg.frameLineWidth)
.attr('cx', width / 2)
.attr('cy', height / 2)
.attr('r', height / 2);
var g = root.append('g');
var h = d3.geo.hexakisIcosahedron;
Utils.svgLines(lineGlobeG, pathLinesGlobe, h.icosahedronEdges(), 'cool-line', 'Cool line');
Utils.svgLines(lineGlobeG, pathLinesGlobe, h.hexakisCenterEdges(), 'hot-line', 'Hot line');
Utils.svgLines(lineGlobeG, pathLinesGlobe, h.hexakisSideEdges(), 'balanced-line', 'Balanced line');
var linesSelection = root.selectAll('.line');
var highlight = root.append('circle')
.style('display', 'none')
.attr('class', 'border land')
.attr('cx', width / 2)
.attr('cy', height / 2)
.attr('r', 5);
var a, pG, pGL;
function zoomed() {
var m = d3.mouse(this);
if (d3.event && d3.event.sourceEvent) {
d3.event.sourceEvent.stopPropagation();
d3.event.sourceEvent.preventDefault();
}
({
zoomstart: function () {
pG = projectionGlobe.rotate();
pGL = projectionLinesGlobe.rotate();
projectionGlobeCalc.rotate(pG);
a = projectionGlobeCalc.invert(m);
},
zoom: function () {
var b = projectionGlobeCalc.invert(m);
var pgR = [pG[0] + b[0] - a[0], pG[1] + b[1] - a[1]];
var plgR = [pGL[0] + b[0] - a[0], pGL[1] + b[1] - a[1]];
if (self.canZoom && !self.canZoom(pgR)) {
return;
}
if (!isNaN(b[0]) && !isNaN(b[1])) {
projectionRaw.rotate(pgR);
projectionRawZero.rotate(pgR);
projectionGlobe.rotate(pgR);
projectionLinesGlobe.rotate(plgR);
update();
if (self.onZoomed) {
var s = zoom.scale();
self.onZoomed(null, s, pgR);
}
}
},
zoomend: function () {
}
})[d3.event.type]();
}
function updateSelection() {
if (self.selection) {
var coo = self.selection.geometry ? self.selection : {
'type': 'Feature',
'geometry': {'type': 'Point', 'coordinates': [self.selection[0] + cfg.shift, self.selection[1], 0]}
};
var p = pathRaw.centroid(coo);
if (!isNaN(p[0]) && !isNaN(p[1])) {
p[0] -= width / 2;
p[1] -= height / 2;
highlight.style('display', null);
highlight.attr('transform', 'translate(' + p + ')');
} else {
highlight.style('display', 'none');
}
} else {
highlight.style('display', 'none');
}
}
function update(running) {
projectionLinesGlobe.precision(running ? 2 : 1);
if (!cfg.filter.map.off) {
landGlobe.attr('d', pathRawZeroRound);
}
if (!cfg.filter.graticule.off) {
graticuleGlobe.attr('d', pathRaw);
}
linesSelection.attr('d', pathLinesGlobe);
updateSelection();
}
function setZoom(t, s, i, running) {
zoom.scale(s);
projectionLinesGlobe.rotate([i[0] + cfg.shift, i[1]]);
projectionGlobe.rotate(i);
projectionRaw.rotate(i);
projectionRawZero.rotate(i);
update(running)
}
self = {
root: root,
land: landGlobe,
pathRaw: pathRaw,
setZoom: setZoom,
updateSelection: updateSelection,
update: update
};
return self;
}
<!DOCTYPE html>
<meta charset="utf-8">
<title>Planetary Grid I</title>
<link rel="stylesheet" href="style.css">
<body>
<script src="//cdnjs.cloudflare.com/ajax/libs/d3/3.5.6/d3.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/topojson/1.6.19/topojson.min.js"></script>
<script src="/darosh/raw/2fe464efd794bde5ed68/hexakis-icosahedron.js"></script>
<script src="/darosh/raw/2d12a584a14910032ab8/togeojson.js"></script>
<script src="config.js"></script>
<script src="utils.js"></script>
<script src="globe.js"></script>
<script src="map.js"></script>
<script src="legend.js"></script>
<script src="list.js"></script>
<script src="info.js"></script>
<script>
(function () {
'use strict';
var widthList = 220;
var margin = 12;
var widthScrollBar = self.frameElement ? 0 : 20;
var widthScreen = Math.max(document.body.clientWidth || 0, 960) - widthScrollBar;
widthScreen = Math.min(1480, widthScreen);
var heightScreen = Math.max(500, widthScreen / (960 / 480));
margin = widthScreen > 960 ? margin * 2 : margin;
var widthGlobe = 200;
var heightGlobe = 200;
if (heightScreen > 660) {
widthGlobe = 280;
heightGlobe = 280;
}
var widthLegend = 140;
var widthMap = widthScreen - Math.max(widthLegend, widthGlobe / 2) - 2 * margin;
var heightMap = heightScreen - heightGlobe / 2 - 2 * margin;
var selected;
var cfg = new Config();
cfg.url = 'http://bl.ocks.org/darosh/14e2e4e14898f13e13c7';
var svg = d3.select('body').append('svg')
.attr('width', widthMap + Math.max(widthLegend, widthGlobe / 2) + 2 * margin)
.attr('height', heightMap + heightGlobe / 2 + 2 * margin);
var map = new SvgMap(svg, widthMap, heightMap, margin, cfg);
var legend = new SvgLegend(svg.append('g')
.attr('transform', 'translate(' + [widthMap + margin + cfg.lineMid, margin] + ')'),
cfg, clickedLegend
);
cfg.filter = legend.lookFilter;
var globe = new SvgGlobe(svg.append('g')
.attr('transform', 'translate(' + [widthMap - widthGlobe / 2 + margin, heightMap - heightGlobe / 2 + margin] + ')'),
widthGlobe, heightGlobe, cfg
);
var info = new HtmlInfo(d3.select('body').append('div')
.style('position', 'absolute')
.style('left', (2 * margin) + 'px')
.style('top', (2 * margin) + 'px')
.style('border', cfg.frameLineWidth + 'px solid ' + cfg.colors.frame)
.style('padding', (cfg.titleSize * 0.75) + 'px')
.style('min-width', (cfg.titleSize * 8) + 'px')
.style('background-color', cfg.colors.bg),
cfg
);
var controls = svg.append('g')
.attr('transform', 'translate(' + [margin * 1.5, heightMap + margin * .5 - 22] + ')');
Utils.svgControls(controls, setIndex, map.reset);
var list = new SvgList(svg.append('g')
.attr('transform', 'translate(' + [margin, (heightMap + margin + cfg.lineMid)] + ')'),
cfg, widthMap - widthGlobe / 2, widthList,
function (h) {
h = heightMap + h + 3 * margin;
svg.attr('height', h);
d3.select(self.frameElement).style('height', h + 'px');
},
selectedPlace
);
map.clickedPoint = function (p) {
selectedPlace(p);
};
map.onZoomed = globe.setZoom;
globe.onZoomed = map.setZoom;
globe.canZoom = function (i) {
var p = map.projection(i);
return !isNaN(p[0]) && !isNaN(p[1]);
};
if (self.frameElement) {
self.frameElement.focus();
}
d3.select('body').on('keydown', function () {
var i = null;
if (d3.event.keyCode === 37) {
i = -1;
} else if (d3.event.keyCode === 39) {
i = +1;
} else if (d3.event.keyCode === 27 && selected) {
selectedPlace(selected);
}
if (i !== null) {
setIndex(i);
}
});
d3.json('mercator-countries.json', function (topo) {
topojson.presimplify(topo);
map.countries.datum(topojson.mesh(topo, topo.objects.countries)).attr('d', map.path);
});
d3.json('mercator-land.json', function (topo) {
topojson.presimplify(topo);
map.land.datum(topojson.feature(topo, topo.objects.land)).attr('d', map.path);
});
d3.json('land.json', function (topo) {
globe.land.datum(topojson.feature(topo, topo.objects.land)).attr('d', globe.pathRaw);
});
d3.xml('/darosh/raw/2d12a584a14910032ab8/places.kml', function (xml) {
var geo = toGeoJSON.kml(xml);
Utils.parsePlaces(geo);
if (list) {
list.update(geo);
}
cfg.filtered = geo.features;
map.placesSelection = Utils.svgPlaces(map.g, geo, map.pathRaw, 1.25, cfg, selectedPlace);
});
function clickedLegend(d) {
map.root.selectAll('.' + d.key).style('display', d.off ? 'none' : null);
globe.root.selectAll('.' + d.key).style('display', d.off ? 'none' : null);
list.filter(legend.lookShapes);
if (!d.off) {
globe.update();
map.update();
}
}
function selectedPlace(d) {
list.selection(selected, d);
if (d === selected) {
d = null;
}
globe.selection = d;
if (d === null) {
globe.updateSelection();
}
info.update(d);
selected = d;
map.zoomTo(d, info.size);
}
function setIndex(i) {
var f = cfg.filtered;
var c = f.indexOf(selected);
c = c === -1 ? 0 : (c + i);
c = (c + f.length) % f.length;
if (list) {
list.selection(selected, f[c]);
}
info.update(f[c]);
globe.selection = f[c];
setTimeout(function () {
map.zoomTo(f[c], info.size);
}, 50);
selected = f[c];
}
})();
</script>
</body>
function HtmlInfo(root, cfg) {
'use strict';
var self;
var previous;
var a = root.append('a')
.style('font-size', (cfg.titleSize * 1.25) + 'px')
.style('line-height', 1)
.style('font-weight', 'bold')
.style('color', '#333')
.attr('href', 'http://bl.ocks.org/darosh/7b816a50e66bb62208a7')
.attr('target', '_blank')
.text('Planetary Grid');
root = root.append('div')
.style('display', 'none');
var b = root.append('b')
.style('display', 'block')
.style('font-size', cfg.titleSize + 'px');
var s = b.append('svg')
.attr('width', cfg.titleSize * 1.6)
.attr('height', cfg.titleSize * 1.6)
.style('float', 'left')
.style('margin-top', (-cfg.titleSize * 0.25) + 'px')
.style('margin-left', (-cfg.titleSize * 0.25) + 'px')
.style('margin-right', (cfg.titleSize * 0.25) + 'px')
.append('path')
.style('stroke-width', 2)
.attr('transform', 'translate(' + [cfg.titleSize * 1.6 / 2, cfg.titleSize * 1.6 / 2] + ')');
var t = b.append('span');
var c = root.append('small')
.style('display', 'block')
.style('text-align', 'right')
.style('margin-top', (cfg.titleSize / 4) + 'px')
.style('margin-bottom', (cfg.titleSize / 2) + 'px');
var d = root.append('a')
.style('display', 'block')
.attr('target', '_blank')
.text('Wikipedia');
var e = root.append('a')
.style('display', 'block')
.attr('target', '_blank')
.text('Google');
var f = root.append('a')
.style('display', 'block')
.attr('target', '_blank')
.text('Google Maps');
var g = root.append('a')
.style('display', 'block')
.attr('target', '_blank')
.text('Google Earth');
function update(feature) {
if (previous === feature) {
return;
}
previous = feature;
if (feature) {
t.text(feature.properties.name);
s
.attr('class', feature.coordinates ? 'legend-symbol ' + feature.type : 'symbol ' + feature.properties.description)
.attr('d', function () {
var s = cfg.sizes[feature.properties.description || 'place'] * cfg.titleSize / 6;
return d3.svg.symbol().size(s).type(cfg.symbols[feature.properties ? feature.properties.description : 'circle'])();
});
if (feature.type !== 'Feature') {
d.style('display', 'none');
e.style('display', 'none');
} else {
d.style('display', 'block');
e.style('display', 'block');
}
var coo = [feature.geometry.coordinates[1], feature.geometry.coordinates[0]];
coo[0] = d3.round(coo[0], 3);
coo[1] = d3.round(coo[1], 3);
c.text(d3.round(coo[0], 2) + ', ' + d3.round(coo[1], 2));
d.attr('href', 'https://wikipedia.org/wiki/Special:Search/' + feature.properties.name);
e.attr('href', 'https://www.google.com/search?q=' + feature.properties.name);
f.attr('href', 'https://www.google.com/maps/@' + coo[0] + ',' + coo[1] + ',12z');
g.attr('href', 'https://www.google.com/maps/@' + coo[0] + ',' + coo[1] + ',512m/data=!3m1!1e3');
a.style('display', 'none');
root.style('display', null);
self.size = root.node().getBoundingClientRect();
} else {
a.style('display', null);
root.style('display', 'none');
}
}
return self = {
update: update
};
}
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
function SvgLegend(root, cfg, clicked) {
'use strict';
var shapes = cfg.symbols;
var data = d3.map(shapes).entries().filter(function (d) {
return d.key !== 'undefined'
});
data.forEach(function (v) {
v.classed = 'symbol ' + v.key;
v.symbol = true;
});
data = data.concat([
{key: 'cool-line', value: 'circle', path: 'M-10,0 L10,0'},
{key: 'hot-line', value: 'circle', path: 'M-10,0 L10,0'},
{key: 'balanced-line', value: 'circle', path: 'M-10,0 L10,0'},
{key: 'cool-point', value: 'circle', classed: 'cool-point', off: true},
{key: 'hot-point', value: 'circle', classed: 'hot-point', off: true},
{key: 'balanced-point', value: 'circle', classed: 'balanced-point', off: true},
{key: 'graticule', value: 'circle', path: 'M-8.25,0 L8.25,0', off: true},
{key: 'map', value: 'square', classed: 'map'}
]);
var l = root.selectAll('legend').data(data);
var g = l.enter().append('g')
.attr('class', 'legend')
.attr('transform', function (d, i) {
return 'translate(' + [0, i * cfg.lineHeight] + ')';
})
.style('opacity', function (d) {
return d.off ? 0.25 : null;
})
.on('click', function (d) {
d.off = !d.off;
d3.select(this).style('opacity', d.off ? 0.25 : null);
clicked(d);
});
g.append('path')
.attr('class', function (d) {
return d.classed || d.key;
})
.style('stroke-width', function (d) {
return (d.key === 'map') ? 1.5 : ((d.path || d.classed) && !d.symbol) ? 2 : 1;
})
.attr('transform', 'translate(' + [cfg.fontSize / 2, cfg.lineMid] + ')')
.attr('d', function (d) {
return d.path || d3.svg.symbol().size(cfg.sizes[d.key]).type(d.value)();
});
g.append('text')
.attr('dy', cfg.fontSize)
.attr('dx', cfg.fontSize + cfg.lineMid)
.text(function (d) {
return d.key.replace('-', ' ');
});
var lookShapes = {};
var lookFilter = {};
data.forEach(function (d) {
lookFilter[d.key] = d;
if (shapes[d.key]) {
lookShapes[d.key] = d;
}
});
return {
data: data,
lookShapes: lookShapes,
lookFilter: lookFilter
};
}
function SvgList(root, cfg, width, minItemWidth, updated, clicked) {
'use strict';
var self;
var shapes = cfg.symbols;
var cols = Math.floor(width / minItemWidth);
var itemWidth = Math.floor((width + cfg.fontSize) / cols);
var data;
var previousData = [];
function selection(o, n) {
root.selectAll('g').data(o ? [o, n] : [n], function (d) {
return d && d.properties ? d.properties.id : null;
})
.style('font-weight', function (d) {
return ((d === n) && (n !== o)) ? 'bold' : null;
})
.selectAll('text')
.each(wrap);
}
function update(topo) {
data = topo.features;
self.filtered = data;
var lastRow = Math.ceil(data.length / cols);
var height = lastRow * cfg.lineHeight;
updated(height);
enter(data, previousData);
previousData = data;
}
function filter(l) {
var filtered = data.filter(function (d) {
var t = d.properties.description;
return !l[t].off;
});
enter(filtered, previousData);
previousData = filtered;
cfg.filtered = filtered;
}
function enter(filtered, previousData) {
var lastRow = Math.ceil(filtered.length / cols);
var g = root.selectAll('g').data(filtered, function (d) {
return d.properties.id;
});
g.exit().remove();
g.transition().attr('transform', function (d, i) {
var row = i % lastRow;
var col = (i - row) / lastRow;
return 'translate(' + [col * itemWidth, row * cfg.lineHeight] + ')';
});
var a = g.enter().append('g')
.attr('class', 'item')
.style('opacity', previousData.length ? 0 : 1)
.attr('transform', function (d, i) {
var row = i % lastRow;
var col = (i - row) / lastRow;
return 'translate(' + [col * itemWidth, row * cfg.lineHeight] + ')';
})
.on('click', clicked);
a.transition().delay(previousData.length ? 250 : 0)
.style('opacity', 1);
a.append('path')
.attr('class', function (d) {
return 'symbol ' + d.properties.description;
})
.attr('transform', 'translate(' + [cfg.fontSize / 2, cfg.lineMid] + ')')
.attr('d', function (d) {
var s = cfg.sizes[d.properties.description];
return d3.svg.symbol().size(s).type(shapes[d.properties.description])();
});
a.append('text')
.attr('dy', cfg.fontSize)
.attr('dx', cfg.fontSize + cfg.lineMid)
.text(function (d) {
return d.properties.name;
})
.each(wrap);
}
function wrap() {
var self = d3.select(this);
var text = self.data()[0].properties.name;
self.text(text);
var textLength = self.node().getComputedTextLength();
while (textLength > (itemWidth - 50) && text.length > 0) {
text = text.slice(0, -1);
self.text(text + '…');
textLength = self.node().getComputedTextLength();
}
self.text(self.text().replace(' …', '…'));
}
self = {
update: update,
filter: filter,
selection: selection
};
return self;
}
function SvgMap(svg, width, height, margin, cfg) {
'use strict';
var maxScale = 3;
var self;
var focused;
var arrowStart;
var prevScale;
var referenceSize = Math.sqrt(height * height + width * width) * cfg.durationScale;
var clip = d3.geo.clipExtent().extent([[-width / 2, -height / 2], [width / 2, height / 2]]);
var projection = d3.geo.mercator()
.translate([0, 0])
.precision(0)
.scale(width / 2 / Math.PI);
var simplify = d3.geo.transform({
point: function (x, y, z) {
if (z >= projectionSimplified.area) {
this.stream.point(~~(x * width), ~~(y * width));
}
}
});
var round = d3.geo.transform({
point: function (x, y) {
this.stream.point(~~(x * 10) / 10, ~~(y * 10) / 10);
}
});
var projectionRounded = {
stream: function (s) {
return projection.stream(round.stream(s));
},
baseArea: 4e-3 / width
};
var projectionLinesRounded = {
stream: function (s) {
return projectionLines.stream(round.stream(s));
},
baseArea: 4e-3 / width
};
var projectionSimplified = {
stream: function (s) {
return simplify.stream(clip.stream(s));
},
baseArea: 4e-3 / width
};
projectionSimplified.area = projectionSimplified.baseArea;
var projectionLines = d3.geo.mercator()
.rotate([cfg.shift, 0, 0])
.translate([0, 0])
.precision(1)
.scale(width / 2 / Math.PI);
var path = d3.geo.path()
.projection(projectionSimplified);
var pathRaw = d3.geo.path()
.projection(projection);
var pathRawRounded = d3.geo.path()
.projection(projectionRounded);
var pathLines = d3.geo.path()
.projection(projectionLines);
var pathLinesRounded = d3.geo.path()
.projection(projectionLinesRounded);
var zoom = d3.behavior.zoom()
.scaleExtent([1, maxScale])
.on('zoom', zoomed);
var defs = svg.append('defs');
defs.append('clipPath')
.attr('id', 'clip-map')
.append('rect')
.attr("x", -width / 2)
.attr("y", -height / 2)
.attr("width", width)
.attr("height", height);
defs.append('clipPath')
.attr('id', 'clip-arrow')
.append('rect')
.attr("x", margin)
.attr("y", margin)
.attr("width", width)
.attr("height", height);
var clipGroup = svg.append("g")
.attr("transform", "translate(" + [width / 2 + margin, height / 2 + margin] + ")")
.style('clip-path', 'url(#clip-map)')
.call(zoom);
clipGroup.append("rect")
.attr("class", "map water")
.attr("x", -width / 2)
.attr("y", -height / 2)
.attr("width", width)
.attr("height", height);
clipGroup.append("rect")
.attr("class", "overlay")
.attr("x", -width / 2)
.attr("y", -height / 2)
.attr("width", width)
.attr("height", height);
var g = clipGroup.append('g');
var graticulePath = g.append('path')
.datum(d3.geo.graticule()())
.attr('class', 'graticule')
.style('display', 'none')
.attr('d', pathRaw);
var land = g.append('path').attr('class', 'map land');
var countries = g.append('path').attr('class', 'map country');
var h = d3.geo.hexakisIcosahedron;
var coolLines = Utils.svgLines(g, pathLines, h.icosahedronEdges(), 'cool-line');
var hotLines = Utils.svgLines(g, pathLines, h.hexakisCenterEdges(), 'hot-line');
var balancedLines = Utils.svgLines(g, pathLines, h.hexakisSideEdges(), 'balanced-line');
var coolPointsData = Utils.pointsToFeatures(h.icosahedronPoints(), 'cool-point', 'Cool point', cfg.shift);
var hotPointsData = Utils.pointsToFeatures(h.hexakisCenterPoints(), 'hot-point', 'Hot point', cfg.shift);
var balancedPointsData = Utils.pointsToFeatures(h.hexakisCrossPoints(), 'balanced-point', 'Balanced point', cfg.shift);
Utils.svgPoints(g, coolPointsData, 'cool-point', projectionLines, clickedPoint, 'none');
Utils.svgPoints(g, hotPointsData, 'hot-point', projectionLines, clickedPoint, 'none');
Utils.svgPoints(g, balancedPointsData, 'balanced-point', projectionLines, clickedPoint, 'none');
function clickedPoint(d) {
self.clickedPoint(d);
}
var placesGroup = g.append('g');
var selectedCircleGroup = svg.append('g')
.style('display', 'none')
.style('clip-path', 'url(#clip-arrow)');
var selectedCircle = selectedCircleGroup.append('circle')
.attr('cx', margin)
.attr('cy', margin)
.attr('r', 20)
.attr('class', 'border');
var selectedArrow = selectedCircleGroup.append('line')
.attr('x1', margin * 4)
.attr('y1', margin * 4)
.attr('class', 'border');
svg.append("rect")
.attr("class", "border")
.style('stroke-width', cfg.frameLineWidth)
.attr("transform", "translate(" + [width / 2 + margin, height / 2 + margin] + ")")
.attr("x", -width / 2 + cfg.frameLineWidth / 2)
.attr("y", -height / 2 + cfg.frameLineWidth / 2)
.attr("width", width - cfg.frameLineWidth)
.attr("height", height - cfg.frameLineWidth);
function getFixedZoom(t, s) {
var S = (width - height) / 2;
t[0] = Math.min(width / 2 * (s - 1), Math.max(width / 2 * (1 - s), t[0]));
t[1] = Math.min(height / 2 * (s - 1) + S * s, Math.max(height / 2 * (1 - s) - S * s, t[1]));
}
function fixZoom() {
var t = zoom.translate();
var s = zoom.scale();
getFixedZoom(t, s);
zoom.translate(t);
}
function roundTranslate(t) {
t[0] = Math.round(t[0]);
t[1] = Math.round(t[1]);
}
function zoomed() {
fixZoom();
var t = zoom.translate();
var s = zoom.scale();
var i = projection.invert([t[0] / s, t[1] / s]);
update();
if (self.onZoomed) {
self.onZoomed(t, s, i);
}
}
function update(running) {
var t = zoom.translate();
var s = Math.min(maxScale, d3.round(zoom.scale(), 6));
roundTranslate(t);
g.attr('transform', 'translate(' + t + ')scale(' + s + ')');
var ps = (running === true) ? 1 : zoom.scale();
var c = translateToCenter(t, s);
var ce = [[
-width / 2 + c[0] - width / 2 / s,
-height / 2 + c[1] - height / 2 / s], [
-width / 2 + c[0] + width / 2 / s,
-height / 2 + c[1] + height / 2 / s]];
clip.extent(ce);
projectionLines.precision(running ? 1 : Math.sqrt(1 / 2) / s / s);
projectionSimplified.area = projectionSimplified.baseArea / ps / ps;
projection.clipExtent(ce);
projectionLines.clipExtent(ce);
var localPathRaw, localPathLines;
if (running) {
localPathRaw = pathRawRounded;
localPathLines = pathLinesRounded;
} else {
localPathRaw = pathRaw;
localPathLines = pathLines;
}
if (!cfg.filter['graticule'].off) {
graticulePath.attr('d', localPathRaw);
}
if (!cfg.filter['cool-line'].off) {
coolLines.attr('d', localPathLines);
}
if (!cfg.filter['hot-line'].off) {
hotLines.attr('d', localPathLines);
}
if (!cfg.filter['balanced-line'].off) {
balancedLines.attr('d', localPathLines);
}
if (!cfg.filter.map.off) {
land.attr('d', path);
countries.attr('d', path);
}
if (prevScale !== s) {
g.style('stroke-width', 1 / s);
if (!cfg.filter['graticule'].off) {
graticulePath.style('stroke-dasharray', (2 / s ) + ',' + (3 / s));
}
//self.placesSelection.attr('transform', function (d) {
// return d.translate + 'scale(' + 1 / s + ')';
//});
self.placesSelection.defs.attr('transform', function () {
return 'scale(' + 1 / s + ')';
});
prevScale = s;
}
if (focused) {
var f = [width / 2 + focused[0] * s + t[0], height / 2 + focused[1] * s + t[1]];
var l = [[arrowStart.width / 2 + 2 * margin, arrowStart.height / 2 + 2 * margin], [f[0] + margin, f[1] + margin]];
var d = Math.sqrt(Math.pow(l[1][0] - l[0][0], 2) + Math.pow(l[1][1] - l[0][1], 2));
var r = (d - 20) / d;
l[1][0] = l[0][0] + r * (l[1][0] - l[0][0]);
l[1][1] = l[0][1] + r * (l[1][1] - l[0][1]);
selectedCircle
.attr('transform', 'translate(' + [d3.round(f[0]), d3.round(f[1])] + ')');
selectedArrow
.attr('x1', l[0][0])
.attr('y1', l[0][1])
.attr('x2', l[1][0])
.attr('y2', l[1][1]);
selectedCircleGroup.style('display', null);
} else {
selectedCircleGroup.style('display', 'none');
}
}
function setZoom(t, s, i) {
var p = projection(i);
zoom.scale(s);
zoom.translate([p[0] * s, p[1] * s]);
fixZoom();
update();
}
function translateToCenter(t, s) {
return [-t[0] / s + width / 2, -t[1] / s + height / 2];
}
function centerToTranslate(c, s) {
return [s * (-c[0] + width / 2), s * (-c[1] + height / 2)];
}
function zoomTransition(p, toScale) {
var fromScale = zoom.scale();
var fromTranslate = zoom.translate();
var toTranslate = [-p[0] * toScale, -p[1] * toScale];
getFixedZoom(toTranslate, toScale);
var from = translateToCenter(fromTranslate, fromScale);
from[2] = referenceSize / fromScale;
var to = translateToCenter(toTranslate, toScale);
to[2] = referenceSize / toScale;
var zi = d3.interpolateZoom(from, to);
var dur = Math.min(cfg.durationMax, Math.max(cfg.durationMin, zi.duration * cfg.durationSpeed));
d3.transition().duration(dur).tween('tween', tween);
function tween() {
return function (t) {
var z = zi(t);
var s = referenceSize / z[2];
var tr = centerToTranslate(z, s);
getFixedZoom(tr, s);
zoom.translate(tr);
zoom.scale(s);
update(t < 1);
if (self.onZoomed) {
var i = projection.invert([tr[0] / s, tr[1] / s]);
self.onZoomed(z, s, i, t < 1);
}
};
}
}
function zoomTo(d, ast) {
if (!d) {
focused = null;
selectedCircleGroup.style('display', 'none');
return;
}
var c = d.geometry ? [d.geometry.coordinates[0], d.geometry.coordinates[1]] : [d[0] + cfg.shift, d[1]];
var p = projection(c);
arrowStart = ast;
focused = p;
zoomTransition(p, maxScale)
}
function reset() {
zoomTransition(projection([0, 0]), 1);
}
self = {
root: svg,
land: land,
countries: countries,
path: path,
pathRaw: pathRaw,
g: placesGroup,
projection: projection,
setZoom: setZoom,
zoomTo: zoomTo,
reset: reset,
update: update
};
return self;
}
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
{"type":"Topology","objects":{"land":{"type":"GeometryCollection","geometries":[{"type":"Polygon","arcs":[[0]]},{"type":"Polygon","arcs":[[1]]},{"type":"Polygon","arcs":[[2]]},{"type":"Polygon","arcs":[[3]]},{"type":"Polygon","arcs":[[4]]},{"type":"Polygon","arcs":[[5]]},{"type":"Polygon","arcs":[[6]]},{"type":"MultiPolygon","arcs":[[[7]],[[8]]]},{"type":"Polygon","arcs":[[9]]},{"type":"Polygon","arcs":[[10]]},{"type":"Polygon","arcs":[[11]]},{"type":"Polygon","arcs":[[12]]},{"type":"Polygon","arcs":[[13]]},{"type":"Polygon","arcs":[[14]]},{"type":"Polygon","arcs":[[15]]},{"type":"Polygon","arcs":[[16]]},{"type":"MultiPolygon","arcs":[[[17]],[[18,-19,19]]]},{"type":"Polygon","arcs":[[20,-19]]},{"type":"Polygon","arcs":[[21]]},{"type":"Polygon","arcs":[[22]]},{"type":"Polygon","arcs":[[23]]},{"type":"Polygon","arcs":[[24]]},{"type":"Polygon","arcs":[[25]]},{"type":"Polygon","arcs":[[26]]},{"type":"Polygon","arcs":[[27]]},{"type":"Polygon","arcs":[[28]]},{"type":"Polygon","arcs":[[29]]},{"type":"Polygon","arcs":[[30]]},{"type":"Polygon","arcs":[[31]]},{"type":"Polygon","arcs":[[32]]},{"type":"Polygon","arcs":[[33]]},{"type":"Polygon","arcs":[[34]]},{"type":"Polygon","arcs":[[35]]},{"type":"Polygon","arcs":[[36]]},{"type":"Polygon","arcs":[[37]]},{"type":"Polygon","arcs":[[38]]},{"type":"Polygon","arcs":[[39]]},{"type":"Polygon","arcs":[[40]]},{"type":"Polygon","arcs":[[41]]},{"type":"Polygon","arcs":[[42]]},{"type":"Polygon","arcs":[[43]]},{"type":"Polygon","arcs":[[44]]},{"type":"Polygon","arcs":[[45]]},{"type":"Polygon","arcs":[[46]]},{"type":"Polygon","arcs":[[47]]},{"type":"Polygon","arcs":[[48]]},{"type":"Polygon","arcs":[[49]]},{"type":"Polygon","arcs":[[50]]},{"type":"Polygon","arcs":[[51]]},{"type":"Polygon","arcs":[[52]]},{"type":"Polygon","arcs":[[53]]},{"type":"Polygon","arcs":[[54]]},{"type":"Polygon","arcs":[[55]]},{"type":"Polygon","arcs":[[56]]},{"type":"Polygon","arcs":[[57]]},{"type":"Polygon","arcs":[[58]]},{"type":"Polygon","arcs":[[59]]},{"type":"Polygon","arcs":[[60]]},{"type":"Polygon","arcs":[[61]]},{"type":"Polygon","arcs":[[62]]},{"type":"Polygon","arcs":[[63]]},{"type":"Polygon","arcs":[[64]]},{"type":"Polygon","arcs":[[65]]},{"type":"Polygon","arcs":[[66]]},{"type":"Polygon","arcs":[[67]]},{"type":"Polygon","arcs":[[68]]},{"type":"Polygon","arcs":[[69]]},{"type":"Polygon","arcs":[[70]]},{"type":"Polygon","arcs":[[71]]},{"type":"Polygon","arcs":[[72]]},{"type":"Polygon","arcs":[[73]]},{"type":"Polygon","arcs":[[74]]},{"type":"Polygon","arcs":[[75]]},{"type":"Polygon","arcs":[[76]]},{"type":"Polygon","arcs":[[77]]},{"type":"Polygon","arcs":[[78]]},{"type":"Polygon","arcs":[[79]]},{"type":"Polygon","arcs":[[80]]},{"type":"Polygon","arcs":[[81]]},{"type":"Polygon","arcs":[[82]]},{"type":"Polygon","arcs":[[83]]},{"type":"Polygon","arcs":[[84]]},{"type":"Polygon","arcs":[[85]]},{"type":"Polygon","arcs":[[86]]},{"type":"Polygon","arcs":[[87]]},{"type":"Polygon","arcs":[[88]]},{"type":"Polygon","arcs":[[89]]},{"type":"Polygon","arcs":[[90]]},{"type":"Polygon","arcs":[[91]]},{"type":"MultiPolygon","arcs":[[[92]],[[93,94]]]},{"type":"Polygon","arcs":[[95,-94]]},{"type":"Polygon","arcs":[[96]]},{"type":"Polygon","arcs":[[97]]},{"type":"Polygon","arcs":[[98]]},{"type":"Polygon","arcs":[[99]]},{"type":"Polygon","arcs":[[100]]},{"type":"Polygon","arcs":[[101]]},{"type":"Polygon","arcs":[[102]]},{"type":"Polygon","arcs":[[103]]},{"type":"Polygon","arcs":[[104]]},{"type":"Polygon","arcs":[[105]]},{"type":"Polygon","arcs":[[106]]},{"type":"Polygon","arcs":[[107]]},{"type":"Polygon","arcs":[[108]]},{"type":"Polygon","arcs":[[109]]},{"type":"Polygon","arcs":[[110]]},{"type":"Polygon","arcs":[[111]]},{"type":"Polygon","arcs":[[112]]},{"type":"MultiPolygon","arcs":[[[113],[114]]]},{"type":"Polygon","arcs":[[115]]},{"type":"Polygon","arcs":[[116]]},{"type":"Polygon","arcs":[[117]]},{"type":"Polygon","arcs":[[118]]},{"type":"Polygon","arcs":[[119]]},{"type":"Polygon","arcs":[[120]]},{"type":"Polygon","arcs":[[121]]},{"type":"Polygon","arcs":[[122]]},{"type":"Polygon","arcs":[[123]]},{"type":"Polygon","arcs":[[124]]},{"type":"Polygon","arcs":[[125]]},{"type":"Polygon","arcs":[[126]]},{"type":"Polygon","arcs":[[127]]},{"type":"Polygon","arcs":[[128]]}]}},"arcs":[[[3344,8837],[-15,168],[-60,-25],[-61,11],[-34,-60],[0,-7],[-16,-51],[63,7],[60,17],[20,-70],[15,-58],[28,68]],[[577,8748],[-54,22],[-35,-56],[-18,-63],[-18,-40],[16,-54],[53,23],[28,45],[20,53],[8,70]],[[3745,8532],[35,62],[12,90],[2,67],[2,83],[-43,53],[-45,45],[-52,42],[-59,36],[-65,-11],[-38,-60],[6,-72],[59,-46],[24,-54],[18,-68],[12,-56],[35,-111],[14,0],[41,-29],[42,29]],[[1632,7993],[36,16],[34,-18],[-16,36],[-26,27],[-39,-9],[-28,-36],[7,-34],[32,18]],[[1512,7991],[42,40],[-52,-14],[-39,-29],[20,-21],[29,24]],[[2250,7840],[30,13],[31,-11],[16,54],[-21,-8],[-34,4],[-34,-4],[-38,6],[-28,-19],[-15,-39],[18,-16],[34,13],[41,7]],[[3098,7751],[4,40],[-5,36],[-8,35],[-33,13],[-31,19],[-36,-2],[14,-38],[-64,27],[-21,-28],[-2,-39],[30,-36],[19,-9],[33,3],[8,-45],[1,-101],[16,-37],[25,-13],[15,30],[6,31],[22,74],[7,40]],[[1021,9998],[4,-2],[6,-151],[-110,-12],[-90,-70],[-23,-110],[-75,-58],[6,-114],[9,-98],[11,-85],[-5,-88],[-47,-56],[-22,-70],[-43,-60],[69,11],[64,-29],[39,63],[51,-56],[45,-67],[22,-59],[-10,-69],[-35,-45],[-41,-47],[-58,-9],[-49,-21],[-54,-15],[-19,-56],[-36,-46],[-20,-50],[-9,-151],[13,13],[26,40],[45,-13],[44,-17],[23,56],[44,-13],[37,-28],[34,-36],[33,-42],[40,-12],[0,-45],[-10,-44],[8,-41],[37,-20],[16,38],[42,-23],[31,-29],[40,-2],[39,-11],[101,-73],[41,15],[40,-15],[38,19],[37,-2],[38,-15],[78,22],[38,-5],[82,5],[39,-5],[28,-31],[34,-18],[34,24],[34,-19],[29,-36],[19,31],[8,39],[19,36],[29,-32],[33,41],[38,13],[31,30],[40,-6],[35,-20],[42,4],[37,16],[39,20],[15,-49],[-18,-36],[-14,-38],[-36,-9],[-15,-38],[-16,-112],[21,13],[36,6],[36,-6],[33,16],[28,29],[12,36],[37,6],[36,-14],[39,-21],[34,-11],[28,24],[37,-8],[24,-76],[23,44],[32,18],[34,-10],[23,40],[37,4],[33,11],[33,22],[22,-37],[11,-36],[28,40],[38,-10],[28,21],[19,35],[37,-10],[29,-22],[29,-26],[33,-14],[39,-12],[36,-14],[26,-22],[17,-29],[7,-41],[-3,-38],[-28,-105],[-7,-30],[1,-66],[23,-63],[6,-31],[-10,-62],[15,-34],[33,-48],[19,-23],[22,-20],[11,-31],[33,-35],[26,-5],[18,-20],[19,-13],[23,-8],[20,-17],[16,-20],[22,-8],[16,17],[-10,20],[-29,21],[-11,14],[-22,-10],[-22,6],[-39,33],[-14,20],[-4,27],[2,26],[12,24],[-18,17],[-26,5],[-33,48],[-16,33],[-4,28],[9,32],[15,24],[23,20],[21,25],[12,31],[13,66],[14,28],[8,34],[4,84],[8,34],[2,39],[9,39],[-4,54],[-15,42],[-17,36],[-37,15],[-12,39],[-17,37],[-42,43],[-37,18],[-72,52],[-23,51],[-44,5],[-49,-5],[-44,10],[-47,0],[9,50],[42,23],[31,36],[18,48],[-31,44],[-48,-14],[-40,36],[-3,120],[33,52],[6,60],[35,63],[59,27],[50,48],[40,57],[50,59],[70,30],[68,55],[47,60],[52,71],[27,106],[13,89],[33,-84],[95,-136],[57,-54],[50,-56],[69,-4],[68,28],[57,48],[17,-88],[39,-57],[70,-4],[107,-81],[58,-25],[62,-31],[43,-45],[-20,-60],[-12,-57],[0,-59],[-54,6],[-57,25],[-54,0],[-8,-58],[4,-110],[12,-31],[40,-33],[47,-32],[67,-77],[25,-50],[38,-22],[57,-27],[43,-5],[41,-16],[68,-51],[69,-63],[24,-37],[26,-33],[9,-42],[-30,-24],[10,-43],[18,-31],[29,-19],[31,-24],[28,-30],[22,-37],[13,-43],[21,-26],[33,6],[13,30],[34,4],[1,-34],[14,-35],[30,9],[7,33],[33,5],[36,-15],[35,-12],[31,6],[12,38],[30,-31],[29,-16],[62,-24],[29,-22],[30,-12],[25,-19],[17,-30],[20,21],[29,-11],[36,71],[31,-17],[13,-34],[28,-23],[37,5],[11,31],[22,-31],[30,-10],[33,-3],[29,1],[31,10],[30,5],[13,28],[18,26],[31,-15],[32,-3],[63,-2],[57,-22],[25,-24],[26,-14],[28,-8],[21,-23],[14,-45],[16,-26],[30,12],[11,28],[24,20],[29,-7],[19,29],[21,21],[28,-19],[10,-35],[25,-15],[28,-26],[61,-26],[66,-52],[26,9],[43,-47],[25,1],[24,-17],[6,-26],[23,-20],[22,-14],[29,-11],[25,-6],[51,12],[22,19],[3,32],[41,44],[33,9],[42,42],[26,5],[23,-16],[24,-31],[26,17],[53,18],[27,5],[28,0],[23,83],[-5,57],[-26,21],[-22,31],[4,35],[31,-1],[-4,33],[-27,73],[21,29],[32,9],[32,-17],[15,-36],[10,-34],[32,-55],[7,-30],[15,-41],[17,-9],[32,-3],[55,-23],[15,-32],[8,-29],[19,-30],[50,-35],[16,-25],[15,-14],[21,-11],[27,7],[53,-16],[30,4],[20,-20],[14,-48],[11,19],[13,35],[23,14],[27,6],[26,-9],[54,8],[18,-8],[24,4],[21,17],[24,-10],[31,0],[24,-11],[30,11],[19,-25],[14,-25],[19,-19],[35,-54],[18,9],[21,21],[18,25],[36,43],[52,3],[60,-19],[42,-42],[31,-2],[21,-15],[22,14],[33,45],[31,-3],[19,19],[33,18],[35,8],[29,-6],[40,-46],[25,-6],[25,10],[29,7],[26,-11],[25,0],[50,13],[25,-12],[30,-11],[60,-4],[50,-11],[8,-35],[1,-30],[18,20],[4,32],[21,54],[23,13],[32,-5],[36,-1],[25,-4],[63,-2],[36,3],[32,6],[19,23],[-5,28],[18,23],[61,38],[35,14],[38,12],[28,13],[32,1],[18,-26],[24,21],[21,26],[25,19],[66,18],[13,33],[32,20],[21,30],[31,14],[32,-3],[30,6],[33,-2],[34,7],[31,12],[28,21],[29,18],[20,27],[-3,36],[-15,34],[-22,79],[-14,42],[-36,16],[-16,37],[-36,23],[-13,42],[-19,42],[-20,36],[-11,48],[-7,44],[-3,56],[0,48],[16,51],[6,50],[13,49],[52,20],[11,63],[-50,23],[-43,33],[-52,6],[-24,90],[-5,78],[-26,131],[37,63],[14,80],[24,76],[33,72],[81,143],[64,76],[14,127],[80,59],[26,107],[77,-74],[63,91],[48,74],[0,109],[-8978,0]],[[0,9998],[0,-109],[2,3],[24,-174],[50,92],[33,-103],[6,5],[41,122],[34,-122],[8,-16],[81,-48],[81,197],[79,80],[45,73],[-484,0]],[[3117,6648],[37,29],[38,13],[-12,25],[-26,3],[-14,-18],[-10,20],[-23,16],[-30,-6],[-21,-15],[-29,-7],[-35,-28],[-29,-27],[-37,-54],[23,9],[39,33],[36,18],[14,-23],[10,-33],[25,-19],[20,5],[24,59]],[[3373,6517],[22,21],[-8,16],[-37,14],[-13,-16],[-23,20],[-14,-20],[33,-29],[24,13],[16,-19]],[[6952,6454],[-43,2],[-1,-23],[6,-27],[18,14],[26,5],[-6,29]],[[9038,6087],[27,13],[37,-13],[16,3],[2,46],[-9,13],[-3,32],[-10,-11],[-19,27],[-23,-3],[-17,-34],[-4,-26],[-16,-33],[1,-18],[18,4]],[[9805,6091],[6,16],[20,-15],[8,16],[0,16],[-28,46],[-14,17],[10,19],[-22,0],[-23,16],[-24,68],[-35,31],[-26,-1],[-18,-14],[-30,-3],[-5,-15],[15,-31],[35,-40],[18,-7],[44,-36],[17,-22],[12,-28],[10,-10],[5,-21],[19,-18],[6,16]],[[9849,5915],[20,38],[1,-25],[13,10],[4,28],[22,12],[19,3],[16,-14],[14,4],[-15,54],[-22,-1],[-7,12],[3,16],[-29,54],[-21,15],[-17,-16],[16,-31],[-9,-21],[-30,-15],[1,-14],[20,-13],[5,-28],[-1,-24],[-11,-30],[-35,-47],[-12,-25],[11,-2],[15,19],[22,9],[7,32]],[[9641,5450],[-10,7],[-16,-8],[-37,-31],[-23,-32],[12,0],[16,11],[44,38],[14,15]],[[9954,5301],[9,9],[-4,16],[-17,4],[-16,-4],[-2,-13],[10,-10],[20,-2]],[[9999,5278],[-35,12],[-4,-10],[39,-17],[0,15]],[[0,5263],[0,15]],[[0,5263],[0,0]],[[0,5263],[0,15]],[[9661,5275],[-9,4],[-8,-21],[17,17]],[[9641,5229],[4,24],[-13,-3],[-4,-30],[13,9]],[[6389,5188],[4,35],[8,15],[-8,23],[-9,-18],[-5,9],[5,23],[-11,19],[0,26],[-25,78],[-28,102],[-12,37],[-23,8],[-24,13],[-38,-19],[-8,-17],[-2,-28],[-10,-25],[-2,-23],[5,-22],[13,-5],[0,-11],[12,-24],[4,-19],[-12,-33],[-2,-28],[9,-17],[4,-20],[14,-1],[26,-11],[12,-1],[39,-35],[8,-15],[-4,-13],[12,4],[15,-21],[1,-18],[9,-13],[17,25],[6,20]],[[8987,5194],[10,23],[18,-11],[22,24],[-3,14],[11,41],[7,3],[7,26],[-3,16],[9,21],[31,15],[38,29],[-4,7],[16,20],[11,33],[11,-7],[11,14],[7,-5],[5,33],[32,32],[22,26],[8,26],[-1,38],[13,28],[-2,29],[-12,45],[1,19],[-6,25],[-12,31],[-21,17],[-19,44],[-8,30],[-11,18],[-11,51],[2,11],[-16,14],[-31,1],[-26,15],[-30,30],[-23,-16],[-17,-8],[5,-18],[-15,7],[-25,27],[-39,-16],[-43,-13],[-18,-23],[-12,-46],[-13,-14],[-27,-4],[9,-18],[-7,-26],[-13,25],[-25,6],[14,-19],[5,-21],[10,-17],[-2,-25],[-22,29],[-18,12],[-10,28],[-22,-14],[1,-19],[-18,-25],[-14,-13],[5,-8],[-36,-21],[-19,-2],[-27,-15],[-50,3],[-67,24],[-27,-3],[-29,18],[-24,8],[-16,32],[-41,4],[-24,-6],[-39,5],[-17,19],[-8,-2],[-27,20],[-39,0],[-30,-23],[-15,-6],[1,-20],[14,-5],[7,-44],[-3,-20],[-15,-34],[-3,-40],[-12,-31],[-12,-12],[-4,-25],[-16,-26],[-4,-14],[13,14],[-10,-31],[14,9],[8,14],[0,-17],[-23,-44],[3,-20],[10,-22],[-3,-19],[11,-22],[2,23],[12,-21],[22,-10],[14,-14],[21,-11],[20,2],[22,-13],[17,-2],[12,-10],[15,1],[29,-9],[15,-14],[7,-16],[17,-17],[2,-27],[19,-27],[12,27],[12,-6],[-10,-14],[9,-15],[12,7],[3,-23],[22,-27],[14,-5],[0,-8],[39,-12],[20,13],[16,18],[35,3],[-6,-16],[13,-24],[13,-8],[-5,-8],[12,-16],[17,-11],[14,4],[24,-6],[-1,-15],[-20,-10],[15,-4],[18,7],[15,12],[23,8],[8,-3],[17,9],[34,-12],[12,15],[-18,28],[-9,1],[3,12],[-18,29],[2,9],[22,16],[36,20],[20,18],[22,8],[4,9],[27,11],[18,-11],[23,-70],[-5,-40],[5,-38],[13,-41],[10,-11],[8,15],[2,18],[18,31],[1,28]],[[9502,5097],[8,10],[-19,0],[-11,-18],[22,8]],[[8352,5090],[-11,0],[-37,-20],[26,-6],[24,18],[-2,8]],[[9467,5079],[-28,-2],[-4,-17],[19,5],[13,14]],[[9490,5071],[-4,5],[-21,-25],[-5,-18],[9,0],[10,24],[11,14]],[[8456,5087],[-24,6],[-1,-13],[12,-18],[28,-12],[3,-7],[52,-11],[10,4],[-10,8],[-52,21],[-18,22]],[[8274,5027],[10,8],[17,-3],[7,13],[-51,10],[-15,-1],[10,-17],[15,0],[7,-10]],[[8413,5027],[-4,16],[-42,8],[-37,-3],[0,-11],[22,-6],[18,9],[18,-2],[25,-11]],[[9440,5034],[1,6],[-37,-23],[-6,-13],[36,21],[6,9]],[[9375,5005],[-18,-5],[-10,-17],[28,22]],[[8017,4988],[53,3],[6,-12],[50,14],[11,19],[42,6],[34,17],[-31,11],[-31,-12],[-54,-1],[-26,-5],[-32,-11],[-32,0],[-51,-12],[-5,-12],[-25,-2],[19,-28],[34,2],[34,13],[4,10]],[[8741,4972],[-14,20],[-3,-22],[11,-20],[7,8],[-1,14]],[[9329,4990],[-8,3],[-24,-30],[-6,-22],[15,12],[14,19],[13,10],[-4,8]],[[9221,4951],[-15,2],[-4,8],[-30,14],[-14,0],[-39,-17],[2,-9],[25,5],[15,-3],[9,-14],[2,15],[16,-2],[24,-20],[-4,-17],[23,4],[-1,16],[-9,18]],[[8534,4892],[-11,10],[-19,-6],[-5,-12],[28,-1],[7,9]],[[8623,4881],[10,23],[-23,-12],[-23,-3],[-35,1],[6,-16],[35,-1],[30,8]],[[9253,4922],[-9,8],[-11,-28],[-29,-22],[-20,-9],[8,-7],[36,22],[22,21],[3,15]],[[8725,4825],[8,47],[29,17],[23,-30],[32,-18],[25,0],[44,21],[30,5],[48,20],[51,17],[35,29],[4,17],[46,18],[7,16],[-25,3],[6,19],[25,19],[18,31],[16,-1],[-2,13],[22,5],[-8,6],[29,12],[-3,9],[-18,2],[-7,-8],[-52,-7],[-38,-35],[-14,-26],[-36,-13],[-41,18],[4,22],[-22,10],[-16,-5],[-28,-1],[-25,-24],[-28,-6],[-7,8],[-35,1],[12,-24],[17,-8],[-7,-31],[-14,-25],[-53,-24],[-23,-3],[-42,-27],[-8,14],[-11,3],[-6,-23],[-21,-14],[29,-11],[20,1],[-2,-8],[-41,0],[-11,-17],[-25,-6],[-11,-14],[37,-7],[14,-9],[45,12],[4,10]],[[8478,4751],[-22,29],[-21,5],[-27,-6],[-46,2],[-24,4],[-4,22],[24,26],[15,-13],[52,-10],[-2,13],[-12,-4],[-12,17],[-25,11],[27,37],[-5,10],[25,34],[-1,19],[-14,8],[-11,-10],[13,-24],[-27,11],[-4,-19],[-20,-17],[3,-28],[-19,9],[3,75],[-17,4],[-12,-8],[8,-27],[-4,-28],[-12,0],[-9,-20],[12,-19],[4,-23],[19,-55],[24,-22],[22,9],[35,4],[32,-2],[27,-21],[5,7]],[[8574,4759],[-2,25],[-14,-2],[-4,17],[11,16],[-8,3],[-11,-18],[-8,-37],[6,-23],[9,-11],[2,16],[16,2],[3,12]],[[7939,4962],[-31,0],[-24,-24],[-35,-24],[-33,-41],[-35,-62],[-24,-24],[-19,-48],[-25,-18],[-14,-25],[-21,-16],[-29,-32],[-3,-15],[61,7],[25,28],[37,32],[26,31],[27,1],[24,19],[16,25],[22,13],[-12,24],[25,10],[6,21],[10,16],[20,2],[14,19],[-7,36],[-1,45]],[[8274,4739],[31,27],[-33,3],[-10,20],[2,26],[-27,20],[-1,29],[-10,44],[-5,-10],[-31,13],[-11,-18],[-20,-2],[-14,-9],[-33,11],[-10,-14],[-41,-2],[-4,-39],[-14,-8],[-13,-25],[-4,-25],[3,-27],[16,-19],[21,10],[21,-6],[6,-24],[12,-6],[33,-6],[45,-52],[23,-16],[22,-20],[14,-23],[11,0],[14,15],[1,12],[42,17],[-2,12],[-19,1],[5,14],[-20,10],[-16,26],[20,28],[-4,13]],[[8510,4548],[4,35],[-9,27],[-11,-30],[-13,15],[9,22],[-8,13],[-32,-17],[-8,-21],[8,-14],[-17,-13],[-9,12],[-13,-1],[-21,16],[-4,-9],[11,-24],[32,-20],[10,14],[21,-8],[5,-13],[19,-1],[-1,-23],[22,14],[5,26]],[[7255,4612],[-25,7],[-12,-23],[-5,-42],[13,-48],[19,17],[13,20],[13,31],[-4,30],[-12,8]],[[3307,4498],[-23,3],[2,-22],[22,-3],[-1,22]],[[8443,4493],[-27,37],[-17,-20],[12,-16],[3,-19],[16,-1],[-5,19],[21,-28],[-3,28]],[[8291,4521],[-37,28],[14,-20],[36,-39],[15,-29],[5,24],[-18,16],[-15,20]],[[8385,4445],[16,10],[18,0],[0,12],[-31,21],[1,-29],[-4,-14]],[[8485,4437],[8,33],[-21,-7],[7,28],[-13,6],[-1,-20],[-9,-2],[-4,-18],[16,2],[0,-11],[-17,-22],[27,0],[7,11]],[[8375,4411],[-7,25],[-27,-37],[24,1],[10,11]],[[8369,4247],[17,9],[9,-8],[-2,20],[9,22],[-7,25],[-16,10],[-5,24],[7,24],[27,0],[34,16],[-2,17],[9,7],[-3,13],[-22,-14],[-10,-16],[-7,11],[-18,-18],[-25,5],[-14,-7],[10,-20],[-8,-7],[-4,11],[-14,-17],[-5,-42],[11,10],[3,-47],[9,-28],[17,0]],[[3178,4256],[-7,7],[-38,1],[3,-17],[37,2],[5,7]],[[2864,4266],[-9,6],[-31,-16],[15,-10],[25,4],[18,16],[-18,0]],[[2984,4205],[24,5],[3,-5],[22,0],[24,7],[5,11],[15,-1],[-1,9],[26,13],[-10,12],[-14,-6],[-21,-1],[-17,8],[-13,-3],[-11,21],[-8,-14],[-19,-5],[-30,0],[-13,6],[-15,-10],[3,-10],[46,7],[10,-7],[-12,-13],[0,-12],[-19,-5],[8,-8],[17,1]],[[8063,4242],[-23,14],[-23,-9],[0,-26],[13,-14],[31,-9],[16,1],[6,12],[-12,13],[-8,18]],[[679,4229],[-11,1],[-4,-20],[5,-17],[19,8],[12,15],[-21,13]],[[2786,4115],[11,12],[26,-4],[51,41],[26,6],[-2,9],[20,1],[21,12],[-3,8],[-37,5],[-19,-2],[-40,3],[18,-17],[-11,-9],[-18,-2],[-16,-26],[-16,1],[-26,-8],[-8,-7],[-36,-5],[-10,-6],[11,-8],[-28,-1],[-35,24],[-26,1],[15,-10],[5,-11],[28,-14],[28,-6],[45,3],[26,10]],[[2846,4084],[-7,1],[-7,-18],[-10,-9],[6,-20],[8,1],[10,26],[0,19]],[[8365,4115],[-12,25],[-14,-26],[-4,-24],[17,-31],[22,-24],[13,10],[-22,70]],[[2838,3994],[-31,4],[-1,-11],[31,-2],[1,9]],[[2861,3994],[-5,22],[-5,-21],[-12,-16],[22,15]],[[8739,3739],[4,13],[-16,21],[-11,-11],[-15,8],[-7,20],[-18,-11],[0,-15],[15,-21],[16,4],[12,-15],[20,7]],[[5960,3686],[-19,15],[3,10],[-28,14],[-14,-5],[-7,-14],[16,-1],[4,-9],[20,1],[25,-11]],[[5658,3685],[15,12],[41,0],[0,7],[16,-5],[-4,11],[-40,2],[1,-5],[-34,-7],[5,-15]],[[5431,3593],[-10,29],[4,11],[-6,19],[-21,-14],[-14,-4],[-39,-18],[4,-20],[32,5],[50,-8]],[[5255,3481],[17,27],[-4,50],[-13,-2],[-11,11],[-10,-9],[-2,-45],[-6,-22],[14,2],[15,-12]],[[8915,3633],[-10,29],[5,18],[-15,25],[-35,16],[-49,3],[-40,40],[-19,-14],[-1,-26],[-48,8],[-33,16],[-32,1],[28,26],[-19,58],[-18,13],[-13,-12],[7,-31],[-18,-10],[-11,-25],[26,-9],[15,-22],[28,-18],[20,-24],[55,-12],[30,8],[29,-64],[19,18],[56,-51],[18,-45],[-5,-43],[11,-24],[30,-7],[15,53],[-1,30],[-25,38],[0,37]],[[5265,3444],[-9,31],[-13,-8],[-7,-26],[6,-15],[18,-15],[5,33]],[[8997,3365],[19,8],[20,-17],[6,45],[-41,11],[-25,39],[-43,-27],[-15,43],[-31,0],[-4,-38],[14,-31],[29,-3],[8,-55],[9,-32],[32,43],[22,14]],[[3231,3267],[20,5],[26,-2],[-14,18],[-10,2],[-35,-17],[-7,-14],[10,-13],[10,21]],[[3283,3156],[-14,0],[-36,-12],[-26,-22],[10,-4],[37,12],[28,19],[1,7]],[[1569,3183],[-15,6],[-45,-20],[-8,-16],[-26,-15],[-4,-13],[-28,-8],[-12,-25],[3,-10],[47,16],[25,5],[24,37],[27,19],[12,24]],[[3440,3086],[-19,39],[19,-16],[19,11],[-10,15],[25,12],[12,-11],[28,14],[-8,33],[19,-8],[12,50],[-11,36],[-13,3],[-19,-8],[6,-35],[-8,-5],[-31,36],[-17,-1],[20,-20],[-27,-10],[-30,2],[-54,-1],[-5,-13],[18,-15],[-12,-12],[24,-26],[28,-72],[17,-26],[25,-16],[13,2],[-21,42]],[[1313,2926],[27,-3],[-9,55],[25,38],[-12,0],[-17,-21],[-10,-23],[-13,-15],[-4,-37],[13,6]],[[8989,3083],[28,79],[-41,-15],[-17,64],[27,44],[-1,29],[-21,-25],[-18,31],[-5,-34],[3,-42],[-3,-46],[6,-34],[2,-61],[-17,-45],[3,-65],[25,-23],[-11,-23],[13,-6],[17,79],[-1,46],[11,47]],[[4811,3013],[-49,27],[-40,-7],[23,-49],[-15,-50],[38,-38],[21,-24],[23,-2],[30,31],[-15,34],[5,35],[-21,43]],[[5352,2848],[-17,40],[-29,-29],[-4,-20],[41,-18],[9,27]],[[750,2769],[-29,20],[-14,-13],[-4,-25],[41,-28],[18,4],[12,17],[-24,25]],[[4916,2687],[-30,58],[29,-7],[30,1],[-7,43],[-25,47],[29,3],[27,65],[19,9],[17,56],[8,19],[33,9],[-3,30],[-14,14],[11,24],[-25,24],[-37,0],[-48,12],[-13,-9],[-18,21],[-26,-5],[-19,17],[-15,-9],[41,-47],[25,-11],[-44,-7],[-8,-19],[29,-14],[-15,-27],[5,-31],[42,5],[4,-29],[-19,-32],[-34,-9],[-7,-12],[10,-23],[-9,-14],[-15,24],[-1,-51],[-14,-25],[10,-56],[21,-44],[23,4],[33,-4]],[[401,2614],[-17,9],[-20,-10],[-16,-16],[28,-10],[21,5],[4,22]],[[2798,2480],[-11,32],[-12,-5],[-8,-18],[12,-23],[12,1],[7,13]],[[2725,2445],[-33,35],[-19,-2],[-6,-16],[20,-29],[38,0],[0,12]],[[230,2377],[17,12],[16,-7],[24,17],[27,9],[-2,7],[-21,14],[-32,-26],[-24,4],[-8,-6],[3,-24]],[[2634,2249],[5,31],[15,-11],[16,19],[30,23],[32,21],[2,32],[21,-6],[20,22],[-25,21],[-43,-16],[-16,-29],[-28,34],[-39,34],[-9,-38],[-38,6],[24,-32],[4,-53],[9,-63],[20,5]],[[4597,2193],[-7,46],[31,47],[-36,52],[-80,45],[-24,12],[-114,-30],[28,-29],[-61,-34],[49,-13],[-1,-20],[-58,-16],[19,-46],[42,-11],[43,48],[42,-39],[35,21],[45,-39],[47,6]],[[2892,2142],[-31,2],[-7,-36],[12,-42],[26,-11],[21,21],[1,32],[-4,12],[-18,22]],[[0,2001],[68,61],[73,75],[-4,46],[19,18],[-5,-53],[75,11],[55,68],[-28,31],[-47,7],[0,67],[-10,13],[-26,-1],[-22,-24],[-37,-20],[-6,-30],[-28,-11],[-31,9],[-16,-24],[6,-27],[-34,17],[14,33],[-16,29],[0,-295]],[[2343,1988],[-17,30],[-38,-26],[-22,9],[-38,-36],[24,-26],[19,-36],[47,39],[25,46]],[[9999,1844],[-30,4],[-5,-28],[35,-38],[0,62]],[[0,1782],[0,62]],[[0,1844],[0,-62]],[[0,1782],[26,-4],[40,27],[-2,12],[-28,21],[-36,6]],[[2485,1957],[-1,83],[38,-63],[33,51],[-9,58],[27,52],[29,-55],[21,-68],[1,-90],[39,7],[42,11],[37,41],[2,40],[-21,43],[19,41],[-4,36],[-53,52],[-39,11],[-29,-23],[-8,37],[-27,59],[-8,30],[-32,46],[-40,4],[-22,28],[-3,42],[-31,8],[-34,50],[-30,68],[-11,47],[-1,66],[40,9],[12,52],[14,41],[39,-11],[51,23],[28,20],[20,25],[35,13],[29,23],[46,2],[30,4],[-4,45],[8,49],[20,53],[42,45],[21,-15],[14,-49],[-13,-76],[-20,-26],[45,-24],[31,-36],[16,-36],[-3,-35],[-19,-46],[-33,-42],[32,-59],[-12,-53],[-9,-95],[19,-14],[48,17],[29,6],[23,-17],[25,21],[35,36],[8,23],[50,5],[-1,49],[9,73],[25,8],[21,33],[40,-32],[25,-61],[20,-27],[21,50],[36,72],[31,65],[-11,33],[37,29],[24,29],[45,14],[18,15],[10,42],[23,7],[11,18],[2,54],[-40,33],[-46,17],[-35,38],[-47,7],[-59,-9],[-42,-1],[-29,3],[-23,33],[-35,19],[-40,58],[-32,39],[23,-7],[45,-56],[58,-37],[41,-4],[25,22],[-27,29],[10,46],[9,32],[36,21],[46,-6],[28,-48],[2,31],[17,15],[-34,26],[-61,26],[-28,16],[-31,29],[-21,-4],[-1,-33],[48,-34],[-44,0],[-31,6],[5,14],[-31,20],[-57,25],[-19,33],[-1,21],[10,20],[14,7],[-32,5],[-20,7],[-29,4],[-23,10],[41,-6],[8,6],[-40,13],[-16,0],[-6,34],[-20,29],[-2,-9],[-15,-12],[13,41],[-25,43],[6,-26],[-14,-14],[-3,-32],[-5,17],[6,30],[1,35],[7,2],[8,48],[-17,27],[-29,10],[-18,21],[-15,2],[-17,24],[-31,23],[-16,16],[-13,20],[-4,24],[14,52],[13,22],[0,15],[13,38],[-2,34],[-7,20],[-22,0],[-5,-14],[-10,-7],[-28,-53],[-4,-13],[6,-21],[-8,-19],[-22,-27],[-11,-6],[-27,15],[-19,-17],[-17,-8],[-32,4],[-24,-3],[-33,7],[4,8],[0,25],[-40,1],[-20,-18],[-25,4],[-20,-7],[-41,10],[-26,23],[-26,16],[-16,15],[-6,15],[1,38],[5,11],[-15,51],[-6,57],[15,33],[5,24],[19,23],[16,32],[30,8],[12,13],[24,-8],[60,-14],[16,-13],[8,-18],[2,-26],[5,-9],[48,-15],[42,-2],[4,22],[-14,18],[-6,19],[5,5],[-11,38],[-7,-8],[-6,26],[3,5],[-5,29],[-16,19],[23,6],[6,-5],[28,3],[25,-7],[28,0],[16,5],[35,25],[-1,21],[-6,10],[-4,25],[2,21],[-11,31],[13,29],[34,34],[21,13],[13,-2],[29,-14],[9,-8],[16,1],[27,9],[19,17],[14,1],[21,-20],[12,-3],[5,-35],[16,-14],[20,-6],[20,2],[34,-21],[14,-15],[17,10],[-7,17],[-16,3],[9,14],[0,15],[-12,17],[10,23],[12,-2],[6,-21],[-8,-10],[-2,-22],[35,-12],[-5,-14],[11,-10],[10,21],[19,1],[18,16],[1,10],[55,-3],[16,13],[20,4],[17,-9],[0,-8],[68,-2],[-24,9],[10,14],[22,2],[21,14],[4,24],[15,-1],[29,18],[17,19],[1,15],[10,0],[26,25],[34,6],[2,-6],[23,-2],[60,18],[29,25],[5,12],[8,-2],[24,67],[14,5],[1,20],[-21,23],[9,9],[48,5],[2,29],[21,-19],[35,10],[46,18],[14,17],[-5,16],[33,-9],[54,15],[41,-1],[41,24],[36,33],[21,8],[24,1],[10,9],[14,55],[-12,48],[-13,19],[-39,41],[-19,34],[-20,25],[-7,1],[-7,22],[2,55],[-11,67],[-9,12],[-5,41],[-28,41],[-5,31],[-22,14],[-7,19],[-31,0],[-43,12],[-19,13],[-31,9],[-33,27],[-24,31],[-4,24],[4,18],[-4,33],[-6,16],[-20,19],[-31,58],[-24,27],[-19,15],[-13,34],[-18,20],[-12,22],[-31,18],[-21,-6],[-15,4],[-26,-16],[-18,2],[-17,-20],[-2,18],[35,31],[-4,25],[17,15],[-2,18],[-25,47],[-42,20],[-55,7],[-32,-3],[6,22],[-6,28],[6,19],[-16,14],[-29,5],[-26,-14],[-12,10],[4,38],[19,12],[16,-12],[8,20],[-26,12],[-23,25],[-3,40],[-7,22],[-26,0],[-22,21],[-9,32],[29,31],[26,8],[-9,39],[-33,24],[-19,52],[-24,18],[-12,21],[9,48],[19,28],[-37,-4],[-38,30],[-5,45],[-11,1],[-32,-16],[-32,-33],[-34,-28],[-9,-30],[8,-27],[-14,-30],[-4,-77],[12,-41],[30,-32],[-43,-13],[27,-37],[9,-68],[31,15],[15,-83],[-19,-10],[-9,49],[-17,-6],[9,-56],[9,-71],[12,-25],[-7,-37],[-2,-41],[11,-1],[17,-58],[20,-57],[11,-51],[-6,-51],[8,-27],[-3,-41],[16,-41],[4,-62],[19,-136],[-2,-51],[-7,-43],[-27,-17],[-2,-13],[-56,-30],[-49,-33],[-22,-19],[-11,-24],[4,-9],[-23,-39],[-28,-54],[-26,-59],[-11,-13],[-9,-21],[-21,-19],[-21,-12],[10,-13],[-14,-28],[9,-20],[22,-19],[15,-21],[-6,-13],[-11,14],[-16,-13],[5,-8],[-4,-26],[9,-5],[5,-18],[11,-18],[-2,-12],[34,-18],[6,-11],[6,-25],[14,-2],[22,-34],[-10,-6],[5,-17],[-6,-27],[6,-7],[-4,-25],[-21,-24],[-6,-16],[7,-8],[-26,-19],[-12,1],[-6,11],[-20,14],[13,16],[-24,10],[-5,-18],[-14,3],[-4,-11],[-19,-6],[-16,2],[-21,-12],[3,-12],[-29,-17],[-9,-13],[-3,15],[-20,-17],[3,-28],[-29,-31],[-25,-23],[9,-2],[-13,-12],[-3,7],[-16,0],[-37,-11],[-22,-11],[-18,-1],[-27,-18],[-32,-32],[-14,-10],[-23,-8],[-15,2],[-36,14],[-42,-13],[-25,-14],[-21,-4],[-31,-14],[-30,-23],[-44,-11],[-12,-14],[-30,-18],[-20,-34],[13,-31],[-10,-14],[-11,-28],[-25,-31],[-28,-25],[-14,-20],[-24,-13],[-4,-8],[4,-20],[-14,-7],[-17,-16],[-8,-24],[-13,-1],[-31,-34],[0,-10],[-16,-25],[-9,-26],[1,-13],[-20,-13],[-11,1],[-14,-9],[-6,14],[8,41],[47,58],[7,21],[13,20],[18,16],[10,30],[16,29],[0,17],[14,1],[21,28],[-17,18],[-8,-20],[-18,-18],[-33,-23],[1,-23],[-5,-18],[-32,-24],[-28,-12],[-16,-19],[13,-1],[11,-12],[1,-15],[-23,-24],[-16,-9],[-20,-43],[-24,-57],[-4,-18],[-19,-20],[-13,-4],[-3,-10],[-15,-2],[-10,-9],[-34,-9],[-2,-20],[-27,-35],[-23,-51],[1,-8],[-13,-12],[-21,-31],[-5,-31],[-14,-20],[6,-32],[-1,-33],[-8,-30],[9,-38],[7,-73],[-4,-56],[-9,-37],[-8,-20],[4,-9],[40,15],[15,40],[6,-11],[-4,-35],[-9,-36],[-4,0],[-54,-44],[-20,-19],[-51,-19],[-14,-41],[2,-29],[-34,-20],[-6,-39],[-33,-36],[0,-26],[-15,-18],[-26,-16],[-8,-45],[-36,-43],[-14,-51],[-27,-4],[-43,-1],[-34,-16],[-56,-58],[-75,-32],[-39,5],[-55,-27],[-33,-25],[-30,13],[4,40],[-46,16],[-26,19],[-29,12],[-4,-33],[12,-57],[29,-19],[-8,-15],[-35,34],[-18,39],[-41,40],[20,28],[-26,39],[-30,23],[-27,17],[-8,23],[-42,27],[-10,25],[-31,22],[-20,-4],[-55,32],[-22,16],[-47,14],[-6,-8],[31,-23],[28,-16],[28,-28],[35,-6],[14,-21],[39,-32],[26,-29],[6,-42],[14,-32],[-32,16],[-9,-9],[-16,20],[-18,-29],[-8,21],[-10,-28],[-27,23],[-18,-1],[-2,-33],[4,-22],[-16,-19],[-38,10],[-23,-26],[-18,-14],[0,-34],[-22,-26],[10,-35],[24,-35],[10,-32],[22,-5],[19,10],[22,-31],[20,6],[22,-20],[-5,-31],[-17,-12],[22,-26],[-17,1],[-31,15],[-8,15],[-22,-15],[-39,8],[-40,-17],[-13,-27],[-34,-40],[38,-30],[63,-35],[23,0],[-4,36],[58,-3],[-22,-46],[-34,-27],[-21,-37],[-26,-33],[-37,-25],[15,-41],[48,-3],[35,-37],[8,-40],[28,-41],[28,-11],[51,-38],[27,6],[42,-48],[42,20],[21,40],[12,-17],[47,5],[-2,19],[42,16],[29,-9],[59,27],[52,8],[21,11],[38,-13],[41,25],[83,32],[44,39],[29,7],[24,-33],[33,-27],[42,10],[41,-36],[46,-22],[20,36],[20,-20],[5,-40],[20,9],[47,76],[38,-57],[2,63],[35,-13],[11,-24],[33,5],[43,33],[65,31],[38,13],[27,-4],[38,40],[-39,39],[49,16],[75,-9],[25,-13],[29,45],[31,-38],[-30,-33],[19,-27],[34,-4],[22,-9],[23,19],[28,44],[31,-6],[48,34],[44,-12],[39,2],[-2,-48],[25,-14],[43,27],[0,72],[17,-61],[23,2],[12,-80],[-31,-50],[-32,-35],[3,-96],[33,-66],[37,15],[28,40],[38,98],[-25,43],[52,16]],[[1829,1629],[-15,46],[62,-29],[39,49],[31,-51],[26,33],[23,92],[13,-37],[-20,-99],[24,-16],[29,17],[31,40],[17,91],[9,64],[47,43],[50,40],[-3,38],[-46,6],[18,32],[-9,30],[-51,-13],[-49,-22],[-32,5],[-51,27],[-83,15],[-37,5],[-15,-38],[-39,-23],[-23,10],[-36,-65],[63,-25],[39,4],[36,-14],[-55,-21],[-59,8],[-38,-2],[-15,-33],[64,-36],[-43,2],[-48,-24],[23,-69],[20,-39],[74,-60],[29,19]],[[2097,1599],[-24,66],[-44,-70],[10,-14],[37,-4],[21,22]],[[2879,1630],[3,29],[-60,-6],[-30,13],[-8,-5],[-31,-53],[1,-37],[14,-7],[63,12],[48,54]],[[2595,1626],[22,61],[26,-80],[70,-41],[48,103],[-4,63],[54,-28],[27,-38],[62,49],[38,44],[3,40],[52,-21],[29,58],[67,35],[24,34],[26,78],[-51,38],[66,51],[44,17],[40,68],[44,5],[-9,52],[-49,81],[-34,-29],[-44,-69],[-37,9],[-2,41],[29,41],[38,31],[11,18],[18,65],[-9,46],[-35,-17],[-70,-52],[39,55],[29,38],[5,22],[-76,-25],[-59,-36],[-34,-31],[10,-19],[-82,-66],[0,19],[-80,11],[-24,-23],[19,-50],[52,-1],[57,-9],[-9,-25],[10,-36],[36,-71],[-8,-34],[-11,-26],[-42,-39],[-57,-27],[18,-20],[-29,-52],[-25,-4],[-22,-29],[-14,24],[-52,12],[-100,-20],[-60,-24],[-44,-14],[-23,-30],[29,-40],[-39,0],[-10,-94],[22,-86],[29,-43],[72,-27],[-21,67]],[[2212,1555],[32,22],[51,-13],[7,30],[-26,48],[42,42],[-5,85],[-45,35],[-28,-8],[-18,-34],[-69,-74],[0,-31],[56,13],[-30,-66],[33,-49]],[[8988,1620],[-42,1],[-57,-11],[-5,-6],[27,-41],[34,-9],[40,40],[3,26]],[[2410,1664],[-29,71],[-32,-3],[-18,-85],[2,-49],[14,-44],[28,-29],[58,3],[52,26],[-41,90],[-34,20]],[[1654,1793],[-73,45],[-16,-40],[-63,-48],[31,-111],[23,-67],[-26,-63],[94,-17],[39,22],[71,5],[27,31],[29,44],[-35,25],[-67,69],[-34,66],[0,39]],[[9186,1421],[-32,44],[-44,-9],[-52,-44],[7,-37],[51,17],[70,29]],[[2398,1434],[-14,42],[-41,-8],[-33,-30],[15,-49],[40,-32],[24,41],[9,36]],[[9029,1367],[-22,84],[-102,-4],[-46,27],[-55,-73],[15,-79],[37,-24],[73,6],[100,63]],[[2264,1227],[20,58],[2,60],[-14,85],[-45,13],[-30,-18],[0,-67],[-44,9],[-2,-92],[30,3],[41,-41],[40,7],[2,-17]],[[1994,1291],[10,43],[26,-21],[29,5],[5,58],[-17,54],[-95,17],[-69,48],[-43,2],[-3,-36],[56,-49],[-124,13],[-39,-19],[37,-115],[27,-34],[78,41],[49,71],[49,9],[-41,-114],[27,-46],[28,15],[10,58]],[[6598,1854],[-17,7],[-91,-12],[-7,-40],[-50,-23],[-4,-50],[27,-21],[0,-51],[55,-87],[-25,-11],[66,-94],[-7,-51],[61,-59],[93,-77],[92,-23],[48,-47],[54,-16],[19,50],[-19,38],[-98,60],[-85,54],[-86,105],[-42,102],[-43,94],[4,78],[55,74]],[[2370,1179],[30,41],[55,0],[24,40],[-6,47],[32,27],[17,28],[38,5],[40,9],[44,-25],[57,-11],[45,9],[30,44],[6,46],[-17,29],[-42,24],[-35,-13],[-80,17],[-57,1],[-46,-12],[-73,-37],[-10,-61],[-4,-57],[-26,-54],[-58,-14],[-32,-39],[10,-52],[58,8]],[[1771,1106],[-4,100],[-20,45],[-26,6],[-53,52],[-43,18],[-38,-25],[46,-93],[58,-85],[43,2],[37,-20]],[[9999,2297],[-36,30],[-36,-5],[25,35],[17,54],[13,17],[3,26],[-7,17],[-52,-14],[-78,47],[-25,7],[-42,42],[-40,37],[-11,26],[-39,-40],[-73,44],[-12,-20],[-27,25],[-37,-8],[-9,37],[-33,53],[1,23],[31,12],[-4,78],[-25,1],[-12,43],[11,22],[-48,26],[-10,56],[-41,11],[-9,49],[-40,43],[-10,-32],[-12,-69],[-15,-111],[13,-71],[23,-32],[2,-25],[43,-13],[50,-70],[48,-59],[49,-47],[23,-87],[-34,6],[-17,51],[-70,65],[-23,-73],[-72,20],[-69,99],[23,35],[-62,15],[-43,5],[2,-40],[-43,-9],[-35,28],[-85,-10],[-91,17],[-90,107],[-106,121],[43,7],[14,31],[27,11],[18,-25],[30,3],[40,54],[1,40],[-21,47],[-3,55],[-12,70],[-42,63],[-9,29],[-76,95],[-17,23],[-38,24],[-17,0],[-17,-19],[-38,29],[-4,13],[-11,-2],[-20,26],[1,28],[-14,8],[-16,18],[-18,6],[-12,11],[-4,20],[26,21],[24,45],[7,22],[0,42],[-10,20],[-25,7],[-22,14],[-25,2],[-3,-18],[5,-26],[-13,-38],[21,-6],[-19,-31],[-13,-7],[-13,3],[-15,-9],[19,-49],[-31,-20],[-39,12],[-20,17],[-30,11],[15,-18],[-6,-14],[22,-26],[-15,-20],[-24,14],[-32,26],[-17,25],[-27,1],[-14,18],[15,25],[22,5],[1,17],[22,11],[31,-26],[25,14],[18,1],[5,19],[-40,10],[-13,19],[-27,18],[-14,24],[30,20],[11,35],[17,30],[19,27],[-1,26],[-17,9],[6,18],[17,10],[-12,53],[-15,3],[-43,78],[-26,38],[-38,29],[-39,27],[-31,3],[-17,14],[-10,-10],[-15,16],[-39,15],[-29,5],[-10,33],[-16,2],[-8,-23],[8,-12],[-37,-10],[-13,5],[-37,27],[-24,29],[-6,21],[46,72],[27,19],[17,24],[12,55],[-3,52],[-24,20],[-31,18],[-23,25],[-35,27],[-11,-19],[9,-19],[-21,-17],[-23,-4],[-11,-16],[-14,-30],[-25,-14],[-24,1],[4,-24],[-24,1],[-2,32],[-25,69],[2,21],[19,1],[11,27],[5,25],[15,17],[17,3],[21,18],[28,37],[-1,33],[4,27],[10,8],[11,26],[-2,10],[-18,1],[-59,-44],[-4,-15],[-16,-19],[-4,-24],[-10,-16],[4,-21],[-18,-24],[-5,-14],[-28,-30],[-4,17],[-5,-16],[11,-47],[-3,-22],[9,-22],[-10,-18],[3,-32],[-12,-15],[-9,-36],[-5,-38],[-12,-25],[-50,37],[-32,-10],[9,-38],[-6,-28],[-22,-35],[4,-11],[-16,-4],[-20,-25],[-9,-32],[-17,-34],[-26,-1],[3,13],[-9,17],[-35,-6],[-4,11],[-19,0],[-34,6],[2,23],[-15,19],[-40,20],[-31,36],[-21,19],[-29,20],[0,14],[-37,18],[-14,2],[-8,23],[6,39],[1,24],[-11,29],[0,50],[-15,1],[-12,22],[8,10],[-25,8],[-10,20],[-11,9],[-26,-28],[-24,-70],[-24,-43],[-12,-56],[-25,-41],[-20,-97],[0,-38],[-5,-29],[-41,19],[-19,-4],[-36,-38],[13,-11],[-8,-12],[-33,-28],[-20,-7],[-9,-23],[-21,-24],[-51,5],[-45,2],[-39,4],[-83,-17],[-31,-4],[-12,-41],[-13,-4],[-22,4],[-28,17],[-34,-11],[-29,-26],[-26,-9],[-18,-30],[-21,-44],[-14,5],[-18,-11],[-11,13],[-16,-2],[3,23],[20,53],[14,7],[4,12],[19,12],[-1,25],[20,38],[-2,-23],[7,-17],[16,6],[1,20],[-6,18],[11,20],[22,-5],[40,2],[39,-42],[26,-31],[-3,22],[4,25],[12,22],[16,11],[37,10],[30,40],[-15,27],[-12,10],[-10,21],[-14,-2],[-9,23],[4,21],[-16,4],[-17,11],[-9,21],[-17,0],[-11,8],[0,12],[-14,8],[-15,-3],[-19,11],[-32,9],[-7,24],[-27,13],[-45,14],[-24,21],[-21,0],[-17,12],[-17,6],[-30,3],[-18,18],[-42,1],[-7,-17],[1,-16],[-13,-45],[1,-19],[-5,-26],[-10,-22],[-15,-10],[-15,-26],[-7,-25],[-20,-21],[-12,-5],[-18,-30],[-4,-21],[2,-19],[-16,-36],[-28,-18],[-10,-18],[2,-7],[-16,-24],[-11,-24],[-31,-48],[-14,0],[8,-48],[-13,38],[-14,23],[-23,-25],[-19,-48],[-3,3],[12,35],[17,33],[21,50],[19,37],[25,35],[-6,5],[1,21],[32,28],[14,37],[-6,5],[4,32],[11,37],[25,18],[15,36],[8,27],[16,15],[38,28],[39,45],[21,18],[-1,12],[-16,7],[21,14],[18,24],[70,-11],[48,-16],[25,-2],[51,-17],[-2,40],[-6,11],[-7,32],[-31,70],[-24,42],[-23,33],[-33,39],[-28,24],[-42,28],[-25,22],[-31,36],[-12,22],[-20,11],[-7,12],[-10,2],[-4,21],[-9,11],[-5,20],[-12,9],[-12,36],[1,17],[18,10],[-7,25],[0,23],[21,48],[15,19],[-1,30],[3,26],[1,46],[5,15],[-19,42],[-18,19],[-56,25],[-33,34],[-9,5],[-31,28],[-3,23],[14,23],[10,26],[-1,31],[-4,15],[7,5],[-16,25],[-57,28],[-12,12],[10,15],[-10,41],[-3,27],[-7,15],[-24,21],[-36,59],[-51,54],[-21,17],[-29,13],[-14,1],[-3,11],[-18,-5],[-13,6],[-30,-6],[-28,2],[-29,14],[-24,5],[-18,14],[-12,1],[-11,-13],[-10,-2],[-17,-19],[0,-20],[-9,-23],[9,-6],[0,-27],[-19,-31],[-34,-72],[-20,-25],[-11,-23],[-13,-55],[-9,-49],[-4,-55],[-26,-38],[-20,-57],[-23,-29],[-4,-43],[4,-26],[11,-41],[15,-39],[25,-32],[2,-39],[-9,-10],[-14,-36],[10,-17],[-14,-48],[-14,-19],[3,-5],[-12,-31],[-22,-31],[-29,-29],[-19,-24],[-16,-30],[19,-61],[-5,-5],[14,-55],[-12,-19],[-12,-5],[-12,-25],[-50,15],[-23,0],[-15,-19],[-9,-21],[-19,-19],[-46,1],[-45,9],[-44,17],[-15,10],[-25,9],[-25,-9],[-32,-5],[-51,5],[-46,19],[-13,0],[-29,-14],[-25,-22],[-24,-16],[-18,-19],[-28,-14],[-14,-15],[-8,-33],[-23,-28],[-14,-10],[-8,-20],[-23,-17],[-11,-2],[-15,-19],[-6,-29],[3,-13],[-11,-23],[-14,-11],[12,-6],[20,-36],[-2,-16],[8,-15],[3,-29],[-6,-45],[2,-16],[-21,-28],[2,-27],[20,-25],[-2,-11],[10,-22],[15,-20],[9,-5],[8,-19],[0,-17],[10,-20],[19,-11],[18,-34],[14,-13],[26,-3],[22,-23],[14,-9],[23,-27],[-7,-42],[14,-47],[18,-24],[28,-15],[21,-15],[27,-58],[20,0],[17,15],[26,-2],[41,8],[27,-19],[30,-7],[18,-15],[26,-10],[46,-8],[47,-2],[14,6],[26,-15],[30,0],[11,9],[19,-3],[31,-15],[19,5],[-1,18],[24,-14],[2,8],[-14,18],[0,16],[9,9],[-3,31],[-19,17],[6,19],[14,1],[7,17],[43,17],[12,-3],[23,6],[37,15],[13,30],[64,20],[30,18],[26,-25],[-6,-26],[9,-16],[20,-16],[19,-5],[37,7],[10,14],[47,11],[6,12],[37,-1],[68,24],[32,-20],[25,-3],[20,4],[7,17],[7,-11],[22,7],[22,3],[13,-9],[14,-29],[5,-25],[15,-38],[13,-24],[-1,-29],[7,-14],[-11,-18],[11,-12],[-17,3],[-23,-9],[-19,21],[-43,5],[-22,-20],[-30,-1],[-6,15],[-20,4],[-26,-19],[-31,1],[-16,-36],[-21,-21],[14,-29],[-18,-17],[31,-37],[43,-1],[12,-29],[52,5],[34,-25],[32,-11],[46,-1],[49,28],[40,14],[32,-6],[24,4],[33,-20],[4,-17],[-7,-26],[-16,-15],[-16,-5],[-46,-46],[-31,-15],[-24,-24],[20,-7],[23,-34],[-15,-17],[41,-17],[-2,-9],[-46,10],[-18,14],[-27,2],[-23,15],[1,26],[14,10],[28,-2],[-5,14],[-31,8],[-37,23],[-16,-9],[6,-18],[-30,-12],[5,-8],[25,-14],[-8,-10],[-42,-10],[-2,-16],[-25,5],[-11,23],[-21,31],[0,11],[-13,7],[-9,-2],[-7,48],[-16,17],[-9,28],[12,37],[25,13],[-5,9],[-33,2],[-35,33],[-9,-26],[-31,-5],[-34,9],[19,23],[-29,6],[-15,-20],[-6,9],[7,22],[14,18],[-10,8],[29,28],[0,21],[-25,-10],[8,18],[-19,4],[12,32],[-20,1],[-22,-16],[-10,-29],[-5,-25],[-26,-38],[-6,-21],[-15,-13],[-3,-18],[6,-38],[-18,-22],[-39,-23],[-16,-14],[-25,-12],[-23,-29],[6,-3],[-13,-17],[-1,-14],[-17,-6],[-10,17],[-7,-14],[0,-15],[7,-3],[-21,-6],[-23,14],[-2,32],[9,21],[26,20],[14,33],[31,32],[22,-1],[7,9],[-8,8],[44,25],[25,20],[-2,21],[-16,-18],[-24,-6],[-12,24],[20,14],[-3,20],[-12,2],[-14,31],[-12,3],[6,-31],[6,-8],[-19,-40],[-12,-6],[-8,-15],[-18,-7],[-12,-16],[-21,-2],[-47,-43],[-19,-23],[-8,-39],[-37,-18],[-12,5],[-16,19],[-12,3],[-25,22],[-55,-11],[-40,14],[-4,23],[2,23],[-26,26],[-36,8],[-3,13],[-17,21],[-10,30],[11,22],[-16,16],[-6,24],[-21,7],[-20,28],[-62,0],[-28,26],[-13,-4],[-11,-11],[-8,-21],[-26,-6],[-11,10],[-14,-5],[-15,4],[5,-28],[-3,-23],[-12,-3],[-7,-14],[2,-26],[11,-12],[8,-38],[-6,-31],[0,-40],[-11,-18],[39,-28],[34,7],[37,0],[30,6],[23,-2],[45,2],[14,-24],[5,-82],[-28,-44],[-21,-22],[-42,-16],[-3,-32],[36,-10],[47,11],[-9,-49],[26,19],[65,-35],[8,-37],[47,-19],[14,-13],[24,-69],[38,-20],[23,1],[6,-10],[23,-3],[5,11],[19,-24],[-6,-20],[-2,-27],[-11,-28],[-1,-53],[12,-31],[24,-3],[11,-15],[22,-15],[-1,27],[-8,18],[4,15],[15,7],[-7,21],[-8,-6],[-20,37],[7,24],[1,20],[28,12],[-1,17],[28,-9],[16,-14],[32,20],[13,16],[18,-15],[79,-40],[28,9],[2,12],[27,1],[6,-22],[38,-18],[-6,-42],[1,-39],[14,-34],[26,-18],[22,39],[22,0],[9,-74],[-10,7],[-18,-20],[-2,-31],[35,-16],[35,-9],[30,9],[29,-1],[31,-31],[-29,-28],[-50,4],[-49,22],[-45,12],[-16,-32],[-27,-19],[6,-59],[-14,-56],[14,-37],[25,-41],[63,-72],[19,-15],[-3,-29],[-39,-33],[-48,20],[-26,48],[4,42],[-45,53],[-53,55],[-20,87],[20,42],[26,32],[-25,65],[-29,13],[-11,91],[-15,48],[-35,-4],[-16,41],[-31,3],[-9,-49],[-23,-60],[-21,-78],[-19,-34],[-55,64],[-37,12],[-38,-27],[-10,-60],[-9,-137],[26,-41],[72,-53],[56,-68],[51,-96],[66,-142],[47,-60],[76,-102],[61,-36],[46,4],[42,-72],[51,4],[49,-18],[88,64],[-36,23],[30,53],[29,-29],[46,51],[76,18],[105,90],[21,37],[2,49],[-31,38],[-45,19],[-124,-55],[-21,10],[45,52],[4,103],[36,20],[22,17],[3,-32],[-17,-30],[18,-25],[67,43],[24,-17],[-19,-50],[64,-70],[26,4],[25,25],[16,-49],[-22,-45],[14,-45],[-21,-49],[78,26],[16,43],[-35,9],[0,42],[22,25],[43,-16],[7,-48],[58,-36],[97,-67],[20,3],[-27,49],[35,8],[19,-28],[52,-1],[42,-33],[31,47],[32,-52],[-29,-47],[14,-28],[82,24],[39,27],[100,91],[19,-42],[-28,-42],[-1,-17],[-34,-8],[10,-40],[-15,-67],[-2,-28],[51,-82],[19,-87],[21,-20],[74,25],[5,54],[-26,75],[17,30],[9,60],[-6,115],[31,49],[-12,52],[-55,105],[32,11],[11,-26],[31,-19],[7,-36],[24,-37],[-16,-43],[12,-53],[-30,-7],[-6,-46],[22,-85],[-36,-72],[50,-63],[-8,-69],[15,-1],[15,53],[-11,90],[29,15],[-12,-65],[46,-38],[58,-5],[51,54],[-25,-78],[-2,-106],[48,-22],[67,5],[60,-13],[-23,-55],[33,-73],[30,-3],[55,-57],[74,-15],[9,-34],[73,-11],[22,28],[63,-66],[51,3],[8,-54],[26,-56],[65,-54],[49,43],[-38,33],[63,20],[7,62],[25,-30],[82,2],[62,60],[23,45],[-7,60],[-31,34],[-73,60],[-21,33],[35,14],[41,27],[24,-21],[15,67],[12,-27],[44,-17],[90,17],[6,49],[116,14],[2,-77],[59,18],[44,0],[45,53],[13,62],[-17,40],[35,72],[44,36],[27,-95],[44,41],[48,-25],[54,29],[20,-26],[45,13],[-20,-88],[37,-41],[251,63],[24,54],[72,70],[112,-17],[56,14],[23,36],[-4,63],[35,24],[37,-17],[49,-3],[53,17],[52,-10],[49,73],[34,-26],[-23,-52],[13,-38],[88,23],[58,-5],[80,40],[39,36],[0,296]],[[6364,3479],[13,27],[14,1],[8,11],[-23,2],[-9,43],[-11,9],[1,18],[9,26],[26,9],[20,18],[39,6],[44,-9],[-3,-35],[4,-38],[-22,-13],[8,-26],[-19,-2],[5,-32],[27,9],[25,-12],[-20,-23],[-8,-22],[-24,10],[-2,28],[-10,-34],[7,-17],[-5,-13],[-32,-14],[-13,-36],[-16,-10],[0,-13],[27,4],[1,-30],[23,-7],[24,5],[6,-39],[-6,-26],[-27,2],[-24,-10],[-32,18],[-26,9],[-12,25],[-27,7],[-28,42],[25,38],[-3,27],[46,67]],[[2393,1124],[-13,2],[-53,-7],[-6,-38],[56,2],[19,25],[-3,16]],[[1939,1099],[-52,39],[-41,-43],[23,-45],[40,-13],[39,22],[-9,40]],[[5686,1077],[-63,56],[-48,-31],[19,-36],[-16,-44],[57,-30],[11,54],[40,31]],[[1954,972],[-34,27],[-47,0],[0,-20],[30,-45],[14,7],[37,31]],[[2338,1050],[-41,29],[-23,-33],[-12,-54],[-2,-60],[36,6],[16,9],[33,52],[-7,51]],[[2220,1012],[11,59],[-46,-17],[-45,-44],[-62,-6],[27,-43],[-34,-36],[-2,-60],[55,23],[75,55],[21,69]],[[7918,1014],[-157,54],[51,-192],[22,-18],[22,12],[70,86],[-8,58]],[[5506,803],[92,116],[-70,59],[-15,103],[-25,27],[-13,107],[-34,5],[-59,-78],[24,-48],[-41,-40],[-54,-122],[-21,-121],[75,-60],[16,58],[39,-2],[11,-56],[40,-6],[35,58]],[[5706,684],[55,61],[-41,86],[-81,20],[-83,-26],[-4,-45],[-40,-3],[-31,-77],[87,-49],[40,42],[27,-52],[71,43]],[[6420,660],[-62,35],[-4,29],[-33,27],[-30,-40],[15,-54],[-61,-5],[53,-33],[44,-2],[5,49],[16,-43],[26,-30],[42,40],[-11,27]],[[7775,930],[-60,19],[-78,-44],[-46,-58],[-21,-118],[-38,-34],[72,-121],[60,-42],[54,92],[64,165],[-7,141]],[[2582,809],[34,52],[-38,46],[-51,110],[-50,11],[-57,-18],[-30,-60],[0,-56],[22,-41],[-50,1],[-31,-52],[-18,-75],[20,-77],[18,-55],[29,-12],[-12,-44],[65,-9],[35,98],[47,38],[46,34],[21,109]],[[3097,135],[74,18],[60,31],[51,62],[-2,60],[-67,92],[-68,40],[-26,45],[62,-2],[-66,116],[-45,51],[-48,138],[-57,27],[-18,32],[-84,17],[39,21],[-20,27],[23,73],[-26,49],[-43,40],[-13,52],[-39,40],[4,29],[48,-5],[0,32],[-74,74],[-73,-34],[-81,20],[-42,-16],[-53,-6],[-4,-61],[53,-28],[-14,-97],[17,-10],[74,59],[-38,-89],[-45,-27],[22,-56],[50,-37],[8,-52],[-39,-64],[-13,-85],[77,8],[22,18],[43,-62],[-63,-22],[-97,13],[-49,-62],[-24,-74],[-31,-58],[-6,-69],[41,-38],[32,-7],[55,-36],[41,-82],[34,13],[30,62],[21,-122],[37,-38],[50,-27],[85,-9],[14,25],[81,-41],[120,32]],[[4247,32],[174,192],[-52,85],[-106,11],[-150,20],[14,38],[99,-23],[83,70],[54,-63],[23,74],[-30,114],[71,-72],[135,-77],[83,39],[15,83],[-113,130],[-16,42],[-88,29],[64,7],[-32,120],[-23,99],[1,158],[33,85],[-43,6],[-46,39],[52,66],[6,99],[-30,11],[36,94],[-61,7],[32,44],[-9,36],[-39,16],[-39,0],[35,67],[0,42],[-55,-40],[-14,26],[37,23],[37,58],[10,71],[-49,17],[-56,-85],[10,60],[-33,46],[73,3],[39,6],[-75,72],[-75,63],[-81,27],[-31,1],[-29,29],[-38,78],[-60,52],[-19,3],[-77,33],[-25,43],[0,47],[-14,43],[-45,51],[11,49],[-27,107],[-38,4],[-41,-48],[-56,0],[-27,-33],[-18,-60],[-49,-79],[-14,-43],[-3,-61],[-39,-65],[10,-53],[-19,-26],[28,-90],[41,-30],[12,-33],[6,-65],[-47,42],[-25,11],[-34,-26],[-2,-58],[11,-45],[25,-2],[56,24],[-47,-56],[-24,-31],[-28,11],[-23,-22],[31,-87],[-17,-36],[-22,-70],[-34,-113],[-35,-43],[0,-49],[-74,-68],[-59,-8],[-74,3],[-68,10],[-32,-39],[-49,-78],[73,-41],[56,-8],[-119,-34],[-63,-56],[4,-56],[106,-71],[101,-73],[11,-58],[-76,-61],[25,-67],[97,-129],[40,-19],[-12,-89],[66,-53],[86,-34],[85,-2],[30,65],[74,-116],[66,80],[39,16],[58,67],[-66,-112],[4,-94],[93,-140],[97,11],[36,-92],[98,-25],[222,32]]],"transform":{"scale":[0.00010001000100010001,0.00009602331466449245],"translate":[-0.5,-0.46013712333025986]}}
body {
margin: 0;
padding: 0;
font-family: Arial, Helvetica, sans-serif;
font-size: 16px;
line-height: 19px;
text-rendering: optimizeLegibility;
color: rgba(0,0,0,0.87);
}
svg, canvas {
display: block;
}
a {
text-decoration: none;
color: #1f78b4;
}
a:hover {
text-decoration: underline;
color: #e31a1c;
}
a:visited {
color: #333;
}
small {
color: rgba(0,0,0,0.64);
}
.no-select {
user-select: none;
}
.point {
pointer-events: all;
cursor: pointer;
}
.water {
fill: #def4ff;
}
.border {
fill: none;
stroke-width: 2.5;
stroke: #444;
stroke-opacity: 1;
}
.overlay {
fill: none;
pointer-events: all;
}
.overlay-white {
fill: #fff;
pointer-events: all;
}
.country {
stroke: #000;
stroke-opacity: .33;
fill: none;
}
.land {
fill: rgba(255, 255, 255, 0.87);
stroke: 0;
}
.graticule {
fill: none;
stroke: #bbb;
stroke-opacity: 0.66;
}
.cool-point {
fill: none;
stroke: #1f78b4;
stroke-opacity: 0.85;
}
.hot-point {
fill: none;
stroke: #e31a1c;
stroke-opacity: 0.86;
}
.balanced-point {
fill: none;
stroke: #333;
stroke-opacity: 0.85;
}
.cool-line {
fill: none;
stroke: #1f78b4;
stroke-opacity: .85;
}
.hot-line {
fill: none;
stroke: #e31a1c;
stroke-opacity: .85;
}
.balanced-line {
fill: none;
stroke: #333;
stroke-opacity: .85;
}
.symbol {
stroke-width: 1;
stroke: #000;
cursor: pointer;
}
.place {
fill: #888;
fill-opacity: 0.33;
}
.pyramid {
fill: #ffff4d;
}
.megalith {
fill: #299ae6;
}
.temple {
fill: #ff7f00;
}
.mound {
fill: #90de43;
}
.volcano {
fill: #e31a1c;
}
.graticule {
stroke-dasharray: 2, 3;
}
.legend {
cursor: pointer;
pointer-events: all;
}
.item {
cursor: pointer;
}
.control {
cursor: pointer;
}
.legend-symbol {
stroke-width: 2;
}
.legend .map {
fill: #def4ff;
stroke: #333;
}
var Utils = (function () {
'use strict';
function parsePlaces(geo) {
geo.features.sort(function (a, b) {
return a.properties.name.localeCompare(b.properties.name);
});
geo.features.forEach(function (v, k) {
v.properties.id = k;
v.properties.description = v.properties.description || 'place';
});
}
function pointsToFeatures(points, type, name, shift) {
return points.coordinates.map(function (p) {
var sh = p[0] + shift;
sh = (sh > 180) ? (sh - 360) : sh;
return {
coordinates: p,
geometry: {
coordinates: [sh, p[1]],
type: 'Point'
},
type: type,
properties: {
name: name
}
}
});
}
function trans(path) {
return function (d) {
var p = path.centroid(d);
if (isNaN(p[0]) || isNaN(p[1])) {
p[0] = -1e10;
p[1] = -1e10;
}
return d.translate = 'translate(' + p + ')';
};
}
function addSymbols(root, cfg, scale) {
var g = root.append('defs');
d3.keys(cfg.symbols).forEach(function (d) {
g.append('path')
.attr('id', d)
.attr('class', 'symbol ' + d)
.attr('d', d3.svg.symbol()
.size(scale * scale * cfg.sizes[d])
.type(cfg.symbols[d])());
});
return g.selectAll('path');
}
function svgPlaces(root, geo, t, scale, cfg, clicked) {
t = trans(t);
var defs = addSymbols(root, cfg, scale);
var places = root.selectAll()
.data(geo.features)
.enter()
.append('use')
.attr('transform', t)
.attr('xlink:href', function (d) {
return '#' + d.properties.description;
})
.on('click', clicked);
return {
defs: defs,
places: places
}
}
function _svgPlaces(root, geo, t, scale, cfg, clicked) {
t = trans(t);
return root.selectAll()
.data(geo.features)
.enter()
.append('path')
.attr('transform', t)
.attr('class', function (d) {
return 'symbol ' + d.properties.description;
})
.attr('d', function (d) {
return d3.svg.symbol()
.size(scale * cfg.sizes[d.properties.description])
.type(cfg.symbols[d.properties.description])();
})
.on('click', clicked);
}
function svgLines(root, path, data, type) {
return root.append('path')
.datum(data)
.attr('class', 'line ' + type)
.attr('d', path);
}
function svgPoints(root, points, type, projection, clicked, display) {
points = points.filter(function (d) {
var p = projection(d.coordinates);
if (Math.abs(p[0]) !== Infinity && Math.abs(p[1]) !== Infinity) {
d.projected = p;
return true;
}
});
var p = root.selectAll('.point.' + type).data(points);
p.enter().append('circle')
.attr('class', 'point ' + type)
.style('display', display)
.attr('r', 5)
.attr('transform', function (d) {
return 'translate(' + d.projected + ')';
})
.on('click', clicked);
}
function svgControls(root, setIndex, reset) {
root.append('path')
.attr('class', 'control')
.attr('d', d3.svg.symbol().size(120).type('triangle-up'))
.attr('transform', 'translate(60,10)rotate(90)')
.on('click', function () {
setIndex(+1);
});
root.append('path')
.attr('class', 'control')
.attr('d', d3.svg.symbol().size(120).type('circle'))
.attr('transform', 'translate(35,10)')
.on('click', reset);
root.append('path')
.attr('class', 'control')
.attr('d', d3.svg.symbol().size(120).type('triangle-up'))
.attr('transform', 'translate(10,10)rotate(-90)')
.on('click', function () {
setIndex(-1);
});
}
return {
svgLines: svgLines,
svgPoints: svgPoints,
svgPlaces: svgPlaces,
svgControls: svgControls,
parsePlaces: parsePlaces,
pointsToFeatures: pointsToFeatures
};
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment