@undp/data-viz 1.5.2 → 1.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (228) hide show
  1. package/dist/AreaChart.cjs +1 -1
  2. package/dist/AreaChart.cjs.map +1 -1
  3. package/dist/AreaChart.js +3 -2
  4. package/dist/AreaChart.js.map +1 -1
  5. package/dist/BarGraph.cjs +1 -1
  6. package/dist/BarGraph.cjs.map +1 -1
  7. package/dist/BarGraph.js +1196 -1224
  8. package/dist/BarGraph.js.map +1 -1
  9. package/dist/BeeSwarmChart.cjs +1 -1
  10. package/dist/BeeSwarmChart.cjs.map +1 -1
  11. package/dist/BeeSwarmChart.js +130 -142
  12. package/dist/BeeSwarmChart.js.map +1 -1
  13. package/dist/BiVariateChoroplethMap.cjs +1 -1
  14. package/dist/BiVariateChoroplethMap.cjs.map +1 -1
  15. package/dist/BiVariateChoroplethMap.js +41 -41
  16. package/dist/BiVariateChoroplethMap.js.map +1 -1
  17. package/dist/BulletChart.cjs +1 -1
  18. package/dist/BulletChart.cjs.map +1 -1
  19. package/dist/BulletChart.js +483 -487
  20. package/dist/BulletChart.js.map +1 -1
  21. package/dist/ButterflyChart.cjs +1 -1
  22. package/dist/ButterflyChart.cjs.map +1 -1
  23. package/dist/ButterflyChart.js +99 -99
  24. package/dist/ButterflyChart.js.map +1 -1
  25. package/dist/ChoroplethMap.cjs +1 -1
  26. package/dist/ChoroplethMap.cjs.map +1 -1
  27. package/dist/ChoroplethMap.js +125 -125
  28. package/dist/ChoroplethMap.js.map +1 -1
  29. package/dist/CirclePackingGraph.cjs +1 -1
  30. package/dist/CirclePackingGraph.js +2 -2
  31. package/dist/DataCards.cjs +2 -2
  32. package/dist/DataCards.cjs.map +1 -1
  33. package/dist/DataCards.js +6 -6
  34. package/dist/DataCards.js.map +1 -1
  35. package/dist/DataTable.cjs +1 -1
  36. package/dist/DataTable.cjs.map +1 -1
  37. package/dist/DataTable.js +66 -68
  38. package/dist/DataTable.js.map +1 -1
  39. package/dist/DifferenceLineChart.cjs +1 -1
  40. package/dist/DifferenceLineChart.cjs.map +1 -1
  41. package/dist/DifferenceLineChart.js +3 -2
  42. package/dist/DifferenceLineChart.js.map +1 -1
  43. package/dist/DonutChart.cjs +1 -1
  44. package/dist/DonutChart.cjs.map +1 -1
  45. package/dist/DonutChart.js +205 -205
  46. package/dist/DonutChart.js.map +1 -1
  47. package/dist/DotDensityMap.cjs +1 -1
  48. package/dist/DotDensityMap.cjs.map +1 -1
  49. package/dist/DotDensityMap.js +78 -81
  50. package/dist/DotDensityMap.js.map +1 -1
  51. package/dist/DualAxisLineChart.cjs +1 -1
  52. package/dist/DualAxisLineChart.cjs.map +1 -1
  53. package/dist/DualAxisLineChart.js +3 -2
  54. package/dist/DualAxisLineChart.js.map +1 -1
  55. package/dist/DumbbellChart.cjs +1 -1
  56. package/dist/DumbbellChart.cjs.map +1 -1
  57. package/dist/DumbbellChart.js +64 -65
  58. package/dist/DumbbellChart.js.map +1 -1
  59. package/dist/GeoHubMap.cjs +1 -1
  60. package/dist/GeoHubMap.js +1 -1
  61. package/dist/GeoHubMapWithLayerSelection.cjs +1 -1
  62. package/dist/GeoHubMapWithLayerSelection.js +1 -1
  63. package/dist/{GraphEl-4RUlclvW.cjs → GraphEl-BcYgMnN2.cjs} +2 -2
  64. package/dist/{GraphEl-4RUlclvW.cjs.map → GraphEl-BcYgMnN2.cjs.map} +1 -1
  65. package/dist/{GraphEl-ClIxlWa3.js → GraphEl-CMWeARJ3.js} +2 -2
  66. package/dist/{GraphEl-ClIxlWa3.js.map → GraphEl-CMWeARJ3.js.map} +1 -1
  67. package/dist/GriddedGraphs.cjs +1 -1
  68. package/dist/GriddedGraphs.js +4 -4
  69. package/dist/GriddedGraphsFromConfig.cjs +1 -1
  70. package/dist/GriddedGraphsFromConfig.js +1 -1
  71. package/dist/HeatMap.cjs +1 -1
  72. package/dist/HeatMap.cjs.map +1 -1
  73. package/dist/HeatMap.js +83 -83
  74. package/dist/HeatMap.js.map +1 -1
  75. package/dist/Histogram.cjs +1 -1
  76. package/dist/Histogram.js +1 -1
  77. package/dist/LineChartWithConfidenceInterval.cjs +1 -1
  78. package/dist/LineChartWithConfidenceInterval.cjs.map +1 -1
  79. package/dist/LineChartWithConfidenceInterval.js +7 -6
  80. package/dist/LineChartWithConfidenceInterval.js.map +1 -1
  81. package/dist/MultiGraphDashboard.cjs +1 -1
  82. package/dist/MultiGraphDashboard.js +2 -2
  83. package/dist/MultiGraphDashboardFromConfig.cjs +1 -1
  84. package/dist/MultiGraphDashboardFromConfig.js +1 -1
  85. package/dist/MultiGraphDashboardWideToLongFormat.cjs +1 -1
  86. package/dist/MultiGraphDashboardWideToLongFormat.js +1 -1
  87. package/dist/MultiGraphDashboardWideToLongFormatFromConfig.cjs +1 -1
  88. package/dist/MultiGraphDashboardWideToLongFormatFromConfig.js +1 -1
  89. package/dist/MultiLineAltChart.cjs +1 -1
  90. package/dist/MultiLineAltChart.cjs.map +1 -1
  91. package/dist/MultiLineAltChart.js +82 -91
  92. package/dist/MultiLineAltChart.js.map +1 -1
  93. package/dist/MultiLineChart.cjs +1 -1
  94. package/dist/MultiLineChart.cjs.map +1 -1
  95. package/dist/MultiLineChart.js +3 -2
  96. package/dist/MultiLineChart.js.map +1 -1
  97. package/dist/PerformanceIntensiveMultiGraphDashboard.cjs +1 -1
  98. package/dist/PerformanceIntensiveMultiGraphDashboard.js +2 -2
  99. package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.cjs +1 -1
  100. package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.js +1 -1
  101. package/dist/RadarChart.cjs +1 -1
  102. package/dist/RadarChart.cjs.map +1 -1
  103. package/dist/RadarChart.js +124 -130
  104. package/dist/RadarChart.js.map +1 -1
  105. package/dist/SankeyChart.cjs +1 -1
  106. package/dist/SankeyChart.cjs.map +1 -1
  107. package/dist/SankeyChart.js +200 -200
  108. package/dist/SankeyChart.js.map +1 -1
  109. package/dist/ScatterPlot.cjs +1 -1
  110. package/dist/ScatterPlot.cjs.map +1 -1
  111. package/dist/ScatterPlot.js +149 -155
  112. package/dist/ScatterPlot.js.map +1 -1
  113. package/dist/SimpleLineChart.cjs +1 -1
  114. package/dist/SimpleLineChart.cjs.map +1 -1
  115. package/dist/SimpleLineChart.js +44 -43
  116. package/dist/SimpleLineChart.js.map +1 -1
  117. package/dist/SingleGraphDashboard.cjs +1 -1
  118. package/dist/SingleGraphDashboard.js +4 -4
  119. package/dist/SingleGraphDashboardFromConfig.cjs +1 -1
  120. package/dist/SingleGraphDashboardFromConfig.js +1 -1
  121. package/dist/SingleGraphDashboardGeoHubMapsFromConfig.cjs +1 -1
  122. package/dist/SingleGraphDashboardGeoHubMapsFromConfig.js +1 -1
  123. package/dist/SingleGraphDashboardThreeDGraphs.cjs +1 -1
  124. package/dist/SingleGraphDashboardThreeDGraphs.js +3 -3
  125. package/dist/SingleGraphDashboardThreeDGraphsFromConfig.cjs +1 -1
  126. package/dist/SingleGraphDashboardThreeDGraphsFromConfig.js +1 -1
  127. package/dist/SlopeChart.cjs +1 -1
  128. package/dist/SlopeChart.cjs.map +1 -1
  129. package/dist/SlopeChart.js +107 -113
  130. package/dist/SlopeChart.js.map +1 -1
  131. package/dist/SparkLine.cjs +1 -1
  132. package/dist/SparkLine.cjs.map +1 -1
  133. package/dist/SparkLine.js +3 -2
  134. package/dist/SparkLine.js.map +1 -1
  135. package/dist/StripChart.cjs +1 -1
  136. package/dist/StripChart.cjs.map +1 -1
  137. package/dist/StripChart.js +159 -159
  138. package/dist/StripChart.js.map +1 -1
  139. package/dist/ThreeDGlobe.cjs +1 -1
  140. package/dist/ThreeDGlobe.cjs.map +1 -1
  141. package/dist/ThreeDGlobe.js +3 -3
  142. package/dist/ThreeDGlobe.js.map +1 -1
  143. package/dist/TreeMapGraph.cjs +1 -1
  144. package/dist/TreeMapGraph.cjs.map +1 -1
  145. package/dist/TreeMapGraph.js +194 -200
  146. package/dist/TreeMapGraph.js.map +1 -1
  147. package/dist/ensureCompleteData-DkQYPeDa.cjs +2 -0
  148. package/dist/ensureCompleteData-DkQYPeDa.cjs.map +1 -0
  149. package/dist/{ensureCompleteData-BALdOrsS.js → ensureCompleteData-DlmibgaI.js} +28 -8
  150. package/dist/ensureCompleteData-DlmibgaI.js.map +1 -0
  151. package/dist/fetchAndParseData-Ba-_CgxS.cjs +16 -0
  152. package/dist/fetchAndParseData-Ba-_CgxS.cjs.map +1 -0
  153. package/dist/fetchAndParseData-sapWbnYk.js +583 -0
  154. package/dist/fetchAndParseData-sapWbnYk.js.map +1 -0
  155. package/dist/fetchAndParseData.cjs +1 -1
  156. package/dist/fetchAndParseData.js +1 -1
  157. package/dist/getJenks-BbngDoBQ.js +19 -0
  158. package/dist/getJenks-BbngDoBQ.js.map +1 -0
  159. package/dist/getJenks-GYmdwBqm.cjs +2 -0
  160. package/dist/getJenks-GYmdwBqm.cjs.map +1 -0
  161. package/dist/getSliderMarks-9cNoRkDx.js +1023 -0
  162. package/dist/getSliderMarks-9cNoRkDx.js.map +1 -0
  163. package/dist/getSliderMarks-CRIbTGYV.cjs +6 -0
  164. package/dist/getSliderMarks-CRIbTGYV.cjs.map +1 -0
  165. package/dist/getUniqValue-DiCh_MOD.js +13 -0
  166. package/dist/getUniqValue-DiCh_MOD.js.map +1 -0
  167. package/dist/getUniqValue-RViz8tTw.cjs +2 -0
  168. package/dist/getUniqValue-RViz8tTw.cjs.map +1 -0
  169. package/dist/{index-BMgDMxKJ.js → index-37q0ULNQ.js} +44 -50
  170. package/dist/index-37q0ULNQ.js.map +1 -0
  171. package/dist/index-CVlCtJbC.cjs +2 -0
  172. package/dist/index-CVlCtJbC.cjs.map +1 -0
  173. package/dist/index.cjs +1 -1
  174. package/dist/index.d.ts +1 -1
  175. package/dist/index.js +6 -6
  176. package/dist/sort-DfK1b0F5.js +34 -0
  177. package/dist/sort-DfK1b0F5.js.map +1 -0
  178. package/dist/sort-O96oMZLb.cjs +2 -0
  179. package/dist/sort-O96oMZLb.cjs.map +1 -0
  180. package/dist/transformData.cjs +1 -1
  181. package/dist/transformData.js +3 -3
  182. package/dist/transformDataForAggregation-KXGm6flX.cjs +2 -0
  183. package/dist/{transformDataForAggregation-BVxVu4yY.cjs.map → transformDataForAggregation-KXGm6flX.cjs.map} +1 -1
  184. package/dist/{transformDataForAggregation-1BYVFqvF.js → transformDataForAggregation-sBpdlX8n.js} +40 -44
  185. package/dist/{transformDataForAggregation-1BYVFqvF.js.map → transformDataForAggregation-sBpdlX8n.js.map} +1 -1
  186. package/dist/{transformDataForGraphFromFile-BC9Ha8hF.js → transformDataForGraphFromFile-ComYvzuz.js} +3 -3
  187. package/dist/{transformDataForGraphFromFile-BC9Ha8hF.js.map → transformDataForGraphFromFile-ComYvzuz.js.map} +1 -1
  188. package/dist/{transformDataForGraphFromFile-b41aNQYY.cjs → transformDataForGraphFromFile-DVZodTHd.cjs} +2 -2
  189. package/dist/{transformDataForGraphFromFile-b41aNQYY.cjs.map → transformDataForGraphFromFile-DVZodTHd.cjs.map} +1 -1
  190. package/dist/uniqBy-BHy4I8PK.js +8 -0
  191. package/dist/uniqBy-BHy4I8PK.js.map +1 -0
  192. package/dist/uniqBy-O05lp2S5.cjs +2 -0
  193. package/dist/uniqBy-O05lp2S5.cjs.map +1 -0
  194. package/dist/utils.cjs +1 -1
  195. package/dist/utils.d.ts +1 -1
  196. package/dist/utils.js +2 -2
  197. package/package.json +1 -7
  198. package/dist/ensureCompleteData-BALdOrsS.js.map +0 -1
  199. package/dist/ensureCompleteData-BU5Zlccy.cjs +0 -2
  200. package/dist/ensureCompleteData-BU5Zlccy.cjs.map +0 -1
  201. package/dist/fetchAndParseData-DBOl1Icl.js +0 -1196
  202. package/dist/fetchAndParseData-DBOl1Icl.js.map +0 -1
  203. package/dist/fetchAndParseData-Dcy7AS_0.cjs +0 -16
  204. package/dist/fetchAndParseData-Dcy7AS_0.cjs.map +0 -1
  205. package/dist/getJenks-DW96UYNE.js +0 -23
  206. package/dist/getJenks-DW96UYNE.js.map +0 -1
  207. package/dist/getJenks-vofIZmeb.cjs +0 -2
  208. package/dist/getJenks-vofIZmeb.cjs.map +0 -1
  209. package/dist/getSliderMarks-C0jptXeP.js +0 -1054
  210. package/dist/getSliderMarks-C0jptXeP.js.map +0 -1
  211. package/dist/getSliderMarks-CtsEXiLV.cjs +0 -6
  212. package/dist/getSliderMarks-CtsEXiLV.cjs.map +0 -1
  213. package/dist/getUniqValue-CfuE_l9c.cjs +0 -2
  214. package/dist/getUniqValue-CfuE_l9c.cjs.map +0 -1
  215. package/dist/getUniqValue-CttuU_wn.js +0 -20
  216. package/dist/getUniqValue-CttuU_wn.js.map +0 -1
  217. package/dist/index-AqnpA7_O.js +0 -631
  218. package/dist/index-AqnpA7_O.js.map +0 -1
  219. package/dist/index-BJOeaYTk.cjs +0 -2
  220. package/dist/index-BJOeaYTk.cjs.map +0 -1
  221. package/dist/index-BMgDMxKJ.js.map +0 -1
  222. package/dist/index-DYH8g9WA.cjs +0 -2
  223. package/dist/index-DYH8g9WA.cjs.map +0 -1
  224. package/dist/index-Da2GUKrr.cjs +0 -2
  225. package/dist/index-Da2GUKrr.cjs.map +0 -1
  226. package/dist/index-fwdktvAS.js +0 -707
  227. package/dist/index-fwdktvAS.js.map +0 -1
  228. package/dist/transformDataForAggregation-BVxVu4yY.cjs +0 -2
package/dist/HeatMap.js CHANGED
@@ -1,17 +1,17 @@
1
- import { j as t, m as me } from "./index-CHPV5EwG-BPSP-7Jg.js";
2
- import { useRef as ae, useState as O, useEffect as ue } from "react";
1
+ import { j as e, m as ue } from "./index-CHPV5EwG-BPSP-7Jg.js";
2
+ import { useRef as ae, useState as O, useEffect as me } from "react";
3
3
  import { i as he } from "./index-Bwrro8-q.js";
4
- import { u as ne } from "./index-AqnpA7_O.js";
5
4
  import { X as ge } from "./Modal-DVVwpKhP.js";
6
5
  import { n as de } from "./numberFormattingFunction-14YCbkN2.js";
7
6
  import { T as pe } from "./Tooltip-CVCGWyzw.js";
8
7
  import { g as fe } from "./getTextColorBasedOnBgColor-B6Nk2WBf.js";
9
8
  import { c as re } from "./checkIfNullOrUndefined-DmfiKkNw.js";
10
9
  import { s as xe } from "./string2HTML-oFCROsus.js";
11
- import { X as we } from "./XAxesLabels-CaV2q-6H.js";
12
- import { Y as ye } from "./YAxesLabels-CPGZjmZJ.js";
10
+ import { X as ye } from "./XAxesLabels-CaV2q-6H.js";
11
+ import { Y as ve } from "./YAxesLabels-CPGZjmZJ.js";
12
+ import { u as ne } from "./uniqBy-BHy4I8PK.js";
13
13
  import { b as ce } from "./band-BEjh2CHI.js";
14
- import { o as ve } from "./ordinal-w9Lu4Stb.js";
14
+ import { o as we } from "./ordinal-w9Lu4Stb.js";
15
15
  import { t as Ce } from "./threshold-DFfqcDMa.js";
16
16
  import { a as be } from "./linear-DUdu7l2G.js";
17
17
  import { u as je } from "./use-in-view-yS6jzJAp.js";
@@ -47,22 +47,22 @@ function Le(z) {
47
47
  selectedColor: G,
48
48
  onSeriesMouseClick: A,
49
49
  resetSelectionOnDoubleClick: Q,
50
- detailsOnClick: y,
50
+ detailsOnClick: v,
51
51
  styles: T,
52
52
  classNames: x,
53
- animate: v,
53
+ animate: w,
54
54
  precision: Z
55
55
  } = z, E = ae(null), H = je(E, {
56
- once: v.once,
57
- amount: v.amount
56
+ once: w.once,
57
+ amount: w.amount
58
58
  }), s = {
59
59
  top: _,
60
60
  bottom: U,
61
61
  left: S,
62
62
  right: B
63
- }, [C, V] = O(void 0), [n, N] = O(void 0), [R, b] = O(void 0), [o, X] = O(void 0), ee = I - s.left - s.right, te = W - s.top - s.bottom, u = ne(d, (e) => e.column).map((e) => e.column), h = ne(d, (e) => e.row).map((e) => e.row), j = ce().domain(h).range([0, te]), D = j.bandwidth(), c = ce().domain(u).range([0, ee]), $ = c.bandwidth(), P = F === "categorical" ? ve().domain(M).range(q) : F === "threshold" ? Ce().domain(M).range(q) : be().domain(M).range(q);
64
- return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
65
- /* @__PURE__ */ t.jsxs(
63
+ }, [C, V] = O(void 0), [n, N] = O(void 0), [R, b] = O(void 0), [o, X] = O(void 0), ee = I - s.left - s.right, te = W - s.top - s.bottom, m = ne(d, "column", !0), h = ne(d, "row", !0), j = ce().domain(h).range([0, te]), D = j.bandwidth(), c = ce().domain(m).range([0, ee]), $ = c.bandwidth(), P = F === "categorical" ? we().domain(M).range(q) : F === "threshold" ? Ce().domain(M).range(q) : be().domain(M).range(q);
64
+ return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
65
+ /* @__PURE__ */ e.jsxs(
66
66
  ie.svg,
67
67
  {
68
68
  width: `${I}px`,
@@ -72,27 +72,27 @@ function Le(z) {
72
72
  direction: "ltr",
73
73
  ref: E,
74
74
  children: [
75
- /* @__PURE__ */ t.jsx("g", { transform: `translate(${s.left},0)`, children: L ? u.map((e, w) => /* @__PURE__ */ t.jsx(
76
- we,
75
+ /* @__PURE__ */ e.jsx("g", { transform: `translate(${s.left},0)`, children: L ? m.map((t, y) => /* @__PURE__ */ e.jsx(
76
+ ye,
77
77
  {
78
78
  y: 0,
79
- x: c(e),
79
+ x: c(t),
80
80
  width: $,
81
81
  height: s.top - 5,
82
- value: `${e}`.length < p ? `${e}` : `${`${e}`.substring(0, p)}...`,
82
+ value: `${t}`.length < p ? `${t}` : `${`${t}`.substring(0, p)}...`,
83
83
  style: T?.xAxis?.labels,
84
84
  className: x?.xAxis?.labels,
85
85
  alignment: "bottom",
86
86
  animate: { duration: 0, once: !0, amount: 0 },
87
87
  isInView: H
88
88
  },
89
- w
89
+ y
90
90
  )) : null }),
91
- /* @__PURE__ */ t.jsx("g", { transform: `translate(0,${s.top})`, children: K ? h.map((e, w) => /* @__PURE__ */ t.jsx(
92
- ye,
91
+ /* @__PURE__ */ e.jsx("g", { transform: `translate(0,${s.top})`, children: K ? h.map((t, y) => /* @__PURE__ */ e.jsx(
92
+ ve,
93
93
  {
94
- value: `${e}`.length < p ? `${e}` : `${`${e}`.substring(0, p)}...`,
95
- y: j(e),
94
+ value: `${t}`.length < p ? `${t}` : `${`${t}`.substring(0, p)}...`,
95
+ y: j(t),
96
96
  x: 0,
97
97
  width: s.left,
98
98
  height: D,
@@ -102,10 +102,10 @@ function Le(z) {
102
102
  animate: { duration: 0, once: !0, amount: 0 },
103
103
  isInView: H
104
104
  },
105
- w
105
+ y
106
106
  )) : null }),
107
- /* @__PURE__ */ t.jsxs("g", { transform: `translate(${s.left},${s.top})`, children: [
108
- h.map((e, w) => /* @__PURE__ */ t.jsx("g", { transform: `translate(0,${j(e)})`, children: u.map((g) => /* @__PURE__ */ t.jsx(
107
+ /* @__PURE__ */ e.jsxs("g", { transform: `translate(${s.left},${s.top})`, children: [
108
+ h.map((t, y) => /* @__PURE__ */ e.jsx("g", { transform: `translate(0,${j(t)})`, children: m.map((g) => /* @__PURE__ */ e.jsx(
109
109
  "rect",
110
110
  {
111
111
  x: c(g),
@@ -115,32 +115,32 @@ function Le(z) {
115
115
  style: { fill: f },
116
116
  className: "stroke-1 stroke-primary-white dark:stroke-primary-gray-700"
117
117
  },
118
- `${e}-${g}`
119
- )) }, w)),
120
- d.filter((e) => !re(e.value)).map((e, w) => {
121
- const g = re(e.value) ? f : (
118
+ `${t}-${g}`
119
+ )) }, y)),
120
+ d.filter((t) => !re(t.value)).map((t, y) => {
121
+ const g = re(t.value) ? f : (
122
122
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
123
- P(e.value)
123
+ P(t.value)
124
124
  );
125
- return /* @__PURE__ */ t.jsxs(
125
+ return /* @__PURE__ */ e.jsxs(
126
126
  "g",
127
127
  {
128
- transform: `translate(${c(e.column)},${j(e.row)})`,
129
- onMouseEnter: (m) => {
130
- N(e), X(m.clientY), b(m.clientX), r?.(e);
128
+ transform: `translate(${c(t.column)},${j(t.row)})`,
129
+ onMouseEnter: (u) => {
130
+ N(t), X(u.clientY), b(u.clientX), r?.(t);
131
131
  },
132
132
  onClick: () => {
133
- (A || y) && (he(C, e) && Q ? (V(void 0), A?.(void 0)) : (V(e), A?.(e)));
133
+ (A || v) && (he(C, t) && Q ? (V(void 0), A?.(void 0)) : (V(t), A?.(t)));
134
134
  },
135
- onMouseMove: (m) => {
136
- N(e), X(m.clientY), b(m.clientX);
135
+ onMouseMove: (u) => {
136
+ N(t), X(u.clientY), b(u.clientX);
137
137
  },
138
138
  onMouseLeave: () => {
139
139
  N(void 0), b(void 0), X(void 0), r?.(void 0);
140
140
  },
141
141
  opacity: G ? G === g ? 1 : 0.3 : 1,
142
142
  children: [
143
- /* @__PURE__ */ t.jsx(
143
+ /* @__PURE__ */ e.jsx(
144
144
  ie.rect,
145
145
  {
146
146
  x: 0,
@@ -148,33 +148,33 @@ function Le(z) {
148
148
  width: $,
149
149
  height: D,
150
150
  className: "stroke-1 stroke-primary-white dark:stroke-primary-gray-700",
151
- exit: { opacity: 0, transition: { duration: v.duration } },
151
+ exit: { opacity: 0, transition: { duration: w.duration } },
152
152
  variants: {
153
153
  initial: { fill: g, opacity: 0 },
154
154
  whileInView: {
155
155
  fill: g,
156
156
  opacity: 1,
157
- transition: { duration: v.duration }
157
+ transition: { duration: w.duration }
158
158
  }
159
159
  },
160
160
  initial: "initial",
161
161
  animate: H ? "whileInView" : "initial"
162
162
  }
163
163
  ),
164
- Y && !re(e.value) ? /* @__PURE__ */ t.jsx(
164
+ Y && !re(t.value) ? /* @__PURE__ */ e.jsx(
165
165
  ie.g,
166
166
  {
167
167
  variants: {
168
168
  initial: { opacity: 0 },
169
- whileInView: { opacity: 1, transition: { duration: v.duration } }
169
+ whileInView: { opacity: 1, transition: { duration: w.duration } }
170
170
  },
171
171
  initial: "initial",
172
172
  animate: H ? "whileInView" : "initial",
173
- exit: { opacity: 0, transition: { duration: v.duration } },
174
- children: /* @__PURE__ */ t.jsx("foreignObject", { y: 0, x: 0, width: $, height: D, children: /* @__PURE__ */ t.jsx("div", { className: "flex flex-col justify-center items-center h-inherit p-1", children: /* @__PURE__ */ t.jsx(
173
+ exit: { opacity: 0, transition: { duration: w.duration } },
174
+ children: /* @__PURE__ */ e.jsx("foreignObject", { y: 0, x: 0, width: $, height: D, children: /* @__PURE__ */ e.jsx("div", { className: "flex flex-col justify-center items-center h-inherit p-1", children: /* @__PURE__ */ e.jsx(
175
175
  "p",
176
176
  {
177
- className: me(
177
+ className: ue(
178
178
  "text-xs text-center m-0 leading-[1.25] graph-value",
179
179
  x?.graphObjectValues
180
180
  ),
@@ -182,17 +182,17 @@ function Le(z) {
182
182
  color: fe(g),
183
183
  ...T?.graphObjectValues || {}
184
184
  },
185
- children: de(e.value, "NA", Z, i, J)
185
+ children: de(t.value, "NA", Z, i, J)
186
186
  }
187
- ) }) }, w)
187
+ ) }) }, y)
188
188
  }
189
189
  ) : null
190
190
  ]
191
191
  },
192
- `${e.column}-${e.row}`
192
+ `${t.column}-${t.row}`
193
193
  );
194
194
  }),
195
- n ? /* @__PURE__ */ t.jsx(
195
+ n ? /* @__PURE__ */ e.jsx(
196
196
  "rect",
197
197
  {
198
198
  x: c(n.column),
@@ -211,7 +211,7 @@ function Le(z) {
211
211
  ]
212
212
  }
213
213
  ),
214
- n && k && R && o ? /* @__PURE__ */ t.jsx(
214
+ n && k && R && o ? /* @__PURE__ */ e.jsx(
215
215
  pe,
216
216
  {
217
217
  data: n,
@@ -222,19 +222,19 @@ function Le(z) {
222
222
  className: x?.tooltip
223
223
  }
224
224
  ) : null,
225
- y && C !== void 0 ? /* @__PURE__ */ t.jsx(
225
+ v && C !== void 0 ? /* @__PURE__ */ e.jsx(
226
226
  ge,
227
227
  {
228
228
  open: C !== void 0,
229
229
  onClose: () => {
230
230
  V(void 0);
231
231
  },
232
- children: /* @__PURE__ */ t.jsx(
232
+ children: /* @__PURE__ */ e.jsx(
233
233
  "div",
234
234
  {
235
235
  className: "graph-modal-content m-0",
236
- dangerouslySetInnerHTML: typeof y == "string" ? { __html: xe(y, C) } : void 0,
237
- children: typeof y == "function" ? y(C) : null
236
+ dangerouslySetInnerHTML: typeof v == "string" ? { __html: xe(v, C) } : void 0,
237
+ children: typeof v == "function" ? v(C) : null
238
238
  }
239
239
  )
240
240
  }
@@ -265,10 +265,10 @@ function ot(z) {
265
265
  tooltip: G,
266
266
  onSeriesMouseOver: A,
267
267
  suffix: Q = "",
268
- prefix: y = "",
268
+ prefix: v = "",
269
269
  showRowLabels: T = !0,
270
270
  relativeHeight: x,
271
- showValues: v,
271
+ showValues: w,
272
272
  graphID: Z,
273
273
  noDataColor: E = a.gray,
274
274
  showColorScale: H = !0,
@@ -283,50 +283,50 @@ function ot(z) {
283
283
  ariaLabel: X,
284
284
  resetSelectionOnDoubleClick: ee = !0,
285
285
  detailsOnClick: te,
286
- styles: u,
286
+ styles: m,
287
287
  classNames: h,
288
288
  animate: j = !1,
289
289
  precision: D = 2
290
- } = z, [c, $] = O(0), [P, e] = O(0), [w, g] = O(void 0), m = ae(null), le = ae(null);
291
- ue(() => {
290
+ } = z, [c, $] = O(0), [P, t] = O(0), [y, g] = O(void 0), u = ae(null), le = ae(null);
291
+ me(() => {
292
292
  const l = new ResizeObserver((se) => {
293
- $(r || se[0].target.clientWidth || 620), e(k || se[0].target.clientHeight || 480);
293
+ $(r || se[0].target.clientWidth || 620), t(k || se[0].target.clientHeight || 480);
294
294
  });
295
- return m.current && (e(m.current.clientHeight || 480), $(m.current.clientWidth || 620), r || l.observe(m.current)), () => l.disconnect();
295
+ return u.current && (t(u.current.clientHeight || 480), $(u.current.clientWidth || 620), r || l.observe(u.current)), () => l.disconnect();
296
296
  }, [r, k]);
297
297
  const oe = J || (typeof i[0] == "string" ? "categorical" : i.length === 2 ? "linear" : "threshold");
298
- return /* @__PURE__ */ t.jsx(
298
+ return /* @__PURE__ */ e.jsx(
299
299
  "div",
300
300
  {
301
301
  className: `${o || "light"} flex ${r ? "grow-0" : "grow"} ${n ? "w-full" : "w-fit"}`,
302
302
  dir: N === "he" || N === "ar" ? "rtl" : void 0,
303
- children: /* @__PURE__ */ t.jsx(
303
+ children: /* @__PURE__ */ e.jsx(
304
304
  "div",
305
305
  {
306
- className: me(
306
+ className: ue(
307
307
  `${f ? f === !0 ? "bg-primary-gray-200 dark:bg-primary-gray-650 " : "" : "bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${N || "en"}`,
308
308
  n ? "w-full" : "w-fit",
309
309
  h?.graphContainer
310
310
  ),
311
311
  style: {
312
- ...u?.graphContainer || {},
312
+ ...m?.graphContainer || {},
313
313
  ...f && f !== !0 ? { backgroundColor: f } : {}
314
314
  },
315
315
  id: Z,
316
316
  ref: le,
317
317
  "aria-label": X || `${L ? `The graph shows ${L}. ` : ""}This is a heatmap. ${p ? ` ${p}` : ""}`,
318
- children: /* @__PURE__ */ t.jsx(
318
+ children: /* @__PURE__ */ e.jsx(
319
319
  "div",
320
320
  {
321
321
  className: "flex grow",
322
322
  style: { padding: f ? q || "1rem" : q || 0 },
323
- children: /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col w-full gap-4 grow justify-between", children: [
324
- L || p || C || V ? /* @__PURE__ */ t.jsx(
323
+ children: /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col w-full gap-4 grow justify-between", children: [
324
+ L || p || C || V ? /* @__PURE__ */ e.jsx(
325
325
  $e,
326
326
  {
327
327
  styles: {
328
- title: u?.title,
329
- description: u?.description
328
+ title: m?.title,
329
+ description: m?.description
330
330
  },
331
331
  classNames: {
332
332
  title: h?.title,
@@ -339,8 +339,8 @@ function ot(z) {
339
339
  dataDownload: V ? d.map((l) => l.data).filter((l) => l !== void 0).length > 0 ? d.map((l) => l.data).filter((l) => l !== void 0) : d.filter((l) => l !== void 0) : null
340
340
  }
341
341
  ) : null,
342
- /* @__PURE__ */ t.jsx("div", { className: "grow flex flex-col justify-center gap-3 w-full", children: d.length === 0 ? /* @__PURE__ */ t.jsx(Oe, {}) : /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
343
- H ? oe === "categorical" ? /* @__PURE__ */ t.jsx(
342
+ /* @__PURE__ */ e.jsx("div", { className: "grow flex flex-col justify-center gap-3 w-full", children: d.length === 0 ? /* @__PURE__ */ e.jsx(Oe, {}) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
343
+ H ? oe === "categorical" ? /* @__PURE__ */ e.jsx(
344
344
  Me,
345
345
  {
346
346
  width: n ? void 0 : r,
@@ -353,7 +353,7 @@ function ot(z) {
353
353
  setSelectedColor: g,
354
354
  showNAColor: R
355
355
  }
356
- ) : oe === "threshold" ? /* @__PURE__ */ t.jsx(
356
+ ) : oe === "threshold" ? /* @__PURE__ */ e.jsx(
357
357
  De,
358
358
  {
359
359
  width: n ? void 0 : r,
@@ -367,7 +367,7 @@ function ot(z) {
367
367
  naColor: E,
368
368
  showNAColor: R
369
369
  }
370
- ) : /* @__PURE__ */ t.jsx(
370
+ ) : /* @__PURE__ */ e.jsx(
371
371
  Ne,
372
372
  {
373
373
  width: n ? void 0 : r,
@@ -379,13 +379,13 @@ function ot(z) {
379
379
  colorDomain: i
380
380
  }
381
381
  ) : null,
382
- /* @__PURE__ */ t.jsx(
382
+ /* @__PURE__ */ e.jsx(
383
383
  "div",
384
384
  {
385
385
  className: "flex grow flex-col justify-center w-full leading-0",
386
- ref: m,
386
+ ref: u,
387
387
  "aria-label": "Graph area",
388
- children: (r || c) && (k || P) ? /* @__PURE__ */ t.jsx(
388
+ children: (r || c) && (k || P) ? /* @__PURE__ */ e.jsx(
389
389
  Le,
390
390
  {
391
391
  data: d,
@@ -406,18 +406,18 @@ function ot(z) {
406
406
  rightMargin: _,
407
407
  topMargin: F,
408
408
  bottomMargin: K,
409
- selectedColor: w,
409
+ selectedColor: y,
410
410
  truncateBy: U,
411
411
  showRowLabels: T,
412
412
  tooltip: G,
413
413
  onSeriesMouseOver: A,
414
- showValues: v,
414
+ showValues: w,
415
415
  suffix: Q,
416
- prefix: y,
416
+ prefix: v,
417
417
  onSeriesMouseClick: s,
418
418
  resetSelectionOnDoubleClick: ee,
419
419
  detailsOnClick: te,
420
- styles: u,
420
+ styles: m,
421
421
  classNames: h,
422
422
  animate: j === !0 ? { duration: 0.5, once: !0, amount: 0.5 } : j || { duration: 0, once: !0, amount: 0 },
423
423
  precision: D
@@ -426,10 +426,10 @@ function ot(z) {
426
426
  }
427
427
  )
428
428
  ] }) }),
429
- B || Y ? /* @__PURE__ */ t.jsx(
429
+ B || Y ? /* @__PURE__ */ e.jsx(
430
430
  ke,
431
431
  {
432
- styles: { footnote: u?.footnote, source: u?.source },
432
+ styles: { footnote: m?.footnote, source: m?.source },
433
433
  classNames: {
434
434
  footnote: h?.footnote,
435
435
  source: h?.source
@@ -1 +1 @@
1
- {"version":3,"file":"HeatMap.js","sources":["../src/Components/Graphs/HeatMap/Graph.tsx","../src/Components/Graphs/HeatMap/index.tsx"],"sourcesContent":["import isEqual from 'fast-deep-equal';\r\nimport { scaleLinear, scaleBand, scaleOrdinal, scaleThreshold } from 'd3-scale';\r\nimport { useRef, useState } from 'react';\r\nimport uniqBy from 'lodash.uniqby';\r\nimport { cn } from '@undp/design-system-react/cn';\r\nimport { Modal } from '@undp/design-system-react/Modal';\r\nimport { motion, useInView } from 'motion/react';\r\n\r\nimport {\r\n AnimateDataType,\r\n ClassNameObject,\r\n HeatMapDataType,\r\n ScaleDataType,\r\n StyleObject,\r\n} from '@/Types';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { getTextColorBasedOnBgColor } from '@/Utils/getTextColorBasedOnBgColor';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { string2HTML } from '@/Utils/string2HTML';\r\nimport { XAxesLabels } from '@/Components/Elements/Axes/XAxesLabels';\r\nimport { YAxesLabels } from '@/Components/Elements/Axes/YAxesLabels';\r\n\r\ninterface Props {\r\n data: HeatMapDataType[];\r\n colorDomain: string[] | number[];\r\n colors: string[];\r\n noDataColor: string;\r\n scaleType: ScaleDataType;\r\n showColumnLabels: boolean;\r\n leftMargin: number;\r\n truncateBy: number;\r\n width: number;\r\n height: number;\r\n rightMargin: number;\r\n topMargin: number;\r\n showRowLabels: boolean;\r\n bottomMargin: number;\r\n suffix: string;\r\n prefix: string;\r\n showValues?: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n selectedColor?: string;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n resetSelectionOnDoubleClick: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n animate: AnimateDataType;\r\n precision: number;\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n const {\r\n data,\r\n showColumnLabels,\r\n leftMargin,\r\n rightMargin,\r\n truncateBy,\r\n width,\r\n height,\r\n topMargin,\r\n bottomMargin,\r\n tooltip,\r\n onSeriesMouseOver,\r\n suffix,\r\n prefix,\r\n showValues,\r\n colorDomain,\r\n colors,\r\n noDataColor,\r\n scaleType,\r\n showRowLabels,\r\n selectedColor,\r\n onSeriesMouseClick,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n animate,\r\n precision,\r\n } = props;\r\n const svgRef = useRef(null);\r\n const isInView = useInView(svgRef, {\r\n once: animate.once,\r\n amount: animate.amount,\r\n });\r\n const margin = {\r\n top: topMargin,\r\n bottom: bottomMargin,\r\n left: leftMargin,\r\n right: rightMargin,\r\n };\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseClickData, setMouseClickData] = useState<any>(undefined);\r\n const [mouseOverData, setMouseOverData] = useState<HeatMapDataType | undefined>(undefined);\r\n const [eventX, setEventX] = useState<number | undefined>(undefined);\r\n const [eventY, setEventY] = useState<number | undefined>(undefined);\r\n const graphWidth = width - margin.left - margin.right;\r\n const graphHeight = height - margin.top - margin.bottom;\r\n const columns = uniqBy(data, d => d.column).map(d => d.column);\r\n const rows = uniqBy(data, d => d.row).map(d => d.row);\r\n const y = scaleBand().domain(rows).range([0, graphHeight]);\r\n const barHeight = y.bandwidth();\r\n const x = scaleBand().domain(columns).range([0, graphWidth]);\r\n const barWidth = x.bandwidth();\r\n const colorScale =\r\n scaleType === 'categorical'\r\n ? scaleOrdinal<number | string, string>().domain(colorDomain).range(colors)\r\n : scaleType === 'threshold'\r\n ? scaleThreshold<number, string>()\r\n .domain(colorDomain as number[])\r\n .range(colors)\r\n : scaleLinear<string, string>()\r\n .domain(colorDomain as number[])\r\n .range(colors);\r\n return (\r\n <>\r\n <motion.svg\r\n width={`${width}px`}\r\n height={`${height}px`}\r\n viewBox={`0 0 ${width} ${height}`}\r\n style={{ marginLeft: 'auto', marginRight: 'auto' }}\r\n direction='ltr'\r\n ref={svgRef}\r\n >\r\n <g transform={`translate(${margin.left},${0})`}>\r\n {showColumnLabels\r\n ? columns.map((d, i) => (\r\n <XAxesLabels\r\n key={i}\r\n y={0}\r\n x={x(d) as number}\r\n width={barWidth}\r\n height={margin.top - 5}\r\n value={\r\n `${d}`.length < truncateBy ? `${d}` : `${`${d}`.substring(0, truncateBy)}...`\r\n }\r\n style={styles?.xAxis?.labels}\r\n className={classNames?.xAxis?.labels}\r\n alignment='bottom'\r\n animate={{ duration: 0, once: true, amount: 0 }}\r\n isInView={isInView}\r\n />\r\n ))\r\n : null}\r\n </g>\r\n <g transform={`translate(${0},${margin.top})`}>\r\n {showRowLabels\r\n ? rows.map((d, i) => (\r\n <YAxesLabels\r\n value={\r\n `${d}`.length < truncateBy ? `${d}` : `${`${d}`.substring(0, truncateBy)}...`\r\n }\r\n key={i}\r\n y={y(d) as number}\r\n x={0}\r\n width={margin.left}\r\n height={barHeight}\r\n alignment='right'\r\n style={styles?.yAxis?.labels}\r\n className={classNames?.yAxis?.labels}\r\n animate={{ duration: 0, once: true, amount: 0 }}\r\n isInView={isInView}\r\n />\r\n ))\r\n : null}\r\n </g>\r\n <g transform={`translate(${margin.left},${margin.top})`}>\r\n {rows.map((d, i) => (\r\n <g key={i} transform={`translate(0,${y(d)})`}>\r\n {columns.map(el => (\r\n <rect\r\n key={`${d}-${el}`}\r\n x={x(el)}\r\n y={0}\r\n width={barWidth}\r\n height={barHeight}\r\n style={{ fill: noDataColor }}\r\n className='stroke-1 stroke-primary-white dark:stroke-primary-gray-700'\r\n />\r\n ))}\r\n </g>\r\n ))}\r\n {data\r\n .filter(d => !checkIfNullOrUndefined(d.value))\r\n .map((d, i) => {\r\n const color = !checkIfNullOrUndefined(d.value)\r\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n colorScale(d.value as any)\r\n : noDataColor;\r\n return (\r\n <g\r\n key={`${d.column}-${d.row}`}\r\n transform={`translate(${x(d.column)},${y(d.row)})`}\r\n onMouseEnter={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n onSeriesMouseOver?.(d);\r\n }}\r\n onClick={() => {\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (isEqual(mouseClickData, d) && resetSelectionOnDoubleClick) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(d);\r\n onSeriesMouseClick?.(d);\r\n }\r\n }\r\n }}\r\n onMouseMove={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n }}\r\n onMouseLeave={() => {\r\n setMouseOverData(undefined);\r\n setEventX(undefined);\r\n setEventY(undefined);\r\n onSeriesMouseOver?.(undefined);\r\n }}\r\n opacity={selectedColor ? (selectedColor === color ? 1 : 0.3) : 1}\r\n >\r\n <motion.rect\r\n x={0}\r\n y={0}\r\n width={barWidth}\r\n height={barHeight}\r\n className='stroke-1 stroke-primary-white dark:stroke-primary-gray-700'\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n variants={{\r\n initial: { fill: color, opacity: 0 },\r\n whileInView: {\r\n fill: color,\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n />\r\n {showValues && !checkIfNullOrUndefined(d.value) ? (\r\n <motion.g\r\n variants={{\r\n initial: { opacity: 0 },\r\n whileInView: { opacity: 1, transition: { duration: animate.duration } },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n >\r\n <foreignObject key={i} y={0} x={0} width={barWidth} height={barHeight}>\r\n <div className='flex flex-col justify-center items-center h-inherit p-1'>\r\n <p\r\n className={cn(\r\n 'text-xs text-center m-0 leading-[1.25] graph-value',\r\n classNames?.graphObjectValues,\r\n )}\r\n style={{\r\n color: getTextColorBasedOnBgColor(color),\r\n ...(styles?.graphObjectValues || {}),\r\n }}\r\n >\r\n {numberFormattingFunction(d.value, 'NA', precision, prefix, suffix)}\r\n </p>\r\n </div>\r\n </foreignObject>\r\n </motion.g>\r\n ) : null}\r\n </g>\r\n );\r\n })}\r\n {mouseOverData ? (\r\n <rect\r\n x={x(mouseOverData.column)}\r\n y={y(mouseOverData.row)}\r\n width={barWidth}\r\n height={barHeight}\r\n style={{\r\n fill: 'none',\r\n fillOpacity: 0,\r\n strokeWidth: 1.5,\r\n }}\r\n className='stroke-primary-gray-700 dark:stroke-primary-gray-300'\r\n />\r\n ) : null}\r\n </g>\r\n </motion.svg>\r\n {mouseOverData && tooltip && eventX && eventY ? (\r\n <Tooltip\r\n data={mouseOverData}\r\n body={tooltip}\r\n xPos={eventX}\r\n yPos={eventY}\r\n backgroundStyle={styles?.tooltip}\r\n className={classNames?.tooltip}\r\n />\r\n ) : null}\r\n {detailsOnClick && mouseClickData !== undefined ? (\r\n <Modal\r\n open={mouseClickData !== undefined}\r\n onClose={() => {\r\n setMouseClickData(undefined);\r\n }}\r\n >\r\n <div\r\n className='graph-modal-content m-0'\r\n dangerouslySetInnerHTML={\r\n typeof detailsOnClick === 'string'\r\n ? { __html: string2HTML(detailsOnClick, mouseClickData) }\r\n : undefined\r\n }\r\n >\r\n {typeof detailsOnClick === 'function' ? detailsOnClick(mouseClickData) : null}\r\n </div>\r\n </Modal>\r\n ) : null}\r\n </>\r\n );\r\n}\r\n","import { useState, useRef, useEffect } from 'react';\r\nimport { cn } from '@undp/design-system-react/cn';\r\n\r\nimport { Graph } from './Graph';\r\n\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport {\r\n HeatMapDataType,\r\n Languages,\r\n ScaleDataType,\r\n SourcesDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n AnimateDataType,\r\n} from '@/Types';\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { ColorLegendWithMouseOver } from '@/Components/Elements/ColorLegendWithMouseOver';\r\nimport { LinearColorLegend } from '@/Components/Elements/LinearColorLegend';\r\nimport { ThresholdColorLegendWithMouseOver } from '@/Components/Elements/ThresholdColorLegendWithMouseOver';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { EmptyState } from '@/Components/Elements/EmptyState';\r\n\r\ninterface Props {\r\n // Data\r\n /** Array of data objects */\r\n data: HeatMapDataType[];\r\n\r\n // Titles, Labels, and Sources\r\n /** Title of the graph */\r\n graphTitle?: string | React.ReactNode;\r\n /** Description of the graph */\r\n graphDescription?: string | React.ReactNode;\r\n /** Footnote for the graph */\r\n footNote?: string | React.ReactNode;\r\n /** Source data for the graph */\r\n sources?: SourcesDataType[];\r\n /** Accessibility label */\r\n ariaLabel?: string;\r\n\r\n // Colors and Styling\r\n /** Array of colors for cells */\r\n colors?: string[];\r\n /** Color where data is not available */\r\n noDataColor?: string;\r\n /** Title for the color legend */\r\n colorLegendTitle?: string;\r\n /** Background color of the graph */\r\n backgroundColor?: string | boolean;\r\n /** Custom styles for the graph. Each object should be a valid React CSS style object. */\r\n styles?: StyleObject;\r\n /** Custom class names */\r\n classNames?: ClassNameObject;\r\n\r\n // Size and Spacing\r\n /** Width of the graph */\r\n width?: number;\r\n /** Height of the graph */\r\n height?: number;\r\n /** Minimum height of the graph */\r\n minHeight?: number;\r\n /** Relative height scaling factor. This overwrites the height props */\r\n relativeHeight?: number;\r\n /** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */\r\n padding?: string;\r\n /** Left margin of the graph */\r\n leftMargin?: number;\r\n /** Right margin of the graph */\r\n rightMargin?: number;\r\n /** Top margin of the graph */\r\n topMargin?: number;\r\n /** Bottom margin of the graph */\r\n bottomMargin?: number;\r\n /** Toggles the background to fill the container. This only works if the width of the graph is defined. */\r\n fillContainer?: boolean;\r\n\r\n // Values and Ticks\r\n /** Prefix for values */\r\n prefix?: string;\r\n /** Suffix for values */\r\n suffix?: string;\r\n /** Maximum value for the chart */\r\n truncateBy?: number;\r\n /** Reference values for comparison */\r\n\r\n // Graph Parameters\r\n /** Toggle visibility of labels in the column */\r\n showColumnLabels?: boolean;\r\n /** Toggle visibility of labels in the row */\r\n showRowLabels?: boolean;\r\n /** Scale for the colors in the cell */\r\n scaleType?: ScaleDataType;\r\n /** Toggle visibility of values */\r\n showValues?: boolean;\r\n /** Toggle visibility of color scale. This is only applicable if the data props hae color parameter */\r\n showColorScale?: boolean;\r\n /** Toggle visibility of NA color in the color scale. This is only applicable if the data props hae color parameter and showColorScale prop is true */\r\n showNAColor?: boolean;\r\n /** Toggles if the graph animates in when loaded. */\r\n animate?: boolean | AnimateDataType;\r\n /** Domain for the colors in the cell. */\r\n colorDomain: number[] | string[];\r\n /** Specifies the number of decimal places to display in the value. */\r\n precision?: number;\r\n /** Enable graph download option as png */\r\n graphDownload?: boolean;\r\n /** Enable data download option as a csv */\r\n dataDownload?: boolean;\r\n /** Reset selection on double-click. Only applicable when used in a dashboard context with filters. */\r\n resetSelectionOnDoubleClick?: boolean;\r\n\r\n // Interactions and Callbacks\r\n /** Tooltip content. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n /** Details displayed on the modal when user clicks of a data point. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n /** Callback for mouse over event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n /** Callback for mouse click event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n\r\n // Configuration and Options\r\n /** Language setting */\r\n language?: Languages;\r\n /** Color theme */\r\n theme?: 'light' | 'dark';\r\n /** Unique ID for the graph */\r\n graphID?: string;\r\n}\r\n\r\nexport function HeatMap(props: Props) {\r\n const {\r\n data,\r\n graphTitle,\r\n colors,\r\n sources,\r\n graphDescription,\r\n showColumnLabels = true,\r\n leftMargin = 100,\r\n rightMargin = 10,\r\n truncateBy = 999,\r\n height,\r\n width,\r\n scaleType,\r\n colorDomain,\r\n footNote,\r\n colorLegendTitle,\r\n padding,\r\n backgroundColor = false,\r\n topMargin = 30,\r\n bottomMargin = 10,\r\n tooltip,\r\n onSeriesMouseOver,\r\n suffix = '',\r\n prefix = '',\r\n showRowLabels = true,\r\n relativeHeight,\r\n showValues,\r\n graphID,\r\n noDataColor = Colors.gray,\r\n showColorScale = true,\r\n onSeriesMouseClick,\r\n graphDownload = false,\r\n dataDownload = false,\r\n fillContainer = true,\r\n language = 'en',\r\n showNAColor = true,\r\n minHeight = 0,\r\n theme = 'light',\r\n ariaLabel,\r\n resetSelectionOnDoubleClick = true,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n animate = false,\r\n precision = 2,\r\n } = props;\r\n\r\n const [svgWidth, setSvgWidth] = useState(0);\r\n const [svgHeight, setSvgHeight] = useState(0);\r\n const [selectedColor, setSelectedColor] = useState<string | undefined>(undefined);\r\n\r\n const graphDiv = useRef<HTMLDivElement>(null);\r\n const graphParentDiv = useRef<HTMLDivElement>(null);\r\n useEffect(() => {\r\n const resizeObserver = new ResizeObserver(entries => {\r\n setSvgWidth(width || entries[0].target.clientWidth || 620);\r\n setSvgHeight(height || entries[0].target.clientHeight || 480);\r\n });\r\n if (graphDiv.current) {\r\n setSvgHeight(graphDiv.current.clientHeight || 480);\r\n setSvgWidth(graphDiv.current.clientWidth || 620);\r\n if (!width) resizeObserver.observe(graphDiv.current);\r\n }\r\n return () => resizeObserver.disconnect();\r\n }, [width, height]);\r\n const scale =\r\n scaleType ||\r\n (typeof colorDomain[0] === 'string'\r\n ? 'categorical'\r\n : colorDomain.length === 2\r\n ? 'linear'\r\n : 'threshold');\r\n\r\n return (\r\n <div\r\n className={`${theme || 'light'} flex ${width ? 'grow-0' : 'grow'} ${\r\n !fillContainer ? 'w-fit' : 'w-full'\r\n }`}\r\n dir={language === 'he' || language === 'ar' ? 'rtl' : undefined}\r\n >\r\n <div\r\n className={cn(\r\n `${\r\n !backgroundColor\r\n ? 'bg-transparent '\r\n : backgroundColor === true\r\n ? 'bg-primary-gray-200 dark:bg-primary-gray-650 '\r\n : ''\r\n }ml-auto mr-auto flex flex-col grow h-inherit ${language || 'en'}`,\r\n !fillContainer ? 'w-fit' : 'w-full',\r\n classNames?.graphContainer,\r\n )}\r\n style={{\r\n ...(styles?.graphContainer || {}),\r\n ...(backgroundColor && backgroundColor !== true ? { backgroundColor } : {}),\r\n }}\r\n id={graphID}\r\n ref={graphParentDiv}\r\n aria-label={\r\n ariaLabel ||\r\n `${\r\n graphTitle ? `The graph shows ${graphTitle}. ` : ''\r\n }This is a heatmap. ${graphDescription ? ` ${graphDescription}` : ''}`\r\n }\r\n >\r\n <div\r\n className='flex grow'\r\n style={{ padding: backgroundColor ? padding || '1rem' : padding || 0 }}\r\n >\r\n <div className='flex flex-col w-full gap-4 grow justify-between'>\r\n {graphTitle || graphDescription || graphDownload || dataDownload ? (\r\n <GraphHeader\r\n styles={{\r\n title: styles?.title,\r\n description: styles?.description,\r\n }}\r\n classNames={{\r\n title: classNames?.title,\r\n description: classNames?.description,\r\n }}\r\n graphTitle={graphTitle}\r\n graphDescription={graphDescription}\r\n width={width}\r\n graphDownload={graphDownload ? graphParentDiv.current : undefined}\r\n dataDownload={\r\n dataDownload\r\n ? data.map(d => d.data).filter(d => d !== undefined).length > 0\r\n ? data.map(d => d.data).filter(d => d !== undefined)\r\n : data.filter(d => d !== undefined)\r\n : null\r\n }\r\n />\r\n ) : null}\r\n <div className='grow flex flex-col justify-center gap-3 w-full'>\r\n {data.length === 0 ? (\r\n <EmptyState />\r\n ) : (\r\n <>\r\n {showColorScale ? (\r\n scale === 'categorical' ? (\r\n <ColorLegendWithMouseOver\r\n width={fillContainer ? undefined : width}\r\n colorLegendTitle={colorLegendTitle}\r\n colors={\r\n colors ||\r\n (typeof colorDomain[0] === 'string'\r\n ? Colors[theme].categoricalColors.colors\r\n : colorDomain.length === 2\r\n ? [\r\n Colors[theme].sequentialColors.neutralColorsx09[0],\r\n Colors[theme].sequentialColors.neutralColorsx09[8],\r\n ]\r\n : Colors[theme].sequentialColors[\r\n `neutralColorsx0${\r\n (colorDomain.length + 1) as 4 | 5 | 6 | 7 | 8 | 9\r\n }`\r\n ])\r\n }\r\n colorDomain={colorDomain.map(d => `${d}`)}\r\n setSelectedColor={setSelectedColor}\r\n showNAColor={showNAColor}\r\n />\r\n ) : scale === 'threshold' ? (\r\n <ThresholdColorLegendWithMouseOver\r\n width={fillContainer ? undefined : width}\r\n colorLegendTitle={colorLegendTitle}\r\n colors={\r\n colors ||\r\n (typeof colorDomain[0] === 'string'\r\n ? Colors[theme].categoricalColors.colors\r\n : colorDomain.length === 2\r\n ? [\r\n Colors[theme].sequentialColors.neutralColorsx09[0],\r\n Colors[theme].sequentialColors.neutralColorsx09[8],\r\n ]\r\n : Colors[theme].sequentialColors[\r\n `neutralColorsx0${\r\n (colorDomain.length + 1) as 4 | 5 | 6 | 7 | 8 | 9\r\n }`\r\n ])\r\n }\r\n colorDomain={colorDomain as number[]}\r\n setSelectedColor={setSelectedColor}\r\n naColor={noDataColor}\r\n showNAColor={showNAColor}\r\n />\r\n ) : (\r\n <LinearColorLegend\r\n width={fillContainer ? undefined : width}\r\n colorLegendTitle={colorLegendTitle}\r\n colors={\r\n colors || [\r\n Colors[theme].sequentialColors.neutralColorsx09[0],\r\n Colors[theme].sequentialColors.neutralColorsx09[8],\r\n ]\r\n }\r\n colorDomain={colorDomain as number[]}\r\n />\r\n )\r\n ) : null}\r\n <div\r\n className='flex grow flex-col justify-center w-full leading-0'\r\n ref={graphDiv}\r\n aria-label='Graph area'\r\n >\r\n {(width || svgWidth) && (height || svgHeight) ? (\r\n <Graph\r\n data={data}\r\n colorDomain={colorDomain}\r\n width={width || svgWidth}\r\n colors={\r\n colors ||\r\n (typeof colorDomain[0] === 'string'\r\n ? Colors[theme].categoricalColors.colors\r\n : colorDomain.length === 2\r\n ? [\r\n Colors[theme].sequentialColors.neutralColorsx09[0],\r\n Colors[theme].sequentialColors.neutralColorsx09[8],\r\n ]\r\n : Colors[theme].sequentialColors[\r\n `neutralColorsx0${\r\n (colorDomain.length + 1) as 4 | 5 | 6 | 7 | 8 | 9\r\n }`\r\n ])\r\n }\r\n noDataColor={noDataColor}\r\n scaleType={scale}\r\n height={Math.max(\r\n minHeight,\r\n height ||\r\n (relativeHeight\r\n ? minHeight\r\n ? (width || svgWidth) * relativeHeight > minHeight\r\n ? (width || svgWidth) * relativeHeight\r\n : minHeight\r\n : (width || svgWidth) * relativeHeight\r\n : svgHeight),\r\n )}\r\n showColumnLabels={showColumnLabels}\r\n leftMargin={leftMargin}\r\n rightMargin={rightMargin}\r\n topMargin={topMargin}\r\n bottomMargin={bottomMargin}\r\n selectedColor={selectedColor}\r\n truncateBy={truncateBy}\r\n showRowLabels={showRowLabels}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n showValues={showValues}\r\n suffix={suffix}\r\n prefix={prefix}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n detailsOnClick={detailsOnClick}\r\n styles={styles}\r\n classNames={classNames}\r\n animate={\r\n animate === true\r\n ? { duration: 0.5, once: true, amount: 0.5 }\r\n : animate || { duration: 0, once: true, amount: 0 }\r\n }\r\n precision={precision}\r\n />\r\n ) : null}\r\n </div>\r\n </>\r\n )}\r\n </div>\r\n {sources || footNote ? (\r\n <GraphFooter\r\n styles={{ footnote: styles?.footnote, source: styles?.source }}\r\n classNames={{\r\n footnote: classNames?.footnote,\r\n source: classNames?.source,\r\n }}\r\n sources={sources}\r\n footNote={footNote}\r\n width={width}\r\n />\r\n ) : null}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n}\r\n"],"names":["Graph","props","data","showColumnLabels","leftMargin","rightMargin","truncateBy","width","height","topMargin","bottomMargin","tooltip","onSeriesMouseOver","suffix","prefix","showValues","colorDomain","colors","noDataColor","scaleType","showRowLabels","selectedColor","onSeriesMouseClick","resetSelectionOnDoubleClick","detailsOnClick","styles","classNames","animate","precision","svgRef","useRef","isInView","useInView","margin","mouseClickData","setMouseClickData","useState","mouseOverData","setMouseOverData","eventX","setEventX","eventY","setEventY","graphWidth","graphHeight","columns","uniqBy","d","rows","y","scaleBand","barHeight","x","barWidth","colorScale","scaleOrdinal","scaleThreshold","scaleLinear","jsxs","Fragment","motion","jsx","i","XAxesLabels","YAxesLabels","el","checkIfNullOrUndefined","color","event","isEqual","cn","getTextColorBasedOnBgColor","Tooltip","Modal","string2HTML","HeatMap","graphTitle","sources","graphDescription","footNote","colorLegendTitle","padding","backgroundColor","relativeHeight","graphID","Colors","showColorScale","graphDownload","dataDownload","fillContainer","language","showNAColor","minHeight","theme","ariaLabel","svgWidth","setSvgWidth","svgHeight","setSvgHeight","setSelectedColor","graphDiv","graphParentDiv","useEffect","resizeObserver","entries","scale","GraphHeader","EmptyState","ColorLegendWithMouseOver","ThresholdColorLegendWithMouseOver","LinearColorLegend","GraphFooter"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAyDO,SAASA,GAAMC,GAAc;AAClC,QAAM;AAAA,IACJ,MAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,aAAAC;AAAA,IACA,YAAAC;AAAA,IACA,OAAAC;AAAA,IACA,QAAAC;AAAA,IACA,WAAAC;AAAA,IACA,cAAAC;AAAA,IACA,SAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,QAAAC;AAAA,IACA,QAAAC;AAAA,IACA,YAAAC;AAAA,IACA,aAAAC;AAAA,IACA,QAAAC;AAAA,IACA,aAAAC;AAAA,IACA,WAAAC;AAAA,IACA,eAAAC;AAAA,IACA,eAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,6BAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,QAAAC;AAAA,IACA,YAAAC;AAAA,IACA,SAAAC;AAAA,IACA,WAAAC;AAAA,EAAA,IACE3B,GACE4B,IAASC,GAAO,IAAI,GACpBC,IAAWC,GAAUH,GAAQ;AAAA,IACjC,MAAMF,EAAQ;AAAA,IACd,QAAQA,EAAQ;AAAA,EAAA,CACjB,GACKM,IAAS;AAAA,IACb,KAAKxB;AAAA,IACL,QAAQC;AAAA,IACR,MAAMN;AAAA,IACN,OAAOC;AAAA,EAAA,GAGH,CAAC6B,GAAgBC,CAAiB,IAAIC,EAAc,MAAS,GAC7D,CAACC,GAAeC,CAAgB,IAAIF,EAAsC,MAAS,GACnF,CAACG,GAAQC,CAAS,IAAIJ,EAA6B,MAAS,GAC5D,CAACK,GAAQC,CAAS,IAAIN,EAA6B,MAAS,GAC5DO,KAAapC,IAAQ0B,EAAO,OAAOA,EAAO,OAC1CW,KAAcpC,IAASyB,EAAO,MAA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0BACA,YAAAG;AAAA,0BACA,QAAAF;AAAA,0BACA,QAAAC;AAAA,0BACA,oBAAAQ;AAAA,0BACA,6BAAAC;AAAA,0BACA,gBAAAC;AAAA,0BACA,QAAAC;AAAA,0BACA,YAAAC;AAAA,0BACA,SACEC,MAAY,KACR,EAAE,UAAU,KAAK,MAAM,IAAM,QAAQ,IAAA,IACrCA,KAAW,EAAE,UAAU,GAAG,MAAM,IAAM,QAAQ,EAAA;AAAA,0BAEpD,WAAAC;AAAA,wBAAA;AAAA,sBAAA,IAEA;AAAA,oBAAA;AAAA,kBAAA;AAAA,gBACN,EAAA,CACF,EAAA,CAEJ;AAAA,gBACCiD,KAAWE,IACVlB,gBAAAA,EAAAA;AAAAA,kBAACkD;AAAA,kBAAA;AAAA,oBACC,QAAQ,EAAE,UAAUtF,GAAQ,UAAU,QAAQA,GAAQ,OAAA;AAAA,oBACtD,YAAY;AAAA,sBACV,UAAUC,GAAY;AAAA,sBACtB,QAAQA,GAAY;AAAA,oBAAA;AAAA,oBAEtB,SAAAmD;AAAA,oBACA,UAAAE;AAAA,oBACA,OAAAxE;AAAA,kBAAA;AAAA,gBAAA,IAEA;AAAA,cAAA,EAAA,CACN;AAAA,YAAA;AAAA,UAAA;AAAA,QACF;AAAA,MAAA;AAAA,IACF;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"HeatMap.js","sources":["../src/Components/Graphs/HeatMap/Graph.tsx","../src/Components/Graphs/HeatMap/index.tsx"],"sourcesContent":["import isEqual from 'fast-deep-equal';\r\nimport { scaleLinear, scaleBand, scaleOrdinal, scaleThreshold } from 'd3-scale';\r\nimport { useRef, useState } from 'react';\r\nimport { cn } from '@undp/design-system-react/cn';\r\nimport { Modal } from '@undp/design-system-react/Modal';\r\nimport { motion, useInView } from 'motion/react';\r\n\r\nimport {\r\n AnimateDataType,\r\n ClassNameObject,\r\n HeatMapDataType,\r\n ScaleDataType,\r\n StyleObject,\r\n} from '@/Types';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { getTextColorBasedOnBgColor } from '@/Utils/getTextColorBasedOnBgColor';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { string2HTML } from '@/Utils/string2HTML';\r\nimport { XAxesLabels } from '@/Components/Elements/Axes/XAxesLabels';\r\nimport { YAxesLabels } from '@/Components/Elements/Axes/YAxesLabels';\r\nimport { uniqBy } from '@/Utils/uniqBy';\r\n\r\ninterface Props {\r\n data: HeatMapDataType[];\r\n colorDomain: string[] | number[];\r\n colors: string[];\r\n noDataColor: string;\r\n scaleType: ScaleDataType;\r\n showColumnLabels: boolean;\r\n leftMargin: number;\r\n truncateBy: number;\r\n width: number;\r\n height: number;\r\n rightMargin: number;\r\n topMargin: number;\r\n showRowLabels: boolean;\r\n bottomMargin: number;\r\n suffix: string;\r\n prefix: string;\r\n showValues?: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n selectedColor?: string;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n resetSelectionOnDoubleClick: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n animate: AnimateDataType;\r\n precision: number;\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n const {\r\n data,\r\n showColumnLabels,\r\n leftMargin,\r\n rightMargin,\r\n truncateBy,\r\n width,\r\n height,\r\n topMargin,\r\n bottomMargin,\r\n tooltip,\r\n onSeriesMouseOver,\r\n suffix,\r\n prefix,\r\n showValues,\r\n colorDomain,\r\n colors,\r\n noDataColor,\r\n scaleType,\r\n showRowLabels,\r\n selectedColor,\r\n onSeriesMouseClick,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n animate,\r\n precision,\r\n } = props;\r\n const svgRef = useRef(null);\r\n const isInView = useInView(svgRef, {\r\n once: animate.once,\r\n amount: animate.amount,\r\n });\r\n const margin = {\r\n top: topMargin,\r\n bottom: bottomMargin,\r\n left: leftMargin,\r\n right: rightMargin,\r\n };\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseClickData, setMouseClickData] = useState<any>(undefined);\r\n const [mouseOverData, setMouseOverData] = useState<HeatMapDataType | undefined>(undefined);\r\n const [eventX, setEventX] = useState<number | undefined>(undefined);\r\n const [eventY, setEventY] = useState<number | undefined>(undefined);\r\n const graphWidth = width - margin.left - margin.right;\r\n const graphHeight = height - margin.top - margin.bottom;\r\n const columns = uniqBy(data, 'column', true) as string[];\r\n const rows = uniqBy(data, 'row', true) as string[];\r\n const y = scaleBand().domain(rows).range([0, graphHeight]);\r\n const barHeight = y.bandwidth();\r\n const x = scaleBand().domain(columns).range([0, graphWidth]);\r\n const barWidth = x.bandwidth();\r\n const colorScale =\r\n scaleType === 'categorical'\r\n ? scaleOrdinal<number | string, string>().domain(colorDomain).range(colors)\r\n : scaleType === 'threshold'\r\n ? scaleThreshold<number, string>()\r\n .domain(colorDomain as number[])\r\n .range(colors)\r\n : scaleLinear<string, string>()\r\n .domain(colorDomain as number[])\r\n .range(colors);\r\n return (\r\n <>\r\n <motion.svg\r\n width={`${width}px`}\r\n height={`${height}px`}\r\n viewBox={`0 0 ${width} ${height}`}\r\n style={{ marginLeft: 'auto', marginRight: 'auto' }}\r\n direction='ltr'\r\n ref={svgRef}\r\n >\r\n <g transform={`translate(${margin.left},${0})`}>\r\n {showColumnLabels\r\n ? columns.map((d, i) => (\r\n <XAxesLabels\r\n key={i}\r\n y={0}\r\n x={x(d) as number}\r\n width={barWidth}\r\n height={margin.top - 5}\r\n value={\r\n `${d}`.length < truncateBy ? `${d}` : `${`${d}`.substring(0, truncateBy)}...`\r\n }\r\n style={styles?.xAxis?.labels}\r\n className={classNames?.xAxis?.labels}\r\n alignment='bottom'\r\n animate={{ duration: 0, once: true, amount: 0 }}\r\n isInView={isInView}\r\n />\r\n ))\r\n : null}\r\n </g>\r\n <g transform={`translate(${0},${margin.top})`}>\r\n {showRowLabels\r\n ? rows.map((d, i) => (\r\n <YAxesLabels\r\n value={\r\n `${d}`.length < truncateBy ? `${d}` : `${`${d}`.substring(0, truncateBy)}...`\r\n }\r\n key={i}\r\n y={y(d) as number}\r\n x={0}\r\n width={margin.left}\r\n height={barHeight}\r\n alignment='right'\r\n style={styles?.yAxis?.labels}\r\n className={classNames?.yAxis?.labels}\r\n animate={{ duration: 0, once: true, amount: 0 }}\r\n isInView={isInView}\r\n />\r\n ))\r\n : null}\r\n </g>\r\n <g transform={`translate(${margin.left},${margin.top})`}>\r\n {rows.map((d, i) => (\r\n <g key={i} transform={`translate(0,${y(d)})`}>\r\n {columns.map(el => (\r\n <rect\r\n key={`${d}-${el}`}\r\n x={x(el)}\r\n y={0}\r\n width={barWidth}\r\n height={barHeight}\r\n style={{ fill: noDataColor }}\r\n className='stroke-1 stroke-primary-white dark:stroke-primary-gray-700'\r\n />\r\n ))}\r\n </g>\r\n ))}\r\n {data\r\n .filter(d => !checkIfNullOrUndefined(d.value))\r\n .map((d, i) => {\r\n const color = !checkIfNullOrUndefined(d.value)\r\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n colorScale(d.value as any)\r\n : noDataColor;\r\n return (\r\n <g\r\n key={`${d.column}-${d.row}`}\r\n transform={`translate(${x(d.column)},${y(d.row)})`}\r\n onMouseEnter={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n onSeriesMouseOver?.(d);\r\n }}\r\n onClick={() => {\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (isEqual(mouseClickData, d) && resetSelectionOnDoubleClick) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(d);\r\n onSeriesMouseClick?.(d);\r\n }\r\n }\r\n }}\r\n onMouseMove={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n }}\r\n onMouseLeave={() => {\r\n setMouseOverData(undefined);\r\n setEventX(undefined);\r\n setEventY(undefined);\r\n onSeriesMouseOver?.(undefined);\r\n }}\r\n opacity={selectedColor ? (selectedColor === color ? 1 : 0.3) : 1}\r\n >\r\n <motion.rect\r\n x={0}\r\n y={0}\r\n width={barWidth}\r\n height={barHeight}\r\n className='stroke-1 stroke-primary-white dark:stroke-primary-gray-700'\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n variants={{\r\n initial: { fill: color, opacity: 0 },\r\n whileInView: {\r\n fill: color,\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n />\r\n {showValues && !checkIfNullOrUndefined(d.value) ? (\r\n <motion.g\r\n variants={{\r\n initial: { opacity: 0 },\r\n whileInView: { opacity: 1, transition: { duration: animate.duration } },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n >\r\n <foreignObject key={i} y={0} x={0} width={barWidth} height={barHeight}>\r\n <div className='flex flex-col justify-center items-center h-inherit p-1'>\r\n <p\r\n className={cn(\r\n 'text-xs text-center m-0 leading-[1.25] graph-value',\r\n classNames?.graphObjectValues,\r\n )}\r\n style={{\r\n color: getTextColorBasedOnBgColor(color),\r\n ...(styles?.graphObjectValues || {}),\r\n }}\r\n >\r\n {numberFormattingFunction(d.value, 'NA', precision, prefix, suffix)}\r\n </p>\r\n </div>\r\n </foreignObject>\r\n </motion.g>\r\n ) : null}\r\n </g>\r\n );\r\n })}\r\n {mouseOverData ? (\r\n <rect\r\n x={x(mouseOverData.column)}\r\n y={y(mouseOverData.row)}\r\n width={barWidth}\r\n height={barHeight}\r\n style={{\r\n fill: 'none',\r\n fillOpacity: 0,\r\n strokeWidth: 1.5,\r\n }}\r\n className='stroke-primary-gray-700 dark:stroke-primary-gray-300'\r\n />\r\n ) : null}\r\n </g>\r\n </motion.svg>\r\n {mouseOverData && tooltip && eventX && eventY ? (\r\n <Tooltip\r\n data={mouseOverData}\r\n body={tooltip}\r\n xPos={eventX}\r\n yPos={eventY}\r\n backgroundStyle={styles?.tooltip}\r\n className={classNames?.tooltip}\r\n />\r\n ) : null}\r\n {detailsOnClick && mouseClickData !== undefined ? (\r\n <Modal\r\n open={mouseClickData !== undefined}\r\n onClose={() => {\r\n setMouseClickData(undefined);\r\n }}\r\n >\r\n <div\r\n className='graph-modal-content m-0'\r\n dangerouslySetInnerHTML={\r\n typeof detailsOnClick === 'string'\r\n ? { __html: string2HTML(detailsOnClick, mouseClickData) }\r\n : undefined\r\n }\r\n >\r\n {typeof detailsOnClick === 'function' ? detailsOnClick(mouseClickData) : null}\r\n </div>\r\n </Modal>\r\n ) : null}\r\n </>\r\n );\r\n}\r\n","import { useState, useRef, useEffect } from 'react';\r\nimport { cn } from '@undp/design-system-react/cn';\r\n\r\nimport { Graph } from './Graph';\r\n\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport {\r\n HeatMapDataType,\r\n Languages,\r\n ScaleDataType,\r\n SourcesDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n AnimateDataType,\r\n} from '@/Types';\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { ColorLegendWithMouseOver } from '@/Components/Elements/ColorLegendWithMouseOver';\r\nimport { LinearColorLegend } from '@/Components/Elements/LinearColorLegend';\r\nimport { ThresholdColorLegendWithMouseOver } from '@/Components/Elements/ThresholdColorLegendWithMouseOver';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { EmptyState } from '@/Components/Elements/EmptyState';\r\n\r\ninterface Props {\r\n // Data\r\n /** Array of data objects */\r\n data: HeatMapDataType[];\r\n\r\n // Titles, Labels, and Sources\r\n /** Title of the graph */\r\n graphTitle?: string | React.ReactNode;\r\n /** Description of the graph */\r\n graphDescription?: string | React.ReactNode;\r\n /** Footnote for the graph */\r\n footNote?: string | React.ReactNode;\r\n /** Source data for the graph */\r\n sources?: SourcesDataType[];\r\n /** Accessibility label */\r\n ariaLabel?: string;\r\n\r\n // Colors and Styling\r\n /** Array of colors for cells */\r\n colors?: string[];\r\n /** Color where data is not available */\r\n noDataColor?: string;\r\n /** Title for the color legend */\r\n colorLegendTitle?: string;\r\n /** Background color of the graph */\r\n backgroundColor?: string | boolean;\r\n /** Custom styles for the graph. Each object should be a valid React CSS style object. */\r\n styles?: StyleObject;\r\n /** Custom class names */\r\n classNames?: ClassNameObject;\r\n\r\n // Size and Spacing\r\n /** Width of the graph */\r\n width?: number;\r\n /** Height of the graph */\r\n height?: number;\r\n /** Minimum height of the graph */\r\n minHeight?: number;\r\n /** Relative height scaling factor. This overwrites the height props */\r\n relativeHeight?: number;\r\n /** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */\r\n padding?: string;\r\n /** Left margin of the graph */\r\n leftMargin?: number;\r\n /** Right margin of the graph */\r\n rightMargin?: number;\r\n /** Top margin of the graph */\r\n topMargin?: number;\r\n /** Bottom margin of the graph */\r\n bottomMargin?: number;\r\n /** Toggles the background to fill the container. This only works if the width of the graph is defined. */\r\n fillContainer?: boolean;\r\n\r\n // Values and Ticks\r\n /** Prefix for values */\r\n prefix?: string;\r\n /** Suffix for values */\r\n suffix?: string;\r\n /** Maximum value for the chart */\r\n truncateBy?: number;\r\n /** Reference values for comparison */\r\n\r\n // Graph Parameters\r\n /** Toggle visibility of labels in the column */\r\n showColumnLabels?: boolean;\r\n /** Toggle visibility of labels in the row */\r\n showRowLabels?: boolean;\r\n /** Scale for the colors in the cell */\r\n scaleType?: ScaleDataType;\r\n /** Toggle visibility of values */\r\n showValues?: boolean;\r\n /** Toggle visibility of color scale. This is only applicable if the data props hae color parameter */\r\n showColorScale?: boolean;\r\n /** Toggle visibility of NA color in the color scale. This is only applicable if the data props hae color parameter and showColorScale prop is true */\r\n showNAColor?: boolean;\r\n /** Toggles if the graph animates in when loaded. */\r\n animate?: boolean | AnimateDataType;\r\n /** Domain for the colors in the cell. */\r\n colorDomain: number[] | string[];\r\n /** Specifies the number of decimal places to display in the value. */\r\n precision?: number;\r\n /** Enable graph download option as png */\r\n graphDownload?: boolean;\r\n /** Enable data download option as a csv */\r\n dataDownload?: boolean;\r\n /** Reset selection on double-click. Only applicable when used in a dashboard context with filters. */\r\n resetSelectionOnDoubleClick?: boolean;\r\n\r\n // Interactions and Callbacks\r\n /** Tooltip content. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n /** Details displayed on the modal when user clicks of a data point. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n /** Callback for mouse over event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n /** Callback for mouse click event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n\r\n // Configuration and Options\r\n /** Language setting */\r\n language?: Languages;\r\n /** Color theme */\r\n theme?: 'light' | 'dark';\r\n /** Unique ID for the graph */\r\n graphID?: string;\r\n}\r\n\r\nexport function HeatMap(props: Props) {\r\n const {\r\n data,\r\n graphTitle,\r\n colors,\r\n sources,\r\n graphDescription,\r\n showColumnLabels = true,\r\n leftMargin = 100,\r\n rightMargin = 10,\r\n truncateBy = 999,\r\n height,\r\n width,\r\n scaleType,\r\n colorDomain,\r\n footNote,\r\n colorLegendTitle,\r\n padding,\r\n backgroundColor = false,\r\n topMargin = 30,\r\n bottomMargin = 10,\r\n tooltip,\r\n onSeriesMouseOver,\r\n suffix = '',\r\n prefix = '',\r\n showRowLabels = true,\r\n relativeHeight,\r\n showValues,\r\n graphID,\r\n noDataColor = Colors.gray,\r\n showColorScale = true,\r\n onSeriesMouseClick,\r\n graphDownload = false,\r\n dataDownload = false,\r\n fillContainer = true,\r\n language = 'en',\r\n showNAColor = true,\r\n minHeight = 0,\r\n theme = 'light',\r\n ariaLabel,\r\n resetSelectionOnDoubleClick = true,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n animate = false,\r\n precision = 2,\r\n } = props;\r\n\r\n const [svgWidth, setSvgWidth] = useState(0);\r\n const [svgHeight, setSvgHeight] = useState(0);\r\n const [selectedColor, setSelectedColor] = useState<string | undefined>(undefined);\r\n\r\n const graphDiv = useRef<HTMLDivElement>(null);\r\n const graphParentDiv = useRef<HTMLDivElement>(null);\r\n useEffect(() => {\r\n const resizeObserver = new ResizeObserver(entries => {\r\n setSvgWidth(width || entries[0].target.clientWidth || 620);\r\n setSvgHeight(height || entries[0].target.clientHeight || 480);\r\n });\r\n if (graphDiv.current) {\r\n setSvgHeight(graphDiv.current.clientHeight || 480);\r\n setSvgWidth(graphDiv.current.clientWidth || 620);\r\n if (!width) resizeObserver.observe(graphDiv.current);\r\n }\r\n return () => resizeObserver.disconnect();\r\n }, [width, height]);\r\n const scale =\r\n scaleType ||\r\n (typeof colorDomain[0] === 'string'\r\n ? 'categorical'\r\n : colorDomain.length === 2\r\n ? 'linear'\r\n : 'threshold');\r\n\r\n return (\r\n <div\r\n className={`${theme || 'light'} flex ${width ? 'grow-0' : 'grow'} ${\r\n !fillContainer ? 'w-fit' : 'w-full'\r\n }`}\r\n dir={language === 'he' || language === 'ar' ? 'rtl' : undefined}\r\n >\r\n <div\r\n className={cn(\r\n `${\r\n !backgroundColor\r\n ? 'bg-transparent '\r\n : backgroundColor === true\r\n ? 'bg-primary-gray-200 dark:bg-primary-gray-650 '\r\n : ''\r\n }ml-auto mr-auto flex flex-col grow h-inherit ${language || 'en'}`,\r\n !fillContainer ? 'w-fit' : 'w-full',\r\n classNames?.graphContainer,\r\n )}\r\n style={{\r\n ...(styles?.graphContainer || {}),\r\n ...(backgroundColor && backgroundColor !== true ? { backgroundColor } : {}),\r\n }}\r\n id={graphID}\r\n ref={graphParentDiv}\r\n aria-label={\r\n ariaLabel ||\r\n `${\r\n graphTitle ? `The graph shows ${graphTitle}. ` : ''\r\n }This is a heatmap. ${graphDescription ? ` ${graphDescription}` : ''}`\r\n }\r\n >\r\n <div\r\n className='flex grow'\r\n style={{ padding: backgroundColor ? padding || '1rem' : padding || 0 }}\r\n >\r\n <div className='flex flex-col w-full gap-4 grow justify-between'>\r\n {graphTitle || graphDescription || graphDownload || dataDownload ? (\r\n <GraphHeader\r\n styles={{\r\n title: styles?.title,\r\n description: styles?.description,\r\n }}\r\n classNames={{\r\n title: classNames?.title,\r\n description: classNames?.description,\r\n }}\r\n graphTitle={graphTitle}\r\n graphDescription={graphDescription}\r\n width={width}\r\n graphDownload={graphDownload ? graphParentDiv.current : undefined}\r\n dataDownload={\r\n dataDownload\r\n ? data.map(d => d.data).filter(d => d !== undefined).length > 0\r\n ? data.map(d => d.data).filter(d => d !== undefined)\r\n : data.filter(d => d !== undefined)\r\n : null\r\n }\r\n />\r\n ) : null}\r\n <div className='grow flex flex-col justify-center gap-3 w-full'>\r\n {data.length === 0 ? (\r\n <EmptyState />\r\n ) : (\r\n <>\r\n {showColorScale ? (\r\n scale === 'categorical' ? (\r\n <ColorLegendWithMouseOver\r\n width={fillContainer ? undefined : width}\r\n colorLegendTitle={colorLegendTitle}\r\n colors={\r\n colors ||\r\n (typeof colorDomain[0] === 'string'\r\n ? Colors[theme].categoricalColors.colors\r\n : colorDomain.length === 2\r\n ? [\r\n Colors[theme].sequentialColors.neutralColorsx09[0],\r\n Colors[theme].sequentialColors.neutralColorsx09[8],\r\n ]\r\n : Colors[theme].sequentialColors[\r\n `neutralColorsx0${\r\n (colorDomain.length + 1) as 4 | 5 | 6 | 7 | 8 | 9\r\n }`\r\n ])\r\n }\r\n colorDomain={colorDomain.map(d => `${d}`)}\r\n setSelectedColor={setSelectedColor}\r\n showNAColor={showNAColor}\r\n />\r\n ) : scale === 'threshold' ? (\r\n <ThresholdColorLegendWithMouseOver\r\n width={fillContainer ? undefined : width}\r\n colorLegendTitle={colorLegendTitle}\r\n colors={\r\n colors ||\r\n (typeof colorDomain[0] === 'string'\r\n ? Colors[theme].categoricalColors.colors\r\n : colorDomain.length === 2\r\n ? [\r\n Colors[theme].sequentialColors.neutralColorsx09[0],\r\n Colors[theme].sequentialColors.neutralColorsx09[8],\r\n ]\r\n : Colors[theme].sequentialColors[\r\n `neutralColorsx0${\r\n (colorDomain.length + 1) as 4 | 5 | 6 | 7 | 8 | 9\r\n }`\r\n ])\r\n }\r\n colorDomain={colorDomain as number[]}\r\n setSelectedColor={setSelectedColor}\r\n naColor={noDataColor}\r\n showNAColor={showNAColor}\r\n />\r\n ) : (\r\n <LinearColorLegend\r\n width={fillContainer ? undefined : width}\r\n colorLegendTitle={colorLegendTitle}\r\n colors={\r\n colors || [\r\n Colors[theme].sequentialColors.neutralColorsx09[0],\r\n Colors[theme].sequentialColors.neutralColorsx09[8],\r\n ]\r\n }\r\n colorDomain={colorDomain as number[]}\r\n />\r\n )\r\n ) : null}\r\n <div\r\n className='flex grow flex-col justify-center w-full leading-0'\r\n ref={graphDiv}\r\n aria-label='Graph area'\r\n >\r\n {(width || svgWidth) && (height || svgHeight) ? (\r\n <Graph\r\n data={data}\r\n colorDomain={colorDomain}\r\n width={width || svgWidth}\r\n colors={\r\n colors ||\r\n (typeof colorDomain[0] === 'string'\r\n ? Colors[theme].categoricalColors.colors\r\n : colorDomain.length === 2\r\n ? [\r\n Colors[theme].sequentialColors.neutralColorsx09[0],\r\n Colors[theme].sequentialColors.neutralColorsx09[8],\r\n ]\r\n : Colors[theme].sequentialColors[\r\n `neutralColorsx0${\r\n (colorDomain.length + 1) as 4 | 5 | 6 | 7 | 8 | 9\r\n }`\r\n ])\r\n }\r\n noDataColor={noDataColor}\r\n scaleType={scale}\r\n height={Math.max(\r\n minHeight,\r\n height ||\r\n (relativeHeight\r\n ? minHeight\r\n ? (width || svgWidth) * relativeHeight > minHeight\r\n ? (width || svgWidth) * relativeHeight\r\n : minHeight\r\n : (width || svgWidth) * relativeHeight\r\n : svgHeight),\r\n )}\r\n showColumnLabels={showColumnLabels}\r\n leftMargin={leftMargin}\r\n rightMargin={rightMargin}\r\n topMargin={topMargin}\r\n bottomMargin={bottomMargin}\r\n selectedColor={selectedColor}\r\n truncateBy={truncateBy}\r\n showRowLabels={showRowLabels}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n showValues={showValues}\r\n suffix={suffix}\r\n prefix={prefix}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n detailsOnClick={detailsOnClick}\r\n styles={styles}\r\n classNames={classNames}\r\n animate={\r\n animate === true\r\n ? { duration: 0.5, once: true, amount: 0.5 }\r\n : animate || { duration: 0, once: true, amount: 0 }\r\n }\r\n precision={precision}\r\n />\r\n ) : null}\r\n </div>\r\n </>\r\n )}\r\n </div>\r\n {sources || footNote ? (\r\n <GraphFooter\r\n styles={{ footnote: styles?.footnote, source: styles?.source }}\r\n classNames={{\r\n footnote: classNames?.footnote,\r\n source: classNames?.source,\r\n }}\r\n sources={sources}\r\n footNote={footNote}\r\n width={width}\r\n />\r\n ) : null}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n}\r\n"],"names":["Graph","props","data","showColumnLabels","leftMargin","rightMargin","truncateBy","width","height","topMargin","bottomMargin","tooltip","onSeriesMouseOver","suffix","prefix","showValues","colorDomain","colors","noDataColor","scaleType","showRowLabels","selectedColor","onSeriesMouseClick","resetSelectionOnDoubleClick","detailsOnClick","styles","classNames","animate","precision","svgRef","useRef","isInView","useInView","margin","mouseClickData","setMouseClickData","useState","mouseOverData","setMouseOverData","eventX","setEventX","eventY","setEventY","graphWidth","graphHeight","columns","uniqBy","rows","y","scaleBand","barHeight","x","barWidth","colorScale","scaleOrdinal","scaleThreshold","scaleLinear","jsxs","Fragment","motion","jsx","d","i","XAxesLabels","YAxesLabels","el","checkIfNullOrUndefined","color","event","isEqual","cn","getTextColorBasedOnBgColor","Tooltip","Modal","string2HTML","HeatMap","graphTitle","sources","graphDescription","footNote","colorLegendTitle","padding","backgroundColor","relativeHeight","graphID","Colors","showColorScale","graphDownload","dataDownload","fillContainer","language","showNAColor","minHeight","theme","ariaLabel","svgWidth","setSvgWidth","svgHeight","setSvgHeight","setSelectedColor","graphDiv","graphParentDiv","useEffect","resizeObserver","entries","scale","GraphHeader","EmptyState","ColorLegendWithMouseOver","ThresholdColorLegendWithMouseOver","LinearColorLegend","GraphFooter"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAyDO,SAASA,GAAMC,GAAc;AAClC,QAAM;AAAA,IACJ,MAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,aAAAC;AAAA,IACA,YAAAC;AAAA,IACA,OAAAC;AAAA,IACA,QAAAC;AAAA,IACA,WAAAC;AAAA,IACA,cAAAC;AAAA,IACA,SAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,QAAAC;AAAA,IACA,QAAAC;AAAA,IACA,YAAAC;AAAA,IACA,aAAAC;AAAA,IACA,QAAAC;AAAA,IACA,aAAAC;AAAA,IACA,WAAAC;AAAA,IACA,eAAAC;AAAA,IACA,eAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,6BAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,QAAAC;AAAA,IACA,YAAAC;AAAA,IACA,SAAAC;AAAA,IACA,WAAAC;AAAA,EAAA,IACE3B,GACE4B,IAASC,GAAO,IAAI,GACpBC,IAAWC,GAAU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