@undp/data-viz 1.4.16 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (224) hide show
  1. package/dist/AreaChart.cjs +1 -1
  2. package/dist/AreaChart.js +3 -3
  3. package/dist/BarGraph.cjs +1 -1
  4. package/dist/BarGraph.js +8 -8
  5. package/dist/BeeSwarmChart.cjs +1 -1
  6. package/dist/BeeSwarmChart.js +5 -5
  7. package/dist/BiVariateChoroplethMap.cjs +1 -1
  8. package/dist/BiVariateChoroplethMap.cjs.map +1 -1
  9. package/dist/BiVariateChoroplethMap.js +35 -34
  10. package/dist/BiVariateChoroplethMap.js.map +1 -1
  11. package/dist/BulletChart.cjs +1 -1
  12. package/dist/BulletChart.js +5 -5
  13. package/dist/ButterflyChart.cjs +1 -1
  14. package/dist/ButterflyChart.js +5 -5
  15. package/dist/ChoroplethMap.cjs +1 -1
  16. package/dist/ChoroplethMap.cjs.map +1 -1
  17. package/dist/ChoroplethMap.js +52 -51
  18. package/dist/ChoroplethMap.js.map +1 -1
  19. package/dist/CirclePackingGraph.cjs +1 -1
  20. package/dist/CirclePackingGraph.js +3 -3
  21. package/dist/DataCards.cjs +1 -1
  22. package/dist/DataCards.js +5 -5
  23. package/dist/DataTable.cjs +1 -1
  24. package/dist/DataTable.js +3 -3
  25. package/dist/DifferenceLineChart.cjs +1 -1
  26. package/dist/DifferenceLineChart.js +2 -2
  27. package/dist/DonutChart.cjs +1 -1
  28. package/dist/DonutChart.js +4 -4
  29. package/dist/DotDensityMap.cjs +1 -1
  30. package/dist/DotDensityMap.cjs.map +1 -1
  31. package/dist/DotDensityMap.js +39 -38
  32. package/dist/DotDensityMap.js.map +1 -1
  33. package/dist/DualAxisLineChart.cjs +1 -1
  34. package/dist/DualAxisLineChart.js +2 -2
  35. package/dist/DumbbellChart.cjs +1 -1
  36. package/dist/DumbbellChart.js +6 -6
  37. package/dist/GeoHubCompareMaps.cjs +1 -1
  38. package/dist/GeoHubCompareMaps.js +1 -1
  39. package/dist/GeoHubMap.cjs +1 -1
  40. package/dist/GeoHubMap.js +3 -3
  41. package/dist/GeoHubMapWithLayerSelection.cjs +1 -1
  42. package/dist/GeoHubMapWithLayerSelection.js +4 -4
  43. package/dist/{GraphEl-Bz2jatkM.cjs → GraphEl-4RUlclvW.cjs} +2 -2
  44. package/dist/{GraphEl-Bz2jatkM.cjs.map → GraphEl-4RUlclvW.cjs.map} +1 -1
  45. package/dist/{GraphEl-zNOHBYrK.js → GraphEl-ClIxlWa3.js} +2 -2
  46. package/dist/{GraphEl-zNOHBYrK.js.map → GraphEl-ClIxlWa3.js.map} +1 -1
  47. package/dist/GriddedGraphs.cjs +1 -1
  48. package/dist/GriddedGraphs.d.ts +58 -1
  49. package/dist/GriddedGraphs.js +7 -7
  50. package/dist/GriddedGraphsFromConfig.cjs +1 -1
  51. package/dist/GriddedGraphsFromConfig.d.ts +58 -1
  52. package/dist/GriddedGraphsFromConfig.js +1 -1
  53. package/dist/HeatMap.cjs +1 -1
  54. package/dist/HeatMap.js +4 -4
  55. package/dist/Histogram.cjs +1 -1
  56. package/dist/Histogram.js +1 -1
  57. package/dist/LineChartWithConfidenceInterval.cjs +1 -1
  58. package/dist/LineChartWithConfidenceInterval.js +2 -2
  59. package/dist/MultiGraphDashboard.cjs +1 -1
  60. package/dist/MultiGraphDashboard.d.ts +58 -1
  61. package/dist/MultiGraphDashboard.js +5 -5
  62. package/dist/MultiGraphDashboardFromConfig.cjs +1 -1
  63. package/dist/MultiGraphDashboardFromConfig.d.ts +58 -1
  64. package/dist/MultiGraphDashboardFromConfig.js +1 -1
  65. package/dist/MultiGraphDashboardWideToLongFormat.cjs +1 -1
  66. package/dist/MultiGraphDashboardWideToLongFormat.js +2 -2
  67. package/dist/MultiGraphDashboardWideToLongFormatFromConfig.cjs +1 -1
  68. package/dist/MultiGraphDashboardWideToLongFormatFromConfig.js +1 -1
  69. package/dist/MultiLineAltChart.cjs +1 -1
  70. package/dist/MultiLineAltChart.js +3 -3
  71. package/dist/MultiLineChart.cjs +1 -1
  72. package/dist/MultiLineChart.js +2 -2
  73. package/dist/ParetoChart.cjs +1 -1
  74. package/dist/ParetoChart.js +3 -3
  75. package/dist/PerformanceIntensiveMultiGraphDashboard.cjs +1 -1
  76. package/dist/PerformanceIntensiveMultiGraphDashboard.d.ts +58 -1
  77. package/dist/PerformanceIntensiveMultiGraphDashboard.js +5 -5
  78. package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.cjs +1 -1
  79. package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.d.ts +58 -1
  80. package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.js +1 -1
  81. package/dist/PerformanceIntensiveScrollStory.d.ts +58 -1
  82. package/dist/RadarChart.cjs +1 -1
  83. package/dist/RadarChart.js +4 -4
  84. package/dist/SankeyChart.cjs +1 -1
  85. package/dist/SankeyChart.js +6 -6
  86. package/dist/ScatterPlot.cjs +1 -1
  87. package/dist/ScatterPlot.js +6 -6
  88. package/dist/ScrollStory.d.ts +58 -1
  89. package/dist/SimpleLineChart.cjs +1 -1
  90. package/dist/SimpleLineChart.js +2 -2
  91. package/dist/SingleGraphDashboard.cjs +1 -1
  92. package/dist/SingleGraphDashboard.d.ts +58 -1
  93. package/dist/SingleGraphDashboard.js +8 -8
  94. package/dist/SingleGraphDashboardFromConfig.cjs +1 -1
  95. package/dist/SingleGraphDashboardFromConfig.d.ts +58 -1
  96. package/dist/SingleGraphDashboardFromConfig.js +1 -1
  97. package/dist/SingleGraphDashboardGeoHubMaps.d.ts +58 -1
  98. package/dist/SingleGraphDashboardGeoHubMapsFromConfig.cjs +1 -1
  99. package/dist/SingleGraphDashboardGeoHubMapsFromConfig.d.ts +58 -1
  100. package/dist/SingleGraphDashboardGeoHubMapsFromConfig.js +1 -1
  101. package/dist/SingleGraphDashboardThreeDGraphs.cjs +1 -1
  102. package/dist/SingleGraphDashboardThreeDGraphs.cjs.map +1 -1
  103. package/dist/SingleGraphDashboardThreeDGraphs.d.ts +58 -1
  104. package/dist/SingleGraphDashboardThreeDGraphs.js +20 -19
  105. package/dist/SingleGraphDashboardThreeDGraphs.js.map +1 -1
  106. package/dist/SingleGraphDashboardThreeDGraphsFromConfig.cjs +1 -1
  107. package/dist/SingleGraphDashboardThreeDGraphsFromConfig.d.ts +58 -1
  108. package/dist/SingleGraphDashboardThreeDGraphsFromConfig.js +1 -1
  109. package/dist/SlopeChart.cjs +1 -1
  110. package/dist/SlopeChart.js +4 -4
  111. package/dist/SparkLine.cjs +1 -1
  112. package/dist/SparkLine.js +2 -2
  113. package/dist/StatCardFromData.cjs +1 -1
  114. package/dist/StatCardFromData.js +1 -1
  115. package/dist/StripChart.cjs +1 -1
  116. package/dist/StripChart.js +5 -5
  117. package/dist/ThreeDGlobe.cjs +1 -1
  118. package/dist/ThreeDGlobe.cjs.map +1 -1
  119. package/dist/ThreeDGlobe.d.ts +61 -6
  120. package/dist/ThreeDGlobe.js +385 -314
  121. package/dist/ThreeDGlobe.js.map +1 -1
  122. package/dist/{Tooltip-DyM5snqx.js → Tooltip-CVCGWyzw.js} +2 -2
  123. package/dist/{Tooltip-DyM5snqx.js.map → Tooltip-CVCGWyzw.js.map} +1 -1
  124. package/dist/{Tooltip-n8z5bfav.cjs → Tooltip-De16GWhY.cjs} +2 -2
  125. package/dist/{Tooltip-n8z5bfav.cjs.map → Tooltip-De16GWhY.cjs.map} +1 -1
  126. package/dist/TreeMapGraph.cjs +1 -1
  127. package/dist/TreeMapGraph.js +3 -3
  128. package/dist/Types.d.ts +58 -1
  129. package/dist/UnitChart.cjs +1 -1
  130. package/dist/UnitChart.js +1 -1
  131. package/dist/_commonjsHelpers-BH3jXuIh.cjs +2 -0
  132. package/dist/_commonjsHelpers-BH3jXuIh.cjs.map +1 -0
  133. package/dist/_commonjsHelpers-ByX85dGu.js +34 -0
  134. package/dist/_commonjsHelpers-ByX85dGu.js.map +1 -0
  135. package/dist/{ensureCompleteData-BBDZbDCE.js → ensureCompleteData-BALdOrsS.js} +2 -2
  136. package/dist/{ensureCompleteData-BBDZbDCE.js.map → ensureCompleteData-BALdOrsS.js.map} +1 -1
  137. package/dist/{ensureCompleteData-DqWQ2Zbi.cjs → ensureCompleteData-BU5Zlccy.cjs} +2 -2
  138. package/dist/{ensureCompleteData-DqWQ2Zbi.cjs.map → ensureCompleteData-BU5Zlccy.cjs.map} +1 -1
  139. package/dist/{fetchAndParseData-4gsYTy6_.js → fetchAndParseData-DBOl1Icl.js} +2 -2
  140. package/dist/{fetchAndParseData-4gsYTy6_.js.map → fetchAndParseData-DBOl1Icl.js.map} +1 -1
  141. package/dist/{fetchAndParseData-CQyVGCul.cjs → fetchAndParseData-Dcy7AS_0.cjs} +2 -2
  142. package/dist/{fetchAndParseData-CQyVGCul.cjs.map → fetchAndParseData-Dcy7AS_0.cjs.map} +1 -1
  143. package/dist/fetchAndParseData.cjs +1 -1
  144. package/dist/fetchAndParseData.js +1 -1
  145. package/dist/{filterData-B8ocT57s.js → filterData-9nEcQ-Jp.js} +3 -3
  146. package/dist/{filterData-B8ocT57s.js.map → filterData-9nEcQ-Jp.js.map} +1 -1
  147. package/dist/{filterData-DN6py7y_.cjs → filterData-BoYadk0l.cjs} +2 -2
  148. package/dist/{filterData-DN6py7y_.cjs.map → filterData-BoYadk0l.cjs.map} +1 -1
  149. package/dist/{getJenks-VhM3GIoC.js → getJenks-DW96UYNE.js} +2 -2
  150. package/dist/{getJenks-VhM3GIoC.js.map → getJenks-DW96UYNE.js.map} +1 -1
  151. package/dist/{getJenks-TWQvbuOz.cjs → getJenks-vofIZmeb.cjs} +2 -2
  152. package/dist/{getJenks-TWQvbuOz.cjs.map → getJenks-vofIZmeb.cjs.map} +1 -1
  153. package/dist/{getUniqValue-CHqgSss5.cjs → getUniqValue-CfuE_l9c.cjs} +2 -2
  154. package/dist/{getUniqValue-CHqgSss5.cjs.map → getUniqValue-CfuE_l9c.cjs.map} +1 -1
  155. package/dist/{getUniqValue-BtUENB2H.js → getUniqValue-CttuU_wn.js} +4 -4
  156. package/dist/{getUniqValue-BtUENB2H.js.map → getUniqValue-CttuU_wn.js.map} +1 -1
  157. package/dist/{index-CaAIPGZo.js → index-AqnpA7_O.js} +2 -2
  158. package/dist/{index-CaAIPGZo.js.map → index-AqnpA7_O.js.map} +1 -1
  159. package/dist/{index-CZbIGs8q.cjs → index-BJOeaYTk.cjs} +2 -2
  160. package/dist/{index-CZbIGs8q.cjs.map → index-BJOeaYTk.cjs.map} +1 -1
  161. package/dist/{index-Bc5VF70V.js → index-BMgDMxKJ.js} +6 -6
  162. package/dist/{index-Bc5VF70V.js.map → index-BMgDMxKJ.js.map} +1 -1
  163. package/dist/{index-B0rbzOoC.cjs → index-BS2TADPj.cjs} +2 -2
  164. package/dist/{index-B0rbzOoC.cjs.map → index-BS2TADPj.cjs.map} +1 -1
  165. package/dist/{index-27yTRcko.js → index-Bwrro8-q.js} +2 -2
  166. package/dist/{index-27yTRcko.js.map → index-Bwrro8-q.js.map} +1 -1
  167. package/dist/{index-BczVvEBZ.cjs → index-CQ3e6Ewi.cjs} +2 -2
  168. package/dist/{index-BczVvEBZ.cjs.map → index-CQ3e6Ewi.cjs.map} +1 -1
  169. package/dist/{index-C21TvELx.cjs → index-CSNtgibC.cjs} +2 -2
  170. package/dist/{index-C21TvELx.cjs.map → index-CSNtgibC.cjs.map} +1 -1
  171. package/dist/{index-D7ltPi18.js → index-CeVNqhMO.js} +2 -2
  172. package/dist/{index-D7ltPi18.js.map → index-CeVNqhMO.js.map} +1 -1
  173. package/dist/index-D05lK1Te.cjs +2 -0
  174. package/dist/index-D05lK1Te.cjs.map +1 -0
  175. package/dist/{index-Ds0uHjK9.cjs → index-D72cOtq7.cjs} +2 -2
  176. package/dist/{index-Ds0uHjK9.cjs.map → index-D72cOtq7.cjs.map} +1 -1
  177. package/dist/{index-BXns0-ng.cjs → index-DQA8q5sC.cjs} +2 -2
  178. package/dist/{index-BXns0-ng.cjs.map → index-DQA8q5sC.cjs.map} +1 -1
  179. package/dist/{index-BzeLQvXk.cjs → index-DYH8g9WA.cjs} +2 -2
  180. package/dist/{index-BzeLQvXk.cjs.map → index-DYH8g9WA.cjs.map} +1 -1
  181. package/dist/{index-BbNoLJ_w.cjs → index-Da2GUKrr.cjs} +2 -2
  182. package/dist/{index-BbNoLJ_w.cjs.map → index-Da2GUKrr.cjs.map} +1 -1
  183. package/dist/{index-BLizQDlg.js → index-DvVprvy6.js} +2 -2
  184. package/dist/{index-BLizQDlg.js.map → index-DvVprvy6.js.map} +1 -1
  185. package/dist/{index-UV9hjG_S.js → index-EArKRVKg.js} +2 -2
  186. package/dist/{index-UV9hjG_S.js.map → index-EArKRVKg.js.map} +1 -1
  187. package/dist/{index-C1rRk_50.js → index-V_JXij1_.js} +2 -2
  188. package/dist/{index-C1rRk_50.js.map → index-V_JXij1_.js.map} +1 -1
  189. package/dist/{index-DxagiOHo.js → index-fwdktvAS.js} +2 -2
  190. package/dist/{index-DxagiOHo.js.map → index-fwdktvAS.js.map} +1 -1
  191. package/dist/index-qfWCwobm.js +682 -0
  192. package/dist/index-qfWCwobm.js.map +1 -0
  193. package/dist/index.cjs +1 -1
  194. package/dist/index.d.ts +63 -7
  195. package/dist/index.js +6 -6
  196. package/dist/{string2HTML-CWHGfz_d.js → string2HTML-oFCROsus.js} +2 -2
  197. package/dist/{string2HTML-CWHGfz_d.js.map → string2HTML-oFCROsus.js.map} +1 -1
  198. package/dist/{string2HTML-D2Avudmb.cjs → string2HTML-z7CwHXcx.cjs} +2 -2
  199. package/dist/{string2HTML-D2Avudmb.cjs.map → string2HTML-z7CwHXcx.cjs.map} +1 -1
  200. package/dist/transformData.cjs +1 -1
  201. package/dist/transformData.js +3 -3
  202. package/dist/{transformDataForAggregation-CdcwlnNe.js → transformDataForAggregation-1BYVFqvF.js} +4 -4
  203. package/dist/{transformDataForAggregation-CdcwlnNe.js.map → transformDataForAggregation-1BYVFqvF.js.map} +1 -1
  204. package/dist/{transformDataForAggregation-Du-Hei-W.cjs → transformDataForAggregation-BVxVu4yY.cjs} +2 -2
  205. package/dist/{transformDataForAggregation-Du-Hei-W.cjs.map → transformDataForAggregation-BVxVu4yY.cjs.map} +1 -1
  206. package/dist/{transformDataForGraphFromFile-BCjsizvb.js → transformDataForGraphFromFile-BC9Ha8hF.js} +3 -3
  207. package/dist/{transformDataForGraphFromFile-BCjsizvb.js.map → transformDataForGraphFromFile-BC9Ha8hF.js.map} +1 -1
  208. package/dist/{transformDataForGraphFromFile-B1A0AS-Z.cjs → transformDataForGraphFromFile-b41aNQYY.cjs} +2 -2
  209. package/dist/{transformDataForGraphFromFile-B1A0AS-Z.cjs.map → transformDataForGraphFromFile-b41aNQYY.cjs.map} +1 -1
  210. package/dist/utils.cjs +1 -1
  211. package/dist/utils.js +2 -2
  212. package/dist/zoom-Bsbhil-K.cjs +2 -0
  213. package/dist/zoom-Bsbhil-K.cjs.map +1 -0
  214. package/dist/zoom-DAu91HKr.js +1864 -0
  215. package/dist/zoom-DAu91HKr.js.map +1 -0
  216. package/package.json +2 -2
  217. package/dist/_commonjsHelpers-DKOUU3wS.cjs +0 -2
  218. package/dist/_commonjsHelpers-DKOUU3wS.cjs.map +0 -1
  219. package/dist/_commonjsHelpers-DaMA6jEr.js +0 -9
  220. package/dist/_commonjsHelpers-DaMA6jEr.js.map +0 -1
  221. package/dist/zoom-Lo7IAUfC.cjs +0 -2
  222. package/dist/zoom-Lo7IAUfC.cjs.map +0 -1
  223. package/dist/zoom-_lqdiGoI.js +0 -1983
  224. package/dist/zoom-_lqdiGoI.js.map +0 -1
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./index-CHPV5EwG-DDoeWRVt.cjs"),G=require("react"),ae=require("./index-BzeLQvXk.cjs"),le=require("./Typography-k-kOjICQ.cjs"),fe=require("./index-BXns0-ng.cjs"),he=require("./Modal-tXZlLE5s.cjs"),ye=require("./Tooltip-n8z5bfav.cjs"),se=require("./Colors.cjs"),pe=require("./numberFormattingFunction-02t-wJta.cjs"),ve=require("./string2HTML-D2Avudmb.cjs"),S=require("./array-DKbXV8lR.cjs"),je=require("./GraphFooter.cjs"),Re=require("./GraphHeader.cjs"),be=require("./EmptyState-d8_8SxeW.cjs"),ge=Math.abs,$=Math.atan2,V=Math.cos,Ee=Math.max,xe=Math.min,B=Math.sin,te=Math.sqrt,O=1e-12,ie=Math.PI,ce=ie/2,ue=2*ie;function we(s){return s>1?0:s<-1?ie:Math.acos(s)}function me(s){return s>=1?ce:s<=-1?-ce:Math.asin(s)}function Me(s){return s.innerRadius}function Ae(s){return s.outerRadius}function Ne(s){return s.startAngle}function Ce(s){return s.endAngle}function Se(s){return s&&s.padAngle}function De(s,a,v,x,N,b,g,e){var m=v-s,i=x-a,t=g-N,E=e-b,n=E*m-t*i;if(!(n*n<O))return n=(t*(a-b)-E*(s-N))/n,[s+n*m,a+n*i]}function oe(s,a,v,x,N,b,g){var e=s-v,m=a-x,i=(g?b:-b)/te(e*e+m*m),t=i*m,E=-i*e,n=s+t,u=a+E,y=v+t,f=x+E,k=(n+y)/2,c=(u+f)/2,M=y-n,j=f-u,R=M*M+j*j,C=N-b,A=n*f-y*u,q=(j<0?-1:1)*te(Ee(0,C*C*R-A*A)),D=(A*j-M*q)/R,d=(-A*M-j*q)/R,T=(A*j+M*q)/R,w=(-A*M+j*q)/R,p=D-k,r=d-c,o=T-k,z=w-c;return p*p+r*r>o*o+z*z&&(D=T,d=w),{cx:D,cy:d,x01:-t,y01:-E,x11:D*(N/C-1),y11:d*(N/C-1)}}function Te(){var s=Me,a=Ae,v=S.constant(0),x=null,N=Ne,b=Ce,g=Se,e=null,m=S.withPath(i);function i(){var t,E,n=+s.apply(this,arguments),u=+a.apply(this,arguments),y=N.apply(this,arguments)-ce,f=b.apply(this,arguments)-ce,k=ge(f-y),c=f>y;if(e||(e=t=m()),u<n&&(E=u,u=n,n=E),!(u>O))e.moveTo(0,0);else if(k>ue-O)e.moveTo(u*V(y),u*B(y)),e.arc(0,0,u,y,f,!c),n>O&&(e.moveTo(n*V(f),n*B(f)),e.arc(0,0,n,f,y,c));else{var M=y,j=f,R=y,C=f,A=k,q=k,D=g.apply(this,arguments)/2,d=D>O&&(x?+x.apply(this,arguments):te(n*n+u*u)),T=xe(ge(u-n)/2,+v.apply(this,arguments)),w=T,p=T,r,o;if(d>O){var z=me(d/n*B(D)),J=me(d/u*B(D));(A-=z*2)>O?(z*=c?1:-1,R+=z,C-=z):(A=0,R=C=(y+f)/2),(q-=J*2)>O?(J*=c?1:-1,M+=J,j-=J):(q=0,M=j=(y+f)/2)}var I=u*V(M),L=u*B(M),K=n*V(C),F=n*B(C);if(T>O){var W=u*V(j),X=u*B(j),Q=n*V(R),U=n*B(R),H;if(k<ie)if(H=De(I,L,Q,U,W,X,K,F)){var Z=I-H[0],ne=L-H[1],_=W-H[0],P=X-H[1],re=1/B(we((Z*_+ne*P)/(te(Z*Z+ne*ne)*te(_*_+P*P)))/2),Y=te(H[0]*H[0]+H[1]*H[1]);w=xe(T,(n-Y)/(re-1)),p=xe(T,(u-Y)/(re+1))}else w=p=0}q>O?p>O?(r=oe(Q,U,I,L,u,p,c),o=oe(W,X,K,F,u,p,c),e.moveTo(r.cx+r.x01,r.cy+r.y01),p<T?e.arc(r.cx,r.cy,p,$(r.y01,r.x01),$(o.y01,o.x01),!c):(e.arc(r.cx,r.cy,p,$(r.y01,r.x01),$(r.y11,r.x11),!c),e.arc(0,0,u,$(r.cy+r.y11,r.cx+r.x11),$(o.cy+o.y11,o.cx+o.x11),!c),e.arc(o.cx,o.cy,p,$(o.y11,o.x11),$(o.y01,o.x01),!c))):(e.moveTo(I,L),e.arc(0,0,u,M,j,!c)):e.moveTo(I,L),!(n>O)||!(A>O)?e.lineTo(K,F):w>O?(r=oe(K,F,W,X,n,-w,c),o=oe(I,L,Q,U,n,-w,c),e.lineTo(r.cx+r.x01,r.cy+r.y01),w<T?e.arc(r.cx,r.cy,w,$(r.y01,r.x01),$(o.y01,o.x01),!c):(e.arc(r.cx,r.cy,w,$(r.y01,r.x01),$(r.y11,r.x11),!c),e.arc(0,0,n,$(r.cy+r.y11,r.cx+r.x11),$(o.cy+o.y11,o.cx+o.x11),c),e.arc(o.cx,o.cy,w,$(o.y11,o.x11),$(o.y01,o.x01),!c))):e.arc(0,0,n,C,R,c)}if(e.closePath(),t)return e=null,t+""||null}return i.centroid=function(){var t=(+s.apply(this,arguments)+ +a.apply(this,arguments))/2,E=(+N.apply(this,arguments)+ +b.apply(this,arguments))/2-ie/2;return[V(E)*t,B(E)*t]},i.innerRadius=function(t){return arguments.length?(s=typeof t=="function"?t:S.constant(+t),i):s},i.outerRadius=function(t){return arguments.length?(a=typeof t=="function"?t:S.constant(+t),i):a},i.cornerRadius=function(t){return arguments.length?(v=typeof t=="function"?t:S.constant(+t),i):v},i.padRadius=function(t){return arguments.length?(x=t==null?null:typeof t=="function"?t:S.constant(+t),i):x},i.startAngle=function(t){return arguments.length?(N=typeof t=="function"?t:S.constant(+t),i):N},i.endAngle=function(t){return arguments.length?(b=typeof t=="function"?t:S.constant(+t),i):b},i.padAngle=function(t){return arguments.length?(g=typeof t=="function"?t:S.constant(+t),i):g},i.context=function(t){return arguments.length?(e=t??null,i):e},i}function $e(s,a){return a<s?-1:a>s?1:a>=s?0:NaN}function ke(s){return s}function qe(){var s=ke,a=$e,v=null,x=S.constant(0),N=S.constant(ue),b=S.constant(0);function g(e){var m,i=(e=S.array(e)).length,t,E,n=0,u=new Array(i),y=new Array(i),f=+x.apply(this,arguments),k=Math.min(ue,Math.max(-ue,N.apply(this,arguments)-f)),c,M=Math.min(Math.abs(k)/i,b.apply(this,arguments)),j=M*(k<0?-1:1),R;for(m=0;m<i;++m)(R=y[u[m]=m]=+s(e[m],m,e))>0&&(n+=R);for(a!=null?u.sort(function(C,A){return a(y[C],y[A])}):v!=null&&u.sort(function(C,A){return v(e[C],e[A])}),m=0,E=n?(k-i*j)/n:0;m<i;++m,f=c)t=u[m],R=y[t],c=f+(R>0?R*E:0)+j,y[t]={data:e[t],index:m,value:R,startAngle:f,endAngle:c,padAngle:M};return y}return g.value=function(e){return arguments.length?(s=typeof e=="function"?e:S.constant(+e),g):s},g.sortValues=function(e){return arguments.length?(a=e,v=null,g):a},g.sort=function(e){return arguments.length?(v=e,a=null,g):v},g.startAngle=function(e){return arguments.length?(x=typeof e=="function"?e:S.constant(+e),g):x},g.endAngle=function(e){return arguments.length?(N=typeof e=="function"?e:S.constant(+e),g):N},g.padAngle=function(e){return arguments.length?(b=typeof e=="function"?e:S.constant(+e),g):b},g}function Oe(s){const{mainText:a,data:v,radius:x,colors:N,subNote:b,strokeWidth:g,tooltip:e,onSeriesMouseOver:m,onSeriesMouseClick:i,colorDomain:t,resetSelectionOnDoubleClick:E,detailsOnClick:n,styles:u,classNames:y,precision:f}=s,k=qe().sort(null).startAngle(0).value(d=>d.size),[c,M]=G.useState(void 0),[j,R]=G.useState(void 0),[C,A]=G.useState(void 0),[q,D]=G.useState(void 0);return l.jsxRuntimeExports.jsxs(l.jsxRuntimeExports.Fragment,{children:[l.jsxRuntimeExports.jsx("svg",{width:`${x*2}px`,height:`${x*2}px`,viewBox:`0 0 ${x*2} ${x*2}`,direction:"ltr",children:l.jsxRuntimeExports.jsxs("g",{transform:`translate(${x} ${x})`,children:[a||b?l.jsxRuntimeExports.jsx("foreignObject",{y:0-(x-g),x:0-(x-g),width:2*(x-g),height:2*(x-g),children:l.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-0.5 justify-center items-center h-inherit py-0 px-4",children:[a?l.jsxRuntimeExports.jsx(le.f,{marginBottom:"none",className:"donut-main-text text-primary-gray-700 dark:text-primary-gray-100 leading-none text-center",children:typeof a=="string"?a:v.findIndex(d=>d.label===a.label)!==-1?pe.numberFormattingFunction(v[v.findIndex(d=>d.label===a.label)].size,"NA",f,a.prefix,a.suffix):"NA"}):null,b?l.jsxRuntimeExports.jsx(le.u,{marginBottom:"none",size:"base",leading:"none",className:"donut-sub-note text-primary-gray-700 dark:text-primary-gray-100 text-center font-bold",children:b}):typeof a=="string"||!a?null:l.jsxRuntimeExports.jsx(le.u,{size:"base",marginBottom:"none",leading:"none",className:"donut-label text-primary-gray-700 dark:text-primary-gray-100 text-center font-bold",children:a.label})]})}):null,k(v).map((d,T)=>l.jsxRuntimeExports.jsx("path",{d:Te()({innerRadius:x-g,outerRadius:x,startAngle:d.startAngle,endAngle:d.endAngle}),style:{fill:t.indexOf(d.data.label)!==-1?N[t.indexOf(d.data.label)%N.length]:se.Colors.gray,opacity:c?c.label===d.data.label?1:.3:1},onMouseEnter:w=>{M(d.data),D(w.clientY),A(w.clientX),m?.(d)},onClick:()=>{(i||n)&&(fe.isEqual(j,d.data)&&E?(R(void 0),i?.(void 0)):(R(d.data),i&&i(d.data)))},onMouseMove:w=>{M(d.data),D(w.clientY),A(w.clientX)},onMouseLeave:()=>{M(void 0),A(void 0),D(void 0),m?.(void 0)}},T))]})}),c&&e&&C&&q?l.jsxRuntimeExports.jsx(ye.Tooltip,{data:c,body:e,xPos:C,yPos:q,backgroundStyle:u?.tooltip,className:y?.tooltip}):null,n&&j!==void 0?l.jsxRuntimeExports.jsx(he.X,{open:j!==void 0,onClose:()=>{R(void 0)},children:l.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof n=="string"?{__html:ve.string2HTML(n,j)}:void 0,children:typeof n=="function"?n(j):null})}):null]})}function He(s){const{mainText:a,graphTitle:v,colors:x=se.Colors.light.categoricalColors.colors,suffix:N="",sources:b,prefix:g="",strokeWidth:e=50,graphDescription:m,subNote:i,footNote:t,radius:E,data:n,showColorScale:u=!0,padding:y,backgroundColor:f=!1,tooltip:k,onSeriesMouseOver:c,graphID:M,onSeriesMouseClick:j,topMargin:R=0,bottomMargin:C=0,graphDownload:A=!1,dataDownload:q=!1,colorDomain:D,sortData:d,language:T="en",theme:w="light",width:p,height:r,minHeight:o=0,relativeHeight:z,ariaLabel:J,resetSelectionOnDoubleClick:I=!0,colorScaleMaxWidth:L,detailsOnClick:K,styles:F,classNames:W,precision:X=2}=s,[Q,U]=G.useState(0),[H,Z]=G.useState(0),[ne,_]=G.useState(0),P=G.useRef(null),re=G.useRef(null);G.useEffect(()=>{const h=new ResizeObserver(ee=>{Z(p||ee[0].target.clientWidth||420),_(r||ee[0].target.clientHeight||420),U((Math.min(p||ee[0].target.clientWidth||620,r||ee[0].target.clientHeight||480)||420)/2)});return P.current&&(_(P.current.clientHeight||420),Z(P.current.clientWidth||420),U((Math.min(P.current.clientWidth,P.current.clientHeight)||420)/2),(!p||!E)&&h.observe(P.current)),()=>h.disconnect()},[p,r,E]);const Y=d==="asc"?ae.sortBy(n,h=>h.size):d==="desc"?ae.sortBy(n,h=>h.size).reverse():n;return l.jsxRuntimeExports.jsx("div",{className:`${w||"light"} flex ${p?"w-fit grow-0":"w-full grow"}`,dir:T==="he"||T==="ar"?"rtl":void 0,children:l.jsxRuntimeExports.jsx("div",{className:l.mo(`${f?f===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${T||"en"}`,p?"w-fit":"w-full",W?.graphContainer),style:{...F?.graphContainer||{},minHeight:"inherit",...f&&f!==!0?{backgroundColor:f}:{}},id:M,ref:re,"aria-label":J||`${v?`The graph shows ${v}. `:""}This is a donut or pie chart chart. ${m?` ${m}`:""}`,children:l.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:f?y||"1rem":y||0},children:l.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-2 w-full grow justify-between",children:[v||m||A||q?l.jsxRuntimeExports.jsx(Re.GraphHeader,{styles:{title:F?.title,description:F?.description},classNames:{title:W?.title,description:W?.description},graphTitle:v,graphDescription:m,width:p,graphDownload:A?re.current:void 0,dataDownload:q?n.map(h=>h.data).filter(h=>h!==void 0).length>0?n.map(h=>h.data).filter(h=>h!==void 0):n.filter(h=>h!==void 0):null}):null,l.jsxRuntimeExports.jsx("div",{className:"flex grow flex-col justify-center items-stretch gap-8 flex-wrap",style:{width:p?`${p}px`:"100%",padding:`${R}px 0 ${C}px 0`},children:n.length===0?l.jsxRuntimeExports.jsx(be.EmptyState,{}):l.jsxRuntimeExports.jsxs(l.jsxRuntimeExports.Fragment,{children:[u?l.jsxRuntimeExports.jsx("div",{className:"leading-0","aria-label":"Color legend",children:l.jsxRuntimeExports.jsx("div",{className:"flex mb-0 ml-auto mr-auto justify-center gap-3.5 flex-wrap",style:{maxWidth:L},children:Y.map((h,ee)=>l.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 items-center",children:[l.jsxRuntimeExports.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:(D||Y.map(de=>de.label)).indexOf(h.label)!==-1?(x||se.Colors[w].categoricalColors.colors)[(D||Y.map(de=>de.label)).indexOf(h.label)%(x||se.Colors[w].categoricalColors.colors).length]:se.Colors.gray}}),l.jsxRuntimeExports.jsxs(le.u,{marginBottom:"none",size:"sm",className:"text-primary-gray-700 dark:text-primary-gray-100",children:[h.label,":"," ",l.jsxRuntimeExports.jsx("span",{className:"font-bold",style:{fontSize:"inherit"},children:pe.numberFormattingFunction(h.size,"NA",X,g,N)})]})]},ee))})}):null,l.jsxRuntimeExports.jsx("div",{className:`flex ${p?"grow-0":"grow"} items-center justify-center leading-0`,style:{width:p?`${p}px`:"100%",height:r?`${Math.max(o,r||(z?o?(p||H)*z>o?(p||H)*z:o:(p||H)*z:ne))}px`:"auto"},ref:P,"aria-label":"Graph area",children:l.jsxRuntimeExports.jsx("div",{className:"w-full flex justify-center leading-0",children:E||Q?l.jsxRuntimeExports.jsx(Oe,{mainText:a,data:d==="asc"?ae.sortBy(n,h=>h.size):d==="desc"?ae.sortBy(n,h=>h.size).reverse():n,colors:x,radius:E||Q,subNote:i,strokeWidth:e,tooltip:k,colorDomain:D||Y.map(h=>h.label),onSeriesMouseOver:c,onSeriesMouseClick:j,resetSelectionOnDoubleClick:I,styles:F,detailsOnClick:K,precision:X}):null})})]})}),b||t?l.jsxRuntimeExports.jsx(je.GraphFooter,{styles:{footnote:F?.footnote,source:F?.source},classNames:{footnote:W?.footnote,source:W?.source},sources:b,footNote:t,width:p}):l.jsxRuntimeExports.jsx("div",{})]})})})})}exports.DonutChart=He;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./index-CHPV5EwG-DDoeWRVt.cjs"),G=require("react"),ae=require("./index-DYH8g9WA.cjs"),le=require("./Typography-k-kOjICQ.cjs"),fe=require("./index-DQA8q5sC.cjs"),he=require("./Modal-tXZlLE5s.cjs"),ye=require("./Tooltip-De16GWhY.cjs"),se=require("./Colors.cjs"),pe=require("./numberFormattingFunction-02t-wJta.cjs"),ve=require("./string2HTML-z7CwHXcx.cjs"),S=require("./array-DKbXV8lR.cjs"),je=require("./GraphFooter.cjs"),Re=require("./GraphHeader.cjs"),be=require("./EmptyState-d8_8SxeW.cjs"),ge=Math.abs,$=Math.atan2,V=Math.cos,Ee=Math.max,xe=Math.min,B=Math.sin,te=Math.sqrt,O=1e-12,ie=Math.PI,ce=ie/2,ue=2*ie;function we(s){return s>1?0:s<-1?ie:Math.acos(s)}function me(s){return s>=1?ce:s<=-1?-ce:Math.asin(s)}function Me(s){return s.innerRadius}function Ae(s){return s.outerRadius}function Ne(s){return s.startAngle}function Ce(s){return s.endAngle}function Se(s){return s&&s.padAngle}function De(s,a,v,x,N,b,g,e){var m=v-s,i=x-a,t=g-N,E=e-b,n=E*m-t*i;if(!(n*n<O))return n=(t*(a-b)-E*(s-N))/n,[s+n*m,a+n*i]}function oe(s,a,v,x,N,b,g){var e=s-v,m=a-x,i=(g?b:-b)/te(e*e+m*m),t=i*m,E=-i*e,n=s+t,u=a+E,y=v+t,f=x+E,k=(n+y)/2,c=(u+f)/2,M=y-n,j=f-u,R=M*M+j*j,C=N-b,A=n*f-y*u,q=(j<0?-1:1)*te(Ee(0,C*C*R-A*A)),D=(A*j-M*q)/R,d=(-A*M-j*q)/R,T=(A*j+M*q)/R,w=(-A*M+j*q)/R,p=D-k,r=d-c,o=T-k,z=w-c;return p*p+r*r>o*o+z*z&&(D=T,d=w),{cx:D,cy:d,x01:-t,y01:-E,x11:D*(N/C-1),y11:d*(N/C-1)}}function Te(){var s=Me,a=Ae,v=S.constant(0),x=null,N=Ne,b=Ce,g=Se,e=null,m=S.withPath(i);function i(){var t,E,n=+s.apply(this,arguments),u=+a.apply(this,arguments),y=N.apply(this,arguments)-ce,f=b.apply(this,arguments)-ce,k=ge(f-y),c=f>y;if(e||(e=t=m()),u<n&&(E=u,u=n,n=E),!(u>O))e.moveTo(0,0);else if(k>ue-O)e.moveTo(u*V(y),u*B(y)),e.arc(0,0,u,y,f,!c),n>O&&(e.moveTo(n*V(f),n*B(f)),e.arc(0,0,n,f,y,c));else{var M=y,j=f,R=y,C=f,A=k,q=k,D=g.apply(this,arguments)/2,d=D>O&&(x?+x.apply(this,arguments):te(n*n+u*u)),T=xe(ge(u-n)/2,+v.apply(this,arguments)),w=T,p=T,r,o;if(d>O){var z=me(d/n*B(D)),J=me(d/u*B(D));(A-=z*2)>O?(z*=c?1:-1,R+=z,C-=z):(A=0,R=C=(y+f)/2),(q-=J*2)>O?(J*=c?1:-1,M+=J,j-=J):(q=0,M=j=(y+f)/2)}var I=u*V(M),L=u*B(M),K=n*V(C),F=n*B(C);if(T>O){var W=u*V(j),X=u*B(j),Q=n*V(R),U=n*B(R),H;if(k<ie)if(H=De(I,L,Q,U,W,X,K,F)){var Z=I-H[0],ne=L-H[1],_=W-H[0],P=X-H[1],re=1/B(we((Z*_+ne*P)/(te(Z*Z+ne*ne)*te(_*_+P*P)))/2),Y=te(H[0]*H[0]+H[1]*H[1]);w=xe(T,(n-Y)/(re-1)),p=xe(T,(u-Y)/(re+1))}else w=p=0}q>O?p>O?(r=oe(Q,U,I,L,u,p,c),o=oe(W,X,K,F,u,p,c),e.moveTo(r.cx+r.x01,r.cy+r.y01),p<T?e.arc(r.cx,r.cy,p,$(r.y01,r.x01),$(o.y01,o.x01),!c):(e.arc(r.cx,r.cy,p,$(r.y01,r.x01),$(r.y11,r.x11),!c),e.arc(0,0,u,$(r.cy+r.y11,r.cx+r.x11),$(o.cy+o.y11,o.cx+o.x11),!c),e.arc(o.cx,o.cy,p,$(o.y11,o.x11),$(o.y01,o.x01),!c))):(e.moveTo(I,L),e.arc(0,0,u,M,j,!c)):e.moveTo(I,L),!(n>O)||!(A>O)?e.lineTo(K,F):w>O?(r=oe(K,F,W,X,n,-w,c),o=oe(I,L,Q,U,n,-w,c),e.lineTo(r.cx+r.x01,r.cy+r.y01),w<T?e.arc(r.cx,r.cy,w,$(r.y01,r.x01),$(o.y01,o.x01),!c):(e.arc(r.cx,r.cy,w,$(r.y01,r.x01),$(r.y11,r.x11),!c),e.arc(0,0,n,$(r.cy+r.y11,r.cx+r.x11),$(o.cy+o.y11,o.cx+o.x11),c),e.arc(o.cx,o.cy,w,$(o.y11,o.x11),$(o.y01,o.x01),!c))):e.arc(0,0,n,C,R,c)}if(e.closePath(),t)return e=null,t+""||null}return i.centroid=function(){var t=(+s.apply(this,arguments)+ +a.apply(this,arguments))/2,E=(+N.apply(this,arguments)+ +b.apply(this,arguments))/2-ie/2;return[V(E)*t,B(E)*t]},i.innerRadius=function(t){return arguments.length?(s=typeof t=="function"?t:S.constant(+t),i):s},i.outerRadius=function(t){return arguments.length?(a=typeof t=="function"?t:S.constant(+t),i):a},i.cornerRadius=function(t){return arguments.length?(v=typeof t=="function"?t:S.constant(+t),i):v},i.padRadius=function(t){return arguments.length?(x=t==null?null:typeof t=="function"?t:S.constant(+t),i):x},i.startAngle=function(t){return arguments.length?(N=typeof t=="function"?t:S.constant(+t),i):N},i.endAngle=function(t){return arguments.length?(b=typeof t=="function"?t:S.constant(+t),i):b},i.padAngle=function(t){return arguments.length?(g=typeof t=="function"?t:S.constant(+t),i):g},i.context=function(t){return arguments.length?(e=t??null,i):e},i}function $e(s,a){return a<s?-1:a>s?1:a>=s?0:NaN}function ke(s){return s}function qe(){var s=ke,a=$e,v=null,x=S.constant(0),N=S.constant(ue),b=S.constant(0);function g(e){var m,i=(e=S.array(e)).length,t,E,n=0,u=new Array(i),y=new Array(i),f=+x.apply(this,arguments),k=Math.min(ue,Math.max(-ue,N.apply(this,arguments)-f)),c,M=Math.min(Math.abs(k)/i,b.apply(this,arguments)),j=M*(k<0?-1:1),R;for(m=0;m<i;++m)(R=y[u[m]=m]=+s(e[m],m,e))>0&&(n+=R);for(a!=null?u.sort(function(C,A){return a(y[C],y[A])}):v!=null&&u.sort(function(C,A){return v(e[C],e[A])}),m=0,E=n?(k-i*j)/n:0;m<i;++m,f=c)t=u[m],R=y[t],c=f+(R>0?R*E:0)+j,y[t]={data:e[t],index:m,value:R,startAngle:f,endAngle:c,padAngle:M};return y}return g.value=function(e){return arguments.length?(s=typeof e=="function"?e:S.constant(+e),g):s},g.sortValues=function(e){return arguments.length?(a=e,v=null,g):a},g.sort=function(e){return arguments.length?(v=e,a=null,g):v},g.startAngle=function(e){return arguments.length?(x=typeof e=="function"?e:S.constant(+e),g):x},g.endAngle=function(e){return arguments.length?(N=typeof e=="function"?e:S.constant(+e),g):N},g.padAngle=function(e){return arguments.length?(b=typeof e=="function"?e:S.constant(+e),g):b},g}function Oe(s){const{mainText:a,data:v,radius:x,colors:N,subNote:b,strokeWidth:g,tooltip:e,onSeriesMouseOver:m,onSeriesMouseClick:i,colorDomain:t,resetSelectionOnDoubleClick:E,detailsOnClick:n,styles:u,classNames:y,precision:f}=s,k=qe().sort(null).startAngle(0).value(d=>d.size),[c,M]=G.useState(void 0),[j,R]=G.useState(void 0),[C,A]=G.useState(void 0),[q,D]=G.useState(void 0);return l.jsxRuntimeExports.jsxs(l.jsxRuntimeExports.Fragment,{children:[l.jsxRuntimeExports.jsx("svg",{width:`${x*2}px`,height:`${x*2}px`,viewBox:`0 0 ${x*2} ${x*2}`,direction:"ltr",children:l.jsxRuntimeExports.jsxs("g",{transform:`translate(${x} ${x})`,children:[a||b?l.jsxRuntimeExports.jsx("foreignObject",{y:0-(x-g),x:0-(x-g),width:2*(x-g),height:2*(x-g),children:l.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-0.5 justify-center items-center h-inherit py-0 px-4",children:[a?l.jsxRuntimeExports.jsx(le.f,{marginBottom:"none",className:"donut-main-text text-primary-gray-700 dark:text-primary-gray-100 leading-none text-center",children:typeof a=="string"?a:v.findIndex(d=>d.label===a.label)!==-1?pe.numberFormattingFunction(v[v.findIndex(d=>d.label===a.label)].size,"NA",f,a.prefix,a.suffix):"NA"}):null,b?l.jsxRuntimeExports.jsx(le.u,{marginBottom:"none",size:"base",leading:"none",className:"donut-sub-note text-primary-gray-700 dark:text-primary-gray-100 text-center font-bold",children:b}):typeof a=="string"||!a?null:l.jsxRuntimeExports.jsx(le.u,{size:"base",marginBottom:"none",leading:"none",className:"donut-label text-primary-gray-700 dark:text-primary-gray-100 text-center font-bold",children:a.label})]})}):null,k(v).map((d,T)=>l.jsxRuntimeExports.jsx("path",{d:Te()({innerRadius:x-g,outerRadius:x,startAngle:d.startAngle,endAngle:d.endAngle}),style:{fill:t.indexOf(d.data.label)!==-1?N[t.indexOf(d.data.label)%N.length]:se.Colors.gray,opacity:c?c.label===d.data.label?1:.3:1},onMouseEnter:w=>{M(d.data),D(w.clientY),A(w.clientX),m?.(d)},onClick:()=>{(i||n)&&(fe.isEqual(j,d.data)&&E?(R(void 0),i?.(void 0)):(R(d.data),i&&i(d.data)))},onMouseMove:w=>{M(d.data),D(w.clientY),A(w.clientX)},onMouseLeave:()=>{M(void 0),A(void 0),D(void 0),m?.(void 0)}},T))]})}),c&&e&&C&&q?l.jsxRuntimeExports.jsx(ye.Tooltip,{data:c,body:e,xPos:C,yPos:q,backgroundStyle:u?.tooltip,className:y?.tooltip}):null,n&&j!==void 0?l.jsxRuntimeExports.jsx(he.X,{open:j!==void 0,onClose:()=>{R(void 0)},children:l.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof n=="string"?{__html:ve.string2HTML(n,j)}:void 0,children:typeof n=="function"?n(j):null})}):null]})}function He(s){const{mainText:a,graphTitle:v,colors:x=se.Colors.light.categoricalColors.colors,suffix:N="",sources:b,prefix:g="",strokeWidth:e=50,graphDescription:m,subNote:i,footNote:t,radius:E,data:n,showColorScale:u=!0,padding:y,backgroundColor:f=!1,tooltip:k,onSeriesMouseOver:c,graphID:M,onSeriesMouseClick:j,topMargin:R=0,bottomMargin:C=0,graphDownload:A=!1,dataDownload:q=!1,colorDomain:D,sortData:d,language:T="en",theme:w="light",width:p,height:r,minHeight:o=0,relativeHeight:z,ariaLabel:J,resetSelectionOnDoubleClick:I=!0,colorScaleMaxWidth:L,detailsOnClick:K,styles:F,classNames:W,precision:X=2}=s,[Q,U]=G.useState(0),[H,Z]=G.useState(0),[ne,_]=G.useState(0),P=G.useRef(null),re=G.useRef(null);G.useEffect(()=>{const h=new ResizeObserver(ee=>{Z(p||ee[0].target.clientWidth||420),_(r||ee[0].target.clientHeight||420),U((Math.min(p||ee[0].target.clientWidth||620,r||ee[0].target.clientHeight||480)||420)/2)});return P.current&&(_(P.current.clientHeight||420),Z(P.current.clientWidth||420),U((Math.min(P.current.clientWidth,P.current.clientHeight)||420)/2),(!p||!E)&&h.observe(P.current)),()=>h.disconnect()},[p,r,E]);const Y=d==="asc"?ae.sortBy(n,h=>h.size):d==="desc"?ae.sortBy(n,h=>h.size).reverse():n;return l.jsxRuntimeExports.jsx("div",{className:`${w||"light"} flex ${p?"w-fit grow-0":"w-full grow"}`,dir:T==="he"||T==="ar"?"rtl":void 0,children:l.jsxRuntimeExports.jsx("div",{className:l.mo(`${f?f===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${T||"en"}`,p?"w-fit":"w-full",W?.graphContainer),style:{...F?.graphContainer||{},minHeight:"inherit",...f&&f!==!0?{backgroundColor:f}:{}},id:M,ref:re,"aria-label":J||`${v?`The graph shows ${v}. `:""}This is a donut or pie chart chart. ${m?` ${m}`:""}`,children:l.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:f?y||"1rem":y||0},children:l.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-2 w-full grow justify-between",children:[v||m||A||q?l.jsxRuntimeExports.jsx(Re.GraphHeader,{styles:{title:F?.title,description:F?.description},classNames:{title:W?.title,description:W?.description},graphTitle:v,graphDescription:m,width:p,graphDownload:A?re.current:void 0,dataDownload:q?n.map(h=>h.data).filter(h=>h!==void 0).length>0?n.map(h=>h.data).filter(h=>h!==void 0):n.filter(h=>h!==void 0):null}):null,l.jsxRuntimeExports.jsx("div",{className:"flex grow flex-col justify-center items-stretch gap-8 flex-wrap",style:{width:p?`${p}px`:"100%",padding:`${R}px 0 ${C}px 0`},children:n.length===0?l.jsxRuntimeExports.jsx(be.EmptyState,{}):l.jsxRuntimeExports.jsxs(l.jsxRuntimeExports.Fragment,{children:[u?l.jsxRuntimeExports.jsx("div",{className:"leading-0","aria-label":"Color legend",children:l.jsxRuntimeExports.jsx("div",{className:"flex mb-0 ml-auto mr-auto justify-center gap-3.5 flex-wrap",style:{maxWidth:L},children:Y.map((h,ee)=>l.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 items-center",children:[l.jsxRuntimeExports.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:(D||Y.map(de=>de.label)).indexOf(h.label)!==-1?(x||se.Colors[w].categoricalColors.colors)[(D||Y.map(de=>de.label)).indexOf(h.label)%(x||se.Colors[w].categoricalColors.colors).length]:se.Colors.gray}}),l.jsxRuntimeExports.jsxs(le.u,{marginBottom:"none",size:"sm",className:"text-primary-gray-700 dark:text-primary-gray-100",children:[h.label,":"," ",l.jsxRuntimeExports.jsx("span",{className:"font-bold",style:{fontSize:"inherit"},children:pe.numberFormattingFunction(h.size,"NA",X,g,N)})]})]},ee))})}):null,l.jsxRuntimeExports.jsx("div",{className:`flex ${p?"grow-0":"grow"} items-center justify-center leading-0`,style:{width:p?`${p}px`:"100%",height:r?`${Math.max(o,r||(z?o?(p||H)*z>o?(p||H)*z:o:(p||H)*z:ne))}px`:"auto"},ref:P,"aria-label":"Graph area",children:l.jsxRuntimeExports.jsx("div",{className:"w-full flex justify-center leading-0",children:E||Q?l.jsxRuntimeExports.jsx(Oe,{mainText:a,data:d==="asc"?ae.sortBy(n,h=>h.size):d==="desc"?ae.sortBy(n,h=>h.size).reverse():n,colors:x,radius:E||Q,subNote:i,strokeWidth:e,tooltip:k,colorDomain:D||Y.map(h=>h.label),onSeriesMouseOver:c,onSeriesMouseClick:j,resetSelectionOnDoubleClick:I,styles:F,detailsOnClick:K,precision:X}):null})})]})}),b||t?l.jsxRuntimeExports.jsx(je.GraphFooter,{styles:{footnote:F?.footnote,source:F?.source},classNames:{footnote:W?.footnote,source:W?.source},sources:b,footNote:t,width:p}):l.jsxRuntimeExports.jsx("div",{})]})})})})}exports.DonutChart=He;
2
2
  //# sourceMappingURL=DonutChart.cjs.map
@@ -1,13 +1,13 @@
1
1
  import { j as c, m as xe } from "./index-CHPV5EwG-BPSP-7Jg.js";
2
2
  import { useState as V, useRef as ge, useEffect as ye } from "react";
3
- import { s as se } from "./index-DxagiOHo.js";
3
+ import { s as se } from "./index-fwdktvAS.js";
4
4
  import { f as ve, u as fe } from "./Typography-Ctgfl1J5.js";
5
- import { i as be } from "./index-27yTRcko.js";
5
+ import { i as be } from "./index-Bwrro8-q.js";
6
6
  import { X as je } from "./Modal-DVVwpKhP.js";
7
- import { T as we } from "./Tooltip-DyM5snqx.js";
7
+ import { T as we } from "./Tooltip-CVCGWyzw.js";
8
8
  import { Colors as ae } from "./Colors.js";
9
9
  import { n as pe } from "./numberFormattingFunction-14YCbkN2.js";
10
- import { s as Me } from "./string2HTML-CWHGfz_d.js";
10
+ import { s as Me } from "./string2HTML-oFCROsus.js";
11
11
  import { w as Ae, c as S, a as Ne } from "./array-B7TkkRH0.js";
12
12
  import { GraphFooter as De } from "./GraphFooter.js";
13
13
  import { GraphHeader as Ce } from "./GraphHeader.js";
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-CHPV5EwG-DDoeWRVt.cjs"),n=require("react"),be=require("./index-CZbIGs8q.cjs"),Ee=require("./parse-hMnG_lRV.cjs"),fe=require("./getSliderMarks-CtsEXiLV.cjs"),ke=require("./Spinner-DA6Z5E4n.cjs"),Ce=require("./index-BXns0-ng.cjs"),$=require("./zoom-Lo7IAUfC.cjs"),De=require("./Modal-tXZlLE5s.cjs"),Se=require("./Typography-k-kOjICQ.cjs"),Ne=require("./Tooltip-n8z5bfav.cjs"),R=require("./Colors.cjs"),$e=require("./string2HTML-D2Avudmb.cjs"),ve=require("./index-BW_-wD2k.cjs"),Me=require("./pow-B5-jkdHU.cjs"),je=require("./select-Bnfk0lJx.cjs"),Oe=require("./use-in-view-sQJZ_xDO.cjs"),de=require("./proxy-BHRoeZgd.cjs"),qe=require("./index-BW8iNx7E.cjs"),Pe=require("./GraphFooter.cjs"),Ie=require("./GraphHeader.cjs"),Le=require("./fetchAndParseData-CQyVGCul.cjs"),we=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),Te=require("./init-DU0ybBc_.cjs");function ze(me){const{data:l,colors:c,mapData:k,colorLegendTitle:M,colorDomain:j,radius:v,height:m,width:a,scale:K,centerPoint:O,tooltip:Z,showLabels:pe,mapBorderWidth:J,mapBorderColor:Q,mapNoDataColor:H,onSeriesMouseOver:ee,showColorScale:xe,zoomScaleExtend:C,zoomTranslateExtend:he,highlightedDataPoints:te,onSeriesMouseClick:B,resetSelectionOnDoubleClick:g,detailsOnClick:D,styles:re,classNames:ge,mapProjection:T,zoomInteraction:q,animate:y,dimmedOpacity:oe,customLayers:ae,maxRadiusValue:ie}=me,[A,se]=n.useState(void 0),[F,h]=n.useState(!(a<680)),z=n.useRef(null),[P,G]=n.useState(void 0),[ne,f]=n.useState(void 0),[b,U]=n.useState(void 0),[le,V]=n.useState(void 0),I=n.useRef(null),X=Oe.useInView(I,{once:y.once,amount:y.amount}),_=n.useRef(null),d=l.filter(e=>e.radius===void 0||e.radius===null).length!==l.length?Me.sqrt().domain([0,ie]).range([.25,v]).nice():void 0;n.useEffect(()=>{const e=je.select(_.current),x=je.select(I.current),o=i=>{if(q==="noZoom")return!1;if(q==="button")return!i.type.includes("wheel");const t=i.type==="wheel",u=i.type.startsWith("touch"),w=i.type==="mousedown"||i.type==="mousemove";return u?!0:t?q==="scroll"?!0:i.ctrlKey:w&&!i.button&&!i.ctrlKey},E=$.zoom().scaleExtent(C).translateExtent(he||[[-20,-20],[a+20,m+20]]).filter(o).on("zoom",({transform:i})=>{e.attr("transform",i)});x.call(E),z.current=E},[m,a,q]);const p=$.turf_bbox_default(k),S=$.turf_centroid_default(k),Y=p[2]-p[0],ce=p[3]-p[1],L=a*190/960*360/Y,ye=m*190/678*180/ce,s=K*Math.min(L,ye),N=T==="mercator"?$.geoMercator().rotate([0,0]).center(O||S.geometry.coordinates).translate([a/2,m/2]).scale(s):T==="equalEarth"?$.geoEqualEarth().rotate([0,0]).center(O||S.geometry.coordinates).translate([a/2,m/2]).scale(s):T==="naturalEarth"?$.geoNaturalEarth1().rotate([0,0]).center(O||S.geometry.coordinates).translate([a/2,m/2]).scale(s):T==="orthographic"?$.geoOrthographic().rotate([0,0]).center(O||S.geometry.coordinates).translate([a/2,m/2]).scale(s):$.geoAlbersUsa().rotate([0,0]).center(O||S.geometry.coordinates).translate([a/2,m/2]).scale(s),W=e=>{if(!I.current||!z.current)return;je.select(I.current).call(z.current.scaleBy,e==="in"?1.2:1/1.2)};return r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsxs("div",{className:"relative",children:[r.jsxRuntimeExports.jsx(de.motion.svg,{width:`${a}px`,height:`${m}px`,viewBox:`0 0 ${a} ${m}`,ref:I,direction:"ltr",children:r.jsxRuntimeExports.jsxs("g",{ref:_,children:[ae.filter(e=>e.position==="before").map(e=>e.layer),k.features.map((e,x)=>r.jsxRuntimeExports.jsx("g",{children:e.geometry.type==="MultiPolygon"?e.geometry.coordinates.map((o,E)=>{let i="";return o.forEach(t=>{let u=" M";t.forEach((w,Re)=>{const ue=N([w[0],w[1]]);Re!==t.length-1?u=`${u}${ue[0]} ${ue[1]}L`:u=`${u}${ue[0]} ${ue[1]}`}),i+=u}),r.jsxRuntimeExports.jsx("path",{d:i,style:{stroke:Q,strokeWidth:J,fill:H}},E)}):e.geometry.coordinates.map((o,E)=>{let i="M";return o.forEach((t,u)=>{const w=N([t[0],t[1]]);u!==o.length-1?i=`${i}${w[0]} ${w[1]}L`:i=`${i}${w[0]} ${w[1]}`}),r.jsxRuntimeExports.jsx("path",{d:i,style:{stroke:Q,strokeWidth:J,fill:H}},E)})},x)),r.jsxRuntimeExports.jsx(qe.AnimatePresence,{children:l.map(e=>{const x=l.filter(o=>o.color).length===0?c[0]:e.color?c[j.indexOf(`${e.color}`)]:R.Colors.gray;return r.jsxRuntimeExports.jsxs(de.motion.g,{variants:{initial:{opacity:0},whileInView:{opacity:A?A===x?1:oe:te.length!==0?te.indexOf(e.label||"")!==-1?1:oe:1,transition:{duration:y.duration}}},initial:"initial",animate:X?"whileInView":"initial",exit:{opacity:0,transition:{duration:y.duration}},onMouseEnter:o=>{f(e),V(o.clientY),U(o.clientX),ee?.(e)},onMouseMove:o=>{f(e),V(o.clientY),U(o.clientX)},onMouseLeave:()=>{f(void 0),U(void 0),V(void 0),ee?.(void 0)},onClick:()=>{(B||D)&&(Ce.isEqual(P,e)&&g?(G(void 0),B?.(void 0)):(G(e),B?.(e)))},transform:`translate(${N([e.long,e.lat])[0]},${N([e.long,e.lat])[1]})`,children:[r.jsxRuntimeExports.jsx(de.motion.circle,{cx:0,cy:0,variants:{initial:{r:0,fill:l.filter(o=>o.color).length===0?c[0]:e.color?c[j.indexOf(`${e.color}`)]:R.Colors.gray,stroke:l.filter(o=>o.color).length===0?c[0]:e.color?c[j.indexOf(`${e.color}`)]:R.Colors.gray},whileInView:{r:d?d(e.radius||0):v,fill:l.filter(o=>o.color).length===0?c[0]:e.color?c[j.indexOf(`${e.color}`)]:R.Colors.gray,stroke:l.filter(o=>o.color).length===0?c[0]:e.color?c[j.indexOf(`${e.color}`)]:R.Colors.gray,transition:{duration:y.duration}}},initial:"initial",animate:X?"whileInView":"initial",exit:{r:0,transition:{duration:y.duration}},style:{fillOpacity:.8}}),pe&&e.label?r.jsxRuntimeExports.jsx(de.motion.text,{variants:{initial:{opacity:0,x:d?d(e.radius||0):v},whileInView:{opacity:1,x:d?d(e.radius||0):v,transition:{duration:y.duration}}},initial:"initial",animate:X?"whileInView":"initial",exit:{opacity:0,transition:{duration:y.duration}},y:0,className:"fill-primary-gray-600 dark:fill-primary-gray-300 text-sm",style:{textAnchor:"start"},dx:4,dy:5,children:e.label}):null]},e.label||`${e.lat}-${e.long}`)})}),ae.filter(e=>e.position==="after").map(e=>e.layer)]})}),l.filter(e=>e.color).length===0||xe===!1?null:r.jsxRuntimeExports.jsx("div",{className:"absolute left-4 bottom-4",children:F?r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsx("div",{style:{backgroundColor:"rgba(240,240,240, 0.7)",border:"1px solid var(--gray-400)",borderRadius:"999px",width:"24px",height:"24px",padding:"3px",cursor:"pointer",zIndex:10,position:"absolute",right:"-0.75rem",top:"-0.75rem"},onClick:()=>{h(!1)},children:r.jsxRuntimeExports.jsx(ve.X,{})}),r.jsxRuntimeExports.jsxs("div",{className:"p-2",style:{backgroundColor:"rgba(240,240,240, 0.7)"},children:[M&&M!==""?r.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:M}):null,r.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-3",children:j.map((e,x)=>r.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 items-center",onMouseOver:()=>{se(c[x%c.length])},onMouseLeave:()=>{se(void 0)},children:[r.jsxRuntimeExports.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:c[x%c.length]}}),r.jsxRuntimeExports.jsx(Se.u,{size:"sm",marginBottom:"none",leading:"none",children:e})]},x))})]})]}):r.jsxRuntimeExports.jsx("button",{type:"button",className:"mb-0 border-0 bg-transparent p-0 self-start",onClick:()=>{h(!0)},children:r.jsxRuntimeExports.jsx("div",{className:"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-550 border-primary-gray-400 dark:border-primary-gray-500",children:"Show Legend"})})}),q==="button"&&r.jsxRuntimeExports.jsxs("div",{className:"absolute left-4 top-4 flex flex-col",children:[r.jsxRuntimeExports.jsx("button",{onClick:()=>W("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-400 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"+"}),r.jsxRuntimeExports.jsx("button",{onClick:()=>W("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-400 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"–"})]})]}),D&&P!==void 0?r.jsxRuntimeExports.jsx(De.X,{open:P!==void 0,onClose:()=>{G(void 0)},children:r.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof D=="string"?{__html:$e.string2HTML(D,P)}:void 0,children:typeof D=="function"?D(P):null})}):null,ne&&Z&&b&&le?r.jsxRuntimeExports.jsx(Ne.Tooltip,{data:ne,body:Z,xPos:b,yPos:le,backgroundStyle:re?.tooltip,className:ge?.tooltip}):null]})}function Ve(me){const{data:l,mapData:c="https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap.json",graphTitle:k,colors:M,sources:j,graphDescription:v,height:m,width:a,footNote:K="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.",colorLegendTitle:O,colorDomain:Z,radius:pe=5,scale:J=.95,centerPoint:Q,padding:H,mapBorderWidth:ee=.5,mapNoDataColor:xe=R.Colors.light.graphNoData,backgroundColor:C=!1,showLabels:he=!1,mapBorderColor:te=R.Colors.light.grays["gray-500"],tooltip:B,relativeHeight:g,onSeriesMouseOver:D,isWorldMap:re=!0,showColorScale:ge=!0,zoomScaleExtend:T=[.8,6],zoomTranslateExtend:q,graphID:y,highlightedDataPoints:oe=[],onSeriesMouseClick:ae,graphDownload:ie=!1,dataDownload:A=!1,showAntarctica:se=!1,language:F="en",minHeight:h=0,theme:z="light",ariaLabel:P,resetSelectionOnDoubleClick:G=!0,detailsOnClick:ne,styles:f,classNames:b,mapProjection:U,zoomInteraction:le="button",animate:V=!1,dimmedOpacity:I=.3,customLayers:X=[],maxRadiusValue:_,timeline:d={enabled:!1,autoplay:!1,showOnlyActiveDate:!0}}=me,[p,S]=n.useState(0),[Y,ce]=n.useState(0),[L,ye]=n.useState(d.autoplay),s=fe.sort(be.uniqBy(l.filter(t=>t.date!==void 0&&t.date!==null),t=>t.date).map(t=>Ee.parse(`${t.date}`,d.dateFormat||"yyyy",new Date).getTime()),(t,u)=>Te.ascending(t,u)),[N,W]=n.useState(d.autoplay?0:s.length-1),[e,x]=n.useState(void 0),o=n.useRef(null),E=n.useRef(null);n.useEffect(()=>{const t=new ResizeObserver(u=>{S(a||u[0].target.clientWidth||760),ce(m||u[0].target.clientHeight||480)});return o.current&&(ce(o.current.clientHeight||480),S(o.current.clientWidth||760),a||t.observe(o.current)),()=>t.disconnect()},[a,m]),n.useEffect(()=>{typeof c=="string"?Le.fetchAndParseJSON(c).then(u=>{x(u)}):x(c)},[c]),n.useEffect(()=>{const t=setInterval(()=>{W(u=>u<s.length-1?u+1:0)},(d.speed||2)*1e3);return L||clearInterval(t),()=>clearInterval(t)},[s,L,d.speed]);const i=fe.getSliderMarks(s,N,d.showOnlyActiveDate,d.dateFormat||"yyyy");return r.jsxRuntimeExports.jsx("div",{className:`${z||"light"} flex ${a?"w-fit grow-0":"w-full grow"}`,dir:F==="he"||F==="ar"?"rtl":void 0,children:r.jsxRuntimeExports.jsx("div",{className:r.mo(`${C?C===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${F||"en"}`,a?"w-fit":"w-full",b?.graphContainer),style:{...f?.graphContainer||{},...C&&C!==!0?{backgroundColor:C}:{}},id:y,ref:E,"aria-label":P||`${k?`The graph shows ${k}. `:""}This is a dot density map showing the distribution of a variable across a region or world, with each dot representing a data point.${v?` ${v}`:""}`,children:r.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:C?H||"1rem":H||0},children:r.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[k||v||ie||A?r.jsxRuntimeExports.jsx(Ie.GraphHeader,{styles:{title:f?.title,description:f?.description},classNames:{title:b?.title,description:b?.description},graphTitle:k,graphDescription:v,width:a,graphDownload:ie?E.current:void 0,dataDownload:A?l.map(t=>t.data).filter(t=>t!==void 0).length>0?l.map(t=>t.data).filter(t=>t!==void 0):l.filter(t=>t!==void 0):null}):null,d.enabled&&s.length>0&&i?r.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[r.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{ye(!L)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":L?"Click to pause animation":"Click to play animation",children:L?r.jsxRuntimeExports.jsx(ve.Pause,{}):r.jsxRuntimeExports.jsx(ve.Play,{})}),r.jsxRuntimeExports.jsx(fe.xr,{min:s[0],max:s[s.length-1],marks:i,step:null,defaultValue:s[s.length-1],value:s[N],onChangeComplete:t=>{W(s.indexOf(t))},onChange:t=>{W(s.indexOf(t))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,r.jsxRuntimeExports.jsx("div",{className:"flex flex-col grow justify-center leading-0",ref:o,"aria-label":"Map area",children:(a||p)&&(m||Y)&&e?r.jsxRuntimeExports.jsx(ze,{data:l.filter(t=>d.enabled?t.date===Ee.format(new Date(s[N]),d.dateFormat||"yyyy"):t),mapData:se?e:{...e,features:e.features.filter(t=>t.properties.NAME!=="Antarctica")},colorDomain:l.filter(t=>t.color).length===0?[]:Z||be.uniqBy(l.filter(t=>!we.checkIfNullOrUndefined(t.color)),"color").map(t=>`${t.color}`),width:a||p,height:Math.max(h,m||(g?h?(a||p)*g>h?(a||p)*g:h:(a||p)*g:Y)),scale:J,centerPoint:Q,colors:l.filter(t=>t.color).length===0?M?[M]:[R.Colors.primaryColors["blue-600"]]:M||R.Colors[z].categoricalColors.colors,colorLegendTitle:O,radius:pe,mapBorderWidth:ee,mapNoDataColor:xe,mapBorderColor:te,tooltip:B,onSeriesMouseOver:D,showLabels:he,isWorldMap:re,showColorScale:ge,zoomScaleExtend:T,zoomTranslateExtend:q,onSeriesMouseClick:ae,highlightedDataPoints:oe,resetSelectionOnDoubleClick:G,styles:f,classNames:b,zoomInteraction:le,detailsOnClick:ne,mapProjection:U||(re?"naturalEarth":"mercator"),animate:V===!0?{duration:.5,once:!0,amount:.5}:V||{duration:0,once:!0,amount:0},dimmedOpacity:I,customLayers:X,maxRadiusValue:we.checkIfNullOrUndefined(_)?Math.max(...l.map(t=>t.radius).filter(t=>t!=null)):_}):r.jsxRuntimeExports.jsx("div",{style:{height:`${Math.max(h,m||(g?h?(a||p)*g>h?(a||p)*g:h:(a||p)*g:Y))}px`},className:"flex items-center justify-center",children:r.jsxRuntimeExports.jsx(ke.y,{"aria-label":"Loading graph"})})}),j||K?r.jsxRuntimeExports.jsx(Pe.GraphFooter,{styles:{footnote:f?.footnote,source:f?.source},classNames:{footnote:b?.footnote,source:b?.source},sources:j,footNote:K,width:a}):null]})})})})}exports.DotDensityMap=Ve;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-CHPV5EwG-DDoeWRVt.cjs"),n=require("react"),be=require("./index-BJOeaYTk.cjs"),Ee=require("./parse-hMnG_lRV.cjs"),fe=require("./getSliderMarks-CtsEXiLV.cjs"),ke=require("./Spinner-DA6Z5E4n.cjs"),Ce=require("./index-DQA8q5sC.cjs"),L=require("./zoom-Bsbhil-K.cjs"),De=require("./Modal-tXZlLE5s.cjs"),Se=require("./Typography-k-kOjICQ.cjs"),Ne=require("./index-D05lK1Te.cjs"),$e=require("./Tooltip-De16GWhY.cjs"),R=require("./Colors.cjs"),Me=require("./string2HTML-z7CwHXcx.cjs"),ve=require("./index-BW_-wD2k.cjs"),qe=require("./pow-B5-jkdHU.cjs"),je=require("./select-Bnfk0lJx.cjs"),Oe=require("./use-in-view-sQJZ_xDO.cjs"),de=require("./proxy-BHRoeZgd.cjs"),Pe=require("./index-BW8iNx7E.cjs"),Ie=require("./GraphFooter.cjs"),Le=require("./GraphHeader.cjs"),Te=require("./fetchAndParseData-Dcy7AS_0.cjs"),we=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),ze=require("./init-DU0ybBc_.cjs");function Ve(me){const{data:l,colors:c,mapData:k,colorLegendTitle:$,colorDomain:j,radius:v,height:m,width:a,scale:K,centerPoint:M,tooltip:Z,showLabels:pe,mapBorderWidth:J,mapBorderColor:Q,mapNoDataColor:H,onSeriesMouseOver:ee,showColorScale:xe,zoomScaleExtend:C,zoomTranslateExtend:he,highlightedDataPoints:te,onSeriesMouseClick:B,resetSelectionOnDoubleClick:g,detailsOnClick:D,styles:re,classNames:ge,mapProjection:T,zoomInteraction:q,animate:y,dimmedOpacity:oe,customLayers:ae,maxRadiusValue:ie}=me,[A,se]=n.useState(void 0),[F,h]=n.useState(!(a<680)),z=n.useRef(null),[O,G]=n.useState(void 0),[ne,f]=n.useState(void 0),[b,U]=n.useState(void 0),[le,V]=n.useState(void 0),P=n.useRef(null),_=Oe.useInView(P,{once:y.once,amount:y.amount}),X=n.useRef(null),d=l.filter(e=>e.radius===void 0||e.radius===null).length!==l.length?qe.sqrt().domain([0,ie]).range([.25,v]).nice():void 0;n.useEffect(()=>{const e=je.select(X.current),x=je.select(P.current),o=i=>{if(q==="noZoom")return!1;if(q==="button")return!i.type.includes("wheel");const t=i.type==="wheel",u=i.type.startsWith("touch"),w=i.type==="mousedown"||i.type==="mousemove";return u?!0:t?q==="scroll"?!0:i.ctrlKey:w&&!i.button&&!i.ctrlKey},E=L.zoom().scaleExtent(C).translateExtent(he||[[-20,-20],[a+20,m+20]]).filter(o).on("zoom",({transform:i})=>{e.attr("transform",i)});x.call(E),z.current=E},[m,a,q]);const p=L.turf_bbox_default(k),S=Ne.turf_center_of_mass_default(k),Y=p[2]-p[0],ce=p[3]-p[1],I=a*190/960*360/Y,ye=m*190/678*180/ce,s=K*Math.min(I,ye),N=T==="mercator"?L.geoMercator().rotate([0,0]).center(M||S.geometry.coordinates).translate([a/2,m/2]).scale(s):T==="equalEarth"?L.geoEqualEarth().rotate([0,0]).center(M||S.geometry.coordinates).translate([a/2,m/2]).scale(s):T==="naturalEarth"?L.geoNaturalEarth1().rotate([0,0]).center(M||S.geometry.coordinates).translate([a/2,m/2]).scale(s):T==="orthographic"?L.geoOrthographic().rotate([0,0]).center(M||S.geometry.coordinates).translate([a/2,m/2]).scale(s):L.geoAlbersUsa().rotate([0,0]).center(M||S.geometry.coordinates).translate([a/2,m/2]).scale(s),W=e=>{if(!P.current||!z.current)return;je.select(P.current).call(z.current.scaleBy,e==="in"?1.2:1/1.2)};return r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsxs("div",{className:"relative",children:[r.jsxRuntimeExports.jsx(de.motion.svg,{width:`${a}px`,height:`${m}px`,viewBox:`0 0 ${a} ${m}`,ref:P,direction:"ltr",children:r.jsxRuntimeExports.jsxs("g",{ref:X,children:[ae.filter(e=>e.position==="before").map(e=>e.layer),k.features.map((e,x)=>r.jsxRuntimeExports.jsx("g",{children:e.geometry.type==="MultiPolygon"?e.geometry.coordinates.map((o,E)=>{let i="";return o.forEach(t=>{let u=" M";t.forEach((w,Re)=>{const ue=N([w[0],w[1]]);Re!==t.length-1?u=`${u}${ue[0]} ${ue[1]}L`:u=`${u}${ue[0]} ${ue[1]}`}),i+=u}),r.jsxRuntimeExports.jsx("path",{d:i,style:{stroke:Q,strokeWidth:J,fill:H}},E)}):e.geometry.coordinates.map((o,E)=>{let i="M";return o.forEach((t,u)=>{const w=N([t[0],t[1]]);u!==o.length-1?i=`${i}${w[0]} ${w[1]}L`:i=`${i}${w[0]} ${w[1]}`}),r.jsxRuntimeExports.jsx("path",{d:i,style:{stroke:Q,strokeWidth:J,fill:H}},E)})},x)),r.jsxRuntimeExports.jsx(Pe.AnimatePresence,{children:l.map(e=>{const x=l.filter(o=>o.color).length===0?c[0]:e.color?c[j.indexOf(`${e.color}`)]:R.Colors.gray;return r.jsxRuntimeExports.jsxs(de.motion.g,{variants:{initial:{opacity:0},whileInView:{opacity:A?A===x?1:oe:te.length!==0?te.indexOf(e.label||"")!==-1?1:oe:1,transition:{duration:y.duration}}},initial:"initial",animate:_?"whileInView":"initial",exit:{opacity:0,transition:{duration:y.duration}},onMouseEnter:o=>{f(e),V(o.clientY),U(o.clientX),ee?.(e)},onMouseMove:o=>{f(e),V(o.clientY),U(o.clientX)},onMouseLeave:()=>{f(void 0),U(void 0),V(void 0),ee?.(void 0)},onClick:()=>{(B||D)&&(Ce.isEqual(O,e)&&g?(G(void 0),B?.(void 0)):(G(e),B?.(e)))},transform:`translate(${N([e.long,e.lat])[0]},${N([e.long,e.lat])[1]})`,children:[r.jsxRuntimeExports.jsx(de.motion.circle,{cx:0,cy:0,variants:{initial:{r:0,fill:l.filter(o=>o.color).length===0?c[0]:e.color?c[j.indexOf(`${e.color}`)]:R.Colors.gray,stroke:l.filter(o=>o.color).length===0?c[0]:e.color?c[j.indexOf(`${e.color}`)]:R.Colors.gray},whileInView:{r:d?d(e.radius||0):v,fill:l.filter(o=>o.color).length===0?c[0]:e.color?c[j.indexOf(`${e.color}`)]:R.Colors.gray,stroke:l.filter(o=>o.color).length===0?c[0]:e.color?c[j.indexOf(`${e.color}`)]:R.Colors.gray,transition:{duration:y.duration}}},initial:"initial",animate:_?"whileInView":"initial",exit:{r:0,transition:{duration:y.duration}},style:{fillOpacity:.8}}),pe&&e.label?r.jsxRuntimeExports.jsx(de.motion.text,{variants:{initial:{opacity:0,x:d?d(e.radius||0):v},whileInView:{opacity:1,x:d?d(e.radius||0):v,transition:{duration:y.duration}}},initial:"initial",animate:_?"whileInView":"initial",exit:{opacity:0,transition:{duration:y.duration}},y:0,className:"fill-primary-gray-600 dark:fill-primary-gray-300 text-sm",style:{textAnchor:"start"},dx:4,dy:5,children:e.label}):null]},e.label||`${e.lat}-${e.long}`)})}),ae.filter(e=>e.position==="after").map(e=>e.layer)]})}),l.filter(e=>e.color).length===0||xe===!1?null:r.jsxRuntimeExports.jsx("div",{className:"absolute left-4 bottom-4",children:F?r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsx("div",{style:{backgroundColor:"rgba(240,240,240, 0.7)",border:"1px solid var(--gray-400)",borderRadius:"999px",width:"24px",height:"24px",padding:"3px",cursor:"pointer",zIndex:10,position:"absolute",right:"-0.75rem",top:"-0.75rem"},onClick:()=>{h(!1)},children:r.jsxRuntimeExports.jsx(ve.X,{})}),r.jsxRuntimeExports.jsxs("div",{className:"p-2",style:{backgroundColor:"rgba(240,240,240, 0.7)"},children:[$&&$!==""?r.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,r.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-3",children:j.map((e,x)=>r.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 items-center",onMouseOver:()=>{se(c[x%c.length])},onMouseLeave:()=>{se(void 0)},children:[r.jsxRuntimeExports.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:c[x%c.length]}}),r.jsxRuntimeExports.jsx(Se.u,{size:"sm",marginBottom:"none",leading:"none",children:e})]},x))})]})]}):r.jsxRuntimeExports.jsx("button",{type:"button",className:"mb-0 border-0 bg-transparent p-0 self-start",onClick:()=>{h(!0)},children:r.jsxRuntimeExports.jsx("div",{className:"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-550 border-primary-gray-400 dark:border-primary-gray-500",children:"Show Legend"})})}),q==="button"&&r.jsxRuntimeExports.jsxs("div",{className:"absolute left-4 top-4 flex flex-col",children:[r.jsxRuntimeExports.jsx("button",{onClick:()=>W("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-400 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"+"}),r.jsxRuntimeExports.jsx("button",{onClick:()=>W("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-400 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"–"})]})]}),D&&O!==void 0?r.jsxRuntimeExports.jsx(De.X,{open:O!==void 0,onClose:()=>{G(void 0)},children:r.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof D=="string"?{__html:Me.string2HTML(D,O)}:void 0,children:typeof D=="function"?D(O):null})}):null,ne&&Z&&b&&le?r.jsxRuntimeExports.jsx($e.Tooltip,{data:ne,body:Z,xPos:b,yPos:le,backgroundStyle:re?.tooltip,className:ge?.tooltip}):null]})}function We(me){const{data:l,mapData:c="https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap.json",graphTitle:k,colors:$,sources:j,graphDescription:v,height:m,width:a,footNote:K="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.",colorLegendTitle:M,colorDomain:Z,radius:pe=5,scale:J=.95,centerPoint:Q,padding:H,mapBorderWidth:ee=.5,mapNoDataColor:xe=R.Colors.light.graphNoData,backgroundColor:C=!1,showLabels:he=!1,mapBorderColor:te=R.Colors.light.grays["gray-500"],tooltip:B,relativeHeight:g,onSeriesMouseOver:D,isWorldMap:re=!0,showColorScale:ge=!0,zoomScaleExtend:T=[.8,6],zoomTranslateExtend:q,graphID:y,highlightedDataPoints:oe=[],onSeriesMouseClick:ae,graphDownload:ie=!1,dataDownload:A=!1,showAntarctica:se=!1,language:F="en",minHeight:h=0,theme:z="light",ariaLabel:O,resetSelectionOnDoubleClick:G=!0,detailsOnClick:ne,styles:f,classNames:b,mapProjection:U,zoomInteraction:le="button",animate:V=!1,dimmedOpacity:P=.3,customLayers:_=[],maxRadiusValue:X,timeline:d={enabled:!1,autoplay:!1,showOnlyActiveDate:!0}}=me,[p,S]=n.useState(0),[Y,ce]=n.useState(0),[I,ye]=n.useState(d.autoplay),s=fe.sort(be.uniqBy(l.filter(t=>t.date!==void 0&&t.date!==null),t=>t.date).map(t=>Ee.parse(`${t.date}`,d.dateFormat||"yyyy",new Date).getTime()),(t,u)=>ze.ascending(t,u)),[N,W]=n.useState(d.autoplay?0:s.length-1),[e,x]=n.useState(void 0),o=n.useRef(null),E=n.useRef(null);n.useEffect(()=>{const t=new ResizeObserver(u=>{S(a||u[0].target.clientWidth||760),ce(m||u[0].target.clientHeight||480)});return o.current&&(ce(o.current.clientHeight||480),S(o.current.clientWidth||760),a||t.observe(o.current)),()=>t.disconnect()},[a,m]),n.useEffect(()=>{typeof c=="string"?Te.fetchAndParseJSON(c).then(u=>{x(u)}):x(c)},[c]),n.useEffect(()=>{const t=setInterval(()=>{W(u=>u<s.length-1?u+1:0)},(d.speed||2)*1e3);return I||clearInterval(t),()=>clearInterval(t)},[s,I,d.speed]);const i=fe.getSliderMarks(s,N,d.showOnlyActiveDate,d.dateFormat||"yyyy");return r.jsxRuntimeExports.jsx("div",{className:`${z||"light"} flex ${a?"w-fit grow-0":"w-full grow"}`,dir:F==="he"||F==="ar"?"rtl":void 0,children:r.jsxRuntimeExports.jsx("div",{className:r.mo(`${C?C===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${F||"en"}`,a?"w-fit":"w-full",b?.graphContainer),style:{...f?.graphContainer||{},...C&&C!==!0?{backgroundColor:C}:{}},id:y,ref:E,"aria-label":O||`${k?`The graph shows ${k}. `:""}This is a dot density map showing the distribution of a variable across a region or world, with each dot representing a data point.${v?` ${v}`:""}`,children:r.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:C?H||"1rem":H||0},children:r.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[k||v||ie||A?r.jsxRuntimeExports.jsx(Le.GraphHeader,{styles:{title:f?.title,description:f?.description},classNames:{title:b?.title,description:b?.description},graphTitle:k,graphDescription:v,width:a,graphDownload:ie?E.current:void 0,dataDownload:A?l.map(t=>t.data).filter(t=>t!==void 0).length>0?l.map(t=>t.data).filter(t=>t!==void 0):l.filter(t=>t!==void 0):null}):null,d.enabled&&s.length>0&&i?r.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[r.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{ye(!I)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":I?"Click to pause animation":"Click to play animation",children:I?r.jsxRuntimeExports.jsx(ve.Pause,{}):r.jsxRuntimeExports.jsx(ve.Play,{})}),r.jsxRuntimeExports.jsx(fe.xr,{min:s[0],max:s[s.length-1],marks:i,step:null,defaultValue:s[s.length-1],value:s[N],onChangeComplete:t=>{W(s.indexOf(t))},onChange:t=>{W(s.indexOf(t))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,r.jsxRuntimeExports.jsx("div",{className:"flex flex-col grow justify-center leading-0",ref:o,"aria-label":"Map area",children:(a||p)&&(m||Y)&&e?r.jsxRuntimeExports.jsx(Ve,{data:l.filter(t=>d.enabled?t.date===Ee.format(new Date(s[N]),d.dateFormat||"yyyy"):t),mapData:se?e:{...e,features:e.features.filter(t=>t.properties.NAME!=="Antarctica")},colorDomain:l.filter(t=>t.color).length===0?[]:Z||be.uniqBy(l.filter(t=>!we.checkIfNullOrUndefined(t.color)),"color").map(t=>`${t.color}`),width:a||p,height:Math.max(h,m||(g?h?(a||p)*g>h?(a||p)*g:h:(a||p)*g:Y)),scale:J,centerPoint:Q,colors:l.filter(t=>t.color).length===0?$?[$]:[R.Colors.primaryColors["blue-600"]]:$||R.Colors[z].categoricalColors.colors,colorLegendTitle:M,radius:pe,mapBorderWidth:ee,mapNoDataColor:xe,mapBorderColor:te,tooltip:B,onSeriesMouseOver:D,showLabels:he,isWorldMap:re,showColorScale:ge,zoomScaleExtend:T,zoomTranslateExtend:q,onSeriesMouseClick:ae,highlightedDataPoints:oe,resetSelectionOnDoubleClick:G,styles:f,classNames:b,zoomInteraction:le,detailsOnClick:ne,mapProjection:U||(re?"naturalEarth":"mercator"),animate:V===!0?{duration:.5,once:!0,amount:.5}:V||{duration:0,once:!0,amount:0},dimmedOpacity:P,customLayers:_,maxRadiusValue:we.checkIfNullOrUndefined(X)?Math.max(...l.map(t=>t.radius).filter(t=>t!=null)):X}):r.jsxRuntimeExports.jsx("div",{style:{height:`${Math.max(h,m||(g?h?(a||p)*g>h?(a||p)*g:h:(a||p)*g:Y))}px`},className:"flex items-center justify-center",children:r.jsxRuntimeExports.jsx(ke.y,{"aria-label":"Loading graph"})})}),j||K?r.jsxRuntimeExports.jsx(Ie.GraphFooter,{styles:{footnote:f?.footnote,source:f?.source},classNames:{footnote:b?.footnote,source:b?.source},sources:j,footNote:K,width:a}):null]})})})})}exports.DotDensityMap=We;
2
2
  //# sourceMappingURL=DotDensityMap.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"DotDensityMap.cjs","sources":["../src/Components/Graphs/Maps/DotDensityMap/Graph.tsx","../src/Components/Graphs/Maps/DotDensityMap/index.tsx"],"sourcesContent":["import isEqual from 'fast-deep-equal';\r\nimport { useEffect, useRef, useState } from 'react';\r\nimport {\r\n geoAlbersUsa,\r\n geoEqualEarth,\r\n geoMercator,\r\n geoNaturalEarth1,\r\n geoOrthographic,\r\n} from 'd3-geo';\r\nimport { D3ZoomEvent, zoom, ZoomBehavior } from 'd3-zoom';\r\nimport { select } from 'd3-selection';\r\nimport { scaleSqrt } from 'd3-scale';\r\nimport { Modal } from '@undp/design-system-react/Modal';\r\nimport { P } from '@undp/design-system-react/Typography';\r\nimport bbox from '@turf/bbox';\r\nimport centroid from '@turf/centroid';\r\nimport { AnimatePresence, motion, useInView } from 'motion/react';\r\n\r\nimport {\r\n AnimateDataType,\r\n ClassNameObject,\r\n CustomLayerDataType,\r\n DotDensityMapDataType,\r\n MapProjectionTypes,\r\n StyleObject,\r\n ZoomInteractionTypes,\r\n} from '@/Types';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { string2HTML } from '@/Utils/string2HTML';\r\nimport { X } from '@/Components/Icons';\r\n\r\ninterface Props {\r\n data: DotDensityMapDataType[];\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapData: any;\r\n colorDomain: string[];\r\n width: number;\r\n height: number;\r\n scale: number;\r\n centerPoint?: [number, number];\r\n colors: string[];\r\n colorLegendTitle?: string;\r\n radius: number;\r\n mapBorderWidth: number;\r\n mapNoDataColor: string;\r\n showLabels: boolean;\r\n mapBorderColor: string;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n isWorldMap: boolean;\r\n showColorScale: boolean;\r\n zoomScaleExtend: [number, number];\r\n zoomTranslateExtend?: [[number, number], [number, number]];\r\n highlightedDataPoints: (string | number)[];\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n resetSelectionOnDoubleClick: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n zoomInteraction: ZoomInteractionTypes;\r\n mapProjection: MapProjectionTypes;\r\n animate: AnimateDataType;\r\n dimmedOpacity: number;\r\n customLayers: CustomLayerDataType[];\r\n maxRadiusValue: number;\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n const {\r\n data,\r\n colors,\r\n mapData,\r\n colorLegendTitle,\r\n colorDomain,\r\n radius,\r\n height,\r\n width,\r\n scale,\r\n centerPoint,\r\n tooltip,\r\n showLabels,\r\n mapBorderWidth,\r\n mapBorderColor,\r\n mapNoDataColor,\r\n onSeriesMouseOver,\r\n showColorScale,\r\n zoomScaleExtend,\r\n zoomTranslateExtend,\r\n highlightedDataPoints,\r\n onSeriesMouseClick,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n mapProjection,\r\n zoomInteraction,\r\n animate,\r\n dimmedOpacity,\r\n customLayers,\r\n maxRadiusValue,\r\n } = props;\r\n const [selectedColor, setSelectedColor] = useState<string | undefined>(undefined);\r\n const [showLegend, setShowLegend] = useState(!(width < 680));\r\n const zoomRef = useRef<ZoomBehavior<SVGSVGElement, unknown> | null>(null);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseClickData, setMouseClickData] = useState<any>(undefined);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseOverData, setMouseOverData] = useState<any>(undefined);\r\n const [eventX, setEventX] = useState<number | undefined>(undefined);\r\n const [eventY, setEventY] = useState<number | undefined>(undefined);\r\n const mapSvg = useRef<SVGSVGElement>(null);\r\n const isInView = useInView(mapSvg, {\r\n once: animate.once,\r\n amount: animate.amount,\r\n });\r\n const mapG = useRef<SVGGElement>(null);\r\n const radiusScale =\r\n data.filter(d => d.radius === undefined || d.radius === null).length !== data.length\r\n ? scaleSqrt().domain([0, maxRadiusValue]).range([0.25, radius]).nice()\r\n : undefined;\r\n\r\n useEffect(() => {\r\n const mapGSelect = select(mapG.current);\r\n const mapSvgSelect = select(mapSvg.current);\r\n const zoomFilter = (e: D3ZoomEvent<SVGSVGElement, unknown>['sourceEvent']) => {\r\n if (zoomInteraction === 'noZoom') return false;\r\n if (zoomInteraction === 'button') return !e.type.includes('wheel');\r\n const isWheel = e.type === 'wheel';\r\n const isTouch = e.type.startsWith('touch');\r\n const isDrag = e.type === 'mousedown' || e.type === 'mousemove';\r\n\r\n if (isTouch) return true;\r\n if (isWheel) {\r\n if (zoomInteraction === 'scroll') return true;\r\n return e.ctrlKey;\r\n }\r\n return isDrag && !e.button && !e.ctrlKey;\r\n };\r\n const zoomBehavior = zoom<SVGSVGElement, unknown>()\r\n .scaleExtent(zoomScaleExtend)\r\n .translateExtent(\r\n zoomTranslateExtend || [\r\n [-20, -20],\r\n [width + 20, height + 20],\r\n ],\r\n )\r\n .filter(zoomFilter)\r\n .on('zoom', ({ transform }) => {\r\n mapGSelect.attr('transform', transform);\r\n });\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapSvgSelect.call(zoomBehavior as any);\r\n\r\n zoomRef.current = zoomBehavior;\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [height, width, zoomInteraction]);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const bounds = bbox(mapData as any);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const center = centroid(mapData as any);\r\n const lonDiff = bounds[2] - bounds[0];\r\n const latDiff = bounds[3] - bounds[1];\r\n const scaleX = (((width * 190) / 960) * 360) / lonDiff;\r\n const scaleY = (((height * 190) / 678) * 180) / latDiff;\r\n const scaleVar = scale * Math.min(scaleX, scaleY);\r\n\r\n const projection =\r\n mapProjection === 'mercator'\r\n ? geoMercator()\r\n .rotate([0, 0])\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'equalEarth'\r\n ? geoEqualEarth()\r\n .rotate([0, 0])\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'naturalEarth'\r\n ? geoNaturalEarth1()\r\n .rotate([0, 0])\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'orthographic'\r\n ? geoOrthographic()\r\n .rotate([0, 0])\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : geoAlbersUsa()\r\n .rotate([0, 0])\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar);\r\n\r\n const handleZoom = (direction: 'in' | 'out') => {\r\n if (!mapSvg.current || !zoomRef.current) return;\r\n const svg = select(mapSvg.current);\r\n svg.call(zoomRef.current.scaleBy, direction === 'in' ? 1.2 : 1 / 1.2);\r\n };\r\n\r\n return (\r\n <>\r\n <div className='relative'>\r\n <motion.svg\r\n width={`${width}px`}\r\n height={`${height}px`}\r\n viewBox={`0 0 ${width} ${height}`}\r\n ref={mapSvg}\r\n direction='ltr'\r\n >\r\n <g ref={mapG}>\r\n {customLayers.filter(d => d.position === 'before').map(d => d.layer)}\r\n {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapData.features.map((d: any, i: number) => {\r\n return (\r\n <g key={i}>\r\n {d.geometry.type === 'MultiPolygon'\r\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n d.geometry.coordinates.map((el: any, j: any) => {\r\n let masterPath = '';\r\n el.forEach((geo: number[][]) => {\r\n let path = ' M';\r\n geo.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== geo.length - 1) path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n masterPath += path;\r\n });\r\n return (\r\n <path\r\n key={j}\r\n d={masterPath}\r\n style={{\r\n stroke: mapBorderColor,\r\n strokeWidth: mapBorderWidth,\r\n fill: mapNoDataColor,\r\n }}\r\n />\r\n );\r\n })\r\n : // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n d.geometry.coordinates.map((el: any, j: number) => {\r\n let path = 'M';\r\n el.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== el.length - 1) path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n return (\r\n <path\r\n key={j}\r\n d={path}\r\n style={{\r\n stroke: mapBorderColor,\r\n strokeWidth: mapBorderWidth,\r\n fill: mapNoDataColor,\r\n }}\r\n />\r\n );\r\n })}\r\n </g>\r\n );\r\n })\r\n }\r\n <AnimatePresence>\r\n {data.map(d => {\r\n const color =\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)];\r\n return (\r\n <motion.g\r\n key={d.label || `${d.lat}-${d.long}`}\r\n variants={{\r\n initial: { opacity: 0 },\r\n whileInView: {\r\n opacity: selectedColor\r\n ? selectedColor === color\r\n ? 1\r\n : dimmedOpacity\r\n : highlightedDataPoints.length !== 0\r\n ? highlightedDataPoints.indexOf(d.label || '') !== -1\r\n ? 1\r\n : dimmedOpacity\r\n : 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n onMouseEnter={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n onSeriesMouseOver?.(d);\r\n }}\r\n onMouseMove={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n }}\r\n onMouseLeave={() => {\r\n setMouseOverData(undefined);\r\n setEventX(undefined);\r\n setEventY(undefined);\r\n onSeriesMouseOver?.(undefined);\r\n }}\r\n onClick={() => {\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (isEqual(mouseClickData, d) && resetSelectionOnDoubleClick) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(d);\r\n onSeriesMouseClick?.(d);\r\n }\r\n }\r\n }}\r\n transform={`translate(${\r\n (projection([d.long, d.lat]) as [number, number])[0]\r\n },${(projection([d.long, d.lat]) as [number, number])[1]})`}\r\n >\r\n <motion.circle\r\n cx={0}\r\n cy={0}\r\n variants={{\r\n initial: {\r\n r: 0,\r\n fill:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n stroke:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n },\r\n whileInView: {\r\n r: !radiusScale ? radius : radiusScale(d.radius || 0),\r\n fill:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n stroke:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ r: 0, transition: { duration: animate.duration } }}\r\n style={{\r\n fillOpacity: 0.8,\r\n }}\r\n />\r\n {showLabels && d.label ? (\r\n <motion.text\r\n variants={{\r\n initial: {\r\n opacity: 0,\r\n x: !radiusScale ? radius : radiusScale(d.radius || 0),\r\n },\r\n whileInView: {\r\n opacity: 1,\r\n x: !radiusScale ? radius : radiusScale(d.radius || 0),\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n y={0}\r\n className='fill-primary-gray-600 dark:fill-primary-gray-300 text-sm'\r\n style={{ textAnchor: 'start' }}\r\n dx={4}\r\n dy={5}\r\n >\r\n {d.label}\r\n </motion.text>\r\n ) : null}\r\n </motion.g>\r\n );\r\n })}\r\n </AnimatePresence>\r\n {customLayers.filter(d => d.position === 'after').map(d => d.layer)}\r\n </g>\r\n </motion.svg>\r\n {data.filter(el => el.color).length === 0 || showColorScale === false ? null : (\r\n <div className='absolute left-4 bottom-4'>\r\n {showLegend ? (\r\n <>\r\n <div\r\n style={{\r\n backgroundColor: 'rgba(240,240,240, 0.7)',\r\n border: '1px solid var(--gray-400)',\r\n borderRadius: '999px',\r\n width: '24px',\r\n height: '24px',\r\n padding: '3px',\r\n cursor: 'pointer',\r\n zIndex: 10,\r\n position: 'absolute',\r\n right: '-0.75rem',\r\n top: '-0.75rem',\r\n }}\r\n onClick={() => {\r\n setShowLegend(false);\r\n }}\r\n >\r\n <X />\r\n </div>\r\n <div className='p-2' style={{ backgroundColor: 'rgba(240,240,240, 0.7)' }}>\r\n {colorLegendTitle && colorLegendTitle !== '' ? (\r\n <p\r\n className='p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300'\r\n style={{\r\n display: '-webkit-box',\r\n WebkitLineClamp: '1',\r\n WebkitBoxOrient: 'vertical',\r\n }}\r\n >\r\n {colorLegendTitle}\r\n </p>\r\n ) : null}\r\n <div className='flex flex-col gap-3'>\r\n {colorDomain.map((d, i) => (\r\n <div\r\n key={i}\r\n className='flex gap-2 items-center'\r\n onMouseOver={() => {\r\n setSelectedColor(colors[i % colors.length]);\r\n }}\r\n onMouseLeave={() => {\r\n setSelectedColor(undefined);\r\n }}\r\n >\r\n <div\r\n className='w-2 h-2 rounded-full'\r\n style={{ backgroundColor: colors[i % colors.length] }}\r\n />\r\n <P size='sm' marginBottom='none' leading='none'>\r\n {d}\r\n </P>\r\n </div>\r\n ))}\r\n </div>\r\n </div>\r\n </>\r\n ) : (\r\n <button\r\n type='button'\r\n className='mb-0 border-0 bg-transparent p-0 self-start'\r\n onClick={() => {\r\n setShowLegend(true);\r\n }}\r\n >\r\n <div className='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-550 border-primary-gray-400 dark:border-primary-gray-500'>\r\n Show Legend\r\n </div>\r\n </button>\r\n )}\r\n </div>\r\n )}\r\n {zoomInteraction === 'button' && (\r\n <div className='absolute left-4 top-4 flex flex-col'>\r\n <button\r\n onClick={() => handleZoom('in')}\r\n className='leading-0 px-2 py-3.5 text-primary-gray-700 border border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-400 dark:bg-primary-gray-600 dark:text-primary-gray-100'\r\n >\r\n +\r\n </button>\r\n <button\r\n onClick={() => handleZoom('out')}\r\n className='leading-0 px-2 py-3.5 text-primary-gray-700 border border-t-0 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-400 dark:bg-primary-gray-600 dark:text-primary-gray-100'\r\n >\r\n –\r\n </button>\r\n </div>\r\n )}\r\n </div>\r\n {detailsOnClick && mouseClickData !== undefined ? (\r\n <Modal\r\n open={mouseClickData !== undefined}\r\n onClose={() => {\r\n setMouseClickData(undefined);\r\n }}\r\n >\r\n <div\r\n className='graph-modal-content m-0'\r\n dangerouslySetInnerHTML={\r\n typeof detailsOnClick === 'string'\r\n ? { __html: string2HTML(detailsOnClick, mouseClickData) }\r\n : undefined\r\n }\r\n >\r\n {typeof detailsOnClick === 'function' ? detailsOnClick(mouseClickData) : null}\r\n </div>\r\n </Modal>\r\n ) : null}\r\n {mouseOverData && tooltip && eventX && eventY ? (\r\n <Tooltip\r\n data={mouseOverData}\r\n body={tooltip}\r\n xPos={eventX}\r\n yPos={eventY}\r\n backgroundStyle={styles?.tooltip}\r\n className={classNames?.tooltip}\r\n />\r\n ) : null}\r\n </>\r\n );\r\n}\r\n","import { useState, useRef, useEffect } from 'react';\r\nimport uniqBy from 'lodash.uniqby';\r\nimport { format } from 'date-fns/format';\r\nimport { parse } from 'date-fns/parse';\r\nimport { cn } from '@undp/design-system-react/cn';\r\nimport { SliderUI } from '@undp/design-system-react/SliderUI';\r\nimport { Spinner } from '@undp/design-system-react/Spinner';\r\nimport { ascending, sort } from 'd3-array';\r\n\r\nimport { Graph } from './Graph';\r\n\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport {\r\n DotDensityMapDataType,\r\n Languages,\r\n SourcesDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n ZoomInteractionTypes,\r\n MapProjectionTypes,\r\n CustomLayerDataType,\r\n AnimateDataType,\r\n TimelineDataType,\r\n} from '@/Types';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { fetchAndParseJSON } from '@/Utils/fetchAndParseData';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { Pause, Play } from '@/Components/Icons';\r\nimport { getSliderMarks } from '@/Utils/getSliderMarks';\r\n\r\ninterface Props {\r\n // Data\r\n /** Array of data objects */\r\n data: DotDensityMapDataType[];\r\n // Titles, Labels, and Sources\r\n /** Title of the graph */\r\n graphTitle?: string | React.ReactNode;\r\n /** Description of the graph */\r\n graphDescription?: string | React.ReactNode;\r\n /** Footnote for the graph */\r\n footNote?: string | React.ReactNode;\r\n /** Source data for the graph */\r\n sources?: SourcesDataType[];\r\n /** Accessibility label */\r\n ariaLabel?: string;\r\n\r\n // Colors and Styling\r\n /** Color or array of colors for the circle */\r\n colors?: string | string[];\r\n /** Domain of colors for the graph */\r\n colorDomain: string[];\r\n /** Title for the color legend */\r\n colorLegendTitle?: string;\r\n /** Color for the areas where data is no available */\r\n mapNoDataColor?: string;\r\n /** Background color of the graph */\r\n backgroundColor?: string | boolean;\r\n /** Custom styles for the graph. Each object should be a valid React CSS style object. */\r\n styles?: StyleObject;\r\n /** Custom class names */\r\n classNames?: ClassNameObject;\r\n\r\n // Size and Spacing\r\n /** Width of the graph */\r\n width?: number;\r\n /** Height of the graph */\r\n height?: number;\r\n /** Minimum height of the graph */\r\n minHeight?: number;\r\n /** Relative height scaling factor. This overwrites the height props */\r\n relativeHeight?: number;\r\n /** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */\r\n padding?: string;\r\n\r\n // Graph Parameters\r\n /** Maximum radius of the circle */\r\n radius?: number;\r\n /** Map data as an object in geoJson format or a url for geoJson */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapData?: any;\r\n /** Scaling factor for the map. Multiplies the scale number to scale. */\r\n scale?: number;\r\n /** Center point of the map */\r\n centerPoint?: [number, number];\r\n /** Defines the zoom mode for the map */\r\n zoomInteraction?: ZoomInteractionTypes;\r\n /** Stroke width of the regions in the map */\r\n mapBorderWidth?: number;\r\n /** Stroke color of the regions in the map */\r\n mapBorderColor?: string;\r\n /** Toggle if the map is a world map */\r\n isWorldMap?: boolean;\r\n /** Map projection type */\r\n mapProjection?: MapProjectionTypes;\r\n /** Extend of the allowed zoom in the map */\r\n zoomScaleExtend?: [number, number];\r\n /** Extend of the allowed panning in the map */\r\n zoomTranslateExtend?: [[number, number], [number, number]];\r\n /** Toggle visibility of labels */\r\n showLabels?: boolean;\r\n /** Maximum value mapped to the radius chart */\r\n maxRadiusValue?: number;\r\n /** Data points to highlight. Use the label value from data to highlight the data point */\r\n highlightedDataPoints?: (string | number)[];\r\n /** Defines the opacity of the non-highlighted data */\r\n dimmedOpacity?: number;\r\n /** Toggles if the graph animates in when loaded. */\r\n animate?: boolean | AnimateDataType;\r\n /** Toggle visibility of color scale. This is only applicable if the data props hae color parameter */\r\n showColorScale?: boolean;\r\n /** Toggles the visibility of Antarctica in the default map. Only applicable for the default map. */\r\n showAntarctica?: boolean;\r\n /** Optional SVG <g> element or function that renders custom content behind or in front of the graph. */\r\n customLayers?: CustomLayerDataType[];\r\n /** Configures playback and slider controls for animating the chart over time. The data must have a key date for it to work properly. */\r\n timeline?: TimelineDataType;\r\n /** Enable graph download option as png */\r\n graphDownload?: boolean;\r\n /** Enable data download option as a csv */\r\n dataDownload?: boolean;\r\n /** Reset selection on double-click. Only applicable when used in a dashboard context with filters. */\r\n resetSelectionOnDoubleClick?: boolean;\r\n\r\n // Interactions and Callbacks\r\n /** Tooltip content. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n /** Details displayed on the modal when user clicks of a data point. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n /** Callback for mouse over event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n /** Callback for mouse click event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n\r\n // Configuration and Options\r\n /** Language setting */\r\n language?: Languages;\r\n /** Color theme */\r\n theme?: 'light' | 'dark';\r\n /** Unique ID for the graph */\r\n graphID?: string;\r\n}\r\n\r\nexport function DotDensityMap(props: Props) {\r\n const {\r\n data,\r\n mapData = 'https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap.json',\r\n graphTitle,\r\n colors,\r\n sources,\r\n graphDescription,\r\n height,\r\n width,\r\n footNote = 'The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.',\r\n colorLegendTitle,\r\n colorDomain,\r\n radius = 5,\r\n scale = 0.95,\r\n centerPoint,\r\n padding,\r\n mapBorderWidth = 0.5,\r\n mapNoDataColor = Colors.light.graphNoData,\r\n backgroundColor = false,\r\n showLabels = false,\r\n mapBorderColor = Colors.light.grays['gray-500'],\r\n tooltip,\r\n relativeHeight,\r\n onSeriesMouseOver,\r\n isWorldMap = true,\r\n showColorScale = true,\r\n zoomScaleExtend = [0.8, 6],\r\n zoomTranslateExtend,\r\n graphID,\r\n highlightedDataPoints = [],\r\n onSeriesMouseClick,\r\n graphDownload = false,\r\n dataDownload = false,\r\n showAntarctica = false,\r\n language = 'en',\r\n minHeight = 0,\r\n theme = 'light',\r\n ariaLabel,\r\n resetSelectionOnDoubleClick = true,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n mapProjection,\r\n zoomInteraction = 'button',\r\n animate = false,\r\n dimmedOpacity = 0.3,\r\n customLayers = [],\r\n maxRadiusValue,\r\n timeline = { enabled: false, autoplay: false, showOnlyActiveDate: true },\r\n } = props;\r\n\r\n const [svgWidth, setSvgWidth] = useState(0);\r\n const [svgHeight, setSvgHeight] = useState(0);\r\n const [play, setPlay] = useState(timeline.autoplay);\r\n const uniqDatesSorted = sort(\r\n uniqBy(\r\n data.filter(d => d.date !== undefined && d.date !== null),\r\n d => d.date,\r\n ).map(d => parse(`${d.date}`, timeline.dateFormat || 'yyyy', new Date()).getTime()),\r\n (a, b) => ascending(a, b),\r\n );\r\n const [index, setIndex] = useState(timeline.autoplay ? 0 : uniqDatesSorted.length - 1);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mapShape, setMapShape] = useState<any>(undefined);\r\n\r\n const graphDiv = useRef<HTMLDivElement>(null);\r\n const graphParentDiv = useRef<HTMLDivElement>(null);\r\n useEffect(() => {\r\n const resizeObserver = new ResizeObserver(entries => {\r\n setSvgWidth(width || entries[0].target.clientWidth || 760);\r\n setSvgHeight(height || entries[0].target.clientHeight || 480);\r\n });\r\n if (graphDiv.current) {\r\n setSvgHeight(graphDiv.current.clientHeight || 480);\r\n setSvgWidth(graphDiv.current.clientWidth || 760);\r\n if (!width) resizeObserver.observe(graphDiv.current);\r\n }\r\n return () => resizeObserver.disconnect();\r\n }, [width, height]);\r\n useEffect(() => {\r\n if (typeof mapData === 'string') {\r\n const fetchData = fetchAndParseJSON(mapData);\r\n fetchData.then(d => {\r\n setMapShape(d);\r\n });\r\n } else {\r\n setMapShape(mapData);\r\n }\r\n }, [mapData]);\r\n\r\n useEffect(() => {\r\n const interval = setInterval(\r\n () => {\r\n setIndex(i => (i < uniqDatesSorted.length - 1 ? i + 1 : 0));\r\n },\r\n (timeline.speed || 2) * 1000,\r\n );\r\n if (!play) clearInterval(interval);\r\n return () => clearInterval(interval);\r\n }, [uniqDatesSorted, play, timeline.speed]);\r\n\r\n const markObj = getSliderMarks(\r\n uniqDatesSorted,\r\n index,\r\n timeline.showOnlyActiveDate,\r\n timeline.dateFormat || 'yyyy',\r\n );\r\n return (\r\n <div\r\n className={`${theme || 'light'} flex ${width ? 'w-fit grow-0' : 'w-full grow'}`}\r\n dir={language === 'he' || language === 'ar' ? 'rtl' : undefined}\r\n >\r\n <div\r\n className={cn(\r\n `${\r\n !backgroundColor\r\n ? 'bg-transparent '\r\n : backgroundColor === true\r\n ? 'bg-primary-gray-200 dark:bg-primary-gray-650 '\r\n : ''\r\n }ml-auto mr-auto flex flex-col grow h-inherit ${language || 'en'}`,\r\n width ? 'w-fit' : 'w-full',\r\n classNames?.graphContainer,\r\n )}\r\n style={{\r\n ...(styles?.graphContainer || {}),\r\n ...(backgroundColor && backgroundColor !== true ? { backgroundColor } : {}),\r\n }}\r\n id={graphID}\r\n ref={graphParentDiv}\r\n aria-label={\r\n ariaLabel ||\r\n `${\r\n graphTitle ? `The graph shows ${graphTitle}. ` : ''\r\n }This is a dot density map showing the distribution of a variable across a region or world, with each dot representing a data point.${\r\n graphDescription ? ` ${graphDescription}` : ''\r\n }`\r\n }\r\n >\r\n <div\r\n className='flex grow'\r\n style={{ padding: backgroundColor ? padding || '1rem' : padding || 0 }}\r\n >\r\n <div className='flex flex-col w-full gap-4 grow justify-between'>\r\n {graphTitle || graphDescription || graphDownload || dataDownload ? (\r\n <GraphHeader\r\n styles={{\r\n title: styles?.title,\r\n description: styles?.description,\r\n }}\r\n classNames={{\r\n title: classNames?.title,\r\n description: classNames?.description,\r\n }}\r\n graphTitle={graphTitle}\r\n graphDescription={graphDescription}\r\n width={width}\r\n graphDownload={graphDownload ? graphParentDiv.current : undefined}\r\n dataDownload={\r\n dataDownload\r\n ? data.map(d => d.data).filter(d => d !== undefined).length > 0\r\n ? data.map(d => d.data).filter(d => d !== undefined)\r\n : data.filter(d => d !== undefined)\r\n : null\r\n }\r\n />\r\n ) : null}\r\n {timeline.enabled && uniqDatesSorted.length > 0 && markObj ? (\r\n <div className='flex gap-6 items-center' dir='ltr'>\r\n <button\r\n type='button'\r\n onClick={() => {\r\n setPlay(!play);\r\n }}\r\n className='p-0 border-0 cursor-pointer bg-transparent'\r\n aria-label={play ? 'Click to pause animation' : 'Click to play animation'}\r\n >\r\n {play ? <Pause /> : <Play />}\r\n </button>\r\n <SliderUI\r\n min={uniqDatesSorted[0]}\r\n max={uniqDatesSorted[uniqDatesSorted.length - 1]}\r\n marks={markObj}\r\n step={null}\r\n defaultValue={uniqDatesSorted[uniqDatesSorted.length - 1]}\r\n value={uniqDatesSorted[index]}\r\n onChangeComplete={nextValue => {\r\n setIndex(uniqDatesSorted.indexOf(nextValue as number));\r\n }}\r\n onChange={nextValue => {\r\n setIndex(uniqDatesSorted.indexOf(nextValue as number));\r\n }}\r\n aria-label='Time slider. Use arrow keys to adjust selected time period.'\r\n />\r\n </div>\r\n ) : null}\r\n <div\r\n className='flex flex-col grow justify-center leading-0'\r\n ref={graphDiv}\r\n aria-label='Map area'\r\n >\r\n {(width || svgWidth) && (height || svgHeight) && mapShape ? (\r\n <Graph\r\n data={data.filter(d =>\r\n timeline.enabled\r\n ? d.date ===\r\n format(new Date(uniqDatesSorted[index]), timeline.dateFormat || 'yyyy')\r\n : d,\r\n )}\r\n mapData={\r\n showAntarctica\r\n ? mapShape\r\n : {\r\n ...mapShape,\r\n features: mapShape.features.filter(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any) => el.properties.NAME !== 'Antarctica',\r\n ),\r\n }\r\n }\r\n colorDomain={\r\n data.filter(el => el.color).length === 0\r\n ? []\r\n : colorDomain ||\r\n (uniqBy(\r\n data.filter(el => !checkIfNullOrUndefined(el.color)),\r\n 'color',\r\n ).map(d => `${d.color}`) as string[])\r\n }\r\n width={width || svgWidth}\r\n height={Math.max(\r\n minHeight,\r\n height ||\r\n (relativeHeight\r\n ? minHeight\r\n ? (width || svgWidth) * relativeHeight > minHeight\r\n ? (width || svgWidth) * relativeHeight\r\n : minHeight\r\n : (width || svgWidth) * relativeHeight\r\n : svgHeight),\r\n )}\r\n scale={scale}\r\n centerPoint={centerPoint}\r\n colors={\r\n data.filter(el => el.color).length === 0\r\n ? colors\r\n ? [colors as string]\r\n : [Colors.primaryColors['blue-600']]\r\n : (colors as string[] | undefined) || Colors[theme].categoricalColors.colors\r\n }\r\n colorLegendTitle={colorLegendTitle}\r\n radius={radius}\r\n mapBorderWidth={mapBorderWidth}\r\n mapNoDataColor={mapNoDataColor}\r\n mapBorderColor={mapBorderColor}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n showLabels={showLabels}\r\n isWorldMap={isWorldMap}\r\n showColorScale={showColorScale}\r\n zoomScaleExtend={zoomScaleExtend}\r\n zoomTranslateExtend={zoomTranslateExtend}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n highlightedDataPoints={highlightedDataPoints}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n styles={styles}\r\n classNames={classNames}\r\n zoomInteraction={zoomInteraction}\r\n detailsOnClick={detailsOnClick}\r\n mapProjection={mapProjection || (isWorldMap ? 'naturalEarth' : 'mercator')}\r\n animate={\r\n animate === true\r\n ? { duration: 0.5, once: true, amount: 0.5 }\r\n : animate || { duration: 0, once: true, amount: 0 }\r\n }\r\n dimmedOpacity={dimmedOpacity}\r\n customLayers={customLayers}\r\n maxRadiusValue={\r\n !checkIfNullOrUndefined(maxRadiusValue)\r\n ? (maxRadiusValue as number)\r\n : Math.max(\r\n ...data.map(d => d.radius).filter(d => d !== undefined && d !== null),\r\n )\r\n }\r\n />\r\n ) : (\r\n <div\r\n style={{\r\n height: `${Math.max(\r\n minHeight,\r\n height ||\r\n (relativeHeight\r\n ? minHeight\r\n ? (width || svgWidth) * relativeHeight > minHeight\r\n ? (width || svgWidth) * relativeHeight\r\n : minHeight\r\n : (width || svgWidth) * relativeHeight\r\n : svgHeight),\r\n )}px`,\r\n }}\r\n className='flex items-center justify-center'\r\n >\r\n <Spinner aria-label='Loading graph' />\r\n </div>\r\n )}\r\n </div>\r\n {sources || footNote ? (\r\n <GraphFooter\r\n styles={{ footnote: styles?.footnote, source: styles?.source }}\r\n classNames={{\r\n footnote: classNames?.footnote,\r\n source: classNames?.source,\r\n }}\r\n sources={sources}\r\n footNote={footNote}\r\n width={width}\r\n />\r\n ) : null}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n}\r\n"],"names":["Graph","props","data","colors","mapData","colorLegendTitle","colorDomain","radius","height","width","scale","centerPoint","tooltip","showLabels","mapBorderWidth","mapBorderColor","mapNoDataColor","onSeriesMouseOver","showColorScale","zoomScaleExtend","zoomTranslateExtend","highlightedDataPoints","onSeriesMouseClick","resetSelectionOnDoubleClick","detailsOnClick","styles","classNames","mapProjection","zoomInteraction","animate","dimmedOpacity","customLayers","maxRadiusValue","selectedColor","setSelectedColor","useState","showLegend","setShowLegend","zoomRef","useRef","mouseClickData","setMouseClickData","mouseOverData","setMouseOverData","eventX","setEventX","eventY","setEventY","mapSvg","isInView","useInView","mapG","radiusScale","d","scaleSqrt","useEffect","mapGSelect","select","mapSvgSelect","zoomFilter","e","isWheel","isTouch","isDrag","zoomBehavior","zoom","transform","bounds","bbox","center","centroid","lonDiff","latDiff","scaleX","scaleY","scaleVar","projection","geoMercator","geoEqualEarth","geoNaturalEarth1","geoOrthographic","geoAlbersUsa","handleZoom","direction","jsxs","Fragment","jsx","motion","i","el","j","masterPath","geo","path","c","k","point","AnimatePresence","color","Colors","event","isEqual","X","P","Modal","string2HTML","Tooltip","DotDensityMap","graphTitle","sources","graphDescription","footNote","padding","backgroundColor","relativeHeight","isWorldMap","graphID","graphDownload","dataDownload","showAntarctica","language","minHeight","theme","ariaLabel","timeline","svgWidth","setSvgWidth","svgHeight","setSvgHeight","play","setPlay","uniqDatesSorted","sort","uniqBy","parse","a","b","ascending","index","setIndex","mapShape","setMapShape","graphDiv","graphParentDiv","resizeObserver","entries","fetchAndParseJSON","interval","markObj","getSliderMarks","cn","GraphHeader","Pause","Play","SliderUI","nextValue","format","checkIfNullOrUndefined","Spinner","GraphFooter"],"mappings":"87BAwEO,SAASA,GAAMC,GAAc,CAClC,KAAM,CACJ,KAAAC,EACA,OAAAC,EACA,QAAAC,EACA,iBAAAC,EACA,YAAAC,EACA,OAAAC,EACA,OAAAC,EACA,MAAAC,EACA,MAAAC,EACA,YAAAC,EACA,QAAAC,EACA,WAAAC,GACA,eAAAC,EACA,eAAAC,EACA,eAAAC,EACA,kBAAAC,GACA,eAAAC,GACA,gBAAAC,EACA,oBAAAC,GACA,sBAAAC,GACA,m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OAAAE,EACA,WAAAC,EACA,gBAAAE,GACA,eAAAJ,GACA,cAAeG,IAAkBwF,GAAa,eAAiB,YAC/D,QACEtF,IAAY,GACR,CAAE,SAAU,GAAK,KAAM,GAAM,OAAQ,EAAA,EACrCA,GAAW,CAAE,SAAU,EAAG,KAAM,GAAM,OAAQ,CAAA,EAEpD,cAAAC,EACA,aAAAC,EACA,eACG8H,GAAAA,uBAAuB7H,CAAc,EAElC,KAAK,IACH,GAAG9B,EAAK,IAAImD,GAAKA,EAAE,MAAM,EAAE,OAAOA,GAAwBA,GAAM,IAAI,CAAA,EAFrErB,CAGD,CAAA,EAIRsD,EAAAA,kBAAAA,IAAC,MAAA,CACC,MAAO,CACL,OAAQ,GAAG,KAAK,IACdmC,EACAjH,IACG0G,EACGO,GACGhH,GAASoH,GAAYX,EAAiBO,GACpChH,GAASoH,GAAYX,EACtBO,GACDhH,GAASoH,GAAYX,EACxBa,EAAA,CACP,IAAA,EAEH,UAAU,mCAEV,SAAAzC,EAAAA,kBAAAA,IAACwE,GAAAA,EAAA,CAAQ,aAAW,eAAA,CAAgB,CAAA,CAAA,CACtC,CAAA,EAGHjD,GAAWE,EACVzB,EAAAA,kBAAAA,IAACyE,GAAAA,YAAA,CACC,OAAQ,CAAE,SAAUtI,GAAQ,SAAU,OAAQA,GAAQ,MAAA,EACtD,WAAY,CACV,SAAUC,GAAY,SACtB,OAAQA,GAAY,MAAA,EAEtB,QAAAmF,EACA,SAAAE,EACA,MAAAtG,CAAA,CAAA,EAEA,IAAA,CAAA,CACN,CAAA,CAAA,CACF,CAAA,CACF,CAAA,CAGN"}
1
+ {"version":3,"file":"DotDensityMap.cjs","sources":["../src/Components/Graphs/Maps/DotDensityMap/Graph.tsx","../src/Components/Graphs/Maps/DotDensityMap/index.tsx"],"sourcesContent":["import isEqual from 'fast-deep-equal';\r\nimport { useEffect, useRef, useState } from 'react';\r\nimport {\r\n geoAlbersUsa,\r\n geoEqualEarth,\r\n geoMercator,\r\n geoNaturalEarth1,\r\n geoOrthographic,\r\n} from 'd3-geo';\r\nimport { D3ZoomEvent, zoom, ZoomBehavior } from 'd3-zoom';\r\nimport { select } from 'd3-selection';\r\nimport { scaleSqrt } from 'd3-scale';\r\nimport { Modal } from '@undp/design-system-react/Modal';\r\nimport { P } from '@undp/design-system-react/Typography';\r\nimport bbox from '@turf/bbox';\r\nimport centerOfMass from '@turf/center-of-mass';\r\nimport { AnimatePresence, motion, useInView } from 'motion/react';\r\n\r\nimport {\r\n AnimateDataType,\r\n ClassNameObject,\r\n CustomLayerDataType,\r\n DotDensityMapDataType,\r\n MapProjectionTypes,\r\n StyleObject,\r\n ZoomInteractionTypes,\r\n} from '@/Types';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { string2HTML } from '@/Utils/string2HTML';\r\nimport { X } from '@/Components/Icons';\r\n\r\ninterface Props {\r\n data: DotDensityMapDataType[];\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapData: any;\r\n colorDomain: string[];\r\n width: number;\r\n height: number;\r\n scale: number;\r\n centerPoint?: [number, number];\r\n colors: string[];\r\n colorLegendTitle?: string;\r\n radius: number;\r\n mapBorderWidth: number;\r\n mapNoDataColor: string;\r\n showLabels: boolean;\r\n mapBorderColor: string;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n isWorldMap: boolean;\r\n showColorScale: boolean;\r\n zoomScaleExtend: [number, number];\r\n zoomTranslateExtend?: [[number, number], [number, number]];\r\n highlightedDataPoints: (string | number)[];\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n resetSelectionOnDoubleClick: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n zoomInteraction: ZoomInteractionTypes;\r\n mapProjection: MapProjectionTypes;\r\n animate: AnimateDataType;\r\n dimmedOpacity: number;\r\n customLayers: CustomLayerDataType[];\r\n maxRadiusValue: number;\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n const {\r\n data,\r\n colors,\r\n mapData,\r\n colorLegendTitle,\r\n colorDomain,\r\n radius,\r\n height,\r\n width,\r\n scale,\r\n centerPoint,\r\n tooltip,\r\n showLabels,\r\n mapBorderWidth,\r\n mapBorderColor,\r\n mapNoDataColor,\r\n onSeriesMouseOver,\r\n showColorScale,\r\n zoomScaleExtend,\r\n zoomTranslateExtend,\r\n highlightedDataPoints,\r\n onSeriesMouseClick,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n mapProjection,\r\n zoomInteraction,\r\n animate,\r\n dimmedOpacity,\r\n customLayers,\r\n maxRadiusValue,\r\n } = props;\r\n const [selectedColor, setSelectedColor] = useState<string | undefined>(undefined);\r\n const [showLegend, setShowLegend] = useState(!(width < 680));\r\n const zoomRef = useRef<ZoomBehavior<SVGSVGElement, unknown> | null>(null);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseClickData, setMouseClickData] = useState<any>(undefined);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseOverData, setMouseOverData] = useState<any>(undefined);\r\n const [eventX, setEventX] = useState<number | undefined>(undefined);\r\n const [eventY, setEventY] = useState<number | undefined>(undefined);\r\n const mapSvg = useRef<SVGSVGElement>(null);\r\n const isInView = useInView(mapSvg, {\r\n once: animate.once,\r\n amount: animate.amount,\r\n });\r\n const mapG = useRef<SVGGElement>(null);\r\n const radiusScale =\r\n data.filter(d => d.radius === undefined || d.radius === null).length !== data.length\r\n ? scaleSqrt().domain([0, maxRadiusValue]).range([0.25, radius]).nice()\r\n : undefined;\r\n\r\n useEffect(() => {\r\n const mapGSelect = select(mapG.current);\r\n const mapSvgSelect = select(mapSvg.current);\r\n const zoomFilter = (e: D3ZoomEvent<SVGSVGElement, unknown>['sourceEvent']) => {\r\n if (zoomInteraction === 'noZoom') return false;\r\n if (zoomInteraction === 'button') return !e.type.includes('wheel');\r\n const isWheel = e.type === 'wheel';\r\n const isTouch = e.type.startsWith('touch');\r\n const isDrag = e.type === 'mousedown' || e.type === 'mousemove';\r\n\r\n if (isTouch) return true;\r\n if (isWheel) {\r\n if (zoomInteraction === 'scroll') return true;\r\n return e.ctrlKey;\r\n }\r\n return isDrag && !e.button && !e.ctrlKey;\r\n };\r\n const zoomBehavior = zoom<SVGSVGElement, unknown>()\r\n .scaleExtent(zoomScaleExtend)\r\n .translateExtent(\r\n zoomTranslateExtend || [\r\n [-20, -20],\r\n [width + 20, height + 20],\r\n ],\r\n )\r\n .filter(zoomFilter)\r\n .on('zoom', ({ transform }) => {\r\n mapGSelect.attr('transform', transform);\r\n });\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapSvgSelect.call(zoomBehavior as any);\r\n\r\n zoomRef.current = zoomBehavior;\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [height, width, zoomInteraction]);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const bounds = bbox(mapData as any);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const center = centerOfMass(mapData as any);\r\n const lonDiff = bounds[2] - bounds[0];\r\n const latDiff = bounds[3] - bounds[1];\r\n const scaleX = (((width * 190) / 960) * 360) / lonDiff;\r\n const scaleY = (((height * 190) / 678) * 180) / latDiff;\r\n const scaleVar = scale * Math.min(scaleX, scaleY);\r\n\r\n const projection =\r\n mapProjection === 'mercator'\r\n ? geoMercator()\r\n .rotate([0, 0])\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'equalEarth'\r\n ? geoEqualEarth()\r\n .rotate([0, 0])\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'naturalEarth'\r\n ? geoNaturalEarth1()\r\n .rotate([0, 0])\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'orthographic'\r\n ? geoOrthographic()\r\n .rotate([0, 0])\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : geoAlbersUsa()\r\n .rotate([0, 0])\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar);\r\n\r\n const handleZoom = (direction: 'in' | 'out') => {\r\n if (!mapSvg.current || !zoomRef.current) return;\r\n const svg = select(mapSvg.current);\r\n svg.call(zoomRef.current.scaleBy, direction === 'in' ? 1.2 : 1 / 1.2);\r\n };\r\n\r\n return (\r\n <>\r\n <div className='relative'>\r\n <motion.svg\r\n width={`${width}px`}\r\n height={`${height}px`}\r\n viewBox={`0 0 ${width} ${height}`}\r\n ref={mapSvg}\r\n direction='ltr'\r\n >\r\n <g ref={mapG}>\r\n {customLayers.filter(d => d.position === 'before').map(d => d.layer)}\r\n {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapData.features.map((d: any, i: number) => {\r\n return (\r\n <g key={i}>\r\n {d.geometry.type === 'MultiPolygon'\r\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n d.geometry.coordinates.map((el: any, j: any) => {\r\n let masterPath = '';\r\n el.forEach((geo: number[][]) => {\r\n let path = ' M';\r\n geo.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== geo.length - 1) path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n masterPath += path;\r\n });\r\n return (\r\n <path\r\n key={j}\r\n d={masterPath}\r\n style={{\r\n stroke: mapBorderColor,\r\n strokeWidth: mapBorderWidth,\r\n fill: mapNoDataColor,\r\n }}\r\n />\r\n );\r\n })\r\n : // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n d.geometry.coordinates.map((el: any, j: number) => {\r\n let path = 'M';\r\n el.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== el.length - 1) path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n return (\r\n <path\r\n key={j}\r\n d={path}\r\n style={{\r\n stroke: mapBorderColor,\r\n strokeWidth: mapBorderWidth,\r\n fill: mapNoDataColor,\r\n }}\r\n />\r\n );\r\n })}\r\n </g>\r\n );\r\n })\r\n }\r\n <AnimatePresence>\r\n {data.map(d => {\r\n const color =\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)];\r\n return (\r\n <motion.g\r\n key={d.label || `${d.lat}-${d.long}`}\r\n variants={{\r\n initial: { opacity: 0 },\r\n whileInView: {\r\n opacity: selectedColor\r\n ? selectedColor === color\r\n ? 1\r\n : dimmedOpacity\r\n : highlightedDataPoints.length !== 0\r\n ? highlightedDataPoints.indexOf(d.label || '') !== -1\r\n ? 1\r\n : dimmedOpacity\r\n : 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n onMouseEnter={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n onSeriesMouseOver?.(d);\r\n }}\r\n onMouseMove={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n }}\r\n onMouseLeave={() => {\r\n setMouseOverData(undefined);\r\n setEventX(undefined);\r\n setEventY(undefined);\r\n onSeriesMouseOver?.(undefined);\r\n }}\r\n onClick={() => {\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (isEqual(mouseClickData, d) && resetSelectionOnDoubleClick) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(d);\r\n onSeriesMouseClick?.(d);\r\n }\r\n }\r\n }}\r\n transform={`translate(${\r\n (projection([d.long, d.lat]) as [number, number])[0]\r\n },${(projection([d.long, d.lat]) as [number, number])[1]})`}\r\n >\r\n <motion.circle\r\n cx={0}\r\n cy={0}\r\n variants={{\r\n initial: {\r\n r: 0,\r\n fill:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n stroke:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n },\r\n whileInView: {\r\n r: !radiusScale ? radius : radiusScale(d.radius || 0),\r\n fill:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n stroke:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ r: 0, transition: { duration: animate.duration } }}\r\n style={{\r\n fillOpacity: 0.8,\r\n }}\r\n />\r\n {showLabels && d.label ? (\r\n <motion.text\r\n variants={{\r\n initial: {\r\n opacity: 0,\r\n x: !radiusScale ? radius : radiusScale(d.radius || 0),\r\n },\r\n whileInView: {\r\n opacity: 1,\r\n x: !radiusScale ? radius : radiusScale(d.radius || 0),\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n y={0}\r\n className='fill-primary-gray-600 dark:fill-primary-gray-300 text-sm'\r\n style={{ textAnchor: 'start' }}\r\n dx={4}\r\n dy={5}\r\n >\r\n {d.label}\r\n </motion.text>\r\n ) : null}\r\n </motion.g>\r\n );\r\n })}\r\n </AnimatePresence>\r\n {customLayers.filter(d => d.position === 'after').map(d => d.layer)}\r\n </g>\r\n </motion.svg>\r\n {data.filter(el => el.color).length === 0 || showColorScale === false ? null : (\r\n <div className='absolute left-4 bottom-4'>\r\n {showLegend ? (\r\n <>\r\n <div\r\n style={{\r\n backgroundColor: 'rgba(240,240,240, 0.7)',\r\n border: '1px solid var(--gray-400)',\r\n borderRadius: '999px',\r\n width: '24px',\r\n height: '24px',\r\n padding: '3px',\r\n cursor: 'pointer',\r\n zIndex: 10,\r\n position: 'absolute',\r\n right: '-0.75rem',\r\n top: '-0.75rem',\r\n }}\r\n onClick={() => {\r\n setShowLegend(false);\r\n }}\r\n >\r\n <X />\r\n </div>\r\n <div className='p-2' style={{ backgroundColor: 'rgba(240,240,240, 0.7)' }}>\r\n {colorLegendTitle && colorLegendTitle !== '' ? (\r\n <p\r\n className='p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300'\r\n style={{\r\n display: '-webkit-box',\r\n WebkitLineClamp: '1',\r\n WebkitBoxOrient: 'vertical',\r\n }}\r\n >\r\n {colorLegendTitle}\r\n </p>\r\n ) : null}\r\n <div className='flex flex-col gap-3'>\r\n {colorDomain.map((d, i) => (\r\n <div\r\n key={i}\r\n className='flex gap-2 items-center'\r\n onMouseOver={() => {\r\n setSelectedColor(colors[i % colors.length]);\r\n }}\r\n onMouseLeave={() => {\r\n setSelectedColor(undefined);\r\n }}\r\n >\r\n <div\r\n className='w-2 h-2 rounded-full'\r\n style={{ backgroundColor: colors[i % colors.length] }}\r\n />\r\n <P size='sm' marginBottom='none' leading='none'>\r\n {d}\r\n </P>\r\n </div>\r\n ))}\r\n </div>\r\n </div>\r\n </>\r\n ) : (\r\n <button\r\n type='button'\r\n className='mb-0 border-0 bg-transparent p-0 self-start'\r\n onClick={() => {\r\n setShowLegend(true);\r\n }}\r\n >\r\n <div className='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-550 border-primary-gray-400 dark:border-primary-gray-500'>\r\n Show Legend\r\n </div>\r\n </button>\r\n )}\r\n </div>\r\n )}\r\n {zoomInteraction === 'button' && (\r\n <div className='absolute left-4 top-4 flex flex-col'>\r\n <button\r\n onClick={() => handleZoom('in')}\r\n className='leading-0 px-2 py-3.5 text-primary-gray-700 border border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-400 dark:bg-primary-gray-600 dark:text-primary-gray-100'\r\n >\r\n +\r\n </button>\r\n <button\r\n onClick={() => handleZoom('out')}\r\n className='leading-0 px-2 py-3.5 text-primary-gray-700 border border-t-0 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-400 dark:bg-primary-gray-600 dark:text-primary-gray-100'\r\n >\r\n –\r\n </button>\r\n </div>\r\n )}\r\n </div>\r\n {detailsOnClick && mouseClickData !== undefined ? (\r\n <Modal\r\n open={mouseClickData !== undefined}\r\n onClose={() => {\r\n setMouseClickData(undefined);\r\n }}\r\n >\r\n <div\r\n className='graph-modal-content m-0'\r\n dangerouslySetInnerHTML={\r\n typeof detailsOnClick === 'string'\r\n ? { __html: string2HTML(detailsOnClick, mouseClickData) }\r\n : undefined\r\n }\r\n >\r\n {typeof detailsOnClick === 'function' ? detailsOnClick(mouseClickData) : null}\r\n </div>\r\n </Modal>\r\n ) : null}\r\n {mouseOverData && tooltip && eventX && eventY ? (\r\n <Tooltip\r\n data={mouseOverData}\r\n body={tooltip}\r\n xPos={eventX}\r\n yPos={eventY}\r\n backgroundStyle={styles?.tooltip}\r\n className={classNames?.tooltip}\r\n />\r\n ) : null}\r\n </>\r\n );\r\n}\r\n","import { useState, useRef, useEffect } from 'react';\r\nimport uniqBy from 'lodash.uniqby';\r\nimport { format } from 'date-fns/format';\r\nimport { parse } from 'date-fns/parse';\r\nimport { cn } from '@undp/design-system-react/cn';\r\nimport { SliderUI } from '@undp/design-system-react/SliderUI';\r\nimport { Spinner } from '@undp/design-system-react/Spinner';\r\nimport { ascending, sort } from 'd3-array';\r\n\r\nimport { Graph } from './Graph';\r\n\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport {\r\n DotDensityMapDataType,\r\n Languages,\r\n SourcesDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n ZoomInteractionTypes,\r\n MapProjectionTypes,\r\n CustomLayerDataType,\r\n AnimateDataType,\r\n TimelineDataType,\r\n} from '@/Types';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { fetchAndParseJSON } from '@/Utils/fetchAndParseData';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { Pause, Play } from '@/Components/Icons';\r\nimport { getSliderMarks } from '@/Utils/getSliderMarks';\r\n\r\ninterface Props {\r\n // Data\r\n /** Array of data objects */\r\n data: DotDensityMapDataType[];\r\n // Titles, Labels, and Sources\r\n /** Title of the graph */\r\n graphTitle?: string | React.ReactNode;\r\n /** Description of the graph */\r\n graphDescription?: string | React.ReactNode;\r\n /** Footnote for the graph */\r\n footNote?: string | React.ReactNode;\r\n /** Source data for the graph */\r\n sources?: SourcesDataType[];\r\n /** Accessibility label */\r\n ariaLabel?: string;\r\n\r\n // Colors and Styling\r\n /** Color or array of colors for the circle */\r\n colors?: string | string[];\r\n /** Domain of colors for the graph */\r\n colorDomain: string[];\r\n /** Title for the color legend */\r\n colorLegendTitle?: string;\r\n /** Color for the areas where data is no available */\r\n mapNoDataColor?: string;\r\n /** Background color of the graph */\r\n backgroundColor?: string | boolean;\r\n /** Custom styles for the graph. Each object should be a valid React CSS style object. */\r\n styles?: StyleObject;\r\n /** Custom class names */\r\n classNames?: ClassNameObject;\r\n\r\n // Size and Spacing\r\n /** Width of the graph */\r\n width?: number;\r\n /** Height of the graph */\r\n height?: number;\r\n /** Minimum height of the graph */\r\n minHeight?: number;\r\n /** Relative height scaling factor. This overwrites the height props */\r\n relativeHeight?: number;\r\n /** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */\r\n padding?: string;\r\n\r\n // Graph Parameters\r\n /** Maximum radius of the circle */\r\n radius?: number;\r\n /** Map data as an object in geoJson format or a url for geoJson */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapData?: any;\r\n /** Scaling factor for the map. Multiplies the scale number to scale. */\r\n scale?: number;\r\n /** Center point of the map */\r\n centerPoint?: [number, number];\r\n /** Defines the zoom mode for the map */\r\n zoomInteraction?: ZoomInteractionTypes;\r\n /** Stroke width of the regions in the map */\r\n mapBorderWidth?: number;\r\n /** Stroke color of the regions in the map */\r\n mapBorderColor?: string;\r\n /** Toggle if the map is a world map */\r\n isWorldMap?: boolean;\r\n /** Map projection type */\r\n mapProjection?: MapProjectionTypes;\r\n /** Extend of the allowed zoom in the map */\r\n zoomScaleExtend?: [number, number];\r\n /** Extend of the allowed panning in the map */\r\n zoomTranslateExtend?: [[number, number], [number, number]];\r\n /** Toggle visibility of labels */\r\n showLabels?: boolean;\r\n /** Maximum value mapped to the radius chart */\r\n maxRadiusValue?: number;\r\n /** Data points to highlight. Use the label value from data to highlight the data point */\r\n highlightedDataPoints?: (string | number)[];\r\n /** Defines the opacity of the non-highlighted data */\r\n dimmedOpacity?: number;\r\n /** Toggles if the graph animates in when loaded. */\r\n animate?: boolean | AnimateDataType;\r\n /** Toggle visibility of color scale. This is only applicable if the data props hae color parameter */\r\n showColorScale?: boolean;\r\n /** Toggles the visibility of Antarctica in the default map. Only applicable for the default map. */\r\n showAntarctica?: boolean;\r\n /** Optional SVG <g> element or function that renders custom content behind or in front of the graph. */\r\n customLayers?: CustomLayerDataType[];\r\n /** Configures playback and slider controls for animating the chart over time. The data must have a key date for it to work properly. */\r\n timeline?: TimelineDataType;\r\n /** Enable graph download option as png */\r\n graphDownload?: boolean;\r\n /** Enable data download option as a csv */\r\n dataDownload?: boolean;\r\n /** Reset selection on double-click. Only applicable when used in a dashboard context with filters. */\r\n resetSelectionOnDoubleClick?: boolean;\r\n\r\n // Interactions and Callbacks\r\n /** Tooltip content. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n /** Details displayed on the modal when user clicks of a data point. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n /** Callback for mouse over event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n /** Callback for mouse click event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n\r\n // Configuration and Options\r\n /** Language setting */\r\n language?: Languages;\r\n /** Color theme */\r\n theme?: 'light' | 'dark';\r\n /** Unique ID for the graph */\r\n graphID?: string;\r\n}\r\n\r\nexport function DotDensityMap(props: Props) {\r\n const {\r\n data,\r\n mapData = 'https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap.json',\r\n graphTitle,\r\n colors,\r\n sources,\r\n graphDescription,\r\n height,\r\n width,\r\n footNote = 'The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.',\r\n colorLegendTitle,\r\n colorDomain,\r\n radius = 5,\r\n scale = 0.95,\r\n centerPoint,\r\n padding,\r\n mapBorderWidth = 0.5,\r\n mapNoDataColor = Colors.light.graphNoData,\r\n backgroundColor = false,\r\n showLabels = false,\r\n mapBorderColor = Colors.light.grays['gray-500'],\r\n tooltip,\r\n relativeHeight,\r\n onSeriesMouseOver,\r\n isWorldMap = true,\r\n showColorScale = true,\r\n zoomScaleExtend = [0.8, 6],\r\n zoomTranslateExtend,\r\n graphID,\r\n highlightedDataPoints = [],\r\n onSeriesMouseClick,\r\n graphDownload = false,\r\n dataDownload = false,\r\n showAntarctica = false,\r\n language = 'en',\r\n minHeight = 0,\r\n theme = 'light',\r\n ariaLabel,\r\n resetSelectionOnDoubleClick = true,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n mapProjection,\r\n zoomInteraction = 'button',\r\n animate = false,\r\n dimmedOpacity = 0.3,\r\n customLayers = [],\r\n maxRadiusValue,\r\n timeline = { enabled: false, autoplay: false, showOnlyActiveDate: true },\r\n } = props;\r\n\r\n const [svgWidth, setSvgWidth] = useState(0);\r\n const [svgHeight, setSvgHeight] = useState(0);\r\n const [play, setPlay] = useState(timeline.autoplay);\r\n const uniqDatesSorted = sort(\r\n uniqBy(\r\n data.filter(d => d.date !== undefined && d.date !== null),\r\n d => d.date,\r\n ).map(d => parse(`${d.date}`, timeline.dateFormat || 'yyyy', new Date()).getTime()),\r\n (a, b) => ascending(a, b),\r\n );\r\n const [index, setIndex] = useState(timeline.autoplay ? 0 : uniqDatesSorted.length - 1);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mapShape, setMapShape] = useState<any>(undefined);\r\n\r\n const graphDiv = useRef<HTMLDivElement>(null);\r\n const graphParentDiv = useRef<HTMLDivElement>(null);\r\n useEffect(() => {\r\n const resizeObserver = new ResizeObserver(entries => {\r\n setSvgWidth(width || entries[0].target.clientWidth || 760);\r\n setSvgHeight(height || entries[0].target.clientHeight || 480);\r\n });\r\n if (graphDiv.current) {\r\n setSvgHeight(graphDiv.current.clientHeight || 480);\r\n setSvgWidth(graphDiv.current.clientWidth || 760);\r\n if (!width) resizeObserver.observe(graphDiv.current);\r\n }\r\n return () => resizeObserver.disconnect();\r\n }, [width, height]);\r\n useEffect(() => {\r\n if (typeof mapData === 'string') {\r\n const fetchData = fetchAndParseJSON(mapData);\r\n fetchData.then(d => {\r\n setMapShape(d);\r\n });\r\n } else {\r\n setMapShape(mapData);\r\n }\r\n }, [mapData]);\r\n\r\n useEffect(() => {\r\n const interval = setInterval(\r\n () => {\r\n setIndex(i => (i < uniqDatesSorted.length - 1 ? i + 1 : 0));\r\n },\r\n (timeline.speed || 2) * 1000,\r\n );\r\n if (!play) clearInterval(interval);\r\n return () => clearInterval(interval);\r\n }, [uniqDatesSorted, play, timeline.speed]);\r\n\r\n const markObj = getSliderMarks(\r\n uniqDatesSorted,\r\n index,\r\n timeline.showOnlyActiveDate,\r\n timeline.dateFormat || 'yyyy',\r\n );\r\n return (\r\n <div\r\n className={`${theme || 'light'} flex ${width ? 'w-fit grow-0' : 'w-full grow'}`}\r\n dir={language === 'he' || language === 'ar' ? 'rtl' : undefined}\r\n >\r\n <div\r\n className={cn(\r\n `${\r\n !backgroundColor\r\n ? 'bg-transparent '\r\n : backgroundColor === true\r\n ? 'bg-primary-gray-200 dark:bg-primary-gray-650 '\r\n : ''\r\n }ml-auto mr-auto flex flex-col grow h-inherit ${language || 'en'}`,\r\n width ? 'w-fit' : 'w-full',\r\n classNames?.graphContainer,\r\n )}\r\n style={{\r\n ...(styles?.graphContainer || {}),\r\n ...(backgroundColor && backgroundColor !== true ? { backgroundColor } : {}),\r\n }}\r\n id={graphID}\r\n ref={graphParentDiv}\r\n aria-label={\r\n ariaLabel ||\r\n `${\r\n graphTitle ? `The graph shows ${graphTitle}. ` : ''\r\n }This is a dot density map showing the distribution of a variable across a region or world, with each dot representing a data point.${\r\n graphDescription ? ` ${graphDescription}` : ''\r\n }`\r\n }\r\n >\r\n <div\r\n className='flex grow'\r\n style={{ padding: backgroundColor ? padding || '1rem' : padding || 0 }}\r\n >\r\n <div className='flex flex-col w-full gap-4 grow justify-between'>\r\n {graphTitle || graphDescription || graphDownload || dataDownload ? (\r\n <GraphHeader\r\n styles={{\r\n title: styles?.title,\r\n description: styles?.description,\r\n }}\r\n classNames={{\r\n title: classNames?.title,\r\n description: classNames?.description,\r\n }}\r\n graphTitle={graphTitle}\r\n graphDescription={graphDescription}\r\n width={width}\r\n graphDownload={graphDownload ? graphParentDiv.current : undefined}\r\n dataDownload={\r\n dataDownload\r\n ? data.map(d => d.data).filter(d => d !== undefined).length > 0\r\n ? data.map(d => d.data).filter(d => d !== undefined)\r\n : data.filter(d => d !== undefined)\r\n : null\r\n }\r\n />\r\n ) : null}\r\n {timeline.enabled && uniqDatesSorted.length > 0 && markObj ? (\r\n <div className='flex gap-6 items-center' dir='ltr'>\r\n <button\r\n type='button'\r\n onClick={() => {\r\n setPlay(!play);\r\n }}\r\n className='p-0 border-0 cursor-pointer bg-transparent'\r\n aria-label={play ? 'Click to pause animation' : 'Click to play animation'}\r\n >\r\n {play ? <Pause /> : <Play />}\r\n </button>\r\n <SliderUI\r\n min={uniqDatesSorted[0]}\r\n max={uniqDatesSorted[uniqDatesSorted.length - 1]}\r\n marks={markObj}\r\n step={null}\r\n defaultValue={uniqDatesSorted[uniqDatesSorted.length - 1]}\r\n value={uniqDatesSorted[index]}\r\n onChangeComplete={nextValue => {\r\n setIndex(uniqDatesSorted.indexOf(nextValue as number));\r\n }}\r\n onChange={nextValue => {\r\n setIndex(uniqDatesSorted.indexOf(nextValue as number));\r\n }}\r\n aria-label='Time slider. Use arrow keys to adjust selected time period.'\r\n />\r\n </div>\r\n ) : null}\r\n <div\r\n className='flex flex-col grow justify-center leading-0'\r\n ref={graphDiv}\r\n aria-label='Map area'\r\n >\r\n {(width || svgWidth) && (height || svgHeight) && mapShape ? (\r\n <Graph\r\n data={data.filter(d =>\r\n timeline.enabled\r\n ? d.date ===\r\n format(new Date(uniqDatesSorted[index]), timeline.dateFormat || 'yyyy')\r\n : d,\r\n )}\r\n mapData={\r\n showAntarctica\r\n ? mapShape\r\n : {\r\n ...mapShape,\r\n features: mapShape.features.filter(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any) => el.properties.NAME !== 'Antarctica',\r\n ),\r\n }\r\n }\r\n colorDomain={\r\n data.filter(el => el.color).length === 0\r\n ? []\r\n : colorDomain ||\r\n (uniqBy(\r\n data.filter(el => !checkIfNullOrUndefined(el.color)),\r\n 'color',\r\n ).map(d => `${d.color}`) as string[])\r\n }\r\n width={width || svgWidth}\r\n height={Math.max(\r\n minHeight,\r\n height ||\r\n (relativeHeight\r\n ? minHeight\r\n ? (width || svgWidth) * relativeHeight > minHeight\r\n ? (width || svgWidth) * relativeHeight\r\n : minHeight\r\n : (width || svgWidth) * relativeHeight\r\n : svgHeight),\r\n )}\r\n scale={scale}\r\n centerPoint={centerPoint}\r\n colors={\r\n data.filter(el => el.color).length === 0\r\n ? colors\r\n ? [colors as string]\r\n : [Colors.primaryColors['blue-600']]\r\n : (colors as string[] | undefined) || Colors[theme].categoricalColors.colors\r\n }\r\n colorLegendTitle={colorLegendTitle}\r\n radius={radius}\r\n mapBorderWidth={mapBorderWidth}\r\n mapNoDataColor={mapNoDataColor}\r\n mapBorderColor={mapBorderColor}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n showLabels={showLabels}\r\n isWorldMap={isWorldMap}\r\n showColorScale={showColorScale}\r\n zoomScaleExtend={zoomScaleExtend}\r\n zoomTranslateExtend={zoomTranslateExtend}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n highlightedDataPoints={highlightedDataPoints}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n styles={styles}\r\n classNames={classNames}\r\n zoomInteraction={zoomInteraction}\r\n detailsOnClick={detailsOnClick}\r\n mapProjection={mapProjection || (isWorldMap ? 'naturalEarth' : 'mercator')}\r\n animate={\r\n animate === true\r\n ? { duration: 0.5, once: true, amount: 0.5 }\r\n : animate || { duration: 0, once: true, amount: 0 }\r\n }\r\n dimmedOpacity={dimmedOpacity}\r\n customLayers={customLayers}\r\n maxRadiusValue={\r\n !checkIfNullOrUndefined(maxRadiusValue)\r\n ? (maxRadiusValue as number)\r\n : Math.max(\r\n ...data.map(d => d.radius).filter(d => d !== undefined && d !== null),\r\n )\r\n }\r\n />\r\n ) : (\r\n <div\r\n style={{\r\n height: `${Math.max(\r\n minHeight,\r\n height ||\r\n (relativeHeight\r\n ? minHeight\r\n ? (width || svgWidth) * relativeHeight > minHeight\r\n ? (width || svgWidth) * relativeHeight\r\n : minHeight\r\n : (width || svgWidth) * relativeHeight\r\n : svgHeight),\r\n )}px`,\r\n }}\r\n className='flex items-center justify-center'\r\n >\r\n <Spinner aria-label='Loading graph' />\r\n </div>\r\n )}\r\n </div>\r\n {sources || footNote ? (\r\n <GraphFooter\r\n styles={{ footnote: styles?.footnote, source: styles?.source }}\r\n classNames={{\r\n footnote: classNames?.footnote,\r\n source: classNames?.source,\r\n }}\r\n sources={sources}\r\n footNote={footNote}\r\n width={width}\r\n />\r\n ) : null}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n}\r\n"],"names":["Graph","props","data","colors","mapData","colorLegendTitle","colorDomain","radius","height","width","scale","centerPoint","tooltip","showLabels","mapBorderWidth","mapBorderColor","mapNoDataColor","onSeriesMouseOver","showColorScale","zoomScaleExtend","zoomTranslateExtend","highlightedDataPoints","onSeriesMouseClick","resetSelectionOnDoubleClick","detailsOnClick","styles","classNames","mapProjection","zoomInteraction","animate","dimmedOpacity","customLayers","maxRadiusValue","selectedColor","setSelectedColor","useState","showLegend","setShowLegend","zoomRef","useRef","mouseClickData","setMouseClickData","mouseOverData","setMouseOverData","eventX","setEventX","eventY","setEventY","mapSvg","isInView","useInView","mapG","radiusScale","d","scaleSqrt","useEffect","mapGSelect","select","mapSvgSelect","zoomFilter","e","isWheel","isTouch","isDrag","zoomBehavior","zoom","transform","bounds","bbox","center","centerOfMass","lonDiff","latDiff","scaleX","scaleY","scaleVar","projection","geoMercator","geoEqualEarth","geoNaturalEarth1","geoOrthographic","geoAlbersUsa","handleZoom","direction","jsxs","Fragment","jsx","motion","i","el","j","masterPath","geo","path","c","k","point","AnimatePresence","color","Colors","event","isEqual","X","P","Modal","string2HTML","Tooltip","DotDensityMap","graphTitle","sources","graphDescription","footNote","padding","backgroundColor","relativeHeight","isWorldMap","graphID","graphDownload","dataDownload","showAntarctica","language","minHeight","theme","ariaLabel","timeline","svgWidth","setSvgWidth","svgHeight","setSvgHeight","play","setPlay","uniqDatesSorted","sort","uniqBy","parse","a","b","ascending","index","setIndex","mapShape","setMapShape","graphDiv","graphParentDiv","resizeObserver","entries","fetchAndParseJSON","interval","markObj","getSliderMarks","cn","GraphHeader","Pause","Play","SliderUI","nextValue","format","checkIfNullOrUndefined","Spinner","GraphFooter"],"mappings":"i+BAwEO,SAASA,GAAMC,GAAc,CAClC,KAAM,CACJ,KAAAC,EACA,OAAAC,EACA,QAAAC,EACA,iBAAAC,EACA,YAAAC,EACA,OAAAC,EACA,OAAAC,EACA,MAAAC,EACA,MAAAC,EACA,YAAAC,EACA,QAAAC,EACA,WAAAC,GACA,eAAAC,EACA,eAAAC,EACA,eAAAC,EACA,kBAAAC,GACA,eAAAC,GACA,gBAAAC,EACA,oBAAAC,GACA,sBAAAC,GACA,mBAAAC,EACA,4BAAAC,EACA,eAAAC,EACA,OAAAC,GACA,WAAAC,GACA,cAAAC,EACA,gBAAAC,EACA,QAAAC,EACA,cAAAC,GACA,aAAAC,GACA,eAAAC,EAAA,EACE/B,GACE,CAACgC,EAAeC,EAAgB,EAAIC,EAAAA,SAA6B,MAAS,EAC1E,CAACC,EAAYC,CAAa,EAAIF,EAAAA,SAAS,EAAE1B,EAAQ,IAAI,EACrD6B,EAAUC,EAAAA,OAAoD,IAAI,EAGlE,CAACC,EAAgBC,CAAiB,EAAIN,EAAAA,SAAc,MAAS,EAE7D,CAACO,GAAeC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