@undp/data-viz 2.3.1 → 2.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AreaChart.cjs +1 -1
- package/dist/AreaChart.js +1 -1
- package/dist/BarGraph.cjs +1 -1
- package/dist/BarGraph.js +2 -2
- package/dist/BasicStatCard.cjs +1 -1
- package/dist/BasicStatCard.js +15 -15
- package/dist/BeeSwarmChart.cjs +1 -1
- package/dist/BeeSwarmChart.js +2 -2
- package/dist/BiVariateChoroplethMap.cjs +1 -1
- package/dist/BiVariateChoroplethMap.cjs.map +1 -1
- package/dist/BiVariateChoroplethMap.js +202 -202
- package/dist/BiVariateChoroplethMap.js.map +1 -1
- package/dist/BulletChart.cjs +1 -1
- package/dist/BulletChart.js +2 -2
- package/dist/ButterflyChart.cjs +1 -1
- package/dist/ButterflyChart.js +2 -2
- package/dist/ChoroplethMap.cjs +1 -1
- package/dist/ChoroplethMap.cjs.map +1 -1
- package/dist/ChoroplethMap.js +33 -33
- package/dist/ChoroplethMap.js.map +1 -1
- package/dist/CirclePackingGraph.cjs +1 -1
- package/dist/CirclePackingGraph.js +2 -2
- package/dist/ColorLegend.cjs +1 -1
- package/dist/ColorLegend.js +7 -7
- package/dist/ColorLegendWithMouseOver.cjs +1 -1
- package/dist/ColorLegendWithMouseOver.js +1 -1
- package/dist/CopyTextButton.cjs +1 -1
- package/dist/CopyTextButton.js +1 -1
- package/dist/CsvDownloadButton.cjs +2 -2
- package/dist/CsvDownloadButton.js +1 -1
- package/dist/DataCards.cjs +1 -1
- package/dist/DataCards.js +3 -3
- package/dist/DataCards.js.map +1 -1
- package/dist/DataTable.cjs +1 -1
- package/dist/DataTable.js +2 -2
- package/dist/DifferenceLineChart.cjs +1 -1
- package/dist/DifferenceLineChart.js +1 -1
- package/dist/DonutChart.cjs +1 -1
- package/dist/DonutChart.js +20 -20
- package/dist/DotDensityMap.cjs +1 -1
- package/dist/DotDensityMap.cjs.map +1 -1
- package/dist/DotDensityMap.js +46 -46
- package/dist/DotDensityMap.js.map +1 -1
- package/dist/DualAxisLineChart.cjs +1 -1
- package/dist/DualAxisLineChart.js +1 -1
- package/dist/DumbbellChart.cjs +1 -1
- package/dist/DumbbellChart.js +2 -2
- package/dist/{EmptyState-CGeBqbmR.cjs → EmptyState-DX0t62iF.cjs} +2 -2
- package/dist/{EmptyState-CGeBqbmR.cjs.map → EmptyState-DX0t62iF.cjs.map} +1 -1
- package/dist/{EmptyState-tZBErBKF.js → EmptyState-Pj-emXt5.js} +3 -3
- package/dist/{EmptyState-tZBErBKF.js.map → EmptyState-Pj-emXt5.js.map} +1 -1
- package/dist/ExcelDownloadButton.cjs +1 -1
- package/dist/ExcelDownloadButton.js +7 -7
- package/dist/FootNote.cjs +1 -1
- package/dist/FootNote.js +1 -1
- package/dist/GeoHubCompareMaps.cjs +1 -1
- package/dist/GeoHubCompareMaps.js +1 -1
- package/dist/GeoHubMap.cjs +1 -1
- package/dist/GeoHubMap.js +1 -1
- package/dist/GeoHubMapWithLayerSelection.cjs +1 -1
- package/dist/GeoHubMapWithLayerSelection.js +2 -2
- package/dist/GraphDescription.cjs +1 -1
- package/dist/GraphDescription.js +1 -1
- package/dist/{GraphEl-ic8C5Ksc.cjs → GraphEl-CWjTuiYd.cjs} +2 -2
- package/dist/{GraphEl-ic8C5Ksc.cjs.map → GraphEl-CWjTuiYd.cjs.map} +1 -1
- package/dist/{GraphEl-L5hNe7wJ.js → GraphEl-DDXkYObU.js} +7 -7
- package/dist/{GraphEl-L5hNe7wJ.js.map → GraphEl-DDXkYObU.js.map} +1 -1
- package/dist/GraphFooter.cjs +1 -1
- package/dist/GraphFooter.js +1 -1
- package/dist/GraphTitle.cjs +1 -1
- package/dist/GraphTitle.js +1 -1
- package/dist/GriddedGraphs.cjs +1 -1
- package/dist/GriddedGraphs.js +1 -1
- package/dist/HeatMap.cjs +1 -1
- package/dist/HeatMap.js +1 -1
- package/dist/Histogram.cjs +1 -1
- package/dist/Histogram.js +1 -1
- package/dist/HybridMap.cjs +1 -1
- package/dist/HybridMap.cjs.map +1 -1
- package/dist/HybridMap.js +42 -42
- package/dist/HybridMap.js.map +1 -1
- package/dist/ImageDownloadButton.cjs +1 -1
- package/dist/ImageDownloadButton.js +1 -1
- package/dist/LineChartWithConfidenceInterval.cjs +1 -1
- package/dist/LineChartWithConfidenceInterval.js +1 -1
- package/dist/LinearColorLegend.cjs +1 -1
- package/dist/LinearColorLegend.js +1 -1
- package/dist/MultiLineAltChart.cjs +1 -1
- package/dist/MultiLineAltChart.js +1 -1
- package/dist/MultiLineChart.cjs +1 -1
- package/dist/MultiLineChart.js +1 -1
- package/dist/ParetoChart.cjs +1 -1
- package/dist/ParetoChart.js +1 -1
- package/dist/RadarChart.cjs +1 -1
- package/dist/RadarChart.js +1 -1
- package/dist/SVGDownloadButton.cjs +1 -1
- package/dist/SVGDownloadButton.js +8 -8
- package/dist/SankeyChart.cjs +1 -1
- package/dist/SankeyChart.js +80 -80
- package/dist/ScatterPlot.cjs +1 -1
- package/dist/ScatterPlot.js +2 -2
- package/dist/SimpleLineChart.cjs +1 -1
- package/dist/SimpleLineChart.js +1 -1
- package/dist/SingleGraphDashboard.cjs +1 -1
- package/dist/SingleGraphDashboard.js +1 -1
- package/dist/SingleGraphDashboardGeoHubMaps.cjs +1 -1
- package/dist/SingleGraphDashboardGeoHubMaps.js +10 -10
- package/dist/SingleGraphDashboardThreeDGraphs.cjs +1 -1
- package/dist/SingleGraphDashboardThreeDGraphs.js +1 -1
- package/dist/SlopeChart.cjs +1 -1
- package/dist/SlopeChart.js +1 -1
- package/dist/{Source-B5AoSlsi.cjs → Source-B3i0Bx2R.cjs} +2 -2
- package/dist/{Source-B5AoSlsi.cjs.map → Source-B3i0Bx2R.cjs.map} +1 -1
- package/dist/{Source-F8EYCYkV.js → Source-_STIejqs.js} +14 -14
- package/dist/{Source-F8EYCYkV.js.map → Source-_STIejqs.js.map} +1 -1
- package/dist/Source.cjs +1 -1
- package/dist/Source.js +2 -2
- package/dist/StatCardFromData.cjs +1 -1
- package/dist/StatCardFromData.js +12 -12
- package/dist/StripChart.cjs +1 -1
- package/dist/StripChart.js +1 -1
- package/dist/ThreeDGlobe.cjs +1 -1
- package/dist/ThreeDGlobe.js +2 -2
- package/dist/ThresholdColorLegendWithMouseOver.cjs +1 -1
- package/dist/ThresholdColorLegendWithMouseOver.js +10 -10
- package/dist/TreeMapGraph.cjs +1 -1
- package/dist/TreeMapGraph.js +29 -29
- package/dist/Typography-DrJ7IOdw.cjs +2 -0
- package/dist/Typography-DrJ7IOdw.cjs.map +1 -0
- package/dist/Typography-iR8PEgdt.js +263 -0
- package/dist/Typography-iR8PEgdt.js.map +1 -0
- package/dist/UnitChart.cjs +1 -1
- package/dist/UnitChart.js +25 -25
- package/dist/WaterfallChart.cjs +1 -1
- package/dist/WaterfallChart.js +1 -1
- package/dist/{index-BQYOuXdl.js → index-B-4y_iGB.js} +19 -17
- package/dist/index-B-4y_iGB.js.map +1 -0
- package/dist/{index-D5ihtaJJ.js → index-BE-lvE4c.js} +3 -3
- package/dist/{index-D5ihtaJJ.js.map → index-BE-lvE4c.js.map} +1 -1
- package/dist/{index-Dgjq6aZ2.cjs → index-DlrGwLQA.cjs} +2 -2
- package/dist/{index-Dgjq6aZ2.cjs.map → index-DlrGwLQA.cjs.map} +1 -1
- package/dist/index-sbKVyHS2.cjs +2 -0
- package/dist/index-sbKVyHS2.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +2 -2
- package/dist/style.css +1 -1
- package/package.json +3 -3
- package/dist/Typography-hWfh3H0J.js +0 -142
- package/dist/Typography-hWfh3H0J.js.map +0 -1
- package/dist/Typography-sa1UE0oF.cjs +0 -2
- package/dist/Typography-sa1UE0oF.cjs.map +0 -1
- package/dist/index-BQYOuXdl.js.map +0 -1
- package/dist/index-C6er0ety.cjs +0 -2
- package/dist/index-C6er0ety.cjs.map +0 -1
package/dist/ButterflyChart.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index-CHPV5EwG-6v2a2njQ.cjs"),V=require("react"),pe=require("./getSliderMarks-CIuSoedo.cjs"),fe=require("./parse-xYI9yrvL.cjs"),ge=require("./index-DQA8q5sC.cjs"),ye=require("./numberFormattingFunction-02t-wJta.cjs"),Be=require("./Tooltip-BLa2EfMs.cjs"),be=require("./XTicksAndGridLines-CekrPykD.cjs"),ve=require("./Axis-Jt_tmhxS.cjs"),Le=require("./YAxesLabels-BQ2aCazV.cjs"),je=require("./ReferenceLine-M9aP3dj-.cjs"),Ce=require("./DetailsModal-DHttOA80.cjs"),ke=require("./band-VYfcZeJ2.cjs"),we=require("./linear-CgUCbw9F.cjs"),Nt=require("./proxy-C4-uo6nS.cjs"),Me=require("./use-in-view-C3o_ntMv.cjs"),de=require("./index-CoobIWNj.cjs"),Ve=require("./GraphFooter.cjs"),$e=require("./GraphHeader.cjs"),Oe=require("./ColorLegend.cjs"),Ae=require("./Colors.cjs"),Ne=require("./EmptyState-CGeBqbmR.cjs"),Re=require("./index-C6er0ety.cjs"),he=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),Se=require("./ensureCompleteData-D9bQTiVS.cjs"),Ee=require("./GraphContainer-B1EDxJ0S.cjs");function De(s){const t=i.compilerRuntimeExports.c(141),{data:a,width:E,height:v,barColors:m,centerGap:j,refValues:h,maxValue:xt,minValue:Rt,showValues:mt,axisTitles:dt,rightMargin:Jt,leftMargin:Kt,topMargin:Y,bottomMargin:Qt,tooltip:St,onSeriesMouseOver:ht,barPadding:Dt,truncateBy:Et,onSeriesMouseClick:$,showTicks:Bt,suffix:pt,prefix:ft,resetSelectionOnDoubleClick:Lt,detailsOnClick:S,styles:r,classNames:n,noOfTicks:B,animate:x,precision:gt,customLayers:D,minValueLeftBar:q,minValueRightBar:T,naLabel:qt,hideAxisLine:Tt}=s,le=V.useRef(null);let Ct;t[0]!==x.amount||t[1]!==x.once?(Ct={once:x.once,amount:x.amount},t[0]=x.amount,t[1]=x.once,t[2]=Ct):Ct=t[2];const O=Me.useInView(le,Ct),[Ft,U]=V.useState(void 0),[F,yt]=V.useState(void 0),[d,l]=V.useState(void 0),[It,bt]=V.useState(void 0);let Gt;t[3]!==Qt||t[4]!==Kt||t[5]!==Jt||t[6]!==Y?(Gt={top:Y,bottom:Qt,left:Kt,right:Jt},t[3]=Qt,t[4]=Kt,t[5]=Jt,t[6]=Y,t[7]=Gt):Gt=t[7];const u=Gt,L=E-u.left-u.right,C=v-u.top-u.bottom;let vt,I,k,W,z,J,K,Q,M,w,Z,_,tt,et;if(t[8]!==x||t[9]!==m[0]||t[10]!==m[1]||t[11]!==Dt||t[12]!==j||t[13]!==n?.graphObjectValues||t[14]!==n?.xAxis?.gridLines||t[15]!==n?.xAxis?.labels||t[16]!==n?.yAxis?.axis||t[17]!==n?.yAxis?.labels||t[18]!==D||t[19]!==a||t[20]!==S||t[21]!==C||t[22]!==L||t[23]!==v||t[24]!==Tt||t[25]!==O||t[26]!==u.bottom||t[27]!==u.left||t[28]!==u.top||t[29]!==xt||t[30]!==Rt||t[31]!==q||t[32]!==T||t[33]!==F||t[34]!==qt||t[35]!==B||t[36]!==$||t[37]!==ht||t[38]!==gt||t[39]!==ft||t[40]!==h||t[41]!==Lt||t[42]!==Bt||t[43]!==mt||t[44]!==r?.graphObjectValues||t[45]!==r?.xAxis?.gridLines||t[46]!==r?.xAxis?.labels||t[47]!==r?.yAxis?.axis||t[48]!==r?.yAxis?.labels||t[49]!==pt||t[50]!==Y||t[51]!==Et||t[52]!==E){const Zt=a.map(Ue),A=ke.band().domain(Zt.map(Ye)).range([C,0]).paddingInner(Dt),p=we.linear().domain([Rt,xt]).range([0,(L-j)/2]).nice(),N=p.ticks(B),f=we.linear().domain([Rt,xt]).range([(L-j)/2,0]).nice(),Vt=f.ticks(B);k=Nt.motion.svg,tt=`${E}px`,et=`${v}px`,W=`0 0 ${E} ${v}`,z="ltr",J=le,M=`translate(${u.left},${u.top})`,t[67]!==D?(w=D.filter(He).map(Xe),t[67]=D,t[68]=w):w=t[68];const c=n?.yAxis?.axis;let R;t[69]!==c?(R={axis:c},t[69]=c,t[70]=R):R=t[70];const Wt=r?.yAxis?.axis;let $t;t[71]!==Wt?($t={axis:Wt},t[71]=Wt,t[72]=$t):$t=t[72],Z=i.jsxRuntimeExports.jsxs("g",{transform:"translate(0,0)",children:[Bt?i.jsxRuntimeExports.jsx(be.XTicksAndGridLines,{values:Vt.filter(Pe),x:Vt.filter(Ge).map(e=>f(e)),y1:0-Y,y2:C+u.bottom,styles:{gridLines:r?.xAxis?.gridLines,labels:r?.xAxis?.labels},classNames:{gridLines:n?.xAxis?.gridLines,labels:n?.xAxis?.labels},suffix:pt,prefix:ft,labelType:"secondary",showGridLines:!0,leftLabel:!0,precision:gt}):null,i.jsxRuntimeExports.jsxs(de.AnimatePresence,{children:[Zt.map((e,y)=>i.jsxRuntimeExports.jsxs(Nt.motion.g,{className:"undp-viz-g-with-hover",opacity:.85,onMouseEnter:b=>{U(e),bt(b.clientY),l(b.clientX),ht?.(e)},onClick:()=>{($||S)&&(ge.isEqual(F,e)&&Lt?(yt(void 0),$?.(void 0)):(yt(e),$?.(e)))},onMouseMove:b=>{U(e),bt(b.clientY),l(b.clientX)},onMouseLeave:()=>{U(void 0),l(void 0),bt(void 0),ht?.(void 0)},children:[e.leftBar?i.jsxRuntimeExports.jsx(Nt.motion.rect,{y:A(`${y}`),style:{fill:m[0]},height:A.bandwidth(),variants:{initial:{x:f(0),width:0},whileInView:{x:e.leftBar<0?f(0):f(e.leftBar),width:e.leftBar<0?f(e.leftBar)-f(0):f(0)-f(e.leftBar),transition:{duration:x.duration}}},initial:"initial",animate:O?"whileInView":"initial",exit:{x:f(0),width:0,transition:{duration:x.duration}}}):null,mt?i.jsxRuntimeExports.jsx(Nt.motion.text,{y:A(`${y}`)+A.bandwidth()/2,style:{textAnchor:e.rightBar&&e.rightBar>0?"end":"start",...r?.graphObjectValues||{}},dx:e.rightBar&&e.rightBar>0?-5:5,dy:"0.33em",className:i.mo("graph-value text-sm",n?.graphObjectValues),exit:{opacity:0,transition:{duration:x.duration}},variants:{initial:{x:f(0),opacity:0,fill:m[0]},whileInView:{x:e.leftBar?f(e.leftBar):f(q<0?0:q),opacity:1,fill:m[0],transition:{duration:x.duration}}},initial:"initial",animate:O?"whileInView":"initial",children:ye.numberFormattingFunction(e.rightBar,qt,gt,ft,pt)}):null]},e.label)),i.jsxRuntimeExports.jsx(ve.Axis,{hideAxisLine:Tt,y1:-2.5,y2:C+u.bottom,x1:f(q<0?0:q),x2:f(q<0?0:q),classNames:R,styles:$t}),h?i.jsxRuntimeExports.jsx(i.jsxRuntimeExports.Fragment,{children:h.map((e,y)=>i.jsxRuntimeExports.jsx(je.RefLineX,{text:e.text,color:e.color,x:f(e.value),y1:0-u.top,y2:C+u.bottom,textSide:"left",classNames:e.classNames,styles:e.styles,animate:x,isInView:O},y))}):null]})]});const _t=n?.yAxis?.axis;let wt;t[73]!==_t?(wt={axis:_t},t[73]=_t,t[74]=wt):wt=t[74];const Ot=r?.yAxis?.axis;let At;t[75]!==Ot?(At={axis:Ot},t[75]=Ot,t[76]=At):At=t[76],_=i.jsxRuntimeExports.jsxs("g",{transform:`translate(${(L+j)/2},0)`,children:[Bt?i.jsxRuntimeExports.jsx(be.XTicksAndGridLines,{values:N.filter(Ie),x:N.filter(Fe).map(e=>p(e)),y1:0-Y,y2:C+u.bottom,styles:{gridLines:r?.xAxis?.gridLines,labels:r?.xAxis?.labels},classNames:{gridLines:n?.xAxis?.gridLines,labels:n?.xAxis?.labels},suffix:pt,prefix:ft,labelType:"secondary",showGridLines:!0,precision:gt}):null,i.jsxRuntimeExports.jsxs(de.AnimatePresence,{children:[Zt.map((e,y)=>i.jsxRuntimeExports.jsxs(Nt.motion.g,{className:"undp-viz-g-with-hover",opacity:.85,onMouseEnter:b=>{U(e),bt(b.clientY),l(b.clientX),ht?.(e)},onClick:()=>{($||S)&&(ge.isEqual(F,e)&&Lt?(yt(void 0),$?.(void 0)):(yt(e),$?.(e)))},onMouseMove:b=>{U(e),bt(b.clientY),l(b.clientX)},onMouseLeave:()=>{U(void 0),l(void 0),bt(void 0),ht?.(void 0)},children:[e.rightBar?i.jsxRuntimeExports.jsx(Nt.motion.rect,{y:A(`${y}`),style:{fill:m[1]},height:A.bandwidth(),exit:{x:p(0),width:0,transition:{duration:x.duration}},variants:{initial:{x:p(0),width:0},whileInView:{x:e.rightBar>=0?p(0):p(e.rightBar),width:e.rightBar>=0?p(e.rightBar)-p(0):p(0)-p(e.rightBar),transition:{duration:x.duration}}},initial:"initial",animate:O?"whileInView":"initial"}):null,mt?i.jsxRuntimeExports.jsx(Nt.motion.text,{y:A(`${y}`)+A.bandwidth()/2,style:{textAnchor:e.rightBar&&e.rightBar<0?"end":"start",...r?.graphObjectValues||{}},className:i.mo("graph-value text-sm",n?.graphObjectValues),dx:e.rightBar&&e.rightBar<0?-5:5,dy:"0.33em",exit:{opacity:0,transition:{duration:x.duration}},variants:{initial:{x:p(0),opacity:0,fill:m[1]},whileInView:{x:e.rightBar?p(e.rightBar):p(T<0?0:T),opacity:1,fill:m[1],transition:{duration:x.duration}}},initial:"initial",animate:O?"whileInView":"initial",children:ye.numberFormattingFunction(e.rightBar,qt,gt,ft,pt)}):null]},y)),i.jsxRuntimeExports.jsx(ve.Axis,{hideAxisLine:Tt,y1:-2.5,y2:C+u.bottom,x1:p(T<0?0:T),x2:p(T<0?0:T),classNames:wt,styles:At}),h?i.jsxRuntimeExports.jsx(i.jsxRuntimeExports.Fragment,{children:h.map((e,y)=>i.jsxRuntimeExports.jsx(je.RefLineX,{text:e.text,color:e.color,x:p(e.value),y1:0-u.top,y2:C+u.bottom,textSide:"right",classNames:e.classNames,styles:e.styles,animate:x,isInView:O},y))}):null]})]}),I=de.AnimatePresence,vt=Nt.motion.g,K=`translate(${L/2},0)`,Q=Zt.map((e,y)=>i.jsxRuntimeExports.jsx(Le.YAxesLabels,{value:`${e.label}`.length<Et?`${e.label}`:`${`${e.label}`.substring(0,Et)}...`,y:A(`${e.id}`),x:0-j/2,width:j,height:A.bandwidth(),alignment:"center",style:r?.yAxis?.labels,className:n?.yAxis?.labels,animate:x,isInView:O},y)),t[8]=x,t[9]=m[0],t[10]=m[1],t[11]=Dt,t[12]=j,t[13]=n?.graphObjectValues,t[14]=n?.xAxis?.gridLines,t[15]=n?.xAxis?.labels,t[16]=n?.yAxis?.axis,t[17]=n?.yAxis?.labels,t[18]=D,t[19]=a,t[20]=S,t[21]=C,t[22]=L,t[23]=v,t[24]=Tt,t[25]=O,t[26]=u.bottom,t[27]=u.left,t[28]=u.top,t[29]=xt,t[30]=Rt,t[31]=q,t[32]=T,t[33]=F,t[34]=qt,t[35]=B,t[36]=$,t[37]=ht,t[38]=gt,t[39]=ft,t[40]=h,t[41]=Lt,t[42]=Bt,t[43]=mt,t[44]=r?.graphObjectValues,t[45]=r?.xAxis?.gridLines,t[46]=r?.xAxis?.labels,t[47]=r?.yAxis?.axis,t[48]=r?.yAxis?.labels,t[49]=pt,t[50]=Y,t[51]=Et,t[52]=E,t[53]=vt,t[54]=I,t[55]=k,t[56]=W,t[57]=z,t[58]=J,t[59]=K,t[60]=Q,t[61]=M,t[62]=w,t[63]=Z,t[64]=_,t[65]=tt,t[66]=et}else vt=t[53],I=t[54],k=t[55],W=t[56],z=t[57],J=t[58],K=t[59],Q=t[60],M=t[61],w=t[62],Z=t[63],_=t[64],tt=t[65],et=t[66];let G;t[77]!==vt||t[78]!==K||t[79]!==Q?(G=i.jsxRuntimeExports.jsx(vt,{transform:K,children:Q}),t[77]=vt,t[78]=K,t[79]=Q,t[80]=G):G=t[80];let it;t[81]!==I||t[82]!==G?(it=i.jsxRuntimeExports.jsx(I,{children:G}),t[81]=I,t[82]=G,t[83]=it):it=t[83];const Pt=`translate(0,${C})`,Xt=r?.yAxis?.title;let st;t[84]!==m[0]||t[85]!==Xt?(st={fill:m[0],textAnchor:"end",...Xt},t[84]=m[0],t[85]=Xt,t[86]=st):st=t[86];const Ht=n?.yAxis?.title;let P;t[87]!==Ht?(P=i.mo("text-base",Ht),t[87]=Ht,t[88]=P):P=t[88];const kt=L/2-j/2;let nt;t[89]!==dt[0]||t[90]!==st||t[91]!==P||t[92]!==kt?(nt=i.jsxRuntimeExports.jsx("text",{style:st,className:P,x:kt,y:0,dx:-5,dy:20,children:dt[0]}),t[89]=dt[0],t[90]=st,t[91]=P,t[92]=kt,t[93]=nt):nt=t[93];const Yt=r?.yAxis?.title;let ot;t[94]!==m[1]||t[95]!==Yt?(ot={fill:m[1],textAnchor:"start",...Yt},t[94]=m[1],t[95]=Yt,t[96]=ot):ot=t[96];const Ut=n?.yAxis?.title;let at;t[97]!==Ut?(at=i.mo("text-base",Ut),t[97]=Ut,t[98]=at):at=t[98];const Mt=L/2+j/2;let rt;t[99]!==dt[1]||t[100]!==ot||t[101]!==at||t[102]!==Mt?(rt=i.jsxRuntimeExports.jsx("text",{style:ot,className:at,x:Mt,y:0,dx:5,dy:20,children:dt[1]}),t[99]=dt[1],t[100]=ot,t[101]=at,t[102]=Mt,t[103]=rt):rt=t[103];let X;t[104]!==Pt||t[105]!==nt||t[106]!==rt?(X=i.jsxRuntimeExports.jsxs("g",{transform:Pt,children:[nt,rt]}),t[104]=Pt,t[105]=nt,t[106]=rt,t[107]=X):X=t[107];let lt;t[108]!==D?(lt=D.filter(Te).map(qe),t[108]=D,t[109]=lt):lt=t[109];let H;t[110]!==it||t[111]!==X||t[112]!==lt||t[113]!==M||t[114]!==w||t[115]!==Z||t[116]!==_?(H=i.jsxRuntimeExports.jsxs("g",{transform:M,children:[w,Z,_,it,X,lt]}),t[110]=it,t[111]=X,t[112]=lt,t[113]=M,t[114]=w,t[115]=Z,t[116]=_,t[117]=H):H=t[117];let o;t[118]!==k||t[119]!==W||t[120]!==z||t[121]!==J||t[122]!==H||t[123]!==tt||t[124]!==et?(o=i.jsxRuntimeExports.jsx(k,{width:tt,height:et,viewBox:W,direction:z,ref:J,children:H}),t[118]=k,t[119]=W,t[120]=z,t[121]=J,t[122]=H,t[123]=tt,t[124]=et,t[125]=o):o=t[125];let ct;t[126]!==n?.tooltip||t[127]!==d||t[128]!==It||t[129]!==Ft||t[130]!==r?.tooltip||t[131]!==St?(ct=Ft&&St&&d&&It?i.jsxRuntimeExports.jsx(Be.Tooltip,{data:Ft,body:St,xPos:d,yPos:It,backgroundStyle:r?.tooltip,className:n?.tooltip}):null,t[126]=n?.tooltip,t[127]=d,t[128]=It,t[129]=Ft,t[130]=r?.tooltip,t[131]=St,t[132]=ct):ct=t[132];let ut;t[133]!==n?.modal||t[134]!==S||t[135]!==F?(ut=S&&F!==void 0?i.jsxRuntimeExports.jsx(Ce.DetailsModal,{body:S,data:F,setData:yt,className:n?.modal}):null,t[133]=n?.modal,t[134]=S,t[135]=F,t[136]=ut):ut=t[136];let jt;return t[137]!==o||t[138]!==ct||t[139]!==ut?(jt=i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[o,ct,ut]}),t[137]=o,t[138]=ct,t[139]=ut,t[140]=jt):jt=t[140],jt}function qe(s){return s.layer}function Te(s){return s.position==="after"}function Fe(s){return s!==0}function Ie(s){return s!==0}function Ge(s){return s!==0}function Pe(s){return s!==0}function Xe(s){return s.layer}function He(s){return s.position==="before"}function Ye(s){return`${s.id}`}function Ue(s,t){return{...s,id:`${t}`}}function re(s,t,a,E){const v=s.map(h=>h[t]).filter(h=>!he.checkIfNullOrUndefined(h)),m=he.checkIfNullOrUndefined(a)?Math.min(...v)>=0?0:Math.min(...v):a,j=he.checkIfNullOrUndefined(E)?Math.max(...v)<0?0:Math.max(...v):E;return{min:m,max:j}}function We(s){const t=i.compilerRuntimeExports.c(119),{data:a,graphTitle:E,sources:v,graphDescription:m,height:j,width:h,footNote:xt,padding:Rt,barColors:mt,backgroundColor:dt,leftMargin:Jt,rightMargin:Kt,topMargin:Y,bottomMargin:Qt,rightBarTitle:St,leftBarTitle:ht,tooltip:Dt,relativeHeight:Et,onSeriesMouseOver:$,graphID:Bt,barPadding:pt,truncateBy:ft,onSeriesMouseClick:Lt,centerGap:S,showValues:r,maxValue:n,minValue:B,refValues:x,suffix:gt,prefix:D,showTicks:q,showColorScale:T,graphDownload:qt,dataDownload:Tt,language:le,colorLegendTitle:Ct,minHeight:O,theme:Ft,ariaLabel:U,resetSelectionOnDoubleClick:F,detailsOnClick:yt,styles:d,classNames:l,noOfTicks:It,animate:bt,precision:Gt,customLayers:u,timeline:L,naLabel:C,hideAxisLine:vt}=s;let I;t[0]!==mt?(I=mt===void 0?[Ae.Colors.light.categoricalColors.colors[0],Ae.Colors.light.categoricalColors.colors[1]]:mt,t[0]=mt,t[1]=I):I=t[1];const k=I,W=dt===void 0?!1:dt,z=Jt===void 0?20:Jt,J=Kt===void 0?20:Kt,K=Y===void 0?25:Y,Q=Qt===void 0?30:Qt,M=St===void 0?"Right bar graph":St,w=ht===void 0?"Left bar graph":ht,Z=pt===void 0?.25:pt,_=ft===void 0?999:ft,tt=S===void 0?100:S,et=r===void 0?!0:r;let G;t[2]!==x?(G=x===void 0?[]:x,t[2]=x,t[3]=G):G=t[3];const it=G,Pt=gt===void 0?"":gt,Xt=D===void 0?"":D,st=q===void 0?!0:q,Ht=T===void 0?!1:T,P=qt===void 0?!1:qt,kt=Tt===void 0?!1:Tt,nt=le===void 0?"en":le,Yt=O===void 0?0:O,ot=Ft===void 0?"light":Ft,Ut=F===void 0?!0:F,at=It===void 0?5:It,Mt=bt===void 0?!1:bt,rt=Gt===void 0?2:Gt;let X;t[4]!==u?(X=u===void 0?[]:u,t[4]=u,t[5]=X):X=t[5];const lt=X;let H;t[6]!==L?(H=L===void 0?{enabled:!1,autoplay:!1,showOnlyActiveDate:!0}:L,t[6]=L,t[7]=H):H=t[7];const o=H,ct=C===void 0?"NA":C,ut=vt===void 0?!1:vt,[jt,Zt]=V.useState(0),[A,p]=V.useState(0),[N,f]=V.useState(o.autoplay);let Vt;if(t[8]!==a||t[9]!==o.dateFormat){let g;t[11]!==o.dateFormat?(g=zt=>fe.parse(`${zt.date}`,o.dateFormat||"yyyy",new Date).getTime(),t[11]=o.dateFormat,t[12]=g):g=t[12],Vt=[...new Set(a.filter(ti).map(g))],Vt.sort(_e),t[8]=a,t[9]=o.dateFormat,t[10]=Vt}else Vt=t[10];const c=Vt,[R,Wt]=V.useState(o.autoplay?0:c.length-1),$t=V.useRef(null),_t=V.useRef(null);let wt,Ot;t[13]===Symbol.for("react.memo_cache_sentinel")?(wt=()=>{const g=new ResizeObserver(zt=>{Zt(zt[0].target.clientWidth||620),p(zt[0].target.clientHeight||480)});return $t.current&&g.observe($t.current),()=>g.disconnect()},Ot=[],t[13]=wt,t[14]=Ot):(wt=t[13],Ot=t[14]),V.useEffect(wt,Ot);let At,e;t[15]!==N||t[16]!==o.speed||t[17]!==c?(At=()=>{const g=setInterval(()=>{Wt(zt=>zt<c.length-1?zt+1:0)},(o.speed||2)*1e3);return N||clearInterval(g),()=>clearInterval(g)},e=[c,N,o.speed],t[15]=N,t[16]=o.speed,t[17]=c,t[18]=At,t[19]=e):(At=t[18],e=t[19]),V.useEffect(At,e);const y=o.dateFormat||"yyyy";let b;t[20]!==R||t[21]!==y||t[22]!==o.showOnlyActiveDate||t[23]!==c?(b=pe.getSliderMarks(c,R,o.showOnlyActiveDate,y),t[20]=R,t[21]=y,t[22]=o.showOnlyActiveDate,t[23]=c,t[24]=b):b=t[24];const ce=b,xe=l?.graphContainer,me=d?.graphContainer;let te;t[25]!==l?.description||t[26]!==l?.title||t[27]!==a||t[28]!==kt||t[29]!==m||t[30]!==P||t[31]!==E||t[32]!==d?.description||t[33]!==d?.title||t[34]!==h?(te=E||m||P||kt?i.jsxRuntimeExports.jsx($e.GraphHeader,{styles:{title:d?.title,description:d?.description},classNames:{title:l?.title,description:l?.description},graphTitle:E,graphDescription:m,width:h,graphDownload:P?_t:void 0,dataDownload:kt?a.map(Ze).filter(Qe).length>0?a.map(Ke).filter(Je):a.filter(ze):null}):null,t[25]=l?.description,t[26]=l?.title,t[27]=a,t[28]=kt,t[29]=m,t[30]=P,t[31]=E,t[32]=d?.description,t[33]=d?.title,t[34]=h,t[35]=te):te=t[35];let ee;t[36]!==R||t[37]!==ce||t[38]!==N||t[39]!==o.enabled||t[40]!==c?(ee=o.enabled&&c.length>0&&ce?i.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[i.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{f(!N)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":N?"Click to pause animation":"Click to play animation",children:N?i.jsxRuntimeExports.jsx(Re.Pause,{}):i.jsxRuntimeExports.jsx(Re.Play,{})}),i.jsxRuntimeExports.jsx(pe.Nr,{min:c[0],max:c[c.length-1],marks:ce,step:null,defaultValue:c[c.length-1],value:c[R],onChangeComplete:g=>{Wt(c.indexOf(g))},onChange:g=>{Wt(c.indexOf(g))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,t[36]=R,t[37]=ce,t[38]=N,t[39]=o.enabled,t[40]=c,t[41]=ee):ee=t[41];let ie;t[42]!==k||t[43]!==l?.colorLegend||t[44]!==Ct||t[45]!==a.length||t[46]!==w||t[47]!==M||t[48]!==Ht?(ie=Ht&&a.length>0?i.jsxRuntimeExports.jsx(Oe.ColorLegend,{colorLegendTitle:Ct,colorDomain:[w,M],colors:k,showNAColor:!1,className:l?.colorLegend}):null,t[42]=k,t[43]=l?.colorLegend,t[44]=Ct,t[45]=a.length,t[46]=w,t[47]=M,t[48]=Ht,t[49]=ie):ie=t[49];let se;t[50]!==a.length?(se=a.length===0&&i.jsxRuntimeExports.jsx(Ne.EmptyState,{}),t[50]=a.length,t[51]=se):se=t[51];let ne;t[52]!==Mt||t[53]!==k||t[54]!==Z||t[55]!==Q||t[56]!==tt||t[57]!==l||t[58]!==lt||t[59]!==a||t[60]!==yt||t[61]!==ut||t[62]!==R||t[63]!==w||t[64]!==z||t[65]!==n||t[66]!==B||t[67]!==ct||t[68]!==at||t[69]!==Lt||t[70]!==$||t[71]!==rt||t[72]!==Xt||t[73]!==it||t[74]!==Ut||t[75]!==M||t[76]!==J||t[77]!==st||t[78]!==et||t[79]!==d||t[80]!==Pt||t[81]!==A||t[82]!==jt||t[83]!==o.dateFormat||t[84]!==o.enabled||t[85]!==Dt||t[86]!==K||t[87]!==_||t[88]!==c?(ne=jt&&A&&a.length>0?i.jsxRuntimeExports.jsx(De,{hideAxisLine:ut,data:Se.ensureCompleteDataForButterFlyChart(a,o.dateFormat||"yyyy").filter(g=>o.enabled?g.date===fe.format(new Date(c[R]),o.dateFormat||"yyyy"):g),barColors:k,width:jt,centerGap:tt,height:A,truncateBy:_,leftMargin:z,rightMargin:J,topMargin:K,bottomMargin:Q,axisTitles:[w,M],tooltip:Dt,onSeriesMouseOver:$,barPadding:Z,refValues:it,maxValue:Math.max(re(a,"leftBar",B,n).max,re(a,"rightBar",B,n).max),minValue:Math.min(re(a,"leftBar",B,n).min,re(a,"rightBar",B,n).min),minValueLeftBar:re(a,"leftBar",B,n).min,minValueRightBar:re(a,"rightBar",B,n).min,showValues:et,onSeriesMouseClick:Lt,showTicks:st,suffix:Pt,prefix:Xt,resetSelectionOnDoubleClick:Ut,detailsOnClick:yt,styles:d,classNames:l,noOfTicks:at,animate:Mt===!0?{duration:.5,once:!0,amount:.5}:Mt||{duration:0,once:!0,amount:0},precision:rt,customLayers:lt,naLabel:ct}):null,t[52]=Mt,t[53]=k,t[54]=Z,t[55]=Q,t[56]=tt,t[57]=l,t[58]=lt,t[59]=a,t[60]=yt,t[61]=ut,t[62]=R,t[63]=w,t[64]=z,t[65]=n,t[66]=B,t[67]=ct,t[68]=at,t[69]=Lt,t[70]=$,t[71]=rt,t[72]=Xt,t[73]=it,t[74]=Ut,t[75]=M,t[76]=J,t[77]=st,t[78]=et,t[79]=d,t[80]=Pt,t[81]=A,t[82]=jt,t[83]=o.dateFormat,t[84]=o.enabled,t[85]=Dt,t[86]=K,t[87]=_,t[88]=c,t[89]=ne):ne=t[89];let oe;t[90]!==se||t[91]!==ne?(oe=i.jsxRuntimeExports.jsxs(Ee.GraphArea,{ref:$t,children:[se,ne]}),t[90]=se,t[91]=ne,t[92]=oe):oe=t[92];let ae;t[93]!==l?.footnote||t[94]!==l?.source||t[95]!==xt||t[96]!==v||t[97]!==d?.footnote||t[98]!==d?.source||t[99]!==h?(ae=v||xt?i.jsxRuntimeExports.jsx(Ve.GraphFooter,{styles:{footnote:d?.footnote,source:d?.source},classNames:{footnote:l?.footnote,source:l?.source},sources:v,footNote:xt,width:h}):null,t[93]=l?.footnote,t[94]=l?.source,t[95]=xt,t[96]=v,t[97]=d?.footnote,t[98]=d?.source,t[99]=h,t[100]=ae):ae=t[100];let ue;return t[101]!==U||t[102]!==W||t[103]!==Bt||t[104]!==j||t[105]!==nt||t[106]!==Yt||t[107]!==Rt||t[108]!==Et||t[109]!==xe||t[110]!==me||t[111]!==te||t[112]!==ee||t[113]!==ie||t[114]!==oe||t[115]!==ae||t[116]!==ot||t[117]!==h?(ue=i.jsxRuntimeExports.jsxs(Ee.GraphContainer,{className:xe,style:me,id:Bt,ref:_t,"aria-label":U,backgroundColor:W,theme:ot,language:nt,minHeight:Yt,width:h,height:j,relativeHeight:Et,padding:Rt,children:[te,ee,ie,oe,ae]}),t[101]=U,t[102]=W,t[103]=Bt,t[104]=j,t[105]=nt,t[106]=Yt,t[107]=Rt,t[108]=Et,t[109]=xe,t[110]=me,t[111]=te,t[112]=ee,t[113]=ie,t[114]=oe,t[115]=ae,t[116]=ot,t[117]=h,t[118]=ue):ue=t[118],ue}function ze(s){return s!==void 0}function Je(s){return s!==void 0}function Ke(s){return s.data}function Qe(s){return s!==void 0}function Ze(s){return s.data}function _e(s,t){return s-t}function ti(s){return s.date}exports.ButterflyChart=We;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index-CHPV5EwG-6v2a2njQ.cjs"),V=require("react"),pe=require("./getSliderMarks-CIuSoedo.cjs"),fe=require("./parse-xYI9yrvL.cjs"),ge=require("./index-DQA8q5sC.cjs"),ye=require("./numberFormattingFunction-02t-wJta.cjs"),Be=require("./Tooltip-BLa2EfMs.cjs"),be=require("./XTicksAndGridLines-CekrPykD.cjs"),ve=require("./Axis-Jt_tmhxS.cjs"),Le=require("./YAxesLabels-BQ2aCazV.cjs"),je=require("./ReferenceLine-M9aP3dj-.cjs"),Ce=require("./DetailsModal-DHttOA80.cjs"),ke=require("./band-VYfcZeJ2.cjs"),we=require("./linear-CgUCbw9F.cjs"),Nt=require("./proxy-C4-uo6nS.cjs"),Me=require("./use-in-view-C3o_ntMv.cjs"),de=require("./index-CoobIWNj.cjs"),Ve=require("./GraphFooter.cjs"),$e=require("./GraphHeader.cjs"),Oe=require("./ColorLegend.cjs"),Ae=require("./Colors.cjs"),Ne=require("./EmptyState-DX0t62iF.cjs"),Re=require("./index-sbKVyHS2.cjs"),he=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),Se=require("./ensureCompleteData-D9bQTiVS.cjs"),Ee=require("./GraphContainer-B1EDxJ0S.cjs");function De(s){const t=i.compilerRuntimeExports.c(141),{data:a,width:E,height:v,barColors:m,centerGap:j,refValues:h,maxValue:xt,minValue:Rt,showValues:mt,axisTitles:dt,rightMargin:Jt,leftMargin:Kt,topMargin:Y,bottomMargin:Qt,tooltip:St,onSeriesMouseOver:ht,barPadding:Dt,truncateBy:Et,onSeriesMouseClick:$,showTicks:Bt,suffix:pt,prefix:ft,resetSelectionOnDoubleClick:Lt,detailsOnClick:S,styles:r,classNames:n,noOfTicks:B,animate:x,precision:gt,customLayers:D,minValueLeftBar:q,minValueRightBar:T,naLabel:qt,hideAxisLine:Tt}=s,le=V.useRef(null);let Ct;t[0]!==x.amount||t[1]!==x.once?(Ct={once:x.once,amount:x.amount},t[0]=x.amount,t[1]=x.once,t[2]=Ct):Ct=t[2];const O=Me.useInView(le,Ct),[Ft,U]=V.useState(void 0),[F,yt]=V.useState(void 0),[d,l]=V.useState(void 0),[It,bt]=V.useState(void 0);let Gt;t[3]!==Qt||t[4]!==Kt||t[5]!==Jt||t[6]!==Y?(Gt={top:Y,bottom:Qt,left:Kt,right:Jt},t[3]=Qt,t[4]=Kt,t[5]=Jt,t[6]=Y,t[7]=Gt):Gt=t[7];const u=Gt,L=E-u.left-u.right,C=v-u.top-u.bottom;let vt,I,k,W,z,J,K,Q,M,w,Z,_,tt,et;if(t[8]!==x||t[9]!==m[0]||t[10]!==m[1]||t[11]!==Dt||t[12]!==j||t[13]!==n?.graphObjectValues||t[14]!==n?.xAxis?.gridLines||t[15]!==n?.xAxis?.labels||t[16]!==n?.yAxis?.axis||t[17]!==n?.yAxis?.labels||t[18]!==D||t[19]!==a||t[20]!==S||t[21]!==C||t[22]!==L||t[23]!==v||t[24]!==Tt||t[25]!==O||t[26]!==u.bottom||t[27]!==u.left||t[28]!==u.top||t[29]!==xt||t[30]!==Rt||t[31]!==q||t[32]!==T||t[33]!==F||t[34]!==qt||t[35]!==B||t[36]!==$||t[37]!==ht||t[38]!==gt||t[39]!==ft||t[40]!==h||t[41]!==Lt||t[42]!==Bt||t[43]!==mt||t[44]!==r?.graphObjectValues||t[45]!==r?.xAxis?.gridLines||t[46]!==r?.xAxis?.labels||t[47]!==r?.yAxis?.axis||t[48]!==r?.yAxis?.labels||t[49]!==pt||t[50]!==Y||t[51]!==Et||t[52]!==E){const Zt=a.map(Ue),A=ke.band().domain(Zt.map(Ye)).range([C,0]).paddingInner(Dt),p=we.linear().domain([Rt,xt]).range([0,(L-j)/2]).nice(),N=p.ticks(B),f=we.linear().domain([Rt,xt]).range([(L-j)/2,0]).nice(),Vt=f.ticks(B);k=Nt.motion.svg,tt=`${E}px`,et=`${v}px`,W=`0 0 ${E} ${v}`,z="ltr",J=le,M=`translate(${u.left},${u.top})`,t[67]!==D?(w=D.filter(He).map(Xe),t[67]=D,t[68]=w):w=t[68];const c=n?.yAxis?.axis;let R;t[69]!==c?(R={axis:c},t[69]=c,t[70]=R):R=t[70];const Wt=r?.yAxis?.axis;let $t;t[71]!==Wt?($t={axis:Wt},t[71]=Wt,t[72]=$t):$t=t[72],Z=i.jsxRuntimeExports.jsxs("g",{transform:"translate(0,0)",children:[Bt?i.jsxRuntimeExports.jsx(be.XTicksAndGridLines,{values:Vt.filter(Pe),x:Vt.filter(Ge).map(e=>f(e)),y1:0-Y,y2:C+u.bottom,styles:{gridLines:r?.xAxis?.gridLines,labels:r?.xAxis?.labels},classNames:{gridLines:n?.xAxis?.gridLines,labels:n?.xAxis?.labels},suffix:pt,prefix:ft,labelType:"secondary",showGridLines:!0,leftLabel:!0,precision:gt}):null,i.jsxRuntimeExports.jsxs(de.AnimatePresence,{children:[Zt.map((e,y)=>i.jsxRuntimeExports.jsxs(Nt.motion.g,{className:"undp-viz-g-with-hover",opacity:.85,onMouseEnter:b=>{U(e),bt(b.clientY),l(b.clientX),ht?.(e)},onClick:()=>{($||S)&&(ge.isEqual(F,e)&&Lt?(yt(void 0),$?.(void 0)):(yt(e),$?.(e)))},onMouseMove:b=>{U(e),bt(b.clientY),l(b.clientX)},onMouseLeave:()=>{U(void 0),l(void 0),bt(void 0),ht?.(void 0)},children:[e.leftBar?i.jsxRuntimeExports.jsx(Nt.motion.rect,{y:A(`${y}`),style:{fill:m[0]},height:A.bandwidth(),variants:{initial:{x:f(0),width:0},whileInView:{x:e.leftBar<0?f(0):f(e.leftBar),width:e.leftBar<0?f(e.leftBar)-f(0):f(0)-f(e.leftBar),transition:{duration:x.duration}}},initial:"initial",animate:O?"whileInView":"initial",exit:{x:f(0),width:0,transition:{duration:x.duration}}}):null,mt?i.jsxRuntimeExports.jsx(Nt.motion.text,{y:A(`${y}`)+A.bandwidth()/2,style:{textAnchor:e.rightBar&&e.rightBar>0?"end":"start",...r?.graphObjectValues||{}},dx:e.rightBar&&e.rightBar>0?-5:5,dy:"0.33em",className:i.mo("graph-value text-sm",n?.graphObjectValues),exit:{opacity:0,transition:{duration:x.duration}},variants:{initial:{x:f(0),opacity:0,fill:m[0]},whileInView:{x:e.leftBar?f(e.leftBar):f(q<0?0:q),opacity:1,fill:m[0],transition:{duration:x.duration}}},initial:"initial",animate:O?"whileInView":"initial",children:ye.numberFormattingFunction(e.rightBar,qt,gt,ft,pt)}):null]},e.label)),i.jsxRuntimeExports.jsx(ve.Axis,{hideAxisLine:Tt,y1:-2.5,y2:C+u.bottom,x1:f(q<0?0:q),x2:f(q<0?0:q),classNames:R,styles:$t}),h?i.jsxRuntimeExports.jsx(i.jsxRuntimeExports.Fragment,{children:h.map((e,y)=>i.jsxRuntimeExports.jsx(je.RefLineX,{text:e.text,color:e.color,x:f(e.value),y1:0-u.top,y2:C+u.bottom,textSide:"left",classNames:e.classNames,styles:e.styles,animate:x,isInView:O},y))}):null]})]});const _t=n?.yAxis?.axis;let wt;t[73]!==_t?(wt={axis:_t},t[73]=_t,t[74]=wt):wt=t[74];const Ot=r?.yAxis?.axis;let At;t[75]!==Ot?(At={axis:Ot},t[75]=Ot,t[76]=At):At=t[76],_=i.jsxRuntimeExports.jsxs("g",{transform:`translate(${(L+j)/2},0)`,children:[Bt?i.jsxRuntimeExports.jsx(be.XTicksAndGridLines,{values:N.filter(Ie),x:N.filter(Fe).map(e=>p(e)),y1:0-Y,y2:C+u.bottom,styles:{gridLines:r?.xAxis?.gridLines,labels:r?.xAxis?.labels},classNames:{gridLines:n?.xAxis?.gridLines,labels:n?.xAxis?.labels},suffix:pt,prefix:ft,labelType:"secondary",showGridLines:!0,precision:gt}):null,i.jsxRuntimeExports.jsxs(de.AnimatePresence,{children:[Zt.map((e,y)=>i.jsxRuntimeExports.jsxs(Nt.motion.g,{className:"undp-viz-g-with-hover",opacity:.85,onMouseEnter:b=>{U(e),bt(b.clientY),l(b.clientX),ht?.(e)},onClick:()=>{($||S)&&(ge.isEqual(F,e)&&Lt?(yt(void 0),$?.(void 0)):(yt(e),$?.(e)))},onMouseMove:b=>{U(e),bt(b.clientY),l(b.clientX)},onMouseLeave:()=>{U(void 0),l(void 0),bt(void 0),ht?.(void 0)},children:[e.rightBar?i.jsxRuntimeExports.jsx(Nt.motion.rect,{y:A(`${y}`),style:{fill:m[1]},height:A.bandwidth(),exit:{x:p(0),width:0,transition:{duration:x.duration}},variants:{initial:{x:p(0),width:0},whileInView:{x:e.rightBar>=0?p(0):p(e.rightBar),width:e.rightBar>=0?p(e.rightBar)-p(0):p(0)-p(e.rightBar),transition:{duration:x.duration}}},initial:"initial",animate:O?"whileInView":"initial"}):null,mt?i.jsxRuntimeExports.jsx(Nt.motion.text,{y:A(`${y}`)+A.bandwidth()/2,style:{textAnchor:e.rightBar&&e.rightBar<0?"end":"start",...r?.graphObjectValues||{}},className:i.mo("graph-value text-sm",n?.graphObjectValues),dx:e.rightBar&&e.rightBar<0?-5:5,dy:"0.33em",exit:{opacity:0,transition:{duration:x.duration}},variants:{initial:{x:p(0),opacity:0,fill:m[1]},whileInView:{x:e.rightBar?p(e.rightBar):p(T<0?0:T),opacity:1,fill:m[1],transition:{duration:x.duration}}},initial:"initial",animate:O?"whileInView":"initial",children:ye.numberFormattingFunction(e.rightBar,qt,gt,ft,pt)}):null]},y)),i.jsxRuntimeExports.jsx(ve.Axis,{hideAxisLine:Tt,y1:-2.5,y2:C+u.bottom,x1:p(T<0?0:T),x2:p(T<0?0:T),classNames:wt,styles:At}),h?i.jsxRuntimeExports.jsx(i.jsxRuntimeExports.Fragment,{children:h.map((e,y)=>i.jsxRuntimeExports.jsx(je.RefLineX,{text:e.text,color:e.color,x:p(e.value),y1:0-u.top,y2:C+u.bottom,textSide:"right",classNames:e.classNames,styles:e.styles,animate:x,isInView:O},y))}):null]})]}),I=de.AnimatePresence,vt=Nt.motion.g,K=`translate(${L/2},0)`,Q=Zt.map((e,y)=>i.jsxRuntimeExports.jsx(Le.YAxesLabels,{value:`${e.label}`.length<Et?`${e.label}`:`${`${e.label}`.substring(0,Et)}...`,y:A(`${e.id}`),x:0-j/2,width:j,height:A.bandwidth(),alignment:"center",style:r?.yAxis?.labels,className:n?.yAxis?.labels,animate:x,isInView:O},y)),t[8]=x,t[9]=m[0],t[10]=m[1],t[11]=Dt,t[12]=j,t[13]=n?.graphObjectValues,t[14]=n?.xAxis?.gridLines,t[15]=n?.xAxis?.labels,t[16]=n?.yAxis?.axis,t[17]=n?.yAxis?.labels,t[18]=D,t[19]=a,t[20]=S,t[21]=C,t[22]=L,t[23]=v,t[24]=Tt,t[25]=O,t[26]=u.bottom,t[27]=u.left,t[28]=u.top,t[29]=xt,t[30]=Rt,t[31]=q,t[32]=T,t[33]=F,t[34]=qt,t[35]=B,t[36]=$,t[37]=ht,t[38]=gt,t[39]=ft,t[40]=h,t[41]=Lt,t[42]=Bt,t[43]=mt,t[44]=r?.graphObjectValues,t[45]=r?.xAxis?.gridLines,t[46]=r?.xAxis?.labels,t[47]=r?.yAxis?.axis,t[48]=r?.yAxis?.labels,t[49]=pt,t[50]=Y,t[51]=Et,t[52]=E,t[53]=vt,t[54]=I,t[55]=k,t[56]=W,t[57]=z,t[58]=J,t[59]=K,t[60]=Q,t[61]=M,t[62]=w,t[63]=Z,t[64]=_,t[65]=tt,t[66]=et}else vt=t[53],I=t[54],k=t[55],W=t[56],z=t[57],J=t[58],K=t[59],Q=t[60],M=t[61],w=t[62],Z=t[63],_=t[64],tt=t[65],et=t[66];let G;t[77]!==vt||t[78]!==K||t[79]!==Q?(G=i.jsxRuntimeExports.jsx(vt,{transform:K,children:Q}),t[77]=vt,t[78]=K,t[79]=Q,t[80]=G):G=t[80];let it;t[81]!==I||t[82]!==G?(it=i.jsxRuntimeExports.jsx(I,{children:G}),t[81]=I,t[82]=G,t[83]=it):it=t[83];const Pt=`translate(0,${C})`,Xt=r?.yAxis?.title;let st;t[84]!==m[0]||t[85]!==Xt?(st={fill:m[0],textAnchor:"end",...Xt},t[84]=m[0],t[85]=Xt,t[86]=st):st=t[86];const Ht=n?.yAxis?.title;let P;t[87]!==Ht?(P=i.mo("text-base",Ht),t[87]=Ht,t[88]=P):P=t[88];const kt=L/2-j/2;let nt;t[89]!==dt[0]||t[90]!==st||t[91]!==P||t[92]!==kt?(nt=i.jsxRuntimeExports.jsx("text",{style:st,className:P,x:kt,y:0,dx:-5,dy:20,children:dt[0]}),t[89]=dt[0],t[90]=st,t[91]=P,t[92]=kt,t[93]=nt):nt=t[93];const Yt=r?.yAxis?.title;let ot;t[94]!==m[1]||t[95]!==Yt?(ot={fill:m[1],textAnchor:"start",...Yt},t[94]=m[1],t[95]=Yt,t[96]=ot):ot=t[96];const Ut=n?.yAxis?.title;let at;t[97]!==Ut?(at=i.mo("text-base",Ut),t[97]=Ut,t[98]=at):at=t[98];const Mt=L/2+j/2;let rt;t[99]!==dt[1]||t[100]!==ot||t[101]!==at||t[102]!==Mt?(rt=i.jsxRuntimeExports.jsx("text",{style:ot,className:at,x:Mt,y:0,dx:5,dy:20,children:dt[1]}),t[99]=dt[1],t[100]=ot,t[101]=at,t[102]=Mt,t[103]=rt):rt=t[103];let X;t[104]!==Pt||t[105]!==nt||t[106]!==rt?(X=i.jsxRuntimeExports.jsxs("g",{transform:Pt,children:[nt,rt]}),t[104]=Pt,t[105]=nt,t[106]=rt,t[107]=X):X=t[107];let lt;t[108]!==D?(lt=D.filter(Te).map(qe),t[108]=D,t[109]=lt):lt=t[109];let H;t[110]!==it||t[111]!==X||t[112]!==lt||t[113]!==M||t[114]!==w||t[115]!==Z||t[116]!==_?(H=i.jsxRuntimeExports.jsxs("g",{transform:M,children:[w,Z,_,it,X,lt]}),t[110]=it,t[111]=X,t[112]=lt,t[113]=M,t[114]=w,t[115]=Z,t[116]=_,t[117]=H):H=t[117];let o;t[118]!==k||t[119]!==W||t[120]!==z||t[121]!==J||t[122]!==H||t[123]!==tt||t[124]!==et?(o=i.jsxRuntimeExports.jsx(k,{width:tt,height:et,viewBox:W,direction:z,ref:J,children:H}),t[118]=k,t[119]=W,t[120]=z,t[121]=J,t[122]=H,t[123]=tt,t[124]=et,t[125]=o):o=t[125];let ct;t[126]!==n?.tooltip||t[127]!==d||t[128]!==It||t[129]!==Ft||t[130]!==r?.tooltip||t[131]!==St?(ct=Ft&&St&&d&&It?i.jsxRuntimeExports.jsx(Be.Tooltip,{data:Ft,body:St,xPos:d,yPos:It,backgroundStyle:r?.tooltip,className:n?.tooltip}):null,t[126]=n?.tooltip,t[127]=d,t[128]=It,t[129]=Ft,t[130]=r?.tooltip,t[131]=St,t[132]=ct):ct=t[132];let ut;t[133]!==n?.modal||t[134]!==S||t[135]!==F?(ut=S&&F!==void 0?i.jsxRuntimeExports.jsx(Ce.DetailsModal,{body:S,data:F,setData:yt,className:n?.modal}):null,t[133]=n?.modal,t[134]=S,t[135]=F,t[136]=ut):ut=t[136];let jt;return t[137]!==o||t[138]!==ct||t[139]!==ut?(jt=i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[o,ct,ut]}),t[137]=o,t[138]=ct,t[139]=ut,t[140]=jt):jt=t[140],jt}function qe(s){return s.layer}function Te(s){return s.position==="after"}function Fe(s){return s!==0}function Ie(s){return s!==0}function Ge(s){return s!==0}function Pe(s){return s!==0}function Xe(s){return s.layer}function He(s){return s.position==="before"}function Ye(s){return`${s.id}`}function Ue(s,t){return{...s,id:`${t}`}}function re(s,t,a,E){const v=s.map(h=>h[t]).filter(h=>!he.checkIfNullOrUndefined(h)),m=he.checkIfNullOrUndefined(a)?Math.min(...v)>=0?0:Math.min(...v):a,j=he.checkIfNullOrUndefined(E)?Math.max(...v)<0?0:Math.max(...v):E;return{min:m,max:j}}function We(s){const t=i.compilerRuntimeExports.c(119),{data:a,graphTitle:E,sources:v,graphDescription:m,height:j,width:h,footNote:xt,padding:Rt,barColors:mt,backgroundColor:dt,leftMargin:Jt,rightMargin:Kt,topMargin:Y,bottomMargin:Qt,rightBarTitle:St,leftBarTitle:ht,tooltip:Dt,relativeHeight:Et,onSeriesMouseOver:$,graphID:Bt,barPadding:pt,truncateBy:ft,onSeriesMouseClick:Lt,centerGap:S,showValues:r,maxValue:n,minValue:B,refValues:x,suffix:gt,prefix:D,showTicks:q,showColorScale:T,graphDownload:qt,dataDownload:Tt,language:le,colorLegendTitle:Ct,minHeight:O,theme:Ft,ariaLabel:U,resetSelectionOnDoubleClick:F,detailsOnClick:yt,styles:d,classNames:l,noOfTicks:It,animate:bt,precision:Gt,customLayers:u,timeline:L,naLabel:C,hideAxisLine:vt}=s;let I;t[0]!==mt?(I=mt===void 0?[Ae.Colors.light.categoricalColors.colors[0],Ae.Colors.light.categoricalColors.colors[1]]:mt,t[0]=mt,t[1]=I):I=t[1];const k=I,W=dt===void 0?!1:dt,z=Jt===void 0?20:Jt,J=Kt===void 0?20:Kt,K=Y===void 0?25:Y,Q=Qt===void 0?30:Qt,M=St===void 0?"Right bar graph":St,w=ht===void 0?"Left bar graph":ht,Z=pt===void 0?.25:pt,_=ft===void 0?999:ft,tt=S===void 0?100:S,et=r===void 0?!0:r;let G;t[2]!==x?(G=x===void 0?[]:x,t[2]=x,t[3]=G):G=t[3];const it=G,Pt=gt===void 0?"":gt,Xt=D===void 0?"":D,st=q===void 0?!0:q,Ht=T===void 0?!1:T,P=qt===void 0?!1:qt,kt=Tt===void 0?!1:Tt,nt=le===void 0?"en":le,Yt=O===void 0?0:O,ot=Ft===void 0?"light":Ft,Ut=F===void 0?!0:F,at=It===void 0?5:It,Mt=bt===void 0?!1:bt,rt=Gt===void 0?2:Gt;let X;t[4]!==u?(X=u===void 0?[]:u,t[4]=u,t[5]=X):X=t[5];const lt=X;let H;t[6]!==L?(H=L===void 0?{enabled:!1,autoplay:!1,showOnlyActiveDate:!0}:L,t[6]=L,t[7]=H):H=t[7];const o=H,ct=C===void 0?"NA":C,ut=vt===void 0?!1:vt,[jt,Zt]=V.useState(0),[A,p]=V.useState(0),[N,f]=V.useState(o.autoplay);let Vt;if(t[8]!==a||t[9]!==o.dateFormat){let g;t[11]!==o.dateFormat?(g=zt=>fe.parse(`${zt.date}`,o.dateFormat||"yyyy",new Date).getTime(),t[11]=o.dateFormat,t[12]=g):g=t[12],Vt=[...new Set(a.filter(ti).map(g))],Vt.sort(_e),t[8]=a,t[9]=o.dateFormat,t[10]=Vt}else Vt=t[10];const c=Vt,[R,Wt]=V.useState(o.autoplay?0:c.length-1),$t=V.useRef(null),_t=V.useRef(null);let wt,Ot;t[13]===Symbol.for("react.memo_cache_sentinel")?(wt=()=>{const g=new ResizeObserver(zt=>{Zt(zt[0].target.clientWidth||620),p(zt[0].target.clientHeight||480)});return $t.current&&g.observe($t.current),()=>g.disconnect()},Ot=[],t[13]=wt,t[14]=Ot):(wt=t[13],Ot=t[14]),V.useEffect(wt,Ot);let At,e;t[15]!==N||t[16]!==o.speed||t[17]!==c?(At=()=>{const g=setInterval(()=>{Wt(zt=>zt<c.length-1?zt+1:0)},(o.speed||2)*1e3);return N||clearInterval(g),()=>clearInterval(g)},e=[c,N,o.speed],t[15]=N,t[16]=o.speed,t[17]=c,t[18]=At,t[19]=e):(At=t[18],e=t[19]),V.useEffect(At,e);const y=o.dateFormat||"yyyy";let b;t[20]!==R||t[21]!==y||t[22]!==o.showOnlyActiveDate||t[23]!==c?(b=pe.getSliderMarks(c,R,o.showOnlyActiveDate,y),t[20]=R,t[21]=y,t[22]=o.showOnlyActiveDate,t[23]=c,t[24]=b):b=t[24];const ce=b,xe=l?.graphContainer,me=d?.graphContainer;let te;t[25]!==l?.description||t[26]!==l?.title||t[27]!==a||t[28]!==kt||t[29]!==m||t[30]!==P||t[31]!==E||t[32]!==d?.description||t[33]!==d?.title||t[34]!==h?(te=E||m||P||kt?i.jsxRuntimeExports.jsx($e.GraphHeader,{styles:{title:d?.title,description:d?.description},classNames:{title:l?.title,description:l?.description},graphTitle:E,graphDescription:m,width:h,graphDownload:P?_t:void 0,dataDownload:kt?a.map(Ze).filter(Qe).length>0?a.map(Ke).filter(Je):a.filter(ze):null}):null,t[25]=l?.description,t[26]=l?.title,t[27]=a,t[28]=kt,t[29]=m,t[30]=P,t[31]=E,t[32]=d?.description,t[33]=d?.title,t[34]=h,t[35]=te):te=t[35];let ee;t[36]!==R||t[37]!==ce||t[38]!==N||t[39]!==o.enabled||t[40]!==c?(ee=o.enabled&&c.length>0&&ce?i.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[i.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{f(!N)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":N?"Click to pause animation":"Click to play animation",children:N?i.jsxRuntimeExports.jsx(Re.Pause,{}):i.jsxRuntimeExports.jsx(Re.Play,{})}),i.jsxRuntimeExports.jsx(pe.Nr,{min:c[0],max:c[c.length-1],marks:ce,step:null,defaultValue:c[c.length-1],value:c[R],onChangeComplete:g=>{Wt(c.indexOf(g))},onChange:g=>{Wt(c.indexOf(g))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,t[36]=R,t[37]=ce,t[38]=N,t[39]=o.enabled,t[40]=c,t[41]=ee):ee=t[41];let ie;t[42]!==k||t[43]!==l?.colorLegend||t[44]!==Ct||t[45]!==a.length||t[46]!==w||t[47]!==M||t[48]!==Ht?(ie=Ht&&a.length>0?i.jsxRuntimeExports.jsx(Oe.ColorLegend,{colorLegendTitle:Ct,colorDomain:[w,M],colors:k,showNAColor:!1,className:l?.colorLegend}):null,t[42]=k,t[43]=l?.colorLegend,t[44]=Ct,t[45]=a.length,t[46]=w,t[47]=M,t[48]=Ht,t[49]=ie):ie=t[49];let se;t[50]!==a.length?(se=a.length===0&&i.jsxRuntimeExports.jsx(Ne.EmptyState,{}),t[50]=a.length,t[51]=se):se=t[51];let ne;t[52]!==Mt||t[53]!==k||t[54]!==Z||t[55]!==Q||t[56]!==tt||t[57]!==l||t[58]!==lt||t[59]!==a||t[60]!==yt||t[61]!==ut||t[62]!==R||t[63]!==w||t[64]!==z||t[65]!==n||t[66]!==B||t[67]!==ct||t[68]!==at||t[69]!==Lt||t[70]!==$||t[71]!==rt||t[72]!==Xt||t[73]!==it||t[74]!==Ut||t[75]!==M||t[76]!==J||t[77]!==st||t[78]!==et||t[79]!==d||t[80]!==Pt||t[81]!==A||t[82]!==jt||t[83]!==o.dateFormat||t[84]!==o.enabled||t[85]!==Dt||t[86]!==K||t[87]!==_||t[88]!==c?(ne=jt&&A&&a.length>0?i.jsxRuntimeExports.jsx(De,{hideAxisLine:ut,data:Se.ensureCompleteDataForButterFlyChart(a,o.dateFormat||"yyyy").filter(g=>o.enabled?g.date===fe.format(new Date(c[R]),o.dateFormat||"yyyy"):g),barColors:k,width:jt,centerGap:tt,height:A,truncateBy:_,leftMargin:z,rightMargin:J,topMargin:K,bottomMargin:Q,axisTitles:[w,M],tooltip:Dt,onSeriesMouseOver:$,barPadding:Z,refValues:it,maxValue:Math.max(re(a,"leftBar",B,n).max,re(a,"rightBar",B,n).max),minValue:Math.min(re(a,"leftBar",B,n).min,re(a,"rightBar",B,n).min),minValueLeftBar:re(a,"leftBar",B,n).min,minValueRightBar:re(a,"rightBar",B,n).min,showValues:et,onSeriesMouseClick:Lt,showTicks:st,suffix:Pt,prefix:Xt,resetSelectionOnDoubleClick:Ut,detailsOnClick:yt,styles:d,classNames:l,noOfTicks:at,animate:Mt===!0?{duration:.5,once:!0,amount:.5}:Mt||{duration:0,once:!0,amount:0},precision:rt,customLayers:lt,naLabel:ct}):null,t[52]=Mt,t[53]=k,t[54]=Z,t[55]=Q,t[56]=tt,t[57]=l,t[58]=lt,t[59]=a,t[60]=yt,t[61]=ut,t[62]=R,t[63]=w,t[64]=z,t[65]=n,t[66]=B,t[67]=ct,t[68]=at,t[69]=Lt,t[70]=$,t[71]=rt,t[72]=Xt,t[73]=it,t[74]=Ut,t[75]=M,t[76]=J,t[77]=st,t[78]=et,t[79]=d,t[80]=Pt,t[81]=A,t[82]=jt,t[83]=o.dateFormat,t[84]=o.enabled,t[85]=Dt,t[86]=K,t[87]=_,t[88]=c,t[89]=ne):ne=t[89];let oe;t[90]!==se||t[91]!==ne?(oe=i.jsxRuntimeExports.jsxs(Ee.GraphArea,{ref:$t,children:[se,ne]}),t[90]=se,t[91]=ne,t[92]=oe):oe=t[92];let ae;t[93]!==l?.footnote||t[94]!==l?.source||t[95]!==xt||t[96]!==v||t[97]!==d?.footnote||t[98]!==d?.source||t[99]!==h?(ae=v||xt?i.jsxRuntimeExports.jsx(Ve.GraphFooter,{styles:{footnote:d?.footnote,source:d?.source},classNames:{footnote:l?.footnote,source:l?.source},sources:v,footNote:xt,width:h}):null,t[93]=l?.footnote,t[94]=l?.source,t[95]=xt,t[96]=v,t[97]=d?.footnote,t[98]=d?.source,t[99]=h,t[100]=ae):ae=t[100];let ue;return t[101]!==U||t[102]!==W||t[103]!==Bt||t[104]!==j||t[105]!==nt||t[106]!==Yt||t[107]!==Rt||t[108]!==Et||t[109]!==xe||t[110]!==me||t[111]!==te||t[112]!==ee||t[113]!==ie||t[114]!==oe||t[115]!==ae||t[116]!==ot||t[117]!==h?(ue=i.jsxRuntimeExports.jsxs(Ee.GraphContainer,{className:xe,style:me,id:Bt,ref:_t,"aria-label":U,backgroundColor:W,theme:ot,language:nt,minHeight:Yt,width:h,height:j,relativeHeight:Et,padding:Rt,children:[te,ee,ie,oe,ae]}),t[101]=U,t[102]=W,t[103]=Bt,t[104]=j,t[105]=nt,t[106]=Yt,t[107]=Rt,t[108]=Et,t[109]=xe,t[110]=me,t[111]=te,t[112]=ee,t[113]=ie,t[114]=oe,t[115]=ae,t[116]=ot,t[117]=h,t[118]=ue):ue=t[118],ue}function ze(s){return s!==void 0}function Je(s){return s!==void 0}function Ke(s){return s.data}function Qe(s){return s!==void 0}function Ze(s){return s.data}function _e(s,t){return s-t}function ti(s){return s.date}exports.ButterflyChart=We;
|
|
2
2
|
//# sourceMappingURL=ButterflyChart.cjs.map
|
package/dist/ButterflyChart.js
CHANGED
|
@@ -19,8 +19,8 @@ import { GraphFooter as Se } from "./GraphFooter.js";
|
|
|
19
19
|
import { GraphHeader as Fe } from "./GraphHeader.js";
|
|
20
20
|
import { ColorLegend as Ie } from "./ColorLegend.js";
|
|
21
21
|
import { Colors as Be } from "./Colors.js";
|
|
22
|
-
import { E as Ge } from "./EmptyState-
|
|
23
|
-
import { P as Re, e as Pe } from "./index-
|
|
22
|
+
import { E as Ge } from "./EmptyState-Pj-emXt5.js";
|
|
23
|
+
import { P as Re, e as Pe } from "./index-B-4y_iGB.js";
|
|
24
24
|
import { c as xe } from "./checkIfNullOrUndefined-DmfiKkNw.js";
|
|
25
25
|
import { c as Ee } from "./ensureCompleteData-CDIukSG6.js";
|
|
26
26
|
import { a as Xe, G as He } from "./GraphContainer-CF6ws3pd.js";
|
package/dist/ChoroplethMap.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-CHPV5EwG-6v2a2njQ.cjs"),c=require("react"),yt=require("./getSliderMarks-CIuSoedo.cjs"),Ct=require("./Spinner-jTMOLuw_.cjs"),vt=require("./parse-xYI9yrvL.cjs"),Dt=require("./index-DQA8q5sC.cjs"),F=require("./index-DLFt97gy.cjs"),jt=require("./Typography-sa1UE0oF.cjs"),St=require("./index-C5K--w8d.cjs"),Nt=require("./numberFormattingFunction-02t-wJta.cjs"),Mt=require("./Tooltip-BLa2EfMs.cjs"),Ot=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),gt=require("./index-C6er0ety.cjs"),qt=require("./DetailsModal-DHttOA80.cjs"),It=require("./ordinal-CrsysVE-.cjs"),Pt=require("./threshold-DNsSUf8Q.cjs"),xt=require("./select-Bnfk0lJx.cjs"),Qe=require("./proxy-C4-uo6nS.cjs"),zt=require("./use-in-view-C3o_ntMv.cjs"),At=require("./index-CoobIWNj.cjs"),Bt=require("./GraphFooter.cjs"),Ft=require("./GraphHeader.cjs"),et=require("./Colors.cjs"),Lt=require("./fetchAndParseData-QTF6tjij.cjs"),Tt=require("./getUniqValue-NX8DgwND.cjs"),Wt=require("./getJenks-BzJvhy_H.cjs"),bt=require("./GraphContainer-B1EDxJ0S.cjs");function _t(d){const{data:e,colorDomain:r,colors:a,mapData:L,colorLegendTitle:E,categorical:T,height:f,width:h,scale:x,centerPoint:W,tooltip:Z,mapBorderWidth:Q,mapBorderColor:xe,mapNoDataColor:ge,onSeriesMouseOver:ee,showColorScale:fe,zoomScaleExtend:Oe,zoomTranslateExtend:qe,highlightedIds:b,onSeriesMouseClick:te,mapProperty:g,resetSelectionOnDoubleClick:ye,detailsOnClick:H,styles:Ie,classNames:oe,mapProjection:D,zoomInteraction:S,animate:k,dimmedOpacity:N,customLayers:re,collapseColorScaleByDefault:ve,zoomAndCenterByHighlightedIds:je,projectionRotate:_,rewindCoordinatesInMapData:be}=d,y=c.useMemo(()=>be?F.index_default(L,{reverse:!0}):L,[L,be]),[w,M]=c.useState(void 0),V=c.useRef(null),[Pe,ne]=c.useState(ve===void 0?!(h<680):!ve),[u,p]=c.useState(void 0),[U,ae]=c.useState(void 0),[Ee,se]=c.useState(void 0),[X,$]=c.useState(void 0),O=c.useRef(null),Y=zt.useInView(O,{once:k.once,amount:k.amount}),ke=c.useRef(null),ze=T?It.ordinal().domain(r).range(a):Pt.threshold().domain(r).range(a);c.useEffect(()=>{const o=xt.select(ke.current),n=xt.select(O.current),j=i=>{if(S==="noZoom")return!1;if(S==="button")return!i.type.includes("wheel");const le=i.type==="wheel",ce=i.type.startsWith("touch"),Se=i.type==="mousedown"||i.type==="mousemove";return ce?!0:le?S==="scroll"?!0:i.ctrlKey:Se&&!i.button&&!i.ctrlKey},C=F.zoom().scaleExtent(Oe).translateExtent(qe||[[-20,-20],[h+20,f+20]]).filter(j).on("zoom",({transform:i})=>{o.attr("transform",i)});n.call(C),V.current=C},[f,h,S]);const v=F.index_default$1({...y,features:je?y.features.filter(o=>(b||[]).length===0||b.indexOf(o.properties[g])!==-1):y.features}),R=St.index_default({...y,features:je?y.features.filter(o=>(b||[]).length===0||b.indexOf(o.properties[g])!==-1):y.features}),q=v[2]-v[0],we=v[3]-v[1],Re=h*190/960*360/q,Ce=f*190/678*180/we,I=x*Math.min(Re,Ce),De=D==="mercator"?F.geoMercator().rotate(_).center(W||R.geometry.coordinates).translate([h/2,f/2]).scale(I):D==="equalEarth"?F.geoEqualEarth().rotate(_).center(W||R.geometry.coordinates).translate([h/2,f/2]).scale(I):D==="naturalEarth"?F.geoNaturalEarth1().rotate(_).center(W||R.geometry.coordinates).translate([h/2,f/2]).scale(I):D==="orthographic"?F.geoOrthographic().rotate(_).center(W||R.geometry.coordinates).translate([h/2,f/2]).scale(I):F.geoAlbersUsa().rotate(_).center(W||R.geometry.coordinates).translate([h/2,f/2]).scale(I),G=F.geoPath().projection(De),ie=o=>{if(!O.current||!V.current)return;xt.select(O.current).call(V.current.scaleBy,o==="in"?1.2:1/1.2)};return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs("div",{className:"relative",children:[t.jsxRuntimeExports.jsx(Qe.motion.svg,{width:`${h}px`,height:`${f}px`,viewBox:`0 0 ${h} ${f}`,ref:O,direction:"ltr",children:t.jsxRuntimeExports.jsxs("g",{ref:ke,children:[re.filter(o=>o.position==="before").map(o=>o.layer),y.features.map((o,n)=>{if(!o.properties?.[g])return null;const j=G(o);return j?t.jsxRuntimeExports.jsx(Qe.motion.g,{opacity:w?N:b.length!==0?b.indexOf(o.properties[g])!==-1?1:N:1,children:t.jsxRuntimeExports.jsx("path",{d:j,style:{stroke:xe,strokeWidth:Q,fill:ge}})},n):null}),t.jsxRuntimeExports.jsx(At.AnimatePresence,{children:e.map(o=>{const n=y.features.findIndex(i=>o.id===i.properties[g]);if(n===-1)return null;const j=G(y.features[n]);if(!j)return null;const C=Ot.checkIfNullOrUndefined(o.x)?ge:ze(o.x);return t.jsxRuntimeExports.jsx(Qe.motion.g,{variants:{initial:{opacity:0},whileInView:{opacity:w?w===C?1:N:b.length!==0?b.indexOf(o.id)!==-1?1:N:1,transition:{duration:k.duration}}},initial:"initial",animate:Y?"whileInView":"initial",exit:{opacity:0,transition:{duration:k.duration}},onMouseEnter:i=>{ae(o),$(i.clientY),se(i.clientX),ee?.(o)},onMouseMove:i=>{ae(o),$(i.clientY),se(i.clientX)},onMouseLeave:()=>{ae(void 0),se(void 0),$(void 0),ee?.(void 0)},onClick:()=>{(te||H)&&(Dt.isEqual(u,o)&&ye?(p(void 0),te?.(void 0)):(p(o),te?.(o)))},children:t.jsxRuntimeExports.jsx(Qe.motion.path,{d:j,variants:{initial:{fill:C,opacity:0},whileInView:{fill:C,opacity:1,transition:{duration:k.duration}}},initial:"initial",animate:Y?"whileInView":"initial",exit:{opacity:0,transition:{duration:k.duration}},style:{stroke:xe,strokeWidth:Q}},`${o.id}`)},o.id)})}),U?y.features.filter(o=>o.properties[g]===U.id).map((o,n)=>t.jsxRuntimeExports.jsx("path",{d:G(o)||"",className:"stroke-primary-gray-700 dark:stroke-primary-gray-300",style:{fill:"none",fillOpacity:0,strokeWidth:"0.5"}},n)):null,re.filter(o=>o.position==="after").map(o=>o.layer)]})}),fe===!1?null:t.jsxRuntimeExports.jsx("div",{className:t.mo("absolute left-4 bottom-4 map-color-legend",oe?.colorLegend),children:Pe?t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.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:()=>{ne(!1)},children:t.jsxRuntimeExports.jsx(gt.X,{})}),t.jsxRuntimeExports.jsxs("div",{className:"color-legend-box p-2 bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)]",style:{width:T?void 0:"340px"},children:[E&&E!==""?t.jsxRuntimeExports.jsx(jt.j,{size:"xs",marginBottom:"xs",className:"p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300",style:{display:"-webkit-box",WebkitLineClamp:"1",WebkitBoxOrient:"vertical"},children:E}):null,T?t.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-3",children:r.map((o,n)=>t.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 items-center",onMouseOver:()=>{M(a[n%a.length])},onMouseLeave:()=>{M(void 0)},children:[t.jsxRuntimeExports.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:a[n%a.length]}}),t.jsxRuntimeExports.jsx(jt.j,{size:"sm",marginBottom:"none",leading:"none",children:o})]},n))}):t.jsxRuntimeExports.jsx("svg",{width:"100%",viewBox:"0 0 320 30",direction:"ltr",children:t.jsxRuntimeExports.jsxs("g",{children:[r.map((o,n)=>t.jsxRuntimeExports.jsxs("g",{onMouseOver:()=>{M(a[n])},onMouseLeave:()=>{M(void 0)},className:"cursor-pointer",children:[t.jsxRuntimeExports.jsx("rect",{x:n*320/a.length+1,y:1,width:320/a.length-2,height:8,className:w===a[n]?"stroke-primary-gray-700 dark:stroke-primary-gray-300":"",style:{fill:a[n],...w===a[n]?{}:{stroke:a[n]}}}),t.jsxRuntimeExports.jsx("text",{x:(n+1)*320/a.length,y:25,className:"fill-primary-gray-700 dark:fill-primary-gray-300 text-xs",style:{textAnchor:"middle"},children:Nt.numberFormattingFunction(o,"NA")})]},n)),t.jsxRuntimeExports.jsx("g",{children:t.jsxRuntimeExports.jsx("rect",{onMouseOver:()=>{M(a[r.length])},onMouseLeave:()=>{M(void 0)},x:r.length*320/a.length+1,y:1,width:320/a.length-2,height:8,className:`cursor-pointer ${w===a[r.length]?"stroke-1 stroke-primary-gray-700 dark:stroke-primary-gray-300":""}`,style:{fill:a[r.length],...w===a[r.length]?{}:{stroke:a[r.length]}}})})]})})]})]}):t.jsxRuntimeExports.jsx("button",{type:"button",className:"mb-0 border-0 bg-transparent p-0 self-start map-legend-button",onClick:()=>{ne(!0)},children:t.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"})})}),S==="button"&&t.jsxRuntimeExports.jsxs("div",{className:"absolute left-4 top-4 flex flex-col zoom-buttons",children:[t.jsxRuntimeExports.jsx("button",{onClick:()=>ie("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:"+"}),t.jsxRuntimeExports.jsx("button",{onClick:()=>ie("out"),className:"leading-0 px-2 py-3.5 text-primary-gray-700 border border-t-0 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"–"})]})]}),H&&u!==void 0?t.jsxRuntimeExports.jsx(qt.DetailsModal,{body:H,data:u,setData:p,className:oe?.modal}):null,U&&Z&&Ee&&X?t.jsxRuntimeExports.jsx(Mt.Tooltip,{data:U,body:Z,xPos:Ee,yPos:X,backgroundStyle:Ie?.tooltip,className:oe?.tooltip}):null]})}function $t(d){const e=t.compilerRuntimeExports.c(126),{data:r,mapData:a,graphTitle:L,colors:E,sources:T,graphDescription:f,height:h,width:x,footNote:W,colorDomain:Z,colorLegendTitle:Q,scaleType:xe,scale:ge,centerPoint:ee,padding:fe,mapBorderWidth:Oe,mapNoDataColor:qe,backgroundColor:b,mapBorderColor:te,relativeHeight:g,tooltip:ye,onSeriesMouseOver:H,isWorldMap:Ie,showColorScale:oe,zoomScaleExtend:D,zoomTranslateExtend:S,graphID:k,highlightedIds:N,onSeriesMouseClick:re,mapProperty:ve,graphDownload:je,dataDownload:_,showAntarctica:be,language:y,minHeight:w,theme:M,ariaLabel:V,resetSelectionOnDoubleClick:Pe,detailsOnClick:ne,styles:u,classNames:p,mapProjection:U,zoomInteraction:ae,animate:Ee,dimmedOpacity:se,customLayers:X,timeline:$,collapseColorScaleByDefault:O,projectionRotate:Y,zoomAndCenterByHighlightedIds:ke,rewindCoordinatesInMapData:ze}=d,v=a===void 0?"https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-v2.json":a,R=W===void 0?"The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.":W,q=xe===void 0?"threshold":xe,we=ge===void 0?.95:ge,Re=Oe===void 0?.5:Oe,Ce=qe===void 0?et.Colors.light.graphNoData:qe,I=b===void 0?!1:b,De=te===void 0?et.Colors.light.grays["gray-500"]:te,G=Ie===void 0?!0:Ie,ie=oe===void 0?!0:oe;let o;e[0]!==D?(o=D===void 0?[.8,6]:D,e[0]=D,e[1]=o):o=e[1];const n=o;let j;e[2]!==N?(j=N===void 0?[]:N,e[2]=N,e[3]=j):j=e[3];const C=j,i=ve===void 0?"ISO3":ve,le=je===void 0?!1:je,ce=_===void 0?!1:_,Se=be===void 0?!1:be,tt=y===void 0?"en":y,P=w===void 0?0:w,J=M===void 0?"light":M,ot=Pe===void 0?!0:Pe,rt=U===void 0?"naturalEarth":U,nt=ae===void 0?"button":ae,Ae=Ee===void 0?!1:Ee,at=se===void 0?.3:se;let Be;e[4]!==X?(Be=X===void 0?[]:X,e[4]=X,e[5]=Be):Be=e[5];const st=Be;let Fe;e[6]!==$?(Fe=$===void 0?{enabled:!1,autoplay:!1,showOnlyActiveDate:!0}:$,e[6]=$,e[7]=Fe):Fe=e[7];const s=Fe;let Le;e[8]!==Y?(Le=Y===void 0?[0,0]:Y,e[8]=Y,e[9]=Le):Le=e[9];const it=Le,lt=ke===void 0?!1:ke,ct=ze===void 0?!0:ze,[K,Et]=c.useState(0),[Ne,kt]=c.useState(0),[z,wt]=c.useState(s.autoplay);let Me;if(e[10]!==r||e[11]!==s.dateFormat){let m;e[13]!==s.dateFormat?(m=B=>vt.parse(`${B.date}`,s.dateFormat||"yyyy",new Date).getTime(),e[13]=s.dateFormat,e[14]=m):m=e[14],Me=[...new Set(r.filter(Zt).map(m))],Me.sort(Kt),e[10]=r,e[11]=s.dateFormat,e[12]=Me}else Me=e[12];const l=Me,[A,dt]=c.useState(s.autoplay?0:l.length-1),[de,Rt]=c.useState(void 0),ut=c.useRef(null),ft=c.useRef(null);let Te,We;e[15]===Symbol.for("react.memo_cache_sentinel")?(Te=()=>{const m=new ResizeObserver(B=>{Et(B[0].target.clientWidth||620),kt(B[0].target.clientHeight||480)});return ut.current&&m.observe(ut.current),()=>m.disconnect()},We=[],e[15]=Te,e[16]=We):(Te=e[15],We=e[16]),c.useEffect(Te,We);let _e;e[17]===Symbol.for("react.memo_cache_sentinel")?(_e=m=>{Rt(m)},e[17]=_e):_e=e[17];const $e=c.useEffectEvent(_e);let Ge;e[18]!==v||e[19]!==$e?(Ge=()=>{typeof v=="string"?Lt.fetchAndParseJSON(v).then(B=>{$e(B)}):$e(v)},e[18]=v,e[19]=$e,e[20]=Ge):Ge=e[20];let He;e[21]!==v?(He=[v],e[21]=v,e[22]=He):He=e[22],c.useEffect(Ge,He);let Ve;e[23]!==Z||e[24]!==E?.length||e[25]!==r||e[26]!==q?(Ve=Z||(q==="categorical"?Tt.getUniqValue(r,"x"):Wt.getJenks(r.map(Jt),E?.length||4)),e[23]=Z,e[24]=E?.length,e[25]=r,e[26]=q,e[27]=Ve):Ve=e[27];const Ue=Ve;let Xe,Ye;e[28]!==z||e[29]!==s.speed||e[30]!==l?(Xe=()=>{const m=setInterval(()=>{dt(B=>B<l.length-1?B+1:0)},(s.speed||2)*1e3);return z||clearInterval(m),()=>clearInterval(m)},Ye=[l,z,s.speed],e[28]=z,e[29]=s.speed,e[30]=l,e[31]=Xe,e[32]=Ye):(Xe=e[31],Ye=e[32]),c.useEffect(Xe,Ye);const pt=s.dateFormat||"yyyy";let Je;e[33]!==A||e[34]!==pt||e[35]!==s.showOnlyActiveDate||e[36]!==l?(Je=yt.getSliderMarks(l,A,s.showOnlyActiveDate,pt),e[33]=A,e[34]=pt,e[35]=s.showOnlyActiveDate,e[36]=l,e[37]=Je):Je=e[37];const Ke=Je,mt=p?.graphContainer,ht=u?.graphContainer;let ue;e[38]!==p?.description||e[39]!==p?.title||e[40]!==r||e[41]!==ce||e[42]!==f||e[43]!==le||e[44]!==L||e[45]!==u?.description||e[46]!==u?.title||e[47]!==x?(ue=L||f||le||ce?t.jsxRuntimeExports.jsx(Ft.GraphHeader,{styles:{title:u?.title,description:u?.description},classNames:{title:p?.title,description:p?.description},graphTitle:L,graphDescription:f,width:x,graphDownload:le?ft:void 0,dataDownload:ce?r.map(Yt).filter(Xt).length>0?r.map(Ut).filter(Vt):r.filter(Ht):null}):null,e[38]=p?.description,e[39]=p?.title,e[40]=r,e[41]=ce,e[42]=f,e[43]=le,e[44]=L,e[45]=u?.description,e[46]=u?.title,e[47]=x,e[48]=ue):ue=e[48];let pe;e[49]!==A||e[50]!==Ke||e[51]!==z||e[52]!==s.enabled||e[53]!==l?(pe=s.enabled&&l.length>0&&Ke?t.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[t.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{wt(!z)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":z?"Click to pause animation":"Click to play animation",children:z?t.jsxRuntimeExports.jsx(gt.Pause,{}):t.jsxRuntimeExports.jsx(gt.Play,{})}),t.jsxRuntimeExports.jsx(yt.Nr,{min:l[0],max:l[l.length-1],marks:Ke,step:null,defaultValue:l[l.length-1],value:l[A],onChangeComplete:m=>{dt(l.indexOf(m))},onChange:m=>{dt(l.indexOf(m))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,e[49]=A,e[50]=Ke,e[51]=z,e[52]=s.enabled,e[53]=l,e[54]=pe):pe=e[54];let me;e[55]!==Ae||e[56]!==ee||e[57]!==p||e[58]!==O||e[59]!==Q||e[60]!==E||e[61]!==st||e[62]!==r||e[63]!==ne||e[64]!==at||e[65]!==Ue||e[66]!==h||e[67]!==C||e[68]!==A||e[69]!==G||e[70]!==De||e[71]!==Re||e[72]!==Ce||e[73]!==rt||e[74]!==i||e[75]!==de||e[76]!==P||e[77]!==re||e[78]!==H||e[79]!==it||e[80]!==g||e[81]!==ot||e[82]!==ct||e[83]!==we||e[84]!==q||e[85]!==Se||e[86]!==ie||e[87]!==u||e[88]!==Ne||e[89]!==K||e[90]!==J||e[91]!==s.dateFormat||e[92]!==s.enabled||e[93]!==ye||e[94]!==l||e[95]!==x||e[96]!==lt||e[97]!==nt||e[98]!==n||e[99]!==S?(me=t.jsxRuntimeExports.jsx(bt.GraphArea,{ref:ut,children:K&&Ne&&de?t.jsxRuntimeExports.jsx(_t,{data:r.filter(m=>s.enabled?m.date===vt.format(new Date(l[A]),s.dateFormat||"yyyy"):m),mapData:Se?de:{...de,features:de.features.filter(Gt)},colorDomain:Ue,width:K,height:Ne,scale:we,centerPoint:ee,colors:E||(q==="categorical"?et.Colors[J].categoricalColors.colors:et.Colors[J].sequentialColors[`neutralColorsx0${Ue.length+1}`]),colorLegendTitle:Q,mapBorderWidth:Re,mapNoDataColor:Ce,categorical:q==="categorical",mapBorderColor:De,tooltip:ye,onSeriesMouseOver:H,isWorldMap:G,showColorScale:ie,zoomScaleExtend:n,zoomTranslateExtend:S,onSeriesMouseClick:re,mapProperty:i,highlightedIds:C,resetSelectionOnDoubleClick:ot,styles:u,classNames:p,detailsOnClick:ne,mapProjection:rt||(G?"naturalEarth":"mercator"),zoomInteraction:nt,dimmedOpacity:at,animate:Ae===!0?{duration:.5,once:!0,amount:.5}:Ae||{duration:0,once:!0,amount:0},customLayers:st,zoomAndCenterByHighlightedIds:lt,collapseColorScaleByDefault:O,projectionRotate:it,rewindCoordinatesInMapData:ct}):t.jsxRuntimeExports.jsx("div",{style:{height:`${Math.max(P,h||(g?P?(x||K)*g>P?(x||K)*g:P:(x||K)*g:Ne))}px`},className:"flex items-center justify-center",children:t.jsxRuntimeExports.jsx(Ct.w,{"aria-label":"Loading graph"})})}),e[55]=Ae,e[56]=ee,e[57]=p,e[58]=O,e[59]=Q,e[60]=E,e[61]=st,e[62]=r,e[63]=ne,e[64]=at,e[65]=Ue,e[66]=h,e[67]=C,e[68]=A,e[69]=G,e[70]=De,e[71]=Re,e[72]=Ce,e[73]=rt,e[74]=i,e[75]=de,e[76]=P,e[77]=re,e[78]=H,e[79]=it,e[80]=g,e[81]=ot,e[82]=ct,e[83]=we,e[84]=q,e[85]=Se,e[86]=ie,e[87]=u,e[88]=Ne,e[89]=K,e[90]=J,e[91]=s.dateFormat,e[92]=s.enabled,e[93]=ye,e[94]=l,e[95]=x,e[96]=lt,e[97]=nt,e[98]=n,e[99]=S,e[100]=me):me=e[100];let he;e[101]!==p?.footnote||e[102]!==p?.source||e[103]!==R||e[104]!==T||e[105]!==u?.footnote||e[106]!==u?.source||e[107]!==x?(he=T||R?t.jsxRuntimeExports.jsx(Bt.GraphFooter,{styles:{footnote:u?.footnote,source:u?.source},classNames:{footnote:p?.footnote,source:p?.source},sources:T,footNote:R,width:x}):null,e[101]=p?.footnote,e[102]=p?.source,e[103]=R,e[104]=T,e[105]=u?.footnote,e[106]=u?.source,e[107]=x,e[108]=he):he=e[108];let Ze;return e[109]!==V||e[110]!==I||e[111]!==k||e[112]!==h||e[113]!==tt||e[114]!==P||e[115]!==fe||e[116]!==g||e[117]!==mt||e[118]!==ht||e[119]!==ue||e[120]!==pe||e[121]!==me||e[122]!==he||e[123]!==J||e[124]!==x?(Ze=t.jsxRuntimeExports.jsxs(bt.GraphContainer,{className:mt,style:ht,id:k,ref:ft,"aria-label":V,backgroundColor:I,theme:J,language:tt,minHeight:P,width:x,height:h,relativeHeight:g,padding:fe,children:[ue,pe,me,he]}),e[109]=V,e[110]=I,e[111]=k,e[112]=h,e[113]=tt,e[114]=P,e[115]=fe,e[116]=g,e[117]=mt,e[118]=ht,e[119]=ue,e[120]=pe,e[121]=me,e[122]=he,e[123]=J,e[124]=x,e[125]=Ze):Ze=e[125],Ze}function Gt(d){return d.properties.NAME!=="Antarctica"}function Ht(d){return d!==void 0}function Vt(d){return d!==void 0}function Ut(d){return d.data}function Xt(d){return d!==void 0}function Yt(d){return d.data}function Jt(d){return d.x}function Kt(d,e){return d-e}function Zt(d){return d.date}exports.ChoroplethMap=$t;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-CHPV5EwG-6v2a2njQ.cjs"),c=require("react"),yt=require("./getSliderMarks-CIuSoedo.cjs"),Ct=require("./Spinner-jTMOLuw_.cjs"),vt=require("./parse-xYI9yrvL.cjs"),Dt=require("./index-DQA8q5sC.cjs"),F=require("./index-DLFt97gy.cjs"),jt=require("./Typography-DrJ7IOdw.cjs"),St=require("./index-C5K--w8d.cjs"),Nt=require("./numberFormattingFunction-02t-wJta.cjs"),Mt=require("./Tooltip-BLa2EfMs.cjs"),Ot=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),gt=require("./index-sbKVyHS2.cjs"),qt=require("./DetailsModal-DHttOA80.cjs"),It=require("./ordinal-CrsysVE-.cjs"),Pt=require("./threshold-DNsSUf8Q.cjs"),xt=require("./select-Bnfk0lJx.cjs"),Qe=require("./proxy-C4-uo6nS.cjs"),zt=require("./use-in-view-C3o_ntMv.cjs"),At=require("./index-CoobIWNj.cjs"),Bt=require("./GraphFooter.cjs"),Ft=require("./GraphHeader.cjs"),et=require("./Colors.cjs"),_t=require("./fetchAndParseData-QTF6tjij.cjs"),Lt=require("./getUniqValue-NX8DgwND.cjs"),Tt=require("./getJenks-BzJvhy_H.cjs"),bt=require("./GraphContainer-B1EDxJ0S.cjs");function Wt(d){const{data:e,colorDomain:r,colors:n,mapData:_,colorLegendTitle:E,categorical:L,height:f,width:h,scale:x,centerPoint:T,tooltip:Z,mapBorderWidth:Q,mapBorderColor:xe,mapNoDataColor:ge,onSeriesMouseOver:ee,showColorScale:fe,zoomScaleExtend:Oe,zoomTranslateExtend:qe,highlightedIds:b,onSeriesMouseClick:te,mapProperty:g,resetSelectionOnDoubleClick:ye,detailsOnClick:H,styles:Ie,classNames:oe,mapProjection:D,zoomInteraction:S,animate:k,dimmedOpacity:N,customLayers:re,collapseColorScaleByDefault:ve,zoomAndCenterByHighlightedIds:je,projectionRotate:W,rewindCoordinatesInMapData:be}=d,y=c.useMemo(()=>be?F.index_default(_,{reverse:!0}):_,[_,be]),[w,M]=c.useState(void 0),V=c.useRef(null),[Pe,ae]=c.useState(ve===void 0?!(h<680):!ve),[u,p]=c.useState(void 0),[U,ne]=c.useState(void 0),[Ee,se]=c.useState(void 0),[X,$]=c.useState(void 0),O=c.useRef(null),Y=zt.useInView(O,{once:k.once,amount:k.amount}),ke=c.useRef(null),ze=L?It.ordinal().domain(r).range(n):Pt.threshold().domain(r).range(n);c.useEffect(()=>{const o=xt.select(ke.current),a=xt.select(O.current),j=i=>{if(S==="noZoom")return!1;if(S==="button")return!i.type.includes("wheel");const le=i.type==="wheel",ce=i.type.startsWith("touch"),Se=i.type==="mousedown"||i.type==="mousemove";return ce?!0:le?S==="scroll"?!0:i.ctrlKey:Se&&!i.button&&!i.ctrlKey},C=F.zoom().scaleExtent(Oe).translateExtent(qe||[[-20,-20],[h+20,f+20]]).filter(j).on("zoom",({transform:i})=>{o.attr("transform",i)});a.call(C),V.current=C},[f,h,S]);const v=F.index_default$1({...y,features:je?y.features.filter(o=>(b||[]).length===0||b.indexOf(o.properties[g])!==-1):y.features}),R=St.index_default({...y,features:je?y.features.filter(o=>(b||[]).length===0||b.indexOf(o.properties[g])!==-1):y.features}),q=(v[2]-v[0])*1.15,we=(v[3]-v[1])*1.15,Re=h*190/960*360/q,Ce=f*190/678*180/we,I=x*Math.min(Re,Ce),De=D==="mercator"?F.geoMercator().rotate(W).center(T||R.geometry.coordinates).translate([h/2,f/2]).scale(I):D==="equalEarth"?F.geoEqualEarth().rotate(W).center(T||R.geometry.coordinates).translate([h/2,f/2]).scale(I):D==="naturalEarth"?F.geoNaturalEarth1().rotate(W).center(T||R.geometry.coordinates).translate([h/2,f/2]).scale(I):D==="orthographic"?F.geoOrthographic().rotate(W).center(T||R.geometry.coordinates).translate([h/2,f/2]).scale(I):F.geoAlbersUsa().rotate(W).center(T||R.geometry.coordinates).translate([h/2,f/2]).scale(I),G=F.geoPath().projection(De),ie=o=>{if(!O.current||!V.current)return;xt.select(O.current).call(V.current.scaleBy,o==="in"?1.2:1/1.2)};return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs("div",{className:"relative",children:[t.jsxRuntimeExports.jsx(Qe.motion.svg,{width:`${h}px`,height:`${f}px`,viewBox:`0 0 ${h} ${f}`,ref:O,direction:"ltr",children:t.jsxRuntimeExports.jsxs("g",{ref:ke,children:[re.filter(o=>o.position==="before").map(o=>o.layer),y.features.map((o,a)=>{if(!o.properties?.[g])return null;const j=G(o);return j?t.jsxRuntimeExports.jsx(Qe.motion.g,{opacity:w?N:b.length!==0?b.indexOf(o.properties[g])!==-1?1:N:1,children:t.jsxRuntimeExports.jsx("path",{d:j,style:{stroke:xe,strokeWidth:Q,fill:ge}})},a):null}),t.jsxRuntimeExports.jsx(At.AnimatePresence,{children:e.map(o=>{const a=y.features.findIndex(i=>o.id===i.properties[g]);if(a===-1)return null;const j=G(y.features[a]);if(!j)return null;const C=Ot.checkIfNullOrUndefined(o.x)?ge:ze(o.x);return t.jsxRuntimeExports.jsx(Qe.motion.g,{className:"undp-map-shapes",variants:{initial:{opacity:0},whileInView:{opacity:w?w===C?1:N:b.length!==0?b.indexOf(o.id)!==-1?1:N:1,transition:{duration:k.duration}}},initial:"initial",animate:Y?"whileInView":"initial",exit:{opacity:0,transition:{duration:k.duration}},onMouseEnter:i=>{ne(o),$(i.clientY),se(i.clientX),ee?.(o)},onMouseMove:i=>{ne(o),$(i.clientY),se(i.clientX)},onMouseLeave:()=>{ne(void 0),se(void 0),$(void 0),ee?.(void 0)},onClick:()=>{(te||H)&&(Dt.isEqual(u,o)&&ye?(p(void 0),te?.(void 0)):(p(o),te?.(o)))},children:t.jsxRuntimeExports.jsx(Qe.motion.path,{d:j,variants:{initial:{fill:C,opacity:0},whileInView:{fill:C,opacity:1,transition:{duration:k.duration}}},initial:"initial",animate:Y?"whileInView":"initial",exit:{opacity:0,transition:{duration:k.duration}},style:{stroke:xe,strokeWidth:Q}},`${o.id}`)},o.id)})}),U?y.features.filter(o=>o.properties[g]===U.id).map((o,a)=>t.jsxRuntimeExports.jsx("path",{d:G(o)||"",className:"stroke-primary-gray-700 dark:stroke-primary-gray-300",style:{fill:"none",fillOpacity:0,strokeWidth:"0.5"}},a)):null,re.filter(o=>o.position==="after").map(o=>o.layer)]})}),fe===!1?null:t.jsxRuntimeExports.jsx("div",{className:t.mo("absolute left-4 bottom-4 map-color-legend",oe?.colorLegend),children:Pe?t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.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:()=>{ae(!1)},children:t.jsxRuntimeExports.jsx(gt.X,{})}),t.jsxRuntimeExports.jsxs("div",{className:"color-legend-box p-2 bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)]",style:{width:L?void 0:"340px"},children:[E&&E!==""?t.jsxRuntimeExports.jsx(jt._,{size:"xs",marginBottom:"xs",className:"p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300",style:{display:"-webkit-box",WebkitLineClamp:"1",WebkitBoxOrient:"vertical"},children:E}):null,L?t.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-3",children:r.map((o,a)=>t.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 items-center",onMouseOver:()=>{M(n[a%n.length])},onMouseLeave:()=>{M(void 0)},children:[t.jsxRuntimeExports.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:n[a%n.length]}}),t.jsxRuntimeExports.jsx(jt._,{size:"sm",marginBottom:"none",leading:"none",children:o})]},a))}):t.jsxRuntimeExports.jsx("svg",{width:"100%",viewBox:"0 0 320 30",direction:"ltr",children:t.jsxRuntimeExports.jsxs("g",{children:[r.map((o,a)=>t.jsxRuntimeExports.jsxs("g",{onMouseOver:()=>{M(n[a])},onMouseLeave:()=>{M(void 0)},className:"cursor-pointer",children:[t.jsxRuntimeExports.jsx("rect",{x:a*320/n.length+1,y:1,width:320/n.length-2,height:8,className:w===n[a]?"stroke-primary-gray-700 dark:stroke-primary-gray-300":"",style:{fill:n[a],...w===n[a]?{}:{stroke:n[a]}}}),t.jsxRuntimeExports.jsx("text",{x:(a+1)*320/n.length,y:25,className:"fill-primary-gray-700 dark:fill-primary-gray-300 text-xs",style:{textAnchor:"middle"},children:Nt.numberFormattingFunction(o,"NA")})]},a)),t.jsxRuntimeExports.jsx("g",{children:t.jsxRuntimeExports.jsx("rect",{onMouseOver:()=>{M(n[r.length])},onMouseLeave:()=>{M(void 0)},x:r.length*320/n.length+1,y:1,width:320/n.length-2,height:8,className:`cursor-pointer ${w===n[r.length]?"stroke-1 stroke-primary-gray-700 dark:stroke-primary-gray-300":""}`,style:{fill:n[r.length],...w===n[r.length]?{}:{stroke:n[r.length]}}})})]})})]})]}):t.jsxRuntimeExports.jsx("button",{type:"button",className:"mb-0 border-0 bg-transparent p-0 self-start map-legend-button",onClick:()=>{ae(!0)},children:t.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"})})}),S==="button"&&t.jsxRuntimeExports.jsxs("div",{className:"absolute left-4 top-4 flex flex-col zoom-buttons",children:[t.jsxRuntimeExports.jsx("button",{onClick:()=>ie("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:"+"}),t.jsxRuntimeExports.jsx("button",{onClick:()=>ie("out"),className:"leading-0 px-2 py-3.5 text-primary-gray-700 border border-t-0 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"–"})]})]}),H&&u!==void 0?t.jsxRuntimeExports.jsx(qt.DetailsModal,{body:H,data:u,setData:p,className:oe?.modal}):null,U&&Z&&Ee&&X?t.jsxRuntimeExports.jsx(Mt.Tooltip,{data:U,body:Z,xPos:Ee,yPos:X,backgroundStyle:Ie?.tooltip,className:oe?.tooltip}):null]})}function $t(d){const e=t.compilerRuntimeExports.c(126),{data:r,mapData:n,graphTitle:_,colors:E,sources:L,graphDescription:f,height:h,width:x,footNote:T,colorDomain:Z,colorLegendTitle:Q,scaleType:xe,scale:ge,centerPoint:ee,padding:fe,mapBorderWidth:Oe,mapNoDataColor:qe,backgroundColor:b,mapBorderColor:te,relativeHeight:g,tooltip:ye,onSeriesMouseOver:H,isWorldMap:Ie,showColorScale:oe,zoomScaleExtend:D,zoomTranslateExtend:S,graphID:k,highlightedIds:N,onSeriesMouseClick:re,mapProperty:ve,graphDownload:je,dataDownload:W,showAntarctica:be,language:y,minHeight:w,theme:M,ariaLabel:V,resetSelectionOnDoubleClick:Pe,detailsOnClick:ae,styles:u,classNames:p,mapProjection:U,zoomInteraction:ne,animate:Ee,dimmedOpacity:se,customLayers:X,timeline:$,collapseColorScaleByDefault:O,projectionRotate:Y,zoomAndCenterByHighlightedIds:ke,rewindCoordinatesInMapData:ze}=d,v=n===void 0?"https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-v2.json":n,R=T===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.":T,q=xe===void 0?"threshold":xe,we=ge===void 0?.95:ge,Re=Oe===void 0?.5:Oe,Ce=qe===void 0?et.Colors.light.graphNoData:qe,I=b===void 0?!1:b,De=te===void 0?et.Colors.light.grays["gray-500"]:te,G=Ie===void 0?!0:Ie,ie=oe===void 0?!0:oe;let o;e[0]!==D?(o=D===void 0?[.8,6]:D,e[0]=D,e[1]=o):o=e[1];const a=o;let j;e[2]!==N?(j=N===void 0?[]:N,e[2]=N,e[3]=j):j=e[3];const C=j,i=ve===void 0?"ISO3":ve,le=je===void 0?!1:je,ce=W===void 0?!1:W,Se=be===void 0?!1:be,tt=y===void 0?"en":y,P=w===void 0?0:w,J=M===void 0?"light":M,ot=Pe===void 0?!0:Pe,rt=U===void 0?"naturalEarth":U,at=ne===void 0?"button":ne,Ae=Ee===void 0?!1:Ee,nt=se===void 0?.3:se;let Be;e[4]!==X?(Be=X===void 0?[]:X,e[4]=X,e[5]=Be):Be=e[5];const st=Be;let Fe;e[6]!==$?(Fe=$===void 0?{enabled:!1,autoplay:!1,showOnlyActiveDate:!0}:$,e[6]=$,e[7]=Fe):Fe=e[7];const s=Fe;let _e;e[8]!==Y?(_e=Y===void 0?[0,0]:Y,e[8]=Y,e[9]=_e):_e=e[9];const it=_e,lt=ke===void 0?!1:ke,ct=ze===void 0?!0:ze,[K,Et]=c.useState(0),[Ne,kt]=c.useState(0),[z,wt]=c.useState(s.autoplay);let Me;if(e[10]!==r||e[11]!==s.dateFormat){let m;e[13]!==s.dateFormat?(m=B=>vt.parse(`${B.date}`,s.dateFormat||"yyyy",new Date).getTime(),e[13]=s.dateFormat,e[14]=m):m=e[14],Me=[...new Set(r.filter(Zt).map(m))],Me.sort(Kt),e[10]=r,e[11]=s.dateFormat,e[12]=Me}else Me=e[12];const l=Me,[A,dt]=c.useState(s.autoplay?0:l.length-1),[de,Rt]=c.useState(void 0),ut=c.useRef(null),ft=c.useRef(null);let Le,Te;e[15]===Symbol.for("react.memo_cache_sentinel")?(Le=()=>{const m=new ResizeObserver(B=>{Et(B[0].target.clientWidth||620),kt(B[0].target.clientHeight||480)});return ut.current&&m.observe(ut.current),()=>m.disconnect()},Te=[],e[15]=Le,e[16]=Te):(Le=e[15],Te=e[16]),c.useEffect(Le,Te);let We;e[17]===Symbol.for("react.memo_cache_sentinel")?(We=m=>{Rt(m)},e[17]=We):We=e[17];const $e=c.useEffectEvent(We);let Ge;e[18]!==v||e[19]!==$e?(Ge=()=>{typeof v=="string"?_t.fetchAndParseJSON(v).then(B=>{$e(B)}):$e(v)},e[18]=v,e[19]=$e,e[20]=Ge):Ge=e[20];let He;e[21]!==v?(He=[v],e[21]=v,e[22]=He):He=e[22],c.useEffect(Ge,He);let Ve;e[23]!==Z||e[24]!==E?.length||e[25]!==r||e[26]!==q?(Ve=Z||(q==="categorical"?Lt.getUniqValue(r,"x"):Tt.getJenks(r.map(Jt),E?.length||4)),e[23]=Z,e[24]=E?.length,e[25]=r,e[26]=q,e[27]=Ve):Ve=e[27];const Ue=Ve;let Xe,Ye;e[28]!==z||e[29]!==s.speed||e[30]!==l?(Xe=()=>{const m=setInterval(()=>{dt(B=>B<l.length-1?B+1:0)},(s.speed||2)*1e3);return z||clearInterval(m),()=>clearInterval(m)},Ye=[l,z,s.speed],e[28]=z,e[29]=s.speed,e[30]=l,e[31]=Xe,e[32]=Ye):(Xe=e[31],Ye=e[32]),c.useEffect(Xe,Ye);const pt=s.dateFormat||"yyyy";let Je;e[33]!==A||e[34]!==pt||e[35]!==s.showOnlyActiveDate||e[36]!==l?(Je=yt.getSliderMarks(l,A,s.showOnlyActiveDate,pt),e[33]=A,e[34]=pt,e[35]=s.showOnlyActiveDate,e[36]=l,e[37]=Je):Je=e[37];const Ke=Je,mt=p?.graphContainer,ht=u?.graphContainer;let ue;e[38]!==p?.description||e[39]!==p?.title||e[40]!==r||e[41]!==ce||e[42]!==f||e[43]!==le||e[44]!==_||e[45]!==u?.description||e[46]!==u?.title||e[47]!==x?(ue=_||f||le||ce?t.jsxRuntimeExports.jsx(Ft.GraphHeader,{styles:{title:u?.title,description:u?.description},classNames:{title:p?.title,description:p?.description},graphTitle:_,graphDescription:f,width:x,graphDownload:le?ft:void 0,dataDownload:ce?r.map(Yt).filter(Xt).length>0?r.map(Ut).filter(Vt):r.filter(Ht):null}):null,e[38]=p?.description,e[39]=p?.title,e[40]=r,e[41]=ce,e[42]=f,e[43]=le,e[44]=_,e[45]=u?.description,e[46]=u?.title,e[47]=x,e[48]=ue):ue=e[48];let pe;e[49]!==A||e[50]!==Ke||e[51]!==z||e[52]!==s.enabled||e[53]!==l?(pe=s.enabled&&l.length>0&&Ke?t.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[t.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{wt(!z)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":z?"Click to pause animation":"Click to play animation",children:z?t.jsxRuntimeExports.jsx(gt.Pause,{}):t.jsxRuntimeExports.jsx(gt.Play,{})}),t.jsxRuntimeExports.jsx(yt.Nr,{min:l[0],max:l[l.length-1],marks:Ke,step:null,defaultValue:l[l.length-1],value:l[A],onChangeComplete:m=>{dt(l.indexOf(m))},onChange:m=>{dt(l.indexOf(m))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,e[49]=A,e[50]=Ke,e[51]=z,e[52]=s.enabled,e[53]=l,e[54]=pe):pe=e[54];let me;e[55]!==Ae||e[56]!==ee||e[57]!==p||e[58]!==O||e[59]!==Q||e[60]!==E||e[61]!==st||e[62]!==r||e[63]!==ae||e[64]!==nt||e[65]!==Ue||e[66]!==h||e[67]!==C||e[68]!==A||e[69]!==G||e[70]!==De||e[71]!==Re||e[72]!==Ce||e[73]!==rt||e[74]!==i||e[75]!==de||e[76]!==P||e[77]!==re||e[78]!==H||e[79]!==it||e[80]!==g||e[81]!==ot||e[82]!==ct||e[83]!==we||e[84]!==q||e[85]!==Se||e[86]!==ie||e[87]!==u||e[88]!==Ne||e[89]!==K||e[90]!==J||e[91]!==s.dateFormat||e[92]!==s.enabled||e[93]!==ye||e[94]!==l||e[95]!==x||e[96]!==lt||e[97]!==at||e[98]!==a||e[99]!==S?(me=t.jsxRuntimeExports.jsx(bt.GraphArea,{ref:ut,children:K&&Ne&&de?t.jsxRuntimeExports.jsx(Wt,{data:r.filter(m=>s.enabled?m.date===vt.format(new Date(l[A]),s.dateFormat||"yyyy"):m),mapData:Se?de:{...de,features:de.features.filter(Gt)},colorDomain:Ue,width:K,height:Ne,scale:we,centerPoint:ee,colors:E||(q==="categorical"?et.Colors[J].categoricalColors.colors:et.Colors[J].sequentialColors[`neutralColorsx0${Ue.length+1}`]),colorLegendTitle:Q,mapBorderWidth:Re,mapNoDataColor:Ce,categorical:q==="categorical",mapBorderColor:De,tooltip:ye,onSeriesMouseOver:H,isWorldMap:G,showColorScale:ie,zoomScaleExtend:a,zoomTranslateExtend:S,onSeriesMouseClick:re,mapProperty:i,highlightedIds:C,resetSelectionOnDoubleClick:ot,styles:u,classNames:p,detailsOnClick:ae,mapProjection:rt||(G?"naturalEarth":"mercator"),zoomInteraction:at,dimmedOpacity:nt,animate:Ae===!0?{duration:.5,once:!0,amount:.5}:Ae||{duration:0,once:!0,amount:0},customLayers:st,zoomAndCenterByHighlightedIds:lt,collapseColorScaleByDefault:O,projectionRotate:it,rewindCoordinatesInMapData:ct}):t.jsxRuntimeExports.jsx("div",{style:{height:`${Math.max(P,h||(g?P?(x||K)*g>P?(x||K)*g:P:(x||K)*g:Ne))}px`},className:"flex items-center justify-center",children:t.jsxRuntimeExports.jsx(Ct.w,{"aria-label":"Loading graph"})})}),e[55]=Ae,e[56]=ee,e[57]=p,e[58]=O,e[59]=Q,e[60]=E,e[61]=st,e[62]=r,e[63]=ae,e[64]=nt,e[65]=Ue,e[66]=h,e[67]=C,e[68]=A,e[69]=G,e[70]=De,e[71]=Re,e[72]=Ce,e[73]=rt,e[74]=i,e[75]=de,e[76]=P,e[77]=re,e[78]=H,e[79]=it,e[80]=g,e[81]=ot,e[82]=ct,e[83]=we,e[84]=q,e[85]=Se,e[86]=ie,e[87]=u,e[88]=Ne,e[89]=K,e[90]=J,e[91]=s.dateFormat,e[92]=s.enabled,e[93]=ye,e[94]=l,e[95]=x,e[96]=lt,e[97]=at,e[98]=a,e[99]=S,e[100]=me):me=e[100];let he;e[101]!==p?.footnote||e[102]!==p?.source||e[103]!==R||e[104]!==L||e[105]!==u?.footnote||e[106]!==u?.source||e[107]!==x?(he=L||R?t.jsxRuntimeExports.jsx(Bt.GraphFooter,{styles:{footnote:u?.footnote,source:u?.source},classNames:{footnote:p?.footnote,source:p?.source},sources:L,footNote:R,width:x}):null,e[101]=p?.footnote,e[102]=p?.source,e[103]=R,e[104]=L,e[105]=u?.footnote,e[106]=u?.source,e[107]=x,e[108]=he):he=e[108];let Ze;return e[109]!==V||e[110]!==I||e[111]!==k||e[112]!==h||e[113]!==tt||e[114]!==P||e[115]!==fe||e[116]!==g||e[117]!==mt||e[118]!==ht||e[119]!==ue||e[120]!==pe||e[121]!==me||e[122]!==he||e[123]!==J||e[124]!==x?(Ze=t.jsxRuntimeExports.jsxs(bt.GraphContainer,{className:mt,style:ht,id:k,ref:ft,"aria-label":V,backgroundColor:I,theme:J,language:tt,minHeight:P,width:x,height:h,relativeHeight:g,padding:fe,children:[ue,pe,me,he]}),e[109]=V,e[110]=I,e[111]=k,e[112]=h,e[113]=tt,e[114]=P,e[115]=fe,e[116]=g,e[117]=mt,e[118]=ht,e[119]=ue,e[120]=pe,e[121]=me,e[122]=he,e[123]=J,e[124]=x,e[125]=Ze):Ze=e[125],Ze}function Gt(d){return d.properties.NAME!=="Antarctica"}function Ht(d){return d!==void 0}function Vt(d){return d!==void 0}function Ut(d){return d.data}function Xt(d){return d!==void 0}function Yt(d){return d.data}function Jt(d){return d.x}function Kt(d,e){return d-e}function Zt(d){return d.date}exports.ChoroplethMap=$t;
|
|
2
2
|
//# sourceMappingURL=ChoroplethMap.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChoroplethMap.cjs","sources":["../src/Components/Graphs/Maps/ChoroplethMap/Graph.tsx","../src/Components/Graphs/Maps/ChoroplethMap/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 { scaleThreshold, scaleOrdinal } 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 ChoroplethMapDataType,\r\n ClassNameObject,\r\n CustomLayerDataType,\r\n MapProjectionTypes,\r\n StyleObject,\r\n ZoomInteractionTypes,\r\n} from '@/Types';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { X } from '@/Components/Icons';\r\nimport { DetailsModal } from '@/Components/Elements/DetailsModal';\r\n\r\ninterface Props {\r\n colorDomain: (number | string)[];\r\n mapData: FeatureCollection;\r\n width: number;\r\n height: number;\r\n colors: string[];\r\n colorLegendTitle?: string;\r\n categorical: boolean;\r\n data: ChoroplethMapDataType[];\r\n scale: number;\r\n centerPoint?: [number, number];\r\n mapBorderWidth: number;\r\n mapNoDataColor: string;\r\n mapBorderColor: string;\r\n isWorldMap: boolean;\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 showColorScale: boolean;\r\n zoomScaleExtend: [number, number];\r\n zoomTranslateExtend?: [[number, number], [number, number]];\r\n highlightedIds: string[];\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n mapProperty: string;\r\n resetSelectionOnDoubleClick: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n 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 collapseColorScaleByDefault?: boolean;\r\n zoomAndCenterByHighlightedIds: boolean;\r\n projectionRotate: [number, number] | [number, number, number];\r\n rewindCoordinatesInMapData: boolean;\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n const {\r\n data,\r\n colorDomain,\r\n colors,\r\n mapData,\r\n colorLegendTitle,\r\n categorical,\r\n height,\r\n width,\r\n scale,\r\n centerPoint,\r\n tooltip,\r\n mapBorderWidth,\r\n mapBorderColor,\r\n mapNoDataColor,\r\n onSeriesMouseOver,\r\n showColorScale,\r\n zoomScaleExtend,\r\n zoomTranslateExtend,\r\n highlightedIds,\r\n onSeriesMouseClick,\r\n mapProperty,\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 collapseColorScaleByDefault,\r\n zoomAndCenterByHighlightedIds,\r\n projectionRotate,\r\n rewindCoordinatesInMapData,\r\n } = props;\r\n const formattedMapData = useMemo(() => {\r\n if (!rewindCoordinatesInMapData) return mapData;\r\n\r\n return rewind(mapData, { reverse: true }) as FeatureCollection;\r\n }, [mapData, rewindCoordinatesInMapData]);\r\n const [selectedColor, setSelectedColor] = useState<string | undefined>(undefined);\r\n const zoomRef = useRef<ZoomBehavior<SVGSVGElement, unknown> | null>(null);\r\n const [showLegend, setShowLegend] = useState(\r\n collapseColorScaleByDefault === undefined ? !(width < 680) : !collapseColorScaleByDefault,\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 colorScale = categorical\r\n ? scaleOrdinal<number | string, string>().domain(colorDomain).range(colors)\r\n : scaleThreshold<number, string>()\r\n .domain(colorDomain as number[])\r\n .range(colors);\r\n\r\n useEffect(() => {\r\n const mapGSelect = select(mapG.current);\r\n const mapSvgSelect = select(mapSvg.current);\r\n const zoomFilter = (e: D3ZoomEvent<SVGSVGElement, unknown>['sourceEvent']) => {\r\n if (zoomInteraction === 'noZoom') return false;\r\n if (zoomInteraction === 'button') return !e.type.includes('wheel');\r\n const isWheel = e.type === 'wheel';\r\n const isTouch = e.type.startsWith('touch');\r\n const isDrag = e.type === 'mousedown' || e.type === 'mousemove';\r\n\r\n if (isTouch) return true;\r\n if (isWheel) {\r\n if (zoomInteraction === 'scroll') return true;\r\n return e.ctrlKey;\r\n }\r\n return isDrag && !e.button && !e.ctrlKey;\r\n };\r\n const zoomBehavior = zoom<SVGSVGElement, unknown>()\r\n .scaleExtent(zoomScaleExtend)\r\n .translateExtent(\r\n zoomTranslateExtend || [\r\n [-20, -20],\r\n [width + 20, height + 20],\r\n ],\r\n )\r\n .filter(zoomFilter)\r\n .on('zoom', ({ transform }) => {\r\n mapGSelect.attr('transform', transform);\r\n });\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapSvgSelect.call(zoomBehavior as any);\r\n\r\n zoomRef.current = zoomBehavior;\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [height, width, zoomInteraction]);\r\n\r\n const bounds = bbox({\r\n ...formattedMapData,\r\n features: zoomAndCenterByHighlightedIds\r\n ? formattedMapData.features.filter(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (d: any) =>\r\n (highlightedIds || []).length === 0 ||\r\n highlightedIds.indexOf(d.properties[mapProperty]) !== -1,\r\n )\r\n : formattedMapData.features,\r\n });\r\n\r\n const center = centerOfMass({\r\n ...formattedMapData,\r\n features: zoomAndCenterByHighlightedIds\r\n ? formattedMapData.features.filter(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (d: any) =>\r\n (highlightedIds || []).length === 0 ||\r\n highlightedIds.indexOf(d.properties[mapProperty]) !== -1,\r\n )\r\n : formattedMapData.features,\r\n });\r\n const lonDiff = bounds[2] - bounds[0];\r\n const latDiff = bounds[3] - bounds[1];\r\n const scaleX = (((width * 190) / 960) * 360) / lonDiff;\r\n const scaleY = (((height * 190) / 678) * 180) / latDiff;\r\n const scaleVar = scale * Math.min(scaleX, scaleY);\r\n\r\n const projection =\r\n mapProjection === 'mercator'\r\n ? geoMercator()\r\n .rotate(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'equalEarth'\r\n ? geoEqualEarth()\r\n .rotate(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'naturalEarth'\r\n ? geoNaturalEarth1()\r\n .rotate(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'orthographic'\r\n ? geoOrthographic()\r\n .rotate(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : geoAlbersUsa()\r\n .rotate(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar);\r\n const pathGenerator = geoPath().projection(projection);\r\n const handleZoom = (direction: 'in' | 'out') => {\r\n if (!mapSvg.current || !zoomRef.current) return;\r\n const svg = select(mapSvg.current);\r\n svg.call(zoomRef.current.scaleBy, direction === 'in' ? 1.2 : 1 / 1.2);\r\n };\r\n return (\r\n <>\r\n <div className='relative'>\r\n <motion.svg\r\n width={`${width}px`}\r\n height={`${height}px`}\r\n viewBox={`0 0 ${width} ${height}`}\r\n ref={mapSvg}\r\n direction='ltr'\r\n >\r\n <g ref={mapG}>\r\n {customLayers.filter(d => d.position === 'before').map(d => d.layer)}\r\n {formattedMapData.features.map((d, i: number) => {\r\n if (!d.properties?.[mapProperty]) return null;\r\n const path = pathGenerator(d);\r\n if (!path) return null;\r\n return (\r\n <motion.g\r\n key={i}\r\n opacity={\r\n selectedColor\r\n ? dimmedOpacity\r\n : highlightedIds.length !== 0\r\n ? highlightedIds.indexOf(d.properties[mapProperty]) !== -1\r\n ? 1\r\n : dimmedOpacity\r\n : 1\r\n }\r\n >\r\n <path\r\n d={path}\r\n style={{\r\n stroke: mapBorderColor,\r\n strokeWidth: mapBorderWidth,\r\n fill: mapNoDataColor,\r\n }}\r\n />\r\n </motion.g>\r\n );\r\n })}\r\n <AnimatePresence>\r\n {data.map(d => {\r\n const index = formattedMapData.features.findIndex(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any) => d.id === el.properties[mapProperty],\r\n );\r\n if (index === -1) return null;\r\n const path = pathGenerator(formattedMapData.features[index]);\r\n if (!path) return null;\r\n const color = !checkIfNullOrUndefined(d.x)\r\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n colorScale(d.x as any)\r\n : mapNoDataColor;\r\n return (\r\n <motion.g\r\n key={d.id}\r\n variants={{\r\n initial: { opacity: 0 },\r\n whileInView: {\r\n opacity: selectedColor\r\n ? selectedColor === color\r\n ? 1\r\n : dimmedOpacity\r\n : highlightedIds.length !== 0\r\n ? highlightedIds.indexOf(d.id) !== -1\r\n ? 1\r\n : dimmedOpacity\r\n : 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n onMouseEnter={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n onSeriesMouseOver?.(d);\r\n }}\r\n onMouseMove={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n }}\r\n onMouseLeave={() => {\r\n setMouseOverData(undefined);\r\n setEventX(undefined);\r\n setEventY(undefined);\r\n onSeriesMouseOver?.(undefined);\r\n }}\r\n onClick={() => {\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (isEqual(mouseClickData, d) && resetSelectionOnDoubleClick) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(d);\r\n onSeriesMouseClick?.(d);\r\n }\r\n }\r\n }}\r\n >\r\n <motion.path\r\n key={`${d.id}`}\r\n d={path}\r\n variants={{\r\n initial: { fill: color, opacity: 0 },\r\n whileInView: {\r\n fill: color,\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n style={{\r\n stroke: mapBorderColor,\r\n strokeWidth: mapBorderWidth,\r\n }}\r\n />\r\n </motion.g>\r\n );\r\n })}\r\n </AnimatePresence>\r\n {mouseOverData\r\n ? formattedMapData.features\r\n .filter(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (d: { properties: any }) => d.properties[mapProperty] === mouseOverData.id,\r\n )\r\n .map((d, i) => (\r\n <path\r\n key={i}\r\n d={pathGenerator(d) || ''}\r\n className='stroke-primary-gray-700 dark:stroke-primary-gray-300'\r\n style={{\r\n fill: 'none',\r\n fillOpacity: 0,\r\n strokeWidth: '0.5',\r\n }}\r\n />\r\n ))\r\n : null}\r\n {customLayers.filter(d => d.position === 'after').map(d => d.layer)}\r\n </g>\r\n </motion.svg>\r\n {showColorScale === false ? null : (\r\n <div className={cn('absolute left-4 bottom-4 map-color-legend', classNames?.colorLegend)}>\r\n {showLegend ? (\r\n <>\r\n <div\r\n className='color-legend-close-button bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)] border border-[var(--gray-400)] rounded-full w-6 h-6 p-[3px] cursor-pointer z-10 absolute right-[-0.75rem] top-[-0.75rem]'\r\n onClick={() => {\r\n setShowLegend(false);\r\n }}\r\n >\r\n <X />\r\n </div>\r\n <div\r\n className='color-legend-box p-2 bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)]'\r\n style={{\r\n width: categorical ? undefined : '340px',\r\n }}\r\n >\r\n {colorLegendTitle && colorLegendTitle !== '' ? (\r\n <P\r\n size='xs'\r\n marginBottom='xs'\r\n className='p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300'\r\n style={{\r\n display: '-webkit-box',\r\n WebkitLineClamp: '1',\r\n WebkitBoxOrient: 'vertical',\r\n }}\r\n >\r\n {colorLegendTitle}\r\n </P>\r\n ) : null}\r\n {!categorical ? (\r\n <svg width='100%' viewBox='0 0 320 30' direction='ltr'>\r\n <g>\r\n {colorDomain.map((d, i) => (\r\n <g\r\n key={i}\r\n onMouseOver={() => {\r\n setSelectedColor(colors[i]);\r\n }}\r\n onMouseLeave={() => {\r\n setSelectedColor(undefined);\r\n }}\r\n className='cursor-pointer'\r\n >\r\n <rect\r\n x={(i * 320) / colors.length + 1}\r\n y={1}\r\n width={320 / colors.length - 2}\r\n height={8}\r\n className={\r\n selectedColor === colors[i]\r\n ? 'stroke-primary-gray-700 dark:stroke-primary-gray-300'\r\n : ''\r\n }\r\n style={{\r\n fill: colors[i],\r\n ...(selectedColor === colors[i] ? {} : { stroke: colors[i] }),\r\n }}\r\n />\r\n <text\r\n x={((i + 1) * 320) / colors.length}\r\n y={25}\r\n className='fill-primary-gray-700 dark:fill-primary-gray-300 text-xs'\r\n style={{ textAnchor: 'middle' }}\r\n >\r\n {numberFormattingFunction(d as number, 'NA')}\r\n </text>\r\n </g>\r\n ))}\r\n <g>\r\n <rect\r\n onMouseOver={() => {\r\n setSelectedColor(colors[colorDomain.length]);\r\n }}\r\n onMouseLeave={() => {\r\n setSelectedColor(undefined);\r\n }}\r\n x={(colorDomain.length * 320) / colors.length + 1}\r\n y={1}\r\n width={320 / colors.length - 2}\r\n height={8}\r\n className={`cursor-pointer ${\r\n selectedColor === colors[colorDomain.length]\r\n ? 'stroke-1 stroke-primary-gray-700 dark:stroke-primary-gray-300'\r\n : ''\r\n }`}\r\n style={{\r\n fill: colors[colorDomain.length],\r\n ...(selectedColor === colors[colorDomain.length]\r\n ? {}\r\n : { stroke: colors[colorDomain.length] }),\r\n }}\r\n />\r\n </g>\r\n </g>\r\n </svg>\r\n ) : (\r\n <div className='flex flex-col gap-3'>\r\n {colorDomain.map((d, i) => (\r\n <div\r\n key={i}\r\n className='flex gap-2 items-center'\r\n onMouseOver={() => {\r\n setSelectedColor(colors[i % colors.length]);\r\n }}\r\n onMouseLeave={() => {\r\n setSelectedColor(undefined);\r\n }}\r\n >\r\n <div\r\n className='w-2 h-2 rounded-full'\r\n style={{ backgroundColor: colors[i % colors.length] }}\r\n />\r\n <P size='sm' marginBottom='none' leading='none'>\r\n {d}\r\n </P>\r\n </div>\r\n ))}\r\n </div>\r\n )}\r\n </div>\r\n </>\r\n ) : (\r\n <button\r\n type='button'\r\n className='mb-0 border-0 bg-transparent p-0 self-start map-legend-button'\r\n onClick={() => {\r\n setShowLegend(true);\r\n }}\r\n >\r\n <div className='show-color-legend-button items-start text-sm font-medium cursor-pointer p-2 mb-0 flex text-primary-black dark:text-primary-gray-300 bg-primary-gray-300 dark:bg-primary-gray-600 border-primary-gray-400 dark:border-primary-gray-500'>\r\n Show Legend\r\n </div>\r\n </button>\r\n )}\r\n </div>\r\n )}\r\n {zoomInteraction === 'button' && (\r\n <div className='absolute left-4 top-4 flex flex-col zoom-buttons'>\r\n <button\r\n onClick={() => handleZoom('in')}\r\n className='leading-0 px-2 py-3.5 text-primary-gray-700 border border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100'\r\n >\r\n +\r\n </button>\r\n <button\r\n onClick={() => handleZoom('out')}\r\n className='leading-0 px-2 py-3.5 text-primary-gray-700 border border-t-0 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100'\r\n >\r\n –\r\n </button>\r\n </div>\r\n )}\r\n </div>\r\n {detailsOnClick && mouseClickData !== undefined ? (\r\n <DetailsModal\r\n body={detailsOnClick}\r\n data={mouseClickData}\r\n setData={setMouseClickData}\r\n className={classNames?.modal}\r\n />\r\n ) : null}\r\n {mouseOverData && tooltip && eventX && eventY ? (\r\n <Tooltip\r\n data={mouseOverData}\r\n body={tooltip}\r\n xPos={eventX}\r\n yPos={eventY}\r\n backgroundStyle={styles?.tooltip}\r\n className={classNames?.tooltip}\r\n />\r\n ) : null}\r\n </>\r\n );\r\n}\r\n","import { useState, useRef, useEffect, useEffectEvent, useMemo } from 'react';\r\nimport { SliderUI } from '@undp/design-system-react/SliderUI';\r\nimport { Spinner } from '@undp/design-system-react/Spinner';\r\nimport { format } from 'date-fns/format';\r\nimport { parse } from 'date-fns/parse';\r\n\r\nimport { Graph } from './Graph';\r\n\r\nimport {\r\n ChoroplethMapDataType,\r\n Languages,\r\n SourcesDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n ScaleDataType,\r\n MapProjectionTypes,\r\n ZoomInteractionTypes,\r\n CustomLayerDataType,\r\n AnimateDataType,\r\n TimelineDataType,\r\n} from '@/Types';\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { fetchAndParseJSON } from '@/Utils/fetchAndParseData';\r\nimport { getUniqValue } from '@/Utils/getUniqValue';\r\nimport { getJenks } from '@/Utils/getJenks';\r\nimport { Pause, Play } from '@/Components/Icons';\r\nimport { getSliderMarks } from '@/Utils/getSliderMarks';\r\nimport { GraphArea, GraphContainer } from '@/Components/Elements/GraphContainer';\r\n\r\ninterface Props {\r\n // Data\r\n /** Array of data objects */\r\n data: ChoroplethMapDataType[];\r\n\r\n // Titles, Labels, and Sources\r\n /** Title of the graph */\r\n graphTitle?: string | React.ReactNode;\r\n /** Description of the graph */\r\n graphDescription?: string | React.ReactNode;\r\n /** Footnote for the graph */\r\n footNote?: string | React.ReactNode;\r\n /** Source data for the graph */\r\n sources?: SourcesDataType[];\r\n /** Accessibility label */\r\n ariaLabel?: string;\r\n\r\n // Colors and Styling\r\n /** Colors for the choropleth map */\r\n colors?: string[];\r\n /** Domain of colors for the graph */\r\n colorDomain?: number[] | 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 /** 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 /** Toggle if the map is centered and zoomed to the highlighted ids. */\r\n zoomAndCenterByHighlightedIds?: boolean;\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 /** Countries or regions to be highlighted */\r\n highlightedIds?: string[];\r\n /** Defines the opacity of the non-highlighted data */\r\n dimmedOpacity?: number;\r\n /** Toggles if the graph animates in when loaded. */\r\n animate?: boolean | AnimateDataType;\r\n /** Scale for the colors */\r\n scaleType?: Exclude<ScaleDataType, 'linear'>;\r\n /** Toggle visibility of color scale. */\r\n showColorScale?: boolean;\r\n /** Toggle if color scale is collapsed by default. */\r\n collapseColorScaleByDefault?: boolean;\r\n /** Property in the property object in mapData geoJson object is used to match to the id in the data object */\r\n mapProperty?: string;\r\n /** 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 ChoroplethMap(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 colorDomain,\r\n colorLegendTitle,\r\n scaleType = 'threshold',\r\n scale = 0.95,\r\n centerPoint,\r\n padding,\r\n mapBorderWidth = 0.5,\r\n mapNoDataColor = Colors.light.graphNoData,\r\n backgroundColor = false,\r\n mapBorderColor = Colors.light.grays['gray-500'],\r\n relativeHeight,\r\n tooltip,\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 highlightedIds = [],\r\n onSeriesMouseClick,\r\n mapProperty = 'ISO3',\r\n graphDownload = false,\r\n dataDownload = false,\r\n showAntarctica = false,\r\n language = 'en',\r\n minHeight = 0,\r\n theme = 'light',\r\n ariaLabel,\r\n resetSelectionOnDoubleClick = true,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n mapProjection = 'naturalEarth',\r\n zoomInteraction = 'button',\r\n animate = false,\r\n dimmedOpacity = 0.3,\r\n customLayers = [],\r\n timeline = { enabled: false, autoplay: false, showOnlyActiveDate: true },\r\n collapseColorScaleByDefault,\r\n projectionRotate = [0, 0],\r\n zoomAndCenterByHighlightedIds = false,\r\n rewindCoordinatesInMapData = true,\r\n } = props;\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 const domain =\r\n colorDomain ||\r\n (scaleType === 'categorical'\r\n ? getUniqValue(data, 'x')\r\n : getJenks(\r\n data.map(d => d.x as number | null | undefined),\r\n colors?.length || 4,\r\n ));\r\n\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 === format(new Date(uniqDatesSorted[index]), timeline.dateFormat || 'yyyy')\r\n : d,\r\n )}\r\n mapData={\r\n showAntarctica\r\n ? mapShape\r\n : {\r\n ...mapShape,\r\n features: mapShape.features.filter(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any) => el.properties.NAME !== 'Antarctica',\r\n ),\r\n }\r\n }\r\n colorDomain={domain}\r\n width={svgWidth}\r\n height={svgHeight}\r\n scale={scale}\r\n centerPoint={centerPoint}\r\n colors={\r\n colors ||\r\n (scaleType === 'categorical'\r\n ? Colors[theme].categoricalColors.colors\r\n : Colors[theme].sequentialColors[\r\n `neutralColorsx0${(domain.length + 1) as 4 | 5 | 6 | 7 | 8 | 9}`\r\n ])\r\n }\r\n colorLegendTitle={colorLegendTitle}\r\n mapBorderWidth={mapBorderWidth}\r\n mapNoDataColor={mapNoDataColor}\r\n categorical={scaleType === 'categorical'}\r\n mapBorderColor={mapBorderColor}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n isWorldMap={isWorldMap}\r\n showColorScale={showColorScale}\r\n zoomScaleExtend={zoomScaleExtend}\r\n zoomTranslateExtend={zoomTranslateExtend}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n mapProperty={mapProperty}\r\n highlightedIds={highlightedIds}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n styles={styles}\r\n classNames={classNames}\r\n detailsOnClick={detailsOnClick}\r\n mapProjection={mapProjection || (isWorldMap ? 'naturalEarth' : 'mercator')}\r\n zoomInteraction={zoomInteraction}\r\n dimmedOpacity={dimmedOpacity}\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 customLayers={customLayers}\r\n zoomAndCenterByHighlightedIds={zoomAndCenterByHighlightedIds}\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","colorDomain","colors","mapData","colorLegendTitle","categorical","height","width","scale","centerPoint","tooltip","mapBorderWidth","mapBorderColor","mapNoDataColor","onSeriesMouseOver","showColorScale","zoomScaleExtend","zoomTranslateExtend","highlightedIds","onSeriesMouseClick","mapProperty","resetSelectionOnDoubleClick","detailsOnClick","styles","classNames","mapProjection","zoomInteraction","animate","dimmedOpacity","customLayers","collapseColorScaleByDefault","zoomAndCenterByHighlightedIds","projectionRotate","rewindCoordinatesInMapData","formattedMapData","useMemo","rewind","reverse","selectedColor","setSelectedColor","useState","undefined","zoomRef","useRef","showLegend","setShowLegend","mouseClickData","setMouseClickData","mouseOverData","setMouseOverData","eventX","setEventX","eventY","setEventY","mapSvg","isInView","useInView","once","amount","mapG","colorScale","scaleOrdinal","domain","range","scaleThreshold","useEffect","mapGSelect","select","current","mapSvgSelect","zoomFilter","e","type","includes","isWheel","isTouch","startsWith","isDrag","ctrlKey","button","zoomBehavior","zoom","scaleExtent","translateExtent","filter","on","transform","attr","call","bounds","bbox","features","d","length","indexOf","properties","center","centerOfMass","lonDiff","latDiff","scaleX","scaleY","scaleVar","Math","min","projection","geoMercator","rotate","geometry","coordinates","translate","geoEqualEarth","geoNaturalEarth1","geoOrthographic","geoAlbersUsa","pathGenerator","geoPath","handleZoom","direction","scaleBy","jsxs","Fragment","jsx","motion","position","map","layer","i","path","stroke","strokeWidth","fill","AnimatePresence","index","findIndex","el","id","color","checkIfNullOrUndefined","x","initial","opacity","whileInView","transition","duration","event","clientY","clientX","isEqual","fillOpacity","cn","colorLegend","X","P","display","WebkitLineClamp","WebkitBoxOrient","backgroundColor","textAnchor","numberFormattingFunction","DetailsModal","modal","Tooltip","ChoroplethMap","$","_c","t0","graphTitle","sources","graphDescription","footNote","t1","scaleType","t2","t3","padding","t4","t5","t6","t7","relativeHeight","isWorldMap","t8","t9","t10","graphID","t11","t12","graphDownload","t13","dataDownload","t14","showAntarctica","t15","language","t16","minHeight","t17","theme","t18","ariaLabel","t19","t20","t21","t22","t23","t24","timeline","t25","t26","t27","t28","Colors","light","graphNoData","grays","t29","t30","t31","t32","enabled","autoplay","showOnlyActiveDate","t33","svgWidth","setSvgWidth","svgHeight","setSvgHeight","play","setPlay","dates","dateFormat","t34","d_0","parse","date","Date","getTime","Set","_temp","sort","_temp2","uniqDatesSorted","setIndex","mapShape","setMapShape","graphDiv","graphParentDiv","t35","Symbol","for","resizeObserver","ResizeObserver","entries","target","clientWidth","clientHeight","observe","disconnect","t36","shape","onUpdateShape","useEffectEvent","t37","fetchAndParseJSON","then","d_1","t38","t39","getUniqValue","getJenks","_temp3","t40","t41","speed","interval","setInterval","clearInterval","t42","t43","getSliderMarks","markObj","t44","graphContainer","t45","t46","description","title","GraphHeader","_temp4","_temp5","_temp6","_temp7","_temp8","t47","Pause","Play","SliderUI","nextValue","nextValue_0","t48","GraphArea","d_8","format","_temp9","categoricalColors","sequentialColors","max","Spinner","t49","footnote","source","GraphFooter","t50","GraphContainer","NAME","d_5","d_4","d_3","d_7","d_6","d_2","a","b"],"mappings":"ylCA8EO,SAASA,GAAMC,EAAc,CAClC,KAAM,CACJC,KAAAA,EACAC,YAAAA,EACAC,OAAAA,EACAC,QAAAA,EACAC,iBAAAA,EACAC,YAAAA,EACAC,OAAAA,EACAC,MAAAA,EACAC,MAAAA,EACAC,YAAAA,EACAC,QAAAA,EACAC,eAAAA,EACAC,eAAAA,GACAC,eAAAA,GACAC,kBAAAA,GACAC,eAAAA,GACAC,gBAAAA,GACAC,oBAAAA,GACAC,eAAAA,EACAC,mBAAAA,GACAC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x"],"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 { scaleThreshold, scaleOrdinal } 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 ChoroplethMapDataType,\r\n ClassNameObject,\r\n CustomLayerDataType,\r\n MapProjectionTypes,\r\n StyleObject,\r\n ZoomInteractionTypes,\r\n} from '@/Types';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { X } from '@/Components/Icons';\r\nimport { DetailsModal } from '@/Components/Elements/DetailsModal';\r\n\r\ninterface Props {\r\n colorDomain: (number | string)[];\r\n mapData: FeatureCollection;\r\n width: number;\r\n height: number;\r\n colors: string[];\r\n colorLegendTitle?: string;\r\n categorical: boolean;\r\n data: ChoroplethMapDataType[];\r\n scale: number;\r\n centerPoint?: [number, number];\r\n mapBorderWidth: number;\r\n mapNoDataColor: string;\r\n mapBorderColor: string;\r\n isWorldMap: boolean;\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 showColorScale: boolean;\r\n zoomScaleExtend: [number, number];\r\n zoomTranslateExtend?: [[number, number], [number, number]];\r\n highlightedIds: string[];\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n mapProperty: string;\r\n resetSelectionOnDoubleClick: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n 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 collapseColorScaleByDefault?: boolean;\r\n zoomAndCenterByHighlightedIds: boolean;\r\n projectionRotate: [number, number] | [number, number, number];\r\n rewindCoordinatesInMapData: boolean;\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n const {\r\n data,\r\n colorDomain,\r\n colors,\r\n mapData,\r\n colorLegendTitle,\r\n categorical,\r\n height,\r\n width,\r\n scale,\r\n centerPoint,\r\n tooltip,\r\n mapBorderWidth,\r\n mapBorderColor,\r\n mapNoDataColor,\r\n onSeriesMouseOver,\r\n showColorScale,\r\n zoomScaleExtend,\r\n zoomTranslateExtend,\r\n highlightedIds,\r\n onSeriesMouseClick,\r\n mapProperty,\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 collapseColorScaleByDefault,\r\n zoomAndCenterByHighlightedIds,\r\n projectionRotate,\r\n rewindCoordinatesInMapData,\r\n } = props;\r\n const formattedMapData = useMemo(() => {\r\n if (!rewindCoordinatesInMapData) return mapData;\r\n\r\n return rewind(mapData, { reverse: true }) as FeatureCollection;\r\n }, [mapData, rewindCoordinatesInMapData]);\r\n const [selectedColor, setSelectedColor] = useState<string | undefined>(undefined);\r\n const zoomRef = useRef<ZoomBehavior<SVGSVGElement, unknown> | null>(null);\r\n const [showLegend, setShowLegend] = useState(\r\n collapseColorScaleByDefault === undefined ? !(width < 680) : !collapseColorScaleByDefault,\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 colorScale = categorical\r\n ? scaleOrdinal<number | string, string>().domain(colorDomain).range(colors)\r\n : scaleThreshold<number, string>()\r\n .domain(colorDomain as number[])\r\n .range(colors);\r\n\r\n useEffect(() => {\r\n const mapGSelect = select(mapG.current);\r\n const mapSvgSelect = select(mapSvg.current);\r\n const zoomFilter = (e: D3ZoomEvent<SVGSVGElement, unknown>['sourceEvent']) => {\r\n if (zoomInteraction === 'noZoom') return false;\r\n if (zoomInteraction === 'button') return !e.type.includes('wheel');\r\n const isWheel = e.type === 'wheel';\r\n const isTouch = e.type.startsWith('touch');\r\n const isDrag = e.type === 'mousedown' || e.type === 'mousemove';\r\n\r\n if (isTouch) return true;\r\n if (isWheel) {\r\n if (zoomInteraction === 'scroll') return true;\r\n return e.ctrlKey;\r\n }\r\n return isDrag && !e.button && !e.ctrlKey;\r\n };\r\n const zoomBehavior = zoom<SVGSVGElement, unknown>()\r\n .scaleExtent(zoomScaleExtend)\r\n .translateExtent(\r\n zoomTranslateExtend || [\r\n [-20, -20],\r\n [width + 20, height + 20],\r\n ],\r\n )\r\n .filter(zoomFilter)\r\n .on('zoom', ({ transform }) => {\r\n mapGSelect.attr('transform', transform);\r\n });\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapSvgSelect.call(zoomBehavior as any);\r\n\r\n zoomRef.current = zoomBehavior;\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [height, width, zoomInteraction]);\r\n\r\n const bounds = bbox({\r\n ...formattedMapData,\r\n features: zoomAndCenterByHighlightedIds\r\n ? formattedMapData.features.filter(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (d: any) =>\r\n (highlightedIds || []).length === 0 ||\r\n highlightedIds.indexOf(d.properties[mapProperty]) !== -1,\r\n )\r\n : formattedMapData.features,\r\n });\r\n\r\n const center = centerOfMass({\r\n ...formattedMapData,\r\n features: zoomAndCenterByHighlightedIds\r\n ? formattedMapData.features.filter(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (d: any) =>\r\n (highlightedIds || []).length === 0 ||\r\n highlightedIds.indexOf(d.properties[mapProperty]) !== -1,\r\n )\r\n : formattedMapData.features,\r\n });\r\n const lonDiff = (bounds[2] - bounds[0]) * 1.15;\r\n const latDiff = (bounds[3] - bounds[1]) * 1.15;\r\n const scaleX = (((width * 190) / 960) * 360) / lonDiff;\r\n const scaleY = (((height * 190) / 678) * 180) / latDiff;\r\n const scaleVar = scale * Math.min(scaleX, scaleY);\r\n\r\n const projection =\r\n mapProjection === 'mercator'\r\n ? geoMercator()\r\n .rotate(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'equalEarth'\r\n ? geoEqualEarth()\r\n .rotate(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'naturalEarth'\r\n ? geoNaturalEarth1()\r\n .rotate(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'orthographic'\r\n ? geoOrthographic()\r\n .rotate(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : geoAlbersUsa()\r\n .rotate(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar);\r\n const pathGenerator = geoPath().projection(projection);\r\n const handleZoom = (direction: 'in' | 'out') => {\r\n if (!mapSvg.current || !zoomRef.current) return;\r\n const svg = select(mapSvg.current);\r\n svg.call(zoomRef.current.scaleBy, direction === 'in' ? 1.2 : 1 / 1.2);\r\n };\r\n return (\r\n <>\r\n <div className='relative'>\r\n <motion.svg\r\n width={`${width}px`}\r\n height={`${height}px`}\r\n viewBox={`0 0 ${width} ${height}`}\r\n ref={mapSvg}\r\n direction='ltr'\r\n >\r\n <g ref={mapG}>\r\n {customLayers.filter(d => d.position === 'before').map(d => d.layer)}\r\n {formattedMapData.features.map((d, i: number) => {\r\n if (!d.properties?.[mapProperty]) return null;\r\n const path = pathGenerator(d);\r\n if (!path) return null;\r\n return (\r\n <motion.g\r\n key={i}\r\n opacity={\r\n selectedColor\r\n ? dimmedOpacity\r\n : highlightedIds.length !== 0\r\n ? highlightedIds.indexOf(d.properties[mapProperty]) !== -1\r\n ? 1\r\n : dimmedOpacity\r\n : 1\r\n }\r\n >\r\n <path\r\n d={path}\r\n style={{\r\n stroke: mapBorderColor,\r\n strokeWidth: mapBorderWidth,\r\n fill: mapNoDataColor,\r\n }}\r\n />\r\n </motion.g>\r\n );\r\n })}\r\n <AnimatePresence>\r\n {data.map(d => {\r\n const index = formattedMapData.features.findIndex(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any) => d.id === el.properties[mapProperty],\r\n );\r\n if (index === -1) return null;\r\n const path = pathGenerator(formattedMapData.features[index]);\r\n if (!path) return null;\r\n const color = !checkIfNullOrUndefined(d.x)\r\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n colorScale(d.x as any)\r\n : mapNoDataColor;\r\n return (\r\n <motion.g\r\n className='undp-map-shapes'\r\n key={d.id}\r\n variants={{\r\n initial: { opacity: 0 },\r\n whileInView: {\r\n opacity: selectedColor\r\n ? selectedColor === color\r\n ? 1\r\n : dimmedOpacity\r\n : highlightedIds.length !== 0\r\n ? highlightedIds.indexOf(d.id) !== -1\r\n ? 1\r\n : dimmedOpacity\r\n : 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n onMouseEnter={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n onSeriesMouseOver?.(d);\r\n }}\r\n onMouseMove={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n }}\r\n onMouseLeave={() => {\r\n setMouseOverData(undefined);\r\n setEventX(undefined);\r\n setEventY(undefined);\r\n onSeriesMouseOver?.(undefined);\r\n }}\r\n onClick={() => {\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (isEqual(mouseClickData, d) && resetSelectionOnDoubleClick) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(d);\r\n onSeriesMouseClick?.(d);\r\n }\r\n }\r\n }}\r\n >\r\n <motion.path\r\n key={`${d.id}`}\r\n d={path}\r\n variants={{\r\n initial: { fill: color, opacity: 0 },\r\n whileInView: {\r\n fill: color,\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n style={{\r\n stroke: mapBorderColor,\r\n strokeWidth: mapBorderWidth,\r\n }}\r\n />\r\n </motion.g>\r\n );\r\n })}\r\n </AnimatePresence>\r\n {mouseOverData\r\n ? formattedMapData.features\r\n .filter(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (d: { properties: any }) => d.properties[mapProperty] === mouseOverData.id,\r\n )\r\n .map((d, i) => (\r\n <path\r\n key={i}\r\n d={pathGenerator(d) || ''}\r\n className='stroke-primary-gray-700 dark:stroke-primary-gray-300'\r\n style={{\r\n fill: 'none',\r\n fillOpacity: 0,\r\n strokeWidth: '0.5',\r\n }}\r\n />\r\n ))\r\n : null}\r\n {customLayers.filter(d => d.position === 'after').map(d => d.layer)}\r\n </g>\r\n </motion.svg>\r\n {showColorScale === false ? null : (\r\n <div className={cn('absolute left-4 bottom-4 map-color-legend', classNames?.colorLegend)}>\r\n {showLegend ? (\r\n <>\r\n <div\r\n className='color-legend-close-button bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)] border border-[var(--gray-400)] rounded-full w-6 h-6 p-[3px] cursor-pointer z-10 absolute right-[-0.75rem] top-[-0.75rem]'\r\n onClick={() => {\r\n setShowLegend(false);\r\n }}\r\n >\r\n <X />\r\n </div>\r\n <div\r\n className='color-legend-box p-2 bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)]'\r\n style={{\r\n width: categorical ? undefined : '340px',\r\n }}\r\n >\r\n {colorLegendTitle && colorLegendTitle !== '' ? (\r\n <P\r\n size='xs'\r\n marginBottom='xs'\r\n className='p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300'\r\n style={{\r\n display: '-webkit-box',\r\n WebkitLineClamp: '1',\r\n WebkitBoxOrient: 'vertical',\r\n }}\r\n >\r\n {colorLegendTitle}\r\n </P>\r\n ) : null}\r\n {!categorical ? (\r\n <svg width='100%' viewBox='0 0 320 30' direction='ltr'>\r\n <g>\r\n {colorDomain.map((d, i) => (\r\n <g\r\n key={i}\r\n onMouseOver={() => {\r\n setSelectedColor(colors[i]);\r\n }}\r\n onMouseLeave={() => {\r\n setSelectedColor(undefined);\r\n }}\r\n className='cursor-pointer'\r\n >\r\n <rect\r\n x={(i * 320) / colors.length + 1}\r\n y={1}\r\n width={320 / colors.length - 2}\r\n height={8}\r\n className={\r\n selectedColor === colors[i]\r\n ? 'stroke-primary-gray-700 dark:stroke-primary-gray-300'\r\n : ''\r\n }\r\n style={{\r\n fill: colors[i],\r\n ...(selectedColor === colors[i] ? {} : { stroke: colors[i] }),\r\n }}\r\n />\r\n <text\r\n x={((i + 1) * 320) / colors.length}\r\n y={25}\r\n className='fill-primary-gray-700 dark:fill-primary-gray-300 text-xs'\r\n style={{ textAnchor: 'middle' }}\r\n >\r\n {numberFormattingFunction(d as number, 'NA')}\r\n </text>\r\n </g>\r\n ))}\r\n <g>\r\n <rect\r\n onMouseOver={() => {\r\n setSelectedColor(colors[colorDomain.length]);\r\n }}\r\n onMouseLeave={() => {\r\n setSelectedColor(undefined);\r\n }}\r\n x={(colorDomain.length * 320) / colors.length + 1}\r\n y={1}\r\n width={320 / colors.length - 2}\r\n height={8}\r\n className={`cursor-pointer ${\r\n selectedColor === colors[colorDomain.length]\r\n ? 'stroke-1 stroke-primary-gray-700 dark:stroke-primary-gray-300'\r\n : ''\r\n }`}\r\n style={{\r\n fill: colors[colorDomain.length],\r\n ...(selectedColor === colors[colorDomain.length]\r\n ? {}\r\n : { stroke: colors[colorDomain.length] }),\r\n }}\r\n />\r\n </g>\r\n </g>\r\n </svg>\r\n ) : (\r\n <div className='flex flex-col gap-3'>\r\n {colorDomain.map((d, i) => (\r\n <div\r\n key={i}\r\n className='flex gap-2 items-center'\r\n onMouseOver={() => {\r\n setSelectedColor(colors[i % colors.length]);\r\n }}\r\n onMouseLeave={() => {\r\n setSelectedColor(undefined);\r\n }}\r\n >\r\n <div\r\n className='w-2 h-2 rounded-full'\r\n style={{ backgroundColor: colors[i % colors.length] }}\r\n />\r\n <P size='sm' marginBottom='none' leading='none'>\r\n {d}\r\n </P>\r\n </div>\r\n ))}\r\n </div>\r\n )}\r\n </div>\r\n </>\r\n ) : (\r\n <button\r\n type='button'\r\n className='mb-0 border-0 bg-transparent p-0 self-start map-legend-button'\r\n onClick={() => {\r\n setShowLegend(true);\r\n }}\r\n >\r\n <div className='show-color-legend-button items-start text-sm font-medium cursor-pointer p-2 mb-0 flex text-primary-black dark:text-primary-gray-300 bg-primary-gray-300 dark:bg-primary-gray-600 border-primary-gray-400 dark:border-primary-gray-500'>\r\n Show Legend\r\n </div>\r\n </button>\r\n )}\r\n </div>\r\n )}\r\n {zoomInteraction === 'button' && (\r\n <div className='absolute left-4 top-4 flex flex-col zoom-buttons'>\r\n <button\r\n onClick={() => handleZoom('in')}\r\n className='leading-0 px-2 py-3.5 text-primary-gray-700 border border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100'\r\n >\r\n +\r\n </button>\r\n <button\r\n onClick={() => handleZoom('out')}\r\n className='leading-0 px-2 py-3.5 text-primary-gray-700 border border-t-0 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100'\r\n >\r\n –\r\n </button>\r\n </div>\r\n )}\r\n </div>\r\n {detailsOnClick && mouseClickData !== undefined ? (\r\n <DetailsModal\r\n body={detailsOnClick}\r\n data={mouseClickData}\r\n setData={setMouseClickData}\r\n className={classNames?.modal}\r\n />\r\n ) : null}\r\n {mouseOverData && tooltip && eventX && eventY ? (\r\n <Tooltip\r\n data={mouseOverData}\r\n body={tooltip}\r\n xPos={eventX}\r\n yPos={eventY}\r\n backgroundStyle={styles?.tooltip}\r\n className={classNames?.tooltip}\r\n />\r\n ) : null}\r\n </>\r\n );\r\n}\r\n","import { useState, useRef, useEffect, useEffectEvent, useMemo } from 'react';\r\nimport { SliderUI } from '@undp/design-system-react/SliderUI';\r\nimport { Spinner } from '@undp/design-system-react/Spinner';\r\nimport { format } from 'date-fns/format';\r\nimport { parse } from 'date-fns/parse';\r\n\r\nimport { Graph } from './Graph';\r\n\r\nimport {\r\n ChoroplethMapDataType,\r\n Languages,\r\n SourcesDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n ScaleDataType,\r\n MapProjectionTypes,\r\n ZoomInteractionTypes,\r\n CustomLayerDataType,\r\n AnimateDataType,\r\n TimelineDataType,\r\n} from '@/Types';\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { fetchAndParseJSON } from '@/Utils/fetchAndParseData';\r\nimport { getUniqValue } from '@/Utils/getUniqValue';\r\nimport { getJenks } from '@/Utils/getJenks';\r\nimport { Pause, Play } from '@/Components/Icons';\r\nimport { getSliderMarks } from '@/Utils/getSliderMarks';\r\nimport { GraphArea, GraphContainer } from '@/Components/Elements/GraphContainer';\r\n\r\ninterface Props {\r\n // Data\r\n /** Array of data objects */\r\n data: ChoroplethMapDataType[];\r\n\r\n // Titles, Labels, and Sources\r\n /** Title of the graph */\r\n graphTitle?: string | React.ReactNode;\r\n /** Description of the graph */\r\n graphDescription?: string | React.ReactNode;\r\n /** Footnote for the graph */\r\n footNote?: string | React.ReactNode;\r\n /** Source data for the graph */\r\n sources?: SourcesDataType[];\r\n /** Accessibility label */\r\n ariaLabel?: string;\r\n\r\n // Colors and Styling\r\n /** Colors for the choropleth map */\r\n colors?: string[];\r\n /** Domain of colors for the graph */\r\n colorDomain?: number[] | 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 /** 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 /** Toggle if the map is centered and zoomed to the highlighted ids. */\r\n zoomAndCenterByHighlightedIds?: boolean;\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 /** Countries or regions to be highlighted */\r\n highlightedIds?: string[];\r\n /** Defines the opacity of the non-highlighted data */\r\n dimmedOpacity?: number;\r\n /** Toggles if the graph animates in when loaded. */\r\n animate?: boolean | AnimateDataType;\r\n /** Scale for the colors */\r\n scaleType?: Exclude<ScaleDataType, 'linear'>;\r\n /** Toggle visibility of color scale. */\r\n showColorScale?: boolean;\r\n /** Toggle if color scale is collapsed by default. */\r\n collapseColorScaleByDefault?: boolean;\r\n /** Property in the property object in mapData geoJson object is used to match to the id in the data object */\r\n mapProperty?: string;\r\n /** 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 ChoroplethMap(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 colorDomain,\r\n colorLegendTitle,\r\n scaleType = 'threshold',\r\n scale = 0.95,\r\n centerPoint,\r\n padding,\r\n mapBorderWidth = 0.5,\r\n mapNoDataColor = Colors.light.graphNoData,\r\n backgroundColor = false,\r\n mapBorderColor = Colors.light.grays['gray-500'],\r\n relativeHeight,\r\n tooltip,\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 highlightedIds = [],\r\n onSeriesMouseClick,\r\n mapProperty = 'ISO3',\r\n graphDownload = false,\r\n dataDownload = false,\r\n showAntarctica = false,\r\n language = 'en',\r\n minHeight = 0,\r\n theme = 'light',\r\n ariaLabel,\r\n resetSelectionOnDoubleClick = true,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n mapProjection = 'naturalEarth',\r\n zoomInteraction = 'button',\r\n animate = false,\r\n dimmedOpacity = 0.3,\r\n customLayers = [],\r\n timeline = { enabled: false, autoplay: false, showOnlyActiveDate: true },\r\n collapseColorScaleByDefault,\r\n projectionRotate = [0, 0],\r\n zoomAndCenterByHighlightedIds = false,\r\n rewindCoordinatesInMapData = true,\r\n } = props;\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 const domain =\r\n colorDomain ||\r\n (scaleType === 'categorical'\r\n ? getUniqValue(data, 'x')\r\n : getJenks(\r\n data.map(d => d.x as number | null | undefined),\r\n colors?.length || 4,\r\n ));\r\n\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 === format(new Date(uniqDatesSorted[index]), timeline.dateFormat || 'yyyy')\r\n : d,\r\n )}\r\n mapData={\r\n showAntarctica\r\n ? mapShape\r\n : {\r\n ...mapShape,\r\n features: mapShape.features.filter(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any) => el.properties.NAME !== 'Antarctica',\r\n ),\r\n }\r\n }\r\n colorDomain={domain}\r\n width={svgWidth}\r\n height={svgHeight}\r\n scale={scale}\r\n centerPoint={centerPoint}\r\n colors={\r\n colors ||\r\n (scaleType === 'categorical'\r\n ? Colors[theme].categoricalColors.colors\r\n : Colors[theme].sequentialColors[\r\n `neutralColorsx0${(domain.length + 1) as 4 | 5 | 6 | 7 | 8 | 9}`\r\n ])\r\n }\r\n colorLegendTitle={colorLegendTitle}\r\n mapBorderWidth={mapBorderWidth}\r\n mapNoDataColor={mapNoDataColor}\r\n categorical={scaleType === 'categorical'}\r\n mapBorderColor={mapBorderColor}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n isWorldMap={isWorldMap}\r\n showColorScale={showColorScale}\r\n zoomScaleExtend={zoomScaleExtend}\r\n zoomTranslateExtend={zoomTranslateExtend}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n mapProperty={mapProperty}\r\n highlightedIds={highlightedIds}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n styles={styles}\r\n classNames={classNames}\r\n detailsOnClick={detailsOnClick}\r\n mapProjection={mapProjection || (isWorldMap ? 'naturalEarth' : 'mercator')}\r\n zoomInteraction={zoomInteraction}\r\n dimmedOpacity={dimmedOpacity}\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 customLayers={customLayers}\r\n zoomAndCenterByHighlightedIds={zoomAndCenterByHighlightedIds}\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","colorDomain","colors","mapData","colorLegendTitle","categorical","height","width","scale","centerPoint","tooltip","mapBorderWidth","mapBorderColor","mapNoDataColor","onSeriesMouseOver","showColorScale","zoomScaleExtend","zoomTranslateExtend","highlightedIds","onSeriesMouseClick","mapProperty","resetSelectionOnDoubleClick","detailsOnClick","styles","classNames","mapProjection","zoomInteraction","animate","dimmedOpacity","customLayers","collapseColorScaleByDefault","zoomAndCenterByHighlightedIds","projectionRotate","rewindCoordinatesInMapData","formattedMapData","useMemo","rewind","reverse","selectedColor","setSelectedColor","useState","undefined","zoomRef","useRef","showLegend","setShowLegend","mouseClickData","setMouseClickData","mouseOverData","setMouseOverData","eventX","setEventX","eventY","setEventY","mapSvg","isInView","useInView","once","amount","mapG","colorScale","scaleOrdinal","domain","range","scaleThreshold","useEffect","mapGSelect","select","current","mapSvgSelect","zoomFilter","e","type","includes","isWheel","isTouch","startsWith","isDrag","ctrlKey","button","zoomBehavior","zoom","scaleExtent","translateExtent","filter","on","transform","attr","call","bounds","bbox","features","d","length","indexOf","properties","center","centerOfMass","lonDiff","latDiff","scaleX","scaleY","scaleVar","Math","min","projection","geoMercator","rotate","geometry","coordinates","translate","geoEqualEarth","geoNaturalEarth1","geoOrthographic","geoAlbersUsa","pathGenerator","geoPath","handleZoom","direction","scaleBy","jsxs","Fragment","jsx","motion","position","map","layer","i","path","stroke","strokeWidth","fill","AnimatePresence","index","findIndex","el","id","color","checkIfNullOrUndefined","x","initial","opacity","whileInView","transition","duration","event","clientY","clientX","isEqual","fillOpacity","cn","colorLegend","X","P","display","WebkitLineClamp","WebkitBoxOrient","backgroundColor","textAnchor","numberFormattingFunction","DetailsModal","modal","Tooltip","ChoroplethMap","$","_c","t0","graphTitle","sources","graphDescription","footNote","t1","scaleType","t2","t3","padding","t4","t5","t6","t7","relativeHeight","isWorldMap","t8","t9","t10","graphID","t11","t12","graphDownload","t13","dataDownload","t14","showAntarctica","t15","language","t16","minHeight","t17","theme","t18","ariaLabel","t19","t20","t21","t22","t23","t24","timeline","t25","t26","t27","t28","Colors","light","graphNoData","grays","t29","t30","t31","t32","enabled","autoplay","showOnlyActiveDate","t33","svgWidth","setSvgWidth","svgHeight","setSvgHeight","play","setPlay","dates","dateFormat","t34","d_0","parse","date","Date","getTime","Set","_temp","sort","_temp2","uniqDatesSorted","setIndex","mapShape","setMapShape","graphDiv","graphParentDiv","t35","Symbol","for","resizeObserver","ResizeObserver","entries","target","clientWidth","clientHeight","observe","disconnect","t36","shape","onUpdateShape","useEffectEvent","t37","fetchAndParseJSON","then","d_1","t38","t39","getUniqValue","getJenks","_temp3","t40","t41","speed","interval","setInterval","clearInterval","t42","t43","getSliderMarks","markObj","t44","graphContainer","t45","t46","description","title","GraphHeader","_temp4","_temp5","_temp6","_temp7","_temp8","t47","Pause","Play","SliderUI","nextValue","nextValue_0","t48","GraphArea","d_8","format","_temp9","categoricalColors","sequentialColors","max","Spinner","t49","footnote","source","GraphFooter","t50","GraphContainer","NAME","d_5","d_4","d_3","d_7","d_6","d_2","a","b"],"mappings":"ylCA8EO,SAASA,GAAMC,EAAc,CAClC,KAAM,CACJC,KAAAA,EACAC,YAAAA,EACAC,OAAAA,EACAC,QAAAA,EACAC,iBAAAA,EACAC,YAAAA,EACAC,OAAAA,EACAC,MAAAA,EACAC,MAAAA,EACAC,YAAAA,EACAC,QAAAA,EACAC,eAAAA,EACAC,eAAAA,GACAC,eAAAA,GACAC,kBAAAA,GACAC,eAAAA,GACAC,gBAAAA,GACAC,oBAAAA,GACAC,eAAAA,EACAC,mBAAAA,GACAC,YAAAA,EACAC,4BAAAA,GACAC,eAAAA,EACAC,OAAAA,GACAC,WAAAA,GACAC,cAAAA,EACAC,gBAAAA,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