lib/mapnya/js/release/mapnya.min.js in nyaplot-0.1.1 vs lib/mapnya/js/release/mapnya.min.js in nyaplot-0.1.2
- old
+ new
@@ -2,6 +2,6 @@
* @license almond 0.2.9 Copyright (c) 2011-2014, The Dojo Foundation All Rights Reserved.
* Available via the MIT or new BSD license.
* see: http://github.com/jrburke/almond for details
*/
-!function(t,e){var n=e();"undefined"!=typeof define&&define.amd&&define(n),t.Mapnya=n}(this,function(){var t,e,n;return function(r){function o(t,e){return v.call(t,e)}function a(t,e){var n,r,o,a,i,l,c,s,f,u,p,d=e&&e.split("/"),m=_.map,x=m&&m["*"]||{};if(t&&"."===t.charAt(0))if(e){for(d=d.slice(0,d.length-1),t=t.split("/"),i=t.length-1,_.nodeIdCompat&&z.test(t[i])&&(t[i]=t[i].replace(z,"")),t=d.concat(t),f=0;f<t.length;f+=1)if(p=t[f],"."===p)t.splice(f,1),f-=1;else if(".."===p){if(1===f&&(".."===t[2]||".."===t[0]))break;f>0&&(t.splice(f-1,2),f-=2)}t=t.join("/")}else 0===t.indexOf("./")&&(t=t.substring(2));if((d||x)&&m){for(n=t.split("/"),f=n.length;f>0;f-=1){if(r=n.slice(0,f).join("/"),d)for(u=d.length;u>0;u-=1)if(o=m[d.slice(0,u).join("/")],o&&(o=o[r])){a=o,l=f;break}if(a)break;!c&&x&&x[r]&&(c=x[r],s=f)}!a&&c&&(a=c,l=s),a&&(n.splice(0,l,a),t=n.join("/"))}return t}function i(t,e){return function(){return d.apply(r,b.call(arguments,0).concat([t,e]))}}function l(t){return function(e){return a(e,t)}}function c(t){return function(e){h[t]=e}}function s(t){if(o(g,t)){var e=g[t];delete g[t],y[t]=!0,p.apply(r,e)}if(!o(h,t)&&!o(y,t))throw new Error("No "+t);return h[t]}function f(t){var e,n=t?t.indexOf("!"):-1;return n>-1&&(e=t.substring(0,n),t=t.substring(n+1,t.length)),[e,t]}function u(t){return function(){return _&&_.config&&_.config[t]||{}}}var p,d,m,x,h={},g={},_={},y={},v=Object.prototype.hasOwnProperty,b=[].slice,z=/\.js$/;m=function(t,e){var n,r=f(t),o=r[0];return t=r[1],o&&(o=a(o,e),n=s(o)),o?t=n&&n.normalize?n.normalize(t,l(e)):a(t,e):(t=a(t,e),r=f(t),o=r[0],t=r[1],o&&(n=s(o))),{f:o?o+"!"+t:t,n:t,pr:o,p:n}},x={require:function(t){return i(t)},exports:function(t){var e=h[t];return"undefined"!=typeof e?e:h[t]={}},module:function(t){return{id:t,uri:"",exports:h[t],config:u(t)}}},p=function(t,e,n,a){var l,f,u,p,d,_,v=[],b=typeof n;if(a=a||t,"undefined"===b||"function"===b){for(e=!e.length&&n.length?["require","exports","module"]:e,d=0;d<e.length;d+=1)if(p=m(e[d],a),f=p.f,"require"===f)v[d]=x.require(t);else if("exports"===f)v[d]=x.exports(t),_=!0;else if("module"===f)l=v[d]=x.module(t);else if(o(h,f)||o(g,f)||o(y,f))v[d]=s(f);else{if(!p.p)throw new Error(t+" missing "+f);p.p.load(p.n,i(a,!0),c(f),{}),v[d]=h[f]}u=n?n.apply(h[t],v):void 0,t&&(l&&l.exports!==r&&l.exports!==h[t]?h[t]=l.exports:u===r&&_||(h[t]=u))}else t&&(h[t]=n)},t=e=d=function(t,e,n,o,a){if("string"==typeof t)return x[t]?x[t](e):s(m(t,e).f);if(!t.splice){if(_=t,_.deps&&d(_.deps,_.callback),!e)return;e.splice?(t=e,e=n,n=null):t=r}return e=e||function(){},"function"==typeof n&&(n=o,o=a),o?p(r,t,e,n):setTimeout(function(){p(r,t,e,n)},4),d},d.config=function(t){return d(t)},t._defined=h,n=function(t,e,n){e.splice||(n=e,e=[]),o(h,t)||o(g,t)||(g[t]=[t,e,n])},n.amd={jQuery:!0}}(),n("contrib/almond/almond",function(){}),n("tools",[],function(){var t={STL:Nyaplot.STL,_:Nyaplot._,uuid:Nyaplot.uuid,Manager:Nyaplot.Manager};return t}),n("components/scale",["tools"],function(t){function e(t,e){Math.abs(e.x[1]-e.x[0]),Math.abs(e.y[1]-e.y[0]);return this.offset={x:0,y:0},this.scale=1,this}t._;return e.prototype.init=function(t){this.projection=t},e.prototype.get=function(t,e){var n=this.projection([t,e]);return{x:n[0]*this.scale+this.offset.x,y:n[1]*this.scale+this.offset.y}},e.prototype.setTranslate=function(t,e){this.offset.x=t,this.offset.y=e},e.prototype.setScale=function(t){this.scale=t},e}),n("components/axis",["tools"],function(t){function e(e,n,r){var o=t._,a=t.Manager,i={width:0,height:0,margin:{top:0,bottom:0,left:0,right:0},x_label:"X",y_label:"Y",zoom:!0,zoom_range:[0,500],rotate_x_label:0,rotate_y_label:0,pane_uuid:null,z_index:0,extra:{}},l={df_id:null,map_data:null,cca3:null,fill_by:null,color:["none"],text_color:"#fff",text_size:"1em",stroke_color:"#000",no_data_color:"none",center:[13,35],scale:1e3};arguments.length>2&&(o.extend(i,r),o.extend(l,r.extra),i.extra=l);var c=function(){var t=o.map(i.extra.map_data.features,function(t){return t.id});if(null!=i.extra.fill_by){var e=a.getData(i.extra.df_id),n=e.scale(i.extra.fill_by,i.extra.color),r=e.column(i.extra.fill_by),l=e.column(i.extra.cca3);return d3.scale.ordinal().domain(t).range(o.map(t,function(t){var e=l.indexOf(t);return-1!=e?n(r[e]):i.extra.no_data_color}))}return d3.scale.ordinal().domain(t).range(i.extra.color)}(),s=e.append("g"),f="clip"+i.pane_uuid;s.append("clipPath").attr("id",f).append("rect").attr({x:0,y:0,width:i.width,height:i.height}),s.attr("clip-path","url(#"+f+")").append("g").attr("class","map").style("z-index",i.z_index);var u=d3.geo.mercator().center(i.extra.center).scale(i.extra.scale);n.init(u);var p=d3.geo.path().projection(u),d=d3.geo.graticule();s.select(".map").append("path").datum(d).attr({d:p,stroke:"#fff","stroke-width":2});s.select(".map").selectAll("path").data(i.extra.map_data.features).enter().append("path").attr("d",p).attr("stroke",i.extra.stroke_color).attr("fill",function(t){return"undefined"==typeof t.id?i.extra.no_data_color:c(t.id)});i.zoom&&e.call(d3.behavior.zoom().scaleExtent(i.zoom_range).on("zoom",function(){var t=d3.event.translate,r=d3.event.scale;n.setTranslate(t[0],t[1]),n.setScale(r),e.select(".context_child").attr("transform","translate("+t+") scale("+r+")"),s.select(".map").attr("transform","translate("+t+") scale("+r+")")}))}return e}),n("main",["require","exports","module","components/scale","components/axis"],function(t){var e={};return e.Nya={scale:t("components/scale"),axis:t("components/axis")},e}),e("main")});
+!function(e,t){var n=t();"undefined"!=typeof define&&define.amd&&define(n),e.Mapnya=n}(this,function(){var e,t,n;return function(r){function o(e,t){return v.call(e,t)}function a(e,t){var n,r,o,a,i,l,c,s,f,u,p,d=t&&t.split("/"),x=_.map,m=x&&x["*"]||{};if(e&&"."===e.charAt(0))if(t){for(d=d.slice(0,d.length-1),e=e.split("/"),i=e.length-1,_.nodeIdCompat&&z.test(e[i])&&(e[i]=e[i].replace(z,"")),e=d.concat(e),f=0;f<e.length;f+=1)if(p=e[f],"."===p)e.splice(f,1),f-=1;else if(".."===p){if(1===f&&(".."===e[2]||".."===e[0]))break;f>0&&(e.splice(f-1,2),f-=2)}e=e.join("/")}else 0===e.indexOf("./")&&(e=e.substring(2));if((d||m)&&x){for(n=e.split("/"),f=n.length;f>0;f-=1){if(r=n.slice(0,f).join("/"),d)for(u=d.length;u>0;u-=1)if(o=x[d.slice(0,u).join("/")],o&&(o=o[r])){a=o,l=f;break}if(a)break;!c&&m&&m[r]&&(c=m[r],s=f)}!a&&c&&(a=c,l=s),a&&(n.splice(0,l,a),e=n.join("/"))}return e}function i(e,t){return function(){return d.apply(r,b.call(arguments,0).concat([e,t]))}}function l(e){return function(t){return a(t,e)}}function c(e){return function(t){h[e]=t}}function s(e){if(o(g,e)){var t=g[e];delete g[e],y[e]=!0,p.apply(r,t)}if(!o(h,e)&&!o(y,e))throw new Error("No "+e);return h[e]}function f(e){var t,n=e?e.indexOf("!"):-1;return n>-1&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}function u(e){return function(){return _&&_.config&&_.config[e]||{}}}var p,d,x,m,h={},g={},_={},y={},v=Object.prototype.hasOwnProperty,b=[].slice,z=/\.js$/;x=function(e,t){var n,r=f(e),o=r[0];return e=r[1],o&&(o=a(o,t),n=s(o)),o?e=n&&n.normalize?n.normalize(e,l(t)):a(e,t):(e=a(e,t),r=f(e),o=r[0],e=r[1],o&&(n=s(o))),{f:o?o+"!"+e:e,n:e,pr:o,p:n}},m={require:function(e){return i(e)},exports:function(e){var t=h[e];return"undefined"!=typeof t?t:h[e]={}},module:function(e){return{id:e,uri:"",exports:h[e],config:u(e)}}},p=function(e,t,n,a){var l,f,u,p,d,_,v=[],b=typeof n;if(a=a||e,"undefined"===b||"function"===b){for(t=!t.length&&n.length?["require","exports","module"]:t,d=0;d<t.length;d+=1)if(p=x(t[d],a),f=p.f,"require"===f)v[d]=m.require(e);else if("exports"===f)v[d]=m.exports(e),_=!0;else if("module"===f)l=v[d]=m.module(e);else if(o(h,f)||o(g,f)||o(y,f))v[d]=s(f);else{if(!p.p)throw new Error(e+" missing "+f);p.p.load(p.n,i(a,!0),c(f),{}),v[d]=h[f]}u=n?n.apply(h[e],v):void 0,e&&(l&&l.exports!==r&&l.exports!==h[e]?h[e]=l.exports:u===r&&_||(h[e]=u))}else e&&(h[e]=n)},e=t=d=function(e,t,n,o,a){if("string"==typeof e)return m[e]?m[e](t):s(x(e,t).f);if(!e.splice){if(_=e,_.deps&&d(_.deps,_.callback),!t)return;t.splice?(e=t,t=n,n=null):e=r}return t=t||function(){},"function"==typeof n&&(n=o,o=a),o?p(r,e,t,n):setTimeout(function(){p(r,e,t,n)},4),d},d.config=function(e){return d(e)},e._defined=h,n=function(e,t,n){t.splice||(n=t,t=[]),o(h,e)||o(g,e)||(g[e]=[e,t,n])},n.amd={jQuery:!0}}(),n("contrib/almond/almond",function(){}),n("tools",[],function(){var e={STL:Nyaplot.STL,_:Nyaplot._,uuid:Nyaplot.uuid,Manager:Nyaplot.Manager};return e}),n("components/scale",["tools"],function(e){function t(e,t){Math.abs(t.x[1]-t.x[0]),Math.abs(t.y[1]-t.y[0]);return this.offset={x:0,y:0},this.scale=1,this}e._;return t.prototype.init=function(e){this.projection=e},t.prototype.get=function(e,t){var n=this.projection([e,t]);return{x:n[0]*this.scale+this.offset.x,y:n[1]*this.scale+this.offset.y}},t.prototype.setTranslate=function(e,t){this.offset.x=e,this.offset.y=t},t.prototype.setScale=function(e){this.scale=e},t}),n("components/axis",["tools"],function(e){function t(t,n,r){var o=e._,a=e.Manager,i={width:0,height:0,margin:{top:0,bottom:0,left:0,right:0},x_label:"X",y_label:"Y",zoom:!0,zoom_range:[0,500],rotate_x_label:0,rotate_y_label:0,pane_uuid:null,z_index:0,extra:{}},l={df_id:null,map_data:null,cca3:null,fill_by:null,color:["none"],text_color:"#fff",text_size:"1em",stroke_color:"#000",no_data_color:"none",center:[13,35],scale:1e3};arguments.length>2&&(o.extend(i,r),o.extend(l,r.extra),i.extra=l);var c=function(){var e=o.map(i.extra.map_data.features,function(e){return e.properties.iso_a3});if(o.every(e,function(e){return"undefined"==typeof e}))return d3.scale.ordinal().range(i.extra.color);if(null!=i.extra.fill_by){var t=a.getData(i.extra.df_id),n=t.scale(i.extra.fill_by,i.extra.color),r=t.column(i.extra.fill_by),l=t.column(i.extra.cca3);return d3.scale.ordinal().domain(e).range(o.map(e,function(e){var t=l.indexOf(e);return-1!=t?n(r[t]):i.extra.no_data_color}))}return d3.scale.ordinal().domain(e).range(i.extra.color)}(),s=t.append("g"),f="clip"+i.pane_uuid;s.append("clipPath").attr("id",f).append("rect").attr({x:0,y:0,width:i.width,height:i.height}),s.attr("clip-path","url(#"+f+")").append("g").attr("class","map").style("z-index",i.z_index);var u=d3.geo.mercator().center(i.extra.center).scale(i.extra.scale);n.init(u);var p=d3.geo.path().projection(u),d=d3.geo.graticule();s.select(".map").append("path").datum(d).attr({d:p,stroke:"#fff","stroke-width":2});s.select(".map").selectAll("path").data(i.extra.map_data.features).enter().append("path").attr("d",p).attr("stroke",i.extra.stroke_color).attr("fill",function(e){return"undefined"==typeof e.properties.iso_a3?i.extra.no_data_color:c(e.properties.iso_a3)});i.zoom&&t.call(d3.behavior.zoom().scaleExtent(i.zoom_range).on("zoom",function(){var e=d3.event.translate,r=d3.event.scale;n.setTranslate(e[0],e[1]),n.setScale(r),t.select(".context_child").attr("transform","translate("+e+") scale("+r+")"),s.select(".map").attr("transform","translate("+e+") scale("+r+")")}))}return t}),n("main",["require","exports","module","components/scale","components/axis"],function(e){var t={};return t.Nya={scale:e("components/scale"),axis:e("components/axis")},t}),t("main")});
\ No newline at end of file