@undp/data-viz 2.3.14 → 2.3.16

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 (55) hide show
  1. package/dist/BiVariateChoroplethMap.cjs +1 -1
  2. package/dist/BiVariateChoroplethMap.cjs.map +1 -1
  3. package/dist/BiVariateChoroplethMap.d.ts +10 -1
  4. package/dist/BiVariateChoroplethMap.js +331 -298
  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 +10 -1
  9. package/dist/ChoroplethMap.js +359 -326
  10. package/dist/ChoroplethMap.js.map +1 -1
  11. package/dist/Data/data.json +2627 -0
  12. package/dist/Data/testMap.json +1 -361
  13. package/dist/DotDensityMap.cjs +1 -1
  14. package/dist/DotDensityMap.cjs.map +1 -1
  15. package/dist/DotDensityMap.d.ts +10 -1
  16. package/dist/DotDensityMap.js +319 -286
  17. package/dist/DotDensityMap.js.map +1 -1
  18. package/dist/{GraphEl-Bb5oGHoa.js → GraphEl-CnJf8b50.js} +11 -5
  19. package/dist/GraphEl-CnJf8b50.js.map +1 -0
  20. package/dist/GraphEl-D_w0Qak4.cjs +2 -0
  21. package/dist/GraphEl-D_w0Qak4.cjs.map +1 -0
  22. package/dist/GriddedGraphs.cjs +1 -1
  23. package/dist/GriddedGraphs.d.ts +11 -1
  24. package/dist/GriddedGraphs.js +1 -1
  25. package/dist/GriddedGraphsFromConfig.d.ts +11 -1
  26. package/dist/HybridMap.cjs +1 -1
  27. package/dist/HybridMap.cjs.map +1 -1
  28. package/dist/HybridMap.d.ts +10 -1
  29. package/dist/HybridMap.js +416 -382
  30. package/dist/HybridMap.js.map +1 -1
  31. package/dist/MultiGraphDashboard.d.ts +11 -1
  32. package/dist/MultiGraphDashboardFromConfig.d.ts +11 -1
  33. package/dist/PerformanceIntensiveMultiGraphDashboard.d.ts +11 -1
  34. package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.d.ts +11 -1
  35. package/dist/PerformanceIntensiveScrollStory.d.ts +11 -1
  36. package/dist/ScatterPlot.cjs +1 -1
  37. package/dist/ScatterPlot.cjs.map +1 -1
  38. package/dist/ScatterPlot.d.ts +4 -0
  39. package/dist/ScatterPlot.js +401 -400
  40. package/dist/ScatterPlot.js.map +1 -1
  41. package/dist/ScrollStory.d.ts +11 -1
  42. package/dist/SingleGraphDashboard.cjs +1 -1
  43. package/dist/SingleGraphDashboard.d.ts +11 -1
  44. package/dist/SingleGraphDashboard.js +1 -1
  45. package/dist/SingleGraphDashboardFromConfig.d.ts +11 -1
  46. package/dist/SingleGraphDashboardGeoHubMaps.d.ts +11 -1
  47. package/dist/SingleGraphDashboardGeoHubMapsFromConfig.d.ts +11 -1
  48. package/dist/SingleGraphDashboardThreeDGraphs.d.ts +11 -1
  49. package/dist/SingleGraphDashboardThreeDGraphsFromConfig.d.ts +11 -1
  50. package/dist/Types.d.ts +12 -1
  51. package/dist/index.d.ts +27 -5
  52. package/package.json +1 -1
  53. package/dist/GraphEl-Bb5oGHoa.js.map +0 -1
  54. package/dist/GraphEl-BerZfJ3j.cjs +0 -2
  55. 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"),l=require("react"),ht=require("./parse-xYI9yrvL.cjs"),ft=require("./getSliderMarks-CIuSoedo.cjs"),Et=require("./Spinner-jTMOLuw_.cjs"),wt=require("./index-DQA8q5sC.cjs"),q=require("./index-DLFt97gy.cjs"),Ct=require("./Typography-CZZxlj1W.cjs"),Dt=require("./index-C5K--w8d.cjs"),Rt=require("./Tooltip-BLa2EfMs.cjs"),j=require("./Colors.cjs"),pt=require("./index-sbKVyHS2.cjs"),St=require("./DetailsModal-DIRTulvr.cjs"),kt=require("./pow-BnyPO-NX.cjs"),mt=require("./select-Bnfk0lJx.cjs"),Je=require("./proxy-C4-uo6nS.cjs"),Nt=require("./use-in-view-C3o_ntMv.cjs"),Ot=require("./index-CoobIWNj.cjs"),Mt=require("./GraphFooter.cjs"),qt=require("./GraphHeader.cjs"),$t=require("./fetchAndParseData-QTF6tjij.cjs"),Pt=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),It=require("./uniqBy-O05lp2S5.cjs"),gt=require("./GraphContainer-B1EDxJ0S.cjs");function zt(a){const{data:e,colors:r,mapData:X,colorLegendTitle:$,colorDomain:f,radius:D,height:x,width:m,scale:p,centerPoint:P,tooltip:Y,showLabels:de,mapBorderWidth:qe,mapBorderColor:$e,mapNoDataColor:me,onSeriesMouseOver:K,showColorScale:Pe,zoomScaleExtend:Ie,zoomTranslateExtend:ze,highlightedDataPoints:pe,onSeriesMouseClick:Z,resetSelectionOnDoubleClick:xe,detailsOnClick:y,styles:J,classNames:_,mapProjection:L,zoomInteraction:E,animate:b,dimmedOpacity:Q,customLayers:V,maxRadiusValue:he,collapseColorScaleByDefault:fe,projectionRotate:I,rewindCoordinatesInMapData:ge}=a,ee=l.useMemo(()=>ge?q.index_default(X,{reverse:!0}):X,[X,ge]),[ye,ve]=l.useState(void 0),[be,je]=l.useState(fe===void 0?!(m<680):!fe),B=l.useRef(null),[c,u]=l.useState(void 0),[Ee,te]=l.useState(void 0),[we,oe]=l.useState(void 0),[A,z]=l.useState(void 0),w=l.useRef(null),F=Nt.useInView(w,{once:b.once,amount:b.amount}),T=l.useRef(null),R=e.filter(t=>t.radius===void 0||t.radius===null).length!==e.length?kt.sqrt().domain([0,he]).range([.25,D]).nice():void 0;l.useEffect(()=>{const t=mt.select(T.current),h=mt.select(w.current),n=g=>{if(E==="noZoom")return!1;if(E==="button")return!g.type.includes("wheel");const re=g.type==="wheel",ae=g.type.startsWith("touch"),Ne=g.type==="mousedown"||g.type==="mousemove";return ae?!0:re?E==="scroll"?!0:g.ctrlKey:Ne&&!g.button&&!g.ctrlKey},H=q.zoom().scaleExtent(Ie).translateExtent(ze||[[-20,-20],[m+20,x+20]]).filter(n).on("zoom",({transform:g})=>{t.attr("transform",g)});h.call(H),B.current=H},[x,m,E]);const v=q.index_default$1(ee),C=Dt.index_default(ee),Ce=(v[2]-v[0])*1.15,De=(v[3]-v[1])*1.15,Re=m*190/960*360/Ce,Se=x*190/678*180/De,S=p*Math.min(Re,Se),W=L==="mercator"?q.geoMercator().rotate(I).center(P||C.geometry.coordinates).translate([m/2,x/2]).scale(S):L==="equalEarth"?q.geoEqualEarth().rotate(I).center(P||C.geometry.coordinates).translate([m/2,x/2]).scale(S):L==="naturalEarth"?q.geoNaturalEarth1().rotate(I).center(P||C.geometry.coordinates).translate([m/2,x/2]).scale(S):L==="orthographic"?q.geoOrthographic().rotate(I).center(P||C.geometry.coordinates).translate([m/2,x/2]).scale(S):q.geoAlbersUsa().rotate(I).center(P||C.geometry.coordinates).translate([m/2,x/2]).scale(S),ke=q.geoPath().projection(W),G=t=>{if(!w.current||!B.current)return;mt.select(w.current).call(B.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(Je.motion.svg,{width:`${m}px`,height:`${x}px`,viewBox:`0 0 ${m} ${x}`,ref:w,direction:"ltr",children:o.jsxRuntimeExports.jsxs("g",{ref:T,children:[V.filter(t=>t.position==="before").map(t=>t.layer),ee.features.map((t,h)=>{const n=ke(t);return n?o.jsxRuntimeExports.jsx("path",{d:n,style:{stroke:$e,strokeWidth:qe,fill:me}},h):null}),o.jsxRuntimeExports.jsx(Ot.AnimatePresence,{children:e.map(t=>{const h=e.filter(n=>n.color).length===0?r[0]:t.color?r[f.indexOf(`${t.color}`)]:j.Colors.gray;return o.jsxRuntimeExports.jsxs(Je.motion.g,{className:"undp-map-dots",variants:{initial:{opacity:0},whileInView:{opacity:ye?ye===h?1:Q:pe.length!==0?pe.indexOf(t.label||"")!==-1?1:Q:1,transition:{duration:b.duration}}},initial:"initial",animate:F?"whileInView":"initial",exit:{opacity:0,transition:{duration:b.duration}},onMouseEnter:n=>{te(t),z(n.clientY),oe(n.clientX),K?.(t)},onMouseMove:n=>{te(t),z(n.clientY),oe(n.clientX)},onMouseLeave:()=>{te(void 0),oe(void 0),z(void 0),K?.(void 0)},onClick:()=>{(Z||y)&&(wt.isEqual(c,t)&&xe?(u(void 0),Z?.(void 0)):(u(t),Z?.(t)))},transform:`translate(${W([t.long,t.lat])[0]},${W([t.long,t.lat])[1]})`,children:[o.jsxRuntimeExports.jsx(Je.motion.circle,{cx:0,cy:0,variants:{initial:{r:0,fill:e.filter(n=>n.color).length===0?r[0]:t.color?r[f.indexOf(`${t.color}`)]:j.Colors.gray,stroke:e.filter(n=>n.color).length===0?r[0]:t.color?r[f.indexOf(`${t.color}`)]:j.Colors.gray},whileInView:{r:R?R(t.radius||0):D,fill:e.filter(n=>n.color).length===0?r[0]:t.color?r[f.indexOf(`${t.color}`)]:j.Colors.gray,stroke:e.filter(n=>n.color).length===0?r[0]:t.color?r[f.indexOf(`${t.color}`)]:j.Colors.gray,transition:{duration:b.duration}}},initial:"initial",animate:F?"whileInView":"initial",exit:{r:0,transition:{duration:b.duration}},style:{fillOpacity:.8}}),de&&t.label?o.jsxRuntimeExports.jsx(Je.motion.text,{variants:{initial:{opacity:0,x:R?R(t.radius||0):D,fill:e.filter(n=>n.color).length===0?r[0]:t.color?r[f.indexOf(`${t.color}`)]:j.Colors.gray},whileInView:{opacity:1,x:R?R(t.radius||0):D,transition:{duration:b.duration},fill:e.filter(n=>n.color).length===0?r[0]:t.color?r[f.indexOf(`${t.color}`)]:j.Colors.gray}},initial:"initial",animate:F?"whileInView":"initial",exit:{opacity:0,transition:{duration:b.duration}},y:0,className:o.mo("graph-value text-sm",_?.graphObjectValues),style:{textAnchor:"start",...J?.graphObjectValues||{}},dx:4,dy:5,children:t.label}):null]},t.label||`${t.lat}-${t.long}`)})}),V.filter(t=>t.position==="after").map(t=>t.layer)]})}),e.filter(t=>t.color).length===0||Pe===!1?null:o.jsxRuntimeExports.jsx("div",{className:o.mo("absolute left-4 bottom-4 map-color-legend",_?.colorLegend),children:be?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:()=>{je(!1)},children:o.jsxRuntimeExports.jsx(pt.X,{})}),o.jsxRuntimeExports.jsxs("div",{className:"p-2",style:{backgroundColor:"rgba(240,240,240, 0.7)"},children:[$&&$!==""?o.jsxRuntimeExports.jsx("p",{className:"p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300",style:{display:"-webkit-box",WebkitLineClamp:"1",WebkitBoxOrient:"vertical"},children:$}):null,o.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-3",children:f.map((t,h)=>o.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 items-center",onMouseOver:()=>{ve(r[h%r.length])},onMouseLeave:()=>{ve(void 0)},children:[o.jsxRuntimeExports.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:r[h%r.length]}}),o.jsxRuntimeExports.jsx(Ct._,{size:"sm",marginBottom:"none",leading:"none",children:t})]},h))})]})]}):o.jsxRuntimeExports.jsx("button",{type:"button",className:"mb-0 border-0 bg-transparent p-0 self-start",onClick:()=>{je(!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"})})}),E==="button"&&o.jsxRuntimeExports.jsxs("div",{className:"absolute left-4 top-4 flex flex-col zoom-buttons",children:[o.jsxRuntimeExports.jsx("button",{onClick:()=>G("in"),className:"leading-0 px-2 py-3.5 text-primary-gray-700 border border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"+"}),o.jsxRuntimeExports.jsx("button",{onClick:()=>G("out"),className:"leading-0 px-2 py-3.5 text-primary-gray-700 border border-t-0 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"–"})]})]}),y&&c!==void 0?o.jsxRuntimeExports.jsx(St.DetailsModal,{body:y,data:c,setData:u,className:_?.modal}):null,Ee&&Y&&we&&A?o.jsxRuntimeExports.jsx(Rt.Tooltip,{data:Ee,body:Y,xPos:we,yPos:A,backgroundStyle:J?.tooltip,className:_?.tooltip}):null]})}function _t(a){const e=o.compilerRuntimeExports.c(121),{data:r,mapData:X,graphTitle:$,colors:f,sources:D,graphDescription:x,height:m,width:p,footNote:P,colorLegendTitle:Y,colorDomain:de,radius:qe,scale:$e,centerPoint:me,padding:K,mapBorderWidth:Pe,mapNoDataColor:Ie,backgroundColor:ze,showLabels:pe,mapBorderColor:Z,tooltip:xe,relativeHeight:y,onSeriesMouseOver:J,isWorldMap:_,showColorScale:L,zoomScaleExtend:E,zoomTranslateExtend:b,graphID:Q,highlightedDataPoints:V,onSeriesMouseClick:he,graphDownload:fe,dataDownload:I,showAntarctica:ge,language:ee,minHeight:ye,theme:ve,ariaLabel:be,resetSelectionOnDoubleClick:je,detailsOnClick:B,styles:c,classNames:u,mapProjection:Ee,zoomInteraction:te,animate:we,dimmedOpacity:oe,customLayers:A,maxRadiusValue:z,timeline:w,collapseColorScaleByDefault:F,projectionRotate:T,rewindCoordinatesInMapData:R}=a,v=X===void 0?"https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-v2.json":X,C=P===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.":P,Ce=qe===void 0?5:qe,De=$e===void 0?.95:$e,Re=Pe===void 0?.5:Pe,Se=Ie===void 0?j.Colors.light.graphNoData:Ie,S=ze===void 0?!1:ze,W=pe===void 0?!1:pe,ke=Z===void 0?j.Colors.light.grays["gray-500"]:Z,G=_===void 0?!0:_,t=L===void 0?!0:L;let h;e[0]!==E?(h=E===void 0?[.8,6]:E,e[0]=E,e[1]=h):h=e[1];const n=h;let H;e[2]!==V?(H=V===void 0?[]:V,e[2]=V,e[3]=H):H=e[3];const g=H,re=fe===void 0?!1:fe,ae=I===void 0?!1:I,Ne=ge===void 0?!1:ge,Qe=ee===void 0?"en":ee,k=ye===void 0?0:ye,ne=ve===void 0?"light":ve,et=je===void 0?!0:je,tt=Ee===void 0?"naturalEarth":Ee,ot=te===void 0?"button":te,_e=we===void 0?!1:we,rt=oe===void 0?.3:oe;let Le;e[4]!==A?(Le=A===void 0?[]:A,e[4]=A,e[5]=Le):Le=e[5];const at=Le;let Ve;e[6]!==w?(Ve=w===void 0?{enabled:!1,autoplay:!1,showOnlyActiveDate:!0}:w,e[6]=w,e[7]=Ve):Ve=e[7];const i=Ve;let Be;e[8]!==T?(Be=T===void 0?[0,0]:T,e[8]=T,e[9]=Be):Be=e[9];const nt=Be,it=R===void 0?!0:R,[U,yt]=l.useState(0),[Oe,vt]=l.useState(0),[N,bt]=l.useState(i.autoplay);let Me;if(e[10]!==r||e[11]!==i.dateFormat){let d;e[13]!==i.dateFormat?(d=M=>ht.parse(`${M.date}`,i.dateFormat||"yyyy",new Date).getTime(),e[13]=i.dateFormat,e[14]=d):d=e[14],Me=[...new Set(r.filter(Yt).map(d))],Me.sort(Xt),e[10]=r,e[11]=i.dateFormat,e[12]=Me}else Me=e[12];const s=Me,[O,st]=l.useState(i.autoplay?0:s.length-1),[ie,jt]=l.useState(void 0),lt=l.useRef(null),xt=l.useRef(null);let Ae,Fe;e[15]===Symbol.for("react.memo_cache_sentinel")?(Ae=()=>{const d=new ResizeObserver(M=>{yt(M[0].target.clientWidth||620),vt(M[0].target.clientHeight||480)});return lt.current&&d.observe(lt.current),()=>d.disconnect()},Fe=[],e[15]=Ae,e[16]=Fe):(Ae=e[15],Fe=e[16]),l.useEffect(Ae,Fe);let Te;e[17]===Symbol.for("react.memo_cache_sentinel")?(Te=d=>{jt(d)},e[17]=Te):Te=e[17];const We=l.useEffectEvent(Te);let Ge;e[18]!==v||e[19]!==We?(Ge=()=>{typeof v=="string"?$t.fetchAndParseJSON(v).then(M=>{We(M)}):We(v)},e[18]=v,e[19]=We,e[20]=Ge):Ge=e[20];let He;e[21]!==v?(He=[v],e[21]=v,e[22]=He):He=e[22],l.useEffect(Ge,He);let Ue,Xe;e[23]!==N||e[24]!==i.speed||e[25]!==s?(Ue=()=>{const d=setInterval(()=>{st(M=>M<s.length-1?M+1:0)},(i.speed||2)*1e3);return N||clearInterval(d),()=>clearInterval(d)},Xe=[s,N,i.speed],e[23]=N,e[24]=i.speed,e[25]=s,e[26]=Ue,e[27]=Xe):(Ue=e[26],Xe=e[27]),l.useEffect(Ue,Xe);const ct=i.dateFormat||"yyyy";let Ye;e[28]!==O||e[29]!==ct||e[30]!==i.showOnlyActiveDate||e[31]!==s?(Ye=ft.getSliderMarks(s,O,i.showOnlyActiveDate,ct),e[28]=O,e[29]=ct,e[30]=i.showOnlyActiveDate,e[31]=s,e[32]=Ye):Ye=e[32];const Ke=Ye,ut=u?.graphContainer,dt=c?.graphContainer;let se;e[33]!==u?.description||e[34]!==u?.title||e[35]!==r||e[36]!==ae||e[37]!==x||e[38]!==re||e[39]!==$||e[40]!==c?.description||e[41]!==c?.title||e[42]!==p?(se=$||x||re||ae?o.jsxRuntimeExports.jsx(qt.GraphHeader,{styles:{title:c?.title,description:c?.description},classNames:{title:u?.title,description:u?.description},graphTitle:$,graphDescription:x,width:p,graphDownload:re?xt:void 0,dataDownload:ae?r.map(Ut).filter(Ht).length>0?r.map(Gt).filter(Wt):r.filter(Tt):null}):null,e[33]=u?.description,e[34]=u?.title,e[35]=r,e[36]=ae,e[37]=x,e[38]=re,e[39]=$,e[40]=c?.description,e[41]=c?.title,e[42]=p,e[43]=se):se=e[43];let le;e[44]!==O||e[45]!==Ke||e[46]!==N||e[47]!==i.enabled||e[48]!==s?(le=i.enabled&&s.length>0&&Ke?o.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[o.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{bt(!N)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":N?"Click to pause animation":"Click to play animation",children:N?o.jsxRuntimeExports.jsx(pt.Pause,{}):o.jsxRuntimeExports.jsx(pt.Play,{})}),o.jsxRuntimeExports.jsx(ft.Nr,{min:s[0],max:s[s.length-1],marks:Ke,step:null,defaultValue:s[s.length-1],value:s[O],onChangeComplete:d=>{st(s.indexOf(d))},onChange:d=>{st(s.indexOf(d))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,e[44]=O,e[45]=Ke,e[46]=N,e[47]=i.enabled,e[48]=s,e[49]=le):le=e[49];let ce;e[50]!==_e||e[51]!==me||e[52]!==u||e[53]!==F||e[54]!==de||e[55]!==Y||e[56]!==f||e[57]!==at||e[58]!==r||e[59]!==B||e[60]!==rt||e[61]!==m||e[62]!==g||e[63]!==O||e[64]!==G||e[65]!==ke||e[66]!==Re||e[67]!==Se||e[68]!==tt||e[69]!==ie||e[70]!==z||e[71]!==k||e[72]!==he||e[73]!==J||e[74]!==nt||e[75]!==Ce||e[76]!==y||e[77]!==et||e[78]!==it||e[79]!==De||e[80]!==Ne||e[81]!==t||e[82]!==W||e[83]!==c||e[84]!==Oe||e[85]!==U||e[86]!==ne||e[87]!==i.dateFormat||e[88]!==i.enabled||e[89]!==xe||e[90]!==s||e[91]!==p||e[92]!==ot||e[93]!==n||e[94]!==b?(ce=o.jsxRuntimeExports.jsx(gt.GraphArea,{ref:lt,children:U&&Oe&&ie?o.jsxRuntimeExports.jsx(zt,{data:r.filter(d=>i.enabled?`${d.date}`===ht.format(new Date(s[O]),i.dateFormat||"yyyy"):d),mapData:Ne?ie:{...ie,features:ie.features.filter(Ft)},colorDomain:r.filter(At).length===0?[]:de||It.uniqBy(r,"color",!0),width:U,height:Oe,scale:De,centerPoint:me,colors:r.filter(Bt).length===0?f?[f]:[j.Colors.primaryColors["blue-600"]]:f||j.Colors[ne].categoricalColors.colors,colorLegendTitle:Y,radius:Ce,mapBorderWidth:Re,mapNoDataColor:Se,mapBorderColor:ke,tooltip:xe,onSeriesMouseOver:J,showLabels:W,isWorldMap:G,showColorScale:t,zoomScaleExtend:n,zoomTranslateExtend:b,onSeriesMouseClick:he,highlightedDataPoints:g,resetSelectionOnDoubleClick:et,styles:c,classNames:u,zoomInteraction:ot,detailsOnClick:B,mapProjection:tt||(G?"naturalEarth":"mercator"),animate:_e===!0?{duration:.5,once:!0,amount:.5}:_e||{duration:0,once:!0,amount:0},dimmedOpacity:rt,customLayers:at,maxRadiusValue:Pt.checkIfNullOrUndefined(z)?Math.max(...r.map(Vt).filter(Lt)):z,collapseColorScaleByDefault:F,projectionRotate:nt,rewindCoordinatesInMapData:it}):o.jsxRuntimeExports.jsx("div",{style:{height:`${Math.max(k,m||(y?k?(p||U)*y>k?(p||U)*y:k:(p||U)*y:Oe))}px`},className:"flex items-center justify-center",children:o.jsxRuntimeExports.jsx(Et.w,{"aria-label":"Loading graph"})})}),e[50]=_e,e[51]=me,e[52]=u,e[53]=F,e[54]=de,e[55]=Y,e[56]=f,e[57]=at,e[58]=r,e[59]=B,e[60]=rt,e[61]=m,e[62]=g,e[63]=O,e[64]=G,e[65]=ke,e[66]=Re,e[67]=Se,e[68]=tt,e[69]=ie,e[70]=z,e[71]=k,e[72]=he,e[73]=J,e[74]=nt,e[75]=Ce,e[76]=y,e[77]=et,e[78]=it,e[79]=De,e[80]=Ne,e[81]=t,e[82]=W,e[83]=c,e[84]=Oe,e[85]=U,e[86]=ne,e[87]=i.dateFormat,e[88]=i.enabled,e[89]=xe,e[90]=s,e[91]=p,e[92]=ot,e[93]=n,e[94]=b,e[95]=ce):ce=e[95];let ue;e[96]!==u?.footnote||e[97]!==u?.source||e[98]!==C||e[99]!==D||e[100]!==c?.footnote||e[101]!==c?.source||e[102]!==p?(ue=D||C?o.jsxRuntimeExports.jsx(Mt.GraphFooter,{styles:{footnote:c?.footnote,source:c?.source},classNames:{footnote:u?.footnote,source:u?.source},sources:D,footNote:C,width:p}):null,e[96]=u?.footnote,e[97]=u?.source,e[98]=C,e[99]=D,e[100]=c?.footnote,e[101]=c?.source,e[102]=p,e[103]=ue):ue=e[103];let Ze;return e[104]!==be||e[105]!==S||e[106]!==Q||e[107]!==m||e[108]!==Qe||e[109]!==k||e[110]!==K||e[111]!==y||e[112]!==ut||e[113]!==dt||e[114]!==se||e[115]!==le||e[116]!==ce||e[117]!==ue||e[118]!==ne||e[119]!==p?(Ze=o.jsxRuntimeExports.jsxs(gt.GraphContainer,{className:ut,style:dt,id:Q,ref:xt,"aria-label":be,backgroundColor:S,theme:ne,language:Qe,minHeight:k,width:p,height:m,relativeHeight:y,padding:K,children:[se,le,ce,ue]}),e[104]=be,e[105]=S,e[106]=Q,e[107]=m,e[108]=Qe,e[109]=k,e[110]=K,e[111]=y,e[112]=ut,e[113]=dt,e[114]=se,e[115]=le,e[116]=ce,e[117]=ue,e[118]=ne,e[119]=p,e[120]=Ze):Ze=e[120],Ze}function Lt(a){return a!=null}function Vt(a){return a.radius}function Bt(a){return a.color}function At(a){return a.color}function Ft(a){return a.properties.NAME!=="Antarctica"}function Tt(a){return a!==void 0}function Wt(a){return a!==void 0}function Gt(a){return a.data}function Ht(a){return a!==void 0}function Ut(a){return a.data}function Xt(a,e){return a-e}function Yt(a){return a.date}exports.DotDensityMap=_t;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-CHPV5EwG-6v2a2njQ.cjs"),i=require("react"),Et=require("./parse-xYI9yrvL.cjs"),Dt=require("./getSliderMarks-CIuSoedo.cjs"),Nt=require("./Spinner-jTMOLuw_.cjs"),qt=require("./index-DQA8q5sC.cjs"),k=require("./index-DLFt97gy.cjs"),Bt=require("./Typography-CZZxlj1W.cjs"),Pt=require("./index-C5K--w8d.cjs"),$t=require("./Tooltip-BLa2EfMs.cjs"),C=require("./Colors.cjs"),jt=require("./index-sbKVyHS2.cjs"),_t=require("./DetailsModal-DIRTulvr.cjs"),It=require("./pow-BnyPO-NX.cjs"),vt=require("./select-Bnfk0lJx.cjs"),at=require("./proxy-C4-uo6nS.cjs"),Wt=require("./use-in-view-C3o_ntMv.cjs"),zt=require("./index-CoobIWNj.cjs"),Lt=require("./GraphFooter.cjs"),Vt=require("./GraphHeader.cjs"),Ct=require("./fetchAndParseData-QTF6tjij.cjs"),At=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),Ft=require("./uniqBy-O05lp2S5.cjs"),wt=require("./GraphContainer-B1EDxJ0S.cjs");function Tt(n){const{data:e,colors:r,mapData:ee,colorLegendTitle:B,colorDomain:g,radius:M,height:x,width:p,scale:h,centerPoint:P,tooltip:te,showLabels:ge,mapBorderWidth:ye,mapBorderColor:ve,mapNoDataColor:je,onSeriesMouseOver:oe,showColorScale:Pe,zoomScaleExtend:$e,zoomTranslateExtend:_e,highlightedDataPoints:be,onSeriesMouseClick:re,resetSelectionOnDoubleClick:Ee,detailsOnClick:v,styles:ae,classNames:z,mapProjection:L,zoomInteraction:w,animate:j,dimmedOpacity:ne,customLayers:V,maxRadiusValue:De,collapseColorScaleByDefault:Ce,projectionRotate:$,rewindCoordinatesInMapData:A,overlayMapData:F,overlayMapBorderColor:Ie,overlayMapBorderWidth:We}=n,T=i.useMemo(()=>A?k.index_default(ee,{reverse:!0}):ee,[ee,A]),ze=i.useMemo(()=>!A||!F?F:k.index_default(F,{reverse:!0}),[F,A]),[ie,u]=i.useState(void 0),[m,we]=i.useState(Ce===void 0?!(p<680):!Ce),se=i.useRef(null),[le,ce]=i.useState(void 0),[G,_]=i.useState(void 0),[H,U]=i.useState(void 0),[X,ue]=i.useState(void 0),d=i.useRef(null),b=Wt.useInView(d,{once:j.once,amount:j.amount}),Y=i.useRef(null),S=e.filter(t=>t.radius===void 0||t.radius===null).length!==e.length?It.sqrt().domain([0,De]).range([.25,M]).nice():void 0;i.useEffect(()=>{const t=vt.select(Y.current),f=vt.select(d.current),a=y=>{if(w==="noZoom")return!1;if(w==="button")return!y.type.includes("wheel");const Oe=y.type==="wheel",E=y.type.startsWith("touch"),W=y.type==="mousedown"||y.type==="mousemove";return E?!0:Oe?w==="scroll"?!0:y.ctrlKey:W&&!y.button&&!y.ctrlKey},Z=k.zoom().scaleExtent($e).translateExtent(_e||[[-20,-20],[p+20,x+20]]).filter(a).on("zoom",({transform:y})=>{t.attr("transform",y)});f.call(Z),se.current=Z},[x,p,w]);const I=k.index_default$1(T),O=Pt.index_default(T),Se=(I[2]-I[0])*1.15,Re=(I[3]-I[1])*1.15,ke=p*190/960*360/Se,Me=x*190/678*180/Re,R=h*Math.min(ke,Me),J=L==="mercator"?k.geoMercator().rotate($).center(P||O.geometry.coordinates).translate([p/2,x/2]).scale(R):L==="equalEarth"?k.geoEqualEarth().rotate($).center(P||O.geometry.coordinates).translate([p/2,x/2]).scale(R):L==="naturalEarth"?k.geoNaturalEarth1().rotate($).center(P||O.geometry.coordinates).translate([p/2,x/2]).scale(R):L==="orthographic"?k.geoOrthographic().rotate($).center(P||O.geometry.coordinates).translate([p/2,x/2]).scale(R):k.geoAlbersUsa().rotate($).center(P||O.geometry.coordinates).translate([p/2,x/2]).scale(R),K=k.geoPath().projection(J),de=t=>{if(!d.current||!se.current)return;vt.select(d.current).call(se.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(at.motion.svg,{width:`${p}px`,height:`${x}px`,viewBox:`0 0 ${p} ${x}`,ref:d,direction:"ltr",children:o.jsxRuntimeExports.jsxs("g",{ref:Y,children:[V.filter(t=>t.position==="before").map(t=>t.layer),T.features.map((t,f)=>{const a=K(t);return a?o.jsxRuntimeExports.jsx("path",{d:a,style:{stroke:ve,strokeWidth:ye,fill:je,vectorEffect:"non-scaling-stroke"}},f):null}),ze?.features.map((t,f)=>{const a=K(t);return a?o.jsxRuntimeExports.jsx("g",{children:o.jsxRuntimeExports.jsx("path",{d:a,style:{stroke:Ie||ve,strokeWidth:We||ye+1,fill:"none",pointerEvents:"none",vectorEffect:"non-scaling-stroke"}})},f):null}),o.jsxRuntimeExports.jsx(zt.AnimatePresence,{children:e.map(t=>{const f=e.filter(a=>a.color).length===0?r[0]:t.color?r[g.indexOf(`${t.color}`)]:C.Colors.gray;return o.jsxRuntimeExports.jsxs(at.motion.g,{className:"undp-map-dots",variants:{initial:{opacity:0},whileInView:{opacity:ie?ie===f?1:ne:be.length!==0?be.indexOf(t.label||"")!==-1?1:ne:1,transition:{duration:j.duration}}},initial:"initial",animate:b?"whileInView":"initial",exit:{opacity:0,transition:{duration:j.duration}},onMouseEnter:a=>{_(t),ue(a.clientY),U(a.clientX),oe?.(t)},onMouseMove:a=>{_(t),ue(a.clientY),U(a.clientX)},onMouseLeave:()=>{_(void 0),U(void 0),ue(void 0),oe?.(void 0)},onClick:()=>{(re||v)&&(qt.isEqual(le,t)&&Ee?(ce(void 0),re?.(void 0)):(ce(t),re?.(t)))},transform:`translate(${J([t.long,t.lat])[0]},${J([t.long,t.lat])[1]})`,children:[o.jsxRuntimeExports.jsx(at.motion.circle,{cx:0,cy:0,variants:{initial:{r:0,fill:e.filter(a=>a.color).length===0?r[0]:t.color?r[g.indexOf(`${t.color}`)]:C.Colors.gray,stroke:e.filter(a=>a.color).length===0?r[0]:t.color?r[g.indexOf(`${t.color}`)]:C.Colors.gray},whileInView:{r:S?S(t.radius||0):M,fill:e.filter(a=>a.color).length===0?r[0]:t.color?r[g.indexOf(`${t.color}`)]:C.Colors.gray,stroke:e.filter(a=>a.color).length===0?r[0]:t.color?r[g.indexOf(`${t.color}`)]:C.Colors.gray,transition:{duration:j.duration}}},initial:"initial",animate:b?"whileInView":"initial",exit:{r:0,transition:{duration:j.duration}},style:{fillOpacity:.8,vectorEffect:"non-scaling-stroke"}}),ge&&t.label?o.jsxRuntimeExports.jsx(at.motion.text,{variants:{initial:{opacity:0,x:S?S(t.radius||0):M,fill:e.filter(a=>a.color).length===0?r[0]:t.color?r[g.indexOf(`${t.color}`)]:C.Colors.gray},whileInView:{opacity:1,x:S?S(t.radius||0):M,transition:{duration:j.duration},fill:e.filter(a=>a.color).length===0?r[0]:t.color?r[g.indexOf(`${t.color}`)]:C.Colors.gray}},initial:"initial",animate:b?"whileInView":"initial",exit:{opacity:0,transition:{duration:j.duration}},y:0,className:o.mo("graph-value text-sm",z?.graphObjectValues),style:{textAnchor:"start",vectorEffect:"non-scaling-stroke",...ae?.graphObjectValues||{}},dx:4,dy:5,children:t.label}):null]},t.label||`${t.lat}-${t.long}`)})}),V.filter(t=>t.position==="after").map(t=>t.layer)]})}),e.filter(t=>t.color).length===0||Pe===!1?null:o.jsxRuntimeExports.jsx("div",{className:o.mo("absolute left-4 bottom-4 map-color-legend",z?.colorLegend),children:m?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:()=>{we(!1)},children:o.jsxRuntimeExports.jsx(jt.X,{})}),o.jsxRuntimeExports.jsxs("div",{className:"p-2",style:{backgroundColor:"rgba(240,240,240, 0.7)"},children:[B&&B!==""?o.jsxRuntimeExports.jsx("p",{className:"p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300",style:{display:"-webkit-box",WebkitLineClamp:"1",WebkitBoxOrient:"vertical"},children:B}):null,o.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-3",children:g.map((t,f)=>o.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 items-center",onMouseOver:()=>{u(r[f%r.length])},onMouseLeave:()=>{u(void 0)},children:[o.jsxRuntimeExports.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:r[f%r.length]}}),o.jsxRuntimeExports.jsx(Bt._,{size:"sm",marginBottom:"none",leading:"none",children:t})]},f))})]})]}):o.jsxRuntimeExports.jsx("button",{type:"button",className:"mb-0 border-0 bg-transparent p-0 self-start",onClick:()=>{we(!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"})})}),w==="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 text-primary-gray-700 border border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"+"}),o.jsxRuntimeExports.jsx("button",{onClick:()=>de("out"),className:"leading-0 px-2 py-3.5 text-primary-gray-700 border border-t-0 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"–"})]})]}),v&&le!==void 0?o.jsxRuntimeExports.jsx(_t.DetailsModal,{body:v,data:le,setData:ce,className:z?.modal}):null,G&&te&&H&&X?o.jsxRuntimeExports.jsx($t.Tooltip,{data:G,body:te,xPos:H,yPos:X,backgroundStyle:ae?.tooltip,className:z?.tooltip}):null]})}function Gt(n){const e=o.compilerRuntimeExports.c(130),{data:r,mapData:ee,graphTitle:B,colors:g,sources:M,graphDescription:x,height:p,width:h,footNote:P,colorLegendTitle:te,colorDomain:ge,radius:ye,scale:ve,centerPoint:je,padding:oe,mapBorderWidth:Pe,mapNoDataColor:$e,backgroundColor:_e,showLabels:be,mapBorderColor:re,tooltip:Ee,relativeHeight:v,onSeriesMouseOver:ae,isWorldMap:z,showColorScale:L,zoomScaleExtend:w,zoomTranslateExtend:j,graphID:ne,highlightedDataPoints:V,onSeriesMouseClick:De,graphDownload:Ce,dataDownload:$,showAntarctica:A,language:F,minHeight:Ie,theme:We,ariaLabel:T,resetSelectionOnDoubleClick:ze,detailsOnClick:ie,styles:u,classNames:m,mapProjection:we,zoomInteraction:se,animate:le,dimmedOpacity:ce,customLayers:G,maxRadiusValue:_,timeline:H,collapseColorScaleByDefault:U,projectionRotate:X,rewindCoordinatesInMapData:ue,mapOverlay:d}=n,b=ee===void 0?"https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-v2.json":ee,Y=P===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.":P,S=ye===void 0?5:ye,I=ve===void 0?.95:ve,O=Pe===void 0?.5:Pe,Se=$e===void 0?C.Colors.light.graphNoData:$e,Re=_e===void 0?!1:_e,ke=be===void 0?!1:be,Me=re===void 0?C.Colors.light.grays["gray-500"]:re,R=z===void 0?!0:z,J=L===void 0?!0:L;let K;e[0]!==w?(K=w===void 0?[.8,6]:w,e[0]=w,e[1]=K):K=e[1];const de=K;let t;e[2]!==V?(t=V===void 0?[]:V,e[2]=V,e[3]=t):t=e[3];const f=t,a=Ce===void 0?!1:Ce,Z=$===void 0?!1:$,y=A===void 0?!1:A,Oe=F===void 0?"en":F,E=Ie===void 0?0:Ie,W=We===void 0?"light":We,nt=ze===void 0?!0:ze,it=we===void 0?"naturalEarth":we,st=se===void 0?"button":se,Le=le===void 0?!1:le,lt=ce===void 0?.3:ce;let Ve;e[4]!==G?(Ve=G===void 0?[]:G,e[4]=G,e[5]=Ve):Ve=e[5];const ct=Ve;let Ae;e[6]!==H?(Ae=H===void 0?{enabled:!1,autoplay:!1,showOnlyActiveDate:!0}:H,e[6]=H,e[7]=Ae):Ae=e[7];const s=Ae;let Fe;e[8]!==X?(Fe=X===void 0?[0,0]:X,e[8]=X,e[9]=Fe):Fe=e[9];const ut=Fe,dt=ue===void 0?!0:ue,[Q,St]=i.useState(0),[Ne,Rt]=i.useState(0),[N,kt]=i.useState(s.autoplay);let qe;if(e[10]!==r||e[11]!==s.dateFormat){let l;e[13]!==s.dateFormat?(l=D=>Et.parse(`${D.date}`,s.dateFormat||"yyyy",new Date).getTime(),e[13]=s.dateFormat,e[14]=l):l=e[14],qe=[...new Set(r.filter(ro).map(l))],qe.sort(oo),e[10]=r,e[11]=s.dateFormat,e[12]=qe}else qe=e[12];const c=qe,[q,pt]=i.useState(s.autoplay?0:c.length-1),[pe,Mt]=i.useState(void 0),[mt,Ot]=i.useState(void 0),ht=i.useRef(null),bt=i.useRef(null);let Te,Ge;e[15]===Symbol.for("react.memo_cache_sentinel")?(Te=()=>{const l=new ResizeObserver(D=>{St(D[0].target.clientWidth||620),Rt(D[0].target.clientHeight||480)});return ht.current&&l.observe(ht.current),()=>l.disconnect()},Ge=[],e[15]=Te,e[16]=Ge):(Te=e[15],Ge=e[16]),i.useEffect(Te,Ge);let He;e[17]===Symbol.for("react.memo_cache_sentinel")?(He=l=>{Mt(l)},e[17]=He):He=e[17];const Ue=i.useEffectEvent(He);let Xe;e[18]===Symbol.for("react.memo_cache_sentinel")?(Xe=l=>{Ot(l)},e[18]=Xe):Xe=e[18];const Be=i.useEffectEvent(Xe);let Ye;e[19]!==b||e[20]!==Ue?(Ye=()=>{typeof b=="string"?Ct.fetchAndParseJSON(b).then(D=>{Ue(D)}):Ue(b)},e[19]=b,e[20]=Ue,e[21]=Ye):Ye=e[21];let Je;e[22]!==b?(Je=[b],e[22]=b,e[23]=Je):Je=e[23],i.useEffect(Ye,Je);let Ke;e[24]!==d?.mapData||e[25]!==Be?(Ke=()=>{d?.mapData||Be(void 0),typeof d?.mapData=="string"?Ct.fetchAndParseJSON(d?.mapData).then(D=>{Be(D)}):Be(d?.mapData)},e[24]=d?.mapData,e[25]=Be,e[26]=Ke):Ke=e[26];const ft=d?.mapData;let Ze;e[27]!==ft?(Ze=[ft],e[27]=ft,e[28]=Ze):Ze=e[28],i.useEffect(Ke,Ze);let Qe,et;e[29]!==N||e[30]!==s.speed||e[31]!==c?(Qe=()=>{const l=setInterval(()=>{pt(D=>D<c.length-1?D+1:0)},(s.speed||2)*1e3);return N||clearInterval(l),()=>clearInterval(l)},et=[c,N,s.speed],e[29]=N,e[30]=s.speed,e[31]=c,e[32]=Qe,e[33]=et):(Qe=e[32],et=e[33]),i.useEffect(Qe,et);const xt=s.dateFormat||"yyyy";let tt;e[34]!==q||e[35]!==xt||e[36]!==s.showOnlyActiveDate||e[37]!==c?(tt=Dt.getSliderMarks(c,q,s.showOnlyActiveDate,xt),e[34]=q,e[35]=xt,e[36]=s.showOnlyActiveDate,e[37]=c,e[38]=tt):tt=e[38];const ot=tt,gt=m?.graphContainer,yt=u?.graphContainer;let me;e[39]!==m?.description||e[40]!==m?.title||e[41]!==r||e[42]!==Z||e[43]!==x||e[44]!==a||e[45]!==B||e[46]!==u?.description||e[47]!==u?.title||e[48]!==h?(me=B||x||a||Z?o.jsxRuntimeExports.jsx(Vt.GraphHeader,{styles:{title:u?.title,description:u?.description},classNames:{title:m?.title,description:m?.description},graphTitle:B,graphDescription:x,width:h,graphDownload:a?bt:void 0,dataDownload:Z?r.map(to).filter(eo).length>0?r.map(Qt).filter(Zt):r.filter(Kt):null}):null,e[39]=m?.description,e[40]=m?.title,e[41]=r,e[42]=Z,e[43]=x,e[44]=a,e[45]=B,e[46]=u?.description,e[47]=u?.title,e[48]=h,e[49]=me):me=e[49];let he;e[50]!==q||e[51]!==ot||e[52]!==N||e[53]!==s.enabled||e[54]!==c?(he=s.enabled&&c.length>0&&ot?o.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[o.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{kt(!N)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":N?"Click to pause animation":"Click to play animation",children:N?o.jsxRuntimeExports.jsx(jt.Pause,{}):o.jsxRuntimeExports.jsx(jt.Play,{})}),o.jsxRuntimeExports.jsx(Dt.Nr,{min:c[0],max:c[c.length-1],marks:ot,step:null,defaultValue:c[c.length-1],value:c[q],onChangeComplete:l=>{pt(c.indexOf(l))},onChange:l=>{pt(c.indexOf(l))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,e[50]=q,e[51]=ot,e[52]=N,e[53]=s.enabled,e[54]=c,e[55]=he):he=e[55];let fe;e[56]!==Le||e[57]!==je||e[58]!==m||e[59]!==U||e[60]!==ge||e[61]!==te||e[62]!==g||e[63]!==ct||e[64]!==r||e[65]!==ie||e[66]!==lt||e[67]!==p||e[68]!==f||e[69]!==q||e[70]!==R||e[71]!==Me||e[72]!==O||e[73]!==Se||e[74]!==d?.mapBorderColor||e[75]!==d?.mapBorderWidth||e[76]!==it||e[77]!==pe||e[78]!==_||e[79]!==E||e[80]!==De||e[81]!==ae||e[82]!==mt||e[83]!==ut||e[84]!==S||e[85]!==v||e[86]!==nt||e[87]!==dt||e[88]!==I||e[89]!==y||e[90]!==J||e[91]!==ke||e[92]!==u||e[93]!==Ne||e[94]!==Q||e[95]!==W||e[96]!==s.dateFormat||e[97]!==s.enabled||e[98]!==Ee||e[99]!==c||e[100]!==h||e[101]!==st||e[102]!==de||e[103]!==j?(fe=o.jsxRuntimeExports.jsx(wt.GraphArea,{ref:ht,children:Q&&Ne&&pe?o.jsxRuntimeExports.jsx(Tt,{data:r.filter(l=>s.enabled?`${l.date}`===Et.format(new Date(c[q]),s.dateFormat||"yyyy"):l),mapData:y?pe:{...pe,features:pe.features.filter(Jt)},colorDomain:r.filter(Yt).length===0?[]:ge||Ft.uniqBy(r,"color",!0),width:Q,height:Ne,scale:I,centerPoint:je,colors:r.filter(Xt).length===0?g?[g]:[C.Colors.primaryColors["blue-600"]]:g||C.Colors[W].categoricalColors.colors,colorLegendTitle:te,radius:S,overlayMapData:mt,overlayMapBorderColor:d?.mapBorderColor,overlayMapBorderWidth:d?.mapBorderWidth,mapBorderWidth:O,mapNoDataColor:Se,mapBorderColor:Me,tooltip:Ee,onSeriesMouseOver:ae,showLabels:ke,isWorldMap:R,showColorScale:J,zoomScaleExtend:de,zoomTranslateExtend:j,onSeriesMouseClick:De,highlightedDataPoints:f,resetSelectionOnDoubleClick:nt,styles:u,classNames:m,zoomInteraction:st,detailsOnClick:ie,mapProjection:it||(R?"naturalEarth":"mercator"),animate:Le===!0?{duration:.5,once:!0,amount:.5}:Le||{duration:0,once:!0,amount:0},dimmedOpacity:lt,customLayers:ct,maxRadiusValue:At.checkIfNullOrUndefined(_)?Math.max(...r.map(Ut).filter(Ht)):_,collapseColorScaleByDefault:U,projectionRotate:ut,rewindCoordinatesInMapData:dt}):o.jsxRuntimeExports.jsx("div",{style:{height:`${Math.max(E,p||(v?E?(h||Q)*v>E?(h||Q)*v:E:(h||Q)*v:Ne))}px`},className:"flex items-center justify-center",children:o.jsxRuntimeExports.jsx(Nt.w,{"aria-label":"Loading graph"})})}),e[56]=Le,e[57]=je,e[58]=m,e[59]=U,e[60]=ge,e[61]=te,e[62]=g,e[63]=ct,e[64]=r,e[65]=ie,e[66]=lt,e[67]=p,e[68]=f,e[69]=q,e[70]=R,e[71]=Me,e[72]=O,e[73]=Se,e[74]=d?.mapBorderColor,e[75]=d?.mapBorderWidth,e[76]=it,e[77]=pe,e[78]=_,e[79]=E,e[80]=De,e[81]=ae,e[82]=mt,e[83]=ut,e[84]=S,e[85]=v,e[86]=nt,e[87]=dt,e[88]=I,e[89]=y,e[90]=J,e[91]=ke,e[92]=u,e[93]=Ne,e[94]=Q,e[95]=W,e[96]=s.dateFormat,e[97]=s.enabled,e[98]=Ee,e[99]=c,e[100]=h,e[101]=st,e[102]=de,e[103]=j,e[104]=fe):fe=e[104];let xe;e[105]!==m?.footnote||e[106]!==m?.source||e[107]!==Y||e[108]!==M||e[109]!==u?.footnote||e[110]!==u?.source||e[111]!==h?(xe=M||Y?o.jsxRuntimeExports.jsx(Lt.GraphFooter,{styles:{footnote:u?.footnote,source:u?.source},classNames:{footnote:m?.footnote,source:m?.source},sources:M,footNote:Y,width:h}):null,e[105]=m?.footnote,e[106]=m?.source,e[107]=Y,e[108]=M,e[109]=u?.footnote,e[110]=u?.source,e[111]=h,e[112]=xe):xe=e[112];let rt;return e[113]!==T||e[114]!==Re||e[115]!==ne||e[116]!==p||e[117]!==Oe||e[118]!==E||e[119]!==oe||e[120]!==v||e[121]!==gt||e[122]!==yt||e[123]!==me||e[124]!==he||e[125]!==fe||e[126]!==xe||e[127]!==W||e[128]!==h?(rt=o.jsxRuntimeExports.jsxs(wt.GraphContainer,{className:gt,style:yt,id:ne,ref:bt,"aria-label":T,backgroundColor:Re,theme:W,language:Oe,minHeight:E,width:h,height:p,relativeHeight:v,padding:oe,children:[me,he,fe,xe]}),e[113]=T,e[114]=Re,e[115]=ne,e[116]=p,e[117]=Oe,e[118]=E,e[119]=oe,e[120]=v,e[121]=gt,e[122]=yt,e[123]=me,e[124]=he,e[125]=fe,e[126]=xe,e[127]=W,e[128]=h,e[129]=rt):rt=e[129],rt}function Ht(n){return n!=null}function Ut(n){return n.radius}function Xt(n){return n.color}function Yt(n){return n.color}function Jt(n){return n.properties?.NAME!=="Antarctica"}function Kt(n){return n!==void 0}function Zt(n){return n!==void 0}function Qt(n){return n.data}function eo(n){return n!==void 0}function to(n){return n.data}function oo(n,e){return n-e}function ro(n){return n.date}exports.DotDensityMap=Gt;
2
2
  //# sourceMappingURL=DotDensityMap.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"DotDensityMap.cjs","sources":["../src/Components/Graphs/Maps/DotDensityMap/Graph.tsx","../src/Components/Graphs/Maps/DotDensityMap/index.tsx"],"sourcesContent":["import isEqual from 'fast-deep-equal';\r\nimport { useEffect, useMemo, useRef, useState } from 'react';\r\nimport {\r\n geoAlbersUsa,\r\n geoEqualEarth,\r\n geoMercator,\r\n geoNaturalEarth1,\r\n geoOrthographic,\r\n geoPath,\r\n} from 'd3-geo';\r\nimport { D3ZoomEvent, zoom, ZoomBehavior } from 'd3-zoom';\r\nimport { select } from 'd3-selection';\r\nimport { scaleSqrt } from 'd3-scale';\r\nimport { P } from '@undp/design-system-react/Typography';\r\nimport bbox from '@turf/bbox';\r\nimport centerOfMass from '@turf/center-of-mass';\r\nimport { AnimatePresence, motion, useInView } from 'motion/react';\r\nimport { cn } from '@undp/design-system-react/cn';\r\nimport rewind from '@turf/rewind';\r\nimport { FeatureCollection } from 'geojson';\r\n\r\nimport {\r\n AnimateDataType,\r\n ClassNameObject,\r\n CustomLayerDataType,\r\n DotDensityMapDataType,\r\n MapProjectionTypes,\r\n StyleObject,\r\n ZoomInteractionTypes,\r\n} from '@/Types';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { X } from '@/Components/Icons';\r\nimport { DetailsModal } from '@/Components/Elements/DetailsModal';\r\n\r\ninterface Props {\r\n data: DotDensityMapDataType[];\r\n\r\n mapData: FeatureCollection;\r\n colorDomain: string[];\r\n width: number;\r\n height: number;\r\n scale: number;\r\n centerPoint?: [number, number];\r\n colors: string[];\r\n colorLegendTitle?: string;\r\n radius: number;\r\n mapBorderWidth: number;\r\n mapNoDataColor: string;\r\n showLabels: boolean;\r\n mapBorderColor: string;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n isWorldMap: boolean;\r\n showColorScale: boolean;\r\n zoomScaleExtend: [number, number];\r\n zoomTranslateExtend?: [[number, number], [number, number]];\r\n highlightedDataPoints: (string | number)[];\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n resetSelectionOnDoubleClick: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n zoomInteraction: ZoomInteractionTypes;\r\n mapProjection: MapProjectionTypes;\r\n animate: AnimateDataType;\r\n dimmedOpacity: number;\r\n customLayers: CustomLayerDataType[];\r\n maxRadiusValue: number;\r\n collapseColorScaleByDefault?: boolean;\r\n projectionRotate: [number, number] | [number, number, number];\r\n rewindCoordinatesInMapData: boolean;\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n const {\r\n data,\r\n colors,\r\n mapData,\r\n colorLegendTitle,\r\n colorDomain,\r\n radius,\r\n height,\r\n width,\r\n scale,\r\n centerPoint,\r\n tooltip,\r\n showLabels,\r\n mapBorderWidth,\r\n mapBorderColor,\r\n mapNoDataColor,\r\n onSeriesMouseOver,\r\n showColorScale,\r\n zoomScaleExtend,\r\n zoomTranslateExtend,\r\n highlightedDataPoints,\r\n onSeriesMouseClick,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n mapProjection,\r\n zoomInteraction,\r\n animate,\r\n dimmedOpacity,\r\n customLayers,\r\n maxRadiusValue,\r\n collapseColorScaleByDefault,\r\n projectionRotate,\r\n rewindCoordinatesInMapData,\r\n } = props;\r\n const formattedMapData = useMemo(() => {\r\n if (!rewindCoordinatesInMapData) return mapData;\r\n\r\n return rewind(mapData, { reverse: true }) as FeatureCollection;\r\n }, [mapData, rewindCoordinatesInMapData]);\r\n const [selectedColor, setSelectedColor] = useState<string | undefined>(undefined);\r\n\r\n const [showLegend, setShowLegend] = useState(\r\n collapseColorScaleByDefault === undefined ? !(width < 680) : !collapseColorScaleByDefault,\r\n );\r\n const zoomRef = useRef<ZoomBehavior<SVGSVGElement, unknown> | null>(null);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseClickData, setMouseClickData] = useState<any>(undefined);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseOverData, setMouseOverData] = useState<any>(undefined);\r\n const [eventX, setEventX] = useState<number | undefined>(undefined);\r\n const [eventY, setEventY] = useState<number | undefined>(undefined);\r\n const mapSvg = useRef<SVGSVGElement>(null);\r\n const isInView = useInView(mapSvg, {\r\n once: animate.once,\r\n amount: animate.amount,\r\n });\r\n const mapG = useRef<SVGGElement>(null);\r\n const radiusScale =\r\n data.filter(d => d.radius === undefined || d.radius === null).length !== data.length\r\n ? scaleSqrt().domain([0, maxRadiusValue]).range([0.25, radius]).nice()\r\n : undefined;\r\n\r\n useEffect(() => {\r\n const mapGSelect = select(mapG.current);\r\n const mapSvgSelect = select(mapSvg.current);\r\n const zoomFilter = (e: D3ZoomEvent<SVGSVGElement, unknown>['sourceEvent']) => {\r\n if (zoomInteraction === 'noZoom') return false;\r\n if (zoomInteraction === 'button') return !e.type.includes('wheel');\r\n const isWheel = e.type === 'wheel';\r\n const isTouch = e.type.startsWith('touch');\r\n const isDrag = e.type === 'mousedown' || e.type === 'mousemove';\r\n\r\n if (isTouch) return true;\r\n if (isWheel) {\r\n if (zoomInteraction === 'scroll') return true;\r\n return e.ctrlKey;\r\n }\r\n return isDrag && !e.button && !e.ctrlKey;\r\n };\r\n const zoomBehavior = zoom<SVGSVGElement, unknown>()\r\n .scaleExtent(zoomScaleExtend)\r\n .translateExtent(\r\n zoomTranslateExtend || [\r\n [-20, -20],\r\n [width + 20, height + 20],\r\n ],\r\n )\r\n .filter(zoomFilter)\r\n .on('zoom', ({ transform }) => {\r\n mapGSelect.attr('transform', transform);\r\n });\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapSvgSelect.call(zoomBehavior as any);\r\n\r\n zoomRef.current = zoomBehavior;\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [height, width, zoomInteraction]);\r\n\r\n const bounds = bbox(formattedMapData);\r\n\r\n const center = centerOfMass(formattedMapData);\r\n const lonDiff = (bounds[2] - bounds[0]) * 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 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 width={`${width}px`}\r\n height={`${height}px`}\r\n viewBox={`0 0 ${width} ${height}`}\r\n ref={mapSvg}\r\n direction='ltr'\r\n >\r\n <g ref={mapG}>\r\n {customLayers.filter(d => d.position === 'before').map(d => d.layer)}\r\n {formattedMapData.features.map((d, i: number) => {\r\n const path = pathGenerator(d);\r\n if (!path) return null;\r\n return (\r\n <path\r\n d={path}\r\n key={i}\r\n style={{\r\n stroke: mapBorderColor,\r\n strokeWidth: mapBorderWidth,\r\n fill: mapNoDataColor,\r\n }}\r\n />\r\n );\r\n })}\r\n <AnimatePresence>\r\n {data.map(d => {\r\n const color =\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)];\r\n return (\r\n <motion.g\r\n className='undp-map-dots'\r\n key={d.label || `${d.lat}-${d.long}`}\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 : highlightedDataPoints.length !== 0\r\n ? highlightedDataPoints.indexOf(d.label || '') !== -1\r\n ? 1\r\n : dimmedOpacity\r\n : 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n onMouseEnter={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n onSeriesMouseOver?.(d);\r\n }}\r\n onMouseMove={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n }}\r\n onMouseLeave={() => {\r\n setMouseOverData(undefined);\r\n setEventX(undefined);\r\n setEventY(undefined);\r\n onSeriesMouseOver?.(undefined);\r\n }}\r\n onClick={() => {\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (isEqual(mouseClickData, d) && resetSelectionOnDoubleClick) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(d);\r\n onSeriesMouseClick?.(d);\r\n }\r\n }\r\n }}\r\n transform={`translate(${\r\n (projection([d.long, d.lat]) as [number, number])[0]\r\n },${(projection([d.long, d.lat]) as [number, number])[1]})`}\r\n >\r\n <motion.circle\r\n cx={0}\r\n cy={0}\r\n variants={{\r\n initial: {\r\n r: 0,\r\n fill:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n stroke:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n },\r\n whileInView: {\r\n r: !radiusScale ? radius : radiusScale(d.radius || 0),\r\n fill:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n stroke:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ r: 0, transition: { duration: animate.duration } }}\r\n style={{\r\n fillOpacity: 0.8,\r\n }}\r\n />\r\n {showLabels && d.label ? (\r\n <motion.text\r\n variants={{\r\n initial: {\r\n opacity: 0,\r\n x: !radiusScale ? radius : radiusScale(d.radius || 0),\r\n fill:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n },\r\n whileInView: {\r\n opacity: 1,\r\n x: !radiusScale ? radius : radiusScale(d.radius || 0),\r\n transition: { duration: animate.duration },\r\n fill:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n y={0}\r\n className={cn('graph-value text-sm', classNames?.graphObjectValues)}\r\n style={{\r\n textAnchor: 'start',\r\n ...(styles?.graphObjectValues || {}),\r\n }}\r\n dx={4}\r\n dy={5}\r\n >\r\n {d.label}\r\n </motion.text>\r\n ) : null}\r\n </motion.g>\r\n );\r\n })}\r\n </AnimatePresence>\r\n {customLayers.filter(d => d.position === 'after').map(d => d.layer)}\r\n </g>\r\n </motion.svg>\r\n {data.filter(el => el.color).length === 0 || 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 className='p-2' style={{ backgroundColor: 'rgba(240,240,240, 0.7)' }}>\r\n {colorLegendTitle && colorLegendTitle !== '' ? (\r\n <p\r\n className='p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300'\r\n style={{\r\n display: '-webkit-box',\r\n WebkitLineClamp: '1',\r\n WebkitBoxOrient: 'vertical',\r\n }}\r\n >\r\n {colorLegendTitle}\r\n </p>\r\n ) : null}\r\n <div className='flex flex-col gap-3'>\r\n {colorDomain.map((d, i) => (\r\n <div\r\n key={i}\r\n className='flex gap-2 items-center'\r\n onMouseOver={() => {\r\n setSelectedColor(colors[i % colors.length]);\r\n }}\r\n onMouseLeave={() => {\r\n setSelectedColor(undefined);\r\n }}\r\n >\r\n <div\r\n className='w-2 h-2 rounded-full'\r\n style={{ backgroundColor: colors[i % colors.length] }}\r\n />\r\n <P size='sm' marginBottom='none' leading='none'>\r\n {d}\r\n </P>\r\n </div>\r\n ))}\r\n </div>\r\n </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 text-primary-gray-700 border border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100'\r\n >\r\n +\r\n </button>\r\n <button\r\n onClick={() => handleZoom('out')}\r\n className='leading-0 px-2 py-3.5 text-primary-gray-700 border border-t-0 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100'\r\n >\r\n –\r\n </button>\r\n </div>\r\n )}\r\n </div>\r\n {detailsOnClick && mouseClickData !== undefined ? (\r\n <DetailsModal\r\n body={detailsOnClick}\r\n data={mouseClickData}\r\n setData={setMouseClickData}\r\n className={classNames?.modal}\r\n />\r\n ) : null}\r\n {mouseOverData && tooltip && eventX && eventY ? (\r\n <Tooltip\r\n data={mouseOverData}\r\n body={tooltip}\r\n xPos={eventX}\r\n yPos={eventY}\r\n backgroundStyle={styles?.tooltip}\r\n className={classNames?.tooltip}\r\n />\r\n ) : null}\r\n </>\r\n );\r\n}\r\n","import { useState, useRef, useEffect, useEffectEvent, useMemo } from 'react';\r\nimport { format } from 'date-fns/format';\r\nimport { parse } from 'date-fns/parse';\r\nimport { SliderUI } from '@undp/design-system-react/SliderUI';\r\nimport { Spinner } from '@undp/design-system-react/Spinner';\r\n\r\nimport { Graph } from './Graph';\r\n\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport {\r\n DotDensityMapDataType,\r\n Languages,\r\n SourcesDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n ZoomInteractionTypes,\r\n MapProjectionTypes,\r\n CustomLayerDataType,\r\n AnimateDataType,\r\n TimelineDataType,\r\n} from '@/Types';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { fetchAndParseJSON } from '@/Utils/fetchAndParseData';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { Pause, Play } from '@/Components/Icons';\r\nimport { getSliderMarks } from '@/Utils/getSliderMarks';\r\nimport { uniqBy } from '@/Utils/uniqBy';\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: DotDensityMapDataType[];\r\n // Titles, Labels, and Sources\r\n /** Title of the graph */\r\n graphTitle?: string | React.ReactNode;\r\n /** Description of the graph */\r\n graphDescription?: string | React.ReactNode;\r\n /** Footnote for the graph */\r\n footNote?: string | React.ReactNode;\r\n /** Source data for the graph */\r\n sources?: SourcesDataType[];\r\n /** Accessibility label */\r\n ariaLabel?: string;\r\n\r\n // Colors and Styling\r\n /** Color or array of colors for the circle */\r\n colors?: string | string[];\r\n /** Domain of colors for the graph */\r\n colorDomain?: string[];\r\n /** Title for the color legend */\r\n colorLegendTitle?: string;\r\n /** Color for the areas where data is no available */\r\n mapNoDataColor?: string;\r\n /** Background color of the graph */\r\n backgroundColor?: string | boolean;\r\n /** Custom styles for the graph. Each object should be a valid React CSS style object. */\r\n styles?: StyleObject;\r\n /** Custom class names */\r\n classNames?: ClassNameObject;\r\n\r\n // Size and Spacing\r\n /** Width of the graph */\r\n width?: number;\r\n /** Height of the graph */\r\n height?: number;\r\n /** Minimum height of the graph */\r\n minHeight?: number;\r\n /** Relative height scaling factor. This overwrites the height props */\r\n relativeHeight?: number;\r\n /** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */\r\n padding?: string;\r\n\r\n // Graph Parameters\r\n /** Maximum radius of the circle */\r\n radius?: number;\r\n /** Map data as an object in geoJson format or a url for geoJson */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapData?: any;\r\n /** Defines if the coordinates in the map data should be rewinded or not. Try to change this is the visualization shows countries as holes instead of shapes. */\r\n rewindCoordinatesInMapData?: boolean;\r\n /** Scaling factor for the map. Multiplies the scale number to scale. */\r\n scale?: number;\r\n /** Center point of the map */\r\n centerPoint?: [number, number];\r\n /** Controls the rotation of the map projection, in degrees, applied before rendering. Useful for shifting the antimeridian to focus the map on different regions */\r\n projectionRotate?: [number, number] | [number, number, number];\r\n /** Defines the zoom mode for the map */\r\n zoomInteraction?: ZoomInteractionTypes;\r\n /** Stroke width of the regions in the map */\r\n mapBorderWidth?: number;\r\n /** Stroke color of the regions in the map */\r\n mapBorderColor?: string;\r\n /** Toggle if the map is a world map */\r\n isWorldMap?: boolean;\r\n /** Map projection type */\r\n mapProjection?: MapProjectionTypes;\r\n /** Extend of the allowed zoom in the map */\r\n zoomScaleExtend?: [number, number];\r\n /** Extend of the allowed panning in the map */\r\n zoomTranslateExtend?: [[number, number], [number, number]];\r\n /** Toggle visibility of labels */\r\n showLabels?: boolean;\r\n /** Maximum value mapped to the radius chart */\r\n maxRadiusValue?: number;\r\n /** Data points to highlight. Use the label value from data to highlight the data point */\r\n highlightedDataPoints?: (string | number)[];\r\n /** Defines the opacity of the non-highlighted data */\r\n dimmedOpacity?: number;\r\n /** Toggles if the graph animates in when loaded. */\r\n animate?: boolean | AnimateDataType;\r\n /** Toggle visibility of color scale. This is only applicable if the data props hae color parameter */\r\n showColorScale?: boolean;\r\n /** Toggle if color scale is collapsed by default. */\r\n collapseColorScaleByDefault?: boolean;\r\n /** Toggles the visibility of Antarctica in the default map. Only applicable for the default map. */\r\n showAntarctica?: boolean;\r\n /** Optional SVG <g> element or function that renders custom content behind or in front of the graph. */\r\n customLayers?: CustomLayerDataType[];\r\n /** 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 DotDensityMap(props: Props) {\r\n const {\r\n data,\r\n mapData = 'https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-v2.json',\r\n graphTitle,\r\n colors,\r\n sources,\r\n graphDescription,\r\n height,\r\n width,\r\n footNote = 'The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.',\r\n colorLegendTitle,\r\n colorDomain,\r\n radius = 5,\r\n scale = 0.95,\r\n centerPoint,\r\n padding,\r\n mapBorderWidth = 0.5,\r\n mapNoDataColor = Colors.light.graphNoData,\r\n backgroundColor = false,\r\n showLabels = false,\r\n mapBorderColor = Colors.light.grays['gray-500'],\r\n tooltip,\r\n relativeHeight,\r\n onSeriesMouseOver,\r\n isWorldMap = true,\r\n showColorScale = true,\r\n zoomScaleExtend = [0.8, 6],\r\n zoomTranslateExtend,\r\n graphID,\r\n highlightedDataPoints = [],\r\n onSeriesMouseClick,\r\n graphDownload = false,\r\n dataDownload = false,\r\n showAntarctica = false,\r\n language = 'en',\r\n minHeight = 0,\r\n theme = 'light',\r\n ariaLabel,\r\n resetSelectionOnDoubleClick = true,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n mapProjection = 'naturalEarth',\r\n zoomInteraction = 'button',\r\n animate = false,\r\n dimmedOpacity = 0.3,\r\n customLayers = [],\r\n maxRadiusValue,\r\n timeline = { enabled: false, autoplay: false, showOnlyActiveDate: true },\r\n collapseColorScaleByDefault,\r\n 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 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 colorDomain={\r\n data.filter(el => el.color).length === 0\r\n ? []\r\n : colorDomain || (uniqBy(data, 'color', true) as string[])\r\n }\r\n width={svgWidth}\r\n height={svgHeight}\r\n scale={scale}\r\n centerPoint={centerPoint}\r\n colors={\r\n data.filter(el => el.color).length === 0\r\n ? colors\r\n ? [colors as string]\r\n : [Colors.primaryColors['blue-600']]\r\n : (colors as string[] | undefined) || Colors[theme].categoricalColors.colors\r\n }\r\n colorLegendTitle={colorLegendTitle}\r\n radius={radius}\r\n mapBorderWidth={mapBorderWidth}\r\n mapNoDataColor={mapNoDataColor}\r\n mapBorderColor={mapBorderColor}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n showLabels={showLabels}\r\n isWorldMap={isWorldMap}\r\n showColorScale={showColorScale}\r\n zoomScaleExtend={zoomScaleExtend}\r\n zoomTranslateExtend={zoomTranslateExtend}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n highlightedDataPoints={highlightedDataPoints}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n styles={styles}\r\n classNames={classNames}\r\n zoomInteraction={zoomInteraction}\r\n detailsOnClick={detailsOnClick}\r\n mapProjection={mapProjection || (isWorldMap ? 'naturalEarth' : 'mercator')}\r\n animate={\r\n animate === true\r\n ? { duration: 0.5, once: true, amount: 0.5 }\r\n : animate || { duration: 0, once: true, amount: 0 }\r\n }\r\n dimmedOpacity={dimmedOpacity}\r\n customLayers={customLayers}\r\n maxRadiusValue={\r\n !checkIfNullOrUndefined(maxRadiusValue)\r\n ? (maxRadiusValue as number)\r\n : Math.max(...data.map(d => d.radius).filter(d => d !== undefined && d !== null))\r\n }\r\n collapseColorScaleByDefault={collapseColorScaleByDefault}\r\n 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","colors","mapData","colorLegendTitle","colorDomain","radius","height","width","scale","centerPoint","tooltip","showLabels","mapBorderWidth","mapBorderColor","mapNoDataColor","onSeriesMouseOver","showColorScale","zoomScaleExtend","zoomTranslateExtend","highlightedDataPoints","onSeriesMouseClick","resetSelectionOnDoubleClick","detailsOnClick","styles","classNames","mapProjection","zoomInteraction","animate","dimmedOpacity","customLayers","maxRadiusValue","collapseColorScaleByDefault","projectionRotate","rewindCoordinatesInMapData","formattedMapData","useMemo","rewind","reverse","selectedColor","setSelectedColor","useState","undefined","showLegend","setShowLegend","zoomRef","useRef","mouseClickData","setMouseClickData","mouseOverData","setMouseOverData","eventX","setEventX","eventY","setEventY","mapSvg","isInView","useInView","once","amount","mapG","radiusScale","filter","d","length","scaleSqrt","domain","range","nice","useEffect","mapGSelect","select","current","mapSvgSelect","zoomFilter","e","type","includes","isWheel","isTouch","startsWith","isDrag","ctrlKey","button","zoomBehavior","zoom","scaleExtent","translateExtent","on","transform","attr","call","bounds","bbox","center","centerOfMass","lonDiff","latDiff","scaleX","scaleY","scaleVar","Math","min","projection","geoMercator","rotate","geometry","coordinates","translate","geoEqualEarth","geoNaturalEarth1","geoOrthographic","geoAlbersUsa","pathGenerator","geoPath","handleZoom","direction","scaleBy","jsxs","Fragment","jsx","motion","position","map","layer","features","i","path","stroke","strokeWidth","fill","AnimatePresence","color","el","indexOf","Colors","gray","initial","opacity","whileInView","label","transition","duration","event","clientY","clientX","isEqual","long","lat","r","fillOpacity","x","cn","graphObjectValues","textAnchor","colorLegend","X","backgroundColor","display","WebkitLineClamp","WebkitBoxOrient","P","DetailsModal","modal","Tooltip","DotDensityMap","$","_c","t0","graphTitle","sources","graphDescription","footNote","t1","t2","t3","padding","t4","t5","t6","t7","t8","relativeHeight","isWorldMap","t9","t10","t11","graphID","t12","graphDownload","t13","dataDownload","t14","showAntarctica","t15","language","t16","minHeight","t17","theme","t18","ariaLabel","t19","t20","t21","t22","t23","t24","timeline","t25","t26","t27","light","graphNoData","grays","t28","t29","t30","t31","enabled","autoplay","showOnlyActiveDate","t32","svgWidth","setSvgWidth","svgHeight","setSvgHeight","play","setPlay","dates","dateFormat","t33","d_0","parse","date","Date","getTime","Set","_temp","sort","_temp2","uniqDatesSorted","index","setIndex","mapShape","setMapShape","graphDiv","graphParentDiv","t34","Symbol","for","resizeObserver","ResizeObserver","entries","target","clientWidth","clientHeight","observe","disconnect","t35","shape","onUpdateShape","useEffectEvent","t36","fetchAndParseJSON","then","d_1","t37","t38","t39","speed","interval","setInterval","clearInterval","t40","t41","getSliderMarks","markObj","t42","graphContainer","t43","t44","description","title","GraphHeader","_temp3","_temp4","_temp5","_temp6","_temp7","t45","Pause","Play","SliderUI","nextValue","nextValue_0","t46","GraphArea","d_7","format","_temp8","_temp9","uniqBy","_temp0","primaryColors","categoricalColors","checkIfNullOrUndefined","max","_temp1","_temp10","Spinner","t47","footnote","source","GraphFooter","t48","GraphContainer","d_9","d_8","el_1","el_0","properties","NAME","d_4","d_3","d_2","d_6","d_5","a","b"],"mappings":"28BA8EO,SAASA,GAAMC,EAAc,CAClC,KAAM,CACJC,KAAAA,EACAC,OAAAA,EACAC,QAAAA,EACAC,iBAAAA,EACAC,YAAAA,EACAC,OAAAA,EACAC,OAAAA,EACAC,MAAAA,EACAC,MAAAA,EACAC,YAAAA,EACAC,QAAAA,EACAC,WAAAA,GACAC,eAAAA,GACAC,eAAAA,GACAC,eAAAA,GACAC,kBAAAA,EACAC,eAAAA,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AnSd,SAAAN,GAAAQ,EAAA,CAAA,OA4P8E9P,GAAM,IAAI,CA5PxF,SAAAqP,GAAAU,EAAA,CAAA,OA4PqC/P,EAACzD,MAAO,CA5P7C,SAAAyS,GAAAgB,EAAA,CAAA,OAwNyB1L,EAAED,KAAM,CAxNjC,SAAAyK,GAAAmB,EAAA,CAAA,OA+MyB3L,EAAED,KAAM,CA/MjC,SAAAwK,GAAAvK,EAAA,CAAA,OA0M4BA,EAAE4L,WAAWC,OAAU,YAAY,CA1M/D,SAAAjC,GAAAkC,EAAA,CAAA,OAwJ4BpQ,IAAMrB,MAAS,CAxJ3C,SAAAsP,GAAAoC,EAAA,CAAA,OAuJ6CrQ,IAAMrB,MAAS,CAvJ5D,SAAAqP,GAAAsC,EAAA,CAAA,OAuJyBtQ,EAAC9D,IAAK,CAvJ/B,SAAA6R,GAAAwC,EAAA,CAAA,OAsJ2CvQ,IAAMrB,MAAS,CAtJ1D,SAAAmP,GAAA0C,EAAA,CAAA,OAsJuBxQ,EAAC9D,IAAK,CAtJ7B,SAAA+O,GAAAwF,EAAAC,EAAA,CAAA,OAkEkBD,EAAIC,CAAC,CAlEvB,SAAA3F,GAAA/K,EAAA,CAAA,OA8DgBA,EAAC2K,IAAK"}
1
+ {"version":3,"file":"DotDensityMap.cjs","sources":["../src/Components/Graphs/Maps/DotDensityMap/Graph.tsx","../src/Components/Graphs/Maps/DotDensityMap/index.tsx"],"sourcesContent":["import isEqual from 'fast-deep-equal';\r\nimport { useEffect, useMemo, useRef, useState } from 'react';\r\nimport {\r\n geoAlbersUsa,\r\n geoEqualEarth,\r\n geoMercator,\r\n geoNaturalEarth1,\r\n geoOrthographic,\r\n geoPath,\r\n} from 'd3-geo';\r\nimport { D3ZoomEvent, zoom, ZoomBehavior } from 'd3-zoom';\r\nimport { select } from 'd3-selection';\r\nimport { scaleSqrt } from 'd3-scale';\r\nimport { P } from '@undp/design-system-react/Typography';\r\nimport bbox from '@turf/bbox';\r\nimport centerOfMass from '@turf/center-of-mass';\r\nimport { AnimatePresence, motion, useInView } from 'motion/react';\r\nimport { cn } from '@undp/design-system-react/cn';\r\nimport rewind from '@turf/rewind';\r\nimport { FeatureCollection } from 'geojson';\r\n\r\nimport {\r\n AnimateDataType,\r\n ClassNameObject,\r\n CustomLayerDataType,\r\n DotDensityMapDataType,\r\n MapProjectionTypes,\r\n StyleObject,\r\n ZoomInteractionTypes,\r\n} from '@/Types';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { X } from '@/Components/Icons';\r\nimport { DetailsModal } from '@/Components/Elements/DetailsModal';\r\n\r\ninterface Props {\r\n data: DotDensityMapDataType[];\r\n\r\n mapData: FeatureCollection;\r\n colorDomain: string[];\r\n width: number;\r\n height: number;\r\n scale: number;\r\n centerPoint?: [number, number];\r\n colors: string[];\r\n colorLegendTitle?: string;\r\n radius: number;\r\n mapBorderWidth: number;\r\n mapNoDataColor: string;\r\n showLabels: boolean;\r\n mapBorderColor: string;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n isWorldMap: boolean;\r\n showColorScale: boolean;\r\n zoomScaleExtend: [number, number];\r\n zoomTranslateExtend?: [[number, number], [number, number]];\r\n highlightedDataPoints: (string | number)[];\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n resetSelectionOnDoubleClick: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n zoomInteraction: ZoomInteractionTypes;\r\n mapProjection: MapProjectionTypes;\r\n animate: AnimateDataType;\r\n dimmedOpacity: number;\r\n customLayers: CustomLayerDataType[];\r\n maxRadiusValue: number;\r\n collapseColorScaleByDefault?: boolean;\r\n 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 colors,\r\n mapData,\r\n colorLegendTitle,\r\n colorDomain,\r\n radius,\r\n height,\r\n width,\r\n scale,\r\n centerPoint,\r\n tooltip,\r\n showLabels,\r\n mapBorderWidth,\r\n mapBorderColor,\r\n mapNoDataColor,\r\n onSeriesMouseOver,\r\n showColorScale,\r\n zoomScaleExtend,\r\n zoomTranslateExtend,\r\n highlightedDataPoints,\r\n onSeriesMouseClick,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n mapProjection,\r\n zoomInteraction,\r\n animate,\r\n dimmedOpacity,\r\n customLayers,\r\n maxRadiusValue,\r\n collapseColorScaleByDefault,\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 [selectedColor, setSelectedColor] = useState<string | undefined>(undefined);\r\n\r\n const [showLegend, setShowLegend] = useState(\r\n collapseColorScaleByDefault === undefined ? !(width < 680) : !collapseColorScaleByDefault,\r\n );\r\n const zoomRef = useRef<ZoomBehavior<SVGSVGElement, unknown> | null>(null);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseClickData, setMouseClickData] = useState<any>(undefined);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseOverData, setMouseOverData] = useState<any>(undefined);\r\n const [eventX, setEventX] = useState<number | undefined>(undefined);\r\n const [eventY, setEventY] = useState<number | undefined>(undefined);\r\n const mapSvg = useRef<SVGSVGElement>(null);\r\n const isInView = useInView(mapSvg, {\r\n once: animate.once,\r\n amount: animate.amount,\r\n });\r\n const mapG = useRef<SVGGElement>(null);\r\n const radiusScale =\r\n data.filter(d => d.radius === undefined || d.radius === null).length !== data.length\r\n ? scaleSqrt().domain([0, maxRadiusValue]).range([0.25, radius]).nice()\r\n : undefined;\r\n\r\n useEffect(() => {\r\n const mapGSelect = select(mapG.current);\r\n const mapSvgSelect = select(mapSvg.current);\r\n const zoomFilter = (e: D3ZoomEvent<SVGSVGElement, unknown>['sourceEvent']) => {\r\n if (zoomInteraction === 'noZoom') return false;\r\n if (zoomInteraction === 'button') return !e.type.includes('wheel');\r\n const isWheel = e.type === 'wheel';\r\n const isTouch = e.type.startsWith('touch');\r\n const isDrag = e.type === 'mousedown' || e.type === 'mousemove';\r\n\r\n if (isTouch) return true;\r\n if (isWheel) {\r\n if (zoomInteraction === 'scroll') return true;\r\n return e.ctrlKey;\r\n }\r\n return isDrag && !e.button && !e.ctrlKey;\r\n };\r\n const zoomBehavior = zoom<SVGSVGElement, unknown>()\r\n .scaleExtent(zoomScaleExtend)\r\n .translateExtent(\r\n zoomTranslateExtend || [\r\n [-20, -20],\r\n [width + 20, height + 20],\r\n ],\r\n )\r\n .filter(zoomFilter)\r\n .on('zoom', ({ transform }) => {\r\n mapGSelect.attr('transform', transform);\r\n });\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapSvgSelect.call(zoomBehavior as any);\r\n\r\n zoomRef.current = zoomBehavior;\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [height, width, zoomInteraction]);\r\n\r\n const bounds = bbox(formattedMapData);\r\n\r\n const center = centerOfMass(formattedMapData);\r\n const lonDiff = (bounds[2] - bounds[0]) * 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 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 width={`${width}px`}\r\n height={`${height}px`}\r\n viewBox={`0 0 ${width} ${height}`}\r\n ref={mapSvg}\r\n direction='ltr'\r\n >\r\n <g ref={mapG}>\r\n {customLayers.filter(d => d.position === 'before').map(d => d.layer)}\r\n {formattedMapData.features.map((d, i: number) => {\r\n const path = pathGenerator(d);\r\n if (!path) return null;\r\n return (\r\n <path\r\n d={path}\r\n key={i}\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 );\r\n })}\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 <AnimatePresence>\r\n {data.map(d => {\r\n const color =\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)];\r\n return (\r\n <motion.g\r\n className='undp-map-dots'\r\n key={d.label || `${d.lat}-${d.long}`}\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 : highlightedDataPoints.length !== 0\r\n ? highlightedDataPoints.indexOf(d.label || '') !== -1\r\n ? 1\r\n : dimmedOpacity\r\n : 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n onMouseEnter={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n onSeriesMouseOver?.(d);\r\n }}\r\n onMouseMove={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n }}\r\n onMouseLeave={() => {\r\n setMouseOverData(undefined);\r\n setEventX(undefined);\r\n setEventY(undefined);\r\n onSeriesMouseOver?.(undefined);\r\n }}\r\n onClick={() => {\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (isEqual(mouseClickData, d) && resetSelectionOnDoubleClick) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(d);\r\n onSeriesMouseClick?.(d);\r\n }\r\n }\r\n }}\r\n transform={`translate(${\r\n (projection([d.long, d.lat]) as [number, number])[0]\r\n },${(projection([d.long, d.lat]) as [number, number])[1]})`}\r\n >\r\n <motion.circle\r\n cx={0}\r\n cy={0}\r\n variants={{\r\n initial: {\r\n r: 0,\r\n fill:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n stroke:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n },\r\n whileInView: {\r\n r: !radiusScale ? radius : radiusScale(d.radius || 0),\r\n fill:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n stroke:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ r: 0, transition: { duration: animate.duration } }}\r\n style={{\r\n fillOpacity: 0.8,\r\n vectorEffect: 'non-scaling-stroke',\r\n }}\r\n />\r\n {showLabels && d.label ? (\r\n <motion.text\r\n variants={{\r\n initial: {\r\n opacity: 0,\r\n x: !radiusScale ? radius : radiusScale(d.radius || 0),\r\n fill:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n },\r\n whileInView: {\r\n opacity: 1,\r\n x: !radiusScale ? radius : radiusScale(d.radius || 0),\r\n transition: { duration: animate.duration },\r\n fill:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n y={0}\r\n className={cn('graph-value text-sm', classNames?.graphObjectValues)}\r\n style={{\r\n textAnchor: 'start',\r\n vectorEffect: 'non-scaling-stroke',\r\n ...(styles?.graphObjectValues || {}),\r\n }}\r\n dx={4}\r\n dy={5}\r\n >\r\n {d.label}\r\n </motion.text>\r\n ) : null}\r\n </motion.g>\r\n );\r\n })}\r\n </AnimatePresence>\r\n {customLayers.filter(d => d.position === 'after').map(d => d.layer)}\r\n </g>\r\n </motion.svg>\r\n {data.filter(el => el.color).length === 0 || 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 className='p-2' style={{ backgroundColor: 'rgba(240,240,240, 0.7)' }}>\r\n {colorLegendTitle && colorLegendTitle !== '' ? (\r\n <p\r\n className='p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300'\r\n style={{\r\n display: '-webkit-box',\r\n WebkitLineClamp: '1',\r\n WebkitBoxOrient: 'vertical',\r\n }}\r\n >\r\n {colorLegendTitle}\r\n </p>\r\n ) : null}\r\n <div className='flex flex-col gap-3'>\r\n {colorDomain.map((d, i) => (\r\n <div\r\n key={i}\r\n className='flex gap-2 items-center'\r\n onMouseOver={() => {\r\n setSelectedColor(colors[i % colors.length]);\r\n }}\r\n onMouseLeave={() => {\r\n setSelectedColor(undefined);\r\n }}\r\n >\r\n <div\r\n className='w-2 h-2 rounded-full'\r\n style={{ backgroundColor: colors[i % colors.length] }}\r\n />\r\n <P size='sm' marginBottom='none' leading='none'>\r\n {d}\r\n </P>\r\n </div>\r\n ))}\r\n </div>\r\n </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 text-primary-gray-700 border border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100'\r\n >\r\n +\r\n </button>\r\n <button\r\n onClick={() => handleZoom('out')}\r\n className='leading-0 px-2 py-3.5 text-primary-gray-700 border border-t-0 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100'\r\n >\r\n –\r\n </button>\r\n </div>\r\n )}\r\n </div>\r\n {detailsOnClick && mouseClickData !== undefined ? (\r\n <DetailsModal\r\n body={detailsOnClick}\r\n data={mouseClickData}\r\n setData={setMouseClickData}\r\n className={classNames?.modal}\r\n />\r\n ) : null}\r\n {mouseOverData && tooltip && eventX && eventY ? (\r\n <Tooltip\r\n data={mouseOverData}\r\n body={tooltip}\r\n xPos={eventX}\r\n yPos={eventY}\r\n backgroundStyle={styles?.tooltip}\r\n className={classNames?.tooltip}\r\n />\r\n ) : null}\r\n </>\r\n );\r\n}\r\n","import { useState, useRef, useEffect, useEffectEvent, useMemo } from 'react';\r\nimport { format } from 'date-fns/format';\r\nimport { parse } from 'date-fns/parse';\r\nimport { SliderUI } from '@undp/design-system-react/SliderUI';\r\nimport { Spinner } from '@undp/design-system-react/Spinner';\r\nimport { FeatureCollection } from 'geojson';\r\n\r\nimport { Graph } from './Graph';\r\n\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport {\r\n DotDensityMapDataType,\r\n Languages,\r\n SourcesDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n ZoomInteractionTypes,\r\n MapProjectionTypes,\r\n CustomLayerDataType,\r\n AnimateDataType,\r\n TimelineDataType,\r\n MapOverlayDataType,\r\n} from '@/Types';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { fetchAndParseJSON } from '@/Utils/fetchAndParseData';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { Pause, Play } from '@/Components/Icons';\r\nimport { getSliderMarks } from '@/Utils/getSliderMarks';\r\nimport { uniqBy } from '@/Utils/uniqBy';\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: DotDensityMapDataType[];\r\n // Titles, Labels, and Sources\r\n /** Title of the graph */\r\n graphTitle?: string | React.ReactNode;\r\n /** Description of the graph */\r\n graphDescription?: string | React.ReactNode;\r\n /** Footnote for the graph */\r\n footNote?: string | React.ReactNode;\r\n /** Source data for the graph */\r\n sources?: SourcesDataType[];\r\n /** Accessibility label */\r\n ariaLabel?: string;\r\n\r\n // Colors and Styling\r\n /** Color or array of colors for the circle */\r\n colors?: string | string[];\r\n /** Domain of colors for the graph */\r\n colorDomain?: string[];\r\n /** Title for the color legend */\r\n colorLegendTitle?: string;\r\n /** Color for the areas where data is no available */\r\n mapNoDataColor?: string;\r\n /** Background color of the graph */\r\n backgroundColor?: string | boolean;\r\n /** Custom styles for the graph. Each object should be a valid React CSS style object. */\r\n styles?: StyleObject;\r\n /** Custom class names */\r\n classNames?: ClassNameObject;\r\n\r\n // Size and Spacing\r\n /** Width of the graph */\r\n width?: number;\r\n /** Height of the graph */\r\n height?: number;\r\n /** Minimum height of the graph */\r\n minHeight?: number;\r\n /** Relative height scaling factor. This overwrites the height props */\r\n relativeHeight?: number;\r\n /** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */\r\n padding?: string;\r\n\r\n // Graph Parameters\r\n /** Maximum radius of the circle */\r\n radius?: number;\r\n /** Map data as an object in geoJson format or a url for geoJson */\r\n mapData?: FeatureCollection | string;\r\n /** Detail if any other map needs to be overlayed over the main map */\r\n mapOverlay?: MapOverlayDataType;\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 /** Extend of the allowed zoom in the map */\r\n zoomScaleExtend?: [number, number];\r\n /** Extend of the allowed panning in the map */\r\n zoomTranslateExtend?: [[number, number], [number, number]];\r\n /** Toggle visibility of labels */\r\n showLabels?: boolean;\r\n /** Maximum value mapped to the radius chart */\r\n maxRadiusValue?: number;\r\n /** Data points to highlight. Use the label value from data to highlight the data point */\r\n highlightedDataPoints?: (string | number)[];\r\n /** Defines the opacity of the non-highlighted data */\r\n dimmedOpacity?: number;\r\n /** Toggles if the graph animates in when loaded. */\r\n animate?: boolean | AnimateDataType;\r\n /** Toggle visibility of color scale. This is only applicable if the data props hae color parameter */\r\n showColorScale?: boolean;\r\n /** Toggle if color scale is collapsed by default. */\r\n collapseColorScaleByDefault?: boolean;\r\n /** Toggles the visibility of Antarctica in the default map. Only applicable for the default map. */\r\n showAntarctica?: boolean;\r\n /** Optional SVG <g> element or function that renders custom content behind or in front of the graph. */\r\n customLayers?: CustomLayerDataType[];\r\n /** 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 DotDensityMap(props: Props) {\r\n const {\r\n data,\r\n mapData = 'https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-v2.json',\r\n graphTitle,\r\n colors,\r\n sources,\r\n graphDescription,\r\n height,\r\n width,\r\n footNote = 'The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.',\r\n colorLegendTitle,\r\n colorDomain,\r\n radius = 5,\r\n scale = 0.95,\r\n centerPoint,\r\n padding,\r\n mapBorderWidth = 0.5,\r\n mapNoDataColor = Colors.light.graphNoData,\r\n backgroundColor = false,\r\n showLabels = false,\r\n mapBorderColor = Colors.light.grays['gray-500'],\r\n tooltip,\r\n relativeHeight,\r\n onSeriesMouseOver,\r\n isWorldMap = true,\r\n showColorScale = true,\r\n zoomScaleExtend = [0.8, 6],\r\n zoomTranslateExtend,\r\n graphID,\r\n highlightedDataPoints = [],\r\n onSeriesMouseClick,\r\n graphDownload = false,\r\n dataDownload = false,\r\n showAntarctica = false,\r\n language = 'en',\r\n minHeight = 0,\r\n theme = 'light',\r\n ariaLabel,\r\n resetSelectionOnDoubleClick = true,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n mapProjection = 'naturalEarth',\r\n zoomInteraction = 'button',\r\n animate = false,\r\n dimmedOpacity = 0.3,\r\n customLayers = [],\r\n maxRadiusValue,\r\n timeline = { enabled: false, autoplay: false, showOnlyActiveDate: true },\r\n collapseColorScaleByDefault,\r\n 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 const [mapShape, setMapShape] = useState<FeatureCollection | undefined>(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\r\n const onUpdateShape = useEffectEvent((shape: FeatureCollection) => {\r\n setMapShape(shape);\r\n });\r\n\r\n const onUpdateOverlayMapShape = useEffectEvent((shape: FeatureCollection | undefined) => {\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 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(el => el.properties?.NAME !== 'Antarctica'),\r\n }\r\n }\r\n colorDomain={\r\n data.filter(el => el.color).length === 0\r\n ? []\r\n : colorDomain || (uniqBy(data, 'color', true) as string[])\r\n }\r\n width={svgWidth}\r\n height={svgHeight}\r\n scale={scale}\r\n centerPoint={centerPoint}\r\n colors={\r\n data.filter(el => el.color).length === 0\r\n ? colors\r\n ? [colors as string]\r\n : [Colors.primaryColors['blue-600']]\r\n : (colors as string[] | undefined) || Colors[theme].categoricalColors.colors\r\n }\r\n colorLegendTitle={colorLegendTitle}\r\n radius={radius}\r\n overlayMapData={overlayMapShape}\r\n overlayMapBorderColor={mapOverlay?.mapBorderColor}\r\n overlayMapBorderWidth={mapOverlay?.mapBorderWidth}\r\n mapBorderWidth={mapBorderWidth}\r\n mapNoDataColor={mapNoDataColor}\r\n mapBorderColor={mapBorderColor}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n showLabels={showLabels}\r\n isWorldMap={isWorldMap}\r\n showColorScale={showColorScale}\r\n zoomScaleExtend={zoomScaleExtend}\r\n zoomTranslateExtend={zoomTranslateExtend}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n highlightedDataPoints={highlightedDataPoints}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n styles={styles}\r\n classNames={classNames}\r\n zoomInteraction={zoomInteraction}\r\n detailsOnClick={detailsOnClick}\r\n mapProjection={mapProjection || (isWorldMap ? 'naturalEarth' : 'mercator')}\r\n animate={\r\n animate === true\r\n ? { duration: 0.5, once: true, amount: 0.5 }\r\n : animate || { duration: 0, once: true, amount: 0 }\r\n }\r\n dimmedOpacity={dimmedOpacity}\r\n customLayers={customLayers}\r\n maxRadiusValue={\r\n !checkIfNullOrUndefined(maxRadiusValue)\r\n ? (maxRadiusValue as number)\r\n : Math.max(...data.map(d => d.radius).filter(d => d !== undefined && d !== null))\r\n }\r\n collapseColorScaleByDefault={collapseColorScaleByDefault}\r\n 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","colors","mapData","colorLegendTitle","colorDomain","radius","height","width","scale","centerPoint","tooltip","showLabels","mapBorderWidth","mapBorderColor","mapNoDataColor","onSeriesMouseOver","showColorScale","zoomScaleExtend","zoomTranslateExtend","highlightedDataPoints","onSeriesMouseClick","resetSelectionOnDoubleClick","detailsOnClick","styles","classNames","mapProjection","zoomInteraction","animate","dimmedOpacity","customLayers","maxRadiusValue","collapseColorScaleByDefault","projectionRotate","rewindCoordinatesInMapData","overlayMapData","overlayMapBorderColor","overlayMapBorderWidth","formattedMapData","useMemo","rewind","reverse","formattedOverlayMapData","selectedColor","setSelectedColor","useState","undefined","showLegend","setShowLegend","zoomRef","useRef","mouseClickData","setMouseClickData","mouseOverData","setMouseOverData","eventX","setEventX","eventY","setEventY","mapSvg","isInView","useInView","once","amount","mapG","radiusScale","filter","d","length","scaleSqrt","domain","range","nice","useEffect","mapGSelect","select","current","mapSvgSelect","zoomFilter","e","type","includes","isWheel","isTouch","startsWith","isDrag","ctrlKey","button","zoomBehavior","zoom","scaleExtent","translateExtent","on","transform","attr","call","bounds","bbox","center","centerOfMass","lonDiff","latDiff","scaleX","scaleY","scaleVar","Math","min","projection","geoMercator","rotate","geometry","coordinates","translate","geoEqualEarth","geoNaturalEarth1","geoOrthographic","geoAlbersUsa","pathGenerator","geoPath","handleZoom","direction","scaleBy","jsxs","Fragment","jsx","motion","position","map","layer","features","i","path","stroke","strokeWidth","fill","vectorEffect","pointerEvents","AnimatePresence","color","el","indexOf","Colors","gray","initial","opacity","whileInView","label","transition","duration","event","clientY","clientX","isEqual","long","lat","r","fillOpacity","x","cn","graphObjectValues","textAnchor","colorLegend","X","backgroundColor","display","WebkitLineClamp","WebkitBoxOrient","P","DetailsModal","modal","Tooltip","DotDensityMap","$","_c","t0","graphTitle","sources","graphDescription","footNote","t1","t2","t3","padding","t4","t5","t6","t7","t8","relativeHeight","isWorldMap","t9","t10","t11","graphID","t12","graphDownload","t13","dataDownload","t14","showAntarctica","t15","language","t16","minHeight","t17","theme","t18","ariaLabel","t19","t20","t21","t22","t23","t24","timeline","t25","t26","t27","mapOverlay","light","graphNoData","grays","t28","t29","t30","t31","enabled","autoplay","showOnlyActiveDate","t32","svgWidth","setSvgWidth","svgHeight","setSvgHeight","play","setPlay","dates","dateFormat","t33","d_0","parse","date","Date","getTime","Set","_temp","sort","_temp2","uniqDatesSorted","index","setIndex","mapShape","setMapShape","overlayMapShape","setOverlayMapShape","graphDiv","graphParentDiv","t34","Symbol","for","resizeObserver","ResizeObserver","entries","target","clientWidth","clientHeight","observe","disconnect","t35","shape","onUpdateShape","useEffectEvent","t36","shape_0","onUpdateOverlayMapShape","t37","fetchAndParseJSON","then","d_1","t38","t39","d_2","t40","t41","t42","t43","speed","interval","setInterval","clearInterval","t44","t45","getSliderMarks","markObj","t46","graphContainer","t47","t48","description","title","GraphHeader","_temp3","_temp4","_temp5","_temp6","_temp7","t49","Pause","Play","SliderUI","nextValue","nextValue_0","t50","GraphArea","d_8","format","_temp8","_temp9","uniqBy","_temp0","primaryColors","categoricalColors","checkIfNullOrUndefined","max","_temp1","_temp10","Spinner","t51","footnote","source","GraphFooter","t52","GraphContainer","d_10","d_9","el_1","el_0","properties","NAME","d_5","d_4","d_3","d_7","d_6","a","b"],"mappings":"28BAiFO,SAASA,GAAMC,EAAc,CAClC,KAAM,CACJC,KAAAA,EACAC,OAAAA,EACAC,QAAAA,GACAC,iBAAAA,EACAC,YAAAA,EACAC,OAAAA,EACAC,OAAAA,EACAC,MAAAA,EACAC,MAAAA,EACAC,YAAAA,EACAC,QAAAA,GACAC,WAAAA,GACAC,eAAAA,GACAC,eAAAA,GACAC,eAAAA,GACAC,kBAAAA,GACAC,eAAAA,GACAC,gBAAAA,GACAC,oBAAAA,GACAC,sBAAAA,GACAC,mBAAAA,GACAC,4BAAAA,GACAC,eAAAA,EACAC,OAAAA,GACAC,WAAAA,EACAC,cAAAA,EACAC,gBAAAA,EACAC,QAAAA,EACAC,cAAAA,GACAC,aAAAA,EACAC,eAAAA,GACAC,4BAAAA,GACAC,iBAAAA,EACAC,2BAAAA,EACAC,eAAAA,EACAC,sBAAAA,GACAC,sBAAAA,EAAAA,EACErC,EACEsC,EAAmBC,EAAAA,QAAQ,IAC1BL,EAEEM,EAAAA,cAAOrC,GAAS,CAAEsC,QAAS,EAAA,CAAM,EAFAtC,GAGvC,CAACA,GAA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,OA4Q8E1Q,GAAM,IAAI,CA5QxF,SAAAiQ,GAAAU,EAAA,CAAA,OA4QqC3Q,EAAC7D,MAAO,CA5Q7C,SAAAyT,GAAAgB,EAAA,CAAA,OAqOyBpM,EAAED,KAAM,CArOjC,SAAAmL,GAAAmB,EAAA,CAAA,OA4NyBrM,EAAED,KAAM,CA5NjC,SAAAkL,GAAAjL,EAAA,CAAA,OAwNsDA,EAAEsM,YAAiBC,OAAK,YAAY,CAxN1F,SAAAjC,GAAAkC,EAAA,CAAA,OAwK4BhR,IAAMrB,MAAS,CAxK3C,SAAAkQ,GAAAoC,EAAA,CAAA,OAuK6CjR,IAAMrB,MAAS,CAvK5D,SAAAiQ,GAAAsC,EAAA,CAAA,OAuKyBlR,EAAClE,IAAK,CAvK/B,SAAA6S,GAAAwC,EAAA,CAAA,OAsK2CnR,IAAMrB,MAAS,CAtK1D,SAAA+P,GAAA0C,EAAA,CAAA,OAsKuBpR,EAAClE,IAAK,CAtK7B,SAAAsP,GAAAiG,EAAAC,EAAA,CAAA,OAmEkBD,EAAIC,CAAC,CAnEvB,SAAApG,GAAAlL,EAAA,CAAA,OA+DgBA,EAAC8K,IAAK"}
@@ -1,3 +1,4 @@
1
+ import { FeatureCollection } from 'geojson';
1
2
  import { JSX } from 'react/jsx-runtime';
2
3
 
3
4
  declare interface AnimateDataType {
@@ -58,6 +59,12 @@ declare interface DotDensityMapDataType {
58
59
 
59
60
  declare type Languages = 'en' | 'ar' | 'az' | 'bn' | 'cy' | 'he' | 'hi' | 'jp' | 'ka' | 'km' | 'ko' | 'my' | 'ne' | 'zh' | 'custom';
60
61
 
62
+ declare interface MapOverlayDataType {
63
+ mapData: FeatureCollection | string;
64
+ mapBorderWidth?: number;
65
+ mapBorderColor?: string;
66
+ }
67
+
61
68
  declare type MapProjectionTypes = 'mercator' | 'equalEarth' | 'naturalEarth' | 'orthographic' | 'albersUSA';
62
69
 
63
70
  declare interface Props {
@@ -100,7 +107,9 @@ declare interface Props {
100
107
  /** Maximum radius of the circle */
101
108
  radius?: number;
102
109
  /** Map data as an object in geoJson format or a url for geoJson */
103
- mapData?: any;
110
+ mapData?: FeatureCollection | string;
111
+ /** Detail if any other map needs to be overlayed over the main map */
112
+ mapOverlay?: MapOverlayDataType;
104
113
  /** 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
114
  rewindCoordinatesInMapData?: boolean;
106
115
  /** Scaling factor for the map. Multiplies the scale number to scale. */