-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcomponent---src-pages-interactive-tsx-a846985e53a35751a475.js
More file actions
2 lines (2 loc) · 27.5 KB
/
Copy pathcomponent---src-pages-interactive-tsx-a846985e53a35751a475.js
File metadata and controls
2 lines (2 loc) · 27.5 KB
1
2
(self.webpackChunkmy_gatsby_site=self.webpackChunkmy_gatsby_site||[]).push([[468],{9713:function(e){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.default=e.exports,e.exports.__esModule=!0},6479:function(e,t,n){var r=n(7316);e.exports=function(e,t){if(null==e)return{};var n,i,a=r(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(i=0;i<l.length;i++)n=l[i],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a},e.exports.default=e.exports,e.exports.__esModule=!0},6379:function(e,t,n){"use strict";n.d(t,{Z:function(){return E}});var r=n(7294),i=n(9692),a=n(7154),l=n.n(a),o=n(9713),c=n.n(o),s=n(6479),u=n.n(s),d=n(5264);function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function m(e){return Object.keys(e).reduce((function(t,n){var r;return r=n,(0,d.Z)(r)&&(t[n]=e[n]),t}),{})}var f=r.forwardRef((function(e,t){var n=e.children,i=e.iconAttrs,a=(e.iconVerticalAlign,e.iconViewBox),o=e.size,s=e.title,d=u()(e,["children","iconAttrs","iconVerticalAlign","iconViewBox","size","title"]),f=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({viewBox:a,height:void 0!==e.height?e.height:o,width:void 0!==e.width?e.width:o,"aria-hidden":null==s?"true":void 0,focusable:"false",role:null!=s?"img":void 0},i),h=m(d);return r.createElement("svg",l()({},f,h,{ref:t}),s&&r.createElement("title",{key:"icon-title"},s),n)})),h=(0,i.ZP)(f).withConfig({displayName:"StyledIconBase",componentId:"ea9ulj-0"})(["display:inline-block;vertical-align:",";overflow:hidden;"],(function(e){return e.iconVerticalAlign})),g=r.forwardRef((function(e,t){return r.createElement(h,l()({iconAttrs:{fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},iconVerticalAlign:"middle",iconViewBox:"0 0 16 16"},e,{ref:t}),r.createElement("path",{d:"M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM6.79 5.093A.5.5 0 0 0 6 5.5v5a.5.5 0 0 0 .79.407l3.5-2.5a.5.5 0 0 0 0-.814l-3.5-2.5z"}))}));g.displayName="PlayCircleFill";var y=r.forwardRef((function(e,t){return r.createElement(h,l()({iconAttrs:{fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},iconVerticalAlign:"middle",iconViewBox:"0 0 16 16"},e,{ref:t}),r.createElement("path",{d:"M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM6.25 5C5.56 5 5 5.56 5 6.25v3.5a1.25 1.25 0 1 0 2.5 0v-3.5C7.5 5.56 6.94 5 6.25 5zm3.5 0c-.69 0-1.25.56-1.25 1.25v3.5a1.25 1.25 0 1 0 2.5 0v-3.5C11 5.56 10.44 5 9.75 5z"}))}));y.displayName="PauseCircleFill";var w=r.forwardRef((function(e,t){return r.createElement(h,l()({iconAttrs:{fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),r.createElement("path",{d:"M12 2C6.486 2 2 6.486 2 12s4.486 10 10 10c5.515 0 10-4.486 10-10S17.515 2 12 2zm4 14l-6-4v4H8V8h2v4l6-4v8z"}))}));w.displayName="SkipPreviousCircle";var x=r.forwardRef((function(e,t){return r.createElement(h,l()({iconAttrs:{fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),r.createElement("path",{d:"M12 2C6.486 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.514 2 12 2zm4 14h-2v-4l-6 4V8l6 4V8h2v8z"}))}));x.displayName="SkipNextCircle";var v=r.forwardRef((function(e,t){return r.createElement(h,l()({iconAttrs:{fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),r.createElement("path",{fill:"none",d:"M0 0h24v24H0z"}),r.createElement("path",{d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm4.82-4.924a7 7 0 10-1.852 1.266l-.975-1.755A5 5 0 1117 12h-3l2.82 5.076z"}))}));v.displayName="Restart";var b=i.ZP.div.withConfig({displayName:"controls__ButtonArea",componentId:"dd8waq-0"})(["display:flex;width:100%;justify-content:center;*{margin:5px 10px;}& > *:hover{cursor:pointer;}"]),E=function(e){var t=e.week,n=e.setWeek,i=e.playing,a=e.setPlaying,l=e.max,o=e.min,c=void 0===o?0:o;return r.createElement(b,null,r.createElement(w,{size:"30px",onClick:function(){t>c&&n(t-1),a(!1)}}),t===l?r.createElement(v,{size:"30px",onClick:function(){n(c),a(!1)}}):i?r.createElement(y,{size:"30px",onClick:function(){a(!1)}}):r.createElement(g,{size:"30px",onClick:function(){a(!0)}}),r.createElement(x,{size:"30px",onClick:function(){t<l&&n(t+1),a(!1)}}))}},719:function(e,t,n){"use strict";n.d(t,{E:function(){return l},o:function(){return o}});var r=n(7294),i=n(7576),a=n(5743),l=(0,r.createContext)(null),o=function(e){var t=e.children,n=i.zL(a,a.objects.states).features,o=i.zL(a,a.objects.counties).features;return r.createElement(l.Provider,{value:{states:n,counties:o}},t)}},9837:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return ce}});var r=n(7294),i=n(9692),a=n(5444),l=n(7329),o=n(1839),c=n(5743),s=n(6372),u=i.ZP.div.withConfig({displayName:"cards__Container",componentId:"sc-134r6bf-0"})(["display:flex;flex-direction:column;border-radius:10px;background-color:lightgray;width:160px;margin:5px;padding:5px;"]),d=i.ZP.h3.withConfig({displayName:"cards__Title",componentId:"sc-134r6bf-1"})(["margin:0 0 10px 0;"]),p=i.ZP.p.withConfig({displayName:"cards__Text",componentId:"sc-134r6bf-2"})(["margin:0;"]),m=i.ZP.div.withConfig({displayName:"cards__Row",componentId:"sc-134r6bf-3"})(["display:flex;justify-content:space-between;"]);function f(e){var t=e.title,n=e.hcount,i=e.ccount,a=e.hrecent,l=e.crecent;return r.createElement(u,null,r.createElement(d,null,t),r.createElement(m,null,r.createElement(p,null,"# Hot Spots:")," ",r.createElement(p,null,n)),r.createElement(m,null,r.createElement(p,null,"# Cold Spots:"),r.createElement(p,null,i)),r.createElement(m,null,r.createElement(p,null,"Last Hot Spot:"),r.createElement(p,null,a)),r.createElement(m,null,r.createElement(p,null,"Last Cold Spot:"),r.createElement(p,null,l)))}var h=n(719),g=n(8928),y=i.ZP.div.withConfig({displayName:"map__Container",componentId:"sc-1o8yluv-0"})(["display:flex;flex-wrap:wrap;flex-direction:column;align-items:center;margin:10px 20px;@media (max-width:830px){margin:10px 5px;}@media (max-width:700px){margin:0;}"]),w=i.ZP.h3.withConfig({displayName:"map__Title",componentId:"sc-1o8yluv-1"})(["margin:0;"]),x=i.ZP.svg.withConfig({displayName:"map__MapContainer",componentId:"sc-1o8yluv-2"})(["g{background-color:light-gray;fill:red;}#c",".cboundary{stroke:black;stroke-width:0.25px;}.cboundary{stroke-width:0px;fill:#ffffff00;}.bubble{stroke-width:0;}border:1px solid ",";"],(function(e){return e.county}),(function(e){return e.border?"black":"white"})),v=function(e){return Number(String(e).slice(0,-3))},b=function(e){var t=e.title,n=e.MapSettings,i=e.countiesMap,a=e.highlightedState,c=e.highlightedCounty,s=e.addState,u=e.stateSelector,d=e.countySelector,p=e.data,m=e.time,f=e.colorScales,b=f[0],E=f[1],C=e.getRadius,_=n.width,k=n.height,S=n.translate,N=n.scale,A=(0,r.useRef)(null),P=o.FWi().scale(N).translate(S),Z=o.l49().projection(P),j=(0,r.useContext)(h.E),I=j.counties,Y=j.states;return(0,r.useEffect)((function(){var e=o.Ys(A.current).attr("width",_).attr("height",k).append("g");s(new g.Z(Z,e,_,k,a[0])),e.append("g").style("stroke","black").style("stroke-width","0.5px").style("fill","#ffffffff").selectAll("path").data(Y).enter().append("path").attr("d",Z).attr("stateFips",(function(e){var t=e.id;return Number(t)})),e.append("g").selectAll("path").data(I).enter().append("path").attr("d",Z).attr("stateName",(function(e){var t=e.id;return i.objects.states.geometries.filter((function(e){return v(t)===Number(e.id)}))[0].properties.name})).attr("id",(function(e){var t=e.id;return"c"+Number(t)})).attr("class","cboundary").on("mouseout",(function(){d([-1,""])})),e.selectAll("circle").data(p).enter().append("circle").attr("class","bubble").attr("countyName",(function(e){var t=e.fips;return i.objects.counties.geometries.filter((function(e){var n=e.id;return t===Number(n)}))[0].properties.name})).attr("stateName",(function(e){var t=e.fips;return i.objects.states.geometries.filter((function(e){var n=e.id;return v(t)===Number(n)}))[0].properties.name})).attr("transform",(function(e){var t=e.fips,n=o.Ys("#c"+t).datum();return"translate("+Z.centroid(n)+")"})).on("mouseout",(function(){d([-1,""])}))}),[]),(0,r.useEffect)((function(){o.Ys(A.current).selectAll(".bubble").attr("r",C).style("fill",(function(e){var t=e.recent.apply(e,(0,l.Z)(m)),n=t[0],r=t[1];return n>r?b(n):E(r)}))}),[m]),(0,r.useEffect)((function(){o.Ys(A.current).selectAll(".cboundary").on("click",(function(e,t){var n=t.id;u([v(n),this.getAttribute("stateName")])})),o.Ys(A.current).selectAll(".cboundary").on("mouseover",(function(e,t){var n=t.id,r=t.properties.name;""!==a[1]&&d([Number(n),r])})),o.Ys(A.current).selectAll(".bubble").on("mouseover",(function(e,t){var n=t.fips;a&&""!==a[1]&&d([n,this.getAttribute("countyName")])})).on("click",(function(e,t){var n=t.fips;u([v(n),this.getAttribute("stateName")])})).style("fill-opacity",(function(e){var t=e.fips;return-1===a[0]||v(t)===a[0]?1:.2}))}),[a]),r.createElement(y,null,r.createElement(w,null,t),r.createElement(x,{ref:A,county:c[0],border:-1!==a[0]}))},E=n(9088),C=i.ZP.div.withConfig({displayName:"mapView__Container",componentId:"sc-1ogju75-0"})(["display:flex;flex-direction:column;align-items:center;width:100%;"]),_=i.ZP.hr.withConfig({displayName:"mapView__Divider",componentId:"sc-1ogju75-1"})(["width:98%;height:1px;background-color:black;border-radius:1px;margin:5px 10px;"]),k=i.ZP.div.withConfig({displayName:"mapView__TextContainerArea",componentId:"sc-1ogju75-2"})(["width:100%;"]),S=i.ZP.div.withConfig({displayName:"mapView__TextContainer",componentId:"sc-1ogju75-3"})(["margin:0 15px;display:flex;justify-content:space-between;@media (max-width:500px){flex-wrap:wrap;justify-content:center;}"]),N=i.ZP.div.withConfig({displayName:"mapView__MapControls",componentId:"sc-1ogju75-4"})(["display:flex;flex-wrap:wrap;"]),A=i.ZP.div.withConfig({displayName:"mapView__MapContainer",componentId:"sc-1ogju75-5"})(["display:flex;flex-direction:row;justify-content:center;width:100%;flex-wrap:wrap;@media (max-width:770px){flex-wrap:wrap;}"]),P=i.ZP.button.withConfig({displayName:"mapView__Button",componentId:"sc-1ogju75-6"})(["border-radius:10px;height:30px;width:60px;"]),Z=i.ZP.div.withConfig({displayName:"mapView__Row",componentId:"sc-1ogju75-7"})(["display:flex;justify-content:center;width:100%;flex-wrap:wrap;"]),j=i.ZP.p.withConfig({displayName:"mapView__Text",componentId:"sc-1ogju75-8"})(["margin:0;width:100%;"]),I=i.ZP.h3.withConfig({displayName:"mapView__Title",componentId:"sc-1ogju75-9"})(["margin:0;white-space:nowrap;"]),Y=i.ZP.div.withConfig({displayName:"mapView__LegendContainer",componentId:"sc-1ogju75-10"})(["display:flex;width:85%;justify-content:space-between;@media (max-width:770px){width:100%;justify-content:center;flex-wrap:wrap;}font-size:16pt;"]),M=i.ZP.div.withConfig({displayName:"mapView__Legend",componentId:"sc-1ogju75-11"})(["margin:10px 0;width:380px;display:flex;justify-content:center;align-itms:center;"]),z=i.ZP.div.withConfig({displayName:"mapView__Cards",componentId:"sc-1ogju75-12"})(["display:flex;flex-direction:row;justify-content:space-evenly;flex-wrap:wrap;"]);function V(e){var t=e.MapSettings,n=e.selectedCounty,i=e.setSelectedCounty,a=e.selectedState,u=e.setSelectedState,d=e.time,p=(e.setTime,(0,r.useContext)(E.z)),m=p.mapData,g=p.mapTitles,y=(0,r.useState)(Array(g.length)),w=y[0],x=y[1],v=(0,r.useState)(1),V=v[0],O=v[1],T=function(e,t){var n,r=e[0],i=e[1];return void 0===t&&(t=!1),w.forEach((function(e){t||r===e.currId||-1===r?(e.reset(),O(1),n=!1):(O(e.select(r)),n=!0)})),n?(u([r,i]),!0):(u([-1,""]),!1)},D=function(e){var t=e[0],n=e[1];-1!==t&&Number(String(t).slice(0,-3))!==a[0]||i([t,n])},B=o.bEe(o.sY$).domain((0,l.Z)(d)),F=o.bEe(o.bc$).domain((0,l.Z)(d)),R=function(e){var t=e instanceof s.Z?e.count.apply(e,(0,l.Z)(d)):[e],n=e instanceof s.Z?e.n:d[1];return(30+Math.max.apply(Math,(0,l.Z)(t)))/n},L=(0,r.useRef)(null),U=100,H=370,W=[20,20];(0,r.useEffect)((function(){var e=Math.min(H,100+10*V)-2*W[0],t=Math.min(U,40+2*V),n=[{x:1,r:1},{x:2,r:5},{x:3,r:10},{x:4,r:20},{x:5,r:52}];o.Ys(L.current).selectAll("*").remove();var r=o.Ys(L.current).style("width",e+3.5*W[0]).style("height",t+2*W[1]).append("g").attr("transform","translate("+W[0]+",0)"),i=o.BYU().domain([1,n[n.length-1].x]).range([0,e]),l=o.BYU().domain([0,1]).range([t,0]);r.append("g").attr("transform","translate(0,"+(3*W[1]/2+5*V/2)+")").call(o.LLu(i).ticks(5).tickFormat((function(e){return String(n[e-1].r)}))),r.append("g").attr("transform","translate("+W[0]+",0)").call(o.y4O(l)).style("display","none"),r.selectAll("dot").remove().data(n).enter().append("circle").attr("class","point").attr("cx",(function(e){var t=e.x;return i(t)})).attr("cy",(function(){return l(.5)})).attr("r",(function(e){var t=e.r;return R(t)*V*(-1===a[0]?4:1)})).style("fill","black"),r.append("text").attr("text-anchor","end").attr("x",e/2+W[0]+10).attr("y",t+3*W[1]/2+V/4).style("font-size","14pt").text("Count")}),[d,V,a]);var q=(0,r.useRef)(null);return(0,r.useEffect)((function(){o.Ys(q.current).selectAll("*").remove();var e=o.Ys(q.current).style("width",H).style("height",U).append("g").attr("transform","translate("+(30+W[0]+40)+",0)"),t=[1,5,10,15,20,25,30,40,46,52],n=(0,l.Z)(Array(2*t.length).keys()).map((function(e){return{x:e%t.length+1,w:t[e%t.length],c:e<t.length?1:2}})),r=o.BYU().domain([1,t.length]).range([0,330-2*W[0]-30]),i=o.BYU().domain([0,3]).range([U-2*W[1],0]);e.append("g").attr("transform","translate(0,"+(W[1]+500/12)+")").call(o.LLu(r).ticks(5).tickFormat((function(e){return String(n[e-1].w)}))),e.append("g").attr("transform","translate("+W[0]+",0)").call(o.y4O(i)).style("display","none"),e.selectAll("dot").remove().data(n).enter().append("circle").attr("class","point").attr("cx",(function(e){var t=e.x;return r(t)})).attr("cy",(function(e){var t=e.c;return i(t)})).attr("r",(function(){return 9})).style("fill",(function(e){var t=e.c,n=e.w;return 1===t?F(n):B(n)})),e.append("text").attr("text-anchor","end").attr("x",175).attr("y",95).style("font-size","14pt").text("Week Number"),e.append("text").attr("text-anchor","end").attr("x",-15).attr("y",45).text("Hotspots").style("font-size","12pt"),e.append("text").attr("text-anchor","end").attr("x",-15).attr("y",25).text("Coldspots").style("font-size","12pt")}),[d,V]),r.createElement(C,null,r.createElement(k,null,r.createElement(S,null,-1!==a[0]?r.createElement(r.Fragment,null,r.createElement(N,null,r.createElement(I,null,"Selected State: ",a[1]),r.createElement(j,null,"Highlight over a county to read its specific values.")),r.createElement(P,{onClick:function(){T([-1,""],!0)}},"Reset")):r.createElement(j,null,"Click a state on the map to zoom in and see county specific information."))),r.createElement(_,null),r.createElement(h.o,null,r.createElement(A,null,g.map((function(e,i){return r.createElement(b,{key:i,MapSettings:t,title:e,countiesMap:c,highlightedCounty:n,highlightedState:a,addState:function(e){return function(e,t){w[t]=e,x(w)}(e,i)},stateSelector:T,countySelector:D,time:d,data:m?m[i]:null,colorScales:[F,B],getRadius:R})})))),r.createElement(Z,null,n[1]?r.createElement(I,null,"Selected County: ",n[1]," County"):null),r.createElement(z,null,-1!==n[0]?[0,2,1,3].map((function(e){var t=!!m&&m[e].filter((function(e){return Number(e.fips)===Number(n[0])}))[0],i=t?t.count.apply(t,(0,l.Z)(d)):[0,0],a=i[0],o=i[1],c=t?t.recent.apply(t,(0,l.Z)(d)):[0,0],s=c[0],u=c[1];return r.createElement(f,{key:e,title:g[e],hcount:a,ccount:o,hrecent:s,crecent:u})})):null),r.createElement(Y,null,r.createElement(M,null,r.createElement("svg",{ref:q})),r.createElement(M,null,r.createElement("svg",{ref:L}))))}var O=n(2114),T=i.ZP.div.withConfig({displayName:"mapExample__Container",componentId:"d21v4l-0"})([""]),D=i.ZP.svg.withConfig({displayName:"mapExample__Map",componentId:"d21v4l-1"})(["width:350px;height:250px;"]),B=280,F=250,R=o.BYU().domain([1,52]).range([0,200]),L=o.BYU().domain([0,2]).range([62.5,0]),U=[0,52],H=o.bEe(o.sY$).domain([].concat(U)),W=o.bEe(o.bc$).domain([].concat(U)),q=function(e){var t=e.count(),n=e.n;return(10+Math.max.apply(Math,(0,l.Z)(t)))/n*12},$=[function(e,t){o.Ys(e.current).select("#xaxis").attr("visibility","hidden"),o.Ys(e.current).selectAll(".cboundary").style("stroke-opacity",1),o.Ys(e.current).selectAll(".bubble").transition().attr("transform",(function(e){var n=e.fips,r=o.Ys("#c"+n).datum();return"translate("+t.centroid(r)+")"})).style("fill","#d3d3d3").attr("r",4).duration(2e3),o.Ys(e.current).select("#axistitle").attr("display","none")},function(e,t){o.Ys(e.current).select("#xaxis").attr("visibility","hidden"),o.Ys(e.current).selectAll(".cboundary").style("stroke-opacity",1),o.Ys(e.current).selectAll(".bubble").transition().style("fill",(function(e){var t=e.recent.apply(e,U);return t[0]>t[1]?"red":"blue"})).attr("r",4).attr("transform",(function(e){var n=e.fips,r=o.Ys("#c"+n).datum();return"translate("+t.centroid(r)+")"})).duration(1e3),o.Ys(e.current).select("#axistitle").attr("display","none")},function(e,t){o.Ys(e.current).selectAll(".cboundary").style("stroke-opacity",0),o.Ys(e.current).select("#xaxis").attr("visibility","visible"),o.Ys(e.current).selectAll(".bubble").transition().style("fill",(function(e){var t=e.recent.apply(e,U),n=t[0],r=t[1];return n>r?W(n):H(r)})).attr("transform",(function(e){var t=e.recent.apply(e,U),n=t[0],r=t[1];return"translate("+(R(Math.max(n,r))+56+25)+", "+(L(n>r?1:2)+62.5)+")"})).attr("r",4).duration(2e3),o.Ys(e.current).select("#axistitle").attr("display","block")},function(e,t){o.Ys(e.current).select("#xaxis").attr("visibility","visible"),o.Ys(e.current).selectAll(".cboundary").style("stroke-opacity",0),o.Ys(e.current).selectAll(".bubble").transition().style("fill",(function(e){var t=e.recent.apply(e,U),n=t[0],r=t[1];return n>r?W(n):H(r)})).attr("r",q).attr("transform",(function(e){var t=e.recent.apply(e,U),n=t[0],r=t[1];return"translate("+(R(n>r?n:r)+56+25)+", "+(L(n>r?1:2)+62.5)+")"})).duration(2e3),o.Ys(e.current).select("#axistitle").attr("display","block")},function(e,t){o.Ys(e.current).selectAll(".cboundary").style("stroke-opacity",1),o.Ys(e.current).select("#xaxis").attr("visibility","hidden"),o.Ys(e.current).selectAll(".bubble").transition().style("fill",(function(e){var t=e.recent.apply(e,U),n=t[0],r=t[1];return n>r?W(n):H(r)})).attr("r",q).attr("transform",(function(e){var n=e.fips,r=o.Ys("#c"+n).datum();return"translate("+t.centroid(r)+")"})).duration(2e3),o.Ys(e.current).select("#axistitle").attr("display","none")}],G=function(e){var t=e.step,n=[315,427.5],i=(0,r.useRef)(null),a=(0,r.useContext)(h.E).counties,l=(0,r.useContext)(E.z),c=l.mapData,s=(l.mapTitles,c[3].filter((function(e){var t=e.fips;return 46==Math.floor(t/1e3)}))),u=o.FWi().scale(3e3).translate(n),d=o.l49().projection(u);return(0,r.useEffect)((function(){var e=o.Ys(i.current).attr("width",B).attr("height",F).append("g");e.append("g").attr("transform","translate(81,125)").attr("id","xaxis").call(o.LLu(R).tickFormat((function(e){return String(e)}))),e.append("g").attr("transform","translate(81,62.5)").call(o.y4O(L)).attr("display","none"),e.append("g").append("text").attr("id","axistitle").attr("text-anchor","middle").attr("x",R(26)+56+25).attr("y",L(-3.25)).text("Week Number").attr("display","none"),e.append("g").selectAll("path").data(a.filter((function(e){var t=e.id;return 46==Math.floor(t/1e3)}))).enter().append("path").attr("d",d).attr("id",(function(e){var t=e.id;return"c"+Number(t)})).attr("class","cboundary").style("stroke","#D3D3D3").style("fill","#FFFFFF00"),e.selectAll("circle").data(s).enter().append("circle").attr("class","bubble").attr("transform",(function(e){var t=e.fips,n=o.Ys("#c"+t).datum();return"translate("+d.centroid(n)+")"}))}),[]),(0,r.useEffect)((function(){$[t-1](i,d)}),[t]),r.createElement(T,null,r.createElement(D,{ref:i}))},X=n(6379),J=i.ZP.div.withConfig({displayName:"legendDescription__Container",componentId:"sc-1w9o80h-0"})(["width:100%;"]),K=i.ZP.div.withConfig({displayName:"legendDescription__TextContainer",componentId:"sc-1w9o80h-1"})(["display:flex;flex-direction:column;width:100%;& > h1{margin:10px 15px 0 15px;}& > h2{margin:5px 15px 0 15px;}margin:5px 0;"]),Q=(i.ZP.hr.withConfig({displayName:"legendDescription__Divider",componentId:"sc-1w9o80h-2"})(["width:98%;height:1px;background-color:black;border-radius:1px;margin:5px 10px;"]),i.ZP.p.withConfig({displayName:"legendDescription__Text",componentId:"sc-1w9o80h-3"})(["margin:0 15px;"])),ee=i.ZP.div.withConfig({displayName:"legendDescription__ControlsContainer",componentId:"sc-1w9o80h-4"})(["display:flex;justify-content:center;flex-direction:column;"]),te=i.ZP.div.withConfig({displayName:"legendDescription__ListMapContainer",componentId:"sc-1w9o80h-5"})(["display:flex;width:100%;@media (max-width:770px){flex-wrap:wrap;justify-content:center;}margin-bottom:5px;"]),ne=(i.ZP.button.withConfig({displayName:"legendDescription__Button",componentId:"sc-1w9o80h-6"})([""]),i.ZP.ol.withConfig({displayName:"legendDescription__StepList",componentId:"sc-1w9o80h-7"})(["max-width:500px;@media (max-width:550px){width:85%;}li:nth-child(","){background-color:#d3d3d3;}& > *{margin:2px 0;padding:3px;cursor:pointer;}"],(function(e){return e.step})));function re(e){var t=e.step,n=e.setLegendStep,i=(0,r.useState)(!1),a=i[0],l=i[1],o=(0,r.useState)(!1),c=o[0],s=o[1],u=function(e){s(!0),n(e)};return(0,r.useEffect)((function(){if(a){u(t);var e=setInterval((function(){t<5&&u(t+1)}),4e3);return function(){return clearInterval(e)}}}),[a,t]),r.createElement(h.o,null,r.createElement(E.X,null,r.createElement(J,null,r.createElement(te,null,r.createElement(K,null,r.createElement(Q,null,"The following list describes the steps that were taken to make the bubble plots on this page. An accompanying map of South Dakota using Safegraph % sheltered is provided to show these steps."),r.createElement(ne,{step:c?t:0},r.createElement("li",{onClick:function(){l(!1),u(1)}},"Counties with significant values have circles placed over their centroids."),r.createElement("li",{onClick:function(){l(!1),u(2)}},"Counties are classified as hotspots (red) or coldspots (blue)."),r.createElement("li",{onClick:function(){l(!1),u(3)}},"The color intensity of circles is determined by the last week the county was a significant value."),r.createElement("li",{onClick:function(){l(!1),u(4)}},"The size of the circles are determined by the total number of weeks a county was a significant value in 2020."),r.createElement("li",{onClick:function(){l(!1),u(5)}},"The circles are placed back over the county.")),r.createElement(Q,null,"Use the controls under the map to play through these steps. You can also click on the text of steps to display them.")),r.createElement(ee,null,r.createElement(G,{step:t}),r.createElement(X.Z,{week:t,setWeek:u,min:1,max:5,setPlaying:l,playing:a}))))))}var ie=i.ZP.div.withConfig({displayName:"interactive__Container",componentId:"n3bg2y-0"})(["width:100%;display:flex;align-items:center;flex-direction:column;"]),ae=i.ZP.div.withConfig({displayName:"interactive__TextContainer",componentId:"n3bg2y-1"})(["display:flex;flex-direction:column;justify-content:start;width:100%;& > h1{margin:10px 15px 0 15px;}& > h2{margin:5px 15px 0 15px;}"]),le=i.ZP.hr.withConfig({displayName:"interactive__Divider",componentId:"n3bg2y-2"})(["width:98%;height:1px;background-color:black;border-radius:1px;margin:5px 10px;"]),oe=i.ZP.p.withConfig({displayName:"interactive__Text",componentId:"n3bg2y-3"})(["margin:5px 15px;"]),ce=function(){var e={width:370,height:250,translate:[185,125],scale:500},t=(0,r.useState)([-1,""]),n=t[0],i=t[1],l=(0,r.useState)([-1,""]),o=l[0],c=l[1],s=(0,r.useState)([0,52]),u=s[0],d=s[1],p=(0,r.useState)(1),m=p[0],f=p[1];return r.createElement(O.Z,{selectedPage:"Interactive"},r.createElement(ie,null,r.createElement(ae,null,r.createElement("h1",null,"Clustering Recency & Consistency"),r.createElement(oe,null,"This page provides a single view representation of the"," ",r.createElement(a.rU,{to:"/animated"},"Animated Choropleth Maps"),". Counties that were either a hotspot or coldspot at least once in 2020 have a circle over them. If the circle is colored blue then the county was a coldspot at some point in time and if it is colored red it was a hotspot. The radius of the circle shows the total number of times that county was a hotspot or coldspot in the given period. A circle with a larger radius indicates that it was a hotspot or coldspot more times in the year. A darker color shows the last time the county was a hotspot or coldspot was later in the year while a lighter color means the last time the county was a hotspot or coldspot was earlier in the year.")),r.createElement(re,{step:m,setLegendStep:f}),r.createElement(le,null),r.createElement(V,{MapSettings:e,selectedCounty:n,setSelectedCounty:i,selectedState:o,setSelectedState:c,time:u,setTime:d}),r.createElement(le,null),r.createElement(ae,null,r.createElement(oe,null,"In general, we see more circles in the eastern parts of the US because of the smaller county size compared to counties in western states. We also see different patterns across the different data sources in each column."),r.createElement(oe,null,"In the left column, showing mobility, Cuebiq shows a cluster of hotspots (high mobility) in the south. These counties are recent (dark red color) and also consistent (larger circle radius). Mississippi in particular contains multiple counties that were hotspots every week in the US. This pattern is not as prevalent in the Safegraph data, though the Safegraph data shows a cluster of coldspots in New England that the Cuebiq map does not."),r.createElement(oe,null,"The plots showing measures of sheltering in the right column are much more similar to each other than the plots in the left column. However, we still see variation in terms of the recency and consistency of cluster classifications. For example, clicking on Iowa will show counties that area classified as hotspots in the Safegraph data but are classified as coldspots in the Cuebiq data. There is still variation in the counties classified as coldspots in both sources. Generally, the counties in the Safegraph data are less recent (lighter shades of blue) and also less consistent (smaller radius)."))))}},8928:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(1839),i=function(){function e(e,t,n,i,a){this.active=r.Ys(null),this.path=null,this.g=null,this.width=0,this.height=0,this.currId=-1,this.path=e,this.g=t,this.width=n,this.height=i,this.currId=a}var t=e.prototype;return t.select=function(e){var t;this.currId=e,this.g.select("[stateFips='"+e+"']").attr("x",(function(e,n){t=e}));var n=this.path.bounds(t),r=n[0],i=r[0],a=r[1],l=n[1],o=l[0],c=l[1],s=o-i,u=c-a,d=(i+o)/2,p=(a+c)/2,m=.8/Math.max(s/this.width,u/this.height),f=[this.width/2-m*d,this.height/2-m*p];return this.g.transition().duration(650).attr("transform","translate("+f+") scale("+m+")"),m},t.clicked=function(e,t){var n=e.getAttribute("id");if(this.active.node()===e)return this.reset();this.active.classed("active",!1),this.active=r.Ys(e).classed("active",!0);var i=this.path.bounds(t),a=i[0],l=a[0],o=a[1],c=i[1],s=c[0],u=c[1],d=s-l,p=u-o,m=(l+s)/2,f=(o+u)/2,h=.7/Math.max(d/this.width,p/this.height),g=[this.width/2-h*m,this.height/2-h*f];return this.g.transition().duration(650).attr("transform","translate("+g+") scale("+h+")"),n},t.reset=function(){this.currId="",this.active.classed("active",!1),this.active=r.Ys(null),this.g.transition().duration(500).attr("transform","translate(0)")},e}()}}]);
//# sourceMappingURL=component---src-pages-interactive-tsx-a846985e53a35751a475.js.map