@undp/data-viz 1.4.0 → 1.4.2

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 (189) 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.js +4 -4
  49. package/dist/GriddedGraphsFromConfig.cjs +1 -1
  50. package/dist/GriddedGraphsFromConfig.js +1 -1
  51. package/dist/HeatMap.cjs +1 -1
  52. package/dist/HeatMap.js +10 -10
  53. package/dist/Histogram.cjs +1 -1
  54. package/dist/Histogram.js +1 -1
  55. package/dist/LineChartWithConfidenceInterval.cjs +1 -1
  56. package/dist/LineChartWithConfidenceInterval.js +21 -21
  57. package/dist/{Modal-CUU6ZK3U.js → Modal-DVVwpKhP.js} +2 -2
  58. package/dist/{Modal-CUU6ZK3U.js.map → Modal-DVVwpKhP.js.map} +1 -1
  59. package/dist/{Modal-C_dl0EtQ.cjs → Modal-tXZlLE5s.cjs} +4 -4
  60. package/dist/{Modal-C_dl0EtQ.cjs.map → Modal-tXZlLE5s.cjs.map} +1 -1
  61. package/dist/MultiGraphDashboard.cjs +1 -1
  62. package/dist/MultiGraphDashboard.js +3 -3
  63. package/dist/MultiGraphDashboardFromConfig.cjs +1 -1
  64. package/dist/MultiGraphDashboardFromConfig.js +1 -1
  65. package/dist/MultiGraphDashboardWideToLongFormat.cjs +1 -1
  66. package/dist/MultiGraphDashboardWideToLongFormat.js +3 -3
  67. package/dist/MultiGraphDashboardWideToLongFormatFromConfig.cjs +1 -1
  68. package/dist/MultiGraphDashboardWideToLongFormatFromConfig.js +1 -1
  69. package/dist/MultiLineAltChart.cjs +1 -1
  70. package/dist/MultiLineAltChart.js +21 -21
  71. package/dist/MultiLineChart.cjs +1 -1
  72. package/dist/MultiLineChart.js +19 -19
  73. package/dist/ParetoChart.cjs +1 -1
  74. package/dist/ParetoChart.js +12 -12
  75. package/dist/PerformanceIntensiveMultiGraphDashboard.cjs +1 -1
  76. package/dist/PerformanceIntensiveMultiGraphDashboard.js +3 -3
  77. package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.cjs +1 -1
  78. package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.js +1 -1
  79. package/dist/PerformanceIntensiveScrollStory.cjs +1 -1
  80. package/dist/PerformanceIntensiveScrollStory.js +2 -2
  81. package/dist/RadarChart.cjs +1 -1
  82. package/dist/RadarChart.js +8 -8
  83. package/dist/{ReferenceLine-CuFMk0cI.cjs → ReferenceLine-CFVBBN__.cjs} +2 -2
  84. package/dist/{ReferenceLine-CuFMk0cI.cjs.map → ReferenceLine-CFVBBN__.cjs.map} +1 -1
  85. package/dist/{ReferenceLine-C1GpoG9d.js → ReferenceLine-CfAW3vKJ.js} +2 -2
  86. package/dist/{ReferenceLine-C1GpoG9d.js.map → ReferenceLine-CfAW3vKJ.js.map} +1 -1
  87. package/dist/{RegressionLine-BFwDCTUU.js → RegressionLine-mH7UKOPi.js} +3 -3
  88. package/dist/{RegressionLine-BFwDCTUU.js.map → RegressionLine-mH7UKOPi.js.map} +1 -1
  89. package/dist/{RegressionLine-7_rKTHN_.cjs → RegressionLine-xKdiJ8sw.cjs} +2 -2
  90. package/dist/{RegressionLine-7_rKTHN_.cjs.map → RegressionLine-xKdiJ8sw.cjs.map} +1 -1
  91. package/dist/SankeyChart.cjs +1 -1
  92. package/dist/SankeyChart.js +4 -4
  93. package/dist/ScatterPlot.cjs +1 -1
  94. package/dist/ScatterPlot.js +13 -13
  95. package/dist/ScrollStory.cjs +1 -1
  96. package/dist/ScrollStory.js +2 -2
  97. package/dist/SimpleLineChart.cjs +1 -1
  98. package/dist/SimpleLineChart.js +20 -20
  99. package/dist/SingleGraphDashboard.cjs +1 -1
  100. package/dist/SingleGraphDashboard.js +4 -4
  101. package/dist/SingleGraphDashboardFromConfig.cjs +1 -1
  102. package/dist/SingleGraphDashboardFromConfig.js +1 -1
  103. package/dist/SingleGraphDashboardGeoHubMapsFromConfig.cjs +1 -1
  104. package/dist/SingleGraphDashboardGeoHubMapsFromConfig.js +1 -1
  105. package/dist/SingleGraphDashboardThreeDGraphs.cjs +1 -1
  106. package/dist/SingleGraphDashboardThreeDGraphs.js +3 -3
  107. package/dist/SingleGraphDashboardThreeDGraphsFromConfig.cjs +1 -1
  108. package/dist/SingleGraphDashboardThreeDGraphsFromConfig.js +1 -1
  109. package/dist/SlopeChart.cjs +1 -1
  110. package/dist/SlopeChart.js +7 -7
  111. package/dist/StripChart.cjs +1 -1
  112. package/dist/StripChart.js +9 -9
  113. package/dist/ThreeDGlobe.cjs +1 -1
  114. package/dist/ThreeDGlobe.js +2 -2
  115. package/dist/TreeMapGraph.cjs +1 -1
  116. package/dist/TreeMapGraph.js +4 -4
  117. package/dist/UnitChart.cjs +1 -1
  118. package/dist/UnitChart.js +3 -3
  119. package/dist/{XAxesLabels-DQFo_z2R.js → XAxesLabels-CaV2q-6H.js} +2 -2
  120. package/dist/{XAxesLabels-DQFo_z2R.js.map → XAxesLabels-CaV2q-6H.js.map} +1 -1
  121. package/dist/{XAxesLabels-CJMQbfVy.cjs → XAxesLabels-OjBNl_lS.cjs} +2 -2
  122. package/dist/{XAxesLabels-CJMQbfVy.cjs.map → XAxesLabels-OjBNl_lS.cjs.map} +1 -1
  123. package/dist/{YAxesLabels-H5-002X5.js → YAxesLabels-CPGZjmZJ.js} +2 -2
  124. package/dist/{YAxesLabels-H5-002X5.js.map → YAxesLabels-CPGZjmZJ.js.map} +1 -1
  125. package/dist/{YAxesLabels-BXLTX7AI.cjs → YAxesLabels-D8IydyZj.cjs} +2 -2
  126. package/dist/{YAxesLabels-BXLTX7AI.cjs.map → YAxesLabels-D8IydyZj.cjs.map} +1 -1
  127. package/dist/{checkIfMultiple-Do4kADNr.cjs → checkIfMultiple-BXbHUCWM.cjs} +6 -6
  128. package/dist/{checkIfMultiple-Do4kADNr.cjs.map → checkIfMultiple-BXbHUCWM.cjs.map} +1 -1
  129. package/dist/{checkIfMultiple-CYp3vADF.js → checkIfMultiple-ChTJk2Tk.js} +5 -5
  130. package/dist/{checkIfMultiple-CYp3vADF.js.map → checkIfMultiple-ChTJk2Tk.js.map} +1 -1
  131. package/dist/{customArea-CaxScFmW.js → customArea-B-dWU0zZ.js} +2 -2
  132. package/dist/{customArea-CaxScFmW.js.map → customArea-B-dWU0zZ.js.map} +1 -1
  133. package/dist/{customArea-BYNyxAkm.cjs → customArea-CK768gCn.cjs} +2 -2
  134. package/dist/{customArea-BYNyxAkm.cjs.map → customArea-CK768gCn.cjs.map} +1 -1
  135. package/dist/{fetchAndParseData-Bcmr659B.js → fetchAndParseData-4gsYTy6_.js} +3 -3
  136. package/dist/fetchAndParseData-4gsYTy6_.js.map +1 -0
  137. package/dist/{fetchAndParseData-DmgQtB9n.cjs → fetchAndParseData-CQyVGCul.cjs} +6 -6
  138. package/dist/fetchAndParseData-CQyVGCul.cjs.map +1 -0
  139. package/dist/fetchAndParseData.cjs +1 -1
  140. package/dist/fetchAndParseData.js +1 -1
  141. package/dist/index-BW8iNx7E.cjs +10 -0
  142. package/dist/index-BW8iNx7E.cjs.map +1 -0
  143. package/dist/index-CNvov0eg.js +122 -0
  144. package/dist/index-CNvov0eg.js.map +1 -0
  145. package/dist/{index-D_n8aamX.cjs → index-CZLvTu6p.cjs} +2 -2
  146. package/dist/{index-D_n8aamX.cjs.map → index-CZLvTu6p.cjs.map} +1 -1
  147. package/dist/{index-n_RI8T0n.js → index-Cdcfp4nk.js} +2 -2
  148. package/dist/{index-n_RI8T0n.js.map → index-Cdcfp4nk.js.map} +1 -1
  149. package/dist/{index-BVnYktl4.js → index-DGAaLNu9.js} +2 -2
  150. package/dist/{index-BVnYktl4.js.map → index-DGAaLNu9.js.map} +1 -1
  151. package/dist/{index-CylX-pWB.cjs → index-DNj994Pv.cjs} +2 -2
  152. package/dist/{index-CylX-pWB.cjs.map → index-DNj994Pv.cjs.map} +1 -1
  153. package/dist/index.cjs +1 -1
  154. package/dist/index.js +3 -3
  155. package/dist/proxy-BHRoeZgd.cjs +2 -0
  156. package/dist/proxy-BHRoeZgd.cjs.map +1 -0
  157. package/dist/{proxy-DJxJg1kD.js → proxy-CkpFesk1.js} +4123 -4075
  158. package/dist/proxy-CkpFesk1.js.map +1 -0
  159. package/dist/style.css +1 -1
  160. package/dist/transformData.cjs +1 -1
  161. package/dist/transformData.js +2 -2
  162. package/dist/{transformDataForGraphFromFile-D9G3ToQf.cjs → transformDataForGraphFromFile-B1A0AS-Z.cjs} +2 -2
  163. package/dist/{transformDataForGraphFromFile-D9G3ToQf.cjs.map → transformDataForGraphFromFile-B1A0AS-Z.cjs.map} +1 -1
  164. package/dist/{transformDataForGraphFromFile-CA0rw80A.js → transformDataForGraphFromFile-BCjsizvb.js} +2 -2
  165. package/dist/{transformDataForGraphFromFile-CA0rw80A.js.map → transformDataForGraphFromFile-BCjsizvb.js.map} +1 -1
  166. package/dist/{use-in-view-BCmzDU2O.cjs → use-in-view-sQJZ_xDO.cjs} +2 -2
  167. package/dist/use-in-view-sQJZ_xDO.cjs.map +1 -0
  168. package/dist/{use-in-view-BAHrBy6b.js → use-in-view-yS6jzJAp.js} +2 -2
  169. package/dist/use-in-view-yS6jzJAp.js.map +1 -0
  170. package/dist/x-BBpi7a_7-Dz2vKSfu.cjs +27 -0
  171. package/dist/x-BBpi7a_7-Dz2vKSfu.cjs.map +1 -0
  172. package/dist/x-BBpi7a_7-WVdj1j6r.js +106 -0
  173. package/dist/x-BBpi7a_7-WVdj1j6r.js.map +1 -0
  174. package/package.json +50 -51
  175. package/dist/fetchAndParseData-Bcmr659B.js.map +0 -1
  176. package/dist/fetchAndParseData-DmgQtB9n.cjs.map +0 -1
  177. package/dist/index-BxAUvrua.js +0 -120
  178. package/dist/index-BxAUvrua.js.map +0 -1
  179. package/dist/index-DVOJ7vxH.cjs +0 -10
  180. package/dist/index-DVOJ7vxH.cjs.map +0 -1
  181. package/dist/proxy-DJxJg1kD.js.map +0 -1
  182. package/dist/proxy-PQd2AItT.cjs +0 -2
  183. package/dist/proxy-PQd2AItT.cjs.map +0 -1
  184. package/dist/use-in-view-BAHrBy6b.js.map +0 -1
  185. package/dist/use-in-view-BCmzDU2O.cjs.map +0 -1
  186. package/dist/x-CnsEH4Ox-CGGXQl4M.cjs +0 -27
  187. package/dist/x-CnsEH4Ox-CGGXQl4M.cjs.map +0 -1
  188. package/dist/x-CnsEH4Ox-DDvAJndW.js +0 -101
  189. package/dist/x-CnsEH4Ox-DDvAJndW.js.map +0 -1
@@ -6,24 +6,24 @@ import { s as $e } from "./index-DxagiOHo.js";
6
6
  import { n as Se } from "./numberFormattingFunction-14YCbkN2.js";
7
7
  import { T as He } from "./Tooltip-DyM5snqx.js";
8
8
  import { c as x } from "./checkIfNullOrUndefined-DmfiKkNw.js";
9
- import { C as We, g as Ie, A as Re } from "./customArea-CaxScFmW.js";
9
+ import { C as We, g as Ie, A as Re } from "./customArea-B-dWU0zZ.js";
10
10
  import { A as Ye } from "./AxisTitle-BmHLMRJZ.js";
11
11
  import { A as Fe } from "./Axis-Ddg-seDi.js";
12
12
  import { X as Xe } from "./XTicksAndGridLines-Bn9u5gOM.js";
13
- import { R as Pe } from "./ReferenceLine-C1GpoG9d.js";
13
+ import { R as Pe } from "./ReferenceLine-CfAW3vKJ.js";
14
14
  import { Y as Ee } from "./YTicksAndGridLines-B6ah7CRf.js";
15
- import { H as Ge } from "./index-n_RI8T0n.js";
15
+ import { H as Ge } from "./index-Cdcfp4nk.js";
16
16
  import { Colors as T } from "./Colors.js";
17
- import { u as Be } from "./use-in-view-BAHrBy6b.js";
18
- import { t as ze } from "./time-BzJP5SPC.js";
19
- import { a as qe } from "./linear-DUdu7l2G.js";
20
- import { D as Ue } from "./delaunay-C1uAf38t.js";
21
- import { l as Je, c as Ke } from "./line-CPfhohvF.js";
22
- import { c as Qe, s as Ze, a as _e, m as et } from "./step-BrDul-H4.js";
23
- import { s as tt } from "./select-DKy99ogv.js";
24
- import { m as E } from "./proxy-DJxJg1kD.js";
25
- import { a as it } from "./init-BhZylTFx.js";
26
- import { p as ot } from "./pointer-CWRWOsrb.js";
17
+ import { t as Be } from "./time-BzJP5SPC.js";
18
+ import { a as ze } from "./linear-DUdu7l2G.js";
19
+ import { D as qe } from "./delaunay-C1uAf38t.js";
20
+ import { l as Ue, c as Je } from "./line-CPfhohvF.js";
21
+ import { c as Ke, s as Qe, a as Ze, m as _e } from "./step-BrDul-H4.js";
22
+ import { s as et } from "./select-DKy99ogv.js";
23
+ import { a as tt } from "./init-BhZylTFx.js";
24
+ import { p as it } from "./pointer-CWRWOsrb.js";
25
+ import { u as ot } from "./use-in-view-yS6jzJAp.js";
26
+ import { m as E } from "./proxy-CkpFesk1.js";
27
27
  import { GraphFooter as at } from "./GraphFooter.js";
28
28
  import { GraphHeader as rt } from "./GraphHeader.js";
29
29
  import { E as nt } from "./EmptyState-DdTp-Mdn.js";
@@ -69,7 +69,7 @@ function lt(pe) {
69
69
  precision: M,
70
70
  naLabel: Ce,
71
71
  customLayers: ne
72
- } = pe, se = ge(null), y = Be(se, {
72
+ } = pe, se = ge(null), y = ot(se, {
73
73
  once: a.once,
74
74
  amount: a.amount
75
75
  }), [A, Oe] = G(!1);
@@ -84,7 +84,7 @@ function lt(pe) {
84
84
  return () => clearTimeout(e);
85
85
  }
86
86
  }, [y, A, a.duration]);
87
- const je = U === "linear" ? Ke : U === "step" ? Qe : U === "stepAfter" ? Ze : U === "stepBefore" ? _e : et, l = $e(
87
+ const je = U === "linear" ? Je : U === "step" ? Ke : U === "stepAfter" ? Qe : U === "stepBefore" ? Ze : _e, l = $e(
88
88
  n.map((e) => ({
89
89
  ...e,
90
90
  date: u(`${e.date}`, f, /* @__PURE__ */ new Date())
@@ -128,26 +128,26 @@ function lt(pe) {
128
128
  ...l.map((e) => e.y).filter((e) => !x(e))
129
129
  ) ? Math.max(
130
130
  ...l.map((e) => e.y).filter((e) => !x(e))
131
- ) : 0, r = ze().domain([P, xe]).range([0, w]), c = qe().domain([
131
+ ) : 0, r = Be().domain([P, xe]).range([0, w]), c = ze().domain([
132
132
  x(z) ? i : z,
133
133
  x(te) ? J > 0 ? J : 0 : te
134
- ]).range([V, 0]).nice(), ke = Ue.from(
134
+ ]).range([V, 0]).nice(), ke = qe.from(
135
135
  l.filter((e) => !x(e.date) && !x(e.y)),
136
136
  (e) => r(e.date),
137
137
  (e) => c(e.y)
138
- ).voronoi([0, 0, w < 0 ? 0 : w, V < 0 ? 0 : V]), De = Je().x((e) => r(e.date)).y((e) => c(e.y)).curve(je), Ne = c.ticks(be), Te = r.ticks(ye);
138
+ ).voronoi([0, 0, w < 0 ? 0 : w, V < 0 ? 0 : V]), De = Ue().x((e) => r(e.date)).y((e) => c(e.y)).curve(je), Ne = c.ticks(be), Te = r.ticks(ye);
139
139
  return Me(() => {
140
140
  const e = (m) => {
141
- const H = l[it(
141
+ const H = l[tt(
142
142
  l.map((Le) => Le.date),
143
- r.invert(ot(m)[0]),
143
+ r.invert(it(m)[0]),
144
144
  1
145
145
  )];
146
146
  d(H || l[l.length - 1]), F(m.clientY), Y(m.clientX), W?.(H || l[l.length - 1]);
147
147
  }, o = () => {
148
148
  d(void 0), Y(void 0), F(void 0);
149
149
  };
150
- tt(X.current).on("mousemove", e).on("mouseout", o), W?.(void 0);
150
+ et(X.current).on("mousemove", e).on("mouseout", o), W?.(void 0);
151
151
  }, [r, l, W]), /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
152
152
  /* @__PURE__ */ t.jsx(
153
153
  E.svg,
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-CHPV5EwG-DDoeWRVt.cjs"),f=require("react"),d=require("./parse-hMnG_lRV.cjs"),Ie=require("./index-BzeLQvXk.cjs"),Ne=require("./numberFormattingFunction-02t-wJta.cjs"),Se=require("./Tooltip-n8z5bfav.cjs"),m=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),be=require("./customArea-BYNyxAkm.cjs"),De=require("./AxisTitle-CK9YeovX.cjs"),Te=require("./Axis-DE7dSn1_.cjs"),qe=require("./XTicksAndGridLines-CCzXIV8d.cjs"),$e=require("./ReferenceLine-CuFMk0cI.cjs"),Me=require("./YTicksAndGridLines-DBDuz6vb.cjs"),Ve=require("./index-CylX-pWB.cjs"),Fe=require("./use-in-view-BCmzDU2O.cjs"),He=require("./time-Byw_jYQ7.cjs"),Ue=require("./linear-BVckp9RD.cjs"),Le=require("./line-DHV4JwCR.cjs"),xe=require("./step-BZ3C8QFW.cjs"),Ge=require("./select-Bnfk0lJx.cjs"),T=require("./proxy-PQd2AItT.cjs"),Pe=require("./init-DU0ybBc_.cjs"),We=require("./pointer-Dkq5NV1q.cjs"),Ye=require("./GraphFooter.cjs"),Xe=require("./GraphHeader.cjs"),Be=require("./ColorLegend.cjs"),ze=require("./Colors.cjs"),_e=require("./EmptyState-d8_8SxeW.cjs"),Je=require("./generateRandomString-B5zBiJzS.cjs");function Ke(ue){const{data:N,width:A,height:q,lineColors:L,dateFormat:l,noOfXTicks:de,labels:v,rightMargin:$,topMargin:h,bottomMargin:_,suffix:M,prefix:V,leftMargin:E,tooltip:G,onSeriesMouseOver:P,showValues:k,showColorLegendAtTop:me,refValues:J,highlightAreaSettings:he,minValue:F,maxValue:K,highlightedLines:b,animate:s,rtl:W,strokeWidth:pe,showDots:ge,annotations:fe,customHighlightAreaSettings:ye,yAxisTitle:Q,noOfYTicks:je,minDate:Y,maxDate:X,curveType:I,styles:c,classNames:y,dimmedOpacity:S,precision:H,customLayers:Z,dashedLines:B,dashSettings:ee,labelsToBeHidden:we,revealClipId:te}=ue,ie=f.useRef(null),x=Fe.useInView(ie,{once:s.once,amount:s.amount}),[O,ve]=f.useState(!1);f.useEffect(()=>{if(x&&!O){const e=setTimeout(()=>{ve(!0)},(s.duration+.5)*1e3);return()=>clearTimeout(e)}},[x,O,s.duration]);const Re=I==="linear"?Le.curveLinear:I==="step"?xe.curveStep:I==="stepAfter"?xe.stepAfter:I==="stepBefore"?xe.stepBefore:xe.monotoneX,[j,C]=f.useState(void 0),[ne,se]=f.useState(void 0),[re,ae]=f.useState(void 0),R={top:h,bottom:_,left:Q?E+30:E,right:$},z=f.useRef(null),r=Ie.sortBy(N.map(e=>({...e,date:d.parse(`${e.date}`,l,new Date)})),"date"),D=r[0].y.map((e,i)=>r.map(n=>({...n,y:n.y[i]})).filter(n=>!m.checkIfNullOrUndefined(n.y))),oe=he.map(e=>({...e,coordinates:[e.coordinates[0]===null?null:d.parse(`${e.coordinates[0]}`,l,new Date),e.coordinates[1]===null?null:d.parse(`${e.coordinates[1]}`,l,new Date)]})),le=ye.map(e=>({...e,coordinates:e.coordinates.map((i,n)=>n%2===0?d.parse(`${i}`,l,new Date):i)})),p=A-R.left-R.right,g=q-R.top-R.bottom,ce=Y?d.parse(`${Y}`,l,new Date):r[0].date,u=X?d.parse(`${X}`,l,new Date):r[r.length-1].date,w=m.checkIfNullOrUndefined(F)?Math.min(...r.map(e=>Math.min(...e.y.filter(i=>!m.checkIfNullOrUndefined(i)))))?Math.min(...r.map(e=>Math.min(...e.y.filter(i=>!m.checkIfNullOrUndefined(i)))))>0?0:Math.min(...r.map(e=>Math.min(...e.y.filter(i=>!m.checkIfNullOrUndefined(i))))):0:F,Ee=Math.max(...r.map(e=>Math.max(...e.y.filter(i=>!m.checkIfNullOrUndefined(i)))))?Math.max(...r.map(e=>Math.max(...e.y.filter(i=>!m.checkIfNullOrUndefined(i))))):0,a=He.time().domain([ce,u]).range([0,p]),o=Ue.linear().domain([m.checkIfNullOrUndefined(F)?w:F,m.checkIfNullOrUndefined(K)?Ee>0?Ee:0:K]).range([g,0]).nice(),Ce=Le.line().x(e=>a(e.date)).y(e=>o(e.y)).curve(Re),Ae=o.ticks(je),ke=a.ticks(de);return f.useEffect(()=>{const e=n=>{const U=r[Pe.bisectCenter(r.map(Oe=>Oe.date),a.invert(We.pointer(n)[0]),1)];C(U||r[r.length-1]),ae(n.clientY),se(n.clientX),P?.(U||r[r.length-1])},i=()=>{C(void 0),se(void 0),ae(void 0)};Ge.select(z.current).on("mousemove",e).on("mouseout",i),P?.(void 0)},[a,r,P]),t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(T.motion.svg,{width:`${A}px`,height:`${q}px`,viewBox:`0 0 ${A} ${q}`,direction:"ltr",ref:ie,children:t.jsxRuntimeExports.jsxs("g",{transform:`translate(${R.left},${R.top})`,children:[t.jsxRuntimeExports.jsx("defs",{children:t.jsxRuntimeExports.jsx("clipPath",{id:te,children:t.jsxRuntimeExports.jsx(T.motion.rect,{x:0,y:0,height:g,variants:{initial:{width:0},whileInView:{width:p,transition:{duration:s.duration}}},initial:"initial",animate:x?"whileInView":"initial"})})}),t.jsxRuntimeExports.jsx(Ve.HighlightArea,{areaSettings:oe,width:p,height:g,scale:a,animate:s,isInView:x}),t.jsxRuntimeExports.jsx(be.CustomArea,{areaSettings:le,scaleX:a,scaleY:o,animate:s,isInView:x}),t.jsxRuntimeExports.jsxs("g",{children:[t.jsxRuntimeExports.jsx(Me.YTicksAndGridLines,{values:Ae.filter(e=>e!==0),y:Ae.filter(e=>e!==0).map(e=>o(e)),x1:0-E,x2:p+R.right,styles:{gridLines:c?.yAxis?.gridLines,labels:c?.yAxis?.labels},classNames:{gridLines:y?.yAxis?.gridLines,labels:y?.yAxis?.labels},suffix:M,prefix:V,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:H}),t.jsxRuntimeExports.jsx(Te.Axis,{y1:o(w<0?0:w),y2:o(w<0?0:w),x1:0-E,x2:p+R.right,label:Ne.numberFormattingFunction(w<0?0:w,"NA",H,V,M),labelPos:{x:0-E,y:o(w<0?0:w),dx:0,dy:Ee<0?"1em":-5},classNames:{axis:y?.xAxis?.axis,label:y?.yAxis?.labels},styles:{axis:c?.xAxis?.axis,label:c?.yAxis?.labels}}),t.jsxRuntimeExports.jsx(De.AxisTitle,{x:0-E-15,y:g/2,style:c?.yAxis?.title,className:y?.yAxis?.title,text:Q,rotate90:!0})]}),t.jsxRuntimeExports.jsx("g",{children:t.jsxRuntimeExports.jsx(qe.XTicksAndGridLines,{values:ke.map(e=>d.format(e,l)),x:ke.map(e=>a(e)),y1:0,y2:g,styles:{gridLines:c?.xAxis?.gridLines,labels:c?.xAxis?.labels},classNames:{gridLines:t.mo("opacity-0",y?.xAxis?.gridLines),labels:t.mo("fill-primary-gray-700 dark:fill-primary-gray-300 xs:max-[360px]:hidden text-[9px] md:text-[10px] lg:text-xs",y?.xAxis?.labels)},suffix:M,prefix:V,labelType:"primary",showGridLines:!0,precision:H})}),Z.filter(e=>e.position==="before").map(e=>e.layer),t.jsxRuntimeExports.jsxs("g",{children:[D.map((e,i)=>t.jsxRuntimeExports.jsxs(T.motion.g,{exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:b.length!==0?b.indexOf(v[i])!==-1?1:S:1},whileInView:{opacity:b.length!==0?b.indexOf(v[i])!==-1?1:S:1,transition:{duration:s.duration}}},initial:"initial",animate:x?"whileInView":"initial",children:[t.jsxRuntimeExports.jsx(T.motion.path,{style:{fill:"none",strokeWidth:pe},clipPath:`url(#${te})`,exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{...B.length===0?{pathLength:0}:{},d:Ce(e.filter(n=>!m.checkIfNullOrUndefined(n.y)))||"",opacity:1,stroke:L[i]},whileInView:{...B.length===0?{pathLength:1}:{},d:Ce(e.filter(n=>!m.checkIfNullOrUndefined(n.y)))||"",opacity:1,stroke:L[i],transition:{duration:s.duration}}},strokeDasharray:B.includes(v[i])?ee[i%ee.length]:void 0,initial:"initial",animate:x?"whileInView":"initial"}),e.map((n,U)=>t.jsxRuntimeExports.jsx("g",{children:m.checkIfNullOrUndefined(n.y)?null:t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[ge?t.jsxRuntimeExports.jsx(T.motion.circle,{r:p/r.length<5?0:p/r.length<20?2:4,style:{fill:L[i]},exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:0,cx:a(n.date),cy:o(n.y)},whileInView:{opacity:1,transition:{duration:O?s.duration:.5,delay:O?0:s.duration},cx:a(n.date),cy:o(n.y)}},initial:"initial",animate:x?"whileInView":"initial"}):null,k?t.jsxRuntimeExports.jsx(T.motion.text,{dy:-8,style:{fill:L[i],textAnchor:"middle",...c?.graphObjectValues||{}},className:t.mo("graph-value text-xs font-bold",y?.graphObjectValues),exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:0,x:a(n.date),y:o(n.y)},whileInView:{opacity:1,x:a(n.date),y:o(n.y),transition:{duration:O?s.duration:.5,delay:O?0:s.duration}}},initial:"initial",animate:x?"whileInView":"initial",children:Ne.numberFormattingFunction(n.y,"NA",H,V,M)}):null]})},U)),me||we.includes(v[i])?null:t.jsxRuntimeExports.jsx(T.motion.text,{style:{fill:L[i]},className:"text-xs",dx:5,dy:4,exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:0,x:a(e[e.length-1].date),y:o(e[e.length-1].y)},whileInView:{opacity:1,x:a(e[e.length-1].date),y:o(e[e.length-1].y),transition:{duration:O?s.duration:.5,delay:O?0:s.duration}}},initial:"initial",animate:x?"whileInView":"initial",children:v[i]})]},v[i])),j?t.jsxRuntimeExports.jsx("line",{y1:0,y2:g,x1:a(j.date),x2:a(j.date),className:t.mo("undp-tick-line stroke-primary-gray-700 dark:stroke-primary-gray-100",y?.mouseOverLine),style:c?.mouseOverLine}):null]}),J?t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:J.map((e,i)=>t.jsxRuntimeExports.jsx($e.RefLineY,{text:e.text,color:e.color,y:o(e.value),x1:0-E,x2:p+R.right,classNames:e.classNames,styles:e.styles,animate:s,isInView:x},i))}):null,t.jsxRuntimeExports.jsx("g",{children:fe.map((e,i)=>{const n=be.getLineEndPoint({x:e.xCoordinate?a(d.parse(`${e.xCoordinate}`,l,new Date))+(e.xOffset||0):0+(e.xOffset||0),y:e.yCoordinate?o(e.yCoordinate)+(e.yOffset||0)-8:0+(e.yOffset||0)-8},{x:e.xCoordinate?a(d.parse(`${e.xCoordinate}`,l,new Date)):0,y:e.yCoordinate?o(e.yCoordinate):0},m.checkIfNullOrUndefined(e.connectorRadius)?3.5:e.connectorRadius),U=e.showConnector?{y1:n.y,x1:n.x,y2:e.yCoordinate?o(e.yCoordinate)+(e.yOffset||0):0+(e.yOffset||0),x2:e.xCoordinate?a(d.parse(`${e.xCoordinate}`,l,new Date))+(e.xOffset||0):0+(e.xOffset||0),cy:e.yCoordinate?o(e.yCoordinate):0,cx:e.xCoordinate?a(d.parse(`${e.xCoordinate}`,l,new Date)):0,circleRadius:m.checkIfNullOrUndefined(e.connectorRadius)?3.5:e.connectorRadius,strokeWidth:e.showConnector===!0?2:Math.min(e.showConnector||0,1)}:void 0,Oe={y:e.yCoordinate?o(e.yCoordinate)+(e.yOffset||0)-8:0+(e.yOffset||0)-8,x:W?0:e.xCoordinate?a(d.parse(`${e.xCoordinate}`,l,new Date))+(e.xOffset||0):0+(e.xOffset||0),width:W?e.xCoordinate?a(d.parse(`${e.xCoordinate}`,l,new Date))+(e.xOffset||0):0+(e.xOffset||0):p-(e.xCoordinate?a(d.parse(`${e.xCoordinate}`,l,new Date))+(e.xOffset||0):0+(e.xOffset||0)),maxWidth:e.maxWidth,fontWeight:e.fontWeight,align:e.align};return t.jsxRuntimeExports.jsx(be.Annotation,{color:e.color,connectorsSettings:U,labelSettings:Oe,text:e.text,classNames:e.classNames,styles:e.styles,animate:s,isInView:x},i)})}),Z.filter(e=>e.position==="after").map(e=>e.layer),t.jsxRuntimeExports.jsx("rect",{ref:z,style:{fill:"none",pointerEvents:"all"},width:p,height:g})]})}),j&&G&&ne&&re?t.jsxRuntimeExports.jsx(Se.Tooltip,{data:j,body:G,xPos:ne,yPos:re,backgroundStyle:c?.tooltip,className:y?.tooltip}):null]})}function Qe(ue){const{data:N,graphTitle:A,lineColors:q=ze.Colors.light.categoricalColors.colors,suffix:L="",sources:l,prefix:de="",graphDescription:v,height:$,width:h,footNote:_,noOfXTicks:M=10,dateFormat:V="yyyy",labels:E,padding:G,showValues:P=!1,backgroundColor:k=!1,leftMargin:me=30,rightMargin:J=50,topMargin:he=20,bottomMargin:F=25,tooltip:K,relativeHeight:b,onSeriesMouseOver:s,showColorLegendAtTop:W=!1,refValues:pe=[],highlightAreaSettings:ge=[],graphID:fe,minValue:ye,maxValue:Q,highlightedLines:je=[],graphDownload:Y=!1,dataDownload:X=!1,animate:I=!1,language:c="en",colorLegendTitle:y,minHeight:S=0,strokeWidth:H=2,showDots:Z=!0,annotations:B=[],customHighlightAreaSettings:ee=[],theme:we="light",ariaLabel:te,yAxisTitle:ie,noOfYTicks:x=5,minDate:O,maxDate:ve,curveType:Re="curve",styles:j,classNames:C,dimmedOpacity:ne=.3,precision:se=2,customLayers:re=[],dashedLines:ae=[],dashSettings:R=["5 5"],labelsToBeHidden:z=[],showColorScale:r=!0}=ue,[D,oe]=f.useState(0),[le,p]=f.useState(0),g=f.useRef(null),ce=f.useRef(null);return f.useEffect(()=>{const u=new ResizeObserver(w=>{oe(h||w[0].target.clientWidth||620),p($||w[0].target.clientHeight||480)});return g.current&&(p(g.current.clientHeight||480),oe(g.current.clientWidth||620),h||u.observe(g.current)),()=>u.disconnect()},[h,$]),t.jsxRuntimeExports.jsx("div",{className:`${we||"light"} flex ${h?"w-fit grow-0":"w-full grow"}`,dir:c==="he"||c==="ar"?"rtl":void 0,children:t.jsxRuntimeExports.jsx("div",{className:t.mo(`${k?k===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${c||"en"}`,C?.graphContainer),style:{...j?.graphContainer||{},...k&&k!==!0?{backgroundColor:k}:{}},id:fe,ref:ce,"aria-label":te||`${A?`The graph shows ${A}. `:""}This is a multi-line chart that shows trends over time.${v?` ${v}`:""}`,children:t.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:k?G||"1rem":G||0},children:t.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[A||v||Y||X?t.jsxRuntimeExports.jsx(Xe.GraphHeader,{styles:{title:j?.title,description:j?.description},classNames:{title:C?.title,description:C?.description},graphTitle:A,graphDescription:v,width:h,graphDownload:Y?ce.current:void 0,dataDownload:X?N.map(u=>u.data).filter(u=>u!==void 0).length>0?N.map(u=>u.data).filter(u=>u!==void 0):N.filter(u=>u!==void 0):null}):null,t.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:N.length===0?t.jsxRuntimeExports.jsx(_e.EmptyState,{}):t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[W&&r?t.jsxRuntimeExports.jsx(Be.ColorLegend,{colorDomain:E,colorLegendTitle:y,labelsToBeHidden:z,colors:q,showNAColor:!1}):null,t.jsxRuntimeExports.jsx("div",{className:"w-full grow leading-0",ref:g,"aria-label":"Graph area",children:(h||D)&&($||le)?t.jsxRuntimeExports.jsx(Ke,{data:N,lineColors:q,width:h||D,height:Math.max(S,$||(b?S?(h||D)*b>S?(h||D)*b:S:(h||D)*b:le)),dateFormat:V,noOfXTicks:M,leftMargin:me,rightMargin:J,topMargin:he,bottomMargin:F,labels:E,tooltip:K,onSeriesMouseOver:s,showColorLegendAtTop:r?W:!0,showValues:P,suffix:L,prefix:de,highlightAreaSettings:ge,refValues:pe,minValue:ye,maxValue:Q,highlightedLines:je,animate:I===!0?{duration:.5,once:!0,amount:.5}:I||{duration:0,once:!0,amount:0},rtl:c==="he"||c==="ar",strokeWidth:H,showDots:Z,annotations:B,customHighlightAreaSettings:ee,yAxisTitle:ie,noOfYTicks:x,minDate:O,maxDate:ve,curveType:Re,styles:j,classNames:C,dimmedOpacity:ne,precision:se,customLayers:re,labelsToBeHidden:z,dashedLines:ae,dashSettings:R,revealClipId:Je.generateRandomString(8)}):null})]})}),l||_?t.jsxRuntimeExports.jsx(Ye.GraphFooter,{styles:{footnote:j?.footnote,source:j?.source},classNames:{footnote:C?.footnote,source:C?.source},sources:l,footNote:_,width:h}):null]})})})})}exports.MultiLineChart=Qe;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-CHPV5EwG-DDoeWRVt.cjs"),f=require("react"),d=require("./parse-hMnG_lRV.cjs"),Ie=require("./index-BzeLQvXk.cjs"),Ne=require("./numberFormattingFunction-02t-wJta.cjs"),Se=require("./Tooltip-n8z5bfav.cjs"),m=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),be=require("./customArea-CK768gCn.cjs"),De=require("./AxisTitle-CK9YeovX.cjs"),Te=require("./Axis-DE7dSn1_.cjs"),qe=require("./XTicksAndGridLines-CCzXIV8d.cjs"),$e=require("./ReferenceLine-CFVBBN__.cjs"),Me=require("./YTicksAndGridLines-DBDuz6vb.cjs"),Ve=require("./index-DNj994Pv.cjs"),Fe=require("./time-Byw_jYQ7.cjs"),He=require("./linear-BVckp9RD.cjs"),Le=require("./line-DHV4JwCR.cjs"),xe=require("./step-BZ3C8QFW.cjs"),Ue=require("./select-Bnfk0lJx.cjs"),Ge=require("./init-DU0ybBc_.cjs"),Pe=require("./pointer-Dkq5NV1q.cjs"),We=require("./use-in-view-sQJZ_xDO.cjs"),T=require("./proxy-BHRoeZgd.cjs"),Ye=require("./GraphFooter.cjs"),Xe=require("./GraphHeader.cjs"),Be=require("./ColorLegend.cjs"),ze=require("./Colors.cjs"),_e=require("./EmptyState-d8_8SxeW.cjs"),Je=require("./generateRandomString-B5zBiJzS.cjs");function Ke(ue){const{data:N,width:A,height:q,lineColors:L,dateFormat:l,noOfXTicks:de,labels:v,rightMargin:$,topMargin:h,bottomMargin:_,suffix:M,prefix:V,leftMargin:E,tooltip:G,onSeriesMouseOver:P,showValues:k,showColorLegendAtTop:me,refValues:J,highlightAreaSettings:he,minValue:F,maxValue:K,highlightedLines:b,animate:s,rtl:W,strokeWidth:pe,showDots:ge,annotations:fe,customHighlightAreaSettings:ye,yAxisTitle:Q,noOfYTicks:je,minDate:Y,maxDate:X,curveType:I,styles:c,classNames:y,dimmedOpacity:S,precision:H,customLayers:Z,dashedLines:B,dashSettings:ee,labelsToBeHidden:we,revealClipId:te}=ue,ie=f.useRef(null),x=We.useInView(ie,{once:s.once,amount:s.amount}),[O,ve]=f.useState(!1);f.useEffect(()=>{if(x&&!O){const e=setTimeout(()=>{ve(!0)},(s.duration+.5)*1e3);return()=>clearTimeout(e)}},[x,O,s.duration]);const Re=I==="linear"?Le.curveLinear:I==="step"?xe.curveStep:I==="stepAfter"?xe.stepAfter:I==="stepBefore"?xe.stepBefore:xe.monotoneX,[j,C]=f.useState(void 0),[ne,se]=f.useState(void 0),[re,ae]=f.useState(void 0),R={top:h,bottom:_,left:Q?E+30:E,right:$},z=f.useRef(null),r=Ie.sortBy(N.map(e=>({...e,date:d.parse(`${e.date}`,l,new Date)})),"date"),D=r[0].y.map((e,i)=>r.map(n=>({...n,y:n.y[i]})).filter(n=>!m.checkIfNullOrUndefined(n.y))),oe=he.map(e=>({...e,coordinates:[e.coordinates[0]===null?null:d.parse(`${e.coordinates[0]}`,l,new Date),e.coordinates[1]===null?null:d.parse(`${e.coordinates[1]}`,l,new Date)]})),le=ye.map(e=>({...e,coordinates:e.coordinates.map((i,n)=>n%2===0?d.parse(`${i}`,l,new Date):i)})),p=A-R.left-R.right,g=q-R.top-R.bottom,ce=Y?d.parse(`${Y}`,l,new Date):r[0].date,u=X?d.parse(`${X}`,l,new Date):r[r.length-1].date,w=m.checkIfNullOrUndefined(F)?Math.min(...r.map(e=>Math.min(...e.y.filter(i=>!m.checkIfNullOrUndefined(i)))))?Math.min(...r.map(e=>Math.min(...e.y.filter(i=>!m.checkIfNullOrUndefined(i)))))>0?0:Math.min(...r.map(e=>Math.min(...e.y.filter(i=>!m.checkIfNullOrUndefined(i))))):0:F,Ee=Math.max(...r.map(e=>Math.max(...e.y.filter(i=>!m.checkIfNullOrUndefined(i)))))?Math.max(...r.map(e=>Math.max(...e.y.filter(i=>!m.checkIfNullOrUndefined(i))))):0,a=Fe.time().domain([ce,u]).range([0,p]),o=He.linear().domain([m.checkIfNullOrUndefined(F)?w:F,m.checkIfNullOrUndefined(K)?Ee>0?Ee:0:K]).range([g,0]).nice(),Ce=Le.line().x(e=>a(e.date)).y(e=>o(e.y)).curve(Re),Ae=o.ticks(je),ke=a.ticks(de);return f.useEffect(()=>{const e=n=>{const U=r[Ge.bisectCenter(r.map(Oe=>Oe.date),a.invert(Pe.pointer(n)[0]),1)];C(U||r[r.length-1]),ae(n.clientY),se(n.clientX),P?.(U||r[r.length-1])},i=()=>{C(void 0),se(void 0),ae(void 0)};Ue.select(z.current).on("mousemove",e).on("mouseout",i),P?.(void 0)},[a,r,P]),t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(T.motion.svg,{width:`${A}px`,height:`${q}px`,viewBox:`0 0 ${A} ${q}`,direction:"ltr",ref:ie,children:t.jsxRuntimeExports.jsxs("g",{transform:`translate(${R.left},${R.top})`,children:[t.jsxRuntimeExports.jsx("defs",{children:t.jsxRuntimeExports.jsx("clipPath",{id:te,children:t.jsxRuntimeExports.jsx(T.motion.rect,{x:0,y:0,height:g,variants:{initial:{width:0},whileInView:{width:p,transition:{duration:s.duration}}},initial:"initial",animate:x?"whileInView":"initial"})})}),t.jsxRuntimeExports.jsx(Ve.HighlightArea,{areaSettings:oe,width:p,height:g,scale:a,animate:s,isInView:x}),t.jsxRuntimeExports.jsx(be.CustomArea,{areaSettings:le,scaleX:a,scaleY:o,animate:s,isInView:x}),t.jsxRuntimeExports.jsxs("g",{children:[t.jsxRuntimeExports.jsx(Me.YTicksAndGridLines,{values:Ae.filter(e=>e!==0),y:Ae.filter(e=>e!==0).map(e=>o(e)),x1:0-E,x2:p+R.right,styles:{gridLines:c?.yAxis?.gridLines,labels:c?.yAxis?.labels},classNames:{gridLines:y?.yAxis?.gridLines,labels:y?.yAxis?.labels},suffix:M,prefix:V,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:H}),t.jsxRuntimeExports.jsx(Te.Axis,{y1:o(w<0?0:w),y2:o(w<0?0:w),x1:0-E,x2:p+R.right,label:Ne.numberFormattingFunction(w<0?0:w,"NA",H,V,M),labelPos:{x:0-E,y:o(w<0?0:w),dx:0,dy:Ee<0?"1em":-5},classNames:{axis:y?.xAxis?.axis,label:y?.yAxis?.labels},styles:{axis:c?.xAxis?.axis,label:c?.yAxis?.labels}}),t.jsxRuntimeExports.jsx(De.AxisTitle,{x:0-E-15,y:g/2,style:c?.yAxis?.title,className:y?.yAxis?.title,text:Q,rotate90:!0})]}),t.jsxRuntimeExports.jsx("g",{children:t.jsxRuntimeExports.jsx(qe.XTicksAndGridLines,{values:ke.map(e=>d.format(e,l)),x:ke.map(e=>a(e)),y1:0,y2:g,styles:{gridLines:c?.xAxis?.gridLines,labels:c?.xAxis?.labels},classNames:{gridLines:t.mo("opacity-0",y?.xAxis?.gridLines),labels:t.mo("fill-primary-gray-700 dark:fill-primary-gray-300 xs:max-[360px]:hidden text-[9px] md:text-[10px] lg:text-xs",y?.xAxis?.labels)},suffix:M,prefix:V,labelType:"primary",showGridLines:!0,precision:H})}),Z.filter(e=>e.position==="before").map(e=>e.layer),t.jsxRuntimeExports.jsxs("g",{children:[D.map((e,i)=>t.jsxRuntimeExports.jsxs(T.motion.g,{exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:b.length!==0?b.indexOf(v[i])!==-1?1:S:1},whileInView:{opacity:b.length!==0?b.indexOf(v[i])!==-1?1:S:1,transition:{duration:s.duration}}},initial:"initial",animate:x?"whileInView":"initial",children:[t.jsxRuntimeExports.jsx(T.motion.path,{style:{fill:"none",strokeWidth:pe},clipPath:`url(#${te})`,exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{...B.length===0?{pathLength:0}:{},d:Ce(e.filter(n=>!m.checkIfNullOrUndefined(n.y)))||"",opacity:1,stroke:L[i]},whileInView:{...B.length===0?{pathLength:1}:{},d:Ce(e.filter(n=>!m.checkIfNullOrUndefined(n.y)))||"",opacity:1,stroke:L[i],transition:{duration:s.duration}}},strokeDasharray:B.includes(v[i])?ee[i%ee.length]:void 0,initial:"initial",animate:x?"whileInView":"initial"}),e.map((n,U)=>t.jsxRuntimeExports.jsx("g",{children:m.checkIfNullOrUndefined(n.y)?null:t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[ge?t.jsxRuntimeExports.jsx(T.motion.circle,{r:p/r.length<5?0:p/r.length<20?2:4,style:{fill:L[i]},exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:0,cx:a(n.date),cy:o(n.y)},whileInView:{opacity:1,transition:{duration:O?s.duration:.5,delay:O?0:s.duration},cx:a(n.date),cy:o(n.y)}},initial:"initial",animate:x?"whileInView":"initial"}):null,k?t.jsxRuntimeExports.jsx(T.motion.text,{dy:-8,style:{fill:L[i],textAnchor:"middle",...c?.graphObjectValues||{}},className:t.mo("graph-value text-xs font-bold",y?.graphObjectValues),exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:0,x:a(n.date),y:o(n.y)},whileInView:{opacity:1,x:a(n.date),y:o(n.y),transition:{duration:O?s.duration:.5,delay:O?0:s.duration}}},initial:"initial",animate:x?"whileInView":"initial",children:Ne.numberFormattingFunction(n.y,"NA",H,V,M)}):null]})},U)),me||we.includes(v[i])?null:t.jsxRuntimeExports.jsx(T.motion.text,{style:{fill:L[i]},className:"text-xs",dx:5,dy:4,exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:0,x:a(e[e.length-1].date),y:o(e[e.length-1].y)},whileInView:{opacity:1,x:a(e[e.length-1].date),y:o(e[e.length-1].y),transition:{duration:O?s.duration:.5,delay:O?0:s.duration}}},initial:"initial",animate:x?"whileInView":"initial",children:v[i]})]},v[i])),j?t.jsxRuntimeExports.jsx("line",{y1:0,y2:g,x1:a(j.date),x2:a(j.date),className:t.mo("undp-tick-line stroke-primary-gray-700 dark:stroke-primary-gray-100",y?.mouseOverLine),style:c?.mouseOverLine}):null]}),J?t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:J.map((e,i)=>t.jsxRuntimeExports.jsx($e.RefLineY,{text:e.text,color:e.color,y:o(e.value),x1:0-E,x2:p+R.right,classNames:e.classNames,styles:e.styles,animate:s,isInView:x},i))}):null,t.jsxRuntimeExports.jsx("g",{children:fe.map((e,i)=>{const n=be.getLineEndPoint({x:e.xCoordinate?a(d.parse(`${e.xCoordinate}`,l,new Date))+(e.xOffset||0):0+(e.xOffset||0),y:e.yCoordinate?o(e.yCoordinate)+(e.yOffset||0)-8:0+(e.yOffset||0)-8},{x:e.xCoordinate?a(d.parse(`${e.xCoordinate}`,l,new Date)):0,y:e.yCoordinate?o(e.yCoordinate):0},m.checkIfNullOrUndefined(e.connectorRadius)?3.5:e.connectorRadius),U=e.showConnector?{y1:n.y,x1:n.x,y2:e.yCoordinate?o(e.yCoordinate)+(e.yOffset||0):0+(e.yOffset||0),x2:e.xCoordinate?a(d.parse(`${e.xCoordinate}`,l,new Date))+(e.xOffset||0):0+(e.xOffset||0),cy:e.yCoordinate?o(e.yCoordinate):0,cx:e.xCoordinate?a(d.parse(`${e.xCoordinate}`,l,new Date)):0,circleRadius:m.checkIfNullOrUndefined(e.connectorRadius)?3.5:e.connectorRadius,strokeWidth:e.showConnector===!0?2:Math.min(e.showConnector||0,1)}:void 0,Oe={y:e.yCoordinate?o(e.yCoordinate)+(e.yOffset||0)-8:0+(e.yOffset||0)-8,x:W?0:e.xCoordinate?a(d.parse(`${e.xCoordinate}`,l,new Date))+(e.xOffset||0):0+(e.xOffset||0),width:W?e.xCoordinate?a(d.parse(`${e.xCoordinate}`,l,new Date))+(e.xOffset||0):0+(e.xOffset||0):p-(e.xCoordinate?a(d.parse(`${e.xCoordinate}`,l,new Date))+(e.xOffset||0):0+(e.xOffset||0)),maxWidth:e.maxWidth,fontWeight:e.fontWeight,align:e.align};return t.jsxRuntimeExports.jsx(be.Annotation,{color:e.color,connectorsSettings:U,labelSettings:Oe,text:e.text,classNames:e.classNames,styles:e.styles,animate:s,isInView:x},i)})}),Z.filter(e=>e.position==="after").map(e=>e.layer),t.jsxRuntimeExports.jsx("rect",{ref:z,style:{fill:"none",pointerEvents:"all"},width:p,height:g})]})}),j&&G&&ne&&re?t.jsxRuntimeExports.jsx(Se.Tooltip,{data:j,body:G,xPos:ne,yPos:re,backgroundStyle:c?.tooltip,className:y?.tooltip}):null]})}function Qe(ue){const{data:N,graphTitle:A,lineColors:q=ze.Colors.light.categoricalColors.colors,suffix:L="",sources:l,prefix:de="",graphDescription:v,height:$,width:h,footNote:_,noOfXTicks:M=10,dateFormat:V="yyyy",labels:E,padding:G,showValues:P=!1,backgroundColor:k=!1,leftMargin:me=30,rightMargin:J=50,topMargin:he=20,bottomMargin:F=25,tooltip:K,relativeHeight:b,onSeriesMouseOver:s,showColorLegendAtTop:W=!1,refValues:pe=[],highlightAreaSettings:ge=[],graphID:fe,minValue:ye,maxValue:Q,highlightedLines:je=[],graphDownload:Y=!1,dataDownload:X=!1,animate:I=!1,language:c="en",colorLegendTitle:y,minHeight:S=0,strokeWidth:H=2,showDots:Z=!0,annotations:B=[],customHighlightAreaSettings:ee=[],theme:we="light",ariaLabel:te,yAxisTitle:ie,noOfYTicks:x=5,minDate:O,maxDate:ve,curveType:Re="curve",styles:j,classNames:C,dimmedOpacity:ne=.3,precision:se=2,customLayers:re=[],dashedLines:ae=[],dashSettings:R=["5 5"],labelsToBeHidden:z=[],showColorScale:r=!0}=ue,[D,oe]=f.useState(0),[le,p]=f.useState(0),g=f.useRef(null),ce=f.useRef(null);return f.useEffect(()=>{const u=new ResizeObserver(w=>{oe(h||w[0].target.clientWidth||620),p($||w[0].target.clientHeight||480)});return g.current&&(p(g.current.clientHeight||480),oe(g.current.clientWidth||620),h||u.observe(g.current)),()=>u.disconnect()},[h,$]),t.jsxRuntimeExports.jsx("div",{className:`${we||"light"} flex ${h?"w-fit grow-0":"w-full grow"}`,dir:c==="he"||c==="ar"?"rtl":void 0,children:t.jsxRuntimeExports.jsx("div",{className:t.mo(`${k?k===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${c||"en"}`,C?.graphContainer),style:{...j?.graphContainer||{},...k&&k!==!0?{backgroundColor:k}:{}},id:fe,ref:ce,"aria-label":te||`${A?`The graph shows ${A}. `:""}This is a multi-line chart that shows trends over time.${v?` ${v}`:""}`,children:t.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:k?G||"1rem":G||0},children:t.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[A||v||Y||X?t.jsxRuntimeExports.jsx(Xe.GraphHeader,{styles:{title:j?.title,description:j?.description},classNames:{title:C?.title,description:C?.description},graphTitle:A,graphDescription:v,width:h,graphDownload:Y?ce.current:void 0,dataDownload:X?N.map(u=>u.data).filter(u=>u!==void 0).length>0?N.map(u=>u.data).filter(u=>u!==void 0):N.filter(u=>u!==void 0):null}):null,t.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:N.length===0?t.jsxRuntimeExports.jsx(_e.EmptyState,{}):t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[W&&r?t.jsxRuntimeExports.jsx(Be.ColorLegend,{colorDomain:E,colorLegendTitle:y,labelsToBeHidden:z,colors:q,showNAColor:!1}):null,t.jsxRuntimeExports.jsx("div",{className:"w-full grow leading-0",ref:g,"aria-label":"Graph area",children:(h||D)&&($||le)?t.jsxRuntimeExports.jsx(Ke,{data:N,lineColors:q,width:h||D,height:Math.max(S,$||(b?S?(h||D)*b>S?(h||D)*b:S:(h||D)*b:le)),dateFormat:V,noOfXTicks:M,leftMargin:me,rightMargin:J,topMargin:he,bottomMargin:F,labels:E,tooltip:K,onSeriesMouseOver:s,showColorLegendAtTop:r?W:!0,showValues:P,suffix:L,prefix:de,highlightAreaSettings:ge,refValues:pe,minValue:ye,maxValue:Q,highlightedLines:je,animate:I===!0?{duration:.5,once:!0,amount:.5}:I||{duration:0,once:!0,amount:0},rtl:c==="he"||c==="ar",strokeWidth:H,showDots:Z,annotations:B,customHighlightAreaSettings:ee,yAxisTitle:ie,noOfYTicks:x,minDate:O,maxDate:ve,curveType:Re,styles:j,classNames:C,dimmedOpacity:ne,precision:se,customLayers:re,labelsToBeHidden:z,dashedLines:ae,dashSettings:R,revealClipId:Je.generateRandomString(8)}):null})]})}),l||_?t.jsxRuntimeExports.jsx(Ye.GraphFooter,{styles:{footnote:j?.footnote,source:j?.source},classNames:{footnote:C?.footnote,source:C?.source},sources:l,footNote:_,width:h}):null]})})})})}exports.MultiLineChart=Qe;
2
2
  //# sourceMappingURL=MultiLineChart.cjs.map
@@ -5,22 +5,22 @@ import { s as Mt } from "./index-DxagiOHo.js";
5
5
  import { n as Nt } from "./numberFormattingFunction-14YCbkN2.js";
6
6
  import { T as St } from "./Tooltip-DyM5snqx.js";
7
7
  import { c as d } from "./checkIfNullOrUndefined-DmfiKkNw.js";
8
- import { C as Vt, g as It, A as Ht } from "./customArea-CaxScFmW.js";
8
+ import { C as Vt, g as It, A as Ht } from "./customArea-B-dWU0zZ.js";
9
9
  import { A as Rt } from "./AxisTitle-BmHLMRJZ.js";
10
10
  import { A as Ft } from "./Axis-Ddg-seDi.js";
11
11
  import { X as Wt } from "./XTicksAndGridLines-Bn9u5gOM.js";
12
- import { R as Pt } from "./ReferenceLine-C1GpoG9d.js";
12
+ import { R as Pt } from "./ReferenceLine-CfAW3vKJ.js";
13
13
  import { Y as Yt } from "./YTicksAndGridLines-B6ah7CRf.js";
14
- import { H as Xt } from "./index-n_RI8T0n.js";
15
- import { u as Et } from "./use-in-view-BAHrBy6b.js";
16
- import { t as Gt } from "./time-BzJP5SPC.js";
17
- import { a as Bt } from "./linear-DUdu7l2G.js";
18
- import { l as zt, c as Ut } from "./line-CPfhohvF.js";
19
- import { c as _t, s as qt, a as Jt, m as Kt } from "./step-BrDul-H4.js";
20
- import { s as Qt } from "./select-DKy99ogv.js";
21
- import { m as S } from "./proxy-DJxJg1kD.js";
22
- import { a as Zt } from "./init-BhZylTFx.js";
23
- import { p as te } from "./pointer-CWRWOsrb.js";
14
+ import { H as Xt } from "./index-Cdcfp4nk.js";
15
+ import { t as Et } from "./time-BzJP5SPC.js";
16
+ import { a as Gt } from "./linear-DUdu7l2G.js";
17
+ import { l as Bt, c as zt } from "./line-CPfhohvF.js";
18
+ import { c as Ut, s as _t, a as qt, m as Jt } from "./step-BrDul-H4.js";
19
+ import { s as Kt } from "./select-DKy99ogv.js";
20
+ import { a as Qt } from "./init-BhZylTFx.js";
21
+ import { p as Zt } from "./pointer-CWRWOsrb.js";
22
+ import { u as te } from "./use-in-view-yS6jzJAp.js";
23
+ import { m as S } from "./proxy-CkpFesk1.js";
24
24
  import { GraphFooter as ee } from "./GraphFooter.js";
25
25
  import { GraphHeader as ie } from "./GraphHeader.js";
26
26
  import { ColorLegend as ae } from "./ColorLegend.js";
@@ -71,7 +71,7 @@ function re(dt) {
71
71
  dashSettings: et,
72
72
  labelsToBeHidden: jt,
73
73
  revealClipId: it
74
- } = dt, at = ht(null), m = Et(at, {
74
+ } = dt, at = ht(null), m = te(at, {
75
75
  once: o.once,
76
76
  amount: o.amount
77
77
  }), [b, Ct] = Y(!1);
@@ -86,7 +86,7 @@ function re(dt) {
86
86
  return () => clearTimeout(t);
87
87
  }
88
88
  }, [m, b, o.duration]);
89
- const bt = N === "linear" ? Ut : N === "step" ? _t : N === "stepAfter" ? qt : N === "stepBefore" ? Jt : Kt, [y, O] = Y(void 0), [ot, nt] = Y(void 0), [st, rt] = Y(void 0), j = {
89
+ const bt = N === "linear" ? zt : N === "step" ? Ut : N === "stepAfter" ? _t : N === "stepBefore" ? qt : Jt, [y, O] = Y(void 0), [ot, nt] = Y(void 0), [st, rt] = Y(void 0), j = {
90
90
  top: x,
91
91
  bottom: J,
92
92
  left: Z ? C + 30 : C,
@@ -131,22 +131,22 @@ function re(dt) {
131
131
  ...n.map(
132
132
  (t) => Math.max(...t.y.filter((i) => !d(i)))
133
133
  )
134
- ) : 0, s = Gt().domain([mt, h]).range([0, g]), r = Bt().domain([
134
+ ) : 0, s = Et().domain([mt, h]).range([0, g]), r = Gt().domain([
135
135
  d(F) ? w : F,
136
136
  d(Q) ? At > 0 ? At : 0 : Q
137
- ]).range([u, 0]).nice(), Lt = zt().x((t) => s(t.date)).y((t) => r(t.y)).curve(bt), Tt = r.ticks(vt), $t = s.ticks(xt);
137
+ ]).range([u, 0]).nice(), Lt = Bt().x((t) => s(t.date)).y((t) => r(t.y)).curve(bt), Tt = r.ticks(vt), $t = s.ticks(xt);
138
138
  return Dt(() => {
139
139
  const t = (a) => {
140
- const P = n[Zt(
140
+ const P = n[Qt(
141
141
  n.map((Ot) => Ot.date),
142
- s.invert(te(a)[0]),
142
+ s.invert(Zt(a)[0]),
143
143
  1
144
144
  )];
145
145
  O(P || n[n.length - 1]), rt(a.clientY), nt(a.clientX), E?.(P || n[n.length - 1]);
146
146
  }, i = () => {
147
147
  O(void 0), nt(void 0), rt(void 0);
148
148
  };
149
- Qt(_.current).on("mousemove", t).on("mouseout", i), E?.(void 0);
149
+ Kt(_.current).on("mousemove", t).on("mouseout", i), E?.(void 0);
150
150
  }, [s, n, E]), /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
151
151
  /* @__PURE__ */ e.jsx(
152
152
  S.svg,
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-CHPV5EwG-DDoeWRVt.cjs"),y=require("react"),dt=require("./index-BXns0-ng.cjs"),vt=require("./Modal-C_dl0EtQ.cjs"),at=require("./numberFormattingFunction-02t-wJta.cjs"),wt=require("./Tooltip-n8z5bfav.cjs"),Et=require("./string2HTML-D2Avudmb.cjs"),mt=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),ht=require("./Axis-DE7dSn1_.cjs"),gt=require("./AxisTitle-CK9YeovX.cjs"),Rt=require("./XAxesLabels-CJMQbfVy.cjs"),At=require("./use-in-view-BCmzDU2O.cjs"),Mt=require("./band-CAApY4Pd.cjs"),ft=require("./linear-BVckp9RD.cjs"),yt=require("./line-DHV4JwCR.cjs"),rt=require("./step-BZ3C8QFW.cjs"),P=require("./proxy-PQd2AItT.cjs"),Ct=require("./index-DVOJ7vxH.cjs"),Nt=require("./GraphFooter.cjs"),kt=require("./GraphHeader.cjs"),$t=require("./ColorLegend.cjs"),ot=require("./Colors.cjs"),St=require("./EmptyState-d8_8SxeW.cjs");function qt(lt){const{data:S,width:R,height:V,barColor:d,lineColor:h,axisTitles:n,sameAxes:j,rightMargin:G,leftMargin:B,topMargin:U,bottomMargin:xt,tooltip:b,showValues:z,onSeriesMouseOver:D,barPadding:ct,truncateBy:_,showLabels:J,onSeriesMouseClick:v,resetSelectionOnDoubleClick:K,detailsOnClick:p,noOfTicks:Q,lineSuffix:Z,barSuffix:X,linePrefix:W,barPrefix:tt,curveType:F,styles:o,classNames:l,animate:a,precision:H,customLayers:q,naLabel:A}=lt,et=y.useRef(null),M=At.useInView(et,{once:a.once,amount:a.amount}),ut=F==="linear"?yt.curveLinear:F==="step"?rt.curveStep:F==="stepAfter"?rt.stepAfter:F==="stepBefore"?rt.stepBefore:rt.monotoneX,[it,C]=y.useState(void 0),[N,I]=y.useState(void 0),[st,k]=y.useState(void 0),[nt,u]=y.useState(void 0),r={top:U,bottom:xt,left:B+50,right:G+65},m=R-r.left-r.right,g=V-r.top-r.bottom,s=S.map((t,E)=>({...t,id:`${E}`})),x=Mt.band().domain(s.map(t=>`${t.id}`)).range([0,m]).paddingInner(ct),w=Math.min(...s.map(t=>t.bar).filter(t=>t!=null))!==1/0?Math.min(...s.map(t=>t.bar).filter(t=>t!=null))>0?0:Math.min(...s.map(t=>t.bar).filter(t=>t!=null)):0,Y=Math.min(...s.map(t=>t.line).filter(t=>t!=null))!==1/0?Math.min(...s.map(t=>t.line).filter(t=>t!=null))>0?0:Math.min(...s.map(t=>t.line).filter(t=>t!=null)):0,L=Math.max(...s.map(t=>t.bar).filter(t=>t!=null))!==1/0?Math.max(...s.map(t=>t.bar).filter(t=>t!=null)):0,T=Math.max(...s.map(t=>t.line).filter(t=>t!=null))!==1/0?Math.max(...s.map(t=>t.line).filter(t=>t!=null)):0,$=w<Y?w:Y,O=L>T?L:T,i=ft.linear().domain([j?$:w,j?O>0?O:0:L>0?L:0]).range([g,0]).nice(),c=ft.linear().domain([j?$:Y,j?O>0?O:0:T>0?T:0]).range([g,0]).nice(),pt=yt.line().defined(t=>!mt.checkIfNullOrUndefined(t.line)).x(t=>x(`${t.id}`)+x.bandwidth()/2).y(t=>c(t.line)).curve(ut),jt=i.ticks(Q),bt=c.ticks(Q);return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(P.motion.svg,{width:`${R}px`,height:`${V}px`,viewBox:`0 0 ${R} ${V}`,direction:"ltr",ref:et,children:e.jsxRuntimeExports.jsxs("g",{transform:`translate(${r.left},${r.top})`,children:[e.jsxRuntimeExports.jsxs("g",{children:[jt.map((t,E)=>e.jsxRuntimeExports.jsxs("g",{children:[e.jsxRuntimeExports.jsx("line",{y1:i(t),y2:i(t),x1:-15,x2:-20,style:{stroke:d,strokeWidth:1,...o?.yAxis?.gridLines||{}},className:l?.yAxis?.gridLines}),e.jsxRuntimeExports.jsx("text",{x:-25,y:i(t),dy:"0.33em",className:e.mo("text-xs",l?.yAxis?.labels),style:{textAnchor:"end",fill:d,...o?.yAxis?.labels||{}},children:at.numberFormattingFunction(t,A,H,tt,X)})]},E)),e.jsxRuntimeExports.jsx(ht.Axis,{y1:0,y2:g,x1:-15,x2:-15,classNames:{axis:l?.xAxis?.axis},styles:{axis:{stroke:d,...o?.xAxis?.axis||{}}}}),e.jsxRuntimeExports.jsx(gt.AxisTitle,{x:10-r.left,y:g/2,style:{fill:d,...o?.yAxis?.title||{}},className:l?.yAxis?.title,text:n[0].length>100?`${n[0].substring(0,100)}...`:n[0],rotate90:!0})]}),e.jsxRuntimeExports.jsxs("g",{children:[bt.map((t,E)=>e.jsxRuntimeExports.jsxs("g",{children:[e.jsxRuntimeExports.jsx("line",{y1:c(t),y2:c(t),x1:m+15,x2:m+20,style:{stroke:h,strokeWidth:1,...o?.yAxis?.gridLines||{}},className:l?.yAxis?.gridLines}),e.jsxRuntimeExports.jsx("text",{x:m+25,y:c(t),dy:"0.33em",dx:-2,style:{textAnchor:"start",fill:h,...o?.yAxis?.labels||{}},className:e.mo("text-xs",l?.yAxis?.labels),children:at.numberFormattingFunction(t,A,H,W,Z)})]},E)),e.jsxRuntimeExports.jsx(ht.Axis,{y1:0,y2:g,x1:m+15,x2:m+15,classNames:{axis:l?.xAxis?.axis},styles:{axis:{stroke:h,...o?.xAxis?.axis||{}}}}),e.jsxRuntimeExports.jsx(gt.AxisTitle,{x:m+r.right-15,y:g/2,style:{fill:h,...o?.yAxis?.title||{}},className:l?.yAxis?.title,text:n[1].length>100?`${n[1].substring(0,100)}...`:n[1],rotate90:!0})]}),e.jsxRuntimeExports.jsx(ht.Axis,{y1:j?i(0):g,y2:j?i(0):g,x1:-15,x2:m+15,classNames:{axis:l?.xAxis?.axis},styles:{axis:o?.xAxis?.axis}}),q.filter(t=>t.position==="before").map(t=>t.layer),e.jsxRuntimeExports.jsxs(Ct.AnimatePresence,{children:[s.map((t,E)=>e.jsxRuntimeExports.jsxs(P.motion.g,{className:"undp-viz-g-with-hover",opacity:.85,onMouseEnter:f=>{C(t),u(f.clientY),k(f.clientX),D?.(t)},onClick:()=>{(v||p)&&(dt.isEqual(N,t)&&K?(I(void 0),v?.(void 0)):(I(t),v?.(t)))},onMouseMove:f=>{C(t),u(f.clientY),k(f.clientX)},onMouseLeave:()=>{C(void 0),k(void 0),u(void 0),D?.(void 0)},children:[e.jsxRuntimeExports.jsx(P.motion.rect,{variants:{initial:{attrY:i(0),height:0,opacity:1},whileInView:{attrY:t.bar?t.bar>0?i(t.bar):i(0):0,height:t.bar?Math.abs(i(t.bar)-i(0)):0,opacity:1,transition:{duration:a.duration}}},initial:"initial",animate:M?"whileInView":"initial",exit:{attrY:i(0),height:0,opacity:0,transition:{duration:a.duration}},x:x(`${E}`),width:x.bandwidth(),style:{fill:d}}),z&&!mt.checkIfNullOrUndefined(t.bar)?e.jsxRuntimeExports.jsx(P.motion.text,{x:x(`${t.id}`)+x.bandwidth()/2,exit:{attrY:i(0),opacity:0,transition:{duration:a.duration}},variants:{initial:{attrY:i(0),opacity:0},whileInView:{attrY:i(t.bar||0),opacity:1,transition:{duration:a.duration}}},initial:"initial",animate:M?"whileInView":"initial",style:{fill:d,textAnchor:"middle",...o?.graphObjectValues||{}},className:e.mo("graph-value text-sm",l?.graphObjectValues),dy:t.bar?t.bar>=0?"-5px":"1em":"-5px",children:at.numberFormattingFunction(t.bar,A,H,tt,X)}):null,J?e.jsxRuntimeExports.jsx(Rt.XAxesLabels,{value:`${t.label}`.length<_?`${t.label}`:`${`${t.label}`.substring(0,_)}...`,y:g+5,x:x(`${t.id}`),width:x.bandwidth(),height:r.bottom,style:o?.xAxis?.labels,className:l?.xAxis?.labels,alignment:"top",animate:a,isInView:M}):null]},t.label)),e.jsxRuntimeExports.jsx(P.motion.path,{exit:{opacity:0,transition:{duration:a.duration}},variants:{initial:{d:pt(s.map(t=>({...t,line:0}))),opacity:0},whileInView:{d:pt(s),opacity:1,transition:{duration:a.duration}}},initial:"initial",animate:M?"whileInView":"initial",style:{stroke:h,fill:"none",strokeWidth:2}}),s.map((t,E)=>e.jsxRuntimeExports.jsx("g",{children:mt.checkIfNullOrUndefined(t.line)?null:e.jsxRuntimeExports.jsxs("g",{onMouseEnter:f=>{C(t),u(f.clientY),k(f.clientX),D?.(t)},onClick:()=>{(v||p)&&(dt.isEqual(N,t)&&K?(I(void 0),v?.(void 0)):(I(t),v?.(t)))},onMouseMove:f=>{C(t),u(f.clientY),k(f.clientX)},onMouseLeave:()=>{C(void 0),k(void 0),u(void 0),D?.(void 0)},children:[e.jsxRuntimeExports.jsx(P.motion.circle,{exit:{cy:c(0),opacity:0,transition:{duration:a.duration}},variants:{initial:{cy:c(0),opacity:0},whileInView:{cy:c(t.line),opacity:1,transition:{duration:a.duration}}},initial:"initial",animate:M?"whileInView":"initial",cx:x(t.id)+x.bandwidth()/2,r:m/s.length<5?0:m/s.length<20?2:4,style:{fill:h}}),z?e.jsxRuntimeExports.jsx(P.motion.text,{x:x(`${t.id}`)+x.bandwidth()/2,exit:{y:c(0),opacity:0,transition:{duration:a.duration}},style:{fill:h,textAnchor:"middle",...o?.graphObjectValues||{}},variants:{initial:{y:c(0),opacity:0},whileInView:{y:c(t.line),opacity:1,transition:{duration:a.duration}}},initial:"initial",animate:M?"whileInView":"initial",className:e.mo("graph-value text-sm",l?.graphObjectValues),dy:"-5px",children:at.numberFormattingFunction(t.line,A,H,W,Z)}):null]})},E))]}),q.filter(t=>t.position==="after").map(t=>t.layer)]})}),it&&b&&st&&nt?e.jsxRuntimeExports.jsx(wt.Tooltip,{data:it,body:b,xPos:st,yPos:nt,backgroundStyle:o?.tooltip,className:l?.tooltip}):null,p&&N!==void 0?e.jsxRuntimeExports.jsx(vt.X,{open:N!==void 0,onClose:()=>{I(void 0)},children:e.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof p=="string"?{__html:Et.string2HTML(p,N)}:void 0,children:typeof p=="function"?p(N):null})}):null]})}function It(lt){const{data:S,graphTitle:R,sources:V,graphDescription:d,height:h,width:n,footNote:j,padding:G,lineColor:B=ot.Colors.light.categoricalColors.colors[1],barColor:U=ot.Colors.light.categoricalColors.colors[0],sameAxes:xt=!1,backgroundColor:b=!1,leftMargin:z=80,rightMargin:D=80,topMargin:ct=20,bottomMargin:_=25,lineAxisTitle:J="Line chart",barAxisTitle:v="Bar graph",tooltip:K,relativeHeight:p,onSeriesMouseOver:Q,graphID:Z,graphDownload:X=!1,dataDownload:W=!1,barPadding:tt=.25,truncateBy:F=999,showLabels:o=!0,onSeriesMouseClick:l,language:a="en",colorLegendTitle:H,minHeight:q=0,theme:A="light",ariaLabel:et,resetSelectionOnDoubleClick:M=!0,detailsOnClick:ut,showValues:it=!0,noOfTicks:C=5,lineSuffix:N="",barSuffix:I="",linePrefix:st="",barPrefix:k="",curveType:nt="curve",styles:u,classNames:r,animate:m=!1,precision:g=2,customLayers:s=[],naLabel:x="NA"}=lt,[w,Y]=y.useState(0),[L,T]=y.useState(0),$=y.useRef(null),O=y.useRef(null);return y.useEffect(()=>{const i=new ResizeObserver(c=>{Y(n||c[0].target.clientWidth||620),T(h||c[0].target.clientHeight||480)});return $.current&&(T($.current.clientHeight||480),Y($.current.clientWidth||620),n||i.observe($.current)),()=>i.disconnect()},[n,h]),e.jsxRuntimeExports.jsx("div",{className:`${A||"light"} flex ${n?"w-fit grow-0":"w-full grow"}`,dir:a==="he"||a==="ar"?"rtl":void 0,children:e.jsxRuntimeExports.jsx("div",{className:e.mo(`${b?b===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${a||"en"}`,r?.graphContainer),style:{...u?.graphContainer||{},...b&&b!==!0?{backgroundColor:b}:{}},id:Z,ref:O,"aria-label":et||`${R?`The graph shows ${R}. `:""}This is a pareto chart that shows a variable as bars and another as line chart.${d?` ${d}`:""}`,children:e.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:b?G||"1rem":G||0},children:e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[R||d||X||W?e.jsxRuntimeExports.jsx(kt.GraphHeader,{styles:{title:u?.title,description:u?.description},classNames:{title:r?.title,description:r?.description},graphTitle:R,graphDescription:d,width:n,graphDownload:X?O.current:void 0,dataDownload:W?S.map(i=>i.data).filter(i=>i!==void 0).length>0?S.map(i=>i.data).filter(i=>i!==void 0):S.filter(i=>i!==void 0):null}):null,e.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:S.length===0?e.jsxRuntimeExports.jsx(St.EmptyState,{}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx($t.ColorLegend,{colorDomain:[v,J],colors:[U||ot.Colors[A].categoricalColors.colors[0],B||ot.Colors[A].categoricalColors.colors[1]],colorLegendTitle:H,showNAColor:!1}),e.jsxRuntimeExports.jsx("div",{className:"flex flex-col grow justify-center leading-0",ref:$,"aria-label":"Graph area",children:(n||w)&&(h||L)?e.jsxRuntimeExports.jsx(qt,{data:S,sameAxes:xt,lineColor:B,barColor:U,width:n||w,height:Math.max(q,h||(p?q?(n||w)*p>q?(n||w)*p:q:(n||w)*p:L)),truncateBy:F,leftMargin:z,rightMargin:D,topMargin:ct,bottomMargin:_,axisTitles:[v,J],tooltip:K,onSeriesMouseOver:Q,barPadding:tt,showLabels:o,onSeriesMouseClick:l,resetSelectionOnDoubleClick:M,detailsOnClick:ut,noOfTicks:C,lineSuffix:N,barSuffix:I,linePrefix:st,barPrefix:k,curveType:nt,showValues:it,styles:u,classNames:r,animate:m===!0?{duration:.5,once:!0,amount:.5}:m||{duration:0,once:!0,amount:0},precision:g,customLayers:s,naLabel:x}):null})]})}),V||j?e.jsxRuntimeExports.jsx(Nt.GraphFooter,{styles:{footnote:u?.footnote,source:u?.source},classNames:{footnote:r?.footnote,source:r?.source},sources:V,footNote:j,width:n}):null]})})})})}exports.ParetoChart=It;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-CHPV5EwG-DDoeWRVt.cjs"),y=require("react"),dt=require("./index-BXns0-ng.cjs"),vt=require("./Modal-tXZlLE5s.cjs"),at=require("./numberFormattingFunction-02t-wJta.cjs"),wt=require("./Tooltip-n8z5bfav.cjs"),Et=require("./string2HTML-D2Avudmb.cjs"),mt=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),ht=require("./Axis-DE7dSn1_.cjs"),gt=require("./AxisTitle-CK9YeovX.cjs"),Rt=require("./XAxesLabels-OjBNl_lS.cjs"),At=require("./band-CAApY4Pd.cjs"),ft=require("./linear-BVckp9RD.cjs"),yt=require("./line-DHV4JwCR.cjs"),rt=require("./step-BZ3C8QFW.cjs"),Mt=require("./use-in-view-sQJZ_xDO.cjs"),P=require("./proxy-BHRoeZgd.cjs"),Ct=require("./index-BW8iNx7E.cjs"),Nt=require("./GraphFooter.cjs"),kt=require("./GraphHeader.cjs"),$t=require("./ColorLegend.cjs"),ot=require("./Colors.cjs"),St=require("./EmptyState-d8_8SxeW.cjs");function qt(lt){const{data:S,width:R,height:V,barColor:d,lineColor:h,axisTitles:n,sameAxes:j,rightMargin:G,leftMargin:B,topMargin:U,bottomMargin:xt,tooltip:b,showValues:z,onSeriesMouseOver:D,barPadding:ct,truncateBy:_,showLabels:J,onSeriesMouseClick:v,resetSelectionOnDoubleClick:K,detailsOnClick:p,noOfTicks:Q,lineSuffix:Z,barSuffix:X,linePrefix:W,barPrefix:tt,curveType:F,styles:o,classNames:l,animate:a,precision:H,customLayers:q,naLabel:A}=lt,et=y.useRef(null),M=Mt.useInView(et,{once:a.once,amount:a.amount}),ut=F==="linear"?yt.curveLinear:F==="step"?rt.curveStep:F==="stepAfter"?rt.stepAfter:F==="stepBefore"?rt.stepBefore:rt.monotoneX,[it,C]=y.useState(void 0),[N,I]=y.useState(void 0),[st,k]=y.useState(void 0),[nt,u]=y.useState(void 0),r={top:U,bottom:xt,left:B+50,right:G+65},m=R-r.left-r.right,g=V-r.top-r.bottom,s=S.map((t,E)=>({...t,id:`${E}`})),x=At.band().domain(s.map(t=>`${t.id}`)).range([0,m]).paddingInner(ct),w=Math.min(...s.map(t=>t.bar).filter(t=>t!=null))!==1/0?Math.min(...s.map(t=>t.bar).filter(t=>t!=null))>0?0:Math.min(...s.map(t=>t.bar).filter(t=>t!=null)):0,Y=Math.min(...s.map(t=>t.line).filter(t=>t!=null))!==1/0?Math.min(...s.map(t=>t.line).filter(t=>t!=null))>0?0:Math.min(...s.map(t=>t.line).filter(t=>t!=null)):0,L=Math.max(...s.map(t=>t.bar).filter(t=>t!=null))!==1/0?Math.max(...s.map(t=>t.bar).filter(t=>t!=null)):0,T=Math.max(...s.map(t=>t.line).filter(t=>t!=null))!==1/0?Math.max(...s.map(t=>t.line).filter(t=>t!=null)):0,$=w<Y?w:Y,O=L>T?L:T,i=ft.linear().domain([j?$:w,j?O>0?O:0:L>0?L:0]).range([g,0]).nice(),c=ft.linear().domain([j?$:Y,j?O>0?O:0:T>0?T:0]).range([g,0]).nice(),pt=yt.line().defined(t=>!mt.checkIfNullOrUndefined(t.line)).x(t=>x(`${t.id}`)+x.bandwidth()/2).y(t=>c(t.line)).curve(ut),jt=i.ticks(Q),bt=c.ticks(Q);return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(P.motion.svg,{width:`${R}px`,height:`${V}px`,viewBox:`0 0 ${R} ${V}`,direction:"ltr",ref:et,children:e.jsxRuntimeExports.jsxs("g",{transform:`translate(${r.left},${r.top})`,children:[e.jsxRuntimeExports.jsxs("g",{children:[jt.map((t,E)=>e.jsxRuntimeExports.jsxs("g",{children:[e.jsxRuntimeExports.jsx("line",{y1:i(t),y2:i(t),x1:-15,x2:-20,style:{stroke:d,strokeWidth:1,...o?.yAxis?.gridLines||{}},className:l?.yAxis?.gridLines}),e.jsxRuntimeExports.jsx("text",{x:-25,y:i(t),dy:"0.33em",className:e.mo("text-xs",l?.yAxis?.labels),style:{textAnchor:"end",fill:d,...o?.yAxis?.labels||{}},children:at.numberFormattingFunction(t,A,H,tt,X)})]},E)),e.jsxRuntimeExports.jsx(ht.Axis,{y1:0,y2:g,x1:-15,x2:-15,classNames:{axis:l?.xAxis?.axis},styles:{axis:{stroke:d,...o?.xAxis?.axis||{}}}}),e.jsxRuntimeExports.jsx(gt.AxisTitle,{x:10-r.left,y:g/2,style:{fill:d,...o?.yAxis?.title||{}},className:l?.yAxis?.title,text:n[0].length>100?`${n[0].substring(0,100)}...`:n[0],rotate90:!0})]}),e.jsxRuntimeExports.jsxs("g",{children:[bt.map((t,E)=>e.jsxRuntimeExports.jsxs("g",{children:[e.jsxRuntimeExports.jsx("line",{y1:c(t),y2:c(t),x1:m+15,x2:m+20,style:{stroke:h,strokeWidth:1,...o?.yAxis?.gridLines||{}},className:l?.yAxis?.gridLines}),e.jsxRuntimeExports.jsx("text",{x:m+25,y:c(t),dy:"0.33em",dx:-2,style:{textAnchor:"start",fill:h,...o?.yAxis?.labels||{}},className:e.mo("text-xs",l?.yAxis?.labels),children:at.numberFormattingFunction(t,A,H,W,Z)})]},E)),e.jsxRuntimeExports.jsx(ht.Axis,{y1:0,y2:g,x1:m+15,x2:m+15,classNames:{axis:l?.xAxis?.axis},styles:{axis:{stroke:h,...o?.xAxis?.axis||{}}}}),e.jsxRuntimeExports.jsx(gt.AxisTitle,{x:m+r.right-15,y:g/2,style:{fill:h,...o?.yAxis?.title||{}},className:l?.yAxis?.title,text:n[1].length>100?`${n[1].substring(0,100)}...`:n[1],rotate90:!0})]}),e.jsxRuntimeExports.jsx(ht.Axis,{y1:j?i(0):g,y2:j?i(0):g,x1:-15,x2:m+15,classNames:{axis:l?.xAxis?.axis},styles:{axis:o?.xAxis?.axis}}),q.filter(t=>t.position==="before").map(t=>t.layer),e.jsxRuntimeExports.jsxs(Ct.AnimatePresence,{children:[s.map((t,E)=>e.jsxRuntimeExports.jsxs(P.motion.g,{className:"undp-viz-g-with-hover",opacity:.85,onMouseEnter:f=>{C(t),u(f.clientY),k(f.clientX),D?.(t)},onClick:()=>{(v||p)&&(dt.isEqual(N,t)&&K?(I(void 0),v?.(void 0)):(I(t),v?.(t)))},onMouseMove:f=>{C(t),u(f.clientY),k(f.clientX)},onMouseLeave:()=>{C(void 0),k(void 0),u(void 0),D?.(void 0)},children:[e.jsxRuntimeExports.jsx(P.motion.rect,{variants:{initial:{attrY:i(0),height:0,opacity:1},whileInView:{attrY:t.bar?t.bar>0?i(t.bar):i(0):0,height:t.bar?Math.abs(i(t.bar)-i(0)):0,opacity:1,transition:{duration:a.duration}}},initial:"initial",animate:M?"whileInView":"initial",exit:{attrY:i(0),height:0,opacity:0,transition:{duration:a.duration}},x:x(`${E}`),width:x.bandwidth(),style:{fill:d}}),z&&!mt.checkIfNullOrUndefined(t.bar)?e.jsxRuntimeExports.jsx(P.motion.text,{x:x(`${t.id}`)+x.bandwidth()/2,exit:{attrY:i(0),opacity:0,transition:{duration:a.duration}},variants:{initial:{attrY:i(0),opacity:0},whileInView:{attrY:i(t.bar||0),opacity:1,transition:{duration:a.duration}}},initial:"initial",animate:M?"whileInView":"initial",style:{fill:d,textAnchor:"middle",...o?.graphObjectValues||{}},className:e.mo("graph-value text-sm",l?.graphObjectValues),dy:t.bar?t.bar>=0?"-5px":"1em":"-5px",children:at.numberFormattingFunction(t.bar,A,H,tt,X)}):null,J?e.jsxRuntimeExports.jsx(Rt.XAxesLabels,{value:`${t.label}`.length<_?`${t.label}`:`${`${t.label}`.substring(0,_)}...`,y:g+5,x:x(`${t.id}`),width:x.bandwidth(),height:r.bottom,style:o?.xAxis?.labels,className:l?.xAxis?.labels,alignment:"top",animate:a,isInView:M}):null]},t.label)),e.jsxRuntimeExports.jsx(P.motion.path,{exit:{opacity:0,transition:{duration:a.duration}},variants:{initial:{d:pt(s.map(t=>({...t,line:0}))),opacity:0},whileInView:{d:pt(s),opacity:1,transition:{duration:a.duration}}},initial:"initial",animate:M?"whileInView":"initial",style:{stroke:h,fill:"none",strokeWidth:2}}),s.map((t,E)=>e.jsxRuntimeExports.jsx("g",{children:mt.checkIfNullOrUndefined(t.line)?null:e.jsxRuntimeExports.jsxs("g",{onMouseEnter:f=>{C(t),u(f.clientY),k(f.clientX),D?.(t)},onClick:()=>{(v||p)&&(dt.isEqual(N,t)&&K?(I(void 0),v?.(void 0)):(I(t),v?.(t)))},onMouseMove:f=>{C(t),u(f.clientY),k(f.clientX)},onMouseLeave:()=>{C(void 0),k(void 0),u(void 0),D?.(void 0)},children:[e.jsxRuntimeExports.jsx(P.motion.circle,{exit:{cy:c(0),opacity:0,transition:{duration:a.duration}},variants:{initial:{cy:c(0),opacity:0},whileInView:{cy:c(t.line),opacity:1,transition:{duration:a.duration}}},initial:"initial",animate:M?"whileInView":"initial",cx:x(t.id)+x.bandwidth()/2,r:m/s.length<5?0:m/s.length<20?2:4,style:{fill:h}}),z?e.jsxRuntimeExports.jsx(P.motion.text,{x:x(`${t.id}`)+x.bandwidth()/2,exit:{y:c(0),opacity:0,transition:{duration:a.duration}},style:{fill:h,textAnchor:"middle",...o?.graphObjectValues||{}},variants:{initial:{y:c(0),opacity:0},whileInView:{y:c(t.line),opacity:1,transition:{duration:a.duration}}},initial:"initial",animate:M?"whileInView":"initial",className:e.mo("graph-value text-sm",l?.graphObjectValues),dy:"-5px",children:at.numberFormattingFunction(t.line,A,H,W,Z)}):null]})},E))]}),q.filter(t=>t.position==="after").map(t=>t.layer)]})}),it&&b&&st&&nt?e.jsxRuntimeExports.jsx(wt.Tooltip,{data:it,body:b,xPos:st,yPos:nt,backgroundStyle:o?.tooltip,className:l?.tooltip}):null,p&&N!==void 0?e.jsxRuntimeExports.jsx(vt.X,{open:N!==void 0,onClose:()=>{I(void 0)},children:e.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof p=="string"?{__html:Et.string2HTML(p,N)}:void 0,children:typeof p=="function"?p(N):null})}):null]})}function It(lt){const{data:S,graphTitle:R,sources:V,graphDescription:d,height:h,width:n,footNote:j,padding:G,lineColor:B=ot.Colors.light.categoricalColors.colors[1],barColor:U=ot.Colors.light.categoricalColors.colors[0],sameAxes:xt=!1,backgroundColor:b=!1,leftMargin:z=80,rightMargin:D=80,topMargin:ct=20,bottomMargin:_=25,lineAxisTitle:J="Line chart",barAxisTitle:v="Bar graph",tooltip:K,relativeHeight:p,onSeriesMouseOver:Q,graphID:Z,graphDownload:X=!1,dataDownload:W=!1,barPadding:tt=.25,truncateBy:F=999,showLabels:o=!0,onSeriesMouseClick:l,language:a="en",colorLegendTitle:H,minHeight:q=0,theme:A="light",ariaLabel:et,resetSelectionOnDoubleClick:M=!0,detailsOnClick:ut,showValues:it=!0,noOfTicks:C=5,lineSuffix:N="",barSuffix:I="",linePrefix:st="",barPrefix:k="",curveType:nt="curve",styles:u,classNames:r,animate:m=!1,precision:g=2,customLayers:s=[],naLabel:x="NA"}=lt,[w,Y]=y.useState(0),[L,T]=y.useState(0),$=y.useRef(null),O=y.useRef(null);return y.useEffect(()=>{const i=new ResizeObserver(c=>{Y(n||c[0].target.clientWidth||620),T(h||c[0].target.clientHeight||480)});return $.current&&(T($.current.clientHeight||480),Y($.current.clientWidth||620),n||i.observe($.current)),()=>i.disconnect()},[n,h]),e.jsxRuntimeExports.jsx("div",{className:`${A||"light"} flex ${n?"w-fit grow-0":"w-full grow"}`,dir:a==="he"||a==="ar"?"rtl":void 0,children:e.jsxRuntimeExports.jsx("div",{className:e.mo(`${b?b===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${a||"en"}`,r?.graphContainer),style:{...u?.graphContainer||{},...b&&b!==!0?{backgroundColor:b}:{}},id:Z,ref:O,"aria-label":et||`${R?`The graph shows ${R}. `:""}This is a pareto chart that shows a variable as bars and another as line chart.${d?` ${d}`:""}`,children:e.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:b?G||"1rem":G||0},children:e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[R||d||X||W?e.jsxRuntimeExports.jsx(kt.GraphHeader,{styles:{title:u?.title,description:u?.description},classNames:{title:r?.title,description:r?.description},graphTitle:R,graphDescription:d,width:n,graphDownload:X?O.current:void 0,dataDownload:W?S.map(i=>i.data).filter(i=>i!==void 0).length>0?S.map(i=>i.data).filter(i=>i!==void 0):S.filter(i=>i!==void 0):null}):null,e.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:S.length===0?e.jsxRuntimeExports.jsx(St.EmptyState,{}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx($t.ColorLegend,{colorDomain:[v,J],colors:[U||ot.Colors[A].categoricalColors.colors[0],B||ot.Colors[A].categoricalColors.colors[1]],colorLegendTitle:H,showNAColor:!1}),e.jsxRuntimeExports.jsx("div",{className:"flex flex-col grow justify-center leading-0",ref:$,"aria-label":"Graph area",children:(n||w)&&(h||L)?e.jsxRuntimeExports.jsx(qt,{data:S,sameAxes:xt,lineColor:B,barColor:U,width:n||w,height:Math.max(q,h||(p?q?(n||w)*p>q?(n||w)*p:q:(n||w)*p:L)),truncateBy:F,leftMargin:z,rightMargin:D,topMargin:ct,bottomMargin:_,axisTitles:[v,J],tooltip:K,onSeriesMouseOver:Q,barPadding:tt,showLabels:o,onSeriesMouseClick:l,resetSelectionOnDoubleClick:M,detailsOnClick:ut,noOfTicks:C,lineSuffix:N,barSuffix:I,linePrefix:st,barPrefix:k,curveType:nt,showValues:it,styles:u,classNames:r,animate:m===!0?{duration:.5,once:!0,amount:.5}:m||{duration:0,once:!0,amount:0},precision:g,customLayers:s,naLabel:x}):null})]})}),V||j?e.jsxRuntimeExports.jsx(Nt.GraphFooter,{styles:{footnote:u?.footnote,source:u?.source},classNames:{footnote:r?.footnote,source:r?.source},sources:V,footNote:j,width:n}):null]})})})})}exports.ParetoChart=It;
2
2
  //# sourceMappingURL=ParetoChart.cjs.map
@@ -1,21 +1,21 @@
1
1
  import { j as t, m as R } from "./index-CHPV5EwG-BPSP-7Jg.js";
2
2
  import { useRef as di, useState as B, useEffect as wi } from "react";
3
3
  import { i as fi } from "./index-27yTRcko.js";
4
- import { X as ji } from "./Modal-CUU6ZK3U.js";
4
+ import { X as ji } from "./Modal-DVVwpKhP.js";
5
5
  import { n as ni } from "./numberFormattingFunction-14YCbkN2.js";
6
6
  import { T as Ai } from "./Tooltip-DyM5snqx.js";
7
7
  import { s as Mi } from "./string2HTML-CWHGfz_d.js";
8
8
  import { c as hi } from "./checkIfNullOrUndefined-DmfiKkNw.js";
9
9
  import { A as ui } from "./Axis-Ddg-seDi.js";
10
10
  import { A as gi } from "./AxisTitle-BmHLMRJZ.js";
11
- import { X as Ni } from "./XAxesLabels-DQFo_z2R.js";
12
- import { u as ki } from "./use-in-view-BAHrBy6b.js";
13
- import { b as $i } from "./band-BEjh2CHI.js";
11
+ import { X as Ni } from "./XAxesLabels-CaV2q-6H.js";
12
+ import { b as ki } from "./band-BEjh2CHI.js";
14
13
  import { a as yi } from "./linear-DUdu7l2G.js";
15
- import { l as Ci, c as Ii } from "./line-CPfhohvF.js";
16
- import { c as Li, s as Ti, a as Si, m as Vi } from "./step-BrDul-H4.js";
17
- import { m as D } from "./proxy-DJxJg1kD.js";
18
- import { A as Oi } from "./index-BxAUvrua.js";
14
+ import { l as $i, c as Ci } from "./line-CPfhohvF.js";
15
+ import { c as Ii, s as Li, a as Ti, m as Si } from "./step-BrDul-H4.js";
16
+ import { u as Vi } from "./use-in-view-yS6jzJAp.js";
17
+ import { m as D } from "./proxy-CkpFesk1.js";
18
+ import { A as Oi } from "./index-CNvov0eg.js";
19
19
  import { GraphFooter as Pi } from "./GraphFooter.js";
20
20
  import { GraphHeader as Di } from "./GraphHeader.js";
21
21
  import { ColorLegend as Yi } from "./ColorLegend.js";
@@ -55,21 +55,21 @@ function Xi(li) {
55
55
  precision: E,
56
56
  customLayers: T,
57
57
  naLabel: M
58
- } = li, ei = di(null), N = ki(ei, {
58
+ } = li, ei = di(null), N = Vi(ei, {
59
59
  once: r.once,
60
60
  amount: r.amount
61
- }), xi = X === "linear" ? Ii : X === "step" ? Li : X === "stepAfter" ? Ti : X === "stepBefore" ? Si : Vi, [ai, k] = B(void 0), [$, S] = B(void 0), [si, C] = B(void 0), [ri, x] = B(void 0), n = {
61
+ }), xi = X === "linear" ? Ci : X === "step" ? Ii : X === "stepAfter" ? Li : X === "stepBefore" ? Ti : Si, [ai, k] = B(void 0), [$, S] = B(void 0), [si, C] = B(void 0), [ri, x] = B(void 0), n = {
62
62
  top: q,
63
63
  bottom: ci,
64
64
  left: _ + 50,
65
65
  right: z + 65
66
- }, h = A - n.left - n.right, f = Y - n.top - n.bottom, a = L.map((i, j) => ({ ...i, id: `${j}` })), c = $i().domain(a.map((i) => `${i.id}`)).range([0, h]).paddingInner(mi), w = Math.min(...a.map((i) => i.bar).filter((i) => i != null)) !== 1 / 0 ? Math.min(...a.map((i) => i.bar).filter((i) => i != null)) > 0 ? 0 : Math.min(...a.map((i) => i.bar).filter((i) => i != null)) : 0, W = Math.min(...a.map((i) => i.line).filter((i) => i != null)) !== 1 / 0 ? Math.min(...a.map((i) => i.line).filter((i) => i != null)) > 0 ? 0 : Math.min(...a.map((i) => i.line).filter((i) => i != null)) : 0, V = Math.max(...a.map((i) => i.bar).filter((i) => i != null)) !== 1 / 0 ? Math.max(...a.map((i) => i.bar).filter((i) => i != null)) : 0, O = Math.max(...a.map((i) => i.line).filter((i) => i != null)) !== 1 / 0 ? Math.max(...a.map((i) => i.line).filter((i) => i != null)) : 0, I = w < W ? w : W, P = V > O ? V : O, e = yi().domain([
66
+ }, h = A - n.left - n.right, f = Y - n.top - n.bottom, a = L.map((i, j) => ({ ...i, id: `${j}` })), c = ki().domain(a.map((i) => `${i.id}`)).range([0, h]).paddingInner(mi), w = Math.min(...a.map((i) => i.bar).filter((i) => i != null)) !== 1 / 0 ? Math.min(...a.map((i) => i.bar).filter((i) => i != null)) > 0 ? 0 : Math.min(...a.map((i) => i.bar).filter((i) => i != null)) : 0, W = Math.min(...a.map((i) => i.line).filter((i) => i != null)) !== 1 / 0 ? Math.min(...a.map((i) => i.line).filter((i) => i != null)) > 0 ? 0 : Math.min(...a.map((i) => i.line).filter((i) => i != null)) : 0, V = Math.max(...a.map((i) => i.bar).filter((i) => i != null)) !== 1 / 0 ? Math.max(...a.map((i) => i.bar).filter((i) => i != null)) : 0, O = Math.max(...a.map((i) => i.line).filter((i) => i != null)) !== 1 / 0 ? Math.max(...a.map((i) => i.line).filter((i) => i != null)) : 0, I = w < W ? w : W, P = V > O ? V : O, e = yi().domain([
67
67
  y ? I : w,
68
68
  y ? P > 0 ? P : 0 : V > 0 ? V : 0
69
69
  ]).range([f, 0]).nice(), m = yi().domain([
70
70
  y ? I : W,
71
71
  y ? P > 0 ? P : 0 : O > 0 ? O : 0
72
- ]).range([f, 0]).nice(), pi = Ci().defined((i) => !hi(i.line)).x((i) => c(`${i.id}`) + c.bandwidth() / 2).y((i) => m(i.line)).curve(xi), vi = e.ticks(Z), bi = m.ticks(Z);
72
+ ]).range([f, 0]).nice(), pi = $i().defined((i) => !hi(i.line)).x((i) => c(`${i.id}`) + c.bandwidth() / 2).y((i) => m(i.line)).curve(xi), vi = e.ticks(Z), bi = m.ticks(Z);
73
73
  return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
74
74
  /* @__PURE__ */ t.jsx(
75
75
  D.svg,
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-CHPV5EwG-DDoeWRVt.cjs"),o=require("react"),I=require("./index-Ds0uHjK9.cjs"),j=require("./index-B0rbzOoC.cjs"),b=require("./DropdownSelect-0I2QxaVy.cjs"),z=require("./checkIfMultiple-Do4kADNr.cjs"),L=require("./SingleGraphDashboard.cjs"),U=require("./SingleGraphDashboardThreeDGraphs.cjs"),Z=require("./SingleGraphDashboardGeoHubMaps.cjs"),p=require("./fetchAndParseData-DmgQtB9n.cjs"),J=require("./getUniqValue-CHqgSss5.cjs"),B=require("./GraphHeader.cjs"),k=require("./filterData-DN6py7y_.cjs"),V=require("./transformDataForSelect-YmStusCI.cjs"),w=y=>y.map(a=>a.columnWidth||1).reduce((a,h)=>a+h,0),K=["barChart","choroplethMap","biVariateChoroplethMap","circlePacking","treeMap"];function Q(y){const{dashboardID:C,dashboardLayout:s,dataSettings:a,filters:h,debugMode:c,theme:g="light",readableHeader:T,dataFilters:R,noOfFiltersPerRow:v=4,filterPosition:F,uiMode:d="normal",graphStyles:S,graphClassNames:D}=y,[m,H]=o.useState(void 0),[f,q]=o.useState(void 0),[u,E]=o.useState([]),A=["threeDGlobe"],N=["geoHubCompareMap","geoHubMap","geoHubMapWithLayerSelection"],G=o.useMemo(()=>({ignoreCase:!0,ignoreAccents:!0,trim:!0}),[]),O=o.useMemo(()=>!f||u.length===0?f:f.filter(l=>u.every(e=>e.value&&j.flattenDeep([e.value]).length>0?I.intersection(j.flattenDeep([l[e.filter]]),j.flattenDeep([e.value]).map(i=>i.value)).length>0:!0)),[u,f]);o.useEffect(()=>{H(O)},[O]);const M=o.useCallback(async()=>{if(a)try{const l=await(a.dataURL?typeof a.dataURL=="string"?a.fileType==="json"?p.fetchAndParseJSON(a.dataURL,a.columnsToArray,a.dataTransformation,c):a.fileType==="api"?p.fetchAndTransformDataFromAPI(a.dataURL,a.apiHeaders,a.columnsToArray,a.dataTransformation,c):p.fetchAndParseCSV(a.dataURL,a.dataTransformation,a.columnsToArray,c,a.delimiter,!0):p.fetchAndParseMultipleDataSources(a.dataURL,a.idColumnTitle):p.transformColumnsToArray(a.data,a.columnsToArray));q(l);const e=(h||[]).map(i=>({filter:i.column,label:i.label||`Filter by ${i.column}`,singleSelect:i.singleSelect,clearable:i.clearable,defaultValue:V.transformDefaultValue(i.defaultValue),value:V.transformDefaultValue(i.defaultValue),availableValues:J.getUniqValue(l,i.column).filter(n=>!i.excludeValues?.includes(`${n}`)).map(n=>({value:n,label:n})),allowSelectAll:i.allowSelectAll,width:i.width}));E(e)}catch(t){console.error("Data fetching error:",t)}},[a,h,c]);o.useEffect(()=>{M()},[M]);const x=o.useCallback((t,l)=>{E(e=>e.map(i=>i.filter===t?{...i,value:l}:i))},[]);return r.jsxRuntimeExports.jsx("div",{className:`${g||"light"} flex grow`,dir:s.language==="he"||s.language==="ar"?"rtl":void 0,children:r.jsxRuntimeExports.jsx("div",{className:`${s.backgroundColor?s.backgroundColor===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto gap-4 flex flex-col w-full grow h-inherit ${s.language||"en"}`,style:{...s.backgroundColor&&s.backgroundColor!==!0?{backgroundColor:s.backgroundColor}:{}},id:C,children:r.jsxRuntimeExports.jsx("div",{style:{padding:s.backgroundColor?s.padding||"1rem":s.padding||0,flexGrow:1,display:"flex"},children:r.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[s.title||s.description?r.jsxRuntimeExports.jsx(B.GraphHeader,{graphTitle:s.title,graphDescription:s.description,isDashboard:!0}):null,r.jsxRuntimeExports.jsxs("div",{style:{display:"flex",gap:"1rem",flexWrap:"wrap"},children:[u.length!==0?r.jsxRuntimeExports.jsx("div",{style:{width:F==="side"?"280px":"100%",flexGrow:1,flexShrink:0},children:r.jsxRuntimeExports.jsx("div",{style:{display:"flex",gap:"1rem",flexWrap:"wrap",alignItems:"flex-start",width:"100%",position:"sticky",top:"1rem"},children:u?.map((t,l)=>r.jsxRuntimeExports.jsxs("div",{style:{width:t.width||`calc(${100/v}% - ${(v-1)/v}rem)`,flexGrow:1,flexShrink:0,minWidth:"240px"},children:[r.jsxRuntimeExports.jsx(z.f,{className:"mb-2",children:t.label}),t.singleSelect?r.jsxRuntimeExports.jsx(b.Za,{options:t.availableValues,isClearable:t.clearable===void 0?!0:t.clearable,size:"sm",variant:d,isMulti:!1,isSearchable:!0,filterOption:b.Hu(G),onChange:e=>{x(t.filter,e)},defaultValue:t.defaultValue,value:t.value}):r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsx(b.Za,{options:t.availableValues,isMulti:!0,size:"sm",isClearable:t.clearable===void 0?!0:t.clearable,variant:d,isSearchable:!0,controlShouldRenderValue:!0,closeMenuOnSelect:!1,hideSelectedOptions:!1,filterOption:b.Hu(G),onChange:e=>{x(t.filter,e)},value:t.value,defaultValue:t.defaultValue}),t.allowSelectAll?r.jsxRuntimeExports.jsx("button",{type:"button",className:"bg-transparent border-0 p-0 mt-2 cursor-pointer text-primary-blue-600 dark:text-primary-blue-400",onClick:()=>{x(t.filter,t.availableValues)},children:"Select all options"}):null]})]},l))})}):null,r.jsxRuntimeExports.jsx("div",{style:{width:F==="side"?"calc(100% - 280px - 1rem)":"100%",minWidth:"280px",flexGrow:1,display:"flex",gap:"1rem",flexWrap:"wrap",flexShrink:"0"},children:s.rows.map((t,l)=>r.jsxRuntimeExports.jsx("div",{style:{display:"flex",gap:"1rem",alignItems:"stretch",minHeight:`${t.height||0}px`,height:"auto",width:"100%",flexWrap:"wrap"},children:t.columns.map((e,i)=>r.jsxRuntimeExports.jsx("div",{className:"flex bg-transparent h-inherit grow min-w-60",style:{width:`calc(${100*(e.columnWidth||1)/w(t.columns)}% - ${(w(t.columns)-(e.columnWidth||1))/w(t.columns)}rem)`,minHeight:"inherit"},children:A.includes(e.graphType)?r.jsxRuntimeExports.jsx(U.SingleGraphDashboardThreeDGraphs,{graphType:e.graphType,dataFilters:e.dataFilters,uiMode:d,graphSettings:{...e.settings||{},width:void 0,height:void 0,resetSelectionOnDoubleClick:e.attachedFilter?!1:e.settings?.resetSelectionOnDoubleClick,styles:e.settings?.styles||S,classNames:e.settings?.classNames||D,radius:e.graphType==="donutChart"?void 0:e.settings?.radius,size:e.graphType==="unitChart"?e.settings?.size:void 0,language:e.settings?.language||s.language,theme:e.settings?.theme||g},dataSettings:{data:m?k.filterData(m,R||[]):void 0},dataTransform:e.dataTransform,dataSelectionOptions:e.dataSelectionOptions,advancedDataSelectionOptions:e.advancedDataSelectionOptions,graphDataConfiguration:e.graphDataConfiguration,debugMode:c,readableHeader:T||[]}):N.includes(e.graphType)?r.jsxRuntimeExports.jsx(Z.SingleGraphDashboardGeoHubMaps,{graphType:e.graphType,uiMode:d,graphSettings:{...e.settings||{},width:void 0,height:void 0,resetSelectionOnDoubleClick:e.attachedFilter?!1:e.settings?.resetSelectionOnDoubleClick,styles:e.settings?.styles||S,classNames:e.settings?.classNames||D,radius:e.graphType==="donutChart"?void 0:e.settings?.radius,size:e.graphType==="unitChart"?e.settings?.size:void 0,language:e.settings?.language||s.language,theme:e.settings?.theme||g},debugMode:c}):r.jsxRuntimeExports.jsx(L.SingleGraphDashboard,{graphType:e.graphType,dataFilters:e.dataFilters,uiMode:d,graphSettings:{...e.settings||{},width:void 0,height:void 0,resetSelectionOnDoubleClick:e.attachedFilter?!1:e.settings?.resetSelectionOnDoubleClick,styles:e.settings?.styles||S,classNames:e.settings?.classNames||D,radius:e.graphType==="donutChart"?void 0:e.settings?.radius,size:e.graphType==="unitChart"?e.settings?.size:void 0,language:e.settings?.language||s.language,theme:e.settings?.theme||g},dataSettings:{data:m?k.filterData(m,R||[]):void 0},updateFilters:e.attachedFilter&&K.indexOf(e.graphType)!==-1&&u.findIndex(n=>n.filter===e.attachedFilter)!==-1?n=>{const W=u.findIndex($=>$.filter===e.attachedFilter),P=n?u[W].singleSelect?{value:n,label:n}:[{value:n,label:n}]:void 0;x(e.attachedFilter,P)}:void 0,dataTransform:e.dataTransform,dataSelectionOptions:e.dataSelectionOptions,advancedDataSelectionOptions:e.advancedDataSelectionOptions,graphDataConfiguration:e.graphDataConfiguration,debugMode:c,readableHeader:T||[]})},i))},l))})]})]})})})})}exports.PerformanceIntensiveMultiGraphDashboard=Q;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-CHPV5EwG-DDoeWRVt.cjs"),o=require("react"),I=require("./index-Ds0uHjK9.cjs"),j=require("./index-B0rbzOoC.cjs"),b=require("./DropdownSelect-BmE5JaeE.cjs"),z=require("./checkIfMultiple-BXbHUCWM.cjs"),L=require("./SingleGraphDashboard.cjs"),U=require("./SingleGraphDashboardThreeDGraphs.cjs"),Z=require("./SingleGraphDashboardGeoHubMaps.cjs"),p=require("./fetchAndParseData-CQyVGCul.cjs"),J=require("./getUniqValue-CHqgSss5.cjs"),B=require("./GraphHeader.cjs"),k=require("./filterData-DN6py7y_.cjs"),V=require("./transformDataForSelect-YmStusCI.cjs"),w=y=>y.map(a=>a.columnWidth||1).reduce((a,h)=>a+h,0),K=["barChart","choroplethMap","biVariateChoroplethMap","circlePacking","treeMap"];function Q(y){const{dashboardID:C,dashboardLayout:s,dataSettings:a,filters:h,debugMode:c,theme:g="light",readableHeader:T,dataFilters:R,noOfFiltersPerRow:v=4,filterPosition:F,uiMode:d="normal",graphStyles:S,graphClassNames:D}=y,[m,H]=o.useState(void 0),[f,q]=o.useState(void 0),[u,E]=o.useState([]),A=["threeDGlobe"],N=["geoHubCompareMap","geoHubMap","geoHubMapWithLayerSelection"],G=o.useMemo(()=>({ignoreCase:!0,ignoreAccents:!0,trim:!0}),[]),O=o.useMemo(()=>!f||u.length===0?f:f.filter(l=>u.every(e=>e.value&&j.flattenDeep([e.value]).length>0?I.intersection(j.flattenDeep([l[e.filter]]),j.flattenDeep([e.value]).map(i=>i.value)).length>0:!0)),[u,f]);o.useEffect(()=>{H(O)},[O]);const M=o.useCallback(async()=>{if(a)try{const l=await(a.dataURL?typeof a.dataURL=="string"?a.fileType==="json"?p.fetchAndParseJSON(a.dataURL,a.columnsToArray,a.dataTransformation,c):a.fileType==="api"?p.fetchAndTransformDataFromAPI(a.dataURL,a.apiHeaders,a.columnsToArray,a.dataTransformation,c):p.fetchAndParseCSV(a.dataURL,a.dataTransformation,a.columnsToArray,c,a.delimiter,!0):p.fetchAndParseMultipleDataSources(a.dataURL,a.idColumnTitle):p.transformColumnsToArray(a.data,a.columnsToArray));q(l);const e=(h||[]).map(i=>({filter:i.column,label:i.label||`Filter by ${i.column}`,singleSelect:i.singleSelect,clearable:i.clearable,defaultValue:V.transformDefaultValue(i.defaultValue),value:V.transformDefaultValue(i.defaultValue),availableValues:J.getUniqValue(l,i.column).filter(n=>!i.excludeValues?.includes(`${n}`)).map(n=>({value:n,label:n})),allowSelectAll:i.allowSelectAll,width:i.width}));E(e)}catch(t){console.error("Data fetching error:",t)}},[a,h,c]);o.useEffect(()=>{M()},[M]);const x=o.useCallback((t,l)=>{E(e=>e.map(i=>i.filter===t?{...i,value:l}:i))},[]);return r.jsxRuntimeExports.jsx("div",{className:`${g||"light"} flex grow`,dir:s.language==="he"||s.language==="ar"?"rtl":void 0,children:r.jsxRuntimeExports.jsx("div",{className:`${s.backgroundColor?s.backgroundColor===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto gap-4 flex flex-col w-full grow h-inherit ${s.language||"en"}`,style:{...s.backgroundColor&&s.backgroundColor!==!0?{backgroundColor:s.backgroundColor}:{}},id:C,children:r.jsxRuntimeExports.jsx("div",{style:{padding:s.backgroundColor?s.padding||"1rem":s.padding||0,flexGrow:1,display:"flex"},children:r.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[s.title||s.description?r.jsxRuntimeExports.jsx(B.GraphHeader,{graphTitle:s.title,graphDescription:s.description,isDashboard:!0}):null,r.jsxRuntimeExports.jsxs("div",{style:{display:"flex",gap:"1rem",flexWrap:"wrap"},children:[u.length!==0?r.jsxRuntimeExports.jsx("div",{style:{width:F==="side"?"280px":"100%",flexGrow:1,flexShrink:0},children:r.jsxRuntimeExports.jsx("div",{style:{display:"flex",gap:"1rem",flexWrap:"wrap",alignItems:"flex-start",width:"100%",position:"sticky",top:"1rem"},children:u?.map((t,l)=>r.jsxRuntimeExports.jsxs("div",{style:{width:t.width||`calc(${100/v}% - ${(v-1)/v}rem)`,flexGrow:1,flexShrink:0,minWidth:"240px"},children:[r.jsxRuntimeExports.jsx(z.f,{className:"mb-2",children:t.label}),t.singleSelect?r.jsxRuntimeExports.jsx(b.Za,{options:t.availableValues,isClearable:t.clearable===void 0?!0:t.clearable,size:"sm",variant:d,isMulti:!1,isSearchable:!0,filterOption:b.Hu(G),onChange:e=>{x(t.filter,e)},defaultValue:t.defaultValue,value:t.value}):r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsx(b.Za,{options:t.availableValues,isMulti:!0,size:"sm",isClearable:t.clearable===void 0?!0:t.clearable,variant:d,isSearchable:!0,controlShouldRenderValue:!0,closeMenuOnSelect:!1,hideSelectedOptions:!1,filterOption:b.Hu(G),onChange:e=>{x(t.filter,e)},value:t.value,defaultValue:t.defaultValue}),t.allowSelectAll?r.jsxRuntimeExports.jsx("button",{type:"button",className:"bg-transparent border-0 p-0 mt-2 cursor-pointer text-primary-blue-600 dark:text-primary-blue-400",onClick:()=>{x(t.filter,t.availableValues)},children:"Select all options"}):null]})]},l))})}):null,r.jsxRuntimeExports.jsx("div",{style:{width:F==="side"?"calc(100% - 280px - 1rem)":"100%",minWidth:"280px",flexGrow:1,display:"flex",gap:"1rem",flexWrap:"wrap",flexShrink:"0"},children:s.rows.map((t,l)=>r.jsxRuntimeExports.jsx("div",{style:{display:"flex",gap:"1rem",alignItems:"stretch",minHeight:`${t.height||0}px`,height:"auto",width:"100%",flexWrap:"wrap"},children:t.columns.map((e,i)=>r.jsxRuntimeExports.jsx("div",{className:"flex bg-transparent h-inherit grow min-w-60",style:{width:`calc(${100*(e.columnWidth||1)/w(t.columns)}% - ${(w(t.columns)-(e.columnWidth||1))/w(t.columns)}rem)`,minHeight:"inherit"},children:A.includes(e.graphType)?r.jsxRuntimeExports.jsx(U.SingleGraphDashboardThreeDGraphs,{graphType:e.graphType,dataFilters:e.dataFilters,uiMode:d,graphSettings:{...e.settings||{},width:void 0,height:void 0,resetSelectionOnDoubleClick:e.attachedFilter?!1:e.settings?.resetSelectionOnDoubleClick,styles:e.settings?.styles||S,classNames:e.settings?.classNames||D,radius:e.graphType==="donutChart"?void 0:e.settings?.radius,size:e.graphType==="unitChart"?e.settings?.size:void 0,language:e.settings?.language||s.language,theme:e.settings?.theme||g},dataSettings:{data:m?k.filterData(m,R||[]):void 0},dataTransform:e.dataTransform,dataSelectionOptions:e.dataSelectionOptions,advancedDataSelectionOptions:e.advancedDataSelectionOptions,graphDataConfiguration:e.graphDataConfiguration,debugMode:c,readableHeader:T||[]}):N.includes(e.graphType)?r.jsxRuntimeExports.jsx(Z.SingleGraphDashboardGeoHubMaps,{graphType:e.graphType,uiMode:d,graphSettings:{...e.settings||{},width:void 0,height:void 0,resetSelectionOnDoubleClick:e.attachedFilter?!1:e.settings?.resetSelectionOnDoubleClick,styles:e.settings?.styles||S,classNames:e.settings?.classNames||D,radius:e.graphType==="donutChart"?void 0:e.settings?.radius,size:e.graphType==="unitChart"?e.settings?.size:void 0,language:e.settings?.language||s.language,theme:e.settings?.theme||g},debugMode:c}):r.jsxRuntimeExports.jsx(L.SingleGraphDashboard,{graphType:e.graphType,dataFilters:e.dataFilters,uiMode:d,graphSettings:{...e.settings||{},width:void 0,height:void 0,resetSelectionOnDoubleClick:e.attachedFilter?!1:e.settings?.resetSelectionOnDoubleClick,styles:e.settings?.styles||S,classNames:e.settings?.classNames||D,radius:e.graphType==="donutChart"?void 0:e.settings?.radius,size:e.graphType==="unitChart"?e.settings?.size:void 0,language:e.settings?.language||s.language,theme:e.settings?.theme||g},dataSettings:{data:m?k.filterData(m,R||[]):void 0},updateFilters:e.attachedFilter&&K.indexOf(e.graphType)!==-1&&u.findIndex(n=>n.filter===e.attachedFilter)!==-1?n=>{const W=u.findIndex($=>$.filter===e.attachedFilter),P=n?u[W].singleSelect?{value:n,label:n}:[{value:n,label:n}]:void 0;x(e.attachedFilter,P)}:void 0,dataTransform:e.dataTransform,dataSelectionOptions:e.dataSelectionOptions,advancedDataSelectionOptions:e.advancedDataSelectionOptions,graphDataConfiguration:e.graphDataConfiguration,debugMode:c,readableHeader:T||[]})},i))},l))})]})]})})})})}exports.PerformanceIntensiveMultiGraphDashboard=Q;
2
2
  //# sourceMappingURL=PerformanceIntensiveMultiGraphDashboard.cjs.map
@@ -2,12 +2,12 @@ import { j as r } from "./index-CHPV5EwG-BPSP-7Jg.js";
2
2
  import { useState as v, useMemo as M, useEffect as A, useCallback as H } from "react";
3
3
  import { i as Z } from "./index-C1rRk_50.js";
4
4
  import { f as S } from "./index-UV9hjG_S.js";
5
- import { Z as G, H as N } from "./DropdownSelect-CDC9lEqU.js";
6
- import { f as q } from "./checkIfMultiple-CYp3vADF.js";
5
+ import { Z as G, H as N } from "./DropdownSelect-CeHog_ih.js";
6
+ import { f as q } from "./checkIfMultiple-ChTJk2Tk.js";
7
7
  import { SingleGraphDashboard as J } from "./SingleGraphDashboard.js";
8
8
  import { SingleGraphDashboardThreeDGraphs as B } from "./SingleGraphDashboardThreeDGraphs.js";
9
9
  import { SingleGraphDashboardGeoHubMaps as K } from "./SingleGraphDashboardGeoHubMaps.js";
10
- import { f as Q, a as X, b as Y, c as _, t as aa } from "./fetchAndParseData-Bcmr659B.js";
10
+ import { f as Q, a as X, b as Y, c as _, t as aa } from "./fetchAndParseData-4gsYTy6_.js";
11
11
  import { g as ea } from "./getUniqValue-BtUENB2H.js";
12
12
  import { GraphHeader as ta } from "./GraphHeader.js";
13
13
  import { f as W } from "./filterData-B8ocT57s.js";
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-CHPV5EwG-DDoeWRVt.cjs"),s=require("react"),o=require("./Spinner-DA6Z5E4n.cjs"),d=require("./PerformanceIntensiveMultiGraphDashboard.cjs"),f=require("./fetchAndParseData-DmgQtB9n.cjs");function u(i){const{config:t}=i,[e,a]=s.useState(void 0);return s.useEffect(()=>{(async()=>{if(typeof t=="string"){const n=await f.fetchAndParseJSON(t);a(n)}else a(t)})()},[t]),e?r.jsxRuntimeExports.jsx(d.PerformanceIntensiveMultiGraphDashboard,{dashboardID:e.dashboardID,dashboardLayout:e.dashboardLayout,dataSettings:e.dataSettings,filters:e.filters,debugMode:e.debugMode,theme:e.theme,readableHeader:e.readableHeader,dataFilters:e.dataFilters,noOfFiltersPerRow:e.noOfFiltersPerRow,filterPosition:e.filterPosition,uiMode:e.uiMode,graphStyles:e.graphStyles,graphClassNames:e.graphClassNames}):r.jsxRuntimeExports.jsx("div",{className:"w-full flex justify-center p-4",children:r.jsxRuntimeExports.jsx(o.y,{})})}exports.PerformanceIntensiveMultiGraphDashboardFromConfig=u;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-CHPV5EwG-DDoeWRVt.cjs"),s=require("react"),o=require("./Spinner-DA6Z5E4n.cjs"),d=require("./PerformanceIntensiveMultiGraphDashboard.cjs"),f=require("./fetchAndParseData-CQyVGCul.cjs");function u(i){const{config:t}=i,[e,a]=s.useState(void 0);return s.useEffect(()=>{(async()=>{if(typeof t=="string"){const n=await f.fetchAndParseJSON(t);a(n)}else a(t)})()},[t]),e?r.jsxRuntimeExports.jsx(d.PerformanceIntensiveMultiGraphDashboard,{dashboardID:e.dashboardID,dashboardLayout:e.dashboardLayout,dataSettings:e.dataSettings,filters:e.filters,debugMode:e.debugMode,theme:e.theme,readableHeader:e.readableHeader,dataFilters:e.dataFilters,noOfFiltersPerRow:e.noOfFiltersPerRow,filterPosition:e.filterPosition,uiMode:e.uiMode,graphStyles:e.graphStyles,graphClassNames:e.graphClassNames}):r.jsxRuntimeExports.jsx("div",{className:"w-full flex justify-center p-4",children:r.jsxRuntimeExports.jsx(o.y,{})})}exports.PerformanceIntensiveMultiGraphDashboardFromConfig=u;
2
2
  //# sourceMappingURL=PerformanceIntensiveMultiGraphDashboardFromConfig.cjs.map
@@ -2,7 +2,7 @@ import { j as a } from "./index-CHPV5EwG-BPSP-7Jg.js";
2
2
  import { useState as i, useEffect as n } from "react";
3
3
  import { y as f } from "./Spinner-C85UF28E.js";
4
4
  import { PerformanceIntensiveMultiGraphDashboard as d } from "./PerformanceIntensiveMultiGraphDashboard.js";
5
- import { f as l } from "./fetchAndParseData-Bcmr659B.js";
5
+ import { f as l } from "./fetchAndParseData-4gsYTy6_.js";
6
6
  function b(s) {
7
7
  const { config: t } = s, [e, r] = i(void 0);
8
8
  return n(() => {
@@ -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
@@ -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