-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdata2
More file actions
1 lines (1 loc) · 1.61 KB
/
data2
File metadata and controls
1 lines (1 loc) · 1.61 KB
1
},k.prototype.addLayer=function(a,b,c){var d;return d=c?this.svg.insert("g",":first-child"):this.svg.append("g"),d.attr("id",b||"").attr("class",a||"")},k.prototype.updateChoropleth=function(a){var b=this.svg;for(var c in a)if(a.hasOwnProperty(c)){var d,e=a[c];if(!c)continue;d="string"==typeof e?e:"string"==typeof e.color?e.color:this.options.fills[e.fillKey],e===Object(e)&&(this.options.data[c]=j(e,this.options.data[c]||{}),this.svg.select("."+c).attr("data-info",JSON.stringify(this.options.data[c]))),b.selectAll("."+c).transition().style("fill",d)}},k.prototype.updatePopup=function(a,b,c){var d=this;a.on("mousemove",null),a.on("mousemove",function(){var e=l.mouse(this);l.select(d.svg[0][0].parentNode).select(".datamaps-hoverover").style("top",e[1]+30+"px").html(function(){var d=JSON.parse(a.attr("data-info"));return c.popupTemplate(b,d)}).style("left",e[0]+"px")}),l.select(d.svg[0][0].parentNode).select(".datamaps-hoverover").style("display","block")},k.prototype.addPlugin=function(a,b){"undefined"==typeof k.prototype[a]&&(k.prototype[a]=function(c,d,e,f){var g;"undefined"==typeof f&&(f=!1),"function"==typeof d&&(e=d,d=void 0),d=j(d||{},n[a+"Config"]),!f&&this.options[a+"Layer"]?(g=this.options[a+"Layer"],d=d||this.options[a+"Options"]):(g=this.addLayer(a),this.options[a+"Layer"]=g,this.options[a+"Options"]=d),b.apply(this,[g,c,d]),e&&e(g)})},"function"==typeof define&&define.amd?define("datamaps",function(a){return l=a("d3"),m=a("topojson"),k}):window.Datamap=window.Datamaps=k,window.jQuery&&(window.jQuery.fn.datamaps=function(a,b){a=a||{},a.element=this[0];var c=new k(a);return"function"==typeof b&&b(c,a),this})}();