@undp/data-viz 1.4.1 → 1.4.3

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 (210) hide show
  1. package/dist/AreaChart.cjs +1 -1
  2. package/dist/AreaChart.js +21 -21
  3. package/dist/BarGraph.cjs +1 -1
  4. package/dist/BarGraph.js +7 -7
  5. package/dist/BeeSwarmChart.cjs +1 -1
  6. package/dist/BeeSwarmChart.js +2 -2
  7. package/dist/BiVariateChoroplethMap.cjs +1 -1
  8. package/dist/BiVariateChoroplethMap.js +5 -5
  9. package/dist/BulletChart.cjs +1 -1
  10. package/dist/BulletChart.js +14 -14
  11. package/dist/ButterflyChart.cjs +1 -1
  12. package/dist/ButterflyChart.js +9 -9
  13. package/dist/ChoroplethMap.cjs +1 -1
  14. package/dist/ChoroplethMap.js +9 -9
  15. package/dist/CirclePackingGraph.cjs +1 -1
  16. package/dist/CirclePackingGraph.js +1 -1
  17. package/dist/CopyTextButton.cjs +7 -7
  18. package/dist/CopyTextButton.cjs.map +1 -1
  19. package/dist/CopyTextButton.js +4 -4
  20. package/dist/CopyTextButton.js.map +1 -1
  21. package/dist/DataCards.cjs +9 -9
  22. package/dist/DataCards.cjs.map +1 -1
  23. package/dist/DataCards.js +93 -93
  24. package/dist/DataCards.js.map +1 -1
  25. package/dist/DifferenceLineChart.cjs +1 -1
  26. package/dist/DifferenceLineChart.js +18 -18
  27. package/dist/DonutChart.cjs +1 -1
  28. package/dist/DonutChart.js +1 -1
  29. package/dist/DotDensityMap.cjs +1 -1
  30. package/dist/DotDensityMap.js +8 -8
  31. package/dist/{DropdownSelect-0I2QxaVy.cjs → DropdownSelect-BmE5JaeE.cjs} +6 -6
  32. package/dist/{DropdownSelect-0I2QxaVy.cjs.map → DropdownSelect-BmE5JaeE.cjs.map} +1 -1
  33. package/dist/{DropdownSelect-CDC9lEqU.js → DropdownSelect-CeHog_ih.js} +4 -4
  34. package/dist/{DropdownSelect-CDC9lEqU.js.map → DropdownSelect-CeHog_ih.js.map} +1 -1
  35. package/dist/DualAxisLineChart.cjs +1 -1
  36. package/dist/DualAxisLineChart.js +15 -15
  37. package/dist/DumbbellChart.cjs +1 -1
  38. package/dist/DumbbellChart.js +13 -13
  39. package/dist/GeoHubMap.cjs +1 -1
  40. package/dist/GeoHubMap.js +2 -2
  41. package/dist/GeoHubMapWithLayerSelection.cjs +1 -1
  42. package/dist/GeoHubMapWithLayerSelection.js +2 -2
  43. package/dist/{GraphEl-B6SoGRFW.cjs → GraphEl-B5gAX1IQ.cjs} +2 -2
  44. package/dist/{GraphEl-B6SoGRFW.cjs.map → GraphEl-B5gAX1IQ.cjs.map} +1 -1
  45. package/dist/{GraphEl-Cw2tDUb3.js → GraphEl-BdIyscdt.js} +3 -3
  46. package/dist/{GraphEl-Cw2tDUb3.js.map → GraphEl-BdIyscdt.js.map} +1 -1
  47. package/dist/GriddedGraphs.cjs +1 -1
  48. package/dist/GriddedGraphs.d.ts +4 -7
  49. package/dist/GriddedGraphs.js +4 -4
  50. package/dist/GriddedGraphsFromConfig.cjs +1 -1
  51. package/dist/GriddedGraphsFromConfig.d.ts +4 -7
  52. package/dist/GriddedGraphsFromConfig.js +1 -1
  53. package/dist/HeatMap.cjs +1 -1
  54. package/dist/HeatMap.js +10 -10
  55. package/dist/Histogram.cjs +1 -1
  56. package/dist/Histogram.js +1 -1
  57. package/dist/LineChartWithConfidenceInterval.cjs +1 -1
  58. package/dist/LineChartWithConfidenceInterval.js +21 -21
  59. package/dist/{Modal-CUU6ZK3U.js → Modal-DVVwpKhP.js} +2 -2
  60. package/dist/{Modal-CUU6ZK3U.js.map → Modal-DVVwpKhP.js.map} +1 -1
  61. package/dist/{Modal-C_dl0EtQ.cjs → Modal-tXZlLE5s.cjs} +4 -4
  62. package/dist/{Modal-C_dl0EtQ.cjs.map → Modal-tXZlLE5s.cjs.map} +1 -1
  63. package/dist/MultiGraphDashboard.cjs +1 -1
  64. package/dist/MultiGraphDashboard.d.ts +4 -7
  65. package/dist/MultiGraphDashboard.js +3 -3
  66. package/dist/MultiGraphDashboardFromConfig.cjs +1 -1
  67. package/dist/MultiGraphDashboardFromConfig.d.ts +4 -7
  68. package/dist/MultiGraphDashboardFromConfig.js +1 -1
  69. package/dist/MultiGraphDashboardWideToLongFormat.cjs +1 -1
  70. package/dist/MultiGraphDashboardWideToLongFormat.js +3 -3
  71. package/dist/MultiGraphDashboardWideToLongFormatFromConfig.cjs +1 -1
  72. package/dist/MultiGraphDashboardWideToLongFormatFromConfig.js +1 -1
  73. package/dist/MultiLineAltChart.cjs +1 -1
  74. package/dist/MultiLineAltChart.js +21 -21
  75. package/dist/MultiLineChart.cjs +1 -1
  76. package/dist/MultiLineChart.js +19 -19
  77. package/dist/ParetoChart.cjs +1 -1
  78. package/dist/ParetoChart.js +12 -12
  79. package/dist/PerformanceIntensiveMultiGraphDashboard.cjs +1 -1
  80. package/dist/PerformanceIntensiveMultiGraphDashboard.d.ts +4 -7
  81. package/dist/PerformanceIntensiveMultiGraphDashboard.js +3 -3
  82. package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.cjs +1 -1
  83. package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.d.ts +4 -7
  84. package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.js +1 -1
  85. package/dist/PerformanceIntensiveScrollStory.cjs +1 -1
  86. package/dist/PerformanceIntensiveScrollStory.d.ts +4 -7
  87. package/dist/PerformanceIntensiveScrollStory.js +2 -2
  88. package/dist/RadarChart.cjs +1 -1
  89. package/dist/RadarChart.js +8 -8
  90. package/dist/{ReferenceLine-CuFMk0cI.cjs → ReferenceLine-CFVBBN__.cjs} +2 -2
  91. package/dist/{ReferenceLine-CuFMk0cI.cjs.map → ReferenceLine-CFVBBN__.cjs.map} +1 -1
  92. package/dist/{ReferenceLine-C1GpoG9d.js → ReferenceLine-CfAW3vKJ.js} +2 -2
  93. package/dist/{ReferenceLine-C1GpoG9d.js.map → ReferenceLine-CfAW3vKJ.js.map} +1 -1
  94. package/dist/{RegressionLine-BFwDCTUU.js → RegressionLine-mH7UKOPi.js} +3 -3
  95. package/dist/{RegressionLine-BFwDCTUU.js.map → RegressionLine-mH7UKOPi.js.map} +1 -1
  96. package/dist/{RegressionLine-7_rKTHN_.cjs → RegressionLine-xKdiJ8sw.cjs} +2 -2
  97. package/dist/{RegressionLine-7_rKTHN_.cjs.map → RegressionLine-xKdiJ8sw.cjs.map} +1 -1
  98. package/dist/SankeyChart.cjs +1 -1
  99. package/dist/SankeyChart.js +4 -4
  100. package/dist/ScatterPlot.cjs +1 -1
  101. package/dist/ScatterPlot.js +13 -13
  102. package/dist/ScrollStory.cjs +1 -1
  103. package/dist/ScrollStory.d.ts +4 -7
  104. package/dist/ScrollStory.js +2 -2
  105. package/dist/SimpleLineChart.cjs +1 -1
  106. package/dist/SimpleLineChart.js +20 -20
  107. package/dist/SingleGraphDashboard.cjs +1 -1
  108. package/dist/SingleGraphDashboard.d.ts +4 -7
  109. package/dist/SingleGraphDashboard.js +4 -4
  110. package/dist/SingleGraphDashboardFromConfig.cjs +1 -1
  111. package/dist/SingleGraphDashboardFromConfig.d.ts +4 -7
  112. package/dist/SingleGraphDashboardFromConfig.js +1 -1
  113. package/dist/SingleGraphDashboardGeoHubMaps.d.ts +4 -7
  114. package/dist/SingleGraphDashboardGeoHubMapsFromConfig.cjs +1 -1
  115. package/dist/SingleGraphDashboardGeoHubMapsFromConfig.d.ts +4 -7
  116. package/dist/SingleGraphDashboardGeoHubMapsFromConfig.js +1 -1
  117. package/dist/SingleGraphDashboardThreeDGraphs.cjs +1 -1
  118. package/dist/SingleGraphDashboardThreeDGraphs.cjs.map +1 -1
  119. package/dist/SingleGraphDashboardThreeDGraphs.d.ts +4 -7
  120. package/dist/SingleGraphDashboardThreeDGraphs.js +30 -27
  121. package/dist/SingleGraphDashboardThreeDGraphs.js.map +1 -1
  122. package/dist/SingleGraphDashboardThreeDGraphsFromConfig.cjs +1 -1
  123. package/dist/SingleGraphDashboardThreeDGraphsFromConfig.d.ts +4 -7
  124. package/dist/SingleGraphDashboardThreeDGraphsFromConfig.js +1 -1
  125. package/dist/SlopeChart.cjs +1 -1
  126. package/dist/SlopeChart.js +7 -7
  127. package/dist/StripChart.cjs +1 -1
  128. package/dist/StripChart.js +9 -9
  129. package/dist/ThreeDGlobe.cjs +1 -1
  130. package/dist/ThreeDGlobe.cjs.map +1 -1
  131. package/dist/ThreeDGlobe.d.ts +11 -2
  132. package/dist/ThreeDGlobe.js +278 -253
  133. package/dist/ThreeDGlobe.js.map +1 -1
  134. package/dist/TreeMapGraph.cjs +1 -1
  135. package/dist/TreeMapGraph.js +4 -4
  136. package/dist/Types.d.ts +4 -7
  137. package/dist/UnitChart.cjs +1 -1
  138. package/dist/UnitChart.js +3 -3
  139. package/dist/{XAxesLabels-DQFo_z2R.js → XAxesLabels-CaV2q-6H.js} +2 -2
  140. package/dist/{XAxesLabels-DQFo_z2R.js.map → XAxesLabels-CaV2q-6H.js.map} +1 -1
  141. package/dist/{XAxesLabels-CJMQbfVy.cjs → XAxesLabels-OjBNl_lS.cjs} +2 -2
  142. package/dist/{XAxesLabels-CJMQbfVy.cjs.map → XAxesLabels-OjBNl_lS.cjs.map} +1 -1
  143. package/dist/{YAxesLabels-H5-002X5.js → YAxesLabels-CPGZjmZJ.js} +2 -2
  144. package/dist/{YAxesLabels-H5-002X5.js.map → YAxesLabels-CPGZjmZJ.js.map} +1 -1
  145. package/dist/{YAxesLabels-BXLTX7AI.cjs → YAxesLabels-D8IydyZj.cjs} +2 -2
  146. package/dist/{YAxesLabels-BXLTX7AI.cjs.map → YAxesLabels-D8IydyZj.cjs.map} +1 -1
  147. package/dist/{checkIfMultiple-Do4kADNr.cjs → checkIfMultiple-BXbHUCWM.cjs} +6 -6
  148. package/dist/{checkIfMultiple-Do4kADNr.cjs.map → checkIfMultiple-BXbHUCWM.cjs.map} +1 -1
  149. package/dist/{checkIfMultiple-CYp3vADF.js → checkIfMultiple-ChTJk2Tk.js} +5 -5
  150. package/dist/{checkIfMultiple-CYp3vADF.js.map → checkIfMultiple-ChTJk2Tk.js.map} +1 -1
  151. package/dist/{customArea-CaxScFmW.js → customArea-B-dWU0zZ.js} +2 -2
  152. package/dist/{customArea-CaxScFmW.js.map → customArea-B-dWU0zZ.js.map} +1 -1
  153. package/dist/{customArea-BYNyxAkm.cjs → customArea-CK768gCn.cjs} +2 -2
  154. package/dist/{customArea-BYNyxAkm.cjs.map → customArea-CK768gCn.cjs.map} +1 -1
  155. package/dist/{fetchAndParseData-Bcmr659B.js → fetchAndParseData-4gsYTy6_.js} +3 -3
  156. package/dist/fetchAndParseData-4gsYTy6_.js.map +1 -0
  157. package/dist/{fetchAndParseData-DmgQtB9n.cjs → fetchAndParseData-CQyVGCul.cjs} +6 -6
  158. package/dist/fetchAndParseData-CQyVGCul.cjs.map +1 -0
  159. package/dist/fetchAndParseData.cjs +1 -1
  160. package/dist/fetchAndParseData.js +1 -1
  161. package/dist/index-BW8iNx7E.cjs +10 -0
  162. package/dist/index-BW8iNx7E.cjs.map +1 -0
  163. package/dist/index-CNvov0eg.js +122 -0
  164. package/dist/index-CNvov0eg.js.map +1 -0
  165. package/dist/{index-D_n8aamX.cjs → index-CZLvTu6p.cjs} +2 -2
  166. package/dist/{index-D_n8aamX.cjs.map → index-CZLvTu6p.cjs.map} +1 -1
  167. package/dist/{index-n_RI8T0n.js → index-Cdcfp4nk.js} +2 -2
  168. package/dist/{index-n_RI8T0n.js.map → index-Cdcfp4nk.js.map} +1 -1
  169. package/dist/{index-BVnYktl4.js → index-DGAaLNu9.js} +2 -2
  170. package/dist/{index-BVnYktl4.js.map → index-DGAaLNu9.js.map} +1 -1
  171. package/dist/{index-CylX-pWB.cjs → index-DNj994Pv.cjs} +2 -2
  172. package/dist/{index-CylX-pWB.cjs.map → index-DNj994Pv.cjs.map} +1 -1
  173. package/dist/index.cjs +1 -1
  174. package/dist/index.d.ts +15 -9
  175. package/dist/index.js +3 -3
  176. package/dist/proxy-BHRoeZgd.cjs +2 -0
  177. package/dist/proxy-BHRoeZgd.cjs.map +1 -0
  178. package/dist/{proxy-DJxJg1kD.js → proxy-CkpFesk1.js} +4123 -4075
  179. package/dist/proxy-CkpFesk1.js.map +1 -0
  180. package/dist/style.css +1 -1
  181. package/dist/transformData.cjs +1 -1
  182. package/dist/transformData.js +2 -2
  183. package/dist/{transformDataForGraphFromFile-D9G3ToQf.cjs → transformDataForGraphFromFile-B1A0AS-Z.cjs} +2 -2
  184. package/dist/{transformDataForGraphFromFile-D9G3ToQf.cjs.map → transformDataForGraphFromFile-B1A0AS-Z.cjs.map} +1 -1
  185. package/dist/{transformDataForGraphFromFile-CA0rw80A.js → transformDataForGraphFromFile-BCjsizvb.js} +2 -2
  186. package/dist/{transformDataForGraphFromFile-CA0rw80A.js.map → transformDataForGraphFromFile-BCjsizvb.js.map} +1 -1
  187. package/dist/{use-in-view-BCmzDU2O.cjs → use-in-view-sQJZ_xDO.cjs} +2 -2
  188. package/dist/use-in-view-sQJZ_xDO.cjs.map +1 -0
  189. package/dist/{use-in-view-BAHrBy6b.js → use-in-view-yS6jzJAp.js} +2 -2
  190. package/dist/use-in-view-yS6jzJAp.js.map +1 -0
  191. package/dist/x-BBpi7a_7-Dz2vKSfu.cjs +27 -0
  192. package/dist/x-BBpi7a_7-Dz2vKSfu.cjs.map +1 -0
  193. package/dist/x-BBpi7a_7-WVdj1j6r.js +106 -0
  194. package/dist/x-BBpi7a_7-WVdj1j6r.js.map +1 -0
  195. package/package.json +50 -51
  196. package/dist/fetchAndParseData-Bcmr659B.js.map +0 -1
  197. package/dist/fetchAndParseData-DmgQtB9n.cjs.map +0 -1
  198. package/dist/index-BxAUvrua.js +0 -120
  199. package/dist/index-BxAUvrua.js.map +0 -1
  200. package/dist/index-DVOJ7vxH.cjs +0 -10
  201. package/dist/index-DVOJ7vxH.cjs.map +0 -1
  202. package/dist/proxy-DJxJg1kD.js.map +0 -1
  203. package/dist/proxy-PQd2AItT.cjs +0 -2
  204. package/dist/proxy-PQd2AItT.cjs.map +0 -1
  205. package/dist/use-in-view-BAHrBy6b.js.map +0 -1
  206. package/dist/use-in-view-BCmzDU2O.cjs.map +0 -1
  207. package/dist/x-CnsEH4Ox-CGGXQl4M.cjs +0 -27
  208. package/dist/x-CnsEH4Ox-CGGXQl4M.cjs.map +0 -1
  209. package/dist/x-CnsEH4Ox-DDvAJndW.js +0 -101
  210. package/dist/x-CnsEH4Ox-DDvAJndW.js.map +0 -1
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-CHPV5EwG-DDoeWRVt.cjs"),d=require("react"),y=require("./SingleGraphDashboard.cjs"),m=require("./SingleGraphDashboardThreeDGraphs.cjs"),j=require("./SingleGraphDashboardGeoHubMaps.cjs"),b=require("./proxy-PQd2AItT.cjs"),D=require("./use-in-view-BCmzDU2O.cjs");function v(s){const{chapters:h,visibilityThreshold:g=.5,mode:i="overlay",infoWidth:n="320px",infoPosition:o="left",infoBackgroundColor:c="rgba(255,255,255,0.8)"}=s,[e,p]=d.useState(0),x=["threeDGlobe"],f=["geoHubCompareMap","geoHubMap","geoHubMapWithLayerSelection"],t=[];return h.forEach((a,u)=>{a.sections.forEach((l,S)=>{t.push({chapter:u,dataSettings:a.dataSettings,section:S,graphType:a.graphType,infoBox:l.infoBox,graphSettings:{...a.graphSettings,...l.graphSettings||{},animate:!0},graphDataConfiguration:l.graphDataConfiguration||a.graphDataConfiguration||[]})})}),r.jsxRuntimeExports.jsxs("div",{className:"relative w-full h-full",children:[r.jsxRuntimeExports.jsx(b.motion.div,{className:"fixed top-0 h-full -z-10",initial:{opacity:0},animate:{opacity:1},transition:{duration:.5},style:{left:i==="overlay"||o==="right"?0:n,width:i==="overlay"?"100%":`calc(100% - ${n})`},children:x.includes(t[e].graphType)?r.jsxRuntimeExports.jsx(m.SingleGraphDashboardThreeDGraphs,{graphType:t[e].graphType,dataSettings:t[e].dataSettings,graphSettings:t[e].graphSettings,graphDataConfiguration:t[e].graphDataConfiguration}):f.includes(t[e].graphType)?r.jsxRuntimeExports.jsx(j.SingleGraphDashboardGeoHubMaps,{graphType:t[e].graphType,graphSettings:t[e].graphSettings}):r.jsxRuntimeExports.jsx(y.SingleGraphDashboard,{graphType:t[e].graphType,dataSettings:t[e].dataSettings,graphSettings:t[e].graphSettings,graphDataConfiguration:t[e].graphDataConfiguration})},t[e].chapter),r.jsxRuntimeExports.jsx("div",{children:t.map((a,u)=>r.jsxRuntimeExports.jsx(T,{width:n,index:u,infoBox:a.infoBox,setActiveIndex:p,position:o,mode:i,visibilityThreshold:g,backgroundColor:c},`${a.chapter}-${a.section}`))})]})}function T({infoBox:s,index:h,setActiveIndex:g,position:i,mode:n,visibilityThreshold:o,backgroundColor:c,width:e}){const p=d.useRef(null);return D.useInView(p,{once:!1,amount:o})&&g(h),r.jsxRuntimeExports.jsx("section",{ref:p,className:`min-h-screen flex ${i==="center"?"justify-center":i==="right"?"justify-end":"justify-start"}`,children:r.jsxRuntimeExports.jsxs("div",{className:`p-8 ${n==="overlay"?"h-fit mx-10 ":""}`,style:{backgroundColor:c,width:e},children:[s.title,s.description]})})}exports.PerformanceIntensiveScrollStory=v;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-CHPV5EwG-DDoeWRVt.cjs"),d=require("react"),y=require("./SingleGraphDashboard.cjs"),m=require("./SingleGraphDashboardThreeDGraphs.cjs"),j=require("./SingleGraphDashboardGeoHubMaps.cjs"),b=require("./proxy-BHRoeZgd.cjs"),D=require("./use-in-view-sQJZ_xDO.cjs");function v(s){const{chapters:h,visibilityThreshold:g=.5,mode:i="overlay",infoWidth:n="320px",infoPosition:o="left",infoBackgroundColor:c="rgba(255,255,255,0.8)"}=s,[e,p]=d.useState(0),x=["threeDGlobe"],f=["geoHubCompareMap","geoHubMap","geoHubMapWithLayerSelection"],t=[];return h.forEach((a,u)=>{a.sections.forEach((l,S)=>{t.push({chapter:u,dataSettings:a.dataSettings,section:S,graphType:a.graphType,infoBox:l.infoBox,graphSettings:{...a.graphSettings,...l.graphSettings||{},animate:!0},graphDataConfiguration:l.graphDataConfiguration||a.graphDataConfiguration||[]})})}),r.jsxRuntimeExports.jsxs("div",{className:"relative w-full h-full",children:[r.jsxRuntimeExports.jsx(b.motion.div,{className:"fixed top-0 h-full -z-10",initial:{opacity:0},animate:{opacity:1},transition:{duration:.5},style:{left:i==="overlay"||o==="right"?0:n,width:i==="overlay"?"100%":`calc(100% - ${n})`},children:x.includes(t[e].graphType)?r.jsxRuntimeExports.jsx(m.SingleGraphDashboardThreeDGraphs,{graphType:t[e].graphType,dataSettings:t[e].dataSettings,graphSettings:t[e].graphSettings,graphDataConfiguration:t[e].graphDataConfiguration}):f.includes(t[e].graphType)?r.jsxRuntimeExports.jsx(j.SingleGraphDashboardGeoHubMaps,{graphType:t[e].graphType,graphSettings:t[e].graphSettings}):r.jsxRuntimeExports.jsx(y.SingleGraphDashboard,{graphType:t[e].graphType,dataSettings:t[e].dataSettings,graphSettings:t[e].graphSettings,graphDataConfiguration:t[e].graphDataConfiguration})},t[e].chapter),r.jsxRuntimeExports.jsx("div",{children:t.map((a,u)=>r.jsxRuntimeExports.jsx(T,{width:n,index:u,infoBox:a.infoBox,setActiveIndex:p,position:o,mode:i,visibilityThreshold:g,backgroundColor:c},`${a.chapter}-${a.section}`))})]})}function T({infoBox:s,index:h,setActiveIndex:g,position:i,mode:n,visibilityThreshold:o,backgroundColor:c,width:e}){const p=d.useRef(null);return D.useInView(p,{once:!1,amount:o})&&g(h),r.jsxRuntimeExports.jsx("section",{ref:p,className:`min-h-screen flex ${i==="center"?"justify-center":i==="right"?"justify-end":"justify-start"}`,children:r.jsxRuntimeExports.jsxs("div",{className:`p-8 ${n==="overlay"?"h-fit mx-10 ":""}`,style:{backgroundColor:c,width:e},children:[s.title,s.description]})})}exports.PerformanceIntensiveScrollStory=v;
2
2
  //# sourceMappingURL=PerformanceIntensiveScrollStory.cjs.map
@@ -359,7 +359,7 @@ declare interface GraphSettingsDataType {
359
359
  labelsToBeHidden?: (string | number)[];
360
360
  autoRotate?: boolean;
361
361
  enableZoom?: boolean;
362
- globeMaterial?: MaterialDataType;
362
+ globeMaterial?: any;
363
363
  categorical?: boolean;
364
364
  atmosphereColor?: string;
365
365
  lineAxisTitle?: string;
@@ -367,6 +367,9 @@ declare interface GraphSettingsDataType {
367
367
  naLabel?: string;
368
368
  globeOffset?: [number, number];
369
369
  polygonAltitude?: number;
370
+ atmosphereAltitude?: number;
371
+ globeCurvatureResolution?: number;
372
+ lightColor?: string;
370
373
  }
371
374
 
372
375
  declare type GraphType = GraphTypeForGriddedGraph;
@@ -403,12 +406,6 @@ declare interface MapLegendDataType {
403
406
 
404
407
  declare type MapProjectionTypes = 'mercator' | 'equalEarth' | 'naturalEarth' | 'orthographic' | 'albersUSA';
405
408
 
406
- declare interface MaterialDataType {
407
- color: string;
408
- opacity: number;
409
- transparent: boolean;
410
- }
411
-
412
409
  declare interface PerformanceIntensiveChaptersDataType {
413
410
  dataSettings: DataSettingsDataType;
414
411
  graphSettings: GraphSettingsDataType;
@@ -3,8 +3,8 @@ import { useState as y, useRef as S } from "react";
3
3
  import { SingleGraphDashboard as x } from "./SingleGraphDashboard.js";
4
4
  import { SingleGraphDashboardThreeDGraphs as j } from "./SingleGraphDashboardThreeDGraphs.js";
5
5
  import { SingleGraphDashboardGeoHubMaps as v } from "./SingleGraphDashboardGeoHubMaps.js";
6
- import { m as D } from "./proxy-DJxJg1kD.js";
7
- import { u as b } from "./use-in-view-BAHrBy6b.js";
6
+ import { m as D } from "./proxy-CkpFesk1.js";
7
+ import { u as b } from "./use-in-view-yS6jzJAp.js";
8
8
  function B(n) {
9
9
  const {
10
10
  chapters: h,
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index-CHPV5EwG-DDoeWRVt.cjs"),f=require("react"),xt=require("./index-CZbIGs8q.cjs"),wt=require("./index-BXns0-ng.cjs"),bt=require("./Modal-C_dl0EtQ.cjs"),Et=require("./Tooltip-n8z5bfav.cjs"),q=require("./Colors.cjs"),dt=require("./numberFormattingFunction-02t-wJta.cjs"),kt=require("./string2HTML-D2Avudmb.cjs"),N=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),Rt=require("./use-in-view-BCmzDU2O.cjs"),pt=require("./linear-BVckp9RD.cjs"),mt=require("./line-DHV4JwCR.cjs"),W=require("./proxy-PQd2AItT.cjs"),Ct=require("./index-DVOJ7vxH.cjs"),It=require("./GraphFooter.cjs"),St=require("./GraphHeader.cjs"),Nt=require("./EmptyState-d8_8SxeW.cjs"),Ot=require("./ColorLegendWithMouseOver.cjs");var Pt=gt(mt.curveLinear);function ft(t){this._curve=t}ft.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}};function gt(t){function e(r){return new ft(t(r))}return e._curve=t,e}function Tt(t){var e=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(r){return arguments.length?e(gt(r)):e()._curve},t}function $t(){return Tt(mt.line().curve(Pt))}function it(){}function ht(t,e,r){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-r),t._x2,t._y2)}function _t(t,e){this._context=t,this._k=(1-e)/6}_t.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:ht(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:ht(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};(function t(e){function r(c){return new _t(c,e)}return r.tension=function(c){return t(+c)},r})(0);function yt(t,e){this._context=t,this._k=(1-e)/6}yt.prototype={areaStart:it,areaEnd:it,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:ht(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const qt=function t(e){function r(c){return new yt(c,e)}return r.tension=function(c){return t(+c)},r}(0);function vt(t){this._context=t}vt.prototype={areaStart:it,areaEnd:it,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function Vt(t){return new vt(t)}function Dt(t){const{data:e,radius:r,lineColors:c,tooltip:k,onSeriesMouseOver:V,onSeriesMouseClick:M,colorDomain:u,detailsOnClick:j,styles:y,classNames:d,selectedColor:O,axisLabels:G,strokeWidth:et,showValues:nt,showDots:st,rightMargin:ot,topMargin:U,bottomMargin:rt,leftMargin:D,curveType:X,noOfTicks:Y,minValue:P,maxValue:T,resetSelectionOnDoubleClick:at,fillShape:h,highlightedLines:g,animate:x,dimmedOpacity:_,precision:R,customLayers:z}=t,B=f.useRef(null),$=Rt.useInView(B,{once:x.once,amount:x.amount}),w=X==="linear"?Vt:qt,b={top:U,left:D},v=Math.min((2*r-D-ot)/2,(2*r-U-rt)/2),[E,L]=f.useState(void 0),[C,A]=f.useState(void 0),[J,H]=f.useState(void 0),[K,F]=f.useState(void 0),l=pt.linear().domain([0,e[0].values.length]).range([0,2*Math.PI]),Q=N.checkIfNullOrUndefined(T)?Math.max(...e.map(i=>Math.max(...i.values.filter(s=>!N.checkIfNullOrUndefined(s)))))<0?0:Math.max(...e.map(i=>Math.max(...i.values.filter(s=>!N.checkIfNullOrUndefined(s))))):T,lt=N.checkIfNullOrUndefined(P)?Math.min(...e.map(i=>Math.min(...i.values.filter(s=>!N.checkIfNullOrUndefined(s)))))>=0?0:Math.min(...e.map(i=>Math.min(...i.values.filter(s=>!N.checkIfNullOrUndefined(s))))):P,p=pt.linear().domain([lt,Q]).range([0,v]).nice(),ct=p.ticks(Y),I=$t().radius(i=>p(i)).angle((i,s)=>l(s)).curve(w);return n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsx(W.motion.svg,{width:`${r*2}px`,height:`${r*2}px`,viewBox:`0 0 ${r*2} ${r*2}`,direction:"ltr",ref:B,children:n.jsxRuntimeExports.jsxs("g",{transform:`translate(${b.left},${b.top})`,children:[z.filter(i=>i.position==="before").map(i=>i.layer),n.jsxRuntimeExports.jsxs("g",{transform:`translate(${v},${v})`,children:[G.map((i,s)=>n.jsxRuntimeExports.jsxs("g",{children:[n.jsxRuntimeExports.jsx("line",{x1:0,y1:0,x2:Math.cos(l(s)-Math.PI/2)*v,y2:Math.sin(l(s)-Math.PI/2)*v,className:n.mo("stroke-1 stroke-primary-gray-500 dark:stroke-primary-gray-550",d?.xAxis?.axis),style:y?.xAxis?.axis},s),n.jsxRuntimeExports.jsx("text",{x:Math.cos(l(s)-Math.PI/2)*(v+6),y:Math.sin(l(s)-Math.PI/2)*(v+6),style:{textAnchor:Math.cos(l(s)-Math.PI/2)<0?"end":Math.cos(l(s)-Math.PI/2)<1e-5?"middle":"start",...y?.xAxis?.labels||""},dy:Math.sin(l(s)-Math.PI/2)<0?0:Math.sin(l(s)-Math.PI/2)<1e-5?5:10,className:n.mo("fill-primary-gray-700 dark:fill-primary-gray-300 text-xs",d?.xAxis?.labels),children:i})]},s)),ct.map((i,s)=>n.jsxRuntimeExports.jsxs("g",{children:[n.jsxRuntimeExports.jsx("path",{d:I(Array(G.length).fill(i))||"",className:n.mo("stroke-primary-gray-500 dark:stroke-primary-gray-550",d?.xAxis?.gridLines),style:{...y?.xAxis?.gridLines,fill:"none"}}),n.jsxRuntimeExports.jsx("foreignObject",{x:-25,y:Math.sin(-Math.PI/2)*p(i)>-1e-4?Math.sin(-Math.PI/2)*p(i)-7:Math.sin(-Math.PI/2)*p(i)-5,width:50,height:12,children:n.jsxRuntimeExports.jsx("div",{className:"flex justify-center",children:n.jsxRuntimeExports.jsx("p",{className:n.mo("fill-primary-gray-500 dark:fill-primary-gray-550 text-xs m-0 py-0 px-1.5 text-center leading-none bg-primary-white dark:bg-primary-gray-700",d?.xAxis?.labels),style:y?.xAxis?.labels,children:dt.numberFormattingFunction(i,"NA",R)})})})]},s)),n.jsxRuntimeExports.jsx(Ct.AnimatePresence,{children:e.map((i,s)=>n.jsxRuntimeExports.jsxs(W.motion.g,{variants:{initial:{opacity:E?i.label===E.label?1:_:O?i.color&&c[u.indexOf(i.color)]===O?1:_:g.length!==0?i.label&&g.indexOf(i.label)!==-1?1:.3:1},whileInView:{opacity:E?i.label===E.label?1:_:O?i.color&&c[u.indexOf(i.color)]===O?1:_:g.length!==0?i.label&&g.indexOf(i.label)!==-1?1:_:1,transition:{duration:x.duration}}},initial:"initial",animate:$?"whileInView":"initial",exit:{opacity:0,transition:{duration:x.duration}},onMouseEnter:a=>{L(i),F(a.clientY),H(a.clientX),V?.(i)},onMouseMove:a=>{L(i),F(a.clientY),H(a.clientX)},onMouseLeave:()=>{L(void 0),H(void 0),F(void 0),V?.(void 0)},onClick:()=>{(M||j)&&(wt.isEqual(C,i)&&at?(A(void 0),M?.(void 0)):(A(i),M?.(i)))},children:[n.jsxRuntimeExports.jsx(W.motion.path,{d:I(i.values)||"",variants:{initial:{d:I(i.values.map(a=>0))||""},whileInView:{d:I(i.values)||"",transition:{duration:x.duration}}},initial:"initial",animate:$?"whileInView":"initial",exit:{opacity:0,transition:{duration:x.duration}},style:{stroke:e.filter(a=>a.color).length===0?c[0]:i.color?c[u.indexOf(i.color)]:q.Colors.gray,fill:h?e.filter(a=>a.color).length===0?c[0]:i.color?c[u.indexOf(i.color)]:q.Colors.gray:"none",fillOpacity:.1,strokeWidth:et}}),n.jsxRuntimeExports.jsx("g",{children:i.values.map((a,m)=>n.jsxRuntimeExports.jsx("g",{children:N.checkIfNullOrUndefined(a)?null:n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[st?n.jsxRuntimeExports.jsx(W.motion.circle,{cx:Math.cos(l(m)-Math.PI/2)*p(a),cy:Math.sin(l(m)-Math.PI/2)*p(a),r:4,style:{fill:e.filter(Z=>Z.color).length===0?c[0]:i.color?c[u.indexOf(i.color)]:q.Colors.gray},variants:{initial:{cx:0,cy:0,opacity:0},whileInView:{cx:Math.cos(l(m)-Math.PI/2)*p(a),cy:Math.sin(l(m)-Math.PI/2)*p(a),opacity:1,transition:{duration:x.duration}}},initial:"initial",animate:$?"whileInView":"initial",exit:{opacity:0,transition:{duration:x.duration}}}):null,nt?n.jsxRuntimeExports.jsx(W.motion.text,{x:Math.cos(l(m)-Math.PI/2)*(p(a)+6),y:Math.sin(l(m)-Math.PI/2)*(p(a)+6),style:{fill:c[s],textAnchor:Math.cos(l(m)-Math.PI/2)<0?"end":Math.cos(l(m)-Math.PI/2)<1e-5?"middle":"start",...y?.graphObjectValues||{}},dy:Math.sin(l(m)-Math.PI/2)<0?10:(Math.sin(l(m)-Math.PI/2)<1e-5,0),className:n.mo("graph-value text-xs font-bold",d?.graphObjectValues),variants:{initial:{opacity:0},whileInView:{opacity:1,transition:{duration:x.duration}}},initial:"initial",animate:$?"whileInView":"initial",exit:{opacity:0,transition:{duration:x.duration}},children:dt.numberFormattingFunction(a,"NA",R)}):null]})},m))})]},i.label||s))})]}),z.filter(i=>i.position==="after").map(i=>i.layer)]})}),E&&k&&J&&K?n.jsxRuntimeExports.jsx(Et.Tooltip,{data:E,body:k,xPos:J,yPos:K,backgroundStyle:y?.tooltip,className:d?.tooltip}):null,j&&C!==void 0?n.jsxRuntimeExports.jsx(bt.X,{open:C!==void 0,onClose:()=>{A(void 0)},children:n.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof j=="string"?{__html:kt.string2HTML(j,C)}:void 0,children:typeof j=="function"?j(C):null})}):null]})}function Lt(t){const{graphTitle:e,colors:r,sources:c,graphDescription:k,footNote:V,radius:M,data:u,showColorScale:j=!0,padding:y,backgroundColor:d=!1,tooltip:O,onSeriesMouseOver:G,graphID:et,onSeriesMouseClick:nt,topMargin:st=75,bottomMargin:ot=75,leftMargin:U=75,rightMargin:rt=75,graphDownload:D=!1,dataDownload:X=!1,colorDomain:Y,language:P="en",theme:T="light",highlightedLines:at=[],width:h,height:g,minHeight:x=0,strokeWidth:_=2,relativeHeight:R,ariaLabel:z,colorLegendTitle:B,detailsOnClick:$,styles:w,classNames:b,showNAColor:v=!0,axisLabels:E,showDots:L=!0,showValues:C=!1,curveType:A="curve",noOfTicks:J=5,minValue:H,maxValue:K,fillShape:F=!1,resetSelectionOnDoubleClick:l=!0,animate:Q=!1,dimmedOpacity:lt=.3,precision:p=2,customLayers:ct=[]}=t,[I,i]=f.useState(0),[s,a]=f.useState(0),[m,Z]=f.useState(0),[Mt,jt]=f.useState(void 0),S=f.useRef(null),ut=f.useRef(null);return f.useEffect(()=>{const o=new ResizeObserver(tt=>{a(h||tt[0].target.clientWidth||420),Z(g||tt[0].target.clientHeight||420),i((Math.min(h||tt[0].target.clientWidth||620,g||tt[0].target.clientHeight||480)||420)/2)});return S.current&&(Z(S.current.clientHeight||420),a(S.current.clientWidth||420),i((Math.min(S.current.clientWidth,S.current.clientHeight)||420)/2),(!h||!M)&&o.observe(S.current)),()=>o.disconnect()},[h,g,M]),n.jsxRuntimeExports.jsx("div",{className:`${T||"light"} flex ${h?"w-fit grow-0":"w-full grow"}`,dir:P==="he"||P==="ar"?"rtl":void 0,children:n.jsxRuntimeExports.jsx("div",{className:n.mo(`${d?d===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${P||"en"}`,b?.graphContainer),style:{...w?.graphContainer||{},minHeight:"inherit",...d&&d!==!0?{backgroundColor:d}:{}},id:et,ref:ut,"aria-label":z||`${e?`The graph shows ${e}. `:""}This is a donut or pie chart chart. ${k?` ${k}`:""}`,children:n.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:d?y||"1rem":y||0},children:n.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-2 w-full grow justify-between",children:[e||k||D||X?n.jsxRuntimeExports.jsx(St.GraphHeader,{styles:{title:w?.title,description:w?.description},classNames:{title:b?.title,description:b?.description},graphTitle:e,graphDescription:k,width:h,graphDownload:D?ut.current:void 0,dataDownload:X?u.map(o=>o.data).filter(o=>o!==void 0).length>0?u.map(o=>o.data).filter(o=>o!==void 0):u.filter(o=>o!==void 0):null}):null,n.jsxRuntimeExports.jsx("div",{className:"flex grow flex-col justify-center items-stretch gap-8 flex-wrap",style:{width:h?`${h}px`:"100%"},children:u.length===0?n.jsxRuntimeExports.jsx(Nt.EmptyState,{}):n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[j&&u.filter(o=>o.color).length!==0?n.jsxRuntimeExports.jsx(Ot.ColorLegendWithMouseOver,{width:h,colorLegendTitle:B,colors:r||q.Colors[T].categoricalColors.colors,colorDomain:Y||xt.uniqBy(u.filter(o=>o.color),"color").map(o=>o.color),setSelectedColor:jt,showNAColor:v}):null,n.jsxRuntimeExports.jsx("div",{className:`flex ${h?"grow-0":"grow"} items-center justify-center leading-0`,style:{width:h?`${h}px`:"100%",height:g?`${Math.max(x,g||(R?x?(h||s)*R>x?(h||s)*R:x:(h||s)*R:m))}px`:"auto"},ref:S,"aria-label":"Graph area",children:n.jsxRuntimeExports.jsx("div",{className:"w-full flex justify-center leading-0",children:M||I?n.jsxRuntimeExports.jsx(Dt,{data:u,lineColors:u.filter(o=>o.color).length===0?r?[r]:[q.Colors.primaryColors["blue-600"]]:r||q.Colors[T].categoricalColors.colors,radius:M||I,tooltip:O,colorDomain:Y||xt.uniqBy(u.filter(o=>o.color),"color").map(o=>o.color),onSeriesMouseOver:G,onSeriesMouseClick:nt,styles:w,detailsOnClick:$,selectedColor:Mt,axisLabels:E,strokeWidth:_,showValues:C,showDots:L,topMargin:st,bottomMargin:ot,leftMargin:U,rightMargin:rt,curveType:A,noOfTicks:J,minValue:H,maxValue:K,fillShape:F,highlightedLines:at,resetSelectionOnDoubleClick:l,animate:Q===!0?{duration:.5,once:!0,amount:.5}:Q||{duration:0,once:!0,amount:0},dimmedOpacity:lt,precision:p,customLayers:ct}):null})})]})}),c||V?n.jsxRuntimeExports.jsx(It.GraphFooter,{styles:{footnote:w?.footnote,source:w?.source},classNames:{footnote:b?.footnote,source:b?.source},sources:c,footNote:V,width:h}):n.jsxRuntimeExports.jsx("div",{})]})})})})}exports.RadarChart=Lt;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index-CHPV5EwG-DDoeWRVt.cjs"),f=require("react"),xt=require("./index-CZbIGs8q.cjs"),wt=require("./index-BXns0-ng.cjs"),bt=require("./Modal-tXZlLE5s.cjs"),Et=require("./Tooltip-n8z5bfav.cjs"),q=require("./Colors.cjs"),dt=require("./numberFormattingFunction-02t-wJta.cjs"),kt=require("./string2HTML-D2Avudmb.cjs"),N=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),pt=require("./linear-BVckp9RD.cjs"),mt=require("./line-DHV4JwCR.cjs"),Rt=require("./use-in-view-sQJZ_xDO.cjs"),W=require("./proxy-BHRoeZgd.cjs"),Ct=require("./index-BW8iNx7E.cjs"),It=require("./GraphFooter.cjs"),St=require("./GraphHeader.cjs"),Nt=require("./EmptyState-d8_8SxeW.cjs"),Ot=require("./ColorLegendWithMouseOver.cjs");var Pt=gt(mt.curveLinear);function ft(t){this._curve=t}ft.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}};function gt(t){function e(r){return new ft(t(r))}return e._curve=t,e}function Tt(t){var e=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(r){return arguments.length?e(gt(r)):e()._curve},t}function $t(){return Tt(mt.line().curve(Pt))}function it(){}function ht(t,e,r){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-r),t._x2,t._y2)}function _t(t,e){this._context=t,this._k=(1-e)/6}_t.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:ht(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:ht(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};(function t(e){function r(c){return new _t(c,e)}return r.tension=function(c){return t(+c)},r})(0);function yt(t,e){this._context=t,this._k=(1-e)/6}yt.prototype={areaStart:it,areaEnd:it,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:ht(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const qt=function t(e){function r(c){return new yt(c,e)}return r.tension=function(c){return t(+c)},r}(0);function vt(t){this._context=t}vt.prototype={areaStart:it,areaEnd:it,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function Vt(t){return new vt(t)}function Dt(t){const{data:e,radius:r,lineColors:c,tooltip:k,onSeriesMouseOver:V,onSeriesMouseClick:M,colorDomain:u,detailsOnClick:j,styles:y,classNames:d,selectedColor:O,axisLabels:G,strokeWidth:et,showValues:nt,showDots:st,rightMargin:ot,topMargin:U,bottomMargin:rt,leftMargin:D,curveType:X,noOfTicks:Y,minValue:P,maxValue:T,resetSelectionOnDoubleClick:at,fillShape:h,highlightedLines:g,animate:x,dimmedOpacity:_,precision:R,customLayers:z}=t,B=f.useRef(null),$=Rt.useInView(B,{once:x.once,amount:x.amount}),w=X==="linear"?Vt:qt,b={top:U,left:D},v=Math.min((2*r-D-ot)/2,(2*r-U-rt)/2),[E,L]=f.useState(void 0),[C,A]=f.useState(void 0),[J,H]=f.useState(void 0),[K,F]=f.useState(void 0),l=pt.linear().domain([0,e[0].values.length]).range([0,2*Math.PI]),Q=N.checkIfNullOrUndefined(T)?Math.max(...e.map(i=>Math.max(...i.values.filter(s=>!N.checkIfNullOrUndefined(s)))))<0?0:Math.max(...e.map(i=>Math.max(...i.values.filter(s=>!N.checkIfNullOrUndefined(s))))):T,lt=N.checkIfNullOrUndefined(P)?Math.min(...e.map(i=>Math.min(...i.values.filter(s=>!N.checkIfNullOrUndefined(s)))))>=0?0:Math.min(...e.map(i=>Math.min(...i.values.filter(s=>!N.checkIfNullOrUndefined(s))))):P,p=pt.linear().domain([lt,Q]).range([0,v]).nice(),ct=p.ticks(Y),I=$t().radius(i=>p(i)).angle((i,s)=>l(s)).curve(w);return n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsx(W.motion.svg,{width:`${r*2}px`,height:`${r*2}px`,viewBox:`0 0 ${r*2} ${r*2}`,direction:"ltr",ref:B,children:n.jsxRuntimeExports.jsxs("g",{transform:`translate(${b.left},${b.top})`,children:[z.filter(i=>i.position==="before").map(i=>i.layer),n.jsxRuntimeExports.jsxs("g",{transform:`translate(${v},${v})`,children:[G.map((i,s)=>n.jsxRuntimeExports.jsxs("g",{children:[n.jsxRuntimeExports.jsx("line",{x1:0,y1:0,x2:Math.cos(l(s)-Math.PI/2)*v,y2:Math.sin(l(s)-Math.PI/2)*v,className:n.mo("stroke-1 stroke-primary-gray-500 dark:stroke-primary-gray-550",d?.xAxis?.axis),style:y?.xAxis?.axis},s),n.jsxRuntimeExports.jsx("text",{x:Math.cos(l(s)-Math.PI/2)*(v+6),y:Math.sin(l(s)-Math.PI/2)*(v+6),style:{textAnchor:Math.cos(l(s)-Math.PI/2)<0?"end":Math.cos(l(s)-Math.PI/2)<1e-5?"middle":"start",...y?.xAxis?.labels||""},dy:Math.sin(l(s)-Math.PI/2)<0?0:Math.sin(l(s)-Math.PI/2)<1e-5?5:10,className:n.mo("fill-primary-gray-700 dark:fill-primary-gray-300 text-xs",d?.xAxis?.labels),children:i})]},s)),ct.map((i,s)=>n.jsxRuntimeExports.jsxs("g",{children:[n.jsxRuntimeExports.jsx("path",{d:I(Array(G.length).fill(i))||"",className:n.mo("stroke-primary-gray-500 dark:stroke-primary-gray-550",d?.xAxis?.gridLines),style:{...y?.xAxis?.gridLines,fill:"none"}}),n.jsxRuntimeExports.jsx("foreignObject",{x:-25,y:Math.sin(-Math.PI/2)*p(i)>-1e-4?Math.sin(-Math.PI/2)*p(i)-7:Math.sin(-Math.PI/2)*p(i)-5,width:50,height:12,children:n.jsxRuntimeExports.jsx("div",{className:"flex justify-center",children:n.jsxRuntimeExports.jsx("p",{className:n.mo("fill-primary-gray-500 dark:fill-primary-gray-550 text-xs m-0 py-0 px-1.5 text-center leading-none bg-primary-white dark:bg-primary-gray-700",d?.xAxis?.labels),style:y?.xAxis?.labels,children:dt.numberFormattingFunction(i,"NA",R)})})})]},s)),n.jsxRuntimeExports.jsx(Ct.AnimatePresence,{children:e.map((i,s)=>n.jsxRuntimeExports.jsxs(W.motion.g,{variants:{initial:{opacity:E?i.label===E.label?1:_:O?i.color&&c[u.indexOf(i.color)]===O?1:_:g.length!==0?i.label&&g.indexOf(i.label)!==-1?1:.3:1},whileInView:{opacity:E?i.label===E.label?1:_:O?i.color&&c[u.indexOf(i.color)]===O?1:_:g.length!==0?i.label&&g.indexOf(i.label)!==-1?1:_:1,transition:{duration:x.duration}}},initial:"initial",animate:$?"whileInView":"initial",exit:{opacity:0,transition:{duration:x.duration}},onMouseEnter:a=>{L(i),F(a.clientY),H(a.clientX),V?.(i)},onMouseMove:a=>{L(i),F(a.clientY),H(a.clientX)},onMouseLeave:()=>{L(void 0),H(void 0),F(void 0),V?.(void 0)},onClick:()=>{(M||j)&&(wt.isEqual(C,i)&&at?(A(void 0),M?.(void 0)):(A(i),M?.(i)))},children:[n.jsxRuntimeExports.jsx(W.motion.path,{d:I(i.values)||"",variants:{initial:{d:I(i.values.map(a=>0))||""},whileInView:{d:I(i.values)||"",transition:{duration:x.duration}}},initial:"initial",animate:$?"whileInView":"initial",exit:{opacity:0,transition:{duration:x.duration}},style:{stroke:e.filter(a=>a.color).length===0?c[0]:i.color?c[u.indexOf(i.color)]:q.Colors.gray,fill:h?e.filter(a=>a.color).length===0?c[0]:i.color?c[u.indexOf(i.color)]:q.Colors.gray:"none",fillOpacity:.1,strokeWidth:et}}),n.jsxRuntimeExports.jsx("g",{children:i.values.map((a,m)=>n.jsxRuntimeExports.jsx("g",{children:N.checkIfNullOrUndefined(a)?null:n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[st?n.jsxRuntimeExports.jsx(W.motion.circle,{cx:Math.cos(l(m)-Math.PI/2)*p(a),cy:Math.sin(l(m)-Math.PI/2)*p(a),r:4,style:{fill:e.filter(Z=>Z.color).length===0?c[0]:i.color?c[u.indexOf(i.color)]:q.Colors.gray},variants:{initial:{cx:0,cy:0,opacity:0},whileInView:{cx:Math.cos(l(m)-Math.PI/2)*p(a),cy:Math.sin(l(m)-Math.PI/2)*p(a),opacity:1,transition:{duration:x.duration}}},initial:"initial",animate:$?"whileInView":"initial",exit:{opacity:0,transition:{duration:x.duration}}}):null,nt?n.jsxRuntimeExports.jsx(W.motion.text,{x:Math.cos(l(m)-Math.PI/2)*(p(a)+6),y:Math.sin(l(m)-Math.PI/2)*(p(a)+6),style:{fill:c[s],textAnchor:Math.cos(l(m)-Math.PI/2)<0?"end":Math.cos(l(m)-Math.PI/2)<1e-5?"middle":"start",...y?.graphObjectValues||{}},dy:Math.sin(l(m)-Math.PI/2)<0?10:(Math.sin(l(m)-Math.PI/2)<1e-5,0),className:n.mo("graph-value text-xs font-bold",d?.graphObjectValues),variants:{initial:{opacity:0},whileInView:{opacity:1,transition:{duration:x.duration}}},initial:"initial",animate:$?"whileInView":"initial",exit:{opacity:0,transition:{duration:x.duration}},children:dt.numberFormattingFunction(a,"NA",R)}):null]})},m))})]},i.label||s))})]}),z.filter(i=>i.position==="after").map(i=>i.layer)]})}),E&&k&&J&&K?n.jsxRuntimeExports.jsx(Et.Tooltip,{data:E,body:k,xPos:J,yPos:K,backgroundStyle:y?.tooltip,className:d?.tooltip}):null,j&&C!==void 0?n.jsxRuntimeExports.jsx(bt.X,{open:C!==void 0,onClose:()=>{A(void 0)},children:n.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof j=="string"?{__html:kt.string2HTML(j,C)}:void 0,children:typeof j=="function"?j(C):null})}):null]})}function Lt(t){const{graphTitle:e,colors:r,sources:c,graphDescription:k,footNote:V,radius:M,data:u,showColorScale:j=!0,padding:y,backgroundColor:d=!1,tooltip:O,onSeriesMouseOver:G,graphID:et,onSeriesMouseClick:nt,topMargin:st=75,bottomMargin:ot=75,leftMargin:U=75,rightMargin:rt=75,graphDownload:D=!1,dataDownload:X=!1,colorDomain:Y,language:P="en",theme:T="light",highlightedLines:at=[],width:h,height:g,minHeight:x=0,strokeWidth:_=2,relativeHeight:R,ariaLabel:z,colorLegendTitle:B,detailsOnClick:$,styles:w,classNames:b,showNAColor:v=!0,axisLabels:E,showDots:L=!0,showValues:C=!1,curveType:A="curve",noOfTicks:J=5,minValue:H,maxValue:K,fillShape:F=!1,resetSelectionOnDoubleClick:l=!0,animate:Q=!1,dimmedOpacity:lt=.3,precision:p=2,customLayers:ct=[]}=t,[I,i]=f.useState(0),[s,a]=f.useState(0),[m,Z]=f.useState(0),[Mt,jt]=f.useState(void 0),S=f.useRef(null),ut=f.useRef(null);return f.useEffect(()=>{const o=new ResizeObserver(tt=>{a(h||tt[0].target.clientWidth||420),Z(g||tt[0].target.clientHeight||420),i((Math.min(h||tt[0].target.clientWidth||620,g||tt[0].target.clientHeight||480)||420)/2)});return S.current&&(Z(S.current.clientHeight||420),a(S.current.clientWidth||420),i((Math.min(S.current.clientWidth,S.current.clientHeight)||420)/2),(!h||!M)&&o.observe(S.current)),()=>o.disconnect()},[h,g,M]),n.jsxRuntimeExports.jsx("div",{className:`${T||"light"} flex ${h?"w-fit grow-0":"w-full grow"}`,dir:P==="he"||P==="ar"?"rtl":void 0,children:n.jsxRuntimeExports.jsx("div",{className:n.mo(`${d?d===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${P||"en"}`,b?.graphContainer),style:{...w?.graphContainer||{},minHeight:"inherit",...d&&d!==!0?{backgroundColor:d}:{}},id:et,ref:ut,"aria-label":z||`${e?`The graph shows ${e}. `:""}This is a donut or pie chart chart. ${k?` ${k}`:""}`,children:n.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:d?y||"1rem":y||0},children:n.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-2 w-full grow justify-between",children:[e||k||D||X?n.jsxRuntimeExports.jsx(St.GraphHeader,{styles:{title:w?.title,description:w?.description},classNames:{title:b?.title,description:b?.description},graphTitle:e,graphDescription:k,width:h,graphDownload:D?ut.current:void 0,dataDownload:X?u.map(o=>o.data).filter(o=>o!==void 0).length>0?u.map(o=>o.data).filter(o=>o!==void 0):u.filter(o=>o!==void 0):null}):null,n.jsxRuntimeExports.jsx("div",{className:"flex grow flex-col justify-center items-stretch gap-8 flex-wrap",style:{width:h?`${h}px`:"100%"},children:u.length===0?n.jsxRuntimeExports.jsx(Nt.EmptyState,{}):n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[j&&u.filter(o=>o.color).length!==0?n.jsxRuntimeExports.jsx(Ot.ColorLegendWithMouseOver,{width:h,colorLegendTitle:B,colors:r||q.Colors[T].categoricalColors.colors,colorDomain:Y||xt.uniqBy(u.filter(o=>o.color),"color").map(o=>o.color),setSelectedColor:jt,showNAColor:v}):null,n.jsxRuntimeExports.jsx("div",{className:`flex ${h?"grow-0":"grow"} items-center justify-center leading-0`,style:{width:h?`${h}px`:"100%",height:g?`${Math.max(x,g||(R?x?(h||s)*R>x?(h||s)*R:x:(h||s)*R:m))}px`:"auto"},ref:S,"aria-label":"Graph area",children:n.jsxRuntimeExports.jsx("div",{className:"w-full flex justify-center leading-0",children:M||I?n.jsxRuntimeExports.jsx(Dt,{data:u,lineColors:u.filter(o=>o.color).length===0?r?[r]:[q.Colors.primaryColors["blue-600"]]:r||q.Colors[T].categoricalColors.colors,radius:M||I,tooltip:O,colorDomain:Y||xt.uniqBy(u.filter(o=>o.color),"color").map(o=>o.color),onSeriesMouseOver:G,onSeriesMouseClick:nt,styles:w,detailsOnClick:$,selectedColor:Mt,axisLabels:E,strokeWidth:_,showValues:C,showDots:L,topMargin:st,bottomMargin:ot,leftMargin:U,rightMargin:rt,curveType:A,noOfTicks:J,minValue:H,maxValue:K,fillShape:F,highlightedLines:at,resetSelectionOnDoubleClick:l,animate:Q===!0?{duration:.5,once:!0,amount:.5}:Q||{duration:0,once:!0,amount:0},dimmedOpacity:lt,precision:p,customLayers:ct}):null})})]})}),c||V?n.jsxRuntimeExports.jsx(It.GraphFooter,{styles:{footnote:w?.footnote,source:w?.source},classNames:{footnote:b?.footnote,source:b?.source},sources:c,footNote:V,width:h}):n.jsxRuntimeExports.jsx("div",{})]})})})})}exports.RadarChart=Lt;
2
2
  //# sourceMappingURL=RadarChart.cjs.map
@@ -2,22 +2,22 @@ import { j as a, m as E } from "./index-CHPV5EwG-BPSP-7Jg.js";
2
2
  import { useRef as ut, useState as j, useEffect as kt } from "react";
3
3
  import { u as pt } from "./index-CaAIPGZo.js";
4
4
  import { i as jt } from "./index-27yTRcko.js";
5
- import { X as It } from "./Modal-CUU6ZK3U.js";
5
+ import { X as It } from "./Modal-DVVwpKhP.js";
6
6
  import { T as Ct } from "./Tooltip-DyM5snqx.js";
7
7
  import { Colors as L } from "./Colors.js";
8
8
  import { n as xt } from "./numberFormattingFunction-14YCbkN2.js";
9
9
  import { s as Nt } from "./string2HTML-CWHGfz_d.js";
10
10
  import { c as O } from "./checkIfNullOrUndefined-DmfiKkNw.js";
11
- import { u as Pt } from "./use-in-view-BAHrBy6b.js";
12
11
  import { a as ft } from "./linear-DUdu7l2G.js";
13
- import { c as St, l as Ot } from "./line-CPfhohvF.js";
14
- import { m as X } from "./proxy-DJxJg1kD.js";
15
- import { A as Tt } from "./index-BxAUvrua.js";
12
+ import { c as Pt, l as St } from "./line-CPfhohvF.js";
13
+ import { u as Ot } from "./use-in-view-yS6jzJAp.js";
14
+ import { m as X } from "./proxy-CkpFesk1.js";
15
+ import { A as Tt } from "./index-CNvov0eg.js";
16
16
  import { GraphFooter as $t } from "./GraphFooter.js";
17
17
  import { GraphHeader as Dt } from "./GraphHeader.js";
18
18
  import { E as Vt } from "./EmptyState-DdTp-Mdn.js";
19
19
  import { ColorLegendWithMouseOver as Et } from "./ColorLegendWithMouseOver.js";
20
- var Lt = _t(St);
20
+ var Lt = _t(Pt);
21
21
  function gt(t) {
22
22
  this._curve = t;
23
23
  }
@@ -51,7 +51,7 @@ function At(t) {
51
51
  }, t;
52
52
  }
53
53
  function Ht() {
54
- return At(Ot().curve(Lt));
54
+ return At(St().curve(Lt));
55
55
  }
56
56
  function et() {
57
57
  }
@@ -217,7 +217,7 @@ function Ft(t) {
217
217
  dimmedOpacity: g,
218
218
  precision: C,
219
219
  customLayers: U
220
- } = t, J = ut(null), V = Pt(J, {
220
+ } = t, J = ut(null), V = Ot(J, {
221
221
  once: d.once,
222
222
  amount: d.amount
223
223
  }), w = q === "linear" ? Wt : Rt, b = {
@@ -1,2 +1,2 @@
1
- "use strict";const t=require("./index-CHPV5EwG-DDoeWRVt.cjs"),d=require("./proxy-PQd2AItT.cjs");function c(y){const{text:a,x1:n,x2:r,y:e,classNames:s,styles:o,color:i,animate:l,isInView:x}=y;return a?t.jsxRuntimeExports.jsxs(d.motion.g,{exit:{opacity:0,transition:{duration:l?.duration||0}},variants:{initial:{opacity:0},whileInView:{opacity:1,transition:{duration:l?.duration||0}}},initial:"initial",animate:x?"whileInView":"initial",children:[t.jsxRuntimeExports.jsx("line",{className:t.mo("undp-ref-line",i?void 0:"stroke-primary-gray-700 dark:stroke-primary-gray-300",s?.line),style:{...i&&{stroke:i},...o?.line||{}},y1:e,y2:e,x1:n,x2:r}),t.jsxRuntimeExports.jsx("text",{x:r,y:e,style:{...i&&{fill:i},textAnchor:"end",...o?.text||{}},className:t.mo("text-xs font-bold",i?void 0:" fill-primary-gray-700 dark:fill-primary-gray-300",s?.text),dy:-5,children:a})]},`${n}-${r}-${e}`):null}function u(y){const{text:a,y1:n,y2:r,x:e,classNames:s,styles:o,color:i,textSide:l,animate:x,isInView:m}=y;return a?t.jsxRuntimeExports.jsxs(d.motion.g,{exit:{opacity:0,transition:{duration:x?.duration||0}},variants:{initial:{opacity:0},whileInView:{opacity:1,transition:{duration:x?.duration||0}}},initial:"initial",animate:m?"whileInView":"initial",children:[t.jsxRuntimeExports.jsx("line",{className:t.mo("undp-ref-line",i?void 0:"stroke-primary-gray-700 dark:stroke-primary-gray-300",s?.line),style:{...i&&{stroke:i},...o?.line||{}},y1:n,y2:r,x1:e,x2:e}),t.jsxRuntimeExports.jsx("text",{x:e,y:n,style:{...i&&{fill:i},textAnchor:l==="left"?"end":"start",...o?.text||{}},className:t.mo("text-xs font-bold",i?void 0:"fill-primary-gray-700 dark:fill-primary-gray-300",s?.text),dy:12.5,dx:l==="left"?-5:5,children:a})]},`${n}-${r}-${e}`):null}exports.RefLineX=u;exports.RefLineY=c;
2
- //# sourceMappingURL=ReferenceLine-CuFMk0cI.cjs.map
1
+ "use strict";const t=require("./index-CHPV5EwG-DDoeWRVt.cjs"),d=require("./proxy-BHRoeZgd.cjs");function c(y){const{text:a,x1:n,x2:r,y:e,classNames:s,styles:o,color:i,animate:l,isInView:x}=y;return a?t.jsxRuntimeExports.jsxs(d.motion.g,{exit:{opacity:0,transition:{duration:l?.duration||0}},variants:{initial:{opacity:0},whileInView:{opacity:1,transition:{duration:l?.duration||0}}},initial:"initial",animate:x?"whileInView":"initial",children:[t.jsxRuntimeExports.jsx("line",{className:t.mo("undp-ref-line",i?void 0:"stroke-primary-gray-700 dark:stroke-primary-gray-300",s?.line),style:{...i&&{stroke:i},...o?.line||{}},y1:e,y2:e,x1:n,x2:r}),t.jsxRuntimeExports.jsx("text",{x:r,y:e,style:{...i&&{fill:i},textAnchor:"end",...o?.text||{}},className:t.mo("text-xs font-bold",i?void 0:" fill-primary-gray-700 dark:fill-primary-gray-300",s?.text),dy:-5,children:a})]},`${n}-${r}-${e}`):null}function u(y){const{text:a,y1:n,y2:r,x:e,classNames:s,styles:o,color:i,textSide:l,animate:x,isInView:m}=y;return a?t.jsxRuntimeExports.jsxs(d.motion.g,{exit:{opacity:0,transition:{duration:x?.duration||0}},variants:{initial:{opacity:0},whileInView:{opacity:1,transition:{duration:x?.duration||0}}},initial:"initial",animate:m?"whileInView":"initial",children:[t.jsxRuntimeExports.jsx("line",{className:t.mo("undp-ref-line",i?void 0:"stroke-primary-gray-700 dark:stroke-primary-gray-300",s?.line),style:{...i&&{stroke:i},...o?.line||{}},y1:n,y2:r,x1:e,x2:e}),t.jsxRuntimeExports.jsx("text",{x:e,y:n,style:{...i&&{fill:i},textAnchor:l==="left"?"end":"start",...o?.text||{}},className:t.mo("text-xs font-bold",i?void 0:"fill-primary-gray-700 dark:fill-primary-gray-300",s?.text),dy:12.5,dx:l==="left"?-5:5,children:a})]},`${n}-${r}-${e}`):null}exports.RefLineX=u;exports.RefLineY=c;
2
+ //# sourceMappingURL=ReferenceLine-CFVBBN__.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ReferenceLine-CuFMk0cI.cjs","sources":["../src/Components/Elements/ReferenceLine.tsx"],"sourcesContent":["import { cn } from '@undp/design-system-react/cn';\r\nimport { motion } from 'motion/react';\r\n\r\nimport { AnimateDataType } from '@/Types';\r\n\r\ninterface RefLineYProps {\r\n text?: string;\r\n color?: string;\r\n y: number;\r\n x1: number;\r\n x2: number;\r\n classNames?: {\r\n line?: string;\r\n text?: string;\r\n };\r\n styles?: {\r\n line?: React.CSSProperties;\r\n text?: React.CSSProperties;\r\n };\r\n animate?: AnimateDataType;\r\n isInView: boolean;\r\n}\r\n\r\nexport function RefLineY(props: RefLineYProps) {\r\n const { text, x1, x2, y, classNames, styles, color, animate, isInView } = props;\r\n if (!text) return null;\r\n return (\r\n <motion.g\r\n key={`${x1}-${x2}-${y}`}\r\n exit={{ opacity: 0, transition: { duration: animate?.duration || 0 } }}\r\n variants={{\r\n initial: {\r\n opacity: 0,\r\n },\r\n whileInView: {\r\n opacity: 1,\r\n transition: { duration: animate?.duration || 0 },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n >\r\n <line\r\n className={cn(\r\n 'undp-ref-line',\r\n !color ? 'stroke-primary-gray-700 dark:stroke-primary-gray-300' : undefined,\r\n classNames?.line,\r\n )}\r\n style={{\r\n ...(color && { stroke: color }),\r\n ...(styles?.line || {}),\r\n }}\r\n y1={y}\r\n y2={y}\r\n x1={x1}\r\n x2={x2}\r\n />\r\n <text\r\n x={x2}\r\n y={y}\r\n style={{\r\n ...(color && { fill: color }),\r\n textAnchor: 'end',\r\n ...(styles?.text || {}),\r\n }}\r\n className={cn(\r\n 'text-xs font-bold',\r\n !color ? ' fill-primary-gray-700 dark:fill-primary-gray-300' : undefined,\r\n classNames?.text,\r\n )}\r\n dy={-5}\r\n >\r\n {text}\r\n </text>\r\n </motion.g>\r\n );\r\n}\r\n\r\ninterface RefLineXProps {\r\n text?: string;\r\n color?: string;\r\n x: number;\r\n y1: number;\r\n y2: number;\r\n textSide: 'left' | 'right';\r\n classNames?: {\r\n line?: string;\r\n text?: string;\r\n };\r\n styles?: {\r\n line?: React.CSSProperties;\r\n text?: React.CSSProperties;\r\n };\r\n animate?: AnimateDataType;\r\n isInView: boolean;\r\n}\r\n\r\nexport function RefLineX(props: RefLineXProps) {\r\n const { text, y1, y2, x, classNames, styles, color, textSide, animate, isInView } = props;\r\n if (!text) return null;\r\n return (\r\n <motion.g\r\n key={`${y1}-${y2}-${x}`}\r\n exit={{ opacity: 0, transition: { duration: animate?.duration || 0 } }}\r\n variants={{\r\n initial: {\r\n opacity: 0,\r\n },\r\n whileInView: {\r\n opacity: 1,\r\n transition: { duration: animate?.duration || 0 },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n >\r\n <line\r\n className={cn(\r\n 'undp-ref-line',\r\n !color ? 'stroke-primary-gray-700 dark:stroke-primary-gray-300' : undefined,\r\n classNames?.line,\r\n )}\r\n style={{\r\n ...(color && { stroke: color }),\r\n ...(styles?.line || {}),\r\n }}\r\n y1={y1}\r\n y2={y2}\r\n x1={x}\r\n x2={x}\r\n />\r\n <text\r\n x={x}\r\n y={y1}\r\n style={{\r\n ...(color && { fill: color }),\r\n textAnchor: textSide === 'left' ? 'end' : 'start',\r\n ...(styles?.text || {}),\r\n }}\r\n className={cn(\r\n 'text-xs font-bold',\r\n !color ? 'fill-primary-gray-700 dark:fill-primary-gray-300' : undefined,\r\n classNames?.text,\r\n )}\r\n dy={12.5}\r\n dx={textSide === 'left' ? -5 : 5}\r\n >\r\n {text}\r\n </text>\r\n </motion.g>\r\n );\r\n}\r\n"],"names":["RefLineY","props","text","x1","x2","y","classNames","styles","color","animate","isInView","jsxs","motion","jsx","cn","RefLineX","y1","y2","x","textSide"],"mappings":"gGAuBO,SAASA,EAASC,EAAsB,CAC7C,KAAM,CAAE,KAAAC,EAAM,GAAAC,EAAI,GAAAC,EAAI,EAAAC,EAAG,WAAAC,EAAY,OAAAC,EAAQ,MAAAC,EAAO,QAAAC,EAAS,SAAAC,CAAA,EAAaT,EAC1E,OAAKC,EAEHS,EAAAA,kBAAAA,KAACC,EAAAA,OAAO,EAAP,CAEC,KAAM,CAAE,QAAS,EAAG,WAAY,CAAE,SAAUH,GAAS,UAAY,EAAE,EACnE,SAAU,CACR,QAAS,CACP,QAAS,CAAA,EAEX,YAAa,CACX,QAAS,EACT,WAAY,CAAE,SAAUA,GAAS,UAAY,CAAA,CAAE,CACjD,EAEF,QAAQ,UACR,QAASC,EAAW,cAAgB,UAEpC,SAAA,CAAAG,EAAAA,kBAAAA,IAAC,OAAA,CACC,UAAWC,EAAAA,GACT,gBACCN,EAAiE,OAAzD,uDACTF,GAAY,IAAA,EAEd,MAAO,CACL,GAAIE,GAAS,CAAE,OAAQA,CAAA,EACvB,GAAID,GAAQ,MAAQ,CAAA,CAAC,EAEvB,GAAIF,EACJ,GAAIA,EACJ,GAAAF,EACA,GAAAC,CAAA,CAAA,EAEFS,EAAAA,kBAAAA,IAAC,OAAA,CACC,EAAGT,EACH,EAAAC,EACA,MAAO,CACL,GAAIG,GAAS,CAAE,KAAMA,CAAA,EACrB,WAAY,MACZ,GAAID,GAAQ,MAAQ,CAAA,CAAC,EAEvB,UAAWO,EAAAA,GACT,oBACCN,EAA8D,OAAtD,oDACTF,GAAY,IAAA,EAEd,GAAI,GAEH,SAAAJ,CAAA,CAAA,CACH,CAAA,EA7CK,GAAGC,CAAE,IAAIC,CAAE,IAAIC,CAAC,EAAA,EAHP,IAmDpB,CAqBO,SAASU,EAASd,EAAsB,CAC7C,KAAM,CAAE,KAAAC,EAAM,GAAAc,EAAI,GAAAC,EAAI,EAAAC,EAAG,WAAAZ,EAAY,OAAAC,EAAQ,MAAAC,EAAO,SAAAW,EAAU,QAAAV,EAAS,SAAAC,CAAA,EAAaT,EACpF,OAAKC,EAEHS,EAAAA,kBAAAA,KAACC,EAAAA,OAAO,EAAP,CAEC,KAAM,CAAE,QAAS,EAAG,WAAY,CAAE,SAAUH,GAAS,UAAY,EAAE,EACnE,SAAU,CACR,QAAS,CACP,QAAS,CAAA,EAEX,YAAa,CACX,QAAS,EACT,WAAY,CAAE,SAAUA,GAAS,UAAY,CAAA,CAAE,CACjD,EAEF,QAAQ,UACR,QAASC,EAAW,cAAgB,UAEpC,SAAA,CAAAG,EAAAA,kBAAAA,IAAC,OAAA,CACC,UAAWC,EAAAA,GACT,gBACCN,EAAiE,OAAzD,uDACTF,GAAY,IAAA,EAEd,MAAO,CACL,GAAIE,GAAS,CAAE,OAAQA,CAAA,EACvB,GAAID,GAAQ,MAAQ,CAAA,CAAC,EAEvB,GAAAS,EACA,GAAAC,EACA,GAAIC,EACJ,GAAIA,CAAA,CAAA,EAENL,EAAAA,kBAAAA,IAAC,OAAA,CACC,EAAAK,EACA,EAAGF,EACH,MAAO,CACL,GAAIR,GAAS,CAAE,KAAMA,CAAA,EACrB,WAAYW,IAAa,OAAS,MAAQ,QAC1C,GAAIZ,GAAQ,MAAQ,CAAA,CAAC,EAEvB,UAAWO,EAAAA,GACT,oBACCN,EAA6D,OAArD,mDACTF,GAAY,IAAA,EAEd,GAAI,KACJ,GAAIa,IAAa,OAAS,GAAK,EAE9B,SAAAjB,CAAA,CAAA,CACH,CAAA,EA9CK,GAAGc,CAAE,IAAIC,CAAE,IAAIC,CAAC,EAAA,EAHP,IAoDpB"}
1
+ {"version":3,"file":"ReferenceLine-CFVBBN__.cjs","sources":["../src/Components/Elements/ReferenceLine.tsx"],"sourcesContent":["import { cn } from '@undp/design-system-react/cn';\r\nimport { motion } from 'motion/react';\r\n\r\nimport { AnimateDataType } from '@/Types';\r\n\r\ninterface RefLineYProps {\r\n text?: string;\r\n color?: string;\r\n y: number;\r\n x1: number;\r\n x2: number;\r\n classNames?: {\r\n line?: string;\r\n text?: string;\r\n };\r\n styles?: {\r\n line?: React.CSSProperties;\r\n text?: React.CSSProperties;\r\n };\r\n animate?: AnimateDataType;\r\n isInView: boolean;\r\n}\r\n\r\nexport function RefLineY(props: RefLineYProps) {\r\n const { text, x1, x2, y, classNames, styles, color, animate, isInView } = props;\r\n if (!text) return null;\r\n return (\r\n <motion.g\r\n key={`${x1}-${x2}-${y}`}\r\n exit={{ opacity: 0, transition: { duration: animate?.duration || 0 } }}\r\n variants={{\r\n initial: {\r\n opacity: 0,\r\n },\r\n whileInView: {\r\n opacity: 1,\r\n transition: { duration: animate?.duration || 0 },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n >\r\n <line\r\n className={cn(\r\n 'undp-ref-line',\r\n !color ? 'stroke-primary-gray-700 dark:stroke-primary-gray-300' : undefined,\r\n classNames?.line,\r\n )}\r\n style={{\r\n ...(color && { stroke: color }),\r\n ...(styles?.line || {}),\r\n }}\r\n y1={y}\r\n y2={y}\r\n x1={x1}\r\n x2={x2}\r\n />\r\n <text\r\n x={x2}\r\n y={y}\r\n style={{\r\n ...(color && { fill: color }),\r\n textAnchor: 'end',\r\n ...(styles?.text || {}),\r\n }}\r\n className={cn(\r\n 'text-xs font-bold',\r\n !color ? ' fill-primary-gray-700 dark:fill-primary-gray-300' : undefined,\r\n classNames?.text,\r\n )}\r\n dy={-5}\r\n >\r\n {text}\r\n </text>\r\n </motion.g>\r\n );\r\n}\r\n\r\ninterface RefLineXProps {\r\n text?: string;\r\n color?: string;\r\n x: number;\r\n y1: number;\r\n y2: number;\r\n textSide: 'left' | 'right';\r\n classNames?: {\r\n line?: string;\r\n text?: string;\r\n };\r\n styles?: {\r\n line?: React.CSSProperties;\r\n text?: React.CSSProperties;\r\n };\r\n animate?: AnimateDataType;\r\n isInView: boolean;\r\n}\r\n\r\nexport function RefLineX(props: RefLineXProps) {\r\n const { text, y1, y2, x, classNames, styles, color, textSide, animate, isInView } = props;\r\n if (!text) return null;\r\n return (\r\n <motion.g\r\n key={`${y1}-${y2}-${x}`}\r\n exit={{ opacity: 0, transition: { duration: animate?.duration || 0 } }}\r\n variants={{\r\n initial: {\r\n opacity: 0,\r\n },\r\n whileInView: {\r\n opacity: 1,\r\n transition: { duration: animate?.duration || 0 },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n >\r\n <line\r\n className={cn(\r\n 'undp-ref-line',\r\n !color ? 'stroke-primary-gray-700 dark:stroke-primary-gray-300' : undefined,\r\n classNames?.line,\r\n )}\r\n style={{\r\n ...(color && { stroke: color }),\r\n ...(styles?.line || {}),\r\n }}\r\n y1={y1}\r\n y2={y2}\r\n x1={x}\r\n x2={x}\r\n />\r\n <text\r\n x={x}\r\n y={y1}\r\n style={{\r\n ...(color && { fill: color }),\r\n textAnchor: textSide === 'left' ? 'end' : 'start',\r\n ...(styles?.text || {}),\r\n }}\r\n className={cn(\r\n 'text-xs font-bold',\r\n !color ? 'fill-primary-gray-700 dark:fill-primary-gray-300' : undefined,\r\n classNames?.text,\r\n )}\r\n dy={12.5}\r\n dx={textSide === 'left' ? -5 : 5}\r\n >\r\n {text}\r\n </text>\r\n </motion.g>\r\n );\r\n}\r\n"],"names":["RefLineY","props","text","x1","x2","y","classNames","styles","color","animate","isInView","jsxs","motion","jsx","cn","RefLineX","y1","y2","x","textSide"],"mappings":"gGAuBO,SAASA,EAASC,EAAsB,CAC7C,KAAM,CAAE,KAAAC,EAAM,GAAAC,EAAI,GAAAC,EAAI,EAAAC,EAAG,WAAAC,EAAY,OAAAC,EAAQ,MAAAC,EAAO,QAAAC,EAAS,SAAAC,CAAA,EAAaT,EAC1E,OAAKC,EAEHS,EAAAA,kBAAAA,KAACC,EAAAA,OAAO,EAAP,CAEC,KAAM,CAAE,QAAS,EAAG,WAAY,CAAE,SAAUH,GAAS,UAAY,EAAE,EACnE,SAAU,CACR,QAAS,CACP,QAAS,CAAA,EAEX,YAAa,CACX,QAAS,EACT,WAAY,CAAE,SAAUA,GAAS,UAAY,CAAA,CAAE,CACjD,EAEF,QAAQ,UACR,QAASC,EAAW,cAAgB,UAEpC,SAAA,CAAAG,EAAAA,kBAAAA,IAAC,OAAA,CACC,UAAWC,EAAAA,GACT,gBACCN,EAAiE,OAAzD,uDACTF,GAAY,IAAA,EAEd,MAAO,CACL,GAAIE,GAAS,CAAE,OAAQA,CAAA,EACvB,GAAID,GAAQ,MAAQ,CAAA,CAAC,EAEvB,GAAIF,EACJ,GAAIA,EACJ,GAAAF,EACA,GAAAC,CAAA,CAAA,EAEFS,EAAAA,kBAAAA,IAAC,OAAA,CACC,EAAGT,EACH,EAAAC,EACA,MAAO,CACL,GAAIG,GAAS,CAAE,KAAMA,CAAA,EACrB,WAAY,MACZ,GAAID,GAAQ,MAAQ,CAAA,CAAC,EAEvB,UAAWO,EAAAA,GACT,oBACCN,EAA8D,OAAtD,oDACTF,GAAY,IAAA,EAEd,GAAI,GAEH,SAAAJ,CAAA,CAAA,CACH,CAAA,EA7CK,GAAGC,CAAE,IAAIC,CAAE,IAAIC,CAAC,EAAA,EAHP,IAmDpB,CAqBO,SAASU,EAASd,EAAsB,CAC7C,KAAM,CAAE,KAAAC,EAAM,GAAAc,EAAI,GAAAC,EAAI,EAAAC,EAAG,WAAAZ,EAAY,OAAAC,EAAQ,MAAAC,EAAO,SAAAW,EAAU,QAAAV,EAAS,SAAAC,CAAA,EAAaT,EACpF,OAAKC,EAEHS,EAAAA,kBAAAA,KAACC,EAAAA,OAAO,EAAP,CAEC,KAAM,CAAE,QAAS,EAAG,WAAY,CAAE,SAAUH,GAAS,UAAY,EAAE,EACnE,SAAU,CACR,QAAS,CACP,QAAS,CAAA,EAEX,YAAa,CACX,QAAS,EACT,WAAY,CAAE,SAAUA,GAAS,UAAY,CAAA,CAAE,CACjD,EAEF,QAAQ,UACR,QAASC,EAAW,cAAgB,UAEpC,SAAA,CAAAG,EAAAA,kBAAAA,IAAC,OAAA,CACC,UAAWC,EAAAA,GACT,gBACCN,EAAiE,OAAzD,uDACTF,GAAY,IAAA,EAEd,MAAO,CACL,GAAIE,GAAS,CAAE,OAAQA,CAAA,EACvB,GAAID,GAAQ,MAAQ,CAAA,CAAC,EAEvB,GAAAS,EACA,GAAAC,EACA,GAAIC,EACJ,GAAIA,CAAA,CAAA,EAENL,EAAAA,kBAAAA,IAAC,OAAA,CACC,EAAAK,EACA,EAAGF,EACH,MAAO,CACL,GAAIR,GAAS,CAAE,KAAMA,CAAA,EACrB,WAAYW,IAAa,OAAS,MAAQ,QAC1C,GAAIZ,GAAQ,MAAQ,CAAA,CAAC,EAEvB,UAAWO,EAAAA,GACT,oBACCN,EAA6D,OAArD,mDACTF,GAAY,IAAA,EAEd,GAAI,KACJ,GAAIa,IAAa,OAAS,GAAK,EAE9B,SAAAjB,CAAA,CAAA,CACH,CAAA,EA9CK,GAAGc,CAAE,IAAIC,CAAE,IAAIC,CAAC,EAAA,EAHP,IAoDpB"}
@@ -1,5 +1,5 @@
1
1
  import { j as r, m as x } from "./index-CHPV5EwG-BPSP-7Jg.js";
2
- import { m } from "./proxy-DJxJg1kD.js";
2
+ import { m } from "./proxy-CkpFesk1.js";
3
3
  function u(d) {
4
4
  const { text: n, x1: a, x2: e, y: t, classNames: l, styles: s, color: i, animate: o, isInView: y } = d;
5
5
  return n ? /* @__PURE__ */ r.jsxs(
@@ -125,4 +125,4 @@ export {
125
125
  u as R,
126
126
  g as a
127
127
  };
128
- //# sourceMappingURL=ReferenceLine-C1GpoG9d.js.map
128
+ //# sourceMappingURL=ReferenceLine-CfAW3vKJ.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ReferenceLine-C1GpoG9d.js","sources":["../src/Components/Elements/ReferenceLine.tsx"],"sourcesContent":["import { cn } from '@undp/design-system-react/cn';\r\nimport { motion } from 'motion/react';\r\n\r\nimport { AnimateDataType } from '@/Types';\r\n\r\ninterface RefLineYProps {\r\n text?: string;\r\n color?: string;\r\n y: number;\r\n x1: number;\r\n x2: number;\r\n classNames?: {\r\n line?: string;\r\n text?: string;\r\n };\r\n styles?: {\r\n line?: React.CSSProperties;\r\n text?: React.CSSProperties;\r\n };\r\n animate?: AnimateDataType;\r\n isInView: boolean;\r\n}\r\n\r\nexport function RefLineY(props: RefLineYProps) {\r\n const { text, x1, x2, y, classNames, styles, color, animate, isInView } = props;\r\n if (!text) return null;\r\n return (\r\n <motion.g\r\n key={`${x1}-${x2}-${y}`}\r\n exit={{ opacity: 0, transition: { duration: animate?.duration || 0 } }}\r\n variants={{\r\n initial: {\r\n opacity: 0,\r\n },\r\n whileInView: {\r\n opacity: 1,\r\n transition: { duration: animate?.duration || 0 },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n >\r\n <line\r\n className={cn(\r\n 'undp-ref-line',\r\n !color ? 'stroke-primary-gray-700 dark:stroke-primary-gray-300' : undefined,\r\n classNames?.line,\r\n )}\r\n style={{\r\n ...(color && { stroke: color }),\r\n ...(styles?.line || {}),\r\n }}\r\n y1={y}\r\n y2={y}\r\n x1={x1}\r\n x2={x2}\r\n />\r\n <text\r\n x={x2}\r\n y={y}\r\n style={{\r\n ...(color && { fill: color }),\r\n textAnchor: 'end',\r\n ...(styles?.text || {}),\r\n }}\r\n className={cn(\r\n 'text-xs font-bold',\r\n !color ? ' fill-primary-gray-700 dark:fill-primary-gray-300' : undefined,\r\n classNames?.text,\r\n )}\r\n dy={-5}\r\n >\r\n {text}\r\n </text>\r\n </motion.g>\r\n );\r\n}\r\n\r\ninterface RefLineXProps {\r\n text?: string;\r\n color?: string;\r\n x: number;\r\n y1: number;\r\n y2: number;\r\n textSide: 'left' | 'right';\r\n classNames?: {\r\n line?: string;\r\n text?: string;\r\n };\r\n styles?: {\r\n line?: React.CSSProperties;\r\n text?: React.CSSProperties;\r\n };\r\n animate?: AnimateDataType;\r\n isInView: boolean;\r\n}\r\n\r\nexport function RefLineX(props: RefLineXProps) {\r\n const { text, y1, y2, x, classNames, styles, color, textSide, animate, isInView } = props;\r\n if (!text) return null;\r\n return (\r\n <motion.g\r\n key={`${y1}-${y2}-${x}`}\r\n exit={{ opacity: 0, transition: { duration: animate?.duration || 0 } }}\r\n variants={{\r\n initial: {\r\n opacity: 0,\r\n },\r\n whileInView: {\r\n opacity: 1,\r\n transition: { duration: animate?.duration || 0 },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n >\r\n <line\r\n className={cn(\r\n 'undp-ref-line',\r\n !color ? 'stroke-primary-gray-700 dark:stroke-primary-gray-300' : undefined,\r\n classNames?.line,\r\n )}\r\n style={{\r\n ...(color && { stroke: color }),\r\n ...(styles?.line || {}),\r\n }}\r\n y1={y1}\r\n y2={y2}\r\n x1={x}\r\n x2={x}\r\n />\r\n <text\r\n x={x}\r\n y={y1}\r\n style={{\r\n ...(color && { fill: color }),\r\n textAnchor: textSide === 'left' ? 'end' : 'start',\r\n ...(styles?.text || {}),\r\n }}\r\n className={cn(\r\n 'text-xs font-bold',\r\n !color ? 'fill-primary-gray-700 dark:fill-primary-gray-300' : undefined,\r\n classNames?.text,\r\n )}\r\n dy={12.5}\r\n dx={textSide === 'left' ? -5 : 5}\r\n >\r\n {text}\r\n </text>\r\n </motion.g>\r\n );\r\n}\r\n"],"names":["RefLineY","props","text","x1","x2","y","classNames","styles","color","animate","isInView","jsxs","motion","jsx","cn","RefLineX","y1","y2","x","textSide"],"mappings":";;AAuBO,SAASA,EAASC,GAAsB;AAC7C,QAAM,EAAE,MAAAC,GAAM,IAAAC,GAAI,IAAAC,GAAI,GAAAC,GAAG,YAAAC,GAAY,QAAAC,GAAQ,OAAAC,GAAO,SAAAC,GAAS,UAAAC,EAAA,IAAaT;AAC1E,SAAKC,IAEHS,gBAAAA,EAAAA;AAAAA,IAACC,EAAO;AAAA,IAAP;AAAA,MAEC,MAAM,EAAE,SAAS,GAAG,YAAY,EAAE,UAAUH,GAAS,YAAY,IAAE;AAAA,MACnE,UAAU;AAAA,QACR,SAAS;AAAA,UACP,SAAS;AAAA,QAAA;AAAA,QAEX,aAAa;AAAA,UACX,SAAS;AAAA,UACT,YAAY,EAAE,UAAUA,GAAS,YAAY,EAAA;AAAA,QAAE;AAAA,MACjD;AAAA,MAEF,SAAQ;AAAA,MACR,SAASC,IAAW,gBAAgB;AAAA,MAEpC,UAAA;AAAA,QAAAG,gBAAAA,EAAAA;AAAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAWC;AAAAA,cACT;AAAA,cACCN,IAAiE,SAAzD;AAAA,cACTF,GAAY;AAAA,YAAA;AAAA,YAEd,OAAO;AAAA,cACL,GAAIE,KAAS,EAAE,QAAQA,EAAA;AAAA,cACvB,GAAID,GAAQ,QAAQ,CAAA;AAAA,YAAC;AAAA,YAEvB,IAAIF;AAAA,YACJ,IAAIA;AAAA,YACJ,IAAAF;AAAA,YACA,IAAAC;AAAA,UAAA;AAAA,QAAA;AAAA,QAEFS,gBAAAA,EAAAA;AAAAA,UAAC;AAAA,UAAA;AAAA,YACC,GAAGT;AAAA,YACH,GAAAC;AAAA,YACA,OAAO;AAAA,cACL,GAAIG,KAAS,EAAE,MAAMA,EAAA;AAAA,cACrB,YAAY;AAAA,cACZ,GAAID,GAAQ,QAAQ,CAAA;AAAA,YAAC;AAAA,YAEvB,WAAWO;AAAAA,cACT;AAAA,cACCN,IAA8D,SAAtD;AAAA,cACTF,GAAY;AAAA,YAAA;AAAA,YAEd,IAAI;AAAA,YAEH,UAAAJ;AAAA,UAAA;AAAA,QAAA;AAAA,MACH;AAAA,IAAA;AAAA,IA7CK,GAAGC,CAAE,IAAIC,CAAE,IAAIC,CAAC;AAAA,EAAA,IAHP;AAmDpB;AAqBO,SAASU,EAASd,GAAsB;AAC7C,QAAM,EAAE,MAAAC,GAAM,IAAAc,GAAI,IAAAC,GAAI,GAAAC,GAAG,YAAAZ,GAAY,QAAAC,GAAQ,OAAAC,GAAO,UAAAW,GAAU,SAAAV,GAAS,UAAAC,EAAA,IAAaT;AACpF,SAAKC,IAEHS,gBAAAA,EAAAA;AAAAA,IAACC,EAAO;AAAA,IAAP;AAAA,MAEC,MAAM,EAAE,SAAS,GAAG,YAAY,EAAE,UAAUH,GAAS,YAAY,IAAE;AAAA,MACnE,UAAU;AAAA,QACR,SAAS;AAAA,UACP,SAAS;AAAA,QAAA;AAAA,QAEX,aAAa;AAAA,UACX,SAAS;AAAA,UACT,YAAY,EAAE,UAAUA,GAAS,YAAY,EAAA;AAAA,QAAE;AAAA,MACjD;AAAA,MAEF,SAAQ;AAAA,MACR,SAASC,IAAW,gBAAgB;AAAA,MAEpC,UAAA;AAAA,QAAAG,gBAAAA,EAAAA;AAAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAWC;AAAAA,cACT;AAAA,cACCN,IAAiE,SAAzD;AAAA,cACTF,GAAY;AAAA,YAAA;AAAA,YAEd,OAAO;AAAA,cACL,GAAIE,KAAS,EAAE,QAAQA,EAAA;AAAA,cACvB,GAAID,GAAQ,QAAQ,CAAA;AAAA,YAAC;AAAA,YAEvB,IAAAS;AAAA,YACA,IAAAC;AAAA,YACA,IAAIC;AAAA,YACJ,IAAIA;AAAA,UAAA;AAAA,QAAA;AAAA,QAENL,gBAAAA,EAAAA;AAAAA,UAAC;AAAA,UAAA;AAAA,YACC,GAAAK;AAAA,YACA,GAAGF;AAAA,YACH,OAAO;AAAA,cACL,GAAIR,KAAS,EAAE,MAAMA,EAAA;AAAA,cACrB,YAAYW,MAAa,SAAS,QAAQ;AAAA,cAC1C,GAAIZ,GAAQ,QAAQ,CAAA;AAAA,YAAC;AAAA,YAEvB,WAAWO;AAAAA,cACT;AAAA,cACCN,IAA6D,SAArD;AAAA,cACTF,GAAY;AAAA,YAAA;AAAA,YAEd,IAAI;AAAA,YACJ,IAAIa,MAAa,SAAS,KAAK;AAAA,YAE9B,UAAAjB;AAAA,UAAA;AAAA,QAAA;AAAA,MACH;AAAA,IAAA;AAAA,IA9CK,GAAGc,CAAE,IAAIC,CAAE,IAAIC,CAAC;AAAA,EAAA,IAHP;AAoDpB;"}
1
+ {"version":3,"file":"ReferenceLine-CfAW3vKJ.js","sources":["../src/Components/Elements/ReferenceLine.tsx"],"sourcesContent":["import { cn } from '@undp/design-system-react/cn';\r\nimport { motion } from 'motion/react';\r\n\r\nimport { AnimateDataType } from '@/Types';\r\n\r\ninterface RefLineYProps {\r\n text?: string;\r\n color?: string;\r\n y: number;\r\n x1: number;\r\n x2: number;\r\n classNames?: {\r\n line?: string;\r\n text?: string;\r\n };\r\n styles?: {\r\n line?: React.CSSProperties;\r\n text?: React.CSSProperties;\r\n };\r\n animate?: AnimateDataType;\r\n isInView: boolean;\r\n}\r\n\r\nexport function RefLineY(props: RefLineYProps) {\r\n const { text, x1, x2, y, classNames, styles, color, animate, isInView } = props;\r\n if (!text) return null;\r\n return (\r\n <motion.g\r\n key={`${x1}-${x2}-${y}`}\r\n exit={{ opacity: 0, transition: { duration: animate?.duration || 0 } }}\r\n variants={{\r\n initial: {\r\n opacity: 0,\r\n },\r\n whileInView: {\r\n opacity: 1,\r\n transition: { duration: animate?.duration || 0 },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n >\r\n <line\r\n className={cn(\r\n 'undp-ref-line',\r\n !color ? 'stroke-primary-gray-700 dark:stroke-primary-gray-300' : undefined,\r\n classNames?.line,\r\n )}\r\n style={{\r\n ...(color && { stroke: color }),\r\n ...(styles?.line || {}),\r\n }}\r\n y1={y}\r\n y2={y}\r\n x1={x1}\r\n x2={x2}\r\n />\r\n <text\r\n x={x2}\r\n y={y}\r\n style={{\r\n ...(color && { fill: color }),\r\n textAnchor: 'end',\r\n ...(styles?.text || {}),\r\n }}\r\n className={cn(\r\n 'text-xs font-bold',\r\n !color ? ' fill-primary-gray-700 dark:fill-primary-gray-300' : undefined,\r\n classNames?.text,\r\n )}\r\n dy={-5}\r\n >\r\n {text}\r\n </text>\r\n </motion.g>\r\n );\r\n}\r\n\r\ninterface RefLineXProps {\r\n text?: string;\r\n color?: string;\r\n x: number;\r\n y1: number;\r\n y2: number;\r\n textSide: 'left' | 'right';\r\n classNames?: {\r\n line?: string;\r\n text?: string;\r\n };\r\n styles?: {\r\n line?: React.CSSProperties;\r\n text?: React.CSSProperties;\r\n };\r\n animate?: AnimateDataType;\r\n isInView: boolean;\r\n}\r\n\r\nexport function RefLineX(props: RefLineXProps) {\r\n const { text, y1, y2, x, classNames, styles, color, textSide, animate, isInView } = props;\r\n if (!text) return null;\r\n return (\r\n <motion.g\r\n key={`${y1}-${y2}-${x}`}\r\n exit={{ opacity: 0, transition: { duration: animate?.duration || 0 } }}\r\n variants={{\r\n initial: {\r\n opacity: 0,\r\n },\r\n whileInView: {\r\n opacity: 1,\r\n transition: { duration: animate?.duration || 0 },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n >\r\n <line\r\n className={cn(\r\n 'undp-ref-line',\r\n !color ? 'stroke-primary-gray-700 dark:stroke-primary-gray-300' : undefined,\r\n classNames?.line,\r\n )}\r\n style={{\r\n ...(color && { stroke: color }),\r\n ...(styles?.line || {}),\r\n }}\r\n y1={y1}\r\n y2={y2}\r\n x1={x}\r\n x2={x}\r\n />\r\n <text\r\n x={x}\r\n y={y1}\r\n style={{\r\n ...(color && { fill: color }),\r\n textAnchor: textSide === 'left' ? 'end' : 'start',\r\n ...(styles?.text || {}),\r\n }}\r\n className={cn(\r\n 'text-xs font-bold',\r\n !color ? 'fill-primary-gray-700 dark:fill-primary-gray-300' : undefined,\r\n classNames?.text,\r\n )}\r\n dy={12.5}\r\n dx={textSide === 'left' ? -5 : 5}\r\n >\r\n {text}\r\n </text>\r\n </motion.g>\r\n );\r\n}\r\n"],"names":["RefLineY","props","text","x1","x2","y","classNames","styles","color","animate","isInView","jsxs","motion","jsx","cn","RefLineX","y1","y2","x","textSide"],"mappings":";;AAuBO,SAASA,EAASC,GAAsB;AAC7C,QAAM,EAAE,MAAAC,GAAM,IAAAC,GAAI,IAAAC,GAAI,GAAAC,GAAG,YAAAC,GAAY,QAAAC,GAAQ,OAAAC,GAAO,SAAAC,GAAS,UAAAC,EAAA,IAAaT;AAC1E,SAAKC,IAEHS,gBAAAA,EAAAA;AAAAA,IAACC,EAAO;AAAA,IAAP;AAAA,MAEC,MAAM,EAAE,SAAS,GAAG,YAAY,EAAE,UAAUH,GAAS,YAAY,IAAE;AAAA,MACnE,UAAU;AAAA,QACR,SAAS;AAAA,UACP,SAAS;AAAA,QAAA;AAAA,QAEX,aAAa;AAAA,UACX,SAAS;AAAA,UACT,YAAY,EAAE,UAAUA,GAAS,YAAY,EAAA;AAAA,QAAE;AAAA,MACjD;AAAA,MAEF,SAAQ;AAAA,MACR,SAASC,IAAW,gBAAgB;AAAA,MAEpC,UAAA;AAAA,QAAAG,gBAAAA,EAAAA;AAAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAWC;AAAAA,cACT;AAAA,cACCN,IAAiE,SAAzD;AAAA,cACTF,GAAY;AAAA,YAAA;AAAA,YAEd,OAAO;AAAA,cACL,GAAIE,KAAS,EAAE,QAAQA,EAAA;AAAA,cACvB,GAAID,GAAQ,QAAQ,CAAA;AAAA,YAAC;AAAA,YAEvB,IAAIF;AAAA,YACJ,IAAIA;AAAA,YACJ,IAAAF;AAAA,YACA,IAAAC;AAAA,UAAA;AAAA,QAAA;AAAA,QAEFS,gBAAAA,EAAAA;AAAAA,UAAC;AAAA,UAAA;AAAA,YACC,GAAGT;AAAA,YACH,GAAAC;AAAA,YACA,OAAO;AAAA,cACL,GAAIG,KAAS,EAAE,MAAMA,EAAA;AAAA,cACrB,YAAY;AAAA,cACZ,GAAID,GAAQ,QAAQ,CAAA;AAAA,YAAC;AAAA,YAEvB,WAAWO;AAAAA,cACT;AAAA,cACCN,IAA8D,SAAtD;AAAA,cACTF,GAAY;AAAA,YAAA;AAAA,YAEd,IAAI;AAAA,YAEH,UAAAJ;AAAA,UAAA;AAAA,QAAA;AAAA,MACH;AAAA,IAAA;AAAA,IA7CK,GAAGC,CAAE,IAAIC,CAAE,IAAIC,CAAC;AAAA,EAAA,IAHP;AAmDpB;AAqBO,SAASU,EAASd,GAAsB;AAC7C,QAAM,EAAE,MAAAC,GAAM,IAAAc,GAAI,IAAAC,GAAI,GAAAC,GAAG,YAAAZ,GAAY,QAAAC,GAAQ,OAAAC,GAAO,UAAAW,GAAU,SAAAV,GAAS,UAAAC,EAAA,IAAaT;AACpF,SAAKC,IAEHS,gBAAAA,EAAAA;AAAAA,IAACC,EAAO;AAAA,IAAP;AAAA,MAEC,MAAM,EAAE,SAAS,GAAG,YAAY,EAAE,UAAUH,GAAS,YAAY,IAAE;AAAA,MACnE,UAAU;AAAA,QACR,SAAS;AAAA,UACP,SAAS;AAAA,QAAA;AAAA,QAEX,aAAa;AAAA,UACX,SAAS;AAAA,UACT,YAAY,EAAE,UAAUA,GAAS,YAAY,EAAA;AAAA,QAAE;AAAA,MACjD;AAAA,MAEF,SAAQ;AAAA,MACR,SAASC,IAAW,gBAAgB;AAAA,MAEpC,UAAA;AAAA,QAAAG,gBAAAA,EAAAA;AAAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAWC;AAAAA,cACT;AAAA,cACCN,IAAiE,SAAzD;AAAA,cACTF,GAAY;AAAA,YAAA;AAAA,YAEd,OAAO;AAAA,cACL,GAAIE,KAAS,EAAE,QAAQA,EAAA;AAAA,cACvB,GAAID,GAAQ,QAAQ,CAAA;AAAA,YAAC;AAAA,YAEvB,IAAAS;AAAA,YACA,IAAAC;AAAA,YACA,IAAIC;AAAA,YACJ,IAAIA;AAAA,UAAA;AAAA,QAAA;AAAA,QAENL,gBAAAA,EAAAA;AAAAA,UAAC;AAAA,UAAA;AAAA,YACC,GAAAK;AAAA,YACA,GAAGF;AAAA,YACH,OAAO;AAAA,cACL,GAAIR,KAAS,EAAE,MAAMA,EAAA;AAAA,cACrB,YAAYW,MAAa,SAAS,QAAQ;AAAA,cAC1C,GAAIZ,GAAQ,QAAQ,CAAA;AAAA,YAAC;AAAA,YAEvB,WAAWO;AAAAA,cACT;AAAA,cACCN,IAA6D,SAArD;AAAA,cACTF,GAAY;AAAA,YAAA;AAAA,YAEd,IAAI;AAAA,YACJ,IAAIa,MAAa,SAAS,KAAK;AAAA,YAE9B,UAAAjB;AAAA,UAAA;AAAA,QAAA;AAAA,MACH;AAAA,IAAA;AAAA,IA9CK,GAAGc,CAAE,IAAIC,CAAE,IAAIC,CAAC;AAAA,EAAA,IAHP;AAoDpB;"}
@@ -1,7 +1,7 @@
1
1
  import { j as i, m as x } from "./index-CHPV5EwG-BPSP-7Jg.js";
2
2
  import { g } from "./generateRandomString-za3IQGfQ.js";
3
- import { A as y } from "./index-BxAUvrua.js";
4
- import { m as u } from "./proxy-DJxJg1kD.js";
3
+ import { A as y } from "./index-CNvov0eg.js";
4
+ import { m as u } from "./proxy-CkpFesk1.js";
5
5
  function R(s) {
6
6
  const { color: t, x1: r, x2: o, y1: n, y2: l, className: m, style: d, animate: e, isInView: c, graphWidth: h, graphHeight: p } = s, a = g(8);
7
7
  return /* @__PURE__ */ i.jsxs("g", { children: [
@@ -45,4 +45,4 @@ function R(s) {
45
45
  export {
46
46
  R
47
47
  };
48
- //# sourceMappingURL=RegressionLine-BFwDCTUU.js.map
48
+ //# sourceMappingURL=RegressionLine-mH7UKOPi.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RegressionLine-BFwDCTUU.js","sources":["../src/Components/Elements/RegressionLine.tsx"],"sourcesContent":["import { cn } from '@undp/design-system-react/cn';\r\nimport { AnimatePresence, motion } from 'motion/react';\r\n\r\nimport { AnimateDataType } from '@/Types';\r\nimport { generateRandomString } from '@/Utils/generateRandomString';\r\n\r\ninterface Props {\r\n color?: string;\r\n y1: number;\r\n y2: number;\r\n x1: number;\r\n x2: number;\r\n graphWidth: number;\r\n graphHeight: number;\r\n className?: string;\r\n style?: React.CSSProperties;\r\n animate: AnimateDataType;\r\n isInView: boolean;\r\n}\r\n\r\nexport function RegressionLine(props: Props) {\r\n const { color, x1, x2, y1, y2, className, style, animate, isInView, graphWidth, graphHeight } =\r\n props;\r\n const id = generateRandomString(8);\r\n return (\r\n <g>\r\n <defs>\r\n <clipPath id={id}>\r\n <rect x='0' y='0' width={graphWidth} height={graphHeight} />\r\n </clipPath>\r\n </defs>\r\n <AnimatePresence>\r\n <motion.line\r\n clipPath={`url(#${id})`}\r\n className={cn(\r\n 'undp-ref-line',\r\n !color ? 'stroke-primary-gray-700 dark:stroke-primary-gray-300' : undefined,\r\n className,\r\n )}\r\n style={{\r\n ...(color && { stroke: color }),\r\n fill: 'none',\r\n ...(style || {}),\r\n }}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n variants={{\r\n initial: {\r\n y1,\r\n y2: y1,\r\n x1,\r\n x2: x1,\r\n },\r\n whileInView: {\r\n y1,\r\n y2,\r\n x1,\r\n x2,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n />\r\n </AnimatePresence>\r\n </g>\r\n );\r\n}\r\n"],"names":["RegressionLine","props","color","x1","x2","y1","y2","className","style","animate","isInView","graphWidth","graphHeight","id","generateRandomString","jsx","AnimatePresence","motion","cn"],"mappings":";;;;AAoBO,SAASA,EAAeC,GAAc;AAC3C,QAAM,EAAE,OAAAC,GAAO,IAAAC,GAAI,IAAAC,GAAI,IAAAC,GAAI,IAAAC,GAAI,WAAAC,GAAW,OAAAC,GAAO,SAAAC,GAAS,UAAAC,GAAU,YAAAC,GAAY,aAAAC,EAAA,IAC9EX,GACIY,IAAKC,EAAqB,CAAC;AACjC,gCACG,KAAA,EACC,UAAA;AAAA,IAAAC,gBAAAA,MAAC,QAAA,EACC,UAAAA,gBAAAA,EAAAA,IAAC,YAAA,EAAS,IAAAF,GACR,gCAAC,QAAA,EAAK,GAAE,KAAI,GAAE,KAAI,OAAOF,GAAY,QAAQC,EAAA,CAAa,GAC5D,GACF;AAAA,0BACCI,GAAA,EACC,UAAAD,gBAAAA,EAAAA;AAAAA,MAACE,EAAO;AAAA,MAAP;AAAA,QACC,UAAU,QAAQJ,CAAE;AAAA,QACpB,WAAWK;AAAAA,UACT;AAAA,UACChB,IAAiE,SAAzD;AAAA,UACTK;AAAA,QAAA;AAAA,QAEF,OAAO;AAAA,UACL,GAAIL,KAAS,EAAE,QAAQA,EAAA;AAAA,UACvB,MAAM;AAAA,UACN,GAAIM,KAAS,CAAA;AAAA,QAAC;AAAA,QAEhB,MAAM,EAAE,SAAS,GAAG,YAAY,EAAE,UAAUC,EAAQ,WAAS;AAAA,QAC7D,UAAU;AAAA,UACR,SAAS;AAAA,YACP,IAAAJ;AAAA,YACA,IAAIA;AAAA,YACJ,IAAAF;AAAA,YACA,IAAIA;AAAA,UAAA;AAAA,UAEN,aAAa;AAAA,YACX,IAAAE;AAAA,YACA,IAAAC;AAAA,YACA,IAAAH;AAAA,YACA,IAAAC;AAAA,YACA,YAAY,EAAE,UAAUK,EAAQ,SAAA;AAAA,UAAS;AAAA,QAC3C;AAAA,QAEF,SAAQ;AAAA,QACR,SAASC,IAAW,gBAAgB;AAAA,MAAA;AAAA,IAAA,EACtC,CACF;AAAA,EAAA,GACF;AAEJ;"}
1
+ {"version":3,"file":"RegressionLine-mH7UKOPi.js","sources":["../src/Components/Elements/RegressionLine.tsx"],"sourcesContent":["import { cn } from '@undp/design-system-react/cn';\r\nimport { AnimatePresence, motion } from 'motion/react';\r\n\r\nimport { AnimateDataType } from '@/Types';\r\nimport { generateRandomString } from '@/Utils/generateRandomString';\r\n\r\ninterface Props {\r\n color?: string;\r\n y1: number;\r\n y2: number;\r\n x1: number;\r\n x2: number;\r\n graphWidth: number;\r\n graphHeight: number;\r\n className?: string;\r\n style?: React.CSSProperties;\r\n animate: AnimateDataType;\r\n isInView: boolean;\r\n}\r\n\r\nexport function RegressionLine(props: Props) {\r\n const { color, x1, x2, y1, y2, className, style, animate, isInView, graphWidth, graphHeight } =\r\n props;\r\n const id = generateRandomString(8);\r\n return (\r\n <g>\r\n <defs>\r\n <clipPath id={id}>\r\n <rect x='0' y='0' width={graphWidth} height={graphHeight} />\r\n </clipPath>\r\n </defs>\r\n <AnimatePresence>\r\n <motion.line\r\n clipPath={`url(#${id})`}\r\n className={cn(\r\n 'undp-ref-line',\r\n !color ? 'stroke-primary-gray-700 dark:stroke-primary-gray-300' : undefined,\r\n className,\r\n )}\r\n style={{\r\n ...(color && { stroke: color }),\r\n fill: 'none',\r\n ...(style || {}),\r\n }}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n variants={{\r\n initial: {\r\n y1,\r\n y2: y1,\r\n x1,\r\n x2: x1,\r\n },\r\n whileInView: {\r\n y1,\r\n y2,\r\n x1,\r\n x2,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n />\r\n </AnimatePresence>\r\n </g>\r\n );\r\n}\r\n"],"names":["RegressionLine","props","color","x1","x2","y1","y2","className","style","animate","isInView","graphWidth","graphHeight","id","generateRandomString","jsx","AnimatePresence","motion","cn"],"mappings":";;;;AAoBO,SAASA,EAAeC,GAAc;AAC3C,QAAM,EAAE,OAAAC,GAAO,IAAAC,GAAI,IAAAC,GAAI,IAAAC,GAAI,IAAAC,GAAI,WAAAC,GAAW,OAAAC,GAAO,SAAAC,GAAS,UAAAC,GAAU,YAAAC,GAAY,aAAAC,EAAA,IAC9EX,GACIY,IAAKC,EAAqB,CAAC;AACjC,gCACG,KAAA,EACC,UAAA;AAAA,IAAAC,gBAAAA,MAAC,QAAA,EACC,UAAAA,gBAAAA,EAAAA,IAAC,YAAA,EAAS,IAAAF,GACR,gCAAC,QAAA,EAAK,GAAE,KAAI,GAAE,KAAI,OAAOF,GAAY,QAAQC,EAAA,CAAa,GAC5D,GACF;AAAA,0BACCI,GAAA,EACC,UAAAD,gBAAAA,EAAAA;AAAAA,MAACE,EAAO;AAAA,MAAP;AAAA,QACC,UAAU,QAAQJ,CAAE;AAAA,QACpB,WAAWK;AAAAA,UACT;AAAA,UACChB,IAAiE,SAAzD;AAAA,UACTK;AAAA,QAAA;AAAA,QAEF,OAAO;AAAA,UACL,GAAIL,KAAS,EAAE,QAAQA,EAAA;AAAA,UACvB,MAAM;AAAA,UACN,GAAIM,KAAS,CAAA;AAAA,QAAC;AAAA,QAEhB,MAAM,EAAE,SAAS,GAAG,YAAY,EAAE,UAAUC,EAAQ,WAAS;AAAA,QAC7D,UAAU;AAAA,UACR,SAAS;AAAA,YACP,IAAAJ;AAAA,YACA,IAAIA;AAAA,YACJ,IAAAF;AAAA,YACA,IAAIA;AAAA,UAAA;AAAA,UAEN,aAAa;AAAA,YACX,IAAAE;AAAA,YACA,IAAAC;AAAA,YACA,IAAAH;AAAA,YACA,IAAAC;AAAA,YACA,YAAY,EAAE,UAAUK,EAAQ,SAAA;AAAA,UAAS;AAAA,QAC3C;AAAA,QAEF,SAAQ;AAAA,QACR,SAASC,IAAW,gBAAgB;AAAA,MAAA;AAAA,IAAA,EACtC,CACF;AAAA,EAAA,GACF;AAEJ;"}
@@ -1,2 +1,2 @@
1
- "use strict";const i=require("./index-CHPV5EwG-DDoeWRVt.cjs"),h=require("./generateRandomString-B5zBiJzS.cjs"),p=require("./index-DVOJ7vxH.cjs"),g=require("./proxy-PQd2AItT.cjs");function j(a){const{color:e,x1:n,x2:o,y1:t,y2:x,className:l,style:c,animate:r,isInView:d,graphWidth:u,graphHeight:m}=a,s=h.generateRandomString(8);return i.jsxRuntimeExports.jsxs("g",{children:[i.jsxRuntimeExports.jsx("defs",{children:i.jsxRuntimeExports.jsx("clipPath",{id:s,children:i.jsxRuntimeExports.jsx("rect",{x:"0",y:"0",width:u,height:m})})}),i.jsxRuntimeExports.jsx(p.AnimatePresence,{children:i.jsxRuntimeExports.jsx(g.motion.line,{clipPath:`url(#${s})`,className:i.mo("undp-ref-line",e?void 0:"stroke-primary-gray-700 dark:stroke-primary-gray-300",l),style:{...e&&{stroke:e},fill:"none",...c||{}},exit:{opacity:0,transition:{duration:r.duration}},variants:{initial:{y1:t,y2:t,x1:n,x2:n},whileInView:{y1:t,y2:x,x1:n,x2:o,transition:{duration:r.duration}}},initial:"initial",animate:d?"whileInView":"initial"})})]})}exports.RegressionLine=j;
2
- //# sourceMappingURL=RegressionLine-7_rKTHN_.cjs.map
1
+ "use strict";const i=require("./index-CHPV5EwG-DDoeWRVt.cjs"),h=require("./generateRandomString-B5zBiJzS.cjs"),p=require("./index-BW8iNx7E.cjs"),g=require("./proxy-BHRoeZgd.cjs");function j(a){const{color:e,x1:n,x2:o,y1:t,y2:x,className:l,style:c,animate:r,isInView:d,graphWidth:u,graphHeight:m}=a,s=h.generateRandomString(8);return i.jsxRuntimeExports.jsxs("g",{children:[i.jsxRuntimeExports.jsx("defs",{children:i.jsxRuntimeExports.jsx("clipPath",{id:s,children:i.jsxRuntimeExports.jsx("rect",{x:"0",y:"0",width:u,height:m})})}),i.jsxRuntimeExports.jsx(p.AnimatePresence,{children:i.jsxRuntimeExports.jsx(g.motion.line,{clipPath:`url(#${s})`,className:i.mo("undp-ref-line",e?void 0:"stroke-primary-gray-700 dark:stroke-primary-gray-300",l),style:{...e&&{stroke:e},fill:"none",...c||{}},exit:{opacity:0,transition:{duration:r.duration}},variants:{initial:{y1:t,y2:t,x1:n,x2:n},whileInView:{y1:t,y2:x,x1:n,x2:o,transition:{duration:r.duration}}},initial:"initial",animate:d?"whileInView":"initial"})})]})}exports.RegressionLine=j;
2
+ //# sourceMappingURL=RegressionLine-xKdiJ8sw.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"RegressionLine-7_rKTHN_.cjs","sources":["../src/Components/Elements/RegressionLine.tsx"],"sourcesContent":["import { cn } from '@undp/design-system-react/cn';\r\nimport { AnimatePresence, motion } from 'motion/react';\r\n\r\nimport { AnimateDataType } from '@/Types';\r\nimport { generateRandomString } from '@/Utils/generateRandomString';\r\n\r\ninterface Props {\r\n color?: string;\r\n y1: number;\r\n y2: number;\r\n x1: number;\r\n x2: number;\r\n graphWidth: number;\r\n graphHeight: number;\r\n className?: string;\r\n style?: React.CSSProperties;\r\n animate: AnimateDataType;\r\n isInView: boolean;\r\n}\r\n\r\nexport function RegressionLine(props: Props) {\r\n const { color, x1, x2, y1, y2, className, style, animate, isInView, graphWidth, graphHeight } =\r\n props;\r\n const id = generateRandomString(8);\r\n return (\r\n <g>\r\n <defs>\r\n <clipPath id={id}>\r\n <rect x='0' y='0' width={graphWidth} height={graphHeight} />\r\n </clipPath>\r\n </defs>\r\n <AnimatePresence>\r\n <motion.line\r\n clipPath={`url(#${id})`}\r\n className={cn(\r\n 'undp-ref-line',\r\n !color ? 'stroke-primary-gray-700 dark:stroke-primary-gray-300' : undefined,\r\n className,\r\n )}\r\n style={{\r\n ...(color && { stroke: color }),\r\n fill: 'none',\r\n ...(style || {}),\r\n }}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n variants={{\r\n initial: {\r\n y1,\r\n y2: y1,\r\n x1,\r\n x2: x1,\r\n },\r\n whileInView: {\r\n y1,\r\n y2,\r\n x1,\r\n x2,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n />\r\n </AnimatePresence>\r\n </g>\r\n );\r\n}\r\n"],"names":["RegressionLine","props","color","x1","x2","y1","y2","className","style","animate","isInView","graphWidth","graphHeight","id","generateRandomString","jsx","AnimatePresence","motion","cn"],"mappings":"mLAoBO,SAASA,EAAeC,EAAc,CAC3C,KAAM,CAAE,MAAAC,EAAO,GAAAC,EAAI,GAAAC,EAAI,GAAAC,EAAI,GAAAC,EAAI,UAAAC,EAAW,MAAAC,EAAO,QAAAC,EAAS,SAAAC,EAAU,WAAAC,EAAY,YAAAC,CAAA,EAC9EX,EACIY,EAAKC,EAAAA,qBAAqB,CAAC,EACjC,gCACG,IAAA,CACC,SAAA,CAAAC,wBAAC,OAAA,CACC,SAAAA,EAAAA,kBAAAA,IAAC,WAAA,CAAS,GAAAF,EACR,iCAAC,OAAA,CAAK,EAAE,IAAI,EAAE,IAAI,MAAOF,EAAY,OAAQC,CAAA,CAAa,EAC5D,EACF,0BACCI,EAAAA,gBAAA,CACC,SAAAD,EAAAA,kBAAAA,IAACE,EAAAA,OAAO,KAAP,CACC,SAAU,QAAQJ,CAAE,IACpB,UAAWK,EAAAA,GACT,gBACChB,EAAiE,OAAzD,uDACTK,CAAA,EAEF,MAAO,CACL,GAAIL,GAAS,CAAE,OAAQA,CAAA,EACvB,KAAM,OACN,GAAIM,GAAS,CAAA,CAAC,EAEhB,KAAM,CAAE,QAAS,EAAG,WAAY,CAAE,SAAUC,EAAQ,SAAS,EAC7D,SAAU,CACR,QAAS,CACP,GAAAJ,EACA,GAAIA,EACJ,GAAAF,EACA,GAAIA,CAAA,EAEN,YAAa,CACX,GAAAE,EACA,GAAAC,EACA,GAAAH,EACA,GAAAC,EACA,WAAY,CAAE,SAAUK,EAAQ,QAAA,CAAS,CAC3C,EAEF,QAAQ,UACR,QAASC,EAAW,cAAgB,SAAA,CAAA,CACtC,CACF,CAAA,EACF,CAEJ"}
1
+ {"version":3,"file":"RegressionLine-xKdiJ8sw.cjs","sources":["../src/Components/Elements/RegressionLine.tsx"],"sourcesContent":["import { cn } from '@undp/design-system-react/cn';\r\nimport { AnimatePresence, motion } from 'motion/react';\r\n\r\nimport { AnimateDataType } from '@/Types';\r\nimport { generateRandomString } from '@/Utils/generateRandomString';\r\n\r\ninterface Props {\r\n color?: string;\r\n y1: number;\r\n y2: number;\r\n x1: number;\r\n x2: number;\r\n graphWidth: number;\r\n graphHeight: number;\r\n className?: string;\r\n style?: React.CSSProperties;\r\n animate: AnimateDataType;\r\n isInView: boolean;\r\n}\r\n\r\nexport function RegressionLine(props: Props) {\r\n const { color, x1, x2, y1, y2, className, style, animate, isInView, graphWidth, graphHeight } =\r\n props;\r\n const id = generateRandomString(8);\r\n return (\r\n <g>\r\n <defs>\r\n <clipPath id={id}>\r\n <rect x='0' y='0' width={graphWidth} height={graphHeight} />\r\n </clipPath>\r\n </defs>\r\n <AnimatePresence>\r\n <motion.line\r\n clipPath={`url(#${id})`}\r\n className={cn(\r\n 'undp-ref-line',\r\n !color ? 'stroke-primary-gray-700 dark:stroke-primary-gray-300' : undefined,\r\n className,\r\n )}\r\n style={{\r\n ...(color && { stroke: color }),\r\n fill: 'none',\r\n ...(style || {}),\r\n }}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n variants={{\r\n initial: {\r\n y1,\r\n y2: y1,\r\n x1,\r\n x2: x1,\r\n },\r\n whileInView: {\r\n y1,\r\n y2,\r\n x1,\r\n x2,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n />\r\n </AnimatePresence>\r\n </g>\r\n );\r\n}\r\n"],"names":["RegressionLine","props","color","x1","x2","y1","y2","className","style","animate","isInView","graphWidth","graphHeight","id","generateRandomString","jsx","AnimatePresence","motion","cn"],"mappings":"mLAoBO,SAASA,EAAeC,EAAc,CAC3C,KAAM,CAAE,MAAAC,EAAO,GAAAC,EAAI,GAAAC,EAAI,GAAAC,EAAI,GAAAC,EAAI,UAAAC,EAAW,MAAAC,EAAO,QAAAC,EAAS,SAAAC,EAAU,WAAAC,EAAY,YAAAC,CAAA,EAC9EX,EACIY,EAAKC,EAAAA,qBAAqB,CAAC,EACjC,gCACG,IAAA,CACC,SAAA,CAAAC,wBAAC,OAAA,CACC,SAAAA,EAAAA,kBAAAA,IAAC,WAAA,CAAS,GAAAF,EACR,iCAAC,OAAA,CAAK,EAAE,IAAI,EAAE,IAAI,MAAOF,EAAY,OAAQC,CAAA,CAAa,EAC5D,EACF,0BACCI,EAAAA,gBAAA,CACC,SAAAD,EAAAA,kBAAAA,IAACE,EAAAA,OAAO,KAAP,CACC,SAAU,QAAQJ,CAAE,IACpB,UAAWK,EAAAA,GACT,gBACChB,EAAiE,OAAzD,uDACTK,CAAA,EAEF,MAAO,CACL,GAAIL,GAAS,CAAE,OAAQA,CAAA,EACvB,KAAM,OACN,GAAIM,GAAS,CAAA,CAAC,EAEhB,KAAM,CAAE,QAAS,EAAG,WAAY,CAAE,SAAUC,EAAQ,SAAS,EAC7D,SAAU,CACR,QAAS,CACP,GAAAJ,EACA,GAAIA,EACJ,GAAAF,EACA,GAAIA,CAAA,EAEN,YAAa,CACX,GAAAE,EACA,GAAAC,EACA,GAAAH,EACA,GAAAC,EACA,WAAY,CAAE,SAAUK,EAAQ,QAAA,CAAS,CAC3C,EAEF,QAAQ,UACR,QAASC,EAAW,cAAgB,SAAA,CAAA,CACtC,CACF,CAAA,EACF,CAEJ"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("./index-CHPV5EwG-DDoeWRVt.cjs"),q=require("react"),ot=require("./index-CZbIGs8q.cjs"),ut=require("./index-BzeLQvXk.cjs"),Et=require("./index-C21TvELx.cjs"),Dt=require("./index-BXns0-ng.cjs"),Pt=require("./Modal-C_dl0EtQ.cjs"),ct=require("./Typography-k-kOjICQ.cjs"),Lt=require("./numberFormattingFunction-02t-wJta.cjs"),zt=require("./Tooltip-n8z5bfav.cjs"),It=require("./string2HTML-D2Avudmb.cjs"),Ht=require("./use-in-view-BCmzDU2O.cjs"),xt=require("./proxy-PQd2AItT.cjs"),At=require("./index-DVOJ7vxH.cjs"),Wt=require("./GraphHeader.cjs"),Gt=require("./GraphFooter.cjs"),Mt=require("./Colors.cjs"),Ft=require("./generateRandomString-B5zBiJzS.cjs"),Xt=require("./EmptyState-d8_8SxeW.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 pt(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 Yt(e){return e.target.depth}function Ut(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,Yt)-1:0}function ft(e){return function(){return e}}function St(e,n){return ht(e.source,n.source)||e.index-n.index}function _t(e,n){return ht(e.target,n.target)||e.index-n.index}function ht(e,n){return e.y0-n.y0}function yt(e){return e.value}function Zt(e){return e.index}function Qt(e){return e.nodes}function Jt(e){return e.links}function Nt(e,n){const i=e.get(n);if(!i)throw new Error("missing: "+n);return i}function Ct({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 vt(){let e=0,n=0,i=1,a=1,l=24,m=8,g,x=Zt,v=Ut,w,j,b=Qt,$=Jt,R=6;function d(){const t={nodes:b.apply(null,arguments),links:$.apply(null,arguments)};return S(t),L(t),V(t),X(t),A(t),Ct(t),t}d.update=function(t){return Ct(t),t},d.nodeId=function(t){return arguments.length?(x=typeof t=="function"?t:ft(t),d):x},d.nodeAlign=function(t){return arguments.length?(v=typeof t=="function"?t:ft(t),d):v},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?(j=t,d):j},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)=>[x(c,r,t),c]));for(const[c,r]of u.entries()){r.index=c;let{source:f,target:p}=r;typeof f!="object"&&(f=r.source=Nt(s,f)),typeof p!="object"&&(p=r.target=Nt(s,p)),f.sourceLinks.push(r),p.targetLinks.push(r)}if(j!=null)for(const{sourceLinks:c,targetLinks:r}of t)c.sort(j),r.sort(j)}function L({nodes:t}){for(const u of t)u.value=u.fixedValue===void 0?Math.max(pt(u.sourceLinks,yt),pt(u.targetLinks,yt)):u.fixedValue}function V({nodes:t}){const u=t.length;let s=new Set(t),c=new Set,r=0;for(;s.size;){for(const f of s){f.depth=r;for(const{target:p}of f.sourceLinks)c.add(p)}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 f of s){f.height=r;for(const{source:p}of f.targetLinks)c.add(p)}if(++r>u)throw new Error("circular link");s=c,c=new Set}}function B({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 f=Math.max(0,Math.min(u-1,Math.floor(v.call(null,r,u))));r.layer=f,r.x0=e+f*s,r.x1=r.x0+l,c[f]?c[f].push(r):c[f]=[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)/pt(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 f of r.sourceLinks)f.width=f.value*u}c=(a-c+g)/(s.length+1);for(let r=0;r<s.length;++r){const f=s[r];f.y0+=c*(r+1),f.y1+=c*(r+1)}P(s)}}function A(t){const u=B(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);tt(u,c,r),K(u,c,r)}}function K(t,u,s){for(let c=1,r=t.length;c<r;++c){const f=t[c];for(const p of f){let N=0,C=0;for(const{source:I,value:O}of p.targetLinks){let H=O*(p.layer-I.layer);N+=U(I,p)*H,C+=H}if(!(C>0))continue;let W=(N/C-p.y0)*u;p.y0+=W,p.y1+=W,T(p)}w===void 0&&f.sort(ht),D(f,s)}}function tt(t,u,s){for(let c=t.length,r=c-2;r>=0;--r){const f=t[r];for(const p of f){let N=0,C=0;for(const{target:I,value:O}of p.sourceLinks){let H=O*(I.layer-p.layer);N+=nt(p,I)*H,C+=H}if(!(C>0))continue;let W=(N/C-p.y0)*u;p.y0+=W,p.y1+=W,T(p)}w===void 0&&f.sort(ht),D(f,s)}}function D(t,u){const s=t.length>>1,c=t[s];et(t,c.y0-g,s-1,u),Y(t,c.y1+g,s+1,u),et(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],f=(u-r.y0)*c;f>1e-6&&(r.y0+=f,r.y1+=f),u=r.y1+g}}function et(t,u,s,c){for(;s>=0;--s){const r=t[s],f=(r.y1-u)*c;f>1e-6&&(r.y0-=f,r.y1-=f),u=r.y0-g}}function T({sourceLinks:t,targetLinks:u}){if(j===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(j===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 nt(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 jt=Math.PI,kt=2*jt,J=1e-6,Kt=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,x=i-e,v=a-n,w=m-e,j=g-n,b=w*w+j*j;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(j*x-v*w)>J)||!l)this._+="L"+(this._x1=e)+","+(this._y1=n);else{var $=i-m,R=a-g,d=x*x+v*v,S=$*$+R*R,L=Math.sqrt(d),V=Math.sqrt(b),X=l*Math.tan((jt-Math.acos((d+b-S)/(2*L*V)))/2),B=X/V,_=X/L;Math.abs(B-1)>J&&(this._+="L"+(e+B*w)+","+(n+B*j)),this._+="A"+l+","+l+",0,0,"+ +(j*$>w*R)+","+(this._x1=e+_*x)+","+(this._y1=n+_*v)}},arc:function(e,n,i,a,l,m){e=+e,n=+n,i=+i,m=!!m;var g=i*Math.cos(a),x=i*Math.sin(a),v=e+g,w=n+x,j=1^m,b=m?a-l:l-a;if(i<0)throw new Error("negative radius: "+i);this._x1===null?this._+="M"+v+","+w:(Math.abs(this._x1-v)>J||Math.abs(this._y1-w)>J)&&(this._+="L"+v+","+w),i&&(b<0&&(b=b%kt+kt),b>Kt?this._+="A"+i+","+i+",0,1,"+j+","+(e-g)+","+(n-x)+"A"+i+","+i+",0,1,"+j+","+(this._x1=v)+","+(this._y1=w):b>J&&(this._+="A"+i+","+i+",0,"+ +(b>=jt)+","+j+","+(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 Tt(e){return function(){return e}}function te(e){return e[0]}function ee(e){return e[1]}var ne=Array.prototype.slice;function oe(e){return e.source}function ie(e){return e.target}function re(e){var n=oe,i=ie,a=te,l=ee,m=null;function g(){var x,v=ne.call(arguments),w=n.apply(this,v),j=i.apply(this,v);if(m||(m=x=qt()),e(m,+a.apply(this,(v[0]=w,v)),+l.apply(this,v),+a.apply(this,(v[0]=j,v)),+l.apply(this,v)),x)return m=null,x+""||null}return g.source=function(x){return arguments.length?(n=x,g):n},g.target=function(x){return arguments.length?(i=x,g):i},g.x=function(x){return arguments.length?(a=typeof x=="function"?x:Tt(+x),g):a},g.y=function(x){return arguments.length?(l=typeof x=="function"?x:Tt(+x),g):l},g.context=function(x){return arguments.length?(m=x??null,g):m},g}function se(e,n,i,a,l){e.moveTo(n,i),e.bezierCurveTo(n=(n+a)/2,i,n,l,a,l)}function ae(){return re(se)}function le(e){return[e.source.x1,e.y0]}function ue(e){return[e.target.x0,e.y1]}function ce(){return ae().source(le).target(ue)}function fe(e){const{data:n,showLabels:i,leftMargin:a,rightMargin:l,truncateBy:m,width:g,height:x,topMargin:v,bottomMargin:w,tooltip:j,onSeriesMouseOver:b,suffix:$,prefix:R,showValues:d,onSeriesMouseClick:S,nodePadding:L,nodeWidth:V,id:X,highlightedSourceDataPoints:B,highlightedTargetDataPoints:_,defaultLinkOpacity:A,sourceTitle:K,targetTitle:tt,animate:D,sortNodes:Y,resetSelectionOnDoubleClick:et,detailsOnClick:T,styles:P,classNames:U,precision:nt,customLayers:t}=e,u=q.useRef(null),s=Ht.useInView(u,{once:D.once,amount:D.amount}),[c,r]=q.useState(void 0),[f,p]=q.useState(void 0),[N,C]=q.useState(void 0),[W,I]=q.useState(void 0),[O,H]=q.useState(void 0),z={top:v,bottom:w,left:a,right:l},G=g-z.left-z.right,F=x-z.top-z.bottom,rt=Y==="mostReadable"?vt().nodeWidth(V).nodePadding(L).size([G,F]).nodeAlign(mt):Y==="none"?vt().nodeWidth(V).nodePadding(L).size([G,F]).nodeAlign(mt).nodeSort(()=>null).linkSort(()=>null):vt().nodeWidth(V).nodePadding(L).size([G,F]).nodeAlign(mt).nodeSort(Y==="desc"?(o,M)=>(M.value||0)-(o.value||0):(o,M)=>(o.value||0)-(M.value||0)),{nodes:st,links:at}=rt(n),Q=ce();return h.jsxRuntimeExports.jsxs(h.jsxRuntimeExports.Fragment,{children:[h.jsxRuntimeExports.jsxs(xt.motion.svg,{width:`${g}px`,height:`${x}px`,viewBox:`0 0 ${g} ${x}`,style:{marginLeft:"auto",marginRight:"auto"},direction:"ltr",ref:u,children:[K?h.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:K}):null,tt?h.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:tt}):null,h.jsxRuntimeExports.jsxs("g",{transform:`translate(${z.left},${z.top})`,children:[t.filter(o=>o.position==="before").map(o=>o.layer),st.filter(o=>o.type==="source").map((o,M)=>h.jsxRuntimeExports.jsx("g",{onMouseEnter:()=>{C(o)},onMouseLeave:()=>{C(void 0)},children:h.jsxRuntimeExports.jsxs("g",{transform:`translate(${o.x0},${o.y0})`,children:[h.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?h.jsxRuntimeExports.jsx("foreignObject",{y:0-L/2,x:0-a,width:a,height:(o.y1||0)-(o.y0||0)+L,children:h.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?h.jsxRuntimeExports.jsx(ct.u,{marginBottom:d?"3xs":"none",size:"sm",leading:"none",className:h.mo("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?h.jsxRuntimeExports.jsx(ct.u,{marginBottom:"none",size:"sm",leading:"none",className:h.mo("sankey-right-value text-right font-bold",U?.graphObjectValues),style:{hyphens:"auto",color:o.color,...P?.graphObjectValues},children:Lt.numberFormattingFunction(o.value,"NA",nt,R,$)}):null]})}):null]})},M)),st.filter(o=>o.type==="target").map((o,M)=>h.jsxRuntimeExports.jsx("g",{onMouseEnter:()=>{C(o)},onMouseLeave:()=>{C(void 0)},children:h.jsxRuntimeExports.jsxs("g",{transform:`translate(${o.x0},${o.y0})`,children:[h.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?h.jsxRuntimeExports.jsx("foreignObject",{y:0-L/2,x:V,width:l-V,height:(o.y1||0)-(o.y0||0)+L,children:h.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?h.jsxRuntimeExports.jsx(ct.u,{marginBottom:d?"3xs":"none",size:"sm",leading:"none",className:h.mo("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?h.jsxRuntimeExports.jsx(ct.u,{size:"sm",leading:"none",marginBottom:"none",className:h.mo("sankey-left-value text-left font-bold",U?.graphObjectValues),style:{hyphens:"auto",color:o.color,...P?.graphObjectValues},children:Lt.numberFormattingFunction(o.value,"NA",nt,R,$)}):null]})}):null]})},M)),h.jsxRuntimeExports.jsx("defs",{children:at.map((o,M)=>h.jsxRuntimeExports.jsxs("linearGradient",{id:`${X}-gradient-${M}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%",gradientUnits:"userSpaceOnUse",children:[h.jsxRuntimeExports.jsx("stop",{offset:"0%",style:{stopColor:o.source.color,stopOpacity:1}}),h.jsxRuntimeExports.jsx("stop",{offset:"100%",style:{stopColor:o.target.color,stopOpacity:1}})]},M))}),h.jsxRuntimeExports.jsx("g",{children:h.jsxRuntimeExports.jsx(At.AnimatePresence,{children:at.map((o,M)=>h.jsxRuntimeExports.jsx(xt.motion.g,{className:"undp-viz-g-with-hover",onMouseEnter:Z=>{r(o.data),H(Z.clientY),I(Z.clientX),b?.(o)},onMouseMove:Z=>{r(o.data),H(Z.clientY),I(Z.clientX)},onClick:()=>{(S||T)&&(Dt.isEqual(f,o.data)&&et?(p(void 0),S?.(void 0)):(p(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:(B.length!==0||_.length!==0)&&(B.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:(B.length!==0||_.length!==0)&&(B.indexOf(o.source.label)!==-1||_.indexOf(o.target.label)!==-1)?.85:A,transition:{duration:D.duration}}},initial:"initial",animate:s?"whileInView":"initial",exit:{opacity:0,transition:{duration:D.duration}},children:h.jsxRuntimeExports.jsx(xt.motion.path,{d:Q(o)||"",style:{stroke:`url(#${X}-gradient-${M})`,strokeWidth:o.width,fill:"none"},exit:{opacity:0,transition:{duration:D.duration}},variants:{initial:{pathLength:0,opacity:1},whileInView:{pathLength:1,opacity:1,transition:{duration:D.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&&j&&W&&O?h.jsxRuntimeExports.jsx(zt.Tooltip,{data:c,body:j,xPos:W,yPos:O,backgroundStyle:P?.tooltip,className:U?.tooltip}):null,T&&f!==void 0?h.jsxRuntimeExports.jsx(Pt.X,{open:f!==void 0,onClose:()=>{p(void 0)},children:h.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof T=="string"?{__html:It.string2HTML(T,f)}:void 0,children:typeof T=="function"?T(f):null})}):null]})}function he(e){const{data:n,graphTitle:i,sources:a,graphDescription:l,showLabels:m=!0,leftMargin:g=75,rightMargin:x=75,topMargin:v=30,bottomMargin:w=10,truncateBy:j=999,height:b,width:$,footNote:R,padding:d,backgroundColor:S,tooltip:L,onSeriesMouseOver:V,suffix:X="",prefix:B="",relativeHeight:_,showValues:A=!0,graphID:K,onSeriesMouseClick:tt,graphDownload:D=!1,dataDownload:Y=!1,fillContainer:et=!0,language:T="en",minHeight:P=0,theme:U="light",ariaLabel:nt,sourceColors:t,targetColors:u,sourceColorDomain:s,targetColorDomain:c,nodePadding:r=5,nodeWidth:f=5,highlightedSourceDataPoints:p=[],highlightedTargetDataPoints:N=[],defaultLinkOpacity:C=.3,sourceTitle:W,targetTitle:I,sortNodes:O="mostReadable",resetSelectionOnDoubleClick:H=!0,detailsOnClick:z,styles:G,classNames:F,animate:rt=!1,precision:st=2,customLayers:at=[]}=e,[Q,o]=q.useState(0),[M,Z]=q.useState(0),[bt,Vt]=q.useState(void 0),it=q.useRef(null),$t=q.useRef(null);return q.useEffect(()=>{const E=ot.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||ot.uniqBy(n,"source").map(y=>`${y.source}`)).findIndex(y=>`${y}`==`${k.source}`)>t.length?t.length-1:(s||ot.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))})),lt=O==="asc"?ut.sortBy(E,k=>k.totalValue):O==="desc"?ut.sortBy(E,k=>k.totalValue).reverse():E,gt=ot.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||ot.uniqBy(n,"target").map(y=>`${y.target}`)).findIndex(y=>`${y}`==`${k.target}`)>u.length?u.length-1:(c||ot.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))})),Bt=O==="asc"?ut.sortBy(gt,k=>k.totalValue):O==="desc"?ut.sortBy(gt,k=>k.totalValue).reverse():gt,dt=[...lt,...Bt];Vt({nodes:dt,links:n.map(k=>({source:dt.findIndex(y=>y.name===`source_${k.source}`),target:dt.findIndex(y=>y.name===`target_${k.target}`),value:k.value,data:{...k}}))})},[n,O,s,t,c,u]),q.useEffect(()=>{const E=new ResizeObserver(lt=>{o($||lt[0].target.clientWidth||620),Z(b||lt[0].target.clientHeight||480)});return it.current&&(Z(it.current.clientHeight||480),o(it.current.clientWidth||620),$||E.observe(it.current)),()=>E.disconnect()},[$,b]),h.jsxRuntimeExports.jsx("div",{className:`${U||"light"} flex ${$?"grow-0":"grow"} ${et?"w-full":"w-fit"} `,dir:T==="he"||T==="ar"?"rtl":void 0,children:h.jsxRuntimeExports.jsx("div",{className:h.mo(`${S?S===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${T||"en"}`,F?.graphContainer),style:{...G?.graphContainer||{},...S&&S!==!0?{backgroundColor:S}:{}},id:K,ref:$t,"aria-label":nt||`${i?`The graph shows ${i}. `:""}This is a sankey chart showing flow. ${l?` ${l}`:""}`,children:h.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:S?d||"1rem":d||0},children:h.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-4 w-full grow justify-between",children:[i||l||D||Y?h.jsxRuntimeExports.jsx(Wt.GraphHeader,{styles:{title:G?.title,description:G?.description},classNames:{title:F?.title,description:F?.description},graphTitle:i,graphDescription:l,width:$,graphDownload:D?$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,h.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:n.length===0?h.jsxRuntimeExports.jsx(Xt.EmptyState,{}):h.jsxRuntimeExports.jsx("div",{className:"flex flex-col grow justify-center gap-3 w-full leading-0",ref:it,"aria-label":"Graph area",children:($||Q)&&(b||M)&&bt?h.jsxRuntimeExports.jsx(fe,{data:bt,width:$||Q,nodePadding:r,nodeWidth:f,height:Math.max(P,b||(_?P?($||Q)*_>P?($||Q)*_:P:($||Q)*_:M)),showLabels:m,leftMargin:g,rightMargin:x,topMargin:v,bottomMargin:w,truncateBy:j,tooltip:L,onSeriesMouseOver:V,showValues:A,suffix:X,prefix:B,onSeriesMouseClick:tt,id:Ft.generateRandomString(8),highlightedSourceDataPoints:p.map(E=>`${E}`),highlightedTargetDataPoints:N.map(E=>`${E}`),defaultLinkOpacity:C,sourceTitle:W,targetTitle:I,sortNodes:O,resetSelectionOnDoubleClick:H,styles:G,classNames:F,detailsOnClick:z,animate:rt===!0?{duration:.5,once:!0,amount:.5}:rt||{duration:0,once:!0,amount:0},precision:st,customLayers:at}):null})}),a||R?h.jsxRuntimeExports.jsx(Gt.GraphFooter,{styles:{footnote:G?.footnote,source:G?.source},classNames:{footnote:F?.footnote,source:F?.source},sources:a,footNote:R,width:$}):null]})})})})}exports.SankeyChart=he;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("./index-CHPV5EwG-DDoeWRVt.cjs"),q=require("react"),ot=require("./index-CZbIGs8q.cjs"),ut=require("./index-BzeLQvXk.cjs"),Et=require("./index-C21TvELx.cjs"),Dt=require("./index-BXns0-ng.cjs"),Pt=require("./Modal-tXZlLE5s.cjs"),ct=require("./Typography-k-kOjICQ.cjs"),Lt=require("./numberFormattingFunction-02t-wJta.cjs"),zt=require("./Tooltip-n8z5bfav.cjs"),It=require("./string2HTML-D2Avudmb.cjs"),Ht=require("./use-in-view-sQJZ_xDO.cjs"),xt=require("./proxy-BHRoeZgd.cjs"),At=require("./index-BW8iNx7E.cjs"),Wt=require("./GraphHeader.cjs"),Gt=require("./GraphFooter.cjs"),Mt=require("./Colors.cjs"),Ft=require("./generateRandomString-B5zBiJzS.cjs"),Xt=require("./EmptyState-d8_8SxeW.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 pt(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 Yt(e){return e.target.depth}function Ut(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,Yt)-1:0}function ft(e){return function(){return e}}function St(e,n){return ht(e.source,n.source)||e.index-n.index}function _t(e,n){return ht(e.target,n.target)||e.index-n.index}function ht(e,n){return e.y0-n.y0}function yt(e){return e.value}function Zt(e){return e.index}function Qt(e){return e.nodes}function Jt(e){return e.links}function Nt(e,n){const i=e.get(n);if(!i)throw new Error("missing: "+n);return i}function Ct({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 vt(){let e=0,n=0,i=1,a=1,l=24,m=8,g,x=Zt,v=Ut,w,j,b=Qt,$=Jt,R=6;function d(){const t={nodes:b.apply(null,arguments),links:$.apply(null,arguments)};return S(t),L(t),V(t),X(t),A(t),Ct(t),t}d.update=function(t){return Ct(t),t},d.nodeId=function(t){return arguments.length?(x=typeof t=="function"?t:ft(t),d):x},d.nodeAlign=function(t){return arguments.length?(v=typeof t=="function"?t:ft(t),d):v},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?(j=t,d):j},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)=>[x(c,r,t),c]));for(const[c,r]of u.entries()){r.index=c;let{source:f,target:p}=r;typeof f!="object"&&(f=r.source=Nt(s,f)),typeof p!="object"&&(p=r.target=Nt(s,p)),f.sourceLinks.push(r),p.targetLinks.push(r)}if(j!=null)for(const{sourceLinks:c,targetLinks:r}of t)c.sort(j),r.sort(j)}function L({nodes:t}){for(const u of t)u.value=u.fixedValue===void 0?Math.max(pt(u.sourceLinks,yt),pt(u.targetLinks,yt)):u.fixedValue}function V({nodes:t}){const u=t.length;let s=new Set(t),c=new Set,r=0;for(;s.size;){for(const f of s){f.depth=r;for(const{target:p}of f.sourceLinks)c.add(p)}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 f of s){f.height=r;for(const{source:p}of f.targetLinks)c.add(p)}if(++r>u)throw new Error("circular link");s=c,c=new Set}}function B({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 f=Math.max(0,Math.min(u-1,Math.floor(v.call(null,r,u))));r.layer=f,r.x0=e+f*s,r.x1=r.x0+l,c[f]?c[f].push(r):c[f]=[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)/pt(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 f of r.sourceLinks)f.width=f.value*u}c=(a-c+g)/(s.length+1);for(let r=0;r<s.length;++r){const f=s[r];f.y0+=c*(r+1),f.y1+=c*(r+1)}P(s)}}function A(t){const u=B(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);tt(u,c,r),K(u,c,r)}}function K(t,u,s){for(let c=1,r=t.length;c<r;++c){const f=t[c];for(const p of f){let N=0,C=0;for(const{source:I,value:O}of p.targetLinks){let H=O*(p.layer-I.layer);N+=U(I,p)*H,C+=H}if(!(C>0))continue;let W=(N/C-p.y0)*u;p.y0+=W,p.y1+=W,T(p)}w===void 0&&f.sort(ht),D(f,s)}}function tt(t,u,s){for(let c=t.length,r=c-2;r>=0;--r){const f=t[r];for(const p of f){let N=0,C=0;for(const{target:I,value:O}of p.sourceLinks){let H=O*(I.layer-p.layer);N+=nt(p,I)*H,C+=H}if(!(C>0))continue;let W=(N/C-p.y0)*u;p.y0+=W,p.y1+=W,T(p)}w===void 0&&f.sort(ht),D(f,s)}}function D(t,u){const s=t.length>>1,c=t[s];et(t,c.y0-g,s-1,u),Y(t,c.y1+g,s+1,u),et(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],f=(u-r.y0)*c;f>1e-6&&(r.y0+=f,r.y1+=f),u=r.y1+g}}function et(t,u,s,c){for(;s>=0;--s){const r=t[s],f=(r.y1-u)*c;f>1e-6&&(r.y0-=f,r.y1-=f),u=r.y0-g}}function T({sourceLinks:t,targetLinks:u}){if(j===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(j===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 nt(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 jt=Math.PI,kt=2*jt,J=1e-6,Kt=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,x=i-e,v=a-n,w=m-e,j=g-n,b=w*w+j*j;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(j*x-v*w)>J)||!l)this._+="L"+(this._x1=e)+","+(this._y1=n);else{var $=i-m,R=a-g,d=x*x+v*v,S=$*$+R*R,L=Math.sqrt(d),V=Math.sqrt(b),X=l*Math.tan((jt-Math.acos((d+b-S)/(2*L*V)))/2),B=X/V,_=X/L;Math.abs(B-1)>J&&(this._+="L"+(e+B*w)+","+(n+B*j)),this._+="A"+l+","+l+",0,0,"+ +(j*$>w*R)+","+(this._x1=e+_*x)+","+(this._y1=n+_*v)}},arc:function(e,n,i,a,l,m){e=+e,n=+n,i=+i,m=!!m;var g=i*Math.cos(a),x=i*Math.sin(a),v=e+g,w=n+x,j=1^m,b=m?a-l:l-a;if(i<0)throw new Error("negative radius: "+i);this._x1===null?this._+="M"+v+","+w:(Math.abs(this._x1-v)>J||Math.abs(this._y1-w)>J)&&(this._+="L"+v+","+w),i&&(b<0&&(b=b%kt+kt),b>Kt?this._+="A"+i+","+i+",0,1,"+j+","+(e-g)+","+(n-x)+"A"+i+","+i+",0,1,"+j+","+(this._x1=v)+","+(this._y1=w):b>J&&(this._+="A"+i+","+i+",0,"+ +(b>=jt)+","+j+","+(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 Tt(e){return function(){return e}}function te(e){return e[0]}function ee(e){return e[1]}var ne=Array.prototype.slice;function oe(e){return e.source}function ie(e){return e.target}function re(e){var n=oe,i=ie,a=te,l=ee,m=null;function g(){var x,v=ne.call(arguments),w=n.apply(this,v),j=i.apply(this,v);if(m||(m=x=qt()),e(m,+a.apply(this,(v[0]=w,v)),+l.apply(this,v),+a.apply(this,(v[0]=j,v)),+l.apply(this,v)),x)return m=null,x+""||null}return g.source=function(x){return arguments.length?(n=x,g):n},g.target=function(x){return arguments.length?(i=x,g):i},g.x=function(x){return arguments.length?(a=typeof x=="function"?x:Tt(+x),g):a},g.y=function(x){return arguments.length?(l=typeof x=="function"?x:Tt(+x),g):l},g.context=function(x){return arguments.length?(m=x??null,g):m},g}function se(e,n,i,a,l){e.moveTo(n,i),e.bezierCurveTo(n=(n+a)/2,i,n,l,a,l)}function ae(){return re(se)}function le(e){return[e.source.x1,e.y0]}function ue(e){return[e.target.x0,e.y1]}function ce(){return ae().source(le).target(ue)}function fe(e){const{data:n,showLabels:i,leftMargin:a,rightMargin:l,truncateBy:m,width:g,height:x,topMargin:v,bottomMargin:w,tooltip:j,onSeriesMouseOver:b,suffix:$,prefix:R,showValues:d,onSeriesMouseClick:S,nodePadding:L,nodeWidth:V,id:X,highlightedSourceDataPoints:B,highlightedTargetDataPoints:_,defaultLinkOpacity:A,sourceTitle:K,targetTitle:tt,animate:D,sortNodes:Y,resetSelectionOnDoubleClick:et,detailsOnClick:T,styles:P,classNames:U,precision:nt,customLayers:t}=e,u=q.useRef(null),s=Ht.useInView(u,{once:D.once,amount:D.amount}),[c,r]=q.useState(void 0),[f,p]=q.useState(void 0),[N,C]=q.useState(void 0),[W,I]=q.useState(void 0),[O,H]=q.useState(void 0),z={top:v,bottom:w,left:a,right:l},G=g-z.left-z.right,F=x-z.top-z.bottom,rt=Y==="mostReadable"?vt().nodeWidth(V).nodePadding(L).size([G,F]).nodeAlign(mt):Y==="none"?vt().nodeWidth(V).nodePadding(L).size([G,F]).nodeAlign(mt).nodeSort(()=>null).linkSort(()=>null):vt().nodeWidth(V).nodePadding(L).size([G,F]).nodeAlign(mt).nodeSort(Y==="desc"?(o,M)=>(M.value||0)-(o.value||0):(o,M)=>(o.value||0)-(M.value||0)),{nodes:st,links:at}=rt(n),Q=ce();return h.jsxRuntimeExports.jsxs(h.jsxRuntimeExports.Fragment,{children:[h.jsxRuntimeExports.jsxs(xt.motion.svg,{width:`${g}px`,height:`${x}px`,viewBox:`0 0 ${g} ${x}`,style:{marginLeft:"auto",marginRight:"auto"},direction:"ltr",ref:u,children:[K?h.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:K}):null,tt?h.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:tt}):null,h.jsxRuntimeExports.jsxs("g",{transform:`translate(${z.left},${z.top})`,children:[t.filter(o=>o.position==="before").map(o=>o.layer),st.filter(o=>o.type==="source").map((o,M)=>h.jsxRuntimeExports.jsx("g",{onMouseEnter:()=>{C(o)},onMouseLeave:()=>{C(void 0)},children:h.jsxRuntimeExports.jsxs("g",{transform:`translate(${o.x0},${o.y0})`,children:[h.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?h.jsxRuntimeExports.jsx("foreignObject",{y:0-L/2,x:0-a,width:a,height:(o.y1||0)-(o.y0||0)+L,children:h.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?h.jsxRuntimeExports.jsx(ct.u,{marginBottom:d?"3xs":"none",size:"sm",leading:"none",className:h.mo("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?h.jsxRuntimeExports.jsx(ct.u,{marginBottom:"none",size:"sm",leading:"none",className:h.mo("sankey-right-value text-right font-bold",U?.graphObjectValues),style:{hyphens:"auto",color:o.color,...P?.graphObjectValues},children:Lt.numberFormattingFunction(o.value,"NA",nt,R,$)}):null]})}):null]})},M)),st.filter(o=>o.type==="target").map((o,M)=>h.jsxRuntimeExports.jsx("g",{onMouseEnter:()=>{C(o)},onMouseLeave:()=>{C(void 0)},children:h.jsxRuntimeExports.jsxs("g",{transform:`translate(${o.x0},${o.y0})`,children:[h.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?h.jsxRuntimeExports.jsx("foreignObject",{y:0-L/2,x:V,width:l-V,height:(o.y1||0)-(o.y0||0)+L,children:h.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?h.jsxRuntimeExports.jsx(ct.u,{marginBottom:d?"3xs":"none",size:"sm",leading:"none",className:h.mo("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?h.jsxRuntimeExports.jsx(ct.u,{size:"sm",leading:"none",marginBottom:"none",className:h.mo("sankey-left-value text-left font-bold",U?.graphObjectValues),style:{hyphens:"auto",color:o.color,...P?.graphObjectValues},children:Lt.numberFormattingFunction(o.value,"NA",nt,R,$)}):null]})}):null]})},M)),h.jsxRuntimeExports.jsx("defs",{children:at.map((o,M)=>h.jsxRuntimeExports.jsxs("linearGradient",{id:`${X}-gradient-${M}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%",gradientUnits:"userSpaceOnUse",children:[h.jsxRuntimeExports.jsx("stop",{offset:"0%",style:{stopColor:o.source.color,stopOpacity:1}}),h.jsxRuntimeExports.jsx("stop",{offset:"100%",style:{stopColor:o.target.color,stopOpacity:1}})]},M))}),h.jsxRuntimeExports.jsx("g",{children:h.jsxRuntimeExports.jsx(At.AnimatePresence,{children:at.map((o,M)=>h.jsxRuntimeExports.jsx(xt.motion.g,{className:"undp-viz-g-with-hover",onMouseEnter:Z=>{r(o.data),H(Z.clientY),I(Z.clientX),b?.(o)},onMouseMove:Z=>{r(o.data),H(Z.clientY),I(Z.clientX)},onClick:()=>{(S||T)&&(Dt.isEqual(f,o.data)&&et?(p(void 0),S?.(void 0)):(p(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:(B.length!==0||_.length!==0)&&(B.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:(B.length!==0||_.length!==0)&&(B.indexOf(o.source.label)!==-1||_.indexOf(o.target.label)!==-1)?.85:A,transition:{duration:D.duration}}},initial:"initial",animate:s?"whileInView":"initial",exit:{opacity:0,transition:{duration:D.duration}},children:h.jsxRuntimeExports.jsx(xt.motion.path,{d:Q(o)||"",style:{stroke:`url(#${X}-gradient-${M})`,strokeWidth:o.width,fill:"none"},exit:{opacity:0,transition:{duration:D.duration}},variants:{initial:{pathLength:0,opacity:1},whileInView:{pathLength:1,opacity:1,transition:{duration:D.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&&j&&W&&O?h.jsxRuntimeExports.jsx(zt.Tooltip,{data:c,body:j,xPos:W,yPos:O,backgroundStyle:P?.tooltip,className:U?.tooltip}):null,T&&f!==void 0?h.jsxRuntimeExports.jsx(Pt.X,{open:f!==void 0,onClose:()=>{p(void 0)},children:h.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof T=="string"?{__html:It.string2HTML(T,f)}:void 0,children:typeof T=="function"?T(f):null})}):null]})}function he(e){const{data:n,graphTitle:i,sources:a,graphDescription:l,showLabels:m=!0,leftMargin:g=75,rightMargin:x=75,topMargin:v=30,bottomMargin:w=10,truncateBy:j=999,height:b,width:$,footNote:R,padding:d,backgroundColor:S,tooltip:L,onSeriesMouseOver:V,suffix:X="",prefix:B="",relativeHeight:_,showValues:A=!0,graphID:K,onSeriesMouseClick:tt,graphDownload:D=!1,dataDownload:Y=!1,fillContainer:et=!0,language:T="en",minHeight:P=0,theme:U="light",ariaLabel:nt,sourceColors:t,targetColors:u,sourceColorDomain:s,targetColorDomain:c,nodePadding:r=5,nodeWidth:f=5,highlightedSourceDataPoints:p=[],highlightedTargetDataPoints:N=[],defaultLinkOpacity:C=.3,sourceTitle:W,targetTitle:I,sortNodes:O="mostReadable",resetSelectionOnDoubleClick:H=!0,detailsOnClick:z,styles:G,classNames:F,animate:rt=!1,precision:st=2,customLayers:at=[]}=e,[Q,o]=q.useState(0),[M,Z]=q.useState(0),[bt,Vt]=q.useState(void 0),it=q.useRef(null),$t=q.useRef(null);return q.useEffect(()=>{const E=ot.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||ot.uniqBy(n,"source").map(y=>`${y.source}`)).findIndex(y=>`${y}`==`${k.source}`)>t.length?t.length-1:(s||ot.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))})),lt=O==="asc"?ut.sortBy(E,k=>k.totalValue):O==="desc"?ut.sortBy(E,k=>k.totalValue).reverse():E,gt=ot.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||ot.uniqBy(n,"target").map(y=>`${y.target}`)).findIndex(y=>`${y}`==`${k.target}`)>u.length?u.length-1:(c||ot.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))})),Bt=O==="asc"?ut.sortBy(gt,k=>k.totalValue):O==="desc"?ut.sortBy(gt,k=>k.totalValue).reverse():gt,dt=[...lt,...Bt];Vt({nodes:dt,links:n.map(k=>({source:dt.findIndex(y=>y.name===`source_${k.source}`),target:dt.findIndex(y=>y.name===`target_${k.target}`),value:k.value,data:{...k}}))})},[n,O,s,t,c,u]),q.useEffect(()=>{const E=new ResizeObserver(lt=>{o($||lt[0].target.clientWidth||620),Z(b||lt[0].target.clientHeight||480)});return it.current&&(Z(it.current.clientHeight||480),o(it.current.clientWidth||620),$||E.observe(it.current)),()=>E.disconnect()},[$,b]),h.jsxRuntimeExports.jsx("div",{className:`${U||"light"} flex ${$?"grow-0":"grow"} ${et?"w-full":"w-fit"} `,dir:T==="he"||T==="ar"?"rtl":void 0,children:h.jsxRuntimeExports.jsx("div",{className:h.mo(`${S?S===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${T||"en"}`,F?.graphContainer),style:{...G?.graphContainer||{},...S&&S!==!0?{backgroundColor:S}:{}},id:K,ref:$t,"aria-label":nt||`${i?`The graph shows ${i}. `:""}This is a sankey chart showing flow. ${l?` ${l}`:""}`,children:h.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:S?d||"1rem":d||0},children:h.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-4 w-full grow justify-between",children:[i||l||D||Y?h.jsxRuntimeExports.jsx(Wt.GraphHeader,{styles:{title:G?.title,description:G?.description},classNames:{title:F?.title,description:F?.description},graphTitle:i,graphDescription:l,width:$,graphDownload:D?$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,h.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:n.length===0?h.jsxRuntimeExports.jsx(Xt.EmptyState,{}):h.jsxRuntimeExports.jsx("div",{className:"flex flex-col grow justify-center gap-3 w-full leading-0",ref:it,"aria-label":"Graph area",children:($||Q)&&(b||M)&&bt?h.jsxRuntimeExports.jsx(fe,{data:bt,width:$||Q,nodePadding:r,nodeWidth:f,height:Math.max(P,b||(_?P?($||Q)*_>P?($||Q)*_:P:($||Q)*_:M)),showLabels:m,leftMargin:g,rightMargin:x,topMargin:v,bottomMargin:w,truncateBy:j,tooltip:L,onSeriesMouseOver:V,showValues:A,suffix:X,prefix:B,onSeriesMouseClick:tt,id:Ft.generateRandomString(8),highlightedSourceDataPoints:p.map(E=>`${E}`),highlightedTargetDataPoints:N.map(E=>`${E}`),defaultLinkOpacity:C,sourceTitle:W,targetTitle:I,sortNodes:O,resetSelectionOnDoubleClick:H,styles:G,classNames:F,detailsOnClick:z,animate:rt===!0?{duration:.5,once:!0,amount:.5}:rt||{duration:0,once:!0,amount:0},precision:st,customLayers:at}):null})}),a||R?h.jsxRuntimeExports.jsx(Gt.GraphFooter,{styles:{footnote:G?.footnote,source:G?.source},classNames:{footnote:F?.footnote,source:F?.source},sources:a,footNote:R,width:$}):null]})})})})}exports.SankeyChart=he;
2
2
  //# sourceMappingURL=SankeyChart.cjs.map
@@ -4,14 +4,14 @@ import { u as ot } from "./index-CaAIPGZo.js";
4
4
  import { s as ct } from "./index-DxagiOHo.js";
5
5
  import { s as Nt } from "./index-D7ltPi18.js";
6
6
  import { i as Ht } from "./index-27yTRcko.js";
7
- import { X as Wt } from "./Modal-CUU6ZK3U.js";
7
+ import { X as Wt } from "./Modal-DVVwpKhP.js";
8
8
  import { u as ft } from "./Typography-Ctgfl1J5.js";
9
9
  import { n as St } from "./numberFormattingFunction-14YCbkN2.js";
10
10
  import { T as Rt } from "./Tooltip-DyM5snqx.js";
11
11
  import { s as Gt } from "./string2HTML-CWHGfz_d.js";
12
- import { u as qt } from "./use-in-view-BAHrBy6b.js";
13
- import { m as mt } from "./proxy-DJxJg1kD.js";
14
- import { A as Xt } from "./index-BxAUvrua.js";
12
+ import { u as qt } from "./use-in-view-yS6jzJAp.js";
13
+ import { m as mt } from "./proxy-CkpFesk1.js";
14
+ import { A as Xt } from "./index-CNvov0eg.js";
15
15
  import { GraphHeader as Ft } from "./GraphHeader.js";
16
16
  import { GraphFooter as Yt } from "./GraphFooter.js";
17
17
  import { Colors as Tt } from "./Colors.js";
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index-CHPV5EwG-DDoeWRVt.cjs"),ke=require("./index-CZbIGs8q.cjs"),Me=require("./parse-hMnG_lRV.cjs"),j=require("react"),Ae=require("./getSliderMarks-CtsEXiLV.cjs"),Ie=require("./index-BXns0-ng.cjs"),Ue=require("./index-BczVvEBZ.cjs"),Le=require("./simple-statistics-xm8c0LQQ.cjs"),Fe=require("./Modal-C_dl0EtQ.cjs"),He=require("./Tooltip-n8z5bfav.cjs"),c=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),N=require("./Colors.cjs"),Ve=require("./numberFormattingFunction-02t-wJta.cjs"),Ne=require("./customArea-BYNyxAkm.cjs"),Ge=require("./string2HTML-D2Avudmb.cjs"),$e=require("./Axis-DE7dSn1_.cjs"),Te=require("./AxisTitle-CK9YeovX.cjs"),We=require("./XTicksAndGridLines-CCzXIV8d.cjs"),De=require("./ReferenceLine-CuFMk0cI.cjs"),Be=require("./RegressionLine-7_rKTHN_.cjs"),ze=require("./YTicksAndGridLines-DBDuz6vb.cjs"),_e=require("./index-CylX-pWB.cjs"),Je=require("./use-in-view-BCmzDU2O.cjs"),Ke=require("./pow-B5-jkdHU.cjs"),Pe=require("./linear-BVckp9RD.cjs"),Qe=require("./delaunay-rcy0HhZi.cjs"),ie=require("./proxy-PQd2AItT.cjs"),Xe=require("./index-DVOJ7vxH.cjs"),Ze=require("./GraphFooter.cjs"),et=require("./GraphHeader.cjs"),tt=require("./ColorLegendWithMouseOver.cjs"),it=require("./EmptyState-d8_8SxeW.cjs"),Ye=require("./index-BW_-wD2k.cjs"),st=require("./ensureCompleteData-DqWQ2Zbi.cjs"),ot=require("./init-DU0ybBc_.cjs");function rt(ge){const{data:s,width:q,height:M,showLabels:se,colors:l,colorDomain:C,radius:R,xAxisTitle:d,yAxisTitle:J,leftMargin:G,rightMargin:ye,topMargin:pe,bottomMargin:oe,tooltip:re,onSeriesMouseOver:X,refXValues:I,refYValues:je,highlightAreaSettings:ve,selectedColor:W,highlightedDataPoints:L,maxRadiusValue:be,maxXValue:B,minXValue:w,maxYValue:Oe,minYValue:E,onSeriesMouseClick:V,rtl:K,annotations:Ce,customHighlightAreaSettings:Re,regressionLine:z,resetSelectionOnDoubleClick:Q,detailsOnClick:k,noOfXTicks:ne,noOfYTicks:le,labelColor:Z,xSuffix:ae,ySuffix:ce,xPrefix:xe,yPrefix:ue,styles:x,classNames:u,animate:n,dimmedOpacity:A,precision:S,customLayers:fe}=ge,me=j.useRef(null),p=Je.useInView(me,{once:n.once,amount:n.amount}),[$,T]=j.useState(void 0),[D,Y]=j.useState(void 0),[de,P]=j.useState(void 0),[he,v]=j.useState(void 0),h={top:pe,bottom:d?oe+50:oe,left:J?G+30:G,right:ye},_=s.map((e,y)=>({...e,id:`${y}`})),g=q-h.left-h.right,b=M-h.top-h.bottom,O=s.filter(e=>e.radius===void 0||e.radius===null).length!==s.length?Ke.sqrt().domain([0,be]).range([.25,R]).nice():void 0,m=_.filter(e=>!c.checkIfNullOrUndefined(e.radius)).length===0?_:Ue.orderBy(_.filter(e=>!c.checkIfNullOrUndefined(e.radius)),"radius","desc"),r=Pe.linear().domain([w,B]).range([0,g]).nice(),a=Pe.linear().domain([E,Oe]).range([b,0]).nice(),ee=r.ticks(ne),te=a.ticks(le),U=Qe.Delaunay.from(m.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=Le.linearRegression(s.filter(e=>!c.checkIfNullOrUndefined(e.x)&&!c.checkIfNullOrUndefined(e.y)).map(e=>[r(e.x),a(e.y)])),f=Le.linearRegressionLine(we);return i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(ie.motion.svg,{width:`${q}px`,height:`${M}px`,viewBox:`0 0 ${q} ${M}`,direction:"ltr",ref:me,children:i.jsxRuntimeExports.jsxs("g",{transform:`translate(${h.left},${h.top})`,children:[i.jsxRuntimeExports.jsxs(Xe.AnimatePresence,{children:[i.jsxRuntimeExports.jsx(_e.HighlightAreaForScatterPlot,{areaSettings:ve,width:g,height:b,scaleX:r,scaleY:a,animate:n,isInView:p}),i.jsxRuntimeExports.jsx(Ne.CustomArea,{areaSettings:Re,scaleX:r,scaleY:a,animate:n,isInView:p})]}),i.jsxRuntimeExports.jsxs("g",{children:[i.jsxRuntimeExports.jsx(ze.YTicksAndGridLines,{values:te.filter(e=>e!==0),y:te.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($e.Axis,{y1:a(E<0?0:E),y2:a(E<0?0:E),x1:0,x2:g+h.right,label:Ve.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(Te.AxisTitle,{x:0-G-15,y:b/2,style:x?.yAxis?.title,className:u?.yAxis?.title,text:J,rotate90:!0})]}),i.jsxRuntimeExports.jsxs("g",{children:[i.jsxRuntimeExports.jsx(We.XTicksAndGridLines,{values:ee.filter(e=>e!==0),x:ee.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($e.Axis,{x1:r(w<0?0:w),x2:r(w<0?0:w),y1:0,y2:b,label:Ve.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(Te.AxisTitle,{x:g/2,y:b+30,style:x?.xAxis?.title,className:u?.xAxis?.title,text:d})]}),fe.filter(e=>e.position==="before").map(e=>e.layer),i.jsxRuntimeExports.jsxs(Xe.AnimatePresence,{children:[m.filter(e=>!c.checkIfNullOrUndefined(e.x)&&!c.checkIfNullOrUndefined(e.y)).map((e,y)=>i.jsxRuntimeExports.jsx("path",{d:U.renderCell(m.findIndex(o=>o.id===e.id)),opacity:0,onMouseEnter:o=>{T(e),v(o.clientY),P(o.clientX),X?.(e)},onMouseMove:o=>{T(e),v(o.clientY),P(o.clientX)},onMouseLeave:()=>{T(void 0),P(void 0),v(void 0),X?.(void 0)},onClick:()=>{(V||k)&&(Ie.isEqual(D,e)&&Q?(Y(void 0),V?.(void 0)):(Y(e),V?.(e)))}},`${e.label||y}`)),m.filter(e=>!c.checkIfNullOrUndefined(e.x)&&!c.checkIfNullOrUndefined(e.y)).map((e,y)=>i.jsxRuntimeExports.jsxs(ie.motion.g,{variants:{initial:{x:r(e.x),y:a(e.y),opacity:W?e.color&&l[C.indexOf(`${e.color}`)]===W?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:W?e.color&&l[C.indexOf(`${e.color}`)]===W?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:p?"whileInView":"initial",exit:{opacity:0,transition:{duration:n.duration}},onMouseEnter:o=>{T(e),v(o.clientY),P(o.clientX),X?.(e)},onMouseMove:o=>{T(e),v(o.clientY),P(o.clientX)},onMouseLeave:()=>{T(void 0),P(void 0),v(void 0),X?.(void 0)},onClick:()=>{(V||k)&&(Ie.isEqual(D,e)&&Q?(Y(void 0),V?.(void 0)):(Y(e),V?.(e)))},children:[i.jsxRuntimeExports.jsx(ie.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:p?"whileInView":"initial",style:{fillOpacity:.6}}),se&&!c.checkIfNullOrUndefined(e.label)?i.jsxRuntimeExports.jsx(ie.motion.text,{style:{...x?.graphObjectValues||{}},className:i.mo("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:Z||(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:Z||(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:p?"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(ie.motion.text,{style:{fill:Z||(s.filter(o=>o.color).length===0?l[0]:e.color?l[C.indexOf(`${e.color}`)]:N.Colors.gray),...x?.graphObjectValues||{}},className:i.mo("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:p?"whileInView":"initial",dy:"0.33em",dx:3,children:e.label}):null]},`${e.label||y}`)),I.map((e,y)=>i.jsxRuntimeExports.jsx(De.RefLineX,{text:e.text,color:e.color,x:r(e.value),y1:0,y2:b,textSide:r(e.value)>g*.75||K?"left":"right",classNames:e.classNames,styles:e.styles,animate:n,isInView:p},y)),je.map((e,y)=>i.jsxRuntimeExports.jsx(De.RefLineY,{text:e.text,color:e.color,y:a(e.value),x1:0,x2:g,classNames:e.classNames,styles:e.styles,animate:n,isInView:p},y)),i.jsxRuntimeExports.jsx("g",{children:Ce.map((e,y)=>{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:K?0:e.xCoordinate?r(e.xCoordinate)+(e.xOffset||0):0+(e.xOffset||0),width:K?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:p},y)})}),z?i.jsxRuntimeExports.jsx(Be.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:p}):null]}),fe.filter(e=>e.position==="after").map(e=>e.layer)]})}),$&&re&&de&&he?i.jsxRuntimeExports.jsx(He.Tooltip,{data:$,body:re,xPos:de,yPos:he,backgroundStyle:x?.tooltip,className:u?.tooltip}):null,k&&D!==void 0?i.jsxRuntimeExports.jsx(Fe.X,{open:D!==void 0,onClose:()=>{Y(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:q,colors:M,sources:se,graphDescription:l,showLabels:C=!1,height:R,width:d,footNote:J,colorDomain:G,colorLegendTitle:ye,radius:pe=5,xAxisTitle:oe="X Axis",yAxisTitle:re="Y Axis",padding:X,backgroundColor:I=!1,leftMargin:je=0,rightMargin:ve=10,topMargin:W=20,bottomMargin:L=50,tooltip:be,relativeHeight:B,onSeriesMouseOver:w,refXValues:Oe=[],refYValues:E=[],highlightAreaSettings:V=[],showColorScale:K=!0,highlightedDataPoints:Ce=[],graphID:Re,maxRadiusValue:z,maxXValue:Q,minXValue:k,maxYValue:ne,minYValue:le,xSuffix:Z="",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:me=[],theme:p="light",regressionLine:$=!1,ariaLabel:T,resetSelectionOnDoubleClick:D=!0,detailsOnClick:Y,noOfXTicks:de=5,noOfYTicks:P=5,labelColor:he,styles:v,classNames:h,animate:_=!1,dimmedOpacity:g=.3,precision:b=2,customLayers:O=[],timeline:m={enabled:!1,autoplay:!1,showOnlyActiveDate:!0}}=ge,[r,a]=j.useState(0),[ee,te]=j.useState(0),[U,we]=j.useState(m.autoplay),f=Ae.sort(ke.uniqBy(s.filter(t=>t.date!==void 0&&t.date!==null),t=>t.date).map(t=>Me.parse(`${t.date}`,m.dateFormat||"yyyy",new Date).getTime()),(t,H)=>ot.ascending(t,H)),[e,y]=j.useState(m.autoplay?0:f.length-1),[o,Ee]=j.useState(void 0),F=j.useRef(null),Se=j.useRef(null);j.useEffect(()=>{const t=new ResizeObserver(H=>{a(d||H[0].target.clientWidth||620),te(R||H[0].target.clientHeight||480)});return F.current&&(te(F.current.clientHeight||480),a(F.current.clientWidth||620),d||t.observe(F.current)),()=>t.disconnect()},[d,R]),j.useEffect(()=>{const t=setInterval(()=>{y(H=>H<f.length-1?H+1:0)},(m.speed||2)*1e3);return U||clearInterval(t),()=>clearInterval(t)},[f,U,m.speed]);const qe=Ae.getSliderMarks(f,e,m.showOnlyActiveDate,m.dateFormat||"yyyy");return i.jsxRuntimeExports.jsx("div",{className:`${p||"light"} flex ${d?"w-fit grow-0":"w-full grow"}`,dir:n==="he"||n==="ar"?"rtl":void 0,children:i.jsxRuntimeExports.jsx("div",{className:i.mo(`${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:Se,"aria-label":T||`${q?`The graph shows ${q}. `:""}This is a scatter plot that shows correlation between two variables.${l?` ${l}`:""}`,children:i.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:I?X||"1rem":X||0},children:i.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[q||l||x||u?i.jsxRuntimeExports.jsx(et.GraphHeader,{styles:{title:v?.title,description:v?.description},classNames:{title:h?.title,description:h?.description},graphTitle:q,graphDescription:l,width:d,graphDownload:x?Se.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,m.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(!U)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":U?"Click to pause animation":"Click to play animation",children:U?i.jsxRuntimeExports.jsx(Ye.Pause,{}):i.jsxRuntimeExports.jsx(Ye.Play,{})}),i.jsxRuntimeExports.jsx(Ae.xr,{min:f[0],max:f[f.length-1],marks:qe,step:null,defaultValue:f[f.length-1],value:f[e],onChangeComplete:t=>{y(f.indexOf(t))},onChange:t=>{y(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:[K&&s.filter(t=>t.color).length!==0?i.jsxRuntimeExports.jsx(tt.ColorLegendWithMouseOver,{width:d,colorLegendTitle:ye,colors:M||N.Colors[p].categoricalColors.colors,colorDomain:G||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:(d||r)&&(R||ee)?i.jsxRuntimeExports.jsx(rt,{data:st.ensureCompleteDataForScatterPlot(s,m.dateFormat||"yyyy").filter(t=>m.enabled?t.date===Me.format(new Date(f[e]),m.dateFormat||"yyyy"):t),width:d||r,height:Math.max(S,R||(B?S?(d||r)*B>S?(d||r)*B:S:(d||r)*B:ee)),colorDomain:s.filter(t=>t.color).length===0?[]:G||ke.uniqBy(s.filter(t=>t.color),"color").map(t=>t.color),colors:s.filter(t=>t.color).length===0?M?[M]:[N.Colors.primaryColors["blue-600"]]:M||N.Colors[p].categoricalColors.colors,xAxisTitle:oe,yAxisTitle:re,refXValues:Oe,refYValues:E,showLabels:C,radius:pe,leftMargin:je,rightMargin:ve,topMargin:W,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(Q)?Math.max(...s.map(t=>t.x).filter(t=>t!=null))>0?Math.max(...s.map(t=>t.x).filter(t=>t!=null)):0:Q,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:me,regressionLine:$,resetSelectionOnDoubleClick:D,detailsOnClick:Y,noOfXTicks:de,noOfYTicks:P,labelColor:he,xSuffix:Z,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:d}):null]})})})})}exports.ScatterPlot=nt;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index-CHPV5EwG-DDoeWRVt.cjs"),ke=require("./index-CZbIGs8q.cjs"),Me=require("./parse-hMnG_lRV.cjs"),j=require("react"),Ae=require("./getSliderMarks-CtsEXiLV.cjs"),Ie=require("./index-BXns0-ng.cjs"),Ue=require("./index-BczVvEBZ.cjs"),Le=require("./simple-statistics-xm8c0LQQ.cjs"),Fe=require("./Modal-tXZlLE5s.cjs"),He=require("./Tooltip-n8z5bfav.cjs"),c=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),N=require("./Colors.cjs"),Ve=require("./numberFormattingFunction-02t-wJta.cjs"),Ne=require("./customArea-CK768gCn.cjs"),Ge=require("./string2HTML-D2Avudmb.cjs"),$e=require("./Axis-DE7dSn1_.cjs"),Te=require("./AxisTitle-CK9YeovX.cjs"),We=require("./XTicksAndGridLines-CCzXIV8d.cjs"),De=require("./ReferenceLine-CFVBBN__.cjs"),Be=require("./RegressionLine-xKdiJ8sw.cjs"),ze=require("./YTicksAndGridLines-DBDuz6vb.cjs"),_e=require("./index-DNj994Pv.cjs"),Je=require("./pow-B5-jkdHU.cjs"),Pe=require("./linear-BVckp9RD.cjs"),Ke=require("./delaunay-rcy0HhZi.cjs"),Qe=require("./use-in-view-sQJZ_xDO.cjs"),ie=require("./proxy-BHRoeZgd.cjs"),Xe=require("./index-BW8iNx7E.cjs"),Ze=require("./GraphFooter.cjs"),et=require("./GraphHeader.cjs"),tt=require("./ColorLegendWithMouseOver.cjs"),it=require("./EmptyState-d8_8SxeW.cjs"),Ye=require("./index-BW_-wD2k.cjs"),st=require("./ensureCompleteData-DqWQ2Zbi.cjs"),ot=require("./init-DU0ybBc_.cjs");function rt(ge){const{data:s,width:q,height:M,showLabels:se,colors:l,colorDomain:C,radius:R,xAxisTitle:d,yAxisTitle:J,leftMargin:G,rightMargin:ye,topMargin:pe,bottomMargin:oe,tooltip:re,onSeriesMouseOver:X,refXValues:I,refYValues:je,highlightAreaSettings:ve,selectedColor:W,highlightedDataPoints:L,maxRadiusValue:be,maxXValue:B,minXValue:w,maxYValue:Oe,minYValue:E,onSeriesMouseClick:V,rtl:K,annotations:Ce,customHighlightAreaSettings:Re,regressionLine:z,resetSelectionOnDoubleClick:Q,detailsOnClick:k,noOfXTicks:ne,noOfYTicks:le,labelColor:Z,xSuffix:ae,ySuffix:ce,xPrefix:xe,yPrefix:ue,styles:x,classNames:u,animate:n,dimmedOpacity:A,precision:S,customLayers:fe}=ge,me=j.useRef(null),p=Qe.useInView(me,{once:n.once,amount:n.amount}),[$,T]=j.useState(void 0),[D,Y]=j.useState(void 0),[de,P]=j.useState(void 0),[he,v]=j.useState(void 0),h={top:pe,bottom:d?oe+50:oe,left:J?G+30:G,right:ye},_=s.map((e,y)=>({...e,id:`${y}`})),g=q-h.left-h.right,b=M-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,m=_.filter(e=>!c.checkIfNullOrUndefined(e.radius)).length===0?_:Ue.orderBy(_.filter(e=>!c.checkIfNullOrUndefined(e.radius)),"radius","desc"),r=Pe.linear().domain([w,B]).range([0,g]).nice(),a=Pe.linear().domain([E,Oe]).range([b,0]).nice(),ee=r.ticks(ne),te=a.ticks(le),U=Ke.Delaunay.from(m.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=Le.linearRegression(s.filter(e=>!c.checkIfNullOrUndefined(e.x)&&!c.checkIfNullOrUndefined(e.y)).map(e=>[r(e.x),a(e.y)])),f=Le.linearRegressionLine(we);return i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(ie.motion.svg,{width:`${q}px`,height:`${M}px`,viewBox:`0 0 ${q} ${M}`,direction:"ltr",ref:me,children:i.jsxRuntimeExports.jsxs("g",{transform:`translate(${h.left},${h.top})`,children:[i.jsxRuntimeExports.jsxs(Xe.AnimatePresence,{children:[i.jsxRuntimeExports.jsx(_e.HighlightAreaForScatterPlot,{areaSettings:ve,width:g,height:b,scaleX:r,scaleY:a,animate:n,isInView:p}),i.jsxRuntimeExports.jsx(Ne.CustomArea,{areaSettings:Re,scaleX:r,scaleY:a,animate:n,isInView:p})]}),i.jsxRuntimeExports.jsxs("g",{children:[i.jsxRuntimeExports.jsx(ze.YTicksAndGridLines,{values:te.filter(e=>e!==0),y:te.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($e.Axis,{y1:a(E<0?0:E),y2:a(E<0?0:E),x1:0,x2:g+h.right,label:Ve.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(Te.AxisTitle,{x:0-G-15,y:b/2,style:x?.yAxis?.title,className:u?.yAxis?.title,text:J,rotate90:!0})]}),i.jsxRuntimeExports.jsxs("g",{children:[i.jsxRuntimeExports.jsx(We.XTicksAndGridLines,{values:ee.filter(e=>e!==0),x:ee.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($e.Axis,{x1:r(w<0?0:w),x2:r(w<0?0:w),y1:0,y2:b,label:Ve.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(Te.AxisTitle,{x:g/2,y:b+30,style:x?.xAxis?.title,className:u?.xAxis?.title,text:d})]}),fe.filter(e=>e.position==="before").map(e=>e.layer),i.jsxRuntimeExports.jsxs(Xe.AnimatePresence,{children:[m.filter(e=>!c.checkIfNullOrUndefined(e.x)&&!c.checkIfNullOrUndefined(e.y)).map((e,y)=>i.jsxRuntimeExports.jsx("path",{d:U.renderCell(m.findIndex(o=>o.id===e.id)),opacity:0,onMouseEnter:o=>{T(e),v(o.clientY),P(o.clientX),X?.(e)},onMouseMove:o=>{T(e),v(o.clientY),P(o.clientX)},onMouseLeave:()=>{T(void 0),P(void 0),v(void 0),X?.(void 0)},onClick:()=>{(V||k)&&(Ie.isEqual(D,e)&&Q?(Y(void 0),V?.(void 0)):(Y(e),V?.(e)))}},`${e.label||y}`)),m.filter(e=>!c.checkIfNullOrUndefined(e.x)&&!c.checkIfNullOrUndefined(e.y)).map((e,y)=>i.jsxRuntimeExports.jsxs(ie.motion.g,{variants:{initial:{x:r(e.x),y:a(e.y),opacity:W?e.color&&l[C.indexOf(`${e.color}`)]===W?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:W?e.color&&l[C.indexOf(`${e.color}`)]===W?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:p?"whileInView":"initial",exit:{opacity:0,transition:{duration:n.duration}},onMouseEnter:o=>{T(e),v(o.clientY),P(o.clientX),X?.(e)},onMouseMove:o=>{T(e),v(o.clientY),P(o.clientX)},onMouseLeave:()=>{T(void 0),P(void 0),v(void 0),X?.(void 0)},onClick:()=>{(V||k)&&(Ie.isEqual(D,e)&&Q?(Y(void 0),V?.(void 0)):(Y(e),V?.(e)))},children:[i.jsxRuntimeExports.jsx(ie.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:p?"whileInView":"initial",style:{fillOpacity:.6}}),se&&!c.checkIfNullOrUndefined(e.label)?i.jsxRuntimeExports.jsx(ie.motion.text,{style:{...x?.graphObjectValues||{}},className:i.mo("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:Z||(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:Z||(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:p?"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(ie.motion.text,{style:{fill:Z||(s.filter(o=>o.color).length===0?l[0]:e.color?l[C.indexOf(`${e.color}`)]:N.Colors.gray),...x?.graphObjectValues||{}},className:i.mo("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:p?"whileInView":"initial",dy:"0.33em",dx:3,children:e.label}):null]},`${e.label||y}`)),I.map((e,y)=>i.jsxRuntimeExports.jsx(De.RefLineX,{text:e.text,color:e.color,x:r(e.value),y1:0,y2:b,textSide:r(e.value)>g*.75||K?"left":"right",classNames:e.classNames,styles:e.styles,animate:n,isInView:p},y)),je.map((e,y)=>i.jsxRuntimeExports.jsx(De.RefLineY,{text:e.text,color:e.color,y:a(e.value),x1:0,x2:g,classNames:e.classNames,styles:e.styles,animate:n,isInView:p},y)),i.jsxRuntimeExports.jsx("g",{children:Ce.map((e,y)=>{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:K?0:e.xCoordinate?r(e.xCoordinate)+(e.xOffset||0):0+(e.xOffset||0),width:K?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:p},y)})}),z?i.jsxRuntimeExports.jsx(Be.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:p}):null]}),fe.filter(e=>e.position==="after").map(e=>e.layer)]})}),$&&re&&de&&he?i.jsxRuntimeExports.jsx(He.Tooltip,{data:$,body:re,xPos:de,yPos:he,backgroundStyle:x?.tooltip,className:u?.tooltip}):null,k&&D!==void 0?i.jsxRuntimeExports.jsx(Fe.X,{open:D!==void 0,onClose:()=>{Y(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:q,colors:M,sources:se,graphDescription:l,showLabels:C=!1,height:R,width:d,footNote:J,colorDomain:G,colorLegendTitle:ye,radius:pe=5,xAxisTitle:oe="X Axis",yAxisTitle:re="Y Axis",padding:X,backgroundColor:I=!1,leftMargin:je=0,rightMargin:ve=10,topMargin:W=20,bottomMargin:L=50,tooltip:be,relativeHeight:B,onSeriesMouseOver:w,refXValues:Oe=[],refYValues:E=[],highlightAreaSettings:V=[],showColorScale:K=!0,highlightedDataPoints:Ce=[],graphID:Re,maxRadiusValue:z,maxXValue:Q,minXValue:k,maxYValue:ne,minYValue:le,xSuffix:Z="",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:me=[],theme:p="light",regressionLine:$=!1,ariaLabel:T,resetSelectionOnDoubleClick:D=!0,detailsOnClick:Y,noOfXTicks:de=5,noOfYTicks:P=5,labelColor:he,styles:v,classNames:h,animate:_=!1,dimmedOpacity:g=.3,precision:b=2,customLayers:O=[],timeline:m={enabled:!1,autoplay:!1,showOnlyActiveDate:!0}}=ge,[r,a]=j.useState(0),[ee,te]=j.useState(0),[U,we]=j.useState(m.autoplay),f=Ae.sort(ke.uniqBy(s.filter(t=>t.date!==void 0&&t.date!==null),t=>t.date).map(t=>Me.parse(`${t.date}`,m.dateFormat||"yyyy",new Date).getTime()),(t,H)=>ot.ascending(t,H)),[e,y]=j.useState(m.autoplay?0:f.length-1),[o,Ee]=j.useState(void 0),F=j.useRef(null),Se=j.useRef(null);j.useEffect(()=>{const t=new ResizeObserver(H=>{a(d||H[0].target.clientWidth||620),te(R||H[0].target.clientHeight||480)});return F.current&&(te(F.current.clientHeight||480),a(F.current.clientWidth||620),d||t.observe(F.current)),()=>t.disconnect()},[d,R]),j.useEffect(()=>{const t=setInterval(()=>{y(H=>H<f.length-1?H+1:0)},(m.speed||2)*1e3);return U||clearInterval(t),()=>clearInterval(t)},[f,U,m.speed]);const qe=Ae.getSliderMarks(f,e,m.showOnlyActiveDate,m.dateFormat||"yyyy");return i.jsxRuntimeExports.jsx("div",{className:`${p||"light"} flex ${d?"w-fit grow-0":"w-full grow"}`,dir:n==="he"||n==="ar"?"rtl":void 0,children:i.jsxRuntimeExports.jsx("div",{className:i.mo(`${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:Se,"aria-label":T||`${q?`The graph shows ${q}. `:""}This is a scatter plot that shows correlation between two variables.${l?` ${l}`:""}`,children:i.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:I?X||"1rem":X||0},children:i.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[q||l||x||u?i.jsxRuntimeExports.jsx(et.GraphHeader,{styles:{title:v?.title,description:v?.description},classNames:{title:h?.title,description:h?.description},graphTitle:q,graphDescription:l,width:d,graphDownload:x?Se.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,m.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(!U)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":U?"Click to pause animation":"Click to play animation",children:U?i.jsxRuntimeExports.jsx(Ye.Pause,{}):i.jsxRuntimeExports.jsx(Ye.Play,{})}),i.jsxRuntimeExports.jsx(Ae.xr,{min:f[0],max:f[f.length-1],marks:qe,step:null,defaultValue:f[f.length-1],value:f[e],onChangeComplete:t=>{y(f.indexOf(t))},onChange:t=>{y(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:[K&&s.filter(t=>t.color).length!==0?i.jsxRuntimeExports.jsx(tt.ColorLegendWithMouseOver,{width:d,colorLegendTitle:ye,colors:M||N.Colors[p].categoricalColors.colors,colorDomain:G||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:(d||r)&&(R||ee)?i.jsxRuntimeExports.jsx(rt,{data:st.ensureCompleteDataForScatterPlot(s,m.dateFormat||"yyyy").filter(t=>m.enabled?t.date===Me.format(new Date(f[e]),m.dateFormat||"yyyy"):t),width:d||r,height:Math.max(S,R||(B?S?(d||r)*B>S?(d||r)*B:S:(d||r)*B:ee)),colorDomain:s.filter(t=>t.color).length===0?[]:G||ke.uniqBy(s.filter(t=>t.color),"color").map(t=>t.color),colors:s.filter(t=>t.color).length===0?M?[M]:[N.Colors.primaryColors["blue-600"]]:M||N.Colors[p].categoricalColors.colors,xAxisTitle:oe,yAxisTitle:re,refXValues:Oe,refYValues:E,showLabels:C,radius:pe,leftMargin:je,rightMargin:ve,topMargin:W,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(Q)?Math.max(...s.map(t=>t.x).filter(t=>t!=null))>0?Math.max(...s.map(t=>t.x).filter(t=>t!=null)):0:Q,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:me,regressionLine:$,resetSelectionOnDoubleClick:D,detailsOnClick:Y,noOfXTicks:de,noOfYTicks:P,labelColor:he,xSuffix:Z,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:d}):null]})})})})}exports.ScatterPlot=nt;
2
2
  //# sourceMappingURL=ScatterPlot.cjs.map