@undp/data-viz 1.2.8 → 1.3.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 (496) hide show
  1. package/dist/AreaChart.d.ts +224 -0
  2. package/dist/AreaChart.js +2 -0
  3. package/dist/AreaChart.js.map +1 -0
  4. package/dist/Axis-BlyBRMNw.cjs +2 -0
  5. package/dist/Axis-BlyBRMNw.cjs.map +1 -0
  6. package/dist/Axis-CvK-w3E2.js +44 -0
  7. package/dist/Axis-CvK-w3E2.js.map +1 -0
  8. package/dist/AxisTitle-BY8MI9jC.cjs +2 -0
  9. package/dist/AxisTitle-BY8MI9jC.cjs.map +1 -0
  10. package/dist/AxisTitle-BeMxcw5I.js +21 -0
  11. package/dist/AxisTitle-BeMxcw5I.js.map +1 -0
  12. package/dist/BarGraph.d.ts +460 -0
  13. package/dist/BarGraph.js +2 -0
  14. package/dist/BarGraph.js.map +1 -0
  15. package/dist/BasicStatCard.d.ts +106 -0
  16. package/dist/BasicStatCard.js +2 -0
  17. package/dist/BasicStatCard.js.map +1 -0
  18. package/dist/BeeSwarmChart.d.ts +189 -0
  19. package/dist/BeeSwarmChart.js +2 -0
  20. package/dist/BeeSwarmChart.js.map +1 -0
  21. package/dist/BiVariateChoroplethMap.d.ts +189 -0
  22. package/dist/BiVariateChoroplethMap.js +2 -0
  23. package/dist/BiVariateChoroplethMap.js.map +1 -0
  24. package/dist/BulletChart.d.ts +219 -0
  25. package/dist/BulletChart.js +2 -0
  26. package/dist/BulletChart.js.map +1 -0
  27. package/dist/ButterflyChart.d.ts +201 -0
  28. package/dist/ButterflyChart.js +2 -0
  29. package/dist/ButterflyChart.js.map +1 -0
  30. package/dist/ChoroplethMap.d.ts +190 -0
  31. package/dist/ChoroplethMap.js +2 -0
  32. package/dist/ChoroplethMap.js.map +1 -0
  33. package/dist/CirclePackingGraph.d.ts +161 -0
  34. package/dist/CirclePackingGraph.js +2 -0
  35. package/dist/CirclePackingGraph.js.map +1 -0
  36. package/dist/ColorLegend.d.ts +17 -0
  37. package/dist/ColorLegend.js +2 -0
  38. package/dist/ColorLegend.js.map +1 -0
  39. package/dist/ColorLegendWithMouseOver.d.ts +16 -0
  40. package/dist/ColorLegendWithMouseOver.js +2 -0
  41. package/dist/ColorLegendWithMouseOver.js.map +1 -0
  42. package/dist/Colors.d.ts +174 -0
  43. package/dist/Colors.js +2 -0
  44. package/dist/Colors.js.map +1 -0
  45. package/dist/CopyTextButton.d.ts +13 -0
  46. package/dist/CopyTextButton.js +17 -0
  47. package/dist/CopyTextButton.js.map +1 -0
  48. package/dist/CsvDownloadButton.d.ts +22 -0
  49. package/dist/CsvDownloadButton.js +23 -0
  50. package/dist/CsvDownloadButton.js.map +1 -0
  51. package/dist/DataCards.d.ts +131 -0
  52. package/dist/DataCards.js +2 -0
  53. package/dist/DataCards.js.map +1 -0
  54. package/dist/DataTable.d.ts +122 -0
  55. package/dist/DataTable.js +2 -0
  56. package/dist/DataTable.js.map +1 -0
  57. package/dist/DifferenceLineChart.d.ts +237 -0
  58. package/dist/DifferenceLineChart.js +2 -0
  59. package/dist/DifferenceLineChart.js.map +1 -0
  60. package/dist/DonutChart.d.ts +148 -0
  61. package/dist/DonutChart.js +2 -0
  62. package/dist/DonutChart.js.map +1 -0
  63. package/dist/DotDensityMap.d.ts +191 -0
  64. package/dist/DotDensityMap.js +2 -0
  65. package/dist/DotDensityMap.js.map +1 -0
  66. package/dist/DropdownSelect-CuzV7gdj.cjs +29 -0
  67. package/dist/DropdownSelect-CuzV7gdj.cjs.map +1 -0
  68. package/dist/DropdownSelect-DmZsXrhY.js +2698 -0
  69. package/dist/DropdownSelect-DmZsXrhY.js.map +1 -0
  70. package/dist/DualAxisLineChart.d.ts +180 -0
  71. package/dist/DualAxisLineChart.js +2 -0
  72. package/dist/DualAxisLineChart.js.map +1 -0
  73. package/dist/DumbbellChart.d.ts +224 -0
  74. package/dist/DumbbellChart.js +2 -0
  75. package/dist/DumbbellChart.js.map +1 -0
  76. package/dist/EmptyState-BQguKAp5.cjs +2 -0
  77. package/dist/EmptyState-BQguKAp5.cjs.map +1 -0
  78. package/dist/EmptyState-b2Ln487i.js +22 -0
  79. package/dist/EmptyState-b2Ln487i.js.map +1 -0
  80. package/dist/ExcelDownloadButton.d.ts +22 -0
  81. package/dist/ExcelDownloadButton.js +2 -0
  82. package/dist/ExcelDownloadButton.js.map +1 -0
  83. package/dist/FootNote.d.ts +12 -0
  84. package/dist/FootNote.js +2 -0
  85. package/dist/FootNote.js.map +1 -0
  86. package/dist/GeoHubCompareMaps.d.ts +103 -0
  87. package/dist/GeoHubCompareMaps.js +2 -0
  88. package/dist/GeoHubCompareMaps.js.map +1 -0
  89. package/dist/GeoHubMap.d.ts +118 -0
  90. package/dist/GeoHubMap.js +2 -0
  91. package/dist/GeoHubMap.js.map +1 -0
  92. package/dist/GeoHubMapWithLayerSelection.d.ts +117 -0
  93. package/dist/GeoHubMapWithLayerSelection.js +2 -0
  94. package/dist/GeoHubMapWithLayerSelection.js.map +1 -0
  95. package/dist/GraphDescription.d.ts +12 -0
  96. package/dist/GraphDescription.js +2 -0
  97. package/dist/GraphDescription.js.map +1 -0
  98. package/dist/GraphFooter.d.ts +24 -0
  99. package/dist/GraphFooter.js +2 -0
  100. package/dist/GraphFooter.js.map +1 -0
  101. package/dist/GraphHeader.d.ts +22 -0
  102. package/dist/GraphHeader.js +2 -0
  103. package/dist/GraphHeader.js.map +1 -0
  104. package/dist/GraphTitle.d.ts +13 -0
  105. package/dist/GraphTitle.js +2 -0
  106. package/dist/GraphTitle.js.map +1 -0
  107. package/dist/GriddedGraphs.d.ts +540 -0
  108. package/dist/GriddedGraphs.js +2 -0
  109. package/dist/GriddedGraphs.js.map +1 -0
  110. package/dist/GriddedGraphsFromConfig.d.ts +543 -0
  111. package/dist/GriddedGraphsFromConfig.js +2 -0
  112. package/dist/GriddedGraphsFromConfig.js.map +1 -0
  113. package/dist/HeatMap.d.ts +166 -0
  114. package/dist/HeatMap.js +2 -0
  115. package/dist/HeatMap.js.map +1 -0
  116. package/dist/Histogram.d.ts +165 -0
  117. package/dist/Histogram.js +2 -0
  118. package/dist/Histogram.js.map +1 -0
  119. package/dist/ImageDownloadButton.d.ts +15 -0
  120. package/dist/ImageDownloadButton.js +2 -0
  121. package/dist/ImageDownloadButton.js.map +1 -0
  122. package/dist/LineChartWithConfidenceInterval.d.ts +250 -0
  123. package/dist/LineChartWithConfidenceInterval.js +2 -0
  124. package/dist/LineChartWithConfidenceInterval.js.map +1 -0
  125. package/dist/LinearColorLegend.d.ts +13 -0
  126. package/dist/LinearColorLegend.js +2 -0
  127. package/dist/LinearColorLegend.js.map +1 -0
  128. package/dist/Modal-C9txyGOk.js +723 -0
  129. package/dist/Modal-C9txyGOk.js.map +1 -0
  130. package/dist/Modal-cQF2UQIa.cjs +46 -0
  131. package/dist/Modal-cQF2UQIa.cjs.map +1 -0
  132. package/dist/MultiGraphDashboard.d.ts +558 -0
  133. package/dist/MultiGraphDashboard.js +2 -0
  134. package/dist/MultiGraphDashboard.js.map +1 -0
  135. package/dist/MultiGraphDashboardFromConfig.d.ts +562 -0
  136. package/dist/MultiGraphDashboardFromConfig.js +2 -0
  137. package/dist/MultiGraphDashboardFromConfig.js.map +1 -0
  138. package/dist/MultiGraphDashboardWideToLongFormat.d.ts +128 -0
  139. package/dist/MultiGraphDashboardWideToLongFormat.js +2 -0
  140. package/dist/MultiGraphDashboardWideToLongFormat.js.map +1 -0
  141. package/dist/MultiGraphDashboardWideToLongFormatFromConfig.d.ts +133 -0
  142. package/dist/MultiGraphDashboardWideToLongFormatFromConfig.js +2 -0
  143. package/dist/MultiGraphDashboardWideToLongFormatFromConfig.js.map +1 -0
  144. package/dist/MultiLineAltChart.d.ts +244 -0
  145. package/dist/MultiLineAltChart.js +2 -0
  146. package/dist/MultiLineAltChart.js.map +1 -0
  147. package/dist/MultiLineChart.d.ts +246 -0
  148. package/dist/MultiLineChart.js +2 -0
  149. package/dist/MultiLineChart.js.map +1 -0
  150. package/dist/ParetoChart.d.ts +178 -0
  151. package/dist/ParetoChart.js +2 -0
  152. package/dist/ParetoChart.js.map +1 -0
  153. package/dist/RadarChart.d.ts +176 -0
  154. package/dist/RadarChart.js +2 -0
  155. package/dist/RadarChart.js.map +1 -0
  156. package/dist/ReferenceLine-BgDdQbDI.js +129 -0
  157. package/dist/ReferenceLine-BgDdQbDI.js.map +1 -0
  158. package/dist/ReferenceLine-Bsb5jeE4.cjs +2 -0
  159. package/dist/ReferenceLine-Bsb5jeE4.cjs.map +1 -0
  160. package/dist/RegressionLine-BfpCuD7B.cjs +2 -0
  161. package/dist/RegressionLine-BfpCuD7B.cjs.map +1 -0
  162. package/dist/RegressionLine-cSljpHaE.js +49 -0
  163. package/dist/RegressionLine-cSljpHaE.js.map +1 -0
  164. package/dist/SVGDownloadButton.d.ts +15 -0
  165. package/dist/SVGDownloadButton.js +2 -0
  166. package/dist/SVGDownloadButton.js.map +1 -0
  167. package/dist/SankeyChart.d.ts +178 -0
  168. package/dist/SankeyChart.js +2 -0
  169. package/dist/SankeyChart.js.map +1 -0
  170. package/dist/ScatterPlot.d.ts +266 -0
  171. package/dist/ScatterPlot.js +2 -0
  172. package/dist/ScatterPlot.js.map +1 -0
  173. package/dist/ScrollStory.d.ts +491 -0
  174. package/dist/ScrollStory.js +2 -0
  175. package/dist/ScrollStory.js.map +1 -0
  176. package/dist/SimpleLineChart.d.ts +230 -0
  177. package/dist/SimpleLineChart.js +2 -0
  178. package/dist/SimpleLineChart.js.map +1 -0
  179. package/dist/SingleGraphDashboard.d.ts +545 -0
  180. package/dist/SingleGraphDashboard.js +2 -0
  181. package/dist/SingleGraphDashboard.js.map +1 -0
  182. package/dist/SingleGraphDashboardFromConfig.d.ts +547 -0
  183. package/dist/SingleGraphDashboardFromConfig.js +2 -0
  184. package/dist/SingleGraphDashboardFromConfig.js.map +1 -0
  185. package/dist/SlopeChart.d.ts +167 -0
  186. package/dist/SlopeChart.js +2 -0
  187. package/dist/SlopeChart.js.map +1 -0
  188. package/dist/Source.d.ts +16 -0
  189. package/dist/Source.js +2 -0
  190. package/dist/Source.js.map +1 -0
  191. package/dist/SparkLine.d.ts +139 -0
  192. package/dist/SparkLine.js +2 -0
  193. package/dist/SparkLine.js.map +1 -0
  194. package/dist/Spinner-DN3s4S0H.js +17 -0
  195. package/dist/Spinner-DN3s4S0H.js.map +1 -0
  196. package/dist/Spinner-UmN-KPe9.cjs +2 -0
  197. package/dist/Spinner-UmN-KPe9.cjs.map +1 -0
  198. package/dist/StatCardFromData.d.ts +115 -0
  199. package/dist/StatCardFromData.js +2 -0
  200. package/dist/StatCardFromData.js.map +1 -0
  201. package/dist/StripChart.d.ts +178 -0
  202. package/dist/StripChart.js +2 -0
  203. package/dist/StripChart.js.map +1 -0
  204. package/dist/ThreeDGlobe.d.ts +158 -0
  205. package/dist/ThreeDGlobe.js +2 -0
  206. package/dist/ThreeDGlobe.js.map +1 -0
  207. package/dist/ThresholdColorLegendWithMouseOver.d.ts +16 -0
  208. package/dist/ThresholdColorLegendWithMouseOver.js +2 -0
  209. package/dist/ThresholdColorLegendWithMouseOver.js.map +1 -0
  210. package/dist/Tooltip-BM18N_3l.cjs +2 -0
  211. package/dist/Tooltip-BM18N_3l.cjs.map +1 -0
  212. package/dist/Tooltip-CzZ1wFyF.js +47 -0
  213. package/dist/Tooltip-CzZ1wFyF.js.map +1 -0
  214. package/dist/TreeMapGraph.d.ts +158 -0
  215. package/dist/TreeMapGraph.js +2 -0
  216. package/dist/TreeMapGraph.js.map +1 -0
  217. package/dist/Types.d.ts +883 -0
  218. package/dist/Types.js +2 -0
  219. package/dist/Types.js.map +1 -0
  220. package/dist/Typography-CDR-DAHH.cjs +2 -0
  221. package/dist/Typography-CDR-DAHH.cjs.map +1 -0
  222. package/dist/Typography-XJoSE-By.js +58 -0
  223. package/dist/Typography-XJoSE-By.js.map +1 -0
  224. package/dist/UnitChart.d.ts +132 -0
  225. package/dist/UnitChart.js +2 -0
  226. package/dist/UnitChart.js.map +1 -0
  227. package/dist/XAxesLabels-C9REbQQs.cjs +2 -0
  228. package/dist/XAxesLabels-C9REbQQs.cjs.map +1 -0
  229. package/dist/XAxesLabels-DVw7Lvuz.js +58 -0
  230. package/dist/XAxesLabels-DVw7Lvuz.js.map +1 -0
  231. package/dist/XTicksAndGridLines-CUefTINd.js +57 -0
  232. package/dist/XTicksAndGridLines-CUefTINd.js.map +1 -0
  233. package/dist/XTicksAndGridLines-DuK35ROS.cjs +2 -0
  234. package/dist/XTicksAndGridLines-DuK35ROS.cjs.map +1 -0
  235. package/dist/YAxesLabels-CYVY053X.js +53 -0
  236. package/dist/YAxesLabels-CYVY053X.js.map +1 -0
  237. package/dist/YAxesLabels-DhBdLk3Z.cjs +2 -0
  238. package/dist/YAxesLabels-DhBdLk3Z.cjs.map +1 -0
  239. package/dist/YTicksAndGridLines-BJRXuBdC.js +57 -0
  240. package/dist/YTicksAndGridLines-BJRXuBdC.js.map +1 -0
  241. package/dist/YTicksAndGridLines-CtLvzExe.cjs +2 -0
  242. package/dist/YTicksAndGridLines-CtLvzExe.cjs.map +1 -0
  243. package/dist/_commonjsHelpers-DKOUU3wS.cjs +2 -0
  244. package/dist/_commonjsHelpers-DKOUU3wS.cjs.map +1 -0
  245. package/dist/_commonjsHelpers-DaMA6jEr.js +9 -0
  246. package/dist/_commonjsHelpers-DaMA6jEr.js.map +1 -0
  247. package/dist/area-BE2wo7fv.js +53 -0
  248. package/dist/area-BE2wo7fv.js.map +1 -0
  249. package/dist/area-D3Qx7k7K.cjs +2 -0
  250. package/dist/area-D3Qx7k7K.cjs.map +1 -0
  251. package/dist/array-B7TkkRH0.js +89 -0
  252. package/dist/array-B7TkkRH0.js.map +1 -0
  253. package/dist/array-DKbXV8lR.cjs +2 -0
  254. package/dist/array-DKbXV8lR.cjs.map +1 -0
  255. package/dist/band-BEjh2CHI.js +47 -0
  256. package/dist/band-BEjh2CHI.js.map +1 -0
  257. package/dist/band-CAApY4Pd.cjs +2 -0
  258. package/dist/band-CAApY4Pd.cjs.map +1 -0
  259. package/dist/checkIfMultiple-CaefP4X2.js +2264 -0
  260. package/dist/checkIfMultiple-CaefP4X2.js.map +1 -0
  261. package/dist/checkIfMultiple-D3h8to1T.cjs +12 -0
  262. package/dist/checkIfMultiple-D3h8to1T.cjs.map +1 -0
  263. package/dist/checkIfNullOrUndefined.d.ts +15 -0
  264. package/dist/checkIfNullOrUndefined.js +2 -0
  265. package/dist/checkIfNullOrUndefined.js.map +1 -0
  266. package/dist/customArea-B47Ew5cT.cjs +2 -0
  267. package/dist/customArea-B47Ew5cT.cjs.map +1 -0
  268. package/dist/customArea-I3MsoqIl.js +176 -0
  269. package/dist/customArea-I3MsoqIl.js.map +1 -0
  270. package/dist/defaultLocale-BEa-49Qz.js +172 -0
  271. package/dist/defaultLocale-BEa-49Qz.js.map +1 -0
  272. package/dist/defaultLocale-DIVzfLaQ.cjs +2 -0
  273. package/dist/defaultLocale-DIVzfLaQ.cjs.map +1 -0
  274. package/dist/delaunay-C1uAf38t.js +684 -0
  275. package/dist/delaunay-C1uAf38t.js.map +1 -0
  276. package/dist/delaunay-rcy0HhZi.cjs +2 -0
  277. package/dist/delaunay-rcy0HhZi.cjs.map +1 -0
  278. package/dist/ensureCompleteData-BBDZbDCE.js +102 -0
  279. package/dist/ensureCompleteData-BBDZbDCE.js.map +1 -0
  280. package/dist/ensureCompleteData-DqWQ2Zbi.cjs +2 -0
  281. package/dist/ensureCompleteData-DqWQ2Zbi.cjs.map +1 -0
  282. package/dist/excelDownload.d.ts +31 -0
  283. package/dist/excelDownload.js +2 -0
  284. package/dist/excelDownload.js.map +1 -0
  285. package/dist/fetchAndParseData.d.ts +84 -0
  286. package/dist/fetchAndParseData.js +16 -0
  287. package/dist/fetchAndParseData.js.map +1 -0
  288. package/dist/filterData-B8ocT57s.js +14 -0
  289. package/dist/filterData-B8ocT57s.js.map +1 -0
  290. package/dist/filterData-DN6py7y_.cjs +2 -0
  291. package/dist/filterData-DN6py7y_.cjs.map +1 -0
  292. package/dist/generateCodes.d.ts +25 -0
  293. package/dist/generateCodes.js +2 -0
  294. package/dist/generateCodes.js.map +1 -0
  295. package/dist/generateRandomString-B5zBiJzS.cjs +2 -0
  296. package/dist/generateRandomString-B5zBiJzS.cjs.map +1 -0
  297. package/dist/generateRandomString-za3IQGfQ.js +11 -0
  298. package/dist/generateRandomString-za3IQGfQ.js.map +1 -0
  299. package/dist/getJenks.d.ts +17 -0
  300. package/dist/getJenks.js +2 -0
  301. package/dist/getJenks.js.map +1 -0
  302. package/dist/getPercentileValue.d.ts +13 -0
  303. package/dist/getPercentileValue.js +2 -0
  304. package/dist/getPercentileValue.js.map +1 -0
  305. package/dist/getQueryParamsFromLink.d.ts +18 -0
  306. package/dist/getQueryParamsFromLink.js +2 -0
  307. package/dist/getQueryParamsFromLink.js.map +1 -0
  308. package/dist/getSchema.d.ts +3256 -0
  309. package/dist/getSchema.js +2 -0
  310. package/dist/getSchema.js.map +1 -0
  311. package/dist/getSliderMarks-CWajGCGq.js +719 -0
  312. package/dist/getSliderMarks-CWajGCGq.js.map +1 -0
  313. package/dist/getSliderMarks-DDJ1CdhL.cjs +6 -0
  314. package/dist/getSliderMarks-DDJ1CdhL.cjs.map +1 -0
  315. package/dist/getTextColorBasedOnBgColor.d.ts +13 -0
  316. package/dist/getTextColorBasedOnBgColor.js +2 -0
  317. package/dist/getTextColorBasedOnBgColor.js.map +1 -0
  318. package/dist/getUniqValue.d.ts +18 -0
  319. package/dist/getUniqValue.js +2 -0
  320. package/dist/getUniqValue.js.map +1 -0
  321. package/dist/graphList.d.ts +9 -0
  322. package/dist/graphList.js +2 -0
  323. package/dist/graphList.js.map +1 -0
  324. package/dist/imageDownload.d.ts +16 -0
  325. package/dist/imageDownload.js +3 -0
  326. package/dist/imageDownload.js.map +1 -0
  327. package/dist/index-01r5X3Gr-9jE0ObrK.cjs +2 -0
  328. package/dist/index-01r5X3Gr-9jE0ObrK.cjs.map +1 -0
  329. package/dist/index-01r5X3Gr-kH7FxQ7P.js +451 -0
  330. package/dist/index-01r5X3Gr-kH7FxQ7P.js.map +1 -0
  331. package/dist/index-27yTRcko.js +35 -0
  332. package/dist/index-27yTRcko.js.map +1 -0
  333. package/dist/index-B0rbzOoC.cjs +2 -0
  334. package/dist/index-B0rbzOoC.cjs.map +1 -0
  335. package/dist/index-BGMGC-HN.cjs +22 -0
  336. package/dist/index-BGMGC-HN.cjs.map +1 -0
  337. package/dist/index-BHm2KTjD-2e-Fu8L-.js +702 -0
  338. package/dist/index-BHm2KTjD-2e-Fu8L-.js.map +1 -0
  339. package/dist/index-BHm2KTjD-D8FylaKc.cjs +44 -0
  340. package/dist/index-BHm2KTjD-D8FylaKc.cjs.map +1 -0
  341. package/dist/index-BIPNFFja.js +506 -0
  342. package/dist/index-BIPNFFja.js.map +1 -0
  343. package/dist/index-BLizQDlg.js +658 -0
  344. package/dist/index-BLizQDlg.js.map +1 -0
  345. package/dist/index-BXns0-ng.cjs +2 -0
  346. package/dist/index-BXns0-ng.cjs.map +1 -0
  347. package/dist/index-BYroABPm.cjs +2 -0
  348. package/dist/index-BYroABPm.cjs.map +1 -0
  349. package/dist/index-BczVvEBZ.cjs +2 -0
  350. package/dist/index-BczVvEBZ.cjs.map +1 -0
  351. package/dist/index-BzeLQvXk.cjs +2 -0
  352. package/dist/index-BzeLQvXk.cjs.map +1 -0
  353. package/dist/index-C1rRk_50.js +273 -0
  354. package/dist/index-C1rRk_50.js.map +1 -0
  355. package/dist/index-C21TvELx.cjs +2 -0
  356. package/dist/index-C21TvELx.cjs.map +1 -0
  357. package/dist/index-CEc_9zWy.cjs +2 -0
  358. package/dist/index-CEc_9zWy.cjs.map +1 -0
  359. package/dist/index-CZbIGs8q.cjs +2 -0
  360. package/dist/index-CZbIGs8q.cjs.map +1 -0
  361. package/dist/index-CaAIPGZo.js +631 -0
  362. package/dist/index-CaAIPGZo.js.map +1 -0
  363. package/dist/index-CbVeVrla.cjs +2 -0
  364. package/dist/index-CbVeVrla.cjs.map +1 -0
  365. package/dist/index-CqzhBPuO-CfQywbdq.js +41 -0
  366. package/dist/index-CqzhBPuO-CfQywbdq.js.map +1 -0
  367. package/dist/index-CqzhBPuO-raKZqS7l.cjs +2 -0
  368. package/dist/index-CqzhBPuO-raKZqS7l.cjs.map +1 -0
  369. package/dist/index-D7ltPi18.js +26 -0
  370. package/dist/index-D7ltPi18.js.map +1 -0
  371. package/dist/index-DSnvdkHZ.js +495 -0
  372. package/dist/index-DSnvdkHZ.js.map +1 -0
  373. package/dist/index-DXmF_0ez.js +308 -0
  374. package/dist/index-DXmF_0ez.js.map +1 -0
  375. package/dist/index-Db-Yg_Ud.js +120 -0
  376. package/dist/index-Db-Yg_Ud.js.map +1 -0
  377. package/dist/index-Ds0uHjK9.cjs +2 -0
  378. package/dist/index-Ds0uHjK9.cjs.map +1 -0
  379. package/dist/index-DxagiOHo.js +707 -0
  380. package/dist/index-DxagiOHo.js.map +1 -0
  381. package/dist/index-DzdwZ2OA.js +77 -0
  382. package/dist/index-DzdwZ2OA.js.map +1 -0
  383. package/dist/index-UV9hjG_S.js +53 -0
  384. package/dist/index-UV9hjG_S.js.map +1 -0
  385. package/dist/index-a2C2Bqn2.cjs +10 -0
  386. package/dist/index-a2C2Bqn2.cjs.map +1 -0
  387. package/dist/index.js +1 -52488
  388. package/dist/index.js.map +1 -1
  389. package/dist/init-BhZylTFx.js +63 -0
  390. package/dist/init-BhZylTFx.js.map +1 -0
  391. package/dist/init-DU0ybBc_.cjs +2 -0
  392. package/dist/init-DU0ybBc_.cjs.map +1 -0
  393. package/dist/line-CPfhohvF.js +68 -0
  394. package/dist/line-CPfhohvF.js.map +1 -0
  395. package/dist/line-DHV4JwCR.cjs +2 -0
  396. package/dist/line-DHV4JwCR.cjs.map +1 -0
  397. package/dist/linear-BVckp9RD.cjs +2 -0
  398. package/dist/linear-BVckp9RD.cjs.map +1 -0
  399. package/dist/linear-DUdu7l2G.js +221 -0
  400. package/dist/linear-DUdu7l2G.js.map +1 -0
  401. package/dist/numberFormattingFunction.d.ts +22 -0
  402. package/dist/numberFormattingFunction.js +2 -0
  403. package/dist/numberFormattingFunction.js.map +1 -0
  404. package/dist/ordinal-BOeNbyae.cjs +2 -0
  405. package/dist/ordinal-BOeNbyae.cjs.map +1 -0
  406. package/dist/ordinal-w9Lu4Stb.js +62 -0
  407. package/dist/ordinal-w9Lu4Stb.js.map +1 -0
  408. package/dist/parse-DlCRUFh_.js +2768 -0
  409. package/dist/parse-DlCRUFh_.js.map +1 -0
  410. package/dist/parse-hMnG_lRV.cjs +2 -0
  411. package/dist/parse-hMnG_lRV.cjs.map +1 -0
  412. package/dist/pointer-CWRWOsrb.js +23 -0
  413. package/dist/pointer-CWRWOsrb.js.map +1 -0
  414. package/dist/pointer-Dkq5NV1q.cjs +2 -0
  415. package/dist/pointer-Dkq5NV1q.cjs.map +1 -0
  416. package/dist/pow-B5-jkdHU.cjs +2 -0
  417. package/dist/pow-B5-jkdHU.cjs.map +1 -0
  418. package/dist/pow-e8zx3AQJ.js +35 -0
  419. package/dist/pow-e8zx3AQJ.js.map +1 -0
  420. package/dist/removeOutliers.d.ts +16 -0
  421. package/dist/removeOutliers.js +2 -0
  422. package/dist/removeOutliers.js.map +1 -0
  423. package/dist/select-Bnfk0lJx.cjs +2 -0
  424. package/dist/select-Bnfk0lJx.cjs.map +1 -0
  425. package/dist/select-DKy99ogv.js +584 -0
  426. package/dist/select-DKy99ogv.js.map +1 -0
  427. package/dist/simple-statistics-flVzqVtt.js +65 -0
  428. package/dist/simple-statistics-flVzqVtt.js.map +1 -0
  429. package/dist/simple-statistics-xm8c0LQQ.cjs +2 -0
  430. package/dist/simple-statistics-xm8c0LQQ.cjs.map +1 -0
  431. package/dist/step-BZ3C8QFW.cjs +2 -0
  432. package/dist/step-BZ3C8QFW.cjs.map +1 -0
  433. package/dist/step-BrDul-H4.js +119 -0
  434. package/dist/step-BrDul-H4.js.map +1 -0
  435. package/dist/string-B8KlVSPX.js +364 -0
  436. package/dist/string-B8KlVSPX.js.map +1 -0
  437. package/dist/string-CRoCZCYa.cjs +2 -0
  438. package/dist/string-CRoCZCYa.cjs.map +1 -0
  439. package/dist/string2HTML-BX0oNw83.js +758 -0
  440. package/dist/string2HTML-BX0oNw83.js.map +1 -0
  441. package/dist/string2HTML-X4ZYX5jI.cjs +3 -0
  442. package/dist/string2HTML-X4ZYX5jI.cjs.map +1 -0
  443. package/dist/style.css +1 -1
  444. package/dist/svgDownload.d.ts +16 -0
  445. package/dist/svgDownload.js +2 -0
  446. package/dist/svgDownload.js.map +1 -0
  447. package/dist/threshold-DFfqcDMa.js +23 -0
  448. package/dist/threshold-DFfqcDMa.js.map +1 -0
  449. package/dist/threshold-DNsSUf8Q.cjs +2 -0
  450. package/dist/threshold-DNsSUf8Q.cjs.map +1 -0
  451. package/dist/time-Byw_jYQ7.cjs +2 -0
  452. package/dist/time-Byw_jYQ7.cjs.map +1 -0
  453. package/dist/time-BzJP5SPC.js +715 -0
  454. package/dist/time-BzJP5SPC.js.map +1 -0
  455. package/dist/timer-B39XOBYL.js +124 -0
  456. package/dist/timer-B39XOBYL.js.map +1 -0
  457. package/dist/timer-CKyBCVzT.cjs +2 -0
  458. package/dist/timer-CKyBCVzT.cjs.map +1 -0
  459. package/dist/toConsumableArray-BSMMWi3w-Cu4vcE-m.js +139 -0
  460. package/dist/toConsumableArray-BSMMWi3w-Cu4vcE-m.js.map +1 -0
  461. package/dist/toConsumableArray-BSMMWi3w-DJL7-zAp.cjs +4 -0
  462. package/dist/toConsumableArray-BSMMWi3w-DJL7-zAp.cjs.map +1 -0
  463. package/dist/transformColumnsToArray.d.ts +38 -0
  464. package/dist/transformColumnsToArray.js +2 -0
  465. package/dist/transformColumnsToArray.js.map +1 -0
  466. package/dist/transformDataForAggregation.d.ts +38 -0
  467. package/dist/transformDataForAggregation.js +2 -0
  468. package/dist/transformDataForAggregation.js.map +1 -0
  469. package/dist/transformDataForGraph.d.ts +47 -0
  470. package/dist/transformDataForGraph.js +2 -0
  471. package/dist/transformDataForGraph.js.map +1 -0
  472. package/dist/transformDataForGraphFromFile.d.ts +66 -0
  473. package/dist/transformDataForGraphFromFile.js +2 -0
  474. package/dist/transformDataForGraphFromFile.js.map +1 -0
  475. package/dist/use-in-view-CZPXmTZM.js +4645 -0
  476. package/dist/use-in-view-CZPXmTZM.js.map +1 -0
  477. package/dist/use-in-view-Dl1CsAIo.cjs +2 -0
  478. package/dist/use-in-view-Dl1CsAIo.cjs.map +1 -0
  479. package/dist/validateSchema.d.ts +68 -0
  480. package/dist/validateSchema.js +2 -0
  481. package/dist/validateSchema.js.map +1 -0
  482. package/dist/x-Dft9NVe_-DcB7wtv5.js +61 -0
  483. package/dist/x-Dft9NVe_-DcB7wtv5.js.map +1 -0
  484. package/dist/x-Dft9NVe_-LeyJu02C.cjs +27 -0
  485. package/dist/x-Dft9NVe_-LeyJu02C.cjs.map +1 -0
  486. package/dist/y-D0sAaVii.js +421 -0
  487. package/dist/y-D0sAaVii.js.map +1 -0
  488. package/dist/y-QcCbqrzx.cjs +2 -0
  489. package/dist/y-QcCbqrzx.cjs.map +1 -0
  490. package/dist/zoom-Lo7IAUfC.cjs +2 -0
  491. package/dist/zoom-Lo7IAUfC.cjs.map +1 -0
  492. package/dist/zoom-_lqdiGoI.js +1983 -0
  493. package/dist/zoom-_lqdiGoI.js.map +1 -0
  494. package/package.json +415 -4
  495. package/dist/index.cjs +0 -68
  496. package/dist/index.cjs.map +0 -1
@@ -0,0 +1,250 @@
1
+ import { JSX } from 'react/jsx-runtime';
2
+
3
+ declare interface AnimateDataType {
4
+ duration: number;
5
+ once: boolean;
6
+ amount: 'some' | 'all' | number;
7
+ }
8
+
9
+ declare interface AnnotationSettingsDataType {
10
+ text: string;
11
+ maxWidth?: number;
12
+ xCoordinate?: number | string;
13
+ yCoordinate?: number | string;
14
+ xOffset?: number;
15
+ yOffset?: number;
16
+ align?: 'center' | 'left' | 'right';
17
+ color?: string;
18
+ fontWeight?: 'regular' | 'bold' | 'medium';
19
+ showConnector?: boolean | number;
20
+ connectorRadius?: number;
21
+ classNames?: {
22
+ connector?: string;
23
+ text?: string;
24
+ };
25
+ styles?: {
26
+ connector?: React.CSSProperties;
27
+ text?: React.CSSProperties;
28
+ };
29
+ }
30
+
31
+ declare interface AxesClassNameObject {
32
+ gridLines?: string;
33
+ labels?: string;
34
+ title?: string;
35
+ axis?: string;
36
+ }
37
+
38
+ declare interface AxesStyleObject {
39
+ gridLines?: React.CSSProperties;
40
+ labels?: React.CSSProperties;
41
+ title?: React.CSSProperties;
42
+ axis?: React.CSSProperties;
43
+ }
44
+
45
+ declare interface ClassNameObject {
46
+ title?: string;
47
+ footnote?: string;
48
+ source?: string;
49
+ description?: string;
50
+ tooltip?: string;
51
+ xAxis?: AxesClassNameObject;
52
+ yAxis?: AxesClassNameObject;
53
+ legend?: string;
54
+ graphContainer?: string;
55
+ graphObjectValues?: string;
56
+ dataConnectors?: string;
57
+ mouseOverLine?: string;
58
+ regLine?: string;
59
+ dataCards?: string;
60
+ }
61
+
62
+ declare type CurveTypes = 'linear' | 'curve' | 'step' | 'stepAfter' | 'stepBefore';
63
+
64
+ declare interface CustomHighlightAreaSettingsDataType {
65
+ coordinates: (number | string)[];
66
+ closePath?: boolean;
67
+ style?: React.CSSProperties;
68
+ className?: string;
69
+ color?: string;
70
+ strokeWidth?: number;
71
+ }
72
+
73
+ declare interface CustomLayerDataType {
74
+ position: 'before' | 'after';
75
+ layer: React.ReactNode;
76
+ }
77
+
78
+ declare interface HighlightAreaSettingsDataType {
79
+ coordinates: [number | string | null, number | string | null];
80
+ style?: React.CSSProperties;
81
+ className?: string;
82
+ color?: string;
83
+ strokeWidth?: number;
84
+ }
85
+
86
+ declare type Languages = 'en' | 'ar' | 'az' | 'bn' | 'cy' | 'he' | 'hi' | 'jp' | 'ka' | 'km' | 'ko' | 'my' | 'ne' | 'zh' | 'custom';
87
+
88
+ export declare function LineChartWithConfidenceInterval(props: Props): JSX.Element;
89
+
90
+ declare interface LineChartWithConfidenceIntervalDataType {
91
+ date: number | string;
92
+ y?: number | null;
93
+ yMin?: number | null;
94
+ yMax?: number | null;
95
+ data?: object;
96
+ }
97
+
98
+ declare interface Props {
99
+ /** Array of data objects */
100
+ data: LineChartWithConfidenceIntervalDataType[];
101
+ /** Title of the graph */
102
+ graphTitle?: string | React.ReactNode;
103
+ /** Description of the graph */
104
+ graphDescription?: string | React.ReactNode;
105
+ /** Footnote for the graph */
106
+ footNote?: string | React.ReactNode;
107
+ /** Source data for the graph */
108
+ sources?: SourcesDataType[];
109
+ /** Accessibility label */
110
+ ariaLabel?: string;
111
+ /** Colors of the line */
112
+ lineColor?: string;
113
+ /** Colors of the interval area */
114
+ intervalAreaColor?: string;
115
+ /** Colors of the top and bottom lines of the interval */
116
+ intervalLineColors?: [string, string];
117
+ /** Colors for the legend */
118
+ colorLegendColors?: string[];
119
+ /** Domain of colors for the legend */
120
+ colorLegendDomain?: string[];
121
+ /** Title for the color legend */
122
+ colorLegendTitle?: string;
123
+ /** Background color of the graph */
124
+ backgroundColor?: string | boolean;
125
+ /** Custom styles for the graph. Each object should be a valid React CSS style object. */
126
+ styles?: StyleObject;
127
+ /** Custom class names */
128
+ classNames?: ClassNameObject;
129
+ /** Width of the graph */
130
+ width?: number;
131
+ /** Height of the graph */
132
+ height?: number;
133
+ /** Minimum height of the graph */
134
+ minHeight?: number;
135
+ /** Relative height scaling factor. This overwrites the height props */
136
+ relativeHeight?: number;
137
+ /** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */
138
+ padding?: string;
139
+ /** Left margin of the graph */
140
+ leftMargin?: number;
141
+ /** Right margin of the graph */
142
+ rightMargin?: number;
143
+ /** Top margin of the graph */
144
+ topMargin?: number;
145
+ /** Bottom margin of the graph */
146
+ bottomMargin?: number;
147
+ /** Prefix for values */
148
+ prefix?: string;
149
+ /** Suffix for values */
150
+ suffix?: string;
151
+ /** Maximum value for the chart */
152
+ maxValue?: number;
153
+ /** Minimum value for the chart */
154
+ minValue?: number;
155
+ /** Reference values for comparison */
156
+ refValues?: ReferenceDataType[];
157
+ /** Maximum value of the date for the chart */
158
+ maxDate?: string | number;
159
+ /** Minimum value of the date for the chart */
160
+ minDate?: string | number;
161
+ /** No. of ticks on the x-axis */
162
+ noOfXTicks?: number;
163
+ /** No. of ticks on the y-axis */
164
+ noOfYTicks?: number;
165
+ /** Toggle visibility of values */
166
+ showValues?: boolean;
167
+ /** Toggle visibility of values of the interval area */
168
+ showIntervalValues?: boolean;
169
+ /** Toggle visibility of dots on the line */
170
+ showDots?: boolean;
171
+ /** Toggle visibility of dots on the line of te interval area */
172
+ showIntervalDots?: boolean;
173
+ /** Stroke width of the line */
174
+ strokeWidth?: number;
175
+ /** Stroke width of the lines of the interval area */
176
+ intervalLineStrokeWidth?: number;
177
+ /** Opacity of the interval area */
178
+ intervalAreaOpacity?: number;
179
+ /** Toggle the initial animation of the line. If the type is number then it uses the number as the time in seconds for animation. */
180
+ animate?: boolean | AnimateDataType;
181
+ /** Format of the date in the data object. Available formats can be found [here](https://date-fns.org/docs/format) */
182
+ dateFormat?: string;
183
+ /** Title for the Y-axis */
184
+ yAxisTitle?: string;
185
+ /** Annotations on the chart */
186
+ annotations?: AnnotationSettingsDataType[];
187
+ /** Highlighted area(square) on the chart */
188
+ highlightAreaSettings?: HighlightAreaSettingsDataType[];
189
+ /** Highlighted area(custom shape) on the chart */
190
+ customHighlightAreaSettings?: CustomHighlightAreaSettingsDataType[];
191
+ /** 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. */
192
+ regressionLine?: boolean | string;
193
+ /** Curve type for the line */
194
+ curveType?: CurveTypes;
195
+ /** Specifies the number of decimal places to display in the value. */
196
+ precision?: number;
197
+ /** Optional SVG <g> element or function that renders custom content behind or in front of the graph. */
198
+ customLayers?: CustomLayerDataType[];
199
+ /** Enable graph download option as png */
200
+ graphDownload?: boolean;
201
+ /** Enable data download option as a csv */
202
+ dataDownload?: boolean;
203
+ /** 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 */
204
+ tooltip?: string | ((_d: any) => React.ReactNode);
205
+ /** Callback for mouse over event */
206
+ onSeriesMouseOver?: (_d: any) => void;
207
+ /** Language setting */
208
+ language?: Languages;
209
+ /** Color theme */
210
+ theme?: 'light' | 'dark';
211
+ /** Unique ID for the graph */
212
+ graphID?: string;
213
+ }
214
+
215
+ declare interface ReferenceDataType {
216
+ value: number | null;
217
+ text: string;
218
+ color?: string;
219
+ styles?: {
220
+ line?: React.CSSProperties;
221
+ text?: React.CSSProperties;
222
+ };
223
+ classNames?: {
224
+ line?: string;
225
+ text?: string;
226
+ };
227
+ }
228
+
229
+ declare interface SourcesDataType {
230
+ source: string;
231
+ link?: string;
232
+ }
233
+
234
+ declare interface StyleObject {
235
+ title?: React.CSSProperties;
236
+ footnote?: React.CSSProperties;
237
+ source?: React.CSSProperties;
238
+ description?: React.CSSProperties;
239
+ graphContainer?: React.CSSProperties;
240
+ tooltip?: React.CSSProperties;
241
+ xAxis?: AxesStyleObject;
242
+ yAxis?: AxesStyleObject;
243
+ graphObjectValues?: React.CSSProperties;
244
+ dataConnectors?: React.CSSProperties;
245
+ mouseOverLine?: React.CSSProperties;
246
+ regLine?: React.CSSProperties;
247
+ dataCards?: React.CSSProperties;
248
+ }
249
+
250
+ export { }
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-BHm2KTjD-D8FylaKc.cjs"),d=require("react"),G=require("./Typography-CDR-DAHH.cjs"),p=require("./parse-hMnG_lRV.cjs"),$t=require("./index-BzeLQvXk.cjs"),Dt=require("./simple-statistics-xm8c0LQQ.cjs"),lt=require("./numberFormattingFunction.js"),Tt=require("./Tooltip-BM18N_3l.cjs"),v=require("./checkIfNullOrUndefined.js"),Ot=require("./customArea-B47Ew5cT.cjs"),Ft=require("./AxisTitle-BY8MI9jC.cjs"),Wt=require("./Axis-BlyBRMNw.cjs"),Ht=require("./ReferenceLine-Bsb5jeE4.cjs"),Pt=require("./RegressionLine-BfpCuD7B.cjs"),Ut=require("./YTicksAndGridLines-CtLvzExe.cjs"),Yt=require("./index-BYroABPm.cjs"),y=require("./use-in-view-Dl1CsAIo.cjs"),Gt=require("./time-Byw_jYQ7.cjs"),Xt=require("./linear-BVckp9RD.cjs"),ct=require("./line-DHV4JwCR.cjs"),xt=require("./step-BZ3C8QFW.cjs"),Bt=require("./area-D3Qx7k7K.cjs"),zt=require("./select-Bnfk0lJx.cjs"),Kt=require("./init-DU0ybBc_.cjs"),Jt=require("./pointer-Dkq5NV1q.cjs"),Qt=require("./GraphFooter.js"),Zt=require("./GraphHeader.js"),ut=require("./Colors.js"),_t=require("./ColorLegend.js"),te=require("./EmptyState-BQguKAp5.cjs");function ee(mt){const{data:A,width:M,height:$,lineColor:V,suffix:I,prefix:j,dateFormat:o,highlightAreaSettings:h,showValues:X,noOfXTicks:ht,rightMargin:pt,leftMargin:R,topMargin:C,bottomMargin:B,tooltip:z,onSeriesMouseOver:T,refValues:K,minValue:J,maxValue:Q,animate:a,rtl:Z,strokeWidth:yt,showDots:D,annotations:dt,customHighlightAreaSettings:gt,regressionLine:F,showIntervalDots:ft,showIntervalValues:jt,intervalLineStrokeWidth:W,intervalLineColors:b,intervalAreaColor:wt,intervalAreaOpacity:vt,yAxisTitle:_,noOfYTicks:Rt,minDate:H,maxDate:P,curveType:L,styles:c,classNames:x,precision:N,customLayers:tt}=mt,et=d.useRef(null),l=y.useInView(et,{once:a.once,amount:a.amount}),[u,Et]=d.useState(!1);d.useEffect(()=>{if(l&&!u){const t=setTimeout(()=>{Et(!0)},(a.duration+.5)*1e3);return()=>clearTimeout(t)}},[l,u,a.duration]);const S=L==="linear"?ct.curveLinear:L==="step"?xt.curveStep:L==="stepAfter"?xt.stepAfter:L==="stepBefore"?xt.stepBefore:xt.monotoneX,[k,it]=d.useState(void 0),[nt,at]=d.useState(void 0),[U,Y]=d.useState(void 0),f={top:C,bottom:B,left:_?R+30:R,right:pt},E=d.useRef(null),n=$t.sortBy(A.filter(t=>!v.checkIfNullOrUndefined(t.y)).map(t=>({date:p.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"),Mt=h.map(t=>({...t,coordinates:[t.coordinates[0]===null?null:p.parse(`${t.coordinates[0]}`,o,new Date),t.coordinates[1]===null?null:p.parse(`${t.coordinates[1]}`,o,new Date)]})),Ct=gt.map(t=>({...t,coordinates:t.coordinates.map((g,O)=>O%2===0?p.parse(`${g}`,o,new Date):g)})),r=M-f.left-f.right,w=$-f.top-f.bottom,st=H?p.parse(`${H}`,o,new Date):n[0].date,rt=P?p.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([st,rt]).range([0,r]),s=Xt.linear().domain([m,v.checkIfNullOrUndefined(Q)?q>0?q:0:Q]).range([w,0]).nice(),At=ct.line().x(t=>i(t.date)).y(t=>s(t.y)).curve(S),It=ct.line().x(t=>i(t.date)).y(t=>s(t.yMin)).curve(S),Lt=ct.line().x(t=>i(t.date)).y(t=>s(t.yMax)).curve(S),Nt=Bt.area().x(t=>i(t.date)).y0(t=>s(t.yMin)).y1(t=>s(t.yMax)).curve(S),kt=s.ticks(Rt),St=i.ticks(ht);d.useEffect(()=>{const t=O=>{const ot=n[Kt.bisectCenter(n.map(bt=>bt.date),i.invert(Jt.pointer(O)[0]),1)];it(ot||n[n.length-1]),T?.(ot||n[n.length-1]),Y(O.clientY),at(O.clientX)},g=()=>{it(void 0),at(void 0),Y(void 0),T?.(void 0)};zt.select(E.current).on("mousemove",t).on("mouseout",g)},[i,n,T]);const qt=Dt.linearRegression(n.filter(t=>!v.checkIfNullOrUndefined(t.date)&&!v.checkIfNullOrUndefined(t.y)).map(t=>[i(t.date),s(t.y)])),Vt=Dt.linearRegressionLine(qt);return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(y.motion.svg,{width:`${M}px`,height:`${$}px`,viewBox:`0 0 ${M} ${$}`,direction:"ltr",ref:et,children:e.jsxRuntimeExports.jsxs("g",{transform:`translate(${f.left},${f.top})`,children:[e.jsxRuntimeExports.jsx(Yt.HighlightArea,{areaSettings:Mt,width:r,height:w,scale:i,animate:a,isInView:l}),e.jsxRuntimeExports.jsx(Ot.CustomArea,{areaSettings:Ct,scaleX:i,scaleY:s,animate:a,isInView:l}),e.jsxRuntimeExports.jsxs("g",{children:[e.jsxRuntimeExports.jsx(Ut.YTicksAndGridLines,{values:kt.filter(t=>t!==0),y:kt.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(Wt.Axis,{y1:s(m<0?0:m),y2:s(m<0?0:m),x1:0-R,x2:r+f.right,label:lt.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:_,rotate90:!0})]}),e.jsxRuntimeExports.jsx("g",{children:St.map((t,g)=>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:p.format(t,o)})},g))}),tt.filter(t=>t.position==="before").map(t=>t.layer),e.jsxRuntimeExports.jsx(y.motion.path,{style:{fill:wt},exit:{opacity:0,transition:{duration:a.duration}},variants:{initial:{opacity:0,d:Nt(n)||""},whileInView:{opacity:vt,d:Nt(n)||"",transition:{duration:a.duration}}},initial:"initial",animate:l?"whileInView":"initial"}),W?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(y.motion.path,{style:{stroke:b[0],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"}),e.jsxRuntimeExports.jsx(y.motion.path,{style:{stroke:b[1],fill:"none",strokeWidth:W},exit:{opacity:0,transition:{duration:a.duration}},variants:{initial:{pathLength:0,d:Lt(n)||"",opacity:1},whileInView:{pathLength:1,d:Lt(n)||"",opacity:1,transition:{duration:a.duration}}},initial:"initial",animate:l?"whileInView":"initial"})]}):null,e.jsxRuntimeExports.jsx(y.motion.path,{style:{stroke:V,fill:"none",strokeWidth:yt},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"}),k?e.jsxRuntimeExports.jsx("line",{y1:0,y2:w,x1:i(k.date),x2:i(k.date),className:G.cnExports.cn("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,g)=>e.jsxRuntimeExports.jsx(y.motion.g,{children:v.checkIfNullOrUndefined(t.y)?null:e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[D?e.jsxRuntimeExports.jsx(y.motion.circle,{r:r/n.length<5?0:r/n.length<20?2:4,style:{fill:V},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,ft?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(y.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(y.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,X?e.jsxRuntimeExports.jsx(y.motion.text,{dy:-8,style:{fill:V,textAnchor:"middle",...c?.graphObjectValues||{}},className:G.cnExports.cn("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:lt.numberFormattingFunction(t.y,"NA",N,j,I)}):null,jt?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(y.motion.text,{dy:"1em",style:{fill:b[0],textAnchor:"middle",...c?.graphObjectValues||{}},className:G.cnExports.cn("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:lt.numberFormattingFunction(t.yMin,"NA",N,j,I)}),e.jsxRuntimeExports.jsx(y.motion.text,{dy:-8,style:{fill:b[1],textAnchor:"middle",...c?.graphObjectValues||{}},className:G.cnExports.cn("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:lt.numberFormattingFunction(t.yMax,"NA",N,j,I)})]}):null]})},g))}),K?e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:K.map((t,g)=>e.jsxRuntimeExports.jsx(Ht.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},g))}):null,e.jsxRuntimeExports.jsx("g",{children:dt.map((t,g)=>{const O=Ot.getLineEndPoint({x:t.xCoordinate?i(p.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(p.parse(`${t.xCoordinate}`,o,new Date)):0,y:t.yCoordinate?s(t.yCoordinate):0},v.checkIfNullOrUndefined(t.connectorRadius)?3.5:t.connectorRadius),ot=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(p.parse(`${t.xCoordinate}`,o,new Date))+(t.xOffset||0):0+(t.xOffset||0),cy:t.yCoordinate?s(t.yCoordinate):0,cx:t.xCoordinate?i(p.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,bt={y:t.yCoordinate?s(t.yCoordinate)+(t.yOffset||0)-8:0+(t.yOffset||0)-8,x:Z?0:t.xCoordinate?i(p.parse(`${t.xCoordinate}`,o,new Date))+(t.xOffset||0):0+(t.xOffset||0),width:Z?t.xCoordinate?i(p.parse(`${t.xCoordinate}`,o,new Date))+(t.xOffset||0):0+(t.xOffset||0):r-(t.xCoordinate?i(p.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(Ot.Annotation,{color:t.color,connectorsSettings:ot,labelSettings:bt,text:t.text,classNames:t.classNames,styles:t.styles,animate:a,isInView:l},g)})}),e.jsxRuntimeExports.jsx("g",{children:F?e.jsxRuntimeExports.jsx(Pt.RegressionLine,{x1:0,x2:r,y1:Vt(0),y2:Vt(r),graphHeight:w,graphWidth:r,className:x?.regLine,style:c?.regLine,color:typeof F=="string"?F:void 0,animate:a,isInView:l}):null}),tt.filter(t=>t.position==="after").map(t=>t.layer),e.jsxRuntimeExports.jsx("rect",{ref:E,style:{fill:"none",pointerEvents:"all"},width:r,height:w})]})}),k&&z&&nt&&U?e.jsxRuntimeExports.jsx(Tt.Tooltip,{data:k,body:z,xPos:nt,yPos:U,backgroundStyle:c?.tooltip,className:x?.tooltip}):null]})}function ie(mt){const{data:A,graphTitle:M,suffix:$="",sources:V,prefix:I="",graphDescription:j,height:o,width:h,footNote:X,noOfXTicks:ht=10,dateFormat:pt="yyyy",showValues:R=!1,backgroundColor:C=!1,padding:B,lineColor:z,leftMargin:T=30,rightMargin:K=30,topMargin:J=20,bottomMargin:Q=25,tooltip:a,refValues:Z=[],highlightAreaSettings:yt=[],relativeHeight:D,onSeriesMouseOver:dt,graphID:gt,minValue:F,maxValue:ft,regressionLine:jt=!1,showIntervalDots:W=!1,showIntervalValues:b=!1,intervalLineStrokeWidth:wt=0,intervalLineColors:vt=[ut.Colors.light.grays["gray-500"],ut.Colors.light.grays["gray-500"]],intervalAreaColor:_=ut.Colors.primaryColors["blue-100"],intervalAreaOpacity:Rt=.4,graphDownload:H=!1,dataDownload:P=!1,animate:L=!1,language:c="en",minHeight:x=0,strokeWidth:N=2,showDots:tt=!0,annotations:et=[],customHighlightAreaSettings:l=[],theme:u="light",ariaLabel:Et,yAxisTitle:S,noOfYTicks:k=5,minDate:it,maxDate:nt,colorLegendTitle:at,colorLegendColors:U,colorLegendDomain:Y,curveType:f="curve",styles:E,classNames:n,precision:Mt=2,customLayers:Ct=[]}=mt,[r,w]=d.useState(0),[st,rt]=d.useState(0),m=d.useRef(null),q=d.useRef(null);return d.useEffect(()=>{const i=new ResizeObserver(s=>{w(h||s[0].target.clientWidth||620),rt(o||s[0].target.clientHeight||480)});return m.current&&(rt(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:G.cnExports.cn(`${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:gt,ref:q,"aria-label":Et||`${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?B||"1rem":B||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:at,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||st)?e.jsxRuntimeExports.jsx(ee,{data:A,lineColor:z||ut.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:st)),suffix:$,prefix:I,dateFormat:pt,showValues:R,noOfXTicks:ht,leftMargin:T,rightMargin:K,topMargin:J,bottomMargin:Q,tooltip:a,highlightAreaSettings:yt,onSeriesMouseOver:dt,refValues:Z,minValue:F,maxValue:ft,animate:L===!0?{duration:.5,once:!0,amount:.5}:L||{duration:0,once:!0,amount:0},rtl:c==="he"||c==="ar",strokeWidth:N,showDots:tt,annotations:et,customHighlightAreaSettings:l,regressionLine:jt,showIntervalDots:W,showIntervalValues:b,intervalLineStrokeWidth:wt,intervalLineColors:vt,intervalAreaColor:_,intervalAreaOpacity:Rt,yAxisTitle:S,noOfYTicks:k,minDate:it,maxDate:nt,curveType:f,styles:E,classNames:n,precision:Mt,customLayers:Ct}):null})]})}),V||X?e.jsxRuntimeExports.jsx(Qt.GraphFooter,{styles:{footnote:E?.footnote,source:E?.source},classNames:{footnote:n?.footnote,source:n?.source},sources:V,footNote:X,width:h}):null]})})})})}exports.LineChartWithConfidenceInterval=ie;
2
+ //# sourceMappingURL=LineChartWithConfidenceInterval.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LineChartWithConfidenceInterval.js","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":"kqCAiGO,SAASA,GAAMC,GAAc,CAClC,KAAM,CACJ,KAAAC,EACA,MAAAC,EACA,OAAAC,EACA,UAAAC,EACA,OAAAC,EACA,OAAAC,EACA,WAAAC,EACA,sBAAAC,EACA,WAAAC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9H,CAAA,CAAA,EAEA,IAAA,CAAA,CACN,CAAA,CAAA,CACF,CAAA,CACF,CAAA,CAGN"}
@@ -0,0 +1,13 @@
1
+ import { JSX } from 'react/jsx-runtime';
2
+
3
+ export declare function LinearColorLegend(props: Props): JSX.Element;
4
+
5
+ declare interface Props {
6
+ colors: string[];
7
+ colorDomain: number[];
8
+ colorLegendTitle?: string;
9
+ width?: number;
10
+ className?: string;
11
+ }
12
+
13
+ export { }
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-BHm2KTjD-D8FylaKc.cjs"),n=require("./Typography-CDR-DAHH.cjs"),o=require("./numberFormattingFunction.js");function x(l){const{colorLegendTitle:t,colorDomain:r,colors:s,width:i,className:a}=l;return e.jsxRuntimeExports.jsxs("div",{className:n.cnExports.cn("flex gap-0 flex-wrap justify-center leading-0",a),style:{maxWidth:i?`${i}px`:"none"},"aria-label":"Color legend",children:[t&&t!==""?e.jsxRuntimeExports.jsx(n.TypographyExports.P,{size:"sm",marginBottom:"2xs",className:"w-full text-center",children:t}):null,e.jsxRuntimeExports.jsxs("div",{className:"flex gap-0 flex-wrap justify-center w-full min-w-[360px] leading-0",children:[e.jsxRuntimeExports.jsx("div",{className:"h-4 mb-1 w-full min-w-[360px]",style:{background:`linear-gradient(90deg, ${s[0]} 0%, ${s[1]} 100%)`}}),e.jsxRuntimeExports.jsxs("div",{className:"flex justify-between w-full min-w-[360px]",children:[e.jsxRuntimeExports.jsx(n.TypographyExports.P,{marginBottom:"none",size:"sm",children:o.numberFormattingFunction(r[0],"NA",2,"","")}),e.jsxRuntimeExports.jsx(n.TypographyExports.P,{marginBottom:"none",size:"sm",children:o.numberFormattingFunction(r[1],"NA",2,"","")})]})]})]})}exports.LinearColorLegend=x;
2
+ //# sourceMappingURL=LinearColorLegend.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LinearColorLegend.js","sources":["../src/Components/Elements/LinearColorLegend.tsx"],"sourcesContent":["import { cn } from '@undp/design-system-react/cn';\r\nimport { P } from '@undp/design-system-react/Typography';\r\n\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\n\r\ninterface Props {\r\n colors: string[];\r\n colorDomain: number[];\r\n colorLegendTitle?: string;\r\n width?: number;\r\n className?: string;\r\n}\r\n\r\nexport function LinearColorLegend(props: Props) {\r\n const { colorLegendTitle, colorDomain, colors, width, className } = props;\r\n return (\r\n <div\r\n className={cn('flex gap-0 flex-wrap justify-center leading-0', className)}\r\n style={{ maxWidth: width ? `${width}px` : 'none' }}\r\n aria-label='Color legend'\r\n >\r\n {colorLegendTitle && colorLegendTitle !== '' ? (\r\n <P size='sm' marginBottom='2xs' className='w-full text-center'>\r\n {colorLegendTitle}\r\n </P>\r\n ) : null}\r\n\r\n <div className='flex gap-0 flex-wrap justify-center w-full min-w-[360px] leading-0'>\r\n <div\r\n className='h-4 mb-1 w-full min-w-[360px]'\r\n style={{ background: `linear-gradient(90deg, ${colors[0]} 0%, ${colors[1]} 100%)` }}\r\n />\r\n <div className='flex justify-between w-full min-w-[360px]'>\r\n <P marginBottom='none' size='sm'>\r\n {numberFormattingFunction(colorDomain[0], 'NA', 2, '', '')}\r\n </P>\r\n <P marginBottom='none' size='sm'>\r\n {numberFormattingFunction(colorDomain[1], 'NA', 2, '', '')}\r\n </P>\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n}\r\n"],"names":["LinearColorLegend","props","colorLegendTitle","colorDomain","colors","width","className","jsxs","cn","jsx","P","numberFormattingFunction"],"mappings":"mNAaO,SAASA,EAAkBC,EAAc,CAC9C,KAAM,CAAE,iBAAAC,EAAkB,YAAAC,EAAa,OAAAC,EAAQ,MAAAC,EAAO,UAAAC,GAAcL,EACpE,OACEM,EAAAA,kBAAAA,KAAC,MAAA,CACC,UAAWC,EAAAA,UAAAA,GAAG,gDAAiDF,CAAS,EACxE,MAAO,CAAE,SAAUD,EAAQ,GAAGA,CAAK,KAAO,MAAA,EAC1C,aAAW,eAEV,SAAA,CAAAH,GAAoBA,IAAqB,GACxCO,EAAAA,kBAAAA,IAACC,EAAAA,kBAAAA,EAAA,CAAE,KAAK,KAAK,aAAa,MAAM,UAAU,qBACvC,SAAAR,CAAA,CACH,EACE,KAEJK,EAAAA,kBAAAA,KAAC,MAAA,CAAI,UAAU,qEACb,SAAA,CAAAE,EAAAA,kBAAAA,IAAC,MAAA,CACC,UAAU,gCACV,MAAO,CAAE,WAAY,0BAA0BL,EAAO,CAAC,CAAC,QAAQA,EAAO,CAAC,CAAC,QAAA,CAAS,CAAA,EAEpFG,EAAAA,kBAAAA,KAAC,MAAA,CAAI,UAAU,4CACb,SAAA,CAAAE,EAAAA,kBAAAA,IAACC,EAAAA,kBAAAA,EAAA,CAAE,aAAa,OAAO,KAAK,KACzB,SAAAC,EAAAA,yBAAyBR,EAAY,CAAC,EAAG,KAAM,EAAG,GAAI,EAAE,EAC3D,EACAM,EAAAA,kBAAAA,IAACC,EAAAA,kBAAAA,EAAA,CAAE,aAAa,OAAO,KAAK,KACzB,SAAAC,EAAAA,yBAAyBR,EAAY,CAAC,EAAG,KAAM,EAAG,GAAI,EAAE,CAAA,CAC3D,CAAA,CAAA,CACF,CAAA,CAAA,CACF,CAAA,CAAA,CAAA,CAGN"}