@undp/data-viz 2.3.11 → 2.3.12
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.cjs.map +1 -1
- package/dist/BarGraph.js +4 -4
- package/dist/BarGraph.js.map +1 -1
- package/dist/BasicStatCard.cjs +1 -1
- package/dist/BasicStatCard.js +1 -1
- 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 +2 -2
- package/dist/BiVariateChoroplethMap.js.map +1 -1
- package/dist/BulletChart.cjs +1 -1
- package/dist/BulletChart.cjs.map +1 -1
- package/dist/BulletChart.js +2 -2
- package/dist/BulletChart.js.map +1 -1
- package/dist/ButterflyChart.cjs +1 -1
- package/dist/ButterflyChart.cjs.map +1 -1
- package/dist/ButterflyChart.js +39 -39
- package/dist/ButterflyChart.js.map +1 -1
- package/dist/ChoroplethMap.cjs +1 -1
- package/dist/ChoroplethMap.cjs.map +1 -1
- package/dist/ChoroplethMap.js +2 -2
- 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 +1 -1
- package/dist/ColorLegendWithMouseOver.cjs +1 -1
- package/dist/ColorLegendWithMouseOver.js +1 -1
- package/dist/DataCards.cjs +1 -1
- package/dist/DataCards.js +2 -2
- package/dist/DataTable.cjs +1 -1
- package/dist/DataTable.js +1 -1
- package/dist/DifferenceLineChart.cjs +1 -1
- package/dist/DifferenceLineChart.js +1 -1
- package/dist/DonutChart.cjs +1 -1
- package/dist/DonutChart.js +3 -3
- package/dist/DotDensityMap.cjs +1 -1
- package/dist/DotDensityMap.cjs.map +1 -1
- package/dist/DotDensityMap.js +19 -19
- 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.cjs.map +1 -1
- package/dist/DumbbellChart.js +2 -2
- package/dist/DumbbellChart.js.map +1 -1
- package/dist/{EmptyState-D807L58h.js → EmptyState-B3fPoH6L.js} +2 -2
- package/dist/{EmptyState-D807L58h.js.map → EmptyState-B3fPoH6L.js.map} +1 -1
- package/dist/{EmptyState-N1eHt3vq.cjs → EmptyState-B4c-CrXs.cjs} +2 -2
- package/dist/{EmptyState-N1eHt3vq.cjs.map → EmptyState-B4c-CrXs.cjs.map} +1 -1
- package/dist/FootNote.cjs +1 -1
- package/dist/FootNote.js +1 -1
- package/dist/GeoHubMapWithLayerSelection.cjs +1 -1
- package/dist/GeoHubMapWithLayerSelection.js +1 -1
- package/dist/GraphDescription.cjs +1 -1
- package/dist/GraphDescription.js +1 -1
- package/dist/{GraphEl-DvwOOhF1.cjs → GraphEl-Bgf8w82K.cjs} +2 -2
- package/dist/{GraphEl-DvwOOhF1.cjs.map → GraphEl-Bgf8w82K.cjs.map} +1 -1
- package/dist/{GraphEl-CT3xPv2P.js → GraphEl-CXK-LPsj.js} +3 -3
- package/dist/{GraphEl-CT3xPv2P.js.map → GraphEl-CXK-LPsj.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 +29 -29
- package/dist/HybridMap.js.map +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.cjs.map +1 -1
- package/dist/MultiLineAltChart.d.ts +2 -0
- package/dist/MultiLineAltChart.js +393 -391
- package/dist/MultiLineAltChart.js.map +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/SankeyChart.cjs +1 -1
- package/dist/SankeyChart.js +2 -2
- package/dist/ScatterPlot.cjs +1 -1
- package/dist/ScatterPlot.cjs.map +1 -1
- package/dist/ScatterPlot.d.ts +2 -0
- package/dist/ScatterPlot.js +439 -437
- package/dist/ScatterPlot.js.map +1 -1
- 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 +1 -1
- 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-24M277ZQ.cjs → Source-BOSAl3UX.cjs} +2 -2
- package/dist/{Source-24M277ZQ.cjs.map → Source-BOSAl3UX.cjs.map} +1 -1
- package/dist/{Source-eILIr4Ov.js → Source-Djkz-7jX.js} +2 -2
- package/dist/{Source-eILIr4Ov.js.map → Source-Djkz-7jX.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 +1 -1
- package/dist/StripChart.cjs +1 -1
- package/dist/StripChart.js +1 -1
- package/dist/ThreeDGlobe.cjs +1 -1
- package/dist/ThreeDGlobe.js +1 -1
- package/dist/ThresholdColorLegendWithMouseOver.cjs +1 -1
- package/dist/ThresholdColorLegendWithMouseOver.js +1 -1
- package/dist/TreeMapGraph.cjs +1 -1
- package/dist/TreeMapGraph.js +2 -2
- package/dist/Typography-CZZxlj1W.cjs +2 -0
- package/dist/Typography-CZZxlj1W.cjs.map +1 -0
- package/dist/{Typography-HicNIA61.js → Typography-DMVW6JnV.js} +67 -60
- package/dist/Typography-DMVW6JnV.js.map +1 -0
- package/dist/UnitChart.cjs +1 -1
- package/dist/UnitChart.js +1 -1
- package/dist/WaterfallChart.cjs +1 -1
- package/dist/WaterfallChart.js +1 -1
- package/dist/{index-B5ggV1vg.js → index-C6VwVS8W.js} +3 -3
- package/dist/{index-B5ggV1vg.js.map → index-C6VwVS8W.js.map} +1 -1
- package/dist/{index-BDR7MlMo.cjs → index-_TlgeI_i.cjs} +2 -2
- package/dist/{index-BDR7MlMo.cjs.map → index-_TlgeI_i.cjs.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +2 -2
- package/dist/style.css +1 -1
- package/package.json +2 -2
- package/dist/Typography-Cc_iHQB-.cjs +0 -2
- package/dist/Typography-Cc_iHQB-.cjs.map +0 -1
- package/dist/Typography-HicNIA61.js.map +0 -1
package/dist/DataTable.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-CHPV5EwG-6v2a2njQ.cjs"),jt=require("./index-DQA8q5sC.cjs"),g=require("react"),Rt=require("./index-CyZ1lmi_.cjs"),$=require("./Typography-Cc_iHQB-.cjs"),vt=require("./index-Cno4Q0YE.cjs"),V=require("./numberFormattingFunction-02t-wJta.cjs"),wt=require("./GraphFooter.cjs"),kt=require("./GraphHeader.cjs"),D=require("./index-sbKVyHS2.cjs"),at=require("./getTextColorBasedOnBgColor-nqY-bsM_.cjs"),Nt=require("./GraphContainer-B1EDxJ0S.cjs"),bt=c=>c.map(h=>h||1).reduce((h,j)=>h+j,0);function St(c){const t=r.compilerRuntimeExports.c(77),{width:m,height:h,graphTitle:j,sources:B,graphDescription:F,footNote:q,graphID:X,data:d,columnData:n,onSeriesMouseClick:b,language:ct,theme:lt,ariaLabel:Y,backgroundColor:pt,padding:J,resetSelectionOnDoubleClick:ut,styles:l,classNames:p,minWidth:T,naLabel:mt,precision:dt}=c,K=ct===void 0?"en":ct,Q=lt===void 0?"light":lt,U=pt===void 0?!1:pt,Z=ut===void 0?!0:ut,C=mt===void 0?"NA":mt,I=dt===void 0?2:dt,Ct=g.useRef(null),[x,xt]=g.useState(void 0),[z,ft]=g.useState(void 0),[f,gt]=g.useState("asc"),[y,ht]=g.useState(void 0);let W;t[0]===Symbol.for("react.memo_cache_sentinel")?(W={},t[0]=W):W=t[0];const[_,It]=g.useState(W);let G;t[1]!==n?(G=n.filter(Bt).map(Dt),t[1]=n,t[2]=G):G=t[2];const[a,yt]=g.useState(G),[tt,Et]=g.useState(d);let P;t[3]===Symbol.for("react.memo_cache_sentinel")?(P=o=>{Et(o)},t[3]=P):P=t[3];const A=g.useEffectEvent(P);let H;t[4]!==n||t[5]!==x||t[6]!==d||t[7]!==a||t[8]!==A||t[9]!==f?(H=()=>{const o=[];d.forEach(u=>{let e=!0;a.forEach(i=>{if(typeof u[i.id]!="object"&&typeof u[i.id]!="function"&&typeof u[i.id]!="symbol")if(n[n.findIndex(s=>s.columnId===i.id)].separator){const s=u[i.id].split(n[n.findIndex(st=>st.columnId===i.id)].separator);Rt.intersection(s,i.option).length===0&&(e=!1)}else i.option.indexOf(u[i.id])===-1&&(e=!1)}),e&&o.push(u)}),A(x&&d?vt.orderBy(o,[x],[f]):o)},t[4]=n,t[5]=x,t[6]=d,t[7]=a,t[8]=A,t[9]=f,t[10]=H):H=t[10];let L;t[11]!==n||t[12]!==x||t[13]!==d||t[14]!==a||t[15]!==f?(L=[x,f,d,a,n],t[11]=n,t[12]=x,t[13]=d,t[14]=a,t[15]=f,t[16]=L):L=t[16],g.useEffect(H,L);const et=p?.graphContainer,ot=l?.graphContainer;let E;t[17]!==p?.description||t[18]!==p?.title||t[19]!==F||t[20]!==j||t[21]!==l?.description||t[22]!==l?.title||t[23]!==m?(E=j||F?r.jsxRuntimeExports.jsx(kt.GraphHeader,{styles:{title:l?.title,description:l?.description},classNames:{title:p?.title,description:p?.description},graphTitle:j,graphDescription:F,width:m}):null,t[17]=p?.description,t[18]=p?.title,t[19]=F,t[20]=j,t[21]=l?.description,t[22]=l?.title,t[23]=m,t[24]=E):E=t[24];const rt=m?`${m}px`:"100%",it=h?`${h}px`:"auto";let R;t[25]!==rt||t[26]!==it?(R={width:rt,height:it},t[25]=rt,t[26]=it,t[27]=R):R=t[27];let v;t[28]!==T?(v=T?{minWidth:T}:void 0,t[28]=T,t[29]=v):v=t[29];let w;t[30]!==n||t[31]!==x||t[32]!==d||t[33]!==a||t[34]!==z||t[35]!==C||t[36]!==b||t[37]!==y||t[38]!==I||t[39]!==Z||t[40]!==f||t[41]!==tt?(w=d?r.jsxRuntimeExports.jsxs("table",{className:"w-full",style:{borderCollapse:"collapse"},children:[r.jsxRuntimeExports.jsx("thead",{className:"text-left bg-primary-gray-300 dark:bg-primary-gray-550",children:r.jsxRuntimeExports.jsx("tr",{children:n?.map((o,u)=>r.jsxRuntimeExports.jsx("th",{className:"text-primary-gray-700 dark:text-primary-gray-100 text-sm",style:{width:`calc(${100*(o.columnWidth||1)/bt(n.map($t))}%`},children:r.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 justify-between items-center p-4",children:[r.jsxRuntimeExports.jsx($._,{size:"sm",marginBottom:"none",className:`w-fit grow text-${o.align||"left"} font-bold`,children:o.columnTitle||o.columnId}),o.sortable?r.jsxRuntimeExports.jsx("button",{type:"button",className:"bg-transparent cursor-pointer p-0 m-0 border-0",onClick:()=>{x===o.columnId?(f==="asc"&>("desc"),f==="desc"&&xt(void 0)):(xt(o.columnId),gt("asc"))},children:x===o.columnId?f==="asc"?r.jsxRuntimeExports.jsx(D.SortingIconAscending,{}):r.jsxRuntimeExports.jsx(D.SortingIconDescending,{}):r.jsxRuntimeExports.jsx(D.SortingIcon,{})}):null,o.filterOptions&&o.filterOptions.length?r.jsxRuntimeExports.jsx("button",{type:"button",className:"bg-transparent cursor-pointer m-0 p-0 border-0",onClick:e=>{if(y===o.columnId)ht(void 0);else if(e.currentTarget){ht(o.columnId);const i=e.currentTarget.getBoundingClientRect();It({top:i.bottom+window.scrollY,left:i.left+window.scrollX-160<0?i.left+window.scrollX:i.left+window.scrollX-160,width:"10rem"})}},children:a[a.findIndex(e=>e.id===o.columnId)].option.length===o.filterOptions?.length?r.jsxRuntimeExports.jsx(D.FilterIcon,{}):r.jsxRuntimeExports.jsx(D.FilterIconApplied,{})}):null]})},u))})}),r.jsxRuntimeExports.jsx("tbody",{children:tt?.map((o,u)=>r.jsxRuntimeExports.jsx("tr",{className:`cursor-${b?"pointer":"auto"} border-b border-b-primary-gray-400 dark:border-b-primary-gray-500 ${jt.isEqual(z,o)?"bg-primary-gray-200 dark:bg-primary-gray-600":"bg-transparent"}`,style:o.rowStyle,onClick:()=>{b&&(jt.isEqual(z,o)&&Z?(ft(void 0),b(void 0)):(ft(o),b(o)))},children:n.map((e,i)=>r.jsxRuntimeExports.jsx("td",{className:`text-primary-gray-700 dark:text-primary-gray-100 text-sm text-${e.align||"left"}`,style:{width:`calc(${100*(o.columnWidth||1)/bt(n.map(Ot))}%`},children:r.jsxRuntimeExports.jsx("div",{className:`text-primary-gray-700 dark:text-primary-gray-100 flex p-4 ${e.align==="right"?"justify-end":e.align==="center"?"justify-center":"justify-start"}`,children:typeof o[e.columnId]=="number"?r.jsxRuntimeExports.jsx($._,{marginBottom:"none",size:"sm",className:`text-primary-gray-700 dark:text-primary-gray-100 w-fit ${e.chip?"grow-0 rounded-sm p-2":"grow rounded-none p-0"} text-${e.align||"left"} ${e.chip?e.chipColors?"":"bg-primary-gray-300 dark:bg-primary-gray-500":"bg-transparent"}`,style:{...e.chip&&e.chipColors?{backgroundColor:e.chipColors[e.chipColors.findIndex(s=>s.value===o[e.chipColumnId||e.columnId])].color,color:at.getTextColorBasedOnBgColor(e.chipColors[e.chipColors.findIndex(s=>s.value===o[e.chipColumnId||e.columnId])].color)}:{}},children:V.numberFormattingFunction(o[e.columnId],C,I,e.prefix,e.suffix)}):typeof o[e.columnId]=="string"?e.separator?r.jsxRuntimeExports.jsx("div",{className:"text-primary-gray-700 dark:text-primary-gray-100 flex flex-wrap gap-2",children:o[e.columnId].split(e.separator).map((s,st)=>r.jsxRuntimeExports.jsx($._,{marginBottom:"none",size:"sm",className:`text-primary-gray-700 dark:text-primary-gray-100 w-fit ${e.chip?"grow-0 rounded-sm p-2":"grow rounded-none p-0"} text-${e.align||"left"} ${e.chip?e.chipColors?"":"bg-primary-gray-300 dark:bg-primary-gray-500":"bg-transparent"}`,style:{...e.chip&&e.chipColors?{backgroundColor:e.chipColors[e.chipColors.findIndex(nt=>nt.value===(e.chipColumnId?o[e.chipColumnId]:s))].color,color:at.getTextColorBasedOnBgColor(e.chipColors[e.chipColors.findIndex(nt=>nt.value===(e.chipColumnId?o[e.chipColumnId]:s))].color)}:{}},children:V.numberFormattingFunction(s,C,I,e.prefix,e.suffix)},st))}):r.jsxRuntimeExports.jsx($._,{marginBottom:"none",size:"sm",className:`text-primary-gray-700 dark:text-primary-gray-100 w-fit ${e.chip?"grow-0 rounded-sm p-2":"grow rounded-none p-0"} text-${e.align||"left"} ${e.chip?e.chipColors?"":"bg-primary-gray-300 dark:bg-primary-gray-500":"bg-transparent"}`,style:{...e.chip&&e.chipColors?{backgroundColor:e.chipColors[e.chipColors.findIndex(s=>s.value===o[e.chipColumnId||e.columnId])].color,color:at.getTextColorBasedOnBgColor(e.chipColors[e.chipColors.findIndex(s=>s.value===o[e.chipColumnId||e.columnId])].color)}:{}},children:V.numberFormattingFunction(o[e.columnId],C,I,e.prefix,e.suffix)}):r.jsxRuntimeExports.jsx("div",{children:V.numberFormattingFunction(o[e.columnId],C,I,e.prefix,e.suffix)})})},i))},u))})]}):null,t[30]=n,t[31]=x,t[32]=d,t[33]=a,t[34]=z,t[35]=C,t[36]=b,t[37]=y,t[38]=I,t[39]=Z,t[40]=f,t[41]=tt,t[42]=w):w=t[42];let k;t[43]!==v||t[44]!==w?(k=r.jsxRuntimeExports.jsx("div",{style:v,children:w}),t[43]=v,t[44]=w,t[45]=k):k=t[45];let N;t[46]!==R||t[47]!==k?(N=r.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center",children:r.jsxRuntimeExports.jsx("div",{className:"undp-scrollbar",style:R,children:k})}),t[46]=R,t[47]=k,t[48]=N):N=t[48];let S;t[49]!==p?.footnote||t[50]!==p?.source||t[51]!==q||t[52]!==B||t[53]!==l?.footnote||t[54]!==l?.source||t[55]!==m?(S=B||q?r.jsxRuntimeExports.jsx(wt.GraphFooter,{styles:{footnote:l?.footnote,source:l?.source},classNames:{footnote:p?.footnote,source:p?.source},sources:B,footNote:q,width:m}):null,t[49]=p?.footnote,t[50]=p?.source,t[51]=q,t[52]=B,t[53]=l?.footnote,t[54]=l?.source,t[55]=m,t[56]=S):S=t[56];let O;t[57]!==n||t[58]!==a||t[59]!==_||t[60]!==y?(O=y&&r.jsxRuntimeExports.jsx("div",{style:_,className:"absolute p-3 border z-[1000] rounded-sm bg-primary-white dark:bg-primary-gray-700 border-primary-gray-300 dark:border-primary-gray-550",children:r.jsxRuntimeExports.jsxs("div",{className:"max-w-60",children:[r.jsxRuntimeExports.jsx($._,{size:"sm",marginBottom:"2xs",className:"font-bold",children:"Filter data by"}),r.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-2",children:n[n.findIndex(o=>o.columnId===y)].filterOptions?.map((o,u)=>r.jsxRuntimeExports.jsx("div",{children:r.jsxRuntimeExports.jsxs("label",{className:"undp-viz-label",children:[r.jsxRuntimeExports.jsx("input",{type:"checkbox",className:"undp-viz-checkbox",checked:a[a.findIndex(e=>e.id===y)].option.indexOf(o)!==-1,onChange:()=>{const e=a.findIndex(s=>s.id===y),i=[...a[e].option];if(i.indexOf(o)!==-1){i.splice(i.indexOf(o),1);const s=[...a];s[e].option=i,yt(s)}else{i.push(o);const s=[...a];s[e].option=i,yt(s)}}}),o]},u)},u))})]})}),t[57]=n,t[58]=a,t[59]=_,t[60]=y,t[61]=O):O=t[61];let M;return t[62]!==Y||t[63]!==U||t[64]!==X||t[65]!==h||t[66]!==K||t[67]!==J||t[68]!==et||t[69]!==ot||t[70]!==E||t[71]!==N||t[72]!==S||t[73]!==O||t[74]!==Q||t[75]!==m?(M=r.jsxRuntimeExports.jsxs(Nt.GraphContainer,{className:et,style:ot,id:X,ref:Ct,"aria-label":Y,backgroundColor:U,theme:Q,language:K,width:m,height:h,padding:J,children:[E,N,S,O]}),t[62]=Y,t[63]=U,t[64]=X,t[65]=h,t[66]=K,t[67]=J,t[68]=et,t[69]=ot,t[70]=E,t[71]=N,t[72]=S,t[73]=O,t[74]=Q,t[75]=m,t[76]=M):M=t[76],M}function Ot(c){return c.columnWidth||1}function $t(c){return c.columnWidth||1}function Dt(c){return{id:c.columnId,option:c.filterOptions}}function Bt(c){return c.filterOptions&&c.filterOptions.length>0}exports.DataTable=St;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-CHPV5EwG-6v2a2njQ.cjs"),jt=require("./index-DQA8q5sC.cjs"),g=require("react"),Rt=require("./index-CyZ1lmi_.cjs"),$=require("./Typography-CZZxlj1W.cjs"),vt=require("./index-Cno4Q0YE.cjs"),V=require("./numberFormattingFunction-02t-wJta.cjs"),wt=require("./GraphFooter.cjs"),kt=require("./GraphHeader.cjs"),D=require("./index-sbKVyHS2.cjs"),at=require("./getTextColorBasedOnBgColor-nqY-bsM_.cjs"),Nt=require("./GraphContainer-B1EDxJ0S.cjs"),bt=c=>c.map(h=>h||1).reduce((h,j)=>h+j,0);function St(c){const t=r.compilerRuntimeExports.c(77),{width:m,height:h,graphTitle:j,sources:B,graphDescription:F,footNote:q,graphID:X,data:d,columnData:n,onSeriesMouseClick:b,language:ct,theme:lt,ariaLabel:Y,backgroundColor:pt,padding:J,resetSelectionOnDoubleClick:ut,styles:l,classNames:p,minWidth:T,naLabel:mt,precision:dt}=c,K=ct===void 0?"en":ct,Q=lt===void 0?"light":lt,U=pt===void 0?!1:pt,Z=ut===void 0?!0:ut,C=mt===void 0?"NA":mt,I=dt===void 0?2:dt,Ct=g.useRef(null),[x,xt]=g.useState(void 0),[z,ft]=g.useState(void 0),[f,gt]=g.useState("asc"),[y,ht]=g.useState(void 0);let W;t[0]===Symbol.for("react.memo_cache_sentinel")?(W={},t[0]=W):W=t[0];const[_,It]=g.useState(W);let G;t[1]!==n?(G=n.filter(Bt).map(Dt),t[1]=n,t[2]=G):G=t[2];const[a,yt]=g.useState(G),[tt,Et]=g.useState(d);let P;t[3]===Symbol.for("react.memo_cache_sentinel")?(P=o=>{Et(o)},t[3]=P):P=t[3];const A=g.useEffectEvent(P);let H;t[4]!==n||t[5]!==x||t[6]!==d||t[7]!==a||t[8]!==A||t[9]!==f?(H=()=>{const o=[];d.forEach(u=>{let e=!0;a.forEach(i=>{if(typeof u[i.id]!="object"&&typeof u[i.id]!="function"&&typeof u[i.id]!="symbol")if(n[n.findIndex(s=>s.columnId===i.id)].separator){const s=u[i.id].split(n[n.findIndex(st=>st.columnId===i.id)].separator);Rt.intersection(s,i.option).length===0&&(e=!1)}else i.option.indexOf(u[i.id])===-1&&(e=!1)}),e&&o.push(u)}),A(x&&d?vt.orderBy(o,[x],[f]):o)},t[4]=n,t[5]=x,t[6]=d,t[7]=a,t[8]=A,t[9]=f,t[10]=H):H=t[10];let L;t[11]!==n||t[12]!==x||t[13]!==d||t[14]!==a||t[15]!==f?(L=[x,f,d,a,n],t[11]=n,t[12]=x,t[13]=d,t[14]=a,t[15]=f,t[16]=L):L=t[16],g.useEffect(H,L);const et=p?.graphContainer,ot=l?.graphContainer;let E;t[17]!==p?.description||t[18]!==p?.title||t[19]!==F||t[20]!==j||t[21]!==l?.description||t[22]!==l?.title||t[23]!==m?(E=j||F?r.jsxRuntimeExports.jsx(kt.GraphHeader,{styles:{title:l?.title,description:l?.description},classNames:{title:p?.title,description:p?.description},graphTitle:j,graphDescription:F,width:m}):null,t[17]=p?.description,t[18]=p?.title,t[19]=F,t[20]=j,t[21]=l?.description,t[22]=l?.title,t[23]=m,t[24]=E):E=t[24];const rt=m?`${m}px`:"100%",it=h?`${h}px`:"auto";let R;t[25]!==rt||t[26]!==it?(R={width:rt,height:it},t[25]=rt,t[26]=it,t[27]=R):R=t[27];let v;t[28]!==T?(v=T?{minWidth:T}:void 0,t[28]=T,t[29]=v):v=t[29];let w;t[30]!==n||t[31]!==x||t[32]!==d||t[33]!==a||t[34]!==z||t[35]!==C||t[36]!==b||t[37]!==y||t[38]!==I||t[39]!==Z||t[40]!==f||t[41]!==tt?(w=d?r.jsxRuntimeExports.jsxs("table",{className:"w-full",style:{borderCollapse:"collapse"},children:[r.jsxRuntimeExports.jsx("thead",{className:"text-left bg-primary-gray-300 dark:bg-primary-gray-550",children:r.jsxRuntimeExports.jsx("tr",{children:n?.map((o,u)=>r.jsxRuntimeExports.jsx("th",{className:"text-primary-gray-700 dark:text-primary-gray-100 text-sm",style:{width:`calc(${100*(o.columnWidth||1)/bt(n.map($t))}%`},children:r.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 justify-between items-center p-4",children:[r.jsxRuntimeExports.jsx($._,{size:"sm",marginBottom:"none",className:`w-fit grow text-${o.align||"left"} font-bold`,children:o.columnTitle||o.columnId}),o.sortable?r.jsxRuntimeExports.jsx("button",{type:"button",className:"bg-transparent cursor-pointer p-0 m-0 border-0",onClick:()=>{x===o.columnId?(f==="asc"&>("desc"),f==="desc"&&xt(void 0)):(xt(o.columnId),gt("asc"))},children:x===o.columnId?f==="asc"?r.jsxRuntimeExports.jsx(D.SortingIconAscending,{}):r.jsxRuntimeExports.jsx(D.SortingIconDescending,{}):r.jsxRuntimeExports.jsx(D.SortingIcon,{})}):null,o.filterOptions&&o.filterOptions.length?r.jsxRuntimeExports.jsx("button",{type:"button",className:"bg-transparent cursor-pointer m-0 p-0 border-0",onClick:e=>{if(y===o.columnId)ht(void 0);else if(e.currentTarget){ht(o.columnId);const i=e.currentTarget.getBoundingClientRect();It({top:i.bottom+window.scrollY,left:i.left+window.scrollX-160<0?i.left+window.scrollX:i.left+window.scrollX-160,width:"10rem"})}},children:a[a.findIndex(e=>e.id===o.columnId)].option.length===o.filterOptions?.length?r.jsxRuntimeExports.jsx(D.FilterIcon,{}):r.jsxRuntimeExports.jsx(D.FilterIconApplied,{})}):null]})},u))})}),r.jsxRuntimeExports.jsx("tbody",{children:tt?.map((o,u)=>r.jsxRuntimeExports.jsx("tr",{className:`cursor-${b?"pointer":"auto"} border-b border-b-primary-gray-400 dark:border-b-primary-gray-500 ${jt.isEqual(z,o)?"bg-primary-gray-200 dark:bg-primary-gray-600":"bg-transparent"}`,style:o.rowStyle,onClick:()=>{b&&(jt.isEqual(z,o)&&Z?(ft(void 0),b(void 0)):(ft(o),b(o)))},children:n.map((e,i)=>r.jsxRuntimeExports.jsx("td",{className:`text-primary-gray-700 dark:text-primary-gray-100 text-sm text-${e.align||"left"}`,style:{width:`calc(${100*(o.columnWidth||1)/bt(n.map(Ot))}%`},children:r.jsxRuntimeExports.jsx("div",{className:`text-primary-gray-700 dark:text-primary-gray-100 flex p-4 ${e.align==="right"?"justify-end":e.align==="center"?"justify-center":"justify-start"}`,children:typeof o[e.columnId]=="number"?r.jsxRuntimeExports.jsx($._,{marginBottom:"none",size:"sm",className:`text-primary-gray-700 dark:text-primary-gray-100 w-fit ${e.chip?"grow-0 rounded-sm p-2":"grow rounded-none p-0"} text-${e.align||"left"} ${e.chip?e.chipColors?"":"bg-primary-gray-300 dark:bg-primary-gray-500":"bg-transparent"}`,style:{...e.chip&&e.chipColors?{backgroundColor:e.chipColors[e.chipColors.findIndex(s=>s.value===o[e.chipColumnId||e.columnId])].color,color:at.getTextColorBasedOnBgColor(e.chipColors[e.chipColors.findIndex(s=>s.value===o[e.chipColumnId||e.columnId])].color)}:{}},children:V.numberFormattingFunction(o[e.columnId],C,I,e.prefix,e.suffix)}):typeof o[e.columnId]=="string"?e.separator?r.jsxRuntimeExports.jsx("div",{className:"text-primary-gray-700 dark:text-primary-gray-100 flex flex-wrap gap-2",children:o[e.columnId].split(e.separator).map((s,st)=>r.jsxRuntimeExports.jsx($._,{marginBottom:"none",size:"sm",className:`text-primary-gray-700 dark:text-primary-gray-100 w-fit ${e.chip?"grow-0 rounded-sm p-2":"grow rounded-none p-0"} text-${e.align||"left"} ${e.chip?e.chipColors?"":"bg-primary-gray-300 dark:bg-primary-gray-500":"bg-transparent"}`,style:{...e.chip&&e.chipColors?{backgroundColor:e.chipColors[e.chipColors.findIndex(nt=>nt.value===(e.chipColumnId?o[e.chipColumnId]:s))].color,color:at.getTextColorBasedOnBgColor(e.chipColors[e.chipColors.findIndex(nt=>nt.value===(e.chipColumnId?o[e.chipColumnId]:s))].color)}:{}},children:V.numberFormattingFunction(s,C,I,e.prefix,e.suffix)},st))}):r.jsxRuntimeExports.jsx($._,{marginBottom:"none",size:"sm",className:`text-primary-gray-700 dark:text-primary-gray-100 w-fit ${e.chip?"grow-0 rounded-sm p-2":"grow rounded-none p-0"} text-${e.align||"left"} ${e.chip?e.chipColors?"":"bg-primary-gray-300 dark:bg-primary-gray-500":"bg-transparent"}`,style:{...e.chip&&e.chipColors?{backgroundColor:e.chipColors[e.chipColors.findIndex(s=>s.value===o[e.chipColumnId||e.columnId])].color,color:at.getTextColorBasedOnBgColor(e.chipColors[e.chipColors.findIndex(s=>s.value===o[e.chipColumnId||e.columnId])].color)}:{}},children:V.numberFormattingFunction(o[e.columnId],C,I,e.prefix,e.suffix)}):r.jsxRuntimeExports.jsx("div",{children:V.numberFormattingFunction(o[e.columnId],C,I,e.prefix,e.suffix)})})},i))},u))})]}):null,t[30]=n,t[31]=x,t[32]=d,t[33]=a,t[34]=z,t[35]=C,t[36]=b,t[37]=y,t[38]=I,t[39]=Z,t[40]=f,t[41]=tt,t[42]=w):w=t[42];let k;t[43]!==v||t[44]!==w?(k=r.jsxRuntimeExports.jsx("div",{style:v,children:w}),t[43]=v,t[44]=w,t[45]=k):k=t[45];let N;t[46]!==R||t[47]!==k?(N=r.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center",children:r.jsxRuntimeExports.jsx("div",{className:"undp-scrollbar",style:R,children:k})}),t[46]=R,t[47]=k,t[48]=N):N=t[48];let S;t[49]!==p?.footnote||t[50]!==p?.source||t[51]!==q||t[52]!==B||t[53]!==l?.footnote||t[54]!==l?.source||t[55]!==m?(S=B||q?r.jsxRuntimeExports.jsx(wt.GraphFooter,{styles:{footnote:l?.footnote,source:l?.source},classNames:{footnote:p?.footnote,source:p?.source},sources:B,footNote:q,width:m}):null,t[49]=p?.footnote,t[50]=p?.source,t[51]=q,t[52]=B,t[53]=l?.footnote,t[54]=l?.source,t[55]=m,t[56]=S):S=t[56];let O;t[57]!==n||t[58]!==a||t[59]!==_||t[60]!==y?(O=y&&r.jsxRuntimeExports.jsx("div",{style:_,className:"absolute p-3 border z-[1000] rounded-sm bg-primary-white dark:bg-primary-gray-700 border-primary-gray-300 dark:border-primary-gray-550",children:r.jsxRuntimeExports.jsxs("div",{className:"max-w-60",children:[r.jsxRuntimeExports.jsx($._,{size:"sm",marginBottom:"2xs",className:"font-bold",children:"Filter data by"}),r.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-2",children:n[n.findIndex(o=>o.columnId===y)].filterOptions?.map((o,u)=>r.jsxRuntimeExports.jsx("div",{children:r.jsxRuntimeExports.jsxs("label",{className:"undp-viz-label",children:[r.jsxRuntimeExports.jsx("input",{type:"checkbox",className:"undp-viz-checkbox",checked:a[a.findIndex(e=>e.id===y)].option.indexOf(o)!==-1,onChange:()=>{const e=a.findIndex(s=>s.id===y),i=[...a[e].option];if(i.indexOf(o)!==-1){i.splice(i.indexOf(o),1);const s=[...a];s[e].option=i,yt(s)}else{i.push(o);const s=[...a];s[e].option=i,yt(s)}}}),o]},u)},u))})]})}),t[57]=n,t[58]=a,t[59]=_,t[60]=y,t[61]=O):O=t[61];let M;return t[62]!==Y||t[63]!==U||t[64]!==X||t[65]!==h||t[66]!==K||t[67]!==J||t[68]!==et||t[69]!==ot||t[70]!==E||t[71]!==N||t[72]!==S||t[73]!==O||t[74]!==Q||t[75]!==m?(M=r.jsxRuntimeExports.jsxs(Nt.GraphContainer,{className:et,style:ot,id:X,ref:Ct,"aria-label":Y,backgroundColor:U,theme:Q,language:K,width:m,height:h,padding:J,children:[E,N,S,O]}),t[62]=Y,t[63]=U,t[64]=X,t[65]=h,t[66]=K,t[67]=J,t[68]=et,t[69]=ot,t[70]=E,t[71]=N,t[72]=S,t[73]=O,t[74]=Q,t[75]=m,t[76]=M):M=t[76],M}function Ot(c){return c.columnWidth||1}function $t(c){return c.columnWidth||1}function Dt(c){return{id:c.columnId,option:c.filterOptions}}function Bt(c){return c.filterOptions&&c.filterOptions.length>0}exports.DataTable=St;
|
|
2
2
|
//# sourceMappingURL=DataTable.cjs.map
|
package/dist/DataTable.js
CHANGED
|
@@ -2,7 +2,7 @@ import { c as vt, j as i } from "./index-CHPV5EwG-BCLAYDCV.js";
|
|
|
2
2
|
import { i as yt } from "./index-Bwrro8-q.js";
|
|
3
3
|
import { useRef as kt, useState as y, useEffectEvent as wt, useEffect as Nt } from "react";
|
|
4
4
|
import { i as $t } from "./index-BuwmuDFJ.js";
|
|
5
|
-
import { _ as B } from "./Typography-
|
|
5
|
+
import { _ as B } from "./Typography-DMVW6JnV.js";
|
|
6
6
|
import { o as Ot } from "./index-BZQYSqar.js";
|
|
7
7
|
import { n as V } from "./numberFormattingFunction-14YCbkN2.js";
|
|
8
8
|
import { GraphFooter as Dt } from "./GraphFooter.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-CHPV5EwG-6v2a2njQ.cjs"),L=require("react"),C=require("./parse-xYI9yrvL.cjs"),xi=require("./index-Cno4Q0YE.cjs"),ei=require("./numberFormattingFunction-02t-wJta.cjs"),mi=require("./Tooltip-BLa2EfMs.cjs"),qt=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),ii=require("./customArea-B1LWQBmM.cjs"),di=require("./AxisTitle-DV4n0RxE.cjs"),fi=require("./Axis-Jt_tmhxS.cjs"),pi=require("./XTicksAndGridLines-CekrPykD.cjs"),hi=require("./ReferenceLine-M9aP3dj-.cjs"),yi=require("./YTicksAndGridLines-UzVC5eBM.cjs"),gi=require("./index-D69M6klB.cjs"),ji=require("./time-CkcKbhwe.cjs"),vi=require("./linear-CgUCbw9F.cjs"),ni=require("./line-DaEMhXmx.cjs"),He=require("./step-BZ3C8QFW.cjs"),oi=require("./area-C1gxfNGD.cjs"),wi=require("./select-Bnfk0lJx.cjs"),D=require("./proxy-C4-uo6nS.cjs"),Ri=require("./init-DU0ybBc_.cjs"),bi=require("./pointer-Dkq5NV1q.cjs"),Ei=require("./use-in-view-C3o_ntMv.cjs"),Oi=require("./GraphFooter.cjs"),Ci=require("./GraphHeader.cjs"),Ai=require("./ColorLegend.cjs"),We=require("./Colors.cjs"),Vi=require("./generateRandomString-B5zBiJzS.cjs"),Li=require("./EmptyState-N1eHt3vq.cjs"),si=require("./GraphContainer-B1EDxJ0S.cjs"),Si=require("./getNoOfTicks-C_1CFXv_.cjs");function ki(r){const t=s.compilerRuntimeExports.c(217),{data:j,width:rt,height:$t,lineColors:c,suffix:O,prefix:w,dateFormat:x,showValues:R,noOfXTicks:Mt,rightMargin:Ft,leftMargin:S,topMargin:Gt,bottomMargin:wt,tooltip:B,highlightAreaSettings:Pt,onSeriesMouseOver:Ht,animate:i,rtl:z,showColorLegendAtTop:Wt,colorDomain:$,diffAreaColors:I,idSuffix:lt,strokeWidth:M,showDots:F,refValues:Rt,minValue:N,maxValue:bt,annotations:Yt,customHighlightAreaSettings:Xt,yAxisTitle:T,noOfYTicks:de,minDate:Ut,maxDate:Et,curveType:Ot,styles:h,classNames:d,precision:E,customLayers:G}=r,Ct=L.useRef(null);let J;t[0]!==i.amount||t[1]!==i.once?(J={once:i.once,amount:i.amount},t[0]=i.amount,t[1]=i.once,t[2]=J):J=t[2];const u=Ei.useInView(Ct,J),[f,se]=L.useState(!1);let At,ct;t[3]!==i.duration||t[4]!==f||t[5]!==u?(At=()=>{if(u&&!f){const o=setTimeout(()=>{se(!0)},(i.duration+.5)*1e3);return()=>clearTimeout(o)}},ct=[u,f,i.duration],t[3]=i.duration,t[4]=f,t[5]=u,t[6]=At,t[7]=ct):(At=t[6],ct=t[7]),L.useEffect(At,ct);const K=Ot==="linear"?ni.curveLinear:Ot==="step"?He.curveStep:Ot==="stepAfter"?He.stepAfter:Ot==="stepBefore"?He.stepBefore:He.monotoneX,[k,g]=L.useState(void 0),[p,ae]=L.useState(void 0),[Q,Bt]=L.useState(void 0),Vt=T?S+30:S;let ut;t[8]!==wt||t[9]!==Ft||t[10]!==Vt||t[11]!==Gt?(ut={top:Gt,bottom:wt,left:Vt,right:Ft},t[8]=wt,t[9]=Ft,t[10]=Vt,t[11]=Gt,t[12]=ut):ut=t[12];const y=ut,xt=L.useRef(null);let Z;t[13]!==x?(Z=o=>({...o,date:C.parse(`${o.date}`,x,new Date)}),t[13]=x,t[14]=Z):Z=t[14];const n=xi.orderBy(j.map(Z),["date"],["asc"]);let mt;if(t[15]!==x||t[16]!==Pt){let o;t[18]!==x?(o=e=>({...e,coordinates:[e.coordinates[0]===null?null:C.parse(`${e.coordinates[0]}`,x,new Date),e.coordinates[1]===null?null:C.parse(`${e.coordinates[1]}`,x,new Date)]}),t[18]=x,t[19]=o):o=t[19],mt=Pt.map(o),t[15]=x,t[16]=Pt,t[17]=mt}else mt=t[17];const Lt=mt;let dt;if(t[20]!==Xt||t[21]!==x){let o;t[23]!==x?(o=e=>({...e,coordinates:e.coordinates.map((U,Tt)=>Tt%2===0?C.parse(`${U}`,x,new Date):U)}),t[23]=x,t[24]=o):o=t[24],dt=Xt.map(o),t[20]=Xt,t[21]=x,t[22]=dt}else dt=t[22];const re=dt,m=rt-y.left-y.right,v=$t-y.top-y.bottom,le=Ut?C.parse(`${Ut}`,x,new Date):n[0].date,zt=Et?C.parse(`${Et}`,x,new Date):n[n.length-1].date,_=Math.min(...n.map(zi))!==1/0?Math.min(...n.map(Bi))>0?0:Math.min(...n.map(Ui)):0,tt=Math.min(...n.map(Xi))!==1/0?Math.min(...n.map(Yi))>0?0:Math.min(...n.map(Wi)):0,P=Math.max(...n.map(Hi))!==1/0?Math.max(...n.map(Pi)):0,Jt=Math.max(...n.map(Gi))!==1/0?Math.max(...n.map(Fi)):0;let q;t[25]!==_||t[26]!==tt||t[27]!==N?(q=qt.checkIfNullOrUndefined(N)?_<tt?_:tt:N,t[25]=_,t[26]=tt,t[27]=N,t[28]=q):q=t[28];const b=q,et=P>Jt?P:Jt,a=ji.time().domain([le,zt]).range([0,m]);let ft;t[29]!==b||t[30]!==N?(ft=qt.checkIfNullOrUndefined(N)?b:N,t[29]=b,t[30]=N,t[31]=ft):ft=t[31];let it;t[32]!==et||t[33]!==bt?(it=qt.checkIfNullOrUndefined(bt)?et>0?et:0:bt,t[32]=et,t[33]=bt,t[34]=it):it=t[34];const l=vi.linear().domain([ft,it]).range([v,0]).nice(),pt=ni.line().x(o=>a(o.date)).y(o=>l(o.y1)).curve(K),Kt=ni.line().x(o=>a(o.date)).y(o=>l(o.y2)).curve(K),St=oi.area().x(o=>a(o.date)).y1(o=>l(o.y1)).y0(o=>l(o.y2)).curve(K),ce=oi.area().x(o=>a(o.date)).y1(o=>l(o.y1)).y0(0).curve(K),ue=oi.area().x(o=>a(o.date)).y1(o=>l(o.y2)).y0(0).curve(K),Qt=l.ticks(de),Zt=a.ticks(Mt);L.useEffect(()=>{const o=U=>{const Tt=n[Ri.bisectCenter(n.map(Mi),a.invert(bi.pointer(U)[0]),0)];g(Tt||n[n.length-1]),Ht?.(Tt||n[n.length-1]),Bt(U.clientY),ae(U.clientX)},e=()=>{g(void 0),ae(void 0),Bt(void 0),Ht?.(void 0)};wi.select(xt.current).on("mousemove",o).on("mouseout",e)},[a,n,Ht]);let ht;t[35]===Symbol.for("react.memo_cache_sentinel")?(ht={fill:"none"},t[35]=ht):ht=t[35];let nt;t[36]===Symbol.for("react.memo_cache_sentinel")?(nt={fill:"none"},t[36]=nt):nt=t[36];let yt;t[37]!==i||t[38]!==v||t[39]!==m||t[40]!==Lt||t[41]!==u||t[42]!==a?(yt=s.jsxRuntimeExports.jsx(gi.HighlightArea,{areaSettings:Lt,width:m,height:v,scale:a,animate:i,isInView:u}),t[37]=i,t[38]=v,t[39]=m,t[40]=Lt,t[41]=u,t[42]=a,t[43]=yt):yt=t[43];const ot=h?.yAxis?.gridLines,xe=h?.yAxis?.labels;let st;t[44]!==ot||t[45]!==xe?(st={gridLines:ot,labels:xe},t[44]=ot,t[45]=xe,t[46]=st):st=t[46];const me=d?.yAxis?.gridLines,kt=d?.yAxis?.labels;let Dt;t[47]!==me||t[48]!==kt?(Dt={gridLines:me,labels:kt},t[47]=me,t[48]=kt,t[49]=Dt):Dt=t[49];const gt=l(b<0?0:b),jt=l(b<0?0:b),It=0-S,Nt=m+y.right,H=b<0?0:b;let A;t[50]!==E||t[51]!==w||t[52]!==O||t[53]!==H?(A=ei.numberFormattingFunction(H,"NA",E,w,O),t[50]=E,t[51]=w,t[52]=O,t[53]=H,t[54]=A):A=t[54];const W=0-S,Y=l(b<0?0:b),X=et<0?"1rem":-5;let V;t[55]!==W||t[56]!==Y||t[57]!==X?(V={x:W,y:Y,dx:0,dy:X},t[55]=W,t[56]=Y,t[57]=X,t[58]=V):V=t[58];const vt=d?.xAxis?.axis,_t=d?.yAxis?.labels;let at;t[59]!==vt||t[60]!==_t?(at={axis:vt,label:_t},t[59]=vt,t[60]=_t,t[61]=at):at=t[61];const Ye=h?.xAxis?.axis,Xe=h?.yAxis?.labels;let te;t[62]!==Ye||t[63]!==Xe?(te={axis:Ye,label:Xe},t[62]=Ye,t[63]=Xe,t[64]=te):te=t[64];let fe;t[65]!==gt||t[66]!==jt||t[67]!==It||t[68]!==Nt||t[69]!==A||t[70]!==V||t[71]!==at||t[72]!==te?(fe=s.jsxRuntimeExports.jsx(fi.Axis,{y1:gt,y2:jt,x1:It,x2:Nt,label:A,labelPos:V,classNames:at,styles:te}),t[65]=gt,t[66]=jt,t[67]=It,t[68]=Nt,t[69]=A,t[70]=V,t[71]=at,t[72]=te,t[73]=fe):fe=t[73];const Ue=0-S-15,Be=v/2,ze=h?.yAxis?.title,Je=d?.yAxis?.title;let pe;t[74]!==Ue||t[75]!==Be||t[76]!==ze||t[77]!==Je||t[78]!==T?(pe=s.jsxRuntimeExports.jsx(di.AxisTitle,{x:Ue,y:Be,style:ze,className:Je,text:T,rotate90:!0}),t[74]=Ue,t[75]=Be,t[76]=ze,t[77]=Je,t[78]=T,t[79]=pe):pe=t[79];let he;t[80]!==x?(he=o=>C.format(o,x),t[80]=x,t[81]=he):he=t[81];const ai=Zt.map(he),ri=Zt.map(o=>a(o)),Ke=h?.xAxis?.gridLines,Qe=h?.xAxis?.labels;let ye;t[82]!==Ke||t[83]!==Qe?(ye={gridLines:Ke,labels:Qe},t[82]=Ke,t[83]=Qe,t[84]=ye):ye=t[84];const Ze=d?.xAxis?.gridLines;let ee;t[85]!==Ze?(ee=s.mo("opacity-0",Ze),t[85]=Ze,t[86]=ee):ee=t[86];const _e=d?.xAxis?.labels;let ie;t[87]!==_e?(ie=s.mo("fill-primary-gray-700 dark:fill-primary-gray-300 xs:max-[360px]:hidden text-[9px] md:text-[10px] lg:text-xs",_e),t[87]=_e,t[88]=ie):ie=t[88];let ge;t[89]!==ee||t[90]!==ie?(ge={gridLines:ee,labels:ie},t[89]=ee,t[90]=ie,t[91]=ge):ge=t[91];let je;t[92]!==G?(je=G.filter(Ti).map(Ni),t[92]=G,t[93]=je):je=t[93];let ve;t[94]!==I[1]?(ve={fill:I[1]},t[94]=I[1],t[95]=ve):ve=t[95];let we;t[96]!==i.duration?(we={opacity:0,transition:{duration:i.duration}},t[96]=i.duration,t[97]=we):we=t[97];let Re;t[98]===Symbol.for("react.memo_cache_sentinel")?(Re={opacity:1},t[98]=Re):Re=t[98];let be;t[99]!==i.duration?(be={initial:Re,whileInView:{opacity:1,transition:{duration:i.duration}}},t[99]=i.duration,t[100]=be):be=t[100];let Ee;t[101]!==I[0]?(Ee={fill:I[0]},t[101]=I[0],t[102]=Ee):Ee=t[102];let Oe;t[103]!==i.duration?(Oe={opacity:0,transition:{duration:i.duration}},t[103]=i.duration,t[104]=Oe):Oe=t[104];let Ce;t[105]===Symbol.for("react.memo_cache_sentinel")?(Ce={opacity:0},t[105]=Ce):Ce=t[105];let Ae;t[106]!==i.duration?(Ae={initial:Ce,whileInView:{opacity:1,transition:{duration:i.duration}}},t[106]=i.duration,t[107]=Ae):Ae=t[107];let Ve;t[108]!==c[0]||t[109]!==M?(Ve={fill:"none",stroke:c[0],strokeWidth:M},t[108]=c[0],t[109]=M,t[110]=Ve):Ve=t[110];let Le;t[111]!==i.duration?(Le={opacity:0,transition:{duration:i.duration}},t[111]=i.duration,t[112]=Le):Le=t[112];let Se;t[113]!==c[1]||t[114]!==M?(Se={fill:"none",stroke:c[1],strokeWidth:M},t[113]=c[1],t[114]=M,t[115]=Se):Se=t[115];let ke;t[116]!==i.duration?(ke={opacity:0,transition:{duration:i.duration}},t[116]=i.duration,t[117]=ke):ke=t[117];const li=1,ti=Kt(n)||"";let ne;t[118]!==i.duration?(ne={duration:i.duration},t[118]=i.duration,t[119]=ne):ne=t[119];let De;t[120]!==ti||t[121]!==ne?(De={pathLength:li,d:ti,opacity:1,transition:ne},t[120]=ti,t[121]=ne,t[122]=De):De=t[122];let Ie;t[123]!==i.duration||t[124]!==$||t[125]!==n||t[126]!==f||t[127]!==u||t[128]!==c[0]||t[129]!==c[1]||t[130]!==Wt||t[131]!==a||t[132]!==l?(Ie=Wt?null:s.jsxRuntimeExports.jsxs("g",{children:[s.jsxRuntimeExports.jsx(D.motion.text,{className:"text-xs",dx:5,dy:4,exit:{opacity:0,transition:{duration:i.duration}},variants:{initial:{opacity:0,x:a(n[n.length-1].date),y:l(n[n.length-1].y1),fill:c[0]},whileInView:{opacity:1,x:a(n[n.length-1].date),y:l(n[n.length-1].y1),fill:c[0],transition:{duration:f?i.duration:.5,delay:f?0:i.duration}}},initial:"initial",animate:u?"whileInView":"initial",children:$[0]},$[0]),s.jsxRuntimeExports.jsx(D.motion.text,{className:"text-xs",dx:5,dy:4,exit:{opacity:0,transition:{duration:i.duration}},variants:{initial:{opacity:0,x:a(n[n.length-1].date),y:l(n[n.length-1].y2),fill:c[1]},whileInView:{opacity:1,x:a(n[n.length-1].date),y:l(n[n.length-1].y2),fill:c[1],transition:{duration:f?i.duration:.5,delay:f?0:i.duration}}},initial:"initial",animate:u?"whileInView":"initial",children:$[1]},$[1])]}),t[123]=i.duration,t[124]=$,t[125]=n,t[126]=f,t[127]=u,t[128]=c[0],t[129]=c[1],t[130]=Wt,t[131]=a,t[132]=l,t[133]=Ie):Ie=t[133];let Ne;t[134]!==d?.mouseOverLine||t[135]!==v||t[136]!==k||t[137]!==h?.mouseOverLine||t[138]!==a?(Ne=k?s.jsxRuntimeExports.jsx("line",{y1:0,y2:v,x1:a(k.date),x2:a(k.date),className:s.mo("undp-tick-line stroke-primary-gray-700 dark:stroke-primary-gray-100",d?.mouseOverLine),style:h?.mouseOverLine}):null,t[134]=d?.mouseOverLine,t[135]=v,t[136]=k,t[137]=h?.mouseOverLine,t[138]=a,t[139]=Ne):Ne=t[139];let Te;if(t[140]!==i.duration||t[141]!==d?.graphObjectValues||t[142]!==n||t[143]!==m||t[144]!==f||t[145]!==u||t[146]!==c[0]||t[147]!==c[1]||t[148]!==E||t[149]!==w||t[150]!==F||t[151]!==R||t[152]!==h?.graphObjectValues||t[153]!==O||t[154]!==a||t[155]!==l){let o;t[157]!==i.duration||t[158]!==d?.graphObjectValues||t[159]!==n.length||t[160]!==m||t[161]!==f||t[162]!==u||t[163]!==c[0]||t[164]!==c[1]||t[165]!==E||t[166]!==w||t[167]!==F||t[168]!==R||t[169]!==h?.graphObjectValues||t[170]!==O||t[171]!==a||t[172]!==l?(o=(e,U)=>s.jsxRuntimeExports.jsxs(D.motion.g,{children:[qt.checkIfNullOrUndefined(e.y1)?null:s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[F?s.jsxRuntimeExports.jsx(D.motion.circle,{r:m/n.length<5?0:m/n.length<20?2:4,exit:{opacity:0,transition:{duration:i.duration}},variants:{initial:{opacity:0,cx:a(e.date),cy:l(e.y1),fill:c[0]},whileInView:{opacity:1,fill:c[0],transition:{duration:.5,delay:i.duration},cx:a(e.date),cy:l(e.y1)}},initial:"initial",animate:u?"whileInView":"initial"}):null,R?s.jsxRuntimeExports.jsx(D.motion.text,{dy:e.y2<e.y1?-8:"1em",style:{textAnchor:"middle",...h?.graphObjectValues||{}},className:s.mo("graph-value graph-value-line-1 text-xs font-bold",d?.graphObjectValues),exit:{opacity:0,transition:{duration:i.duration}},variants:{initial:{opacity:0,x:a(e.date),y:l(e.y1),fill:c[0]},whileInView:{opacity:1,fill:c[0],x:a(e.date),y:l(e.y1),transition:{duration:f?i.duration:.5,delay:f?0:i.duration}}},initial:"initial",animate:u?"whileInView":"initial",children:ei.numberFormattingFunction(e.y1,"NA",E,w,O)}):null]}),qt.checkIfNullOrUndefined(e.y2)?null:s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[F?s.jsxRuntimeExports.jsx(D.motion.circle,{r:m/n.length<5?0:m/n.length<20?2:4,exit:{opacity:0,transition:{duration:i.duration}},variants:{initial:{opacity:0,cx:a(e.date),cy:l(e.y2),fill:c[1]},whileInView:{opacity:1,fill:c[1],transition:{duration:f?i.duration:.5,delay:f?0:i.duration},cx:a(e.date),cy:l(e.y2)}},initial:"initial",animate:u?"whileInView":"initial"}):null,R?s.jsxRuntimeExports.jsx(D.motion.text,{dy:e.y2>e.y1?-8:"1em",style:{textAnchor:"middle",...h?.graphObjectValues||{}},className:s.mo("graph-value graph-value-line-2 text-xs font-bold",d?.graphObjectValues),exit:{opacity:0,transition:{duration:i.duration}},variants:{initial:{opacity:0,x:a(e.date),y:l(e.y2),fill:c[1]},whileInView:{opacity:1,x:a(e.date),y:l(e.y2),fill:c[1],transition:{duration:f?i.duration:.5,delay:f?0:i.duration}}},initial:"initial",animate:u?"whileInView":"initial",children:ei.numberFormattingFunction(e.y2,"NA",E,w,O)}):null]})]},U),t[157]=i.duration,t[158]=d?.graphObjectValues,t[159]=n.length,t[160]=m,t[161]=f,t[162]=u,t[163]=c[0],t[164]=c[1],t[165]=E,t[166]=w,t[167]=F,t[168]=R,t[169]=h?.graphObjectValues,t[170]=O,t[171]=a,t[172]=l,t[173]=o):o=t[173],Te=n.map(o),t[140]=i.duration,t[141]=d?.graphObjectValues,t[142]=n,t[143]=m,t[144]=f,t[145]=u,t[146]=c[0],t[147]=c[1],t[148]=E,t[149]=w,t[150]=F,t[151]=R,t[152]=h?.graphObjectValues,t[153]=O,t[154]=a,t[155]=l,t[156]=Te}else Te=t[156];let qe;t[174]!==i||t[175]!==m||t[176]!==u||t[177]!==S||t[178]!==y.right||t[179]!==Rt||t[180]!==l?(qe=Rt?s.jsxRuntimeExports.jsx(s.jsxRuntimeExports.Fragment,{children:Rt.map((o,e)=>s.jsxRuntimeExports.jsx(hi.RefLineY,{text:o.text,color:o.color,y:l(o.value),x1:0-S,x2:m+y.right,classNames:o.classNames,styles:o.styles,animate:i,isInView:u},e))}):null,t[174]=i,t[175]=m,t[176]=u,t[177]=S,t[178]=y.right,t[179]=Rt,t[180]=l,t[181]=qe):qe=t[181];let oe;if(t[182]!==i||t[183]!==Yt||t[184]!==x||t[185]!==m||t[186]!==u||t[187]!==y.right||t[188]!==z||t[189]!==a||t[190]!==l){let o;t[192]!==i||t[193]!==x||t[194]!==m||t[195]!==u||t[196]!==y.right||t[197]!==z||t[198]!==a||t[199]!==l?(o=(e,U)=>{const Tt=ii.getLineEndPoint({x:e.xCoordinate?a(C.parse(`${e.xCoordinate}`,x,new Date))+(e.xOffset||0):0+(e.xOffset||0),y:e.yCoordinate?l(e.yCoordinate)+(e.yOffset||0)-8:0+(e.yOffset||0)-8},{x:e.xCoordinate?a(C.parse(`${e.xCoordinate}`,x,new Date)):0,y:e.yCoordinate?l(e.yCoordinate):0},qt.checkIfNullOrUndefined(e.connectorRadius)?3.5:e.connectorRadius),ci=e.showConnector?{y1:Tt.y,x1:Tt.x,y2:e.yCoordinate?l(e.yCoordinate)+(e.yOffset||0):0+(e.yOffset||0),x2:e.xCoordinate?a(C.parse(`${e.xCoordinate}`,x,new Date))+(e.xOffset||0):0+(e.xOffset||0),cy:e.yCoordinate?l(e.yCoordinate):0,cx:e.xCoordinate?a(C.parse(`${e.xCoordinate}`,x,new Date)):0,circleRadius:qt.checkIfNullOrUndefined(e.connectorRadius)?3.5:e.connectorRadius,strokeWidth:e.showConnector===!0?2:Math.min(e.showConnector||0,1)}:void 0,ui={y:e.yCoordinate?l(e.yCoordinate)+(e.yOffset||0)-8:0+(e.yOffset||0)-8,x:z?0:e.xCoordinate?a(C.parse(`${e.xCoordinate}`,x,new Date))+(e.xOffset||0):0+(e.xOffset||0),width:z?e.xCoordinate?a(C.parse(`${e.xCoordinate}`,x,new Date))+(e.xOffset||0):0+(e.xOffset||0):m+y.right-(e.xCoordinate?a(C.parse(`${e.xCoordinate}`,x,new Date))+(e.xOffset||0):0+(e.xOffset||0)),maxWidth:e.maxWidth,fontWeight:e.fontWeight,align:e.align};return s.jsxRuntimeExports.jsx(ii.Annotation,{color:e.color,connectorsSettings:ci,labelSettings:ui,text:e.text,classNames:e.classNames,styles:e.styles,animate:i,isInView:u},U)},t[192]=i,t[193]=x,t[194]=m,t[195]=u,t[196]=y.right,t[197]=z,t[198]=a,t[199]=l,t[200]=o):o=t[200],oe=Yt.map(o),t[182]=i,t[183]=Yt,t[184]=x,t[185]=m,t[186]=u,t[187]=y.right,t[188]=z,t[189]=a,t[190]=l,t[191]=oe}else oe=t[191];let $e;t[201]!==oe?($e=s.jsxRuntimeExports.jsx("g",{children:oe}),t[201]=oe,t[202]=$e):$e=t[202];let Me;t[203]!==G?(Me=G.filter(Ii).map(Di),t[203]=G,t[204]=Me):Me=t[204];let Fe;t[205]===Symbol.for("react.memo_cache_sentinel")?(Fe={fill:"none",pointerEvents:"all"},t[205]=Fe):Fe=t[205];let Ge;t[206]!==xt||t[207]!==v||t[208]!==m?(Ge=s.jsxRuntimeExports.jsx("rect",{ref:xt,style:Fe,width:m,height:v}),t[206]=xt,t[207]=v,t[208]=m,t[209]=Ge):Ge=t[209];let Pe;return t[210]!==d?.tooltip||t[211]!==p||t[212]!==Q||t[213]!==k||t[214]!==h?.tooltip||t[215]!==B?(Pe=k&&B&&p&&Q?s.jsxRuntimeExports.jsx(mi.Tooltip,{data:k,body:B,xPos:p,yPos:Q,backgroundStyle:h?.tooltip,className:d?.tooltip}):null,t[210]=d?.tooltip,t[211]=p,t[212]=Q,t[213]=k,t[214]=h?.tooltip,t[215]=B,t[216]=Pe):Pe=t[216],s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsx(D.motion.svg,{width:`${rt}px`,height:`${$t}px`,viewBox:`0 0 ${rt} ${$t}`,direction:"ltr",ref:Ct,children:s.jsxRuntimeExports.jsxs("g",{transform:`translate(${y.left},${y.top})`,children:[s.jsxRuntimeExports.jsx("clipPath",{id:`above${lt}`,children:s.jsxRuntimeExports.jsx("path",{d:ue(n),style:ht})}),s.jsxRuntimeExports.jsx("clipPath",{id:`below${lt}`,children:s.jsxRuntimeExports.jsx("path",{d:ce(n),style:nt})}),yt,s.jsxRuntimeExports.jsx(ii.CustomArea,{areaSettings:re,scaleX:a,scaleY:l,animate:i,isInView:u}),s.jsxRuntimeExports.jsx("g",{children:s.jsxRuntimeExports.jsxs("g",{children:[s.jsxRuntimeExports.jsx(yi.YTicksAndGridLines,{values:Qt.filter($i),y:Qt.filter(qi).map(o=>l(o)),x1:0-S,x2:m+y.right,styles:st,classNames:Dt,suffix:O,prefix:w,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:E}),fe,pe]})}),s.jsxRuntimeExports.jsx(pi.XTicksAndGridLines,{values:ai,x:ri,y1:0,y2:v,styles:ye,classNames:ge,suffix:O,prefix:w,labelType:"primary",showGridLines:!0,precision:E}),je,s.jsxRuntimeExports.jsxs("g",{children:[s.jsxRuntimeExports.jsx(D.motion.path,{clipPath:`url(#below${lt})`,d:St(n)||"",style:ve,exit:we,variants:be,initial:"initial",animate:u?"whileInView":"initial"}),s.jsxRuntimeExports.jsx(D.motion.path,{clipPath:`url(#above${lt})`,d:St(n)||"",style:Ee,exit:Oe,variants:Ae,initial:"initial",animate:u?"whileInView":"initial"})]}),s.jsxRuntimeExports.jsxs("g",{children:[s.jsxRuntimeExports.jsx(D.motion.path,{d:pt(n)||"",style:Ve,exit:Le,variants:{initial:{pathLength:0,d:pt(n)||"",opacity:1},whileInView:{pathLength:1,d:pt(n)||"",opacity:1,transition:{duration:i.duration}}},initial:"initial",animate:u?"whileInView":"initial"}),s.jsxRuntimeExports.jsx(D.motion.path,{style:Se,exit:ke,variants:{initial:{pathLength:0,d:Kt(n)||"",opacity:1},whileInView:De},initial:"initial",animate:u?"whileInView":"initial"}),Ie,Ne,Te]}),qe,$e,Me,Ge]})}),Pe]})}function Di(r){return r.layer}function Ii(r){return r.position==="after"}function Ni(r){return r.layer}function Ti(r){return r.position==="before"}function qi(r){return r!==0}function $i(r){return r!==0}function Mi(r){return r.date}function Fi(r){return r.y2}function Gi(r){return r.y2}function Pi(r){return r.y1}function Hi(r){return r.y1}function Wi(r){return r.y2}function Yi(r){return r.y2}function Xi(r){return r.y2}function Ui(r){return r.y1}function Bi(r){return r.y1}function zi(r){return r.y1}function Ji(r){const t=s.compilerRuntimeExports.c(102),{data:j,graphTitle:rt,suffix:$t,sources:c,prefix:O,graphDescription:w,height:x,width:R,footNote:Mt,noOfXTicks:Ft,dateFormat:S,showValues:Gt,padding:wt,lineColors:B,backgroundColor:Pt,leftMargin:Ht,rightMargin:i,topMargin:z,bottomMargin:Wt,tooltip:$,highlightAreaSettings:I,relativeHeight:lt,onSeriesMouseOver:M,graphID:F,graphDownload:Rt,dataDownload:N,animate:bt,language:Yt,minHeight:Xt,labels:T,showColorLegendAtTop:de,colorLegendTitle:Ut,diffAreaColors:Et,strokeWidth:Ot,showDots:h,refValues:d,minValue:E,maxValue:G,annotations:Ct,customHighlightAreaSettings:J,theme:u,ariaLabel:f,yAxisTitle:se,noOfYTicks:At,minDate:ct,maxDate:K,curveType:k,styles:g,classNames:p,precision:ae,customLayers:Q}=r,Bt=$t===void 0?"":$t,Vt=O===void 0?"":O,ut=Ft===void 0?10:Ft,y=S===void 0?"yyyy":S,xt=Gt===void 0?!1:Gt;let Z;t[0]!==B?(Z=B===void 0?[We.Colors.light.categoricalColors.colors[0],We.Colors.light.categoricalColors.colors[1]]:B,t[0]=B,t[1]=Z):Z=t[1];const n=Z,mt=Pt===void 0?!1:Pt,Lt=Ht===void 0?30:Ht,dt=i===void 0?50:i,re=z===void 0?20:z,m=Wt===void 0?25:Wt;let v;t[2]!==I?(v=I===void 0?[]:I,t[2]=I,t[3]=v):v=t[3];const le=v,zt=Rt===void 0?!1:Rt,_=N===void 0?!1:N,tt=bt===void 0?!1:bt,P=Yt===void 0?"en":Yt,Jt=Xt===void 0?0:Xt,q=de===void 0?!1:de;let b;t[4]!==Et?(b=Et===void 0?[We.Colors.alerts.red,We.Colors.alerts.darkGreen]:Et,t[4]=Et,t[5]=b):b=t[5];const et=b,a=Ot===void 0?2:Ot,ft=h===void 0?!0:h;let it;t[6]!==d?(it=d===void 0?[]:d,t[6]=d,t[7]=it):it=t[7];const l=it;let pt;t[8]!==Ct?(pt=Ct===void 0?[]:Ct,t[8]=Ct,t[9]=pt):pt=t[9];const Kt=pt;let St;t[10]!==J?(St=J===void 0?[]:J,t[10]=J,t[11]=St):St=t[11];const ce=St,ue=u===void 0?"light":u,Qt=At===void 0?5:At,Zt=k===void 0?"curve":k,ht=ae===void 0?2:ae;let nt;t[12]!==Q?(nt=Q===void 0?[]:Q,t[12]=Q,t[13]=nt):nt=t[13];const yt=nt,[ot,xe]=L.useState(0),[st,me]=L.useState(0),kt=L.useRef(null),Dt=L.useRef(null);let gt,jt;t[14]===Symbol.for("react.memo_cache_sentinel")?(gt=()=>{const _t=new ResizeObserver(at=>{xe(at[0].target.clientWidth||620),me(at[0].target.clientHeight||480)});return kt.current&&_t.observe(kt.current),()=>_t.disconnect()},jt=[],t[14]=gt,t[15]=jt):(gt=t[14],jt=t[15]),L.useEffect(gt,jt);const It=p?.graphContainer,Nt=g?.graphContainer;let H;t[16]!==p?.description||t[17]!==p?.title||t[18]!==j||t[19]!==_||t[20]!==w||t[21]!==zt||t[22]!==rt||t[23]!==g?.description||t[24]!==g?.title||t[25]!==R?(H=rt||w||zt||_?s.jsxRuntimeExports.jsx(Ci.GraphHeader,{styles:{title:g?.title,description:g?.description},classNames:{title:p?.title,description:p?.description},graphTitle:rt,graphDescription:w,width:R,graphDownload:zt?Dt:void 0,dataDownload:_?j.map(tn).filter(_i).length>0?j.map(Zi).filter(Qi):j.filter(Ki):null}):null,t[16]=p?.description,t[17]=p?.title,t[18]=j,t[19]=_,t[20]=w,t[21]=zt,t[22]=rt,t[23]=g?.description,t[24]=g?.title,t[25]=R,t[26]=H):H=t[26];let A;t[27]!==p?.colorLegend||t[28]!==Ut||t[29]!==j.length||t[30]!==T||t[31]!==n||t[32]!==q?(A=q&&j.length>0?s.jsxRuntimeExports.jsx(Ai.ColorLegend,{colorDomain:T,colorLegendTitle:Ut,colors:n,showNAColor:!1,className:p?.colorLegend}):null,t[27]=p?.colorLegend,t[28]=Ut,t[29]=j.length,t[30]=T,t[31]=n,t[32]=q,t[33]=A):A=t[33];let W;t[34]!==j.length?(W=j.length===0&&s.jsxRuntimeExports.jsx(Li.EmptyState,{}),t[34]=j.length,t[35]=W):W=t[35];let Y;t[36]!==tt||t[37]!==Kt||t[38]!==m||t[39]!==p||t[40]!==Zt||t[41]!==ce||t[42]!==yt||t[43]!==j||t[44]!==y||t[45]!==et||t[46]!==le||t[47]!==T||t[48]!==P||t[49]!==Lt||t[50]!==n||t[51]!==K||t[52]!==G||t[53]!==ct||t[54]!==E||t[55]!==ut||t[56]!==Qt||t[57]!==M||t[58]!==ht||t[59]!==Vt||t[60]!==l||t[61]!==dt||t[62]!==q||t[63]!==ft||t[64]!==xt||t[65]!==a||t[66]!==g||t[67]!==Bt||t[68]!==st||t[69]!==ot||t[70]!==$||t[71]!==re||t[72]!==se?(Y=ot&&st&&j.length>0?s.jsxRuntimeExports.jsx(ki,{data:j,lineColors:n,colorDomain:T,width:ot,height:st,suffix:Bt,prefix:Vt,dateFormat:y,showValues:xt,noOfXTicks:ut??Si.getNoOfTicks(ot),leftMargin:Lt,rightMargin:dt,topMargin:re,bottomMargin:m,highlightAreaSettings:le,tooltip:$,onSeriesMouseOver:M,showColorLegendAtTop:q,animate:tt===!0?{duration:.5,once:!0,amount:.5}:tt||{duration:0,once:!0,amount:0},rtl:P==="he"||P==="ar",diffAreaColors:et,idSuffix:Vi.generateRandomString(8),strokeWidth:a,showDots:ft,refValues:l,minValue:E,maxValue:G,annotations:Kt,customHighlightAreaSettings:ce,yAxisTitle:se,noOfYTicks:Qt,minDate:ct,maxDate:K,curveType:Zt,styles:g,classNames:p,precision:ht,customLayers:yt}):null,t[36]=tt,t[37]=Kt,t[38]=m,t[39]=p,t[40]=Zt,t[41]=ce,t[42]=yt,t[43]=j,t[44]=y,t[45]=et,t[46]=le,t[47]=T,t[48]=P,t[49]=Lt,t[50]=n,t[51]=K,t[52]=G,t[53]=ct,t[54]=E,t[55]=ut,t[56]=Qt,t[57]=M,t[58]=ht,t[59]=Vt,t[60]=l,t[61]=dt,t[62]=q,t[63]=ft,t[64]=xt,t[65]=a,t[66]=g,t[67]=Bt,t[68]=st,t[69]=ot,t[70]=$,t[71]=re,t[72]=se,t[73]=Y):Y=t[73];let X;t[74]!==W||t[75]!==Y?(X=s.jsxRuntimeExports.jsxs(si.GraphArea,{ref:kt,children:[W,Y]}),t[74]=W,t[75]=Y,t[76]=X):X=t[76];let V;t[77]!==p?.footnote||t[78]!==p?.source||t[79]!==Mt||t[80]!==c||t[81]!==g?.footnote||t[82]!==g?.source||t[83]!==R?(V=c||Mt?s.jsxRuntimeExports.jsx(Oi.GraphFooter,{styles:{footnote:g?.footnote,source:g?.source},classNames:{footnote:p?.footnote,source:p?.source},sources:c,footNote:Mt,width:R}):null,t[77]=p?.footnote,t[78]=p?.source,t[79]=Mt,t[80]=c,t[81]=g?.footnote,t[82]=g?.source,t[83]=R,t[84]=V):V=t[84];let vt;return t[85]!==f||t[86]!==mt||t[87]!==F||t[88]!==x||t[89]!==P||t[90]!==Jt||t[91]!==wt||t[92]!==lt||t[93]!==It||t[94]!==Nt||t[95]!==H||t[96]!==A||t[97]!==X||t[98]!==V||t[99]!==ue||t[100]!==R?(vt=s.jsxRuntimeExports.jsxs(si.GraphContainer,{className:It,style:Nt,id:F,ref:Dt,"aria-label":f,backgroundColor:mt,theme:ue,language:P,minHeight:Jt,width:R,height:x,relativeHeight:lt,padding:wt,children:[H,A,X,V]}),t[85]=f,t[86]=mt,t[87]=F,t[88]=x,t[89]=P,t[90]=Jt,t[91]=wt,t[92]=lt,t[93]=It,t[94]=Nt,t[95]=H,t[96]=A,t[97]=X,t[98]=V,t[99]=ue,t[100]=R,t[101]=vt):vt=t[101],vt}function Ki(r){return r!==void 0}function Qi(r){return r!==void 0}function Zi(r){return r.data}function _i(r){return r!==void 0}function tn(r){return r.data}exports.DifferenceLineChart=Ji;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-CHPV5EwG-6v2a2njQ.cjs"),L=require("react"),C=require("./parse-xYI9yrvL.cjs"),xi=require("./index-Cno4Q0YE.cjs"),ei=require("./numberFormattingFunction-02t-wJta.cjs"),mi=require("./Tooltip-BLa2EfMs.cjs"),qt=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),ii=require("./customArea-B1LWQBmM.cjs"),di=require("./AxisTitle-DV4n0RxE.cjs"),fi=require("./Axis-Jt_tmhxS.cjs"),pi=require("./XTicksAndGridLines-CekrPykD.cjs"),hi=require("./ReferenceLine-M9aP3dj-.cjs"),yi=require("./YTicksAndGridLines-UzVC5eBM.cjs"),gi=require("./index-D69M6klB.cjs"),ji=require("./time-CkcKbhwe.cjs"),vi=require("./linear-CgUCbw9F.cjs"),ni=require("./line-DaEMhXmx.cjs"),He=require("./step-BZ3C8QFW.cjs"),oi=require("./area-C1gxfNGD.cjs"),wi=require("./select-Bnfk0lJx.cjs"),D=require("./proxy-C4-uo6nS.cjs"),Ri=require("./init-DU0ybBc_.cjs"),bi=require("./pointer-Dkq5NV1q.cjs"),Ei=require("./use-in-view-C3o_ntMv.cjs"),Oi=require("./GraphFooter.cjs"),Ci=require("./GraphHeader.cjs"),Ai=require("./ColorLegend.cjs"),We=require("./Colors.cjs"),Vi=require("./generateRandomString-B5zBiJzS.cjs"),Li=require("./EmptyState-B4c-CrXs.cjs"),si=require("./GraphContainer-B1EDxJ0S.cjs"),Si=require("./getNoOfTicks-C_1CFXv_.cjs");function ki(r){const t=s.compilerRuntimeExports.c(217),{data:j,width:rt,height:$t,lineColors:c,suffix:O,prefix:w,dateFormat:x,showValues:R,noOfXTicks:Mt,rightMargin:Ft,leftMargin:S,topMargin:Gt,bottomMargin:wt,tooltip:B,highlightAreaSettings:Pt,onSeriesMouseOver:Ht,animate:i,rtl:z,showColorLegendAtTop:Wt,colorDomain:$,diffAreaColors:I,idSuffix:lt,strokeWidth:M,showDots:F,refValues:Rt,minValue:N,maxValue:bt,annotations:Yt,customHighlightAreaSettings:Xt,yAxisTitle:T,noOfYTicks:de,minDate:Ut,maxDate:Et,curveType:Ot,styles:h,classNames:d,precision:E,customLayers:G}=r,Ct=L.useRef(null);let J;t[0]!==i.amount||t[1]!==i.once?(J={once:i.once,amount:i.amount},t[0]=i.amount,t[1]=i.once,t[2]=J):J=t[2];const u=Ei.useInView(Ct,J),[f,se]=L.useState(!1);let At,ct;t[3]!==i.duration||t[4]!==f||t[5]!==u?(At=()=>{if(u&&!f){const o=setTimeout(()=>{se(!0)},(i.duration+.5)*1e3);return()=>clearTimeout(o)}},ct=[u,f,i.duration],t[3]=i.duration,t[4]=f,t[5]=u,t[6]=At,t[7]=ct):(At=t[6],ct=t[7]),L.useEffect(At,ct);const K=Ot==="linear"?ni.curveLinear:Ot==="step"?He.curveStep:Ot==="stepAfter"?He.stepAfter:Ot==="stepBefore"?He.stepBefore:He.monotoneX,[k,g]=L.useState(void 0),[p,ae]=L.useState(void 0),[Q,Bt]=L.useState(void 0),Vt=T?S+30:S;let ut;t[8]!==wt||t[9]!==Ft||t[10]!==Vt||t[11]!==Gt?(ut={top:Gt,bottom:wt,left:Vt,right:Ft},t[8]=wt,t[9]=Ft,t[10]=Vt,t[11]=Gt,t[12]=ut):ut=t[12];const y=ut,xt=L.useRef(null);let Z;t[13]!==x?(Z=o=>({...o,date:C.parse(`${o.date}`,x,new Date)}),t[13]=x,t[14]=Z):Z=t[14];const n=xi.orderBy(j.map(Z),["date"],["asc"]);let mt;if(t[15]!==x||t[16]!==Pt){let o;t[18]!==x?(o=e=>({...e,coordinates:[e.coordinates[0]===null?null:C.parse(`${e.coordinates[0]}`,x,new Date),e.coordinates[1]===null?null:C.parse(`${e.coordinates[1]}`,x,new Date)]}),t[18]=x,t[19]=o):o=t[19],mt=Pt.map(o),t[15]=x,t[16]=Pt,t[17]=mt}else mt=t[17];const Lt=mt;let dt;if(t[20]!==Xt||t[21]!==x){let o;t[23]!==x?(o=e=>({...e,coordinates:e.coordinates.map((U,Tt)=>Tt%2===0?C.parse(`${U}`,x,new Date):U)}),t[23]=x,t[24]=o):o=t[24],dt=Xt.map(o),t[20]=Xt,t[21]=x,t[22]=dt}else dt=t[22];const re=dt,m=rt-y.left-y.right,v=$t-y.top-y.bottom,le=Ut?C.parse(`${Ut}`,x,new Date):n[0].date,zt=Et?C.parse(`${Et}`,x,new Date):n[n.length-1].date,_=Math.min(...n.map(zi))!==1/0?Math.min(...n.map(Bi))>0?0:Math.min(...n.map(Ui)):0,tt=Math.min(...n.map(Xi))!==1/0?Math.min(...n.map(Yi))>0?0:Math.min(...n.map(Wi)):0,P=Math.max(...n.map(Hi))!==1/0?Math.max(...n.map(Pi)):0,Jt=Math.max(...n.map(Gi))!==1/0?Math.max(...n.map(Fi)):0;let q;t[25]!==_||t[26]!==tt||t[27]!==N?(q=qt.checkIfNullOrUndefined(N)?_<tt?_:tt:N,t[25]=_,t[26]=tt,t[27]=N,t[28]=q):q=t[28];const b=q,et=P>Jt?P:Jt,a=ji.time().domain([le,zt]).range([0,m]);let ft;t[29]!==b||t[30]!==N?(ft=qt.checkIfNullOrUndefined(N)?b:N,t[29]=b,t[30]=N,t[31]=ft):ft=t[31];let it;t[32]!==et||t[33]!==bt?(it=qt.checkIfNullOrUndefined(bt)?et>0?et:0:bt,t[32]=et,t[33]=bt,t[34]=it):it=t[34];const l=vi.linear().domain([ft,it]).range([v,0]).nice(),pt=ni.line().x(o=>a(o.date)).y(o=>l(o.y1)).curve(K),Kt=ni.line().x(o=>a(o.date)).y(o=>l(o.y2)).curve(K),St=oi.area().x(o=>a(o.date)).y1(o=>l(o.y1)).y0(o=>l(o.y2)).curve(K),ce=oi.area().x(o=>a(o.date)).y1(o=>l(o.y1)).y0(0).curve(K),ue=oi.area().x(o=>a(o.date)).y1(o=>l(o.y2)).y0(0).curve(K),Qt=l.ticks(de),Zt=a.ticks(Mt);L.useEffect(()=>{const o=U=>{const Tt=n[Ri.bisectCenter(n.map(Mi),a.invert(bi.pointer(U)[0]),0)];g(Tt||n[n.length-1]),Ht?.(Tt||n[n.length-1]),Bt(U.clientY),ae(U.clientX)},e=()=>{g(void 0),ae(void 0),Bt(void 0),Ht?.(void 0)};wi.select(xt.current).on("mousemove",o).on("mouseout",e)},[a,n,Ht]);let ht;t[35]===Symbol.for("react.memo_cache_sentinel")?(ht={fill:"none"},t[35]=ht):ht=t[35];let nt;t[36]===Symbol.for("react.memo_cache_sentinel")?(nt={fill:"none"},t[36]=nt):nt=t[36];let yt;t[37]!==i||t[38]!==v||t[39]!==m||t[40]!==Lt||t[41]!==u||t[42]!==a?(yt=s.jsxRuntimeExports.jsx(gi.HighlightArea,{areaSettings:Lt,width:m,height:v,scale:a,animate:i,isInView:u}),t[37]=i,t[38]=v,t[39]=m,t[40]=Lt,t[41]=u,t[42]=a,t[43]=yt):yt=t[43];const ot=h?.yAxis?.gridLines,xe=h?.yAxis?.labels;let st;t[44]!==ot||t[45]!==xe?(st={gridLines:ot,labels:xe},t[44]=ot,t[45]=xe,t[46]=st):st=t[46];const me=d?.yAxis?.gridLines,kt=d?.yAxis?.labels;let Dt;t[47]!==me||t[48]!==kt?(Dt={gridLines:me,labels:kt},t[47]=me,t[48]=kt,t[49]=Dt):Dt=t[49];const gt=l(b<0?0:b),jt=l(b<0?0:b),It=0-S,Nt=m+y.right,H=b<0?0:b;let A;t[50]!==E||t[51]!==w||t[52]!==O||t[53]!==H?(A=ei.numberFormattingFunction(H,"NA",E,w,O),t[50]=E,t[51]=w,t[52]=O,t[53]=H,t[54]=A):A=t[54];const W=0-S,Y=l(b<0?0:b),X=et<0?"1rem":-5;let V;t[55]!==W||t[56]!==Y||t[57]!==X?(V={x:W,y:Y,dx:0,dy:X},t[55]=W,t[56]=Y,t[57]=X,t[58]=V):V=t[58];const vt=d?.xAxis?.axis,_t=d?.yAxis?.labels;let at;t[59]!==vt||t[60]!==_t?(at={axis:vt,label:_t},t[59]=vt,t[60]=_t,t[61]=at):at=t[61];const Ye=h?.xAxis?.axis,Xe=h?.yAxis?.labels;let te;t[62]!==Ye||t[63]!==Xe?(te={axis:Ye,label:Xe},t[62]=Ye,t[63]=Xe,t[64]=te):te=t[64];let fe;t[65]!==gt||t[66]!==jt||t[67]!==It||t[68]!==Nt||t[69]!==A||t[70]!==V||t[71]!==at||t[72]!==te?(fe=s.jsxRuntimeExports.jsx(fi.Axis,{y1:gt,y2:jt,x1:It,x2:Nt,label:A,labelPos:V,classNames:at,styles:te}),t[65]=gt,t[66]=jt,t[67]=It,t[68]=Nt,t[69]=A,t[70]=V,t[71]=at,t[72]=te,t[73]=fe):fe=t[73];const Ue=0-S-15,Be=v/2,ze=h?.yAxis?.title,Je=d?.yAxis?.title;let pe;t[74]!==Ue||t[75]!==Be||t[76]!==ze||t[77]!==Je||t[78]!==T?(pe=s.jsxRuntimeExports.jsx(di.AxisTitle,{x:Ue,y:Be,style:ze,className:Je,text:T,rotate90:!0}),t[74]=Ue,t[75]=Be,t[76]=ze,t[77]=Je,t[78]=T,t[79]=pe):pe=t[79];let he;t[80]!==x?(he=o=>C.format(o,x),t[80]=x,t[81]=he):he=t[81];const ai=Zt.map(he),ri=Zt.map(o=>a(o)),Ke=h?.xAxis?.gridLines,Qe=h?.xAxis?.labels;let ye;t[82]!==Ke||t[83]!==Qe?(ye={gridLines:Ke,labels:Qe},t[82]=Ke,t[83]=Qe,t[84]=ye):ye=t[84];const Ze=d?.xAxis?.gridLines;let ee;t[85]!==Ze?(ee=s.mo("opacity-0",Ze),t[85]=Ze,t[86]=ee):ee=t[86];const _e=d?.xAxis?.labels;let ie;t[87]!==_e?(ie=s.mo("fill-primary-gray-700 dark:fill-primary-gray-300 xs:max-[360px]:hidden text-[9px] md:text-[10px] lg:text-xs",_e),t[87]=_e,t[88]=ie):ie=t[88];let ge;t[89]!==ee||t[90]!==ie?(ge={gridLines:ee,labels:ie},t[89]=ee,t[90]=ie,t[91]=ge):ge=t[91];let je;t[92]!==G?(je=G.filter(Ti).map(Ni),t[92]=G,t[93]=je):je=t[93];let ve;t[94]!==I[1]?(ve={fill:I[1]},t[94]=I[1],t[95]=ve):ve=t[95];let we;t[96]!==i.duration?(we={opacity:0,transition:{duration:i.duration}},t[96]=i.duration,t[97]=we):we=t[97];let Re;t[98]===Symbol.for("react.memo_cache_sentinel")?(Re={opacity:1},t[98]=Re):Re=t[98];let be;t[99]!==i.duration?(be={initial:Re,whileInView:{opacity:1,transition:{duration:i.duration}}},t[99]=i.duration,t[100]=be):be=t[100];let Ee;t[101]!==I[0]?(Ee={fill:I[0]},t[101]=I[0],t[102]=Ee):Ee=t[102];let Oe;t[103]!==i.duration?(Oe={opacity:0,transition:{duration:i.duration}},t[103]=i.duration,t[104]=Oe):Oe=t[104];let Ce;t[105]===Symbol.for("react.memo_cache_sentinel")?(Ce={opacity:0},t[105]=Ce):Ce=t[105];let Ae;t[106]!==i.duration?(Ae={initial:Ce,whileInView:{opacity:1,transition:{duration:i.duration}}},t[106]=i.duration,t[107]=Ae):Ae=t[107];let Ve;t[108]!==c[0]||t[109]!==M?(Ve={fill:"none",stroke:c[0],strokeWidth:M},t[108]=c[0],t[109]=M,t[110]=Ve):Ve=t[110];let Le;t[111]!==i.duration?(Le={opacity:0,transition:{duration:i.duration}},t[111]=i.duration,t[112]=Le):Le=t[112];let Se;t[113]!==c[1]||t[114]!==M?(Se={fill:"none",stroke:c[1],strokeWidth:M},t[113]=c[1],t[114]=M,t[115]=Se):Se=t[115];let ke;t[116]!==i.duration?(ke={opacity:0,transition:{duration:i.duration}},t[116]=i.duration,t[117]=ke):ke=t[117];const li=1,ti=Kt(n)||"";let ne;t[118]!==i.duration?(ne={duration:i.duration},t[118]=i.duration,t[119]=ne):ne=t[119];let De;t[120]!==ti||t[121]!==ne?(De={pathLength:li,d:ti,opacity:1,transition:ne},t[120]=ti,t[121]=ne,t[122]=De):De=t[122];let Ie;t[123]!==i.duration||t[124]!==$||t[125]!==n||t[126]!==f||t[127]!==u||t[128]!==c[0]||t[129]!==c[1]||t[130]!==Wt||t[131]!==a||t[132]!==l?(Ie=Wt?null:s.jsxRuntimeExports.jsxs("g",{children:[s.jsxRuntimeExports.jsx(D.motion.text,{className:"text-xs",dx:5,dy:4,exit:{opacity:0,transition:{duration:i.duration}},variants:{initial:{opacity:0,x:a(n[n.length-1].date),y:l(n[n.length-1].y1),fill:c[0]},whileInView:{opacity:1,x:a(n[n.length-1].date),y:l(n[n.length-1].y1),fill:c[0],transition:{duration:f?i.duration:.5,delay:f?0:i.duration}}},initial:"initial",animate:u?"whileInView":"initial",children:$[0]},$[0]),s.jsxRuntimeExports.jsx(D.motion.text,{className:"text-xs",dx:5,dy:4,exit:{opacity:0,transition:{duration:i.duration}},variants:{initial:{opacity:0,x:a(n[n.length-1].date),y:l(n[n.length-1].y2),fill:c[1]},whileInView:{opacity:1,x:a(n[n.length-1].date),y:l(n[n.length-1].y2),fill:c[1],transition:{duration:f?i.duration:.5,delay:f?0:i.duration}}},initial:"initial",animate:u?"whileInView":"initial",children:$[1]},$[1])]}),t[123]=i.duration,t[124]=$,t[125]=n,t[126]=f,t[127]=u,t[128]=c[0],t[129]=c[1],t[130]=Wt,t[131]=a,t[132]=l,t[133]=Ie):Ie=t[133];let Ne;t[134]!==d?.mouseOverLine||t[135]!==v||t[136]!==k||t[137]!==h?.mouseOverLine||t[138]!==a?(Ne=k?s.jsxRuntimeExports.jsx("line",{y1:0,y2:v,x1:a(k.date),x2:a(k.date),className:s.mo("undp-tick-line stroke-primary-gray-700 dark:stroke-primary-gray-100",d?.mouseOverLine),style:h?.mouseOverLine}):null,t[134]=d?.mouseOverLine,t[135]=v,t[136]=k,t[137]=h?.mouseOverLine,t[138]=a,t[139]=Ne):Ne=t[139];let Te;if(t[140]!==i.duration||t[141]!==d?.graphObjectValues||t[142]!==n||t[143]!==m||t[144]!==f||t[145]!==u||t[146]!==c[0]||t[147]!==c[1]||t[148]!==E||t[149]!==w||t[150]!==F||t[151]!==R||t[152]!==h?.graphObjectValues||t[153]!==O||t[154]!==a||t[155]!==l){let o;t[157]!==i.duration||t[158]!==d?.graphObjectValues||t[159]!==n.length||t[160]!==m||t[161]!==f||t[162]!==u||t[163]!==c[0]||t[164]!==c[1]||t[165]!==E||t[166]!==w||t[167]!==F||t[168]!==R||t[169]!==h?.graphObjectValues||t[170]!==O||t[171]!==a||t[172]!==l?(o=(e,U)=>s.jsxRuntimeExports.jsxs(D.motion.g,{children:[qt.checkIfNullOrUndefined(e.y1)?null:s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[F?s.jsxRuntimeExports.jsx(D.motion.circle,{r:m/n.length<5?0:m/n.length<20?2:4,exit:{opacity:0,transition:{duration:i.duration}},variants:{initial:{opacity:0,cx:a(e.date),cy:l(e.y1),fill:c[0]},whileInView:{opacity:1,fill:c[0],transition:{duration:.5,delay:i.duration},cx:a(e.date),cy:l(e.y1)}},initial:"initial",animate:u?"whileInView":"initial"}):null,R?s.jsxRuntimeExports.jsx(D.motion.text,{dy:e.y2<e.y1?-8:"1em",style:{textAnchor:"middle",...h?.graphObjectValues||{}},className:s.mo("graph-value graph-value-line-1 text-xs font-bold",d?.graphObjectValues),exit:{opacity:0,transition:{duration:i.duration}},variants:{initial:{opacity:0,x:a(e.date),y:l(e.y1),fill:c[0]},whileInView:{opacity:1,fill:c[0],x:a(e.date),y:l(e.y1),transition:{duration:f?i.duration:.5,delay:f?0:i.duration}}},initial:"initial",animate:u?"whileInView":"initial",children:ei.numberFormattingFunction(e.y1,"NA",E,w,O)}):null]}),qt.checkIfNullOrUndefined(e.y2)?null:s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[F?s.jsxRuntimeExports.jsx(D.motion.circle,{r:m/n.length<5?0:m/n.length<20?2:4,exit:{opacity:0,transition:{duration:i.duration}},variants:{initial:{opacity:0,cx:a(e.date),cy:l(e.y2),fill:c[1]},whileInView:{opacity:1,fill:c[1],transition:{duration:f?i.duration:.5,delay:f?0:i.duration},cx:a(e.date),cy:l(e.y2)}},initial:"initial",animate:u?"whileInView":"initial"}):null,R?s.jsxRuntimeExports.jsx(D.motion.text,{dy:e.y2>e.y1?-8:"1em",style:{textAnchor:"middle",...h?.graphObjectValues||{}},className:s.mo("graph-value graph-value-line-2 text-xs font-bold",d?.graphObjectValues),exit:{opacity:0,transition:{duration:i.duration}},variants:{initial:{opacity:0,x:a(e.date),y:l(e.y2),fill:c[1]},whileInView:{opacity:1,x:a(e.date),y:l(e.y2),fill:c[1],transition:{duration:f?i.duration:.5,delay:f?0:i.duration}}},initial:"initial",animate:u?"whileInView":"initial",children:ei.numberFormattingFunction(e.y2,"NA",E,w,O)}):null]})]},U),t[157]=i.duration,t[158]=d?.graphObjectValues,t[159]=n.length,t[160]=m,t[161]=f,t[162]=u,t[163]=c[0],t[164]=c[1],t[165]=E,t[166]=w,t[167]=F,t[168]=R,t[169]=h?.graphObjectValues,t[170]=O,t[171]=a,t[172]=l,t[173]=o):o=t[173],Te=n.map(o),t[140]=i.duration,t[141]=d?.graphObjectValues,t[142]=n,t[143]=m,t[144]=f,t[145]=u,t[146]=c[0],t[147]=c[1],t[148]=E,t[149]=w,t[150]=F,t[151]=R,t[152]=h?.graphObjectValues,t[153]=O,t[154]=a,t[155]=l,t[156]=Te}else Te=t[156];let qe;t[174]!==i||t[175]!==m||t[176]!==u||t[177]!==S||t[178]!==y.right||t[179]!==Rt||t[180]!==l?(qe=Rt?s.jsxRuntimeExports.jsx(s.jsxRuntimeExports.Fragment,{children:Rt.map((o,e)=>s.jsxRuntimeExports.jsx(hi.RefLineY,{text:o.text,color:o.color,y:l(o.value),x1:0-S,x2:m+y.right,classNames:o.classNames,styles:o.styles,animate:i,isInView:u},e))}):null,t[174]=i,t[175]=m,t[176]=u,t[177]=S,t[178]=y.right,t[179]=Rt,t[180]=l,t[181]=qe):qe=t[181];let oe;if(t[182]!==i||t[183]!==Yt||t[184]!==x||t[185]!==m||t[186]!==u||t[187]!==y.right||t[188]!==z||t[189]!==a||t[190]!==l){let o;t[192]!==i||t[193]!==x||t[194]!==m||t[195]!==u||t[196]!==y.right||t[197]!==z||t[198]!==a||t[199]!==l?(o=(e,U)=>{const Tt=ii.getLineEndPoint({x:e.xCoordinate?a(C.parse(`${e.xCoordinate}`,x,new Date))+(e.xOffset||0):0+(e.xOffset||0),y:e.yCoordinate?l(e.yCoordinate)+(e.yOffset||0)-8:0+(e.yOffset||0)-8},{x:e.xCoordinate?a(C.parse(`${e.xCoordinate}`,x,new Date)):0,y:e.yCoordinate?l(e.yCoordinate):0},qt.checkIfNullOrUndefined(e.connectorRadius)?3.5:e.connectorRadius),ci=e.showConnector?{y1:Tt.y,x1:Tt.x,y2:e.yCoordinate?l(e.yCoordinate)+(e.yOffset||0):0+(e.yOffset||0),x2:e.xCoordinate?a(C.parse(`${e.xCoordinate}`,x,new Date))+(e.xOffset||0):0+(e.xOffset||0),cy:e.yCoordinate?l(e.yCoordinate):0,cx:e.xCoordinate?a(C.parse(`${e.xCoordinate}`,x,new Date)):0,circleRadius:qt.checkIfNullOrUndefined(e.connectorRadius)?3.5:e.connectorRadius,strokeWidth:e.showConnector===!0?2:Math.min(e.showConnector||0,1)}:void 0,ui={y:e.yCoordinate?l(e.yCoordinate)+(e.yOffset||0)-8:0+(e.yOffset||0)-8,x:z?0:e.xCoordinate?a(C.parse(`${e.xCoordinate}`,x,new Date))+(e.xOffset||0):0+(e.xOffset||0),width:z?e.xCoordinate?a(C.parse(`${e.xCoordinate}`,x,new Date))+(e.xOffset||0):0+(e.xOffset||0):m+y.right-(e.xCoordinate?a(C.parse(`${e.xCoordinate}`,x,new Date))+(e.xOffset||0):0+(e.xOffset||0)),maxWidth:e.maxWidth,fontWeight:e.fontWeight,align:e.align};return s.jsxRuntimeExports.jsx(ii.Annotation,{color:e.color,connectorsSettings:ci,labelSettings:ui,text:e.text,classNames:e.classNames,styles:e.styles,animate:i,isInView:u},U)},t[192]=i,t[193]=x,t[194]=m,t[195]=u,t[196]=y.right,t[197]=z,t[198]=a,t[199]=l,t[200]=o):o=t[200],oe=Yt.map(o),t[182]=i,t[183]=Yt,t[184]=x,t[185]=m,t[186]=u,t[187]=y.right,t[188]=z,t[189]=a,t[190]=l,t[191]=oe}else oe=t[191];let $e;t[201]!==oe?($e=s.jsxRuntimeExports.jsx("g",{children:oe}),t[201]=oe,t[202]=$e):$e=t[202];let Me;t[203]!==G?(Me=G.filter(Ii).map(Di),t[203]=G,t[204]=Me):Me=t[204];let Fe;t[205]===Symbol.for("react.memo_cache_sentinel")?(Fe={fill:"none",pointerEvents:"all"},t[205]=Fe):Fe=t[205];let Ge;t[206]!==xt||t[207]!==v||t[208]!==m?(Ge=s.jsxRuntimeExports.jsx("rect",{ref:xt,style:Fe,width:m,height:v}),t[206]=xt,t[207]=v,t[208]=m,t[209]=Ge):Ge=t[209];let Pe;return t[210]!==d?.tooltip||t[211]!==p||t[212]!==Q||t[213]!==k||t[214]!==h?.tooltip||t[215]!==B?(Pe=k&&B&&p&&Q?s.jsxRuntimeExports.jsx(mi.Tooltip,{data:k,body:B,xPos:p,yPos:Q,backgroundStyle:h?.tooltip,className:d?.tooltip}):null,t[210]=d?.tooltip,t[211]=p,t[212]=Q,t[213]=k,t[214]=h?.tooltip,t[215]=B,t[216]=Pe):Pe=t[216],s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsx(D.motion.svg,{width:`${rt}px`,height:`${$t}px`,viewBox:`0 0 ${rt} ${$t}`,direction:"ltr",ref:Ct,children:s.jsxRuntimeExports.jsxs("g",{transform:`translate(${y.left},${y.top})`,children:[s.jsxRuntimeExports.jsx("clipPath",{id:`above${lt}`,children:s.jsxRuntimeExports.jsx("path",{d:ue(n),style:ht})}),s.jsxRuntimeExports.jsx("clipPath",{id:`below${lt}`,children:s.jsxRuntimeExports.jsx("path",{d:ce(n),style:nt})}),yt,s.jsxRuntimeExports.jsx(ii.CustomArea,{areaSettings:re,scaleX:a,scaleY:l,animate:i,isInView:u}),s.jsxRuntimeExports.jsx("g",{children:s.jsxRuntimeExports.jsxs("g",{children:[s.jsxRuntimeExports.jsx(yi.YTicksAndGridLines,{values:Qt.filter($i),y:Qt.filter(qi).map(o=>l(o)),x1:0-S,x2:m+y.right,styles:st,classNames:Dt,suffix:O,prefix:w,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:E}),fe,pe]})}),s.jsxRuntimeExports.jsx(pi.XTicksAndGridLines,{values:ai,x:ri,y1:0,y2:v,styles:ye,classNames:ge,suffix:O,prefix:w,labelType:"primary",showGridLines:!0,precision:E}),je,s.jsxRuntimeExports.jsxs("g",{children:[s.jsxRuntimeExports.jsx(D.motion.path,{clipPath:`url(#below${lt})`,d:St(n)||"",style:ve,exit:we,variants:be,initial:"initial",animate:u?"whileInView":"initial"}),s.jsxRuntimeExports.jsx(D.motion.path,{clipPath:`url(#above${lt})`,d:St(n)||"",style:Ee,exit:Oe,variants:Ae,initial:"initial",animate:u?"whileInView":"initial"})]}),s.jsxRuntimeExports.jsxs("g",{children:[s.jsxRuntimeExports.jsx(D.motion.path,{d:pt(n)||"",style:Ve,exit:Le,variants:{initial:{pathLength:0,d:pt(n)||"",opacity:1},whileInView:{pathLength:1,d:pt(n)||"",opacity:1,transition:{duration:i.duration}}},initial:"initial",animate:u?"whileInView":"initial"}),s.jsxRuntimeExports.jsx(D.motion.path,{style:Se,exit:ke,variants:{initial:{pathLength:0,d:Kt(n)||"",opacity:1},whileInView:De},initial:"initial",animate:u?"whileInView":"initial"}),Ie,Ne,Te]}),qe,$e,Me,Ge]})}),Pe]})}function Di(r){return r.layer}function Ii(r){return r.position==="after"}function Ni(r){return r.layer}function Ti(r){return r.position==="before"}function qi(r){return r!==0}function $i(r){return r!==0}function Mi(r){return r.date}function Fi(r){return r.y2}function Gi(r){return r.y2}function Pi(r){return r.y1}function Hi(r){return r.y1}function Wi(r){return r.y2}function Yi(r){return r.y2}function Xi(r){return r.y2}function Ui(r){return r.y1}function Bi(r){return r.y1}function zi(r){return r.y1}function Ji(r){const t=s.compilerRuntimeExports.c(102),{data:j,graphTitle:rt,suffix:$t,sources:c,prefix:O,graphDescription:w,height:x,width:R,footNote:Mt,noOfXTicks:Ft,dateFormat:S,showValues:Gt,padding:wt,lineColors:B,backgroundColor:Pt,leftMargin:Ht,rightMargin:i,topMargin:z,bottomMargin:Wt,tooltip:$,highlightAreaSettings:I,relativeHeight:lt,onSeriesMouseOver:M,graphID:F,graphDownload:Rt,dataDownload:N,animate:bt,language:Yt,minHeight:Xt,labels:T,showColorLegendAtTop:de,colorLegendTitle:Ut,diffAreaColors:Et,strokeWidth:Ot,showDots:h,refValues:d,minValue:E,maxValue:G,annotations:Ct,customHighlightAreaSettings:J,theme:u,ariaLabel:f,yAxisTitle:se,noOfYTicks:At,minDate:ct,maxDate:K,curveType:k,styles:g,classNames:p,precision:ae,customLayers:Q}=r,Bt=$t===void 0?"":$t,Vt=O===void 0?"":O,ut=Ft===void 0?10:Ft,y=S===void 0?"yyyy":S,xt=Gt===void 0?!1:Gt;let Z;t[0]!==B?(Z=B===void 0?[We.Colors.light.categoricalColors.colors[0],We.Colors.light.categoricalColors.colors[1]]:B,t[0]=B,t[1]=Z):Z=t[1];const n=Z,mt=Pt===void 0?!1:Pt,Lt=Ht===void 0?30:Ht,dt=i===void 0?50:i,re=z===void 0?20:z,m=Wt===void 0?25:Wt;let v;t[2]!==I?(v=I===void 0?[]:I,t[2]=I,t[3]=v):v=t[3];const le=v,zt=Rt===void 0?!1:Rt,_=N===void 0?!1:N,tt=bt===void 0?!1:bt,P=Yt===void 0?"en":Yt,Jt=Xt===void 0?0:Xt,q=de===void 0?!1:de;let b;t[4]!==Et?(b=Et===void 0?[We.Colors.alerts.red,We.Colors.alerts.darkGreen]:Et,t[4]=Et,t[5]=b):b=t[5];const et=b,a=Ot===void 0?2:Ot,ft=h===void 0?!0:h;let it;t[6]!==d?(it=d===void 0?[]:d,t[6]=d,t[7]=it):it=t[7];const l=it;let pt;t[8]!==Ct?(pt=Ct===void 0?[]:Ct,t[8]=Ct,t[9]=pt):pt=t[9];const Kt=pt;let St;t[10]!==J?(St=J===void 0?[]:J,t[10]=J,t[11]=St):St=t[11];const ce=St,ue=u===void 0?"light":u,Qt=At===void 0?5:At,Zt=k===void 0?"curve":k,ht=ae===void 0?2:ae;let nt;t[12]!==Q?(nt=Q===void 0?[]:Q,t[12]=Q,t[13]=nt):nt=t[13];const yt=nt,[ot,xe]=L.useState(0),[st,me]=L.useState(0),kt=L.useRef(null),Dt=L.useRef(null);let gt,jt;t[14]===Symbol.for("react.memo_cache_sentinel")?(gt=()=>{const _t=new ResizeObserver(at=>{xe(at[0].target.clientWidth||620),me(at[0].target.clientHeight||480)});return kt.current&&_t.observe(kt.current),()=>_t.disconnect()},jt=[],t[14]=gt,t[15]=jt):(gt=t[14],jt=t[15]),L.useEffect(gt,jt);const It=p?.graphContainer,Nt=g?.graphContainer;let H;t[16]!==p?.description||t[17]!==p?.title||t[18]!==j||t[19]!==_||t[20]!==w||t[21]!==zt||t[22]!==rt||t[23]!==g?.description||t[24]!==g?.title||t[25]!==R?(H=rt||w||zt||_?s.jsxRuntimeExports.jsx(Ci.GraphHeader,{styles:{title:g?.title,description:g?.description},classNames:{title:p?.title,description:p?.description},graphTitle:rt,graphDescription:w,width:R,graphDownload:zt?Dt:void 0,dataDownload:_?j.map(tn).filter(_i).length>0?j.map(Zi).filter(Qi):j.filter(Ki):null}):null,t[16]=p?.description,t[17]=p?.title,t[18]=j,t[19]=_,t[20]=w,t[21]=zt,t[22]=rt,t[23]=g?.description,t[24]=g?.title,t[25]=R,t[26]=H):H=t[26];let A;t[27]!==p?.colorLegend||t[28]!==Ut||t[29]!==j.length||t[30]!==T||t[31]!==n||t[32]!==q?(A=q&&j.length>0?s.jsxRuntimeExports.jsx(Ai.ColorLegend,{colorDomain:T,colorLegendTitle:Ut,colors:n,showNAColor:!1,className:p?.colorLegend}):null,t[27]=p?.colorLegend,t[28]=Ut,t[29]=j.length,t[30]=T,t[31]=n,t[32]=q,t[33]=A):A=t[33];let W;t[34]!==j.length?(W=j.length===0&&s.jsxRuntimeExports.jsx(Li.EmptyState,{}),t[34]=j.length,t[35]=W):W=t[35];let Y;t[36]!==tt||t[37]!==Kt||t[38]!==m||t[39]!==p||t[40]!==Zt||t[41]!==ce||t[42]!==yt||t[43]!==j||t[44]!==y||t[45]!==et||t[46]!==le||t[47]!==T||t[48]!==P||t[49]!==Lt||t[50]!==n||t[51]!==K||t[52]!==G||t[53]!==ct||t[54]!==E||t[55]!==ut||t[56]!==Qt||t[57]!==M||t[58]!==ht||t[59]!==Vt||t[60]!==l||t[61]!==dt||t[62]!==q||t[63]!==ft||t[64]!==xt||t[65]!==a||t[66]!==g||t[67]!==Bt||t[68]!==st||t[69]!==ot||t[70]!==$||t[71]!==re||t[72]!==se?(Y=ot&&st&&j.length>0?s.jsxRuntimeExports.jsx(ki,{data:j,lineColors:n,colorDomain:T,width:ot,height:st,suffix:Bt,prefix:Vt,dateFormat:y,showValues:xt,noOfXTicks:ut??Si.getNoOfTicks(ot),leftMargin:Lt,rightMargin:dt,topMargin:re,bottomMargin:m,highlightAreaSettings:le,tooltip:$,onSeriesMouseOver:M,showColorLegendAtTop:q,animate:tt===!0?{duration:.5,once:!0,amount:.5}:tt||{duration:0,once:!0,amount:0},rtl:P==="he"||P==="ar",diffAreaColors:et,idSuffix:Vi.generateRandomString(8),strokeWidth:a,showDots:ft,refValues:l,minValue:E,maxValue:G,annotations:Kt,customHighlightAreaSettings:ce,yAxisTitle:se,noOfYTicks:Qt,minDate:ct,maxDate:K,curveType:Zt,styles:g,classNames:p,precision:ht,customLayers:yt}):null,t[36]=tt,t[37]=Kt,t[38]=m,t[39]=p,t[40]=Zt,t[41]=ce,t[42]=yt,t[43]=j,t[44]=y,t[45]=et,t[46]=le,t[47]=T,t[48]=P,t[49]=Lt,t[50]=n,t[51]=K,t[52]=G,t[53]=ct,t[54]=E,t[55]=ut,t[56]=Qt,t[57]=M,t[58]=ht,t[59]=Vt,t[60]=l,t[61]=dt,t[62]=q,t[63]=ft,t[64]=xt,t[65]=a,t[66]=g,t[67]=Bt,t[68]=st,t[69]=ot,t[70]=$,t[71]=re,t[72]=se,t[73]=Y):Y=t[73];let X;t[74]!==W||t[75]!==Y?(X=s.jsxRuntimeExports.jsxs(si.GraphArea,{ref:kt,children:[W,Y]}),t[74]=W,t[75]=Y,t[76]=X):X=t[76];let V;t[77]!==p?.footnote||t[78]!==p?.source||t[79]!==Mt||t[80]!==c||t[81]!==g?.footnote||t[82]!==g?.source||t[83]!==R?(V=c||Mt?s.jsxRuntimeExports.jsx(Oi.GraphFooter,{styles:{footnote:g?.footnote,source:g?.source},classNames:{footnote:p?.footnote,source:p?.source},sources:c,footNote:Mt,width:R}):null,t[77]=p?.footnote,t[78]=p?.source,t[79]=Mt,t[80]=c,t[81]=g?.footnote,t[82]=g?.source,t[83]=R,t[84]=V):V=t[84];let vt;return t[85]!==f||t[86]!==mt||t[87]!==F||t[88]!==x||t[89]!==P||t[90]!==Jt||t[91]!==wt||t[92]!==lt||t[93]!==It||t[94]!==Nt||t[95]!==H||t[96]!==A||t[97]!==X||t[98]!==V||t[99]!==ue||t[100]!==R?(vt=s.jsxRuntimeExports.jsxs(si.GraphContainer,{className:It,style:Nt,id:F,ref:Dt,"aria-label":f,backgroundColor:mt,theme:ue,language:P,minHeight:Jt,width:R,height:x,relativeHeight:lt,padding:wt,children:[H,A,X,V]}),t[85]=f,t[86]=mt,t[87]=F,t[88]=x,t[89]=P,t[90]=Jt,t[91]=wt,t[92]=lt,t[93]=It,t[94]=Nt,t[95]=H,t[96]=A,t[97]=X,t[98]=V,t[99]=ue,t[100]=R,t[101]=vt):vt=t[101],vt}function Ki(r){return r!==void 0}function Qi(r){return r!==void 0}function Zi(r){return r.data}function _i(r){return r!==void 0}function tn(r){return r.data}exports.DifferenceLineChart=Ji;
|
|
2
2
|
//# sourceMappingURL=DifferenceLineChart.cjs.map
|
|
@@ -27,7 +27,7 @@ import { GraphHeader as Pi } from "./GraphHeader.js";
|
|
|
27
27
|
import { ColorLegend as Hi } from "./ColorLegend.js";
|
|
28
28
|
import { Colors as Xe } from "./Colors.js";
|
|
29
29
|
import { g as Gi } from "./generateRandomString-za3IQGfQ.js";
|
|
30
|
-
import { E as Ri } from "./EmptyState-
|
|
30
|
+
import { E as Ri } from "./EmptyState-B3fPoH6L.js";
|
|
31
31
|
import { a as Fi, G as Wi } from "./GraphContainer-DwMxWRCi.js";
|
|
32
32
|
import { g as Yi } from "./getNoOfTicks-CpmRjcRF.js";
|
|
33
33
|
function Xi(r) {
|
package/dist/DonutChart.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-CHPV5EwG-6v2a2njQ.cjs"),M=require("react"),ot=require("./Typography-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-CHPV5EwG-6v2a2njQ.cjs"),M=require("react"),ot=require("./Typography-CZZxlj1W.cjs"),mt=require("./index-Cno4Q0YE.cjs"),xt=require("./Source-BOSAl3UX.cjs"),pt=require("./index-DQA8q5sC.cjs"),dt=require("./Tooltip-BLa2EfMs.cjs"),W=require("./Colors.cjs"),ct=require("./numberFormattingFunction-02t-wJta.cjs"),gt=require("./DetailsModal-DIRTulvr.cjs"),F=require("./array-DMyR1sql.cjs"),rt=require("./proxy-C4-uo6nS.cjs"),ht=require("./use-in-view-C3o_ntMv.cjs"),ft=require("./index-CoobIWNj.cjs"),yt=require("./GraphFooter.cjs"),jt=require("./GraphHeader.cjs"),bt=require("./EmptyState-B4c-CrXs.cjs"),it=require("./GraphContainer-B1EDxJ0S.cjs"),vt=Math.PI,st=2*vt;function Et(c,t){return t<c?-1:t>c?1:t>=c?0:NaN}function Ct(c){return c}function Mt(){var c=Ct,t=Et,n=null,a=F.constant(0),r=F.constant(st),p=F.constant(0);function s(e){var l,f=(e=F.array(e)).length,d,S,m=0,g=new Array(f),b=new Array(f),y=+a.apply(this,arguments),q=Math.min(st,Math.max(-st,r.apply(this,arguments)-y)),x,P=Math.min(Math.abs(q)/f,p.apply(this,arguments)),G=P*(q<0?-1:1),h;for(l=0;l<f;++l)(h=b[g[l]=l]=+c(e[l],l,e))>0&&(m+=h);for(t!=null?g.sort(function(R,A){return t(b[R],b[A])}):n!=null&&g.sort(function(R,A){return n(e[R],e[A])}),l=0,S=m?(q-f*G)/m:0;l<f;++l,y=x)d=g[l],h=b[d],x=y+(h>0?h*S:0)+G,b[d]={data:e[d],index:l,value:h,startAngle:y,endAngle:x,padAngle:P};return b}return s.value=function(e){return arguments.length?(c=typeof e=="function"?e:F.constant(+e),s):c},s.sortValues=function(e){return arguments.length?(t=e,n=null,s):t},s.sort=function(e){return arguments.length?(n=e,t=null,s):n},s.startAngle=function(e){return arguments.length?(a=typeof e=="function"?e:F.constant(+e),s):a},s.endAngle=function(e){return arguments.length?(r=typeof e=="function"?e:F.constant(+e),s):r},s.padAngle=function(e){return arguments.length?(p=typeof e=="function"?e:F.constant(+e),s):p},s}const at=(c,t,n,a)=>({x:c+n*Math.cos(a),y:t+n*Math.sin(a)});function lt(c,t,n,a,r){const p=at(c,t,n,a),s=at(c,t,n,Math.abs(r-a)===2*Math.PI?.999999*r:r),e=r-a<=Math.PI?"0":"1";return["M",p.x,p.y,"A",n,n,0,e,1,s.x,s.y].join(" ")}function Rt(c){const t=o.compilerRuntimeExports.c(59),{mainText:n,data:a,radius:r,colors:p,subNote:s,strokeWidth:e,tooltip:l,onSeriesMouseOver:f,onSeriesMouseClick:d,colorDomain:S,resetSelectionOnDoubleClick:m,detailsOnClick:g,styles:b,classNames:y,precision:q,animate:x,trackColor:P}=c,G=M.useRef(null);let h;t[0]!==x.amount||t[1]!==x.once?(h={once:x.once,amount:x.amount},t[0]=x.amount,t[1]=x.once,t[2]=h):h=t[2];const R=ht.useInView(G,h),A=Mt().sort(null).startAngle(0).value(Dt),[j,X]=M.useState(void 0),[v,E]=M.useState(void 0),[V,Y]=M.useState(void 0),[I,J]=M.useState(void 0),K=rt.motion,Q=`${r*2}px`,U=`${r*2}px`,D=`0 0 ${r*2} ${r*2}`,z="ltr",et="mx-auto",T=rt.motion,Z=`translate(${r} ${r})`;let O;t[3]!==a||t[4]!==n||t[5]!==q||t[6]!==r||t[7]!==e||t[8]!==s?(O=n||s?o.jsxRuntimeExports.jsx("foreignObject",{y:0-(r-e),x:0-(r-e),width:2*(r-e),height:2*(r-e),children:o.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-0.5 justify-center items-center h-inherit py-0 px-4",children:[n?M.isValidElement(n)?n:o.jsxRuntimeExports.jsx(ot.E,{marginBottom:"none",className:"donut-main-text text-primary-gray-700 dark:text-primary-gray-100 leading-none text-center",children:typeof n=="string"?n:a.findIndex(u=>u.label===n.label)!==-1?ct.numberFormattingFunction(a[a.findIndex(u=>u.label===n.label)].size,"NA",q,n.prefix,n.suffix):"NA"}):null,s?o.jsxRuntimeExports.jsx(ot._,{marginBottom:"none",size:"base",leading:"none",className:"donut-sub-note text-primary-gray-700 dark:text-primary-gray-100 text-center font-bold",children:s}):typeof n=="string"||!n||M.isValidElement(n)?null:o.jsxRuntimeExports.jsx(ot._,{size:"base",marginBottom:"none",leading:"none",className:"donut-label text-primary-gray-700 dark:text-primary-gray-100 text-center font-bold",children:n.label})]})}):null,t[3]=a,t[4]=n,t[5]=q,t[6]=r,t[7]=e,t[8]=s,t[9]=O):O=t[9];const _=r-e/2;let N;t[10]!==e||t[11]!==_||t[12]!==P?(N=o.jsxRuntimeExports.jsx("circle",{cx:0,cy:0,r:_,fill:"none",stroke:P,strokeWidth:e}),t[10]=e,t[11]=_,t[12]=P,t[13]=N):N=t[13];const $=ft.AnimatePresence;let k;t[14]!==x.duration||t[15]!==S||t[16]!==p||t[17]!==g||t[18]!==R||t[19]!==v||t[20]!==j||t[21]!==d||t[22]!==f||t[23]!==r||t[24]!==m||t[25]!==E||t[26]!==e?(k=(u,ut)=>o.jsxRuntimeExports.jsx(rt.motion.path,{variants:{initial:{pathLength:0,d:lt(0,0,r-e/2,u.startAngle-Math.PI/2,u.endAngle-Math.PI/2),opacity:j?j.label===u.data.label?1:.3:1},whileInView:{pathLength:1,d:lt(0,0,r-e/2,u.startAngle-Math.PI/2,u.endAngle-Math.PI/2),opacity:j?j.label===u.data.label?1:.3:1,transition:{duration:x.duration}}},initial:"initial",animate:R?"whileInView":"initial",exit:{opacity:0,transition:{duration:x.duration}},style:{stroke:S.indexOf(u.data.label)!==-1?p[S.indexOf(u.data.label)%p.length]:W.Colors.gray,strokeWidth:e,fill:"none"},onMouseEnter:tt=>{X(u.data),J(tt.clientY),Y(tt.clientX),f?.(u)},onClick:()=>{(d||g)&&(pt.isEqual(v,u.data)&&m?(E(void 0),d?.(void 0)):(E(u.data),d&&d(u.data)))},onMouseMove:tt=>{X(u.data),J(tt.clientY),Y(tt.clientX)},onMouseLeave:()=>{X(void 0),Y(void 0),J(void 0),f?.(void 0)}},ut),t[14]=x.duration,t[15]=S,t[16]=p,t[17]=g,t[18]=R,t[19]=v,t[20]=j,t[21]=d,t[22]=f,t[23]=r,t[24]=m,t[25]=E,t[26]=e,t[27]=k):k=t[27];const i=A(a).map(k);let C;t[28]!==$||t[29]!==i?(C=o.jsxRuntimeExports.jsx($,{children:i}),t[28]=$,t[29]=i,t[30]=C):C=t[30];let w;t[31]!==N||t[32]!==C||t[33]!==T.g||t[34]!==Z||t[35]!==O?(w=o.jsxRuntimeExports.jsxs(T.g,{transform:Z,children:[O,N,C]}),t[31]=N,t[32]=C,t[33]=T.g,t[34]=Z,t[35]=O,t[36]=w):w=t[36];let B;t[37]!==K.svg||t[38]!==w||t[39]!==Q||t[40]!==U||t[41]!==D?(B=o.jsxRuntimeExports.jsx(K.svg,{ref:G,width:Q,height:U,viewBox:D,direction:z,className:et,children:w}),t[37]=K.svg,t[38]=w,t[39]=Q,t[40]=U,t[41]=D,t[42]=B):B=t[42];let H;t[43]!==y?.tooltip||t[44]!==V||t[45]!==I||t[46]!==j||t[47]!==b?.tooltip||t[48]!==l?(H=j&&l&&V&&I?o.jsxRuntimeExports.jsx(dt.Tooltip,{data:j,body:l,xPos:V,yPos:I,backgroundStyle:b?.tooltip,className:y?.tooltip}):null,t[43]=y?.tooltip,t[44]=V,t[45]=I,t[46]=j,t[47]=b?.tooltip,t[48]=l,t[49]=H):H=t[49];let L;t[50]!==y?.modal||t[51]!==g||t[52]!==v||t[53]!==E?(L=g&&v!==void 0?o.jsxRuntimeExports.jsx(gt.DetailsModal,{body:g,data:v,setData:E,className:y?.modal}):null,t[50]=y?.modal,t[51]=g,t[52]=v,t[53]=E,t[54]=L):L=t[54];let nt;return t[55]!==B||t[56]!==H||t[57]!==L?(nt=o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[B,H,L]}),t[55]=B,t[56]=H,t[57]=L,t[58]=nt):nt=t[58],nt}function Dt(c){return c.size}function Nt(c){const{mainText:t,graphTitle:n,colors:a=W.Colors.light.categoricalColors.colors,suffix:r="",sources:p,prefix:s="",strokeWidth:e=50,graphDescription:l,subNote:f,footNote:d,radius:S,data:m,showColorScale:g=!0,padding:b,backgroundColor:y=!1,tooltip:q,onSeriesMouseOver:x,graphID:P,onSeriesMouseClick:G,graphDownload:h=!1,dataDownload:R=!1,colorDomain:A,sortData:j,language:X="en",theme:v="light",width:E,height:V,minHeight:Y=0,relativeHeight:I,ariaLabel:J,resetSelectionOnDoubleClick:K=!0,colorScaleMaxWidth:Q,detailsOnClick:U,styles:D,classNames:z,precision:et=2,animate:T=!1,trackColor:Z=W.Colors.light.grays["gray-200"]}=c,[O,_]=M.useState(0),N=M.useRef(null),$=M.useRef(null);M.useEffect(()=>{const i=new ResizeObserver(C=>{_((Math.min(C[0].target.clientWidth||620,C[0].target.clientHeight||480)||420)/2)});return N.current&&i.observe(N.current),()=>i.disconnect()},[]);const k=j?mt.orderBy(m,["size"],[j]):m;return o.jsxRuntimeExports.jsxs(it.GraphContainer,{className:z?.graphContainer,style:D?.graphContainer,id:P,ref:$,"aria-label":J,backgroundColor:y,theme:v,language:X,minHeight:Y,width:E,height:V,relativeHeight:I,padding:b,children:[n||l||h||R?o.jsxRuntimeExports.jsx(jt.GraphHeader,{styles:{title:D?.title,description:D?.description},classNames:{title:z?.title,description:z?.description},graphTitle:n,graphDescription:l,width:E,graphDownload:h?$:void 0,dataDownload:R?m.map(i=>i.data).filter(i=>i!==void 0).length>0?m.map(i=>i.data).filter(i=>i!==void 0):m.filter(i=>i!==void 0):null}):null,g&&m.length>0?o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx("div",{className:o.mo("leading-0 flex mb-0 ml-auto mr-auto justify-center gap-x-3 gap-y-0 flex-wrap",z?.colorLegend),style:{maxWidth:Q},"aria-label":"Color legend",children:k.map((i,C)=>o.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 items-center pb-3",children:[o.jsxRuntimeExports.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:(A||k.map(w=>w.label)).indexOf(i.label)!==-1?(a||W.Colors[v].categoricalColors.colors)[(A||k.map(w=>w.label)).indexOf(i.label)%(a||W.Colors[v].categoricalColors.colors).length]:W.Colors.gray}}),o.jsxRuntimeExports.jsxs(ot._,{marginBottom:"none",size:"sm",className:"text-primary-gray-700 dark:text-primary-gray-100",children:[i.label,":"," ",o.jsxRuntimeExports.jsx("span",{className:"font-bold",style:{fontSize:"inherit"},children:ct.numberFormattingFunction(i.size,"NA",et,s,r)})]})]},C))}),o.jsxRuntimeExports.jsx(xt.n,{size:"lg"})]}):null,o.jsxRuntimeExports.jsxs(it.GraphArea,{ref:N,children:[m.length===0&&o.jsxRuntimeExports.jsx(bt.EmptyState,{}),O&&m.length>0?o.jsxRuntimeExports.jsx(Rt,{mainText:t,data:k,colors:a,radius:S||O,subNote:f,strokeWidth:e,tooltip:q,colorDomain:A||k.map(i=>i.label),onSeriesMouseOver:x,onSeriesMouseClick:G,resetSelectionOnDoubleClick:K,styles:D,detailsOnClick:U,precision:et,animate:T===!0?{duration:.5,once:!0,amount:.5}:T||{duration:0,once:!0,amount:0},trackColor:Z}):null]}),p||d?o.jsxRuntimeExports.jsx(yt.GraphFooter,{styles:{footnote:D?.footnote,source:D?.source},classNames:{footnote:z?.footnote,source:z?.source},sources:p,footNote:d,width:E}):null]})}exports.DonutChart=Nt;
|
|
2
2
|
//# sourceMappingURL=DonutChart.cjs.map
|
package/dist/DonutChart.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { c as dt, j as a, m as pt } from "./index-CHPV5EwG-BCLAYDCV.js";
|
|
2
2
|
import { useRef as rt, useState as tt, isValidElement as lt, useEffect as ft } from "react";
|
|
3
|
-
import { E as gt, _ as it } from "./Typography-
|
|
3
|
+
import { E as gt, _ as it } from "./Typography-DMVW6JnV.js";
|
|
4
4
|
import { o as ht } from "./index-BZQYSqar.js";
|
|
5
|
-
import { n as xt } from "./Source-
|
|
5
|
+
import { n as xt } from "./Source-Djkz-7jX.js";
|
|
6
6
|
import { i as yt } from "./index-Bwrro8-q.js";
|
|
7
7
|
import { T as vt } from "./Tooltip-CohiIbLZ.js";
|
|
8
8
|
import { Colors as X } from "./Colors.js";
|
|
@@ -14,7 +14,7 @@ import { u as Mt } from "./use-in-view-DqvKAveg.js";
|
|
|
14
14
|
import { A as Nt } from "./index-Co3YGYe1.js";
|
|
15
15
|
import { GraphFooter as Ct } from "./GraphFooter.js";
|
|
16
16
|
import { GraphHeader as Dt } from "./GraphHeader.js";
|
|
17
|
-
import { E as kt } from "./EmptyState-
|
|
17
|
+
import { E as kt } from "./EmptyState-B3fPoH6L.js";
|
|
18
18
|
import { G as wt, a as At } from "./GraphContainer-DwMxWRCi.js";
|
|
19
19
|
const Ot = Math.PI, at = 2 * Ot;
|
|
20
20
|
function St(c, t) {
|
package/dist/DotDensityMap.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-CHPV5EwG-6v2a2njQ.cjs"),l=require("react"),ht=require("./parse-xYI9yrvL.cjs"),ft=require("./getSliderMarks-CIuSoedo.cjs"),Et=require("./Spinner-jTMOLuw_.cjs"),wt=require("./index-DQA8q5sC.cjs"),q=require("./index-DLFt97gy.cjs"),Ct=require("./Typography-Cc_iHQB-.cjs"),Dt=require("./index-C5K--w8d.cjs"),Rt=require("./Tooltip-BLa2EfMs.cjs"),j=require("./Colors.cjs"),pt=require("./index-sbKVyHS2.cjs"),St=require("./DetailsModal-DIRTulvr.cjs"),kt=require("./pow-BnyPO-NX.cjs"),mt=require("./select-Bnfk0lJx.cjs"),Je=require("./proxy-C4-uo6nS.cjs"),Nt=require("./use-in-view-C3o_ntMv.cjs"),Ot=require("./index-CoobIWNj.cjs"),Mt=require("./GraphFooter.cjs"),qt=require("./GraphHeader.cjs"),Pt=require("./fetchAndParseData-QTF6tjij.cjs"),$t=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),It=require("./uniqBy-O05lp2S5.cjs"),gt=require("./GraphContainer-B1EDxJ0S.cjs");function zt(a){const{data:e,colors:r,mapData:X,colorLegendTitle:P,colorDomain:f,radius:D,height:x,width:m,scale:p,centerPoint:$,tooltip:Y,showLabels:de,mapBorderWidth:qe,mapBorderColor:Pe,mapNoDataColor:me,onSeriesMouseOver:K,showColorScale:$e,zoomScaleExtend:Ie,zoomTranslateExtend:ze,highlightedDataPoints:pe,onSeriesMouseClick:Z,resetSelectionOnDoubleClick:xe,detailsOnClick:y,styles:J,classNames:_,mapProjection:L,zoomInteraction:E,animate:b,dimmedOpacity:Q,customLayers:V,maxRadiusValue:he,collapseColorScaleByDefault:fe,projectionRotate:I,rewindCoordinatesInMapData:ge}=a,ee=l.useMemo(()=>ge?q.index_default(X,{reverse:!0}):X,[X,ge]),[ye,ve]=l.useState(void 0),[be,je]=l.useState(fe===void 0?!(m<680):!fe),B=l.useRef(null),[c,u]=l.useState(void 0),[Ee,te]=l.useState(void 0),[we,oe]=l.useState(void 0),[A,z]=l.useState(void 0),w=l.useRef(null),F=Nt.useInView(w,{once:b.once,amount:b.amount}),T=l.useRef(null),R=e.filter(t=>t.radius===void 0||t.radius===null).length!==e.length?kt.sqrt().domain([0,he]).range([.25,D]).nice():void 0;l.useEffect(()=>{const t=mt.select(T.current),h=mt.select(w.current),n=g=>{if(E==="noZoom")return!1;if(E==="button")return!g.type.includes("wheel");const re=g.type==="wheel",ae=g.type.startsWith("touch"),Ne=g.type==="mousedown"||g.type==="mousemove";return ae?!0:re?E==="scroll"?!0:g.ctrlKey:Ne&&!g.button&&!g.ctrlKey},H=q.zoom().scaleExtent(Ie).translateExtent(ze||[[-20,-20],[m+20,x+20]]).filter(n).on("zoom",({transform:g})=>{t.attr("transform",g)});h.call(H),B.current=H},[x,m,E]);const v=q.index_default$1(ee),C=Dt.index_default(ee),Ce=(v[2]-v[0])*1.15,De=(v[3]-v[1])*1.15,Re=m*190/960*360/Ce,Se=x*190/678*180/De,S=p*Math.min(Re,Se),W=L==="mercator"?q.geoMercator().rotate(I).center($||C.geometry.coordinates).translate([m/2,x/2]).scale(S):L==="equalEarth"?q.geoEqualEarth().rotate(I).center($||C.geometry.coordinates).translate([m/2,x/2]).scale(S):L==="naturalEarth"?q.geoNaturalEarth1().rotate(I).center($||C.geometry.coordinates).translate([m/2,x/2]).scale(S):L==="orthographic"?q.geoOrthographic().rotate(I).center($||C.geometry.coordinates).translate([m/2,x/2]).scale(S):q.geoAlbersUsa().rotate(I).center($||C.geometry.coordinates).translate([m/2,x/2]).scale(S),ke=q.geoPath().projection(W),G=t=>{if(!w.current||!B.current)return;mt.select(w.current).call(B.current.scaleBy,t==="in"?1.2:1/1.2)};return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsxs("div",{className:"relative",children:[o.jsxRuntimeExports.jsx(Je.motion.svg,{width:`${m}px`,height:`${x}px`,viewBox:`0 0 ${m} ${x}`,ref:w,direction:"ltr",children:o.jsxRuntimeExports.jsxs("g",{ref:T,children:[V.filter(t=>t.position==="before").map(t=>t.layer),ee.features.map((t,h)=>{const n=ke(t);return n?o.jsxRuntimeExports.jsx("path",{d:n,style:{stroke:Pe,strokeWidth:qe,fill:me}},h):null}),o.jsxRuntimeExports.jsx(Ot.AnimatePresence,{children:e.map(t=>{const h=e.filter(n=>n.color).length===0?r[0]:t.color?r[f.indexOf(`${t.color}`)]:j.Colors.gray;return o.jsxRuntimeExports.jsxs(Je.motion.g,{className:"undp-map-dots",variants:{initial:{opacity:0},whileInView:{opacity:ye?ye===h?1:Q:pe.length!==0?pe.indexOf(t.label||"")!==-1?1:Q:1,transition:{duration:b.duration}}},initial:"initial",animate:F?"whileInView":"initial",exit:{opacity:0,transition:{duration:b.duration}},onMouseEnter:n=>{te(t),z(n.clientY),oe(n.clientX),K?.(t)},onMouseMove:n=>{te(t),z(n.clientY),oe(n.clientX)},onMouseLeave:()=>{te(void 0),oe(void 0),z(void 0),K?.(void 0)},onClick:()=>{(Z||y)&&(wt.isEqual(c,t)&&xe?(u(void 0),Z?.(void 0)):(u(t),Z?.(t)))},transform:`translate(${W([t.long,t.lat])[0]},${W([t.long,t.lat])[1]})`,children:[o.jsxRuntimeExports.jsx(Je.motion.circle,{cx:0,cy:0,variants:{initial:{r:0,fill:e.filter(n=>n.color).length===0?r[0]:t.color?r[f.indexOf(`${t.color}`)]:j.Colors.gray,stroke:e.filter(n=>n.color).length===0?r[0]:t.color?r[f.indexOf(`${t.color}`)]:j.Colors.gray},whileInView:{r:R?R(t.radius||0):D,fill:e.filter(n=>n.color).length===0?r[0]:t.color?r[f.indexOf(`${t.color}`)]:j.Colors.gray,stroke:e.filter(n=>n.color).length===0?r[0]:t.color?r[f.indexOf(`${t.color}`)]:j.Colors.gray,transition:{duration:b.duration}}},initial:"initial",animate:F?"whileInView":"initial",exit:{r:0,transition:{duration:b.duration}},style:{fillOpacity:.8}}),de&&t.label?o.jsxRuntimeExports.jsx(Je.motion.text,{variants:{initial:{opacity:0,x:R?R(t.radius||0):D,fill:e.filter(n=>n.color).length===0?r[0]:t.color?r[f.indexOf(`${t.color}`)]:j.Colors.gray},whileInView:{opacity:1,x:R?R(t.radius||0):D,transition:{duration:b.duration},fill:e.filter(n=>n.color).length===0?r[0]:t.color?r[f.indexOf(`${t.color}`)]:j.Colors.gray}},initial:"initial",animate:F?"whileInView":"initial",exit:{opacity:0,transition:{duration:b.duration}},y:0,className:o.mo("graph-value text-sm",_?.graphObjectValues),style:{textAnchor:"start",...J?.graphObjectValues||{}},dx:4,dy:5,children:t.label}):null]},t.label||`${t.lat}-${t.long}`)})}),V.filter(t=>t.position==="after").map(t=>t.layer)]})}),e.filter(t=>t.color).length===0||$e===!1?null:o.jsxRuntimeExports.jsx("div",{className:o.mo("absolute left-4 bottom-4 map-color-legend",_?.colorLegend),children:be?o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx("div",{className:"color-legend-close-button bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)] border border-[var(--gray-400)] rounded-full w-6 h-6 p-[3px] cursor-pointer z-10 absolute right-[-0.75rem] top-[-0.75rem]",onClick:()=>{je(!1)},children:o.jsxRuntimeExports.jsx(pt.X,{})}),o.jsxRuntimeExports.jsxs("div",{className:"p-2",style:{backgroundColor:"rgba(240,240,240, 0.7)"},children:[P&&P!==""?o.jsxRuntimeExports.jsx("p",{className:"p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300",style:{display:"-webkit-box",WebkitLineClamp:"1",WebkitBoxOrient:"vertical"},children:P}):null,o.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-3",children:f.map((t,h)=>o.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 items-center",onMouseOver:()=>{ve(r[h%r.length])},onMouseLeave:()=>{ve(void 0)},children:[o.jsxRuntimeExports.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:r[h%r.length]}}),o.jsxRuntimeExports.jsx(Ct._,{size:"sm",marginBottom:"none",leading:"none",children:t})]},h))})]})]}):o.jsxRuntimeExports.jsx("button",{type:"button",className:"mb-0 border-0 bg-transparent p-0 self-start",onClick:()=>{je(!0)},children:o.jsxRuntimeExports.jsx("div",{className:"show-color-legend-button items-start text-sm font-medium cursor-pointer p-2 mb-0 flex text-primary-black dark:text-primary-gray-300 bg-primary-gray-300 dark:bg-primary-gray-600 border-primary-gray-400 dark:border-primary-gray-500",children:"Show Legend"})})}),E==="button"&&o.jsxRuntimeExports.jsxs("div",{className:"absolute left-4 top-4 flex flex-col zoom-buttons",children:[o.jsxRuntimeExports.jsx("button",{onClick:()=>G("in"),className:"leading-0 px-2 py-3.5 text-primary-gray-700 border border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"+"}),o.jsxRuntimeExports.jsx("button",{onClick:()=>G("out"),className:"leading-0 px-2 py-3.5 text-primary-gray-700 border border-t-0 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"–"})]})]}),y&&c!==void 0?o.jsxRuntimeExports.jsx(St.DetailsModal,{body:y,data:c,setData:u,className:_?.modal}):null,Ee&&Y&&we&&A?o.jsxRuntimeExports.jsx(Rt.Tooltip,{data:Ee,body:Y,xPos:we,yPos:A,backgroundStyle:J?.tooltip,className:_?.tooltip}):null]})}function _t(a){const e=o.compilerRuntimeExports.c(121),{data:r,mapData:X,graphTitle:P,colors:f,sources:D,graphDescription:x,height:m,width:p,footNote:$,colorLegendTitle:Y,colorDomain:de,radius:qe,scale:Pe,centerPoint:me,padding:K,mapBorderWidth:$e,mapNoDataColor:Ie,backgroundColor:ze,showLabels:pe,mapBorderColor:Z,tooltip:xe,relativeHeight:y,onSeriesMouseOver:J,isWorldMap:_,showColorScale:L,zoomScaleExtend:E,zoomTranslateExtend:b,graphID:Q,highlightedDataPoints:V,onSeriesMouseClick:he,graphDownload:fe,dataDownload:I,showAntarctica:ge,language:ee,minHeight:ye,theme:ve,ariaLabel:be,resetSelectionOnDoubleClick:je,detailsOnClick:B,styles:c,classNames:u,mapProjection:Ee,zoomInteraction:te,animate:we,dimmedOpacity:oe,customLayers:A,maxRadiusValue:z,timeline:w,collapseColorScaleByDefault:F,projectionRotate:T,rewindCoordinatesInMapData:R}=a,v=X===void 0?"https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-v2.json":X,C=$===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.":$,Ce=qe===void 0?5:qe,De=Pe===void 0?.95:Pe,Re=$e===void 0?.5:$e,Se=Ie===void 0?j.Colors.light.graphNoData:Ie,S=ze===void 0?!1:ze,W=pe===void 0?!1:pe,ke=Z===void 0?j.Colors.light.grays["gray-500"]:Z,G=_===void 0?!0:_,t=L===void 0?!0:L;let h;e[0]!==E?(h=E===void 0?[.8,6]:E,e[0]=E,e[1]=h):h=e[1];const n=h;let H;e[2]!==V?(H=V===void 0?[]:V,e[2]=V,e[3]=H):H=e[3];const g=H,re=fe===void 0?!1:fe,ae=I===void 0?!1:I,Ne=ge===void 0?!1:ge,Qe=ee===void 0?"en":ee,k=ye===void 0?0:ye,ne=ve===void 0?"light":ve,et=je===void 0?!0:je,tt=Ee===void 0?"naturalEarth":Ee,ot=te===void 0?"button":te,_e=we===void 0?!1:we,rt=oe===void 0?.3:oe;let Le;e[4]!==A?(Le=A===void 0?[]:A,e[4]=A,e[5]=Le):Le=e[5];const at=Le;let Ve;e[6]!==w?(Ve=w===void 0?{enabled:!1,autoplay:!1,showOnlyActiveDate:!0}:w,e[6]=w,e[7]=Ve):Ve=e[7];const i=Ve;let Be;e[8]!==T?(Be=T===void 0?[0,0]:T,e[8]=T,e[9]=Be):Be=e[9];const nt=Be,it=R===void 0?!0:R,[U,yt]=l.useState(0),[Oe,vt]=l.useState(0),[N,bt]=l.useState(i.autoplay);let Me;if(e[10]!==r||e[11]!==i.dateFormat){let d;e[13]!==i.dateFormat?(d=M=>ht.parse(`${M.date}`,i.dateFormat||"yyyy",new Date).getTime(),e[13]=i.dateFormat,e[14]=d):d=e[14],Me=[...new Set(r.filter(Yt).map(d))],Me.sort(Xt),e[10]=r,e[11]=i.dateFormat,e[12]=Me}else Me=e[12];const s=Me,[O,st]=l.useState(i.autoplay?0:s.length-1),[ie,jt]=l.useState(void 0),lt=l.useRef(null),xt=l.useRef(null);let Ae,Fe;e[15]===Symbol.for("react.memo_cache_sentinel")?(Ae=()=>{const d=new ResizeObserver(M=>{yt(M[0].target.clientWidth||620),vt(M[0].target.clientHeight||480)});return lt.current&&d.observe(lt.current),()=>d.disconnect()},Fe=[],e[15]=Ae,e[16]=Fe):(Ae=e[15],Fe=e[16]),l.useEffect(Ae,Fe);let Te;e[17]===Symbol.for("react.memo_cache_sentinel")?(Te=d=>{jt(d)},e[17]=Te):Te=e[17];const We=l.useEffectEvent(Te);let Ge;e[18]!==v||e[19]!==We?(Ge=()=>{typeof v=="string"?Pt.fetchAndParseJSON(v).then(M=>{We(M)}):We(v)},e[18]=v,e[19]=We,e[20]=Ge):Ge=e[20];let He;e[21]!==v?(He=[v],e[21]=v,e[22]=He):He=e[22],l.useEffect(Ge,He);let Ue,Xe;e[23]!==N||e[24]!==i.speed||e[25]!==s?(Ue=()=>{const d=setInterval(()=>{st(M=>M<s.length-1?M+1:0)},(i.speed||2)*1e3);return N||clearInterval(d),()=>clearInterval(d)},Xe=[s,N,i.speed],e[23]=N,e[24]=i.speed,e[25]=s,e[26]=Ue,e[27]=Xe):(Ue=e[26],Xe=e[27]),l.useEffect(Ue,Xe);const ct=i.dateFormat||"yyyy";let Ye;e[28]!==O||e[29]!==ct||e[30]!==i.showOnlyActiveDate||e[31]!==s?(Ye=ft.getSliderMarks(s,O,i.showOnlyActiveDate,ct),e[28]=O,e[29]=ct,e[30]=i.showOnlyActiveDate,e[31]=s,e[32]=Ye):Ye=e[32];const Ke=Ye,ut=u?.graphContainer,dt=c?.graphContainer;let se;e[33]!==u?.description||e[34]!==u?.title||e[35]!==r||e[36]!==ae||e[37]!==x||e[38]!==re||e[39]!==P||e[40]!==c?.description||e[41]!==c?.title||e[42]!==p?(se=P||x||re||ae?o.jsxRuntimeExports.jsx(qt.GraphHeader,{styles:{title:c?.title,description:c?.description},classNames:{title:u?.title,description:u?.description},graphTitle:P,graphDescription:x,width:p,graphDownload:re?xt:void 0,dataDownload:ae?r.map(Ut).filter(Ht).length>0?r.map(Gt).filter(Wt):r.filter(Tt):null}):null,e[33]=u?.description,e[34]=u?.title,e[35]=r,e[36]=ae,e[37]=x,e[38]=re,e[39]=P,e[40]=c?.description,e[41]=c?.title,e[42]=p,e[43]=se):se=e[43];let le;e[44]!==O||e[45]!==Ke||e[46]!==N||e[47]!==i.enabled||e[48]!==s?(le=i.enabled&&s.length>0&&Ke?o.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[o.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{bt(!N)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":N?"Click to pause animation":"Click to play animation",children:N?o.jsxRuntimeExports.jsx(pt.Pause,{}):o.jsxRuntimeExports.jsx(pt.Play,{})}),o.jsxRuntimeExports.jsx(ft.Nr,{min:s[0],max:s[s.length-1],marks:Ke,step:null,defaultValue:s[s.length-1],value:s[O],onChangeComplete:d=>{st(s.indexOf(d))},onChange:d=>{st(s.indexOf(d))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,e[44]=O,e[45]=Ke,e[46]=N,e[47]=i.enabled,e[48]=s,e[49]=le):le=e[49];let ce;e[50]!==_e||e[51]!==me||e[52]!==u||e[53]!==F||e[54]!==de||e[55]!==Y||e[56]!==f||e[57]!==at||e[58]!==r||e[59]!==B||e[60]!==rt||e[61]!==m||e[62]!==g||e[63]!==O||e[64]!==G||e[65]!==ke||e[66]!==Re||e[67]!==Se||e[68]!==tt||e[69]!==ie||e[70]!==z||e[71]!==k||e[72]!==he||e[73]!==J||e[74]!==nt||e[75]!==Ce||e[76]!==y||e[77]!==et||e[78]!==it||e[79]!==De||e[80]!==Ne||e[81]!==t||e[82]!==W||e[83]!==c||e[84]!==Oe||e[85]!==U||e[86]!==ne||e[87]!==i.dateFormat||e[88]!==i.enabled||e[89]!==xe||e[90]!==s||e[91]!==p||e[92]!==ot||e[93]!==n||e[94]!==b?(ce=o.jsxRuntimeExports.jsx(gt.GraphArea,{ref:lt,children:U&&Oe&&ie?o.jsxRuntimeExports.jsx(zt,{data:r.filter(d=>i.enabled?d.date===ht.format(new Date(s[O]),i.dateFormat||"yyyy"):d),mapData:Ne?ie:{...ie,features:ie.features.filter(Ft)},colorDomain:r.filter(At).length===0?[]:de||It.uniqBy(r,"color",!0),width:U,height:Oe,scale:De,centerPoint:me,colors:r.filter(Bt).length===0?f?[f]:[j.Colors.primaryColors["blue-600"]]:f||j.Colors[ne].categoricalColors.colors,colorLegendTitle:Y,radius:Ce,mapBorderWidth:Re,mapNoDataColor:Se,mapBorderColor:ke,tooltip:xe,onSeriesMouseOver:J,showLabels:W,isWorldMap:G,showColorScale:t,zoomScaleExtend:n,zoomTranslateExtend:b,onSeriesMouseClick:he,highlightedDataPoints:g,resetSelectionOnDoubleClick:et,styles:c,classNames:u,zoomInteraction:ot,detailsOnClick:B,mapProjection:tt||(G?"naturalEarth":"mercator"),animate:_e===!0?{duration:.5,once:!0,amount:.5}:_e||{duration:0,once:!0,amount:0},dimmedOpacity:rt,customLayers:at,maxRadiusValue:$t.checkIfNullOrUndefined(z)?Math.max(...r.map(Vt).filter(Lt)):z,collapseColorScaleByDefault:F,projectionRotate:nt,rewindCoordinatesInMapData:it}):o.jsxRuntimeExports.jsx("div",{style:{height:`${Math.max(k,m||(y?k?(p||U)*y>k?(p||U)*y:k:(p||U)*y:Oe))}px`},className:"flex items-center justify-center",children:o.jsxRuntimeExports.jsx(Et.w,{"aria-label":"Loading graph"})})}),e[50]=_e,e[51]=me,e[52]=u,e[53]=F,e[54]=de,e[55]=Y,e[56]=f,e[57]=at,e[58]=r,e[59]=B,e[60]=rt,e[61]=m,e[62]=g,e[63]=O,e[64]=G,e[65]=ke,e[66]=Re,e[67]=Se,e[68]=tt,e[69]=ie,e[70]=z,e[71]=k,e[72]=he,e[73]=J,e[74]=nt,e[75]=Ce,e[76]=y,e[77]=et,e[78]=it,e[79]=De,e[80]=Ne,e[81]=t,e[82]=W,e[83]=c,e[84]=Oe,e[85]=U,e[86]=ne,e[87]=i.dateFormat,e[88]=i.enabled,e[89]=xe,e[90]=s,e[91]=p,e[92]=ot,e[93]=n,e[94]=b,e[95]=ce):ce=e[95];let ue;e[96]!==u?.footnote||e[97]!==u?.source||e[98]!==C||e[99]!==D||e[100]!==c?.footnote||e[101]!==c?.source||e[102]!==p?(ue=D||C?o.jsxRuntimeExports.jsx(Mt.GraphFooter,{styles:{footnote:c?.footnote,source:c?.source},classNames:{footnote:u?.footnote,source:u?.source},sources:D,footNote:C,width:p}):null,e[96]=u?.footnote,e[97]=u?.source,e[98]=C,e[99]=D,e[100]=c?.footnote,e[101]=c?.source,e[102]=p,e[103]=ue):ue=e[103];let Ze;return e[104]!==be||e[105]!==S||e[106]!==Q||e[107]!==m||e[108]!==Qe||e[109]!==k||e[110]!==K||e[111]!==y||e[112]!==ut||e[113]!==dt||e[114]!==se||e[115]!==le||e[116]!==ce||e[117]!==ue||e[118]!==ne||e[119]!==p?(Ze=o.jsxRuntimeExports.jsxs(gt.GraphContainer,{className:ut,style:dt,id:Q,ref:xt,"aria-label":be,backgroundColor:S,theme:ne,language:Qe,minHeight:k,width:p,height:m,relativeHeight:y,padding:K,children:[se,le,ce,ue]}),e[104]=be,e[105]=S,e[106]=Q,e[107]=m,e[108]=Qe,e[109]=k,e[110]=K,e[111]=y,e[112]=ut,e[113]=dt,e[114]=se,e[115]=le,e[116]=ce,e[117]=ue,e[118]=ne,e[119]=p,e[120]=Ze):Ze=e[120],Ze}function Lt(a){return a!=null}function Vt(a){return a.radius}function Bt(a){return a.color}function At(a){return a.color}function Ft(a){return a.properties.NAME!=="Antarctica"}function Tt(a){return a!==void 0}function Wt(a){return a!==void 0}function Gt(a){return a.data}function Ht(a){return a!==void 0}function Ut(a){return a.data}function Xt(a,e){return a-e}function Yt(a){return a.date}exports.DotDensityMap=_t;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-CHPV5EwG-6v2a2njQ.cjs"),l=require("react"),ht=require("./parse-xYI9yrvL.cjs"),ft=require("./getSliderMarks-CIuSoedo.cjs"),Et=require("./Spinner-jTMOLuw_.cjs"),wt=require("./index-DQA8q5sC.cjs"),q=require("./index-DLFt97gy.cjs"),Ct=require("./Typography-CZZxlj1W.cjs"),Dt=require("./index-C5K--w8d.cjs"),Rt=require("./Tooltip-BLa2EfMs.cjs"),j=require("./Colors.cjs"),pt=require("./index-sbKVyHS2.cjs"),St=require("./DetailsModal-DIRTulvr.cjs"),kt=require("./pow-BnyPO-NX.cjs"),mt=require("./select-Bnfk0lJx.cjs"),Je=require("./proxy-C4-uo6nS.cjs"),Nt=require("./use-in-view-C3o_ntMv.cjs"),Ot=require("./index-CoobIWNj.cjs"),Mt=require("./GraphFooter.cjs"),qt=require("./GraphHeader.cjs"),$t=require("./fetchAndParseData-QTF6tjij.cjs"),Pt=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),It=require("./uniqBy-O05lp2S5.cjs"),gt=require("./GraphContainer-B1EDxJ0S.cjs");function zt(a){const{data:e,colors:r,mapData:X,colorLegendTitle:$,colorDomain:f,radius:D,height:x,width:m,scale:p,centerPoint:P,tooltip:Y,showLabels:de,mapBorderWidth:qe,mapBorderColor:$e,mapNoDataColor:me,onSeriesMouseOver:K,showColorScale:Pe,zoomScaleExtend:Ie,zoomTranslateExtend:ze,highlightedDataPoints:pe,onSeriesMouseClick:Z,resetSelectionOnDoubleClick:xe,detailsOnClick:y,styles:J,classNames:_,mapProjection:L,zoomInteraction:E,animate:b,dimmedOpacity:Q,customLayers:V,maxRadiusValue:he,collapseColorScaleByDefault:fe,projectionRotate:I,rewindCoordinatesInMapData:ge}=a,ee=l.useMemo(()=>ge?q.index_default(X,{reverse:!0}):X,[X,ge]),[ye,ve]=l.useState(void 0),[be,je]=l.useState(fe===void 0?!(m<680):!fe),B=l.useRef(null),[c,u]=l.useState(void 0),[Ee,te]=l.useState(void 0),[we,oe]=l.useState(void 0),[A,z]=l.useState(void 0),w=l.useRef(null),F=Nt.useInView(w,{once:b.once,amount:b.amount}),T=l.useRef(null),R=e.filter(t=>t.radius===void 0||t.radius===null).length!==e.length?kt.sqrt().domain([0,he]).range([.25,D]).nice():void 0;l.useEffect(()=>{const t=mt.select(T.current),h=mt.select(w.current),n=g=>{if(E==="noZoom")return!1;if(E==="button")return!g.type.includes("wheel");const re=g.type==="wheel",ae=g.type.startsWith("touch"),Ne=g.type==="mousedown"||g.type==="mousemove";return ae?!0:re?E==="scroll"?!0:g.ctrlKey:Ne&&!g.button&&!g.ctrlKey},H=q.zoom().scaleExtent(Ie).translateExtent(ze||[[-20,-20],[m+20,x+20]]).filter(n).on("zoom",({transform:g})=>{t.attr("transform",g)});h.call(H),B.current=H},[x,m,E]);const v=q.index_default$1(ee),C=Dt.index_default(ee),Ce=(v[2]-v[0])*1.15,De=(v[3]-v[1])*1.15,Re=m*190/960*360/Ce,Se=x*190/678*180/De,S=p*Math.min(Re,Se),W=L==="mercator"?q.geoMercator().rotate(I).center(P||C.geometry.coordinates).translate([m/2,x/2]).scale(S):L==="equalEarth"?q.geoEqualEarth().rotate(I).center(P||C.geometry.coordinates).translate([m/2,x/2]).scale(S):L==="naturalEarth"?q.geoNaturalEarth1().rotate(I).center(P||C.geometry.coordinates).translate([m/2,x/2]).scale(S):L==="orthographic"?q.geoOrthographic().rotate(I).center(P||C.geometry.coordinates).translate([m/2,x/2]).scale(S):q.geoAlbersUsa().rotate(I).center(P||C.geometry.coordinates).translate([m/2,x/2]).scale(S),ke=q.geoPath().projection(W),G=t=>{if(!w.current||!B.current)return;mt.select(w.current).call(B.current.scaleBy,t==="in"?1.2:1/1.2)};return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsxs("div",{className:"relative",children:[o.jsxRuntimeExports.jsx(Je.motion.svg,{width:`${m}px`,height:`${x}px`,viewBox:`0 0 ${m} ${x}`,ref:w,direction:"ltr",children:o.jsxRuntimeExports.jsxs("g",{ref:T,children:[V.filter(t=>t.position==="before").map(t=>t.layer),ee.features.map((t,h)=>{const n=ke(t);return n?o.jsxRuntimeExports.jsx("path",{d:n,style:{stroke:$e,strokeWidth:qe,fill:me}},h):null}),o.jsxRuntimeExports.jsx(Ot.AnimatePresence,{children:e.map(t=>{const h=e.filter(n=>n.color).length===0?r[0]:t.color?r[f.indexOf(`${t.color}`)]:j.Colors.gray;return o.jsxRuntimeExports.jsxs(Je.motion.g,{className:"undp-map-dots",variants:{initial:{opacity:0},whileInView:{opacity:ye?ye===h?1:Q:pe.length!==0?pe.indexOf(t.label||"")!==-1?1:Q:1,transition:{duration:b.duration}}},initial:"initial",animate:F?"whileInView":"initial",exit:{opacity:0,transition:{duration:b.duration}},onMouseEnter:n=>{te(t),z(n.clientY),oe(n.clientX),K?.(t)},onMouseMove:n=>{te(t),z(n.clientY),oe(n.clientX)},onMouseLeave:()=>{te(void 0),oe(void 0),z(void 0),K?.(void 0)},onClick:()=>{(Z||y)&&(wt.isEqual(c,t)&&xe?(u(void 0),Z?.(void 0)):(u(t),Z?.(t)))},transform:`translate(${W([t.long,t.lat])[0]},${W([t.long,t.lat])[1]})`,children:[o.jsxRuntimeExports.jsx(Je.motion.circle,{cx:0,cy:0,variants:{initial:{r:0,fill:e.filter(n=>n.color).length===0?r[0]:t.color?r[f.indexOf(`${t.color}`)]:j.Colors.gray,stroke:e.filter(n=>n.color).length===0?r[0]:t.color?r[f.indexOf(`${t.color}`)]:j.Colors.gray},whileInView:{r:R?R(t.radius||0):D,fill:e.filter(n=>n.color).length===0?r[0]:t.color?r[f.indexOf(`${t.color}`)]:j.Colors.gray,stroke:e.filter(n=>n.color).length===0?r[0]:t.color?r[f.indexOf(`${t.color}`)]:j.Colors.gray,transition:{duration:b.duration}}},initial:"initial",animate:F?"whileInView":"initial",exit:{r:0,transition:{duration:b.duration}},style:{fillOpacity:.8}}),de&&t.label?o.jsxRuntimeExports.jsx(Je.motion.text,{variants:{initial:{opacity:0,x:R?R(t.radius||0):D,fill:e.filter(n=>n.color).length===0?r[0]:t.color?r[f.indexOf(`${t.color}`)]:j.Colors.gray},whileInView:{opacity:1,x:R?R(t.radius||0):D,transition:{duration:b.duration},fill:e.filter(n=>n.color).length===0?r[0]:t.color?r[f.indexOf(`${t.color}`)]:j.Colors.gray}},initial:"initial",animate:F?"whileInView":"initial",exit:{opacity:0,transition:{duration:b.duration}},y:0,className:o.mo("graph-value text-sm",_?.graphObjectValues),style:{textAnchor:"start",...J?.graphObjectValues||{}},dx:4,dy:5,children:t.label}):null]},t.label||`${t.lat}-${t.long}`)})}),V.filter(t=>t.position==="after").map(t=>t.layer)]})}),e.filter(t=>t.color).length===0||Pe===!1?null:o.jsxRuntimeExports.jsx("div",{className:o.mo("absolute left-4 bottom-4 map-color-legend",_?.colorLegend),children:be?o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx("div",{className:"color-legend-close-button bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)] border border-[var(--gray-400)] rounded-full w-6 h-6 p-[3px] cursor-pointer z-10 absolute right-[-0.75rem] top-[-0.75rem]",onClick:()=>{je(!1)},children:o.jsxRuntimeExports.jsx(pt.X,{})}),o.jsxRuntimeExports.jsxs("div",{className:"p-2",style:{backgroundColor:"rgba(240,240,240, 0.7)"},children:[$&&$!==""?o.jsxRuntimeExports.jsx("p",{className:"p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300",style:{display:"-webkit-box",WebkitLineClamp:"1",WebkitBoxOrient:"vertical"},children:$}):null,o.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-3",children:f.map((t,h)=>o.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 items-center",onMouseOver:()=>{ve(r[h%r.length])},onMouseLeave:()=>{ve(void 0)},children:[o.jsxRuntimeExports.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:r[h%r.length]}}),o.jsxRuntimeExports.jsx(Ct._,{size:"sm",marginBottom:"none",leading:"none",children:t})]},h))})]})]}):o.jsxRuntimeExports.jsx("button",{type:"button",className:"mb-0 border-0 bg-transparent p-0 self-start",onClick:()=>{je(!0)},children:o.jsxRuntimeExports.jsx("div",{className:"show-color-legend-button items-start text-sm font-medium cursor-pointer p-2 mb-0 flex text-primary-black dark:text-primary-gray-300 bg-primary-gray-300 dark:bg-primary-gray-600 border-primary-gray-400 dark:border-primary-gray-500",children:"Show Legend"})})}),E==="button"&&o.jsxRuntimeExports.jsxs("div",{className:"absolute left-4 top-4 flex flex-col zoom-buttons",children:[o.jsxRuntimeExports.jsx("button",{onClick:()=>G("in"),className:"leading-0 px-2 py-3.5 text-primary-gray-700 border border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"+"}),o.jsxRuntimeExports.jsx("button",{onClick:()=>G("out"),className:"leading-0 px-2 py-3.5 text-primary-gray-700 border border-t-0 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"–"})]})]}),y&&c!==void 0?o.jsxRuntimeExports.jsx(St.DetailsModal,{body:y,data:c,setData:u,className:_?.modal}):null,Ee&&Y&&we&&A?o.jsxRuntimeExports.jsx(Rt.Tooltip,{data:Ee,body:Y,xPos:we,yPos:A,backgroundStyle:J?.tooltip,className:_?.tooltip}):null]})}function _t(a){const e=o.compilerRuntimeExports.c(121),{data:r,mapData:X,graphTitle:$,colors:f,sources:D,graphDescription:x,height:m,width:p,footNote:P,colorLegendTitle:Y,colorDomain:de,radius:qe,scale:$e,centerPoint:me,padding:K,mapBorderWidth:Pe,mapNoDataColor:Ie,backgroundColor:ze,showLabels:pe,mapBorderColor:Z,tooltip:xe,relativeHeight:y,onSeriesMouseOver:J,isWorldMap:_,showColorScale:L,zoomScaleExtend:E,zoomTranslateExtend:b,graphID:Q,highlightedDataPoints:V,onSeriesMouseClick:he,graphDownload:fe,dataDownload:I,showAntarctica:ge,language:ee,minHeight:ye,theme:ve,ariaLabel:be,resetSelectionOnDoubleClick:je,detailsOnClick:B,styles:c,classNames:u,mapProjection:Ee,zoomInteraction:te,animate:we,dimmedOpacity:oe,customLayers:A,maxRadiusValue:z,timeline:w,collapseColorScaleByDefault:F,projectionRotate:T,rewindCoordinatesInMapData:R}=a,v=X===void 0?"https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-v2.json":X,C=P===void 0?"The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.":P,Ce=qe===void 0?5:qe,De=$e===void 0?.95:$e,Re=Pe===void 0?.5:Pe,Se=Ie===void 0?j.Colors.light.graphNoData:Ie,S=ze===void 0?!1:ze,W=pe===void 0?!1:pe,ke=Z===void 0?j.Colors.light.grays["gray-500"]:Z,G=_===void 0?!0:_,t=L===void 0?!0:L;let h;e[0]!==E?(h=E===void 0?[.8,6]:E,e[0]=E,e[1]=h):h=e[1];const n=h;let H;e[2]!==V?(H=V===void 0?[]:V,e[2]=V,e[3]=H):H=e[3];const g=H,re=fe===void 0?!1:fe,ae=I===void 0?!1:I,Ne=ge===void 0?!1:ge,Qe=ee===void 0?"en":ee,k=ye===void 0?0:ye,ne=ve===void 0?"light":ve,et=je===void 0?!0:je,tt=Ee===void 0?"naturalEarth":Ee,ot=te===void 0?"button":te,_e=we===void 0?!1:we,rt=oe===void 0?.3:oe;let Le;e[4]!==A?(Le=A===void 0?[]:A,e[4]=A,e[5]=Le):Le=e[5];const at=Le;let Ve;e[6]!==w?(Ve=w===void 0?{enabled:!1,autoplay:!1,showOnlyActiveDate:!0}:w,e[6]=w,e[7]=Ve):Ve=e[7];const i=Ve;let Be;e[8]!==T?(Be=T===void 0?[0,0]:T,e[8]=T,e[9]=Be):Be=e[9];const nt=Be,it=R===void 0?!0:R,[U,yt]=l.useState(0),[Oe,vt]=l.useState(0),[N,bt]=l.useState(i.autoplay);let Me;if(e[10]!==r||e[11]!==i.dateFormat){let d;e[13]!==i.dateFormat?(d=M=>ht.parse(`${M.date}`,i.dateFormat||"yyyy",new Date).getTime(),e[13]=i.dateFormat,e[14]=d):d=e[14],Me=[...new Set(r.filter(Yt).map(d))],Me.sort(Xt),e[10]=r,e[11]=i.dateFormat,e[12]=Me}else Me=e[12];const s=Me,[O,st]=l.useState(i.autoplay?0:s.length-1),[ie,jt]=l.useState(void 0),lt=l.useRef(null),xt=l.useRef(null);let Ae,Fe;e[15]===Symbol.for("react.memo_cache_sentinel")?(Ae=()=>{const d=new ResizeObserver(M=>{yt(M[0].target.clientWidth||620),vt(M[0].target.clientHeight||480)});return lt.current&&d.observe(lt.current),()=>d.disconnect()},Fe=[],e[15]=Ae,e[16]=Fe):(Ae=e[15],Fe=e[16]),l.useEffect(Ae,Fe);let Te;e[17]===Symbol.for("react.memo_cache_sentinel")?(Te=d=>{jt(d)},e[17]=Te):Te=e[17];const We=l.useEffectEvent(Te);let Ge;e[18]!==v||e[19]!==We?(Ge=()=>{typeof v=="string"?$t.fetchAndParseJSON(v).then(M=>{We(M)}):We(v)},e[18]=v,e[19]=We,e[20]=Ge):Ge=e[20];let He;e[21]!==v?(He=[v],e[21]=v,e[22]=He):He=e[22],l.useEffect(Ge,He);let Ue,Xe;e[23]!==N||e[24]!==i.speed||e[25]!==s?(Ue=()=>{const d=setInterval(()=>{st(M=>M<s.length-1?M+1:0)},(i.speed||2)*1e3);return N||clearInterval(d),()=>clearInterval(d)},Xe=[s,N,i.speed],e[23]=N,e[24]=i.speed,e[25]=s,e[26]=Ue,e[27]=Xe):(Ue=e[26],Xe=e[27]),l.useEffect(Ue,Xe);const ct=i.dateFormat||"yyyy";let Ye;e[28]!==O||e[29]!==ct||e[30]!==i.showOnlyActiveDate||e[31]!==s?(Ye=ft.getSliderMarks(s,O,i.showOnlyActiveDate,ct),e[28]=O,e[29]=ct,e[30]=i.showOnlyActiveDate,e[31]=s,e[32]=Ye):Ye=e[32];const Ke=Ye,ut=u?.graphContainer,dt=c?.graphContainer;let se;e[33]!==u?.description||e[34]!==u?.title||e[35]!==r||e[36]!==ae||e[37]!==x||e[38]!==re||e[39]!==$||e[40]!==c?.description||e[41]!==c?.title||e[42]!==p?(se=$||x||re||ae?o.jsxRuntimeExports.jsx(qt.GraphHeader,{styles:{title:c?.title,description:c?.description},classNames:{title:u?.title,description:u?.description},graphTitle:$,graphDescription:x,width:p,graphDownload:re?xt:void 0,dataDownload:ae?r.map(Ut).filter(Ht).length>0?r.map(Gt).filter(Wt):r.filter(Tt):null}):null,e[33]=u?.description,e[34]=u?.title,e[35]=r,e[36]=ae,e[37]=x,e[38]=re,e[39]=$,e[40]=c?.description,e[41]=c?.title,e[42]=p,e[43]=se):se=e[43];let le;e[44]!==O||e[45]!==Ke||e[46]!==N||e[47]!==i.enabled||e[48]!==s?(le=i.enabled&&s.length>0&&Ke?o.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[o.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{bt(!N)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":N?"Click to pause animation":"Click to play animation",children:N?o.jsxRuntimeExports.jsx(pt.Pause,{}):o.jsxRuntimeExports.jsx(pt.Play,{})}),o.jsxRuntimeExports.jsx(ft.Nr,{min:s[0],max:s[s.length-1],marks:Ke,step:null,defaultValue:s[s.length-1],value:s[O],onChangeComplete:d=>{st(s.indexOf(d))},onChange:d=>{st(s.indexOf(d))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,e[44]=O,e[45]=Ke,e[46]=N,e[47]=i.enabled,e[48]=s,e[49]=le):le=e[49];let ce;e[50]!==_e||e[51]!==me||e[52]!==u||e[53]!==F||e[54]!==de||e[55]!==Y||e[56]!==f||e[57]!==at||e[58]!==r||e[59]!==B||e[60]!==rt||e[61]!==m||e[62]!==g||e[63]!==O||e[64]!==G||e[65]!==ke||e[66]!==Re||e[67]!==Se||e[68]!==tt||e[69]!==ie||e[70]!==z||e[71]!==k||e[72]!==he||e[73]!==J||e[74]!==nt||e[75]!==Ce||e[76]!==y||e[77]!==et||e[78]!==it||e[79]!==De||e[80]!==Ne||e[81]!==t||e[82]!==W||e[83]!==c||e[84]!==Oe||e[85]!==U||e[86]!==ne||e[87]!==i.dateFormat||e[88]!==i.enabled||e[89]!==xe||e[90]!==s||e[91]!==p||e[92]!==ot||e[93]!==n||e[94]!==b?(ce=o.jsxRuntimeExports.jsx(gt.GraphArea,{ref:lt,children:U&&Oe&&ie?o.jsxRuntimeExports.jsx(zt,{data:r.filter(d=>i.enabled?`${d.date}`===ht.format(new Date(s[O]),i.dateFormat||"yyyy"):d),mapData:Ne?ie:{...ie,features:ie.features.filter(Ft)},colorDomain:r.filter(At).length===0?[]:de||It.uniqBy(r,"color",!0),width:U,height:Oe,scale:De,centerPoint:me,colors:r.filter(Bt).length===0?f?[f]:[j.Colors.primaryColors["blue-600"]]:f||j.Colors[ne].categoricalColors.colors,colorLegendTitle:Y,radius:Ce,mapBorderWidth:Re,mapNoDataColor:Se,mapBorderColor:ke,tooltip:xe,onSeriesMouseOver:J,showLabels:W,isWorldMap:G,showColorScale:t,zoomScaleExtend:n,zoomTranslateExtend:b,onSeriesMouseClick:he,highlightedDataPoints:g,resetSelectionOnDoubleClick:et,styles:c,classNames:u,zoomInteraction:ot,detailsOnClick:B,mapProjection:tt||(G?"naturalEarth":"mercator"),animate:_e===!0?{duration:.5,once:!0,amount:.5}:_e||{duration:0,once:!0,amount:0},dimmedOpacity:rt,customLayers:at,maxRadiusValue:Pt.checkIfNullOrUndefined(z)?Math.max(...r.map(Vt).filter(Lt)):z,collapseColorScaleByDefault:F,projectionRotate:nt,rewindCoordinatesInMapData:it}):o.jsxRuntimeExports.jsx("div",{style:{height:`${Math.max(k,m||(y?k?(p||U)*y>k?(p||U)*y:k:(p||U)*y:Oe))}px`},className:"flex items-center justify-center",children:o.jsxRuntimeExports.jsx(Et.w,{"aria-label":"Loading graph"})})}),e[50]=_e,e[51]=me,e[52]=u,e[53]=F,e[54]=de,e[55]=Y,e[56]=f,e[57]=at,e[58]=r,e[59]=B,e[60]=rt,e[61]=m,e[62]=g,e[63]=O,e[64]=G,e[65]=ke,e[66]=Re,e[67]=Se,e[68]=tt,e[69]=ie,e[70]=z,e[71]=k,e[72]=he,e[73]=J,e[74]=nt,e[75]=Ce,e[76]=y,e[77]=et,e[78]=it,e[79]=De,e[80]=Ne,e[81]=t,e[82]=W,e[83]=c,e[84]=Oe,e[85]=U,e[86]=ne,e[87]=i.dateFormat,e[88]=i.enabled,e[89]=xe,e[90]=s,e[91]=p,e[92]=ot,e[93]=n,e[94]=b,e[95]=ce):ce=e[95];let ue;e[96]!==u?.footnote||e[97]!==u?.source||e[98]!==C||e[99]!==D||e[100]!==c?.footnote||e[101]!==c?.source||e[102]!==p?(ue=D||C?o.jsxRuntimeExports.jsx(Mt.GraphFooter,{styles:{footnote:c?.footnote,source:c?.source},classNames:{footnote:u?.footnote,source:u?.source},sources:D,footNote:C,width:p}):null,e[96]=u?.footnote,e[97]=u?.source,e[98]=C,e[99]=D,e[100]=c?.footnote,e[101]=c?.source,e[102]=p,e[103]=ue):ue=e[103];let Ze;return e[104]!==be||e[105]!==S||e[106]!==Q||e[107]!==m||e[108]!==Qe||e[109]!==k||e[110]!==K||e[111]!==y||e[112]!==ut||e[113]!==dt||e[114]!==se||e[115]!==le||e[116]!==ce||e[117]!==ue||e[118]!==ne||e[119]!==p?(Ze=o.jsxRuntimeExports.jsxs(gt.GraphContainer,{className:ut,style:dt,id:Q,ref:xt,"aria-label":be,backgroundColor:S,theme:ne,language:Qe,minHeight:k,width:p,height:m,relativeHeight:y,padding:K,children:[se,le,ce,ue]}),e[104]=be,e[105]=S,e[106]=Q,e[107]=m,e[108]=Qe,e[109]=k,e[110]=K,e[111]=y,e[112]=ut,e[113]=dt,e[114]=se,e[115]=le,e[116]=ce,e[117]=ue,e[118]=ne,e[119]=p,e[120]=Ze):Ze=e[120],Ze}function Lt(a){return a!=null}function Vt(a){return a.radius}function Bt(a){return a.color}function At(a){return a.color}function Ft(a){return a.properties.NAME!=="Antarctica"}function Tt(a){return a!==void 0}function Wt(a){return a!==void 0}function Gt(a){return a.data}function Ht(a){return a!==void 0}function Ut(a){return a.data}function Xt(a,e){return a-e}function Yt(a){return a.date}exports.DotDensityMap=_t;
|
|
2
2
|
//# sourceMappingURL=DotDensityMap.cjs.map
|