@undp/data-viz 2.3.13 → 2.3.15

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.
Files changed (58) hide show
  1. package/dist/BiVariateChoroplethMap.cjs +1 -1
  2. package/dist/BiVariateChoroplethMap.cjs.map +1 -1
  3. package/dist/BiVariateChoroplethMap.d.ts +6 -0
  4. package/dist/BiVariateChoroplethMap.js +330 -297
  5. package/dist/BiVariateChoroplethMap.js.map +1 -1
  6. package/dist/ChoroplethMap.cjs +1 -1
  7. package/dist/ChoroplethMap.cjs.map +1 -1
  8. package/dist/ChoroplethMap.d.ts +6 -0
  9. package/dist/ChoroplethMap.js +359 -326
  10. package/dist/ChoroplethMap.js.map +1 -1
  11. package/dist/DotDensityMap.cjs +1 -1
  12. package/dist/DotDensityMap.cjs.map +1 -1
  13. package/dist/DotDensityMap.d.ts +8 -1
  14. package/dist/DotDensityMap.js +319 -286
  15. package/dist/DotDensityMap.js.map +1 -1
  16. package/dist/{GraphEl-Bb5oGHoa.js → GraphEl-BgNA-xFf.js} +10 -5
  17. package/dist/GraphEl-BgNA-xFf.js.map +1 -0
  18. package/dist/GraphEl-Bl1Hnqnd.cjs +2 -0
  19. package/dist/GraphEl-Bl1Hnqnd.cjs.map +1 -0
  20. package/dist/GriddedGraphs.cjs +1 -1
  21. package/dist/GriddedGraphs.d.ts +8 -1
  22. package/dist/GriddedGraphs.js +1 -1
  23. package/dist/GriddedGraphsFromConfig.d.ts +8 -1
  24. package/dist/HybridMap.cjs +1 -1
  25. package/dist/HybridMap.cjs.map +1 -1
  26. package/dist/HybridMap.d.ts +8 -1
  27. package/dist/HybridMap.js +416 -382
  28. package/dist/HybridMap.js.map +1 -1
  29. package/dist/MultiGraphDashboard.d.ts +8 -1
  30. package/dist/MultiGraphDashboardFromConfig.d.ts +8 -1
  31. package/dist/PerformanceIntensiveMultiGraphDashboard.d.ts +8 -1
  32. package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.d.ts +8 -1
  33. package/dist/PerformanceIntensiveScrollStory.d.ts +8 -1
  34. package/dist/ScatterPlot.cjs +1 -1
  35. package/dist/ScatterPlot.cjs.map +1 -1
  36. package/dist/ScatterPlot.d.ts +2 -0
  37. package/dist/ScatterPlot.js +408 -403
  38. package/dist/ScatterPlot.js.map +1 -1
  39. package/dist/ScrollStory.d.ts +8 -1
  40. package/dist/SingleGraphDashboard.cjs +1 -1
  41. package/dist/SingleGraphDashboard.d.ts +8 -1
  42. package/dist/SingleGraphDashboard.js +1 -1
  43. package/dist/SingleGraphDashboardFromConfig.d.ts +8 -1
  44. package/dist/SingleGraphDashboardGeoHubMaps.d.ts +8 -1
  45. package/dist/SingleGraphDashboardGeoHubMapsFromConfig.d.ts +8 -1
  46. package/dist/SingleGraphDashboardThreeDGraphs.d.ts +8 -1
  47. package/dist/SingleGraphDashboardThreeDGraphsFromConfig.d.ts +8 -1
  48. package/dist/StripChart.cjs +1 -1
  49. package/dist/StripChart.cjs.map +1 -1
  50. package/dist/StripChart.js +330 -334
  51. package/dist/StripChart.js.map +1 -1
  52. package/dist/Types.d.ts +9 -1
  53. package/dist/index.d.ts +36 -3
  54. package/dist/style.css +1 -1
  55. package/package.json +1 -1
  56. package/dist/GraphEl-Bb5oGHoa.js.map +0 -1
  57. package/dist/GraphEl-BerZfJ3j.cjs +0 -2
  58. package/dist/GraphEl-BerZfJ3j.cjs.map +0 -1
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-CHPV5EwG-6v2a2njQ.cjs"),s=require("react"),vt=require("./getSliderMarks-CIuSoedo.cjs"),Mt=require("./Spinner-jTMOLuw_.cjs"),jt=require("./parse-xYI9yrvL.cjs"),qt=require("./index-DQA8q5sC.cjs"),A=require("./index-DLFt97gy.cjs"),It=require("./index-C5K--w8d.cjs"),bt=require("./Typography-CZZxlj1W.cjs"),Et=require("./numberFormattingFunction-02t-wJta.cjs"),zt=require("./Tooltip-BLa2EfMs.cjs"),kt=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),ft=require("./index-sbKVyHS2.cjs"),Pt=require("./DetailsModal-DIRTulvr.cjs"),xt=require("./select-Bnfk0lJx.cjs"),Ct=require("./threshold-DNsSUf8Q.cjs"),et=require("./proxy-C4-uo6nS.cjs"),At=require("./use-in-view-C3o_ntMv.cjs"),Bt=require("./index-CoobIWNj.cjs"),Ft=require("./GraphHeader.cjs"),_t=require("./GraphFooter.cjs"),gt=require("./Colors.cjs"),Lt=require("./fetchAndParseData-QTF6tjij.cjs"),wt=require("./getJenks-BzJvhy_H.cjs"),Rt=require("./GraphContainer-B1EDxJ0S.cjs");function Wt(a){const{data:e,xDomain:u,mapData:B,xColorLegendTitle:ze,yDomain:Y,yColorLegendTitle:J,width:x,height:p,colors:h,scale:Pe,centerPoint:E,mapBorderWidth:F,mapNoDataColor:K,mapBorderColor:pe,tooltip:Z,onSeriesMouseOver:he,zoomScaleExtend:xe,zoomTranslateExtend:ge,highlightedIds:k,onSeriesMouseClick:Q,mapProperty:R,resetSelectionOnDoubleClick:Ae,detailsOnClick:y,showColorScale:fe,styles:Be,classNames:_,mapProjection:L,zoomInteraction:D,animate:S,dimmedOpacity:N,customLayers:ee,collapseColorScaleByDefault:ye,zoomAndCenterByHighlightedIds:ve,projectionRotate:W,rewindCoordinatesInMapData:je}=a,v=s.useMemo(()=>je?A.index_default(B,{reverse:!0}):B,[B,je]),[Fe,be]=s.useState(ye===void 0?!(x<680):!ye),[$,Ee]=s.useState(void 0),[H,c]=s.useState(void 0),[l,te]=s.useState(void 0),[ke,oe]=s.useState(void 0),[Ce,T]=s.useState(void 0),w=s.useRef(null),re=At.useInView(w,{once:S.once,amount:S.amount}),we=s.useRef(null),G=s.useRef(null);s.useEffect(()=>{const t=xt.select(we.current),r=xt.select(w.current),g=m=>{if(D==="noZoom")return!1;if(D==="button")return!m.type.includes("wheel");const C=m.type==="wheel",j=m.type.startsWith("touch"),Me=m.type==="mousedown"||m.type==="mousemove";return j?!0:C?D==="scroll"?!0:m.ctrlKey:Me&&!m.button&&!m.ctrlKey},b=A.zoom().scaleExtent(xe).translateExtent(ge||[[-20,-20],[x+20,p+20]]).filter(g).on("zoom",({transform:m})=>{t.attr("transform",m)});r.call(b),G.current=b},[p,x,D]);const V=A.index_default$1({...v,features:ve?v.features.filter(t=>(k||[]).length===0||k.indexOf(t.properties[R])!==-1):v.features}),f=It.index_default({...v,features:ve?v.features.filter(t=>(k||[]).length===0||k.indexOf(t.properties[R])!==-1):v.features}),O=(V[2]-V[0])*1.15,ne=(V[3]-V[1])*1.15,Re=x*190/960*360/O,De=p*190/678*180/ne,M=Pe*Math.min(Re,De),Se=L==="mercator"?A.geoMercator().rotate(W).center(E||f.geometry.coordinates).translate([x/2,p/2]).scale(M):L==="equalEarth"?A.geoEqualEarth().rotate(W).center(E||f.geometry.coordinates).translate([x/2,p/2]).scale(M):L==="naturalEarth"?A.geoNaturalEarth1().rotate(W).center(E||f.geometry.coordinates).translate([x/2,p/2]).scale(M):L==="orthographic"?A.geoOrthographic().rotate(W).center(E||f.geometry.coordinates).translate([x/2,p/2]).scale(M):A.geoAlbersUsa().rotate(W).center(E||f.geometry.coordinates).translate([x/2,p/2]).scale(M),U=A.geoPath().projection(Se),Ne=Array.from({length:u.length},(t,r)=>r),Oe=Array.from({length:Y.length},(t,r)=>r),ae=Ct.threshold().domain(u).range(Ne),ie=Ct.threshold().domain(Y).range(Oe),se=t=>{if(!w.current||!G.current)return;xt.select(w.current).call(G.current.scaleBy,t==="in"?1.2:1/1.2)};return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsxs("div",{className:"relative",children:[o.jsxRuntimeExports.jsx(et.motion.svg,{viewBox:`0 0 ${x} ${p}`,width:`${x}px`,height:`${p}px`,ref:w,direction:"ltr",children:o.jsxRuntimeExports.jsxs("g",{ref:we,children:[ee.filter(t=>t.position==="before").map(t=>t.layer),v.features.map((t,r)=>{if(!t.properties?.[R])return null;const g=U(t);return g?o.jsxRuntimeExports.jsx(et.motion.g,{opacity:$?N:k.length!==0?k.indexOf(t.properties[R])!==-1?1:N:1,children:o.jsxRuntimeExports.jsx("path",{d:g,style:{stroke:pe,strokeWidth:F,fill:K}})},r):null}),o.jsxRuntimeExports.jsx(Bt.AnimatePresence,{children:e.map(t=>{const r=v.features.findIndex(j=>t.id===j.properties[R]);if(r===-1)return null;const g=U(v.features[r]);if(!g)return null;const b=kt.checkIfNullOrUndefined(t.x)?void 0:ae(t.x),m=kt.checkIfNullOrUndefined(t.y)?void 0:ie(t.y),C=b!==void 0&&m!==void 0?h[m][b]:K;return o.jsxRuntimeExports.jsx(et.motion.g,{className:"undp-map-shapes",variants:{initial:{opacity:0},whileInView:{opacity:$?$===C?1:N:k.length!==0?k.indexOf(t.id)!==-1?1:N:1,transition:{duration:S.duration}}},initial:"initial",animate:re?"whileInView":"initial",exit:{opacity:0,transition:{duration:S.duration}},onMouseEnter:j=>{te(t),T(j.clientY),oe(j.clientX),he?.(t)},onClick:()=>{(Q||y)&&(qt.isEqual(H,t)&&Ae?(c(void 0),Q?.(void 0)):(c(t),Q?.(t)))},onMouseMove:j=>{te(t),T(j.clientY),oe(j.clientX)},onMouseLeave:()=>{te(void 0),oe(void 0),T(void 0),he?.(void 0)},children:o.jsxRuntimeExports.jsx(et.motion.path,{d:g,variants:{initial:{fill:C,opacity:0},whileInView:{fill:C,opacity:1,transition:{duration:S.duration}}},initial:"initial",animate:re?"whileInView":"initial",exit:{opacity:0,transition:{duration:S.duration}},className:`${C===K?"stroke-primary-gray-400 dark:stroke-primary-gray-500":"stroke-primary-white dark:stroke-primary-gray-650"}`,style:{stroke:pe,strokeWidth:F}},`${t.id}`)},t.id)})}),l?v.features.filter(t=>t.properties[R]===l.id).map((t,r)=>o.jsxRuntimeExports.jsx("path",{d:U(t)||"",className:"stroke-primary-gray-700 dark:stroke-primary-gray-300",style:{fill:"none",fillOpacity:0,strokeWidth:"0.5"}},r)):null,ee.filter(t=>t.position==="after").map(t=>t.layer)]})}),fe===!1?null:o.jsxRuntimeExports.jsx("div",{className:o.mo("absolute left-4 bottom-4 map-color-legend",_?.colorLegend),children:Fe?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:()=>{be(!1)},children:o.jsxRuntimeExports.jsx(ft.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:"175px"},children:[o.jsxRuntimeExports.jsxs("div",{className:"flex gap-1 items-center",children:[o.jsxRuntimeExports.jsx("svg",{width:"136px",viewBox:"0 0 136 136",className:"shrink-0",children:o.jsxRuntimeExports.jsxs("g",{children:[h.map((t,r)=>o.jsxRuntimeExports.jsx("g",{transform:`translate(0,${100-r*25})`,children:t.map((g,b)=>o.jsxRuntimeExports.jsx("rect",{y:1,x:b*25+1,fill:g,width:23,height:23,strokeWidth:$===g?2:.25,style:{cursor:"pointer"},onMouseOver:()=>{Ee(g)},onMouseLeave:()=>{Ee(void 0)}},b))},r)),o.jsxRuntimeExports.jsx("g",{transform:"translate(0,125)",children:u.map((t,r)=>o.jsxRuntimeExports.jsx("text",{y:10,x:(r+1)*25,fontSize:10,textAnchor:"middle",children:typeof t=="string"||t<1?t:Et.numberFormattingFunction(t,"NA")},r))}),Y.map((t,r)=>o.jsxRuntimeExports.jsx("g",{transform:`translate(${Math.max(Math.min(u.length+1,5),4)*25+10},${100-r*25})`,children:o.jsxRuntimeExports.jsx("text",{x:0,transform:"rotate(-90)",y:0,fontSize:10,textAnchor:"middle",children:typeof t=="string"||t<1?t:Et.numberFormattingFunction(t,"NA")})},r))]})}),o.jsxRuntimeExports.jsx(bt._,{marginBottom:"none",size:"xs",className:"leading-normal text-center shrink-0",style:{display:"-webkit-box",WebkitLineClamp:"1",WebkitBoxOrient:"vertical",overflow:"hidden",writingMode:"vertical-rl",height:"8.5rem",transform:"rotate(180deg)"},children:J})]}),o.jsxRuntimeExports.jsx(bt._,{marginBottom:"none",size:"xs",className:"mt-1 leading-normal text-center",style:{display:"-webkit-box",WebkitLineClamp:"1",width:"8.5rem",WebkitBoxOrient:"vertical",overflow:"hidden"},children:ze})]})]}):o.jsxRuntimeExports.jsx("button",{type:"button",className:"mb-0 border-0 bg-transparent p-0 self-start",onClick:()=>{be(!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"})})}),D==="button"&&o.jsxRuntimeExports.jsxs("div",{className:"absolute left-4 top-4 flex flex-col zoom-buttons",children:[o.jsxRuntimeExports.jsx("button",{onClick:()=>se("in"),className:"leading-0 px-2 py-3.5 border text-primary-gray-700 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:()=>se("out"),className:"leading-0 px-2 py-3.5 border text-primary-gray-700 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:"–"})]})]}),l&&Z&&ke&&Ce?o.jsxRuntimeExports.jsx(zt.Tooltip,{data:l,body:Z,xPos:ke,yPos:Ce,backgroundStyle:Be?.tooltip,className:_?.tooltip}):null,y&&H!==void 0?o.jsxRuntimeExports.jsx(Pt.DetailsModal,{body:y,data:H,setData:c,className:_?.modal}):null]})}function $t(a){const e=o.compilerRuntimeExports.c(121),{data:u,graphTitle:B,mapData:ze,colors:Y,sources:J,graphDescription:x,height:p,width:h,footNote:Pe,xDomain:E,yDomain:F,xColorLegendTitle:K,yColorLegendTitle:pe,tooltip:Z,scale:he,centerPoint:xe,padding:ge,mapBorderWidth:k,mapNoDataColor:Q,backgroundColor:R,mapBorderColor:Ae,relativeHeight:y,onSeriesMouseOver:fe,isWorldMap:Be,zoomScaleExtend:_,zoomTranslateExtend:L,graphID:D,showColorScale:S,highlightedIds:N,onSeriesMouseClick:ee,mapProperty:ye,graphDownload:ve,dataDownload:W,showAntarctica:je,language:v,minHeight:Fe,theme:be,ariaLabel:$,resetSelectionOnDoubleClick:Ee,detailsOnClick:H,styles:c,classNames:l,mapProjection:te,zoomInteraction:ke,animate:oe,dimmedOpacity:Ce,customLayers:T,timeline:w,collapseColorScaleByDefault:re,zoomAndCenterByHighlightedIds:we,projectionRotate:G,rewindCoordinatesInMapData:V}=a,f=ze===void 0?"https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-v2.json":ze,O=Y===void 0?gt.Colors.light.bivariateColors.colors05x05:Y,ne=Pe===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.":Pe,Re=K===void 0?"X Color key":K,De=pe===void 0?"Y Color key":pe,M=he===void 0?.95:he,Se=k===void 0?.5:k,U=Q===void 0?gt.Colors.light.graphNoData:Q,Ne=R===void 0?!1:R,Oe=Ae===void 0?gt.Colors.light.grays["gray-500"]:Ae,ae=Be===void 0?!0:Be;let ie;e[0]!==_?(ie=_===void 0?[.8,6]:_,e[0]=_,e[1]=ie):ie=e[1];const se=ie,t=S===void 0?!0:S;let r;e[2]!==N?(r=N===void 0?[]:N,e[2]=N,e[3]=r):r=e[3];const g=r,b=ye===void 0?"ISO3":ye,m=ve===void 0?!1:ve,C=W===void 0?!1:W,j=je===void 0?!1:je,Me=v===void 0?"en":v,q=Fe===void 0?0:Fe,tt=be===void 0?"light":be,ot=Ee===void 0?!0:Ee,rt=te===void 0?"naturalEarth":te,nt=ke===void 0?"button":ke,_e=oe===void 0?!1:oe,at=Ce===void 0?.3:Ce;let Le;e[4]!==T?(Le=T===void 0?[]:T,e[4]=T,e[5]=Le):Le=e[5];const it=Le;let We;e[6]!==w?(We=w===void 0?{enabled:!1,autoplay:!1,showOnlyActiveDate:!0}:w,e[6]=w,e[7]=We):We=e[7];const n=We,st=we===void 0?!1:we;let $e;e[8]!==G?($e=G===void 0?[0,0]:G,e[8]=G,e[9]=$e):$e=e[9];const lt=$e,ct=V===void 0?!0:V,[X,Dt]=s.useState(0),[qe,St]=s.useState(0),[I,Nt]=s.useState(n.autoplay);let Ie;if(e[10]!==u||e[11]!==n.dateFormat){let d;e[13]!==n.dateFormat?(d=P=>jt.parse(`${P.date}`,n.dateFormat||"yyyy",new Date).getTime(),e[13]=n.dateFormat,e[14]=d):d=e[14],Ie=[...new Set(u.filter(Zt).map(d))],Ie.sort(Kt),e[10]=u,e[11]=n.dateFormat,e[12]=Ie}else Ie=e[12];const i=Ie,[z,dt]=s.useState(n.autoplay?0:i.length-1),[le,Ot]=s.useState(void 0),ut=s.useRef(null),yt=s.useRef(null);let Te,Ge;e[15]===Symbol.for("react.memo_cache_sentinel")?(Te=()=>{const d=new ResizeObserver(P=>{Dt(P[0].target.clientWidth||620),St(P[0].target.clientHeight||480)});return ut.current&&d.observe(ut.current),()=>d.disconnect()},Ge=[],e[15]=Te,e[16]=Ge):(Te=e[15],Ge=e[16]),s.useEffect(Te,Ge);let He;e[17]===Symbol.for("react.memo_cache_sentinel")?(He=d=>{Ot(d)},e[17]=He):He=e[17];const Ve=s.useEffectEvent(He);let Ue;e[18]!==f||e[19]!==Ve?(Ue=()=>{typeof f=="string"?Lt.fetchAndParseJSON(f).then(P=>{Ve(P)}):Ve(f)},e[18]=f,e[19]=Ve,e[20]=Ue):Ue=e[20];let Xe;e[21]!==f?(Xe=[f],e[21]=f,e[22]=Xe):Xe=e[22],s.useEffect(Ue,Xe);let Ye,Je;e[23]!==I||e[24]!==n.speed||e[25]!==i?(Ye=()=>{const d=setInterval(()=>{dt(P=>P<i.length-1?P+1:0)},(n.speed||2)*1e3);return I||clearInterval(d),()=>clearInterval(d)},Je=[i,I,n.speed],e[23]=I,e[24]=n.speed,e[25]=i,e[26]=Ye,e[27]=Je):(Ye=e[26],Je=e[27]),s.useEffect(Ye,Je);const mt=n.dateFormat||"yyyy";let Ke;e[28]!==z||e[29]!==mt||e[30]!==n.showOnlyActiveDate||e[31]!==i?(Ke=vt.getSliderMarks(i,z,n.showOnlyActiveDate,mt),e[28]=z,e[29]=mt,e[30]=n.showOnlyActiveDate,e[31]=i,e[32]=Ke):Ke=e[32];const Ze=Ke;if(E&&F&&(E.length!==O[0].length-1||F.length!==O.length-1))return console.error("the xDomain and yDomain array length don't match to the color array length"),null;const pt=l?.graphContainer,ht=c?.graphContainer;let ce;e[33]!==l?.description||e[34]!==l?.title||e[35]!==u||e[36]!==C||e[37]!==x||e[38]!==m||e[39]!==B||e[40]!==c?.description||e[41]!==c?.title||e[42]!==h?(ce=B||x||m||C?o.jsxRuntimeExports.jsx(Ft.GraphHeader,{styles:{title:c?.title,description:c?.description},classNames:{title:l?.title,description:l?.description},graphTitle:B,graphDescription:x,width:h,graphDownload:m?yt:void 0,dataDownload:C?u.map(Jt).filter(Yt).length>0?u.map(Xt).filter(Ut):u.filter(Vt):null}):null,e[33]=l?.description,e[34]=l?.title,e[35]=u,e[36]=C,e[37]=x,e[38]=m,e[39]=B,e[40]=c?.description,e[41]=c?.title,e[42]=h,e[43]=ce):ce=e[43];let de;e[44]!==z||e[45]!==Ze||e[46]!==I||e[47]!==n.enabled||e[48]!==i?(de=n.enabled&&i.length>0&&Ze?o.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[o.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{Nt(!I)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":I?"Click to pause animation":"Click to play animation",children:I?o.jsxRuntimeExports.jsx(ft.Pause,{}):o.jsxRuntimeExports.jsx(ft.Play,{})}),o.jsxRuntimeExports.jsx(vt.Nr,{min:i[0],max:i[i.length-1],marks:Ze,step:null,defaultValue:i[i.length-1],value:i[z],onChangeComplete:d=>{dt(i.indexOf(d))},onChange:d=>{dt(i.indexOf(d))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,e[44]=z,e[45]=Ze,e[46]=I,e[47]=n.enabled,e[48]=i,e[49]=de):de=e[49];let ue;e[50]!==_e||e[51]!==xe||e[52]!==l||e[53]!==re||e[54]!==O||e[55]!==it||e[56]!==u||e[57]!==H||e[58]!==at||e[59]!==p||e[60]!==g||e[61]!==z||e[62]!==ae||e[63]!==Oe||e[64]!==Se||e[65]!==U||e[66]!==rt||e[67]!==b||e[68]!==le||e[69]!==q||e[70]!==ee||e[71]!==fe||e[72]!==lt||e[73]!==y||e[74]!==ot||e[75]!==ct||e[76]!==M||e[77]!==j||e[78]!==t||e[79]!==c||e[80]!==qe||e[81]!==X||e[82]!==n.dateFormat||e[83]!==n.enabled||e[84]!==Z||e[85]!==i||e[86]!==h||e[87]!==Re||e[88]!==E||e[89]!==De||e[90]!==F||e[91]!==st||e[92]!==nt||e[93]!==se||e[94]!==L?(ue=o.jsxRuntimeExports.jsx(Rt.GraphArea,{ref:ut,children:X&&qe&&le?o.jsxRuntimeExports.jsx(Wt,{data:u.filter(d=>n.enabled?`${d.date}`===jt.format(new Date(i[z]),n.dateFormat||"yyyy"):d),mapData:j?le:{...le,features:le.features.filter(Ht)},xDomain:E||wt.getJenks(u.map(Gt),O[0].length),yDomain:F||wt.getJenks(u.map(Tt),O.length),width:X,height:qe,scale:M,centerPoint:xe,colors:O,xColorLegendTitle:Re,yColorLegendTitle:De,mapBorderWidth:Se,mapNoDataColor:U,mapBorderColor:Oe,tooltip:Z,onSeriesMouseOver:fe,isWorldMap:ae,zoomScaleExtend:se,zoomTranslateExtend:L,onSeriesMouseClick:ee,mapProperty:b,highlightedIds:g,resetSelectionOnDoubleClick:ot,styles:c,showColorScale:t,classNames:l,mapProjection:rt||(ae?"naturalEarth":"mercator"),detailsOnClick:H,zoomInteraction:nt,animate:_e===!0?{duration:.5,once:!0,amount:.5}:_e||{duration:0,once:!0,amount:0},dimmedOpacity:at,customLayers:it,collapseColorScaleByDefault:re,zoomAndCenterByHighlightedIds:st,projectionRotate:lt,rewindCoordinatesInMapData:ct}):o.jsxRuntimeExports.jsx("div",{style:{height:`${Math.max(q,p||(y?q?(h||X)*y>q?(h||X)*y:q:(h||X)*y:qe))}px`},className:"flex items-center justify-center",children:o.jsxRuntimeExports.jsx(Mt.w,{"aria-label":"Loading graph"})})}),e[50]=_e,e[51]=xe,e[52]=l,e[53]=re,e[54]=O,e[55]=it,e[56]=u,e[57]=H,e[58]=at,e[59]=p,e[60]=g,e[61]=z,e[62]=ae,e[63]=Oe,e[64]=Se,e[65]=U,e[66]=rt,e[67]=b,e[68]=le,e[69]=q,e[70]=ee,e[71]=fe,e[72]=lt,e[73]=y,e[74]=ot,e[75]=ct,e[76]=M,e[77]=j,e[78]=t,e[79]=c,e[80]=qe,e[81]=X,e[82]=n.dateFormat,e[83]=n.enabled,e[84]=Z,e[85]=i,e[86]=h,e[87]=Re,e[88]=E,e[89]=De,e[90]=F,e[91]=st,e[92]=nt,e[93]=se,e[94]=L,e[95]=ue):ue=e[95];let me;e[96]!==l?.footnote||e[97]!==l?.source||e[98]!==ne||e[99]!==J||e[100]!==c?.footnote||e[101]!==c?.source||e[102]!==h?(me=J||ne?o.jsxRuntimeExports.jsx(_t.GraphFooter,{styles:{footnote:c?.footnote,source:c?.source},classNames:{footnote:l?.footnote,source:l?.source},sources:J,footNote:ne,width:h}):null,e[96]=l?.footnote,e[97]=l?.source,e[98]=ne,e[99]=J,e[100]=c?.footnote,e[101]=c?.source,e[102]=h,e[103]=me):me=e[103];let Qe;return e[104]!==$||e[105]!==Ne||e[106]!==D||e[107]!==p||e[108]!==Me||e[109]!==q||e[110]!==ge||e[111]!==y||e[112]!==pt||e[113]!==ht||e[114]!==ce||e[115]!==de||e[116]!==ue||e[117]!==me||e[118]!==tt||e[119]!==h?(Qe=o.jsxRuntimeExports.jsxs(Rt.GraphContainer,{className:pt,style:ht,id:D,ref:yt,"aria-label":$,backgroundColor:Ne,theme:tt,language:Me,minHeight:q,width:h,height:p,relativeHeight:y,padding:ge,children:[ce,de,ue,me]}),e[104]=$,e[105]=Ne,e[106]=D,e[107]=p,e[108]=Me,e[109]=q,e[110]=ge,e[111]=y,e[112]=pt,e[113]=ht,e[114]=ce,e[115]=de,e[116]=ue,e[117]=me,e[118]=tt,e[119]=h,e[120]=Qe):Qe=e[120],Qe}function Tt(a){return a.y}function Gt(a){return a.x}function Ht(a){return a.properties.NAME!=="Antarctica"}function Vt(a){return a!==void 0}function Ut(a){return a!==void 0}function Xt(a){return a.data}function Yt(a){return a!==void 0}function Jt(a){return a.data}function Kt(a,e){return a-e}function Zt(a){return a.date}exports.BiVariateChoroplethMap=$t;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-CHPV5EwG-6v2a2njQ.cjs"),a=require("react"),wt=require("./getSliderMarks-CIuSoedo.cjs"),Ft=require("./Spinner-jTMOLuw_.cjs"),Rt=require("./parse-xYI9yrvL.cjs"),Lt=require("./index-DQA8q5sC.cjs"),S=require("./index-DLFt97gy.cjs"),$t=require("./index-C5K--w8d.cjs"),St=require("./Typography-CZZxlj1W.cjs"),Mt=require("./numberFormattingFunction-02t-wJta.cjs"),Tt=require("./Tooltip-BLa2EfMs.cjs"),Nt=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),Ct=require("./index-sbKVyHS2.cjs"),Gt=require("./DetailsModal-DIRTulvr.cjs"),Et=require("./select-Bnfk0lJx.cjs"),Ot=require("./threshold-DNsSUf8Q.cjs"),it=require("./proxy-C4-uo6nS.cjs"),Ht=require("./use-in-view-C3o_ntMv.cjs"),Vt=require("./index-CoobIWNj.cjs"),Ut=require("./GraphHeader.cjs"),Xt=require("./GraphFooter.cjs"),kt=require("./Colors.cjs"),Bt=require("./fetchAndParseData-QTF6tjij.cjs"),qt=require("./getJenks-BzJvhy_H.cjs"),It=require("./GraphContainer-B1EDxJ0S.cjs");function Yt(s){const{data:e,xDomain:p,mapData:F,xColorLegendTitle:ze,yDomain:Q,yColorLegendTitle:ee,width:f,height:u,colors:h,scale:Pe,centerPoint:k,mapBorderWidth:M,mapNoDataColor:te,mapBorderColor:oe,tooltip:re,onSeriesMouseOver:fe,zoomScaleExtend:ge,zoomTranslateExtend:ye,highlightedIds:C,onSeriesMouseClick:ae,mapProperty:N,resetSelectionOnDoubleClick:We,detailsOnClick:j,showColorScale:ve,styles:Ae,classNames:L,mapProjection:$,zoomInteraction:O,animate:B,dimmedOpacity:q,customLayers:ne,collapseColorScaleByDefault:je,zoomAndCenterByHighlightedIds:be,projectionRotate:T,rewindCoordinatesInMapData:U,overlayMapData:X,overlayMapBorderColor:Fe,overlayMapBorderWidth:Le}=s,v=a.useMemo(()=>U?S.index_default(F,{reverse:!0}):F,[F,U]),$e=a.useMemo(()=>!U||!X?X:S.index_default(X,{reverse:!0}),[X,U]),[Ee,d]=a.useState(je===void 0?!(f<680):!je),[c,ke]=a.useState(void 0),[se,ie]=a.useState(void 0),[Y,G]=a.useState(void 0),[J,K]=a.useState(void 0),[Ce,H]=a.useState(void 0),V=a.useRef(null),g=Ht.useInView(V,{once:B.once,amount:B.amount}),D=a.useRef(null),w=a.useRef(null);a.useEffect(()=>{const t=Et.select(D.current),r=Et.select(V.current),m=x=>{if(O==="noZoom")return!1;if(O==="button")return!x.type.includes("wheel");const y=x.type==="wheel",b=x.type.startsWith("touch"),Be=x.type==="mousedown"||x.type==="mousemove";return b?!0:y?O==="scroll"?!0:x.ctrlKey:Be&&!x.button&&!x.ctrlKey},E=S.zoom().scaleExtent(ge).translateExtent(ye||[[-20,-20],[f+20,u+20]]).filter(m).on("zoom",({transform:x})=>{t.attr("transform",x)});r.call(E),w.current=E},[u,f,O]);const I=S.index_default$1({...v,features:be?v.features.filter(t=>(C||[]).length===0||C.indexOf(t.properties[N])!==-1):v.features}),_=$t.index_default({...v,features:be?v.features.filter(t=>(C||[]).length===0||C.indexOf(t.properties[N])!==-1):v.features}),De=(I[2]-I[0])*1.15,we=(I[3]-I[1])*1.15,Re=f*190/960*360/De,Se=u*190/678*180/we,z=Pe*Math.min(Re,Se),Me=$==="mercator"?S.geoMercator().rotate(T).center(k||_.geometry.coordinates).translate([f/2,u/2]).scale(z):$==="equalEarth"?S.geoEqualEarth().rotate(T).center(k||_.geometry.coordinates).translate([f/2,u/2]).scale(z):$==="naturalEarth"?S.geoNaturalEarth1().rotate(T).center(k||_.geometry.coordinates).translate([f/2,u/2]).scale(z):$==="orthographic"?S.geoOrthographic().rotate(T).center(k||_.geometry.coordinates).translate([f/2,u/2]).scale(z):S.geoAlbersUsa().rotate(T).center(k||_.geometry.coordinates).translate([f/2,u/2]).scale(z),P=S.geoPath().projection(Me),le=Array.from({length:p.length},(t,r)=>r),Ne=Array.from({length:Q.length},(t,r)=>r),Oe=Ot.threshold().domain(p).range(le),ce=Ot.threshold().domain(Q).range(Ne),de=t=>{if(!V.current||!w.current)return;Et.select(V.current).call(w.current.scaleBy,t==="in"?1.2:1/1.2)};return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsxs("div",{className:"relative",children:[o.jsxRuntimeExports.jsx(it.motion.svg,{viewBox:`0 0 ${f} ${u}`,width:`${f}px`,height:`${u}px`,ref:V,direction:"ltr",children:o.jsxRuntimeExports.jsxs("g",{ref:D,children:[ne.filter(t=>t.position==="before").map(t=>t.layer),v.features.map((t,r)=>{if(!t.properties?.[N])return null;const m=P(t);return m?o.jsxRuntimeExports.jsx(it.motion.g,{opacity:c?q:C.length!==0?C.indexOf(t.properties[N])!==-1?1:q:1,children:o.jsxRuntimeExports.jsx("path",{d:m,style:{stroke:oe,strokeWidth:M,fill:te,vectorEffect:"non-scaling-stroke"}})},r):null}),o.jsxRuntimeExports.jsx(Vt.AnimatePresence,{children:e.map(t=>{const r=v.features.findIndex(b=>t.id===b.properties[N]);if(r===-1)return null;const m=P(v.features[r]);if(!m)return null;const E=Nt.checkIfNullOrUndefined(t.x)?void 0:Oe(t.x),x=Nt.checkIfNullOrUndefined(t.y)?void 0:ce(t.y),y=E!==void 0&&x!==void 0?h[x][E]:te;return o.jsxRuntimeExports.jsx(it.motion.g,{className:"undp-map-shapes",variants:{initial:{opacity:0},whileInView:{opacity:c?c===y?1:q:C.length!==0?C.indexOf(t.id)!==-1?1:q:1,transition:{duration:B.duration}}},initial:"initial",animate:g?"whileInView":"initial",exit:{opacity:0,transition:{duration:B.duration}},onMouseEnter:b=>{G(t),H(b.clientY),K(b.clientX),fe?.(t)},onClick:()=>{(ae||j)&&(Lt.isEqual(se,t)&&We?(ie(void 0),ae?.(void 0)):(ie(t),ae?.(t)))},onMouseMove:b=>{G(t),H(b.clientY),K(b.clientX)},onMouseLeave:()=>{G(void 0),K(void 0),H(void 0),fe?.(void 0)},children:o.jsxRuntimeExports.jsx(it.motion.path,{d:m,variants:{initial:{fill:y,opacity:0},whileInView:{fill:y,opacity:1,transition:{duration:B.duration}}},initial:"initial",animate:g?"whileInView":"initial",exit:{opacity:0,transition:{duration:B.duration}},className:`${y===te?"stroke-primary-gray-400 dark:stroke-primary-gray-500":"stroke-primary-white dark:stroke-primary-gray-650"}`,style:{stroke:oe,strokeWidth:M,vectorEffect:"non-scaling-stroke"}},`${t.id}`)},t.id)})}),Y?v.features.filter(t=>t.properties[N]===Y.id).map((t,r)=>o.jsxRuntimeExports.jsx("path",{d:P(t)||"",className:"stroke-primary-gray-700 dark:stroke-primary-gray-300",style:{fill:"none",fillOpacity:0,strokeWidth:"0.5",vectorEffect:"non-scaling-stroke"}},r)):null,$e?.features.map((t,r)=>{const m=P(t);return m?o.jsxRuntimeExports.jsx("g",{children:o.jsxRuntimeExports.jsx("path",{d:m,style:{stroke:Fe||oe,strokeWidth:Le||M+1,fill:"none",pointerEvents:"none",vectorEffect:"non-scaling-stroke"}})},r):null}),ne.filter(t=>t.position==="after").map(t=>t.layer)]})}),ve===!1?null:o.jsxRuntimeExports.jsx("div",{className:o.mo("absolute left-4 bottom-4 map-color-legend",L?.colorLegend),children:Ee?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:()=>{d(!1)},children:o.jsxRuntimeExports.jsx(Ct.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:"175px"},children:[o.jsxRuntimeExports.jsxs("div",{className:"flex gap-1 items-center",children:[o.jsxRuntimeExports.jsx("svg",{width:"136px",viewBox:"0 0 136 136",className:"shrink-0",children:o.jsxRuntimeExports.jsxs("g",{children:[h.map((t,r)=>o.jsxRuntimeExports.jsx("g",{transform:`translate(0,${100-r*25})`,children:t.map((m,E)=>o.jsxRuntimeExports.jsx("rect",{y:1,x:E*25+1,fill:m,width:23,height:23,strokeWidth:c===m?2:.25,style:{cursor:"pointer"},onMouseOver:()=>{ke(m)},onMouseLeave:()=>{ke(void 0)}},E))},r)),o.jsxRuntimeExports.jsx("g",{transform:"translate(0,125)",children:p.map((t,r)=>o.jsxRuntimeExports.jsx("text",{y:10,x:(r+1)*25,fontSize:10,textAnchor:"middle",children:typeof t=="string"||t<1?t:Mt.numberFormattingFunction(t,"NA")},r))}),Q.map((t,r)=>o.jsxRuntimeExports.jsx("g",{transform:`translate(${Math.max(Math.min(p.length+1,5),4)*25+10},${100-r*25})`,children:o.jsxRuntimeExports.jsx("text",{x:0,transform:"rotate(-90)",y:0,fontSize:10,textAnchor:"middle",children:typeof t=="string"||t<1?t:Mt.numberFormattingFunction(t,"NA")})},r))]})}),o.jsxRuntimeExports.jsx(St._,{marginBottom:"none",size:"xs",className:"leading-normal text-center shrink-0",style:{display:"-webkit-box",WebkitLineClamp:"1",WebkitBoxOrient:"vertical",overflow:"hidden",writingMode:"vertical-rl",height:"8.5rem",transform:"rotate(180deg)"},children:ee})]}),o.jsxRuntimeExports.jsx(St._,{marginBottom:"none",size:"xs",className:"mt-1 leading-normal text-center",style:{display:"-webkit-box",WebkitLineClamp:"1",width:"8.5rem",WebkitBoxOrient:"vertical",overflow:"hidden"},children:ze})]})]}):o.jsxRuntimeExports.jsx("button",{type:"button",className:"mb-0 border-0 bg-transparent p-0 self-start",onClick:()=>{d(!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"})})}),O==="button"&&o.jsxRuntimeExports.jsxs("div",{className:"absolute left-4 top-4 flex flex-col zoom-buttons",children:[o.jsxRuntimeExports.jsx("button",{onClick:()=>de("in"),className:"leading-0 px-2 py-3.5 border text-primary-gray-700 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:()=>de("out"),className:"leading-0 px-2 py-3.5 border text-primary-gray-700 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:"–"})]})]}),Y&&re&&J&&Ce?o.jsxRuntimeExports.jsx(Tt.Tooltip,{data:Y,body:re,xPos:J,yPos:Ce,backgroundStyle:Ae?.tooltip,className:L?.tooltip}):null,j&&se!==void 0?o.jsxRuntimeExports.jsx(Gt.DetailsModal,{body:j,data:se,setData:ie,className:L?.modal}):null]})}function Jt(s){const e=o.compilerRuntimeExports.c(130),{data:p,graphTitle:F,mapData:ze,colors:Q,sources:ee,graphDescription:f,height:u,width:h,footNote:Pe,xDomain:k,yDomain:M,xColorLegendTitle:te,yColorLegendTitle:oe,tooltip:re,scale:fe,centerPoint:ge,padding:ye,mapBorderWidth:C,mapNoDataColor:ae,backgroundColor:N,mapBorderColor:We,relativeHeight:j,onSeriesMouseOver:ve,isWorldMap:Ae,zoomScaleExtend:L,zoomTranslateExtend:$,graphID:O,showColorScale:B,highlightedIds:q,onSeriesMouseClick:ne,mapProperty:je,graphDownload:be,dataDownload:T,showAntarctica:U,language:X,minHeight:Fe,theme:Le,ariaLabel:v,resetSelectionOnDoubleClick:$e,detailsOnClick:Ee,styles:d,classNames:c,mapProjection:ke,zoomInteraction:se,animate:ie,dimmedOpacity:Y,customLayers:G,timeline:J,collapseColorScaleByDefault:K,zoomAndCenterByHighlightedIds:Ce,projectionRotate:H,rewindCoordinatesInMapData:V,mapOverlay:g}=s,D=ze===void 0?"https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-v2.json":ze,w=Q===void 0?kt.Colors.light.bivariateColors.colors05x05:Q,I=Pe===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.":Pe,_=te===void 0?"X Color key":te,De=oe===void 0?"Y Color key":oe,we=fe===void 0?.95:fe,Re=C===void 0?.5:C,Se=ae===void 0?kt.Colors.light.graphNoData:ae,z=N===void 0?!1:N,Me=We===void 0?kt.Colors.light.grays["gray-500"]:We,P=Ae===void 0?!0:Ae;let le;e[0]!==L?(le=L===void 0?[.8,6]:L,e[0]=L,e[1]=le):le=e[1];const Ne=le,Oe=B===void 0?!0:B;let ce;e[2]!==q?(ce=q===void 0?[]:q,e[2]=q,e[3]=ce):ce=e[3];const de=ce,t=je===void 0?"ISO3":je,r=be===void 0?!1:be,m=T===void 0?!1:T,E=U===void 0?!1:U,x=X===void 0?"en":X,y=Fe===void 0?0:Fe,b=Le===void 0?"light":Le,Be=$e===void 0?!0:$e,lt=ke===void 0?"naturalEarth":ke,ct=se===void 0?"button":se,Te=ie===void 0?!1:ie,dt=Y===void 0?.3:Y;let Ge;e[4]!==G?(Ge=G===void 0?[]:G,e[4]=G,e[5]=Ge):Ge=e[5];const mt=Ge;let He;e[6]!==J?(He=J===void 0?{enabled:!1,autoplay:!1,showOnlyActiveDate:!0}:J,e[6]=J,e[7]=He):He=e[7];const n=He,pt=Ce===void 0?!1:Ce;let Ve;e[8]!==H?(Ve=H===void 0?[0,0]:H,e[8]=H,e[9]=Ve):Ve=e[9];const ut=Ve,ht=V===void 0?!0:V,[Z,_t]=a.useState(0),[qe,zt]=a.useState(0),[W,Pt]=a.useState(n.autoplay);let Ie;if(e[10]!==p||e[11]!==n.dateFormat){let i;e[13]!==n.dateFormat?(i=R=>Rt.parse(`${R.date}`,n.dateFormat||"yyyy",new Date).getTime(),e[13]=n.dateFormat,e[14]=i):i=e[14],Ie=[...new Set(p.filter(so).map(i))],Ie.sort(no),e[10]=p,e[11]=n.dateFormat,e[12]=Ie}else Ie=e[12];const l=Ie,[A,xt]=a.useState(n.autoplay?0:l.length-1),[me,Wt]=a.useState(void 0),[ft,At]=a.useState(void 0),gt=a.useRef(null),Dt=a.useRef(null);let Ue,Xe;e[15]===Symbol.for("react.memo_cache_sentinel")?(Ue=()=>{const i=new ResizeObserver(R=>{_t(R[0].target.clientWidth||620),zt(R[0].target.clientHeight||480)});return gt.current&&i.observe(gt.current),()=>i.disconnect()},Xe=[],e[15]=Ue,e[16]=Xe):(Ue=e[15],Xe=e[16]),a.useEffect(Ue,Xe);let Ye;e[17]===Symbol.for("react.memo_cache_sentinel")?(Ye=i=>{Wt(i)},e[17]=Ye):Ye=e[17];const Je=a.useEffectEvent(Ye);let Ke;e[18]===Symbol.for("react.memo_cache_sentinel")?(Ke=i=>{At(i)},e[18]=Ke):Ke=e[18];const _e=a.useEffectEvent(Ke);let Ze;e[19]!==D||e[20]!==Je?(Ze=()=>{typeof D=="string"?Bt.fetchAndParseJSON(D).then(R=>{Je(R)}):Je(D)},e[19]=D,e[20]=Je,e[21]=Ze):Ze=e[21];let Qe;e[22]!==D?(Qe=[D],e[22]=D,e[23]=Qe):Qe=e[23],a.useEffect(Ze,Qe);let et;e[24]!==g?.mapData||e[25]!==_e?(et=()=>{g?.mapData||_e(void 0),typeof g?.mapData=="string"?Bt.fetchAndParseJSON(g?.mapData).then(R=>{_e(R)}):_e(g?.mapData)},e[24]=g?.mapData,e[25]=_e,e[26]=et):et=e[26];const yt=g?.mapData;let tt;e[27]!==yt?(tt=[yt],e[27]=yt,e[28]=tt):tt=e[28],a.useEffect(et,tt);let ot,rt;e[29]!==W||e[30]!==n.speed||e[31]!==l?(ot=()=>{const i=setInterval(()=>{xt(R=>R<l.length-1?R+1:0)},(n.speed||2)*1e3);return W||clearInterval(i),()=>clearInterval(i)},rt=[l,W,n.speed],e[29]=W,e[30]=n.speed,e[31]=l,e[32]=ot,e[33]=rt):(ot=e[32],rt=e[33]),a.useEffect(ot,rt);const vt=n.dateFormat||"yyyy";let at;e[34]!==A||e[35]!==vt||e[36]!==n.showOnlyActiveDate||e[37]!==l?(at=wt.getSliderMarks(l,A,n.showOnlyActiveDate,vt),e[34]=A,e[35]=vt,e[36]=n.showOnlyActiveDate,e[37]=l,e[38]=at):at=e[38];const nt=at;if(k&&M&&(k.length!==w[0].length-1||M.length!==w.length-1))return console.error("the xDomain and yDomain array length don't match to the color array length"),null;const jt=c?.graphContainer,bt=d?.graphContainer;let pe;e[39]!==c?.description||e[40]!==c?.title||e[41]!==p||e[42]!==m||e[43]!==f||e[44]!==r||e[45]!==F||e[46]!==d?.description||e[47]!==d?.title||e[48]!==h?(pe=F||f||r||m?o.jsxRuntimeExports.jsx(Ut.GraphHeader,{styles:{title:d?.title,description:d?.description},classNames:{title:c?.title,description:c?.description},graphTitle:F,graphDescription:f,width:h,graphDownload:r?Dt:void 0,dataDownload:m?p.map(ao).filter(ro).length>0?p.map(oo).filter(to):p.filter(eo):null}):null,e[39]=c?.description,e[40]=c?.title,e[41]=p,e[42]=m,e[43]=f,e[44]=r,e[45]=F,e[46]=d?.description,e[47]=d?.title,e[48]=h,e[49]=pe):pe=e[49];let ue;e[50]!==A||e[51]!==nt||e[52]!==W||e[53]!==n.enabled||e[54]!==l?(ue=n.enabled&&l.length>0&&nt?o.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[o.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{Pt(!W)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":W?"Click to pause animation":"Click to play animation",children:W?o.jsxRuntimeExports.jsx(Ct.Pause,{}):o.jsxRuntimeExports.jsx(Ct.Play,{})}),o.jsxRuntimeExports.jsx(wt.Nr,{min:l[0],max:l[l.length-1],marks:nt,step:null,defaultValue:l[l.length-1],value:l[A],onChangeComplete:i=>{xt(l.indexOf(i))},onChange:i=>{xt(l.indexOf(i))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,e[50]=A,e[51]=nt,e[52]=W,e[53]=n.enabled,e[54]=l,e[55]=ue):ue=e[55];let he;e[56]!==Te||e[57]!==ge||e[58]!==c||e[59]!==K||e[60]!==w||e[61]!==mt||e[62]!==p||e[63]!==Ee||e[64]!==dt||e[65]!==u||e[66]!==de||e[67]!==A||e[68]!==P||e[69]!==Me||e[70]!==Re||e[71]!==Se||e[72]!==g?.mapBorderColor||e[73]!==g?.mapBorderWidth||e[74]!==lt||e[75]!==t||e[76]!==me||e[77]!==y||e[78]!==ne||e[79]!==ve||e[80]!==ft||e[81]!==ut||e[82]!==j||e[83]!==Be||e[84]!==ht||e[85]!==we||e[86]!==E||e[87]!==Oe||e[88]!==d||e[89]!==qe||e[90]!==Z||e[91]!==n.dateFormat||e[92]!==n.enabled||e[93]!==re||e[94]!==l||e[95]!==h||e[96]!==_||e[97]!==k||e[98]!==De||e[99]!==M||e[100]!==pt||e[101]!==ct||e[102]!==Ne||e[103]!==$?(he=o.jsxRuntimeExports.jsx(It.GraphArea,{ref:gt,children:Z&&qe&&me?o.jsxRuntimeExports.jsx(Yt,{data:p.filter(i=>n.enabled?`${i.date}`===Rt.format(new Date(l[A]),n.dateFormat||"yyyy"):i),mapData:E?me:{...me,features:me.features.filter(Qt)},xDomain:k||qt.getJenks(p.map(Zt),w[0].length),yDomain:M||qt.getJenks(p.map(Kt),w.length),width:Z,height:qe,scale:we,centerPoint:ge,colors:w,xColorLegendTitle:_,yColorLegendTitle:De,mapBorderWidth:Re,mapNoDataColor:Se,mapBorderColor:Me,tooltip:re,onSeriesMouseOver:ve,isWorldMap:P,zoomScaleExtend:Ne,zoomTranslateExtend:$,onSeriesMouseClick:ne,mapProperty:t,highlightedIds:de,resetSelectionOnDoubleClick:Be,styles:d,showColorScale:Oe,classNames:c,mapProjection:lt||(P?"naturalEarth":"mercator"),detailsOnClick:Ee,zoomInteraction:ct,overlayMapData:ft,overlayMapBorderColor:g?.mapBorderColor,overlayMapBorderWidth:g?.mapBorderWidth,animate:Te===!0?{duration:.5,once:!0,amount:.5}:Te||{duration:0,once:!0,amount:0},dimmedOpacity:dt,customLayers:mt,collapseColorScaleByDefault:K,zoomAndCenterByHighlightedIds:pt,projectionRotate:ut,rewindCoordinatesInMapData:ht}):o.jsxRuntimeExports.jsx("div",{style:{height:`${Math.max(y,u||(j?y?(h||Z)*j>y?(h||Z)*j:y:(h||Z)*j:qe))}px`},className:"flex items-center justify-center",children:o.jsxRuntimeExports.jsx(Ft.w,{"aria-label":"Loading graph"})})}),e[56]=Te,e[57]=ge,e[58]=c,e[59]=K,e[60]=w,e[61]=mt,e[62]=p,e[63]=Ee,e[64]=dt,e[65]=u,e[66]=de,e[67]=A,e[68]=P,e[69]=Me,e[70]=Re,e[71]=Se,e[72]=g?.mapBorderColor,e[73]=g?.mapBorderWidth,e[74]=lt,e[75]=t,e[76]=me,e[77]=y,e[78]=ne,e[79]=ve,e[80]=ft,e[81]=ut,e[82]=j,e[83]=Be,e[84]=ht,e[85]=we,e[86]=E,e[87]=Oe,e[88]=d,e[89]=qe,e[90]=Z,e[91]=n.dateFormat,e[92]=n.enabled,e[93]=re,e[94]=l,e[95]=h,e[96]=_,e[97]=k,e[98]=De,e[99]=M,e[100]=pt,e[101]=ct,e[102]=Ne,e[103]=$,e[104]=he):he=e[104];let xe;e[105]!==c?.footnote||e[106]!==c?.source||e[107]!==I||e[108]!==ee||e[109]!==d?.footnote||e[110]!==d?.source||e[111]!==h?(xe=ee||I?o.jsxRuntimeExports.jsx(Xt.GraphFooter,{styles:{footnote:d?.footnote,source:d?.source},classNames:{footnote:c?.footnote,source:c?.source},sources:ee,footNote:I,width:h}):null,e[105]=c?.footnote,e[106]=c?.source,e[107]=I,e[108]=ee,e[109]=d?.footnote,e[110]=d?.source,e[111]=h,e[112]=xe):xe=e[112];let st;return e[113]!==v||e[114]!==z||e[115]!==O||e[116]!==u||e[117]!==x||e[118]!==y||e[119]!==ye||e[120]!==j||e[121]!==jt||e[122]!==bt||e[123]!==pe||e[124]!==ue||e[125]!==he||e[126]!==xe||e[127]!==b||e[128]!==h?(st=o.jsxRuntimeExports.jsxs(It.GraphContainer,{className:jt,style:bt,id:O,ref:Dt,"aria-label":v,backgroundColor:z,theme:b,language:x,minHeight:y,width:h,height:u,relativeHeight:j,padding:ye,children:[pe,ue,he,xe]}),e[113]=v,e[114]=z,e[115]=O,e[116]=u,e[117]=x,e[118]=y,e[119]=ye,e[120]=j,e[121]=jt,e[122]=bt,e[123]=pe,e[124]=ue,e[125]=he,e[126]=xe,e[127]=b,e[128]=h,e[129]=st):st=e[129],st}function Kt(s){return s.y}function Zt(s){return s.x}function Qt(s){return s.properties.NAME!=="Antarctica"}function eo(s){return s!==void 0}function to(s){return s!==void 0}function oo(s){return s.data}function ro(s){return s!==void 0}function ao(s){return s.data}function no(s,e){return s-e}function so(s){return s.date}exports.BiVariateChoroplethMap=Jt;
2
2
  //# sourceMappingURL=BiVariateChoroplethMap.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"BiVariateChoroplethMap.cjs","sources":["../src/Components/Graphs/Maps/BiVariateMap/Graph.tsx","../src/Components/Graphs/Maps/BiVariateMap/index.tsx"],"sourcesContent":["import isEqual from 'fast-deep-equal';\r\nimport bbox from '@turf/bbox';\r\nimport centerOfMass from '@turf/center-of-mass';\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 { scaleThreshold } from 'd3-scale';\r\nimport { P } from '@undp/design-system-react/Typography';\r\nimport { AnimatePresence, motion, useInView } from 'motion/react';\r\nimport { cn } from '@undp/design-system-react/cn';\r\nimport { FeatureCollection } from 'geojson';\r\nimport rewind from '@turf/rewind';\r\n\r\nimport {\r\n AnimateDataType,\r\n BivariateMapDataType,\r\n ClassNameObject,\r\n CustomLayerDataType,\r\n MapProjectionTypes,\r\n StyleObject,\r\n ZoomInteractionTypes,\r\n} from '@/Types';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { X } from '@/Components/Icons';\r\nimport { DetailsModal } from '@/Components/Elements/DetailsModal';\r\n\r\ninterface Props {\r\n data: BivariateMapDataType[];\r\n mapData: FeatureCollection;\r\n xDomain: number[];\r\n yDomain: number[];\r\n width: number;\r\n height: number;\r\n colors: string[][];\r\n xColorLegendTitle: string;\r\n yColorLegendTitle: string;\r\n mapBorderWidth: number;\r\n mapNoDataColor: string;\r\n scale: number;\r\n centerPoint?: [number, number];\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 zoomInteraction: ZoomInteractionTypes;\r\n mapProjection: MapProjectionTypes;\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n isWorldMap: boolean;\r\n zoomScaleExtend: [number, number];\r\n zoomTranslateExtend?: [[number, number], [number, number]];\r\n highlightedIds: string[];\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n mapProperty: string;\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 showColorScale: boolean;\r\n collapseColorScaleByDefault?: boolean;\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n animate: AnimateDataType;\r\n dimmedOpacity: number;\r\n customLayers: CustomLayerDataType[];\r\n zoomAndCenterByHighlightedIds: boolean;\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 xDomain,\r\n mapData,\r\n xColorLegendTitle,\r\n yDomain,\r\n yColorLegendTitle,\r\n width,\r\n height,\r\n colors,\r\n scale,\r\n centerPoint,\r\n mapBorderWidth,\r\n mapNoDataColor,\r\n mapBorderColor,\r\n tooltip,\r\n onSeriesMouseOver,\r\n zoomScaleExtend,\r\n zoomTranslateExtend,\r\n highlightedIds,\r\n onSeriesMouseClick,\r\n mapProperty,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\r\n showColorScale,\r\n styles,\r\n classNames,\r\n mapProjection,\r\n zoomInteraction,\r\n animate,\r\n dimmedOpacity,\r\n customLayers,\r\n collapseColorScaleByDefault,\r\n zoomAndCenterByHighlightedIds,\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 [showLegend, setShowLegend] = useState(\r\n collapseColorScaleByDefault === undefined ? !(width < 680) : !collapseColorScaleByDefault,\r\n );\r\n const [selectedColor, setSelectedColor] = useState<string | undefined>(undefined);\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 zoomRef = useRef<ZoomBehavior<SVGSVGElement, unknown> | null>(null);\r\n\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({\r\n ...formattedMapData,\r\n features: zoomAndCenterByHighlightedIds\r\n ? formattedMapData.features.filter(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (d: any) =>\r\n (highlightedIds || []).length === 0 ||\r\n highlightedIds.indexOf(d.properties[mapProperty]) !== -1,\r\n )\r\n : formattedMapData.features,\r\n });\r\n\r\n const center = centerOfMass({\r\n ...formattedMapData,\r\n features: zoomAndCenterByHighlightedIds\r\n ? formattedMapData.features.filter(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (d: any) =>\r\n (highlightedIds || []).length === 0 ||\r\n highlightedIds.indexOf(d.properties[mapProperty]) !== -1,\r\n )\r\n : formattedMapData.features,\r\n });\r\n const lonDiff = (bounds[2] - bounds[0]) * 1.15;\r\n const latDiff = (bounds[3] - bounds[1]) * 1.15;\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\r\n const pathGenerator = geoPath().projection(projection);\r\n const xRange = Array.from({ length: xDomain.length }, (_, i) => i);\r\n\r\n const yRange = Array.from({ length: yDomain.length }, (_, i) => i);\r\n const xScale = scaleThreshold<number, number>().domain(xDomain).range(xRange);\r\n const yScale = scaleThreshold<number, number>().domain(yDomain).range(yRange);\r\n\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\r\n return (\r\n <>\r\n <div className='relative'>\r\n <motion.svg\r\n viewBox={`0 0 ${width} ${height}`}\r\n width={`${width}px`}\r\n height={`${height}px`}\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.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 xColorCoord = !checkIfNullOrUndefined(d.x)\r\n ? xScale(d.x as number)\r\n : undefined;\r\n const yColorCoord = !checkIfNullOrUndefined(d.y)\r\n ? yScale(d.y as number)\r\n : undefined;\r\n const color =\r\n xColorCoord !== undefined && yColorCoord !== undefined\r\n ? colors[yColorCoord][xColorCoord]\r\n : mapNoDataColor;\r\n\r\n return (\r\n <motion.g\r\n className='undp-map-shapes'\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) !== -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 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 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 >\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={{ opacity: 0, transition: { duration: animate.duration } }}\r\n className={`${\r\n color === mapNoDataColor\r\n ? 'stroke-primary-gray-400 dark:stroke-primary-gray-500'\r\n : 'stroke-primary-white dark:stroke-primary-gray-650'\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 </AnimatePresence>\r\n {mouseOverData\r\n ? formattedMapData.features\r\n .filter(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (d: { properties: any }) => d.properties[mapProperty] === mouseOverData.id,\r\n )\r\n .map((d, i) => (\r\n <path\r\n key={i}\r\n d={pathGenerator(d) || ''}\r\n className='stroke-primary-gray-700 dark:stroke-primary-gray-300'\r\n style={{\r\n fill: 'none',\r\n fillOpacity: 0,\r\n strokeWidth: '0.5',\r\n }}\r\n />\r\n ))\r\n : null}\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={{ width: '175px' }}\r\n >\r\n <div className='flex gap-1 items-center'>\r\n <svg width='136px' viewBox='0 0 136 136' className='shrink-0'>\r\n <g>\r\n {colors.map((d, i) => (\r\n <g key={i} transform={`translate(0,${100 - i * 25})`}>\r\n {d.map((el, j) => (\r\n <rect\r\n key={j}\r\n y={1}\r\n x={j * 25 + 1}\r\n fill={el}\r\n width={23}\r\n height={23}\r\n strokeWidth={selectedColor === el ? 2 : 0.25}\r\n style={{ cursor: 'pointer' }}\r\n onMouseOver={() => {\r\n setSelectedColor(el);\r\n }}\r\n onMouseLeave={() => {\r\n setSelectedColor(undefined);\r\n }}\r\n />\r\n ))}\r\n </g>\r\n ))}\r\n <g transform='translate(0,125)'>\r\n {xDomain.map((el, j) => (\r\n <text key={j} y={10} x={(j + 1) * 25} fontSize={10} textAnchor='middle'>\r\n {typeof el === 'string' || el < 1\r\n ? el\r\n : numberFormattingFunction(el, 'NA')}\r\n </text>\r\n ))}\r\n </g>\r\n {yDomain.map((el, j) => (\r\n <g\r\n key={j}\r\n transform={`translate(${\r\n Math.max(Math.min(xDomain.length + 1, 5), 4) * 25 + 10\r\n },${100 - j * 25})`}\r\n >\r\n <text\r\n x={0}\r\n transform='rotate(-90)'\r\n y={0}\r\n fontSize={10}\r\n textAnchor='middle'\r\n >\r\n {typeof el === 'string' || el < 1\r\n ? el\r\n : numberFormattingFunction(el, 'NA')}\r\n </text>\r\n </g>\r\n ))}\r\n </g>\r\n </svg>\r\n <P\r\n marginBottom='none'\r\n size='xs'\r\n className='leading-normal text-center shrink-0'\r\n style={{\r\n display: '-webkit-box',\r\n WebkitLineClamp: '1',\r\n WebkitBoxOrient: 'vertical',\r\n overflow: 'hidden',\r\n writingMode: 'vertical-rl',\r\n height: '8.5rem',\r\n transform: 'rotate(180deg)',\r\n }}\r\n >\r\n {yColorLegendTitle}\r\n </P>\r\n </div>\r\n <P\r\n marginBottom='none'\r\n size='xs'\r\n className='mt-1 leading-normal text-center'\r\n style={{\r\n display: '-webkit-box',\r\n WebkitLineClamp: '1',\r\n width: '8.5rem',\r\n WebkitBoxOrient: 'vertical',\r\n overflow: 'hidden',\r\n }}\r\n >\r\n {xColorLegendTitle}\r\n </P>\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'\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 border text-primary-gray-700 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 border text-primary-gray-700 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 {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 {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 </>\r\n );\r\n}\r\n","import { useEffect, useEffectEvent, useMemo, useRef, useState } from 'react';\r\nimport { SliderUI } from '@undp/design-system-react/SliderUI';\r\nimport { Spinner } from '@undp/design-system-react/Spinner';\r\nimport { format } from 'date-fns/format';\r\nimport { parse } from 'date-fns/parse';\r\n\r\nimport { Graph } from './Graph';\r\n\r\nimport {\r\n BivariateMapDataType,\r\n Languages,\r\n SourcesDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n MapProjectionTypes,\r\n ZoomInteractionTypes,\r\n CustomLayerDataType,\r\n AnimateDataType,\r\n TimelineDataType,\r\n} from '@/Types';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { fetchAndParseJSON } from '@/Utils/fetchAndParseData';\r\nimport { getJenks } from '@/Utils/getJenks';\r\nimport { Pause, Play } from '@/Components/Icons';\r\nimport { getSliderMarks } from '@/Utils/getSliderMarks';\r\nimport { GraphArea, GraphContainer } from '@/Components/Elements/GraphContainer';\r\n\r\ninterface Props {\r\n // Data\r\n /** Array of data objects. */\r\n data: BivariateMapDataType[];\r\n\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 /** Colors for the choropleth map. Array must be 5x5 */\r\n colors?: string[][];\r\n /** Title for the first color legend */\r\n xColorLegendTitle?: string;\r\n /** Title for the second color legend */\r\n yColorLegendTitle?: string;\r\n /** Domain of x-colors for the map */\r\n xDomain?: number[];\r\n /** Domain of y-colors for the map */\r\n yDomain?: number[];\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 /** 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 /** Toggle if the map is a world map */\r\n isWorldMap?: boolean;\r\n /** Map projection type */\r\n mapProjection?: MapProjectionTypes;\r\n /** Toggle if the map is centered and zoomed to the highlighted ids. */\r\n zoomAndCenterByHighlightedIds?: boolean;\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 /** Countries or regions to be highlighted */\r\n highlightedIds?: string[];\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 /** 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 /** Toggle visibility of color scale. */\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 /** 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 BiVariateChoroplethMap(props: Props) {\r\n const {\r\n data,\r\n graphTitle,\r\n mapData = 'https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-v2.json',\r\n colors = Colors.light.bivariateColors.colors05x05,\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 xDomain,\r\n yDomain,\r\n xColorLegendTitle = 'X Color key',\r\n yColorLegendTitle = 'Y Color key',\r\n tooltip,\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 mapBorderColor = Colors.light.grays['gray-500'],\r\n relativeHeight,\r\n onSeriesMouseOver,\r\n isWorldMap = true,\r\n zoomScaleExtend = [0.8, 6],\r\n zoomTranslateExtend,\r\n graphID,\r\n showColorScale = true,\r\n highlightedIds = [],\r\n onSeriesMouseClick,\r\n mapProperty = 'ISO3',\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 timeline = { enabled: false, autoplay: false, showOnlyActiveDate: true },\r\n collapseColorScaleByDefault,\r\n zoomAndCenterByHighlightedIds = false,\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 // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mapShape, setMapShape] = useState<any>(undefined);\r\n\r\n const graphDiv = useRef<HTMLDivElement>(null);\r\n const graphParentDiv = useRef<HTMLDivElement>(null);\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);\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\r\n if (xDomain && yDomain)\r\n if (xDomain.length !== colors[0].length - 1 || yDomain.length !== colors.length - 1) {\r\n console.error(\"the xDomain and yDomain array length don't match to the color array length\");\r\n return null;\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 data={data.filter(d =>\r\n timeline.enabled\r\n ? `${d.date}` ===\r\n 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 xDomain={\r\n xDomain ||\r\n getJenks(\r\n data.map(d => d.x as number | null | undefined),\r\n colors[0].length,\r\n )\r\n }\r\n yDomain={\r\n yDomain ||\r\n getJenks(\r\n data.map(d => d.y as number | null | undefined),\r\n colors.length,\r\n )\r\n }\r\n width={svgWidth}\r\n height={svgHeight}\r\n scale={scale}\r\n centerPoint={centerPoint}\r\n colors={colors}\r\n xColorLegendTitle={xColorLegendTitle}\r\n yColorLegendTitle={yColorLegendTitle}\r\n mapBorderWidth={mapBorderWidth}\r\n mapNoDataColor={mapNoDataColor}\r\n mapBorderColor={mapBorderColor}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n isWorldMap={isWorldMap}\r\n zoomScaleExtend={zoomScaleExtend}\r\n zoomTranslateExtend={zoomTranslateExtend}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n mapProperty={mapProperty}\r\n highlightedIds={highlightedIds}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n styles={styles}\r\n showColorScale={showColorScale}\r\n classNames={classNames}\r\n mapProjection={mapProjection || (isWorldMap ? 'naturalEarth' : 'mercator')}\r\n detailsOnClick={detailsOnClick}\r\n zoomInteraction={zoomInteraction}\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 collapseColorScaleByDefault={collapseColorScaleByDefault}\r\n zoomAndCenterByHighlightedIds={zoomAndCenterByHighlightedIds}\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":["Graph","props","data","xDomain","mapData","xColorLegendTitle","yDomain","yColorLegendTitle","width","height","colors","scale","centerPoint","mapBorderWidth","mapNoDataColor","mapBorderColor","tooltip","onSeriesMouseOver","zoomScaleExtend","zoomTranslateExtend","highlightedIds","onSeriesMouseClick","mapProperty","resetSelectionOnDoubleClick","detailsOnClick","showColorScale","styles","classNames","mapProjection","zoomInteraction","animate","dimmedOpacity","customLayers","collapseColorScaleByDefault","zoomAndCenterByHighlightedIds","projectionRotate","rewindCoordinatesInMapData","formattedMapData","useMemo","rewind","reverse","showLegend","setShowLegend","useState","undefined","selectedColor","setSelectedColor","mouseClickData","setMouseClickData","mouseOverData","setMouseOverData","eventX","setEventX","eventY","setEventY","mapSvg","useRef","isInView","useInView","once","amount","mapG","zoomRef","useEffect","mapGSelect","select","current","mapSvgSelect","zoomFilter","e","type","includes","isWheel","isTouch","startsWith","isDrag","ctrlKey","button","zoomBehavior","zoom","scaleExtent","translateExtent","filter","on","transform","attr","call","bounds","bbox","features","d","length","indexOf","properties","center","centerOfMass","lonDiff","latDiff","scaleX","scaleY","scaleVar","Math","min","projection","geoMercator","rotate","geometry","coordinates","translate","geoEqualEarth","geoNaturalEarth1","geoOrthographic","geoAlbersUsa","pathGenerator","geoPath","xRange","Array","from","_","i","yRange","xScale","scaleThreshold","domain","range","yScale","handleZoom","direction","scaleBy","jsxs","Fragment","jsx","motion","position","map","layer","path","stroke","strokeWidth","fill","AnimatePresence","index","findIndex","el","id","xColorCoord","checkIfNullOrUndefined","x","yColorCoord","y","color","initial","opacity","whileInView","transition","duration","event","clientY","clientX","isEqual","fillOpacity","cn","colorLegend","X","j","cursor","numberFormattingFunction","max","P","display","WebkitLineClamp","WebkitBoxOrient","overflow","writingMode","Tooltip","DetailsModal","modal","BiVariateChoroplethMap","$","_c","graphTitle","t0","t1","sources","graphDescription","footNote","t2","t3","t4","t5","padding","t6","t7","backgroundColor","t8","t9","relativeHeight","isWorldMap","t10","t11","graphID","t12","t13","t14","graphDownload","t15","dataDownload","t16","showAntarctica","t17","language","t18","minHeight","t19","theme","t20","ariaLabel","t21","t22","t23","t24","t25","t26","timeline","t27","t28","t29","t30","Colors","light","bivariateColors","colors05x05","graphNoData","grays","t31","t32","t33","t34","enabled","autoplay","showOnlyActiveDate","t35","svgWidth","setSvgWidth","svgHeight","setSvgHeight","play","setPlay","dates","dateFormat","t36","d_0","parse","date","Date","getTime","Set","_temp","sort","_temp2","uniqDatesSorted","setIndex","mapShape","setMapShape","graphDiv","graphParentDiv","t37","Symbol","for","resizeObserver","ResizeObserver","entries","target","clientWidth","clientHeight","observe","disconnect","t38","shape","onUpdateShape","useEffectEvent","t39","fetchAndParseJSON","then","d_1","t40","t41","t42","speed","interval","setInterval","clearInterval","t43","t44","getSliderMarks","markObj","console","error","t45","graphContainer","t46","t47","description","title","GraphHeader","_temp3","_temp4","_temp5","_temp6","_temp7","t48","Pause","Play","SliderUI","nextValue","nextValue_0","t49","GraphArea","d_7","format","_temp8","getJenks","_temp9","_temp0","Spinner","t50","footnote","source","GraphFooter","t51","GraphContainer","d_9","d_8","NAME","d_4","d_3","d_2","d_6","d_5","a","b"],"mappings":"0gCAiFO,SAASA,GAAMC,EAAc,CAClC,KAAM,CAC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AC,EAAA,CAAA,OAmEkBD,EAAIC,CAAC,CAnEvB,SAAAnF,GAAAvK,EAAA,CAAA,OA+DgBA,EAACmK,IAAK"}
1
+ {"version":3,"file":"BiVariateChoroplethMap.cjs","sources":["../src/Components/Graphs/Maps/BiVariateMap/Graph.tsx","../src/Components/Graphs/Maps/BiVariateMap/index.tsx"],"sourcesContent":["import isEqual from 'fast-deep-equal';\r\nimport bbox from '@turf/bbox';\r\nimport centerOfMass from '@turf/center-of-mass';\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 { scaleThreshold } from 'd3-scale';\r\nimport { P } from '@undp/design-system-react/Typography';\r\nimport { AnimatePresence, motion, useInView } from 'motion/react';\r\nimport { cn } from '@undp/design-system-react/cn';\r\nimport { FeatureCollection } from 'geojson';\r\nimport rewind from '@turf/rewind';\r\n\r\nimport {\r\n AnimateDataType,\r\n BivariateMapDataType,\r\n ClassNameObject,\r\n CustomLayerDataType,\r\n MapProjectionTypes,\r\n StyleObject,\r\n ZoomInteractionTypes,\r\n} from '@/Types';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { X } from '@/Components/Icons';\r\nimport { DetailsModal } from '@/Components/Elements/DetailsModal';\r\n\r\ninterface Props {\r\n data: BivariateMapDataType[];\r\n mapData: FeatureCollection;\r\n xDomain: number[];\r\n yDomain: number[];\r\n width: number;\r\n height: number;\r\n colors: string[][];\r\n xColorLegendTitle: string;\r\n yColorLegendTitle: string;\r\n mapBorderWidth: number;\r\n mapNoDataColor: string;\r\n scale: number;\r\n centerPoint?: [number, number];\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 zoomInteraction: ZoomInteractionTypes;\r\n mapProjection: MapProjectionTypes;\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n isWorldMap: boolean;\r\n zoomScaleExtend: [number, number];\r\n zoomTranslateExtend?: [[number, number], [number, number]];\r\n highlightedIds: string[];\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n mapProperty: string;\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 showColorScale: boolean;\r\n collapseColorScaleByDefault?: boolean;\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n animate: AnimateDataType;\r\n dimmedOpacity: number;\r\n customLayers: CustomLayerDataType[];\r\n zoomAndCenterByHighlightedIds: boolean;\r\n projectionRotate: [number, number] | [number, number, number];\r\n rewindCoordinatesInMapData: boolean;\r\n overlayMapData?: FeatureCollection;\r\n overlayMapBorderColor?: string;\r\n overlayMapBorderWidth?: number;\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n const {\r\n data,\r\n xDomain,\r\n mapData,\r\n xColorLegendTitle,\r\n yDomain,\r\n yColorLegendTitle,\r\n width,\r\n height,\r\n colors,\r\n scale,\r\n centerPoint,\r\n mapBorderWidth,\r\n mapNoDataColor,\r\n mapBorderColor,\r\n tooltip,\r\n onSeriesMouseOver,\r\n zoomScaleExtend,\r\n zoomTranslateExtend,\r\n highlightedIds,\r\n onSeriesMouseClick,\r\n mapProperty,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\r\n showColorScale,\r\n styles,\r\n classNames,\r\n mapProjection,\r\n zoomInteraction,\r\n animate,\r\n dimmedOpacity,\r\n customLayers,\r\n collapseColorScaleByDefault,\r\n zoomAndCenterByHighlightedIds,\r\n projectionRotate,\r\n rewindCoordinatesInMapData,\r\n overlayMapData,\r\n overlayMapBorderColor,\r\n overlayMapBorderWidth,\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 formattedOverlayMapData = useMemo(() => {\r\n if (!rewindCoordinatesInMapData || !overlayMapData) return overlayMapData;\r\n\r\n return rewind(overlayMapData, { reverse: true }) as FeatureCollection;\r\n }, [overlayMapData, rewindCoordinatesInMapData]);\r\n const [showLegend, setShowLegend] = useState(\r\n collapseColorScaleByDefault === undefined ? !(width < 680) : !collapseColorScaleByDefault,\r\n );\r\n const [selectedColor, setSelectedColor] = useState<string | undefined>(undefined);\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 zoomRef = useRef<ZoomBehavior<SVGSVGElement, unknown> | null>(null);\r\n\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({\r\n ...formattedMapData,\r\n features: zoomAndCenterByHighlightedIds\r\n ? formattedMapData.features.filter(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (d: any) =>\r\n (highlightedIds || []).length === 0 ||\r\n highlightedIds.indexOf(d.properties[mapProperty]) !== -1,\r\n )\r\n : formattedMapData.features,\r\n });\r\n\r\n const center = centerOfMass({\r\n ...formattedMapData,\r\n features: zoomAndCenterByHighlightedIds\r\n ? formattedMapData.features.filter(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (d: any) =>\r\n (highlightedIds || []).length === 0 ||\r\n highlightedIds.indexOf(d.properties[mapProperty]) !== -1,\r\n )\r\n : formattedMapData.features,\r\n });\r\n const lonDiff = (bounds[2] - bounds[0]) * 1.15;\r\n const latDiff = (bounds[3] - bounds[1]) * 1.15;\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\r\n const pathGenerator = geoPath().projection(projection);\r\n const xRange = Array.from({ length: xDomain.length }, (_, i) => i);\r\n\r\n const yRange = Array.from({ length: yDomain.length }, (_, i) => i);\r\n const xScale = scaleThreshold<number, number>().domain(xDomain).range(xRange);\r\n const yScale = scaleThreshold<number, number>().domain(yDomain).range(yRange);\r\n\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\r\n return (\r\n <>\r\n <div className='relative'>\r\n <motion.svg\r\n viewBox={`0 0 ${width} ${height}`}\r\n width={`${width}px`}\r\n height={`${height}px`}\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 vectorEffect: 'non-scaling-stroke',\r\n }}\r\n />\r\n </motion.g>\r\n );\r\n })}\r\n <AnimatePresence>\r\n {data.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 xColorCoord = !checkIfNullOrUndefined(d.x)\r\n ? xScale(d.x as number)\r\n : undefined;\r\n const yColorCoord = !checkIfNullOrUndefined(d.y)\r\n ? yScale(d.y as number)\r\n : undefined;\r\n const color =\r\n xColorCoord !== undefined && yColorCoord !== undefined\r\n ? colors[yColorCoord][xColorCoord]\r\n : mapNoDataColor;\r\n\r\n return (\r\n <motion.g\r\n className='undp-map-shapes'\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) !== -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 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 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 >\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={{ opacity: 0, transition: { duration: animate.duration } }}\r\n className={`${\r\n color === mapNoDataColor\r\n ? 'stroke-primary-gray-400 dark:stroke-primary-gray-500'\r\n : 'stroke-primary-white dark:stroke-primary-gray-650'\r\n }`}\r\n style={{\r\n stroke: mapBorderColor,\r\n strokeWidth: mapBorderWidth,\r\n vectorEffect: 'non-scaling-stroke',\r\n }}\r\n />\r\n </motion.g>\r\n );\r\n })}\r\n </AnimatePresence>\r\n {mouseOverData\r\n ? formattedMapData.features\r\n .filter(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (d: { properties: any }) => d.properties[mapProperty] === mouseOverData.id,\r\n )\r\n .map((d, i) => (\r\n <path\r\n key={i}\r\n d={pathGenerator(d) || ''}\r\n className='stroke-primary-gray-700 dark:stroke-primary-gray-300'\r\n style={{\r\n fill: 'none',\r\n fillOpacity: 0,\r\n strokeWidth: '0.5',\r\n vectorEffect: 'non-scaling-stroke',\r\n }}\r\n />\r\n ))\r\n : null}\r\n {formattedOverlayMapData?.features.map((d, i: number) => {\r\n const path = pathGenerator(d);\r\n if (!path) return null;\r\n return (\r\n <g key={i}>\r\n <path\r\n d={path}\r\n style={{\r\n stroke: overlayMapBorderColor || mapBorderColor,\r\n strokeWidth: overlayMapBorderWidth || mapBorderWidth + 1,\r\n fill: 'none',\r\n pointerEvents: 'none',\r\n vectorEffect: 'non-scaling-stroke',\r\n }}\r\n />\r\n </g>\r\n );\r\n })}\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={{ width: '175px' }}\r\n >\r\n <div className='flex gap-1 items-center'>\r\n <svg width='136px' viewBox='0 0 136 136' className='shrink-0'>\r\n <g>\r\n {colors.map((d, i) => (\r\n <g key={i} transform={`translate(0,${100 - i * 25})`}>\r\n {d.map((el, j) => (\r\n <rect\r\n key={j}\r\n y={1}\r\n x={j * 25 + 1}\r\n fill={el}\r\n width={23}\r\n height={23}\r\n strokeWidth={selectedColor === el ? 2 : 0.25}\r\n style={{ cursor: 'pointer' }}\r\n onMouseOver={() => {\r\n setSelectedColor(el);\r\n }}\r\n onMouseLeave={() => {\r\n setSelectedColor(undefined);\r\n }}\r\n />\r\n ))}\r\n </g>\r\n ))}\r\n <g transform='translate(0,125)'>\r\n {xDomain.map((el, j) => (\r\n <text key={j} y={10} x={(j + 1) * 25} fontSize={10} textAnchor='middle'>\r\n {typeof el === 'string' || el < 1\r\n ? el\r\n : numberFormattingFunction(el, 'NA')}\r\n </text>\r\n ))}\r\n </g>\r\n {yDomain.map((el, j) => (\r\n <g\r\n key={j}\r\n transform={`translate(${\r\n Math.max(Math.min(xDomain.length + 1, 5), 4) * 25 + 10\r\n },${100 - j * 25})`}\r\n >\r\n <text\r\n x={0}\r\n transform='rotate(-90)'\r\n y={0}\r\n fontSize={10}\r\n textAnchor='middle'\r\n >\r\n {typeof el === 'string' || el < 1\r\n ? el\r\n : numberFormattingFunction(el, 'NA')}\r\n </text>\r\n </g>\r\n ))}\r\n </g>\r\n </svg>\r\n <P\r\n marginBottom='none'\r\n size='xs'\r\n className='leading-normal text-center shrink-0'\r\n style={{\r\n display: '-webkit-box',\r\n WebkitLineClamp: '1',\r\n WebkitBoxOrient: 'vertical',\r\n overflow: 'hidden',\r\n writingMode: 'vertical-rl',\r\n height: '8.5rem',\r\n transform: 'rotate(180deg)',\r\n }}\r\n >\r\n {yColorLegendTitle}\r\n </P>\r\n </div>\r\n <P\r\n marginBottom='none'\r\n size='xs'\r\n className='mt-1 leading-normal text-center'\r\n style={{\r\n display: '-webkit-box',\r\n WebkitLineClamp: '1',\r\n width: '8.5rem',\r\n WebkitBoxOrient: 'vertical',\r\n overflow: 'hidden',\r\n }}\r\n >\r\n {xColorLegendTitle}\r\n </P>\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'\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 border text-primary-gray-700 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 border text-primary-gray-700 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 {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 {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 </>\r\n );\r\n}\r\n","import { useEffect, useEffectEvent, useMemo, useRef, useState } from 'react';\r\nimport { SliderUI } from '@undp/design-system-react/SliderUI';\r\nimport { Spinner } from '@undp/design-system-react/Spinner';\r\nimport { format } from 'date-fns/format';\r\nimport { parse } from 'date-fns/parse';\r\nimport { FeatureCollection } from 'geojson';\r\n\r\nimport { Graph } from './Graph';\r\n\r\nimport {\r\n BivariateMapDataType,\r\n Languages,\r\n SourcesDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n MapProjectionTypes,\r\n ZoomInteractionTypes,\r\n CustomLayerDataType,\r\n AnimateDataType,\r\n TimelineDataType,\r\n} from '@/Types';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { fetchAndParseJSON } from '@/Utils/fetchAndParseData';\r\nimport { getJenks } from '@/Utils/getJenks';\r\nimport { Pause, Play } from '@/Components/Icons';\r\nimport { getSliderMarks } from '@/Utils/getSliderMarks';\r\nimport { GraphArea, GraphContainer } from '@/Components/Elements/GraphContainer';\r\n\r\ninterface Props {\r\n // Data\r\n /** Array of data objects. */\r\n data: BivariateMapDataType[];\r\n\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 /** Colors for the choropleth map. Array must be 5x5 */\r\n colors?: string[][];\r\n /** Title for the first color legend */\r\n xColorLegendTitle?: string;\r\n /** Title for the second color legend */\r\n yColorLegendTitle?: string;\r\n /** Domain of x-colors for the map */\r\n xDomain?: number[];\r\n /** Domain of y-colors for the map */\r\n yDomain?: number[];\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 /** 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 /** Detail if any other map needs to be overlayed over the main map */\r\n mapOverlay?: {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapData?: any;\r\n mapBorderWidth?: number;\r\n mapBorderColor?: string;\r\n };\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 /** Toggle if the map is a world map */\r\n isWorldMap?: boolean;\r\n /** Map projection type */\r\n mapProjection?: MapProjectionTypes;\r\n /** Toggle if the map is centered and zoomed to the highlighted ids. */\r\n zoomAndCenterByHighlightedIds?: boolean;\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 /** Countries or regions to be highlighted */\r\n highlightedIds?: string[];\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 /** 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 /** Toggle visibility of color scale. */\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 /** 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 BiVariateChoroplethMap(props: Props) {\r\n const {\r\n data,\r\n graphTitle,\r\n mapData = 'https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-v2.json',\r\n colors = Colors.light.bivariateColors.colors05x05,\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 xDomain,\r\n yDomain,\r\n xColorLegendTitle = 'X Color key',\r\n yColorLegendTitle = 'Y Color key',\r\n tooltip,\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 mapBorderColor = Colors.light.grays['gray-500'],\r\n relativeHeight,\r\n onSeriesMouseOver,\r\n isWorldMap = true,\r\n zoomScaleExtend = [0.8, 6],\r\n zoomTranslateExtend,\r\n graphID,\r\n showColorScale = true,\r\n highlightedIds = [],\r\n onSeriesMouseClick,\r\n mapProperty = 'ISO3',\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 timeline = { enabled: false, autoplay: false, showOnlyActiveDate: true },\r\n collapseColorScaleByDefault,\r\n zoomAndCenterByHighlightedIds = false,\r\n projectionRotate = [0, 0],\r\n rewindCoordinatesInMapData = true,\r\n mapOverlay,\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 // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mapShape, setMapShape] = useState<any>(undefined);\r\n const [overlayMapShape, setOverlayMapShape] = useState<FeatureCollection | undefined>(undefined);\r\n\r\n const graphDiv = useRef<HTMLDivElement>(null);\r\n const graphParentDiv = useRef<HTMLDivElement>(null);\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 // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const onUpdateOverlayMapShape = useEffectEvent((shape: any) => {\r\n setOverlayMapShape(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);\r\n });\r\n } else {\r\n onUpdateShape(mapData);\r\n }\r\n }, [mapData]);\r\n useEffect(() => {\r\n if (!mapOverlay?.mapData) onUpdateOverlayMapShape(undefined);\r\n if (typeof mapOverlay?.mapData === 'string') {\r\n const fetchData = fetchAndParseJSON(mapOverlay?.mapData);\r\n fetchData.then(d => {\r\n onUpdateOverlayMapShape(d as FeatureCollection);\r\n });\r\n } else {\r\n onUpdateOverlayMapShape(mapOverlay?.mapData);\r\n }\r\n }, [mapOverlay?.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\r\n if (xDomain && yDomain)\r\n if (xDomain.length !== colors[0].length - 1 || yDomain.length !== colors.length - 1) {\r\n console.error(\"the xDomain and yDomain array length don't match to the color array length\");\r\n return null;\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 data={data.filter(d =>\r\n timeline.enabled\r\n ? `${d.date}` ===\r\n 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 xDomain={\r\n xDomain ||\r\n getJenks(\r\n data.map(d => d.x as number | null | undefined),\r\n colors[0].length,\r\n )\r\n }\r\n yDomain={\r\n yDomain ||\r\n getJenks(\r\n data.map(d => d.y as number | null | undefined),\r\n colors.length,\r\n )\r\n }\r\n width={svgWidth}\r\n height={svgHeight}\r\n scale={scale}\r\n centerPoint={centerPoint}\r\n colors={colors}\r\n xColorLegendTitle={xColorLegendTitle}\r\n yColorLegendTitle={yColorLegendTitle}\r\n mapBorderWidth={mapBorderWidth}\r\n mapNoDataColor={mapNoDataColor}\r\n mapBorderColor={mapBorderColor}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n isWorldMap={isWorldMap}\r\n zoomScaleExtend={zoomScaleExtend}\r\n zoomTranslateExtend={zoomTranslateExtend}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n mapProperty={mapProperty}\r\n highlightedIds={highlightedIds}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n styles={styles}\r\n showColorScale={showColorScale}\r\n classNames={classNames}\r\n mapProjection={mapProjection || (isWorldMap ? 'naturalEarth' : 'mercator')}\r\n detailsOnClick={detailsOnClick}\r\n zoomInteraction={zoomInteraction}\r\n overlayMapData={overlayMapShape}\r\n overlayMapBorderColor={mapOverlay?.mapBorderColor}\r\n overlayMapBorderWidth={mapOverlay?.mapBorderWidth}\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 collapseColorScaleByDefault={collapseColorScaleByDefault}\r\n zoomAndCenterByHighlightedIds={zoomAndCenterByHighlightedIds}\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":["Graph","props","data","xDomain","mapData","xColorLegendTitle","yDomain","yColorLegendTitle","width","height","colors","scale","centerPoint","mapBorderWidth","mapNoDataColor","mapBorderColor","tooltip","onSeriesMouseOver","zoomScaleExtend","zoomTranslateExtend","highlightedIds","onSeriesMouseClick","mapProperty","resetSelectionOnDoubleClick","detailsOnClick","showColorScale","styles","classNames","mapProjection","zoomInteraction","animate","dimmedOpacity","customLayers","collapseColorScaleByDefault","zoomAndCenterByHighlightedIds","projectionRotate","rewindCoordinatesInMapData","overlayMapData","overlayMapBorderColor","overlayMapBorderWidth","formattedMapData","useMemo","rewind","reverse","formattedOverlayMapData","showLegend","setShowLegend","useState","undefined","selectedColor","setSelectedColor","mouseClickData","setMouseClickData","mouseOverData","setMouseOverData","eventX","setEventX","eventY","setEventY","mapSvg","useRef","isInView","useInView","once","amount","mapG","zoomRef","useEffect","mapGSelect","select","current","mapSvgSelect","zoomFilter","e","type","includes","isWheel","isTouch","startsWith","isDrag","ctrlKey","button","zoomBehavior","zoom","scaleExtent","translateExtent","filter","on","transform","attr","call","bounds","bbox","features","d","length","indexOf","properties","center","centerOfMass","lonDiff","latDiff","scaleX","scaleY","scaleVar","Math","min","projection","geoMercator","rotate","geometry","coordinates","translate","geoEqualEarth","geoNaturalEarth1","geoOrthographic","geoAlbersUsa","pathGenerator","geoPath","xRange","Array","from","_","i","yRange","xScale","scaleThreshold","domain","range","yScale","handleZoom","direction","scaleBy","jsxs","Fragment","jsx","motion","position","map","layer","path","stroke","strokeWidth","fill","vectorEffect","AnimatePresence","index","findIndex","el","id","xColorCoord","checkIfNullOrUndefined","x","yColorCoord","y","color","initial","opacity","whileInView","transition","duration","event","clientY","clientX","isEqual","fillOpacity","pointerEvents","cn","colorLegend","X","j","cursor","numberFormattingFunction","max","P","display","WebkitLineClamp","WebkitBoxOrient","overflow","writingMode","Tooltip","DetailsModal","modal","BiVariateChoroplethMap","$","_c","graphTitle","t0","t1","sources","graphDescription","footNote","t2","t3","t4","t5","padding","t6","t7","backgroundColor","t8","t9","relativeHeight","isWorldMap","t10","t11","graphID","t12","t13","t14","graphDownload","t15","dataDownload","t16","showAntarctica","t17","language","t18","minHeight","t19","theme","t20","ariaLabel","t21","t22","t23","t24","t25","t26","timeline","t27","t28","t29","t30","mapOverlay","Colors","light","bivariateColors","colors05x05","graphNoData","grays","t31","t32","t33","t34","enabled","autoplay","showOnlyActiveDate","t35","svgWidth","setSvgWidth","svgHeight","setSvgHeight","play","setPlay","dates","dateFormat","t36","d_0","parse","date","Date","getTime","Set","_temp","sort","_temp2","uniqDatesSorted","setIndex","mapShape","setMapShape","overlayMapShape","setOverlayMapShape","graphDiv","graphParentDiv","t37","Symbol","for","resizeObserver","ResizeObserver","entries","target","clientWidth","clientHeight","observe","disconnect","t38","shape","onUpdateShape","useEffectEvent","t39","shape_0","onUpdateOverlayMapShape","t40","fetchAndParseJSON","then","d_1","t41","t42","d_2","t43","t44","t45","t46","speed","interval","setInterval","clearInterval","t47","t48","getSliderMarks","markObj","console","error","t49","graphContainer","t50","t51","description","title","GraphHeader","_temp3","_temp4","_temp5","_temp6","_temp7","t52","Pause","Play","SliderUI","nextValue","nextValue_0","t53","GraphArea","d_8","format","_temp8","getJenks","_temp9","_temp0","Spinner","t54","footnote","source","GraphFooter","t55","GraphContainer","d_10","d_9","NAME","d_5","d_4","d_3","d_7","d_6","a","b"],"mappings":"0gCAoFO,SAASA,GAAMC,EAAc,CAClC,KAAM,CACJC,KAAAA,EACAC,QAAAA,EACAC,QAAAA,EACAC,kBAAAA,GACAC,QAAAA,EACAC,kBAAAA,GACAC,MAAAA,EACAC,OAAAA,EACAC,OAAAA,EACAC,MAAAA,GACAC,YAAAA,EACAC,eAAAA,EACAC,eAAAA,GACAC,eAAAA,GACAC,QAAAA,GACAC,kBAAAA,GACAC,gBAAAA,GACAC,oBAAAA,GACAC,eAAAA,EACAC,mBAAAA,GACAC,YAAAA,EACAC,4BAAAA,GACAC,eAAAA,EACAC,eAAAA,GACAC,OAAAA,GACAC,WAAAA,EACAC,cAAAA,EACAC,gBAAAA,EACAC,QAAAA,EACAC,cAAAA,EACAC,aAAAA,GACAC,4BAAAA,GACAC,8BAAAA,GACAC,iBAAAA,EACAC,2BAAAA,EACAC,eAAAA,EACAC,sBAAAA,GACAC,sBAAAA,EAAAA,EACEtC,EACEuC,EAAmBC,EAAAA,QAAQ,IAC1BL,EAEEM,EAAAA,cAAOtC,EAAS,CAAEuC,QAAS,EAAA,CAAM,EAFAvC,EAGvC,CAACA,EAASgC,CAA0B,CAAC,EAClCQ,GAA0BH,EAAAA,QAAQ,IAClC,CAACL,GAA8B,CAACC,EAAuBA,EAEpDK,EAAAA,cAAOL,EAAgB,CAAEM,QAAS,EAAA,CAAM,EAC9C,CAACN,EAAgBD,CAA0B,CAAC,EACzC,CAACS,GAAYC,CAAa,EAAIC,WAClCd,KAAgCe,OAAY,EAAExC,EAAQ,KAAO,CAACyB,EAChE,EACM,CAACgB,EAAeC,EAAgB,EAAIH,EAAAA,SAA6BC,MAAS,EAE1E,CAACG,GAAgBC,EAAiB,EAAIL,EAAAA,SAAcC,MA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,GAAApJ,OAAA6J,GAAA7J,OAAAoC,EAAApC,OAAAhL,EAAAgL,OAAAiK,IAAAA,GAAAjK,EAAA,GAAA,EA9KjBiK,EA8KiB,CA7Td,SAAAN,GAAAQ,EAAA,CAAA,OAgPuB7P,EAAC4D,CAA+B,CAhPvD,SAAAwL,GAAAU,EAAA,CAAA,OAyOuB9P,EAAC0D,CAA+B,CAzOvD,SAAAwL,GAAA5L,EAAA,CAAA,OAkO4BA,EAAEnD,WAAW4P,OAAU,YAAY,CAlO/D,SAAAxB,GAAAyB,EAAA,CAAA,OAgL4BhQ,IAAM9C,MAAS,CAhL3C,SAAAoR,GAAA2B,EAAA,CAAA,OA+K6CjQ,IAAM9C,MAAS,CA/K5D,SAAAmR,GAAA6B,EAAA,CAAA,OA+KyBlQ,EAAC5F,IAAK,CA/K/B,SAAAgU,GAAA+B,EAAA,CAAA,OA8K2CnQ,IAAM9C,MAAS,CA9K1D,SAAAiR,GAAAiC,EAAA,CAAA,OA8KuBpQ,EAAC5F,IAAK,CA9K7B,SAAAwQ,GAAAyF,EAAAC,EAAA,CAAA,OAoEkBD,EAAIC,CAAC,CApEvB,SAAA5F,GAAA1K,EAAA,CAAA,OAgEgBA,EAACsK,IAAK"}
@@ -101,6 +101,12 @@ declare interface Props {
101
101
  padding?: string;
102
102
  /** Map data as an object in geoJson format or a url for geoJson */
103
103
  mapData?: any;
104
+ /** Detail if any other map needs to be overlayed over the main map */
105
+ mapOverlay?: {
106
+ mapData?: any;
107
+ mapBorderWidth?: number;
108
+ mapBorderColor?: string;
109
+ };
104
110
  /** 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. */
105
111
  rewindCoordinatesInMapData?: boolean;
106
112
  /** Scaling factor for the map. Multiplies the scale number to scale. */