@undp/data-viz 1.3.0 → 1.4.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 (621) hide show
  1. package/dist/AreaChart.cjs +2 -0
  2. package/dist/AreaChart.cjs.map +1 -0
  3. package/dist/AreaChart.js +530 -1
  4. package/dist/AreaChart.js.map +1 -1
  5. package/dist/Axis-DE7dSn1_.cjs +2 -0
  6. package/dist/{Axis-BlyBRMNw.cjs.map → Axis-DE7dSn1_.cjs.map} +1 -1
  7. package/dist/{Axis-CvK-w3E2.js → Axis-Ddg-seDi.js} +10 -11
  8. package/dist/{Axis-CvK-w3E2.js.map → Axis-Ddg-seDi.js.map} +1 -1
  9. package/dist/AxisTitle-BmHLMRJZ.js +20 -0
  10. package/dist/{AxisTitle-BeMxcw5I.js.map → AxisTitle-BmHLMRJZ.js.map} +1 -1
  11. package/dist/AxisTitle-CK9YeovX.cjs +2 -0
  12. package/dist/{AxisTitle-BY8MI9jC.cjs.map → AxisTitle-CK9YeovX.cjs.map} +1 -1
  13. package/dist/BarGraph.cjs +2 -0
  14. package/dist/BarGraph.cjs.map +1 -0
  15. package/dist/BarGraph.js +4043 -1
  16. package/dist/BarGraph.js.map +1 -1
  17. package/dist/BasicStatCard.cjs +2 -0
  18. package/dist/BasicStatCard.cjs.map +1 -0
  19. package/dist/BasicStatCard.js +190 -1
  20. package/dist/BasicStatCard.js.map +1 -1
  21. package/dist/BeeSwarmChart.cjs +2 -0
  22. package/dist/BeeSwarmChart.cjs.map +1 -0
  23. package/dist/BeeSwarmChart.d.ts +0 -8
  24. package/dist/BeeSwarmChart.js +1042 -1
  25. package/dist/BeeSwarmChart.js.map +1 -1
  26. package/dist/BiVariateChoroplethMap.cjs +2 -0
  27. package/dist/BiVariateChoroplethMap.cjs.map +1 -0
  28. package/dist/BiVariateChoroplethMap.js +720 -1
  29. package/dist/BiVariateChoroplethMap.js.map +1 -1
  30. package/dist/BulletChart.cjs +2 -0
  31. package/dist/BulletChart.cjs.map +1 -0
  32. package/dist/BulletChart.js +1431 -1
  33. package/dist/BulletChart.js.map +1 -1
  34. package/dist/ButterflyChart.cjs +2 -0
  35. package/dist/ButterflyChart.cjs.map +1 -0
  36. package/dist/ButterflyChart.js +692 -1
  37. package/dist/ButterflyChart.js.map +1 -1
  38. package/dist/ChoroplethMap.cjs +2 -0
  39. package/dist/ChoroplethMap.cjs.map +1 -0
  40. package/dist/ChoroplethMap.js +745 -1
  41. package/dist/ChoroplethMap.js.map +1 -1
  42. package/dist/CirclePackingGraph.cjs +2 -0
  43. package/dist/CirclePackingGraph.cjs.map +1 -0
  44. package/dist/CirclePackingGraph.d.ts +0 -8
  45. package/dist/CirclePackingGraph.js +14 -1
  46. package/dist/CirclePackingGraph.js.map +1 -1
  47. package/dist/ColorLegend.cjs +2 -0
  48. package/dist/ColorLegend.cjs.map +1 -0
  49. package/dist/ColorLegend.js +47 -1
  50. package/dist/ColorLegend.js.map +1 -1
  51. package/dist/ColorLegendWithMouseOver.cjs +2 -0
  52. package/dist/ColorLegendWithMouseOver.cjs.map +1 -0
  53. package/dist/ColorLegendWithMouseOver.js +70 -1
  54. package/dist/ColorLegendWithMouseOver.js.map +1 -1
  55. package/dist/Colors.cjs +2 -0
  56. package/dist/Colors.cjs.map +1 -0
  57. package/dist/Colors.js +561 -1
  58. package/dist/Colors.js.map +1 -1
  59. package/dist/CopyTextButton.cjs +17 -0
  60. package/dist/CopyTextButton.cjs.map +1 -0
  61. package/dist/CopyTextButton.js +698 -16
  62. package/dist/CopyTextButton.js.map +1 -1
  63. package/dist/CsvDownloadButton.cjs +23 -0
  64. package/dist/CsvDownloadButton.cjs.map +1 -0
  65. package/dist/CsvDownloadButton.js +852 -7
  66. package/dist/CsvDownloadButton.js.map +1 -1
  67. package/dist/DataCards.cjs +22 -0
  68. package/dist/DataCards.cjs.map +1 -0
  69. package/dist/DataCards.js +624 -1
  70. package/dist/DataCards.js.map +1 -1
  71. package/dist/DataTable.cjs +2 -0
  72. package/dist/DataTable.cjs.map +1 -0
  73. package/dist/DataTable.js +331 -1
  74. package/dist/DataTable.js.map +1 -1
  75. package/dist/DifferenceLineChart.cjs +2 -0
  76. package/dist/DifferenceLineChart.cjs.map +1 -0
  77. package/dist/DifferenceLineChart.js +805 -1
  78. package/dist/DifferenceLineChart.js.map +1 -1
  79. package/dist/DonutChart.cjs +2 -0
  80. package/dist/DonutChart.cjs.map +1 -0
  81. package/dist/DonutChart.js +478 -1
  82. package/dist/DonutChart.js.map +1 -1
  83. package/dist/DotDensityMap.cjs +2 -0
  84. package/dist/DotDensityMap.cjs.map +1 -0
  85. package/dist/DotDensityMap.js +600 -1
  86. package/dist/DotDensityMap.js.map +1 -1
  87. package/dist/DropdownSelect-0I2QxaVy.cjs +29 -0
  88. package/dist/DropdownSelect-0I2QxaVy.cjs.map +1 -0
  89. package/dist/DropdownSelect-CDC9lEqU.js +4193 -0
  90. package/dist/DropdownSelect-CDC9lEqU.js.map +1 -0
  91. package/dist/DualAxisLineChart.cjs +2 -0
  92. package/dist/DualAxisLineChart.cjs.map +1 -0
  93. package/dist/DualAxisLineChart.js +699 -1
  94. package/dist/DualAxisLineChart.js.map +1 -1
  95. package/dist/DumbbellChart.cjs +2 -0
  96. package/dist/DumbbellChart.cjs.map +1 -0
  97. package/dist/DumbbellChart.js +1510 -1
  98. package/dist/DumbbellChart.js.map +1 -1
  99. package/dist/{EmptyState-b2Ln487i.js → EmptyState-DdTp-Mdn.js} +8 -8
  100. package/dist/{EmptyState-b2Ln487i.js.map → EmptyState-DdTp-Mdn.js.map} +1 -1
  101. package/dist/EmptyState-d8_8SxeW.cjs +2 -0
  102. package/dist/{EmptyState-BQguKAp5.cjs.map → EmptyState-d8_8SxeW.cjs.map} +1 -1
  103. package/dist/ExcelDownloadButton.cjs +2 -0
  104. package/dist/ExcelDownloadButton.cjs.map +1 -0
  105. package/dist/ExcelDownloadButton.js +29 -1
  106. package/dist/ExcelDownloadButton.js.map +1 -1
  107. package/dist/FootNote.cjs +2 -0
  108. package/dist/FootNote.cjs.map +1 -0
  109. package/dist/FootNote.js +20 -1
  110. package/dist/FootNote.js.map +1 -1
  111. package/dist/GeoHubCompareMaps.cjs +2 -0
  112. package/dist/GeoHubCompareMaps.cjs.map +1 -0
  113. package/dist/GeoHubCompareMaps.js +370 -1
  114. package/dist/GeoHubCompareMaps.js.map +1 -1
  115. package/dist/GeoHubMap.cjs +2 -0
  116. package/dist/GeoHubMap.cjs.map +1 -0
  117. package/dist/GeoHubMap.js +429 -1
  118. package/dist/GeoHubMap.js.map +1 -1
  119. package/dist/GeoHubMapWithLayerSelection.cjs +2 -0
  120. package/dist/GeoHubMapWithLayerSelection.cjs.map +1 -0
  121. package/dist/GeoHubMapWithLayerSelection.js +307 -1
  122. package/dist/GeoHubMapWithLayerSelection.js.map +1 -1
  123. package/dist/GraphDescription.cjs +2 -0
  124. package/dist/GraphDescription.cjs.map +1 -0
  125. package/dist/GraphDescription.js +20 -1
  126. package/dist/GraphDescription.js.map +1 -1
  127. package/dist/GraphEl-B6SoGRFW.cjs +2 -0
  128. package/dist/GraphEl-B6SoGRFW.cjs.map +1 -0
  129. package/dist/{checkIfMultiple-CaefP4X2.js → GraphEl-Cw2tDUb3.js} +123 -662
  130. package/dist/GraphEl-Cw2tDUb3.js.map +1 -0
  131. package/dist/GraphFooter.cjs +2 -0
  132. package/dist/GraphFooter.cjs.map +1 -0
  133. package/dist/GraphFooter.js +21 -1
  134. package/dist/GraphFooter.js.map +1 -1
  135. package/dist/GraphHeader.cjs +2 -0
  136. package/dist/GraphHeader.cjs.map +1 -0
  137. package/dist/GraphHeader.js +63 -1
  138. package/dist/GraphHeader.js.map +1 -1
  139. package/dist/GraphTitle.cjs +2 -0
  140. package/dist/GraphTitle.cjs.map +1 -0
  141. package/dist/GraphTitle.js +28 -1
  142. package/dist/GraphTitle.js.map +1 -1
  143. package/dist/GriddedGraphs.cjs +2 -0
  144. package/dist/GriddedGraphs.cjs.map +1 -0
  145. package/dist/GriddedGraphs.d.ts +2 -4
  146. package/dist/GriddedGraphs.js +483 -1
  147. package/dist/GriddedGraphs.js.map +1 -1
  148. package/dist/GriddedGraphsFromConfig.cjs +2 -0
  149. package/dist/GriddedGraphsFromConfig.cjs.map +1 -0
  150. package/dist/GriddedGraphsFromConfig.d.ts +2 -4
  151. package/dist/GriddedGraphsFromConfig.js +42 -1
  152. package/dist/GriddedGraphsFromConfig.js.map +1 -1
  153. package/dist/HeatMap.cjs +2 -0
  154. package/dist/HeatMap.cjs.map +1 -0
  155. package/dist/HeatMap.js +451 -1
  156. package/dist/HeatMap.js.map +1 -1
  157. package/dist/Histogram.cjs +2 -0
  158. package/dist/Histogram.cjs.map +1 -0
  159. package/dist/Histogram.js +287 -1
  160. package/dist/Histogram.js.map +1 -1
  161. package/dist/ImageDownloadButton.cjs +2 -0
  162. package/dist/ImageDownloadButton.cjs.map +1 -0
  163. package/dist/ImageDownloadButton.js +28 -1
  164. package/dist/ImageDownloadButton.js.map +1 -1
  165. package/dist/LineChartWithConfidenceInterval.cjs +2 -0
  166. package/dist/LineChartWithConfidenceInterval.cjs.map +1 -0
  167. package/dist/LineChartWithConfidenceInterval.js +818 -1
  168. package/dist/LineChartWithConfidenceInterval.js.map +1 -1
  169. package/dist/LinearColorLegend.cjs +2 -0
  170. package/dist/LinearColorLegend.cjs.map +1 -0
  171. package/dist/LinearColorLegend.js +33 -1
  172. package/dist/LinearColorLegend.js.map +1 -1
  173. package/dist/Modal-CUU6ZK3U.js +1019 -0
  174. package/dist/Modal-CUU6ZK3U.js.map +1 -0
  175. package/dist/Modal-C_dl0EtQ.cjs +46 -0
  176. package/dist/Modal-C_dl0EtQ.cjs.map +1 -0
  177. package/dist/MultiGraphDashboard.cjs +2 -0
  178. package/dist/MultiGraphDashboard.cjs.map +1 -0
  179. package/dist/MultiGraphDashboard.d.ts +16 -12
  180. package/dist/MultiGraphDashboard.js +303 -1
  181. package/dist/MultiGraphDashboard.js.map +1 -1
  182. package/dist/MultiGraphDashboardFromConfig.cjs +2 -0
  183. package/dist/MultiGraphDashboardFromConfig.cjs.map +1 -0
  184. package/dist/MultiGraphDashboardFromConfig.d.ts +16 -12
  185. package/dist/MultiGraphDashboardFromConfig.js +37 -1
  186. package/dist/MultiGraphDashboardFromConfig.js.map +1 -1
  187. package/dist/MultiGraphDashboardWideToLongFormat.cjs +2 -0
  188. package/dist/MultiGraphDashboardWideToLongFormat.cjs.map +1 -0
  189. package/dist/MultiGraphDashboardWideToLongFormat.js +243 -1
  190. package/dist/MultiGraphDashboardWideToLongFormat.js.map +1 -1
  191. package/dist/MultiGraphDashboardWideToLongFormatFromConfig.cjs +2 -0
  192. package/dist/MultiGraphDashboardWideToLongFormatFromConfig.cjs.map +1 -0
  193. package/dist/MultiGraphDashboardWideToLongFormatFromConfig.js +30 -1
  194. package/dist/MultiGraphDashboardWideToLongFormatFromConfig.js.map +1 -1
  195. package/dist/MultiLineAltChart.cjs +2 -0
  196. package/dist/MultiLineAltChart.cjs.map +1 -0
  197. package/dist/MultiLineAltChart.js +689 -1
  198. package/dist/MultiLineAltChart.js.map +1 -1
  199. package/dist/MultiLineChart.cjs +2 -0
  200. package/dist/MultiLineChart.cjs.map +1 -0
  201. package/dist/MultiLineChart.js +722 -1
  202. package/dist/MultiLineChart.js.map +1 -1
  203. package/dist/ParetoChart.cjs +2 -0
  204. package/dist/ParetoChart.cjs.map +1 -0
  205. package/dist/ParetoChart.js +636 -1
  206. package/dist/ParetoChart.js.map +1 -1
  207. package/dist/PerformanceIntensiveMultiGraphDashboard.cjs +2 -0
  208. package/dist/PerformanceIntensiveMultiGraphDashboard.cjs.map +1 -0
  209. package/dist/PerformanceIntensiveMultiGraphDashboard.d.ts +566 -0
  210. package/dist/PerformanceIntensiveMultiGraphDashboard.js +353 -0
  211. package/dist/PerformanceIntensiveMultiGraphDashboard.js.map +1 -0
  212. package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.cjs +2 -0
  213. package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.cjs.map +1 -0
  214. package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.d.ts +570 -0
  215. package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.js +38 -0
  216. package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.js.map +1 -0
  217. package/dist/PerformanceIntensiveScrollStory.cjs +2 -0
  218. package/dist/PerformanceIntensiveScrollStory.cjs.map +1 -0
  219. package/dist/PerformanceIntensiveScrollStory.d.ts +493 -0
  220. package/dist/PerformanceIntensiveScrollStory.js +122 -0
  221. package/dist/PerformanceIntensiveScrollStory.js.map +1 -0
  222. package/dist/RadarChart.cjs +2 -0
  223. package/dist/RadarChart.cjs.map +1 -0
  224. package/dist/RadarChart.js +677 -1
  225. package/dist/RadarChart.js.map +1 -1
  226. package/dist/{ReferenceLine-BgDdQbDI.js → ReferenceLine-C1GpoG9d.js} +33 -34
  227. package/dist/ReferenceLine-C1GpoG9d.js.map +1 -0
  228. package/dist/ReferenceLine-CuFMk0cI.cjs +2 -0
  229. package/dist/ReferenceLine-CuFMk0cI.cjs.map +1 -0
  230. package/dist/RegressionLine-7_rKTHN_.cjs +2 -0
  231. package/dist/{RegressionLine-BfpCuD7B.cjs.map → RegressionLine-7_rKTHN_.cjs.map} +1 -1
  232. package/dist/{RegressionLine-cSljpHaE.js → RegressionLine-BFwDCTUU.js} +17 -18
  233. package/dist/{RegressionLine-cSljpHaE.js.map → RegressionLine-BFwDCTUU.js.map} +1 -1
  234. package/dist/SVGDownloadButton.cjs +2 -0
  235. package/dist/SVGDownloadButton.cjs.map +1 -0
  236. package/dist/SVGDownloadButton.js +28 -1
  237. package/dist/SVGDownloadButton.js.map +1 -1
  238. package/dist/SankeyChart.cjs +2 -0
  239. package/dist/SankeyChart.cjs.map +1 -0
  240. package/dist/SankeyChart.js +989 -1
  241. package/dist/SankeyChart.js.map +1 -1
  242. package/dist/ScatterPlot.cjs +2 -0
  243. package/dist/ScatterPlot.cjs.map +1 -0
  244. package/dist/ScatterPlot.js +828 -1
  245. package/dist/ScatterPlot.js.map +1 -1
  246. package/dist/ScrollStory.cjs +2 -0
  247. package/dist/ScrollStory.cjs.map +1 -0
  248. package/dist/ScrollStory.d.ts +3 -5
  249. package/dist/ScrollStory.js +105 -1
  250. package/dist/ScrollStory.js.map +1 -1
  251. package/dist/SimpleLineChart.cjs +2 -0
  252. package/dist/SimpleLineChart.cjs.map +1 -0
  253. package/dist/SimpleLineChart.js +619 -1
  254. package/dist/SimpleLineChart.js.map +1 -1
  255. package/dist/SingleGraphDashboard.cjs +2 -0
  256. package/dist/SingleGraphDashboard.cjs.map +1 -0
  257. package/dist/SingleGraphDashboard.d.ts +2 -5
  258. package/dist/SingleGraphDashboard.js +522 -1
  259. package/dist/SingleGraphDashboard.js.map +1 -1
  260. package/dist/SingleGraphDashboardFromConfig.cjs +2 -0
  261. package/dist/SingleGraphDashboardFromConfig.cjs.map +1 -0
  262. package/dist/SingleGraphDashboardFromConfig.d.ts +2 -4
  263. package/dist/SingleGraphDashboardFromConfig.js +34 -1
  264. package/dist/SingleGraphDashboardFromConfig.js.map +1 -1
  265. package/dist/SingleGraphDashboardGeoHubMaps.cjs +2 -0
  266. package/dist/SingleGraphDashboardGeoHubMaps.cjs.map +1 -0
  267. package/dist/SingleGraphDashboardGeoHubMaps.d.ts +428 -0
  268. package/dist/SingleGraphDashboardGeoHubMaps.js +185 -0
  269. package/dist/SingleGraphDashboardGeoHubMaps.js.map +1 -0
  270. package/dist/SingleGraphDashboardGeoHubMapsFromConfig.cjs +2 -0
  271. package/dist/SingleGraphDashboardGeoHubMapsFromConfig.cjs.map +1 -0
  272. package/dist/SingleGraphDashboardGeoHubMapsFromConfig.d.ts +432 -0
  273. package/dist/SingleGraphDashboardGeoHubMapsFromConfig.js +25 -0
  274. package/dist/SingleGraphDashboardGeoHubMapsFromConfig.js.map +1 -0
  275. package/dist/SingleGraphDashboardThreeDGraphs.cjs +2 -0
  276. package/dist/SingleGraphDashboardThreeDGraphs.cjs.map +1 -0
  277. package/dist/SingleGraphDashboardThreeDGraphs.d.ts +540 -0
  278. package/dist/SingleGraphDashboardThreeDGraphs.js +610 -0
  279. package/dist/SingleGraphDashboardThreeDGraphs.js.map +1 -0
  280. package/dist/SingleGraphDashboardThreeDGraphsFromConfig.cjs +2 -0
  281. package/dist/SingleGraphDashboardThreeDGraphsFromConfig.cjs.map +1 -0
  282. package/dist/SingleGraphDashboardThreeDGraphsFromConfig.d.ts +543 -0
  283. package/dist/SingleGraphDashboardThreeDGraphsFromConfig.js +35 -0
  284. package/dist/SingleGraphDashboardThreeDGraphsFromConfig.js.map +1 -0
  285. package/dist/SlopeChart.cjs +2 -0
  286. package/dist/SlopeChart.cjs.map +1 -0
  287. package/dist/SlopeChart.js +582 -1
  288. package/dist/SlopeChart.js.map +1 -1
  289. package/dist/Source.cjs +2 -0
  290. package/dist/Source.cjs.map +1 -0
  291. package/dist/Source.js +40 -1
  292. package/dist/Source.js.map +1 -1
  293. package/dist/SparkLine.cjs +2 -0
  294. package/dist/SparkLine.cjs.map +1 -0
  295. package/dist/SparkLine.js +320 -1
  296. package/dist/SparkLine.js.map +1 -1
  297. package/dist/Spinner-C85UF28E.js +30 -0
  298. package/dist/Spinner-C85UF28E.js.map +1 -0
  299. package/dist/Spinner-DA6Z5E4n.cjs +2 -0
  300. package/dist/Spinner-DA6Z5E4n.cjs.map +1 -0
  301. package/dist/StatCardFromData.cjs +2 -0
  302. package/dist/StatCardFromData.cjs.map +1 -0
  303. package/dist/StatCardFromData.js +249 -1
  304. package/dist/StatCardFromData.js.map +1 -1
  305. package/dist/StripChart.cjs +2 -0
  306. package/dist/StripChart.cjs.map +1 -0
  307. package/dist/StripChart.js +988 -1
  308. package/dist/StripChart.js.map +1 -1
  309. package/dist/ThreeDGlobe.cjs +2 -0
  310. package/dist/ThreeDGlobe.cjs.map +1 -0
  311. package/dist/ThreeDGlobe.js +451 -1
  312. package/dist/ThreeDGlobe.js.map +1 -1
  313. package/dist/ThresholdColorLegendWithMouseOver.cjs +2 -0
  314. package/dist/ThresholdColorLegendWithMouseOver.cjs.map +1 -0
  315. package/dist/ThresholdColorLegendWithMouseOver.js +130 -1
  316. package/dist/ThresholdColorLegendWithMouseOver.js.map +1 -1
  317. package/dist/{Tooltip-CzZ1wFyF.js → Tooltip-DyM5snqx.js} +15 -16
  318. package/dist/{Tooltip-CzZ1wFyF.js.map → Tooltip-DyM5snqx.js.map} +1 -1
  319. package/dist/Tooltip-n8z5bfav.cjs +2 -0
  320. package/dist/{Tooltip-BM18N_3l.cjs.map → Tooltip-n8z5bfav.cjs.map} +1 -1
  321. package/dist/TreeMapGraph.cjs +2 -0
  322. package/dist/TreeMapGraph.cjs.map +1 -0
  323. package/dist/TreeMapGraph.js +760 -1
  324. package/dist/TreeMapGraph.js.map +1 -1
  325. package/dist/Types.cjs +2 -0
  326. package/dist/Types.cjs.map +1 -0
  327. package/dist/Types.d.ts +38 -11
  328. package/dist/Types.js +1 -1
  329. package/dist/Typography-Ctgfl1J5.js +140 -0
  330. package/dist/Typography-Ctgfl1J5.js.map +1 -0
  331. package/dist/Typography-k-kOjICQ.cjs +2 -0
  332. package/dist/Typography-k-kOjICQ.cjs.map +1 -0
  333. package/dist/UnitChart.cjs +2 -0
  334. package/dist/UnitChart.cjs.map +1 -0
  335. package/dist/UnitChart.js +216 -1
  336. package/dist/UnitChart.js.map +1 -1
  337. package/dist/XAxesLabels-CJMQbfVy.cjs +2 -0
  338. package/dist/{XAxesLabels-C9REbQQs.cjs.map → XAxesLabels-CJMQbfVy.cjs.map} +1 -1
  339. package/dist/{XAxesLabels-DVw7Lvuz.js → XAxesLabels-DQFo_z2R.js} +21 -22
  340. package/dist/{XAxesLabels-DVw7Lvuz.js.map → XAxesLabels-DQFo_z2R.js.map} +1 -1
  341. package/dist/{XTicksAndGridLines-CUefTINd.js → XTicksAndGridLines-Bn9u5gOM.js} +19 -20
  342. package/dist/{XTicksAndGridLines-CUefTINd.js.map → XTicksAndGridLines-Bn9u5gOM.js.map} +1 -1
  343. package/dist/XTicksAndGridLines-CCzXIV8d.cjs +2 -0
  344. package/dist/{XTicksAndGridLines-DuK35ROS.cjs.map → XTicksAndGridLines-CCzXIV8d.cjs.map} +1 -1
  345. package/dist/YAxesLabels-BXLTX7AI.cjs +2 -0
  346. package/dist/{YAxesLabels-DhBdLk3Z.cjs.map → YAxesLabels-BXLTX7AI.cjs.map} +1 -1
  347. package/dist/{YAxesLabels-CYVY053X.js → YAxesLabels-H5-002X5.js} +11 -12
  348. package/dist/{YAxesLabels-CYVY053X.js.map → YAxesLabels-H5-002X5.js.map} +1 -1
  349. package/dist/{YTicksAndGridLines-BJRXuBdC.js → YTicksAndGridLines-B6ah7CRf.js} +14 -15
  350. package/dist/{YTicksAndGridLines-BJRXuBdC.js.map → YTicksAndGridLines-B6ah7CRf.js.map} +1 -1
  351. package/dist/YTicksAndGridLines-DBDuz6vb.cjs +2 -0
  352. package/dist/{YTicksAndGridLines-CtLvzExe.cjs.map → YTicksAndGridLines-DBDuz6vb.cjs.map} +1 -1
  353. package/dist/checkIfMultiple-CYp3vADF.js +912 -0
  354. package/dist/checkIfMultiple-CYp3vADF.js.map +1 -0
  355. package/dist/checkIfMultiple-Do4kADNr.cjs +12 -0
  356. package/dist/checkIfMultiple-Do4kADNr.cjs.map +1 -0
  357. package/dist/checkIfNullOrUndefined-BCW3Y1ML.cjs +2 -0
  358. package/dist/checkIfNullOrUndefined-BCW3Y1ML.cjs.map +1 -0
  359. package/dist/checkIfNullOrUndefined-DmfiKkNw.js +7 -0
  360. package/dist/checkIfNullOrUndefined-DmfiKkNw.js.map +1 -0
  361. package/dist/customArea-BYNyxAkm.cjs +2 -0
  362. package/dist/{customArea-B47Ew5cT.cjs.map → customArea-BYNyxAkm.cjs.map} +1 -1
  363. package/dist/{customArea-I3MsoqIl.js → customArea-CaxScFmW.js} +29 -30
  364. package/dist/{customArea-I3MsoqIl.js.map → customArea-CaxScFmW.js.map} +1 -1
  365. package/dist/excelDownload-BOA-lskf.js +19 -0
  366. package/dist/excelDownload-BOA-lskf.js.map +1 -0
  367. package/dist/excelDownload-BQpsCa62.cjs +2 -0
  368. package/dist/excelDownload-BQpsCa62.cjs.map +1 -0
  369. package/dist/fetchAndParseData-Bcmr659B.js +1196 -0
  370. package/dist/fetchAndParseData-Bcmr659B.js.map +1 -0
  371. package/dist/fetchAndParseData-DmgQtB9n.cjs +16 -0
  372. package/dist/fetchAndParseData-DmgQtB9n.cjs.map +1 -0
  373. package/dist/fetchAndParseData.cjs +2 -0
  374. package/dist/fetchAndParseData.cjs.map +1 -0
  375. package/dist/fetchAndParseData.js +9 -15
  376. package/dist/fetchAndParseData.js.map +1 -1
  377. package/dist/getGraphList-DuColTJM.js +265 -0
  378. package/dist/getGraphList-DuColTJM.js.map +1 -0
  379. package/dist/getGraphList-gf02xgT2.cjs +2 -0
  380. package/dist/getGraphList-gf02xgT2.cjs.map +1 -0
  381. package/dist/getJenks-TWQvbuOz.cjs +2 -0
  382. package/dist/getJenks-TWQvbuOz.cjs.map +1 -0
  383. package/dist/getJenks-VhM3GIoC.js +23 -0
  384. package/dist/getJenks-VhM3GIoC.js.map +1 -0
  385. package/dist/getSchema.cjs +2 -0
  386. package/dist/getSchema.cjs.map +1 -0
  387. package/dist/getSchema.d.ts +7 -5
  388. package/dist/getSchema.js +910 -1
  389. package/dist/getSchema.js.map +1 -1
  390. package/dist/getSliderMarks-C0jptXeP.js +1054 -0
  391. package/dist/getSliderMarks-C0jptXeP.js.map +1 -0
  392. package/dist/getSliderMarks-CtsEXiLV.cjs +6 -0
  393. package/dist/getSliderMarks-CtsEXiLV.cjs.map +1 -0
  394. package/dist/getTextColorBasedOnBgColor-B6Nk2WBf.js +28 -0
  395. package/dist/getTextColorBasedOnBgColor-B6Nk2WBf.js.map +1 -0
  396. package/dist/getTextColorBasedOnBgColor-nqY-bsM_.cjs +2 -0
  397. package/dist/getTextColorBasedOnBgColor-nqY-bsM_.cjs.map +1 -0
  398. package/dist/getUniqValue-BtUENB2H.js +20 -0
  399. package/dist/getUniqValue-BtUENB2H.js.map +1 -0
  400. package/dist/getUniqValue-CHqgSss5.cjs +2 -0
  401. package/dist/getUniqValue-CHqgSss5.cjs.map +1 -0
  402. package/dist/imageDownload-CgDcm1Sj.cjs +3 -0
  403. package/dist/imageDownload-CgDcm1Sj.cjs.map +1 -0
  404. package/dist/imageDownload-Dcci2LEy.js +495 -0
  405. package/dist/imageDownload-Dcci2LEy.js.map +1 -0
  406. package/dist/index-BVnYktl4.js +435 -0
  407. package/dist/index-BVnYktl4.js.map +1 -0
  408. package/dist/index-BW_-wD2k.cjs +2 -0
  409. package/dist/index-BW_-wD2k.cjs.map +1 -0
  410. package/dist/{index-DXmF_0ez.js → index-BmCqpO1B.js} +74 -40
  411. package/dist/index-BmCqpO1B.js.map +1 -0
  412. package/dist/{index-Db-Yg_Ud.js → index-BxAUvrua.js} +19 -19
  413. package/dist/{index-Db-Yg_Ud.js.map → index-BxAUvrua.js.map} +1 -1
  414. package/dist/index-CHPV5EwG-BPSP-7Jg.js +3341 -0
  415. package/dist/index-CHPV5EwG-BPSP-7Jg.js.map +1 -0
  416. package/dist/index-CHPV5EwG-DDoeWRVt.cjs +44 -0
  417. package/dist/index-CHPV5EwG-DDoeWRVt.cjs.map +1 -0
  418. package/dist/index-CylX-pWB.cjs +2 -0
  419. package/dist/{index-BYroABPm.cjs.map → index-CylX-pWB.cjs.map} +1 -1
  420. package/dist/index-DG3YrCr5-D3FrrXj8.js +459 -0
  421. package/dist/index-DG3YrCr5-D3FrrXj8.js.map +1 -0
  422. package/dist/index-DG3YrCr5-v7rayV3N.cjs +2 -0
  423. package/dist/index-DG3YrCr5-v7rayV3N.cjs.map +1 -0
  424. package/dist/index-DVOJ7vxH.cjs +10 -0
  425. package/dist/{index-a2C2Bqn2.cjs.map → index-DVOJ7vxH.cjs.map} +1 -1
  426. package/dist/index-D_n8aamX.cjs +2 -0
  427. package/dist/index-D_n8aamX.cjs.map +1 -0
  428. package/dist/{index-DzdwZ2OA.js → index-n_RI8T0n.js} +3 -3
  429. package/dist/{index-DzdwZ2OA.js.map → index-n_RI8T0n.js.map} +1 -1
  430. package/dist/index-tvAyXPPW-DBlMKnNB.js +47 -0
  431. package/dist/index-tvAyXPPW-DBlMKnNB.js.map +1 -0
  432. package/dist/index-tvAyXPPW-DPOG-C2i.cjs +2 -0
  433. package/dist/index-tvAyXPPW-DPOG-C2i.cjs.map +1 -0
  434. package/dist/index.cjs +2 -0
  435. package/dist/index.cjs.map +1 -0
  436. package/dist/index.d.ts +331 -168
  437. package/dist/index.js +194 -1
  438. package/dist/index.js.map +1 -1
  439. package/dist/numberFormattingFunction-02t-wJta.cjs +2 -0
  440. package/dist/numberFormattingFunction-02t-wJta.cjs.map +1 -0
  441. package/dist/numberFormattingFunction-14YCbkN2.js +13 -0
  442. package/dist/numberFormattingFunction-14YCbkN2.js.map +1 -0
  443. package/dist/{use-in-view-CZPXmTZM.js → proxy-DJxJg1kD.js} +699 -732
  444. package/dist/proxy-DJxJg1kD.js.map +1 -0
  445. package/dist/{use-in-view-Dl1CsAIo.cjs → proxy-PQd2AItT.cjs} +2 -2
  446. package/dist/proxy-PQd2AItT.cjs.map +1 -0
  447. package/dist/removeOutliers-DR48e-18.js +57 -0
  448. package/dist/removeOutliers-DR48e-18.js.map +1 -0
  449. package/dist/removeOutliers-WELHHqiI.cjs +2 -0
  450. package/dist/removeOutliers-WELHHqiI.cjs.map +1 -0
  451. package/dist/{string2HTML-BX0oNw83.js → string2HTML-CWHGfz_d.js} +2 -2
  452. package/dist/{string2HTML-BX0oNw83.js.map → string2HTML-CWHGfz_d.js.map} +1 -1
  453. package/dist/{string2HTML-X4ZYX5jI.cjs → string2HTML-D2Avudmb.cjs} +2 -2
  454. package/dist/{string2HTML-X4ZYX5jI.cjs.map → string2HTML-D2Avudmb.cjs.map} +1 -1
  455. package/dist/svgDownload-C2-E3yf2.js +9 -0
  456. package/dist/svgDownload-C2-E3yf2.js.map +1 -0
  457. package/dist/svgDownload-D9zEGjTF.cjs +2 -0
  458. package/dist/svgDownload-D9zEGjTF.cjs.map +1 -0
  459. package/dist/toConsumableArray-DiWOvh_d-DcLaZvDq.cjs +4 -0
  460. package/dist/toConsumableArray-DiWOvh_d-DcLaZvDq.cjs.map +1 -0
  461. package/dist/toConsumableArray-DiWOvh_d-DlpOlgap.js +145 -0
  462. package/dist/toConsumableArray-DiWOvh_d-DlpOlgap.js.map +1 -0
  463. package/dist/transformData.cjs +2 -0
  464. package/dist/transformData.cjs.map +1 -0
  465. package/dist/transformData.d.ts +170 -0
  466. package/dist/transformData.js +10 -0
  467. package/dist/transformData.js.map +1 -0
  468. package/dist/transformDataForAggregation-CdcwlnNe.js +759 -0
  469. package/dist/transformDataForAggregation-CdcwlnNe.js.map +1 -0
  470. package/dist/transformDataForAggregation-Du-Hei-W.cjs +2 -0
  471. package/dist/transformDataForAggregation-Du-Hei-W.cjs.map +1 -0
  472. package/dist/transformDataForGraphFromFile-CA0rw80A.js +24 -0
  473. package/dist/transformDataForGraphFromFile-CA0rw80A.js.map +1 -0
  474. package/dist/transformDataForGraphFromFile-D9G3ToQf.cjs +2 -0
  475. package/dist/transformDataForGraphFromFile-D9G3ToQf.cjs.map +1 -0
  476. package/dist/transformDataForSelect-D8AuvYdf.js +14 -0
  477. package/dist/transformDataForSelect-D8AuvYdf.js.map +1 -0
  478. package/dist/transformDataForSelect-YmStusCI.cjs +2 -0
  479. package/dist/transformDataForSelect-YmStusCI.cjs.map +1 -0
  480. package/dist/use-in-view-BAHrBy6b.js +40 -0
  481. package/dist/use-in-view-BAHrBy6b.js.map +1 -0
  482. package/dist/use-in-view-BCmzDU2O.cjs +2 -0
  483. package/dist/use-in-view-BCmzDU2O.cjs.map +1 -0
  484. package/dist/utils.cjs +2 -0
  485. package/dist/utils.cjs.map +1 -0
  486. package/dist/utils.d.ts +217 -0
  487. package/dist/utils.js +27 -0
  488. package/dist/utils.js.map +1 -0
  489. package/dist/validateSchema.cjs +2 -0
  490. package/dist/validateSchema.cjs.map +1 -0
  491. package/dist/validateSchema.d.ts +2 -4
  492. package/dist/validateSchema.js +104 -1
  493. package/dist/validateSchema.js.map +1 -1
  494. package/dist/x-CnsEH4Ox-CGGXQl4M.cjs +27 -0
  495. package/dist/x-CnsEH4Ox-CGGXQl4M.cjs.map +1 -0
  496. package/dist/x-CnsEH4Ox-DDvAJndW.js +101 -0
  497. package/dist/x-CnsEH4Ox-DDvAJndW.js.map +1 -0
  498. package/package.json +50 -90
  499. package/dist/Axis-BlyBRMNw.cjs +0 -2
  500. package/dist/AxisTitle-BY8MI9jC.cjs +0 -2
  501. package/dist/AxisTitle-BeMxcw5I.js +0 -21
  502. package/dist/DropdownSelect-CuzV7gdj.cjs +0 -29
  503. package/dist/DropdownSelect-CuzV7gdj.cjs.map +0 -1
  504. package/dist/DropdownSelect-DmZsXrhY.js +0 -2698
  505. package/dist/DropdownSelect-DmZsXrhY.js.map +0 -1
  506. package/dist/EmptyState-BQguKAp5.cjs +0 -2
  507. package/dist/Modal-C9txyGOk.js +0 -723
  508. package/dist/Modal-C9txyGOk.js.map +0 -1
  509. package/dist/Modal-cQF2UQIa.cjs +0 -46
  510. package/dist/Modal-cQF2UQIa.cjs.map +0 -1
  511. package/dist/ReferenceLine-BgDdQbDI.js.map +0 -1
  512. package/dist/ReferenceLine-Bsb5jeE4.cjs +0 -2
  513. package/dist/ReferenceLine-Bsb5jeE4.cjs.map +0 -1
  514. package/dist/RegressionLine-BfpCuD7B.cjs +0 -2
  515. package/dist/Spinner-DN3s4S0H.js +0 -17
  516. package/dist/Spinner-DN3s4S0H.js.map +0 -1
  517. package/dist/Spinner-UmN-KPe9.cjs +0 -2
  518. package/dist/Spinner-UmN-KPe9.cjs.map +0 -1
  519. package/dist/Tooltip-BM18N_3l.cjs +0 -2
  520. package/dist/Typography-CDR-DAHH.cjs +0 -2
  521. package/dist/Typography-CDR-DAHH.cjs.map +0 -1
  522. package/dist/Typography-XJoSE-By.js +0 -58
  523. package/dist/Typography-XJoSE-By.js.map +0 -1
  524. package/dist/XAxesLabels-C9REbQQs.cjs +0 -2
  525. package/dist/XTicksAndGridLines-DuK35ROS.cjs +0 -2
  526. package/dist/YAxesLabels-DhBdLk3Z.cjs +0 -2
  527. package/dist/YTicksAndGridLines-CtLvzExe.cjs +0 -2
  528. package/dist/checkIfMultiple-CaefP4X2.js.map +0 -1
  529. package/dist/checkIfMultiple-D3h8to1T.cjs +0 -12
  530. package/dist/checkIfMultiple-D3h8to1T.cjs.map +0 -1
  531. package/dist/checkIfNullOrUndefined.d.ts +0 -15
  532. package/dist/checkIfNullOrUndefined.js +0 -2
  533. package/dist/checkIfNullOrUndefined.js.map +0 -1
  534. package/dist/customArea-B47Ew5cT.cjs +0 -2
  535. package/dist/excelDownload.d.ts +0 -31
  536. package/dist/excelDownload.js +0 -2
  537. package/dist/excelDownload.js.map +0 -1
  538. package/dist/generateCodes.d.ts +0 -25
  539. package/dist/generateCodes.js +0 -2
  540. package/dist/generateCodes.js.map +0 -1
  541. package/dist/getJenks.d.ts +0 -17
  542. package/dist/getJenks.js +0 -2
  543. package/dist/getJenks.js.map +0 -1
  544. package/dist/getPercentileValue.d.ts +0 -13
  545. package/dist/getPercentileValue.js +0 -2
  546. package/dist/getPercentileValue.js.map +0 -1
  547. package/dist/getQueryParamsFromLink.d.ts +0 -18
  548. package/dist/getQueryParamsFromLink.js +0 -2
  549. package/dist/getQueryParamsFromLink.js.map +0 -1
  550. package/dist/getSliderMarks-CWajGCGq.js +0 -719
  551. package/dist/getSliderMarks-CWajGCGq.js.map +0 -1
  552. package/dist/getSliderMarks-DDJ1CdhL.cjs +0 -6
  553. package/dist/getSliderMarks-DDJ1CdhL.cjs.map +0 -1
  554. package/dist/getTextColorBasedOnBgColor.d.ts +0 -13
  555. package/dist/getTextColorBasedOnBgColor.js +0 -2
  556. package/dist/getTextColorBasedOnBgColor.js.map +0 -1
  557. package/dist/getUniqValue.d.ts +0 -18
  558. package/dist/getUniqValue.js +0 -2
  559. package/dist/getUniqValue.js.map +0 -1
  560. package/dist/graphList.d.ts +0 -9
  561. package/dist/graphList.js +0 -2
  562. package/dist/graphList.js.map +0 -1
  563. package/dist/imageDownload.d.ts +0 -16
  564. package/dist/imageDownload.js +0 -3
  565. package/dist/imageDownload.js.map +0 -1
  566. package/dist/index-01r5X3Gr-9jE0ObrK.cjs +0 -2
  567. package/dist/index-01r5X3Gr-9jE0ObrK.cjs.map +0 -1
  568. package/dist/index-01r5X3Gr-kH7FxQ7P.js +0 -451
  569. package/dist/index-01r5X3Gr-kH7FxQ7P.js.map +0 -1
  570. package/dist/index-BGMGC-HN.cjs +0 -22
  571. package/dist/index-BGMGC-HN.cjs.map +0 -1
  572. package/dist/index-BHm2KTjD-2e-Fu8L-.js +0 -702
  573. package/dist/index-BHm2KTjD-2e-Fu8L-.js.map +0 -1
  574. package/dist/index-BHm2KTjD-D8FylaKc.cjs +0 -44
  575. package/dist/index-BHm2KTjD-D8FylaKc.cjs.map +0 -1
  576. package/dist/index-BIPNFFja.js +0 -506
  577. package/dist/index-BIPNFFja.js.map +0 -1
  578. package/dist/index-BYroABPm.cjs +0 -2
  579. package/dist/index-CEc_9zWy.cjs +0 -2
  580. package/dist/index-CEc_9zWy.cjs.map +0 -1
  581. package/dist/index-CbVeVrla.cjs +0 -2
  582. package/dist/index-CbVeVrla.cjs.map +0 -1
  583. package/dist/index-CqzhBPuO-CfQywbdq.js +0 -41
  584. package/dist/index-CqzhBPuO-CfQywbdq.js.map +0 -1
  585. package/dist/index-CqzhBPuO-raKZqS7l.cjs +0 -2
  586. package/dist/index-CqzhBPuO-raKZqS7l.cjs.map +0 -1
  587. package/dist/index-DSnvdkHZ.js +0 -495
  588. package/dist/index-DSnvdkHZ.js.map +0 -1
  589. package/dist/index-DXmF_0ez.js.map +0 -1
  590. package/dist/index-a2C2Bqn2.cjs +0 -10
  591. package/dist/numberFormattingFunction.d.ts +0 -22
  592. package/dist/numberFormattingFunction.js +0 -2
  593. package/dist/numberFormattingFunction.js.map +0 -1
  594. package/dist/removeOutliers.d.ts +0 -16
  595. package/dist/removeOutliers.js +0 -2
  596. package/dist/removeOutliers.js.map +0 -1
  597. package/dist/svgDownload.d.ts +0 -16
  598. package/dist/svgDownload.js +0 -2
  599. package/dist/svgDownload.js.map +0 -1
  600. package/dist/toConsumableArray-BSMMWi3w-Cu4vcE-m.js +0 -139
  601. package/dist/toConsumableArray-BSMMWi3w-Cu4vcE-m.js.map +0 -1
  602. package/dist/toConsumableArray-BSMMWi3w-DJL7-zAp.cjs +0 -4
  603. package/dist/toConsumableArray-BSMMWi3w-DJL7-zAp.cjs.map +0 -1
  604. package/dist/transformColumnsToArray.d.ts +0 -38
  605. package/dist/transformColumnsToArray.js +0 -2
  606. package/dist/transformColumnsToArray.js.map +0 -1
  607. package/dist/transformDataForAggregation.d.ts +0 -38
  608. package/dist/transformDataForAggregation.js +0 -2
  609. package/dist/transformDataForAggregation.js.map +0 -1
  610. package/dist/transformDataForGraph.d.ts +0 -47
  611. package/dist/transformDataForGraph.js +0 -2
  612. package/dist/transformDataForGraph.js.map +0 -1
  613. package/dist/transformDataForGraphFromFile.d.ts +0 -66
  614. package/dist/transformDataForGraphFromFile.js +0 -2
  615. package/dist/transformDataForGraphFromFile.js.map +0 -1
  616. package/dist/use-in-view-CZPXmTZM.js.map +0 -1
  617. package/dist/use-in-view-Dl1CsAIo.cjs.map +0 -1
  618. package/dist/x-Dft9NVe_-DcB7wtv5.js +0 -61
  619. package/dist/x-Dft9NVe_-DcB7wtv5.js.map +0 -1
  620. package/dist/x-Dft9NVe_-LeyJu02C.cjs +0 -27
  621. package/dist/x-Dft9NVe_-LeyJu02C.cjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Histogram.js","sources":["../node_modules/d3-array/src/count.js","../node_modules/d3-array/src/identity.js","../node_modules/d3-array/src/array.js","../node_modules/d3-array/src/constant.js","../node_modules/d3-array/src/nice.js","../node_modules/d3-array/src/threshold/sturges.js","../node_modules/d3-array/src/bin.js","../src/Components/Graphs/Histogram/index.tsx"],"sourcesContent":["export default function count(values, valueof) {\n let count = 0;\n if (valueof === undefined) {\n for (let value of values) {\n if (value != null && (value = +value) >= value) {\n ++count;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null && (value = +value) >= value) {\n ++count;\n }\n }\n }\n return count;\n}\n","export default function identity(x) {\n return x;\n}\n","var array = Array.prototype;\n\nexport var slice = array.slice;\nexport var map = array.map;\n","export default function constant(x) {\n return () => x;\n}\n","import {tickIncrement} from \"./ticks.js\";\n\nexport default function nice(start, stop, count) {\n let prestep;\n while (true) {\n const step = tickIncrement(start, stop, count);\n if (step === prestep || step === 0 || !isFinite(step)) {\n return [start, stop];\n } else if (step > 0) {\n start = Math.floor(start / step) * step;\n stop = Math.ceil(stop / step) * step;\n } else if (step < 0) {\n start = Math.ceil(start * step) / step;\n stop = Math.floor(stop * step) / step;\n }\n prestep = step;\n }\n}\n","import count from \"../count.js\";\n\nexport default function thresholdSturges(values) {\n return Math.max(1, Math.ceil(Math.log(count(values)) / Math.LN2) + 1);\n}\n","import {slice} from \"./array.js\";\nimport bisect from \"./bisect.js\";\nimport constant from \"./constant.js\";\nimport extent from \"./extent.js\";\nimport identity from \"./identity.js\";\nimport nice from \"./nice.js\";\nimport ticks, {tickIncrement} from \"./ticks.js\";\nimport sturges from \"./threshold/sturges.js\";\n\nexport default function bin() {\n var value = identity,\n domain = extent,\n threshold = sturges;\n\n function histogram(data) {\n if (!Array.isArray(data)) data = Array.from(data);\n\n var i,\n n = data.length,\n x,\n step,\n values = new Array(n);\n\n for (i = 0; i < n; ++i) {\n values[i] = value(data[i], i, data);\n }\n\n var xz = domain(values),\n x0 = xz[0],\n x1 = xz[1],\n tz = threshold(values, x0, x1);\n\n // Convert number of thresholds into uniform thresholds, and nice the\n // default domain accordingly.\n if (!Array.isArray(tz)) {\n const max = x1, tn = +tz;\n if (domain === extent) [x0, x1] = nice(x0, x1, tn);\n tz = ticks(x0, x1, tn);\n\n // If the domain is aligned with the first tick (which it will by\n // default), then we can use quantization rather than bisection to bin\n // values, which is substantially faster.\n if (tz[0] <= x0) step = tickIncrement(x0, x1, tn);\n\n // If the last threshold is coincident with the domain’s upper bound, the\n // last bin will be zero-width. If the default domain is used, and this\n // last threshold is coincident with the maximum input value, we can\n // extend the niced upper bound by one tick to ensure uniform bin widths;\n // otherwise, we simply remove the last threshold. Note that we don’t\n // coerce values or the domain to numbers, and thus must be careful to\n // compare order (>=) rather than strict equality (===)!\n if (tz[tz.length - 1] >= x1) {\n if (max >= x1 && domain === extent) {\n const step = tickIncrement(x0, x1, tn);\n if (isFinite(step)) {\n if (step > 0) {\n x1 = (Math.floor(x1 / step) + 1) * step;\n } else if (step < 0) {\n x1 = (Math.ceil(x1 * -step) + 1) / -step;\n }\n }\n } else {\n tz.pop();\n }\n }\n }\n\n // Remove any thresholds outside the domain.\n // Be careful not to mutate an array owned by the user!\n var m = tz.length, a = 0, b = m;\n while (tz[a] <= x0) ++a;\n while (tz[b - 1] > x1) --b;\n if (a || b < m) tz = tz.slice(a, b), m = b - a;\n\n var bins = new Array(m + 1),\n bin;\n\n // Initialize bins.\n for (i = 0; i <= m; ++i) {\n bin = bins[i] = [];\n bin.x0 = i > 0 ? tz[i - 1] : x0;\n bin.x1 = i < m ? tz[i] : x1;\n }\n\n // Assign data to bins by value, ignoring any outside the domain.\n if (isFinite(step)) {\n if (step > 0) {\n for (i = 0; i < n; ++i) {\n if ((x = values[i]) != null && x0 <= x && x <= x1) {\n bins[Math.min(m, Math.floor((x - x0) / step))].push(data[i]);\n }\n }\n } else if (step < 0) {\n for (i = 0; i < n; ++i) {\n if ((x = values[i]) != null && x0 <= x && x <= x1) {\n const j = Math.floor((x0 - x) * step);\n bins[Math.min(m, j + (tz[j] <= x))].push(data[i]); // handle off-by-one due to rounding\n }\n }\n }\n } else {\n for (i = 0; i < n; ++i) {\n if ((x = values[i]) != null && x0 <= x && x <= x1) {\n bins[bisect(tz, x, 0, m)].push(data[i]);\n }\n }\n }\n\n return bins;\n }\n\n histogram.value = function(_) {\n return arguments.length ? (value = typeof _ === \"function\" ? _ : constant(_), histogram) : value;\n };\n\n histogram.domain = function(_) {\n return arguments.length ? (domain = typeof _ === \"function\" ? _ : constant([_[0], _[1]]), histogram) : domain;\n };\n\n histogram.thresholds = function(_) {\n return arguments.length ? (threshold = typeof _ === \"function\" ? _ : constant(Array.isArray(_) ? slice.call(_) : _), histogram) : threshold;\n };\n\n return histogram;\n}\n","import { useState, useEffect } from 'react';\r\nimport { bin } from 'd3-array';\r\nimport { Spinner } from '@undp/design-system-react/Spinner';\r\n\r\nimport { CirclePackingGraph } from '../CirclePackingGraph';\r\nimport { TreeMapGraph } from '../TreeMapGraph';\r\nimport { DonutChart } from '../DonutChart';\r\nimport { SimpleBarGraph } from '../BarGraph';\r\n\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport {\r\n TreeMapDataType,\r\n ReferenceDataType,\r\n HistogramDataType,\r\n DonutChartDataType,\r\n SourcesDataType,\r\n Languages,\r\n StyleObject,\r\n ClassNameObject,\r\n} from '@/Types';\r\n\r\ninterface Props {\r\n // Data\r\n /** Array of data objects */\r\n data: HistogramDataType[];\r\n\r\n /** Type of the graph for histogram */\r\n graphType?: 'circlePacking' | 'treeMap' | 'barGraph' | 'donutChart';\r\n\r\n // Titles, Labels, and Sources\r\n /** Title of the graph */\r\n graphTitle?: string | React.ReactNode;\r\n /** Description of the graph */\r\n graphDescription?: string | React.ReactNode;\r\n /** Footnote for the graph */\r\n footNote?: string | React.ReactNode;\r\n /** Source data for the graph */\r\n sources?: SourcesDataType[];\r\n /** Accessibility label */\r\n ariaLabel?: string;\r\n\r\n // Colors and Styling\r\n /** Colors for visualization */\r\n colors?: string[] | 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 /** Left margin of the graph */\r\n leftMargin?: number;\r\n /** Right margin of the graph */\r\n rightMargin?: number;\r\n /** Top margin of the graph */\r\n topMargin?: number;\r\n /** Bottom margin of the graph */\r\n bottomMargin?: number;\r\n /** Padding between bars */\r\n barPadding?: number;\r\n /** Maximum thickness of bars */\r\n maxBarThickness?: number;\r\n\r\n // Values and Ticks\r\n /** Maximum value for the chart */\r\n maxValue?: number;\r\n /** Truncate labels by specified length */\r\n truncateBy?: number;\r\n /** Reference values for comparison */\r\n refValues?: ReferenceDataType[];\r\n\r\n // Graph Parameters\r\n /** Number of bins for the histogram */\r\n numberOfBins?: number;\r\n /** Orientation of the bar graph. Only applicable if graphType is barGraph. */\r\n barGraphLayout?: 'vertical' | 'horizontal';\r\n /** Stroke width of the arcs and circle of the donut. Only applicable if graphType is donutChart. */\r\n donutStrokeWidth?: number;\r\n /** Sorting order for data. This is overwritten by labelOrder prop */\r\n sortData?: 'asc' | 'desc';\r\n /** Toggle visibility of labels */\r\n showLabels?: boolean;\r\n /** Toggle visibility of values */\r\n showValues?: boolean;\r\n /** Toggle visibility of axis ticks */\r\n showTicks?: boolean;\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\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 Histogram(props: Props) {\r\n const {\r\n data,\r\n graphTitle,\r\n sources,\r\n graphDescription,\r\n barPadding,\r\n showValues,\r\n showTicks,\r\n leftMargin,\r\n rightMargin,\r\n height,\r\n width,\r\n footNote,\r\n colors,\r\n padding,\r\n backgroundColor,\r\n topMargin,\r\n bottomMargin,\r\n showLabels,\r\n relativeHeight,\r\n tooltip,\r\n onSeriesMouseOver,\r\n refValues,\r\n graphID,\r\n maxValue,\r\n onSeriesMouseClick,\r\n graphDownload,\r\n dataDownload,\r\n numberOfBins,\r\n truncateBy,\r\n graphType,\r\n barGraphLayout,\r\n donutStrokeWidth,\r\n sortData,\r\n language,\r\n minHeight,\r\n theme = 'light',\r\n maxBarThickness,\r\n ariaLabel,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n precision,\r\n } = props;\r\n\r\n const [dataFormatted, setDataFormatted] = useState<TreeMapDataType[]>([]);\r\n useEffect(() => {\r\n const bins = bin()\r\n .thresholds(numberOfBins || 10)\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n .value((d: any) => d.value)(data as any);\r\n const dataUpdates = bins.map(d => ({\r\n label: `${d.x0}-${d.x1}`,\r\n size: d.length,\r\n data: {\r\n options: `${d.x0}-${d.x1}`,\r\n frequency: d.length,\r\n },\r\n }));\r\n setDataFormatted(dataUpdates);\r\n }, [data, numberOfBins]);\r\n if (dataFormatted.length === 0)\r\n return (\r\n <div style={{ width: `${width}px`, height: `${height}px`, margin: 'auto' }}>\r\n <div className='flex m-auto items-center justify-center p-0 leading-none text-base h-40'>\r\n <Spinner />\r\n </div>\r\n </div>\r\n );\r\n if (graphType === 'circlePacking')\r\n return (\r\n <CirclePackingGraph\r\n colors={colors || Colors.graphMainColor}\r\n graphTitle={graphTitle}\r\n graphDescription={graphDescription}\r\n footNote={footNote}\r\n width={width}\r\n height={height}\r\n sources={sources}\r\n leftMargin={leftMargin}\r\n rightMargin={rightMargin}\r\n backgroundColor={backgroundColor}\r\n padding={padding}\r\n topMargin={topMargin}\r\n bottomMargin={bottomMargin}\r\n relativeHeight={relativeHeight}\r\n showLabels={showLabels}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n showColorScale={false}\r\n showValues={showValues}\r\n graphID={graphID}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n graphDownload={graphDownload}\r\n dataDownload={dataDownload}\r\n data={dataFormatted}\r\n language={language}\r\n minHeight={minHeight}\r\n theme={theme}\r\n ariaLabel={ariaLabel}\r\n detailsOnClick={detailsOnClick}\r\n styles={styles}\r\n classNames={classNames}\r\n precision={precision}\r\n />\r\n );\r\n if (graphType === 'treeMap')\r\n return (\r\n <TreeMapGraph\r\n colors={colors || Colors.graphMainColor}\r\n graphTitle={graphTitle}\r\n graphDescription={graphDescription}\r\n footNote={footNote}\r\n width={width}\r\n height={height}\r\n sources={sources}\r\n leftMargin={leftMargin}\r\n rightMargin={rightMargin}\r\n backgroundColor={backgroundColor}\r\n padding={padding}\r\n topMargin={topMargin}\r\n bottomMargin={bottomMargin}\r\n relativeHeight={relativeHeight}\r\n showLabels={showLabels}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n showColorScale={false}\r\n showValues={showValues}\r\n graphID={graphID}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n graphDownload={graphDownload}\r\n dataDownload={dataDownload}\r\n data={dataFormatted}\r\n language={language}\r\n minHeight={minHeight}\r\n theme={theme}\r\n ariaLabel={ariaLabel}\r\n detailsOnClick={detailsOnClick}\r\n styles={styles}\r\n classNames={classNames}\r\n precision={precision}\r\n />\r\n );\r\n if (graphType === 'donutChart')\r\n return (\r\n <DonutChart\r\n colors={(colors as string[] | undefined) || Colors[theme].categoricalColors.colors}\r\n graphTitle={graphTitle}\r\n graphDescription={graphDescription}\r\n footNote={footNote}\r\n radius={width && height ? (width < height ? width : height) : width || height || undefined}\r\n sources={sources}\r\n backgroundColor={backgroundColor}\r\n padding={padding}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n graphID={graphID}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n graphDownload={graphDownload}\r\n dataDownload={dataDownload}\r\n data={dataFormatted as DonutChartDataType[]}\r\n strokeWidth={donutStrokeWidth}\r\n showColorScale\r\n sortData={sortData}\r\n language={language}\r\n theme={theme}\r\n ariaLabel={ariaLabel}\r\n detailsOnClick={detailsOnClick}\r\n styles={styles}\r\n classNames={classNames}\r\n precision={precision}\r\n />\r\n );\r\n return (\r\n <SimpleBarGraph\r\n colors={colors || Colors.graphMainColor}\r\n graphTitle={graphTitle}\r\n graphDescription={graphDescription}\r\n footNote={footNote}\r\n width={width}\r\n height={height}\r\n sources={sources}\r\n leftMargin={leftMargin}\r\n rightMargin={rightMargin}\r\n backgroundColor={backgroundColor}\r\n padding={padding}\r\n topMargin={topMargin}\r\n bottomMargin={bottomMargin}\r\n relativeHeight={relativeHeight}\r\n showLabels={showLabels}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n showColorScale={false}\r\n showValues={showValues}\r\n graphID={graphID}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n graphDownload={graphDownload}\r\n dataDownload={dataDownload}\r\n data={dataFormatted}\r\n barPadding={barPadding}\r\n refValues={refValues}\r\n truncateBy={truncateBy}\r\n maxValue={maxValue}\r\n showTicks={showTicks}\r\n sortData={sortData}\r\n language={language}\r\n minHeight={minHeight}\r\n theme={theme}\r\n maxBarThickness={maxBarThickness}\r\n ariaLabel={ariaLabel}\r\n orientation={barGraphLayout}\r\n detailsOnClick={detailsOnClick}\r\n styles={styles}\r\n classNames={classNames}\r\n precision={precision}\r\n />\r\n );\r\n}\r\n"],"names":["count","values","valueof","value","identity","x","array","slice","constant","nice","start","stop","prestep","step","tickIncrement","thresholdSturges","bin","domain","extent","threshold","sturges","histogram","data","i","n","xz","x0","x1","tz","max","tn","ticks","m","a","b","bins","j","bisect","_","Histogram","props","graphTitle","sources","graphDescription","barPadding","showValues","showTicks","leftMargin","rightMargin","height","width","footNote","colors","padding","backgroundColor","topMargin","bottomMargin","showLabels","relativeHeight","tooltip","onSeriesMouseOver","refValues","graphID","maxValue","onSeriesMouseClick","graphDownload","dataDownload","numberOfBins","truncateBy","graphType","barGraphLayout","donutStrokeWidth","sortData","language","minHeight","theme","maxBarThickness","ariaLabel","detailsOnClick","styles","classNames","precision","dataFormatted","setDataFormatted","useState","useEffect","dataUpdates","d","jsx","Spinner","CirclePackingGraph","Colors","TreeMapGraph","DonutChart","SimpleBarGraph"],"mappings":"kZAAe,SAASA,GAAMC,EAAQC,EAAS,CAC7C,IAAIF,EAAQ,EAEV,QAASG,KAASF,EACZE,GAAS,OAASA,EAAQ,CAACA,IAAUA,GACvC,EAAEH,EAWR,OAAOA,CACT,CCjBe,SAASI,GAASC,EAAG,CAClC,OAAOA,CACT,CCFA,IAAIC,GAAQ,MAAM,UAEPC,GAAQD,GAAM,MCFV,SAASE,EAASH,EAAG,CAClC,MAAO,IAAMA,CACf,CCAe,SAASI,GAAKC,EAAOC,EAAMX,EAAO,CAC/C,IAAIY,EACJ,OAAa,CACX,MAAMC,EAAOC,EAAAA,cAAcJ,EAAOC,EAAMX,CAAK,EAC7C,GAA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AAAA,IAACM,GAAAA,eAAA,CACC,OAAQ1C,GAAUuC,EAAAA,OAAO,eACzB,WAAAlD,EACA,iBAAAE,EACA,SAAAQ,EACA,MAAAD,EACA,OAAAD,EACA,QAAAP,EACA,WAAAK,EACA,YAAAC,EACA,gBAAAM,EACA,QAAAD,EACA,UAAAE,EACA,aAAAC,EACA,eAAAE,EACA,WAAAD,EACA,QAAAE,EACA,kBAAAC,EACA,eAAgB,GAChB,WAAAf,EACA,QAAAiB,EACA,mBAAAE,EACA,cAAAC,EACA,aAAAC,EACA,KAAMgB,EACN,WAAAtC,EACA,UAAAiB,EACA,WAAAO,EACA,SAAAL,EACA,UAAAjB,EACA,SAAA0B,EACA,SAAAC,EACA,UAAAC,EACA,MAAAC,EACA,gBAAAC,EACA,UAAAC,EACA,YAAaP,EACb,eAAAQ,EACA,OAAAC,EACA,WAAAC,EACA,UAAAC,CAAA,CAAA,CAGN","x_google_ignoreList":[0,1,2,3,4,5,6]}
1
+ {"version":3,"file":"Histogram.js","sources":["../node_modules/d3-array/src/count.js","../node_modules/d3-array/src/identity.js","../node_modules/d3-array/src/array.js","../node_modules/d3-array/src/constant.js","../node_modules/d3-array/src/nice.js","../node_modules/d3-array/src/threshold/sturges.js","../node_modules/d3-array/src/bin.js","../src/Components/Graphs/Histogram/index.tsx"],"sourcesContent":["export default function count(values, valueof) {\n let count = 0;\n if (valueof === undefined) {\n for (let value of values) {\n if (value != null && (value = +value) >= value) {\n ++count;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null && (value = +value) >= value) {\n ++count;\n }\n }\n }\n return count;\n}\n","export default function identity(x) {\n return x;\n}\n","var array = Array.prototype;\n\nexport var slice = array.slice;\nexport var map = array.map;\n","export default function constant(x) {\n return () => x;\n}\n","import {tickIncrement} from \"./ticks.js\";\n\nexport default function nice(start, stop, count) {\n let prestep;\n while (true) {\n const step = tickIncrement(start, stop, count);\n if (step === prestep || step === 0 || !isFinite(step)) {\n return [start, stop];\n } else if (step > 0) {\n start = Math.floor(start / step) * step;\n stop = Math.ceil(stop / step) * step;\n } else if (step < 0) {\n start = Math.ceil(start * step) / step;\n stop = Math.floor(stop * step) / step;\n }\n prestep = step;\n }\n}\n","import count from \"../count.js\";\n\nexport default function thresholdSturges(values) {\n return Math.max(1, Math.ceil(Math.log(count(values)) / Math.LN2) + 1);\n}\n","import {slice} from \"./array.js\";\nimport bisect from \"./bisect.js\";\nimport constant from \"./constant.js\";\nimport extent from \"./extent.js\";\nimport identity from \"./identity.js\";\nimport nice from \"./nice.js\";\nimport ticks, {tickIncrement} from \"./ticks.js\";\nimport sturges from \"./threshold/sturges.js\";\n\nexport default function bin() {\n var value = identity,\n domain = extent,\n threshold = sturges;\n\n function histogram(data) {\n if (!Array.isArray(data)) data = Array.from(data);\n\n var i,\n n = data.length,\n x,\n step,\n values = new Array(n);\n\n for (i = 0; i < n; ++i) {\n values[i] = value(data[i], i, data);\n }\n\n var xz = domain(values),\n x0 = xz[0],\n x1 = xz[1],\n tz = threshold(values, x0, x1);\n\n // Convert number of thresholds into uniform thresholds, and nice the\n // default domain accordingly.\n if (!Array.isArray(tz)) {\n const max = x1, tn = +tz;\n if (domain === extent) [x0, x1] = nice(x0, x1, tn);\n tz = ticks(x0, x1, tn);\n\n // If the domain is aligned with the first tick (which it will by\n // default), then we can use quantization rather than bisection to bin\n // values, which is substantially faster.\n if (tz[0] <= x0) step = tickIncrement(x0, x1, tn);\n\n // If the last threshold is coincident with the domain’s upper bound, the\n // last bin will be zero-width. If the default domain is used, and this\n // last threshold is coincident with the maximum input value, we can\n // extend the niced upper bound by one tick to ensure uniform bin widths;\n // otherwise, we simply remove the last threshold. Note that we don’t\n // coerce values or the domain to numbers, and thus must be careful to\n // compare order (>=) rather than strict equality (===)!\n if (tz[tz.length - 1] >= x1) {\n if (max >= x1 && domain === extent) {\n const step = tickIncrement(x0, x1, tn);\n if (isFinite(step)) {\n if (step > 0) {\n x1 = (Math.floor(x1 / step) + 1) * step;\n } else if (step < 0) {\n x1 = (Math.ceil(x1 * -step) + 1) / -step;\n }\n }\n } else {\n tz.pop();\n }\n }\n }\n\n // Remove any thresholds outside the domain.\n // Be careful not to mutate an array owned by the user!\n var m = tz.length, a = 0, b = m;\n while (tz[a] <= x0) ++a;\n while (tz[b - 1] > x1) --b;\n if (a || b < m) tz = tz.slice(a, b), m = b - a;\n\n var bins = new Array(m + 1),\n bin;\n\n // Initialize bins.\n for (i = 0; i <= m; ++i) {\n bin = bins[i] = [];\n bin.x0 = i > 0 ? tz[i - 1] : x0;\n bin.x1 = i < m ? tz[i] : x1;\n }\n\n // Assign data to bins by value, ignoring any outside the domain.\n if (isFinite(step)) {\n if (step > 0) {\n for (i = 0; i < n; ++i) {\n if ((x = values[i]) != null && x0 <= x && x <= x1) {\n bins[Math.min(m, Math.floor((x - x0) / step))].push(data[i]);\n }\n }\n } else if (step < 0) {\n for (i = 0; i < n; ++i) {\n if ((x = values[i]) != null && x0 <= x && x <= x1) {\n const j = Math.floor((x0 - x) * step);\n bins[Math.min(m, j + (tz[j] <= x))].push(data[i]); // handle off-by-one due to rounding\n }\n }\n }\n } else {\n for (i = 0; i < n; ++i) {\n if ((x = values[i]) != null && x0 <= x && x <= x1) {\n bins[bisect(tz, x, 0, m)].push(data[i]);\n }\n }\n }\n\n return bins;\n }\n\n histogram.value = function(_) {\n return arguments.length ? (value = typeof _ === \"function\" ? _ : constant(_), histogram) : value;\n };\n\n histogram.domain = function(_) {\n return arguments.length ? (domain = typeof _ === \"function\" ? _ : constant([_[0], _[1]]), histogram) : domain;\n };\n\n histogram.thresholds = function(_) {\n return arguments.length ? (threshold = typeof _ === \"function\" ? _ : constant(Array.isArray(_) ? slice.call(_) : _), histogram) : threshold;\n };\n\n return histogram;\n}\n","import { useState, useEffect } from 'react';\r\nimport { bin } from 'd3-array';\r\nimport { Spinner } from '@undp/design-system-react/Spinner';\r\n\r\nimport { CirclePackingGraph } from '../CirclePackingGraph';\r\nimport { TreeMapGraph } from '../TreeMapGraph';\r\nimport { DonutChart } from '../DonutChart';\r\nimport { SimpleBarGraph } from '../BarGraph';\r\n\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport {\r\n TreeMapDataType,\r\n ReferenceDataType,\r\n HistogramDataType,\r\n DonutChartDataType,\r\n SourcesDataType,\r\n Languages,\r\n StyleObject,\r\n ClassNameObject,\r\n} from '@/Types';\r\n\r\ninterface Props {\r\n // Data\r\n /** Array of data objects */\r\n data: HistogramDataType[];\r\n\r\n /** Type of the graph for histogram */\r\n graphType?: 'circlePacking' | 'treeMap' | 'barGraph' | 'donutChart';\r\n\r\n // Titles, Labels, and Sources\r\n /** Title of the graph */\r\n graphTitle?: string | React.ReactNode;\r\n /** Description of the graph */\r\n graphDescription?: string | React.ReactNode;\r\n /** Footnote for the graph */\r\n footNote?: string | React.ReactNode;\r\n /** Source data for the graph */\r\n sources?: SourcesDataType[];\r\n /** Accessibility label */\r\n ariaLabel?: string;\r\n\r\n // Colors and Styling\r\n /** Colors for visualization */\r\n colors?: string[] | 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 /** Left margin of the graph */\r\n leftMargin?: number;\r\n /** Right margin of the graph */\r\n rightMargin?: number;\r\n /** Top margin of the graph */\r\n topMargin?: number;\r\n /** Bottom margin of the graph */\r\n bottomMargin?: number;\r\n /** Padding between bars */\r\n barPadding?: number;\r\n /** Maximum thickness of bars */\r\n maxBarThickness?: number;\r\n\r\n // Values and Ticks\r\n /** Maximum value for the chart */\r\n maxValue?: number;\r\n /** Truncate labels by specified length */\r\n truncateBy?: number;\r\n /** Reference values for comparison */\r\n refValues?: ReferenceDataType[];\r\n\r\n // Graph Parameters\r\n /** Number of bins for the histogram */\r\n numberOfBins?: number;\r\n /** Orientation of the bar graph. Only applicable if graphType is barGraph. */\r\n barGraphLayout?: 'vertical' | 'horizontal';\r\n /** Stroke width of the arcs and circle of the donut. Only applicable if graphType is donutChart. */\r\n donutStrokeWidth?: number;\r\n /** Sorting order for data. This is overwritten by labelOrder prop */\r\n sortData?: 'asc' | 'desc';\r\n /** Toggle visibility of labels */\r\n showLabels?: boolean;\r\n /** Toggle visibility of values */\r\n showValues?: boolean;\r\n /** Toggle visibility of axis ticks */\r\n showTicks?: boolean;\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\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 Histogram(props: Props) {\r\n const {\r\n data,\r\n graphTitle,\r\n sources,\r\n graphDescription,\r\n barPadding,\r\n showValues,\r\n showTicks,\r\n leftMargin,\r\n rightMargin,\r\n height,\r\n width,\r\n footNote,\r\n colors,\r\n padding,\r\n backgroundColor,\r\n topMargin,\r\n bottomMargin,\r\n showLabels,\r\n relativeHeight,\r\n tooltip,\r\n onSeriesMouseOver,\r\n refValues,\r\n graphID,\r\n maxValue,\r\n onSeriesMouseClick,\r\n graphDownload,\r\n dataDownload,\r\n numberOfBins,\r\n truncateBy,\r\n graphType,\r\n barGraphLayout,\r\n donutStrokeWidth,\r\n sortData,\r\n language,\r\n minHeight,\r\n theme = 'light',\r\n maxBarThickness,\r\n ariaLabel,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n precision,\r\n } = props;\r\n\r\n const [dataFormatted, setDataFormatted] = useState<TreeMapDataType[]>([]);\r\n useEffect(() => {\r\n const bins = bin()\r\n .thresholds(numberOfBins || 10)\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n .value((d: any) => d.value)(data as any);\r\n const dataUpdates = bins.map(d => ({\r\n label: `${d.x0}-${d.x1}`,\r\n size: d.length,\r\n data: {\r\n options: `${d.x0}-${d.x1}`,\r\n frequency: d.length,\r\n },\r\n }));\r\n setDataFormatted(dataUpdates);\r\n }, [data, numberOfBins]);\r\n if (dataFormatted.length === 0)\r\n return (\r\n <div style={{ width: `${width}px`, height: `${height}px`, margin: 'auto' }}>\r\n <div className='flex m-auto items-center justify-center p-0 leading-none text-base h-40'>\r\n <Spinner />\r\n </div>\r\n </div>\r\n );\r\n if (graphType === 'circlePacking')\r\n return (\r\n <CirclePackingGraph\r\n colors={colors || Colors.graphMainColor}\r\n graphTitle={graphTitle}\r\n graphDescription={graphDescription}\r\n footNote={footNote}\r\n width={width}\r\n height={height}\r\n sources={sources}\r\n leftMargin={leftMargin}\r\n rightMargin={rightMargin}\r\n backgroundColor={backgroundColor}\r\n padding={padding}\r\n topMargin={topMargin}\r\n bottomMargin={bottomMargin}\r\n relativeHeight={relativeHeight}\r\n showLabels={showLabels}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n showColorScale={false}\r\n showValues={showValues}\r\n graphID={graphID}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n graphDownload={graphDownload}\r\n dataDownload={dataDownload}\r\n data={dataFormatted}\r\n language={language}\r\n minHeight={minHeight}\r\n theme={theme}\r\n ariaLabel={ariaLabel}\r\n detailsOnClick={detailsOnClick}\r\n styles={styles}\r\n classNames={classNames}\r\n precision={precision}\r\n />\r\n );\r\n if (graphType === 'treeMap')\r\n return (\r\n <TreeMapGraph\r\n colors={colors || Colors.graphMainColor}\r\n graphTitle={graphTitle}\r\n graphDescription={graphDescription}\r\n footNote={footNote}\r\n width={width}\r\n height={height}\r\n sources={sources}\r\n leftMargin={leftMargin}\r\n rightMargin={rightMargin}\r\n backgroundColor={backgroundColor}\r\n padding={padding}\r\n topMargin={topMargin}\r\n bottomMargin={bottomMargin}\r\n relativeHeight={relativeHeight}\r\n showLabels={showLabels}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n showColorScale={false}\r\n showValues={showValues}\r\n graphID={graphID}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n graphDownload={graphDownload}\r\n dataDownload={dataDownload}\r\n data={dataFormatted}\r\n language={language}\r\n minHeight={minHeight}\r\n theme={theme}\r\n ariaLabel={ariaLabel}\r\n detailsOnClick={detailsOnClick}\r\n styles={styles}\r\n classNames={classNames}\r\n precision={precision}\r\n />\r\n );\r\n if (graphType === 'donutChart')\r\n return (\r\n <DonutChart\r\n colors={(colors as string[] | undefined) || Colors[theme].categoricalColors.colors}\r\n graphTitle={graphTitle}\r\n graphDescription={graphDescription}\r\n footNote={footNote}\r\n radius={width && height ? (width < height ? width : height) : width || height || undefined}\r\n sources={sources}\r\n backgroundColor={backgroundColor}\r\n padding={padding}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n graphID={graphID}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n graphDownload={graphDownload}\r\n dataDownload={dataDownload}\r\n data={dataFormatted as DonutChartDataType[]}\r\n strokeWidth={donutStrokeWidth}\r\n showColorScale\r\n sortData={sortData}\r\n language={language}\r\n theme={theme}\r\n ariaLabel={ariaLabel}\r\n detailsOnClick={detailsOnClick}\r\n styles={styles}\r\n classNames={classNames}\r\n precision={precision}\r\n />\r\n );\r\n return (\r\n <SimpleBarGraph\r\n colors={colors || Colors.graphMainColor}\r\n graphTitle={graphTitle}\r\n graphDescription={graphDescription}\r\n footNote={footNote}\r\n width={width}\r\n height={height}\r\n sources={sources}\r\n leftMargin={leftMargin}\r\n rightMargin={rightMargin}\r\n backgroundColor={backgroundColor}\r\n padding={padding}\r\n topMargin={topMargin}\r\n bottomMargin={bottomMargin}\r\n relativeHeight={relativeHeight}\r\n showLabels={showLabels}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n showColorScale={false}\r\n showValues={showValues}\r\n graphID={graphID}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n graphDownload={graphDownload}\r\n dataDownload={dataDownload}\r\n data={dataFormatted}\r\n barPadding={barPadding}\r\n refValues={refValues}\r\n truncateBy={truncateBy}\r\n maxValue={maxValue}\r\n showTicks={showTicks}\r\n sortData={sortData}\r\n language={language}\r\n minHeight={minHeight}\r\n theme={theme}\r\n maxBarThickness={maxBarThickness}\r\n ariaLabel={ariaLabel}\r\n orientation={barGraphLayout}\r\n detailsOnClick={detailsOnClick}\r\n styles={styles}\r\n classNames={classNames}\r\n precision={precision}\r\n />\r\n );\r\n}\r\n"],"names":["count","values","valueof","value","identity","x","array","slice","constant","nice","start","stop","prestep","step","tickIncrement","thresholdSturges","bin","domain","extent","threshold","sturges","histogram","data","i","n","xz","x0","x1","tz","max","tn","ticks","m","a","b","bins","j","bisect","_","Histogram","props","graphTitle","sources","graphDescription","barPadding","showValues","showTicks","leftMargin","rightMargin","height","width","footNote","colors","padding","backgroundColor","topMargin","bottomMargin","showLabels","relativeHeight","tooltip","onSeriesMouseOver","refValues","graphID","maxValue","onSeriesMouseClick","graphDownload","dataDownload","numberOfBins","truncateBy","graphType","barGraphLayout","donutStrokeWidth","sortData","language","minHeight","theme","maxBarThickness","ariaLabel","detailsOnClick","styles","classNames","precision","dataFormatted","setDataFormatted","useState","useEffect","dataUpdates","d","jsx","Spinner","CirclePackingGraph","Colors","TreeMapGraph","DonutChart","SimpleBarGraph"],"mappings":";;;;;;;;;;AAAe,SAASA,GAAMC,GAAQC,GAAS;AAC7C,MAAIF,IAAQ;AAEV,WAASG,KAASF;AAChB,IAAIE,KAAS,SAASA,IAAQ,CAACA,MAAUA,KACvC,EAAEH;AAWR,SAAOA;AACT;ACjBe,SAASI,GAASC,GAAG;AAClC,SAAOA;AACT;ACFA,IAAIC,KAAQ,MAAM,WAEPC,KAAQD,GAAM;ACFV,SAASE,EAASH,GAAG;AAClC,SAAO,MAAMA;AACf;ACAe,SAASI,GAAKC,GAAOC,GAAMX,GAAO;AAC/C,MAAIY;AACJ,aAAa;AACX,UAAMC,IAAOC,EAAcJ,GAAOC,GAAMX,CAAK;AAC7C,QAAIa,MAASD,KAAWC,MAAS,KAAK,CAAC,SAASA,CAAI;AAClD,aAAO,CAACH,GAAOC,CAAI;AACd,IAAIE,IAAO,KAChBH,IAAQ,KAAK,MAAMA,IAAQG,CAAI,IAAIA,GACnCF,IAAO,KAAK,KAAKA,IAAOE,CAAI,IAAIA,KACvBA,IAAO,MAChBH,IAAQ,KAAK,KAAKA,IAAQG,CAAI,IAAIA,GAClCF,IAAO,KAAK,MAAMA,IAAOE,CAAI,IAAIA,IAEnCD,IAAUC;AAAA,EACZ;AACF;ACfe,SAASE,GAAiBd,GAAQ;AAC/C,SAAO,KAAK,IAAI,GAAG,KAAK,KAAK,KAAK,IAAID,GAAMC,CAAM,CAAC,IAAI,KAAK,GAAG,IA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,MACA,aAAaP;AAAA,MACb,gBAAAQ;AAAA,MACA,QAAAC;AAAA,MACA,YAAAC;AAAA,MACA,WAAAC;AAAA,IAAA;AAAA,EAAA;AAGN;","x_google_ignoreList":[0,1,2,3,4,5,6]}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-CHPV5EwG-DDoeWRVt.cjs"),n=require("./index-BW_-wD2k.cjs"),a=require("./imageDownload-CgDcm1Sj.cjs");function s(r){const{nodeID:e,filename:t="image",buttonContent:i,buttonType:l="tertiary",buttonSmall:d,className:m=""}=r;return o.jsxRuntimeExports.jsx(n.d,{variant:l,className:`undp-viz-download-button ${d?"p-2":"py-4 px-6"} ${m} border border-primary-gray-400 dark:border-primary-gray-550`,onClick:()=>{typeof e=="string"?document.getElementById(e)?a.imageDownload(document.getElementById(e),t):console.error("Cannot find the html element"):a.imageDownload(e,t)},"aria-label":"Click to download the graph as image",children:i||o.jsxRuntimeExports.jsx(n.ImageDown,{})})}exports.ImageDownloadButton=s;
2
+ //# sourceMappingURL=ImageDownloadButton.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ImageDownloadButton.cjs","sources":["../src/Components/Actions/ImageDownloadButton.tsx"],"sourcesContent":["import { JSX } from 'react';\r\nimport { Button } from '@undp/design-system-react/Button';\r\n\r\nimport { imageDownload } from '@/Utils/imageDownload';\r\nimport { ImageDown } from '@/Components/Icons';\r\n\r\ninterface Props {\r\n buttonContent?: string | JSX.Element;\r\n buttonType?:\r\n | 'primary'\r\n | 'primary-without-icon'\r\n | 'secondary'\r\n | 'secondary-without-icon'\r\n | 'tertiary';\r\n nodeID: string | HTMLElement;\r\n filename?: string;\r\n buttonSmall?: boolean;\r\n className?: string;\r\n}\r\n\r\nexport function ImageDownloadButton(props: Props) {\r\n const {\r\n nodeID,\r\n filename = 'image',\r\n buttonContent,\r\n buttonType = 'tertiary',\r\n buttonSmall,\r\n className = '',\r\n } = props;\r\n return (\r\n <Button\r\n variant={buttonType}\r\n className={`undp-viz-download-button ${\r\n buttonSmall ? 'p-2' : 'py-4 px-6'\r\n } ${className} border border-primary-gray-400 dark:border-primary-gray-550`}\r\n onClick={() => {\r\n if (typeof nodeID === 'string') {\r\n if (document.getElementById(nodeID)) {\r\n imageDownload(document.getElementById(nodeID) as HTMLElement, filename);\r\n } else {\r\n console.error('Cannot find the html element');\r\n }\r\n } else {\r\n imageDownload(nodeID as HTMLElement, filename);\r\n }\r\n }}\r\n aria-label='Click to download the graph as image'\r\n >\r\n {buttonContent || <ImageDown />}\r\n </Button>\r\n );\r\n}\r\n"],"names":["ImageDownloadButton","props","nodeID","filename","buttonContent","buttonType","buttonSmall","className","jsx","Button","imageDownload","ImageDown"],"mappings":"6MAoBO,SAASA,EAAoBC,EAAc,CAChD,KAAM,CACJ,OAAAC,EACA,SAAAC,EAAW,QACX,cAAAC,EACA,WAAAC,EAAa,WACb,YAAAC,EACA,UAAAC,EAAY,EAAA,EACVN,EACJ,OACEO,EAAAA,kBAAAA,IAACC,EAAAA,EAAA,CACC,QAASJ,EACT,UAAW,4BACTC,EAAc,MAAQ,WACxB,IAAIC,CAAS,+DACb,QAAS,IAAM,CACT,OAAOL,GAAW,SAChB,SAAS,eAAeA,CAAM,EAChCQ,EAAAA,cAAc,SAAS,eAAeR,CAAM,EAAkBC,CAAQ,EAEtE,QAAQ,MAAM,8BAA8B,EAG9CO,EAAAA,cAAcR,EAAuBC,CAAQ,CAEjD,EACA,aAAW,uCAEV,SAAAC,2BAAkBO,EAAAA,UAAA,CAAA,CAAU,CAAA,CAAA,CAGnC"}
@@ -1,2 +1,29 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-BHm2KTjD-D8FylaKc.cjs"),n=require("./index-CEc_9zWy.cjs"),r=require("./imageDownload.js");function s(a){const{nodeID:e,filename:t="image",buttonContent:i,buttonType:l="tertiary",buttonSmall:d,className:m=""}=a;return o.jsxRuntimeExports.jsx(n.ButtonExports.Button,{variant:l,className:`undp-viz-download-button ${d?"p-2":"py-4 px-6"} ${m} border border-primary-gray-400 dark:border-primary-gray-550`,onClick:()=>{typeof e=="string"?document.getElementById(e)?r.imageDownload(document.getElementById(e),t):console.error("Cannot find the html element"):r.imageDownload(e,t)},"aria-label":"Click to download the graph as image",children:i||o.jsxRuntimeExports.jsx(n.ImageDown,{})})}exports.ImageDownloadButton=s;
1
+ import { j as t } from "./index-CHPV5EwG-BPSP-7Jg.js";
2
+ import { d, I as s } from "./index-BmCqpO1B.js";
3
+ import { i as n } from "./imageDownload-Dcci2LEy.js";
4
+ function c(r) {
5
+ const {
6
+ nodeID: e,
7
+ filename: o = "image",
8
+ buttonContent: a,
9
+ buttonType: m = "tertiary",
10
+ buttonSmall: i,
11
+ className: l = ""
12
+ } = r;
13
+ return /* @__PURE__ */ t.jsx(
14
+ d,
15
+ {
16
+ variant: m,
17
+ className: `undp-viz-download-button ${i ? "p-2" : "py-4 px-6"} ${l} border border-primary-gray-400 dark:border-primary-gray-550`,
18
+ onClick: () => {
19
+ typeof e == "string" ? document.getElementById(e) ? n(document.getElementById(e), o) : console.error("Cannot find the html element") : n(e, o);
20
+ },
21
+ "aria-label": "Click to download the graph as image",
22
+ children: a || /* @__PURE__ */ t.jsx(s, {})
23
+ }
24
+ );
25
+ }
26
+ export {
27
+ c as ImageDownloadButton
28
+ };
2
29
  //# sourceMappingURL=ImageDownloadButton.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ImageDownloadButton.js","sources":["../src/Components/Actions/ImageDownloadButton.tsx"],"sourcesContent":["import { JSX } from 'react';\r\nimport { Button } from '@undp/design-system-react/Button';\r\n\r\nimport { imageDownload } from '@/Utils/imageDownload';\r\nimport { ImageDown } from '@/Components/Icons';\r\n\r\ninterface Props {\r\n buttonContent?: string | JSX.Element;\r\n buttonType?:\r\n | 'primary'\r\n | 'primary-without-icon'\r\n | 'secondary'\r\n | 'secondary-without-icon'\r\n | 'tertiary';\r\n nodeID: string | HTMLElement;\r\n filename?: string;\r\n buttonSmall?: boolean;\r\n className?: string;\r\n}\r\n\r\nexport function ImageDownloadButton(props: Props) {\r\n const {\r\n nodeID,\r\n filename = 'image',\r\n buttonContent,\r\n buttonType = 'tertiary',\r\n buttonSmall,\r\n className = '',\r\n } = props;\r\n return (\r\n <Button\r\n variant={buttonType}\r\n className={`undp-viz-download-button ${\r\n buttonSmall ? 'p-2' : 'py-4 px-6'\r\n } ${className} border border-primary-gray-400 dark:border-primary-gray-550`}\r\n onClick={() => {\r\n if (typeof nodeID === 'string') {\r\n if (document.getElementById(nodeID)) {\r\n imageDownload(document.getElementById(nodeID) as HTMLElement, filename);\r\n } else {\r\n console.error('Cannot find the html element');\r\n }\r\n } else {\r\n imageDownload(nodeID as HTMLElement, filename);\r\n }\r\n }}\r\n aria-label='Click to download the graph as image'\r\n >\r\n {buttonContent || <ImageDown />}\r\n </Button>\r\n );\r\n}\r\n"],"names":["ImageDownloadButton","props","nodeID","filename","buttonContent","buttonType","buttonSmall","className","jsx","Button","imageDownload","ImageDown"],"mappings":"mMAoBO,SAASA,EAAoBC,EAAc,CAChD,KAAM,CACJ,OAAAC,EACA,SAAAC,EAAW,QACX,cAAAC,EACA,WAAAC,EAAa,WACb,YAAAC,EACA,UAAAC,EAAY,EAAA,EACVN,EACJ,OACEO,EAAAA,kBAAAA,IAACC,EAAAA,cAAAA,OAAA,CACC,QAASJ,EACT,UAAW,4BACTC,EAAc,MAAQ,WACxB,IAAIC,CAAS,+DACb,QAAS,IAAM,CACT,OAAOL,GAAW,SAChB,SAAS,eAAeA,CAAM,EAChCQ,EAAAA,cAAc,SAAS,eAAeR,CAAM,EAAkBC,CAAQ,EAEtE,QAAQ,MAAM,8BAA8B,EAG9CO,EAAAA,cAAcR,EAAuBC,CAAQ,CAEjD,EACA,aAAW,uCAEV,SAAAC,2BAAkBO,EAAAA,UAAA,CAAA,CAAU,CAAA,CAAA,CAGnC"}
1
+ {"version":3,"file":"ImageDownloadButton.js","sources":["../src/Components/Actions/ImageDownloadButton.tsx"],"sourcesContent":["import { JSX } from 'react';\r\nimport { Button } from '@undp/design-system-react/Button';\r\n\r\nimport { imageDownload } from '@/Utils/imageDownload';\r\nimport { ImageDown } from '@/Components/Icons';\r\n\r\ninterface Props {\r\n buttonContent?: string | JSX.Element;\r\n buttonType?:\r\n | 'primary'\r\n | 'primary-without-icon'\r\n | 'secondary'\r\n | 'secondary-without-icon'\r\n | 'tertiary';\r\n nodeID: string | HTMLElement;\r\n filename?: string;\r\n buttonSmall?: boolean;\r\n className?: string;\r\n}\r\n\r\nexport function ImageDownloadButton(props: Props) {\r\n const {\r\n nodeID,\r\n filename = 'image',\r\n buttonContent,\r\n buttonType = 'tertiary',\r\n buttonSmall,\r\n className = '',\r\n } = props;\r\n return (\r\n <Button\r\n variant={buttonType}\r\n className={`undp-viz-download-button ${\r\n buttonSmall ? 'p-2' : 'py-4 px-6'\r\n } ${className} border border-primary-gray-400 dark:border-primary-gray-550`}\r\n onClick={() => {\r\n if (typeof nodeID === 'string') {\r\n if (document.getElementById(nodeID)) {\r\n imageDownload(document.getElementById(nodeID) as HTMLElement, filename);\r\n } else {\r\n console.error('Cannot find the html element');\r\n }\r\n } else {\r\n imageDownload(nodeID as HTMLElement, filename);\r\n }\r\n }}\r\n aria-label='Click to download the graph as image'\r\n >\r\n {buttonContent || <ImageDown />}\r\n </Button>\r\n );\r\n}\r\n"],"names":["ImageDownloadButton","props","nodeID","filename","buttonContent","buttonType","buttonSmall","className","jsx","Button","imageDownload","ImageDown"],"mappings":";;;AAoBO,SAASA,EAAoBC,GAAc;AAChD,QAAM;AAAA,IACJ,QAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,eAAAC;AAAA,IACA,YAAAC,IAAa;AAAA,IACb,aAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,EAAA,IACVN;AACJ,SACEO,gBAAAA,EAAAA;AAAAA,IAACC;AAAAA,IAAA;AAAA,MACC,SAASJ;AAAA,MACT,WAAW,4BACTC,IAAc,QAAQ,WACxB,IAAIC,CAAS;AAAA,MACb,SAAS,MAAM;AACb,QAAI,OAAOL,KAAW,WAChB,SAAS,eAAeA,CAAM,IAChCQ,EAAc,SAAS,eAAeR,CAAM,GAAkBC,CAAQ,IAEtE,QAAQ,MAAM,8BAA8B,IAG9CO,EAAcR,GAAuBC,CAAQ;AAAA,MAEjD;AAAA,MACA,cAAW;AAAA,MAEV,UAAAC,2BAAkBO,GAAA,CAAA,CAAU;AAAA,IAAA;AAAA,EAAA;AAGnC;"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-CHPV5EwG-DDoeWRVt.cjs"),p=require("react"),y=require("./parse-hMnG_lRV.cjs"),qt=require("./index-BzeLQvXk.cjs"),kt=require("./simple-statistics-xm8c0LQQ.cjs"),ot=require("./numberFormattingFunction-02t-wJta.cjs"),$t=require("./Tooltip-n8z5bfav.cjs"),v=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),bt=require("./customArea-BYNyxAkm.cjs"),Ft=require("./AxisTitle-CK9YeovX.cjs"),Tt=require("./Axis-DE7dSn1_.cjs"),Wt=require("./ReferenceLine-CuFMk0cI.cjs"),Ht=require("./RegressionLine-7_rKTHN_.cjs"),Pt=require("./YTicksAndGridLines-DBDuz6vb.cjs"),Ut=require("./index-CylX-pWB.cjs"),Yt=require("./use-in-view-BCmzDU2O.cjs"),Gt=require("./time-Byw_jYQ7.cjs"),Xt=require("./linear-BVckp9RD.cjs"),lt=require("./line-DHV4JwCR.cjs"),ct=require("./step-BZ3C8QFW.cjs"),Bt=require("./area-D3Qx7k7K.cjs"),zt=require("./select-Bnfk0lJx.cjs"),g=require("./proxy-PQd2AItT.cjs"),Jt=require("./init-DU0ybBc_.cjs"),Kt=require("./pointer-Dkq5NV1q.cjs"),Qt=require("./GraphFooter.cjs"),Zt=require("./GraphHeader.cjs"),xt=require("./Colors.cjs"),_t=require("./ColorLegend.cjs"),te=require("./EmptyState-d8_8SxeW.cjs");function ee(ut){const{data:A,width:M,height:$,lineColor:k,suffix:I,prefix:j,dateFormat:o,highlightAreaSettings:h,showValues:G,noOfXTicks:mt,rightMargin:ht,leftMargin:R,topMargin:C,bottomMargin:X,tooltip:B,onSeriesMouseOver:F,refValues:z,minValue:J,maxValue:K,animate:a,rtl:Q,strokeWidth:yt,showDots:D,annotations:pt,customHighlightAreaSettings:dt,regressionLine:T,showIntervalDots:gt,showIntervalValues:ft,intervalLineStrokeWidth:W,intervalLineColors:b,intervalAreaColor:jt,intervalAreaOpacity:wt,yAxisTitle:Z,noOfYTicks:vt,minDate:H,maxDate:P,curveType:L,styles:c,classNames:x,precision:N,customLayers:_}=ut,tt=p.useRef(null),l=Yt.useInView(tt,{once:a.once,amount:a.amount}),[u,Rt]=p.useState(!1);p.useEffect(()=>{if(l&&!u){const t=setTimeout(()=>{Rt(!0)},(a.duration+.5)*1e3);return()=>clearTimeout(t)}},[l,u,a.duration]);const S=L==="linear"?lt.curveLinear:L==="step"?ct.curveStep:L==="stepAfter"?ct.stepAfter:L==="stepBefore"?ct.stepBefore:ct.monotoneX,[V,et]=p.useState(void 0),[it,nt]=p.useState(void 0),[U,Y]=p.useState(void 0),f={top:C,bottom:X,left:Z?R+30:R,right:ht},E=p.useRef(null),n=qt.sortBy(A.filter(t=>!v.checkIfNullOrUndefined(t.y)).map(t=>({date:y.parse(`${t.date}`,o,new Date),y:t.y,yMin:v.checkIfNullOrUndefined(t.yMin)?t.y:t.yMin,yMax:v.checkIfNullOrUndefined(t.yMax)?t.y:t.yMax,data:t.data})),"date"),Et=h.map(t=>({...t,coordinates:[t.coordinates[0]===null?null:y.parse(`${t.coordinates[0]}`,o,new Date),t.coordinates[1]===null?null:y.parse(`${t.coordinates[1]}`,o,new Date)]})),Mt=dt.map(t=>({...t,coordinates:t.coordinates.map((d,O)=>O%2===0?y.parse(`${d}`,o,new Date):d)})),r=M-f.left-f.right,w=$-f.top-f.bottom,at=H?y.parse(`${H}`,o,new Date):n[0].date,st=P?y.parse(`${P}`,o,new Date):n[n.length-1].date,m=v.checkIfNullOrUndefined(J)?Math.min(...n.map(t=>Math.min(t.y,t.yMax,t.yMin)))?Math.min(...n.map(t=>Math.min(t.y,t.yMax,t.yMin)))>0?0:Math.min(...n.map(t=>Math.min(t.y,t.yMax,t.yMin))):0:J,q=Math.max(...n.map(t=>Math.max(t.y,t.yMax,t.yMin)))?Math.max(...n.map(t=>Math.max(t.y,t.yMax,t.yMin))):0,i=Gt.time().domain([at,st]).range([0,r]),s=Xt.linear().domain([m,v.checkIfNullOrUndefined(K)?q>0?q:0:K]).range([w,0]).nice(),Ot=lt.line().x(t=>i(t.date)).y(t=>s(t.y)).curve(S),At=lt.line().x(t=>i(t.date)).y(t=>s(t.yMin)).curve(S),It=lt.line().x(t=>i(t.date)).y(t=>s(t.yMax)).curve(S),Lt=Bt.area().x(t=>i(t.date)).y0(t=>s(t.yMin)).y1(t=>s(t.yMax)).curve(S),Nt=s.ticks(vt),Dt=i.ticks(mt);p.useEffect(()=>{const t=O=>{const rt=n[Jt.bisectCenter(n.map(Ct=>Ct.date),i.invert(Kt.pointer(O)[0]),1)];et(rt||n[n.length-1]),F?.(rt||n[n.length-1]),Y(O.clientY),nt(O.clientX)},d=()=>{et(void 0),nt(void 0),Y(void 0),F?.(void 0)};zt.select(E.current).on("mousemove",t).on("mouseout",d)},[i,n,F]);const St=kt.linearRegression(n.filter(t=>!v.checkIfNullOrUndefined(t.date)&&!v.checkIfNullOrUndefined(t.y)).map(t=>[i(t.date),s(t.y)])),Vt=kt.linearRegressionLine(St);return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(g.motion.svg,{width:`${M}px`,height:`${$}px`,viewBox:`0 0 ${M} ${$}`,direction:"ltr",ref:tt,children:e.jsxRuntimeExports.jsxs("g",{transform:`translate(${f.left},${f.top})`,children:[e.jsxRuntimeExports.jsx(Ut.HighlightArea,{areaSettings:Et,width:r,height:w,scale:i,animate:a,isInView:l}),e.jsxRuntimeExports.jsx(bt.CustomArea,{areaSettings:Mt,scaleX:i,scaleY:s,animate:a,isInView:l}),e.jsxRuntimeExports.jsxs("g",{children:[e.jsxRuntimeExports.jsx(Pt.YTicksAndGridLines,{values:Nt.filter(t=>t!==0),y:Nt.filter(t=>t!==0).map(t=>s(t)),x1:0-R,x2:r+f.right,styles:{gridLines:c?.yAxis?.gridLines,labels:c?.yAxis?.labels},classNames:{gridLines:x?.yAxis?.gridLines,labels:x?.yAxis?.labels},suffix:I,prefix:j,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:N}),e.jsxRuntimeExports.jsx(Tt.Axis,{y1:s(m<0?0:m),y2:s(m<0?0:m),x1:0-R,x2:r+f.right,label:ot.numberFormattingFunction(m<0?0:m,"NA",N,j,I),labelPos:{x:0-R,y:s(m<0?0:m),dx:0,dy:q<0?"1em":-5},classNames:{axis:x?.xAxis?.axis,label:x?.yAxis?.labels},styles:{axis:c?.xAxis?.axis,label:c?.yAxis?.labels}}),e.jsxRuntimeExports.jsx(Ft.AxisTitle,{x:0-R+15,y:w/2,style:c?.yAxis?.title,className:x?.yAxis?.title,text:Z,rotate90:!0})]}),e.jsxRuntimeExports.jsx("g",{children:Dt.map((t,d)=>e.jsxRuntimeExports.jsx("g",{children:e.jsxRuntimeExports.jsx("text",{y:w,x:i(t),style:{textAnchor:"middle"},className:"fill-primary-gray-700 dark:fill-primary-gray-300 xs:max-[360px]:hidden text-[9px] md:text-[10px] lg:text-xs",dy:15,children:y.format(t,o)})},d))}),_.filter(t=>t.position==="before").map(t=>t.layer),e.jsxRuntimeExports.jsx(g.motion.path,{style:{fill:jt},exit:{opacity:0,transition:{duration:a.duration}},variants:{initial:{opacity:0,d:Lt(n)||""},whileInView:{opacity:wt,d:Lt(n)||"",transition:{duration:a.duration}}},initial:"initial",animate:l?"whileInView":"initial"}),W?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(g.motion.path,{style:{stroke:b[0],fill:"none",strokeWidth:W},exit:{opacity:0,transition:{duration:a.duration}},variants:{initial:{pathLength:0,d:At(n)||"",opacity:1},whileInView:{pathLength:1,d:At(n)||"",opacity:1,transition:{duration:a.duration}}},initial:"initial",animate:l?"whileInView":"initial"}),e.jsxRuntimeExports.jsx(g.motion.path,{style:{stroke:b[1],fill:"none",strokeWidth:W},exit:{opacity:0,transition:{duration:a.duration}},variants:{initial:{pathLength:0,d:It(n)||"",opacity:1},whileInView:{pathLength:1,d:It(n)||"",opacity:1,transition:{duration:a.duration}}},initial:"initial",animate:l?"whileInView":"initial"})]}):null,e.jsxRuntimeExports.jsx(g.motion.path,{style:{stroke:k,fill:"none",strokeWidth:yt},exit:{opacity:0,transition:{duration:a.duration}},variants:{initial:{pathLength:0,d:Ot(n)||"",opacity:1},whileInView:{pathLength:1,d:Ot(n)||"",opacity:1,transition:{duration:a.duration}}},initial:"initial",animate:l?"whileInView":"initial"}),V?e.jsxRuntimeExports.jsx("line",{y1:0,y2:w,x1:i(V.date),x2:i(V.date),className:e.mo("undp-tick-line stroke-primary-gray-700 dark:stroke-primary-gray-100",x?.mouseOverLine),style:c?.mouseOverLine}):null,e.jsxRuntimeExports.jsx("g",{children:n.map((t,d)=>e.jsxRuntimeExports.jsx(g.motion.g,{children:v.checkIfNullOrUndefined(t.y)?null:e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[D?e.jsxRuntimeExports.jsx(g.motion.circle,{r:r/n.length<5?0:r/n.length<20?2:4,style:{fill:k},exit:{opacity:0,transition:{duration:a.duration}},variants:{initial:{opacity:0,cx:i(t.date),cy:s(t.y)},whileInView:{opacity:1,transition:{duration:u?a.duration:.5,delay:u?0:a.duration},cx:i(t.date),cy:s(t.y)}},initial:"initial",animate:l?"whileInView":"initial"}):null,gt?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(g.motion.circle,{r:r/n.length<5?0:r/n.length<20?2:4,style:{fill:b[0]},exit:{opacity:0,transition:{duration:a.duration}},variants:{initial:{opacity:0,cx:i(t.date),cy:s(t.yMin)},whileInView:{opacity:1,transition:{duration:u?a.duration:.5,delay:u?0:a.duration},cx:i(t.date),cy:s(t.yMin)}},initial:"initial",animate:l?"whileInView":"initial"}),e.jsxRuntimeExports.jsx(g.motion.circle,{r:r/n.length<5?0:r/n.length<20?2:4,style:{fill:b[1]},exit:{opacity:0,transition:{duration:a.duration}},variants:{initial:{opacity:0,cx:i(t.date),cy:s(t.yMax)},whileInView:{opacity:1,transition:{duration:u?a.duration:.5,delay:u?0:a.duration},cx:i(t.date),cy:s(t.yMax)}},initial:"initial",animate:l?"whileInView":"initial"})]}):null,G?e.jsxRuntimeExports.jsx(g.motion.text,{dy:-8,style:{fill:k,textAnchor:"middle",...c?.graphObjectValues||{}},className:e.mo("graph-value text-xs font-bold",x?.graphObjectValues),exit:{opacity:0,transition:{duration:a.duration}},variants:{initial:{opacity:0,x:i(t.date),y:s(t.y)},whileInView:{opacity:1,x:i(t.date),y:s(t.y),transition:{duration:u?a.duration:.5,delay:u?0:a.duration}}},initial:"initial",animate:l?"whileInView":"initial",children:ot.numberFormattingFunction(t.y,"NA",N,j,I)}):null,ft?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(g.motion.text,{dy:"1em",style:{fill:b[0],textAnchor:"middle",...c?.graphObjectValues||{}},className:e.mo("text-xs font-bold",x?.graphObjectValues),exit:{opacity:0,transition:{duration:a.duration}},variants:{initial:{opacity:0,x:i(t.date),y:s(t.yMin)},whileInView:{opacity:1,x:i(t.date),y:s(t.yMin),transition:{duration:u?a.duration:.5,delay:u?0:a.duration}}},initial:"initial",animate:l?"whileInView":"initial",children:ot.numberFormattingFunction(t.yMin,"NA",N,j,I)}),e.jsxRuntimeExports.jsx(g.motion.text,{dy:-8,style:{fill:b[1],textAnchor:"middle",...c?.graphObjectValues||{}},className:e.mo("text-xs font-bold",x?.graphObjectValues),exit:{opacity:0,transition:{duration:a.duration}},variants:{initial:{opacity:0,x:i(t.date),y:s(t.yMax)},whileInView:{opacity:1,x:i(t.date),y:s(t.yMax),transition:{duration:u?a.duration:.5,delay:u?0:a.duration}}},initial:"initial",animate:l?"whileInView":"initial",children:ot.numberFormattingFunction(t.yMax,"NA",N,j,I)})]}):null]})},d))}),z?e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:z.map((t,d)=>e.jsxRuntimeExports.jsx(Wt.RefLineY,{text:t.text,color:t.color,y:s(t.value),x1:0-R,x2:r+f.right,classNames:t.classNames,styles:t.styles,animate:a,isInView:l},d))}):null,e.jsxRuntimeExports.jsx("g",{children:pt.map((t,d)=>{const O=bt.getLineEndPoint({x:t.xCoordinate?i(y.parse(`${t.xCoordinate}`,o,new Date))+(t.xOffset||0):0+(t.xOffset||0),y:t.yCoordinate?s(t.yCoordinate)+(t.yOffset||0)-8:0+(t.yOffset||0)-8},{x:t.xCoordinate?i(y.parse(`${t.xCoordinate}`,o,new Date)):0,y:t.yCoordinate?s(t.yCoordinate):0},v.checkIfNullOrUndefined(t.connectorRadius)?3.5:t.connectorRadius),rt=t.showConnector?{y1:O.y,x1:O.x,y2:t.yCoordinate?s(t.yCoordinate)+(t.yOffset||0):0+(t.yOffset||0),x2:t.xCoordinate?i(y.parse(`${t.xCoordinate}`,o,new Date))+(t.xOffset||0):0+(t.xOffset||0),cy:t.yCoordinate?s(t.yCoordinate):0,cx:t.xCoordinate?i(y.parse(`${t.xCoordinate}`,o,new Date)):0,circleRadius:v.checkIfNullOrUndefined(t.connectorRadius)?3.5:t.connectorRadius,strokeWidth:t.showConnector===!0?2:Math.min(t.showConnector||0,1)}:void 0,Ct={y:t.yCoordinate?s(t.yCoordinate)+(t.yOffset||0)-8:0+(t.yOffset||0)-8,x:Q?0:t.xCoordinate?i(y.parse(`${t.xCoordinate}`,o,new Date))+(t.xOffset||0):0+(t.xOffset||0),width:Q?t.xCoordinate?i(y.parse(`${t.xCoordinate}`,o,new Date))+(t.xOffset||0):0+(t.xOffset||0):r-(t.xCoordinate?i(y.parse(`${t.xCoordinate}`,o,new Date))+(t.xOffset||0):0+(t.xOffset||0)),maxWidth:t.maxWidth,fontWeight:t.fontWeight,align:t.align};return e.jsxRuntimeExports.jsx(bt.Annotation,{color:t.color,connectorsSettings:rt,labelSettings:Ct,text:t.text,classNames:t.classNames,styles:t.styles,animate:a,isInView:l},d)})}),e.jsxRuntimeExports.jsx("g",{children:T?e.jsxRuntimeExports.jsx(Ht.RegressionLine,{x1:0,x2:r,y1:Vt(0),y2:Vt(r),graphHeight:w,graphWidth:r,className:x?.regLine,style:c?.regLine,color:typeof T=="string"?T:void 0,animate:a,isInView:l}):null}),_.filter(t=>t.position==="after").map(t=>t.layer),e.jsxRuntimeExports.jsx("rect",{ref:E,style:{fill:"none",pointerEvents:"all"},width:r,height:w})]})}),V&&B&&it&&U?e.jsxRuntimeExports.jsx($t.Tooltip,{data:V,body:B,xPos:it,yPos:U,backgroundStyle:c?.tooltip,className:x?.tooltip}):null]})}function ie(ut){const{data:A,graphTitle:M,suffix:$="",sources:k,prefix:I="",graphDescription:j,height:o,width:h,footNote:G,noOfXTicks:mt=10,dateFormat:ht="yyyy",showValues:R=!1,backgroundColor:C=!1,padding:X,lineColor:B,leftMargin:F=30,rightMargin:z=30,topMargin:J=20,bottomMargin:K=25,tooltip:a,refValues:Q=[],highlightAreaSettings:yt=[],relativeHeight:D,onSeriesMouseOver:pt,graphID:dt,minValue:T,maxValue:gt,regressionLine:ft=!1,showIntervalDots:W=!1,showIntervalValues:b=!1,intervalLineStrokeWidth:jt=0,intervalLineColors:wt=[xt.Colors.light.grays["gray-500"],xt.Colors.light.grays["gray-500"]],intervalAreaColor:Z=xt.Colors.primaryColors["blue-100"],intervalAreaOpacity:vt=.4,graphDownload:H=!1,dataDownload:P=!1,animate:L=!1,language:c="en",minHeight:x=0,strokeWidth:N=2,showDots:_=!0,annotations:tt=[],customHighlightAreaSettings:l=[],theme:u="light",ariaLabel:Rt,yAxisTitle:S,noOfYTicks:V=5,minDate:et,maxDate:it,colorLegendTitle:nt,colorLegendColors:U,colorLegendDomain:Y,curveType:f="curve",styles:E,classNames:n,precision:Et=2,customLayers:Mt=[]}=ut,[r,w]=p.useState(0),[at,st]=p.useState(0),m=p.useRef(null),q=p.useRef(null);return p.useEffect(()=>{const i=new ResizeObserver(s=>{w(h||s[0].target.clientWidth||620),st(o||s[0].target.clientHeight||480)});return m.current&&(st(m.current.clientHeight||480),w(m.current.clientWidth||620),h||i.observe(m.current)),()=>i.disconnect()},[h,o]),e.jsxRuntimeExports.jsx("div",{className:`${u||"light"} flex ${h?"w-fit grow-0":"w-full grow"}`,dir:c==="he"||c==="ar"?"rtl":void 0,children:e.jsxRuntimeExports.jsx("div",{className:e.mo(`${C?C===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${c||"en"}`,n?.graphContainer),style:{...E?.graphContainer||{},...C&&C!==!0?{backgroundColor:C}:{}},id:dt,ref:q,"aria-label":Rt||`${M?`The graph shows ${M}. `:""}This is a line chart that highlights the difference between two datasets over time.${j?` ${j}`:""}`,children:e.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:C?X||"1rem":X||0},children:e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[M||j||H||P?e.jsxRuntimeExports.jsx(Zt.GraphHeader,{styles:{title:E?.title,description:E?.description},classNames:{title:n?.title,description:n?.description},graphTitle:M,graphDescription:j,width:h,graphDownload:H?q.current:void 0,dataDownload:P?A.map(i=>i.data).filter(i=>i!==void 0).length>0?A.map(i=>i.data).filter(i=>i!==void 0):A.filter(i=>i!==void 0):null}):null,e.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:A.length===0?e.jsxRuntimeExports.jsx(te.EmptyState,{}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[U&&Y?e.jsxRuntimeExports.jsx(_t.ColorLegend,{width:h,colorLegendTitle:nt,colors:U,colorDomain:Y,showNAColor:!1}):null,e.jsxRuntimeExports.jsx("div",{className:"flex flex-col grow justify-center leading-0",ref:m,"aria-label":"Graph area",children:(h||r)&&(o||at)?e.jsxRuntimeExports.jsx(ee,{data:A,lineColor:B||xt.Colors.primaryColors["blue-600"],width:h||r,height:Math.max(x,o||(D?x?(h||r)*D>x?(h||r)*D:x:(h||r)*D:at)),suffix:$,prefix:I,dateFormat:ht,showValues:R,noOfXTicks:mt,leftMargin:F,rightMargin:z,topMargin:J,bottomMargin:K,tooltip:a,highlightAreaSettings:yt,onSeriesMouseOver:pt,refValues:Q,minValue:T,maxValue:gt,animate:L===!0?{duration:.5,once:!0,amount:.5}:L||{duration:0,once:!0,amount:0},rtl:c==="he"||c==="ar",strokeWidth:N,showDots:_,annotations:tt,customHighlightAreaSettings:l,regressionLine:ft,showIntervalDots:W,showIntervalValues:b,intervalLineStrokeWidth:jt,intervalLineColors:wt,intervalAreaColor:Z,intervalAreaOpacity:vt,yAxisTitle:S,noOfYTicks:V,minDate:et,maxDate:it,curveType:f,styles:E,classNames:n,precision:Et,customLayers:Mt}):null})]})}),k||G?e.jsxRuntimeExports.jsx(Qt.GraphFooter,{styles:{footnote:E?.footnote,source:E?.source},classNames:{footnote:n?.footnote,source:n?.source},sources:k,footNote:G,width:h}):null]})})})})}exports.LineChartWithConfidenceInterval=ie;
2
+ //# sourceMappingURL=LineChartWithConfidenceInterval.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LineChartWithConfidenceInterval.cjs","sources":["../src/Components/Graphs/LineCharts/LineChartWithConfidenceInterval/Graph.tsx","../src/Components/Graphs/LineCharts/LineChartWithConfidenceInterval/index.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from 'react';\r\nimport {\r\n line,\r\n curveMonotoneX,\r\n area,\r\n curveLinear,\r\n curveStep,\r\n curveStepAfter,\r\n curveStepBefore,\r\n} from 'd3-shape';\r\nimport { scaleLinear, scaleTime } from 'd3-scale';\r\nimport { format } from 'date-fns/format';\r\nimport { parse } from 'date-fns/parse';\r\nimport { bisectCenter } from 'd3-array';\r\nimport { pointer, select } from 'd3-selection';\r\nimport sortBy from 'lodash.sortby';\r\nimport { linearRegression, linearRegressionLine } from 'simple-statistics';\r\nimport { cn } from '@undp/design-system-react/cn';\r\nimport { motion, useInView } from 'motion/react';\r\n\r\nimport {\r\n AnimateDataType,\r\n AnnotationSettingsDataType,\r\n ClassNameObject,\r\n CurveTypes,\r\n CustomHighlightAreaSettingsDataType,\r\n CustomLayerDataType,\r\n HighlightAreaSettingsDataType,\r\n LineChartWithConfidenceIntervalDataType,\r\n ReferenceDataType,\r\n StyleObject,\r\n} from '@/Types';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { getLineEndPoint } from '@/Utils/getLineEndPoint';\r\nimport { AxisTitle } from '@/Components/Elements/Axes/AxisTitle';\r\nimport { Axis } from '@/Components/Elements/Axes/Axis';\r\nimport { RefLineY } from '@/Components/Elements/ReferenceLine';\r\nimport { RegressionLine } from '@/Components/Elements/RegressionLine';\r\nimport { Annotation } from '@/Components/Elements/Annotations';\r\nimport { YTicksAndGridLines } from '@/Components/Elements/Axes/YTicksAndGridLines';\r\nimport { CustomArea } from '@/Components/Elements/HighlightArea/customArea';\r\nimport { HighlightArea } from '@/Components/Elements/HighlightArea';\r\n\r\ninterface Props {\r\n data: LineChartWithConfidenceIntervalDataType[];\r\n lineColor: string;\r\n width: number;\r\n height: number;\r\n suffix: string;\r\n prefix: string;\r\n dateFormat: string;\r\n showValues?: boolean;\r\n noOfXTicks: number;\r\n rightMargin: number;\r\n leftMargin: number;\r\n topMargin: number;\r\n bottomMargin: number;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n refValues: ReferenceDataType[];\r\n highlightAreaSettings: HighlightAreaSettingsDataType[];\r\n maxValue?: number;\r\n minValue?: number;\r\n animate: AnimateDataType;\r\n rtl: boolean;\r\n strokeWidth: number;\r\n showDots: boolean;\r\n annotations: AnnotationSettingsDataType[];\r\n customHighlightAreaSettings: CustomHighlightAreaSettingsDataType[];\r\n regressionLine: boolean | string;\r\n showIntervalDots: boolean;\r\n showIntervalValues: boolean;\r\n intervalLineStrokeWidth: number;\r\n intervalLineColors: [string, string];\r\n intervalAreaColor: string;\r\n intervalAreaOpacity: number;\r\n yAxisTitle?: string;\r\n noOfYTicks: number;\r\n minDate?: string | number;\r\n maxDate?: string | number;\r\n curveType: CurveTypes;\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n precision: number;\r\n customLayers: CustomLayerDataType[];\r\n}\r\ninterface FormattedDataType {\r\n y: number;\r\n date: Date;\r\n yMin: number;\r\n yMax: number;\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n const {\r\n data,\r\n width,\r\n height,\r\n lineColor,\r\n suffix,\r\n prefix,\r\n dateFormat,\r\n highlightAreaSettings,\r\n showValues,\r\n noOfXTicks,\r\n rightMargin,\r\n leftMargin,\r\n topMargin,\r\n bottomMargin,\r\n tooltip,\r\n onSeriesMouseOver,\r\n refValues,\r\n minValue,\r\n maxValue,\r\n animate,\r\n rtl,\r\n strokeWidth,\r\n showDots,\r\n annotations,\r\n customHighlightAreaSettings,\r\n regressionLine,\r\n showIntervalDots,\r\n showIntervalValues,\r\n intervalLineStrokeWidth,\r\n intervalLineColors,\r\n intervalAreaColor,\r\n intervalAreaOpacity,\r\n yAxisTitle,\r\n noOfYTicks,\r\n minDate,\r\n maxDate,\r\n curveType,\r\n styles,\r\n classNames,\r\n precision,\r\n customLayers,\r\n } = props;\r\n const svgRef = useRef(null);\r\n const isInView = useInView(svgRef, {\r\n once: animate.once,\r\n amount: animate.amount,\r\n });\r\n const [hasAnimatedOnce, setHasAnimatedOnce] = useState(false);\r\n\r\n useEffect(() => {\r\n if (isInView && !hasAnimatedOnce) {\r\n const timeout = setTimeout(\r\n () => {\r\n setHasAnimatedOnce(true);\r\n },\r\n (animate.duration + 0.5) * 1000,\r\n );\r\n return () => clearTimeout(timeout);\r\n }\r\n }, [isInView, hasAnimatedOnce, animate.duration]);\r\n const curve =\r\n curveType === 'linear'\r\n ? curveLinear\r\n : curveType === 'step'\r\n ? curveStep\r\n : curveType === 'stepAfter'\r\n ? curveStepAfter\r\n : curveType === 'stepBefore'\r\n ? curveStepBefore\r\n : curveMonotoneX;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseOverData, setMouseOverData] = useState<any>(undefined);\r\n const [eventX, setEventX] = useState<number | undefined>(undefined);\r\n const [eventY, setEventY] = useState<number | undefined>(undefined);\r\n const margin = {\r\n top: topMargin,\r\n bottom: bottomMargin,\r\n left: yAxisTitle ? leftMargin + 30 : leftMargin,\r\n right: rightMargin,\r\n };\r\n const MouseoverRectRef = useRef(null);\r\n const dataFormatted: FormattedDataType[] = sortBy(\r\n data\r\n .filter(d => !checkIfNullOrUndefined(d.y))\r\n .map(d => ({\r\n date: parse(`${d.date}`, dateFormat, new Date()),\r\n y: d.y as number,\r\n yMin: checkIfNullOrUndefined(d.yMin) ? (d.y as number) : (d.yMin as number),\r\n yMax: checkIfNullOrUndefined(d.yMax) ? (d.y as number) : (d.yMax as number),\r\n data: d.data,\r\n })),\r\n 'date',\r\n );\r\n const highlightAreaSettingsFormatted = highlightAreaSettings.map(d => ({\r\n ...d,\r\n coordinates: [\r\n d.coordinates[0] === null ? null : parse(`${d.coordinates[0]}`, dateFormat, new Date()),\r\n d.coordinates[1] === null ? null : parse(`${d.coordinates[1]}`, dateFormat, new Date()),\r\n ],\r\n }));\r\n const customHighlightAreaSettingsFormatted = customHighlightAreaSettings.map(d => ({\r\n ...d,\r\n coordinates: d.coordinates.map((el, j) =>\r\n j % 2 === 0 ? parse(`${el}`, dateFormat, new Date()) : (el as number),\r\n ),\r\n }));\r\n const graphWidth = width - margin.left - margin.right;\r\n const graphHeight = height - margin.top - margin.bottom;\r\n const minYear = minDate ? parse(`${minDate}`, dateFormat, new Date()) : dataFormatted[0].date;\r\n const maxYear = maxDate\r\n ? parse(`${maxDate}`, dateFormat, new Date())\r\n : dataFormatted[dataFormatted.length - 1].date;\r\n const minParam: number = !checkIfNullOrUndefined(minValue)\r\n ? (minValue as number)\r\n : Math.min(...dataFormatted.map(d => Math.min(d.y, d.yMax, d.yMin)))\r\n ? Math.min(...dataFormatted.map(d => Math.min(d.y, d.yMax, d.yMin))) > 0\r\n ? 0\r\n : Math.min(...dataFormatted.map(d => Math.min(d.y, d.yMax, d.yMin)))\r\n : 0;\r\n const maxParam: number = Math.max(...dataFormatted.map(d => Math.max(d.y, d.yMax, d.yMin)))\r\n ? Math.max(...dataFormatted.map(d => Math.max(d.y, d.yMax, d.yMin)))\r\n : 0;\r\n const x = scaleTime().domain([minYear, maxYear]).range([0, graphWidth]);\r\n const y = scaleLinear()\r\n .domain([\r\n minParam,\r\n checkIfNullOrUndefined(maxValue) ? (maxParam > 0 ? maxParam : 0) : (maxValue as number),\r\n ])\r\n .range([graphHeight, 0])\r\n .nice();\r\n\r\n const lineShape = line<FormattedDataType>()\r\n .x(d => x(d.date))\r\n .y(d => y(d.y))\r\n .curve(curve);\r\n\r\n const lineShapeMin = line<FormattedDataType>()\r\n .x(d => x(d.date))\r\n .y(d => y(d.yMin))\r\n .curve(curve);\r\n\r\n const lineShapeMax = line<FormattedDataType>()\r\n .x(d => x(d.date))\r\n .y(d => y(d.yMax))\r\n .curve(curve);\r\n\r\n const areaShape = area<FormattedDataType>()\r\n .x(d => x(d.date))\r\n .y0(d => y(d.yMin))\r\n .y1(d => y(d.yMax))\r\n .curve(curve);\r\n\r\n const yTicks = y.ticks(noOfYTicks);\r\n\r\n const xTicks = x.ticks(noOfXTicks);\r\n\r\n useEffect(() => {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const mousemove = (event: any) => {\r\n const selectedData =\r\n dataFormatted[\r\n bisectCenter(\r\n dataFormatted.map(d => d.date),\r\n x.invert(pointer(event)[0]),\r\n 1,\r\n )\r\n ];\r\n setMouseOverData(selectedData || dataFormatted[dataFormatted.length - 1]);\r\n onSeriesMouseOver?.(selectedData || dataFormatted[dataFormatted.length - 1]);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n };\r\n const mouseout = () => {\r\n setMouseOverData(undefined);\r\n setEventX(undefined);\r\n setEventY(undefined);\r\n onSeriesMouseOver?.(undefined);\r\n };\r\n select(MouseoverRectRef.current).on('mousemove', mousemove).on('mouseout', mouseout);\r\n }, [x, dataFormatted, onSeriesMouseOver]);\r\n const regressionLineParam = linearRegression(\r\n dataFormatted\r\n .filter(d => !checkIfNullOrUndefined(d.date) && !checkIfNullOrUndefined(d.y))\r\n .map(d => [x(d.date), y(d.y as number)]),\r\n );\r\n const predict = linearRegressionLine(regressionLineParam);\r\n return (\r\n <>\r\n <motion.svg\r\n width={`${width}px`}\r\n height={`${height}px`}\r\n viewBox={`0 0 ${width} ${height}`}\r\n direction='ltr'\r\n ref={svgRef}\r\n >\r\n <g transform={`translate(${margin.left},${margin.top})`}>\r\n <HighlightArea\r\n areaSettings={highlightAreaSettingsFormatted}\r\n width={graphWidth}\r\n height={graphHeight}\r\n scale={x}\r\n animate={animate}\r\n isInView={isInView}\r\n />\r\n <CustomArea\r\n areaSettings={customHighlightAreaSettingsFormatted}\r\n scaleX={x}\r\n scaleY={y}\r\n animate={animate}\r\n isInView={isInView}\r\n />\r\n <g>\r\n <YTicksAndGridLines\r\n values={yTicks.filter(d => d !== 0)}\r\n y={yTicks.filter(d => d !== 0).map(d => y(d))}\r\n x1={0 - leftMargin}\r\n x2={graphWidth + margin.right}\r\n styles={{\r\n gridLines: styles?.yAxis?.gridLines,\r\n labels: styles?.yAxis?.labels,\r\n }}\r\n classNames={{\r\n gridLines: classNames?.yAxis?.gridLines,\r\n labels: classNames?.yAxis?.labels,\r\n }}\r\n suffix={suffix}\r\n prefix={prefix}\r\n labelType='secondary'\r\n showGridLines\r\n labelPos='vertical'\r\n precision={precision}\r\n />\r\n <Axis\r\n y1={y(minParam < 0 ? 0 : minParam)}\r\n y2={y(minParam < 0 ? 0 : minParam)}\r\n x1={0 - leftMargin}\r\n x2={graphWidth + margin.right}\r\n label={numberFormattingFunction(\r\n minParam < 0 ? 0 : minParam,\r\n 'NA',\r\n precision,\r\n prefix,\r\n suffix,\r\n )}\r\n labelPos={{\r\n x: 0 - leftMargin,\r\n y: y(minParam < 0 ? 0 : minParam),\r\n dx: 0,\r\n dy: maxParam < 0 ? '1em' : -5,\r\n }}\r\n classNames={{\r\n axis: classNames?.xAxis?.axis,\r\n label: classNames?.yAxis?.labels,\r\n }}\r\n styles={{\r\n axis: styles?.xAxis?.axis,\r\n label: styles?.yAxis?.labels,\r\n }}\r\n />\r\n <AxisTitle\r\n x={0 - leftMargin + 15}\r\n y={graphHeight / 2}\r\n style={styles?.yAxis?.title}\r\n className={classNames?.yAxis?.title}\r\n text={yAxisTitle}\r\n rotate90\r\n />\r\n </g>\r\n <g>\r\n {xTicks.map((d, i) => (\r\n <g key={i}>\r\n <text\r\n y={graphHeight}\r\n x={x(d)}\r\n style={{ textAnchor: 'middle' }}\r\n className='fill-primary-gray-700 dark:fill-primary-gray-300 xs:max-[360px]:hidden text-[9px] md:text-[10px] lg:text-xs'\r\n dy={15}\r\n >\r\n {format(d, dateFormat)}\r\n </text>\r\n </g>\r\n ))}\r\n </g>\r\n {customLayers.filter(d => d.position === 'before').map(d => d.layer)}\r\n <motion.path\r\n style={{\r\n fill: intervalAreaColor,\r\n }}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n variants={{\r\n initial: { opacity: 0, d: areaShape(dataFormatted) || '' },\r\n whileInView: {\r\n opacity: intervalAreaOpacity,\r\n d: areaShape(dataFormatted) || '',\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n />\r\n {intervalLineStrokeWidth ? (\r\n <>\r\n <motion.path\r\n style={{\r\n stroke: intervalLineColors[0],\r\n fill: 'none',\r\n strokeWidth: intervalLineStrokeWidth,\r\n }}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n variants={{\r\n initial: {\r\n pathLength: 0,\r\n d: lineShapeMin(dataFormatted) || '',\r\n opacity: 1,\r\n },\r\n whileInView: {\r\n pathLength: 1,\r\n d: lineShapeMin(dataFormatted) || '',\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n />\r\n <motion.path\r\n style={{\r\n stroke: intervalLineColors[1],\r\n fill: 'none',\r\n strokeWidth: intervalLineStrokeWidth,\r\n }}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n variants={{\r\n initial: {\r\n pathLength: 0,\r\n d: lineShapeMax(dataFormatted) || '',\r\n opacity: 1,\r\n },\r\n whileInView: {\r\n pathLength: 1,\r\n d: lineShapeMax(dataFormatted) || '',\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n />\r\n </>\r\n ) : null}\r\n <motion.path\r\n style={{\r\n stroke: lineColor,\r\n fill: 'none',\r\n strokeWidth,\r\n }}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n variants={{\r\n initial: {\r\n pathLength: 0,\r\n d: lineShape(dataFormatted) || '',\r\n opacity: 1,\r\n },\r\n whileInView: {\r\n pathLength: 1,\r\n d: lineShape(dataFormatted) || '',\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n />\r\n {mouseOverData ? (\r\n <line\r\n y1={0}\r\n y2={graphHeight}\r\n x1={x(mouseOverData.date)}\r\n x2={x(mouseOverData.date)}\r\n className={cn(\r\n 'undp-tick-line stroke-primary-gray-700 dark:stroke-primary-gray-100',\r\n classNames?.mouseOverLine,\r\n )}\r\n style={styles?.mouseOverLine}\r\n />\r\n ) : null}\r\n <g>\r\n {dataFormatted.map((d, i) => (\r\n <motion.g key={i}>\r\n {!checkIfNullOrUndefined(d.y) ? (\r\n <>\r\n {showDots ? (\r\n <motion.circle\r\n r={\r\n graphWidth / dataFormatted.length < 5\r\n ? 0\r\n : graphWidth / dataFormatted.length < 20\r\n ? 2\r\n : 4\r\n }\r\n style={{ fill: lineColor }}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n variants={{\r\n initial: { opacity: 0, cx: x(d.date), cy: y(d.y) },\r\n whileInView: {\r\n opacity: 1,\r\n transition: {\r\n duration: hasAnimatedOnce ? animate.duration : 0.5,\r\n delay: hasAnimatedOnce ? 0 : animate.duration,\r\n },\r\n cx: x(d.date),\r\n cy: y(d.y),\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n />\r\n ) : null}\r\n {showIntervalDots ? (\r\n <>\r\n <motion.circle\r\n r={\r\n graphWidth / dataFormatted.length < 5\r\n ? 0\r\n : graphWidth / dataFormatted.length < 20\r\n ? 2\r\n : 4\r\n }\r\n style={{ fill: intervalLineColors[0] }}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n variants={{\r\n initial: { opacity: 0, cx: x(d.date), cy: y(d.yMin) },\r\n whileInView: {\r\n opacity: 1,\r\n transition: {\r\n duration: hasAnimatedOnce ? animate.duration : 0.5,\r\n delay: hasAnimatedOnce ? 0 : animate.duration,\r\n },\r\n cx: x(d.date),\r\n cy: y(d.yMin),\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n />\r\n <motion.circle\r\n r={\r\n graphWidth / dataFormatted.length < 5\r\n ? 0\r\n : graphWidth / dataFormatted.length < 20\r\n ? 2\r\n : 4\r\n }\r\n style={{ fill: intervalLineColors[1] }}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n variants={{\r\n initial: { opacity: 0, cx: x(d.date), cy: y(d.yMax) },\r\n whileInView: {\r\n opacity: 1,\r\n transition: {\r\n duration: hasAnimatedOnce ? animate.duration : 0.5,\r\n delay: hasAnimatedOnce ? 0 : animate.duration,\r\n },\r\n cx: x(d.date),\r\n cy: y(d.yMax),\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n />\r\n </>\r\n ) : null}\r\n {showValues ? (\r\n <motion.text\r\n dy={-8}\r\n style={{\r\n fill: lineColor,\r\n textAnchor: 'middle',\r\n ...(styles?.graphObjectValues || {}),\r\n }}\r\n className={cn(\r\n 'graph-value text-xs font-bold',\r\n classNames?.graphObjectValues,\r\n )}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n variants={{\r\n initial: { opacity: 0, x: x(d.date), y: y(d.y) },\r\n whileInView: {\r\n opacity: 1,\r\n x: x(d.date),\r\n y: y(d.y),\r\n transition: {\r\n duration: hasAnimatedOnce ? animate.duration : 0.5,\r\n delay: hasAnimatedOnce ? 0 : animate.duration,\r\n },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n >\r\n {numberFormattingFunction(d.y, 'NA', precision, prefix, suffix)}\r\n </motion.text>\r\n ) : null}\r\n {showIntervalValues ? (\r\n <>\r\n <motion.text\r\n dy='1em'\r\n style={{\r\n fill: intervalLineColors[0],\r\n textAnchor: 'middle',\r\n ...(styles?.graphObjectValues || {}),\r\n }}\r\n className={cn('text-xs font-bold', classNames?.graphObjectValues)}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n variants={{\r\n initial: { opacity: 0, x: x(d.date), y: y(d.yMin) },\r\n whileInView: {\r\n opacity: 1,\r\n x: x(d.date),\r\n y: y(d.yMin),\r\n transition: {\r\n duration: hasAnimatedOnce ? animate.duration : 0.5,\r\n delay: hasAnimatedOnce ? 0 : animate.duration,\r\n },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n >\r\n {numberFormattingFunction(d.yMin, 'NA', precision, prefix, suffix)}\r\n </motion.text>\r\n <motion.text\r\n dy={-8}\r\n style={{\r\n fill: intervalLineColors[1],\r\n textAnchor: 'middle',\r\n ...(styles?.graphObjectValues || {}),\r\n }}\r\n className={cn('text-xs font-bold', classNames?.graphObjectValues)}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n variants={{\r\n initial: { opacity: 0, x: x(d.date), y: y(d.yMax) },\r\n whileInView: {\r\n opacity: 1,\r\n x: x(d.date),\r\n y: y(d.yMax),\r\n transition: {\r\n duration: hasAnimatedOnce ? animate.duration : 0.5,\r\n delay: hasAnimatedOnce ? 0 : animate.duration,\r\n },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n >\r\n {numberFormattingFunction(d.yMax, 'NA', precision, prefix, suffix)}\r\n </motion.text>\r\n </>\r\n ) : null}\r\n </>\r\n ) : null}\r\n </motion.g>\r\n ))}\r\n </g>\r\n {refValues ? (\r\n <>\r\n {refValues.map((el, i) => (\r\n <RefLineY\r\n key={i}\r\n text={el.text}\r\n color={el.color}\r\n y={y(el.value as number)}\r\n x1={0 - leftMargin}\r\n x2={graphWidth + margin.right}\r\n classNames={el.classNames}\r\n styles={el.styles}\r\n animate={animate}\r\n isInView={isInView}\r\n />\r\n ))}\r\n </>\r\n ) : null}\r\n <g>\r\n {annotations.map((d, i) => {\r\n const endPoints = getLineEndPoint(\r\n {\r\n x: d.xCoordinate\r\n ? x(parse(`${d.xCoordinate}`, dateFormat, new Date())) + (d.xOffset || 0)\r\n : 0 + (d.xOffset || 0),\r\n y: d.yCoordinate\r\n ? y(d.yCoordinate as number) + (d.yOffset || 0) - 8\r\n : 0 + (d.yOffset || 0) - 8,\r\n },\r\n {\r\n x: d.xCoordinate ? x(parse(`${d.xCoordinate}`, dateFormat, new Date())) : 0,\r\n y: d.yCoordinate ? y(d.yCoordinate as number) : 0,\r\n },\r\n checkIfNullOrUndefined(d.connectorRadius) ? 3.5 : (d.connectorRadius as number),\r\n );\r\n const connectorSettings = d.showConnector\r\n ? {\r\n y1: endPoints.y,\r\n x1: endPoints.x,\r\n y2: d.yCoordinate\r\n ? y(d.yCoordinate as number) + (d.yOffset || 0)\r\n : 0 + (d.yOffset || 0),\r\n x2: d.xCoordinate\r\n ? x(parse(`${d.xCoordinate}`, dateFormat, new Date())) + (d.xOffset || 0)\r\n : 0 + (d.xOffset || 0),\r\n cy: d.yCoordinate ? y(d.yCoordinate as number) : 0,\r\n cx: d.xCoordinate ? x(parse(`${d.xCoordinate}`, dateFormat, new Date())) : 0,\r\n circleRadius: checkIfNullOrUndefined(d.connectorRadius)\r\n ? 3.5\r\n : (d.connectorRadius as number),\r\n strokeWidth: d.showConnector === true ? 2 : Math.min(d.showConnector || 0, 1),\r\n }\r\n : undefined;\r\n const labelSettings = {\r\n y: d.yCoordinate\r\n ? y(d.yCoordinate as number) + (d.yOffset || 0) - 8\r\n : 0 + (d.yOffset || 0) - 8,\r\n x: rtl\r\n ? 0\r\n : d.xCoordinate\r\n ? x(parse(`${d.xCoordinate}`, dateFormat, new Date())) + (d.xOffset || 0)\r\n : 0 + (d.xOffset || 0),\r\n width: rtl\r\n ? d.xCoordinate\r\n ? x(parse(`${d.xCoordinate}`, dateFormat, new Date())) + (d.xOffset || 0)\r\n : 0 + (d.xOffset || 0)\r\n : graphWidth -\r\n (d.xCoordinate\r\n ? x(parse(`${d.xCoordinate}`, dateFormat, new Date())) + (d.xOffset || 0)\r\n : 0 + (d.xOffset || 0)),\r\n maxWidth: d.maxWidth,\r\n fontWeight: d.fontWeight,\r\n align: d.align,\r\n };\r\n return (\r\n <Annotation\r\n key={i}\r\n color={d.color}\r\n connectorsSettings={connectorSettings}\r\n labelSettings={labelSettings}\r\n text={d.text}\r\n classNames={d.classNames}\r\n styles={d.styles}\r\n animate={animate}\r\n isInView={isInView}\r\n />\r\n );\r\n })}\r\n </g>\r\n <g>\r\n {regressionLine ? (\r\n <RegressionLine\r\n x1={0}\r\n x2={graphWidth}\r\n y1={predict(0)}\r\n y2={predict(graphWidth)}\r\n graphHeight={graphHeight}\r\n graphWidth={graphWidth}\r\n className={classNames?.regLine}\r\n style={styles?.regLine}\r\n color={typeof regressionLine === 'string' ? regressionLine : undefined}\r\n animate={animate}\r\n isInView={isInView}\r\n />\r\n ) : null}\r\n </g>\r\n {customLayers.filter(d => d.position === 'after').map(d => d.layer)}\r\n <rect\r\n ref={MouseoverRectRef}\r\n style={{\r\n fill: 'none',\r\n pointerEvents: 'all',\r\n }}\r\n width={graphWidth}\r\n height={graphHeight}\r\n />\r\n </g>\r\n </motion.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 </>\r\n );\r\n}\r\n","import { useState, useRef, useEffect } from 'react';\r\nimport { cn } from '@undp/design-system-react/cn';\r\n\r\nimport { Graph } from './Graph';\r\n\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport {\r\n AnnotationSettingsDataType,\r\n CustomHighlightAreaSettingsDataType,\r\n Languages,\r\n LineChartWithConfidenceIntervalDataType,\r\n ReferenceDataType,\r\n SourcesDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n HighlightAreaSettingsDataType,\r\n CurveTypes,\r\n CustomLayerDataType,\r\n AnimateDataType,\r\n} from '@/Types';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { ColorLegend } from '@/Components/Elements/ColorLegend';\r\nimport { EmptyState } from '@/Components/Elements/EmptyState';\r\n\r\ninterface Props {\r\n // Data\r\n /** Array of data objects */\r\n data: LineChartWithConfidenceIntervalDataType[];\r\n\r\n // Titles, Labels, and Sources\r\n /** Title of the graph */\r\n graphTitle?: string | React.ReactNode;\r\n /** Description of the graph */\r\n graphDescription?: string | React.ReactNode;\r\n /** Footnote for the graph */\r\n footNote?: string | React.ReactNode;\r\n /** Source data for the graph */\r\n sources?: SourcesDataType[];\r\n /** Accessibility label */\r\n ariaLabel?: string;\r\n\r\n // Colors and Styling\r\n /** Colors of the line */\r\n lineColor?: string;\r\n /** Colors of the interval area */\r\n intervalAreaColor?: string;\r\n /** Colors of the top and bottom lines of the interval */\r\n intervalLineColors?: [string, string];\r\n /** Colors for the legend */\r\n colorLegendColors?: string[];\r\n /** Domain of colors for the legend */\r\n colorLegendDomain?: string[];\r\n /** Title for the color legend */\r\n colorLegendTitle?: 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 /** Left margin of the graph */\r\n leftMargin?: number;\r\n /** Right margin of the graph */\r\n rightMargin?: number;\r\n /** Top margin of the graph */\r\n topMargin?: number;\r\n /** Bottom margin of the graph */\r\n bottomMargin?: 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 /** Maximum value for the chart */\r\n maxValue?: number;\r\n /** Minimum value for the chart */\r\n minValue?: number;\r\n /** Reference values for comparison */\r\n refValues?: ReferenceDataType[];\r\n /** Maximum value of the date for the chart */\r\n maxDate?: string | number;\r\n /** Minimum value of the date for the chart */\r\n minDate?: string | number;\r\n /** No. of ticks on the x-axis */\r\n noOfXTicks?: number;\r\n /** No. of ticks on the y-axis */\r\n noOfYTicks?: number;\r\n\r\n // Graph Parameters\r\n /** Toggle visibility of values */\r\n showValues?: boolean;\r\n /** Toggle visibility of values of the interval area */\r\n showIntervalValues?: boolean;\r\n /** Toggle visibility of dots on the line */\r\n showDots?: boolean;\r\n /** Toggle visibility of dots on the line of te interval area */\r\n showIntervalDots?: boolean;\r\n /** Stroke width of the line */\r\n strokeWidth?: number;\r\n /** Stroke width of the lines of the interval area */\r\n intervalLineStrokeWidth?: number;\r\n /** Opacity of the interval area */\r\n intervalAreaOpacity?: number;\r\n /** Toggle the initial animation of the line. If the type is number then it uses the number as the time in seconds for animation. */\r\n animate?: boolean | AnimateDataType;\r\n /** Format of the date in the data object. Available formats can be found [here](https://date-fns.org/docs/format) */\r\n dateFormat?: string;\r\n /** Title for the Y-axis */\r\n yAxisTitle?: string;\r\n /** Annotations on the chart */\r\n annotations?: AnnotationSettingsDataType[];\r\n /** Highlighted area(square) on the chart */\r\n highlightAreaSettings?: HighlightAreaSettingsDataType[];\r\n /** Highlighted area(custom shape) on the chart */\r\n customHighlightAreaSettings?: CustomHighlightAreaSettingsDataType[];\r\n /** Toggles the visibility of the regression line for the data. If the type is string then string is use to define the color of the line. */\r\n regressionLine?: boolean | string;\r\n /** Curve type for the line */\r\n curveType?: CurveTypes;\r\n /** Specifies the number of decimal places to display in the value. */\r\n precision?: number;\r\n /** Optional SVG <g> element or function that renders custom content behind or in front of the graph. */\r\n customLayers?: CustomLayerDataType[];\r\n /** 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\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 /** Callback for mouse over event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_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 LineChartWithConfidenceInterval(props: Props) {\r\n const {\r\n data,\r\n graphTitle,\r\n suffix = '',\r\n sources,\r\n prefix = '',\r\n graphDescription,\r\n height,\r\n width,\r\n footNote,\r\n noOfXTicks = 10,\r\n dateFormat = 'yyyy',\r\n showValues = false,\r\n backgroundColor = false,\r\n padding,\r\n lineColor,\r\n leftMargin = 30,\r\n rightMargin = 30,\r\n topMargin = 20,\r\n bottomMargin = 25,\r\n tooltip,\r\n refValues = [],\r\n highlightAreaSettings = [],\r\n relativeHeight,\r\n onSeriesMouseOver,\r\n graphID,\r\n minValue,\r\n maxValue,\r\n regressionLine = false,\r\n showIntervalDots = false,\r\n showIntervalValues = false,\r\n intervalLineStrokeWidth = 0,\r\n intervalLineColors = [Colors.light.grays['gray-500'], Colors.light.grays['gray-500']],\r\n intervalAreaColor = Colors.primaryColors['blue-100'],\r\n intervalAreaOpacity = 0.4,\r\n graphDownload = false,\r\n dataDownload = false,\r\n animate = false,\r\n language = 'en',\r\n minHeight = 0,\r\n strokeWidth = 2,\r\n showDots = true,\r\n annotations = [],\r\n customHighlightAreaSettings = [],\r\n theme = 'light',\r\n ariaLabel,\r\n yAxisTitle,\r\n noOfYTicks = 5,\r\n minDate,\r\n maxDate,\r\n colorLegendTitle,\r\n colorLegendColors,\r\n colorLegendDomain,\r\n curveType = 'curve',\r\n styles,\r\n classNames,\r\n precision = 2,\r\n customLayers = [],\r\n } = props;\r\n\r\n const [svgWidth, setSvgWidth] = useState(0);\r\n const [svgHeight, setSvgHeight] = useState(0);\r\n\r\n const graphDiv = useRef<HTMLDivElement>(null);\r\n const graphParentDiv = useRef<HTMLDivElement>(null);\r\n useEffect(() => {\r\n const resizeObserver = new ResizeObserver(entries => {\r\n setSvgWidth(width || entries[0].target.clientWidth || 620);\r\n setSvgHeight(height || entries[0].target.clientHeight || 480);\r\n });\r\n if (graphDiv.current) {\r\n setSvgHeight(graphDiv.current.clientHeight || 480);\r\n setSvgWidth(graphDiv.current.clientWidth || 620);\r\n if (!width) resizeObserver.observe(graphDiv.current);\r\n }\r\n return () => resizeObserver.disconnect();\r\n }, [width, height]);\r\n\r\n return (\r\n <div\r\n className={`${theme || 'light'} flex ${width ? 'w-fit grow-0' : 'w-full grow'}`}\r\n dir={language === 'he' || language === 'ar' ? 'rtl' : undefined}\r\n >\r\n <div\r\n className={cn(\r\n `${\r\n !backgroundColor\r\n ? 'bg-transparent '\r\n : backgroundColor === true\r\n ? 'bg-primary-gray-200 dark:bg-primary-gray-650 '\r\n : ''\r\n }ml-auto mr-auto flex flex-col grow h-inherit ${language || 'en'}`,\r\n classNames?.graphContainer,\r\n )}\r\n style={{\r\n ...(styles?.graphContainer || {}),\r\n ...(backgroundColor && backgroundColor !== true ? { backgroundColor } : {}),\r\n }}\r\n id={graphID}\r\n ref={graphParentDiv}\r\n aria-label={\r\n ariaLabel ||\r\n `${\r\n graphTitle ? `The graph shows ${graphTitle}. ` : ''\r\n }This is a line chart that highlights the difference between two datasets over time.${\r\n graphDescription ? ` ${graphDescription}` : ''\r\n }`\r\n }\r\n >\r\n <div\r\n className='flex grow'\r\n style={{ padding: backgroundColor ? padding || '1rem' : padding || 0 }}\r\n >\r\n <div className='flex flex-col w-full gap-4 grow justify-between'>\r\n {graphTitle || graphDescription || graphDownload || dataDownload ? (\r\n <GraphHeader\r\n styles={{\r\n title: styles?.title,\r\n description: styles?.description,\r\n }}\r\n classNames={{\r\n title: classNames?.title,\r\n description: classNames?.description,\r\n }}\r\n graphTitle={graphTitle}\r\n graphDescription={graphDescription}\r\n width={width}\r\n graphDownload={graphDownload ? graphParentDiv.current : undefined}\r\n dataDownload={\r\n dataDownload\r\n ? data.map(d => d.data).filter(d => d !== undefined).length > 0\r\n ? data.map(d => d.data).filter(d => d !== undefined)\r\n : data.filter(d => d !== undefined)\r\n : null\r\n }\r\n />\r\n ) : null}\r\n <div className='grow flex flex-col justify-center gap-3 w-full'>\r\n {data.length === 0 ? (\r\n <EmptyState />\r\n ) : (\r\n <>\r\n {colorLegendColors && colorLegendDomain ? (\r\n <ColorLegend\r\n width={width}\r\n colorLegendTitle={colorLegendTitle}\r\n colors={colorLegendColors}\r\n colorDomain={colorLegendDomain}\r\n showNAColor={false}\r\n />\r\n ) : null}\r\n <div\r\n className='flex flex-col grow justify-center leading-0'\r\n ref={graphDiv}\r\n aria-label='Graph area'\r\n >\r\n {(width || svgWidth) && (height || svgHeight) ? (\r\n <Graph\r\n data={data}\r\n lineColor={lineColor || Colors.primaryColors['blue-600']}\r\n width={width || svgWidth}\r\n height={Math.max(\r\n minHeight,\r\n height ||\r\n (relativeHeight\r\n ? minHeight\r\n ? (width || svgWidth) * relativeHeight > minHeight\r\n ? (width || svgWidth) * relativeHeight\r\n : minHeight\r\n : (width || svgWidth) * relativeHeight\r\n : svgHeight),\r\n )}\r\n suffix={suffix}\r\n prefix={prefix}\r\n dateFormat={dateFormat}\r\n showValues={showValues}\r\n noOfXTicks={noOfXTicks}\r\n leftMargin={leftMargin}\r\n rightMargin={rightMargin}\r\n topMargin={topMargin}\r\n bottomMargin={bottomMargin}\r\n tooltip={tooltip}\r\n highlightAreaSettings={highlightAreaSettings}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n refValues={refValues}\r\n minValue={minValue}\r\n maxValue={maxValue}\r\n animate={\r\n animate === true\r\n ? { duration: 0.5, once: true, amount: 0.5 }\r\n : animate || { duration: 0, once: true, amount: 0 }\r\n }\r\n rtl={language === 'he' || language === 'ar'}\r\n strokeWidth={strokeWidth}\r\n showDots={showDots}\r\n annotations={annotations}\r\n customHighlightAreaSettings={customHighlightAreaSettings}\r\n regressionLine={regressionLine}\r\n showIntervalDots={showIntervalDots}\r\n showIntervalValues={showIntervalValues}\r\n intervalLineStrokeWidth={intervalLineStrokeWidth}\r\n intervalLineColors={intervalLineColors}\r\n intervalAreaColor={intervalAreaColor}\r\n intervalAreaOpacity={intervalAreaOpacity}\r\n yAxisTitle={yAxisTitle}\r\n noOfYTicks={noOfYTicks}\r\n minDate={minDate}\r\n maxDate={maxDate}\r\n curveType={curveType}\r\n styles={styles}\r\n classNames={classNames}\r\n precision={precision}\r\n customLayers={customLayers}\r\n />\r\n ) : null}\r\n </div>\r\n </>\r\n )}\r\n </div>\r\n {sources || footNote ? (\r\n <GraphFooter\r\n styles={{ footnote: styles?.footnote, source: styles?.source }}\r\n classNames={{\r\n footnote: classNames?.footnote,\r\n source: classNames?.source,\r\n }}\r\n sources={sources}\r\n footNote={footNote}\r\n width={width}\r\n />\r\n ) : null}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n}\r\n"],"names":["Graph","props","data","width","height","lineColor","suffix","prefix","dateFormat","highlightAreaSettings","showValues","noOfXTicks","rightMargin","leftMargin","topMargin","bottomMargin","tooltip","onSeriesMouseOver","refValues","minValue","maxValue","animate","rtl","strokeWidth","showDots","annotations","customHighlightAreaSettings","regressionLine","showIntervalDots","showIntervalValues","intervalLineStrokeWidth","intervalLineColors","intervalAreaColor","intervalAreaOpacity","yAxisTitle","noOfYTicks","minDate","maxDate","curveType","styles","classNames","precision","customLayers","svgRef","useRef","isInView","useInView","hasAnimatedOnce","setHasAnimatedOnce","useState","useEffect","timeout","curve","curveLinear","curveStep","curveStepAfter","curveStepBefore","curveMonotoneX","mouseOverData","setMouseOverData","eventX","setEventX","eventY","setEventY","margin","MouseoverRectRef","dataFormatted","sortBy","d","checkIfNullOrUndefined","parse","highlightAreaSettingsFormatted","customHighlightAreaSettingsFormatted","el","j","graphWidth","graphHeight","minYear","maxYear","minParam","maxParam","x","scaleTime","y","scaleLinear","lineShape","line","lineShapeMin","lineShapeMax","areaShape","area","yTicks","xTicks","mousemove","event","selectedData","bisectCenter","pointer","mouseout","select","regressionLineParam","linearRegression","predict","linearRegressionLine","jsxs","Fragment","jsx","motion","HighlightArea","CustomArea","YTicksAndGridLines","Axis","numberFormattingFunction","AxisTitle","i","format","cn","RefLineY","endPoints","getLineEndPoint","connectorSettings","labelSettings","Annotation","RegressionLine","Tooltip","LineChartWithConfidenceInterval","graphTitle","sources","graphDescription","footNote","backgroundColor","padding","relativeHeight","graphID","Colors","graphDownload","dataDownload","language","minHeight","theme","ariaLabel","colorLegendTitle","colorLegendColors","colorLegendDomain","svgWidth","setSvgWidth","svgHeight","setSvgHeight","graphDiv","graphParentDiv","resizeObserver","entries","GraphHeader","EmptyState","ColorLegend","GraphFooter"],"mappings":"srCAiGO,SAASA,GAAMC,GAAc,CAClC,KAAM,CACJ,KAAAC,EACA,MAAAC,EACA,OAAAC,EACA,UAAAC,EACA,OAAAC,EACA,OAAAC,EACA,WAAAC,EACA,sBAAAC,EACA,WAAAC,EACA,WAAAC,GACA,YAAAC,GACA,WAAAC,EACA,UAAAC,EACA,aAAAC,EACA,QAAAC,EACA,kBAAAC,EACA,UAAAC,EACA,SAAAC,EACA,SAAAC,EACA,QAAAC,EACA,IAAAC,EACA,YAAAC,GACA,SAAAC,EACA,YAAAC,GACA,4BAAAC,GACA,eAAAC,EACA,iBAAAC,GACA,mBAAAC,GACA,wBAAAC,EACA,mBAAAC,EACA,kBAAAC,GACA,oBAAAC,GACA,WAAAC,EACA,WAAAC,GACA,QAAAC,EACA,QAAAC,EACA,UAAAC,EACA,OAAAC,EACA,WAAAC,EACA,UAAAC,EACA,aAAAC,CAAA,EACEzC,GACE0C,GAASC,EAAAA,OAAO,IAAI,EACpBC,EAAWC,GAAAA,UAAUH,GAAQ,CACjC,KAAMtB,EAAQ,KACd,O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