Black Americans vital longer, though secular opening remains, CDC says

“),t.hudContent=jQuery(“


“),t.select=jQuery(“”),t.select.on(“change”,t.onSelectUpdate);var e=jQuery(“”);e.on(“click”,function(e){t.activeState=null}),t.hud.append(t.hudContent).append(t.select).append(e),t.$element.append(t.hud)},this.build=function(){t.data.csv=t.formatCSVData(t.data.csv),t.data.states=t.formatStateData(t.data.states),t.buildMap()},this.buildMap=function(){t.map.selectAll(“.state-land”).data(topojson.feature(t.data.topo,t.data.topo.objects.states).features).enter().append(“path”).attr(“d”,t.path).attr(“class”,”state-land”).style(“fill”,”#808080″).on(“mouseover”,t.onStateOver).on(“mouseout”,t.onStateOut).on(“click”,t.onStateClicked)},this.drawCounties=function(e,n,a,o){var s=Object.create(t.data.topo.objects.counties);t.activeCounties=s.geometries=t.data.topo.objects.counties.geometries.filter(function(e){return t.fipsMatch(e.id,a)});var i=e.data(topojson.feature(t.data.topo,s).features);i.enter().append(“path”).attr(“class”,”county-land”).on(“click”,t.onCountyClicked),i.attr(“opacity”,0).attr(“d”,t.path).attr(“data-leading-cause”,function(e,n){var a=t.data.csv[e.id.toString()]?t.data.csv[e.id.toString()].causes[0].id:”no-data”;return”no-data”==aconsole.log(e.id+” does not have data”),a}).transition().duration(750).attr(“opacity”,1),i.exit().transition().duration(750).attr(“opacity”,0).remove()},this.centerMapOnState=function(e,n,a,o){var n=n||0,a=a||0,o=o||0,s=t.path.bounds(e),i=s[1][0]-s[0][0]+n/2,c=s[1][1]-s[0][1],r=(s[0][0]+s[1][0])/2,u=(s[0][1]+s[1][1])/2+a/2,l=1/Math.max(i/t.props.width,c/t.props.height),d=[t.props.width/2-(l+o)*r+n,t.props.height/2-(l+o)*u+a];t.map.transition().duration(750).style(“stroke-width”,1.5/(l+o)+”px”).attr(“transform”,”translate(“+d+”)scale(“+(l+o)+”)”)},this.formatCSVData=function(t){var e={};return jQuery.each(t,function(t,n){var a={causes:[]};jQuery.each(n,function(t,e){switch(t){case”state”:case”FIPS”:case”cnty”:a[t]=e;break;default:a.causes.push({id:t.split(” “)[0].split(“,”).join(“”).toLowerCase(),name:t,val:parseFloat(e)})}}),a.causes.sort(function(t,e){return t.vale.val?-1:0}),e[n.FIPS]=a}),e},this.formatStateData=function(t){var e={};return jQuery.each(t,function(t,n){e[n.id.toString()]=n}),e},this.setProperties=function(t){return{height:t.height||500,width:t.width||960,data:t.data||{topo:”./data/usa.json”}}},this.fipsMatch=function(t,e){return t=String(t),e=String(e),5===t.length?t.slice(0,2)===e:t.slice(0,1)===e},this.loadData=function(){var e=t,n=queue();t.props.data instanceof ObjectjQuery.each(t.props.data,function(t,e){var a=e.split(“.”)[e.split(".”).length-1];n.defer(d3[a[a])}),n.await(function(t){if(t)throw t;var n=[].slice.call(arguments);n.shift(),jQuery.each(e.props.data,function(t,a){e.props.data[t[t].shift()}),e.build()})},this.reset=function(){t.activeState=null},this.activateState=function(){if(t.activeState){var e=o(),n=”sm”==e||”xs”==e?0:-.85,a=”sm”==e||”xs”==e?0:100,s=”sm”==e||”xs”==e?-50:0;t.centerMapOnState(t.activeState,a,s,n),t.map.selectAll(“.county-land”).call(t.drawCounties,t.data.topo,t.activeState.id,t.data.csv),t.map.selectAll(“.county-land”).on(“mouseover”,t.onCountyMouseOver).on(“mouseout”,t.onCountyMouseOut),t.props.isCountiesReady=!0,jQuery(“body”).addClass(“map-zoomed”)}else t.isCountiesReady=!1,t.map.transition().duration(750).style(“stroke-width”,”1.5px”).attr(“transform”,””),t.map.selectAll(“.county-land”).transition().duration(750).attr(“opacity”,0).remove(),jQuery(“body”).removeClass(“map-zoomed”);t.updateHUD()},this.updateHUD=function(){if(t.activeState){var e=[],n=jQuery(“”);n.append(“

“+t.data.states[t[t.activeState.id.toString()]ame+”

“),t.hudContent.html(n.html()),jQuery.each(t.activeCounties,function(n,a){t.data.csv[a[a.id.toString()]push(jQuery(“”+t.data.csv[a[a.id.toString()]nty+””))}),e.sort(function(t,e){return t.text()e.text()?1:t.text()Select county”)),t.select.empty().append(e)}},this.on=function(e,n){return jQuery(t).on(e,n),t},this.one=function(e,n){return jQuery(t).one(e,n),t},this.off=function(e,n){return jQuery(t).off(e,n),t},this.trigger=function(e){return jQuery(t).trigger(e),t},this.onStateClicked=function(e){t.activeState=e},this.onCountyMouseOver=function(e){o();”sm”!==o()”xs”!==o(t.countyData=t.data.csv[e[e.id.toString()].trigger(“countyMouseOver”))},this.onCountyMouseOut=function(e){o();”sm”!==o()”xs”!==o(t.countyData=null,t.trigger(“countyMouseOut”))},this.onCountyClicked=function(e){t.countyData=t.data.csv[e[e.id.toString()].trigger(“countySelected”)},this.onStateOver=function(e){o();”sm”!==o()”xs”!==o(t.stateData=t.data.states[e[e.id.toString()].trigger(“stateMouseOver”))},this.onStateOut=function(e){o();”sm”!==o()”xs”!==o(t.stateData=null,t.trigger(“stateMouseOut”))},this.onSelectUpdate=function(e){var n=jQuery(jQuery(e.target).children()[e[e.target.selectedIndex]a=n.attr(“value”);n.text();a(t.countyData=t.data.csv[a[a.toString()].trigger(“countySelected”))}})},function(t,e){},function(t,e,n){t.exports=n.p+”data/data.csv”},function(t,e,n){t.exports=n.p+”data/old/_bak/data.csv”},function(t,e,n){t.exports=n.p+”data/old/countyData.csv”},function(t,e,n){t.exports=n.p+”data/old/data.csv”},function(t,e,n){t.exports=n.p+”data/old/elections.csv”},function(t,e,n){function a(t){return n(o(t))}function o(t){return s[t[t]function(){throw new Error(“Cannot find procedure ‘”+t+”‘.”)}()}var s={“./data.csv”:12,”./old/_bak/data.csv”:13,”./old/_bak/usa”:1,”./old/_bak/usa.json”:1,”./old/countyData”:2,”./old/countyData.csv”:14,”./old/countyData.json”:2,”./old/data.csv”:15,”./old/elections.csv”:16,”./old/states”:3,”./old/states.json”:3,”./old/us”:4,”./old/us.json”:4,”./old/us2016.topo”:5,”./old/us2016.topo.json”:5,”./old/usa”:6,”./old/usa.json”:6,”./states”:7,”./states.json”:7,”./usa”:8,”./usa.json”:8};a.keys=function(){return Object.keys(s)},a.resolve=o,t.exports=a,a.id=17},function(t,e){function n(t){throw new Error(“Cannot find procedure ‘”+t+”‘.”)}n.keys=function(){return[]},n.resolve=n,t.exports=n,n.id=18},function(t,e){function n(t){throw new Error(“Cannot find procedure ‘”+t+”‘.”)}n.keys=function(){return[]},n.resolve=n,t.exports=n,n.id=19},function(t,e){t.exports=jQuery}]);


Do you have an unusual story to tell? E-mail stories@tutuz.com