Sha256: 2c24bb8ff01d4ace4abd37509ca7375c9b1f255e3df6a42de37c1da944431ff5
Contents?: true
Size: 815 Bytes
Versions: 25
Compression:
Stored size: 815 Bytes
Contents
d3.geo.equirectangular = function() { var scale = 500, translate = [480, 250]; function equirectangular(coordinates) { var x = coordinates[0] / 360, y = -coordinates[1] / 360; return [ scale * x + translate[0], scale * y + translate[1] ]; } equirectangular.invert = function(coordinates) { var x = (coordinates[0] - translate[0]) / scale, y = (coordinates[1] - translate[1]) / scale; return [ 360 * x, -360 * y ]; }; equirectangular.scale = function(x) { if (!arguments.length) return scale; scale = +x; return equirectangular; }; equirectangular.translate = function(x) { if (!arguments.length) return translate; translate = [+x[0], +x[1]]; return equirectangular; }; return equirectangular; };
Version data entries
25 entries across 25 versions & 1 rubygems