Skip to content

Instantly share code, notes, and snippets.

@martgnz
martgnz / .block
Last active October 28, 2017 14:51
Venezia
license: mit
border: none
height: 690
@martgnz
martgnz / .block
Last active October 28, 2017 14:49
Spanish unemployment
license: mit
border: none
@martgnz
martgnz / .block
Last active October 3, 2023 04:20
Canvas Globe
license: mit
border: none
@martgnz
martgnz / .block
Last active October 28, 2017 14:14
Arctic temperatures
license: mit
border: none
height: 2540
var StaticCanvasMap;var ZoomableCanvasMap;!function(){"use strict";function inside(pt,polygon){var polys=polygon.geometry.coordinates;if(polygon.geometry.type==="Polygon")polys=[polys];var insidePoly=false;var i=0;while(i<polys.length&&!insidePoly){if(inRing(pt,polys[i][0])){var inHole=false;var k=1;while(k<polys[i].length&&!inHole){if(inRing(pt,polys[i][k])){inHole=true}k++}if(!inHole)insidePoly=true}i++}return insidePoly}function inRing(pt,ring){var isInside=false;for(var i=0,j=ring.length-1;i<ring.length;j=i++){var xi=ring[i][0],yi=ring[i][1];var xj=ring[j][0],yj=ring[j][1];var intersect=yi>pt[1]!==yj>pt[1]&&pt[0]<(xj-xi)*(pt[1]-yi)/(yj-yi)+xi;if(intersect)isInside=!isInside}return isInside}function maxBounds(one,two){var bounds=two;if(one[0][0]<two[0][0])bounds[0][0]=one[0][0];if(one[0][1]<two[0][1])bounds[0][1]=one[0][1];if(one[1][0]>two[1][0])bounds[1][0]=one[1][0];if(one[1][1]>two[1][1])bounds[1][1]=one[1][1];return bounds}function createRTree(element,dataPath){element.lookupTree=rbush(4);var elements=
@martgnz
martgnz / .block
Last active October 28, 2017 14:01
Choropleth I
license: mit
border: none
height: 1096
@martgnz
martgnz / .block
Last active October 28, 2017 13:54
Choropleth II
license: mit
border: none
height: 1096
@martgnz
martgnz / .block
Last active September 13, 2019 09:29
Choropleth III
license: mit
border: none
height: 690
@martgnz
martgnz / .block
Last active July 15, 2018 23:50
Chatty Map
license: mit
border: none
height: 510
@martgnz
martgnz / .block
Last active October 28, 2017 13:31
Canvas shadows
license: mit
border: none