function makeMap(t,e){var a,n,r,o;n=e[0].height?e[0].height:430,o=e[0].scale?e[0].scale:1,(a=(a=d3.select("#"+t).style("width")).substring(0,a.length-2))<400?r=3e3*o:a>=400&&a<500?r=4200*o:a>=500&&a<550?r=5100*o:a>=550&&a<700?r=5600*o:a>=700&&a<1e3?r=6200*o:a>=1e3&&a<1500?r=6500*o:a>=1500&&(r=6700*o);var s=d3.geo.conicConformal().rotate([120.5,0]).center([0,47.25]).parallels([45.83,47.33]).scale(r).translate([a/2,n/2]).precision(.1),l=d3.geo.path().projection(s),i=d3.select("#"+t).append("svg").attr("class",t).attr("width",a).attr("height",n),p=i.append("g"),c=queue(),u=["error"];e.forEach(function(t){var e=t.link.split(".");u.push(e[0]),c.defer(d3.json,"https://s3-us-west-2.amazonaws.com/geolpublist/json/"+t.link)}),c.await(function(r){if(r)throw r;for(var o=0;o"+a.properties.label+"
"+a.properties.PHONE+"
Email"):a.properties.date&&a.properties.spanish?x.html(""+a.properties.label+"
Last updated: "+a.properties.date+"
English | Spanish"):a.properties.date&&!a.properties.spanish?x.html(""+a.properties.label+"
Last updated: "+a.properties.date+"
English "):a.properties.status?x.html(""+a.properties.label+"
Status: "+a.properties.status):a.properties.URL?x.html(""+a.properties.label+"
Download"):x.html(""+a.properties.label+""),createTip(b,this,t,!!o)),r&&tabulate(r,a.properties.label,!1,y,g)}),e[o-1].force&&forceLabel(a,n,topojson.feature(c,c.objects[d]).features,t,l,i),e[o-1].label&&p.append("g").selectAll("."+t+" .anno").data(topojson.feature(c,c.objects[d]).features).enter().append("text").text(function(t){return t.properties.label}).attr("class",t+" anno").attr("transform",function(t){var e=l.centroid(t),a=e[0],n=e[1]-.2,r=s.rotate();return r=r[0]+180,"translate("+a+","+n+")rotate("+r+")"}).call(wrap,e[o-1].lWidth,e[o-1].label),e[o-1].legend){var f=i.append("g");f.append("rect").attr("class","fourlegend").attr("width",165).attr("height",120).attr("fill","white").attr("stroke","black").attr("transform","translate(10 290)"),f.append("rect").attr("class","fourpub").attr("width","30px").attr("height","45px").attr("transform","translate(15 300)"),f.append("rect").attr("class","fourprep").attr("width","30px").attr("height","45px").attr("transform","translate(15 360)"),f.append("text").text("Map has been published").attr("font-size","11px").attr("font-family","arial, sans-serif").attr("transform","translate(50 320)"),f.append("text").text("Map is in preparation").attr("font-size","11px").attr("font-family","arial, sans-serif").attr("transform","translate(50 380)")}}else if("point"==e[o-1].type){var h;h=e[o-1].force?5:3,p.append("g").selectAll("path").data(topojson.feature(c,c.objects[d]).features).enter().append("path").attr("d",l.pointRadius(h)).attr("class",function(){return e[o-1].tip?d+" click":d+" point"}).on("mouseup",function(a){for(var n=!1,r=!1,o=0;o"+a.properties.label+"
Download"),createTip(b,this,t,!!r))}),e[o-1].force?forceLabel(a,n,topojson.feature(c,c.objects[d]).features,t,l,i):p.append("g").selectAll("."+d+" .labels").data(topojson.feature(c,c.objects[d]).features).enter().append("text").attr("transform",function(t){return"translate("+s(t.geometry.coordinates)+")"}).attr("dy",3).attr("dx",3).text(function(t){return t.properties.label}).attr("class",d+" labels")}}for(o=0;oe&&(o.pop(),i.text(o.join(" ")),o=[t],i=n.append("tspan").attr("x",0).attr("y",++s*a+"em").text(t))})}function tip(){d3.select(window).on("scroll",function(){d3.selectAll(".tip").style("opacity",0).style("pointer-events","none")}).on("hashchange",function(){d3.selectAll(".tip").style("opacity",0).style("pointer-events","none")})}function createTip(t,e,a,n){d3.selectAll("."+a).style("pointer-events","all");var r=0,o=0;n||(r=(r=t.style("width")).substring(0,r.length-2),o=(o=t.style("height")).substring(0,o.length-2));var s=d3.mouse(e),l=s[0]-r/2,i=s[1]-o/2,p=e.getScreenCTM().translate(l,i);t.transition().style("left",p.e+"px").style("top",p.f+"px"),d3.selectAll(".tip").selectAll(".close").on("mousedown",function(){d3.selectAll(".tip").transition().style("opacity",0).style("pointer-events","none")})}function zoom_zoom(t,e,a,n,r,o){n.classed("zoom",!0),n.append("rect").attr("class","overlay").attr("width",t).attr("height",e);var s=[t/2,e/2],l=d3.behavior.zoom().scaleExtent([1,45]).on("zoom",p),i=n.selectAll(".button").data(["zoom_in","zoom_out"]).enter().append("g").attr("class","button").attr("transform",function(t,e){return"translate(5,"+3*e+"5)"});function p(n){if(n)r.attr("transform","translate("+l.translate()+")scale("+l.scale()+")");else{var o=d3.event.translate,s=d3.event.scale,i=e/4;o[0]=Math.min(t/e*(s-1),Math.max(t*(1-s),o[0])),o[1]=Math.min(i*(s-1)+i*s,Math.max(e*(1-s)-i*s,o[1])),l.translate(o),r.attr("transform","translate("+o+")scale("+s+")")}r.selectAll(".poly").style("stroke-width",.5/l.scale()+"px"),r.selectAll(".labels").style("font-size",12/l.scale()+"px").attr("dy",-5/l.scale()).attr("dx",-2/l.scale()),r.selectAll(".nodeLabels").style("font-size",12/l.scale()+"px"),r.selectAll(".link").style("stroke-width",2/l.scale()+"px"),r.selectAll(".point").attr("d",a.pointRadius(2/l.scale()))}i.append("rect").attr("width",30).attr("height",30).attr("class",function(t){return t}),i.append("text").attr("x",9).attr("y",20).style("pointer-events","none").style("font-weight","bold").style("font-size","20px").text(function(t,e){return e?"--":"+"}),n.call(l).call(l.event).on("dblclick.zoom",null);var c=!1;function u(){n.on("mousedown.zoom",null).on("touchstart.zoom",null).on("touchmove.zoom",null).on("touchend.zoom",null)}function d(t){var e=l.scale(),a=l.scaleExtent(),n=l.translate(),r=n[0],o=n[1],i=t?1.3:1/1.3,u=e*i,f=Math.max(a[0],Math.min(a[1],u));f!=u&&(i=(u=f)/e),r=(r-s[0])*i+s[0],o=(o-s[1])*i+s[1],d3.transition().duration(100).tween("zoom",function(){var t=d3.interpolate(e,u),a=d3.interpolate(n,[r,o]);return function(e){l.scale(t(e)).translate(a(e)),p(!0)}}).each("end",function(){c&&d(t)})}n.select(".zoom_in").on("mousedown",function(){d3.event.preventDefault(),c=!0,u(),d(!0)}).on("mouseup",function(){c=!1}).on("mouseout",function(){c=!1}),n.select(".zoom_in, .zoom_out").on("mouseup",function(){c=!1,n.call(l).call(l.event)}),n.select(".zoom_out").on("mousedown",function(){d3.event.preventDefault(),c=!0,u(),d(!1)}).on("mouseup",function(){c=!1}).on("mouseout",function(){c=!1}),n.select(".zoom_out").on("mouseup",function(){c=!1,n.call(l).call(l.event)})}function tabulate(t,e,a,n,r,o){d3.text("https://s3-us-west-2.amazonaws.com/geolpublist/text/"+t,function(t){var r,s,l,i=d3.csv.parse(t);r=i.reduce(function(t,e){return t.concat(d3.keys(e))},[]).reduce(function(t,e){return t.set(e,0),t},d3.map()).keys(),e&&(i=i.filter(function(t,a){var n=i[a];if(n.Quadrangle===e||n.County===e||n.Location===e)return t})),a&&d3.select("#"+o).selectAll("thead").selectAll("tr").data(r).enter().append("th").attr("class",function(t){return t}).text(function(t){return t}),(s=n.selectAll("tr").data(i)).enter().append("tr"),(l=s.selectAll("td").data(function(t){return r.map(function(e){return t[e]})})).html(function(t){return t}).style("opacity",0).transition().duration(300).style("opacity",1),l.enter().append("td").html(function(t){return t}).style("opacity",0).transition().duration(300).style("opacity",1),s.exit().transition().duration(200).style("opacity",0).remove(),l.exit().remove(),d3.selectAll("a").attr("target","_blank")})}function forceLabel(t,e,a,n,r){for(var o=[],s=[],l=0;l