@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,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("./index-BHm2KTjD-D8FylaKc.cjs"),q=require("react"),it=require("./index-CZbIGs8q.cjs"),ct=require("./index-BzeLQvXk.cjs"),Et=require("./index-C21TvELx.cjs"),Z=require("./Typography-CDR-DAHH.cjs"),Vt=require("./index-BXns0-ng.cjs"),Pt=require("./Modal-cQF2UQIa.cjs"),Lt=require("./numberFormattingFunction.js"),zt=require("./Tooltip-BM18N_3l.cjs"),It=require("./string2HTML-X4ZYX5jI.cjs"),ht=require("./use-in-view-Dl1CsAIo.cjs"),Ht=require("./index-a2C2Bqn2.cjs"),At=require("./GraphHeader.js"),Wt=require("./GraphFooter.js"),Mt=require("./Colors.js"),Ft=require("./generateRandomString-B5zBiJzS.cjs"),Gt=require("./EmptyState-BQguKAp5.cjs");function Rt(e,n){let i;if(n===void 0)for(const a of e)a!=null&&(i<a||i===void 0&&a>=a)&&(i=a);else{let a=-1;for(let l of e)(l=n(l,++a,e))!=null&&(i<l||i===void 0&&l>=l)&&(i=l)}return i}function Ot(e,n){let i;if(n===void 0)for(const a of e)a!=null&&(i>a||i===void 0&&a>=a)&&(i=a);else{let a=-1;for(let l of e)(l=n(l,++a,e))!=null&&(i>l||i===void 0&&l>=l)&&(i=l)}return i}function xt(e,n){let i=0;if(n===void 0)for(let a of e)(a=+a)&&(i+=a);else{let a=-1;for(let l of e)(l=+n(l,++a,e))&&(i+=l)}return i}function Xt(e){return e.target.depth}function Yt(e,n){return e.sourceLinks.length?e.depth:n-1}function mt(e){return e.targetLinks.length?e.depth:e.sourceLinks.length?Ot(e.sourceLinks,Xt)-1:0}function ft(e){return function(){return e}}function St(e,n){return gt(e.source,n.source)||e.index-n.index}function _t(e,n){return gt(e.target,n.target)||e.index-n.index}function gt(e,n){return e.y0-n.y0}function yt(e){return e.value}function Ut(e){return e.index}function Zt(e){return e.nodes}function Kt(e){return e.links}function Nt(e,n){const i=e.get(n);if(!i)throw new Error("missing: "+n);return i}function Tt({nodes:e}){for(const n of e){let i=n.y0,a=i;for(const l of n.sourceLinks)l.y0=i+l.width/2,i+=l.width;for(const l of n.targetLinks)l.y1=a+l.width/2,a+=l.width}}function jt(){let e=0,n=0,i=1,a=1,l=24,m=8,g,p=Ut,j=Yt,w,v,b=Zt,$=Kt,R=6;function d(){const t={nodes:b.apply(null,arguments),links:$.apply(null,arguments)};return S(t),L(t),B(t),X(t),A(t),Tt(t),t}d.update=function(t){return Tt(t),t},d.nodeId=function(t){return arguments.length?(p=typeof t=="function"?t:ft(t),d):p},d.nodeAlign=function(t){return arguments.length?(j=typeof t=="function"?t:ft(t),d):j},d.nodeSort=function(t){return arguments.length?(w=t,d):w},d.nodeWidth=function(t){return arguments.length?(l=+t,d):l},d.nodePadding=function(t){return arguments.length?(m=g=+t,d):m},d.nodes=function(t){return arguments.length?(b=typeof t=="function"?t:ft(t),d):b},d.links=function(t){return arguments.length?($=typeof t=="function"?t:ft(t),d):$},d.linkSort=function(t){return arguments.length?(v=t,d):v},d.size=function(t){return arguments.length?(e=n=0,i=+t[0],a=+t[1],d):[i-e,a-n]},d.extent=function(t){return arguments.length?(e=+t[0][0],i=+t[1][0],n=+t[0][1],a=+t[1][1],d):[[e,n],[i,a]]},d.iterations=function(t){return arguments.length?(R=+t,d):R};function S({nodes:t,links:u}){for(const[c,r]of t.entries())r.index=c,r.sourceLinks=[],r.targetLinks=[];const s=new Map(t.map((c,r)=>[p(c,r,t),c]));for(const[c,r]of u.entries()){r.index=c;let{source:h,target:x}=r;typeof h!="object"&&(h=r.source=Nt(s,h)),typeof x!="object"&&(x=r.target=Nt(s,x)),h.sourceLinks.push(r),x.targetLinks.push(r)}if(v!=null)for(const{sourceLinks:c,targetLinks:r}of t)c.sort(v),r.sort(v)}function L({nodes:t}){for(const u of t)u.value=u.fixedValue===void 0?Math.max(xt(u.sourceLinks,yt),xt(u.targetLinks,yt)):u.fixedValue}function B({nodes:t}){const u=t.length;let s=new Set(t),c=new Set,r=0;for(;s.size;){for(const h of s){h.depth=r;for(const{target:x}of h.sourceLinks)c.add(x)}if(++r>u)throw new Error("circular link");s=c,c=new Set}}function X({nodes:t}){const u=t.length;let s=new Set(t),c=new Set,r=0;for(;s.size;){for(const h of s){h.height=r;for(const{source:x}of h.targetLinks)c.add(x)}if(++r>u)throw new Error("circular link");s=c,c=new Set}}function D({nodes:t}){const u=Rt(t,r=>r.depth)+1,s=(i-e-l)/(u-1),c=new Array(u);for(const r of t){const h=Math.max(0,Math.min(u-1,Math.floor(j.call(null,r,u))));r.layer=h,r.x0=e+h*s,r.x1=r.x0+l,c[h]?c[h].push(r):c[h]=[r]}if(w)for(const r of c)r.sort(w);return c}function _(t){const u=Ot(t,s=>(a-n-(s.length-1)*g)/xt(s,yt));for(const s of t){let c=n;for(const r of s){r.y0=c,r.y1=c+r.value*u,c=r.y1+g;for(const h of r.sourceLinks)h.width=h.value*u}c=(a-c+g)/(s.length+1);for(let r=0;r<s.length;++r){const h=s[r];h.y0+=c*(r+1),h.y1+=c*(r+1)}P(s)}}function A(t){const u=D(t);g=Math.min(m,(a-n)/(Rt(u,s=>s.length)-1)),_(u);for(let s=0;s<R;++s){const c=Math.pow(.99,s),r=Math.max(1-c,(s+1)/R);et(u,c,r),tt(u,c,r)}}function tt(t,u,s){for(let c=1,r=t.length;c<r;++c){const h=t[c];for(const x of h){let N=0,T=0;for(const{source:I,value:O}of x.targetLinks){let H=O*(x.layer-I.layer);N+=U(I,x)*H,T+=H}if(!(T>0))continue;let W=(N/T-x.y0)*u;x.y0+=W,x.y1+=W,C(x)}w===void 0&&h.sort(gt),V(h,s)}}function et(t,u,s){for(let c=t.length,r=c-2;r>=0;--r){const h=t[r];for(const x of h){let N=0,T=0;for(const{target:I,value:O}of x.sourceLinks){let H=O*(I.layer-x.layer);N+=ot(x,I)*H,T+=H}if(!(T>0))continue;let W=(N/T-x.y0)*u;x.y0+=W,x.y1+=W,C(x)}w===void 0&&h.sort(gt),V(h,s)}}function V(t,u){const s=t.length>>1,c=t[s];nt(t,c.y0-g,s-1,u),Y(t,c.y1+g,s+1,u),nt(t,a,t.length-1,u),Y(t,n,0,u)}function Y(t,u,s,c){for(;s<t.length;++s){const r=t[s],h=(u-r.y0)*c;h>1e-6&&(r.y0+=h,r.y1+=h),u=r.y1+g}}function nt(t,u,s,c){for(;s>=0;--s){const r=t[s],h=(r.y1-u)*c;h>1e-6&&(r.y0-=h,r.y1-=h),u=r.y0-g}}function C({sourceLinks:t,targetLinks:u}){if(v===void 0){for(const{source:{sourceLinks:s}}of u)s.sort(_t);for(const{target:{targetLinks:s}}of t)s.sort(St)}}function P(t){if(v===void 0)for(const{sourceLinks:u,targetLinks:s}of t)u.sort(_t),s.sort(St)}function U(t,u){let s=t.y0-(t.sourceLinks.length-1)*g/2;for(const{target:c,width:r}of t.sourceLinks){if(c===u)break;s+=r+g}for(const{source:c,width:r}of u.targetLinks){if(c===t)break;s-=r}return s}function ot(t,u){let s=u.y0-(u.targetLinks.length-1)*g/2;for(const{source:c,width:r}of u.targetLinks){if(c===t)break;s+=r+g}for(const{target:c,width:r}of t.sourceLinks){if(c===u)break;s-=r}return s}return d}var vt=Math.PI,kt=2*vt,J=1e-6,Qt=kt-J;function wt(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function qt(){return new wt}wt.prototype=qt.prototype={constructor:wt,moveTo:function(e,n){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+n)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(e,n){this._+="L"+(this._x1=+e)+","+(this._y1=+n)},quadraticCurveTo:function(e,n,i,a){this._+="Q"+ +e+","+ +n+","+(this._x1=+i)+","+(this._y1=+a)},bezierCurveTo:function(e,n,i,a,l,m){this._+="C"+ +e+","+ +n+","+ +i+","+ +a+","+(this._x1=+l)+","+(this._y1=+m)},arcTo:function(e,n,i,a,l){e=+e,n=+n,i=+i,a=+a,l=+l;var m=this._x1,g=this._y1,p=i-e,j=a-n,w=m-e,v=g-n,b=w*w+v*v;if(l<0)throw new Error("negative radius: "+l);if(this._x1===null)this._+="M"+(this._x1=e)+","+(this._y1=n);else if(b>J)if(!(Math.abs(v*p-j*w)>J)||!l)this._+="L"+(this._x1=e)+","+(this._y1=n);else{var $=i-m,R=a-g,d=p*p+j*j,S=$*$+R*R,L=Math.sqrt(d),B=Math.sqrt(b),X=l*Math.tan((vt-Math.acos((d+b-S)/(2*L*B)))/2),D=X/B,_=X/L;Math.abs(D-1)>J&&(this._+="L"+(e+D*w)+","+(n+D*v)),this._+="A"+l+","+l+",0,0,"+ +(v*$>w*R)+","+(this._x1=e+_*p)+","+(this._y1=n+_*j)}},arc:function(e,n,i,a,l,m){e=+e,n=+n,i=+i,m=!!m;var g=i*Math.cos(a),p=i*Math.sin(a),j=e+g,w=n+p,v=1^m,b=m?a-l:l-a;if(i<0)throw new Error("negative radius: "+i);this._x1===null?this._+="M"+j+","+w:(Math.abs(this._x1-j)>J||Math.abs(this._y1-w)>J)&&(this._+="L"+j+","+w),i&&(b<0&&(b=b%kt+kt),b>Qt?this._+="A"+i+","+i+",0,1,"+v+","+(e-g)+","+(n-p)+"A"+i+","+i+",0,1,"+v+","+(this._x1=j)+","+(this._y1=w):b>J&&(this._+="A"+i+","+i+",0,"+ +(b>=vt)+","+v+","+(this._x1=e+i*Math.cos(l))+","+(this._y1=n+i*Math.sin(l))))},rect:function(e,n,i,a){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+n)+"h"+ +i+"v"+ +a+"h"+-i+"Z"},toString:function(){return this._}};function Ct(e){return function(){return e}}function Jt(e){return e[0]}function te(e){return e[1]}var ee=Array.prototype.slice;function ne(e){return e.source}function oe(e){return e.target}function ie(e){var n=ne,i=oe,a=Jt,l=te,m=null;function g(){var p,j=ee.call(arguments),w=n.apply(this,j),v=i.apply(this,j);if(m||(m=p=qt()),e(m,+a.apply(this,(j[0]=w,j)),+l.apply(this,j),+a.apply(this,(j[0]=v,j)),+l.apply(this,j)),p)return m=null,p+""||null}return g.source=function(p){return arguments.length?(n=p,g):n},g.target=function(p){return arguments.length?(i=p,g):i},g.x=function(p){return arguments.length?(a=typeof p=="function"?p:Ct(+p),g):a},g.y=function(p){return arguments.length?(l=typeof p=="function"?p:Ct(+p),g):l},g.context=function(p){return arguments.length?(m=p??null,g):m},g}function re(e,n,i,a,l){e.moveTo(n,i),e.bezierCurveTo(n=(n+a)/2,i,n,l,a,l)}function se(){return ie(re)}function ae(e){return[e.source.x1,e.y0]}function le(e){return[e.target.x0,e.y1]}function ue(){return se().source(ae).target(le)}function ce(e){const{data:n,showLabels:i,leftMargin:a,rightMargin:l,truncateBy:m,width:g,height:p,topMargin:j,bottomMargin:w,tooltip:v,onSeriesMouseOver:b,suffix:$,prefix:R,showValues:d,onSeriesMouseClick:S,nodePadding:L,nodeWidth:B,id:X,highlightedSourceDataPoints:D,highlightedTargetDataPoints:_,defaultLinkOpacity:A,sourceTitle:tt,targetTitle:et,animate:V,sortNodes:Y,resetSelectionOnDoubleClick:nt,detailsOnClick:C,styles:P,classNames:U,precision:ot,customLayers:t}=e,u=q.useRef(null),s=ht.useInView(u,{once:V.once,amount:V.amount}),[c,r]=q.useState(void 0),[h,x]=q.useState(void 0),[N,T]=q.useState(void 0),[W,I]=q.useState(void 0),[O,H]=q.useState(void 0),z={top:j,bottom:w,left:a,right:l},F=g-z.left-z.right,G=p-z.top-z.bottom,st=Y==="mostReadable"?jt().nodeWidth(B).nodePadding(L).size([F,G]).nodeAlign(mt):Y==="none"?jt().nodeWidth(B).nodePadding(L).size([F,G]).nodeAlign(mt).nodeSort(()=>null).linkSort(()=>null):jt().nodeWidth(B).nodePadding(L).size([F,G]).nodeAlign(mt).nodeSort(Y==="desc"?(o,M)=>(M.value||0)-(o.value||0):(o,M)=>(o.value||0)-(M.value||0)),{nodes:at,links:lt}=st(n),Q=ue();return f.jsxRuntimeExports.jsxs(f.jsxRuntimeExports.Fragment,{children:[f.jsxRuntimeExports.jsxs(ht.motion.svg,{width:`${g}px`,height:`${p}px`,viewBox:`0 0 ${g} ${p}`,style:{marginLeft:"auto",marginRight:"auto"},direction:"ltr",ref:u,children:[tt?f.jsxRuntimeExports.jsx("text",{x:z.left,y:z.top-10,className:"text-base font-bold fill-primary-gray-700 dark:fill-primary-gray-100",style:{textAnchor:"start"},children:tt}):null,et?f.jsxRuntimeExports.jsx("text",{x:g-z.right,y:z.top-10,className:"text-base font-bold fill-primary-gray-700 dark:fill-primary-gray-100",style:{textAnchor:"end"},children:et}):null,f.jsxRuntimeExports.jsxs("g",{transform:`translate(${z.left},${z.top})`,children:[t.filter(o=>o.position==="before").map(o=>o.layer),at.filter(o=>o.type==="source").map((o,M)=>f.jsxRuntimeExports.jsx("g",{onMouseEnter:()=>{T(o)},onMouseLeave:()=>{T(void 0)},children:f.jsxRuntimeExports.jsxs("g",{transform:`translate(${o.x0},${o.y0})`,children:[f.jsxRuntimeExports.jsx("rect",{x:0,y:0,width:(o.x1||0)-(o.x0||0),height:(o.y1||0)-(o.y0||0),style:{fill:o.color}}),i||d?f.jsxRuntimeExports.jsx("foreignObject",{y:0-L/2,x:0-a,width:a,height:(o.y1||0)-(o.y0||0)+L,children:f.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-0.5 justify-center py-0 px-1.5",style:{height:`${(o.y1||0)-(o.y0||0)+L}px`,overflow:"visible"},children:[i?f.jsxRuntimeExports.jsx(Z.TypographyExports.P,{marginBottom:d?"3xs":"none",size:"sm",leading:"none",className:Z.cnExports.cn("sankey-right-label text-right",U?.graphObjectValues),style:{hyphens:"auto",color:o.color,...P?.graphObjectValues},children:`${o.label}`.length<m?`${o.label}`:`${`${o.label}`.substring(0,m)}...`}):null,d?f.jsxRuntimeExports.jsx(Z.TypographyExports.P,{marginBottom:"none",size:"sm",leading:"none",className:Z.cnExports.cn("sankey-right-value text-right font-bold",U?.graphObjectValues),style:{hyphens:"auto",color:o.color,...P?.graphObjectValues},children:Lt.numberFormattingFunction(o.value,"NA",ot,R,$)}):null]})}):null]})},M)),at.filter(o=>o.type==="target").map((o,M)=>f.jsxRuntimeExports.jsx("g",{onMouseEnter:()=>{T(o)},onMouseLeave:()=>{T(void 0)},children:f.jsxRuntimeExports.jsxs("g",{transform:`translate(${o.x0},${o.y0})`,children:[f.jsxRuntimeExports.jsx("rect",{x:0,y:0,width:(o.x1||0)-(o.x0||0),height:(o.y1||0)-(o.y0||0),style:{fill:o.color}}),i||d?f.jsxRuntimeExports.jsx("foreignObject",{y:0-L/2,x:B,width:l-B,height:(o.y1||0)-(o.y0||0)+L,children:f.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-0.5 justify-center py-0 px-1.5",style:{height:`${(o.y1||0)-(o.y0||0)+L}px`},children:[i?f.jsxRuntimeExports.jsx(Z.TypographyExports.P,{marginBottom:d?"3xs":"none",size:"sm",leading:"none",className:Z.cnExports.cn("sankey-left-label text-left",U?.graphObjectValues),style:{hyphens:"auto",color:o.color,...P?.graphObjectValues},children:`${o.label}`.length<m?`${o.label}`:`${`${o.label}`.substring(0,m)}...`}):null,d?f.jsxRuntimeExports.jsx(Z.TypographyExports.P,{size:"sm",leading:"none",marginBottom:"none",className:Z.cnExports.cn("sankey-left-value text-left font-bold",U?.graphObjectValues),style:{hyphens:"auto",color:o.color,...P?.graphObjectValues},children:Lt.numberFormattingFunction(o.value,"NA",ot,R,$)}):null]})}):null]})},M)),f.jsxRuntimeExports.jsx("defs",{children:lt.map((o,M)=>f.jsxRuntimeExports.jsxs("linearGradient",{id:`${X}-gradient-${M}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%",gradientUnits:"userSpaceOnUse",children:[f.jsxRuntimeExports.jsx("stop",{offset:"0%",style:{stopColor:o.source.color,stopOpacity:1}}),f.jsxRuntimeExports.jsx("stop",{offset:"100%",style:{stopColor:o.target.color,stopOpacity:1}})]},M))}),f.jsxRuntimeExports.jsx("g",{children:f.jsxRuntimeExports.jsx(Ht.AnimatePresence,{children:lt.map((o,M)=>f.jsxRuntimeExports.jsx(ht.motion.g,{className:"undp-viz-g-with-hover",onMouseEnter:K=>{r(o.data),H(K.clientY),I(K.clientX),b?.(o)},onMouseMove:K=>{r(o.data),H(K.clientY),I(K.clientX)},onClick:()=>{(S||C)&&(Vt.isEqual(h,o.data)&&nt?(x(void 0),S?.(void 0)):(x(o.data),S?.(o.data)))},onMouseLeave:()=>{r(void 0),I(void 0),H(void 0),b?.(void 0)},variants:{initial:{opacity:N?o.source.name===N.name||o.target.name===N.name?.85:A:(D.length!==0||_.length!==0)&&(D.indexOf(o.source.label)!==-1||_.indexOf(o.target.label)!==-1)?.85:A},whileInView:{opacity:N?o.source.name===N.name||o.target.name===N.name?.85:A:(D.length!==0||_.length!==0)&&(D.indexOf(o.source.label)!==-1||_.indexOf(o.target.label)!==-1)?.85:A,transition:{duration:V.duration}}},initial:"initial",animate:s?"whileInView":"initial",exit:{opacity:0,transition:{duration:V.duration}},children:f.jsxRuntimeExports.jsx(ht.motion.path,{d:Q(o)||"",style:{stroke:`url(#${X}-gradient-${M})`,strokeWidth:o.width,fill:"none"},exit:{opacity:0,transition:{duration:V.duration}},variants:{initial:{pathLength:0,opacity:1},whileInView:{pathLength:1,opacity:1,transition:{duration:V.duration}}},initial:"initial",animate:s?"whileInView":"initial"},`${o.source}-${o.target}`)},`${o.source}-${o.target}`))})}),t.filter(o=>o.position==="after").map(o=>o.layer)]})]}),c&&v&&W&&O?f.jsxRuntimeExports.jsx(zt.Tooltip,{data:c,body:v,xPos:W,yPos:O,backgroundStyle:P?.tooltip,className:U?.tooltip}):null,C&&h!==void 0?f.jsxRuntimeExports.jsx(Pt.ModalExports.Modal,{open:h!==void 0,onClose:()=>{x(void 0)},children:f.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof C=="string"?{__html:It.string2HTML(C,h)}:void 0,children:typeof C=="function"?C(h):null})}):null]})}function he(e){const{data:n,graphTitle:i,sources:a,graphDescription:l,showLabels:m=!0,leftMargin:g=75,rightMargin:p=75,topMargin:j=30,bottomMargin:w=10,truncateBy:v=999,height:b,width:$,footNote:R,padding:d,backgroundColor:S,tooltip:L,onSeriesMouseOver:B,suffix:X="",prefix:D="",relativeHeight:_,showValues:A=!0,graphID:tt,onSeriesMouseClick:et,graphDownload:V=!1,dataDownload:Y=!1,fillContainer:nt=!0,language:C="en",minHeight:P=0,theme:U="light",ariaLabel:ot,sourceColors:t,targetColors:u,sourceColorDomain:s,targetColorDomain:c,nodePadding:r=5,nodeWidth:h=5,highlightedSourceDataPoints:x=[],highlightedTargetDataPoints:N=[],defaultLinkOpacity:T=.3,sourceTitle:W,targetTitle:I,sortNodes:O="mostReadable",resetSelectionOnDoubleClick:H=!0,detailsOnClick:z,styles:F,classNames:G,animate:st=!1,precision:at=2,customLayers:lt=[]}=e,[Q,o]=q.useState(0),[M,K]=q.useState(0),[bt,Bt]=q.useState(void 0),rt=q.useRef(null),$t=q.useRef(null);return q.useEffect(()=>{const E=it.uniqBy(n,"source").map(k=>({name:`source_${k.source}`,type:"source",label:`${k.source}`,color:typeof t=="string"||!t?t||Mt.Colors.graphMainColor:t[(s||it.uniqBy(n,"source").map(y=>`${y.source}`)).findIndex(y=>`${y}`==`${k.source}`)>t.length?t.length-1:(s||it.uniqBy(n,"source").map(y=>`${y.source}`)).findIndex(y=>`${y}`==`${k.source}`)],totalValue:Et.sum(n.filter(y=>`${y.source}`==`${k.source}`).map(y=>y.value))})),ut=O==="asc"?ct.sortBy(E,k=>k.totalValue):O==="desc"?ct.sortBy(E,k=>k.totalValue).reverse():E,dt=it.uniqBy(n,"target").map(k=>({name:`target_${k.target}`,type:"target",label:`${k.target}`,color:typeof u=="string"||!u?u||Mt.Colors.graphMainColor:u[(c||it.uniqBy(n,"target").map(y=>`${y.target}`)).findIndex(y=>`${y}`==`${k.target}`)>u.length?u.length-1:(c||it.uniqBy(n,"target").map(y=>`${y.target}`)).findIndex(y=>`${y}`==`${k.target}`)],totalValue:Et.sum(n.filter(y=>`${y.target}`==`${k.target}`).map(y=>y.value))})),Dt=O==="asc"?ct.sortBy(dt,k=>k.totalValue):O==="desc"?ct.sortBy(dt,k=>k.totalValue).reverse():dt,pt=[...ut,...Dt];Bt({nodes:pt,links:n.map(k=>({source:pt.findIndex(y=>y.name===`source_${k.source}`),target:pt.findIndex(y=>y.name===`target_${k.target}`),value:k.value,data:{...k}}))})},[n,O,s,t,c,u]),q.useEffect(()=>{const E=new ResizeObserver(ut=>{o($||ut[0].target.clientWidth||620),K(b||ut[0].target.clientHeight||480)});return rt.current&&(K(rt.current.clientHeight||480),o(rt.current.clientWidth||620),$||E.observe(rt.current)),()=>E.disconnect()},[$,b]),f.jsxRuntimeExports.jsx("div",{className:`${U||"light"} flex ${$?"grow-0":"grow"} ${nt?"w-full":"w-fit"} `,dir:C==="he"||C==="ar"?"rtl":void 0,children:f.jsxRuntimeExports.jsx("div",{className:Z.cnExports.cn(`${S?S===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${C||"en"}`,G?.graphContainer),style:{...F?.graphContainer||{},...S&&S!==!0?{backgroundColor:S}:{}},id:tt,ref:$t,"aria-label":ot||`${i?`The graph shows ${i}. `:""}This is a sankey chart showing flow. ${l?` ${l}`:""}`,children:f.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:S?d||"1rem":d||0},children:f.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-4 w-full grow justify-between",children:[i||l||V||Y?f.jsxRuntimeExports.jsx(At.GraphHeader,{styles:{title:F?.title,description:F?.description},classNames:{title:G?.title,description:G?.description},graphTitle:i,graphDescription:l,width:$,graphDownload:V?$t.current:void 0,dataDownload:Y?n.map(E=>E.data).filter(E=>E!==void 0).length>0?n.map(E=>E.data).filter(E=>E!==void 0):n.filter(E=>E!==void 0):null}):null,f.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:n.length===0?f.jsxRuntimeExports.jsx(Gt.EmptyState,{}):f.jsxRuntimeExports.jsx("div",{className:"flex flex-col grow justify-center gap-3 w-full leading-0",ref:rt,"aria-label":"Graph area",children:($||Q)&&(b||M)&&bt?f.jsxRuntimeExports.jsx(ce,{data:bt,width:$||Q,nodePadding:r,nodeWidth:h,height:Math.max(P,b||(_?P?($||Q)*_>P?($||Q)*_:P:($||Q)*_:M)),showLabels:m,leftMargin:g,rightMargin:p,topMargin:j,bottomMargin:w,truncateBy:v,tooltip:L,onSeriesMouseOver:B,showValues:A,suffix:X,prefix:D,onSeriesMouseClick:et,id:Ft.generateRandomString(8),highlightedSourceDataPoints:x.map(E=>`${E}`),highlightedTargetDataPoints:N.map(E=>`${E}`),defaultLinkOpacity:T,sourceTitle:W,targetTitle:I,sortNodes:O,resetSelectionOnDoubleClick:H,styles:F,classNames:G,detailsOnClick:z,animate:st===!0?{duration:.5,once:!0,amount:.5}:st||{duration:0,once:!0,amount:0},precision:at,customLayers:lt}):null})}),a||R?f.jsxRuntimeExports.jsx(Wt.GraphFooter,{styles:{footnote:F?.footnote,source:F?.source},classNames:{footnote:G?.footnote,source:G?.source},sources:a,footNote:R,width:$}):null]})})})})}exports.SankeyChart=he;
2
+ //# sourceMappingURL=SankeyChart.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SankeyChart.js","sources":["../node_modules/d3-sankey/node_modules/d3-array/src/max.js","../node_modules/d3-sankey/node_modules/d3-array/src/min.js","../node_modules/d3-sankey/node_modules/d3-array/src/sum.js","../node_modules/d3-sankey/src/align.js","../node_modules/d3-sankey/src/constant.js","../node_modules/d3-sankey/src/sankey.js","../node_modules/d3-sankey/node_modules/d3-path/src/path.js","../node_modules/d3-sankey/node_modules/d3-shape/src/constant.js","../node_modules/d3-sankey/node_modules/d3-shape/src/point.js","../node_modules/d3-sankey/node_modules/d3-shape/src/array.js","../node_modules/d3-sankey/node_modules/d3-shape/src/link/index.js","../node_modules/d3-sankey/src/sankeyLinkHorizontal.js","../src/Components/Graphs/SankeyChart/Graph.tsx","../src/Components/Graphs/SankeyChart/index.tsx"],"sourcesContent":["export default function max(values, valueof) {\n let max;\n if (valueof === undefined) {\n for (const value of values) {\n if (value != null\n && (max < value || (max === undefined && value >= value))) {\n max = value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null\n && (max < value || (max === undefined && value >= value))) {\n max = value;\n }\n }\n }\n return max;\n}\n","export default function min(values, valueof) {\n let min;\n if (valueof === undefined) {\n for (const value of values) {\n if (value != null\n && (min > value || (min === undefined && value >= value))) {\n min = value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null\n && (min > value || (min === undefined && value >= value))) {\n min = value;\n }\n }\n }\n return min;\n}\n","export default function sum(values, valueof) {\n let sum = 0;\n if (valueof === undefined) {\n for (let value of values) {\n if (value = +value) {\n sum += value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if (value = +valueof(value, ++index, values)) {\n sum += value;\n }\n }\n }\n return sum;\n}\n","import {min} from \"d3-array\";\n\nfunction targetDepth(d) {\n return d.target.depth;\n}\n\nexport function left(node) {\n return node.depth;\n}\n\nexport function right(node, n) {\n return n - 1 - node.height;\n}\n\nexport function justify(node, n) {\n return node.sourceLinks.length ? node.depth : n - 1;\n}\n\nexport function center(node) {\n return node.targetLinks.length ? node.depth\n : node.sourceLinks.length ? min(node.sourceLinks, targetDepth) - 1\n : 0;\n}\n","export default function constant(x) {\n return function() {\n return x;\n };\n}\n","import {max, min, sum} from \"d3-array\";\nimport {justify} from \"./align.js\";\nimport constant from \"./constant.js\";\n\nfunction ascendingSourceBreadth(a, b) {\n return ascendingBreadth(a.source, b.source) || a.index - b.index;\n}\n\nfunction ascendingTargetBreadth(a, b) {\n return ascendingBreadth(a.target, b.target) || a.index - b.index;\n}\n\nfunction ascendingBreadth(a, b) {\n return a.y0 - b.y0;\n}\n\nfunction value(d) {\n return d.value;\n}\n\nfunction defaultId(d) {\n return d.index;\n}\n\nfunction defaultNodes(graph) {\n return graph.nodes;\n}\n\nfunction defaultLinks(graph) {\n return graph.links;\n}\n\nfunction find(nodeById, id) {\n const node = nodeById.get(id);\n if (!node) throw new Error(\"missing: \" + id);\n return node;\n}\n\nfunction computeLinkBreadths({nodes}) {\n for (const node of nodes) {\n let y0 = node.y0;\n let y1 = y0;\n for (const link of node.sourceLinks) {\n link.y0 = y0 + link.width / 2;\n y0 += link.width;\n }\n for (const link of node.targetLinks) {\n link.y1 = y1 + link.width / 2;\n y1 += link.width;\n }\n }\n}\n\nexport default function Sankey() {\n let x0 = 0, y0 = 0, x1 = 1, y1 = 1; // extent\n let dx = 24; // nodeWidth\n let dy = 8, py; // nodePadding\n let id = defaultId;\n let align = justify;\n let sort;\n let linkSort;\n let nodes = defaultNodes;\n let links = defaultLinks;\n let iterations = 6;\n\n function sankey() {\n const graph = {nodes: nodes.apply(null, arguments), links: links.apply(null, arguments)};\n computeNodeLinks(graph);\n computeNodeValues(graph);\n computeNodeDepths(graph);\n computeNodeHeights(graph);\n computeNodeBreadths(graph);\n computeLinkBreadths(graph);\n return graph;\n }\n\n sankey.update = function(graph) {\n computeLinkBreadths(graph);\n return graph;\n };\n\n sankey.nodeId = function(_) {\n return arguments.length ? (id = typeof _ === \"function\" ? _ : constant(_), sankey) : id;\n };\n\n sankey.nodeAlign = function(_) {\n return arguments.length ? (align = typeof _ === \"function\" ? _ : constant(_), sankey) : align;\n };\n\n sankey.nodeSort = function(_) {\n return arguments.length ? (sort = _, sankey) : sort;\n };\n\n sankey.nodeWidth = function(_) {\n return arguments.length ? (dx = +_, sankey) : dx;\n };\n\n sankey.nodePadding = function(_) {\n return arguments.length ? (dy = py = +_, sankey) : dy;\n };\n\n sankey.nodes = function(_) {\n return arguments.length ? (nodes = typeof _ === \"function\" ? _ : constant(_), sankey) : nodes;\n };\n\n sankey.links = function(_) {\n return arguments.length ? (links = typeof _ === \"function\" ? _ : constant(_), sankey) : links;\n };\n\n sankey.linkSort = function(_) {\n return arguments.length ? (linkSort = _, sankey) : linkSort;\n };\n\n sankey.size = function(_) {\n return arguments.length ? (x0 = y0 = 0, x1 = +_[0], y1 = +_[1], sankey) : [x1 - x0, y1 - y0];\n };\n\n sankey.extent = function(_) {\n return arguments.length ? (x0 = +_[0][0], x1 = +_[1][0], y0 = +_[0][1], y1 = +_[1][1], sankey) : [[x0, y0], [x1, y1]];\n };\n\n sankey.iterations = function(_) {\n return arguments.length ? (iterations = +_, sankey) : iterations;\n };\n\n function computeNodeLinks({nodes, links}) {\n for (const [i, node] of nodes.entries()) {\n node.index = i;\n node.sourceLinks = [];\n node.targetLinks = [];\n }\n const nodeById = new Map(nodes.map((d, i) => [id(d, i, nodes), d]));\n for (const [i, link] of links.entries()) {\n link.index = i;\n let {source, target} = link;\n if (typeof source !== \"object\") source = link.source = find(nodeById, source);\n if (typeof target !== \"object\") target = link.target = find(nodeById, target);\n source.sourceLinks.push(link);\n target.targetLinks.push(link);\n }\n if (linkSort != null) {\n for (const {sourceLinks, targetLinks} of nodes) {\n sourceLinks.sort(linkSort);\n targetLinks.sort(linkSort);\n }\n }\n }\n\n function computeNodeValues({nodes}) {\n for (const node of nodes) {\n node.value = node.fixedValue === undefined\n ? Math.max(sum(node.sourceLinks, value), sum(node.targetLinks, value))\n : node.fixedValue;\n }\n }\n\n function computeNodeDepths({nodes}) {\n const n = nodes.length;\n let current = new Set(nodes);\n let next = new Set;\n let x = 0;\n while (current.size) {\n for (const node of current) {\n node.depth = x;\n for (const {target} of node.sourceLinks) {\n next.add(target);\n }\n }\n if (++x > n) throw new Error(\"circular link\");\n current = next;\n next = new Set;\n }\n }\n\n function computeNodeHeights({nodes}) {\n const n = nodes.length;\n let current = new Set(nodes);\n let next = new Set;\n let x = 0;\n while (current.size) {\n for (const node of current) {\n node.height = x;\n for (const {source} of node.targetLinks) {\n next.add(source);\n }\n }\n if (++x > n) throw new Error(\"circular link\");\n current = next;\n next = new Set;\n }\n }\n\n function computeNodeLayers({nodes}) {\n const x = max(nodes, d => d.depth) + 1;\n const kx = (x1 - x0 - dx) / (x - 1);\n const columns = new Array(x);\n for (const node of nodes) {\n const i = Math.max(0, Math.min(x - 1, Math.floor(align.call(null, node, x))));\n node.layer = i;\n node.x0 = x0 + i * kx;\n node.x1 = node.x0 + dx;\n if (columns[i]) columns[i].push(node);\n else columns[i] = [node];\n }\n if (sort) for (const column of columns) {\n column.sort(sort);\n }\n return columns;\n }\n\n function initializeNodeBreadths(columns) {\n const ky = min(columns, c => (y1 - y0 - (c.length - 1) * py) / sum(c, value));\n for (const nodes of columns) {\n let y = y0;\n for (const node of nodes) {\n node.y0 = y;\n node.y1 = y + node.value * ky;\n y = node.y1 + py;\n for (const link of node.sourceLinks) {\n link.width = link.value * ky;\n }\n }\n y = (y1 - y + py) / (nodes.length + 1);\n for (let i = 0; i < nodes.length; ++i) {\n const node = nodes[i];\n node.y0 += y * (i + 1);\n node.y1 += y * (i + 1);\n }\n reorderLinks(nodes);\n }\n }\n\n function computeNodeBreadths(graph) {\n const columns = computeNodeLayers(graph);\n py = Math.min(dy, (y1 - y0) / (max(columns, c => c.length) - 1));\n initializeNodeBreadths(columns);\n for (let i = 0; i < iterations; ++i) {\n const alpha = Math.pow(0.99, i);\n const beta = Math.max(1 - alpha, (i + 1) / iterations);\n relaxRightToLeft(columns, alpha, beta);\n relaxLeftToRight(columns, alpha, beta);\n }\n }\n\n // Reposition each node based on its incoming (target) links.\n function relaxLeftToRight(columns, alpha, beta) {\n for (let i = 1, n = columns.length; i < n; ++i) {\n const column = columns[i];\n for (const target of column) {\n let y = 0;\n let w = 0;\n for (const {source, value} of target.targetLinks) {\n let v = value * (target.layer - source.layer);\n y += targetTop(source, target) * v;\n w += v;\n }\n if (!(w > 0)) continue;\n let dy = (y / w - target.y0) * alpha;\n target.y0 += dy;\n target.y1 += dy;\n reorderNodeLinks(target);\n }\n if (sort === undefined) column.sort(ascendingBreadth);\n resolveCollisions(column, beta);\n }\n }\n\n // Reposition each node based on its outgoing (source) links.\n function relaxRightToLeft(columns, alpha, beta) {\n for (let n = columns.length, i = n - 2; i >= 0; --i) {\n const column = columns[i];\n for (const source of column) {\n let y = 0;\n let w = 0;\n for (const {target, value} of source.sourceLinks) {\n let v = value * (target.layer - source.layer);\n y += sourceTop(source, target) * v;\n w += v;\n }\n if (!(w > 0)) continue;\n let dy = (y / w - source.y0) * alpha;\n source.y0 += dy;\n source.y1 += dy;\n reorderNodeLinks(source);\n }\n if (sort === undefined) column.sort(ascendingBreadth);\n resolveCollisions(column, beta);\n }\n }\n\n function resolveCollisions(nodes, alpha) {\n const i = nodes.length >> 1;\n const subject = nodes[i];\n resolveCollisionsBottomToTop(nodes, subject.y0 - py, i - 1, alpha);\n resolveCollisionsTopToBottom(nodes, subject.y1 + py, i + 1, alpha);\n resolveCollisionsBottomToTop(nodes, y1, nodes.length - 1, alpha);\n resolveCollisionsTopToBottom(nodes, y0, 0, alpha);\n }\n\n // Push any overlapping nodes down.\n function resolveCollisionsTopToBottom(nodes, y, i, alpha) {\n for (; i < nodes.length; ++i) {\n const node = nodes[i];\n const dy = (y - node.y0) * alpha;\n if (dy > 1e-6) node.y0 += dy, node.y1 += dy;\n y = node.y1 + py;\n }\n }\n\n // Push any overlapping nodes up.\n function resolveCollisionsBottomToTop(nodes, y, i, alpha) {\n for (; i >= 0; --i) {\n const node = nodes[i];\n const dy = (node.y1 - y) * alpha;\n if (dy > 1e-6) node.y0 -= dy, node.y1 -= dy;\n y = node.y0 - py;\n }\n }\n\n function reorderNodeLinks({sourceLinks, targetLinks}) {\n if (linkSort === undefined) {\n for (const {source: {sourceLinks}} of targetLinks) {\n sourceLinks.sort(ascendingTargetBreadth);\n }\n for (const {target: {targetLinks}} of sourceLinks) {\n targetLinks.sort(ascendingSourceBreadth);\n }\n }\n }\n\n function reorderLinks(nodes) {\n if (linkSort === undefined) {\n for (const {sourceLinks, targetLinks} of nodes) {\n sourceLinks.sort(ascendingTargetBreadth);\n targetLinks.sort(ascendingSourceBreadth);\n }\n }\n }\n\n // Returns the target.y0 that would produce an ideal link from source to target.\n function targetTop(source, target) {\n let y = source.y0 - (source.sourceLinks.length - 1) * py / 2;\n for (const {target: node, width} of source.sourceLinks) {\n if (node === target) break;\n y += width + py;\n }\n for (const {source: node, width} of target.targetLinks) {\n if (node === source) break;\n y -= width;\n }\n return y;\n }\n\n // Returns the source.y0 that would produce an ideal link from source to target.\n function sourceTop(source, target) {\n let y = target.y0 - (target.targetLinks.length - 1) * py / 2;\n for (const {source: node, width} of target.targetLinks) {\n if (node === source) break;\n y += width + py;\n }\n for (const {target: node, width} of source.sourceLinks) {\n if (node === target) break;\n y -= width;\n }\n return y;\n }\n\n return sankey;\n}\n","var pi = Math.PI,\n tau = 2 * pi,\n epsilon = 1e-6,\n tauEpsilon = tau - epsilon;\n\nfunction Path() {\n this._x0 = this._y0 = // start of current subpath\n this._x1 = this._y1 = null; // end of current subpath\n this._ = \"\";\n}\n\nfunction path() {\n return new Path;\n}\n\nPath.prototype = path.prototype = {\n constructor: Path,\n moveTo: function(x, y) {\n this._ += \"M\" + (this._x0 = this._x1 = +x) + \",\" + (this._y0 = this._y1 = +y);\n },\n closePath: function() {\n if (this._x1 !== null) {\n this._x1 = this._x0, this._y1 = this._y0;\n this._ += \"Z\";\n }\n },\n lineTo: function(x, y) {\n this._ += \"L\" + (this._x1 = +x) + \",\" + (this._y1 = +y);\n },\n quadraticCurveTo: function(x1, y1, x, y) {\n this._ += \"Q\" + (+x1) + \",\" + (+y1) + \",\" + (this._x1 = +x) + \",\" + (this._y1 = +y);\n },\n bezierCurveTo: function(x1, y1, x2, y2, x, y) {\n this._ += \"C\" + (+x1) + \",\" + (+y1) + \",\" + (+x2) + \",\" + (+y2) + \",\" + (this._x1 = +x) + \",\" + (this._y1 = +y);\n },\n arcTo: function(x1, y1, x2, y2, r) {\n x1 = +x1, y1 = +y1, x2 = +x2, y2 = +y2, r = +r;\n var x0 = this._x1,\n y0 = this._y1,\n x21 = x2 - x1,\n y21 = y2 - y1,\n x01 = x0 - x1,\n y01 = y0 - y1,\n l01_2 = x01 * x01 + y01 * y01;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(\"negative radius: \" + r);\n\n // Is this path empty? Move to (x1,y1).\n if (this._x1 === null) {\n this._ += \"M\" + (this._x1 = x1) + \",\" + (this._y1 = y1);\n }\n\n // Or, is (x1,y1) coincident with (x0,y0)? Do nothing.\n else if (!(l01_2 > epsilon));\n\n // Or, are (x0,y0), (x1,y1) and (x2,y2) collinear?\n // Equivalently, is (x1,y1) coincident with (x2,y2)?\n // Or, is the radius zero? Line to (x1,y1).\n else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon) || !r) {\n this._ += \"L\" + (this._x1 = x1) + \",\" + (this._y1 = y1);\n }\n\n // Otherwise, draw an arc!\n else {\n var x20 = x2 - x0,\n y20 = y2 - y0,\n l21_2 = x21 * x21 + y21 * y21,\n l20_2 = x20 * x20 + y20 * y20,\n l21 = Math.sqrt(l21_2),\n l01 = Math.sqrt(l01_2),\n l = r * Math.tan((pi - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2),\n t01 = l / l01,\n t21 = l / l21;\n\n // If the start tangent is not coincident with (x0,y0), line to.\n if (Math.abs(t01 - 1) > epsilon) {\n this._ += \"L\" + (x1 + t01 * x01) + \",\" + (y1 + t01 * y01);\n }\n\n this._ += \"A\" + r + \",\" + r + \",0,0,\" + (+(y01 * x20 > x01 * y20)) + \",\" + (this._x1 = x1 + t21 * x21) + \",\" + (this._y1 = y1 + t21 * y21);\n }\n },\n arc: function(x, y, r, a0, a1, ccw) {\n x = +x, y = +y, r = +r, ccw = !!ccw;\n var dx = r * Math.cos(a0),\n dy = r * Math.sin(a0),\n x0 = x + dx,\n y0 = y + dy,\n cw = 1 ^ ccw,\n da = ccw ? a0 - a1 : a1 - a0;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(\"negative radius: \" + r);\n\n // Is this path empty? Move to (x0,y0).\n if (this._x1 === null) {\n this._ += \"M\" + x0 + \",\" + y0;\n }\n\n // Or, is (x0,y0) not coincident with the previous point? Line to (x0,y0).\n else if (Math.abs(this._x1 - x0) > epsilon || Math.abs(this._y1 - y0) > epsilon) {\n this._ += \"L\" + x0 + \",\" + y0;\n }\n\n // Is this arc empty? We’re done.\n if (!r) return;\n\n // Does the angle go the wrong way? Flip the direction.\n if (da < 0) da = da % tau + tau;\n\n // Is this a complete circle? Draw two arcs to complete the circle.\n if (da > tauEpsilon) {\n this._ += \"A\" + r + \",\" + r + \",0,1,\" + cw + \",\" + (x - dx) + \",\" + (y - dy) + \"A\" + r + \",\" + r + \",0,1,\" + cw + \",\" + (this._x1 = x0) + \",\" + (this._y1 = y0);\n }\n\n // Is this arc non-empty? Draw an arc!\n else if (da > epsilon) {\n this._ += \"A\" + r + \",\" + r + \",0,\" + (+(da >= pi)) + \",\" + cw + \",\" + (this._x1 = x + r * Math.cos(a1)) + \",\" + (this._y1 = y + r * Math.sin(a1));\n }\n },\n rect: function(x, y, w, h) {\n this._ += \"M\" + (this._x0 = this._x1 = +x) + \",\" + (this._y0 = this._y1 = +y) + \"h\" + (+w) + \"v\" + (+h) + \"h\" + (-w) + \"Z\";\n },\n toString: function() {\n return this._;\n }\n};\n\nexport default path;\n","export default function(x) {\n return function constant() {\n return x;\n };\n}\n","export function x(p) {\n return p[0];\n}\n\nexport function y(p) {\n return p[1];\n}\n","export var slice = Array.prototype.slice;\n","import {path} from \"d3-path\";\nimport {slice} from \"../array.js\";\nimport constant from \"../constant.js\";\nimport {x as pointX, y as pointY} from \"../point.js\";\nimport pointRadial from \"../pointRadial.js\";\n\nfunction linkSource(d) {\n return d.source;\n}\n\nfunction linkTarget(d) {\n return d.target;\n}\n\nfunction link(curve) {\n var source = linkSource,\n target = linkTarget,\n x = pointX,\n y = pointY,\n context = null;\n\n function link() {\n var buffer, argv = slice.call(arguments), s = source.apply(this, argv), t = target.apply(this, argv);\n if (!context) context = buffer = path();\n curve(context, +x.apply(this, (argv[0] = s, argv)), +y.apply(this, argv), +x.apply(this, (argv[0] = t, argv)), +y.apply(this, argv));\n if (buffer) return context = null, buffer + \"\" || null;\n }\n\n link.source = function(_) {\n return arguments.length ? (source = _, link) : source;\n };\n\n link.target = function(_) {\n return arguments.length ? (target = _, link) : target;\n };\n\n link.x = function(_) {\n return arguments.length ? (x = typeof _ === \"function\" ? _ : constant(+_), link) : x;\n };\n\n link.y = function(_) {\n return arguments.length ? (y = typeof _ === \"function\" ? _ : constant(+_), link) : y;\n };\n\n link.context = function(_) {\n return arguments.length ? ((context = _ == null ? null : _), link) : context;\n };\n\n return link;\n}\n\nfunction curveHorizontal(context, x0, y0, x1, y1) {\n context.moveTo(x0, y0);\n context.bezierCurveTo(x0 = (x0 + x1) / 2, y0, x0, y1, x1, y1);\n}\n\nfunction curveVertical(context, x0, y0, x1, y1) {\n context.moveTo(x0, y0);\n context.bezierCurveTo(x0, y0 = (y0 + y1) / 2, x1, y0, x1, y1);\n}\n\nfunction curveRadial(context, x0, y0, x1, y1) {\n var p0 = pointRadial(x0, y0),\n p1 = pointRadial(x0, y0 = (y0 + y1) / 2),\n p2 = pointRadial(x1, y0),\n p3 = pointRadial(x1, y1);\n context.moveTo(p0[0], p0[1]);\n context.bezierCurveTo(p1[0], p1[1], p2[0], p2[1], p3[0], p3[1]);\n}\n\nexport function linkHorizontal() {\n return link(curveHorizontal);\n}\n\nexport function linkVertical() {\n return link(curveVertical);\n}\n\nexport function linkRadial() {\n var l = link(curveRadial);\n l.angle = l.x, delete l.x;\n l.radius = l.y, delete l.y;\n return l;\n}\n","import {linkHorizontal} from \"d3-shape\";\n\nfunction horizontalSource(d) {\n return [d.source.x1, d.y0];\n}\n\nfunction horizontalTarget(d) {\n return [d.target.x0, d.y1];\n}\n\nexport default function() {\n return linkHorizontal()\n .source(horizontalSource)\n .target(horizontalTarget);\n}\n","import isEqual from 'fast-deep-equal';\r\nimport { useRef, useState } from 'react';\r\nimport { sankey, sankeyCenter, sankeyLinkHorizontal } from 'd3-sankey';\r\nimport { AnimatePresence, motion, useInView } from 'motion/react';\r\nimport { Modal } from '@undp/design-system-react/Modal';\r\nimport { cn } from '@undp/design-system-react/cn';\r\nimport { P } from '@undp/design-system-react/Typography';\r\n\r\nimport {\r\n AnimateDataType,\r\n ClassNameObject,\r\n CustomLayerDataType,\r\n NodeDataType,\r\n NodesLinkDataType,\r\n StyleObject,\r\n} from '@/Types';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { string2HTML } from '@/Utils/string2HTML';\r\n\r\ninterface Props {\r\n data: NodesLinkDataType;\r\n showLabels: boolean;\r\n leftMargin: number;\r\n truncateBy: number;\r\n defaultLinkOpacity: number;\r\n width: number;\r\n height: number;\r\n nodePadding: number;\r\n nodeWidth: number;\r\n rightMargin: number;\r\n topMargin: number;\r\n bottomMargin: number;\r\n suffix: string;\r\n prefix: string;\r\n showValues?: boolean;\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 // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n id: string;\r\n highlightedSourceDataPoints: string[];\r\n highlightedTargetDataPoints: string[];\r\n sourceTitle?: string;\r\n targetTitle?: string;\r\n animate: AnimateDataType;\r\n sortNodes: 'asc' | 'desc' | 'mostReadable' | 'none';\r\n resetSelectionOnDoubleClick: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n precision: number;\r\n customLayers: CustomLayerDataType[];\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n const {\r\n data,\r\n showLabels,\r\n leftMargin,\r\n rightMargin,\r\n truncateBy,\r\n width,\r\n height,\r\n topMargin,\r\n bottomMargin,\r\n tooltip,\r\n onSeriesMouseOver,\r\n suffix,\r\n prefix,\r\n showValues,\r\n onSeriesMouseClick,\r\n nodePadding,\r\n nodeWidth,\r\n id,\r\n highlightedSourceDataPoints,\r\n highlightedTargetDataPoints,\r\n defaultLinkOpacity,\r\n sourceTitle,\r\n targetTitle,\r\n animate,\r\n sortNodes,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\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 // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseOverData, setMouseOverData] = useState<any>(undefined);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseClickData, setMouseClickData] = useState<any>(undefined);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [selectedNode, setSelectedNode] = 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: leftMargin,\r\n right: rightMargin,\r\n };\r\n const graphWidth = width - margin.left - margin.right;\r\n const graphHeight = height - margin.top - margin.bottom;\r\n const sankeyGenerator =\r\n sortNodes === 'mostReadable'\r\n ? sankey()\r\n .nodeWidth(nodeWidth)\r\n .nodePadding(nodePadding)\r\n .size([graphWidth, graphHeight])\r\n .nodeAlign(sankeyCenter)\r\n : sortNodes === 'none'\r\n ? sankey()\r\n .nodeWidth(nodeWidth)\r\n .nodePadding(nodePadding)\r\n .size([graphWidth, graphHeight])\r\n .nodeAlign(sankeyCenter)\r\n .nodeSort(() => null)\r\n .linkSort(() => null)\r\n : sankey()\r\n .nodeWidth(nodeWidth)\r\n .nodePadding(nodePadding)\r\n .size([graphWidth, graphHeight])\r\n .nodeAlign(sankeyCenter)\r\n .nodeSort(\r\n sortNodes === 'desc'\r\n ? (a, b) => (b.value || 0) - (a.value || 0)\r\n : (a, b) => (a.value || 0) - (b.value || 0),\r\n );\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const { nodes, links } = sankeyGenerator(data as any);\r\n const linkPathGenerator = sankeyLinkHorizontal();\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 style={{ marginLeft: 'auto', marginRight: 'auto' }}\r\n direction='ltr'\r\n ref={svgRef}\r\n >\r\n {sourceTitle ? (\r\n <text\r\n x={margin.left}\r\n y={margin.top - 10}\r\n className='text-base font-bold fill-primary-gray-700 dark:fill-primary-gray-100'\r\n style={{ textAnchor: 'start' }}\r\n >\r\n {sourceTitle}\r\n </text>\r\n ) : null}\r\n {targetTitle ? (\r\n <text\r\n x={width - margin.right}\r\n y={margin.top - 10}\r\n className='text-base font-bold fill-primary-gray-700 dark:fill-primary-gray-100'\r\n style={{ textAnchor: 'end' }}\r\n >\r\n {targetTitle}\r\n </text>\r\n ) : null}\r\n <g transform={`translate(${margin.left},${margin.top})`}>\r\n {customLayers.filter(d => d.position === 'before').map(d => d.layer)}\r\n {nodes\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n .filter((d: any) => d.type === 'source')\r\n .map((d, i) => (\r\n <g\r\n key={i}\r\n onMouseEnter={() => {\r\n setSelectedNode(d);\r\n }}\r\n onMouseLeave={() => {\r\n setSelectedNode(undefined);\r\n }}\r\n >\r\n <g transform={`translate(${d.x0},${d.y0})`}>\r\n <rect\r\n x={0}\r\n y={0}\r\n width={(d.x1 || 0) - (d.x0 || 0)}\r\n height={(d.y1 || 0) - (d.y0 || 0)}\r\n style={{ fill: (d as NodeDataType).color }}\r\n />\r\n {showLabels || showValues ? (\r\n <foreignObject\r\n y={0 - nodePadding / 2}\r\n x={0 - leftMargin}\r\n width={leftMargin}\r\n height={(d.y1 || 0) - (d.y0 || 0) + nodePadding}\r\n >\r\n <div\r\n className='flex flex-col gap-0.5 justify-center py-0 px-1.5'\r\n style={{\r\n height: `${(d.y1 || 0) - (d.y0 || 0) + nodePadding}px`,\r\n overflow: 'visible',\r\n }}\r\n >\r\n {showLabels ? (\r\n <P\r\n marginBottom={showValues ? '3xs' : 'none'}\r\n size='sm'\r\n leading='none'\r\n className={cn(\r\n 'sankey-right-label text-right',\r\n classNames?.graphObjectValues,\r\n )}\r\n style={{\r\n hyphens: 'auto',\r\n color: (d as NodeDataType).color,\r\n ...styles?.graphObjectValues,\r\n }}\r\n >\r\n {`${(d as NodeDataType).label}`.length < truncateBy\r\n ? `${(d as NodeDataType).label}`\r\n : `${`${(d as NodeDataType).label}`.substring(0, truncateBy)}...`}\r\n </P>\r\n ) : null}\r\n {showValues ? (\r\n <P\r\n marginBottom='none'\r\n size='sm'\r\n leading='none'\r\n className={cn(\r\n 'sankey-right-value text-right font-bold',\r\n classNames?.graphObjectValues,\r\n )}\r\n style={{\r\n hyphens: 'auto',\r\n color: (d as NodeDataType).color,\r\n ...styles?.graphObjectValues,\r\n }}\r\n >\r\n {numberFormattingFunction(d.value, 'NA', precision, prefix, suffix)}\r\n </P>\r\n ) : null}\r\n </div>\r\n </foreignObject>\r\n ) : null}\r\n </g>\r\n </g>\r\n ))}\r\n {nodes\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n .filter((d: any) => d.type === 'target')\r\n .map((d, i) => (\r\n <g\r\n key={i}\r\n onMouseEnter={() => {\r\n setSelectedNode(d);\r\n }}\r\n onMouseLeave={() => {\r\n setSelectedNode(undefined);\r\n }}\r\n >\r\n <g transform={`translate(${d.x0},${d.y0})`}>\r\n <rect\r\n x={0}\r\n y={0}\r\n width={(d.x1 || 0) - (d.x0 || 0)}\r\n height={(d.y1 || 0) - (d.y0 || 0)}\r\n style={{ fill: (d as NodeDataType).color }}\r\n />\r\n {showLabels || showValues ? (\r\n <foreignObject\r\n y={0 - nodePadding / 2}\r\n x={nodeWidth}\r\n width={rightMargin - nodeWidth}\r\n height={(d.y1 || 0) - (d.y0 || 0) + nodePadding}\r\n >\r\n <div\r\n className='flex flex-col gap-0.5 justify-center py-0 px-1.5'\r\n style={{\r\n height: `${(d.y1 || 0) - (d.y0 || 0) + nodePadding}px`,\r\n }}\r\n >\r\n {showLabels ? (\r\n <P\r\n marginBottom={showValues ? '3xs' : 'none'}\r\n size='sm'\r\n leading='none'\r\n className={cn(\r\n 'sankey-left-label text-left',\r\n classNames?.graphObjectValues,\r\n )}\r\n style={{\r\n hyphens: 'auto',\r\n color: (d as NodeDataType).color,\r\n ...styles?.graphObjectValues,\r\n }}\r\n >\r\n {`${(d as NodeDataType).label}`.length < truncateBy\r\n ? `${(d as NodeDataType).label}`\r\n : `${`${(d as NodeDataType).label}`.substring(0, truncateBy)}...`}\r\n </P>\r\n ) : null}\r\n {showValues ? (\r\n <P\r\n size='sm'\r\n leading='none'\r\n marginBottom='none'\r\n className={cn(\r\n 'sankey-left-value text-left font-bold',\r\n classNames?.graphObjectValues,\r\n )}\r\n style={{\r\n hyphens: 'auto',\r\n color: (d as NodeDataType).color,\r\n ...styles?.graphObjectValues,\r\n }}\r\n >\r\n {numberFormattingFunction(d.value, 'NA', precision, prefix, suffix)}\r\n </P>\r\n ) : null}\r\n </div>\r\n </foreignObject>\r\n ) : null}\r\n </g>\r\n </g>\r\n ))}\r\n <defs>\r\n {links.map((d, i) => (\r\n <linearGradient\r\n id={`${id}-gradient-${i}`}\r\n x1='0%'\r\n y1='0%'\r\n x2='100%'\r\n y2='0%'\r\n key={i}\r\n gradientUnits='userSpaceOnUse'\r\n >\r\n <stop\r\n offset='0%'\r\n style={{\r\n stopColor: (d.source as NodeDataType).color,\r\n stopOpacity: 1,\r\n }}\r\n />\r\n <stop\r\n offset='100%'\r\n style={{\r\n stopColor: (d.target as NodeDataType).color,\r\n stopOpacity: 1,\r\n }}\r\n />\r\n </linearGradient>\r\n ))}\r\n </defs>\r\n <g>\r\n <AnimatePresence>\r\n {links.map((d, i) => (\r\n <motion.g\r\n className='undp-viz-g-with-hover'\r\n key={`${d.source}-${d.target}`}\r\n onMouseEnter={event => {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n setMouseOverData((d as any).data);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n\r\n onSeriesMouseOver?.(d);\r\n }}\r\n onMouseMove={event => {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n setMouseOverData((d as any).data);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n }}\r\n onClick={() => {\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n isEqual(mouseClickData, (d as any).data) &&\r\n resetSelectionOnDoubleClick\r\n ) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n setMouseClickData((d as any).data);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?.((d as any).data);\r\n }\r\n }\r\n }}\r\n onMouseLeave={() => {\r\n setMouseOverData(undefined);\r\n setEventX(undefined);\r\n setEventY(undefined);\r\n onSeriesMouseOver?.(undefined);\r\n }}\r\n variants={{\r\n initial: {\r\n opacity: selectedNode\r\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (d.source as any).name === selectedNode.name ||\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (d.target as any).name === selectedNode.name\r\n ? 0.85\r\n : defaultLinkOpacity\r\n : highlightedSourceDataPoints.length !== 0 ||\r\n highlightedTargetDataPoints.length !== 0\r\n ? highlightedSourceDataPoints.indexOf(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (d.source as any).label,\r\n ) !== -1 ||\r\n highlightedTargetDataPoints.indexOf(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (d.target as any).label,\r\n ) !== -1\r\n ? 0.85\r\n : defaultLinkOpacity\r\n : defaultLinkOpacity,\r\n },\r\n whileInView: {\r\n opacity: selectedNode\r\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (d.source as any).name === selectedNode.name ||\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (d.target as any).name === selectedNode.name\r\n ? 0.85\r\n : defaultLinkOpacity\r\n : highlightedSourceDataPoints.length !== 0 ||\r\n highlightedTargetDataPoints.length !== 0\r\n ? highlightedSourceDataPoints.indexOf(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (d.source as any).label,\r\n ) !== -1 ||\r\n highlightedTargetDataPoints.indexOf(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (d.target as any).label,\r\n ) !== -1\r\n ? 0.85\r\n : defaultLinkOpacity\r\n : defaultLinkOpacity,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n >\r\n <motion.path\r\n key={`${d.source}-${d.target}`}\r\n d={linkPathGenerator(d) || ''}\r\n style={{\r\n stroke: `url(#${id}-gradient-${i})`,\r\n strokeWidth: d.width,\r\n fill: 'none',\r\n }}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n variants={{\r\n initial: {\r\n pathLength: 0,\r\n opacity: 1,\r\n },\r\n whileInView: {\r\n pathLength: 1,\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.g>\r\n ))}\r\n </AnimatePresence>\r\n </g>\r\n {customLayers.filter(d => d.position === 'after').map(d => d.layer)}\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 {detailsOnClick && mouseClickData !== undefined ? (\r\n <Modal\r\n open={mouseClickData !== undefined}\r\n onClose={() => {\r\n setMouseClickData(undefined);\r\n }}\r\n >\r\n <div\r\n className='graph-modal-content m-0'\r\n dangerouslySetInnerHTML={\r\n typeof detailsOnClick === 'string'\r\n ? { __html: string2HTML(detailsOnClick, mouseClickData) }\r\n : undefined\r\n }\r\n >\r\n {typeof detailsOnClick === 'function' ? detailsOnClick(mouseClickData) : null}\r\n </div>\r\n </Modal>\r\n ) : null}\r\n </>\r\n );\r\n}\r\n","import { useState, useRef, useEffect } from 'react';\r\nimport uniqBy from 'lodash.uniqby';\r\nimport sortBy from 'lodash.sortby';\r\nimport sum from 'lodash.sum';\r\nimport { cn } from '@undp/design-system-react/cn';\r\n\r\nimport { Graph } from './Graph';\r\n\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport {\r\n AnimateDataType,\r\n ClassNameObject,\r\n CustomLayerDataType,\r\n Languages,\r\n NodesLinkDataType,\r\n SankeyDataType,\r\n SourcesDataType,\r\n StyleObject,\r\n} from '@/Types';\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { generateRandomString } from '@/Utils/generateRandomString';\r\nimport { EmptyState } from '@/Components/Elements/EmptyState';\r\n\r\ninterface Props {\r\n // Data\r\n /** Array of data objects */\r\n data: SankeyDataType[];\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 /** Color or array of colors for source */\r\n sourceColors?: string[] | string;\r\n /** Color or array of colors for targets */\r\n targetColors?: string[] | string;\r\n /** Domain of colors for the source */\r\n sourceColorDomain?: (string | number)[];\r\n /** Domain of colors for the target */\r\n targetColorDomain?: (string | number)[];\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 /** Toggles the background to fill the container. This only works if the width of the graph is defined. */\r\n fillContainer?: boolean;\r\n /** Padding between nodes */\r\n nodePadding?: number;\r\n /** Thickness of each node */\r\n nodeWidth?: 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 /** Truncate labels by specified length */\r\n truncateBy?: number;\r\n\r\n // Graph Parameters\r\n /** Title of the source */\r\n sourceTitle?: string;\r\n /** Title of the targets */\r\n targetTitle?: string;\r\n /** Toggle visibility of labels */\r\n showLabels?: boolean;\r\n /** Toggle visibility of values */\r\n showValues?: boolean;\r\n /** Source to highlight. Use the label value from data to highlight the data point */\r\n highlightedSourceDataPoints?: (string | number)[];\r\n /** Targets to highlight. Use the label value from data to highlight the data point */\r\n highlightedTargetDataPoints?: (string | number)[];\r\n /** Opacity of the links */\r\n defaultLinkOpacity?: number;\r\n /** Sorting order of the nodes */\r\n sortNodes?: 'asc' | 'desc' | 'mostReadable' | 'none';\r\n /** Toggles if the graph animates in when loaded. */\r\n animate?: boolean | AnimateDataType;\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 /** Reset selection on double-click. Only applicable when used in a dashboard context with filters. */\r\n resetSelectionOnDoubleClick?: boolean;\r\n\r\n // Interactions and Callbacks\r\n /** Tooltip content when user mouseover on the links. 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 SankeyChart(props: Props) {\r\n const {\r\n data,\r\n graphTitle,\r\n sources,\r\n graphDescription,\r\n showLabels = true,\r\n leftMargin = 75,\r\n rightMargin = 75,\r\n topMargin = 30,\r\n bottomMargin = 10,\r\n truncateBy = 999,\r\n height,\r\n width,\r\n footNote,\r\n padding,\r\n backgroundColor,\r\n tooltip,\r\n onSeriesMouseOver,\r\n suffix = '',\r\n prefix = '',\r\n relativeHeight,\r\n showValues = true,\r\n graphID,\r\n onSeriesMouseClick,\r\n graphDownload = false,\r\n dataDownload = false,\r\n fillContainer = true,\r\n language = 'en',\r\n minHeight = 0,\r\n theme = 'light',\r\n ariaLabel,\r\n sourceColors,\r\n targetColors,\r\n sourceColorDomain,\r\n targetColorDomain,\r\n nodePadding = 5,\r\n nodeWidth = 5,\r\n highlightedSourceDataPoints = [],\r\n highlightedTargetDataPoints = [],\r\n defaultLinkOpacity = 0.3,\r\n sourceTitle,\r\n targetTitle,\r\n sortNodes = 'mostReadable',\r\n resetSelectionOnDoubleClick = true,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n animate = false,\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 const [sankeyData, setSankeyData] = useState<NodesLinkDataType | undefined>(undefined);\r\n\r\n const graphDiv = useRef<HTMLDivElement>(null);\r\n const graphParentDiv = useRef<HTMLDivElement>(null);\r\n\r\n useEffect(() => {\r\n const sourceNodes = uniqBy(data, 'source').map(d => ({\r\n name: `source_${d.source}`,\r\n type: 'source' as const,\r\n label: `${d.source}`,\r\n color:\r\n typeof sourceColors === 'string' || !sourceColors\r\n ? sourceColors || Colors.graphMainColor\r\n : sourceColors[\r\n (sourceColorDomain || uniqBy(data, 'source').map(el => `${el.source}`)).findIndex(\r\n el => `${el}` === `${d.source}`,\r\n ) > sourceColors.length\r\n ? sourceColors.length - 1\r\n : (sourceColorDomain || uniqBy(data, 'source').map(el => `${el.source}`)).findIndex(\r\n el => `${el}` === `${d.source}`,\r\n )\r\n ],\r\n totalValue: sum(data.filter(el => `${el.source}` === `${d.source}`).map(el => el.value)),\r\n }));\r\n const sourceNodesSorted =\r\n sortNodes === 'asc'\r\n ? sortBy(sourceNodes, d => d.totalValue)\r\n : sortNodes === 'desc'\r\n ? sortBy(sourceNodes, d => d.totalValue).reverse()\r\n : sourceNodes;\r\n const targetNodes = uniqBy(data, 'target').map(d => ({\r\n name: `target_${d.target}`,\r\n type: 'target' as const,\r\n label: `${d.target}`,\r\n color:\r\n typeof targetColors === 'string' || !targetColors\r\n ? targetColors || Colors.graphMainColor\r\n : targetColors[\r\n (targetColorDomain || uniqBy(data, 'target').map(el => `${el.target}`)).findIndex(\r\n el => `${el}` === `${d.target}`,\r\n ) > targetColors.length\r\n ? targetColors.length - 1\r\n : (targetColorDomain || uniqBy(data, 'target').map(el => `${el.target}`)).findIndex(\r\n el => `${el}` === `${d.target}`,\r\n )\r\n ],\r\n totalValue: sum(data.filter(el => `${el.target}` === `${d.target}`).map(el => el.value)),\r\n }));\r\n const targetNodesSorted =\r\n sortNodes === 'asc'\r\n ? sortBy(targetNodes, d => d.totalValue)\r\n : sortNodes === 'desc'\r\n ? sortBy(targetNodes, d => d.totalValue).reverse()\r\n : targetNodes;\r\n\r\n const nodes = [...sourceNodesSorted, ...targetNodesSorted];\r\n setSankeyData({\r\n nodes,\r\n links: data.map(d => ({\r\n source: nodes.findIndex(el => el.name === `source_${d.source}`),\r\n target: nodes.findIndex(el => el.name === `target_${d.target}`),\r\n value: d.value,\r\n data: { ...d },\r\n })),\r\n });\r\n }, [data, sortNodes, sourceColorDomain, sourceColors, targetColorDomain, targetColors]);\r\n\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 ? 'grow-0' : 'grow'} ${\r\n !fillContainer ? 'w-fit' : 'w-full'\r\n } `}\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 sankey chart showing flow. ${graphDescription ? ` ${graphDescription}` : ''}`\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 gap-4 w-full 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 <div\r\n className='flex flex-col grow justify-center gap-3 w-full leading-0'\r\n ref={graphDiv}\r\n aria-label='Graph area'\r\n >\r\n {(width || svgWidth) && (height || svgHeight) && sankeyData ? (\r\n <Graph\r\n data={sankeyData}\r\n width={width || svgWidth}\r\n nodePadding={nodePadding}\r\n nodeWidth={nodeWidth}\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 showLabels={showLabels}\r\n leftMargin={leftMargin}\r\n rightMargin={rightMargin}\r\n topMargin={topMargin}\r\n bottomMargin={bottomMargin}\r\n truncateBy={truncateBy}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n showValues={showValues}\r\n suffix={suffix}\r\n prefix={prefix}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n id={generateRandomString(8)}\r\n highlightedSourceDataPoints={highlightedSourceDataPoints.map(d => `${d}`)}\r\n highlightedTargetDataPoints={highlightedTargetDataPoints.map(d => `${d}`)}\r\n defaultLinkOpacity={defaultLinkOpacity}\r\n sourceTitle={sourceTitle}\r\n targetTitle={targetTitle}\r\n sortNodes={sortNodes}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n styles={styles}\r\n classNames={classNames}\r\n detailsOnClick={detailsOnClick}\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 precision={precision}\r\n customLayers={customLayers}\r\n />\r\n ) : null}\r\n </div>\r\n )}\r\n </div>\r\n {sources || footNote ? (\r\n <GraphFooter\r\n styles={{ footnote: styles?.footnote, source: styles?.source }}\r\n classNames={{\r\n footnote: classNames?.footnote,\r\n source: classNames?.source,\r\n }}\r\n sources={sources}\r\n footNote={footNote}\r\n width={width}\r\n />\r\n ) : null}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n}\r\n"],"names":["max","values","valueof","value","index","min","sum","targetDepth","d","justify","node","center","constant","x","ascendingSourceBreadth","a","b","ascendingBreadth","ascendingTargetBreadth","defaultId","defaultNodes","graph","defaultLinks","find","nodeById","id","computeLinkBreadths","nodes","y0","y1","link","Sankey","x0","x1","dx","dy","py","align","sort","linkSort","links","iterations","sankey","computeNodeLinks","computeNodeValues","computeNodeDepths","computeNodeHeights","computeNodeBreadths","_","i","source","target","sourceLinks","targetLinks","n","current","next","computeNodeLayers","kx","columns","column","initializeNodeBreadths","ky","c","y","reorderLinks","alpha","beta","relaxRightToLeft","relaxLeftToRight","w","v","targetTop","reorderNodeLinks","resolveCollisions","sourceTop","subject","resolveCollisionsBottomToTop","resolveCollisionsTopToBottom","width","pi","tau","epsilon","tauEpsilon","Path","path","x2","y2","r","x21","y21","x01","y01","l01_2","x20","y20","l21_2","l20_2","l21","l01","l","t01","t21","a0","a1","ccw","cw","da","h","p","slice","linkSource","linkTarget","curve","pointX","pointY","context","buffer","argv","s","t","curveHorizontal","linkHorizontal","horizontalSource","horizontalTarget","sankeyLinkHorizontal","Graph","props","data","showLabels","leftMargin","rightMargin","truncateBy","height","topMargin","bottomMargin","tooltip","onSeriesMouseOver","suffix","prefix","showValues","onSeriesMouseClick","nodePadding","nodeWidth","highlightedSourceDataPoints","highlightedTargetDataPoints","defaultLinkOpacity","sourceTitle","targetTitle","animate","sortNodes","resetSelectionOnDoubleClick","detailsOnClick","styles","classNames","precision","customLayers","svgRef","useRef","isInView","useInView","mouseOverData","setMouseOverData","useState","mouseClickData","setMouseClickData","selectedNode","setSelectedNode","eventX","setEventX","eventY","setEventY","margin","graphWidth","graphHeight","sankeyGenerator","sankeyCenter","linkPathGenerator","jsxs","Fragment","motion","jsx","P","cn","AnimatePresence","event","isEqual","Tooltip","Modal","string2HTML","SankeyChart","graphTitle","sources","graphDescription","footNote","padding","backgroundColor","relativeHeight","graphID","graphDownload","dataDownload","fillContainer","language","minHeight","theme","ariaLabel","sourceColors","targetColors","sourceColorDomain","targetColorDomain","svgWidth","setSvgWidth","svgHeight","setSvgHeight","sankeyData","setSankeyData","graphDiv","graphParentDiv","useEffect","sourceNodes","uniqBy","Colors","el","sourceNodesSorted","sortBy","targetNodes","targetNodesSorted","resizeObserver","entries","GraphHeader","EmptyState","generateRandomString","GraphFooter"],"mappings":"kuBAAe,SAASA,GAAIC,EAAQC,EAAS,CAC3C,IAAIF,EACJ,GAAIE,IAAY,OACd,UAAWC,KAASF,EACdE,GAAS,OACLH,EAAMG,GAAUH,IAAQ,QAAaG,GAASA,KACpDH,EAAMG,OAGL,CACL,IAAIC,EAAQ,GACZ,QAASD,KAASF,GACXE,EAAQD,EAAQC,EAAO,EAAEC,EAAOH,CAAM,IAAM,OACzCD,EAAMG,GAAUH,IAAQ,QA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,EAA4B,IAAIzI,GAAK,GAAGA,CAAC,EAAE,EACxE,mBAAA0I,EACA,YAAAC,EACA,YAAAC,EACA,UAAAE,EACA,4BAAAC,EACA,OAAAE,EACA,WAAAC,EACA,eAAAF,EACA,QACEH,KAAY,GACR,CAAE,SAAU,GAAK,KAAM,GAAM,OAAQ,EAAA,EACrCA,IAAW,CAAE,SAAU,EAAG,KAAM,GAAM,OAAQ,CAAA,EAEpD,UAAAM,GACA,aAAAC,EAAA,CAAA,EAEA,IAAA,CAAA,EAGV,EACCoC,GAAWE,EACVb,EAAAA,kBAAAA,IAACmD,GAAAA,YAAA,CACC,OAAQ,CAAE,SAAU/E,GAAQ,SAAU,OAAQA,GAAQ,MAAA,EACtD,WAAY,CACV,SAAUC,GAAY,SACtB,OAAQA,GAAY,MAAA,EAEtB,QAAAsC,EACA,SAAAE,EACA,MAAAnH,CAAA,CAAA,EAEA,IAAA,CAAA,CACN,CAAA,CAAA,CACF,CAAA,CACF,CAAA,CAGN","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11]}
@@ -0,0 +1,266 @@
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 interface CustomHighlightAreaSettingsForScatterPlotDataType {
63
+ coordinates: number[];
64
+ closePath?: boolean;
65
+ style?: React.CSSProperties;
66
+ className?: string;
67
+ color?: string;
68
+ strokeWidth?: number;
69
+ }
70
+
71
+ declare interface CustomLayerDataType {
72
+ position: 'before' | 'after';
73
+ layer: React.ReactNode;
74
+ }
75
+
76
+ declare interface HighlightAreaSettingsForScatterPlotDataType {
77
+ coordinates: [number | null, number | null, number | null, number | null];
78
+ style?: React.CSSProperties;
79
+ className?: string;
80
+ color?: string;
81
+ strokeWidth?: number;
82
+ }
83
+
84
+ declare type Languages = 'en' | 'ar' | 'az' | 'bn' | 'cy' | 'he' | 'hi' | 'jp' | 'ka' | 'km' | 'ko' | 'my' | 'ne' | 'zh' | 'custom';
85
+
86
+ declare interface Props {
87
+ /** Array of data objects */
88
+ data: ScatterPlotDataType[];
89
+ /** Title of the graph */
90
+ graphTitle?: string | React.ReactNode;
91
+ /** Description of the graph */
92
+ graphDescription?: string | React.ReactNode;
93
+ /** Footnote for the graph */
94
+ footNote?: string | React.ReactNode;
95
+ /** Source data for the graph */
96
+ sources?: SourcesDataType[];
97
+ /** Accessibility label */
98
+ ariaLabel?: string;
99
+ /** Color or array of colors for circle */
100
+ colors?: string | string[];
101
+ /** Domain of colors for the graph */
102
+ colorDomain?: string[];
103
+ /** Title for the color legend */
104
+ colorLegendTitle?: string;
105
+ /** Background color of the graph */
106
+ backgroundColor?: string | boolean;
107
+ /** Custom styles for the graph. Each object should be a valid React CSS style object. */
108
+ styles?: StyleObject;
109
+ /** Custom class names */
110
+ classNames?: ClassNameObject;
111
+ /** Width of the graph */
112
+ width?: number;
113
+ /** Height of the graph */
114
+ height?: number;
115
+ /** Minimum height of the graph */
116
+ minHeight?: number;
117
+ /** Relative height scaling factor. This overwrites the height props */
118
+ relativeHeight?: number;
119
+ /** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */
120
+ padding?: string;
121
+ /** Left margin of the graph */
122
+ leftMargin?: number;
123
+ /** Right margin of the graph */
124
+ rightMargin?: number;
125
+ /** Top margin of the graph */
126
+ topMargin?: number;
127
+ /** Bottom margin of the graph */
128
+ bottomMargin?: number;
129
+ /** Prefix for values on x-axis */
130
+ xPrefix?: string;
131
+ /** Suffix for values on x-axis */
132
+ xSuffix?: string;
133
+ /** Prefix for values on y-axis */
134
+ yPrefix?: string;
135
+ /** Suffix for values on y-axis */
136
+ ySuffix?: string;
137
+ /** Maximum value for the x-axis */
138
+ maxXValue?: number;
139
+ /** Minimum value for the x-axis */
140
+ minXValue?: number;
141
+ /** Maximum value for the y-axis */
142
+ maxYValue?: number;
143
+ /** Minimum value for the y-axis */
144
+ minYValue?: number;
145
+ /** Maximum value mapped to the radius chart */
146
+ maxRadiusValue?: number;
147
+ /** Reference values for comparison on x-axis */
148
+ refXValues?: ReferenceDataType[];
149
+ /** Reference values for comparison on y-axis */
150
+ refYValues?: ReferenceDataType[];
151
+ /** Number of ticks on the x-axis */
152
+ noOfXTicks?: number;
153
+ /** Number of ticks on the y-axis */
154
+ noOfYTicks?: number;
155
+ /** Maximum radius of the circle */
156
+ radius?: number;
157
+ /** Toggle visibility of labels */
158
+ showLabels?: boolean;
159
+ /** Toggle visibility of color scale. This is only applicable if the data props hae color parameter */
160
+ showColorScale?: boolean;
161
+ /** Toggle visibility of NA color in the color scale. This is only applicable if the data props hae color parameter and showColorScale prop is true */
162
+ showNAColor?: boolean;
163
+ /** Data points to highlight. Use the label value from data to highlight the data point */
164
+ highlightedDataPoints?: (string | number)[];
165
+ /** Defines the opacity of the non-highlighted data */
166
+ dimmedOpacity?: number;
167
+ /** Title for the x-axis */
168
+ xAxisTitle?: string;
169
+ /** Title for the y-axis */
170
+ yAxisTitle?: string;
171
+ /** Annotations on the chart */
172
+ annotations?: AnnotationSettingsDataType[];
173
+ /** Highlighted area(square) on the chart */
174
+ highlightAreaSettings?: HighlightAreaSettingsForScatterPlotDataType[];
175
+ /** Highlighted area(custom shape) on the chart */
176
+ customHighlightAreaSettings?: CustomHighlightAreaSettingsForScatterPlotDataType[];
177
+ /** 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. */
178
+ regressionLine?: boolean | string;
179
+ /** Color of the labels */
180
+ labelColor?: string;
181
+ /** Toggles if the graph animates in when loaded. */
182
+ animate?: boolean | AnimateDataType;
183
+ /** Specifies the number of decimal places to display in the value. */
184
+ precision?: number;
185
+ /** Optional SVG <g> element or function that renders custom content behind or in front of the graph. */
186
+ customLayers?: CustomLayerDataType[];
187
+ /** Configures playback and slider controls for animating the chart over time. The data must have a key date for it to work properly. */
188
+ timeline?: TimelineDataType;
189
+ /** Enable graph download option as png */
190
+ graphDownload?: boolean;
191
+ /** Enable data download option as a csv */
192
+ dataDownload?: boolean;
193
+ /** Reset selection on double-click. Only applicable when used in a dashboard context with filters. */
194
+ resetSelectionOnDoubleClick?: boolean;
195
+ /** 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 */
196
+ tooltip?: string | ((_d: any) => React.ReactNode);
197
+ /** 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 */
198
+ detailsOnClick?: string | ((_d: any) => React.ReactNode);
199
+ /** Callback for mouse over event */
200
+ onSeriesMouseOver?: (_d: any) => void;
201
+ /** Callback for mouse click event */
202
+ onSeriesMouseClick?: (_d: any) => void;
203
+ /** Language setting */
204
+ language?: Languages;
205
+ /** Color theme */
206
+ theme?: 'light' | 'dark';
207
+ /** Unique ID for the graph */
208
+ graphID?: string;
209
+ }
210
+
211
+ declare interface ReferenceDataType {
212
+ value: number | null;
213
+ text: string;
214
+ color?: string;
215
+ styles?: {
216
+ line?: React.CSSProperties;
217
+ text?: React.CSSProperties;
218
+ };
219
+ classNames?: {
220
+ line?: string;
221
+ text?: string;
222
+ };
223
+ }
224
+
225
+ export declare function ScatterPlot(props: Props): JSX.Element;
226
+
227
+ declare interface ScatterPlotDataType {
228
+ x?: number | null;
229
+ y?: number | null;
230
+ date?: string | number;
231
+ radius?: number | null;
232
+ color?: string | null;
233
+ label: string | number;
234
+ data?: object;
235
+ }
236
+
237
+ declare interface SourcesDataType {
238
+ source: string;
239
+ link?: string;
240
+ }
241
+
242
+ declare interface StyleObject {
243
+ title?: React.CSSProperties;
244
+ footnote?: React.CSSProperties;
245
+ source?: React.CSSProperties;
246
+ description?: React.CSSProperties;
247
+ graphContainer?: React.CSSProperties;
248
+ tooltip?: React.CSSProperties;
249
+ xAxis?: AxesStyleObject;
250
+ yAxis?: AxesStyleObject;
251
+ graphObjectValues?: React.CSSProperties;
252
+ dataConnectors?: React.CSSProperties;
253
+ mouseOverLine?: React.CSSProperties;
254
+ regLine?: React.CSSProperties;
255
+ dataCards?: React.CSSProperties;
256
+ }
257
+
258
+ declare interface TimelineDataType {
259
+ autoplay: boolean;
260
+ enabled: boolean;
261
+ showOnlyActiveDate: boolean;
262
+ speed?: number;
263
+ dateFormat?: string;
264
+ }
265
+
266
+ export { }
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index-BHm2KTjD-D8FylaKc.cjs"),ke=require("./index-CZbIGs8q.cjs"),Ie=require("./parse-hMnG_lRV.cjs"),j=require("react"),Se=require("./Typography-CDR-DAHH.cjs"),Ae=require("./getSliderMarks-DDJ1CdhL.cjs"),Le=require("./index-BXns0-ng.cjs"),Fe=require("./index-BczVvEBZ.cjs"),Ve=require("./simple-statistics-xm8c0LQQ.cjs"),He=require("./Modal-cQF2UQIa.cjs"),We=require("./Tooltip-BM18N_3l.cjs"),c=require("./checkIfNullOrUndefined.js"),N=require("./Colors.js"),$e=require("./numberFormattingFunction.js"),Ne=require("./customArea-B47Ew5cT.cjs"),Ge=require("./string2HTML-X4ZYX5jI.cjs"),Te=require("./Axis-BlyBRMNw.cjs"),De=require("./AxisTitle-BY8MI9jC.cjs"),Be=require("./XTicksAndGridLines-DuK35ROS.cjs"),Pe=require("./ReferenceLine-Bsb5jeE4.cjs"),ze=require("./RegressionLine-BfpCuD7B.cjs"),_e=require("./YTicksAndGridLines-CtLvzExe.cjs"),Ke=require("./index-BYroABPm.cjs"),K=require("./use-in-view-Dl1CsAIo.cjs"),Je=require("./pow-B5-jkdHU.cjs"),Ue=require("./linear-BVckp9RD.cjs"),Qe=require("./delaunay-rcy0HhZi.cjs"),Xe=require("./index-a2C2Bqn2.cjs"),Ze=require("./GraphFooter.js"),et=require("./GraphHeader.js"),tt=require("./ColorLegendWithMouseOver.js"),it=require("./EmptyState-BQguKAp5.cjs"),Ye=require("./index-CEc_9zWy.cjs"),st=require("./ensureCompleteData-DqWQ2Zbi.cjs"),ot=require("./init-DU0ybBc_.cjs");function rt(ge){const{data:s,width:M,height:q,showLabels:se,colors:l,colorDomain:C,radius:R,xAxisTitle:m,yAxisTitle:J,leftMargin:W,rightMargin:pe,topMargin:ye,bottomMargin:oe,tooltip:re,onSeriesMouseOver:U,refXValues:I,refYValues:je,highlightAreaSettings:ve,selectedColor:G,highlightedDataPoints:L,maxRadiusValue:be,maxXValue:B,minXValue:w,maxYValue:Oe,minYValue:E,onSeriesMouseClick:V,rtl:Q,annotations:Ce,customHighlightAreaSettings:Re,regressionLine:z,resetSelectionOnDoubleClick:Z,detailsOnClick:k,noOfXTicks:ne,noOfYTicks:le,labelColor:ee,xSuffix:ae,ySuffix:ce,xPrefix:xe,yPrefix:ue,styles:x,classNames:u,animate:n,dimmedOpacity:A,precision:S,customLayers:fe}=ge,de=j.useRef(null),y=K.useInView(de,{once:n.once,amount:n.amount}),[$,T]=j.useState(void 0),[D,X]=j.useState(void 0),[me,P]=j.useState(void 0),[he,v]=j.useState(void 0),h={top:ye,bottom:m?oe+50:oe,left:J?W+30:W,right:pe},_=s.map((e,p)=>({...e,id:`${p}`})),g=M-h.left-h.right,b=q-h.top-h.bottom,O=s.filter(e=>e.radius===void 0||e.radius===null).length!==s.length?Je.sqrt().domain([0,be]).range([.25,R]).nice():void 0,d=_.filter(e=>!c.checkIfNullOrUndefined(e.radius)).length===0?_:Fe.orderBy(_.filter(e=>!c.checkIfNullOrUndefined(e.radius)),"radius","desc"),r=Ue.linear().domain([w,B]).range([0,g]).nice(),a=Ue.linear().domain([E,Oe]).range([b,0]).nice(),te=r.ticks(ne),ie=a.ticks(le),Y=Qe.Delaunay.from(d.filter(e=>!c.checkIfNullOrUndefined(e.x)&&!c.checkIfNullOrUndefined(e.y)),e=>r(e.x),e=>a(e.y)).voronoi([0,0,g<0?0:g,b<0?0:b]),we=Ve.linearRegression(s.filter(e=>!c.checkIfNullOrUndefined(e.x)&&!c.checkIfNullOrUndefined(e.y)).map(e=>[r(e.x),a(e.y)])),f=Ve.linearRegressionLine(we);return i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(K.motion.svg,{width:`${M}px`,height:`${q}px`,viewBox:`0 0 ${M} ${q}`,direction:"ltr",ref:de,children:i.jsxRuntimeExports.jsxs("g",{transform:`translate(${h.left},${h.top})`,children:[i.jsxRuntimeExports.jsxs(Xe.AnimatePresence,{children:[i.jsxRuntimeExports.jsx(Ke.HighlightAreaForScatterPlot,{areaSettings:ve,width:g,height:b,scaleX:r,scaleY:a,animate:n,isInView:y}),i.jsxRuntimeExports.jsx(Ne.CustomArea,{areaSettings:Re,scaleX:r,scaleY:a,animate:n,isInView:y})]}),i.jsxRuntimeExports.jsxs("g",{children:[i.jsxRuntimeExports.jsx(_e.YTicksAndGridLines,{values:ie.filter(e=>e!==0),y:ie.filter(e=>e!==0).map(e=>a(e)),x1:0,x2:g+h.right,styles:{gridLines:x?.yAxis?.gridLines,labels:x?.yAxis?.labels},classNames:{gridLines:u?.yAxis?.gridLines,labels:u?.yAxis?.labels},suffix:ce,prefix:ue,labelType:"secondary",showGridLines:!0,labelPos:"side",precision:S}),i.jsxRuntimeExports.jsx(Te.Axis,{y1:a(E<0?0:E),y2:a(E<0?0:E),x1:0,x2:g+h.right,label:$e.numberFormattingFunction(E<0?0:E,"NA",S,ue,ce),labelPos:{x:0,y:a(E<0?0:E),dy:"0.33em",dx:-4},classNames:{axis:u?.xAxis?.axis,label:u?.yAxis?.labels},styles:{axis:x?.xAxis?.axis,label:{textAnchor:"end",...x?.yAxis?.labels||{}}}}),i.jsxRuntimeExports.jsx(De.AxisTitle,{x:0-W-15,y:b/2,style:x?.yAxis?.title,className:u?.yAxis?.title,text:J,rotate90:!0})]}),i.jsxRuntimeExports.jsxs("g",{children:[i.jsxRuntimeExports.jsx(Be.XTicksAndGridLines,{values:te.filter(e=>e!==0),x:te.filter(e=>e!==0).map(e=>r(e)),y1:0,y2:b,styles:{gridLines:x?.xAxis?.gridLines,labels:x?.xAxis?.labels},classNames:{gridLines:u?.xAxis?.gridLines,labels:u?.xAxis?.labels},suffix:ae,prefix:xe,labelType:"primary",showGridLines:!0,precision:S}),i.jsxRuntimeExports.jsx(Te.Axis,{x1:r(w<0?0:w),x2:r(w<0?0:w),y1:0,y2:b,label:$e.numberFormattingFunction(w<0?0:w,"NA",S,xe,ae),labelPos:{x:r(w<0?0:w),y:b,dy:"1em",dx:0},classNames:{axis:u?.xAxis?.axis,label:u?.yAxis?.labels},styles:{axis:x?.xAxis?.axis,label:{textAnchor:"middle",...x?.yAxis?.labels||{}}}}),i.jsxRuntimeExports.jsx(De.AxisTitle,{x:g/2,y:b+30,style:x?.xAxis?.title,className:u?.xAxis?.title,text:m})]}),fe.filter(e=>e.position==="before").map(e=>e.layer),i.jsxRuntimeExports.jsxs(Xe.AnimatePresence,{children:[d.filter(e=>!c.checkIfNullOrUndefined(e.x)&&!c.checkIfNullOrUndefined(e.y)).map((e,p)=>i.jsxRuntimeExports.jsx("path",{d:Y.renderCell(d.findIndex(o=>o.id===e.id)),opacity:0,onMouseEnter:o=>{T(e),v(o.clientY),P(o.clientX),U?.(e)},onMouseMove:o=>{T(e),v(o.clientY),P(o.clientX)},onMouseLeave:()=>{T(void 0),P(void 0),v(void 0),U?.(void 0)},onClick:()=>{(V||k)&&(Le.isEqual(D,e)&&Z?(X(void 0),V?.(void 0)):(X(e),V?.(e)))}},`${e.label||p}`)),d.filter(e=>!c.checkIfNullOrUndefined(e.x)&&!c.checkIfNullOrUndefined(e.y)).map((e,p)=>i.jsxRuntimeExports.jsxs(K.motion.g,{variants:{initial:{x:r(e.x),y:a(e.y),opacity:G?e.color&&l[C.indexOf(`${e.color}`)]===G?1:A:$?$.id===e.id?1:A:L.length!==0?L.indexOf(e.label||"")!==-1?1:A:1},whileInView:{x:r(e.x),y:a(e.y),opacity:G?e.color&&l[C.indexOf(`${e.color}`)]===G?1:A:$?$.id===e.id?1:A:L.length!==0?L.indexOf(e.label||"")!==-1?1:A:1,transition:{duration:n.duration}}},initial:"initial",animate:y?"whileInView":"initial",exit:{opacity:0,transition:{duration:n.duration}},onMouseEnter:o=>{T(e),v(o.clientY),P(o.clientX),U?.(e)},onMouseMove:o=>{T(e),v(o.clientY),P(o.clientX)},onMouseLeave:()=>{T(void 0),P(void 0),v(void 0),U?.(void 0)},onClick:()=>{(V||k)&&(Le.isEqual(D,e)&&Z?(X(void 0),V?.(void 0)):(X(e),V?.(e)))},children:[i.jsxRuntimeExports.jsx(K.motion.circle,{cx:0,cy:0,exit:{r:0,transition:{duration:n.duration}},variants:{initial:{r:0,fill:s.filter(o=>o.color).length===0?l[0]:e.color?l[C.indexOf(`${e.color}`)]:N.Colors.gray,stroke:s.filter(o=>o.color).length===0?l[0]:e.color?l[C.indexOf(`${e.color}`)]:N.Colors.gray},whileInView:{r:O?O(e.radius||0):R,fill:s.filter(o=>o.color).length===0?l[0]:e.color?l[C.indexOf(`${e.color}`)]:N.Colors.gray,stroke:s.filter(o=>o.color).length===0?l[0]:e.color?l[C.indexOf(`${e.color}`)]:N.Colors.gray,transition:{duration:n.duration}}},initial:"initial",animate:y?"whileInView":"initial",style:{fillOpacity:.6}}),se&&!c.checkIfNullOrUndefined(e.label)?i.jsxRuntimeExports.jsx(K.motion.text,{style:{...x?.graphObjectValues||{}},className:Se.cnExports.cn("graph-value text-sm",u?.graphObjectValues),y:0,exit:{opacity:0,transition:{duration:n.duration}},variants:{initial:{x:O?O(e.radius||0):R,opacity:0,fill:ee||(s.filter(o=>o.color).length===0?l[0]:e.color?l[C.indexOf(`${e.color}`)]:N.Colors.gray)},whileInView:{x:O?O(e.radius||0):R,opacity:1,fill:ee||(s.filter(o=>o.color).length===0?l[0]:e.color?l[C.indexOf(`${e.color}`)]:N.Colors.gray),transition:{duration:n.duration}}},initial:"initial",animate:y?"whileInView":"initial",dy:"0.33em",dx:3,children:e.label}):L.length!==0&&!c.checkIfNullOrUndefined(e.label)&&L.indexOf(e.label)!==-1?i.jsxRuntimeExports.jsx(K.motion.text,{style:{fill:ee||(s.filter(o=>o.color).length===0?l[0]:e.color?l[C.indexOf(`${e.color}`)]:N.Colors.gray),...x?.graphObjectValues||{}},className:Se.cnExports.cn("graph-value text-sm",u?.graphObjectValues),y:0,exit:{opacity:0,transition:{duration:n.duration}},variants:{initial:{x:O?O(e.radius||0):R,opacity:0},whileInView:{x:O?O(e.radius||0):R,opacity:1,transition:{duration:n.duration}}},initial:"initial",animate:y?"whileInView":"initial",dy:"0.33em",dx:3,children:e.label}):null]},`${e.label||p}`)),I.map((e,p)=>i.jsxRuntimeExports.jsx(Pe.RefLineX,{text:e.text,color:e.color,x:r(e.value),y1:0,y2:b,textSide:r(e.value)>g*.75||Q?"left":"right",classNames:e.classNames,styles:e.styles,animate:n,isInView:y},p)),je.map((e,p)=>i.jsxRuntimeExports.jsx(Pe.RefLineY,{text:e.text,color:e.color,y:a(e.value),x1:0,x2:g,classNames:e.classNames,styles:e.styles,animate:n,isInView:y},p)),i.jsxRuntimeExports.jsx("g",{children:Ce.map((e,p)=>{const o=Ne.getLineEndPoint({x:e.xCoordinate?r(e.xCoordinate)+(e.xOffset||0):0+(e.xOffset||0),y:e.yCoordinate?a(e.yCoordinate)+(e.yOffset||0)-8:0+(e.yOffset||0)-8},{x:e.xCoordinate?r(e.xCoordinate):0,y:e.yCoordinate?a(e.yCoordinate):0},c.checkIfNullOrUndefined(e.connectorRadius)?3.5:e.connectorRadius),Ee=e.showConnector?{y1:o.y,x1:o.x,y2:e.yCoordinate?a(e.yCoordinate)+(e.yOffset||0):0+(e.yOffset||0),x2:e.xCoordinate?r(e.xCoordinate)+(e.xOffset||0):0+(e.xOffset||0),cy:e.yCoordinate?a(e.yCoordinate):0,cx:e.xCoordinate?r(e.xCoordinate):0,circleRadius:c.checkIfNullOrUndefined(e.connectorRadius)?3.5:e.connectorRadius,strokeWidth:e.showConnector===!0?2:Math.min(e.showConnector||0,1)}:void 0,F={y:e.yCoordinate?a(e.yCoordinate)+(e.yOffset||0)-8:0+(e.yOffset||0)-8,x:Q?0:e.xCoordinate?r(e.xCoordinate)+(e.xOffset||0):0+(e.xOffset||0),width:Q?e.xCoordinate?r(e.xCoordinate)+(e.xOffset||0):0+(e.xOffset||0):g-(e.xCoordinate?r(e.xCoordinate)+(e.xOffset||0):0+(e.xOffset||0)),maxWidth:e.maxWidth,fontWeight:e.fontWeight,align:e.align};return i.jsxRuntimeExports.jsx(Ne.Annotation,{color:e.color,connectorsSettings:Ee,labelSettings:F,text:e.text,classNames:e.classNames,styles:e.styles,animate:n,isInView:y},p)})}),z?i.jsxRuntimeExports.jsx(ze.RegressionLine,{x1:0,x2:g,y1:f(0),y2:f(g),graphHeight:b,graphWidth:g,className:u?.regLine,style:x?.regLine,color:typeof z=="string"?z:void 0,animate:n,isInView:y}):null]}),fe.filter(e=>e.position==="after").map(e=>e.layer)]})}),$&&re&&me&&he?i.jsxRuntimeExports.jsx(We.Tooltip,{data:$,body:re,xPos:me,yPos:he,backgroundStyle:x?.tooltip,className:u?.tooltip}):null,k&&D!==void 0?i.jsxRuntimeExports.jsx(He.ModalExports.Modal,{open:D!==void 0,onClose:()=>{X(void 0)},children:i.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof k=="string"?{__html:Ge.string2HTML(k,D)}:void 0,children:typeof k=="function"?k(D):null})}):null]})}function nt(ge){const{data:s,graphTitle:M,colors:q,sources:se,graphDescription:l,showLabels:C=!1,height:R,width:m,footNote:J,colorDomain:W,colorLegendTitle:pe,radius:ye=5,xAxisTitle:oe="X Axis",yAxisTitle:re="Y Axis",padding:U,backgroundColor:I=!1,leftMargin:je=0,rightMargin:ve=10,topMargin:G=20,bottomMargin:L=50,tooltip:be,relativeHeight:B,onSeriesMouseOver:w,refXValues:Oe=[],refYValues:E=[],highlightAreaSettings:V=[],showColorScale:Q=!0,highlightedDataPoints:Ce=[],graphID:Re,maxRadiusValue:z,maxXValue:Z,minXValue:k,maxYValue:ne,minYValue:le,xSuffix:ee="",ySuffix:ae="",xPrefix:ce="",yPrefix:xe="",onSeriesMouseClick:ue,graphDownload:x=!1,dataDownload:u=!1,language:n="en",showNAColor:A=!0,minHeight:S=0,annotations:fe=[],customHighlightAreaSettings:de=[],theme:y="light",regressionLine:$=!1,ariaLabel:T,resetSelectionOnDoubleClick:D=!0,detailsOnClick:X,noOfXTicks:me=5,noOfYTicks:P=5,labelColor:he,styles:v,classNames:h,animate:_=!1,dimmedOpacity:g=.3,precision:b=2,customLayers:O=[],timeline:d={enabled:!1,autoplay:!1,showOnlyActiveDate:!0}}=ge,[r,a]=j.useState(0),[te,ie]=j.useState(0),[Y,we]=j.useState(d.autoplay),f=Ae.sort(ke.uniqBy(s.filter(t=>t.date!==void 0&&t.date!==null),t=>t.date).map(t=>Ie.parse(`${t.date}`,d.dateFormat||"yyyy",new Date).getTime()),(t,H)=>ot.ascending(t,H)),[e,p]=j.useState(d.autoplay?0:f.length-1),[o,Ee]=j.useState(void 0),F=j.useRef(null),Me=j.useRef(null);j.useEffect(()=>{const t=new ResizeObserver(H=>{a(m||H[0].target.clientWidth||620),ie(R||H[0].target.clientHeight||480)});return F.current&&(ie(F.current.clientHeight||480),a(F.current.clientWidth||620),m||t.observe(F.current)),()=>t.disconnect()},[m,R]),j.useEffect(()=>{const t=setInterval(()=>{p(H=>H<f.length-1?H+1:0)},(d.speed||2)*1e3);return Y||clearInterval(t),()=>clearInterval(t)},[f,Y,d.speed]);const qe=Ae.getSliderMarks(f,e,d.showOnlyActiveDate,d.dateFormat||"yyyy");return i.jsxRuntimeExports.jsx("div",{className:`${y||"light"} flex ${m?"w-fit grow-0":"w-full grow"}`,dir:n==="he"||n==="ar"?"rtl":void 0,children:i.jsxRuntimeExports.jsx("div",{className:Se.cnExports.cn(`${I?I===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${n||"en"}`,h?.graphContainer),style:{...v?.graphContainer||{},...I&&I!==!0?{backgroundColor:I}:{}},id:Re,ref:Me,"aria-label":T||`${M?`The graph shows ${M}. `:""}This is a scatter plot that shows correlation between two variables.${l?` ${l}`:""}`,children:i.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:I?U||"1rem":U||0},children:i.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[M||l||x||u?i.jsxRuntimeExports.jsx(et.GraphHeader,{styles:{title:v?.title,description:v?.description},classNames:{title:h?.title,description:h?.description},graphTitle:M,graphDescription:l,width:m,graphDownload:x?Me.current:void 0,dataDownload:u?s.map(t=>t.data).filter(t=>t!==void 0).length>0?s.map(t=>t.data).filter(t=>t!==void 0):s.filter(t=>t!==void 0):null}):null,d.enabled&&f.length>0&&qe?i.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[i.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{we(!Y)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":Y?"Click to pause animation":"Click to play animation",children:Y?i.jsxRuntimeExports.jsx(Ye.Pause,{}):i.jsxRuntimeExports.jsx(Ye.Play,{})}),i.jsxRuntimeExports.jsx(Ae.SliderUIExports.SliderUI,{min:f[0],max:f[f.length-1],marks:qe,step:null,defaultValue:f[f.length-1],value:f[e],onChangeComplete:t=>{p(f.indexOf(t))},onChange:t=>{p(f.indexOf(t))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,i.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:s.length===0?i.jsxRuntimeExports.jsx(it.EmptyState,{}):i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[Q&&s.filter(t=>t.color).length!==0?i.jsxRuntimeExports.jsx(tt.ColorLegendWithMouseOver,{width:m,colorLegendTitle:pe,colors:q||N.Colors[y].categoricalColors.colors,colorDomain:W||ke.uniqBy(s.filter(t=>t.color),"color").map(t=>t.color),setSelectedColor:Ee,showNAColor:A}):null,i.jsxRuntimeExports.jsx("div",{className:"flex flex-col grow justify-center w-full leading-0",ref:F,"aria-label":"Graph area",children:(m||r)&&(R||te)?i.jsxRuntimeExports.jsx(rt,{data:st.ensureCompleteDataForScatterPlot(s,d.dateFormat||"yyyy").filter(t=>d.enabled?t.date===Ie.format(new Date(f[e]),d.dateFormat||"yyyy"):t),width:m||r,height:Math.max(S,R||(B?S?(m||r)*B>S?(m||r)*B:S:(m||r)*B:te)),colorDomain:s.filter(t=>t.color).length===0?[]:W||ke.uniqBy(s.filter(t=>t.color),"color").map(t=>t.color),colors:s.filter(t=>t.color).length===0?q?[q]:[N.Colors.primaryColors["blue-600"]]:q||N.Colors[y].categoricalColors.colors,xAxisTitle:oe,yAxisTitle:re,refXValues:Oe,refYValues:E,showLabels:C,radius:ye,leftMargin:je,rightMargin:ve,topMargin:G,bottomMargin:L,tooltip:be,onSeriesMouseOver:w,highlightAreaSettings:V,highlightedDataPoints:s.filter(t=>t.label).length===0?[]:Ce,selectedColor:o,maxRadiusValue:c.checkIfNullOrUndefined(z)?Math.max(...s.map(t=>t.radius).filter(t=>t!=null)):z,maxXValue:c.checkIfNullOrUndefined(Z)?Math.max(...s.map(t=>t.x).filter(t=>t!=null))>0?Math.max(...s.map(t=>t.x).filter(t=>t!=null)):0:Z,minXValue:c.checkIfNullOrUndefined(k)?Math.min(...s.map(t=>t.x).filter(t=>t!=null))>0?0:Math.min(...s.map(t=>t.x).filter(t=>t!=null)):k,maxYValue:c.checkIfNullOrUndefined(ne)?Math.max(...s.map(t=>t.y).filter(t=>t!=null))>0?Math.max(...s.map(t=>t.y).filter(t=>t!=null)):0:ne,minYValue:c.checkIfNullOrUndefined(le)?Math.min(...s.map(t=>t.y).filter(t=>t!=null))>0?0:Math.min(...s.map(t=>t.y).filter(t=>t!=null)):le,onSeriesMouseClick:ue,rtl:n==="he"||n==="ar",annotations:fe,customHighlightAreaSettings:de,regressionLine:$,resetSelectionOnDoubleClick:D,detailsOnClick:X,noOfXTicks:me,noOfYTicks:P,labelColor:he,xSuffix:ee,ySuffix:ae,xPrefix:ce,yPrefix:xe,styles:v,classNames:h,animate:_===!0?{duration:.5,once:!0,amount:.5}:_||{duration:0,once:!0,amount:0},dimmedOpacity:g,precision:b,customLayers:O}):null})]})}),se||J?i.jsxRuntimeExports.jsx(Ze.GraphFooter,{styles:{footnote:v?.footnote,source:v?.source},classNames:{footnote:h?.footnote,source:h?.source},sources:se,footNote:J,width:m}):null]})})})})}exports.ScatterPlot=nt;
2
+ //# sourceMappingURL=ScatterPlot.js.map