/** * @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(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;f0&&(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;d2&&(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")});