@undp/data-viz 1.5.6 → 1.5.8

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 (88) hide show
  1. package/dist/BarGraph.cjs +1 -1
  2. package/dist/BarGraph.cjs.map +1 -1
  3. package/dist/BarGraph.js +650 -648
  4. package/dist/BarGraph.js.map +1 -1
  5. package/dist/BulletChart.cjs +1 -1
  6. package/dist/BulletChart.cjs.map +1 -1
  7. package/dist/BulletChart.js +210 -208
  8. package/dist/BulletChart.js.map +1 -1
  9. package/dist/ButterflyChart.cjs +1 -1
  10. package/dist/ButterflyChart.cjs.map +1 -1
  11. package/dist/ButterflyChart.js +42 -40
  12. package/dist/ButterflyChart.js.map +1 -1
  13. package/dist/DifferenceLineChart.cjs +1 -1
  14. package/dist/DifferenceLineChart.cjs.map +1 -1
  15. package/dist/DifferenceLineChart.js +122 -120
  16. package/dist/DifferenceLineChart.js.map +1 -1
  17. package/dist/DualAxisLineChart.cjs +1 -1
  18. package/dist/DualAxisLineChart.cjs.map +1 -1
  19. package/dist/DualAxisLineChart.js +133 -113
  20. package/dist/DualAxisLineChart.js.map +1 -1
  21. package/dist/DumbbellChart.cjs +1 -1
  22. package/dist/DumbbellChart.cjs.map +1 -1
  23. package/dist/DumbbellChart.js +274 -274
  24. package/dist/DumbbellChart.js.map +1 -1
  25. package/dist/LineChartWithConfidenceInterval.cjs +1 -1
  26. package/dist/LineChartWithConfidenceInterval.cjs.map +1 -1
  27. package/dist/LineChartWithConfidenceInterval.js +194 -174
  28. package/dist/LineChartWithConfidenceInterval.js.map +1 -1
  29. package/dist/MultiLineAltChart.cjs +1 -1
  30. package/dist/MultiLineAltChart.cjs.map +1 -1
  31. package/dist/MultiLineAltChart.js +160 -161
  32. package/dist/MultiLineAltChart.js.map +1 -1
  33. package/dist/MultiLineChart.cjs +1 -1
  34. package/dist/MultiLineChart.cjs.map +1 -1
  35. package/dist/MultiLineChart.js +77 -66
  36. package/dist/MultiLineChart.js.map +1 -1
  37. package/dist/ParetoChart.cjs +1 -1
  38. package/dist/ParetoChart.cjs.map +1 -1
  39. package/dist/ParetoChart.js +166 -161
  40. package/dist/ParetoChart.js.map +1 -1
  41. package/dist/RadarChart.cjs +1 -1
  42. package/dist/RadarChart.cjs.map +1 -1
  43. package/dist/RadarChart.js +253 -241
  44. package/dist/RadarChart.js.map +1 -1
  45. package/dist/{RegressionLine-mH7UKOPi.js → RegressionLine-C2--oMQq.js} +10 -9
  46. package/dist/RegressionLine-C2--oMQq.js.map +1 -0
  47. package/dist/RegressionLine-Dj0GSiAp.cjs +2 -0
  48. package/dist/RegressionLine-Dj0GSiAp.cjs.map +1 -0
  49. package/dist/ScatterPlot.cjs +1 -1
  50. package/dist/ScatterPlot.cjs.map +1 -1
  51. package/dist/ScatterPlot.js +130 -129
  52. package/dist/ScatterPlot.js.map +1 -1
  53. package/dist/SimpleLineChart.cjs +1 -1
  54. package/dist/SimpleLineChart.cjs.map +1 -1
  55. package/dist/SimpleLineChart.js +43 -38
  56. package/dist/SimpleLineChart.js.map +1 -1
  57. package/dist/SlopeChart.cjs +1 -1
  58. package/dist/SlopeChart.cjs.map +1 -1
  59. package/dist/SlopeChart.js +113 -109
  60. package/dist/SlopeChart.js.map +1 -1
  61. package/dist/StripChart.cjs +1 -1
  62. package/dist/StripChart.cjs.map +1 -1
  63. package/dist/StripChart.js +282 -270
  64. package/dist/StripChart.js.map +1 -1
  65. package/dist/ThreeDGlobe.cjs +1 -1
  66. package/dist/ThreeDGlobe.cjs.map +1 -1
  67. package/dist/ThreeDGlobe.js +284 -349
  68. package/dist/ThreeDGlobe.js.map +1 -1
  69. package/dist/UnitChart.cjs +1 -1
  70. package/dist/UnitChart.cjs.map +1 -1
  71. package/dist/UnitChart.js +20 -21
  72. package/dist/UnitChart.js.map +1 -1
  73. package/dist/getCentroidCoordinates-Dfk6IqEG.js +70 -0
  74. package/dist/getCentroidCoordinates-Dfk6IqEG.js.map +1 -0
  75. package/dist/getCentroidCoordinates-DxTBqzp2.cjs +2 -0
  76. package/dist/getCentroidCoordinates-DxTBqzp2.cjs.map +1 -0
  77. package/dist/index.cjs +1 -1
  78. package/dist/index.d.ts +7 -0
  79. package/dist/index.js +34 -32
  80. package/dist/index.js.map +1 -1
  81. package/dist/utils.cjs +1 -1
  82. package/dist/utils.d.ts +8 -0
  83. package/dist/utils.js +16 -14
  84. package/dist/utils.js.map +1 -1
  85. package/package.json +1 -1
  86. package/dist/RegressionLine-mH7UKOPi.js.map +0 -1
  87. package/dist/RegressionLine-xKdiJ8sw.cjs +0 -2
  88. package/dist/RegressionLine-xKdiJ8sw.cjs.map +0 -1
@@ -4,11 +4,11 @@ import { i as gi } from "./index-Bwrro8-q.js";
4
4
  import { X as Ai } from "./Modal-DVVwpKhP.js";
5
5
  import { n as oi } from "./numberFormattingFunction-14YCbkN2.js";
6
6
  import { T as Mi } from "./Tooltip-CVCGWyzw.js";
7
- import { s as Ni } from "./string2HTML-oFCROsus.js";
7
+ import { s as ki } from "./string2HTML-oFCROsus.js";
8
8
  import { c as di } from "./checkIfNullOrUndefined-DmfiKkNw.js";
9
9
  import { A as pi } from "./Axis-Ddg-seDi.js";
10
10
  import { A as yi } from "./AxisTitle-BmHLMRJZ.js";
11
- import { X as ki } from "./XAxesLabels-loO78vUO.js";
11
+ import { X as Ni } from "./XAxesLabels-loO78vUO.js";
12
12
  import { b as Ci } from "./band-BEjh2CHI.js";
13
13
  import { a as bi } from "./linear-DUdu7l2G.js";
14
14
  import { l as $i, c as Li } from "./line-CPfhohvF.js";
@@ -24,10 +24,10 @@ import { E as Xi } from "./EmptyState-DdTp-Mdn.js";
24
24
  function Ei(mi) {
25
25
  const {
26
26
  data: S,
27
- width: N,
27
+ width: k,
28
28
  height: Y,
29
- barColor: p,
30
- lineColor: x,
29
+ barColor: x,
30
+ lineColor: n,
31
31
  axisTitles: a,
32
32
  sameAxes: b,
33
33
  rightMargin: q,
@@ -42,75 +42,75 @@ function Ei(mi) {
42
42
  showLabels: Z,
43
43
  onSeriesMouseClick: w,
44
44
  resetSelectionOnDoubleClick: ii,
45
- detailsOnClick: h,
45
+ detailsOnClick: u,
46
46
  noOfTicks: ti,
47
47
  lineSuffix: ei,
48
48
  barSuffix: B,
49
49
  linePrefix: F,
50
50
  barPrefix: ai,
51
51
  curveType: X,
52
- styles: n,
53
- classNames: o,
54
- animate: l,
52
+ styles: o,
53
+ classNames: c,
54
+ animate: r,
55
55
  precision: E,
56
56
  customLayers: T,
57
- naLabel: k,
57
+ naLabel: N,
58
58
  showAxisLabels: si
59
- } = mi, ri = fi(null), C = Oi(ri, {
60
- once: l.once,
61
- amount: l.amount
62
- }), ui = X === "linear" ? Li : X === "step" ? Ii : X === "stepAfter" ? Si : X === "stepBefore" ? Ti : Vi, [li, $] = W(void 0), [L, V] = W(void 0), [ni, I] = W(void 0), [j, m] = W(void 0), u = {
59
+ } = mi, li = fi(null), C = Oi(li, {
60
+ once: r.once,
61
+ amount: r.amount
62
+ }), ui = X === "linear" ? Li : X === "step" ? Ii : X === "stepAfter" ? Si : X === "stepBefore" ? Ti : Vi, [ri, $] = W(void 0), [L, V] = W(void 0), [ni, I] = W(void 0), [j, h] = W(void 0), d = {
63
63
  top: J,
64
64
  bottom: xi,
65
65
  left: U + 50,
66
66
  right: q + 65
67
- }, d = N - u.left - u.right, f = Y - u.top - u.bottom, s = S.map((i, M) => ({ ...i, id: `${M}` })), c = Ci().domain(s.map((i) => `${i.id}`)).range([0, d]).paddingInner(hi), G = Math.min(...s.map((i) => i.bar).filter((i) => i != null)) !== 1 / 0 ? Math.min(...s.map((i) => i.bar).filter((i) => i != null)) > 0 ? 0 : Math.min(...s.map((i) => i.bar).filter((i) => i != null)) : 0, A = Math.min(...s.map((i) => i.line).filter((i) => i != null)) !== 1 / 0 ? Math.min(...s.map((i) => i.line).filter((i) => i != null)) > 0 ? 0 : Math.min(...s.map((i) => i.line).filter((i) => i != null)) : 0, O = Math.max(...s.map((i) => i.bar).filter((i) => i != null)) !== 1 / 0 ? Math.max(...s.map((i) => i.bar).filter((i) => i != null)) : 0, P = Math.max(...s.map((i) => i.line).filter((i) => i != null)) !== 1 / 0 ? Math.max(...s.map((i) => i.line).filter((i) => i != null)) : 0, R = G < A ? G : A, y = O > P ? O : P, r = bi().domain([
67
+ }, p = k - d.left - d.right, f = Y - d.top - d.bottom, s = S.map((i, M) => ({ ...i, id: `${M}` })), m = Ci().domain(s.map((i) => `${i.id}`)).range([0, p]).paddingInner(hi), G = Math.min(...s.map((i) => i.bar).filter((i) => i != null)) !== 1 / 0 ? Math.min(...s.map((i) => i.bar).filter((i) => i != null)) > 0 ? 0 : Math.min(...s.map((i) => i.bar).filter((i) => i != null)) : 0, A = Math.min(...s.map((i) => i.line).filter((i) => i != null)) !== 1 / 0 ? Math.min(...s.map((i) => i.line).filter((i) => i != null)) > 0 ? 0 : Math.min(...s.map((i) => i.line).filter((i) => i != null)) : 0, O = Math.max(...s.map((i) => i.bar).filter((i) => i != null)) !== 1 / 0 ? Math.max(...s.map((i) => i.bar).filter((i) => i != null)) : 0, P = Math.max(...s.map((i) => i.line).filter((i) => i != null)) !== 1 / 0 ? Math.max(...s.map((i) => i.line).filter((i) => i != null)) : 0, R = G < A ? G : A, y = O > P ? O : P, l = bi().domain([
68
68
  b ? R : G,
69
69
  b ? y > 0 ? y : 0 : O > 0 ? O : 0
70
70
  ]).range([f, 0]).nice(), e = bi().domain([
71
71
  b ? R : A,
72
72
  b ? y > 0 ? y : 0 : P > 0 ? P : 0
73
- ]).range([f, 0]).nice(), z = $i().defined((i) => !di(i.line)).x((i) => c(`${i.id}`) + c.bandwidth() / 2).y((i) => e(i.line)).curve(ui), vi = r.ticks(ti), wi = e.ticks(ti);
73
+ ]).range([f, 0]).nice(), z = $i().defined((i) => !di(i.line)).x((i) => m(`${i.id}`) + m.bandwidth() / 2).y((i) => e(i.line)).curve(ui), vi = l.ticks(ti), wi = e.ticks(ti);
74
74
  return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
75
75
  /* @__PURE__ */ t.jsx(
76
76
  D.svg,
77
77
  {
78
- width: `${N}px`,
78
+ width: `${k}px`,
79
79
  height: `${Y}px`,
80
- viewBox: `0 0 ${N} ${Y}`,
80
+ viewBox: `0 0 ${k} ${Y}`,
81
81
  direction: "ltr",
82
- ref: ri,
83
- children: /* @__PURE__ */ t.jsxs("g", { transform: `translate(${u.left},${u.top})`, children: [
82
+ ref: li,
83
+ children: /* @__PURE__ */ t.jsxs("g", { transform: `translate(${d.left},${d.top})`, children: [
84
84
  /* @__PURE__ */ t.jsxs("g", { children: [
85
85
  vi.map((i, M) => /* @__PURE__ */ t.jsxs("g", { children: [
86
86
  /* @__PURE__ */ t.jsx(
87
87
  "line",
88
88
  {
89
- y1: r(i),
90
- y2: r(i),
89
+ y1: l(i),
90
+ y2: l(i),
91
91
  x1: -15,
92
92
  x2: -20,
93
93
  style: {
94
- stroke: p,
94
+ stroke: x,
95
95
  strokeWidth: 1,
96
- ...n?.yAxis?.gridLines || {}
96
+ ...o?.yAxis?.gridLines || {}
97
97
  },
98
- className: o?.yAxis?.gridLines
98
+ className: c?.yAxis?.gridLines
99
99
  }
100
100
  ),
101
101
  /* @__PURE__ */ t.jsx(
102
102
  "text",
103
103
  {
104
104
  x: -25,
105
- y: r(i),
105
+ y: l(i),
106
106
  dy: "0.33em",
107
- className: _("text-xs", o?.yAxis?.labels),
107
+ className: _("text-xs", c?.yAxis?.labels),
108
108
  style: {
109
109
  textAnchor: "end",
110
- fill: p,
111
- ...n?.yAxis?.labels || {}
110
+ fill: x,
111
+ ...o?.yAxis?.labels || {}
112
112
  },
113
- children: oi(i, k, E, ai, B)
113
+ children: oi(i, N, E, ai, B)
114
114
  }
115
115
  )
116
116
  ] }, M)),
@@ -121,17 +121,17 @@ function Ei(mi) {
121
121
  y2: f,
122
122
  x1: -15,
123
123
  x2: -15,
124
- classNames: { axis: o?.xAxis?.axis },
125
- styles: { axis: { stroke: p, ...n?.xAxis?.axis || {} } }
124
+ classNames: { axis: c?.xAxis?.axis },
125
+ styles: { axis: { stroke: x, ...o?.xAxis?.axis || {} } }
126
126
  }
127
127
  ),
128
128
  si ? /* @__PURE__ */ t.jsx(
129
129
  yi,
130
130
  {
131
- x: 10 - u.left,
131
+ x: 10 - d.left,
132
132
  y: f / 2,
133
- style: { fill: p, ...n?.yAxis?.title || {} },
134
- className: o?.yAxis?.title,
133
+ style: { fill: x, ...o?.yAxis?.title || {} },
134
+ className: c?.yAxis?.title,
135
135
  text: a[0].length > 100 ? `${a[0].substring(0, 100)}...` : a[0],
136
136
  rotate90: !0
137
137
  }
@@ -144,30 +144,30 @@ function Ei(mi) {
144
144
  {
145
145
  y1: e(i),
146
146
  y2: e(i),
147
- x1: d + 15,
148
- x2: d + 20,
147
+ x1: p + 15,
148
+ x2: p + 20,
149
149
  style: {
150
- stroke: x,
150
+ stroke: n,
151
151
  strokeWidth: 1,
152
- ...n?.yAxis?.gridLines || {}
152
+ ...o?.yAxis?.gridLines || {}
153
153
  },
154
- className: o?.yAxis?.gridLines
154
+ className: c?.yAxis?.gridLines
155
155
  }
156
156
  ),
157
157
  /* @__PURE__ */ t.jsx(
158
158
  "text",
159
159
  {
160
- x: d + 25,
160
+ x: p + 25,
161
161
  y: e(i),
162
162
  dy: "0.33em",
163
163
  dx: -2,
164
164
  style: {
165
165
  textAnchor: "start",
166
- fill: x,
167
- ...n?.yAxis?.labels || {}
166
+ fill: n,
167
+ ...o?.yAxis?.labels || {}
168
168
  },
169
- className: _("text-xs", o?.yAxis?.labels),
170
- children: oi(i, k, E, F, ei)
169
+ className: _("text-xs", c?.yAxis?.labels),
170
+ children: oi(i, N, E, F, ei)
171
171
  }
172
172
  )
173
173
  ] }, M)),
@@ -176,19 +176,19 @@ function Ei(mi) {
176
176
  {
177
177
  y1: 0,
178
178
  y2: f,
179
- x1: d + 15,
180
- x2: d + 15,
181
- classNames: { axis: o?.xAxis?.axis },
182
- styles: { axis: { stroke: x, ...n?.xAxis?.axis || {} } }
179
+ x1: p + 15,
180
+ x2: p + 15,
181
+ classNames: { axis: c?.xAxis?.axis },
182
+ styles: { axis: { stroke: n, ...o?.xAxis?.axis || {} } }
183
183
  }
184
184
  ),
185
185
  si ? /* @__PURE__ */ t.jsx(
186
186
  yi,
187
187
  {
188
- x: d + u.right - 15,
188
+ x: p + d.right - 15,
189
189
  y: f / 2,
190
- style: { fill: x, ...n?.yAxis?.title || {} },
191
- className: o?.yAxis?.title,
190
+ style: { fill: n, ...o?.yAxis?.title || {} },
191
+ className: c?.yAxis?.title,
192
192
  text: a[1].length > 100 ? `${a[1].substring(0, 100)}...` : a[1],
193
193
  rotate90: !0
194
194
  }
@@ -197,12 +197,12 @@ function Ei(mi) {
197
197
  /* @__PURE__ */ t.jsx(
198
198
  pi,
199
199
  {
200
- y1: b ? r(0) : f,
201
- y2: b ? r(0) : f,
200
+ y1: b ? l(0) : f,
201
+ y2: b ? l(0) : f,
202
202
  x1: -15,
203
- x2: d + 15,
204
- classNames: { axis: o?.xAxis?.axis },
205
- styles: { axis: n?.xAxis?.axis }
203
+ x2: p + 15,
204
+ classNames: { axis: c?.xAxis?.axis },
205
+ styles: { axis: o?.xAxis?.axis }
206
206
  }
207
207
  ),
208
208
  T.filter((i) => i.position === "before").map((i) => i.layer),
@@ -213,16 +213,16 @@ function Ei(mi) {
213
213
  className: "undp-viz-g-with-hover",
214
214
  opacity: 0.85,
215
215
  onMouseEnter: (g) => {
216
- $(i), m(g.clientY), I(g.clientX), H?.(i);
216
+ $(i), h(g.clientY), I(g.clientX), H?.(i);
217
217
  },
218
218
  onClick: () => {
219
- (w || h) && (gi(L, i) && ii ? (V(void 0), w?.(void 0)) : (V(i), w?.(i)));
219
+ (w || u) && (gi(L, i) && ii ? (V(void 0), w?.(void 0)) : (V(i), w?.(i)));
220
220
  },
221
221
  onMouseMove: (g) => {
222
- $(i), m(g.clientY), I(g.clientX);
222
+ $(i), h(g.clientY), I(g.clientX);
223
223
  },
224
224
  onMouseLeave: () => {
225
- $(void 0), I(void 0), m(void 0), H?.(void 0);
225
+ $(void 0), I(void 0), h(void 0), H?.(void 0);
226
226
  },
227
227
  children: [
228
228
  /* @__PURE__ */ t.jsx(
@@ -230,74 +230,76 @@ function Ei(mi) {
230
230
  {
231
231
  variants: {
232
232
  initial: {
233
- attrY: r(0),
233
+ attrY: l(0),
234
234
  height: 0,
235
- opacity: 1
235
+ opacity: 1,
236
+ fill: x
236
237
  },
237
238
  whileInView: {
238
- attrY: i.bar ? i.bar > 0 ? r(i.bar) : r(0) : 0,
239
- height: i.bar ? Math.abs(r(i.bar) - r(0)) : 0,
239
+ attrY: i.bar ? i.bar > 0 ? l(i.bar) : l(0) : 0,
240
+ height: i.bar ? Math.abs(l(i.bar) - l(0)) : 0,
240
241
  opacity: 1,
241
- transition: { duration: l.duration }
242
+ fill: x,
243
+ transition: { duration: r.duration }
242
244
  }
243
245
  },
244
246
  initial: "initial",
245
247
  animate: C ? "whileInView" : "initial",
246
248
  exit: {
247
- attrY: r(0),
249
+ attrY: l(0),
248
250
  height: 0,
249
251
  opacity: 0,
250
- transition: { duration: l.duration }
252
+ transition: { duration: r.duration }
251
253
  },
252
- x: c(`${M}`),
253
- width: c.bandwidth(),
254
- style: { fill: p }
254
+ x: m(`${M}`),
255
+ width: m.bandwidth()
255
256
  }
256
257
  ),
257
258
  K && !di(i.bar) ? /* @__PURE__ */ t.jsx(
258
259
  D.text,
259
260
  {
260
- x: c(`${i.id}`) + c.bandwidth() / 2,
261
+ x: m(`${i.id}`) + m.bandwidth() / 2,
261
262
  exit: {
262
- attrY: r(0),
263
+ attrY: l(0),
263
264
  opacity: 0,
264
- transition: { duration: l.duration }
265
+ transition: { duration: r.duration }
265
266
  },
266
267
  variants: {
267
268
  initial: {
268
- attrY: r(0),
269
- opacity: 0
269
+ attrY: l(0),
270
+ opacity: 0,
271
+ fill: x
270
272
  },
271
273
  whileInView: {
272
- attrY: r(i.bar || 0),
274
+ attrY: l(i.bar || 0),
273
275
  opacity: 1,
274
- transition: { duration: l.duration }
276
+ fill: x,
277
+ transition: { duration: r.duration }
275
278
  }
276
279
  },
277
280
  initial: "initial",
278
281
  animate: C ? "whileInView" : "initial",
279
282
  style: {
280
- fill: p,
281
283
  textAnchor: "middle",
282
- ...n?.graphObjectValues || {}
284
+ ...o?.graphObjectValues || {}
283
285
  },
284
- className: _("graph-value text-sm", o?.graphObjectValues),
286
+ className: _("graph-value text-sm", c?.graphObjectValues),
285
287
  dy: i.bar ? i.bar >= 0 ? "-5px" : "1em" : "-5px",
286
- children: oi(i.bar, k, E, ai, B)
288
+ children: oi(i.bar, N, E, ai, B)
287
289
  }
288
290
  ) : null,
289
291
  Z ? /* @__PURE__ */ t.jsx(
290
- ki,
292
+ Ni,
291
293
  {
292
294
  value: `${i.label}`.length < Q ? `${i.label}` : `${`${i.label}`.substring(0, Q)}...`,
293
295
  y: f + 5,
294
- x: c(`${i.id}`),
295
- width: c.bandwidth(),
296
- height: u.bottom,
297
- style: n?.xAxis?.labels,
298
- className: o?.xAxis?.labels,
296
+ x: m(`${i.id}`),
297
+ width: m.bandwidth(),
298
+ height: d.bottom,
299
+ style: o?.xAxis?.labels,
300
+ className: c?.xAxis?.labels,
299
301
  alignment: "top",
300
- animate: l,
302
+ animate: r,
301
303
  isInView: C
302
304
  }
303
305
  ) : null
@@ -310,23 +312,24 @@ function Ei(mi) {
310
312
  {
311
313
  exit: {
312
314
  opacity: 0,
313
- transition: { duration: l.duration }
315
+ transition: { duration: r.duration }
314
316
  },
315
317
  variants: {
316
318
  initial: {
317
319
  d: z(s.map((i) => ({ ...i, line: 0 }))),
318
- opacity: 0
320
+ opacity: 0,
321
+ stroke: n
319
322
  },
320
323
  whileInView: {
321
324
  d: z(s),
322
325
  opacity: 1,
323
- transition: { duration: l.duration }
326
+ stroke: n,
327
+ transition: { duration: r.duration }
324
328
  }
325
329
  },
326
330
  initial: "initial",
327
331
  animate: C ? "whileInView" : "initial",
328
332
  style: {
329
- stroke: x,
330
333
  fill: "none",
331
334
  strokeWidth: 2
332
335
  }
@@ -336,16 +339,16 @@ function Ei(mi) {
336
339
  "g",
337
340
  {
338
341
  onMouseEnter: (g) => {
339
- $(i), m(g.clientY), I(g.clientX), H?.(i);
342
+ $(i), h(g.clientY), I(g.clientX), H?.(i);
340
343
  },
341
344
  onClick: () => {
342
- (w || h) && (gi(L, i) && ii ? (V(void 0), w?.(void 0)) : (V(i), w?.(i)));
345
+ (w || u) && (gi(L, i) && ii ? (V(void 0), w?.(void 0)) : (V(i), w?.(i)));
343
346
  },
344
347
  onMouseMove: (g) => {
345
- $(i), m(g.clientY), I(g.clientX);
348
+ $(i), h(g.clientY), I(g.clientX);
346
349
  },
347
350
  onMouseLeave: () => {
348
- $(void 0), I(void 0), m(void 0), H?.(void 0);
351
+ $(void 0), I(void 0), h(void 0), H?.(void 0);
349
352
  },
350
353
  children: [
351
354
  /* @__PURE__ */ t.jsx(
@@ -354,58 +357,60 @@ function Ei(mi) {
354
357
  exit: {
355
358
  cy: e(0),
356
359
  opacity: 0,
357
- transition: { duration: l.duration }
360
+ transition: { duration: r.duration }
358
361
  },
359
362
  variants: {
360
363
  initial: {
361
364
  cy: e(0),
362
- opacity: 0
365
+ opacity: 0,
366
+ fill: n
363
367
  },
364
368
  whileInView: {
365
369
  cy: e(i.line),
366
370
  opacity: 1,
367
- transition: { duration: l.duration }
371
+ fill: n,
372
+ transition: { duration: r.duration }
368
373
  }
369
374
  },
370
375
  initial: "initial",
371
376
  animate: C ? "whileInView" : "initial",
372
- cx: c(i.id) + c.bandwidth() / 2,
373
- r: d / s.length < 5 ? 0 : d / s.length < 20 ? 2 : 4,
374
- style: { fill: x }
377
+ cx: m(i.id) + m.bandwidth() / 2,
378
+ r: p / s.length < 5 ? 0 : p / s.length < 20 ? 2 : 4
375
379
  }
376
380
  ),
377
381
  K ? /* @__PURE__ */ t.jsx(
378
382
  D.text,
379
383
  {
380
- x: c(`${i.id}`) + c.bandwidth() / 2,
384
+ x: m(`${i.id}`) + m.bandwidth() / 2,
381
385
  exit: {
382
386
  y: e(0),
383
387
  opacity: 0,
384
- transition: { duration: l.duration }
388
+ transition: { duration: r.duration }
385
389
  },
386
390
  style: {
387
- fill: x,
388
391
  textAnchor: "middle",
389
- ...n?.graphObjectValues || {}
392
+ ...o?.graphObjectValues || {}
390
393
  },
391
394
  variants: {
392
395
  initial: {
393
396
  y: e(0),
394
- opacity: 0
397
+ opacity: 0,
398
+ fill: n
395
399
  },
396
400
  whileInView: {
397
401
  y: e(i.line),
398
402
  opacity: 1,
399
- transition: { duration: l.duration }
403
+ fill: n,
404
+ transition: { duration: r.duration }
400
405
  }
401
406
  },
402
407
  initial: "initial",
403
408
  animate: C ? "whileInView" : "initial",
404
- className: _("graph-value text-sm", o?.graphObjectValues),
409
+ className: _("graph-value text-sm", c?.graphObjectValues),
405
410
  dy: "-5px",
406
411
  children: oi(
407
412
  i.line,
408
- k,
413
+ N,
409
414
  E,
410
415
  F,
411
416
  ei
@@ -420,18 +425,18 @@ function Ei(mi) {
420
425
  ] })
421
426
  }
422
427
  ),
423
- li && v && ni && j ? /* @__PURE__ */ t.jsx(
428
+ ri && v && ni && j ? /* @__PURE__ */ t.jsx(
424
429
  Mi,
425
430
  {
426
- data: li,
431
+ data: ri,
427
432
  body: v,
428
433
  xPos: ni,
429
434
  yPos: j,
430
- backgroundStyle: n?.tooltip,
431
- className: o?.tooltip
435
+ backgroundStyle: o?.tooltip,
436
+ className: c?.tooltip
432
437
  }
433
438
  ) : null,
434
- h && L !== void 0 ? /* @__PURE__ */ t.jsx(
439
+ u && L !== void 0 ? /* @__PURE__ */ t.jsx(
435
440
  Ai,
436
441
  {
437
442
  open: L !== void 0,
@@ -442,8 +447,8 @@ function Ei(mi) {
442
447
  "div",
443
448
  {
444
449
  className: "graph-modal-content m-0",
445
- dangerouslySetInnerHTML: typeof h == "string" ? { __html: Ni(h, L) } : void 0,
446
- children: typeof h == "function" ? h(L) : null
450
+ dangerouslySetInnerHTML: typeof u == "string" ? { __html: ki(u, L) } : void 0,
451
+ children: typeof u == "function" ? u(L) : null
447
452
  }
448
453
  )
449
454
  }
@@ -453,10 +458,10 @@ function Ei(mi) {
453
458
  function mt(mi) {
454
459
  const {
455
460
  data: S,
456
- graphTitle: N,
461
+ graphTitle: k,
457
462
  sources: Y,
458
- graphDescription: p,
459
- height: x,
463
+ graphDescription: x,
464
+ height: n,
460
465
  width: a,
461
466
  footNote: b,
462
467
  padding: q,
@@ -471,70 +476,70 @@ function mt(mi) {
471
476
  lineAxisTitle: Z = "Line chart",
472
477
  barAxisTitle: w = "Bar graph",
473
478
  tooltip: ii,
474
- relativeHeight: h,
479
+ relativeHeight: u,
475
480
  onSeriesMouseOver: ti,
476
481
  graphID: ei,
477
482
  graphDownload: B = !1,
478
483
  dataDownload: F = !1,
479
484
  barPadding: ai = 0.25,
480
485
  truncateBy: X = 999,
481
- showLabels: n = !0,
482
- onSeriesMouseClick: o,
483
- language: l = "en",
486
+ showLabels: o = !0,
487
+ onSeriesMouseClick: c,
488
+ language: r = "en",
484
489
  colorLegendTitle: E,
485
490
  minHeight: T = 0,
486
- theme: k = "light",
491
+ theme: N = "light",
487
492
  ariaLabel: si,
488
- resetSelectionOnDoubleClick: ri = !0,
493
+ resetSelectionOnDoubleClick: li = !0,
489
494
  detailsOnClick: C,
490
495
  showValues: ui = !0,
491
- noOfTicks: li = 5,
496
+ noOfTicks: ri = 5,
492
497
  lineSuffix: $ = "",
493
498
  barSuffix: L = "",
494
499
  linePrefix: V = "",
495
500
  barPrefix: ni = "",
496
501
  curveType: I = "curve",
497
502
  styles: j,
498
- classNames: m,
499
- animate: u = !1,
500
- precision: d = 2,
503
+ classNames: h,
504
+ animate: d = !1,
505
+ precision: p = 2,
501
506
  customLayers: f = [],
502
507
  naLabel: s = "NA",
503
- showColorScale: c = !0,
508
+ showColorScale: m = !0,
504
509
  showAxisLabels: G = !0
505
- } = mi, [A, O] = W(0), [P, R] = W(0), y = fi(null), r = fi(null);
510
+ } = mi, [A, O] = W(0), [P, R] = W(0), y = fi(null), l = fi(null);
506
511
  return ji(() => {
507
512
  const e = new ResizeObserver((z) => {
508
- O(a || z[0].target.clientWidth || 620), R(x || z[0].target.clientHeight || 480);
513
+ O(a || z[0].target.clientWidth || 620), R(n || z[0].target.clientHeight || 480);
509
514
  });
510
515
  return y.current && (R(y.current.clientHeight || 480), O(y.current.clientWidth || 620), a || e.observe(y.current)), () => e.disconnect();
511
- }, [a, x]), /* @__PURE__ */ t.jsx(
516
+ }, [a, n]), /* @__PURE__ */ t.jsx(
512
517
  "div",
513
518
  {
514
- className: `${k || "light"} flex ${a ? "w-fit grow-0" : "w-full grow"}`,
515
- dir: l === "he" || l === "ar" ? "rtl" : void 0,
519
+ className: `${N || "light"} flex ${a ? "w-fit grow-0" : "w-full grow"}`,
520
+ dir: r === "he" || r === "ar" ? "rtl" : void 0,
516
521
  children: /* @__PURE__ */ t.jsx(
517
522
  "div",
518
523
  {
519
524
  className: _(
520
- `${v ? v === !0 ? "bg-primary-gray-200 dark:bg-primary-gray-650 " : "" : "bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${l || "en"}`,
525
+ `${v ? v === !0 ? "bg-primary-gray-200 dark:bg-primary-gray-650 " : "" : "bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${r || "en"}`,
521
526
  a ? "w-fit" : "w-full",
522
- m?.graphContainer
527
+ h?.graphContainer
523
528
  ),
524
529
  style: {
525
530
  ...j?.graphContainer || {},
526
531
  ...v && v !== !0 ? { backgroundColor: v } : {}
527
532
  },
528
533
  id: ei,
529
- ref: r,
530
- "aria-label": si || `${N ? `The graph shows ${N}. ` : ""}This is a pareto chart that shows a variable as bars and another as line chart.${p ? ` ${p}` : ""}`,
534
+ ref: l,
535
+ "aria-label": si || `${k ? `The graph shows ${k}. ` : ""}This is a pareto chart that shows a variable as bars and another as line chart.${x ? ` ${x}` : ""}`,
531
536
  children: /* @__PURE__ */ t.jsx(
532
537
  "div",
533
538
  {
534
539
  className: "flex grow",
535
540
  style: { padding: v ? q || "1rem" : q || 0 },
536
541
  children: /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col w-full gap-4 grow justify-between", children: [
537
- N || p || B || F ? /* @__PURE__ */ t.jsx(
542
+ k || x || B || F ? /* @__PURE__ */ t.jsx(
538
543
  Yi,
539
544
  {
540
545
  styles: {
@@ -542,24 +547,24 @@ function mt(mi) {
542
547
  description: j?.description
543
548
  },
544
549
  classNames: {
545
- title: m?.title,
546
- description: m?.description
550
+ title: h?.title,
551
+ description: h?.description
547
552
  },
548
- graphTitle: N,
549
- graphDescription: p,
553
+ graphTitle: k,
554
+ graphDescription: x,
550
555
  width: a,
551
- graphDownload: B ? r.current : void 0,
556
+ graphDownload: B ? l.current : void 0,
552
557
  dataDownload: F ? S.map((e) => e.data).filter((e) => e !== void 0).length > 0 ? S.map((e) => e.data).filter((e) => e !== void 0) : S.filter((e) => e !== void 0) : null
553
558
  }
554
559
  ) : null,
555
560
  /* @__PURE__ */ t.jsx("div", { className: "grow flex flex-col justify-center gap-3 w-full", children: S.length === 0 ? /* @__PURE__ */ t.jsx(Xi, {}) : /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
556
- c ? /* @__PURE__ */ t.jsx(
561
+ m ? /* @__PURE__ */ t.jsx(
557
562
  Hi,
558
563
  {
559
564
  colorDomain: [w, Z],
560
565
  colors: [
561
- J || ci[k].categoricalColors.colors[0],
562
- U || ci[k].categoricalColors.colors[1]
566
+ J || ci[N].categoricalColors.colors[0],
567
+ U || ci[N].categoricalColors.colors[1]
563
568
  ],
564
569
  colorLegendTitle: E,
565
570
  showNAColor: !1
@@ -571,7 +576,7 @@ function mt(mi) {
571
576
  className: "flex flex-col grow justify-center leading-0",
572
577
  ref: y,
573
578
  "aria-label": "Graph area",
574
- children: (a || A) && (x || P) ? /* @__PURE__ */ t.jsx(
579
+ children: (a || A) && (n || P) ? /* @__PURE__ */ t.jsx(
575
580
  Ei,
576
581
  {
577
582
  data: S,
@@ -581,7 +586,7 @@ function mt(mi) {
581
586
  width: a || A,
582
587
  height: Math.max(
583
588
  T,
584
- x || (h ? T ? (a || A) * h > T ? (a || A) * h : T : (a || A) * h : P)
589
+ n || (u ? T ? (a || A) * u > T ? (a || A) * u : T : (a || A) * u : P)
585
590
  ),
586
591
  truncateBy: X,
587
592
  leftMargin: K,
@@ -592,11 +597,11 @@ function mt(mi) {
592
597
  tooltip: ii,
593
598
  onSeriesMouseOver: ti,
594
599
  barPadding: ai,
595
- showLabels: n,
596
- onSeriesMouseClick: o,
597
- resetSelectionOnDoubleClick: ri,
600
+ showLabels: o,
601
+ onSeriesMouseClick: c,
602
+ resetSelectionOnDoubleClick: li,
598
603
  detailsOnClick: C,
599
- noOfTicks: li,
604
+ noOfTicks: ri,
600
605
  lineSuffix: $,
601
606
  barSuffix: L,
602
607
  linePrefix: V,
@@ -604,9 +609,9 @@ function mt(mi) {
604
609
  curveType: I,
605
610
  showValues: ui,
606
611
  styles: j,
607
- classNames: m,
608
- animate: u === !0 ? { duration: 0.5, once: !0, amount: 0.5 } : u || { duration: 0, once: !0, amount: 0 },
609
- precision: d,
612
+ classNames: h,
613
+ animate: d === !0 ? { duration: 0.5, once: !0, amount: 0.5 } : d || { duration: 0, once: !0, amount: 0 },
614
+ precision: p,
610
615
  customLayers: f,
611
616
  naLabel: s,
612
617
  showAxisLabels: G
@@ -620,8 +625,8 @@ function mt(mi) {
620
625
  {
621
626
  styles: { footnote: j?.footnote, source: j?.source },
622
627
  classNames: {
623
- footnote: m?.footnote,
624
- source: m?.source
628
+ footnote: h?.footnote,
629
+ source: h?.source
625
630
  },
626
631
  sources: Y,
627
632
  footNote: b,