@undp/data-viz 2.3.1 → 2.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AreaChart.cjs +1 -1
- package/dist/AreaChart.js +1 -1
- package/dist/BarGraph.cjs +1 -1
- package/dist/BarGraph.js +2 -2
- package/dist/BasicStatCard.cjs +1 -1
- package/dist/BasicStatCard.js +15 -15
- package/dist/BeeSwarmChart.cjs +1 -1
- package/dist/BeeSwarmChart.js +2 -2
- package/dist/BiVariateChoroplethMap.cjs +1 -1
- package/dist/BiVariateChoroplethMap.cjs.map +1 -1
- package/dist/BiVariateChoroplethMap.js +202 -202
- package/dist/BiVariateChoroplethMap.js.map +1 -1
- package/dist/BulletChart.cjs +1 -1
- package/dist/BulletChart.js +2 -2
- package/dist/ButterflyChart.cjs +1 -1
- package/dist/ButterflyChart.js +2 -2
- package/dist/ChoroplethMap.cjs +1 -1
- package/dist/ChoroplethMap.cjs.map +1 -1
- package/dist/ChoroplethMap.js +33 -33
- package/dist/ChoroplethMap.js.map +1 -1
- package/dist/CirclePackingGraph.cjs +1 -1
- package/dist/CirclePackingGraph.js +2 -2
- package/dist/ColorLegend.cjs +1 -1
- package/dist/ColorLegend.js +7 -7
- package/dist/ColorLegendWithMouseOver.cjs +1 -1
- package/dist/ColorLegendWithMouseOver.js +1 -1
- package/dist/CopyTextButton.cjs +1 -1
- package/dist/CopyTextButton.js +1 -1
- package/dist/CsvDownloadButton.cjs +2 -2
- package/dist/CsvDownloadButton.js +1 -1
- package/dist/DataCards.cjs +1 -1
- package/dist/DataCards.js +3 -3
- package/dist/DataCards.js.map +1 -1
- package/dist/DataTable.cjs +1 -1
- package/dist/DataTable.js +2 -2
- package/dist/DifferenceLineChart.cjs +1 -1
- package/dist/DifferenceLineChart.js +1 -1
- package/dist/DonutChart.cjs +1 -1
- package/dist/DonutChart.js +20 -20
- package/dist/DotDensityMap.cjs +1 -1
- package/dist/DotDensityMap.cjs.map +1 -1
- package/dist/DotDensityMap.js +46 -46
- package/dist/DotDensityMap.js.map +1 -1
- package/dist/DualAxisLineChart.cjs +1 -1
- package/dist/DualAxisLineChart.js +1 -1
- package/dist/DumbbellChart.cjs +1 -1
- package/dist/DumbbellChart.js +2 -2
- package/dist/{EmptyState-CGeBqbmR.cjs → EmptyState-DX0t62iF.cjs} +2 -2
- package/dist/{EmptyState-CGeBqbmR.cjs.map → EmptyState-DX0t62iF.cjs.map} +1 -1
- package/dist/{EmptyState-tZBErBKF.js → EmptyState-Pj-emXt5.js} +3 -3
- package/dist/{EmptyState-tZBErBKF.js.map → EmptyState-Pj-emXt5.js.map} +1 -1
- package/dist/ExcelDownloadButton.cjs +1 -1
- package/dist/ExcelDownloadButton.js +7 -7
- package/dist/FootNote.cjs +1 -1
- package/dist/FootNote.js +1 -1
- package/dist/GeoHubCompareMaps.cjs +1 -1
- package/dist/GeoHubCompareMaps.js +1 -1
- package/dist/GeoHubMap.cjs +1 -1
- package/dist/GeoHubMap.js +1 -1
- package/dist/GeoHubMapWithLayerSelection.cjs +1 -1
- package/dist/GeoHubMapWithLayerSelection.js +2 -2
- package/dist/GraphDescription.cjs +1 -1
- package/dist/GraphDescription.js +1 -1
- package/dist/{GraphEl-ic8C5Ksc.cjs → GraphEl-CWjTuiYd.cjs} +2 -2
- package/dist/{GraphEl-ic8C5Ksc.cjs.map → GraphEl-CWjTuiYd.cjs.map} +1 -1
- package/dist/{GraphEl-L5hNe7wJ.js → GraphEl-DDXkYObU.js} +7 -7
- package/dist/{GraphEl-L5hNe7wJ.js.map → GraphEl-DDXkYObU.js.map} +1 -1
- package/dist/GraphFooter.cjs +1 -1
- package/dist/GraphFooter.js +1 -1
- package/dist/GraphTitle.cjs +1 -1
- package/dist/GraphTitle.js +1 -1
- package/dist/GriddedGraphs.cjs +1 -1
- package/dist/GriddedGraphs.js +1 -1
- package/dist/HeatMap.cjs +1 -1
- package/dist/HeatMap.js +1 -1
- package/dist/Histogram.cjs +1 -1
- package/dist/Histogram.js +1 -1
- package/dist/HybridMap.cjs +1 -1
- package/dist/HybridMap.cjs.map +1 -1
- package/dist/HybridMap.js +42 -42
- package/dist/HybridMap.js.map +1 -1
- package/dist/ImageDownloadButton.cjs +1 -1
- package/dist/ImageDownloadButton.js +1 -1
- package/dist/LineChartWithConfidenceInterval.cjs +1 -1
- package/dist/LineChartWithConfidenceInterval.js +1 -1
- package/dist/LinearColorLegend.cjs +1 -1
- package/dist/LinearColorLegend.js +1 -1
- package/dist/MultiLineAltChart.cjs +1 -1
- package/dist/MultiLineAltChart.js +1 -1
- package/dist/MultiLineChart.cjs +1 -1
- package/dist/MultiLineChart.js +1 -1
- package/dist/ParetoChart.cjs +1 -1
- package/dist/ParetoChart.js +1 -1
- package/dist/RadarChart.cjs +1 -1
- package/dist/RadarChart.js +1 -1
- package/dist/SVGDownloadButton.cjs +1 -1
- package/dist/SVGDownloadButton.js +8 -8
- package/dist/SankeyChart.cjs +1 -1
- package/dist/SankeyChart.js +80 -80
- package/dist/ScatterPlot.cjs +1 -1
- package/dist/ScatterPlot.js +2 -2
- package/dist/SimpleLineChart.cjs +1 -1
- package/dist/SimpleLineChart.js +1 -1
- package/dist/SingleGraphDashboard.cjs +1 -1
- package/dist/SingleGraphDashboard.js +1 -1
- package/dist/SingleGraphDashboardGeoHubMaps.cjs +1 -1
- package/dist/SingleGraphDashboardGeoHubMaps.js +10 -10
- package/dist/SingleGraphDashboardThreeDGraphs.cjs +1 -1
- package/dist/SingleGraphDashboardThreeDGraphs.js +1 -1
- package/dist/SlopeChart.cjs +1 -1
- package/dist/SlopeChart.js +1 -1
- package/dist/{Source-B5AoSlsi.cjs → Source-B3i0Bx2R.cjs} +2 -2
- package/dist/{Source-B5AoSlsi.cjs.map → Source-B3i0Bx2R.cjs.map} +1 -1
- package/dist/{Source-F8EYCYkV.js → Source-_STIejqs.js} +14 -14
- package/dist/{Source-F8EYCYkV.js.map → Source-_STIejqs.js.map} +1 -1
- package/dist/Source.cjs +1 -1
- package/dist/Source.js +2 -2
- package/dist/StatCardFromData.cjs +1 -1
- package/dist/StatCardFromData.js +12 -12
- package/dist/StripChart.cjs +1 -1
- package/dist/StripChart.js +1 -1
- package/dist/ThreeDGlobe.cjs +1 -1
- package/dist/ThreeDGlobe.js +2 -2
- package/dist/ThresholdColorLegendWithMouseOver.cjs +1 -1
- package/dist/ThresholdColorLegendWithMouseOver.js +10 -10
- package/dist/TreeMapGraph.cjs +1 -1
- package/dist/TreeMapGraph.js +29 -29
- package/dist/Typography-DrJ7IOdw.cjs +2 -0
- package/dist/Typography-DrJ7IOdw.cjs.map +1 -0
- package/dist/Typography-iR8PEgdt.js +263 -0
- package/dist/Typography-iR8PEgdt.js.map +1 -0
- package/dist/UnitChart.cjs +1 -1
- package/dist/UnitChart.js +25 -25
- package/dist/WaterfallChart.cjs +1 -1
- package/dist/WaterfallChart.js +1 -1
- package/dist/{index-BQYOuXdl.js → index-B-4y_iGB.js} +19 -17
- package/dist/index-B-4y_iGB.js.map +1 -0
- package/dist/{index-D5ihtaJJ.js → index-BE-lvE4c.js} +3 -3
- package/dist/{index-D5ihtaJJ.js.map → index-BE-lvE4c.js.map} +1 -1
- package/dist/{index-Dgjq6aZ2.cjs → index-DlrGwLQA.cjs} +2 -2
- package/dist/{index-Dgjq6aZ2.cjs.map → index-DlrGwLQA.cjs.map} +1 -1
- package/dist/index-sbKVyHS2.cjs +2 -0
- package/dist/index-sbKVyHS2.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +2 -2
- package/dist/style.css +1 -1
- package/package.json +3 -3
- package/dist/Typography-hWfh3H0J.js +0 -142
- package/dist/Typography-hWfh3H0J.js.map +0 -1
- package/dist/Typography-sa1UE0oF.cjs +0 -2
- package/dist/Typography-sa1UE0oF.cjs.map +0 -1
- package/dist/index-BQYOuXdl.js.map +0 -1
- package/dist/index-C6er0ety.cjs +0 -2
- package/dist/index-C6er0ety.cjs.map +0 -1
package/dist/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-DrJ7IOdw.cjs"),mt=require("./index-Cno4Q0YE.cjs"),xt=require("./Source-B3i0Bx2R.cjs"),pt=require("./index-DQA8q5sC.cjs"),dt=require("./Tooltip-BLa2EfMs.cjs"),W=require("./Colors.cjs"),ct=require("./numberFormattingFunction-02t-wJta.cjs"),gt=require("./DetailsModal-DHttOA80.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-DX0t62iF.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-DecW7_qr.js";
|
|
2
2
|
import { useRef as rt, useState as tt, isValidElement as lt, useEffect as ft } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { E as gt, _ as it } from "./Typography-iR8PEgdt.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-_STIejqs.js";
|
|
6
6
|
import { i as yt } from "./index-Bwrro8-q.js";
|
|
7
7
|
import { T as vt } from "./Tooltip-BRnAz2Gv.js";
|
|
8
8
|
import { Colors as X } from "./Colors.js";
|
|
@@ -14,7 +14,7 @@ import { u as Mt } from "./use-in-view-Dl5L8LtP.js";
|
|
|
14
14
|
import { A as Nt } from "./index-CtMBjvtq.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-Pj-emXt5.js";
|
|
18
18
|
import { G as wt, a as At } from "./GraphContainer-CF6ws3pd.js";
|
|
19
19
|
const Ot = Math.PI, at = 2 * Ot;
|
|
20
20
|
function St(c, t) {
|
|
@@ -23,10 +23,10 @@ function St(c, t) {
|
|
|
23
23
|
function zt(c) {
|
|
24
24
|
return c;
|
|
25
25
|
}
|
|
26
|
-
function
|
|
26
|
+
function Et() {
|
|
27
27
|
var c = zt, t = St, o = null, l = T(0), n = T(at), p = T(0);
|
|
28
28
|
function r(e) {
|
|
29
|
-
var s, x = (e = jt(e)).length, f, O, m = 0, g = new Array(x), b = new Array(x), y = +l.apply(this, arguments), S = Math.min(at, Math.max(-at, n.apply(this, arguments) - y)), d,
|
|
29
|
+
var s, x = (e = jt(e)).length, f, O, m = 0, g = new Array(x), b = new Array(x), y = +l.apply(this, arguments), S = Math.min(at, Math.max(-at, n.apply(this, arguments) - y)), d, P = Math.min(Math.abs(S) / x, p.apply(this, arguments)), G = P * (S < 0 ? -1 : 1), h;
|
|
30
30
|
for (s = 0; s < x; ++s)
|
|
31
31
|
(h = b[g[s] = s] = +c(e[s], s, e)) > 0 && (m += h);
|
|
32
32
|
for (t != null ? g.sort(function(C, z) {
|
|
@@ -40,7 +40,7 @@ function Pt() {
|
|
|
40
40
|
value: h,
|
|
41
41
|
startAngle: y,
|
|
42
42
|
endAngle: d,
|
|
43
|
-
padAngle:
|
|
43
|
+
padAngle: P
|
|
44
44
|
};
|
|
45
45
|
return b;
|
|
46
46
|
}
|
|
@@ -66,7 +66,7 @@ function ct(c, t, o, l, n) {
|
|
|
66
66
|
const p = st(c, t, o, l), r = st(c, t, o, Math.abs(n - l) === 2 * Math.PI ? 0.999999 * n : n), e = n - l <= Math.PI ? "0" : "1";
|
|
67
67
|
return ["M", p.x, p.y, "A", o, o, 0, e, 1, r.x, r.y].join(" ");
|
|
68
68
|
}
|
|
69
|
-
function
|
|
69
|
+
function Pt(c) {
|
|
70
70
|
const t = dt.c(59), {
|
|
71
71
|
mainText: o,
|
|
72
72
|
data: l,
|
|
@@ -84,22 +84,22 @@ function Et(c) {
|
|
|
84
84
|
classNames: y,
|
|
85
85
|
precision: S,
|
|
86
86
|
animate: d,
|
|
87
|
-
trackColor:
|
|
87
|
+
trackColor: P
|
|
88
88
|
} = c, G = rt(null);
|
|
89
89
|
let h;
|
|
90
90
|
t[0] !== d.amount || t[1] !== d.once ? (h = {
|
|
91
91
|
once: d.once,
|
|
92
92
|
amount: d.amount
|
|
93
93
|
}, t[0] = d.amount, t[1] = d.once, t[2] = h) : h = t[2];
|
|
94
|
-
const C = Mt(G, h), z =
|
|
95
|
-
let
|
|
96
|
-
t[3] !== l || t[4] !== o || t[5] !== S || t[6] !== n || t[7] !== e || t[8] !== r ? (
|
|
94
|
+
const C = Mt(G, h), z = Et().sort(null).startAngle(0).value(It), [v, Y] = tt(void 0), [j, M] = tt(void 0), [V, q] = tt(void 0), [$, R] = tt(void 0), J = nt, K = `${n * 2}px`, Q = `${n * 2}px`, D = `0 0 ${n * 2} ${n * 2}`, I = "ltr", et = "mx-auto", B = nt, U = `translate(${n} ${n})`;
|
|
95
|
+
let E;
|
|
96
|
+
t[3] !== l || t[4] !== o || t[5] !== S || t[6] !== n || t[7] !== e || t[8] !== r ? (E = o || r ? /* @__PURE__ */ a.jsx("foreignObject", { y: 0 - (n - e), x: 0 - (n - e), width: 2 * (n - e), height: 2 * (n - e), children: /* @__PURE__ */ a.jsxs("div", { className: "flex flex-col gap-0.5 justify-center items-center h-inherit py-0 px-4", children: [
|
|
97
97
|
o ? lt(o) ? o : /* @__PURE__ */ a.jsx(gt, { marginBottom: "none", className: "donut-main-text text-primary-gray-700 dark:text-primary-gray-100 leading-none text-center", children: typeof o == "string" ? o : l.findIndex((u) => u.label === o.label) !== -1 ? ut(l[l.findIndex((u) => u.label === o.label)].size, "NA", S, o.prefix, o.suffix) : "NA" }) : null,
|
|
98
98
|
r ? /* @__PURE__ */ a.jsx(it, { marginBottom: "none", size: "base", leading: "none", className: "donut-sub-note text-primary-gray-700 dark:text-primary-gray-100 text-center font-bold", children: r }) : typeof o == "string" || !o || lt(o) ? null : /* @__PURE__ */ a.jsx(it, { size: "base", marginBottom: "none", leading: "none", className: "donut-label text-primary-gray-700 dark:text-primary-gray-100 text-center font-bold", children: o.label })
|
|
99
|
-
] }) }) : null, t[3] = l, t[4] = o, t[5] = S, t[6] = n, t[7] = e, t[8] = r, t[9] =
|
|
99
|
+
] }) }) : null, t[3] = l, t[4] = o, t[5] = S, t[6] = n, t[7] = e, t[8] = r, t[9] = E) : E = t[9];
|
|
100
100
|
const Z = n - e / 2;
|
|
101
101
|
let k;
|
|
102
|
-
t[10] !== e || t[11] !== Z || t[12] !==
|
|
102
|
+
t[10] !== e || t[11] !== Z || t[12] !== P ? (k = /* @__PURE__ */ a.jsx("circle", { cx: 0, cy: 0, r: Z, fill: "none", stroke: P, strokeWidth: e }), t[10] = e, t[11] = Z, t[12] = P, t[13] = k) : k = t[13];
|
|
103
103
|
const F = Nt;
|
|
104
104
|
let w;
|
|
105
105
|
t[14] !== d.duration || t[15] !== O || t[16] !== p || t[17] !== g || t[18] !== C || t[19] !== j || t[20] !== v || t[21] !== f || t[22] !== x || t[23] !== n || t[24] !== m || t[25] !== M || t[26] !== e ? (w = (u, mt) => /* @__PURE__ */ a.jsx(nt.path, { variants: {
|
|
@@ -138,11 +138,11 @@ function Et(c) {
|
|
|
138
138
|
let N;
|
|
139
139
|
t[28] !== F || t[29] !== i ? (N = /* @__PURE__ */ a.jsx(F, { children: i }), t[28] = F, t[29] = i, t[30] = N) : N = t[30];
|
|
140
140
|
let A;
|
|
141
|
-
t[31] !== k || t[32] !== N || t[33] !== B.g || t[34] !== U || t[35] !==
|
|
142
|
-
|
|
141
|
+
t[31] !== k || t[32] !== N || t[33] !== B.g || t[34] !== U || t[35] !== E ? (A = /* @__PURE__ */ a.jsxs(B.g, { transform: U, children: [
|
|
142
|
+
E,
|
|
143
143
|
k,
|
|
144
144
|
N
|
|
145
|
-
] }), t[31] = k, t[32] = N, t[33] = B.g, t[34] = U, t[35] =
|
|
145
|
+
] }), t[31] = k, t[32] = N, t[33] = B.g, t[34] = U, t[35] = E, t[36] = A) : A = t[36];
|
|
146
146
|
let L;
|
|
147
147
|
t[37] !== J.svg || t[38] !== A || t[39] !== K || t[40] !== Q || t[41] !== D ? (L = /* @__PURE__ */ a.jsx(J.svg, { ref: G, width: K, height: Q, viewBox: D, direction: I, className: et, children: A }), t[37] = J.svg, t[38] = A, t[39] = K, t[40] = Q, t[41] = D, t[42] = L) : L = t[42];
|
|
148
148
|
let W;
|
|
@@ -178,7 +178,7 @@ function _t(c) {
|
|
|
178
178
|
backgroundColor: y = !1,
|
|
179
179
|
tooltip: S,
|
|
180
180
|
onSeriesMouseOver: d,
|
|
181
|
-
graphID:
|
|
181
|
+
graphID: P,
|
|
182
182
|
onSeriesMouseClick: G,
|
|
183
183
|
graphDownload: h = !1,
|
|
184
184
|
dataDownload: C = !1,
|
|
@@ -199,7 +199,7 @@ function _t(c) {
|
|
|
199
199
|
precision: et = 2,
|
|
200
200
|
animate: B = !1,
|
|
201
201
|
trackColor: U = X.light.grays["gray-200"]
|
|
202
|
-
} = c, [
|
|
202
|
+
} = c, [E, Z] = tt(0), k = rt(null), F = rt(null);
|
|
203
203
|
ft(() => {
|
|
204
204
|
const i = new ResizeObserver((N) => {
|
|
205
205
|
Z((Math.min(N[0].target.clientWidth || 620, N[0].target.clientHeight || 480) || 420) / 2);
|
|
@@ -207,7 +207,7 @@ function _t(c) {
|
|
|
207
207
|
return k.current && i.observe(k.current), () => i.disconnect();
|
|
208
208
|
}, []);
|
|
209
209
|
const w = v ? ht(m, ["size"], [v]) : m;
|
|
210
|
-
return /* @__PURE__ */ a.jsxs(wt, { className: I?.graphContainer, style: D?.graphContainer, id:
|
|
210
|
+
return /* @__PURE__ */ a.jsxs(wt, { className: I?.graphContainer, style: D?.graphContainer, id: P, ref: F, "aria-label": R, backgroundColor: y, theme: j, language: Y, minHeight: q, width: M, height: V, relativeHeight: $, padding: b, children: [
|
|
211
211
|
o || s || h || C ? /* @__PURE__ */ a.jsx(Dt, { styles: {
|
|
212
212
|
title: D?.title,
|
|
213
213
|
description: D?.description
|
|
@@ -235,7 +235,7 @@ function _t(c) {
|
|
|
235
235
|
] }) : null,
|
|
236
236
|
/* @__PURE__ */ a.jsxs(At, { ref: k, children: [
|
|
237
237
|
m.length === 0 && /* @__PURE__ */ a.jsx(kt, {}),
|
|
238
|
-
|
|
238
|
+
E && m.length > 0 ? /* @__PURE__ */ a.jsx(Pt, { mainText: t, data: w, colors: l, radius: O || E, subNote: x, strokeWidth: e, tooltip: S, colorDomain: z || w.map((i) => i.label), onSeriesMouseOver: d, onSeriesMouseClick: G, resetSelectionOnDoubleClick: J, styles: D, detailsOnClick: Q, precision: et, animate: B === !0 ? {
|
|
239
239
|
duration: 0.5,
|
|
240
240
|
once: !0,
|
|
241
241
|
amount: 0.5
|
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-sa1UE0oF.cjs"),Dt=require("./index-C5K--w8d.cjs"),Rt=require("./Tooltip-BLa2EfMs.cjs"),b=require("./Colors.cjs"),pt=require("./index-C6er0ety.cjs"),St=require("./DetailsModal-DHttOA80.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:L,mapProjection:V,zoomInteraction:E,animate:j,dimmedOpacity:Q,customLayers:_,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),[je,be]=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:j.once,amount:j.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],De=v[3]-v[1],Re=m*190/960*360/Ce,Se=x*190/678*180/De,S=p*Math.min(Re,Se),W=V==="mercator"?q.geoMercator().rotate(I).center($||C.geometry.coordinates).translate([m/2,x/2]).scale(S):V==="equalEarth"?q.geoEqualEarth().rotate(I).center($||C.geometry.coordinates).translate([m/2,x/2]).scale(S):V==="naturalEarth"?q.geoNaturalEarth1().rotate(I).center($||C.geometry.coordinates).translate([m/2,x/2]).scale(S):V==="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:[_.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}`)]:b.Colors.gray;return o.jsxRuntimeExports.jsxs(Je.motion.g,{variants:{initial:{opacity:0},whileInView:{opacity:ye?ye===h?1:Q:pe.length!==0?pe.indexOf(t.label||"")!==-1?1:Q:1,transition:{duration:j.duration}}},initial:"initial",animate:F?"whileInView":"initial",exit:{opacity:0,transition:{duration:j.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}`)]:b.Colors.gray,stroke:e.filter(n=>n.color).length===0?r[0]:t.color?r[f.indexOf(`${t.color}`)]:b.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}`)]:b.Colors.gray,stroke:e.filter(n=>n.color).length===0?r[0]:t.color?r[f.indexOf(`${t.color}`)]:b.Colors.gray,transition:{duration:j.duration}}},initial:"initial",animate:F?"whileInView":"initial",exit:{r:0,transition:{duration:j.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}`)]:b.Colors.gray},whileInView:{opacity:1,x:R?R(t.radius||0):D,transition:{duration:j.duration},fill:e.filter(n=>n.color).length===0?r[0]:t.color?r[f.indexOf(`${t.color}`)]:b.Colors.gray}},initial:"initial",animate:F?"whileInView":"initial",exit:{opacity:0,transition:{duration:j.duration}},y:0,className:o.mo("graph-value text-sm",L?.graphObjectValues),style:{textAnchor:"start",...J?.graphObjectValues||{}},dx:4,dy:5,children:t.label}):null]},t.label||`${t.lat}-${t.long}`)})}),_.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",L?.colorLegend),children:je?o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx("div",{className:"color-legend-close-button bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)] border border-[var(--gray-400)] rounded-full w-6 h-6 p-[3px] cursor-pointer z-10 absolute right-[-0.75rem] top-[-0.75rem]",onClick:()=>{be(!1)},children:o.jsxRuntimeExports.jsx(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.j,{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:()=>{be(!0)},children:o.jsxRuntimeExports.jsx("div",{className:"show-color-legend-button items-start text-sm font-medium cursor-pointer p-2 mb-0 flex text-primary-black dark:text-primary-gray-300 bg-primary-gray-300 dark:bg-primary-gray-600 border-primary-gray-400 dark:border-primary-gray-500",children:"Show Legend"})})}),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:L?.modal}):null,Ee&&Y&&we&&A?o.jsxRuntimeExports.jsx(Rt.Tooltip,{data:Ee,body:Y,xPos:we,yPos:A,backgroundStyle:J?.tooltip,className:L?.tooltip}):null]})}function Lt(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:L,showColorScale:V,zoomScaleExtend:E,zoomTranslateExtend:j,graphID:Q,highlightedDataPoints:_,onSeriesMouseClick:he,graphDownload:fe,dataDownload:I,showAntarctica:ge,language:ee,minHeight:ye,theme:ve,ariaLabel:je,resetSelectionOnDoubleClick:be,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?b.Colors.light.graphNoData:Ie,S=ze===void 0?!1:ze,W=pe===void 0?!1:pe,ke=Z===void 0?b.Colors.light.grays["gray-500"]:Z,G=L===void 0?!0:L,t=V===void 0?!0:V;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]!==_?(H=_===void 0?[]:_,e[2]=_,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=be===void 0?!0:be,tt=Ee===void 0?"naturalEarth":Ee,ot=te===void 0?"button":te,Le=we===void 0?!1:we,rt=oe===void 0?.3:oe;let Ve;e[4]!==A?(Ve=A===void 0?[]:A,e[4]=A,e[5]=Ve):Ve=e[5];const at=Ve;let _e;e[6]!==w?(_e=w===void 0?{enabled:!1,autoplay:!1,showOnlyActiveDate:!0}:w,e[6]=w,e[7]=_e):_e=e[7];const i=_e;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,jt]=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,bt]=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=>{bt(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:()=>{jt(!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]!==Le||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]!==j?(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]:[b.Colors.primaryColors["blue-600"]]:f||b.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:j,onSeriesMouseClick:he,highlightedDataPoints:g,resetSelectionOnDoubleClick:et,styles:c,classNames:u,zoomInteraction:ot,detailsOnClick:B,mapProjection:tt||(G?"naturalEarth":"mercator"),animate:Le===!0?{duration:.5,once:!0,amount:.5}:Le||{duration:0,once:!0,amount:0},dimmedOpacity:rt,customLayers:at,maxRadiusValue:$t.checkIfNullOrUndefined(z)?Math.max(...r.map(_t).filter(Vt)):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]=Le,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]=j,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]!==je||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":je,backgroundColor:S,theme:ne,language:Qe,minHeight:k,width:p,height:m,relativeHeight:y,padding:K,children:[se,le,ce,ue]}),e[104]=je,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 Vt(a){return a!=null}function _t(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=Lt;
|
|
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-DrJ7IOdw.cjs"),Dt=require("./index-C5K--w8d.cjs"),Rt=require("./Tooltip-BLa2EfMs.cjs"),j=require("./Colors.cjs"),pt=require("./index-sbKVyHS2.cjs"),St=require("./DetailsModal-DHttOA80.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;
|
|
2
2
|
//# sourceMappingURL=DotDensityMap.cjs.map
|