@undp/data-viz 2.3.0 → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/HybridMap.cjs +1 -1
- package/dist/HybridMap.cjs.map +1 -1
- package/dist/HybridMap.js +144 -141
- package/dist/HybridMap.js.map +1 -1
- package/package.json +1 -1
package/dist/HybridMap.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-CHPV5EwG-6v2a2njQ.cjs"),c=require("react"),qt=require("./parse-xYI9yrvL.cjs"),It=require("./getSliderMarks-CIuSoedo.cjs"),Ut=require("./Spinner-jTMOLuw_.cjs"),Pt=require("./index-DQA8q5sC.cjs"),U=require("./index-DLFt97gy.cjs"),St=require("./Typography-sa1UE0oF.cjs"),Gt=require("./index-C5K--w8d.cjs"),zt=require("./Source-B5AoSlsi.cjs"),Ht=require("./index-Dzc_aaI9-C3DbPpy3.cjs"),Xt=require("./Tooltip-BLa2EfMs.cjs"),Ot=require("./index-C6er0ety.cjs"),Yt=require("./DetailsModal-DHttOA80.cjs"),Jt=require("./pow-BnyPO-NX.cjs"),Kt=require("./ordinal-CrsysVE-.cjs"),Zt=require("./threshold-DNsSUf8Q.cjs"),Nt=require("./select-Bnfk0lJx.cjs"),le=require("./proxy-C4-uo6nS.cjs"),dt=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),Qt=require("./numberFormattingFunction-02t-wJta.cjs"),eo=require("./use-in-view-C3o_ntMv.cjs"),to=require("./index-CoobIWNj.cjs"),oo=require("./GraphFooter.cjs"),ro=require("./GraphHeader.cjs"),we=require("./Colors.cjs"),io=require("./fetchAndParseData-QTF6tjij.cjs"),Lt=require("./GraphContainer-B1EDxJ0S.cjs"),ao=require("./getUniqValue-NX8DgwND.cjs"),no=require("./getJenks-BzJvhy_H.cjs");function so(i){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const t in i)if(t!=="default"){const g=Object.getOwnPropertyDescriptor(i,t);Object.defineProperty(e,t,g.get?g:{enumerable:!0,get:()=>i[t]})}}return e.default=i,Object.freeze(e)}const lo=so(c);var co="Separator",Vt="horizontal",uo=["horizontal","vertical"],_t=lo.forwardRef((i,e)=>{const{decorative:t,orientation:g=Vt,...f}=i,n=mo(g)?g:Vt,y=t?{role:"none"}:{"aria-orientation":n==="vertical"?n:void 0,role:"separator"};return o.ae.jsx(Ht.w.div,{"data-orientation":n,...y,...f,ref:e})});_t.displayName=co;function mo(i){return uo.includes(i)}var $t=_t;const Bt=c.forwardRef((i,e)=>{const t=o._.c(14);let g,f,n,y;t[0]!==i?({className:g,variant:n,orientation:y,...f}=i,t[0]=i,t[1]=g,t[2]=f,t[3]=n,t[4]=y):(g=t[1],f=t[2],n=t[3],y=t[4]);const v=n===void 0?"dark":n,d=y===void 0?"horizontal":y,x=d==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",w=v==="dark"?"bg-primary-gray-600 dark:bg-primary-gray-200":"bg-primary-gray-400 dark:bg-primary-gray-550";let b;t[5]!==g||t[6]!==x||t[7]!==w?(b=o.mo(x,w,g),t[5]=g,t[6]=x,t[7]=w,t[8]=b):b=t[8];let S;return t[9]!==d||t[10]!==f||t[11]!==e||t[12]!==b?(S=o.ae.jsx($t,{...f,ref:e,orientation:d,className:b}),t[9]=d,t[10]=f,t[11]=e,t[12]=b,t[13]=S):S=t[13],S});Bt.displayName=$t.displayName;function po(i){const{data:e,colors:t,mapData:g,mapColorLegendTitle:f,colorDomain:n,radius:y,height:v,width:d,scale:x,centerPoint:w,tooltip:b,showLabels:S,mapBorderWidth:ke,mapBorderColor:Re,mapNoDataColor:Ce,onSeriesMouseOver:G,showColorScale:De,zoomScaleExtend:We,zoomTranslateExtend:Ue,highlightedDataPoints:Se,onSeriesMouseClick:I,resetSelectionOnDoubleClick:Ne,detailsOnClick:H,styles:k,classNames:X,mapProjection:Q,zoomInteraction:Y,animate:j,dimmedOpacity:P,customLayers:ce,maxRadiusValue:de,categorical:ee,dotColor:J,collapseColorScaleByDefault:Oe,highlightedIds:te,mapProperty:ue,dotLegendTitle:me,dotBorderColor:Me,labelColor:qe,projectionRotate:K,rewindCoordinatesInMapData:pe}=i,u=c.useMemo(()=>pe?U.index_default(g,{reverse:!0}):g,[g,pe]),[s,z]=c.useState(void 0),[Ge,Ie]=c.useState(Oe===void 0?!(d<680):!Oe),xe=c.useRef(null),[L,N]=c.useState(void 0),[oe,O]=c.useState(void 0),[Pe,R]=c.useState(void 0),[ze,M]=c.useState(void 0),V=c.useRef(null),Z=eo.useInView(V,{once:j.once,amount:j.amount}),re=c.useRef(null),_=e.filter(r=>r.radius===void 0||r.radius===null).length!==e.length?Jt.sqrt().domain([0,de]).range([.25,y]).nice():void 0,q=ee?Kt.ordinal().domain(n).range(t):Zt.threshold().domain(n).range(t);c.useEffect(()=>{const r=Nt.select(re.current),a=Nt.select(V.current),C=m=>{if(Y==="noZoom")return!1;if(Y==="button")return!m.type.includes("wheel");const ge=m.type==="wheel",fe=m.type.startsWith("touch"),Be=m.type==="mousedown"||m.type==="mousemove";return fe?!0:ge?Y==="scroll"?!0:m.ctrlKey:Be&&!m.button&&!m.ctrlKey},D=U.zoom().scaleExtent(We).translateExtent(Ue||[[-20,-20],[d+20,v+20]]).filter(C).on("zoom",({transform:m})=>{r.attr("transform",m)});a.call(D),xe.current=D},[v,d,Y]);const $=U.index_default$1(u),E=Gt.index_default(u),Le=$[2]-$[0],Ve=$[3]-$[1],_e=d*190/960*360/Le,$e=v*190/678*180/Ve,B=x*Math.min(_e,$e),ie=Q==="mercator"?U.geoMercator().rotate(K).center(w||E.geometry.coordinates).translate([d/2,v/2]).scale(B):Q==="equalEarth"?U.geoEqualEarth().rotate(K).center(w||E.geometry.coordinates).translate([d/2,v/2]).scale(B):Q==="naturalEarth"?U.geoNaturalEarth1().rotate(K).center(w||E.geometry.coordinates).translate([d/2,v/2]).scale(B):Q==="orthographic"?U.geoOrthographic().rotate(K).center(w||E.geometry.coordinates).translate([d/2,v/2]).scale(B):U.geoAlbersUsa().rotate(K).center(w||E.geometry.coordinates).translate([d/2,v/2]).scale(B),he=U.geoPath().projection(ie),ae=r=>{if(!V.current||!xe.current)return;Nt.select(V.current).call(xe.current.scaleBy,r==="in"?1.2:1/1.2)};return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsxs("div",{className:"relative",children:[o.jsxRuntimeExports.jsx(le.motion.svg,{width:`${d}px`,height:`${v}px`,viewBox:`0 0 ${d} ${v}`,ref:V,direction:"ltr",children:o.jsxRuntimeExports.jsxs("g",{ref:re,children:[ce.filter(r=>r.position==="before").map(r=>r.layer),u.features.map((r,a)=>{if(!r.properties?.[ue])return null;const C=he(r);return C?o.jsxRuntimeExports.jsx(le.motion.g,{opacity:s?P:te.length!==0?te.indexOf(r.properties[ue])!==-1?1:P:1,children:o.jsxRuntimeExports.jsx("path",{d:C,style:{stroke:Re,strokeWidth:ke,fill:Ce}})},a):null}),o.jsxRuntimeExports.jsxs(to.AnimatePresence,{children:[e.filter(r=>r.id).map(r=>{const a=u.features.findIndex(m=>r.id===m.properties[ue]);if(a===-1)return null;const C=he(u.features[a]);if(!C)return null;const D=dt.checkIfNullOrUndefined(r.x)?Ce:q(r.x);return o.jsxRuntimeExports.jsx(le.motion.g,{variants:{initial:{opacity:0},whileInView:{opacity:s?s===D?1:P:te.length!==0?te.indexOf(r.id)!==-1?1:P:1,transition:{duration:j.duration}}},initial:"initial",animate:Z?"whileInView":"initial",exit:{opacity:0,transition:{duration:j.duration}},onMouseEnter:m=>{O(r),M(m.clientY),R(m.clientX),G?.(r)},onMouseMove:m=>{O(r),M(m.clientY),R(m.clientX)},onMouseLeave:()=>{O(void 0),R(void 0),M(void 0),G?.(void 0)},onClick:()=>{(I||H)&&(Pt.isEqual(L,r)&&Ne?(N(void 0),I?.(void 0)):(N(r),I?.(r)))},children:o.jsxRuntimeExports.jsx(le.motion.path,{d:C,variants:{initial:{fill:D,opacity:0},whileInView:{fill:D,opacity:1,transition:{duration:j.duration}}},initial:"initial",animate:Z?"whileInView":"initial",exit:{opacity:0,transition:{duration:j.duration}},style:{stroke:Re,strokeWidth:ke}},`${r.id}`)},r.id)}),e.filter(r=>!dt.checkIfNullOrUndefined(r.lat)&&!dt.checkIfNullOrUndefined(r.long)).map(r=>o.jsxRuntimeExports.jsxs(le.motion.g,{variants:{initial:{opacity:0},whileInView:{opacity:Se.length!==0?Se.indexOf(r.label||"")!==-1?1:P:1,transition:{duration:j.duration}}},initial:"initial",animate:Z?"whileInView":"initial",exit:{opacity:0,transition:{duration:j.duration}},onMouseEnter:a=>{O(r),M(a.clientY),R(a.clientX),G?.(r)},onMouseMove:a=>{O(r),M(a.clientY),R(a.clientX)},onMouseLeave:()=>{O(void 0),R(void 0),M(void 0),G?.(void 0)},onClick:()=>{(I||H)&&(Pt.isEqual(L,r)&&Ne?(N(void 0),I?.(void 0)):(N(r),I?.(r)))},transform:`translate(${ie([r.long,r.lat])[0]},${ie([r.long,r.lat])[1]})`,children:[o.jsxRuntimeExports.jsx(le.motion.circle,{cx:0,cy:0,variants:{initial:{r:0,fill:J,stroke:Me||J},whileInView:{r:_?_(r.radius||0):y,fill:J,stroke:Me||J,transition:{duration:j.duration}}},initial:"initial",animate:Z?"whileInView":"initial",exit:{r:0,transition:{duration:j.duration}},style:{fillOpacity:.8}}),S&&r.label?o.jsxRuntimeExports.jsx(le.motion.text,{variants:{initial:{opacity:0,x:_?_(r.radius||0):y},whileInView:{opacity:1,x:_?_(r.radius||0):y,transition:{duration:j.duration}}},initial:"initial",animate:Z?"whileInView":"initial",exit:{opacity:0,transition:{duration:j.duration}},y:0,className:o.mo("text-sm",X?.graphObjectValues),style:{textAnchor:"start",fill:qe||"#000",...k?.graphObjectValues||{}},dx:4,dy:5,children:r.label}):null]},r.label||`${r.lat}-${r.long}`))]}),ce.filter(r=>r.position==="after").map(r=>r.layer)]})}),De===!1?null:o.jsxRuntimeExports.jsx("div",{className:o.mo("absolute left-4 bottom-4 map-color-legend",X?.colorLegend),children:Ge?o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx("div",{className:"color-legend-close-button bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)] border border-[var(--gray-400)] rounded-full w-6 h-6 p-[3px] cursor-pointer z-10 absolute right-[-0.75rem] top-[-0.75rem]",onClick:()=>{Ie(!1)},children:o.jsxRuntimeExports.jsx(Ot.X,{})}),o.jsxRuntimeExports.jsxs("div",{className:"color-legend-box p-2 bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)]",style:{width:ee?void 0:"340px"},children:[me&&me!==""?o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxRuntimeExports.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:J}}),o.jsxRuntimeExports.jsx(St.j,{size:"xs",marginBottom:"none",className:"p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300",style:{display:"-webkit-box",WebkitLineClamp:"1",WebkitBoxOrient:"vertical"},children:me})]}),o.jsxRuntimeExports.jsx(zt.n,{size:"xl"}),o.jsxRuntimeExports.jsx(Bt,{}),o.jsxRuntimeExports.jsx(zt.n,{size:"xl"})]}):null,f&&f!==""?o.jsxRuntimeExports.jsx(St.j,{size:"xs",marginBottom:"xs",className:"p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300",style:{display:"-webkit-box",WebkitLineClamp:"1",WebkitBoxOrient:"vertical"},children:f}):null,ee?o.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-3",children:n.map((r,a)=>o.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 items-center",onMouseOver:()=>{z(t[a%t.length])},onMouseLeave:()=>{z(void 0)},children:[o.jsxRuntimeExports.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:t[a%t.length]}}),o.jsxRuntimeExports.jsx(St.j,{size:"sm",marginBottom:"none",leading:"none",children:r})]},a))}):o.jsxRuntimeExports.jsx("svg",{width:"100%",viewBox:"0 0 320 30",direction:"ltr",children:o.jsxRuntimeExports.jsxs("g",{children:[n.map((r,a)=>o.jsxRuntimeExports.jsxs("g",{onMouseOver:()=>{z(t[a])},onMouseLeave:()=>{z(void 0)},className:"cursor-pointer",children:[o.jsxRuntimeExports.jsx("rect",{x:a*320/t.length+1,y:1,width:320/t.length-2,height:8,className:s===t[a]?"stroke-primary-gray-700 dark:stroke-primary-gray-300":"",style:{fill:t[a],...s===t[a]?{}:{stroke:t[a]}}}),o.jsxRuntimeExports.jsx("text",{x:(a+1)*320/t.length,y:25,className:"fill-primary-gray-700 dark:fill-primary-gray-300 text-xs",style:{textAnchor:"middle"},children:Qt.numberFormattingFunction(r,"NA")})]},a)),o.jsxRuntimeExports.jsx("g",{children:o.jsxRuntimeExports.jsx("rect",{onMouseOver:()=>{z(t[n.length])},onMouseLeave:()=>{z(void 0)},x:n.length*320/t.length+1,y:1,width:320/t.length-2,height:8,className:`cursor-pointer ${s===t[n.length]?"stroke-1 stroke-primary-gray-700 dark:stroke-primary-gray-300":""}`,style:{fill:t[n.length],...s===t[n.length]?{}:{stroke:t[n.length]}}})})]})})]})]}):o.jsxRuntimeExports.jsx("button",{type:"button",className:"mb-0 border-0 bg-transparent p-0 self-start map-legend-button",onClick:()=>{Ie(!0)},children:o.jsxRuntimeExports.jsx("div",{className:"show-color-legend-button items-start text-sm font-medium cursor-pointer p-2 mb-0 flex text-primary-black dark:text-primary-gray-300 bg-primary-gray-300 dark:bg-primary-gray-600 border-primary-gray-400 dark:border-primary-gray-500",children:"Show Legend"})})}),Y==="button"&&o.jsxRuntimeExports.jsxs("div",{className:"absolute left-4 top-4 flex flex-col zoom-buttons",children:[o.jsxRuntimeExports.jsx("button",{onClick:()=>ae("in"),className:"leading-0 px-2 py-3.5 text-primary-gray-700 border border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"+"}),o.jsxRuntimeExports.jsx("button",{onClick:()=>ae("out"),className:"leading-0 px-2 py-3.5 text-primary-gray-700 border border-t-0 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"–"})]})]}),H&&L!==void 0?o.jsxRuntimeExports.jsx(Yt.DetailsModal,{body:H,data:L,setData:N,className:X?.modal}):null,oe&&b&&Pe&&ze?o.jsxRuntimeExports.jsx(Xt.Tooltip,{data:oe,body:b,xPos:Pe,yPos:ze,backgroundStyle:k?.tooltip,className:X?.tooltip}):null]})}function xo(i){const e=o.compilerRuntimeExports.c(135),{data:t,mapData:g,graphTitle:f,colors:n,sources:y,graphDescription:v,height:d,width:x,footNote:w,mapColorLegendTitle:b,colorDomain:S,choroplethScaleType:ke,radius:Re,scale:Ce,centerPoint:G,padding:De,mapBorderWidth:We,mapNoDataColor:Ue,backgroundColor:Se,showLabels:I,mapBorderColor:Ne,tooltip:H,relativeHeight:k,onSeriesMouseOver:X,isWorldMap:Q,showColorScale:Y,zoomScaleExtend:j,zoomTranslateExtend:P,graphID:ce,highlightedDataPoints:de,onSeriesMouseClick:ee,graphDownload:J,dataDownload:Oe,showAntarctica:te,language:ue,minHeight:me,theme:Me,ariaLabel:qe,resetSelectionOnDoubleClick:K,detailsOnClick:pe,styles:u,classNames:s,mapProjection:z,zoomInteraction:Ge,animate:Ie,dimmedOpacity:xe,customLayers:L,maxRadiusValue:N,timeline:oe,collapseColorScaleByDefault:O,dotColor:Pe,highlightedIds:R,mapProperty:ze,dotLegendTitle:M,dotBorderColor:V,labelColor:Z,projectionRotate:re,rewindCoordinatesInMapData:_}=i,q=g===void 0?"https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-v2.json":g,$=w===void 0?"The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.":w,E=ke===void 0?"threshold":ke,Le=Re===void 0?5:Re,Ve=Ce===void 0?.95:Ce,_e=We===void 0?.5:We,$e=Ue===void 0?we.Colors.light.graphNoData:Ue,B=Se===void 0?!1:Se,ie=I===void 0?!1:I,he=Ne===void 0?we.Colors.light.grays["gray-500"]:Ne,ae=Q===void 0?!0:Q,r=Y===void 0?!0:Y;let a;e[0]!==j?(a=j===void 0?[.8,6]:j,e[0]=j,e[1]=a):a=e[1];const C=a;let D;e[2]!==de?(D=de===void 0?[]:de,e[2]=de,e[3]=D):D=e[3];const m=D,ge=J===void 0?!1:J,fe=Oe===void 0?!1:Oe,Be=te===void 0?!1:te,ut=ue===void 0?"en":ue,F=me===void 0?0:me,ne=Me===void 0?"light":Me,mt=K===void 0?!0:K,pt=z===void 0?"naturalEarth":z,xt=Ge===void 0?"button":Ge,He=Ie===void 0?!1:Ie,ht=xe===void 0?.3:xe;let Xe;e[4]!==L?(Xe=L===void 0?[]:L,e[4]=L,e[5]=Xe):Xe=e[5];const gt=Xe;let Ye;e[6]!==oe?(Ye=oe===void 0?{enabled:!1,autoplay:!1,showOnlyActiveDate:!0}:oe,e[6]=oe,e[7]=Ye):Ye=e[7];const l=Ye,ft=Pe===void 0?we.Colors.primaryColors["blue-600"]:Pe;let Je;e[8]!==R?(Je=R===void 0?[]:R,e[8]=R,e[9]=Je):Je=e[9];const yt=Je,vt=ze===void 0?"ISO3":ze,jt=Z===void 0?we.Colors.primaryColors["blue-600"]:Z;let Ke;e[10]!==re?(Ke=re===void 0?[0,0]:re,e[10]=re,e[11]=Ke):Ke=e[11];const bt=Ke,Et=_===void 0?!0:_,[se,Ft]=c.useState(0),[Fe,Tt]=c.useState(0),[T,At]=c.useState(l.autoplay);let Te;if(e[12]!==t||e[13]!==l.dateFormat){let h;e[15]!==l.dateFormat?(h=W=>qt.parse(`${W.date}`,l.dateFormat||"yyyy",new Date).getTime(),e[15]=l.dateFormat,e[16]=h):h=e[16],Te=[...new Set(t.filter(Ro).map(h))],Te.sort(ko),e[12]=t,e[13]=l.dateFormat,e[14]=Te}else Te=e[14];const p=Te,[A,wt]=c.useState(l.autoplay?0:p.length-1),[ye,Wt]=c.useState(void 0),kt=c.useRef(null),Mt=c.useRef(null);let Ze;e[17]!==E||e[18]!==S||e[19]!==n?.length||e[20]!==t?(Ze=S||(E==="categorical"?ao.getUniqValue(t,"x"):no.getJenks(t.map(wo),n?.length||4)),e[17]=E,e[18]=S,e[19]=n?.length,e[20]=t,e[21]=Ze):Ze=e[21];const Ae=Ze;let Qe,et;e[22]===Symbol.for("react.memo_cache_sentinel")?(Qe=()=>{const h=new ResizeObserver(W=>{Ft(W[0].target.clientWidth||620),Tt(W[0].target.clientHeight||480)});return kt.current&&h.observe(kt.current),()=>h.disconnect()},et=[],e[22]=Qe,e[23]=et):(Qe=e[22],et=e[23]),c.useEffect(Qe,et);let tt;e[24]===Symbol.for("react.memo_cache_sentinel")?(tt=h=>{Wt(h)},e[24]=tt):tt=e[24];const ot=c.useEffectEvent(tt);let rt;e[25]!==q||e[26]!==ot?(rt=()=>{typeof q=="string"?io.fetchAndParseJSON(q).then(W=>{ot(W)}):ot(q)},e[25]=q,e[26]=ot,e[27]=rt):rt=e[27];let it;e[28]!==q?(it=[q],e[28]=q,e[29]=it):it=e[29],c.useEffect(rt,it);let at,nt;e[30]!==T||e[31]!==l.speed||e[32]!==p?(at=()=>{const h=setInterval(()=>{wt(W=>W<p.length-1?W+1:0)},(l.speed||2)*1e3);return T||clearInterval(h),()=>clearInterval(h)},nt=[p,T,l.speed],e[30]=T,e[31]=l.speed,e[32]=p,e[33]=at,e[34]=nt):(at=e[33],nt=e[34]),c.useEffect(at,nt);const Rt=l.dateFormat||"yyyy";let st;e[35]!==A||e[36]!==Rt||e[37]!==l.showOnlyActiveDate||e[38]!==p?(st=It.getSliderMarks(p,A,l.showOnlyActiveDate,Rt),e[35]=A,e[36]=Rt,e[37]=l.showOnlyActiveDate,e[38]=p,e[39]=st):st=e[39];const lt=st,Ct=s?.graphContainer,Dt=u?.graphContainer;let ve;e[40]!==s?.description||e[41]!==s?.title||e[42]!==t||e[43]!==fe||e[44]!==v||e[45]!==ge||e[46]!==f||e[47]!==u?.description||e[48]!==u?.title||e[49]!==x?(ve=f||v||ge||fe?o.jsxRuntimeExports.jsx(ro.GraphHeader,{styles:{title:u?.title,description:u?.description},classNames:{title:s?.title,description:s?.description},graphTitle:f,graphDescription:v,width:x,graphDownload:ge?Mt:void 0,dataDownload:fe?t.map(Eo).filter(bo).length>0?t.map(jo).filter(vo):t.filter(yo):null}):null,e[40]=s?.description,e[41]=s?.title,e[42]=t,e[43]=fe,e[44]=v,e[45]=ge,e[46]=f,e[47]=u?.description,e[48]=u?.title,e[49]=x,e[50]=ve):ve=e[50];let je;e[51]!==A||e[52]!==lt||e[53]!==T||e[54]!==l.enabled||e[55]!==p?(je=l.enabled&&p.length>0&<?o.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[o.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{At(!T)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":T?"Click to pause animation":"Click to play animation",children:T?o.jsxRuntimeExports.jsx(Ot.Pause,{}):o.jsxRuntimeExports.jsx(Ot.Play,{})}),o.jsxRuntimeExports.jsx(It.Nr,{min:p[0],max:p[p.length-1],marks:lt,step:null,defaultValue:p[p.length-1],value:p[A],onChangeComplete:h=>{wt(p.indexOf(h))},onChange:h=>{wt(p.indexOf(h))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,e[51]=A,e[52]=lt,e[53]=T,e[54]=l.enabled,e[55]=p,e[56]=je):je=e[56];let be;e[57]!==He||e[58]!==G||e[59]!==E||e[60]!==s||e[61]!==O||e[62]!==n||e[63]!==gt||e[64]!==t||e[65]!==pe||e[66]!==ht||e[67]!==Ae||e[68]!==V||e[69]!==ft||e[70]!==M||e[71]!==d||e[72]!==m||e[73]!==yt||e[74]!==A||e[75]!==ae||e[76]!==jt||e[77]!==he||e[78]!==_e||e[79]!==b||e[80]!==$e||e[81]!==pt||e[82]!==vt||e[83]!==ye||e[84]!==N||e[85]!==F||e[86]!==ee||e[87]!==X||e[88]!==bt||e[89]!==Le||e[90]!==k||e[91]!==mt||e[92]!==Et||e[93]!==Ve||e[94]!==Be||e[95]!==r||e[96]!==ie||e[97]!==u||e[98]!==Fe||e[99]!==se||e[100]!==ne||e[101]!==l.dateFormat||e[102]!==l.enabled||e[103]!==H||e[104]!==p||e[105]!==x||e[106]!==xt||e[107]!==C||e[108]!==P?(be=o.jsxRuntimeExports.jsx(Lt.GraphArea,{ref:kt,children:se&&Fe&&ye?o.jsxRuntimeExports.jsx(po,{dotColor:ft,data:t.filter(h=>l.enabled?h.date===qt.format(new Date(p[A]),l.dateFormat||"yyyy"):h),mapData:Be?ye:{...ye,features:ye.features.filter(fo)},colorDomain:Ae,width:se,height:Fe,scale:Ve,centerPoint:G,colors:n||(E==="categorical"?we.Colors[ne].sequentialColors[`neutralColorsx0${Ae.length}`]:we.Colors[ne].sequentialColors[`neutralColorsx0${Ae.length+1}`]),mapColorLegendTitle:b,radius:Le,categorical:E==="categorical",mapBorderWidth:_e,mapNoDataColor:$e,mapBorderColor:he,tooltip:H,onSeriesMouseOver:X,showLabels:ie,isWorldMap:ae,showColorScale:r,zoomScaleExtend:C,zoomTranslateExtend:P,onSeriesMouseClick:ee,highlightedDataPoints:m,resetSelectionOnDoubleClick:mt,styles:u,classNames:s,zoomInteraction:xt,detailsOnClick:pe,mapProjection:pt||(ae?"naturalEarth":"mercator"),animate:He===!0?{duration:.5,once:!0,amount:.5}:He||{duration:0,once:!0,amount:0},dimmedOpacity:ht,customLayers:gt,maxRadiusValue:dt.checkIfNullOrUndefined(N)?Math.max(...t.map(go).filter(ho)):N,collapseColorScaleByDefault:O,highlightedIds:yt,mapProperty:vt,dotLegendTitle:M,dotBorderColor:V,labelColor:jt,projectionRotate:bt,rewindCoordinatesInMapData:Et}):o.jsxRuntimeExports.jsx("div",{style:{height:`${Math.max(F,d||(k?F?(x||se)*k>F?(x||se)*k:F:(x||se)*k:Fe))}px`},className:"flex items-center justify-center",children:o.jsxRuntimeExports.jsx(Ut.w,{"aria-label":"Loading graph"})})}),e[57]=He,e[58]=G,e[59]=E,e[60]=s,e[61]=O,e[62]=n,e[63]=gt,e[64]=t,e[65]=pe,e[66]=ht,e[67]=Ae,e[68]=V,e[69]=ft,e[70]=M,e[71]=d,e[72]=m,e[73]=yt,e[74]=A,e[75]=ae,e[76]=jt,e[77]=he,e[78]=_e,e[79]=b,e[80]=$e,e[81]=pt,e[82]=vt,e[83]=ye,e[84]=N,e[85]=F,e[86]=ee,e[87]=X,e[88]=bt,e[89]=Le,e[90]=k,e[91]=mt,e[92]=Et,e[93]=Ve,e[94]=Be,e[95]=r,e[96]=ie,e[97]=u,e[98]=Fe,e[99]=se,e[100]=ne,e[101]=l.dateFormat,e[102]=l.enabled,e[103]=H,e[104]=p,e[105]=x,e[106]=xt,e[107]=C,e[108]=P,e[109]=be):be=e[109];let Ee;e[110]!==s?.footnote||e[111]!==s?.source||e[112]!==$||e[113]!==y||e[114]!==u?.footnote||e[115]!==u?.source||e[116]!==x?(Ee=y||$?o.jsxRuntimeExports.jsx(oo.GraphFooter,{styles:{footnote:u?.footnote,source:u?.source},classNames:{footnote:s?.footnote,source:s?.source},sources:y,footNote:$,width:x}):null,e[110]=s?.footnote,e[111]=s?.source,e[112]=$,e[113]=y,e[114]=u?.footnote,e[115]=u?.source,e[116]=x,e[117]=Ee):Ee=e[117];let ct;return e[118]!==qe||e[119]!==B||e[120]!==ce||e[121]!==d||e[122]!==ut||e[123]!==F||e[124]!==De||e[125]!==k||e[126]!==Ct||e[127]!==Dt||e[128]!==ve||e[129]!==je||e[130]!==be||e[131]!==Ee||e[132]!==ne||e[133]!==x?(ct=o.jsxRuntimeExports.jsxs(Lt.GraphContainer,{className:Ct,style:Dt,id:ce,ref:Mt,"aria-label":qe,backgroundColor:B,theme:ne,language:ut,minHeight:F,width:x,height:d,relativeHeight:k,padding:De,children:[ve,je,be,Ee]}),e[118]=qe,e[119]=B,e[120]=ce,e[121]=d,e[122]=ut,e[123]=F,e[124]=De,e[125]=k,e[126]=Ct,e[127]=Dt,e[128]=ve,e[129]=je,e[130]=be,e[131]=Ee,e[132]=ne,e[133]=x,e[134]=ct):ct=e[134],ct}function ho(i){return i!=null}function go(i){return i.radius}function fo(i){return i.properties.NAME!=="Antarctica"}function yo(i){return i!==void 0}function vo(i){return i!==void 0}function jo(i){return i.data}function bo(i){return i!==void 0}function Eo(i){return i.data}function wo(i){return i.x}function ko(i,e){return i-e}function Ro(i){return i.date}exports.HybridMap=xo;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-CHPV5EwG-6v2a2njQ.cjs"),d=require("react"),qt=require("./parse-xYI9yrvL.cjs"),It=require("./getSliderMarks-CIuSoedo.cjs"),Ut=require("./Spinner-jTMOLuw_.cjs"),Pt=require("./index-DQA8q5sC.cjs"),U=require("./index-DLFt97gy.cjs"),St=require("./Typography-sa1UE0oF.cjs"),Gt=require("./index-C5K--w8d.cjs"),zt=require("./Source-B5AoSlsi.cjs"),Ht=require("./index-Dzc_aaI9-C3DbPpy3.cjs"),Xt=require("./Tooltip-BLa2EfMs.cjs"),Ot=require("./index-C6er0ety.cjs"),Yt=require("./DetailsModal-DHttOA80.cjs"),Jt=require("./pow-BnyPO-NX.cjs"),Kt=require("./ordinal-CrsysVE-.cjs"),Zt=require("./threshold-DNsSUf8Q.cjs"),Nt=require("./select-Bnfk0lJx.cjs"),le=require("./proxy-C4-uo6nS.cjs"),dt=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),Qt=require("./numberFormattingFunction-02t-wJta.cjs"),eo=require("./use-in-view-C3o_ntMv.cjs"),to=require("./index-CoobIWNj.cjs"),oo=require("./GraphFooter.cjs"),ro=require("./GraphHeader.cjs"),we=require("./Colors.cjs"),io=require("./fetchAndParseData-QTF6tjij.cjs"),Lt=require("./GraphContainer-B1EDxJ0S.cjs"),ao=require("./getUniqValue-NX8DgwND.cjs"),no=require("./getJenks-BzJvhy_H.cjs");function so(i){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const t in i)if(t!=="default"){const g=Object.getOwnPropertyDescriptor(i,t);Object.defineProperty(e,t,g.get?g:{enumerable:!0,get:()=>i[t]})}}return e.default=i,Object.freeze(e)}const lo=so(d);var co="Separator",Vt="horizontal",uo=["horizontal","vertical"],_t=lo.forwardRef((i,e)=>{const{decorative:t,orientation:g=Vt,...f}=i,n=mo(g)?g:Vt,y=t?{role:"none"}:{"aria-orientation":n==="vertical"?n:void 0,role:"separator"};return r.ae.jsx(Ht.w.div,{"data-orientation":n,...y,...f,ref:e})});_t.displayName=co;function mo(i){return uo.includes(i)}var $t=_t;const Bt=d.forwardRef((i,e)=>{const t=r._.c(14);let g,f,n,y;t[0]!==i?({className:g,variant:n,orientation:y,...f}=i,t[0]=i,t[1]=g,t[2]=f,t[3]=n,t[4]=y):(g=t[1],f=t[2],n=t[3],y=t[4]);const v=n===void 0?"dark":n,s=y===void 0?"horizontal":y,x=s==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",k=v==="dark"?"bg-primary-gray-600 dark:bg-primary-gray-200":"bg-primary-gray-400 dark:bg-primary-gray-550";let E;t[5]!==g||t[6]!==x||t[7]!==k?(E=r.mo(x,k,g),t[5]=g,t[6]=x,t[7]=k,t[8]=E):E=t[8];let S;return t[9]!==s||t[10]!==f||t[11]!==e||t[12]!==E?(S=r.ae.jsx($t,{...f,ref:e,orientation:s,className:E}),t[9]=s,t[10]=f,t[11]=e,t[12]=E,t[13]=S):S=t[13],S});Bt.displayName=$t.displayName;function po(i){const{data:e,colors:t,mapData:g,mapColorLegendTitle:f,colorDomain:n,radius:y,height:v,width:s,scale:x,centerPoint:k,tooltip:E,showLabels:S,mapBorderWidth:ke,mapBorderColor:Re,mapNoDataColor:Ce,onSeriesMouseOver:G,showColorScale:De,zoomScaleExtend:We,zoomTranslateExtend:Ue,highlightedDataPoints:Se,onSeriesMouseClick:I,resetSelectionOnDoubleClick:Ne,detailsOnClick:H,styles:R,classNames:X,mapProjection:ee,zoomInteraction:Y,animate:j,dimmedOpacity:P,customLayers:ce,maxRadiusValue:de,categorical:te,dotColor:J,collapseColorScaleByDefault:Oe,highlightedIds:oe,mapProperty:ue,dotLegendTitle:me,dotBorderColor:Me,labelColor:qe,projectionRotate:K,rewindCoordinatesInMapData:pe}=i,u=d.useMemo(()=>pe?U.index_default(g,{reverse:!0}):g,[g,pe]),[l,z]=d.useState(void 0),[Ge,Ie]=d.useState(Oe===void 0?!(s<680):!Oe),xe=d.useRef(null),[L,N]=d.useState(void 0),[re,O]=d.useState(void 0),[Pe,C]=d.useState(void 0),[ze,M]=d.useState(void 0),V=d.useRef(null),Z=eo.useInView(V,{once:j.once,amount:j.amount}),ie=d.useRef(null),_=e.filter(o=>o.radius===void 0||o.radius===null).length!==e.length?Jt.sqrt().domain([0,de]).range([.25,y]).nice():void 0,q=te?Kt.ordinal().domain(n).range(t):Zt.threshold().domain(n).range(t);d.useEffect(()=>{const o=Nt.select(ie.current),a=Nt.select(V.current),b=m=>{if(Y==="noZoom")return!1;if(Y==="button")return!m.type.includes("wheel");const ge=m.type==="wheel",fe=m.type.startsWith("touch"),Be=m.type==="mousedown"||m.type==="mousemove";return fe?!0:ge?Y==="scroll"?!0:m.ctrlKey:Be&&!m.button&&!m.ctrlKey},D=U.zoom().scaleExtent(We).translateExtent(Ue||[[-20,-20],[s+20,v+20]]).filter(b).on("zoom",({transform:m})=>{o.attr("transform",m)});a.call(D),xe.current=D},[v,s,Y]);const $=U.index_default$1(u),w=Gt.index_default(u),Le=$[2]-$[0],Ve=$[3]-$[1],_e=s*190/960*360/Le,$e=v*190/678*180/Ve,B=x*Math.min(_e,$e),Q=ee==="mercator"?U.geoMercator().rotate(K).center(k||w.geometry.coordinates).translate([s/2,v/2]).scale(B):ee==="equalEarth"?U.geoEqualEarth().rotate(K).center(k||w.geometry.coordinates).translate([s/2,v/2]).scale(B):ee==="naturalEarth"?U.geoNaturalEarth1().rotate(K).center(k||w.geometry.coordinates).translate([s/2,v/2]).scale(B):ee==="orthographic"?U.geoOrthographic().rotate(K).center(k||w.geometry.coordinates).translate([s/2,v/2]).scale(B):U.geoAlbersUsa().rotate(K).center(k||w.geometry.coordinates).translate([s/2,v/2]).scale(B),he=U.geoPath().projection(Q),ae=o=>{if(!V.current||!xe.current)return;Nt.select(V.current).call(xe.current.scaleBy,o==="in"?1.2:1/1.2)};return r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsxs("div",{className:"relative",children:[r.jsxRuntimeExports.jsx(le.motion.svg,{width:`${s}px`,height:`${v}px`,viewBox:`0 0 ${s} ${v}`,ref:V,direction:"ltr",children:r.jsxRuntimeExports.jsxs("g",{ref:ie,children:[ce.filter(o=>o.position==="before").map(o=>o.layer),u.features.map((o,a)=>{if(!o.properties?.[ue])return null;const b=he(o);return b?r.jsxRuntimeExports.jsx(le.motion.g,{opacity:l?P:oe.length!==0?oe.indexOf(o.properties[ue])!==-1?1:P:1,children:r.jsxRuntimeExports.jsx("path",{d:b,style:{stroke:Re,strokeWidth:ke,fill:Ce}})},a):null}),r.jsxRuntimeExports.jsxs(to.AnimatePresence,{children:[e.filter(o=>o.id).map(o=>{const a=u.features.findIndex(m=>o.id===m.properties[ue]);if(a===-1)return null;const b=he(u.features[a]);if(!b)return null;const D=dt.checkIfNullOrUndefined(o.x)?Ce:q(o.x);return r.jsxRuntimeExports.jsx(le.motion.g,{variants:{initial:{opacity:0},whileInView:{opacity:l?l===D?1:P:oe.length!==0?oe.indexOf(o.id)!==-1?1:P:1,transition:{duration:j.duration}}},initial:"initial",animate:Z?"whileInView":"initial",exit:{opacity:0,transition:{duration:j.duration}},onMouseEnter:m=>{O(o),M(m.clientY),C(m.clientX),G?.(o)},onMouseMove:m=>{O(o),M(m.clientY),C(m.clientX)},onMouseLeave:()=>{O(void 0),C(void 0),M(void 0),G?.(void 0)},onClick:()=>{(I||H)&&(Pt.isEqual(L,o)&&Ne?(N(void 0),I?.(void 0)):(N(o),I?.(o)))},children:r.jsxRuntimeExports.jsx(le.motion.path,{d:b,variants:{initial:{fill:D,opacity:0},whileInView:{fill:D,opacity:1,transition:{duration:j.duration}}},initial:"initial",animate:Z?"whileInView":"initial",exit:{opacity:0,transition:{duration:j.duration}},style:{stroke:Re,strokeWidth:ke}},`${o.id}`)},o.id)}),e.filter(o=>!dt.checkIfNullOrUndefined(o.lat)&&!dt.checkIfNullOrUndefined(o.long)).map(o=>{const a=Q([o.long,o.lat])[0]>.6*s?-1:1;return r.jsxRuntimeExports.jsxs(le.motion.g,{variants:{initial:{opacity:0},whileInView:{opacity:Se.length!==0?Se.indexOf(o.label||"")!==-1?1:P:1,transition:{duration:j.duration}}},initial:"initial",animate:Z?"whileInView":"initial",exit:{opacity:0,transition:{duration:j.duration}},onMouseEnter:b=>{O(o),M(b.clientY),C(b.clientX),G?.(o)},onMouseMove:b=>{O(o),M(b.clientY),C(b.clientX)},onMouseLeave:()=>{O(void 0),C(void 0),M(void 0),G?.(void 0)},onClick:()=>{(I||H)&&(Pt.isEqual(L,o)&&Ne?(N(void 0),I?.(void 0)):(N(o),I?.(o)))},transform:`translate(${Q([o.long,o.lat])[0]},${Q([o.long,o.lat])[1]})`,children:[r.jsxRuntimeExports.jsx(le.motion.circle,{cx:0,cy:0,variants:{initial:{r:0,fill:J,stroke:Me||J},whileInView:{r:_?_(o.radius||0):y,fill:J,stroke:Me||J,transition:{duration:j.duration}}},initial:"initial",animate:Z?"whileInView":"initial",exit:{r:0,transition:{duration:j.duration}},style:{fillOpacity:.8}}),S&&o.label?r.jsxRuntimeExports.jsx(le.motion.text,{variants:{initial:{opacity:0,x:a*(_?_(o.radius||0):y)},whileInView:{opacity:1,x:a*(_?_(o.radius||0):y),transition:{duration:j.duration}}},initial:"initial",animate:Z?"whileInView":"initial",exit:{opacity:0,transition:{duration:j.duration}},y:0,className:r.mo("text-sm",X?.graphObjectValues),style:{textAnchor:a===-1?"end":"start",fill:qe||"#000",...R?.graphObjectValues||{}},dx:a*4,dy:5,children:o.label}):null]},o.label||`${o.lat}-${o.long}`)})]}),ce.filter(o=>o.position==="after").map(o=>o.layer)]})}),De===!1?null:r.jsxRuntimeExports.jsx("div",{className:r.mo("absolute left-4 bottom-4 map-color-legend",X?.colorLegend),children:Ge?r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsx("div",{className:"color-legend-close-button bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)] border border-[var(--gray-400)] rounded-full w-6 h-6 p-[3px] cursor-pointer z-10 absolute right-[-0.75rem] top-[-0.75rem]",onClick:()=>{Ie(!1)},children:r.jsxRuntimeExports.jsx(Ot.X,{})}),r.jsxRuntimeExports.jsxs("div",{className:"color-legend-box p-2 bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)]",style:{width:te?void 0:"340px"},children:[me&&me!==""?r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxRuntimeExports.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:J}}),r.jsxRuntimeExports.jsx(St.j,{size:"xs",marginBottom:"none",className:"p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300",style:{display:"-webkit-box",WebkitLineClamp:"1",WebkitBoxOrient:"vertical"},children:me})]}),r.jsxRuntimeExports.jsx(zt.n,{size:"xl"}),r.jsxRuntimeExports.jsx(Bt,{}),r.jsxRuntimeExports.jsx(zt.n,{size:"xl"})]}):null,f&&f!==""?r.jsxRuntimeExports.jsx(St.j,{size:"xs",marginBottom:"xs",className:"p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300",style:{display:"-webkit-box",WebkitLineClamp:"1",WebkitBoxOrient:"vertical"},children:f}):null,te?r.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-3",children:n.map((o,a)=>r.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 items-center",onMouseOver:()=>{z(t[a%t.length])},onMouseLeave:()=>{z(void 0)},children:[r.jsxRuntimeExports.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:t[a%t.length]}}),r.jsxRuntimeExports.jsx(St.j,{size:"sm",marginBottom:"none",leading:"none",children:o})]},a))}):r.jsxRuntimeExports.jsx("svg",{width:"100%",viewBox:"0 0 320 30",direction:"ltr",children:r.jsxRuntimeExports.jsxs("g",{children:[n.map((o,a)=>r.jsxRuntimeExports.jsxs("g",{onMouseOver:()=>{z(t[a])},onMouseLeave:()=>{z(void 0)},className:"cursor-pointer",children:[r.jsxRuntimeExports.jsx("rect",{x:a*320/t.length+1,y:1,width:320/t.length-2,height:8,className:l===t[a]?"stroke-primary-gray-700 dark:stroke-primary-gray-300":"",style:{fill:t[a],...l===t[a]?{}:{stroke:t[a]}}}),r.jsxRuntimeExports.jsx("text",{x:(a+1)*320/t.length,y:25,className:"fill-primary-gray-700 dark:fill-primary-gray-300 text-xs",style:{textAnchor:"middle"},children:Qt.numberFormattingFunction(o,"NA")})]},a)),r.jsxRuntimeExports.jsx("g",{children:r.jsxRuntimeExports.jsx("rect",{onMouseOver:()=>{z(t[n.length])},onMouseLeave:()=>{z(void 0)},x:n.length*320/t.length+1,y:1,width:320/t.length-2,height:8,className:`cursor-pointer ${l===t[n.length]?"stroke-1 stroke-primary-gray-700 dark:stroke-primary-gray-300":""}`,style:{fill:t[n.length],...l===t[n.length]?{}:{stroke:t[n.length]}}})})]})})]})]}):r.jsxRuntimeExports.jsx("button",{type:"button",className:"mb-0 border-0 bg-transparent p-0 self-start map-legend-button",onClick:()=>{Ie(!0)},children:r.jsxRuntimeExports.jsx("div",{className:"show-color-legend-button items-start text-sm font-medium cursor-pointer p-2 mb-0 flex text-primary-black dark:text-primary-gray-300 bg-primary-gray-300 dark:bg-primary-gray-600 border-primary-gray-400 dark:border-primary-gray-500",children:"Show Legend"})})}),Y==="button"&&r.jsxRuntimeExports.jsxs("div",{className:"absolute left-4 top-4 flex flex-col zoom-buttons",children:[r.jsxRuntimeExports.jsx("button",{onClick:()=>ae("in"),className:"leading-0 px-2 py-3.5 text-primary-gray-700 border border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"+"}),r.jsxRuntimeExports.jsx("button",{onClick:()=>ae("out"),className:"leading-0 px-2 py-3.5 text-primary-gray-700 border border-t-0 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"–"})]})]}),H&&L!==void 0?r.jsxRuntimeExports.jsx(Yt.DetailsModal,{body:H,data:L,setData:N,className:X?.modal}):null,re&&E&&Pe&&ze?r.jsxRuntimeExports.jsx(Xt.Tooltip,{data:re,body:E,xPos:Pe,yPos:ze,backgroundStyle:R?.tooltip,className:X?.tooltip}):null]})}function xo(i){const e=r.compilerRuntimeExports.c(135),{data:t,mapData:g,graphTitle:f,colors:n,sources:y,graphDescription:v,height:s,width:x,footNote:k,mapColorLegendTitle:E,colorDomain:S,choroplethScaleType:ke,radius:Re,scale:Ce,centerPoint:G,padding:De,mapBorderWidth:We,mapNoDataColor:Ue,backgroundColor:Se,showLabels:I,mapBorderColor:Ne,tooltip:H,relativeHeight:R,onSeriesMouseOver:X,isWorldMap:ee,showColorScale:Y,zoomScaleExtend:j,zoomTranslateExtend:P,graphID:ce,highlightedDataPoints:de,onSeriesMouseClick:te,graphDownload:J,dataDownload:Oe,showAntarctica:oe,language:ue,minHeight:me,theme:Me,ariaLabel:qe,resetSelectionOnDoubleClick:K,detailsOnClick:pe,styles:u,classNames:l,mapProjection:z,zoomInteraction:Ge,animate:Ie,dimmedOpacity:xe,customLayers:L,maxRadiusValue:N,timeline:re,collapseColorScaleByDefault:O,dotColor:Pe,highlightedIds:C,mapProperty:ze,dotLegendTitle:M,dotBorderColor:V,labelColor:Z,projectionRotate:ie,rewindCoordinatesInMapData:_}=i,q=g===void 0?"https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-v2.json":g,$=k===void 0?"The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.":k,w=ke===void 0?"threshold":ke,Le=Re===void 0?5:Re,Ve=Ce===void 0?.95:Ce,_e=We===void 0?.5:We,$e=Ue===void 0?we.Colors.light.graphNoData:Ue,B=Se===void 0?!1:Se,Q=I===void 0?!1:I,he=Ne===void 0?we.Colors.light.grays["gray-500"]:Ne,ae=ee===void 0?!0:ee,o=Y===void 0?!0:Y;let a;e[0]!==j?(a=j===void 0?[.8,6]:j,e[0]=j,e[1]=a):a=e[1];const b=a;let D;e[2]!==de?(D=de===void 0?[]:de,e[2]=de,e[3]=D):D=e[3];const m=D,ge=J===void 0?!1:J,fe=Oe===void 0?!1:Oe,Be=oe===void 0?!1:oe,ut=ue===void 0?"en":ue,F=me===void 0?0:me,ne=Me===void 0?"light":Me,mt=K===void 0?!0:K,pt=z===void 0?"naturalEarth":z,xt=Ge===void 0?"button":Ge,He=Ie===void 0?!1:Ie,ht=xe===void 0?.3:xe;let Xe;e[4]!==L?(Xe=L===void 0?[]:L,e[4]=L,e[5]=Xe):Xe=e[5];const gt=Xe;let Ye;e[6]!==re?(Ye=re===void 0?{enabled:!1,autoplay:!1,showOnlyActiveDate:!0}:re,e[6]=re,e[7]=Ye):Ye=e[7];const c=Ye,ft=Pe===void 0?we.Colors.primaryColors["blue-600"]:Pe;let Je;e[8]!==C?(Je=C===void 0?[]:C,e[8]=C,e[9]=Je):Je=e[9];const yt=Je,vt=ze===void 0?"ISO3":ze,jt=Z===void 0?we.Colors.primaryColors["blue-600"]:Z;let Ke;e[10]!==ie?(Ke=ie===void 0?[0,0]:ie,e[10]=ie,e[11]=Ke):Ke=e[11];const bt=Ke,Et=_===void 0?!0:_,[se,Ft]=d.useState(0),[Fe,Tt]=d.useState(0),[T,At]=d.useState(c.autoplay);let Te;if(e[12]!==t||e[13]!==c.dateFormat){let h;e[15]!==c.dateFormat?(h=W=>qt.parse(`${W.date}`,c.dateFormat||"yyyy",new Date).getTime(),e[15]=c.dateFormat,e[16]=h):h=e[16],Te=[...new Set(t.filter(Ro).map(h))],Te.sort(ko),e[12]=t,e[13]=c.dateFormat,e[14]=Te}else Te=e[14];const p=Te,[A,wt]=d.useState(c.autoplay?0:p.length-1),[ye,Wt]=d.useState(void 0),kt=d.useRef(null),Mt=d.useRef(null);let Ze;e[17]!==w||e[18]!==S||e[19]!==n?.length||e[20]!==t?(Ze=S||(w==="categorical"?ao.getUniqValue(t,"x"):no.getJenks(t.map(wo),n?.length||4)),e[17]=w,e[18]=S,e[19]=n?.length,e[20]=t,e[21]=Ze):Ze=e[21];const Ae=Ze;let Qe,et;e[22]===Symbol.for("react.memo_cache_sentinel")?(Qe=()=>{const h=new ResizeObserver(W=>{Ft(W[0].target.clientWidth||620),Tt(W[0].target.clientHeight||480)});return kt.current&&h.observe(kt.current),()=>h.disconnect()},et=[],e[22]=Qe,e[23]=et):(Qe=e[22],et=e[23]),d.useEffect(Qe,et);let tt;e[24]===Symbol.for("react.memo_cache_sentinel")?(tt=h=>{Wt(h)},e[24]=tt):tt=e[24];const ot=d.useEffectEvent(tt);let rt;e[25]!==q||e[26]!==ot?(rt=()=>{typeof q=="string"?io.fetchAndParseJSON(q).then(W=>{ot(W)}):ot(q)},e[25]=q,e[26]=ot,e[27]=rt):rt=e[27];let it;e[28]!==q?(it=[q],e[28]=q,e[29]=it):it=e[29],d.useEffect(rt,it);let at,nt;e[30]!==T||e[31]!==c.speed||e[32]!==p?(at=()=>{const h=setInterval(()=>{wt(W=>W<p.length-1?W+1:0)},(c.speed||2)*1e3);return T||clearInterval(h),()=>clearInterval(h)},nt=[p,T,c.speed],e[30]=T,e[31]=c.speed,e[32]=p,e[33]=at,e[34]=nt):(at=e[33],nt=e[34]),d.useEffect(at,nt);const Rt=c.dateFormat||"yyyy";let st;e[35]!==A||e[36]!==Rt||e[37]!==c.showOnlyActiveDate||e[38]!==p?(st=It.getSliderMarks(p,A,c.showOnlyActiveDate,Rt),e[35]=A,e[36]=Rt,e[37]=c.showOnlyActiveDate,e[38]=p,e[39]=st):st=e[39];const lt=st,Ct=l?.graphContainer,Dt=u?.graphContainer;let ve;e[40]!==l?.description||e[41]!==l?.title||e[42]!==t||e[43]!==fe||e[44]!==v||e[45]!==ge||e[46]!==f||e[47]!==u?.description||e[48]!==u?.title||e[49]!==x?(ve=f||v||ge||fe?r.jsxRuntimeExports.jsx(ro.GraphHeader,{styles:{title:u?.title,description:u?.description},classNames:{title:l?.title,description:l?.description},graphTitle:f,graphDescription:v,width:x,graphDownload:ge?Mt:void 0,dataDownload:fe?t.map(Eo).filter(bo).length>0?t.map(jo).filter(vo):t.filter(yo):null}):null,e[40]=l?.description,e[41]=l?.title,e[42]=t,e[43]=fe,e[44]=v,e[45]=ge,e[46]=f,e[47]=u?.description,e[48]=u?.title,e[49]=x,e[50]=ve):ve=e[50];let je;e[51]!==A||e[52]!==lt||e[53]!==T||e[54]!==c.enabled||e[55]!==p?(je=c.enabled&&p.length>0&<?r.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[r.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{At(!T)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":T?"Click to pause animation":"Click to play animation",children:T?r.jsxRuntimeExports.jsx(Ot.Pause,{}):r.jsxRuntimeExports.jsx(Ot.Play,{})}),r.jsxRuntimeExports.jsx(It.Nr,{min:p[0],max:p[p.length-1],marks:lt,step:null,defaultValue:p[p.length-1],value:p[A],onChangeComplete:h=>{wt(p.indexOf(h))},onChange:h=>{wt(p.indexOf(h))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,e[51]=A,e[52]=lt,e[53]=T,e[54]=c.enabled,e[55]=p,e[56]=je):je=e[56];let be;e[57]!==He||e[58]!==G||e[59]!==w||e[60]!==l||e[61]!==O||e[62]!==n||e[63]!==gt||e[64]!==t||e[65]!==pe||e[66]!==ht||e[67]!==Ae||e[68]!==V||e[69]!==ft||e[70]!==M||e[71]!==s||e[72]!==m||e[73]!==yt||e[74]!==A||e[75]!==ae||e[76]!==jt||e[77]!==he||e[78]!==_e||e[79]!==E||e[80]!==$e||e[81]!==pt||e[82]!==vt||e[83]!==ye||e[84]!==N||e[85]!==F||e[86]!==te||e[87]!==X||e[88]!==bt||e[89]!==Le||e[90]!==R||e[91]!==mt||e[92]!==Et||e[93]!==Ve||e[94]!==Be||e[95]!==o||e[96]!==Q||e[97]!==u||e[98]!==Fe||e[99]!==se||e[100]!==ne||e[101]!==c.dateFormat||e[102]!==c.enabled||e[103]!==H||e[104]!==p||e[105]!==x||e[106]!==xt||e[107]!==b||e[108]!==P?(be=r.jsxRuntimeExports.jsx(Lt.GraphArea,{ref:kt,children:se&&Fe&&ye?r.jsxRuntimeExports.jsx(po,{dotColor:ft,data:t.filter(h=>c.enabled?h.date===qt.format(new Date(p[A]),c.dateFormat||"yyyy"):h),mapData:Be?ye:{...ye,features:ye.features.filter(fo)},colorDomain:Ae,width:se,height:Fe,scale:Ve,centerPoint:G,colors:n||(w==="categorical"?we.Colors[ne].sequentialColors[`neutralColorsx0${Ae.length}`]:we.Colors[ne].sequentialColors[`neutralColorsx0${Ae.length+1}`]),mapColorLegendTitle:E,radius:Le,categorical:w==="categorical",mapBorderWidth:_e,mapNoDataColor:$e,mapBorderColor:he,tooltip:H,onSeriesMouseOver:X,showLabels:Q,isWorldMap:ae,showColorScale:o,zoomScaleExtend:b,zoomTranslateExtend:P,onSeriesMouseClick:te,highlightedDataPoints:m,resetSelectionOnDoubleClick:mt,styles:u,classNames:l,zoomInteraction:xt,detailsOnClick:pe,mapProjection:pt||(ae?"naturalEarth":"mercator"),animate:He===!0?{duration:.5,once:!0,amount:.5}:He||{duration:0,once:!0,amount:0},dimmedOpacity:ht,customLayers:gt,maxRadiusValue:dt.checkIfNullOrUndefined(N)?Math.max(...t.map(go).filter(ho)):N,collapseColorScaleByDefault:O,highlightedIds:yt,mapProperty:vt,dotLegendTitle:M,dotBorderColor:V,labelColor:jt,projectionRotate:bt,rewindCoordinatesInMapData:Et}):r.jsxRuntimeExports.jsx("div",{style:{height:`${Math.max(F,s||(R?F?(x||se)*R>F?(x||se)*R:F:(x||se)*R:Fe))}px`},className:"flex items-center justify-center",children:r.jsxRuntimeExports.jsx(Ut.w,{"aria-label":"Loading graph"})})}),e[57]=He,e[58]=G,e[59]=w,e[60]=l,e[61]=O,e[62]=n,e[63]=gt,e[64]=t,e[65]=pe,e[66]=ht,e[67]=Ae,e[68]=V,e[69]=ft,e[70]=M,e[71]=s,e[72]=m,e[73]=yt,e[74]=A,e[75]=ae,e[76]=jt,e[77]=he,e[78]=_e,e[79]=E,e[80]=$e,e[81]=pt,e[82]=vt,e[83]=ye,e[84]=N,e[85]=F,e[86]=te,e[87]=X,e[88]=bt,e[89]=Le,e[90]=R,e[91]=mt,e[92]=Et,e[93]=Ve,e[94]=Be,e[95]=o,e[96]=Q,e[97]=u,e[98]=Fe,e[99]=se,e[100]=ne,e[101]=c.dateFormat,e[102]=c.enabled,e[103]=H,e[104]=p,e[105]=x,e[106]=xt,e[107]=b,e[108]=P,e[109]=be):be=e[109];let Ee;e[110]!==l?.footnote||e[111]!==l?.source||e[112]!==$||e[113]!==y||e[114]!==u?.footnote||e[115]!==u?.source||e[116]!==x?(Ee=y||$?r.jsxRuntimeExports.jsx(oo.GraphFooter,{styles:{footnote:u?.footnote,source:u?.source},classNames:{footnote:l?.footnote,source:l?.source},sources:y,footNote:$,width:x}):null,e[110]=l?.footnote,e[111]=l?.source,e[112]=$,e[113]=y,e[114]=u?.footnote,e[115]=u?.source,e[116]=x,e[117]=Ee):Ee=e[117];let ct;return e[118]!==qe||e[119]!==B||e[120]!==ce||e[121]!==s||e[122]!==ut||e[123]!==F||e[124]!==De||e[125]!==R||e[126]!==Ct||e[127]!==Dt||e[128]!==ve||e[129]!==je||e[130]!==be||e[131]!==Ee||e[132]!==ne||e[133]!==x?(ct=r.jsxRuntimeExports.jsxs(Lt.GraphContainer,{className:Ct,style:Dt,id:ce,ref:Mt,"aria-label":qe,backgroundColor:B,theme:ne,language:ut,minHeight:F,width:x,height:s,relativeHeight:R,padding:De,children:[ve,je,be,Ee]}),e[118]=qe,e[119]=B,e[120]=ce,e[121]=s,e[122]=ut,e[123]=F,e[124]=De,e[125]=R,e[126]=Ct,e[127]=Dt,e[128]=ve,e[129]=je,e[130]=be,e[131]=Ee,e[132]=ne,e[133]=x,e[134]=ct):ct=e[134],ct}function ho(i){return i!=null}function go(i){return i.radius}function fo(i){return i.properties.NAME!=="Antarctica"}function yo(i){return i!==void 0}function vo(i){return i!==void 0}function jo(i){return i.data}function bo(i){return i!==void 0}function Eo(i){return i.data}function wo(i){return i.x}function ko(i,e){return i-e}function Ro(i){return i.date}exports.HybridMap=xo;
|
|
2
2
|
//# sourceMappingURL=HybridMap.cjs.map
|
package/dist/HybridMap.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HybridMap.cjs","sources":["../node_modules/@undp/design-system-react/dist/Separator.js","../src/Components/Graphs/Maps/HybridMap/Graph.tsx","../src/Components/Graphs/Maps/HybridMap/index.tsx"],"sourcesContent":["import { j as v } from \"./jsx-runtime-BzflLqGi.js\";\nimport { c as N } from \"./compiler-runtime-Cu50tn6L.js\";\nimport * as R from \"react\";\nimport g from \"react\";\nimport { P as x } from \"./index-DE1ItLfl.js\";\nimport { c as O } from \"./utils-D_Pof5Gy.js\";\nvar h = \"Separator\", f = \"horizontal\", E = [\"horizontal\", \"vertical\"], y = R.forwardRef((i, s) => {\n const { decorative: r, orientation: a = f, ...o } = i, t = P(a) ? a : f, m = r ? { role: \"none\" } : { \"aria-orientation\": t === \"vertical\" ? t : void 0, role: \"separator\" };\n return /* @__PURE__ */ v.jsx(\n x.div,\n {\n \"data-orientation\": t,\n ...m,\n ...o,\n ref: s\n }\n );\n});\ny.displayName = h;\nfunction P(i) {\n return E.includes(i);\n}\nvar u = y;\nconst T = g.forwardRef((i, s) => {\n const r = N.c(14);\n let a, o, t, e;\n r[0] !== i ? ({\n className: a,\n variant: t,\n orientation: e,\n ...o\n } = i, r[0] = i, r[1] = a, r[2] = o, r[3] = t, r[4] = e) : (a = r[1], o = r[2], t = r[3], e = r[4]);\n const m = t === void 0 ? \"dark\" : t, l = e === void 0 ? \"horizontal\" : e, c = l === \"horizontal\" ? \"h-[1px] w-full\" : \"h-full w-[1px]\", d = m === \"dark\" ? \"bg-primary-gray-600 dark:bg-primary-gray-200\" : \"bg-primary-gray-400 dark:bg-primary-gray-550\";\n let n;\n r[5] !== a || r[6] !== c || r[7] !== d ? (n = O(c, d, a), r[5] = a, r[6] = c, r[7] = d, r[8] = n) : n = r[8];\n let p;\n return r[9] !== l || r[10] !== o || r[11] !== s || r[12] !== n ? (p = /* @__PURE__ */ v.jsx(u, { ...o, ref: s, orientation: l, className: n }), r[9] = l, r[10] = o, r[11] = s, r[12] = n, r[13] = p) : p = r[13], p;\n});\nT.displayName = u.displayName;\nexport {\n T as Separator\n};\n//# sourceMappingURL=Separator.js.map\n","import isEqual from 'fast-deep-equal';\r\nimport { useEffect, useMemo, useRef, useState } from 'react';\r\nimport {\r\n geoAlbersUsa,\r\n geoEqualEarth,\r\n geoMercator,\r\n geoNaturalEarth1,\r\n geoOrthographic,\r\n geoPath,\r\n} from 'd3-geo';\r\nimport { D3ZoomEvent, zoom, ZoomBehavior } from 'd3-zoom';\r\nimport { select } from 'd3-selection';\r\nimport { scaleOrdinal, scaleSqrt, scaleThreshold } from 'd3-scale';\r\nimport { P } from '@undp/design-system-react/Typography';\r\nimport bbox from '@turf/bbox';\r\nimport centerOfMass from '@turf/center-of-mass';\r\nimport { AnimatePresence, motion, useInView } from 'motion/react';\r\nimport { cn } from '@undp/design-system-react/cn';\r\nimport { Spacer } from '@undp/design-system-react/Spacer';\r\nimport { Separator } from '@undp/design-system-react/Separator';\r\nimport { FeatureCollection } from 'geojson';\r\nimport rewind from '@turf/rewind';\r\n\r\nimport {\r\n AnimateDataType,\r\n ClassNameObject,\r\n CustomLayerDataType,\r\n HybridMapDataType,\r\n MapProjectionTypes,\r\n StyleObject,\r\n ZoomInteractionTypes,\r\n} from '@/Types';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { X } from '@/Components/Icons';\r\nimport { checkIfNullOrUndefined, numberFormattingFunction } from '@/Utils';\r\nimport { DetailsModal } from '@/Components/Elements/DetailsModal';\r\n\r\ninterface Props {\r\n data: HybridMapDataType[];\r\n mapData: FeatureCollection;\r\n colorDomain: (string | number)[];\r\n width: number;\r\n height: number;\r\n scale: number;\r\n centerPoint?: [number, number];\r\n colors: string[];\r\n mapColorLegendTitle?: string;\r\n categorical: boolean;\r\n radius: number;\r\n mapBorderWidth: number;\r\n mapNoDataColor: string;\r\n showLabels: boolean;\r\n mapBorderColor: string;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n isWorldMap: boolean;\r\n showColorScale: boolean;\r\n zoomScaleExtend: [number, number];\r\n zoomTranslateExtend?: [[number, number], [number, number]];\r\n highlightedDataPoints: (string | number)[];\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n resetSelectionOnDoubleClick: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n zoomInteraction: ZoomInteractionTypes;\r\n mapProjection: MapProjectionTypes;\r\n animate: AnimateDataType;\r\n dimmedOpacity: number;\r\n customLayers: CustomLayerDataType[];\r\n maxRadiusValue: number;\r\n collapseColorScaleByDefault?: boolean;\r\n dotColor: string;\r\n highlightedIds: string[];\r\n mapProperty: string;\r\n dotLegendTitle?: string;\r\n dotBorderColor?: string;\r\n labelColor: string;\r\n projectionRotate: [number, number] | [number, number, number];\r\n rewindCoordinatesInMapData: boolean;\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n const {\r\n data,\r\n colors,\r\n mapData,\r\n mapColorLegendTitle,\r\n colorDomain,\r\n radius,\r\n height,\r\n width,\r\n scale,\r\n centerPoint,\r\n tooltip,\r\n showLabels,\r\n mapBorderWidth,\r\n mapBorderColor,\r\n mapNoDataColor,\r\n onSeriesMouseOver,\r\n showColorScale,\r\n zoomScaleExtend,\r\n zoomTranslateExtend,\r\n highlightedDataPoints,\r\n onSeriesMouseClick,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n mapProjection,\r\n zoomInteraction,\r\n animate,\r\n dimmedOpacity,\r\n customLayers,\r\n maxRadiusValue,\r\n categorical,\r\n dotColor,\r\n collapseColorScaleByDefault,\r\n highlightedIds,\r\n mapProperty,\r\n dotLegendTitle,\r\n dotBorderColor,\r\n labelColor,\r\n projectionRotate,\r\n rewindCoordinatesInMapData,\r\n } = props;\r\n const formattedMapData = useMemo(() => {\r\n if (!rewindCoordinatesInMapData) return mapData;\r\n\r\n return rewind(mapData, { reverse: true }) as FeatureCollection;\r\n }, [mapData, rewindCoordinatesInMapData]);\r\n const [selectedColor, setSelectedColor] = useState<string | undefined>(undefined);\r\n\r\n const [showLegend, setShowLegend] = useState(\r\n collapseColorScaleByDefault === undefined ? !(width < 680) : !collapseColorScaleByDefault,\r\n );\r\n const zoomRef = useRef<ZoomBehavior<SVGSVGElement, unknown> | null>(null);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseClickData, setMouseClickData] = useState<any>(undefined);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseOverData, setMouseOverData] = useState<any>(undefined);\r\n const [eventX, setEventX] = useState<number | undefined>(undefined);\r\n const [eventY, setEventY] = useState<number | undefined>(undefined);\r\n const mapSvg = useRef<SVGSVGElement>(null);\r\n const isInView = useInView(mapSvg, {\r\n once: animate.once,\r\n amount: animate.amount,\r\n });\r\n const mapG = useRef<SVGGElement>(null);\r\n const radiusScale =\r\n data.filter(d => d.radius === undefined || d.radius === null).length !== data.length\r\n ? scaleSqrt().domain([0, maxRadiusValue]).range([0.25, radius]).nice()\r\n : undefined;\r\n\r\n const colorScale = categorical\r\n ? scaleOrdinal<number | string, string>().domain(colorDomain).range(colors)\r\n : scaleThreshold<number, string>()\r\n .domain(colorDomain as number[])\r\n .range(colors);\r\n useEffect(() => {\r\n const mapGSelect = select(mapG.current);\r\n const mapSvgSelect = select(mapSvg.current);\r\n const zoomFilter = (e: D3ZoomEvent<SVGSVGElement, unknown>['sourceEvent']) => {\r\n if (zoomInteraction === 'noZoom') return false;\r\n if (zoomInteraction === 'button') return !e.type.includes('wheel');\r\n const isWheel = e.type === 'wheel';\r\n const isTouch = e.type.startsWith('touch');\r\n const isDrag = e.type === 'mousedown' || e.type === 'mousemove';\r\n\r\n if (isTouch) return true;\r\n if (isWheel) {\r\n if (zoomInteraction === 'scroll') return true;\r\n return e.ctrlKey;\r\n }\r\n return isDrag && !e.button && !e.ctrlKey;\r\n };\r\n const zoomBehavior = zoom<SVGSVGElement, unknown>()\r\n .scaleExtent(zoomScaleExtend)\r\n .translateExtent(\r\n zoomTranslateExtend || [\r\n [-20, -20],\r\n [width + 20, height + 20],\r\n ],\r\n )\r\n .filter(zoomFilter)\r\n .on('zoom', ({ transform }) => {\r\n mapGSelect.attr('transform', transform);\r\n });\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapSvgSelect.call(zoomBehavior as any);\r\n\r\n zoomRef.current = zoomBehavior;\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [height, width, zoomInteraction]);\r\n\r\n const bounds = bbox(formattedMapData);\r\n\r\n const center = centerOfMass(formattedMapData);\r\n const lonDiff = bounds[2] - bounds[0];\r\n const latDiff = bounds[3] - bounds[1];\r\n const scaleX = (((width * 190) / 960) * 360) / lonDiff;\r\n const scaleY = (((height * 190) / 678) * 180) / latDiff;\r\n const scaleVar = scale * Math.min(scaleX, scaleY);\r\n\r\n const projection =\r\n mapProjection === 'mercator'\r\n ? geoMercator()\r\n .rotate(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'equalEarth'\r\n ? geoEqualEarth()\r\n .rotate(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'naturalEarth'\r\n ? geoNaturalEarth1()\r\n .rotate(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'orthographic'\r\n ? geoOrthographic()\r\n .rotate(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : geoAlbersUsa()\r\n .rotate(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar);\r\n const pathGenerator = geoPath().projection(projection);\r\n const handleZoom = (direction: 'in' | 'out') => {\r\n if (!mapSvg.current || !zoomRef.current) return;\r\n const svg = select(mapSvg.current);\r\n svg.call(zoomRef.current.scaleBy, direction === 'in' ? 1.2 : 1 / 1.2);\r\n };\r\n return (\r\n <>\r\n <div className='relative'>\r\n <motion.svg\r\n width={`${width}px`}\r\n height={`${height}px`}\r\n viewBox={`0 0 ${width} ${height}`}\r\n ref={mapSvg}\r\n direction='ltr'\r\n >\r\n <g ref={mapG}>\r\n {customLayers.filter(d => d.position === 'before').map(d => d.layer)}\r\n {formattedMapData.features.map((d, i: number) => {\r\n if (!d.properties?.[mapProperty]) return null;\r\n const path = pathGenerator(d);\r\n if (!path) return null;\r\n return (\r\n <motion.g\r\n key={i}\r\n opacity={\r\n selectedColor\r\n ? dimmedOpacity\r\n : highlightedIds.length !== 0\r\n ? highlightedIds.indexOf(d.properties[mapProperty]) !== -1\r\n ? 1\r\n : dimmedOpacity\r\n : 1\r\n }\r\n >\r\n <path\r\n d={path}\r\n style={{\r\n stroke: mapBorderColor,\r\n strokeWidth: mapBorderWidth,\r\n fill: mapNoDataColor,\r\n }}\r\n />\r\n </motion.g>\r\n );\r\n })}\r\n <AnimatePresence>\r\n {data\r\n .filter(d => d.id)\r\n .map(d => {\r\n const index = formattedMapData.features.findIndex(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any) => d.id === el.properties[mapProperty],\r\n );\r\n if (index === -1) return null;\r\n const path = pathGenerator(formattedMapData.features[index]);\r\n if (!path) return null;\r\n const color = !checkIfNullOrUndefined(d.x)\r\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n colorScale(d.x as any)\r\n : mapNoDataColor;\r\n return (\r\n <motion.g\r\n key={d.id}\r\n variants={{\r\n initial: { opacity: 0 },\r\n whileInView: {\r\n opacity: selectedColor\r\n ? selectedColor === color\r\n ? 1\r\n : dimmedOpacity\r\n : highlightedIds.length !== 0\r\n ? highlightedIds.indexOf(d.id as string) !== -1\r\n ? 1\r\n : dimmedOpacity\r\n : 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n onMouseEnter={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n onSeriesMouseOver?.(d);\r\n }}\r\n onMouseMove={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n }}\r\n onMouseLeave={() => {\r\n setMouseOverData(undefined);\r\n setEventX(undefined);\r\n setEventY(undefined);\r\n onSeriesMouseOver?.(undefined);\r\n }}\r\n onClick={() => {\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (isEqual(mouseClickData, d) && resetSelectionOnDoubleClick) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(d);\r\n onSeriesMouseClick?.(d);\r\n }\r\n }\r\n }}\r\n >\r\n <motion.path\r\n key={`${d.id}`}\r\n d={path}\r\n variants={{\r\n initial: { fill: color, opacity: 0 },\r\n whileInView: {\r\n fill: color,\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{\r\n opacity: 0,\r\n transition: { duration: animate.duration },\r\n }}\r\n style={{\r\n stroke: mapBorderColor,\r\n strokeWidth: mapBorderWidth,\r\n }}\r\n />\r\n </motion.g>\r\n );\r\n })}\r\n {data\r\n .filter(d => !checkIfNullOrUndefined(d.lat) && !checkIfNullOrUndefined(d.long))\r\n .map(d => {\r\n return (\r\n <motion.g\r\n key={d.label || `${d.lat}-${d.long}`}\r\n variants={{\r\n initial: { opacity: 0 },\r\n whileInView: {\r\n opacity:\r\n highlightedDataPoints.length !== 0\r\n ? highlightedDataPoints.indexOf(d.label || '') !== -1\r\n ? 1\r\n : dimmedOpacity\r\n : 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n onMouseEnter={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n onSeriesMouseOver?.(d);\r\n }}\r\n onMouseMove={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n }}\r\n onMouseLeave={() => {\r\n setMouseOverData(undefined);\r\n setEventX(undefined);\r\n setEventY(undefined);\r\n onSeriesMouseOver?.(undefined);\r\n }}\r\n onClick={() => {\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (isEqual(mouseClickData, d) && resetSelectionOnDoubleClick) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(d);\r\n onSeriesMouseClick?.(d);\r\n }\r\n }\r\n }}\r\n transform={`translate(${\r\n (projection([d.long as number, d.lat as number]) as [number, number])[0]\r\n },${(projection([d.long as number, d.lat as number]) as [number, number])[1]})`}\r\n >\r\n <motion.circle\r\n cx={0}\r\n cy={0}\r\n variants={{\r\n initial: {\r\n r: 0,\r\n fill: dotColor,\r\n stroke: dotBorderColor || dotColor,\r\n },\r\n whileInView: {\r\n r: !radiusScale ? radius : radiusScale(d.radius || 0),\r\n fill: dotColor,\r\n stroke: dotBorderColor || dotColor,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ r: 0, transition: { duration: animate.duration } }}\r\n style={{\r\n fillOpacity: 0.8,\r\n }}\r\n />\r\n {showLabels && d.label ? (\r\n <motion.text\r\n variants={{\r\n initial: {\r\n opacity: 0,\r\n x: !radiusScale ? radius : radiusScale(d.radius || 0),\r\n },\r\n whileInView: {\r\n opacity: 1,\r\n x: !radiusScale ? radius : radiusScale(d.radius || 0),\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n y={0}\r\n className={cn('text-sm', classNames?.graphObjectValues)}\r\n style={{\r\n textAnchor: 'start',\r\n fill: labelColor || '#000',\r\n ...(styles?.graphObjectValues || {}),\r\n }}\r\n dx={4}\r\n dy={5}\r\n >\r\n {d.label}\r\n </motion.text>\r\n ) : null}\r\n </motion.g>\r\n );\r\n })}\r\n </AnimatePresence>\r\n {customLayers.filter(d => d.position === 'after').map(d => d.layer)}\r\n </g>\r\n </motion.svg>\r\n {showColorScale === false ? null : (\r\n <div className={cn('absolute left-4 bottom-4 map-color-legend', classNames?.colorLegend)}>\r\n {showLegend ? (\r\n <>\r\n <div\r\n className='color-legend-close-button bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)] border border-[var(--gray-400)] rounded-full w-6 h-6 p-[3px] cursor-pointer z-10 absolute right-[-0.75rem] top-[-0.75rem]'\r\n onClick={() => {\r\n setShowLegend(false);\r\n }}\r\n >\r\n <X />\r\n </div>\r\n <div\r\n className='color-legend-box p-2 bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)]'\r\n style={{\r\n width: categorical ? undefined : '340px',\r\n }}\r\n >\r\n {dotLegendTitle && dotLegendTitle !== '' ? (\r\n <>\r\n <div className='flex items-center gap-2'>\r\n <div\r\n className='w-3 h-3 rounded-full'\r\n style={{ backgroundColor: dotColor }}\r\n />\r\n <P\r\n size='xs'\r\n marginBottom='none'\r\n className='p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300'\r\n style={{\r\n display: '-webkit-box',\r\n WebkitLineClamp: '1',\r\n WebkitBoxOrient: 'vertical',\r\n }}\r\n >\r\n {dotLegendTitle}\r\n </P>\r\n </div>\r\n <Spacer size='xl' />\r\n <Separator />\r\n <Spacer size='xl' />\r\n </>\r\n ) : null}\r\n {mapColorLegendTitle && mapColorLegendTitle !== '' ? (\r\n <P\r\n size='xs'\r\n marginBottom='xs'\r\n className='p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300'\r\n style={{\r\n display: '-webkit-box',\r\n WebkitLineClamp: '1',\r\n WebkitBoxOrient: 'vertical',\r\n }}\r\n >\r\n {mapColorLegendTitle}\r\n </P>\r\n ) : null}\r\n {!categorical ? (\r\n <svg width='100%' viewBox='0 0 320 30' direction='ltr'>\r\n <g>\r\n {colorDomain.map((d, i) => (\r\n <g\r\n key={i}\r\n onMouseOver={() => {\r\n setSelectedColor(colors[i]);\r\n }}\r\n onMouseLeave={() => {\r\n setSelectedColor(undefined);\r\n }}\r\n className='cursor-pointer'\r\n >\r\n <rect\r\n x={(i * 320) / colors.length + 1}\r\n y={1}\r\n width={320 / colors.length - 2}\r\n height={8}\r\n className={\r\n selectedColor === colors[i]\r\n ? 'stroke-primary-gray-700 dark:stroke-primary-gray-300'\r\n : ''\r\n }\r\n style={{\r\n fill: colors[i],\r\n ...(selectedColor === colors[i] ? {} : { stroke: colors[i] }),\r\n }}\r\n />\r\n <text\r\n x={((i + 1) * 320) / colors.length}\r\n y={25}\r\n className='fill-primary-gray-700 dark:fill-primary-gray-300 text-xs'\r\n style={{ textAnchor: 'middle' }}\r\n >\r\n {numberFormattingFunction(d as number, 'NA')}\r\n </text>\r\n </g>\r\n ))}\r\n <g>\r\n <rect\r\n onMouseOver={() => {\r\n setSelectedColor(colors[colorDomain.length]);\r\n }}\r\n onMouseLeave={() => {\r\n setSelectedColor(undefined);\r\n }}\r\n x={(colorDomain.length * 320) / colors.length + 1}\r\n y={1}\r\n width={320 / colors.length - 2}\r\n height={8}\r\n className={`cursor-pointer ${\r\n selectedColor === colors[colorDomain.length]\r\n ? 'stroke-1 stroke-primary-gray-700 dark:stroke-primary-gray-300'\r\n : ''\r\n }`}\r\n style={{\r\n fill: colors[colorDomain.length],\r\n ...(selectedColor === colors[colorDomain.length]\r\n ? {}\r\n : { stroke: colors[colorDomain.length] }),\r\n }}\r\n />\r\n </g>\r\n </g>\r\n </svg>\r\n ) : (\r\n <div className='flex flex-col gap-3'>\r\n {colorDomain.map((d, i) => (\r\n <div\r\n key={i}\r\n className='flex gap-2 items-center'\r\n onMouseOver={() => {\r\n setSelectedColor(colors[i % colors.length]);\r\n }}\r\n onMouseLeave={() => {\r\n setSelectedColor(undefined);\r\n }}\r\n >\r\n <div\r\n className='w-2 h-2 rounded-full'\r\n style={{ backgroundColor: colors[i % colors.length] }}\r\n />\r\n <P size='sm' marginBottom='none' leading='none'>\r\n {d}\r\n </P>\r\n </div>\r\n ))}\r\n </div>\r\n )}\r\n </div>\r\n </>\r\n ) : (\r\n <button\r\n type='button'\r\n className='mb-0 border-0 bg-transparent p-0 self-start map-legend-button'\r\n onClick={() => {\r\n setShowLegend(true);\r\n }}\r\n >\r\n <div className='show-color-legend-button items-start text-sm font-medium cursor-pointer p-2 mb-0 flex text-primary-black dark:text-primary-gray-300 bg-primary-gray-300 dark:bg-primary-gray-600 border-primary-gray-400 dark:border-primary-gray-500'>\r\n Show Legend\r\n </div>\r\n </button>\r\n )}\r\n </div>\r\n )}\r\n {zoomInteraction === 'button' && (\r\n <div className='absolute left-4 top-4 flex flex-col zoom-buttons'>\r\n <button\r\n onClick={() => handleZoom('in')}\r\n className='leading-0 px-2 py-3.5 text-primary-gray-700 border border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100'\r\n >\r\n +\r\n </button>\r\n <button\r\n onClick={() => handleZoom('out')}\r\n className='leading-0 px-2 py-3.5 text-primary-gray-700 border border-t-0 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100'\r\n >\r\n –\r\n </button>\r\n </div>\r\n )}\r\n </div>\r\n {detailsOnClick && mouseClickData !== undefined ? (\r\n <DetailsModal\r\n body={detailsOnClick}\r\n data={mouseClickData}\r\n setData={setMouseClickData}\r\n className={classNames?.modal}\r\n />\r\n ) : null}\r\n {mouseOverData && tooltip && eventX && eventY ? (\r\n <Tooltip\r\n data={mouseOverData}\r\n body={tooltip}\r\n xPos={eventX}\r\n yPos={eventY}\r\n backgroundStyle={styles?.tooltip}\r\n className={classNames?.tooltip}\r\n />\r\n ) : null}\r\n </>\r\n );\r\n}\r\n","import { useState, useRef, useEffect, useEffectEvent, useMemo } from 'react';\r\nimport { format } from 'date-fns/format';\r\nimport { parse } from 'date-fns/parse';\r\nimport { SliderUI } from '@undp/design-system-react/SliderUI';\r\nimport { Spinner } from '@undp/design-system-react/Spinner';\r\nimport { FeatureCollection } from 'geojson';\r\n\r\nimport { Graph } from './Graph';\r\n\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport {\r\n HybridMapDataType,\r\n Languages,\r\n SourcesDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n ZoomInteractionTypes,\r\n MapProjectionTypes,\r\n CustomLayerDataType,\r\n AnimateDataType,\r\n TimelineDataType,\r\n ScaleDataType,\r\n} from '@/Types';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { fetchAndParseJSON } from '@/Utils/fetchAndParseData';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { Pause, Play } from '@/Components/Icons';\r\nimport { getSliderMarks } from '@/Utils/getSliderMarks';\r\nimport { GraphArea, GraphContainer } from '@/Components/Elements/GraphContainer';\r\nimport { getJenks, getUniqValue } from '@/Utils';\r\n\r\ninterface Props {\r\n // Data\r\n /** Array of data objects for dot density map*/\r\n data: HybridMapDataType[];\r\n // Titles, Labels, and Sources\r\n /** Title of the graph */\r\n graphTitle?: string | React.ReactNode;\r\n /** Description of the graph */\r\n graphDescription?: string | React.ReactNode;\r\n /** Footnote for the graph */\r\n footNote?: string | React.ReactNode;\r\n /** Source data for the graph */\r\n sources?: SourcesDataType[];\r\n /** Accessibility label */\r\n ariaLabel?: string;\r\n\r\n // Colors and Styling\r\n /** Color or array of colors for the circle */\r\n colors?: string[];\r\n /** Domain of colors for the graph for the choropleth map */\r\n colorDomain?: number[] | string[];\r\n /** Title for the legend for the dot density scale */\r\n dotLegendTitle?: string;\r\n /** Title for the color legend for the color scale */\r\n mapColorLegendTitle?: string;\r\n /** Color for the areas where data is no available */\r\n mapNoDataColor?: string;\r\n /** Background color of the graph */\r\n backgroundColor?: string | boolean;\r\n /** Custom styles for the graph. Each object should be a valid React CSS style object. */\r\n styles?: StyleObject;\r\n /** Custom class names */\r\n classNames?: ClassNameObject;\r\n\r\n // Size and Spacing\r\n /** Width of the graph */\r\n width?: number;\r\n /** Height of the graph */\r\n height?: number;\r\n /** Minimum height of the graph */\r\n minHeight?: number;\r\n /** Relative height scaling factor. This overwrites the height props */\r\n relativeHeight?: number;\r\n /** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */\r\n padding?: string;\r\n\r\n // Graph Parameters\r\n /** Maximum radius of the circle */\r\n radius?: number;\r\n /** Map data as an object in geoJson format or a url for geoJson */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapData?: any;\r\n /** Defines if the coordinates in the map data should be rewinded or not. Try to change this is the visualization shows countries as holes instead of shapes. */\r\n rewindCoordinatesInMapData?: boolean;\r\n /** Scaling factor for the map. Multiplies the scale number to scale. */\r\n scale?: number;\r\n /** Center point of the map */\r\n centerPoint?: [number, number];\r\n /** Controls the rotation of the map projection, in degrees, applied before rendering. Useful for shifting the antimeridian to focus the map on different regions */\r\n projectionRotate?: [number, number] | [number, number, number];\r\n /** Defines the zoom mode for the map */\r\n zoomInteraction?: ZoomInteractionTypes;\r\n /** Stroke width of the regions in the map */\r\n mapBorderWidth?: number;\r\n /** Stroke color of the regions in the map */\r\n mapBorderColor?: string;\r\n /** Color of the dots in the dot density map */\r\n dotColor?: string;\r\n /** Border color of the dots in the dot density map */\r\n dotBorderColor?: string;\r\n /** Color of the labels */\r\n labelColor?: string;\r\n /** Toggle if the map is a world map */\r\n isWorldMap?: boolean;\r\n /** Scale for the colors of the choropleth map */\r\n choroplethScaleType?: Exclude<ScaleDataType, 'linear'>;\r\n /** Map projection type */\r\n mapProjection?: MapProjectionTypes;\r\n /** Extend of the allowed zoom in the map */\r\n zoomScaleExtend?: [number, number];\r\n /** Extend of the allowed panning in the map */\r\n zoomTranslateExtend?: [[number, number], [number, number]];\r\n /** Toggle visibility of labels */\r\n showLabels?: boolean;\r\n /** Maximum value mapped to the radius chart */\r\n maxRadiusValue?: number;\r\n /** Countries or regions to be highlighted */\r\n highlightedIds?: string[];\r\n /** Data points to highlight. Use the label value from data to highlight the data point */\r\n highlightedDataPoints?: (string | number)[];\r\n /** Defines the opacity of the non-highlighted data */\r\n dimmedOpacity?: number;\r\n /** Toggles if the graph animates in when loaded. */\r\n animate?: boolean | AnimateDataType;\r\n /** Toggle visibility of color scale. This is only applicable if the data props hae color parameter */\r\n showColorScale?: boolean;\r\n /** Toggle if color scale is collapsed by default. */\r\n collapseColorScaleByDefault?: boolean;\r\n /** Toggles the visibility of Antarctica in the default map. Only applicable for the default map. */\r\n showAntarctica?: boolean;\r\n /** Optional SVG <g> element or function that renders custom content behind or in front of the graph. */\r\n customLayers?: CustomLayerDataType[];\r\n /** Property in the property object in mapData geoJson object is used to match to the id in the data object */\r\n mapProperty?: string;\r\n /** Configures playback and slider controls for animating the chart over time. The data must have a key date for it to work properly. */\r\n timeline?: TimelineDataType;\r\n /** Enable graph download option as png */\r\n graphDownload?: boolean;\r\n /** Enable data download option as a csv */\r\n dataDownload?: boolean;\r\n /** Reset selection on double-click. Only applicable when used in a dashboard context with filters. */\r\n resetSelectionOnDoubleClick?: boolean;\r\n\r\n // Interactions and Callbacks\r\n /** Tooltip content. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n /** Details displayed on the modal when user clicks of a data point. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n /** Callback for mouse over event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n /** Callback for mouse click event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n\r\n // Configuration and Options\r\n /** Language setting */\r\n language?: Languages;\r\n /** Color theme */\r\n theme?: 'light' | 'dark';\r\n /** Unique ID for the graph */\r\n graphID?: string;\r\n}\r\n\r\nexport function HybridMap(props: Props) {\r\n const {\r\n data,\r\n mapData = 'https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-v2.json',\r\n graphTitle,\r\n colors,\r\n sources,\r\n graphDescription,\r\n height,\r\n width,\r\n footNote = 'The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.',\r\n mapColorLegendTitle,\r\n colorDomain,\r\n choroplethScaleType = 'threshold',\r\n radius = 5,\r\n scale = 0.95,\r\n centerPoint,\r\n padding,\r\n mapBorderWidth = 0.5,\r\n mapNoDataColor = Colors.light.graphNoData,\r\n backgroundColor = false,\r\n showLabels = false,\r\n mapBorderColor = Colors.light.grays['gray-500'],\r\n tooltip,\r\n relativeHeight,\r\n onSeriesMouseOver,\r\n isWorldMap = true,\r\n showColorScale = true,\r\n zoomScaleExtend = [0.8, 6],\r\n zoomTranslateExtend,\r\n graphID,\r\n highlightedDataPoints = [],\r\n onSeriesMouseClick,\r\n graphDownload = false,\r\n dataDownload = false,\r\n showAntarctica = false,\r\n language = 'en',\r\n minHeight = 0,\r\n theme = 'light',\r\n ariaLabel,\r\n resetSelectionOnDoubleClick = true,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n mapProjection = 'naturalEarth',\r\n zoomInteraction = 'button',\r\n animate = false,\r\n dimmedOpacity = 0.3,\r\n customLayers = [],\r\n maxRadiusValue,\r\n timeline = { enabled: false, autoplay: false, showOnlyActiveDate: true },\r\n collapseColorScaleByDefault,\r\n dotColor = Colors.primaryColors['blue-600'],\r\n highlightedIds = [],\r\n mapProperty = 'ISO3',\r\n dotLegendTitle,\r\n dotBorderColor,\r\n labelColor = Colors.primaryColors['blue-600'],\r\n projectionRotate = [0, 0],\r\n rewindCoordinatesInMapData = true,\r\n } = props;\r\n\r\n const [svgWidth, setSvgWidth] = useState(0);\r\n const [svgHeight, setSvgHeight] = useState(0);\r\n const [play, setPlay] = useState(timeline.autoplay);\r\n const uniqDatesSorted = useMemo(() => {\r\n const dates = [\r\n ...new Set(\r\n data\r\n .filter(d => d.date)\r\n .map(d => parse(`${d.date}`, timeline.dateFormat || 'yyyy', new Date()).getTime()),\r\n ),\r\n ];\r\n dates.sort((a, b) => a - b);\r\n return dates;\r\n }, [data, timeline.dateFormat]);\r\n const [index, setIndex] = useState(timeline.autoplay ? 0 : uniqDatesSorted.length - 1);\r\n\r\n const [mapShape, setMapShape] = useState<FeatureCollection | undefined>(undefined);\r\n\r\n const graphDiv = useRef<HTMLDivElement>(null);\r\n const graphParentDiv = useRef<HTMLDivElement>(null);\r\n const domain =\r\n colorDomain ||\r\n (choroplethScaleType === 'categorical'\r\n ? getUniqValue(data, 'x')\r\n : getJenks(\r\n data.map(d => d.x as number | null | undefined),\r\n colors?.length || 4,\r\n ));\r\n useEffect(() => {\r\n const resizeObserver = new ResizeObserver(entries => {\r\n setSvgWidth(entries[0].target.clientWidth || 620);\r\n setSvgHeight(entries[0].target.clientHeight || 480);\r\n });\r\n if (graphDiv.current) {\r\n resizeObserver.observe(graphDiv.current);\r\n }\r\n return () => resizeObserver.disconnect();\r\n }, []);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const onUpdateShape = useEffectEvent((shape: any) => {\r\n setMapShape(shape);\r\n });\r\n useEffect(() => {\r\n if (typeof mapData === 'string') {\r\n const fetchData = fetchAndParseJSON(mapData);\r\n fetchData.then(d => {\r\n onUpdateShape(d as FeatureCollection);\r\n });\r\n } else {\r\n onUpdateShape(mapData);\r\n }\r\n }, [mapData]);\r\n\r\n useEffect(() => {\r\n const interval = setInterval(\r\n () => {\r\n setIndex(i => (i < uniqDatesSorted.length - 1 ? i + 1 : 0));\r\n },\r\n (timeline.speed || 2) * 1000,\r\n );\r\n if (!play) clearInterval(interval);\r\n return () => clearInterval(interval);\r\n }, [uniqDatesSorted, play, timeline.speed]);\r\n\r\n const markObj = getSliderMarks(\r\n uniqDatesSorted,\r\n index,\r\n timeline.showOnlyActiveDate,\r\n timeline.dateFormat || 'yyyy',\r\n );\r\n return (\r\n <GraphContainer\r\n className={classNames?.graphContainer}\r\n style={styles?.graphContainer}\r\n id={graphID}\r\n ref={graphParentDiv}\r\n aria-label={ariaLabel}\r\n backgroundColor={backgroundColor}\r\n theme={theme}\r\n language={language}\r\n minHeight={minHeight}\r\n width={width}\r\n height={height}\r\n relativeHeight={relativeHeight}\r\n padding={padding}\r\n >\r\n {graphTitle || graphDescription || graphDownload || dataDownload ? (\r\n <GraphHeader\r\n styles={{\r\n title: styles?.title,\r\n description: styles?.description,\r\n }}\r\n classNames={{\r\n title: classNames?.title,\r\n description: classNames?.description,\r\n }}\r\n graphTitle={graphTitle}\r\n graphDescription={graphDescription}\r\n width={width}\r\n graphDownload={graphDownload ? graphParentDiv : undefined}\r\n dataDownload={\r\n dataDownload\r\n ? data.map(d => d.data).filter(d => d !== undefined).length > 0\r\n ? data.map(d => d.data).filter(d => d !== undefined)\r\n : data.filter(d => d !== undefined)\r\n : null\r\n }\r\n />\r\n ) : null}\r\n {timeline.enabled && uniqDatesSorted.length > 0 && markObj ? (\r\n <div className='flex gap-6 items-center' dir='ltr'>\r\n <button\r\n type='button'\r\n onClick={() => {\r\n setPlay(!play);\r\n }}\r\n className='p-0 border-0 cursor-pointer bg-transparent'\r\n aria-label={play ? 'Click to pause animation' : 'Click to play animation'}\r\n >\r\n {play ? <Pause /> : <Play />}\r\n </button>\r\n <SliderUI\r\n min={uniqDatesSorted[0]}\r\n max={uniqDatesSorted[uniqDatesSorted.length - 1]}\r\n marks={markObj}\r\n step={null}\r\n defaultValue={uniqDatesSorted[uniqDatesSorted.length - 1]}\r\n value={uniqDatesSorted[index]}\r\n onChangeComplete={nextValue => {\r\n setIndex(uniqDatesSorted.indexOf(nextValue as number));\r\n }}\r\n onChange={nextValue => {\r\n setIndex(uniqDatesSorted.indexOf(nextValue as number));\r\n }}\r\n aria-label='Time slider. Use arrow keys to adjust selected time period.'\r\n />\r\n </div>\r\n ) : null}\r\n <GraphArea ref={graphDiv}>\r\n {svgWidth && svgHeight && mapShape ? (\r\n <Graph\r\n dotColor={dotColor}\r\n data={data.filter(d =>\r\n timeline.enabled\r\n ? d.date === format(new Date(uniqDatesSorted[index]), timeline.dateFormat || 'yyyy')\r\n : d,\r\n )}\r\n mapData={\r\n showAntarctica\r\n ? mapShape\r\n : {\r\n ...mapShape,\r\n features: mapShape.features.filter(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any) => el.properties.NAME !== 'Antarctica',\r\n ),\r\n }\r\n }\r\n colorDomain={domain}\r\n width={svgWidth}\r\n height={svgHeight}\r\n scale={scale}\r\n centerPoint={centerPoint}\r\n colors={\r\n colors ||\r\n (choroplethScaleType === 'categorical'\r\n ? Colors[theme].sequentialColors[\r\n `neutralColorsx0${domain.length as 4 | 5 | 6 | 7 | 8 | 9}`\r\n ]\r\n : Colors[theme].sequentialColors[\r\n `neutralColorsx0${(domain.length + 1) as 4 | 5 | 6 | 7 | 8 | 9}`\r\n ])\r\n }\r\n mapColorLegendTitle={mapColorLegendTitle}\r\n radius={radius}\r\n categorical={choroplethScaleType === 'categorical'}\r\n mapBorderWidth={mapBorderWidth}\r\n mapNoDataColor={mapNoDataColor}\r\n mapBorderColor={mapBorderColor}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n showLabels={showLabels}\r\n isWorldMap={isWorldMap}\r\n showColorScale={showColorScale}\r\n zoomScaleExtend={zoomScaleExtend}\r\n zoomTranslateExtend={zoomTranslateExtend}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n highlightedDataPoints={highlightedDataPoints}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n styles={styles}\r\n classNames={classNames}\r\n zoomInteraction={zoomInteraction}\r\n detailsOnClick={detailsOnClick}\r\n mapProjection={mapProjection || (isWorldMap ? 'naturalEarth' : 'mercator')}\r\n animate={\r\n animate === true\r\n ? { duration: 0.5, once: true, amount: 0.5 }\r\n : animate || { duration: 0, once: true, amount: 0 }\r\n }\r\n dimmedOpacity={dimmedOpacity}\r\n customLayers={customLayers}\r\n maxRadiusValue={\r\n !checkIfNullOrUndefined(maxRadiusValue)\r\n ? (maxRadiusValue as number)\r\n : Math.max(...data.map(d => d.radius).filter(d => d !== undefined && d !== null))\r\n }\r\n collapseColorScaleByDefault={collapseColorScaleByDefault}\r\n highlightedIds={highlightedIds}\r\n mapProperty={mapProperty}\r\n dotLegendTitle={dotLegendTitle}\r\n dotBorderColor={dotBorderColor}\r\n labelColor={labelColor}\r\n projectionRotate={projectionRotate}\r\n rewindCoordinatesInMapData={rewindCoordinatesInMapData}\r\n />\r\n ) : (\r\n <div\r\n style={{\r\n height: `${Math.max(\r\n minHeight,\r\n height ||\r\n (relativeHeight\r\n ? minHeight\r\n ? (width || svgWidth) * relativeHeight > minHeight\r\n ? (width || svgWidth) * relativeHeight\r\n : minHeight\r\n : (width || svgWidth) * relativeHeight\r\n : svgHeight),\r\n )}px`,\r\n }}\r\n className='flex items-center justify-center'\r\n >\r\n <Spinner aria-label='Loading graph' />\r\n </div>\r\n )}\r\n </GraphArea>\r\n {sources || footNote ? (\r\n <GraphFooter\r\n styles={{ footnote: styles?.footnote, source: styles?.source }}\r\n classNames={{\r\n footnote: classNames?.footnote,\r\n source: classNames?.source,\r\n }}\r\n sources={sources}\r\n footNote={footNote}\r\n width={width}\r\n />\r\n ) : null}\r\n </GraphContainer>\r\n );\r\n}\r\n"],"names":["h","f","E","y","R","s","r","a","o","t","P","m","v","x","u","T","g","N","e","l","c","d","n","O","p","Graph","props","data","colors","mapData","mapColorLegendTitle","colorDomain","radius","height","width","scale","centerPoint","tooltip","showLabels","mapBorderWidth","mapBorderColor","mapNoDataColor","onSeriesMouseOver","showColorScale","zoomScaleExtend","zoomTranslateExtend","highlightedDataPoints","onSeriesMouseClick","resetSelectionOnDoubleClick","detailsOnClick","styles","classNames","mapProjection","zoomInteraction","animate","dimmedOpacity","customLayers","maxRadiusValue","categorical","dotColor","collapseColorScaleByDefault","highlightedIds","mapProperty","dotLegendTitle","dotBorderColor","labelColor","projectionRotate","rewindCoordinatesInMapData","formattedMapData","useMemo","rewind","reverse","selectedColor","setSelectedColor","useState","undefined","showLegend","setShowLegend","zoomRef","useRef","mouseClickData","setMouseClickData","mouseOverData","setMouseOverData","eventX","setEventX","eventY","setEventY","mapSvg","isInView","useInView","once","amount","mapG","radiusScale","filter","length","scaleSqrt","domain","range","nice","colorScale","scaleOrdinal","scaleThreshold","useEffect","mapGSelect","select","current","mapSvgSelect","zoomFilter","type","includes","isWheel","isTouch","startsWith","isDrag","ctrlKey","button","zoomBehavior","zoom","scaleExtent","translateExtent","on","transform","attr","call","bounds","bbox","center","centerOfMass","lonDiff","latDiff","scaleX","scaleY","scaleVar","Math","min","projection","geoMercator","rotate","geometry","coordinates","translate","geoEqualEarth","geoNaturalEarth1","geoOrthographic","geoAlbersUsa","pathGenerator","geoPath","handleZoom","direction","scaleBy","jsxs","Fragment","jsx","motion","position","map","layer","features","i","properties","path","indexOf","stroke","strokeWidth","fill","AnimatePresence","id","index","findIndex","el","color","checkIfNullOrUndefined","initial","opacity","whileInView","transition","duration","event","clientY","clientX","isEqual","lat","long","label","fillOpacity","cn","graphObjectValues","textAnchor","colorLegend","X","backgroundColor","display","WebkitLineClamp","WebkitBoxOrient","Spacer","Separator","numberFormattingFunction","DetailsModal","modal","Tooltip","HybridMap","$","_c","t0","graphTitle","sources","graphDescription","footNote","t1","choroplethScaleType","t2","t3","t4","padding","t5","t6","t7","t8","t9","relativeHeight","isWorldMap","t10","t11","t12","graphID","t13","graphDownload","t14","dataDownload","t15","showAntarctica","t16","language","t17","minHeight","t18","theme","t19","ariaLabel","t20","t21","t22","t23","t24","t25","timeline","t26","t27","t28","t29","t30","t31","t32","Colors","light","graphNoData","grays","t33","t34","t35","t36","enabled","autoplay","showOnlyActiveDate","primaryColors","t37","t38","svgWidth","setSvgWidth","svgHeight","setSvgHeight","play","setPlay","dates","dateFormat","t39","d_0","parse","date","Date","getTime","Set","_temp","sort","_temp2","uniqDatesSorted","setIndex","mapShape","setMapShape","graphDiv","graphParentDiv","getUniqValue","getJenks","_temp3","t40","t41","Symbol","for","resizeObserver","ResizeObserver","entries","target","clientWidth","clientHeight","observe","disconnect","t42","shape","onUpdateShape","useEffectEvent","t43","fetchAndParseJSON","then","d_2","t44","t45","t46","speed","interval","setInterval","clearInterval","t47","t48","getSliderMarks","markObj","t49","graphContainer","t50","t51","description","title","GraphHeader","_temp4","_temp5","_temp6","_temp7","_temp8","t52","Pause","Play","SliderUI","nextValue","nextValue_0","t53","GraphArea","format","d_8","_temp9","sequentialColors","max","_temp0","_temp1","Spinner","t54","footnote","source","GraphFooter","t55","GraphContainer","d_10","d_9","NAME","d_5","d_4","d_3","d_7","d_6","d_1","b"],"mappings":"u+CAMA,IAAIA,GAAI,YAAaC,GAAI,aAAcC,GAAI,CAAC,aAAc,UAAU,EAAGC,GAAIC,GAAE,WAAW,CAAC,EAAGC,IAAM,CAChG,KAAM,CAAE,WAAYC,EAAG,YAAaC,EAAIN,GAAG,GAAGO,CAAC,EAAK,EAAGC,EAAIC,GAAEH,CAAC,EAAIA,EAAIN,GAAGU,EAAIL,EAAI,CAAE,KAAM,MAAM,EAAK,CAAE,mBAAoBG,IAAM,WAAaA,EAAI,OAAQ,KAAM,WAAW,EAC1K,OAA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,EAAAyK,OAAA4J,IAAAA,GAAA5J,EAAA,GAAA,EAjLjB4J,EAiLiB,CAtTd,SAAAN,GAAAQ,EAAA,CAAA,OA0Q8EpV,GAAM,IAAI,CA1QxF,SAAA2U,GAAAU,EAAA,CAAA,OA0QqCrV,EAACW,MAAO,CA1Q7C,SAAA6T,GAAAlL,EAAA,CAAA,OAwN4BA,EAAEV,WAAW0M,OAAU,YAAY,CAxN/D,SAAAzB,GAAA0B,EAAA,CAAA,OAsK4BvV,IAAMsD,MAAS,CAtK3C,SAAAsQ,GAAA4B,EAAA,CAAA,OAqK6CxV,IAAMsD,MAAS,CArK5D,SAAAqQ,GAAA8B,EAAA,CAAA,OAqKyBzV,EAACM,IAAK,CArK/B,SAAAoT,GAAAgC,EAAA,CAAA,OAoK2C1V,IAAMsD,MAAS,CApK1D,SAAAmQ,GAAAkC,EAAA,CAAA,OAoKuB3V,EAACM,IAAK,CApK7B,SAAA4Q,GAAA0E,EAAA,CAAA,OAuFiB5V,EAACR,CAA+B,CAvFjD,SAAAiR,GAAAvR,EAAA2W,EAAA,CAAA,OAyEkB3W,EAAI2W,CAAC,CAzEvB,SAAAtF,GAAAvQ,EAAA,CAAA,OAqEgBA,EAACmQ,IAAK","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"HybridMap.cjs","sources":["../node_modules/@undp/design-system-react/dist/Separator.js","../src/Components/Graphs/Maps/HybridMap/Graph.tsx","../src/Components/Graphs/Maps/HybridMap/index.tsx"],"sourcesContent":["import { j as v } from \"./jsx-runtime-BzflLqGi.js\";\nimport { c as N } from \"./compiler-runtime-Cu50tn6L.js\";\nimport * as R from \"react\";\nimport g from \"react\";\nimport { P as x } from \"./index-DE1ItLfl.js\";\nimport { c as O } from \"./utils-D_Pof5Gy.js\";\nvar h = \"Separator\", f = \"horizontal\", E = [\"horizontal\", \"vertical\"], y = R.forwardRef((i, s) => {\n const { decorative: r, orientation: a = f, ...o } = i, t = P(a) ? a : f, m = r ? { role: \"none\" } : { \"aria-orientation\": t === \"vertical\" ? t : void 0, role: \"separator\" };\n return /* @__PURE__ */ v.jsx(\n x.div,\n {\n \"data-orientation\": t,\n ...m,\n ...o,\n ref: s\n }\n );\n});\ny.displayName = h;\nfunction P(i) {\n return E.includes(i);\n}\nvar u = y;\nconst T = g.forwardRef((i, s) => {\n const r = N.c(14);\n let a, o, t, e;\n r[0] !== i ? ({\n className: a,\n variant: t,\n orientation: e,\n ...o\n } = i, r[0] = i, r[1] = a, r[2] = o, r[3] = t, r[4] = e) : (a = r[1], o = r[2], t = r[3], e = r[4]);\n const m = t === void 0 ? \"dark\" : t, l = e === void 0 ? \"horizontal\" : e, c = l === \"horizontal\" ? \"h-[1px] w-full\" : \"h-full w-[1px]\", d = m === \"dark\" ? \"bg-primary-gray-600 dark:bg-primary-gray-200\" : \"bg-primary-gray-400 dark:bg-primary-gray-550\";\n let n;\n r[5] !== a || r[6] !== c || r[7] !== d ? (n = O(c, d, a), r[5] = a, r[6] = c, r[7] = d, r[8] = n) : n = r[8];\n let p;\n return r[9] !== l || r[10] !== o || r[11] !== s || r[12] !== n ? (p = /* @__PURE__ */ v.jsx(u, { ...o, ref: s, orientation: l, className: n }), r[9] = l, r[10] = o, r[11] = s, r[12] = n, r[13] = p) : p = r[13], p;\n});\nT.displayName = u.displayName;\nexport {\n T as Separator\n};\n//# sourceMappingURL=Separator.js.map\n","import isEqual from 'fast-deep-equal';\r\nimport { useEffect, useMemo, useRef, useState } from 'react';\r\nimport {\r\n geoAlbersUsa,\r\n geoEqualEarth,\r\n geoMercator,\r\n geoNaturalEarth1,\r\n geoOrthographic,\r\n geoPath,\r\n} from 'd3-geo';\r\nimport { D3ZoomEvent, zoom, ZoomBehavior } from 'd3-zoom';\r\nimport { select } from 'd3-selection';\r\nimport { scaleOrdinal, scaleSqrt, scaleThreshold } from 'd3-scale';\r\nimport { P } from '@undp/design-system-react/Typography';\r\nimport bbox from '@turf/bbox';\r\nimport centerOfMass from '@turf/center-of-mass';\r\nimport { AnimatePresence, motion, useInView } from 'motion/react';\r\nimport { cn } from '@undp/design-system-react/cn';\r\nimport { Spacer } from '@undp/design-system-react/Spacer';\r\nimport { Separator } from '@undp/design-system-react/Separator';\r\nimport { FeatureCollection } from 'geojson';\r\nimport rewind from '@turf/rewind';\r\n\r\nimport {\r\n AnimateDataType,\r\n ClassNameObject,\r\n CustomLayerDataType,\r\n HybridMapDataType,\r\n MapProjectionTypes,\r\n StyleObject,\r\n ZoomInteractionTypes,\r\n} from '@/Types';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { X } from '@/Components/Icons';\r\nimport { checkIfNullOrUndefined, numberFormattingFunction } from '@/Utils';\r\nimport { DetailsModal } from '@/Components/Elements/DetailsModal';\r\n\r\ninterface Props {\r\n data: HybridMapDataType[];\r\n mapData: FeatureCollection;\r\n colorDomain: (string | number)[];\r\n width: number;\r\n height: number;\r\n scale: number;\r\n centerPoint?: [number, number];\r\n colors: string[];\r\n mapColorLegendTitle?: string;\r\n categorical: boolean;\r\n radius: number;\r\n mapBorderWidth: number;\r\n mapNoDataColor: string;\r\n showLabels: boolean;\r\n mapBorderColor: string;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n isWorldMap: boolean;\r\n showColorScale: boolean;\r\n zoomScaleExtend: [number, number];\r\n zoomTranslateExtend?: [[number, number], [number, number]];\r\n highlightedDataPoints: (string | number)[];\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n resetSelectionOnDoubleClick: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n zoomInteraction: ZoomInteractionTypes;\r\n mapProjection: MapProjectionTypes;\r\n animate: AnimateDataType;\r\n dimmedOpacity: number;\r\n customLayers: CustomLayerDataType[];\r\n maxRadiusValue: number;\r\n collapseColorScaleByDefault?: boolean;\r\n dotColor: string;\r\n highlightedIds: string[];\r\n mapProperty: string;\r\n dotLegendTitle?: string;\r\n dotBorderColor?: string;\r\n labelColor: string;\r\n projectionRotate: [number, number] | [number, number, number];\r\n rewindCoordinatesInMapData: boolean;\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n const {\r\n data,\r\n colors,\r\n mapData,\r\n mapColorLegendTitle,\r\n colorDomain,\r\n radius,\r\n height,\r\n width,\r\n scale,\r\n centerPoint,\r\n tooltip,\r\n showLabels,\r\n mapBorderWidth,\r\n mapBorderColor,\r\n mapNoDataColor,\r\n onSeriesMouseOver,\r\n showColorScale,\r\n zoomScaleExtend,\r\n zoomTranslateExtend,\r\n highlightedDataPoints,\r\n onSeriesMouseClick,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n mapProjection,\r\n zoomInteraction,\r\n animate,\r\n dimmedOpacity,\r\n customLayers,\r\n maxRadiusValue,\r\n categorical,\r\n dotColor,\r\n collapseColorScaleByDefault,\r\n highlightedIds,\r\n mapProperty,\r\n dotLegendTitle,\r\n dotBorderColor,\r\n labelColor,\r\n projectionRotate,\r\n rewindCoordinatesInMapData,\r\n } = props;\r\n const formattedMapData = useMemo(() => {\r\n if (!rewindCoordinatesInMapData) return mapData;\r\n\r\n return rewind(mapData, { reverse: true }) as FeatureCollection;\r\n }, [mapData, rewindCoordinatesInMapData]);\r\n const [selectedColor, setSelectedColor] = useState<string | undefined>(undefined);\r\n\r\n const [showLegend, setShowLegend] = useState(\r\n collapseColorScaleByDefault === undefined ? !(width < 680) : !collapseColorScaleByDefault,\r\n );\r\n const zoomRef = useRef<ZoomBehavior<SVGSVGElement, unknown> | null>(null);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseClickData, setMouseClickData] = useState<any>(undefined);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseOverData, setMouseOverData] = useState<any>(undefined);\r\n const [eventX, setEventX] = useState<number | undefined>(undefined);\r\n const [eventY, setEventY] = useState<number | undefined>(undefined);\r\n const mapSvg = useRef<SVGSVGElement>(null);\r\n const isInView = useInView(mapSvg, {\r\n once: animate.once,\r\n amount: animate.amount,\r\n });\r\n const mapG = useRef<SVGGElement>(null);\r\n const radiusScale =\r\n data.filter(d => d.radius === undefined || d.radius === null).length !== data.length\r\n ? scaleSqrt().domain([0, maxRadiusValue]).range([0.25, radius]).nice()\r\n : undefined;\r\n\r\n const colorScale = categorical\r\n ? scaleOrdinal<number | string, string>().domain(colorDomain).range(colors)\r\n : scaleThreshold<number, string>()\r\n .domain(colorDomain as number[])\r\n .range(colors);\r\n useEffect(() => {\r\n const mapGSelect = select(mapG.current);\r\n const mapSvgSelect = select(mapSvg.current);\r\n const zoomFilter = (e: D3ZoomEvent<SVGSVGElement, unknown>['sourceEvent']) => {\r\n if (zoomInteraction === 'noZoom') return false;\r\n if (zoomInteraction === 'button') return !e.type.includes('wheel');\r\n const isWheel = e.type === 'wheel';\r\n const isTouch = e.type.startsWith('touch');\r\n const isDrag = e.type === 'mousedown' || e.type === 'mousemove';\r\n\r\n if (isTouch) return true;\r\n if (isWheel) {\r\n if (zoomInteraction === 'scroll') return true;\r\n return e.ctrlKey;\r\n }\r\n return isDrag && !e.button && !e.ctrlKey;\r\n };\r\n const zoomBehavior = zoom<SVGSVGElement, unknown>()\r\n .scaleExtent(zoomScaleExtend)\r\n .translateExtent(\r\n zoomTranslateExtend || [\r\n [-20, -20],\r\n [width + 20, height + 20],\r\n ],\r\n )\r\n .filter(zoomFilter)\r\n .on('zoom', ({ transform }) => {\r\n mapGSelect.attr('transform', transform);\r\n });\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapSvgSelect.call(zoomBehavior as any);\r\n\r\n zoomRef.current = zoomBehavior;\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [height, width, zoomInteraction]);\r\n\r\n const bounds = bbox(formattedMapData);\r\n\r\n const center = centerOfMass(formattedMapData);\r\n const lonDiff = bounds[2] - bounds[0];\r\n const latDiff = bounds[3] - bounds[1];\r\n const scaleX = (((width * 190) / 960) * 360) / lonDiff;\r\n const scaleY = (((height * 190) / 678) * 180) / latDiff;\r\n const scaleVar = scale * Math.min(scaleX, scaleY);\r\n\r\n const projection =\r\n mapProjection === 'mercator'\r\n ? geoMercator()\r\n .rotate(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'equalEarth'\r\n ? geoEqualEarth()\r\n .rotate(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'naturalEarth'\r\n ? geoNaturalEarth1()\r\n .rotate(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'orthographic'\r\n ? geoOrthographic()\r\n .rotate(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : geoAlbersUsa()\r\n .rotate(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar);\r\n const pathGenerator = geoPath().projection(projection);\r\n const handleZoom = (direction: 'in' | 'out') => {\r\n if (!mapSvg.current || !zoomRef.current) return;\r\n const svg = select(mapSvg.current);\r\n svg.call(zoomRef.current.scaleBy, direction === 'in' ? 1.2 : 1 / 1.2);\r\n };\r\n return (\r\n <>\r\n <div className='relative'>\r\n <motion.svg\r\n width={`${width}px`}\r\n height={`${height}px`}\r\n viewBox={`0 0 ${width} ${height}`}\r\n ref={mapSvg}\r\n direction='ltr'\r\n >\r\n <g ref={mapG}>\r\n {customLayers.filter(d => d.position === 'before').map(d => d.layer)}\r\n {formattedMapData.features.map((d, i: number) => {\r\n if (!d.properties?.[mapProperty]) return null;\r\n const path = pathGenerator(d);\r\n if (!path) return null;\r\n return (\r\n <motion.g\r\n key={i}\r\n opacity={\r\n selectedColor\r\n ? dimmedOpacity\r\n : highlightedIds.length !== 0\r\n ? highlightedIds.indexOf(d.properties[mapProperty]) !== -1\r\n ? 1\r\n : dimmedOpacity\r\n : 1\r\n }\r\n >\r\n <path\r\n d={path}\r\n style={{\r\n stroke: mapBorderColor,\r\n strokeWidth: mapBorderWidth,\r\n fill: mapNoDataColor,\r\n }}\r\n />\r\n </motion.g>\r\n );\r\n })}\r\n <AnimatePresence>\r\n {data\r\n .filter(d => d.id)\r\n .map(d => {\r\n const index = formattedMapData.features.findIndex(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any) => d.id === el.properties[mapProperty],\r\n );\r\n if (index === -1) return null;\r\n const path = pathGenerator(formattedMapData.features[index]);\r\n if (!path) return null;\r\n const color = !checkIfNullOrUndefined(d.x)\r\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n colorScale(d.x as any)\r\n : mapNoDataColor;\r\n return (\r\n <motion.g\r\n key={d.id}\r\n variants={{\r\n initial: { opacity: 0 },\r\n whileInView: {\r\n opacity: selectedColor\r\n ? selectedColor === color\r\n ? 1\r\n : dimmedOpacity\r\n : highlightedIds.length !== 0\r\n ? highlightedIds.indexOf(d.id as string) !== -1\r\n ? 1\r\n : dimmedOpacity\r\n : 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n onMouseEnter={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n onSeriesMouseOver?.(d);\r\n }}\r\n onMouseMove={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n }}\r\n onMouseLeave={() => {\r\n setMouseOverData(undefined);\r\n setEventX(undefined);\r\n setEventY(undefined);\r\n onSeriesMouseOver?.(undefined);\r\n }}\r\n onClick={() => {\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (isEqual(mouseClickData, d) && resetSelectionOnDoubleClick) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(d);\r\n onSeriesMouseClick?.(d);\r\n }\r\n }\r\n }}\r\n >\r\n <motion.path\r\n key={`${d.id}`}\r\n d={path}\r\n variants={{\r\n initial: { fill: color, opacity: 0 },\r\n whileInView: {\r\n fill: color,\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{\r\n opacity: 0,\r\n transition: { duration: animate.duration },\r\n }}\r\n style={{\r\n stroke: mapBorderColor,\r\n strokeWidth: mapBorderWidth,\r\n }}\r\n />\r\n </motion.g>\r\n );\r\n })}\r\n {data\r\n .filter(d => !checkIfNullOrUndefined(d.lat) && !checkIfNullOrUndefined(d.long))\r\n .map(d => {\r\n const labelPosMultiplier =\r\n (projection([d.long as number, d.lat as number]) as [number, number])[0] >\r\n 0.6 * width\r\n ? -1\r\n : 1;\r\n return (\r\n <motion.g\r\n key={d.label || `${d.lat}-${d.long}`}\r\n variants={{\r\n initial: { opacity: 0 },\r\n whileInView: {\r\n opacity:\r\n highlightedDataPoints.length !== 0\r\n ? highlightedDataPoints.indexOf(d.label || '') !== -1\r\n ? 1\r\n : dimmedOpacity\r\n : 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n onMouseEnter={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n onSeriesMouseOver?.(d);\r\n }}\r\n onMouseMove={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n }}\r\n onMouseLeave={() => {\r\n setMouseOverData(undefined);\r\n setEventX(undefined);\r\n setEventY(undefined);\r\n onSeriesMouseOver?.(undefined);\r\n }}\r\n onClick={() => {\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (isEqual(mouseClickData, d) && resetSelectionOnDoubleClick) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(d);\r\n onSeriesMouseClick?.(d);\r\n }\r\n }\r\n }}\r\n transform={`translate(${\r\n (projection([d.long as number, d.lat as number]) as [number, number])[0]\r\n },${(projection([d.long as number, d.lat as number]) as [number, number])[1]})`}\r\n >\r\n <motion.circle\r\n cx={0}\r\n cy={0}\r\n variants={{\r\n initial: {\r\n r: 0,\r\n fill: dotColor,\r\n stroke: dotBorderColor || dotColor,\r\n },\r\n whileInView: {\r\n r: !radiusScale ? radius : radiusScale(d.radius || 0),\r\n fill: dotColor,\r\n stroke: dotBorderColor || dotColor,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ r: 0, transition: { duration: animate.duration } }}\r\n style={{\r\n fillOpacity: 0.8,\r\n }}\r\n />\r\n {showLabels && d.label ? (\r\n <motion.text\r\n variants={{\r\n initial: {\r\n opacity: 0,\r\n x:\r\n labelPosMultiplier *\r\n (!radiusScale ? radius : radiusScale(d.radius || 0)),\r\n },\r\n whileInView: {\r\n opacity: 1,\r\n x:\r\n labelPosMultiplier *\r\n (!radiusScale ? radius : radiusScale(d.radius || 0)),\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n y={0}\r\n className={cn('text-sm', classNames?.graphObjectValues)}\r\n style={{\r\n textAnchor: labelPosMultiplier === -1 ? 'end' : 'start',\r\n fill: labelColor || '#000',\r\n ...(styles?.graphObjectValues || {}),\r\n }}\r\n dx={labelPosMultiplier * 4}\r\n dy={5}\r\n >\r\n {d.label}\r\n </motion.text>\r\n ) : null}\r\n </motion.g>\r\n );\r\n })}\r\n </AnimatePresence>\r\n {customLayers.filter(d => d.position === 'after').map(d => d.layer)}\r\n </g>\r\n </motion.svg>\r\n {showColorScale === false ? null : (\r\n <div className={cn('absolute left-4 bottom-4 map-color-legend', classNames?.colorLegend)}>\r\n {showLegend ? (\r\n <>\r\n <div\r\n className='color-legend-close-button bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)] border border-[var(--gray-400)] rounded-full w-6 h-6 p-[3px] cursor-pointer z-10 absolute right-[-0.75rem] top-[-0.75rem]'\r\n onClick={() => {\r\n setShowLegend(false);\r\n }}\r\n >\r\n <X />\r\n </div>\r\n <div\r\n className='color-legend-box p-2 bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)]'\r\n style={{\r\n width: categorical ? undefined : '340px',\r\n }}\r\n >\r\n {dotLegendTitle && dotLegendTitle !== '' ? (\r\n <>\r\n <div className='flex items-center gap-2'>\r\n <div\r\n className='w-3 h-3 rounded-full'\r\n style={{ backgroundColor: dotColor }}\r\n />\r\n <P\r\n size='xs'\r\n marginBottom='none'\r\n className='p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300'\r\n style={{\r\n display: '-webkit-box',\r\n WebkitLineClamp: '1',\r\n WebkitBoxOrient: 'vertical',\r\n }}\r\n >\r\n {dotLegendTitle}\r\n </P>\r\n </div>\r\n <Spacer size='xl' />\r\n <Separator />\r\n <Spacer size='xl' />\r\n </>\r\n ) : null}\r\n {mapColorLegendTitle && mapColorLegendTitle !== '' ? (\r\n <P\r\n size='xs'\r\n marginBottom='xs'\r\n className='p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300'\r\n style={{\r\n display: '-webkit-box',\r\n WebkitLineClamp: '1',\r\n WebkitBoxOrient: 'vertical',\r\n }}\r\n >\r\n {mapColorLegendTitle}\r\n </P>\r\n ) : null}\r\n {!categorical ? (\r\n <svg width='100%' viewBox='0 0 320 30' direction='ltr'>\r\n <g>\r\n {colorDomain.map((d, i) => (\r\n <g\r\n key={i}\r\n onMouseOver={() => {\r\n setSelectedColor(colors[i]);\r\n }}\r\n onMouseLeave={() => {\r\n setSelectedColor(undefined);\r\n }}\r\n className='cursor-pointer'\r\n >\r\n <rect\r\n x={(i * 320) / colors.length + 1}\r\n y={1}\r\n width={320 / colors.length - 2}\r\n height={8}\r\n className={\r\n selectedColor === colors[i]\r\n ? 'stroke-primary-gray-700 dark:stroke-primary-gray-300'\r\n : ''\r\n }\r\n style={{\r\n fill: colors[i],\r\n ...(selectedColor === colors[i] ? {} : { stroke: colors[i] }),\r\n }}\r\n />\r\n <text\r\n x={((i + 1) * 320) / colors.length}\r\n y={25}\r\n className='fill-primary-gray-700 dark:fill-primary-gray-300 text-xs'\r\n style={{ textAnchor: 'middle' }}\r\n >\r\n {numberFormattingFunction(d as number, 'NA')}\r\n </text>\r\n </g>\r\n ))}\r\n <g>\r\n <rect\r\n onMouseOver={() => {\r\n setSelectedColor(colors[colorDomain.length]);\r\n }}\r\n onMouseLeave={() => {\r\n setSelectedColor(undefined);\r\n }}\r\n x={(colorDomain.length * 320) / colors.length + 1}\r\n y={1}\r\n width={320 / colors.length - 2}\r\n height={8}\r\n className={`cursor-pointer ${\r\n selectedColor === colors[colorDomain.length]\r\n ? 'stroke-1 stroke-primary-gray-700 dark:stroke-primary-gray-300'\r\n : ''\r\n }`}\r\n style={{\r\n fill: colors[colorDomain.length],\r\n ...(selectedColor === colors[colorDomain.length]\r\n ? {}\r\n : { stroke: colors[colorDomain.length] }),\r\n }}\r\n />\r\n </g>\r\n </g>\r\n </svg>\r\n ) : (\r\n <div className='flex flex-col gap-3'>\r\n {colorDomain.map((d, i) => (\r\n <div\r\n key={i}\r\n className='flex gap-2 items-center'\r\n onMouseOver={() => {\r\n setSelectedColor(colors[i % colors.length]);\r\n }}\r\n onMouseLeave={() => {\r\n setSelectedColor(undefined);\r\n }}\r\n >\r\n <div\r\n className='w-2 h-2 rounded-full'\r\n style={{ backgroundColor: colors[i % colors.length] }}\r\n />\r\n <P size='sm' marginBottom='none' leading='none'>\r\n {d}\r\n </P>\r\n </div>\r\n ))}\r\n </div>\r\n )}\r\n </div>\r\n </>\r\n ) : (\r\n <button\r\n type='button'\r\n className='mb-0 border-0 bg-transparent p-0 self-start map-legend-button'\r\n onClick={() => {\r\n setShowLegend(true);\r\n }}\r\n >\r\n <div className='show-color-legend-button items-start text-sm font-medium cursor-pointer p-2 mb-0 flex text-primary-black dark:text-primary-gray-300 bg-primary-gray-300 dark:bg-primary-gray-600 border-primary-gray-400 dark:border-primary-gray-500'>\r\n Show Legend\r\n </div>\r\n </button>\r\n )}\r\n </div>\r\n )}\r\n {zoomInteraction === 'button' && (\r\n <div className='absolute left-4 top-4 flex flex-col zoom-buttons'>\r\n <button\r\n onClick={() => handleZoom('in')}\r\n className='leading-0 px-2 py-3.5 text-primary-gray-700 border border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100'\r\n >\r\n +\r\n </button>\r\n <button\r\n onClick={() => handleZoom('out')}\r\n className='leading-0 px-2 py-3.5 text-primary-gray-700 border border-t-0 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100'\r\n >\r\n –\r\n </button>\r\n </div>\r\n )}\r\n </div>\r\n {detailsOnClick && mouseClickData !== undefined ? (\r\n <DetailsModal\r\n body={detailsOnClick}\r\n data={mouseClickData}\r\n setData={setMouseClickData}\r\n className={classNames?.modal}\r\n />\r\n ) : null}\r\n {mouseOverData && tooltip && eventX && eventY ? (\r\n <Tooltip\r\n data={mouseOverData}\r\n body={tooltip}\r\n xPos={eventX}\r\n yPos={eventY}\r\n backgroundStyle={styles?.tooltip}\r\n className={classNames?.tooltip}\r\n />\r\n ) : null}\r\n </>\r\n );\r\n}\r\n","import { useState, useRef, useEffect, useEffectEvent, useMemo } from 'react';\r\nimport { format } from 'date-fns/format';\r\nimport { parse } from 'date-fns/parse';\r\nimport { SliderUI } from '@undp/design-system-react/SliderUI';\r\nimport { Spinner } from '@undp/design-system-react/Spinner';\r\nimport { FeatureCollection } from 'geojson';\r\n\r\nimport { Graph } from './Graph';\r\n\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport {\r\n HybridMapDataType,\r\n Languages,\r\n SourcesDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n ZoomInteractionTypes,\r\n MapProjectionTypes,\r\n CustomLayerDataType,\r\n AnimateDataType,\r\n TimelineDataType,\r\n ScaleDataType,\r\n} from '@/Types';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { fetchAndParseJSON } from '@/Utils/fetchAndParseData';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { Pause, Play } from '@/Components/Icons';\r\nimport { getSliderMarks } from '@/Utils/getSliderMarks';\r\nimport { GraphArea, GraphContainer } from '@/Components/Elements/GraphContainer';\r\nimport { getJenks, getUniqValue } from '@/Utils';\r\n\r\ninterface Props {\r\n // Data\r\n /** Array of data objects for dot density map*/\r\n data: HybridMapDataType[];\r\n // Titles, Labels, and Sources\r\n /** Title of the graph */\r\n graphTitle?: string | React.ReactNode;\r\n /** Description of the graph */\r\n graphDescription?: string | React.ReactNode;\r\n /** Footnote for the graph */\r\n footNote?: string | React.ReactNode;\r\n /** Source data for the graph */\r\n sources?: SourcesDataType[];\r\n /** Accessibility label */\r\n ariaLabel?: string;\r\n\r\n // Colors and Styling\r\n /** Color or array of colors for the circle */\r\n colors?: string[];\r\n /** Domain of colors for the graph for the choropleth map */\r\n colorDomain?: number[] | string[];\r\n /** Title for the legend for the dot density scale */\r\n dotLegendTitle?: string;\r\n /** Title for the color legend for the color scale */\r\n mapColorLegendTitle?: string;\r\n /** Color for the areas where data is no available */\r\n mapNoDataColor?: string;\r\n /** Background color of the graph */\r\n backgroundColor?: string | boolean;\r\n /** Custom styles for the graph. Each object should be a valid React CSS style object. */\r\n styles?: StyleObject;\r\n /** Custom class names */\r\n classNames?: ClassNameObject;\r\n\r\n // Size and Spacing\r\n /** Width of the graph */\r\n width?: number;\r\n /** Height of the graph */\r\n height?: number;\r\n /** Minimum height of the graph */\r\n minHeight?: number;\r\n /** Relative height scaling factor. This overwrites the height props */\r\n relativeHeight?: number;\r\n /** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */\r\n padding?: string;\r\n\r\n // Graph Parameters\r\n /** Maximum radius of the circle */\r\n radius?: number;\r\n /** Map data as an object in geoJson format or a url for geoJson */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapData?: any;\r\n /** Defines if the coordinates in the map data should be rewinded or not. Try to change this is the visualization shows countries as holes instead of shapes. */\r\n rewindCoordinatesInMapData?: boolean;\r\n /** Scaling factor for the map. Multiplies the scale number to scale. */\r\n scale?: number;\r\n /** Center point of the map */\r\n centerPoint?: [number, number];\r\n /** Controls the rotation of the map projection, in degrees, applied before rendering. Useful for shifting the antimeridian to focus the map on different regions */\r\n projectionRotate?: [number, number] | [number, number, number];\r\n /** Defines the zoom mode for the map */\r\n zoomInteraction?: ZoomInteractionTypes;\r\n /** Stroke width of the regions in the map */\r\n mapBorderWidth?: number;\r\n /** Stroke color of the regions in the map */\r\n mapBorderColor?: string;\r\n /** Color of the dots in the dot density map */\r\n dotColor?: string;\r\n /** Border color of the dots in the dot density map */\r\n dotBorderColor?: string;\r\n /** Color of the labels */\r\n labelColor?: string;\r\n /** Toggle if the map is a world map */\r\n isWorldMap?: boolean;\r\n /** Scale for the colors of the choropleth map */\r\n choroplethScaleType?: Exclude<ScaleDataType, 'linear'>;\r\n /** Map projection type */\r\n mapProjection?: MapProjectionTypes;\r\n /** Extend of the allowed zoom in the map */\r\n zoomScaleExtend?: [number, number];\r\n /** Extend of the allowed panning in the map */\r\n zoomTranslateExtend?: [[number, number], [number, number]];\r\n /** Toggle visibility of labels */\r\n showLabels?: boolean;\r\n /** Maximum value mapped to the radius chart */\r\n maxRadiusValue?: number;\r\n /** Countries or regions to be highlighted */\r\n highlightedIds?: string[];\r\n /** Data points to highlight. Use the label value from data to highlight the data point */\r\n highlightedDataPoints?: (string | number)[];\r\n /** Defines the opacity of the non-highlighted data */\r\n dimmedOpacity?: number;\r\n /** Toggles if the graph animates in when loaded. */\r\n animate?: boolean | AnimateDataType;\r\n /** Toggle visibility of color scale. This is only applicable if the data props hae color parameter */\r\n showColorScale?: boolean;\r\n /** Toggle if color scale is collapsed by default. */\r\n collapseColorScaleByDefault?: boolean;\r\n /** Toggles the visibility of Antarctica in the default map. Only applicable for the default map. */\r\n showAntarctica?: boolean;\r\n /** Optional SVG <g> element or function that renders custom content behind or in front of the graph. */\r\n customLayers?: CustomLayerDataType[];\r\n /** Property in the property object in mapData geoJson object is used to match to the id in the data object */\r\n mapProperty?: string;\r\n /** Configures playback and slider controls for animating the chart over time. The data must have a key date for it to work properly. */\r\n timeline?: TimelineDataType;\r\n /** Enable graph download option as png */\r\n graphDownload?: boolean;\r\n /** Enable data download option as a csv */\r\n dataDownload?: boolean;\r\n /** Reset selection on double-click. Only applicable when used in a dashboard context with filters. */\r\n resetSelectionOnDoubleClick?: boolean;\r\n\r\n // Interactions and Callbacks\r\n /** Tooltip content. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n /** Details displayed on the modal when user clicks of a data point. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n /** Callback for mouse over event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n /** Callback for mouse click event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n\r\n // Configuration and Options\r\n /** Language setting */\r\n language?: Languages;\r\n /** Color theme */\r\n theme?: 'light' | 'dark';\r\n /** Unique ID for the graph */\r\n graphID?: string;\r\n}\r\n\r\nexport function HybridMap(props: Props) {\r\n const {\r\n data,\r\n mapData = 'https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-v2.json',\r\n graphTitle,\r\n colors,\r\n sources,\r\n graphDescription,\r\n height,\r\n width,\r\n footNote = 'The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.',\r\n mapColorLegendTitle,\r\n colorDomain,\r\n choroplethScaleType = 'threshold',\r\n radius = 5,\r\n scale = 0.95,\r\n centerPoint,\r\n padding,\r\n mapBorderWidth = 0.5,\r\n mapNoDataColor = Colors.light.graphNoData,\r\n backgroundColor = false,\r\n showLabels = false,\r\n mapBorderColor = Colors.light.grays['gray-500'],\r\n tooltip,\r\n relativeHeight,\r\n onSeriesMouseOver,\r\n isWorldMap = true,\r\n showColorScale = true,\r\n zoomScaleExtend = [0.8, 6],\r\n zoomTranslateExtend,\r\n graphID,\r\n highlightedDataPoints = [],\r\n onSeriesMouseClick,\r\n graphDownload = false,\r\n dataDownload = false,\r\n showAntarctica = false,\r\n language = 'en',\r\n minHeight = 0,\r\n theme = 'light',\r\n ariaLabel,\r\n resetSelectionOnDoubleClick = true,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n mapProjection = 'naturalEarth',\r\n zoomInteraction = 'button',\r\n animate = false,\r\n dimmedOpacity = 0.3,\r\n customLayers = [],\r\n maxRadiusValue,\r\n timeline = { enabled: false, autoplay: false, showOnlyActiveDate: true },\r\n collapseColorScaleByDefault,\r\n dotColor = Colors.primaryColors['blue-600'],\r\n highlightedIds = [],\r\n mapProperty = 'ISO3',\r\n dotLegendTitle,\r\n dotBorderColor,\r\n labelColor = Colors.primaryColors['blue-600'],\r\n projectionRotate = [0, 0],\r\n rewindCoordinatesInMapData = true,\r\n } = props;\r\n\r\n const [svgWidth, setSvgWidth] = useState(0);\r\n const [svgHeight, setSvgHeight] = useState(0);\r\n const [play, setPlay] = useState(timeline.autoplay);\r\n const uniqDatesSorted = useMemo(() => {\r\n const dates = [\r\n ...new Set(\r\n data\r\n .filter(d => d.date)\r\n .map(d => parse(`${d.date}`, timeline.dateFormat || 'yyyy', new Date()).getTime()),\r\n ),\r\n ];\r\n dates.sort((a, b) => a - b);\r\n return dates;\r\n }, [data, timeline.dateFormat]);\r\n const [index, setIndex] = useState(timeline.autoplay ? 0 : uniqDatesSorted.length - 1);\r\n\r\n const [mapShape, setMapShape] = useState<FeatureCollection | undefined>(undefined);\r\n\r\n const graphDiv = useRef<HTMLDivElement>(null);\r\n const graphParentDiv = useRef<HTMLDivElement>(null);\r\n const domain =\r\n colorDomain ||\r\n (choroplethScaleType === 'categorical'\r\n ? getUniqValue(data, 'x')\r\n : getJenks(\r\n data.map(d => d.x as number | null | undefined),\r\n colors?.length || 4,\r\n ));\r\n useEffect(() => {\r\n const resizeObserver = new ResizeObserver(entries => {\r\n setSvgWidth(entries[0].target.clientWidth || 620);\r\n setSvgHeight(entries[0].target.clientHeight || 480);\r\n });\r\n if (graphDiv.current) {\r\n resizeObserver.observe(graphDiv.current);\r\n }\r\n return () => resizeObserver.disconnect();\r\n }, []);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const onUpdateShape = useEffectEvent((shape: any) => {\r\n setMapShape(shape);\r\n });\r\n useEffect(() => {\r\n if (typeof mapData === 'string') {\r\n const fetchData = fetchAndParseJSON(mapData);\r\n fetchData.then(d => {\r\n onUpdateShape(d as FeatureCollection);\r\n });\r\n } else {\r\n onUpdateShape(mapData);\r\n }\r\n }, [mapData]);\r\n\r\n useEffect(() => {\r\n const interval = setInterval(\r\n () => {\r\n setIndex(i => (i < uniqDatesSorted.length - 1 ? i + 1 : 0));\r\n },\r\n (timeline.speed || 2) * 1000,\r\n );\r\n if (!play) clearInterval(interval);\r\n return () => clearInterval(interval);\r\n }, [uniqDatesSorted, play, timeline.speed]);\r\n\r\n const markObj = getSliderMarks(\r\n uniqDatesSorted,\r\n index,\r\n timeline.showOnlyActiveDate,\r\n timeline.dateFormat || 'yyyy',\r\n );\r\n return (\r\n <GraphContainer\r\n className={classNames?.graphContainer}\r\n style={styles?.graphContainer}\r\n id={graphID}\r\n ref={graphParentDiv}\r\n aria-label={ariaLabel}\r\n backgroundColor={backgroundColor}\r\n theme={theme}\r\n language={language}\r\n minHeight={minHeight}\r\n width={width}\r\n height={height}\r\n relativeHeight={relativeHeight}\r\n padding={padding}\r\n >\r\n {graphTitle || graphDescription || graphDownload || dataDownload ? (\r\n <GraphHeader\r\n styles={{\r\n title: styles?.title,\r\n description: styles?.description,\r\n }}\r\n classNames={{\r\n title: classNames?.title,\r\n description: classNames?.description,\r\n }}\r\n graphTitle={graphTitle}\r\n graphDescription={graphDescription}\r\n width={width}\r\n graphDownload={graphDownload ? graphParentDiv : undefined}\r\n dataDownload={\r\n dataDownload\r\n ? data.map(d => d.data).filter(d => d !== undefined).length > 0\r\n ? data.map(d => d.data).filter(d => d !== undefined)\r\n : data.filter(d => d !== undefined)\r\n : null\r\n }\r\n />\r\n ) : null}\r\n {timeline.enabled && uniqDatesSorted.length > 0 && markObj ? (\r\n <div className='flex gap-6 items-center' dir='ltr'>\r\n <button\r\n type='button'\r\n onClick={() => {\r\n setPlay(!play);\r\n }}\r\n className='p-0 border-0 cursor-pointer bg-transparent'\r\n aria-label={play ? 'Click to pause animation' : 'Click to play animation'}\r\n >\r\n {play ? <Pause /> : <Play />}\r\n </button>\r\n <SliderUI\r\n min={uniqDatesSorted[0]}\r\n max={uniqDatesSorted[uniqDatesSorted.length - 1]}\r\n marks={markObj}\r\n step={null}\r\n defaultValue={uniqDatesSorted[uniqDatesSorted.length - 1]}\r\n value={uniqDatesSorted[index]}\r\n onChangeComplete={nextValue => {\r\n setIndex(uniqDatesSorted.indexOf(nextValue as number));\r\n }}\r\n onChange={nextValue => {\r\n setIndex(uniqDatesSorted.indexOf(nextValue as number));\r\n }}\r\n aria-label='Time slider. Use arrow keys to adjust selected time period.'\r\n />\r\n </div>\r\n ) : null}\r\n <GraphArea ref={graphDiv}>\r\n {svgWidth && svgHeight && mapShape ? (\r\n <Graph\r\n dotColor={dotColor}\r\n data={data.filter(d =>\r\n timeline.enabled\r\n ? d.date === format(new Date(uniqDatesSorted[index]), timeline.dateFormat || 'yyyy')\r\n : d,\r\n )}\r\n mapData={\r\n showAntarctica\r\n ? mapShape\r\n : {\r\n ...mapShape,\r\n features: mapShape.features.filter(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any) => el.properties.NAME !== 'Antarctica',\r\n ),\r\n }\r\n }\r\n colorDomain={domain}\r\n width={svgWidth}\r\n height={svgHeight}\r\n scale={scale}\r\n centerPoint={centerPoint}\r\n colors={\r\n colors ||\r\n (choroplethScaleType === 'categorical'\r\n ? Colors[theme].sequentialColors[\r\n `neutralColorsx0${domain.length as 4 | 5 | 6 | 7 | 8 | 9}`\r\n ]\r\n : Colors[theme].sequentialColors[\r\n `neutralColorsx0${(domain.length + 1) as 4 | 5 | 6 | 7 | 8 | 9}`\r\n ])\r\n }\r\n mapColorLegendTitle={mapColorLegendTitle}\r\n radius={radius}\r\n categorical={choroplethScaleType === 'categorical'}\r\n mapBorderWidth={mapBorderWidth}\r\n mapNoDataColor={mapNoDataColor}\r\n mapBorderColor={mapBorderColor}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n showLabels={showLabels}\r\n isWorldMap={isWorldMap}\r\n showColorScale={showColorScale}\r\n zoomScaleExtend={zoomScaleExtend}\r\n zoomTranslateExtend={zoomTranslateExtend}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n highlightedDataPoints={highlightedDataPoints}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n styles={styles}\r\n classNames={classNames}\r\n zoomInteraction={zoomInteraction}\r\n detailsOnClick={detailsOnClick}\r\n mapProjection={mapProjection || (isWorldMap ? 'naturalEarth' : 'mercator')}\r\n animate={\r\n animate === true\r\n ? { duration: 0.5, once: true, amount: 0.5 }\r\n : animate || { duration: 0, once: true, amount: 0 }\r\n }\r\n dimmedOpacity={dimmedOpacity}\r\n customLayers={customLayers}\r\n maxRadiusValue={\r\n !checkIfNullOrUndefined(maxRadiusValue)\r\n ? (maxRadiusValue as number)\r\n : Math.max(...data.map(d => d.radius).filter(d => d !== undefined && d !== null))\r\n }\r\n collapseColorScaleByDefault={collapseColorScaleByDefault}\r\n highlightedIds={highlightedIds}\r\n mapProperty={mapProperty}\r\n dotLegendTitle={dotLegendTitle}\r\n dotBorderColor={dotBorderColor}\r\n labelColor={labelColor}\r\n projectionRotate={projectionRotate}\r\n rewindCoordinatesInMapData={rewindCoordinatesInMapData}\r\n />\r\n ) : (\r\n <div\r\n style={{\r\n height: `${Math.max(\r\n minHeight,\r\n height ||\r\n (relativeHeight\r\n ? minHeight\r\n ? (width || svgWidth) * relativeHeight > minHeight\r\n ? (width || svgWidth) * relativeHeight\r\n : minHeight\r\n : (width || svgWidth) * relativeHeight\r\n : svgHeight),\r\n )}px`,\r\n }}\r\n className='flex items-center justify-center'\r\n >\r\n <Spinner aria-label='Loading graph' />\r\n </div>\r\n )}\r\n </GraphArea>\r\n {sources || footNote ? (\r\n <GraphFooter\r\n styles={{ footnote: styles?.footnote, source: styles?.source }}\r\n classNames={{\r\n footnote: classNames?.footnote,\r\n source: classNames?.source,\r\n }}\r\n sources={sources}\r\n footNote={footNote}\r\n width={width}\r\n />\r\n ) : null}\r\n </GraphContainer>\r\n );\r\n}\r\n"],"names":["h","f","E","y","R","s","r","a","o","t","P","m","v","x","u","T","g","N","e","l","c","d","n","O","p","Graph","props","data","colors","mapData","mapColorLegendTitle","colorDomain","radius","height","width","scale","centerPoint","tooltip","showLabels","mapBorderWidth","mapBorderColor","mapNoDataColor","onSeriesMouseOver","showColorScale","zoomScaleExtend","zoomTranslateExtend","highlightedDataPoints","onSeriesMouseClick","resetSelectionOnDoubleClick","detailsOnClick","styles","classNames","mapProjection","zoomInteraction","animate","dimmedOpacity","customLayers","maxRadiusValue","categorical","dotColor","collapseColorScaleByDefault","highlightedIds","mapProperty","dotLegendTitle","dotBorderColor","labelColor","projectionRotate","rewindCoordinatesInMapData","formattedMapData","useMemo","rewind","reverse","selectedColor","setSelectedColor","useState","undefined","showLegend","setShowLegend","zoomRef","useRef","mouseClickData","setMouseClickData","mouseOverData","setMouseOverData","eventX","setEventX","eventY","setEventY","mapSvg","isInView","useInView","once","amount","mapG","radiusScale","filter","length","scaleSqrt","domain","range","nice","colorScale","scaleOrdinal","scaleThreshold","useEffect","mapGSelect","select","current","mapSvgSelect","zoomFilter","type","includes","isWheel","isTouch","startsWith","isDrag","ctrlKey","button","zoomBehavior","zoom","scaleExtent","translateExtent","on","transform","attr","call","bounds","bbox","center","centerOfMass","lonDiff","latDiff","scaleX","scaleY","scaleVar","Math","min","projection","geoMercator","rotate","geometry","coordinates","translate","geoEqualEarth","geoNaturalEarth1","geoOrthographic","geoAlbersUsa","pathGenerator","geoPath","handleZoom","direction","scaleBy","jsxs","Fragment","jsx","motion","position","map","layer","features","i","properties","path","indexOf","stroke","strokeWidth","fill","AnimatePresence","id","index","findIndex","el","color","checkIfNullOrUndefined","initial","opacity","whileInView","transition","duration","event","clientY","clientX","isEqual","lat","long","labelPosMultiplier","label","fillOpacity","cn","graphObjectValues","textAnchor","colorLegend","X","backgroundColor","display","WebkitLineClamp","WebkitBoxOrient","Spacer","Separator","numberFormattingFunction","DetailsModal","modal","Tooltip","HybridMap","$","_c","t0","graphTitle","sources","graphDescription","footNote","t1","choroplethScaleType","t2","t3","t4","padding","t5","t6","t7","t8","t9","relativeHeight","isWorldMap","t10","t11","t12","graphID","t13","graphDownload","t14","dataDownload","t15","showAntarctica","t16","language","t17","minHeight","t18","theme","t19","ariaLabel","t20","t21","t22","t23","t24","t25","timeline","t26","t27","t28","t29","t30","t31","t32","Colors","light","graphNoData","grays","t33","t34","t35","t36","enabled","autoplay","showOnlyActiveDate","primaryColors","t37","t38","svgWidth","setSvgWidth","svgHeight","setSvgHeight","play","setPlay","dates","dateFormat","t39","d_0","parse","date","Date","getTime","Set","_temp","sort","_temp2","uniqDatesSorted","setIndex","mapShape","setMapShape","graphDiv","graphParentDiv","getUniqValue","getJenks","_temp3","t40","t41","Symbol","for","resizeObserver","ResizeObserver","entries","target","clientWidth","clientHeight","observe","disconnect","t42","shape","onUpdateShape","useEffectEvent","t43","fetchAndParseJSON","then","d_2","t44","t45","t46","speed","interval","setInterval","clearInterval","t47","t48","getSliderMarks","markObj","t49","graphContainer","t50","t51","description","title","GraphHeader","_temp4","_temp5","_temp6","_temp7","_temp8","t52","Pause","Play","SliderUI","nextValue","nextValue_0","t53","GraphArea","format","d_8","_temp9","sequentialColors","max","_temp0","_temp1","Spinner","t54","footnote","source","GraphFooter","t55","GraphContainer","d_10","d_9","NAME","d_5","d_4","d_3","d_7","d_6","d_1","b"],"mappings":"u+CAMA,IAAIA,GAAI,YAAaC,GAAI,aAAcC,GAAI,CAAC,aAAc,UAAU,EAAGC,GAAIC,GAAE,WAAW,CAAC,EAAGC,IAAM,CAChG,KAAM,CAAE,WAAYC,EAAG,YAAaC,EAAIN,GAAG,GAAGO,CAAC,EAAK,EAAGC,EAAIC,GAAEH,CAAC,EAAIA,EAAIN,GAAGU,EAAIL,EAAI,CAAE,KAAM,MAAM,EAAK,CAAE,mBAAoBG,IAAM,WAAaA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