@undp/data-viz 1.3.1 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/dist/DataCards.cjs +21 -1
  2. package/dist/DataCards.cjs.map +1 -1
  3. package/dist/DataCards.js +622 -12
  4. package/dist/DataCards.js.map +1 -1
  5. package/dist/GraphEl-B6SoGRFW.cjs +2 -0
  6. package/dist/GraphEl-B6SoGRFW.cjs.map +1 -0
  7. package/dist/{checkIfMultiple-BB7PlCNh.js → GraphEl-Cw2tDUb3.js} +129 -1163
  8. package/dist/GraphEl-Cw2tDUb3.js.map +1 -0
  9. package/dist/GriddedGraphs.cjs +1 -1
  10. package/dist/GriddedGraphs.cjs.map +1 -1
  11. package/dist/GriddedGraphs.d.ts +2 -4
  12. package/dist/GriddedGraphs.js +9 -8
  13. package/dist/GriddedGraphs.js.map +1 -1
  14. package/dist/GriddedGraphsFromConfig.d.ts +2 -4
  15. package/dist/MultiGraphDashboard.cjs +1 -1
  16. package/dist/MultiGraphDashboard.cjs.map +1 -1
  17. package/dist/MultiGraphDashboard.d.ts +16 -12
  18. package/dist/MultiGraphDashboard.js +2 -2
  19. package/dist/MultiGraphDashboardFromConfig.d.ts +16 -12
  20. package/dist/MultiGraphDashboardWideToLongFormat.cjs +1 -1
  21. package/dist/MultiGraphDashboardWideToLongFormat.js +1 -1
  22. package/dist/PerformanceIntensiveMultiGraphDashboard.cjs +2 -0
  23. package/dist/PerformanceIntensiveMultiGraphDashboard.cjs.map +1 -0
  24. package/dist/PerformanceIntensiveMultiGraphDashboard.d.ts +566 -0
  25. package/dist/PerformanceIntensiveMultiGraphDashboard.js +353 -0
  26. package/dist/PerformanceIntensiveMultiGraphDashboard.js.map +1 -0
  27. package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.cjs +2 -0
  28. package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.cjs.map +1 -0
  29. package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.d.ts +570 -0
  30. package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.js +38 -0
  31. package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.js.map +1 -0
  32. package/dist/PerformanceIntensiveScrollStory.cjs +2 -0
  33. package/dist/PerformanceIntensiveScrollStory.cjs.map +1 -0
  34. package/dist/PerformanceIntensiveScrollStory.d.ts +493 -0
  35. package/dist/PerformanceIntensiveScrollStory.js +122 -0
  36. package/dist/PerformanceIntensiveScrollStory.js.map +1 -0
  37. package/dist/ScrollStory.cjs.map +1 -1
  38. package/dist/ScrollStory.d.ts +3 -5
  39. package/dist/ScrollStory.js.map +1 -1
  40. package/dist/SingleGraphDashboard.cjs +1 -1
  41. package/dist/SingleGraphDashboard.cjs.map +1 -1
  42. package/dist/SingleGraphDashboard.d.ts +2 -5
  43. package/dist/SingleGraphDashboard.js +194 -194
  44. package/dist/SingleGraphDashboard.js.map +1 -1
  45. package/dist/SingleGraphDashboardFromConfig.d.ts +2 -4
  46. package/dist/SingleGraphDashboardGeoHubMaps.cjs +2 -0
  47. package/dist/SingleGraphDashboardGeoHubMaps.cjs.map +1 -0
  48. package/dist/SingleGraphDashboardGeoHubMaps.d.ts +428 -0
  49. package/dist/SingleGraphDashboardGeoHubMaps.js +185 -0
  50. package/dist/SingleGraphDashboardGeoHubMaps.js.map +1 -0
  51. package/dist/SingleGraphDashboardGeoHubMapsFromConfig.cjs +2 -0
  52. package/dist/SingleGraphDashboardGeoHubMapsFromConfig.cjs.map +1 -0
  53. package/dist/SingleGraphDashboardGeoHubMapsFromConfig.d.ts +432 -0
  54. package/dist/SingleGraphDashboardGeoHubMapsFromConfig.js +25 -0
  55. package/dist/SingleGraphDashboardGeoHubMapsFromConfig.js.map +1 -0
  56. package/dist/SingleGraphDashboardThreeDGraphs.cjs +2 -0
  57. package/dist/SingleGraphDashboardThreeDGraphs.cjs.map +1 -0
  58. package/dist/SingleGraphDashboardThreeDGraphs.d.ts +540 -0
  59. package/dist/SingleGraphDashboardThreeDGraphs.js +610 -0
  60. package/dist/SingleGraphDashboardThreeDGraphs.js.map +1 -0
  61. package/dist/SingleGraphDashboardThreeDGraphsFromConfig.cjs +2 -0
  62. package/dist/SingleGraphDashboardThreeDGraphsFromConfig.cjs.map +1 -0
  63. package/dist/SingleGraphDashboardThreeDGraphsFromConfig.d.ts +543 -0
  64. package/dist/SingleGraphDashboardThreeDGraphsFromConfig.js +35 -0
  65. package/dist/SingleGraphDashboardThreeDGraphsFromConfig.js.map +1 -0
  66. package/dist/Types.d.ts +38 -11
  67. package/dist/checkIfMultiple-CYp3vADF.js +912 -0
  68. package/dist/checkIfMultiple-CYp3vADF.js.map +1 -0
  69. package/dist/checkIfMultiple-Do4kADNr.cjs +12 -0
  70. package/dist/checkIfMultiple-Do4kADNr.cjs.map +1 -0
  71. package/dist/getSchema.cjs.map +1 -1
  72. package/dist/getSchema.d.ts +7 -5
  73. package/dist/getSchema.js.map +1 -1
  74. package/dist/index.cjs +1 -1
  75. package/dist/index.d.ts +330 -163
  76. package/dist/index.js +150 -136
  77. package/dist/index.js.map +1 -1
  78. package/dist/transformData.cjs +1 -1
  79. package/dist/transformData.d.ts +5 -5
  80. package/dist/transformData.js +2 -2
  81. package/dist/{transformDataForAggregation-DAQJWGNL.js → transformDataForAggregation-CdcwlnNe.js} +2 -2
  82. package/dist/transformDataForAggregation-CdcwlnNe.js.map +1 -0
  83. package/dist/{transformDataForAggregation-BUGJnson.cjs → transformDataForAggregation-Du-Hei-W.cjs} +2 -2
  84. package/dist/transformDataForAggregation-Du-Hei-W.cjs.map +1 -0
  85. package/dist/{transformDataForGraphFromFile-DdNiOWeC.js → transformDataForGraphFromFile-CA0rw80A.js} +2 -2
  86. package/dist/{transformDataForGraphFromFile-DdNiOWeC.js.map → transformDataForGraphFromFile-CA0rw80A.js.map} +1 -1
  87. package/dist/{transformDataForGraphFromFile-CrntpaMU.cjs → transformDataForGraphFromFile-D9G3ToQf.cjs} +2 -2
  88. package/dist/{transformDataForGraphFromFile-CrntpaMU.cjs.map → transformDataForGraphFromFile-D9G3ToQf.cjs.map} +1 -1
  89. package/dist/transformDataForSelect-D8AuvYdf.js +14 -0
  90. package/dist/transformDataForSelect-D8AuvYdf.js.map +1 -0
  91. package/dist/transformDataForSelect-YmStusCI.cjs +2 -0
  92. package/dist/transformDataForSelect-YmStusCI.cjs.map +1 -0
  93. package/dist/validateSchema.d.ts +2 -4
  94. package/package.json +36 -1
  95. package/dist/checkIfMultiple-BB7PlCNh.js.map +0 -1
  96. package/dist/checkIfMultiple-D5ysrI7G.cjs +0 -12
  97. package/dist/checkIfMultiple-D5ysrI7G.cjs.map +0 -1
  98. package/dist/index-D9h2WYDS.cjs +0 -22
  99. package/dist/index-D9h2WYDS.cjs.map +0 -1
  100. package/dist/index-OCoyy1wG.js +0 -635
  101. package/dist/index-OCoyy1wG.js.map +0 -1
  102. package/dist/transformDataForAggregation-BUGJnson.cjs.map +0 -1
  103. package/dist/transformDataForAggregation-DAQJWGNL.js.map +0 -1
@@ -1,155 +1,155 @@
1
- import { j as r, m as da } from "./index-CHPV5EwG-BPSP-7Jg.js";
2
- import { useState as v, useRef as Z, useMemo as R, useCallback as J, useEffect as H } from "react";
3
- import { i as ua } from "./index-C1rRk_50.js";
4
- import { f as L } from "./index-UV9hjG_S.js";
5
- import { i as ca } from "./index-27yTRcko.js";
6
- import { Z as y, H as A } from "./DropdownSelect-CDC9lEqU.js";
7
- import { f as N, a as B, v as K, c as ha, w as Q, G as X, b as fa } from "./checkIfMultiple-BB7PlCNh.js";
8
- import { u as ga } from "./Typography-Ctgfl1J5.js";
9
- import { y as pa } from "./Spinner-C85UF28E.js";
10
- import { f as ma, a as Ca, b as ba, c as xa, t as Ia } from "./fetchAndParseData-Bcmr659B.js";
11
- import { a as va, t as wa } from "./transformDataForAggregation-DAQJWGNL.js";
12
- import { g as Y } from "./getUniqValue-BtUENB2H.js";
13
- import { GraphHeader as ya } from "./GraphHeader.js";
14
- import { f as _ } from "./filterData-B8ocT57s.js";
15
- import { g as Sa } from "./getGraphList-DuColTJM.js";
16
- import { t as aa } from "./index-OCoyy1wG.js";
17
- const Va = (s) => {
18
- if (s.findIndex((n) => n.chartConfigId === "yMin") !== -1 && s.findIndex((n) => n.chartConfigId === "yMax") !== -1)
19
- return s;
20
- const t = [...s];
21
- return s.findIndex((n) => n.chartConfigId === "yMin") === -1 && t.push({
1
+ import { j as n, m as sa } from "./index-CHPV5EwG-BPSP-7Jg.js";
2
+ import { useState as b, useRef as q, useMemo as O, useCallback as Z, useEffect as G } from "react";
3
+ import { i as da } from "./index-C1rRk_50.js";
4
+ import { f as P } from "./index-UV9hjG_S.js";
5
+ import { i as ua } from "./index-27yTRcko.js";
6
+ import { Z as y, H as N } from "./DropdownSelect-CDC9lEqU.js";
7
+ import { f as F, a as J, v as B, c as ca, w as K, G as Q } from "./checkIfMultiple-CYp3vADF.js";
8
+ import { u as ha } from "./Typography-Ctgfl1J5.js";
9
+ import { y as fa } from "./Spinner-C85UF28E.js";
10
+ import { G as ga } from "./GraphEl-Cw2tDUb3.js";
11
+ import { f as pa, a as ma, b as Ca, c as xa, t as Ia } from "./fetchAndParseData-Bcmr659B.js";
12
+ import { a as va, t as ba } from "./transformDataForAggregation-CdcwlnNe.js";
13
+ import { g as X } from "./getUniqValue-BtUENB2H.js";
14
+ import { GraphHeader as wa } from "./GraphHeader.js";
15
+ import { f as Y } from "./filterData-B8ocT57s.js";
16
+ import { g as ya } from "./getGraphList-DuColTJM.js";
17
+ import { t as _ } from "./transformDataForSelect-D8AuvYdf.js";
18
+ const Va = (o) => {
19
+ if (o.findIndex((r) => r.chartConfigId === "yMin") !== -1 && o.findIndex((r) => r.chartConfigId === "yMax") !== -1)
20
+ return o;
21
+ const t = [...o];
22
+ return o.findIndex((r) => r.chartConfigId === "yMin") === -1 && t.push({
22
23
  chartConfigId: "yMin",
23
- columnId: `${s[s.findIndex((n) => n.chartConfigId === "y")].columnId}Min`
24
- }), s.findIndex((n) => n.chartConfigId === "yMax") === -1 && t.push({
24
+ columnId: `${o[o.findIndex((r) => r.chartConfigId === "y")].columnId}Min`
25
+ }), o.findIndex((r) => r.chartConfigId === "yMax") === -1 && t.push({
25
26
  chartConfigId: "yMax",
26
- columnId: `${s[s.findIndex((n) => n.chartConfigId === "y")].columnId}Max`
27
+ columnId: `${o[o.findIndex((r) => r.chartConfigId === "y")].columnId}Max`
27
28
  }), t;
28
- }, O = (s, t) => {
29
- const n = t?.map((S) => {
30
- const o = s?.findIndex((i) => i.chartConfigId === S.chartConfigId);
31
- if (o === -1) return {};
32
- const b = s[o]?.allowedColumnIds?.findIndex(
33
- (i) => i.value === S.columnId
29
+ }, H = (o, t) => {
30
+ const r = t?.map((V) => {
31
+ const h = o?.findIndex((i) => i.chartConfigId === V.chartConfigId);
32
+ if (h === -1) return {};
33
+ const x = o[h]?.allowedColumnIds?.findIndex(
34
+ (i) => i.value === V.columnId
34
35
  );
35
- return b === -1 ? {} : s[o].allowedColumnIds[b].graphSettings || {};
36
+ return x === -1 ? {} : o[h].allowedColumnIds[x].graphSettings || {};
36
37
  }) || [];
37
- return Object.assign({}, ...n);
38
+ return Object.assign({}, ...r);
38
39
  };
39
- function za(s) {
40
+ function Ua(o) {
40
41
  const {
41
42
  graphSettings: t,
42
- dataSettings: n,
43
- filters: S,
44
- graphType: o,
45
- dataTransform: b,
43
+ dataSettings: r,
44
+ filters: V,
45
+ graphType: h,
46
+ dataTransform: x,
46
47
  graphDataConfiguration: i,
47
- dataFilters: F,
48
- debugMode: V,
49
- dataSelectionOptions: x,
50
- advancedDataSelectionOptions: P,
51
- readableHeader: ea,
52
- noOfFiltersPerRow: h = 4,
53
- updateFilters: la,
48
+ dataFilters: R,
49
+ debugMode: D,
50
+ dataSelectionOptions: I,
51
+ advancedDataSelectionOptions: L,
52
+ readableHeader: aa,
53
+ noOfFiltersPerRow: c = 4,
54
+ updateFilters: ea,
54
55
  uiMode: f = "normal",
55
- theme: W = "light",
56
56
  highlightDataPointSettings: m
57
- } = s, [C, ta] = v(void 0), [w, ra] = v(void 0), [g, I] = v(
57
+ } = o, [C, la] = b(void 0), [w, ta] = b(void 0), [g, v] = b(
58
58
  i
59
- ), [p, D] = v({}), [j, na] = v(void 0), [ia, oa] = v([]), z = Z(null), U = Z(
59
+ ), [p, S] = b({}), [j, na] = b(void 0), [ra, ia] = b([]), z = q(null), U = q(
60
60
  i
61
- ), [M, E] = v([]), k = R(
61
+ ), [$, W] = b([]), T = O(
62
62
  () => ({
63
63
  ignoreCase: !0,
64
64
  ignoreAccents: !0,
65
65
  trim: !0
66
66
  }),
67
67
  []
68
- ), q = J(async () => {
69
- if (o !== "geoHubMap" && o !== "geoHubCompareMap" && o !== "geoHubMapWithLayerSelection" && n)
68
+ ), E = Z(async () => {
69
+ if (r)
70
70
  try {
71
- const u = await (n.dataURL ? typeof n.dataURL == "string" ? n.fileType === "json" ? ma(
72
- n.dataURL,
73
- n.columnsToArray,
74
- n.dataTransformation,
75
- V
76
- ) : n.fileType === "api" ? Ca(
77
- n.dataURL,
78
- n.apiHeaders,
79
- n.columnsToArray,
80
- n.dataTransformation,
81
- V
82
- ) : ba(
83
- n.dataURL,
84
- n.dataTransformation,
85
- n.columnsToArray,
86
- V,
87
- n.delimiter,
71
+ const d = await (r.dataURL ? typeof r.dataURL == "string" ? r.fileType === "json" ? pa(
72
+ r.dataURL,
73
+ r.columnsToArray,
74
+ r.dataTransformation,
75
+ D
76
+ ) : r.fileType === "api" ? ma(
77
+ r.dataURL,
78
+ r.apiHeaders,
79
+ r.columnsToArray,
80
+ r.dataTransformation,
81
+ D
82
+ ) : Ca(
83
+ r.dataURL,
84
+ r.dataTransformation,
85
+ r.columnsToArray,
86
+ D,
87
+ r.delimiter,
88
88
  !0
89
- ) : xa(n.dataURL, n.idColumnTitle) : Ia(n.data, n.columnsToArray));
90
- ra(u);
91
- const e = (S || []).map((l) => ({
89
+ ) : xa(r.dataURL, r.idColumnTitle) : Ia(r.data, r.columnsToArray));
90
+ ta(d);
91
+ const e = (V || []).map((l) => ({
92
92
  filter: l.column,
93
93
  label: l.label || `Filter by ${l.column}`,
94
94
  singleSelect: l.singleSelect,
95
95
  clearable: l.clearable,
96
- defaultValue: aa(l.defaultValue),
97
- value: aa(l.defaultValue),
98
- availableValues: Y(u, l.column).filter((d) => !l.excludeValues?.includes(`${d}`)).map((d) => ({ value: d, label: d })),
96
+ defaultValue: _(l.defaultValue),
97
+ value: _(l.defaultValue),
98
+ availableValues: X(d, l.column).filter((s) => !l.excludeValues?.includes(`${s}`)).map((s) => ({ value: s, label: s })),
99
99
  allowSelectAll: l.allowSelectAll,
100
100
  width: l.width
101
101
  }));
102
- E(e);
102
+ W(e);
103
103
  } catch (a) {
104
104
  console.error("Data fetching error:", a);
105
105
  }
106
- }, [n, o, S, V]);
107
- H(() => {
108
- q();
109
- }, [q]);
110
- const $ = R(() => !w || M.length === 0 ? w : w.filter(
111
- (u) => M.every(
112
- (e) => e.value && L([e.value]).length > 0 ? ua(
113
- L([u[e.filter]]),
114
- L([e.value]).map((l) => l.value)
106
+ }, [r, V, D]);
107
+ G(() => {
108
+ E();
109
+ }, [E]);
110
+ const k = O(() => !w || $.length === 0 ? w : w.filter(
111
+ (d) => $.every(
112
+ (e) => e.value && P([e.value]).length > 0 ? da(
113
+ P([d[e.filter]]),
114
+ P([e.value]).map((l) => l.value)
115
115
  ).length > 0 : !0
116
116
  )
117
- ), [M, w]);
118
- H(() => {
119
- x && D(O(x, i));
120
- }, [x, i]), H(() => {
121
- o !== "geoHubMap" && o !== "geoHubCompareMap" && o !== "geoHubMapWithLayerSelection" && w && ta($);
122
- }, [$, o, w]), H(() => {
123
- m?.column && $ && oa(
124
- Y($, m.column).filter((a) => !m?.excludeValues?.includes(`${a}`)).map((a) => ({ value: a, label: a }))
117
+ ), [$, w]);
118
+ G(() => {
119
+ I && S(H(I, i));
120
+ }, [I, i]), G(() => {
121
+ w && la(k);
122
+ }, [k, h, w]), G(() => {
123
+ m?.column && k && ia(
124
+ X(k, m.column).filter((a) => !m?.excludeValues?.includes(`${a}`)).map((a) => ({ value: a, label: a }))
125
125
  );
126
- }, [$, m]), H(() => {
127
- ca(U.current, i) || (I(i), U.current = i);
126
+ }, [k, m]), G(() => {
127
+ ua(U.current, i) || (v(i), U.current = i);
128
128
  }, [i]);
129
- const T = J((a, u) => {
130
- E((e) => e.map((l) => l.filter === a ? { ...l, value: u } : l));
131
- }, []), sa = R(() => {
129
+ const M = Z((a, d) => {
130
+ W((e) => e.map((l) => l.filter === a ? { ...l, value: d } : l));
131
+ }, []), oa = O(() => {
132
132
  if (!C) return;
133
- const a = o === "lineChartWithConfidenceInterval" && g ? Va(g) : g;
134
- return o !== "geoHubMap" && o !== "geoHubCompareMap" && o !== "geoHubMapWithLayerSelection" ? va(
135
- b ? wa(
136
- _(C, F || []),
137
- b.keyColumn,
138
- b.aggregationColumnsSetting
139
- ) : _(C, F || []),
140
- o,
133
+ const a = h === "lineChartWithConfidenceInterval" && g ? Va(g) : g;
134
+ return va(
135
+ x ? ba(
136
+ Y(C, R || []),
137
+ x.keyColumn,
138
+ x.aggregationColumnsSetting
139
+ ) : Y(C, R || []),
140
+ h,
141
141
  a
142
- ) : void 0;
143
- }, [o, g, C, F, b]);
144
- return !n && o !== "geoHubMap" && o !== "geoHubCompareMap" && o !== "geoHubMapWithLayerSelection" ? /* @__PURE__ */ r.jsx(ga, { size: "xs", className: "text-center text-accent-dark-red dark:text-accent-red p-2", children: "Please make sure either `dataSettings` props are present as they are required for data." }) : /* @__PURE__ */ r.jsx(
142
+ );
143
+ }, [h, g, C, R, x]);
144
+ return r ? /* @__PURE__ */ n.jsx(
145
145
  "div",
146
146
  {
147
- className: `${W || t?.theme || "light"} flex ${t?.width ? "w-fit grow-0" : "w-full grow"}${t?.height ? "" : " h-full"}`,
147
+ className: `${t?.theme || "light"} flex ${t?.width ? "w-fit grow-0" : "w-full grow"}${t?.height ? "" : " h-full"}`,
148
148
  dir: t?.language === "he" || t?.language === "ar" ? "rtl" : void 0,
149
- children: /* @__PURE__ */ r.jsx(
149
+ children: /* @__PURE__ */ n.jsx(
150
150
  "div",
151
151
  {
152
- className: da(
152
+ className: sa(
153
153
  `${t?.backgroundColor ? t?.backgroundColor === !0 ? "bg-primary-gray-200 dark:bg-primary-gray-650 " : "" : "bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${t?.language || "en"}`,
154
154
  t?.classNames?.graphContainer
155
155
  ),
@@ -159,7 +159,7 @@ function za(s) {
159
159
  },
160
160
  id: t?.graphID,
161
161
  ref: z,
162
- children: /* @__PURE__ */ r.jsx(
162
+ children: /* @__PURE__ */ n.jsx(
163
163
  "div",
164
164
  {
165
165
  style: {
@@ -167,9 +167,9 @@ function za(s) {
167
167
  flexGrow: 1,
168
168
  display: "flex"
169
169
  },
170
- children: /* @__PURE__ */ r.jsx("div", { className: "flex flex-col w-full gap-4 grow justify-between", children: C || Sa.filter((a) => a.geoHubMapPresentation).map((a) => a.graphID).indexOf(o) !== -1 ? /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
171
- p?.graphTitle || p?.graphDescription || t?.graphTitle || t?.graphDescription || t?.graphDownload || t?.dataDownload ? /* @__PURE__ */ r.jsx(
172
- ya,
170
+ children: /* @__PURE__ */ n.jsx("div", { className: "flex flex-col w-full gap-4 grow justify-between", children: C || ya.filter((a) => a.geoHubMapPresentation).map((a) => a.graphID).indexOf(h) !== -1 ? /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
171
+ p?.graphTitle || p?.graphDescription || t?.graphTitle || t?.graphDescription || t?.graphDownload || t?.dataDownload ? /* @__PURE__ */ n.jsx(
172
+ wa,
173
173
  {
174
174
  styles: {
175
175
  title: p?.styles?.title || t?.styles?.title,
@@ -186,7 +186,7 @@ function za(s) {
186
186
  dataDownload: t?.dataDownload && C && C.length > 0 ? C : null
187
187
  }
188
188
  ) : null,
189
- M.length !== 0 || (x || []).length !== 0 || (P || []).length !== 0 || m ? /* @__PURE__ */ r.jsxs(
189
+ $.length !== 0 || (I || []).length !== 0 || (L || []).length !== 0 || m ? /* @__PURE__ */ n.jsxs(
190
190
  "div",
191
191
  {
192
192
  style: {
@@ -197,18 +197,18 @@ function za(s) {
197
197
  width: "100%"
198
198
  },
199
199
  children: [
200
- P?.map((a, u) => /* @__PURE__ */ r.jsxs(
200
+ L?.map((a, d) => /* @__PURE__ */ n.jsxs(
201
201
  "div",
202
202
  {
203
203
  style: {
204
- width: a.width || `calc(${100 / h}% - ${(h - 1) / h}rem)`,
204
+ width: a.width || `calc(${100 / c}% - ${(c - 1) / c}rem)`,
205
205
  flexGrow: 1,
206
206
  flexShrink: a.ui !== "radio" ? 0 : 1,
207
207
  minWidth: "240px"
208
208
  },
209
209
  children: [
210
- /* @__PURE__ */ r.jsx(N, { className: "mb-2", children: a.label || "Graph by" }),
211
- a.ui !== "radio" ? /* @__PURE__ */ r.jsx(
210
+ /* @__PURE__ */ n.jsx(F, { className: "mb-2", children: a.label || "Graph by" }),
211
+ a.ui !== "radio" ? /* @__PURE__ */ n.jsx(
212
212
  y,
213
213
  {
214
214
  options: a.options.map((e) => ({
@@ -228,37 +228,37 @@ function za(s) {
228
228
  value: a.options[0].label
229
229
  },
230
230
  onChange: (e) => {
231
- D(e?.graphSettings || {}), I(e?.dataConfiguration);
231
+ S(e?.graphSettings || {}), v(e?.dataConfiguration);
232
232
  }
233
233
  }
234
- ) : /* @__PURE__ */ r.jsx(
235
- B,
234
+ ) : /* @__PURE__ */ n.jsx(
235
+ J,
236
236
  {
237
237
  defaultValue: a.defaultValue?.label || a.options[0].label,
238
238
  variant: f,
239
239
  onValueChange: (e) => {
240
- const l = a.options[a.options.findIndex((d) => d.label === e)];
241
- D(l.graphSettings || {}), I(l.dataConfiguration);
240
+ const l = a.options[a.options.findIndex((s) => s.label === e)];
241
+ S(l.graphSettings || {}), v(l.dataConfiguration);
242
242
  },
243
- children: a.options.map((e, l) => /* @__PURE__ */ r.jsx(K, { label: e.label, value: e.label }, l))
243
+ children: a.options.map((e, l) => /* @__PURE__ */ n.jsx(B, { label: e.label, value: e.label }, l))
244
244
  }
245
245
  )
246
246
  ]
247
247
  },
248
- u
248
+ d
249
249
  )),
250
- x?.map((a, u) => /* @__PURE__ */ r.jsxs(
250
+ I?.map((a, d) => /* @__PURE__ */ n.jsxs(
251
251
  "div",
252
252
  {
253
253
  style: {
254
- width: a.width || `calc(${100 / h}% - ${(h - 1) / h}rem)`,
254
+ width: a.width || `calc(${100 / c}% - ${(c - 1) / c}rem)`,
255
255
  flexGrow: 1,
256
256
  flexShrink: a.ui !== "radio" ? 0 : 1,
257
257
  minWidth: "240px"
258
258
  },
259
259
  children: [
260
- /* @__PURE__ */ r.jsx(N, { className: "mb-2", children: a.label || `Visualize ${a.chartConfigId} by` }),
261
- ha(a.chartConfigId, g || []) ? a.ui !== "radio" ? /* @__PURE__ */ r.jsx(
260
+ /* @__PURE__ */ n.jsx(F, { className: "mb-2", children: a.label || `Visualize ${a.chartConfigId} by` }),
261
+ ca(a.chartConfigId, g || []) ? a.ui !== "radio" ? /* @__PURE__ */ n.jsx(
262
262
  y,
263
263
  {
264
264
  options: a.allowedColumnIds,
@@ -272,22 +272,22 @@ function za(s) {
272
272
  )].columnId.map(
273
273
  (e) => a.allowedColumnIds[a.allowedColumnIds.findIndex((l) => l.value === e)]
274
274
  ) : void 0,
275
- filterOption: A(k),
275
+ filterOption: N(T),
276
276
  onChange: (e) => {
277
277
  const l = {
278
278
  columnId: (e || []).map(
279
279
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
280
- (c) => c.value
280
+ (u) => u.value
281
281
  ),
282
282
  chartConfigId: a.chartConfigId
283
- }, d = g?.map(
284
- (c) => c.chartConfigId === l.chartConfigId ? l : c
283
+ }, s = g?.map(
284
+ (u) => u.chartConfigId === l.chartConfigId ? l : u
285
285
  );
286
- I(d);
286
+ v(s);
287
287
  }
288
288
  }
289
- ) : /* @__PURE__ */ r.jsx(
290
- Q,
289
+ ) : /* @__PURE__ */ n.jsx(
290
+ K,
291
291
  {
292
292
  variant: f,
293
293
  defaultValue: i ? i[i.findIndex(
@@ -299,14 +299,14 @@ function za(s) {
299
299
  const l = {
300
300
  columnId: e || [],
301
301
  chartConfigId: a.chartConfigId
302
- }, d = g?.map(
303
- (c) => c.chartConfigId === l.chartConfigId ? l : c
302
+ }, s = g?.map(
303
+ (u) => u.chartConfigId === l.chartConfigId ? l : u
304
304
  );
305
- I(d);
305
+ v(s);
306
306
  },
307
- children: a.allowedColumnIds.map((e, l) => /* @__PURE__ */ r.jsx(X, { label: e.label, value: e.label }, l))
307
+ children: a.allowedColumnIds.map((e, l) => /* @__PURE__ */ n.jsx(Q, { label: e.label, value: e.label }, l))
308
308
  }
309
- ) : a.ui !== "radio" ? /* @__PURE__ */ r.jsx(
309
+ ) : a.ui !== "radio" ? /* @__PURE__ */ n.jsx(
310
310
  y,
311
311
  {
312
312
  options: a.allowedColumnIds,
@@ -324,16 +324,16 @@ function za(s) {
324
324
  const l = {
325
325
  columnId: e?.value,
326
326
  chartConfigId: a.chartConfigId
327
- }, d = g?.map(
328
- (c) => c.chartConfigId === l.chartConfigId ? l : c
327
+ }, s = g?.map(
328
+ (u) => u.chartConfigId === l.chartConfigId ? l : u
329
329
  );
330
- D(
331
- O(x, d)
332
- ), I(d);
330
+ S(
331
+ H(I, s)
332
+ ), v(s);
333
333
  }
334
334
  }
335
- ) : /* @__PURE__ */ r.jsx(
336
- B,
335
+ ) : /* @__PURE__ */ n.jsx(
336
+ J,
337
337
  {
338
338
  variant: f,
339
339
  defaultValue: i ? a.allowedColumnIds[a.allowedColumnIds.findIndex(
@@ -342,35 +342,35 @@ function za(s) {
342
342
  )].columnId
343
343
  )].label : "",
344
344
  onValueChange: (e) => {
345
- const d = {
346
- columnId: a.allowedColumnIds[a.allowedColumnIds.findIndex((G) => G.label === e)].value,
345
+ const s = {
346
+ columnId: a.allowedColumnIds[a.allowedColumnIds.findIndex((A) => A.label === e)].value,
347
347
  chartConfigId: a.chartConfigId
348
- }, c = g?.map(
349
- (G) => G.chartConfigId === d.chartConfigId ? d : G
348
+ }, u = g?.map(
349
+ (A) => A.chartConfigId === s.chartConfigId ? s : A
350
350
  );
351
- D(
352
- O(x, c)
353
- ), I(c);
351
+ S(
352
+ H(I, u)
353
+ ), v(u);
354
354
  },
355
- children: a.allowedColumnIds.map((e, l) => /* @__PURE__ */ r.jsx(K, { label: e.label, value: e.label }, l))
355
+ children: a.allowedColumnIds.map((e, l) => /* @__PURE__ */ n.jsx(B, { label: e.label, value: e.label }, l))
356
356
  }
357
357
  )
358
358
  ]
359
359
  },
360
- u
360
+ d
361
361
  )),
362
- M?.map((a, u) => /* @__PURE__ */ r.jsxs(
362
+ $?.map((a, d) => /* @__PURE__ */ n.jsxs(
363
363
  "div",
364
364
  {
365
365
  style: {
366
- width: a.width || `calc(${100 / h}% - ${(h - 1) / h}rem)`,
366
+ width: a.width || `calc(${100 / c}% - ${(c - 1) / c}rem)`,
367
367
  flexGrow: 1,
368
368
  flexShrink: 0,
369
369
  minWidth: "240px"
370
370
  },
371
371
  children: [
372
- /* @__PURE__ */ r.jsx(N, { className: "mb-2", children: a.label }),
373
- a.singleSelect ? /* @__PURE__ */ r.jsx(
372
+ /* @__PURE__ */ n.jsx(F, { className: "mb-2", children: a.label }),
373
+ a.singleSelect ? /* @__PURE__ */ n.jsx(
374
374
  y,
375
375
  {
376
376
  options: a.availableValues,
@@ -378,15 +378,15 @@ function za(s) {
378
378
  isClearable: a.clearable === void 0 ? !0 : a.clearable,
379
379
  isSearchable: !0,
380
380
  controlShouldRenderValue: !0,
381
- filterOption: A(k),
381
+ filterOption: N(T),
382
382
  onChange: (e) => {
383
- T(a.filter, e);
383
+ M(a.filter, e);
384
384
  },
385
385
  value: a.value,
386
386
  defaultValue: a.defaultValue
387
387
  }
388
- ) : /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
389
- a.ui !== "radio" ? /* @__PURE__ */ r.jsx(
388
+ ) : /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
389
+ a.ui !== "radio" ? /* @__PURE__ */ n.jsx(
390
390
  y,
391
391
  {
392
392
  options: a.availableValues,
@@ -396,27 +396,27 @@ function za(s) {
396
396
  isClearable: a.clearable === void 0 ? !0 : a.clearable,
397
397
  isSearchable: !0,
398
398
  controlShouldRenderValue: !0,
399
- filterOption: A(k),
399
+ filterOption: N(T),
400
400
  onChange: (e) => {
401
- T(a.filter, e);
401
+ M(a.filter, e);
402
402
  },
403
403
  value: a.value,
404
404
  defaultValue: a.defaultValue
405
405
  }
406
- ) : /* @__PURE__ */ r.jsx(
407
- Q,
406
+ ) : /* @__PURE__ */ n.jsx(
407
+ K,
408
408
  {
409
409
  variant: f,
410
410
  defaultValue: a.defaultValue ? a.defaultValue.map((e) => `${e.value}`) : [],
411
411
  value: a.value ? a.value.map((e) => `${e.value}`) : void 0,
412
412
  onValueChange: (e) => {
413
- T(
413
+ M(
414
414
  a.filter,
415
415
  a.availableValues.filter((l) => e.indexOf(`${l.value}`) !== -1)
416
416
  );
417
417
  },
418
- children: a.availableValues.map((e, l) => /* @__PURE__ */ r.jsx(
419
- X,
418
+ children: a.availableValues.map((e, l) => /* @__PURE__ */ n.jsx(
419
+ Q,
420
420
  {
421
421
  label: `${e.label}`,
422
422
  value: `${e.value}`
@@ -425,13 +425,13 @@ function za(s) {
425
425
  ))
426
426
  }
427
427
  ),
428
- a.allowSelectAll ? /* @__PURE__ */ r.jsx(
428
+ a.allowSelectAll ? /* @__PURE__ */ n.jsx(
429
429
  "button",
430
430
  {
431
431
  type: "button",
432
432
  className: "bg-transparent border-0 p-0 mt-2 cursor-pointer text-primary-blue-600 dark:text-primary-blue-400",
433
433
  onClick: () => {
434
- T(a.filter, a.availableValues);
434
+ M(a.filter, a.availableValues);
435
435
  },
436
436
  children: "Select all options"
437
437
  }
@@ -439,32 +439,32 @@ function za(s) {
439
439
  ] })
440
440
  ]
441
441
  },
442
- u
442
+ d
443
443
  )),
444
- m ? /* @__PURE__ */ r.jsxs(
444
+ m ? /* @__PURE__ */ n.jsxs(
445
445
  "div",
446
446
  {
447
447
  style: {
448
- width: m.width || `calc(${100 / h}% - ${(h - 1) / h}rem)`,
448
+ width: m.width || `calc(${100 / c}% - ${(c - 1) / c}rem)`,
449
449
  flexGrow: 1,
450
450
  flexShrink: 0,
451
451
  minWidth: "240px"
452
452
  },
453
453
  children: [
454
- /* @__PURE__ */ r.jsx(N, { className: "mb-2", children: m.label || "Highlight data" }),
455
- /* @__PURE__ */ r.jsx(
454
+ /* @__PURE__ */ n.jsx(F, { className: "mb-2", children: m.label || "Highlight data" }),
455
+ /* @__PURE__ */ n.jsx(
456
456
  y,
457
457
  {
458
- options: ia,
458
+ options: ra,
459
459
  variant: f,
460
460
  size: "sm",
461
461
  isMulti: !0,
462
462
  isClearable: !0,
463
463
  isSearchable: !0,
464
464
  controlShouldRenderValue: !0,
465
- filterOption: A(k),
465
+ filterOption: N(T),
466
466
  onChange: (a) => {
467
- na(a?.map((u) => u.value));
467
+ na(a?.map((d) => d.value));
468
468
  },
469
469
  value: j?.map((a) => ({
470
470
  label: a,
@@ -482,15 +482,15 @@ function za(s) {
482
482
  ]
483
483
  }
484
484
  ) : null,
485
- /* @__PURE__ */ r.jsx(
486
- fa,
485
+ /* @__PURE__ */ n.jsx(
486
+ ga,
487
487
  {
488
- graph: o,
489
- graphData: sa,
488
+ graph: h,
489
+ graphData: oa,
490
490
  graphDataConfiguration: g,
491
- debugMode: V,
492
- readableHeader: ea || [],
493
- updateFilters: la,
491
+ debugMode: D,
492
+ readableHeader: aa || [],
493
+ updateFilters: ea,
494
494
  settings: {
495
495
  ...t || {},
496
496
  ...p,
@@ -500,7 +500,7 @@ function za(s) {
500
500
  dataDownload: !1,
501
501
  backgroundColor: void 0,
502
502
  padding: "0",
503
- theme: t?.theme || W,
503
+ theme: t?.theme,
504
504
  ...j ? {
505
505
  highlightedDataPoints: j,
506
506
  highlightedIds: j?.map((a) => `${a}`),
@@ -509,15 +509,15 @@ function za(s) {
509
509
  }
510
510
  }
511
511
  )
512
- ] }) : /* @__PURE__ */ r.jsx("div", { className: "w-full flex justify-center p-4", children: /* @__PURE__ */ r.jsx(pa, {}) }) })
512
+ ] }) : /* @__PURE__ */ n.jsx("div", { className: "w-full flex justify-center p-4", children: /* @__PURE__ */ n.jsx(fa, {}) }) })
513
513
  }
514
514
  )
515
515
  }
516
516
  )
517
517
  }
518
- );
518
+ ) : /* @__PURE__ */ n.jsx(ha, { size: "xs", className: "text-center text-accent-dark-red dark:text-accent-red p-2", children: "Please make sure either `dataSettings` props are present as they are required for data." });
519
519
  }
520
520
  export {
521
- za as SingleGraphDashboard
521
+ Ua as SingleGraphDashboard
522
522
  };
523
523
  //# sourceMappingURL=SingleGraphDashboard.js.map