@undp/data-viz 2.0.9 → 2.1.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 (204) hide show
  1. package/dist/AreaChart.cjs +1 -1
  2. package/dist/AreaChart.d.ts +2 -0
  3. package/dist/AreaChart.js +1 -1
  4. package/dist/BarGraph.cjs +1 -1
  5. package/dist/BarGraph.cjs.map +1 -1
  6. package/dist/BarGraph.d.ts +2 -0
  7. package/dist/BarGraph.js +1188 -1213
  8. package/dist/BarGraph.js.map +1 -1
  9. package/dist/BasicStatCard.d.ts +2 -0
  10. package/dist/BeeSwarmChart.cjs +1 -1
  11. package/dist/BeeSwarmChart.cjs.map +1 -1
  12. package/dist/BeeSwarmChart.d.ts +2 -0
  13. package/dist/BeeSwarmChart.js +258 -267
  14. package/dist/BeeSwarmChart.js.map +1 -1
  15. package/dist/BiVariateChoroplethMap.cjs +1 -1
  16. package/dist/BiVariateChoroplethMap.cjs.map +1 -1
  17. package/dist/BiVariateChoroplethMap.d.ts +2 -0
  18. package/dist/BiVariateChoroplethMap.js +126 -131
  19. package/dist/BiVariateChoroplethMap.js.map +1 -1
  20. package/dist/BulletChart.cjs +1 -1
  21. package/dist/BulletChart.cjs.map +1 -1
  22. package/dist/BulletChart.d.ts +2 -0
  23. package/dist/BulletChart.js +404 -413
  24. package/dist/BulletChart.js.map +1 -1
  25. package/dist/ButterflyChart.cjs +1 -1
  26. package/dist/ButterflyChart.cjs.map +1 -1
  27. package/dist/ButterflyChart.d.ts +2 -0
  28. package/dist/ButterflyChart.js +179 -184
  29. package/dist/ButterflyChart.js.map +1 -1
  30. package/dist/ChoroplethMap.cjs +1 -1
  31. package/dist/ChoroplethMap.cjs.map +1 -1
  32. package/dist/ChoroplethMap.d.ts +2 -0
  33. package/dist/ChoroplethMap.js +268 -273
  34. package/dist/ChoroplethMap.js.map +1 -1
  35. package/dist/CirclePackingGraph.cjs +1 -1
  36. package/dist/CirclePackingGraph.d.ts +2 -0
  37. package/dist/CirclePackingGraph.js +1 -1
  38. package/dist/DataCards.d.ts +2 -0
  39. package/dist/DataCards.js +1 -1
  40. package/dist/DataTable.d.ts +2 -0
  41. package/dist/DetailsModal-0Ry5nXiC.js +32 -0
  42. package/dist/DetailsModal-0Ry5nXiC.js.map +1 -0
  43. package/dist/DetailsModal-BN0HDFlV.cjs +2 -0
  44. package/dist/DetailsModal-BN0HDFlV.cjs.map +1 -0
  45. package/dist/DifferenceLineChart.cjs +1 -1
  46. package/dist/DifferenceLineChart.d.ts +2 -0
  47. package/dist/DifferenceLineChart.js +1 -1
  48. package/dist/DonutChart.cjs +1 -1
  49. package/dist/DonutChart.cjs.map +1 -1
  50. package/dist/DonutChart.d.ts +2 -0
  51. package/dist/DonutChart.js +185 -190
  52. package/dist/DonutChart.js.map +1 -1
  53. package/dist/DotDensityMap.cjs +1 -1
  54. package/dist/DotDensityMap.cjs.map +1 -1
  55. package/dist/DotDensityMap.d.ts +2 -0
  56. package/dist/DotDensityMap.js +198 -203
  57. package/dist/DotDensityMap.js.map +1 -1
  58. package/dist/DualAxisLineChart.cjs +1 -1
  59. package/dist/DualAxisLineChart.d.ts +2 -0
  60. package/dist/DualAxisLineChart.js +1 -1
  61. package/dist/DumbbellChart.cjs +1 -1
  62. package/dist/DumbbellChart.cjs.map +1 -1
  63. package/dist/DumbbellChart.d.ts +2 -0
  64. package/dist/DumbbellChart.js +364 -373
  65. package/dist/DumbbellChart.js.map +1 -1
  66. package/dist/GeoHubCompareMaps.d.ts +2 -0
  67. package/dist/GeoHubMap.d.ts +2 -0
  68. package/dist/GeoHubMapWithLayerSelection.d.ts +2 -0
  69. package/dist/{GraphEl-BcKU0bG1.cjs → GraphEl-B16EYkko.cjs} +2 -2
  70. package/dist/{GraphEl-BcKU0bG1.cjs.map → GraphEl-B16EYkko.cjs.map} +1 -1
  71. package/dist/{GraphEl-CGq1EWRn.js → GraphEl-ebgfxefq.js} +3 -3
  72. package/dist/{GraphEl-CGq1EWRn.js.map → GraphEl-ebgfxefq.js.map} +1 -1
  73. package/dist/GriddedGraphs.cjs +1 -1
  74. package/dist/GriddedGraphs.cjs.map +1 -1
  75. package/dist/GriddedGraphs.d.ts +2 -0
  76. package/dist/GriddedGraphs.js +19 -19
  77. package/dist/GriddedGraphs.js.map +1 -1
  78. package/dist/GriddedGraphsFromConfig.d.ts +2 -0
  79. package/dist/HeatMap.cjs +1 -1
  80. package/dist/HeatMap.cjs.map +1 -1
  81. package/dist/HeatMap.d.ts +2 -0
  82. package/dist/HeatMap.js +111 -116
  83. package/dist/HeatMap.js.map +1 -1
  84. package/dist/Histogram.cjs +1 -1
  85. package/dist/Histogram.d.ts +2 -0
  86. package/dist/Histogram.js +1 -1
  87. package/dist/HybridMap.cjs +1 -1
  88. package/dist/HybridMap.cjs.map +1 -1
  89. package/dist/HybridMap.d.ts +2 -0
  90. package/dist/HybridMap.js +202 -207
  91. package/dist/HybridMap.js.map +1 -1
  92. package/dist/LineChartWithConfidenceInterval.cjs +1 -1
  93. package/dist/LineChartWithConfidenceInterval.d.ts +2 -0
  94. package/dist/LineChartWithConfidenceInterval.js +1 -1
  95. package/dist/{Modal-DGcuAHyK.js → Modal-bMQA6bL_.js} +5 -5
  96. package/dist/{Modal-DGcuAHyK.js.map → Modal-bMQA6bL_.js.map} +1 -1
  97. package/dist/MultiGraphDashboard.cjs +1 -1
  98. package/dist/MultiGraphDashboard.cjs.map +1 -1
  99. package/dist/MultiGraphDashboard.d.ts +2 -0
  100. package/dist/MultiGraphDashboard.js +10 -10
  101. package/dist/MultiGraphDashboard.js.map +1 -1
  102. package/dist/MultiGraphDashboardFromConfig.d.ts +2 -0
  103. package/dist/MultiGraphDashboardWideToLongFormat.d.ts +2 -0
  104. package/dist/MultiGraphDashboardWideToLongFormat.js +1 -1
  105. package/dist/MultiGraphDashboardWideToLongFormatFromConfig.d.ts +2 -0
  106. package/dist/MultiLineAltChart.cjs +1 -1
  107. package/dist/MultiLineAltChart.d.ts +2 -0
  108. package/dist/MultiLineAltChart.js +1 -1
  109. package/dist/MultiLineChart.cjs +1 -1
  110. package/dist/MultiLineChart.d.ts +2 -0
  111. package/dist/MultiLineChart.js +1 -1
  112. package/dist/ParetoChart.cjs +1 -1
  113. package/dist/ParetoChart.cjs.map +1 -1
  114. package/dist/ParetoChart.d.ts +2 -0
  115. package/dist/ParetoChart.js +187 -192
  116. package/dist/ParetoChart.js.map +1 -1
  117. package/dist/PerformanceIntensiveMultiGraphDashboard.cjs +1 -1
  118. package/dist/PerformanceIntensiveMultiGraphDashboard.cjs.map +1 -1
  119. package/dist/PerformanceIntensiveMultiGraphDashboard.d.ts +2 -0
  120. package/dist/PerformanceIntensiveMultiGraphDashboard.js +16 -16
  121. package/dist/PerformanceIntensiveMultiGraphDashboard.js.map +1 -1
  122. package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.d.ts +2 -0
  123. package/dist/PerformanceIntensiveScrollStory.d.ts +2 -0
  124. package/dist/RadarChart.cjs +1 -1
  125. package/dist/RadarChart.cjs.map +1 -1
  126. package/dist/RadarChart.d.ts +2 -0
  127. package/dist/RadarChart.js +158 -163
  128. package/dist/RadarChart.js.map +1 -1
  129. package/dist/SankeyChart.cjs +1 -1
  130. package/dist/SankeyChart.cjs.map +1 -1
  131. package/dist/SankeyChart.d.ts +2 -0
  132. package/dist/SankeyChart.js +172 -177
  133. package/dist/SankeyChart.js.map +1 -1
  134. package/dist/ScatterPlot.cjs +1 -1
  135. package/dist/ScatterPlot.cjs.map +1 -1
  136. package/dist/ScatterPlot.d.ts +2 -0
  137. package/dist/ScatterPlot.js +222 -227
  138. package/dist/ScatterPlot.js.map +1 -1
  139. package/dist/ScrollStory.d.ts +2 -0
  140. package/dist/SimpleLineChart.cjs +1 -1
  141. package/dist/SimpleLineChart.d.ts +2 -0
  142. package/dist/SimpleLineChart.js +1 -1
  143. package/dist/SingleGraphDashboard.cjs +1 -1
  144. package/dist/SingleGraphDashboard.cjs.map +1 -1
  145. package/dist/SingleGraphDashboard.d.ts +2 -0
  146. package/dist/SingleGraphDashboard.js +24 -24
  147. package/dist/SingleGraphDashboard.js.map +1 -1
  148. package/dist/SingleGraphDashboardFromConfig.d.ts +2 -0
  149. package/dist/SingleGraphDashboardGeoHubMaps.d.ts +2 -0
  150. package/dist/SingleGraphDashboardGeoHubMapsFromConfig.d.ts +2 -0
  151. package/dist/SingleGraphDashboardThreeDGraphs.cjs +1 -1
  152. package/dist/SingleGraphDashboardThreeDGraphs.cjs.map +1 -1
  153. package/dist/SingleGraphDashboardThreeDGraphs.d.ts +2 -0
  154. package/dist/SingleGraphDashboardThreeDGraphs.js +46 -46
  155. package/dist/SingleGraphDashboardThreeDGraphs.js.map +1 -1
  156. package/dist/SingleGraphDashboardThreeDGraphsFromConfig.d.ts +2 -0
  157. package/dist/SlopeChart.cjs +1 -1
  158. package/dist/SlopeChart.cjs.map +1 -1
  159. package/dist/SlopeChart.d.ts +2 -0
  160. package/dist/SlopeChart.js +182 -187
  161. package/dist/SlopeChart.js.map +1 -1
  162. package/dist/SparkLine.cjs +1 -1
  163. package/dist/SparkLine.d.ts +2 -0
  164. package/dist/SparkLine.js +1 -1
  165. package/dist/StatCardFromData.d.ts +2 -0
  166. package/dist/StripChart.cjs +1 -1
  167. package/dist/StripChart.cjs.map +1 -1
  168. package/dist/StripChart.d.ts +2 -0
  169. package/dist/StripChart.js +249 -258
  170. package/dist/StripChart.js.map +1 -1
  171. package/dist/ThreeDGlobe.cjs +1 -1
  172. package/dist/ThreeDGlobe.cjs.map +1 -1
  173. package/dist/ThreeDGlobe.d.ts +2 -0
  174. package/dist/ThreeDGlobe.js +142 -147
  175. package/dist/ThreeDGlobe.js.map +1 -1
  176. package/dist/Tooltip-Dj5eVppQ.js +45 -0
  177. package/dist/Tooltip-Dj5eVppQ.js.map +1 -0
  178. package/dist/Tooltip-uUdw6wJL.cjs +2 -0
  179. package/dist/Tooltip-uUdw6wJL.cjs.map +1 -0
  180. package/dist/TreeMapGraph.cjs +1 -1
  181. package/dist/TreeMapGraph.cjs.map +1 -1
  182. package/dist/TreeMapGraph.d.ts +2 -0
  183. package/dist/TreeMapGraph.js +159 -164
  184. package/dist/TreeMapGraph.js.map +1 -1
  185. package/dist/Types.d.ts +2 -0
  186. package/dist/UnitChart.d.ts +2 -0
  187. package/dist/{checkIfMultiple-Y9iKaV_u.js → checkIfMultiple-CIRtG0KE.js} +2 -2
  188. package/dist/{checkIfMultiple-Y9iKaV_u.js.map → checkIfMultiple-CIRtG0KE.js.map} +1 -1
  189. package/dist/index-BBV4tAeA.js +330 -0
  190. package/dist/index-BBV4tAeA.js.map +1 -0
  191. package/dist/index-CF5hnGvG.cjs +2 -0
  192. package/dist/index-CF5hnGvG.cjs.map +1 -0
  193. package/dist/index.cjs +1 -1
  194. package/dist/index.d.ts +2 -0
  195. package/dist/index.js +1 -1
  196. package/package.json +1 -1
  197. package/dist/Tooltip-4dJo4_AF.cjs +0 -2
  198. package/dist/Tooltip-4dJo4_AF.cjs.map +0 -1
  199. package/dist/Tooltip-CwWUegPB.js +0 -43
  200. package/dist/Tooltip-CwWUegPB.js.map +0 -1
  201. package/dist/index-B2LQV7Tk.js +0 -335
  202. package/dist/index-B2LQV7Tk.js.map +0 -1
  203. package/dist/index-xRHRLDIp.cjs +0 -2
  204. package/dist/index-xRHRLDIp.cjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"DonutChart.js","sources":["../node_modules/d3-shape/src/math.js","../node_modules/d3-shape/src/arc.js","../node_modules/d3-shape/src/descending.js","../node_modules/d3-shape/src/identity.js","../node_modules/d3-shape/src/pie.js","../src/Components/Graphs/DonutChart/Graph.tsx","../src/Components/Graphs/DonutChart/index.tsx"],"sourcesContent":["export const abs = Math.abs;\nexport const atan2 = Math.atan2;\nexport const cos = Math.cos;\nexport const max = Math.max;\nexport const min = Math.min;\nexport const sin = Math.sin;\nexport const sqrt = Math.sqrt;\n\nexport const epsilon = 1e-12;\nexport const pi = Math.PI;\nexport const halfPi = pi / 2;\nexport const tau = 2 * pi;\n\nexport function acos(x) {\n return x > 1 ? 0 : x < -1 ? pi : Math.acos(x);\n}\n\nexport function asin(x) {\n return x >= 1 ? halfPi : x <= -1 ? -halfPi : Math.asin(x);\n}\n","import constant from \"./constant.js\";\nimport {abs, acos, asin, atan2, cos, epsilon, halfPi, max, min, pi, sin, sqrt, tau} from \"./math.js\";\nimport {withPath} from \"./path.js\";\n\nfunction arcInnerRadius(d) {\n return d.innerRadius;\n}\n\nfunction arcOuterRadius(d) {\n return d.outerRadius;\n}\n\nfunction arcStartAngle(d) {\n return d.startAngle;\n}\n\nfunction arcEndAngle(d) {\n return d.endAngle;\n}\n\nfunction arcPadAngle(d) {\n return d && d.padAngle; // Note: optional!\n}\n\nfunction intersect(x0, y0, x1, y1, x2, y2, x3, y3) {\n var x10 = x1 - x0, y10 = y1 - y0,\n x32 = x3 - x2, y32 = y3 - y2,\n t = y32 * x10 - x32 * y10;\n if (t * t < epsilon) return;\n t = (x32 * (y0 - y2) - y32 * (x0 - x2)) / t;\n return [x0 + t * x10, y0 + t * y10];\n}\n\n// Compute perpendicular offset line of length rc.\n// http://mathworld.wolfram.com/Circle-LineIntersection.html\nfunction cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / sqrt(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * sqrt(max(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}\n\nexport default function() {\n var innerRadius = arcInnerRadius,\n outerRadius = arcOuterRadius,\n cornerRadius = constant(0),\n padRadius = null,\n startAngle = arcStartAngle,\n endAngle = arcEndAngle,\n padAngle = arcPadAngle,\n context = null,\n path = withPath(arc);\n\n function arc() {\n var buffer,\n r,\n r0 = +innerRadius.apply(this, arguments),\n r1 = +outerRadius.apply(this, arguments),\n a0 = startAngle.apply(this, arguments) - halfPi,\n a1 = endAngle.apply(this, arguments) - halfPi,\n da = abs(a1 - a0),\n cw = a1 > a0;\n\n if (!context) context = buffer = path();\n\n // Ensure that the outer radius is always larger than the inner radius.\n if (r1 < r0) r = r1, r1 = r0, r0 = r;\n\n // Is it a point?\n if (!(r1 > epsilon)) context.moveTo(0, 0);\n\n // Or is it a circle or annulus?\n else if (da > tau - epsilon) {\n context.moveTo(r1 * cos(a0), r1 * sin(a0));\n context.arc(0, 0, r1, a0, a1, !cw);\n if (r0 > epsilon) {\n context.moveTo(r0 * cos(a1), r0 * sin(a1));\n context.arc(0, 0, r0, a1, a0, cw);\n }\n }\n\n // Or is it a circular or annular sector?\n else {\n var a01 = a0,\n a11 = a1,\n a00 = a0,\n a10 = a1,\n da0 = da,\n da1 = da,\n ap = padAngle.apply(this, arguments) / 2,\n rp = (ap > epsilon) && (padRadius ? +padRadius.apply(this, arguments) : sqrt(r0 * r0 + r1 * r1)),\n rc = min(abs(r1 - r0) / 2, +cornerRadius.apply(this, arguments)),\n rc0 = rc,\n rc1 = rc,\n t0,\n t1;\n\n // Apply padding? Note that since r1 ≥ r0, da1 ≥ da0.\n if (rp > epsilon) {\n var p0 = asin(rp / r0 * sin(ap)),\n p1 = asin(rp / r1 * sin(ap));\n if ((da0 -= p0 * 2) > epsilon) p0 *= (cw ? 1 : -1), a00 += p0, a10 -= p0;\n else da0 = 0, a00 = a10 = (a0 + a1) / 2;\n if ((da1 -= p1 * 2) > epsilon) p1 *= (cw ? 1 : -1), a01 += p1, a11 -= p1;\n else da1 = 0, a01 = a11 = (a0 + a1) / 2;\n }\n\n var x01 = r1 * cos(a01),\n y01 = r1 * sin(a01),\n x10 = r0 * cos(a10),\n y10 = r0 * sin(a10);\n\n // Apply rounded corners?\n if (rc > epsilon) {\n var x11 = r1 * cos(a11),\n y11 = r1 * sin(a11),\n x00 = r0 * cos(a00),\n y00 = r0 * sin(a00),\n oc;\n\n // Restrict the corner radius according to the sector angle. If this\n // intersection fails, it’s probably because the arc is too small, so\n // disable the corner radius entirely.\n if (da < pi) {\n if (oc = intersect(x01, y01, x00, y00, x11, y11, x10, y10)) {\n var ax = x01 - oc[0],\n ay = y01 - oc[1],\n bx = x11 - oc[0],\n by = y11 - oc[1],\n kc = 1 / sin(acos((ax * bx + ay * by) / (sqrt(ax * ax + ay * ay) * sqrt(bx * bx + by * by))) / 2),\n lc = sqrt(oc[0] * oc[0] + oc[1] * oc[1]);\n rc0 = min(rc, (r0 - lc) / (kc - 1));\n rc1 = min(rc, (r1 - lc) / (kc + 1));\n } else {\n rc0 = rc1 = 0;\n }\n }\n }\n\n // Is the sector collapsed to a line?\n if (!(da1 > epsilon)) context.moveTo(x01, y01);\n\n // Does the sector’s outer ring have rounded corners?\n else if (rc1 > epsilon) {\n t0 = cornerTangents(x00, y00, x01, y01, r1, rc1, cw);\n t1 = cornerTangents(x11, y11, x10, y10, r1, rc1, cw);\n\n context.moveTo(t0.cx + t0.x01, t0.cy + t0.y01);\n\n // Have the corners merged?\n if (rc1 < rc) context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);\n\n // Otherwise, draw the two corners and the ring.\n else {\n context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);\n context.arc(0, 0, r1, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), !cw);\n context.arc(t1.cx, t1.cy, rc1, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);\n }\n }\n\n // Or is the outer ring just a circular arc?\n else context.moveTo(x01, y01), context.arc(0, 0, r1, a01, a11, !cw);\n\n // Is there no inner ring, and it’s a circular sector?\n // Or perhaps it’s an annular sector collapsed due to padding?\n if (!(r0 > epsilon) || !(da0 > epsilon)) context.lineTo(x10, y10);\n\n // Does the sector’s inner ring (or point) have rounded corners?\n else if (rc0 > epsilon) {\n t0 = cornerTangents(x10, y10, x11, y11, r0, -rc0, cw);\n t1 = cornerTangents(x01, y01, x00, y00, r0, -rc0, cw);\n\n context.lineTo(t0.cx + t0.x01, t0.cy + t0.y01);\n\n // Have the corners merged?\n if (rc0 < rc) context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);\n\n // Otherwise, draw the two corners and the ring.\n else {\n context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);\n context.arc(0, 0, r0, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), cw);\n context.arc(t1.cx, t1.cy, rc0, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);\n }\n }\n\n // Or is the inner ring just a circular arc?\n else context.arc(0, 0, r0, a10, a00, cw);\n }\n\n context.closePath();\n\n if (buffer) return context = null, buffer + \"\" || null;\n }\n\n arc.centroid = function() {\n var r = (+innerRadius.apply(this, arguments) + +outerRadius.apply(this, arguments)) / 2,\n a = (+startAngle.apply(this, arguments) + +endAngle.apply(this, arguments)) / 2 - pi / 2;\n return [cos(a) * r, sin(a) * r];\n };\n\n arc.innerRadius = function(_) {\n return arguments.length ? (innerRadius = typeof _ === \"function\" ? _ : constant(+_), arc) : innerRadius;\n };\n\n arc.outerRadius = function(_) {\n return arguments.length ? (outerRadius = typeof _ === \"function\" ? _ : constant(+_), arc) : outerRadius;\n };\n\n arc.cornerRadius = function(_) {\n return arguments.length ? (cornerRadius = typeof _ === \"function\" ? _ : constant(+_), arc) : cornerRadius;\n };\n\n arc.padRadius = function(_) {\n return arguments.length ? (padRadius = _ == null ? null : typeof _ === \"function\" ? _ : constant(+_), arc) : padRadius;\n };\n\n arc.startAngle = function(_) {\n return arguments.length ? (startAngle = typeof _ === \"function\" ? _ : constant(+_), arc) : startAngle;\n };\n\n arc.endAngle = function(_) {\n return arguments.length ? (endAngle = typeof _ === \"function\" ? _ : constant(+_), arc) : endAngle;\n };\n\n arc.padAngle = function(_) {\n return arguments.length ? (padAngle = typeof _ === \"function\" ? _ : constant(+_), arc) : padAngle;\n };\n\n arc.context = function(_) {\n return arguments.length ? ((context = _ == null ? null : _), arc) : context;\n };\n\n return arc;\n}\n","export default function(a, b) {\n return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN;\n}\n","export default function(d) {\n return d;\n}\n","import array from \"./array.js\";\nimport constant from \"./constant.js\";\nimport descending from \"./descending.js\";\nimport identity from \"./identity.js\";\nimport {tau} from \"./math.js\";\n\nexport default function() {\n var value = identity,\n sortValues = descending,\n sort = null,\n startAngle = constant(0),\n endAngle = constant(tau),\n padAngle = constant(0);\n\n function pie(data) {\n var i,\n n = (data = array(data)).length,\n j,\n k,\n sum = 0,\n index = new Array(n),\n arcs = new Array(n),\n a0 = +startAngle.apply(this, arguments),\n da = Math.min(tau, Math.max(-tau, endAngle.apply(this, arguments) - a0)),\n a1,\n p = Math.min(Math.abs(da) / n, padAngle.apply(this, arguments)),\n pa = p * (da < 0 ? -1 : 1),\n v;\n\n for (i = 0; i < n; ++i) {\n if ((v = arcs[index[i] = i] = +value(data[i], i, data)) > 0) {\n sum += v;\n }\n }\n\n // Optionally sort the arcs by previously-computed values or by data.\n if (sortValues != null) index.sort(function(i, j) { return sortValues(arcs[i], arcs[j]); });\n else if (sort != null) index.sort(function(i, j) { return sort(data[i], data[j]); });\n\n // Compute the arcs! They are stored in the original data's order.\n for (i = 0, k = sum ? (da - n * pa) / sum : 0; i < n; ++i, a0 = a1) {\n j = index[i], v = arcs[j], a1 = a0 + (v > 0 ? v * k : 0) + pa, arcs[j] = {\n data: data[j],\n index: i,\n value: v,\n startAngle: a0,\n endAngle: a1,\n padAngle: p\n };\n }\n\n return arcs;\n }\n\n pie.value = function(_) {\n return arguments.length ? (value = typeof _ === \"function\" ? _ : constant(+_), pie) : value;\n };\n\n pie.sortValues = function(_) {\n return arguments.length ? (sortValues = _, sort = null, pie) : sortValues;\n };\n\n pie.sort = function(_) {\n return arguments.length ? (sort = _, sortValues = null, pie) : sort;\n };\n\n pie.startAngle = function(_) {\n return arguments.length ? (startAngle = typeof _ === \"function\" ? _ : constant(+_), pie) : startAngle;\n };\n\n pie.endAngle = function(_) {\n return arguments.length ? (endAngle = typeof _ === \"function\" ? _ : constant(+_), pie) : endAngle;\n };\n\n pie.padAngle = function(_) {\n return arguments.length ? (padAngle = typeof _ === \"function\" ? _ : constant(+_), pie) : padAngle;\n };\n\n return pie;\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\r\nimport isEqual from 'fast-deep-equal';\r\nimport { pie, arc } from 'd3-shape';\r\nimport { useState } from 'react';\r\nimport { H2, P } from '@undp/design-system-react/Typography';\r\nimport { Modal } from '@undp/design-system-react/Modal';\r\n\r\nimport { ClassNameObject, DonutChartDataType, StyleObject } from '@/Types';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport { string2HTML } from '@/Utils/string2HTML';\r\n\r\ninterface Props {\r\n mainText?: string | { label: string; suffix?: string; prefix?: string };\r\n radius: number;\r\n colors: string[];\r\n subNote?: string;\r\n strokeWidth: number;\r\n data: DonutChartDataType[];\r\n\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n\r\n onSeriesMouseOver?: (_d: any) => void;\r\n\r\n onSeriesMouseClick?: (_d: any) => void;\r\n colorDomain: string[];\r\n resetSelectionOnDoubleClick: boolean;\r\n\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n precision: number;\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n const {\r\n mainText,\r\n data,\r\n radius,\r\n colors,\r\n subNote,\r\n strokeWidth,\r\n tooltip,\r\n onSeriesMouseOver,\r\n onSeriesMouseClick,\r\n colorDomain,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n precision,\r\n } = props;\r\n const pieData = pie()\r\n .sort(null)\r\n .startAngle(0)\r\n\r\n .value((d: any) => d.size);\r\n\r\n const [mouseOverData, setMouseOverData] = useState<any>(undefined);\r\n\r\n const [mouseClickData, setMouseClickData] = useState<any>(undefined);\r\n const [eventX, setEventX] = useState<number | undefined>(undefined);\r\n const [eventY, setEventY] = useState<number | undefined>(undefined);\r\n return (\r\n <>\r\n <svg\r\n width={`${radius * 2}px`}\r\n height={`${radius * 2}px`}\r\n viewBox={`0 0 ${radius * 2} ${radius * 2}`}\r\n direction='ltr'\r\n className='mx-auto'\r\n >\r\n <g transform={`translate(${radius} ${radius})`}>\r\n {mainText || subNote ? (\r\n <foreignObject\r\n y={0 - (radius - strokeWidth)}\r\n x={0 - (radius - strokeWidth)}\r\n width={2 * (radius - strokeWidth)}\r\n height={2 * (radius - strokeWidth)}\r\n >\r\n <div className='flex flex-col gap-0.5 justify-center items-center h-inherit py-0 px-4'>\r\n {mainText ? (\r\n <H2\r\n marginBottom='none'\r\n className='donut-main-text text-primary-gray-700 dark:text-primary-gray-100 leading-none text-center'\r\n >\r\n {typeof mainText === 'string'\r\n ? mainText\r\n : data.findIndex(d => d.label === mainText.label) !== -1\r\n ? numberFormattingFunction(\r\n data[data.findIndex(d => d.label === mainText.label)].size,\r\n 'NA',\r\n precision,\r\n mainText.prefix,\r\n mainText.suffix,\r\n )\r\n : 'NA'}\r\n </H2>\r\n ) : null}\r\n {subNote ? (\r\n <P\r\n marginBottom='none'\r\n size='base'\r\n leading='none'\r\n className='donut-sub-note text-primary-gray-700 dark:text-primary-gray-100 text-center font-bold'\r\n >\r\n {subNote}\r\n </P>\r\n ) : typeof mainText === 'string' || !mainText ? null : (\r\n <P\r\n size='base'\r\n marginBottom='none'\r\n leading='none'\r\n className='donut-label text-primary-gray-700 dark:text-primary-gray-100 text-center font-bold'\r\n >\r\n {mainText.label}\r\n </P>\r\n )}\r\n </div>\r\n </foreignObject>\r\n ) : null}\r\n {pieData(data as any).map((d, i) => (\r\n <path\r\n key={i}\r\n d={\r\n arc()({\r\n innerRadius: radius - strokeWidth,\r\n outerRadius: radius,\r\n startAngle: d.startAngle,\r\n endAngle: d.endAngle,\r\n }) as string\r\n }\r\n style={{\r\n fill:\r\n colorDomain.indexOf((d.data as any).label) !== -1\r\n ? colors[colorDomain.indexOf((d.data as any).label) % colors.length]\r\n : Colors.gray,\r\n opacity: mouseOverData\r\n ? mouseOverData.label === (d.data as any).label\r\n ? 1\r\n : 0.3\r\n : 1,\r\n }}\r\n onMouseEnter={event => {\r\n setMouseOverData(d.data);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n onSeriesMouseOver?.(d);\r\n }}\r\n onClick={() => {\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (isEqual(mouseClickData, d.data) && resetSelectionOnDoubleClick) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(d.data);\r\n if (onSeriesMouseClick) onSeriesMouseClick(d.data);\r\n }\r\n }\r\n }}\r\n onMouseMove={event => {\r\n setMouseOverData(d.data);\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 />\r\n ))}\r\n </g>\r\n </svg>\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 {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 </>\r\n );\r\n}\r\n","import { useEffect, useRef, useState } from 'react';\r\nimport { P } from '@undp/design-system-react/Typography';\r\nimport orderBy from 'lodash.orderby';\r\nimport { Spacer } from '@undp/design-system-react/Spacer';\r\nimport { cn } from '@undp/design-system-react/cn';\r\n\r\nimport { Graph } from './Graph';\r\n\r\nimport {\r\n DonutChartDataType,\r\n Languages,\r\n SourcesDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n} from '@/Types';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { EmptyState } from '@/Components/Elements/EmptyState';\r\nimport { GraphArea, GraphContainer } from '@/Components/Elements/GraphContainer';\r\n\r\ninterface Props {\r\n // Data\r\n /** Array of data objects */\r\n data: DonutChartDataType[];\r\n\r\n // Titles, Labels, and Sources\r\n /** Title of the graph */\r\n graphTitle?: string | React.ReactNode;\r\n /** Description of the graph */\r\n graphDescription?: string | React.ReactNode;\r\n /** Footnote for the graph */\r\n footNote?: string | React.ReactNode;\r\n /** Source data for the graph */\r\n sources?: SourcesDataType[];\r\n /** Accessibility label */\r\n ariaLabel?: string;\r\n\r\n // Colors and Styling\r\n /** Array of colors for each segment */\r\n colors?: string[];\r\n /** Domain of colors for the graph */\r\n colorDomain?: 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 /** Radius of the donut chart */\r\n radius?: number;\r\n\r\n // Values and Ticks\r\n /** Prefix for values */\r\n prefix?: string;\r\n /** Suffix for values */\r\n suffix?: string;\r\n\r\n // Graph Parameters\r\n /** Toggle visibility of color scale. This is only applicable if the data props hae color parameter */\r\n showColorScale?: boolean;\r\n /** Max width of the color scale as a css property */\r\n colorScaleMaxWidth?: string;\r\n /** Stroke width of the arcs and circle of the donut */\r\n strokeWidth?: number;\r\n /** Sorting order for data. This is overwritten by labelOrder prop */\r\n sortData?: 'asc' | 'desc';\r\n /** Large text at the center of the donut chart. If the type is an object then the text is the value in the data for the label mentioned in the object */\r\n mainText?: string | { label: string; suffix?: string; prefix?: string };\r\n /** Small text at the center of the donut chart */\r\n subNote?: string;\r\n /** Specifies the number of decimal places to display in the value. */\r\n precision?: number;\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 DonutChart(props: Props) {\r\n const {\r\n mainText,\r\n graphTitle,\r\n colors = Colors.light.categoricalColors.colors,\r\n suffix = '',\r\n sources,\r\n prefix = '',\r\n strokeWidth = 50,\r\n graphDescription,\r\n subNote,\r\n footNote,\r\n radius,\r\n data,\r\n showColorScale = true,\r\n padding,\r\n backgroundColor = false,\r\n tooltip,\r\n onSeriesMouseOver,\r\n graphID,\r\n onSeriesMouseClick,\r\n graphDownload = false,\r\n dataDownload = false,\r\n colorDomain,\r\n sortData,\r\n language = 'en',\r\n theme = 'light',\r\n width,\r\n height,\r\n minHeight = 0,\r\n relativeHeight,\r\n ariaLabel,\r\n resetSelectionOnDoubleClick = true,\r\n colorScaleMaxWidth,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n precision = 2,\r\n } = props;\r\n\r\n const [graphRadius, setGraphRadius] = useState(0);\r\n\r\n const graphDiv = useRef<HTMLDivElement>(null);\r\n const graphParentDiv = useRef<HTMLDivElement>(null);\r\n\r\n useEffect(() => {\r\n const resizeObserver = new ResizeObserver(entries => {\r\n setGraphRadius(\r\n (Math.min(\r\n ...[\r\n entries[0].target.clientWidth || 620,\r\n entries[0].target.clientHeight || 480,\r\n radius || Infinity,\r\n ],\r\n ) || 420) / 2,\r\n );\r\n });\r\n if (graphDiv.current) {\r\n resizeObserver.observe(graphDiv.current);\r\n }\r\n return () => resizeObserver.disconnect();\r\n }, [radius]);\r\n\r\n const sortedData = sortData ? orderBy(data, ['size'], [sortData]) : data;\r\n\r\n return (\r\n <GraphContainer\r\n className={classNames?.graphContainer}\r\n style={styles?.graphContainer}\r\n id={graphID}\r\n ref={graphParentDiv}\r\n aria-label={ariaLabel}\r\n backgroundColor={backgroundColor}\r\n theme={theme}\r\n language={language}\r\n minHeight={minHeight}\r\n width={width}\r\n height={height}\r\n relativeHeight={relativeHeight}\r\n padding={padding}\r\n >\r\n {graphTitle || graphDescription || graphDownload || dataDownload ? (\r\n <GraphHeader\r\n styles={{\r\n title: styles?.title,\r\n description: styles?.description,\r\n }}\r\n classNames={{\r\n title: classNames?.title,\r\n description: classNames?.description,\r\n }}\r\n graphTitle={graphTitle}\r\n graphDescription={graphDescription}\r\n width={width}\r\n graphDownload={graphDownload ? graphParentDiv : undefined}\r\n dataDownload={\r\n dataDownload\r\n ? data.map(d => d.data).filter(d => d !== undefined).length > 0\r\n ? data.map(d => d.data).filter(d => d !== undefined)\r\n : data.filter(d => d !== undefined)\r\n : null\r\n }\r\n />\r\n ) : null}\r\n {data.length === 0 ? (\r\n <EmptyState />\r\n ) : (\r\n <>\r\n {showColorScale ? (\r\n <div\r\n className={cn(\r\n 'leading-0 flex mb-0 ml-auto mr-auto justify-center gap-x-3 gap-y-0 flex-wrap',\r\n classNames?.colorLegend,\r\n )}\r\n style={{ maxWidth: colorScaleMaxWidth }}\r\n aria-label='Color legend'\r\n >\r\n {sortedData.map((d, i) => (\r\n <div className='flex gap-2 items-center pb-3' key={i}>\r\n <div\r\n className='w-3 h-3 rounded-full'\r\n style={{\r\n backgroundColor:\r\n (colorDomain || sortedData.map(el => el.label)).indexOf(d.label) !== -1\r\n ? (colors || Colors[theme].categoricalColors.colors)[\r\n (colorDomain || sortedData.map(el => el.label)).indexOf(d.label) %\r\n (colors || Colors[theme].categoricalColors.colors).length\r\n ]\r\n : Colors.gray,\r\n }}\r\n />\r\n <P\r\n marginBottom='none'\r\n size='sm'\r\n className='text-primary-gray-700 dark:text-primary-gray-100'\r\n >\r\n {d.label}:{' '}\r\n <span className='font-bold' style={{ fontSize: 'inherit' }}>\r\n {numberFormattingFunction(d.size, 'NA', precision, prefix, suffix)}\r\n </span>\r\n </P>\r\n </div>\r\n ))}\r\n </div>\r\n ) : null}\r\n <Spacer size='lg' />\r\n <GraphArea ref={graphDiv}>\r\n {graphRadius ? (\r\n <Graph\r\n mainText={mainText}\r\n data={sortedData}\r\n colors={colors}\r\n radius={graphRadius}\r\n subNote={subNote}\r\n strokeWidth={strokeWidth}\r\n tooltip={tooltip}\r\n colorDomain={colorDomain || sortedData.map(d => d.label)}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n styles={styles}\r\n detailsOnClick={detailsOnClick}\r\n precision={precision}\r\n />\r\n ) : null}\r\n </GraphArea>\r\n </>\r\n )}\r\n {sources || footNote ? (\r\n <GraphFooter\r\n styles={{ footnote: styles?.footnote, source: styles?.source }}\r\n classNames={{\r\n footnote: classNames?.footnote,\r\n source: classNames?.source,\r\n }}\r\n sources={sources}\r\n footNote={footNote}\r\n width={width}\r\n />\r\n ) : null}\r\n </GraphContainer>\r\n );\r\n}\r\n"],"names":["abs","atan2","cos","max","min","sin","sqrt","epsilon","pi","halfPi","tau","acos","x","asin","arcInnerRadius","d","arcOuterRadius","arcStartAngle","arcEndAngle","arcPadAngle","intersect","x0","y0","x1","y1","x2","y2","x3","y3","x10","y10","x32","y32","t","cornerTangents","r1","rc","cw","x01","y01","lo","ox","oy","x11","y11","x00","y00","dx","dy","d2","r","D","cx0","cy0","cx1","cy1","dx0","dy0","dx1","dy1","arc","innerRadius","outerRadius","cornerRadius","constant","padRadius","startAngle","endAngle","padAngle","context","path","withPath","buffer","r0","a0","a1","da","a01","a11","a00","a10","da0","da1","ap","rp","rc0","rc1","t0","t1","p0","p1","oc","ax","ay","bx","by","kc","lc","a","_","descending","b","identity","pie","value","sortValues","sort","data","i","n","array","j","k","sum","index","arcs","p","pa","v","Graph","props","$","_c","mainText","radius","colors","subNote","strokeWidth","tooltip","onSeriesMouseOver","onSeriesMouseClick","colorDomain","resetSelectionOnDoubleClick","detailsOnClick","styles","classNames","precision","pieData","_temp","mouseOverData","setMouseOverData","useState","undefined","mouseClickData","setMouseClickData","eventX","setEventX","eventY","setEventY","t2","t3","t4","t5","t6","jsx","jsxs","H2","findIndex","d_1","label","numberFormattingFunction","d_0","size","prefix","suffix","P","t7","d_2","fill","indexOf","length","Colors","gray","opacity","event","clientY","clientX","isEqual","event_0","t8","map","t9","t10","t11","Tooltip","t12","Modal","__html","string2HTML","t13","Fragment","DonutChart","graphTitle","light","categoricalColors","sources","graphDescription","footNote","showColorScale","padding","backgroundColor","graphID","graphDownload","dataDownload","sortData","language","theme","width","height","minHeight","relativeHeight","ariaLabel","colorScaleMaxWidth","graphRadius","setGraphRadius","graphDiv","useRef","graphParentDiv","useEffect","resizeObserver","ResizeObserver","entries","Math","target","clientWidth","clientHeight","Infinity","current","observe","disconnect","sortedData","orderBy","GraphContainer","graphContainer","GraphHeader","title","description","filter","EmptyState","cn","colorLegend","maxWidth","el","fontSize","Spacer","GraphArea","GraphFooter","footnote","source"],"mappings":";;;;;;;;;;;;;;;;AAAO,MAAMA,KAAM,KAAK,KACXC,IAAQ,KAAK,OACbC,I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,EAAA,CAAqB,IAErB,KAAA,CACN;AAAA,IAAA,GACF;AAAA,IAED2D,KAAWE,IACV3C,gBAAAA,EAAAA,IAAC4F,IAAA,EACC,QAAQ;AAAA,MAAEC,UAAUjH,GAAQiH;AAAAA,MAAUC,QAAQlH,GAAQkH;AAAAA,IAAAA,GACtD,YAAY;AAAA,MACVD,UAAUhH,GAAYgH;AAAAA,MACtBC,QAAQjH,GAAYiH;AAAAA,IAAAA,GAEtB,SAAArD,GACA,UAAAE,GACA,OAAAU,EAAA,CAAa,IAEb;AAAA,EAAA,GACN;AAEJ;","x_google_ignoreList":[0,1,2,3,4]}
1
+ {"version":3,"file":"DonutChart.js","sources":["../node_modules/d3-shape/src/math.js","../node_modules/d3-shape/src/arc.js","../node_modules/d3-shape/src/descending.js","../node_modules/d3-shape/src/identity.js","../node_modules/d3-shape/src/pie.js","../src/Components/Graphs/DonutChart/Graph.tsx","../src/Components/Graphs/DonutChart/index.tsx"],"sourcesContent":["export const abs = Math.abs;\nexport const atan2 = Math.atan2;\nexport const cos = Math.cos;\nexport const max = Math.max;\nexport const min = Math.min;\nexport const sin = Math.sin;\nexport const sqrt = Math.sqrt;\n\nexport const epsilon = 1e-12;\nexport const pi = Math.PI;\nexport const halfPi = pi / 2;\nexport const tau = 2 * pi;\n\nexport function acos(x) {\n return x > 1 ? 0 : x < -1 ? pi : Math.acos(x);\n}\n\nexport function asin(x) {\n return x >= 1 ? halfPi : x <= -1 ? -halfPi : Math.asin(x);\n}\n","import constant from \"./constant.js\";\nimport {abs, acos, asin, atan2, cos, epsilon, halfPi, max, min, pi, sin, sqrt, tau} from \"./math.js\";\nimport {withPath} from \"./path.js\";\n\nfunction arcInnerRadius(d) {\n return d.innerRadius;\n}\n\nfunction arcOuterRadius(d) {\n return d.outerRadius;\n}\n\nfunction arcStartAngle(d) {\n return d.startAngle;\n}\n\nfunction arcEndAngle(d) {\n return d.endAngle;\n}\n\nfunction arcPadAngle(d) {\n return d && d.padAngle; // Note: optional!\n}\n\nfunction intersect(x0, y0, x1, y1, x2, y2, x3, y3) {\n var x10 = x1 - x0, y10 = y1 - y0,\n x32 = x3 - x2, y32 = y3 - y2,\n t = y32 * x10 - x32 * y10;\n if (t * t < epsilon) return;\n t = (x32 * (y0 - y2) - y32 * (x0 - x2)) / t;\n return [x0 + t * x10, y0 + t * y10];\n}\n\n// Compute perpendicular offset line of length rc.\n// http://mathworld.wolfram.com/Circle-LineIntersection.html\nfunction cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / sqrt(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * sqrt(max(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}\n\nexport default function() {\n var innerRadius = arcInnerRadius,\n outerRadius = arcOuterRadius,\n cornerRadius = constant(0),\n padRadius = null,\n startAngle = arcStartAngle,\n endAngle = arcEndAngle,\n padAngle = arcPadAngle,\n context = null,\n path = withPath(arc);\n\n function arc() {\n var buffer,\n r,\n r0 = +innerRadius.apply(this, arguments),\n r1 = +outerRadius.apply(this, arguments),\n a0 = startAngle.apply(this, arguments) - halfPi,\n a1 = endAngle.apply(this, arguments) - halfPi,\n da = abs(a1 - a0),\n cw = a1 > a0;\n\n if (!context) context = buffer = path();\n\n // Ensure that the outer radius is always larger than the inner radius.\n if (r1 < r0) r = r1, r1 = r0, r0 = r;\n\n // Is it a point?\n if (!(r1 > epsilon)) context.moveTo(0, 0);\n\n // Or is it a circle or annulus?\n else if (da > tau - epsilon) {\n context.moveTo(r1 * cos(a0), r1 * sin(a0));\n context.arc(0, 0, r1, a0, a1, !cw);\n if (r0 > epsilon) {\n context.moveTo(r0 * cos(a1), r0 * sin(a1));\n context.arc(0, 0, r0, a1, a0, cw);\n }\n }\n\n // Or is it a circular or annular sector?\n else {\n var a01 = a0,\n a11 = a1,\n a00 = a0,\n a10 = a1,\n da0 = da,\n da1 = da,\n ap = padAngle.apply(this, arguments) / 2,\n rp = (ap > epsilon) && (padRadius ? +padRadius.apply(this, arguments) : sqrt(r0 * r0 + r1 * r1)),\n rc = min(abs(r1 - r0) / 2, +cornerRadius.apply(this, arguments)),\n rc0 = rc,\n rc1 = rc,\n t0,\n t1;\n\n // Apply padding? Note that since r1 ≥ r0, da1 ≥ da0.\n if (rp > epsilon) {\n var p0 = asin(rp / r0 * sin(ap)),\n p1 = asin(rp / r1 * sin(ap));\n if ((da0 -= p0 * 2) > epsilon) p0 *= (cw ? 1 : -1), a00 += p0, a10 -= p0;\n else da0 = 0, a00 = a10 = (a0 + a1) / 2;\n if ((da1 -= p1 * 2) > epsilon) p1 *= (cw ? 1 : -1), a01 += p1, a11 -= p1;\n else da1 = 0, a01 = a11 = (a0 + a1) / 2;\n }\n\n var x01 = r1 * cos(a01),\n y01 = r1 * sin(a01),\n x10 = r0 * cos(a10),\n y10 = r0 * sin(a10);\n\n // Apply rounded corners?\n if (rc > epsilon) {\n var x11 = r1 * cos(a11),\n y11 = r1 * sin(a11),\n x00 = r0 * cos(a00),\n y00 = r0 * sin(a00),\n oc;\n\n // Restrict the corner radius according to the sector angle. If this\n // intersection fails, it’s probably because the arc is too small, so\n // disable the corner radius entirely.\n if (da < pi) {\n if (oc = intersect(x01, y01, x00, y00, x11, y11, x10, y10)) {\n var ax = x01 - oc[0],\n ay = y01 - oc[1],\n bx = x11 - oc[0],\n by = y11 - oc[1],\n kc = 1 / sin(acos((ax * bx + ay * by) / (sqrt(ax * ax + ay * ay) * sqrt(bx * bx + by * by))) / 2),\n lc = sqrt(oc[0] * oc[0] + oc[1] * oc[1]);\n rc0 = min(rc, (r0 - lc) / (kc - 1));\n rc1 = min(rc, (r1 - lc) / (kc + 1));\n } else {\n rc0 = rc1 = 0;\n }\n }\n }\n\n // Is the sector collapsed to a line?\n if (!(da1 > epsilon)) context.moveTo(x01, y01);\n\n // Does the sector’s outer ring have rounded corners?\n else if (rc1 > epsilon) {\n t0 = cornerTangents(x00, y00, x01, y01, r1, rc1, cw);\n t1 = cornerTangents(x11, y11, x10, y10, r1, rc1, cw);\n\n context.moveTo(t0.cx + t0.x01, t0.cy + t0.y01);\n\n // Have the corners merged?\n if (rc1 < rc) context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);\n\n // Otherwise, draw the two corners and the ring.\n else {\n context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);\n context.arc(0, 0, r1, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), !cw);\n context.arc(t1.cx, t1.cy, rc1, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);\n }\n }\n\n // Or is the outer ring just a circular arc?\n else context.moveTo(x01, y01), context.arc(0, 0, r1, a01, a11, !cw);\n\n // Is there no inner ring, and it’s a circular sector?\n // Or perhaps it’s an annular sector collapsed due to padding?\n if (!(r0 > epsilon) || !(da0 > epsilon)) context.lineTo(x10, y10);\n\n // Does the sector’s inner ring (or point) have rounded corners?\n else if (rc0 > epsilon) {\n t0 = cornerTangents(x10, y10, x11, y11, r0, -rc0, cw);\n t1 = cornerTangents(x01, y01, x00, y00, r0, -rc0, cw);\n\n context.lineTo(t0.cx + t0.x01, t0.cy + t0.y01);\n\n // Have the corners merged?\n if (rc0 < rc) context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);\n\n // Otherwise, draw the two corners and the ring.\n else {\n context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);\n context.arc(0, 0, r0, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), cw);\n context.arc(t1.cx, t1.cy, rc0, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);\n }\n }\n\n // Or is the inner ring just a circular arc?\n else context.arc(0, 0, r0, a10, a00, cw);\n }\n\n context.closePath();\n\n if (buffer) return context = null, buffer + \"\" || null;\n }\n\n arc.centroid = function() {\n var r = (+innerRadius.apply(this, arguments) + +outerRadius.apply(this, arguments)) / 2,\n a = (+startAngle.apply(this, arguments) + +endAngle.apply(this, arguments)) / 2 - pi / 2;\n return [cos(a) * r, sin(a) * r];\n };\n\n arc.innerRadius = function(_) {\n return arguments.length ? (innerRadius = typeof _ === \"function\" ? _ : constant(+_), arc) : innerRadius;\n };\n\n arc.outerRadius = function(_) {\n return arguments.length ? (outerRadius = typeof _ === \"function\" ? _ : constant(+_), arc) : outerRadius;\n };\n\n arc.cornerRadius = function(_) {\n return arguments.length ? (cornerRadius = typeof _ === \"function\" ? _ : constant(+_), arc) : cornerRadius;\n };\n\n arc.padRadius = function(_) {\n return arguments.length ? (padRadius = _ == null ? null : typeof _ === \"function\" ? _ : constant(+_), arc) : padRadius;\n };\n\n arc.startAngle = function(_) {\n return arguments.length ? (startAngle = typeof _ === \"function\" ? _ : constant(+_), arc) : startAngle;\n };\n\n arc.endAngle = function(_) {\n return arguments.length ? (endAngle = typeof _ === \"function\" ? _ : constant(+_), arc) : endAngle;\n };\n\n arc.padAngle = function(_) {\n return arguments.length ? (padAngle = typeof _ === \"function\" ? _ : constant(+_), arc) : padAngle;\n };\n\n arc.context = function(_) {\n return arguments.length ? ((context = _ == null ? null : _), arc) : context;\n };\n\n return arc;\n}\n","export default function(a, b) {\n return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN;\n}\n","export default function(d) {\n return d;\n}\n","import array from \"./array.js\";\nimport constant from \"./constant.js\";\nimport descending from \"./descending.js\";\nimport identity from \"./identity.js\";\nimport {tau} from \"./math.js\";\n\nexport default function() {\n var value = identity,\n sortValues = descending,\n sort = null,\n startAngle = constant(0),\n endAngle = constant(tau),\n padAngle = constant(0);\n\n function pie(data) {\n var i,\n n = (data = array(data)).length,\n j,\n k,\n sum = 0,\n index = new Array(n),\n arcs = new Array(n),\n a0 = +startAngle.apply(this, arguments),\n da = Math.min(tau, Math.max(-tau, endAngle.apply(this, arguments) - a0)),\n a1,\n p = Math.min(Math.abs(da) / n, padAngle.apply(this, arguments)),\n pa = p * (da < 0 ? -1 : 1),\n v;\n\n for (i = 0; i < n; ++i) {\n if ((v = arcs[index[i] = i] = +value(data[i], i, data)) > 0) {\n sum += v;\n }\n }\n\n // Optionally sort the arcs by previously-computed values or by data.\n if (sortValues != null) index.sort(function(i, j) { return sortValues(arcs[i], arcs[j]); });\n else if (sort != null) index.sort(function(i, j) { return sort(data[i], data[j]); });\n\n // Compute the arcs! They are stored in the original data's order.\n for (i = 0, k = sum ? (da - n * pa) / sum : 0; i < n; ++i, a0 = a1) {\n j = index[i], v = arcs[j], a1 = a0 + (v > 0 ? v * k : 0) + pa, arcs[j] = {\n data: data[j],\n index: i,\n value: v,\n startAngle: a0,\n endAngle: a1,\n padAngle: p\n };\n }\n\n return arcs;\n }\n\n pie.value = function(_) {\n return arguments.length ? (value = typeof _ === \"function\" ? _ : constant(+_), pie) : value;\n };\n\n pie.sortValues = function(_) {\n return arguments.length ? (sortValues = _, sort = null, pie) : sortValues;\n };\n\n pie.sort = function(_) {\n return arguments.length ? (sort = _, sortValues = null, pie) : sort;\n };\n\n pie.startAngle = function(_) {\n return arguments.length ? (startAngle = typeof _ === \"function\" ? _ : constant(+_), pie) : startAngle;\n };\n\n pie.endAngle = function(_) {\n return arguments.length ? (endAngle = typeof _ === \"function\" ? _ : constant(+_), pie) : endAngle;\n };\n\n pie.padAngle = function(_) {\n return arguments.length ? (padAngle = typeof _ === \"function\" ? _ : constant(+_), pie) : padAngle;\n };\n\n return pie;\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\r\nimport isEqual from 'fast-deep-equal';\r\nimport { pie, arc } from 'd3-shape';\r\nimport { useState } from 'react';\r\nimport { H2, P } from '@undp/design-system-react/Typography';\r\n\r\nimport { ClassNameObject, DonutChartDataType, StyleObject } from '@/Types';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport { DetailsModal } from '@/Components/Elements/DetailsModal';\r\n\r\ninterface Props {\r\n mainText?: string | { label: string; suffix?: string; prefix?: string };\r\n radius: number;\r\n colors: string[];\r\n subNote?: string;\r\n strokeWidth: number;\r\n data: DonutChartDataType[];\r\n\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n\r\n onSeriesMouseOver?: (_d: any) => void;\r\n\r\n onSeriesMouseClick?: (_d: any) => void;\r\n colorDomain: string[];\r\n resetSelectionOnDoubleClick: boolean;\r\n\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n precision: number;\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n const {\r\n mainText,\r\n data,\r\n radius,\r\n colors,\r\n subNote,\r\n strokeWidth,\r\n tooltip,\r\n onSeriesMouseOver,\r\n onSeriesMouseClick,\r\n colorDomain,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n precision,\r\n } = props;\r\n const pieData = pie()\r\n .sort(null)\r\n .startAngle(0)\r\n\r\n .value((d: any) => d.size);\r\n\r\n const [mouseOverData, setMouseOverData] = useState<any>(undefined);\r\n\r\n const [mouseClickData, setMouseClickData] = useState<any>(undefined);\r\n const [eventX, setEventX] = useState<number | undefined>(undefined);\r\n const [eventY, setEventY] = useState<number | undefined>(undefined);\r\n return (\r\n <>\r\n <svg\r\n width={`${radius * 2}px`}\r\n height={`${radius * 2}px`}\r\n viewBox={`0 0 ${radius * 2} ${radius * 2}`}\r\n direction='ltr'\r\n className='mx-auto'\r\n >\r\n <g transform={`translate(${radius} ${radius})`}>\r\n {mainText || subNote ? (\r\n <foreignObject\r\n y={0 - (radius - strokeWidth)}\r\n x={0 - (radius - strokeWidth)}\r\n width={2 * (radius - strokeWidth)}\r\n height={2 * (radius - strokeWidth)}\r\n >\r\n <div className='flex flex-col gap-0.5 justify-center items-center h-inherit py-0 px-4'>\r\n {mainText ? (\r\n <H2\r\n marginBottom='none'\r\n className='donut-main-text text-primary-gray-700 dark:text-primary-gray-100 leading-none text-center'\r\n >\r\n {typeof mainText === 'string'\r\n ? mainText\r\n : data.findIndex(d => d.label === mainText.label) !== -1\r\n ? numberFormattingFunction(\r\n data[data.findIndex(d => d.label === mainText.label)].size,\r\n 'NA',\r\n precision,\r\n mainText.prefix,\r\n mainText.suffix,\r\n )\r\n : 'NA'}\r\n </H2>\r\n ) : null}\r\n {subNote ? (\r\n <P\r\n marginBottom='none'\r\n size='base'\r\n leading='none'\r\n className='donut-sub-note text-primary-gray-700 dark:text-primary-gray-100 text-center font-bold'\r\n >\r\n {subNote}\r\n </P>\r\n ) : typeof mainText === 'string' || !mainText ? null : (\r\n <P\r\n size='base'\r\n marginBottom='none'\r\n leading='none'\r\n className='donut-label text-primary-gray-700 dark:text-primary-gray-100 text-center font-bold'\r\n >\r\n {mainText.label}\r\n </P>\r\n )}\r\n </div>\r\n </foreignObject>\r\n ) : null}\r\n {pieData(data as any).map((d, i) => (\r\n <path\r\n key={i}\r\n d={\r\n arc()({\r\n innerRadius: radius - strokeWidth,\r\n outerRadius: radius,\r\n startAngle: d.startAngle,\r\n endAngle: d.endAngle,\r\n }) as string\r\n }\r\n style={{\r\n fill:\r\n colorDomain.indexOf((d.data as any).label) !== -1\r\n ? colors[colorDomain.indexOf((d.data as any).label) % colors.length]\r\n : Colors.gray,\r\n opacity: mouseOverData\r\n ? mouseOverData.label === (d.data as any).label\r\n ? 1\r\n : 0.3\r\n : 1,\r\n }}\r\n onMouseEnter={event => {\r\n setMouseOverData(d.data);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n onSeriesMouseOver?.(d);\r\n }}\r\n onClick={() => {\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (isEqual(mouseClickData, d.data) && resetSelectionOnDoubleClick) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(d.data);\r\n if (onSeriesMouseClick) onSeriesMouseClick(d.data);\r\n }\r\n }\r\n }}\r\n onMouseMove={event => {\r\n setMouseOverData(d.data);\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 />\r\n ))}\r\n </g>\r\n </svg>\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 {detailsOnClick && mouseClickData !== undefined ? (\r\n <DetailsModal\r\n body={detailsOnClick}\r\n data={mouseClickData}\r\n setData={setMouseClickData}\r\n className={classNames?.modal}\r\n />\r\n ) : null}\r\n </>\r\n );\r\n}\r\n","import { useEffect, useRef, useState } from 'react';\r\nimport { P } from '@undp/design-system-react/Typography';\r\nimport orderBy from 'lodash.orderby';\r\nimport { Spacer } from '@undp/design-system-react/Spacer';\r\nimport { cn } from '@undp/design-system-react/cn';\r\n\r\nimport { Graph } from './Graph';\r\n\r\nimport {\r\n DonutChartDataType,\r\n Languages,\r\n SourcesDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n} from '@/Types';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { EmptyState } from '@/Components/Elements/EmptyState';\r\nimport { GraphArea, GraphContainer } from '@/Components/Elements/GraphContainer';\r\n\r\ninterface Props {\r\n // Data\r\n /** Array of data objects */\r\n data: DonutChartDataType[];\r\n\r\n // Titles, Labels, and Sources\r\n /** Title of the graph */\r\n graphTitle?: string | React.ReactNode;\r\n /** Description of the graph */\r\n graphDescription?: string | React.ReactNode;\r\n /** Footnote for the graph */\r\n footNote?: string | React.ReactNode;\r\n /** Source data for the graph */\r\n sources?: SourcesDataType[];\r\n /** Accessibility label */\r\n ariaLabel?: string;\r\n\r\n // Colors and Styling\r\n /** Array of colors for each segment */\r\n colors?: string[];\r\n /** Domain of colors for the graph */\r\n colorDomain?: 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 /** Radius of the donut chart */\r\n radius?: number;\r\n\r\n // Values and Ticks\r\n /** Prefix for values */\r\n prefix?: string;\r\n /** Suffix for values */\r\n suffix?: string;\r\n\r\n // Graph Parameters\r\n /** Toggle visibility of color scale. This is only applicable if the data props hae color parameter */\r\n showColorScale?: boolean;\r\n /** Max width of the color scale as a css property */\r\n colorScaleMaxWidth?: string;\r\n /** Stroke width of the arcs and circle of the donut */\r\n strokeWidth?: number;\r\n /** Sorting order for data. This is overwritten by labelOrder prop */\r\n sortData?: 'asc' | 'desc';\r\n /** Large text at the center of the donut chart. If the type is an object then the text is the value in the data for the label mentioned in the object */\r\n mainText?: string | { label: string; suffix?: string; prefix?: string };\r\n /** Small text at the center of the donut chart */\r\n subNote?: string;\r\n /** Specifies the number of decimal places to display in the value. */\r\n precision?: number;\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 DonutChart(props: Props) {\r\n const {\r\n mainText,\r\n graphTitle,\r\n colors = Colors.light.categoricalColors.colors,\r\n suffix = '',\r\n sources,\r\n prefix = '',\r\n strokeWidth = 50,\r\n graphDescription,\r\n subNote,\r\n footNote,\r\n radius,\r\n data,\r\n showColorScale = true,\r\n padding,\r\n backgroundColor = false,\r\n tooltip,\r\n onSeriesMouseOver,\r\n graphID,\r\n onSeriesMouseClick,\r\n graphDownload = false,\r\n dataDownload = false,\r\n colorDomain,\r\n sortData,\r\n language = 'en',\r\n theme = 'light',\r\n width,\r\n height,\r\n minHeight = 0,\r\n relativeHeight,\r\n ariaLabel,\r\n resetSelectionOnDoubleClick = true,\r\n colorScaleMaxWidth,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n precision = 2,\r\n } = props;\r\n\r\n const [graphRadius, setGraphRadius] = useState(0);\r\n\r\n const graphDiv = useRef<HTMLDivElement>(null);\r\n const graphParentDiv = useRef<HTMLDivElement>(null);\r\n\r\n useEffect(() => {\r\n const resizeObserver = new ResizeObserver(entries => {\r\n setGraphRadius(\r\n (Math.min(\r\n ...[\r\n entries[0].target.clientWidth || 620,\r\n entries[0].target.clientHeight || 480,\r\n radius || Infinity,\r\n ],\r\n ) || 420) / 2,\r\n );\r\n });\r\n if (graphDiv.current) {\r\n resizeObserver.observe(graphDiv.current);\r\n }\r\n return () => resizeObserver.disconnect();\r\n }, [radius]);\r\n\r\n const sortedData = sortData ? orderBy(data, ['size'], [sortData]) : data;\r\n\r\n return (\r\n <GraphContainer\r\n className={classNames?.graphContainer}\r\n style={styles?.graphContainer}\r\n id={graphID}\r\n ref={graphParentDiv}\r\n aria-label={ariaLabel}\r\n backgroundColor={backgroundColor}\r\n theme={theme}\r\n language={language}\r\n minHeight={minHeight}\r\n width={width}\r\n height={height}\r\n relativeHeight={relativeHeight}\r\n padding={padding}\r\n >\r\n {graphTitle || graphDescription || graphDownload || dataDownload ? (\r\n <GraphHeader\r\n styles={{\r\n title: styles?.title,\r\n description: styles?.description,\r\n }}\r\n classNames={{\r\n title: classNames?.title,\r\n description: classNames?.description,\r\n }}\r\n graphTitle={graphTitle}\r\n graphDescription={graphDescription}\r\n width={width}\r\n graphDownload={graphDownload ? graphParentDiv : undefined}\r\n dataDownload={\r\n dataDownload\r\n ? data.map(d => d.data).filter(d => d !== undefined).length > 0\r\n ? data.map(d => d.data).filter(d => d !== undefined)\r\n : data.filter(d => d !== undefined)\r\n : null\r\n }\r\n />\r\n ) : null}\r\n {data.length === 0 ? (\r\n <EmptyState />\r\n ) : (\r\n <>\r\n {showColorScale ? (\r\n <div\r\n className={cn(\r\n 'leading-0 flex mb-0 ml-auto mr-auto justify-center gap-x-3 gap-y-0 flex-wrap',\r\n classNames?.colorLegend,\r\n )}\r\n style={{ maxWidth: colorScaleMaxWidth }}\r\n aria-label='Color legend'\r\n >\r\n {sortedData.map((d, i) => (\r\n <div className='flex gap-2 items-center pb-3' key={i}>\r\n <div\r\n className='w-3 h-3 rounded-full'\r\n style={{\r\n backgroundColor:\r\n (colorDomain || sortedData.map(el => el.label)).indexOf(d.label) !== -1\r\n ? (colors || Colors[theme].categoricalColors.colors)[\r\n (colorDomain || sortedData.map(el => el.label)).indexOf(d.label) %\r\n (colors || Colors[theme].categoricalColors.colors).length\r\n ]\r\n : Colors.gray,\r\n }}\r\n />\r\n <P\r\n marginBottom='none'\r\n size='sm'\r\n className='text-primary-gray-700 dark:text-primary-gray-100'\r\n >\r\n {d.label}:{' '}\r\n <span className='font-bold' style={{ fontSize: 'inherit' }}>\r\n {numberFormattingFunction(d.size, 'NA', precision, prefix, suffix)}\r\n </span>\r\n </P>\r\n </div>\r\n ))}\r\n </div>\r\n ) : null}\r\n <Spacer size='lg' />\r\n <GraphArea ref={graphDiv}>\r\n {graphRadius ? (\r\n <Graph\r\n mainText={mainText}\r\n data={sortedData}\r\n colors={colors}\r\n radius={graphRadius}\r\n subNote={subNote}\r\n strokeWidth={strokeWidth}\r\n tooltip={tooltip}\r\n colorDomain={colorDomain || sortedData.map(d => d.label)}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n styles={styles}\r\n detailsOnClick={detailsOnClick}\r\n precision={precision}\r\n />\r\n ) : null}\r\n </GraphArea>\r\n </>\r\n )}\r\n {sources || footNote ? (\r\n <GraphFooter\r\n styles={{ footnote: styles?.footnote, source: styles?.source }}\r\n classNames={{\r\n footnote: classNames?.footnote,\r\n source: classNames?.source,\r\n }}\r\n sources={sources}\r\n footNote={footNote}\r\n width={width}\r\n />\r\n ) : null}\r\n </GraphContainer>\r\n );\r\n}\r\n"],"names":["abs","atan2","cos","max","min","sin","sqrt","epsilon","pi","halfPi","tau","acos","x","asin","arcInnerRadius","d","arcOuterRadius","arcStartAngle","arcEndAngle","arcPadAngle","intersect","x0","y0","x1","y1","x2","y2","x3","y3","x10","y10","x32","y32","t","cornerTangents","r1","rc","cw","x01","y01","lo","ox","oy","x11","y11","x00","y00","dx","dy","d2","r","cx0","cy0","cx1","cy1","dx0","dy0","dx1","dy1","arc","innerRadius","outerRadius","cornerRadius","constant","padRadius","startAngle","endAngle","padAngle","context","path","withPath","buffer","r0","a0","a1","da","a01","a11","a00","a10","da0","da1","ap","rp","rc0","rc1","t0","t1","p0","p1","oc","ax","ay","bx","by","kc","lc","a","_","descending","b","identity","pie","value","sortValues","sort","data","i","n","array","j","k","sum","index","arcs","p","pa","v","Graph","props","$","_c","mainText","radius","colors","subNote","strokeWidth","tooltip","onSeriesMouseOver","onSeriesMouseClick","colorDomain","resetSelectionOnDoubleClick","detailsOnClick","styles","classNames","precision","pieData","_temp","mouseOverData","setMouseOverData","useState","undefined","mouseClickData","setMouseClickData","eventX","setEventX","eventY","setEventY","t2","t3","t4","t5","t6","jsx","jsxs","H2","findIndex","d_1","label","numberFormattingFunction","d_0","size","prefix","suffix","P","t7","d_2","fill","indexOf","length","Colors","gray","opacity","event","clientY","clientX","isEqual","event_0","t8","map","t9","t10","t11","Tooltip","t12","modal","DetailsModal","t13","Fragment","DonutChart","graphTitle","light","categoricalColors","sources","graphDescription","footNote","showColorScale","padding","backgroundColor","graphID","graphDownload","dataDownload","sortData","language","theme","width","height","minHeight","relativeHeight","ariaLabel","colorScaleMaxWidth","graphRadius","setGraphRadius","graphDiv","useRef","graphParentDiv","useEffect","resizeObserver","ResizeObserver","entries","Math","target","clientWidth","clientHeight","Infinity","current","observe","disconnect","sortedData","orderBy","GraphContainer","graphContainer","GraphHeader","title","description","filter","EmptyState","cn","colorLegend","maxWidth","el","fontSize","Spacer","GraphArea","GraphFooter","footnote","source"],"mappings":";;;;;;;;;;;;;;;AAAO,MAAMA,KAAM,KAAK,KACXC,IAAQ,KAAK,OACbC,IAAM,KAAK,KACXC,KAAM,KAAK,KACXC,KAAM,KAAK,KACXC,IAAM,KAAK,KACXC,IAAO,KAAK,MAEZC,IAAU,OACVC,KAAK,KAAK,IACVC,KAASD,KAAK,GACdE,KAAM,IAAIF;AAEhB,SAASG,GAAKC,GAAG;AACtB,SAAOA,IAAI,IAAI,IAAIA,IAAI,KAAKJ,KAAK,KAAK,KAAKI,CAAC;AAC9C;AAEO,SAASC,GAAKD,GAAG;AACtB,SAAOA,KAAK,IAAIH,KAASG,KAAK,KAAK,CAACH,KAAS,KAAK,KAAKG,CAAC;AAC1D;ACfA,SAASE,GAAeC,GAAG;AACzB,SAAOA,EAAE;AACX;AAEA,SAASC,GAAeD,GAAG;AACzB,SAAOA,EAAE;AACX;AAEA,SAASE,GAAcF,GAAG;AACxB,SAAOA,EAAE;AACX;AAEA,SAASG,GAAYH,GAAG;AACtB,SAAOA,EAAE;AACX;AAEA,SAASI,GAAYJ,GAAG;AACtB,SAAOA,KAAKA,EAAE;AAChB;AAEA,SAASK,GAAUC,GAAIC,GAAIC,GAAIC,GAAIC,GAAI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H,IACE;AAAA,MACJ8C,gBAAAA,EAAAA,IAACyF,IAAA,EAAO,MAAK,KAAA,CAAI;AAAA,MACjBzF,gBAAAA,EAAAA,IAAC0F,IAAA,EAAU,KAAK9B,GACbF,UAAAA,IACC1D,gBAAAA,EAAAA,IAACnC,IAAA,EACC,UAAAI,GACA,MAAM0G,GACN,QAAAxG,GACA,QAAQuF,GACR,SAAAtF,GACA,aAAAC,GACA,SAAAC,GACA,aAAaG,KAAekG,EAAWjD,IAAIpK,CAAAA,MAAKA,EAAE+I,KAAK,GACvD,mBAAA9B,GACA,oBAAAC,GACA,6BAAAE,GACA,QAAAE,GACA,gBAAAD,GACA,WAAAG,EAAA,CAAqB,IAErB,KAAA,CACN;AAAA,IAAA,GACF;AAAA,IAED0D,KAAWE,IACV1C,gBAAAA,EAAAA,IAAC2F,IAAA,EACC,QAAQ;AAAA,MAAEC,UAAUhH,GAAQgH;AAAAA,MAAUC,QAAQjH,GAAQiH;AAAAA,IAAAA,GACtD,YAAY;AAAA,MACVD,UAAU/G,GAAY+G;AAAAA,MACtBC,QAAQhH,GAAYgH;AAAAA,IAAAA,GAEtB,SAAArD,GACA,UAAAE,GACA,OAAAU,EAAA,CAAa,IAEb;AAAA,EAAA,GACN;AAEJ;","x_google_ignoreList":[0,1,2,3,4]}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-CHPV5EwG-CTPQjnHt.cjs"),s=require("react"),nt=require("./parse-hMnG_lRV.cjs"),at=require("./getSliderMarks-BmADcPQt.cjs"),dt=require("./Spinner-DRMBUsX7.cjs"),mt=require("./index-DQA8q5sC.cjs"),U=require("./zoom-DPw8bba-.cjs"),pt=require("./Modal-JW_IExO3.cjs"),xt=require("./Typography-DX7PlgQU.cjs"),ht=require("./index-DxXnJ8Ti.cjs"),gt=require("./Tooltip-4dJo4_AF.cjs"),M=require("./Colors.cjs"),ft=require("./string2HTML-CPGr_I5E.cjs"),ot=require("./index-DRXx7m-C.cjs"),yt=require("./pow-DgrUorRi.cjs"),tt=require("./select-Bnfk0lJx.cjs"),vt=require("./use-in-view-QcfiW0w3.cjs"),Ge=require("./proxy-BxvUI_9l.cjs"),jt=require("./index-DG2bgAva.cjs"),bt=require("./GraphFooter.cjs"),Et=require("./GraphHeader.cjs"),wt=require("./fetchAndParseData-l5HGMAEs.cjs"),Ct=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),it=require("./uniqBy-O05lp2S5.cjs"),st=require("./GraphContainer-d8A46BK2.cjs"),Rt=require("./sort-O96oMZLb.cjs"),kt=require("./init-DU0ybBc_.cjs");function Dt(n){const{data:e,colors:r,mapData:X,colorLegendTitle:O,colorDomain:b,radius:k,height:g,width:u,scale:p,centerPoint:$,tooltip:Y,showLabels:pe,mapBorderWidth:xe,mapBorderColor:he,mapNoDataColor:K,onSeriesMouseOver:Z,showColorScale:Me,zoomScaleExtend:Oe,zoomTranslateExtend:$e,highlightedDataPoints:ge,onSeriesMouseClick:J,resetSelectionOnDoubleClick:fe,detailsOnClick:x,styles:ye,classNames:ve,mapProjection:B,zoomInteraction:R,animate:E,dimmedOpacity:Q,customLayers:T,maxRadiusValue:je,collapseColorScaleByDefault:be}=n,[Ee,we]=s.useState(void 0),[Pe,Ce]=s.useState(be===void 0?!(u<680):!be),ee=s.useRef(null),[D,te]=s.useState(void 0),[oe,l]=s.useState(void 0),[c,V]=s.useState(void 0),[Re,re]=s.useState(void 0),P=s.useRef(null),L=vt.useInView(P,{once:E.once,amount:E.amount}),W=s.useRef(null),S=e.filter(t=>t.radius===void 0||t.radius===null).length!==e.length?yt.sqrt().domain([0,je]).range([.25,k]).nice():void 0;s.useEffect(()=>{const t=tt.select(W.current),f=tt.select(P.current),a=i=>{if(R==="noZoom")return!1;if(R==="button")return!i.type.includes("wheel");const w=i.type==="wheel",j=i.type.startsWith("touch"),v=i.type==="mousedown"||i.type==="mousemove";return j?!0:w?R==="scroll"?!0:i.ctrlKey:v&&!i.button&&!i.ctrlKey},C=U.zoom().scaleExtent(Oe).translateExtent($e||[[-20,-20],[u+20,g+20]]).filter(a).on("zoom",({transform:i})=>{t.attr("transform",i)});f.call(C),ee.current=C},[g,u,R]);const _=U.turf_bbox_default(X),y=ht.turf_center_of_mass_default(X),ne=_[2]-_[0],ke=_[3]-_[1],De=u*190/960*360/ne,Se=g*190/678*180/ke,N=p*Math.min(De,Se),I=B==="mercator"?U.geoMercator().rotate([0,0]).center($||y.geometry.coordinates).translate([u/2,g/2]).scale(N):B==="equalEarth"?U.geoEqualEarth().rotate([0,0]).center($||y.geometry.coordinates).translate([u/2,g/2]).scale(N):B==="naturalEarth"?U.geoNaturalEarth1().rotate([0,0]).center($||y.geometry.coordinates).translate([u/2,g/2]).scale(N):B==="orthographic"?U.geoOrthographic().rotate([0,0]).center($||y.geometry.coordinates).translate([u/2,g/2]).scale(N):U.geoAlbersUsa().rotate([0,0]).center($||y.geometry.coordinates).translate([u/2,g/2]).scale(N),ae=t=>{if(!P.current||!ee.current)return;tt.select(P.current).call(ee.current.scaleBy,t==="in"?1.2:1/1.2)};return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsxs("div",{className:"relative",children:[o.jsxRuntimeExports.jsx(Ge.motion.svg,{width:`${u}px`,height:`${g}px`,viewBox:`0 0 ${u} ${g}`,ref:P,direction:"ltr",children:o.jsxRuntimeExports.jsxs("g",{ref:W,children:[T.filter(t=>t.position==="before").map(t=>t.layer),X.features.map((t,f)=>o.jsxRuntimeExports.jsx("g",{children:t.geometry.type==="MultiPolygon"?t.geometry.coordinates.map((a,C)=>{let i="";return a.forEach(w=>{let j=" M";w.forEach((v,ie)=>{const z=I([v[0],v[1]]);ie!==w.length-1?j=`${j}${z[0]} ${z[1]}L`:j=`${j}${z[0]} ${z[1]}`}),i+=j}),o.jsxRuntimeExports.jsx("path",{d:i,style:{stroke:he,strokeWidth:xe,fill:K}},C)}):t.geometry.coordinates.map((a,C)=>{let i="M";return a.forEach((w,j)=>{const v=I([w[0],w[1]]);j!==a.length-1?i=`${i}${v[0]} ${v[1]}L`:i=`${i}${v[0]} ${v[1]}`}),o.jsxRuntimeExports.jsx("path",{d:i,style:{stroke:he,strokeWidth:xe,fill:K}},C)})},f)),o.jsxRuntimeExports.jsx(jt.AnimatePresence,{children:e.map(t=>{const f=e.filter(a=>a.color).length===0?r[0]:t.color?r[b.indexOf(`${t.color}`)]:M.Colors.gray;return o.jsxRuntimeExports.jsxs(Ge.motion.g,{variants:{initial:{opacity:0},whileInView:{opacity:Ee?Ee===f?1:Q:ge.length!==0?ge.indexOf(t.label||"")!==-1?1:Q:1,transition:{duration:E.duration}}},initial:"initial",animate:L?"whileInView":"initial",exit:{opacity:0,transition:{duration:E.duration}},onMouseEnter:a=>{l(t),re(a.clientY),V(a.clientX),Z?.(t)},onMouseMove:a=>{l(t),re(a.clientY),V(a.clientX)},onMouseLeave:()=>{l(void 0),V(void 0),re(void 0),Z?.(void 0)},onClick:()=>{(J||x)&&(mt.isEqual(D,t)&&fe?(te(void 0),J?.(void 0)):(te(t),J?.(t)))},transform:`translate(${I([t.long,t.lat])[0]},${I([t.long,t.lat])[1]})`,children:[o.jsxRuntimeExports.jsx(Ge.motion.circle,{cx:0,cy:0,variants:{initial:{r:0,fill:e.filter(a=>a.color).length===0?r[0]:t.color?r[b.indexOf(`${t.color}`)]:M.Colors.gray,stroke:e.filter(a=>a.color).length===0?r[0]:t.color?r[b.indexOf(`${t.color}`)]:M.Colors.gray},whileInView:{r:S?S(t.radius||0):k,fill:e.filter(a=>a.color).length===0?r[0]:t.color?r[b.indexOf(`${t.color}`)]:M.Colors.gray,stroke:e.filter(a=>a.color).length===0?r[0]:t.color?r[b.indexOf(`${t.color}`)]:M.Colors.gray,transition:{duration:E.duration}}},initial:"initial",animate:L?"whileInView":"initial",exit:{r:0,transition:{duration:E.duration}},style:{fillOpacity:.8}}),pe&&t.label?o.jsxRuntimeExports.jsx(Ge.motion.text,{variants:{initial:{opacity:0,x:S?S(t.radius||0):k},whileInView:{opacity:1,x:S?S(t.radius||0):k,transition:{duration:E.duration}}},initial:"initial",animate:L?"whileInView":"initial",exit:{opacity:0,transition:{duration:E.duration}},y:0,className:"fill-primary-gray-600 dark:fill-primary-gray-300 text-sm",style:{textAnchor:"start"},dx:4,dy:5,children:t.label}):null]},t.label||`${t.lat}-${t.long}`)})}),T.filter(t=>t.position==="after").map(t=>t.layer)]})}),e.filter(t=>t.color).length===0||Me===!1?null:o.jsxRuntimeExports.jsx("div",{className:o.mo("absolute left-4 bottom-4 map-color-legend",ve?.colorLegend),children:Pe?o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx("div",{className:"color-legend-close-button bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)] border border-[var(--gray-400)] rounded-full w-6 h-6 p-[3px] cursor-pointer z-10 absolute right-[-0.75rem] top-[-0.75rem]",onClick:()=>{Ce(!1)},children:o.jsxRuntimeExports.jsx(ot.X,{})}),o.jsxRuntimeExports.jsxs("div",{className:"p-2",style:{backgroundColor:"rgba(240,240,240, 0.7)"},children:[O&&O!==""?o.jsxRuntimeExports.jsx("p",{className:"p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300",style:{display:"-webkit-box",WebkitLineClamp:"1",WebkitBoxOrient:"vertical"},children:O}):null,o.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-3",children:b.map((t,f)=>o.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 items-center",onMouseOver:()=>{we(r[f%r.length])},onMouseLeave:()=>{we(void 0)},children:[o.jsxRuntimeExports.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:r[f%r.length]}}),o.jsxRuntimeExports.jsx(xt.j,{size:"sm",marginBottom:"none",leading:"none",children:t})]},f))})]})]}):o.jsxRuntimeExports.jsx("button",{type:"button",className:"mb-0 border-0 bg-transparent p-0 self-start",onClick:()=>{Ce(!0)},children:o.jsxRuntimeExports.jsx("div",{className:"show-color-legend-button items-start text-sm font-medium cursor-pointer p-2 mb-0 flex text-primary-black dark:text-primary-gray-300 bg-primary-gray-300 dark:bg-primary-gray-600 border-primary-gray-400 dark:border-primary-gray-500",children:"Show Legend"})})}),R==="button"&&o.jsxRuntimeExports.jsxs("div",{className:"absolute left-4 top-4 flex flex-col zoom-buttons",children:[o.jsxRuntimeExports.jsx("button",{onClick:()=>ae("in"),className:"leading-0 px-2 py-3.5 text-primary-gray-700 border border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"+"}),o.jsxRuntimeExports.jsx("button",{onClick:()=>ae("out"),className:"leading-0 px-2 py-3.5 text-primary-gray-700 border border-t-0 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"–"})]})]}),x&&D!==void 0?o.jsxRuntimeExports.jsx(pt.le,{open:D!==void 0,onClose:()=>{te(void 0)},children:o.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof x=="string"?{__html:ft.string2HTML(x,D)}:void 0,children:typeof x=="function"?x(D):null})}):null,oe&&Y&&c&&Re?o.jsxRuntimeExports.jsx(gt.Tooltip,{data:oe,body:Y,xPos:c,yPos:Re,backgroundStyle:ye?.tooltip,className:ve?.tooltip}):null]})}function St(n){const e=o.compilerRuntimeExports.c(102),{data:r,mapData:X,graphTitle:O,colors:b,sources:k,graphDescription:g,height:u,width:p,footNote:$,colorLegendTitle:Y,colorDomain:pe,radius:xe,scale:he,centerPoint:K,padding:Z,mapBorderWidth:Me,mapNoDataColor:Oe,backgroundColor:$e,showLabels:ge,mapBorderColor:J,tooltip:fe,relativeHeight:x,onSeriesMouseOver:ye,isWorldMap:ve,showColorScale:B,zoomScaleExtend:R,zoomTranslateExtend:E,graphID:Q,highlightedDataPoints:T,onSeriesMouseClick:je,graphDownload:be,dataDownload:Ee,showAntarctica:we,language:Pe,minHeight:Ce,theme:ee,ariaLabel:D,resetSelectionOnDoubleClick:te,detailsOnClick:oe,styles:l,classNames:c,mapProjection:V,zoomInteraction:Re,animate:re,dimmedOpacity:P,customLayers:L,maxRadiusValue:W,timeline:S,collapseColorScaleByDefault:_}=n,y=X===void 0?"https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap.json":X,ne=$===void 0?"The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.":$,ke=xe===void 0?5:xe,De=he===void 0?.95:he,Se=Me===void 0?.5:Me,N=Oe===void 0?M.Colors.light.graphNoData:Oe,I=$e===void 0?!1:$e,ae=ge===void 0?!1:ge,t=J===void 0?M.Colors.light.grays["gray-500"]:J,f=ve===void 0?!0:ve,a=B===void 0?!0:B;let C;e[0]!==R?(C=R===void 0?[.8,6]:R,e[0]=R,e[1]=C):C=e[1];const i=C;let w;e[2]!==T?(w=T===void 0?[]:T,e[2]=T,e[3]=w):w=e[3];const j=w,v=be===void 0?!1:be,ie=Ee===void 0?!1:Ee,z=we===void 0?!1:we,Fe=Pe===void 0?"en":Pe,q=Ce===void 0?0:Ce,se=ee===void 0?"light":ee,Ue=te===void 0?!0:te,Xe=Re===void 0?"button":Re,Le=re===void 0?!1:re,Ye=P===void 0?.3:P;let _e;e[4]!==L?(_e=L===void 0?[]:L,e[4]=L,e[5]=_e):_e=e[5];const Ke=_e,h=S===void 0?{enabled:!1,autoplay:!1,showOnlyActiveDate:!0}:S,[A,lt]=s.useState(0),[Ne,ct]=s.useState(0),[H,Ze]=s.useState(h.autoplay),d=Rt.sort(it.uniqBy(r,"date",!0).map(m=>nt.parse(`${m}`,h.dateFormat||"yyyy",new Date).getTime()),Bt),[G,qe]=s.useState(h.autoplay?0:d.length-1),[le,ut]=s.useState(void 0),Je=s.useRef(null),rt=s.useRef(null);let Ie,ze;e[6]===Symbol.for("react.memo_cache_sentinel")?(Ie=()=>{const m=new ResizeObserver(F=>{lt(F[0].target.clientWidth||620),ct(F[0].target.clientHeight||480)});return Je.current&&m.observe(Je.current),()=>m.disconnect()},ze=[],e[6]=Ie,e[7]=ze):(Ie=e[6],ze=e[7]),s.useEffect(Ie,ze);let Be;e[8]===Symbol.for("react.memo_cache_sentinel")?(Be=m=>{ut(m)},e[8]=Be):Be=e[8];const Te=s.useEffectEvent(Be);let Ve;e[9]!==y||e[10]!==Te?(Ve=()=>{typeof y=="string"?wt.fetchAndParseJSON(y).then(F=>{Te(F)}):Te(y)},e[9]=y,e[10]=Te,e[11]=Ve):Ve=e[11];let We;e[12]!==y?(We=[y],e[12]=y,e[13]=We):We=e[13],s.useEffect(Ve,We),s.useEffect(()=>{const m=setInterval(()=>{qe(F=>F<d.length-1?F+1:0)},(h.speed||2)*1e3);return H||clearInterval(m),()=>clearInterval(m)},[d,H,h.speed]);const Ae=at.getSliderMarks(d,G,h.showOnlyActiveDate,h.dateFormat||"yyyy"),Qe=c?.graphContainer,et=l?.graphContainer;let ce;e[14]!==c?.description||e[15]!==c?.title||e[16]!==r||e[17]!==ie||e[18]!==g||e[19]!==v||e[20]!==O||e[21]!==l?.description||e[22]!==l?.title||e[23]!==p?(ce=O||g||v||ie?o.jsxRuntimeExports.jsx(Et.GraphHeader,{styles:{title:l?.title,description:l?.description},classNames:{title:c?.title,description:c?.description},graphTitle:O,graphDescription:g,width:p,graphDownload:v?rt:void 0,dataDownload:ie?r.map(zt).filter(It).length>0?r.map(_t).filter(Lt):r.filter(Pt):null}):null,e[14]=c?.description,e[15]=c?.title,e[16]=r,e[17]=ie,e[18]=g,e[19]=v,e[20]=O,e[21]=l?.description,e[22]=l?.title,e[23]=p,e[24]=ce):ce=e[24];let ue;e[25]!==G||e[26]!==Ae||e[27]!==H||e[28]!==qe||e[29]!==Ze||e[30]!==h.enabled||e[31]!==d?(ue=h.enabled&&d.length>0&&Ae?o.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[o.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{Ze(!H)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":H?"Click to pause animation":"Click to play animation",children:H?o.jsxRuntimeExports.jsx(ot.Pause,{}):o.jsxRuntimeExports.jsx(ot.Play,{})}),o.jsxRuntimeExports.jsx(at.Nr,{min:d[0],max:d[d.length-1],marks:Ae,step:null,defaultValue:d[d.length-1],value:d[G],onChangeComplete:m=>{qe(d.indexOf(m))},onChange:m=>{qe(d.indexOf(m))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,e[25]=G,e[26]=Ae,e[27]=H,e[28]=qe,e[29]=Ze,e[30]=h.enabled,e[31]=d,e[32]=ue):ue=e[32];let de;e[33]!==Le||e[34]!==K||e[35]!==c||e[36]!==_||e[37]!==pe||e[38]!==Y||e[39]!==b||e[40]!==Ke||e[41]!==r||e[42]!==oe||e[43]!==Ye||e[44]!==u||e[45]!==j||e[46]!==G||e[47]!==f||e[48]!==t||e[49]!==Se||e[50]!==N||e[51]!==V||e[52]!==le||e[53]!==W||e[54]!==q||e[55]!==je||e[56]!==ye||e[57]!==ke||e[58]!==x||e[59]!==Ue||e[60]!==De||e[61]!==z||e[62]!==a||e[63]!==ae||e[64]!==l||e[65]!==Ne||e[66]!==A||e[67]!==se||e[68]!==h.dateFormat||e[69]!==h.enabled||e[70]!==fe||e[71]!==d||e[72]!==p||e[73]!==Xe||e[74]!==i||e[75]!==E?(de=o.jsxRuntimeExports.jsx(st.GraphArea,{ref:Je,children:A&&Ne&&le?o.jsxRuntimeExports.jsx(Dt,{data:r.filter(m=>h.enabled?m.date===nt.format(new Date(d[G]),h.dateFormat||"yyyy"):m),mapData:z?le:{...le,features:le.features.filter($t)},colorDomain:r.filter(Ot).length===0?[]:pe||it.uniqBy(r,"color",!0),width:A,height:Ne,scale:De,centerPoint:K,colors:r.filter(Mt).length===0?b?[b]:[M.Colors.primaryColors["blue-600"]]:b||M.Colors[se].categoricalColors.colors,colorLegendTitle:Y,radius:ke,mapBorderWidth:Se,mapNoDataColor:N,mapBorderColor:t,tooltip:fe,onSeriesMouseOver:ye,showLabels:ae,isWorldMap:f,showColorScale:a,zoomScaleExtend:i,zoomTranslateExtend:E,onSeriesMouseClick:je,highlightedDataPoints:j,resetSelectionOnDoubleClick:Ue,styles:l,classNames:c,zoomInteraction:Xe,detailsOnClick:oe,mapProjection:V||(f?"naturalEarth":"mercator"),animate:Le===!0?{duration:.5,once:!0,amount:.5}:Le||{duration:0,once:!0,amount:0},dimmedOpacity:Ye,customLayers:Ke,maxRadiusValue:Ct.checkIfNullOrUndefined(W)?Math.max(...r.map(qt).filter(Nt)):W,collapseColorScaleByDefault:_}):o.jsxRuntimeExports.jsx("div",{style:{height:`${Math.max(q,u||(x?q?(p||A)*x>q?(p||A)*x:q:(p||A)*x:Ne))}px`},className:"flex items-center justify-center",children:o.jsxRuntimeExports.jsx(dt.w,{"aria-label":"Loading graph"})})}),e[33]=Le,e[34]=K,e[35]=c,e[36]=_,e[37]=pe,e[38]=Y,e[39]=b,e[40]=Ke,e[41]=r,e[42]=oe,e[43]=Ye,e[44]=u,e[45]=j,e[46]=G,e[47]=f,e[48]=t,e[49]=Se,e[50]=N,e[51]=V,e[52]=le,e[53]=W,e[54]=q,e[55]=je,e[56]=ye,e[57]=ke,e[58]=x,e[59]=Ue,e[60]=De,e[61]=z,e[62]=a,e[63]=ae,e[64]=l,e[65]=Ne,e[66]=A,e[67]=se,e[68]=h.dateFormat,e[69]=h.enabled,e[70]=fe,e[71]=d,e[72]=p,e[73]=Xe,e[74]=i,e[75]=E,e[76]=de):de=e[76];let me;e[77]!==c?.footnote||e[78]!==c?.source||e[79]!==ne||e[80]!==k||e[81]!==l?.footnote||e[82]!==l?.source||e[83]!==p?(me=k||ne?o.jsxRuntimeExports.jsx(bt.GraphFooter,{styles:{footnote:l?.footnote,source:l?.source},classNames:{footnote:c?.footnote,source:c?.source},sources:k,footNote:ne,width:p}):null,e[77]=c?.footnote,e[78]=c?.source,e[79]=ne,e[80]=k,e[81]=l?.footnote,e[82]=l?.source,e[83]=p,e[84]=me):me=e[84];let He;return e[85]!==D||e[86]!==I||e[87]!==Q||e[88]!==u||e[89]!==Fe||e[90]!==q||e[91]!==Z||e[92]!==x||e[93]!==Qe||e[94]!==et||e[95]!==ce||e[96]!==ue||e[97]!==de||e[98]!==me||e[99]!==se||e[100]!==p?(He=o.jsxRuntimeExports.jsxs(st.GraphContainer,{className:Qe,style:et,id:Q,ref:rt,"aria-label":D,backgroundColor:I,theme:se,language:Fe,minHeight:q,width:p,height:u,relativeHeight:x,padding:Z,children:[ce,ue,de,me]}),e[85]=D,e[86]=I,e[87]=Q,e[88]=u,e[89]=Fe,e[90]=q,e[91]=Z,e[92]=x,e[93]=Qe,e[94]=et,e[95]=ce,e[96]=ue,e[97]=de,e[98]=me,e[99]=se,e[100]=p,e[101]=He):He=e[101],He}function Nt(n){return n!=null}function qt(n){return n.radius}function Mt(n){return n.color}function Ot(n){return n.color}function $t(n){return n.properties.NAME!=="Antarctica"}function Pt(n){return n!==void 0}function Lt(n){return n!==void 0}function _t(n){return n.data}function It(n){return n!==void 0}function zt(n){return n.data}function Bt(n,e){return kt.ascending(n,e)}exports.DotDensityMap=St;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-CHPV5EwG-CTPQjnHt.cjs"),s=require("react"),at=require("./parse-hMnG_lRV.cjs"),nt=require("./getSliderMarks-BmADcPQt.cjs"),dt=require("./Spinner-DRMBUsX7.cjs"),mt=require("./index-DQA8q5sC.cjs"),U=require("./zoom-DPw8bba-.cjs"),pt=require("./Typography-DX7PlgQU.cjs"),xt=require("./index-DxXnJ8Ti.cjs"),ht=require("./Tooltip-uUdw6wJL.cjs"),q=require("./Colors.cjs"),ot=require("./index-DRXx7m-C.cjs"),gt=require("./DetailsModal-BN0HDFlV.cjs"),ft=require("./pow-DgrUorRi.cjs"),tt=require("./select-Bnfk0lJx.cjs"),yt=require("./use-in-view-QcfiW0w3.cjs"),Fe=require("./proxy-BxvUI_9l.cjs"),vt=require("./index-DG2bgAva.cjs"),bt=require("./GraphFooter.cjs"),jt=require("./GraphHeader.cjs"),Et=require("./fetchAndParseData-l5HGMAEs.cjs"),wt=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),it=require("./uniqBy-O05lp2S5.cjs"),st=require("./GraphContainer-d8A46BK2.cjs"),Ct=require("./sort-O96oMZLb.cjs"),Dt=require("./init-DU0ybBc_.cjs");function Rt(a){const{data:e,colors:r,mapData:X,colorLegendTitle:O,colorDomain:j,radius:R,height:h,width:u,scale:p,centerPoint:M,tooltip:Y,showLabels:xe,mapBorderWidth:he,mapBorderColor:ge,mapNoDataColor:K,onSeriesMouseOver:Z,showColorScale:Oe,zoomScaleExtend:Me,zoomTranslateExtend:$e,highlightedDataPoints:fe,onSeriesMouseClick:J,resetSelectionOnDoubleClick:ye,detailsOnClick:v,styles:ve,classNames:Q,mapProjection:_,zoomInteraction:D,animate:E,dimmedOpacity:ee,customLayers:B,maxRadiusValue:be,collapseColorScaleByDefault:je}=a,[Ee,we]=s.useState(void 0),[Pe,Ce]=s.useState(je===void 0?!(u<680):!je),te=s.useRef(null),[V,oe]=s.useState(void 0),[re,l]=s.useState(void 0),[c,W]=s.useState(void 0),[De,ae]=s.useState(void 0),$=s.useRef(null),P=yt.useInView($,{once:E.once,amount:E.amount}),T=s.useRef(null),k=e.filter(t=>t.radius===void 0||t.radius===null).length!==e.length?ft.sqrt().domain([0,be]).range([.25,R]).nice():void 0;s.useEffect(()=>{const t=tt.select(T.current),g=tt.select($.current),n=i=>{if(D==="noZoom")return!1;if(D==="button")return!i.type.includes("wheel");const w=i.type==="wheel",b=i.type.startsWith("touch"),y=i.type==="mousedown"||i.type==="mousemove";return b?!0:w?D==="scroll"?!0:i.ctrlKey:y&&!i.button&&!i.ctrlKey},C=U.zoom().scaleExtent(Me).translateExtent($e||[[-20,-20],[u+20,h+20]]).filter(n).on("zoom",({transform:i})=>{t.attr("transform",i)});g.call(C),te.current=C},[h,u,D]);const z=U.turf_bbox_default(X),f=xt.turf_center_of_mass_default(X),ne=z[2]-z[0],Re=z[3]-z[1],ke=u*190/960*360/ne,Se=h*190/678*180/Re,S=p*Math.min(ke,Se),I=_==="mercator"?U.geoMercator().rotate([0,0]).center(M||f.geometry.coordinates).translate([u/2,h/2]).scale(S):_==="equalEarth"?U.geoEqualEarth().rotate([0,0]).center(M||f.geometry.coordinates).translate([u/2,h/2]).scale(S):_==="naturalEarth"?U.geoNaturalEarth1().rotate([0,0]).center(M||f.geometry.coordinates).translate([u/2,h/2]).scale(S):_==="orthographic"?U.geoOrthographic().rotate([0,0]).center(M||f.geometry.coordinates).translate([u/2,h/2]).scale(S):U.geoAlbersUsa().rotate([0,0]).center(M||f.geometry.coordinates).translate([u/2,h/2]).scale(S),ie=t=>{if(!$.current||!te.current)return;tt.select($.current).call(te.current.scaleBy,t==="in"?1.2:1/1.2)};return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsxs("div",{className:"relative",children:[o.jsxRuntimeExports.jsx(Fe.motion.svg,{width:`${u}px`,height:`${h}px`,viewBox:`0 0 ${u} ${h}`,ref:$,direction:"ltr",children:o.jsxRuntimeExports.jsxs("g",{ref:T,children:[B.filter(t=>t.position==="before").map(t=>t.layer),X.features.map((t,g)=>o.jsxRuntimeExports.jsx("g",{children:t.geometry.type==="MultiPolygon"?t.geometry.coordinates.map((n,C)=>{let i="";return n.forEach(w=>{let b=" M";w.forEach((y,se)=>{const L=I([y[0],y[1]]);se!==w.length-1?b=`${b}${L[0]} ${L[1]}L`:b=`${b}${L[0]} ${L[1]}`}),i+=b}),o.jsxRuntimeExports.jsx("path",{d:i,style:{stroke:ge,strokeWidth:he,fill:K}},C)}):t.geometry.coordinates.map((n,C)=>{let i="M";return n.forEach((w,b)=>{const y=I([w[0],w[1]]);b!==n.length-1?i=`${i}${y[0]} ${y[1]}L`:i=`${i}${y[0]} ${y[1]}`}),o.jsxRuntimeExports.jsx("path",{d:i,style:{stroke:ge,strokeWidth:he,fill:K}},C)})},g)),o.jsxRuntimeExports.jsx(vt.AnimatePresence,{children:e.map(t=>{const g=e.filter(n=>n.color).length===0?r[0]:t.color?r[j.indexOf(`${t.color}`)]:q.Colors.gray;return o.jsxRuntimeExports.jsxs(Fe.motion.g,{variants:{initial:{opacity:0},whileInView:{opacity:Ee?Ee===g?1:ee:fe.length!==0?fe.indexOf(t.label||"")!==-1?1:ee:1,transition:{duration:E.duration}}},initial:"initial",animate:P?"whileInView":"initial",exit:{opacity:0,transition:{duration:E.duration}},onMouseEnter:n=>{l(t),ae(n.clientY),W(n.clientX),Z?.(t)},onMouseMove:n=>{l(t),ae(n.clientY),W(n.clientX)},onMouseLeave:()=>{l(void 0),W(void 0),ae(void 0),Z?.(void 0)},onClick:()=>{(J||v)&&(mt.isEqual(V,t)&&ye?(oe(void 0),J?.(void 0)):(oe(t),J?.(t)))},transform:`translate(${I([t.long,t.lat])[0]},${I([t.long,t.lat])[1]})`,children:[o.jsxRuntimeExports.jsx(Fe.motion.circle,{cx:0,cy:0,variants:{initial:{r:0,fill:e.filter(n=>n.color).length===0?r[0]:t.color?r[j.indexOf(`${t.color}`)]:q.Colors.gray,stroke:e.filter(n=>n.color).length===0?r[0]:t.color?r[j.indexOf(`${t.color}`)]:q.Colors.gray},whileInView:{r:k?k(t.radius||0):R,fill:e.filter(n=>n.color).length===0?r[0]:t.color?r[j.indexOf(`${t.color}`)]:q.Colors.gray,stroke:e.filter(n=>n.color).length===0?r[0]:t.color?r[j.indexOf(`${t.color}`)]:q.Colors.gray,transition:{duration:E.duration}}},initial:"initial",animate:P?"whileInView":"initial",exit:{r:0,transition:{duration:E.duration}},style:{fillOpacity:.8}}),xe&&t.label?o.jsxRuntimeExports.jsx(Fe.motion.text,{variants:{initial:{opacity:0,x:k?k(t.radius||0):R},whileInView:{opacity:1,x:k?k(t.radius||0):R,transition:{duration:E.duration}}},initial:"initial",animate:P?"whileInView":"initial",exit:{opacity:0,transition:{duration:E.duration}},y:0,className:"fill-primary-gray-600 dark:fill-primary-gray-300 text-sm",style:{textAnchor:"start"},dx:4,dy:5,children:t.label}):null]},t.label||`${t.lat}-${t.long}`)})}),B.filter(t=>t.position==="after").map(t=>t.layer)]})}),e.filter(t=>t.color).length===0||Oe===!1?null:o.jsxRuntimeExports.jsx("div",{className:o.mo("absolute left-4 bottom-4 map-color-legend",Q?.colorLegend),children:Pe?o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx("div",{className:"color-legend-close-button bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)] border border-[var(--gray-400)] rounded-full w-6 h-6 p-[3px] cursor-pointer z-10 absolute right-[-0.75rem] top-[-0.75rem]",onClick:()=>{Ce(!1)},children:o.jsxRuntimeExports.jsx(ot.X,{})}),o.jsxRuntimeExports.jsxs("div",{className:"p-2",style:{backgroundColor:"rgba(240,240,240, 0.7)"},children:[O&&O!==""?o.jsxRuntimeExports.jsx("p",{className:"p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300",style:{display:"-webkit-box",WebkitLineClamp:"1",WebkitBoxOrient:"vertical"},children:O}):null,o.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-3",children:j.map((t,g)=>o.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 items-center",onMouseOver:()=>{we(r[g%r.length])},onMouseLeave:()=>{we(void 0)},children:[o.jsxRuntimeExports.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:r[g%r.length]}}),o.jsxRuntimeExports.jsx(pt.j,{size:"sm",marginBottom:"none",leading:"none",children:t})]},g))})]})]}):o.jsxRuntimeExports.jsx("button",{type:"button",className:"mb-0 border-0 bg-transparent p-0 self-start",onClick:()=>{Ce(!0)},children:o.jsxRuntimeExports.jsx("div",{className:"show-color-legend-button items-start text-sm font-medium cursor-pointer p-2 mb-0 flex text-primary-black dark:text-primary-gray-300 bg-primary-gray-300 dark:bg-primary-gray-600 border-primary-gray-400 dark:border-primary-gray-500",children:"Show Legend"})})}),D==="button"&&o.jsxRuntimeExports.jsxs("div",{className:"absolute left-4 top-4 flex flex-col zoom-buttons",children:[o.jsxRuntimeExports.jsx("button",{onClick:()=>ie("in"),className:"leading-0 px-2 py-3.5 text-primary-gray-700 border border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"+"}),o.jsxRuntimeExports.jsx("button",{onClick:()=>ie("out"),className:"leading-0 px-2 py-3.5 text-primary-gray-700 border border-t-0 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"–"})]})]}),v&&V!==void 0?o.jsxRuntimeExports.jsx(gt.DetailsModal,{body:v,data:V,setData:oe,className:Q?.modal}):null,re&&Y&&c&&De?o.jsxRuntimeExports.jsx(ht.Tooltip,{data:re,body:Y,xPos:c,yPos:De,backgroundStyle:ve?.tooltip,className:Q?.tooltip}):null]})}function kt(a){const e=o.compilerRuntimeExports.c(102),{data:r,mapData:X,graphTitle:O,colors:j,sources:R,graphDescription:h,height:u,width:p,footNote:M,colorLegendTitle:Y,colorDomain:xe,radius:he,scale:ge,centerPoint:K,padding:Z,mapBorderWidth:Oe,mapNoDataColor:Me,backgroundColor:$e,showLabels:fe,mapBorderColor:J,tooltip:ye,relativeHeight:v,onSeriesMouseOver:ve,isWorldMap:Q,showColorScale:_,zoomScaleExtend:D,zoomTranslateExtend:E,graphID:ee,highlightedDataPoints:B,onSeriesMouseClick:be,graphDownload:je,dataDownload:Ee,showAntarctica:we,language:Pe,minHeight:Ce,theme:te,ariaLabel:V,resetSelectionOnDoubleClick:oe,detailsOnClick:re,styles:l,classNames:c,mapProjection:W,zoomInteraction:De,animate:ae,dimmedOpacity:$,customLayers:P,maxRadiusValue:T,timeline:k,collapseColorScaleByDefault:z}=a,f=X===void 0?"https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap.json":X,ne=M===void 0?"The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.":M,Re=he===void 0?5:he,ke=ge===void 0?.95:ge,Se=Oe===void 0?.5:Oe,S=Me===void 0?q.Colors.light.graphNoData:Me,I=$e===void 0?!1:$e,ie=fe===void 0?!1:fe,t=J===void 0?q.Colors.light.grays["gray-500"]:J,g=Q===void 0?!0:Q,n=_===void 0?!0:_;let C;e[0]!==D?(C=D===void 0?[.8,6]:D,e[0]=D,e[1]=C):C=e[1];const i=C;let w;e[2]!==B?(w=B===void 0?[]:B,e[2]=B,e[3]=w):w=e[3];const b=w,y=je===void 0?!1:je,se=Ee===void 0?!1:Ee,L=we===void 0?!1:we,He=Pe===void 0?"en":Pe,N=Ce===void 0?0:Ce,le=te===void 0?"light":te,Ue=oe===void 0?!0:oe,Xe=De===void 0?"button":De,ze=ae===void 0?!1:ae,Ye=$===void 0?.3:$;let Ie;e[4]!==P?(Ie=P===void 0?[]:P,e[4]=P,e[5]=Ie):Ie=e[5];const Ke=Ie,x=k===void 0?{enabled:!1,autoplay:!1,showOnlyActiveDate:!0}:k,[A,lt]=s.useState(0),[Ne,ct]=s.useState(0),[G,Ze]=s.useState(x.autoplay),d=Ct.sort(it.uniqBy(r,"date",!0).map(m=>at.parse(`${m}`,x.dateFormat||"yyyy",new Date).getTime()),_t),[F,qe]=s.useState(x.autoplay?0:d.length-1),[ce,ut]=s.useState(void 0),Je=s.useRef(null),rt=s.useRef(null);let Le,_e;e[6]===Symbol.for("react.memo_cache_sentinel")?(Le=()=>{const m=new ResizeObserver(H=>{lt(H[0].target.clientWidth||620),ct(H[0].target.clientHeight||480)});return Je.current&&m.observe(Je.current),()=>m.disconnect()},_e=[],e[6]=Le,e[7]=_e):(Le=e[6],_e=e[7]),s.useEffect(Le,_e);let Be;e[8]===Symbol.for("react.memo_cache_sentinel")?(Be=m=>{ut(m)},e[8]=Be):Be=e[8];const Ve=s.useEffectEvent(Be);let We;e[9]!==f||e[10]!==Ve?(We=()=>{typeof f=="string"?Et.fetchAndParseJSON(f).then(H=>{Ve(H)}):Ve(f)},e[9]=f,e[10]=Ve,e[11]=We):We=e[11];let Te;e[12]!==f?(Te=[f],e[12]=f,e[13]=Te):Te=e[13],s.useEffect(We,Te),s.useEffect(()=>{const m=setInterval(()=>{qe(H=>H<d.length-1?H+1:0)},(x.speed||2)*1e3);return G||clearInterval(m),()=>clearInterval(m)},[d,G,x.speed]);const Ae=nt.getSliderMarks(d,F,x.showOnlyActiveDate,x.dateFormat||"yyyy"),Qe=c?.graphContainer,et=l?.graphContainer;let ue;e[14]!==c?.description||e[15]!==c?.title||e[16]!==r||e[17]!==se||e[18]!==h||e[19]!==y||e[20]!==O||e[21]!==l?.description||e[22]!==l?.title||e[23]!==p?(ue=O||h||y||se?o.jsxRuntimeExports.jsx(jt.GraphHeader,{styles:{title:l?.title,description:l?.description},classNames:{title:c?.title,description:c?.description},graphTitle:O,graphDescription:h,width:p,graphDownload:y?rt:void 0,dataDownload:se?r.map(Lt).filter(It).length>0?r.map(zt).filter(Pt):r.filter($t):null}):null,e[14]=c?.description,e[15]=c?.title,e[16]=r,e[17]=se,e[18]=h,e[19]=y,e[20]=O,e[21]=l?.description,e[22]=l?.title,e[23]=p,e[24]=ue):ue=e[24];let de;e[25]!==F||e[26]!==Ae||e[27]!==G||e[28]!==qe||e[29]!==Ze||e[30]!==x.enabled||e[31]!==d?(de=x.enabled&&d.length>0&&Ae?o.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[o.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{Ze(!G)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":G?"Click to pause animation":"Click to play animation",children:G?o.jsxRuntimeExports.jsx(ot.Pause,{}):o.jsxRuntimeExports.jsx(ot.Play,{})}),o.jsxRuntimeExports.jsx(nt.Nr,{min:d[0],max:d[d.length-1],marks:Ae,step:null,defaultValue:d[d.length-1],value:d[F],onChangeComplete:m=>{qe(d.indexOf(m))},onChange:m=>{qe(d.indexOf(m))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,e[25]=F,e[26]=Ae,e[27]=G,e[28]=qe,e[29]=Ze,e[30]=x.enabled,e[31]=d,e[32]=de):de=e[32];let me;e[33]!==ze||e[34]!==K||e[35]!==c||e[36]!==z||e[37]!==xe||e[38]!==Y||e[39]!==j||e[40]!==Ke||e[41]!==r||e[42]!==re||e[43]!==Ye||e[44]!==u||e[45]!==b||e[46]!==F||e[47]!==g||e[48]!==t||e[49]!==Se||e[50]!==S||e[51]!==W||e[52]!==ce||e[53]!==T||e[54]!==N||e[55]!==be||e[56]!==ve||e[57]!==Re||e[58]!==v||e[59]!==Ue||e[60]!==ke||e[61]!==L||e[62]!==n||e[63]!==ie||e[64]!==l||e[65]!==Ne||e[66]!==A||e[67]!==le||e[68]!==x.dateFormat||e[69]!==x.enabled||e[70]!==ye||e[71]!==d||e[72]!==p||e[73]!==Xe||e[74]!==i||e[75]!==E?(me=o.jsxRuntimeExports.jsx(st.GraphArea,{ref:Je,children:A&&Ne&&ce?o.jsxRuntimeExports.jsx(Rt,{data:r.filter(m=>x.enabled?m.date===at.format(new Date(d[F]),x.dateFormat||"yyyy"):m),mapData:L?ce:{...ce,features:ce.features.filter(Mt)},colorDomain:r.filter(Ot).length===0?[]:xe||it.uniqBy(r,"color",!0),width:A,height:Ne,scale:ke,centerPoint:K,colors:r.filter(qt).length===0?j?[j]:[q.Colors.primaryColors["blue-600"]]:j||q.Colors[le].categoricalColors.colors,colorLegendTitle:Y,radius:Re,mapBorderWidth:Se,mapNoDataColor:S,mapBorderColor:t,tooltip:ye,onSeriesMouseOver:ve,showLabels:ie,isWorldMap:g,showColorScale:n,zoomScaleExtend:i,zoomTranslateExtend:E,onSeriesMouseClick:be,highlightedDataPoints:b,resetSelectionOnDoubleClick:Ue,styles:l,classNames:c,zoomInteraction:Xe,detailsOnClick:re,mapProjection:W||(g?"naturalEarth":"mercator"),animate:ze===!0?{duration:.5,once:!0,amount:.5}:ze||{duration:0,once:!0,amount:0},dimmedOpacity:Ye,customLayers:Ke,maxRadiusValue:wt.checkIfNullOrUndefined(T)?Math.max(...r.map(Nt).filter(St)):T,collapseColorScaleByDefault:z}):o.jsxRuntimeExports.jsx("div",{style:{height:`${Math.max(N,u||(v?N?(p||A)*v>N?(p||A)*v:N:(p||A)*v:Ne))}px`},className:"flex items-center justify-center",children:o.jsxRuntimeExports.jsx(dt.w,{"aria-label":"Loading graph"})})}),e[33]=ze,e[34]=K,e[35]=c,e[36]=z,e[37]=xe,e[38]=Y,e[39]=j,e[40]=Ke,e[41]=r,e[42]=re,e[43]=Ye,e[44]=u,e[45]=b,e[46]=F,e[47]=g,e[48]=t,e[49]=Se,e[50]=S,e[51]=W,e[52]=ce,e[53]=T,e[54]=N,e[55]=be,e[56]=ve,e[57]=Re,e[58]=v,e[59]=Ue,e[60]=ke,e[61]=L,e[62]=n,e[63]=ie,e[64]=l,e[65]=Ne,e[66]=A,e[67]=le,e[68]=x.dateFormat,e[69]=x.enabled,e[70]=ye,e[71]=d,e[72]=p,e[73]=Xe,e[74]=i,e[75]=E,e[76]=me):me=e[76];let pe;e[77]!==c?.footnote||e[78]!==c?.source||e[79]!==ne||e[80]!==R||e[81]!==l?.footnote||e[82]!==l?.source||e[83]!==p?(pe=R||ne?o.jsxRuntimeExports.jsx(bt.GraphFooter,{styles:{footnote:l?.footnote,source:l?.source},classNames:{footnote:c?.footnote,source:c?.source},sources:R,footNote:ne,width:p}):null,e[77]=c?.footnote,e[78]=c?.source,e[79]=ne,e[80]=R,e[81]=l?.footnote,e[82]=l?.source,e[83]=p,e[84]=pe):pe=e[84];let Ge;return e[85]!==V||e[86]!==I||e[87]!==ee||e[88]!==u||e[89]!==He||e[90]!==N||e[91]!==Z||e[92]!==v||e[93]!==Qe||e[94]!==et||e[95]!==ue||e[96]!==de||e[97]!==me||e[98]!==pe||e[99]!==le||e[100]!==p?(Ge=o.jsxRuntimeExports.jsxs(st.GraphContainer,{className:Qe,style:et,id:ee,ref:rt,"aria-label":V,backgroundColor:I,theme:le,language:He,minHeight:N,width:p,height:u,relativeHeight:v,padding:Z,children:[ue,de,me,pe]}),e[85]=V,e[86]=I,e[87]=ee,e[88]=u,e[89]=He,e[90]=N,e[91]=Z,e[92]=v,e[93]=Qe,e[94]=et,e[95]=ue,e[96]=de,e[97]=me,e[98]=pe,e[99]=le,e[100]=p,e[101]=Ge):Ge=e[101],Ge}function St(a){return a!=null}function Nt(a){return a.radius}function qt(a){return a.color}function Ot(a){return a.color}function Mt(a){return a.properties.NAME!=="Antarctica"}function $t(a){return a!==void 0}function Pt(a){return a!==void 0}function zt(a){return a.data}function It(a){return a!==void 0}function Lt(a){return a.data}function _t(a,e){return Dt.ascending(a,e)}exports.DotDensityMap=kt;
2
2
  //# sourceMappingURL=DotDensityMap.cjs.map