impaktapps-design 0.2.993-alpha.250 → 0.2.993-alpha.252

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 (35) hide show
  1. package/dist/impaktapps-design.es.js +149 -272
  2. package/dist/impaktapps-design.es.js.map +1 -1
  3. package/dist/impaktapps-design.umd.js +24 -24
  4. package/dist/impaktapps-design.umd.js.map +1 -1
  5. package/dist/src/component/AreaGraph/AreaGraph.d.ts +2 -4
  6. package/dist/src/component/AreaGraph/DrawAreaGraph.d.ts +1 -12
  7. package/dist/src/component/AreaGraph/interface.d.ts +63 -0
  8. package/dist/src/component/LineGraph/DrawLineGraph.d.ts +2 -7
  9. package/dist/src/component/LineGraph/LineGraph.d.ts +2 -4
  10. package/dist/src/component/LineGraph/interface.d.ts +56 -0
  11. package/dist/src/component/PieGraph/DrawPieGraph.d.ts +2 -6
  12. package/dist/src/component/PieGraph/PieGraph.d.ts +2 -4
  13. package/dist/src/component/PieGraph/interface.d.ts +41 -0
  14. package/dist/src/component/StackBarLineGraph/interface.d.ts +18 -6
  15. package/package.json +1 -1
  16. package/src/component/AreaGraph/AreaGraph.tsx +12 -14
  17. package/src/component/AreaGraph/DrawAreaGraph.tsx +6 -12
  18. package/src/component/AreaGraph/interface.ts +57 -0
  19. package/src/component/BarGraph/BarGraph.tsx +7 -9
  20. package/src/component/BarGraph/BarGraphInterface.ts +52 -0
  21. package/src/component/BarGraph/DrawBarGraph.tsx +8 -6
  22. package/src/component/BarGraph/DrawHorizontalBarGraph.tsx +7 -6
  23. package/src/component/BarGraph/HorizontalBarGraph.tsx +9 -10
  24. package/src/component/BarGraph/HorizontalBarGraphInterface.ts +52 -0
  25. package/src/component/LineGraph/DrawLineGraph.tsx +11 -8
  26. package/src/component/LineGraph/LineGraph.tsx +16 -14
  27. package/src/component/LineGraph/interface.ts +52 -0
  28. package/src/component/PieGraph/DrawPieGraph.tsx +14 -10
  29. package/src/component/PieGraph/PieGraph.tsx +11 -8
  30. package/src/component/PieGraph/interface.ts +39 -0
  31. package/src/component/StackBarLineGraph/DrawStackBarLineGraph.tsx +9 -8
  32. package/src/component/StackBarLineGraph/StackBarLineGraph.tsx +8 -11
  33. package/src/component/StackBarLineGraph/interface.ts +20 -6
  34. package/dist/src/utils/finalDataProvider.d.ts +0 -56
  35. package/src/utils/finalDataProvider.ts +0 -149
@@ -18657,15 +18657,17 @@ function DrawBarGraph({
18657
18657
  margin: margin2,
18658
18658
  value
18659
18659
  }) {
18660
- var _a, _b, _c, _d, _e, _f, _g, _h, _i;
18661
- const graphData = value.main.data;
18662
- const disableLeftLabel = (_a = value.main) == null ? void 0 : _a.disableLeftLabel;
18663
- const labelsArray = Object.keys(graphData[0]).filter((d2) => d2 !== value.main.xAxisValue);
18664
- const colorMap = (_c = (_b = value.style) == null ? void 0 : _b.barStyle) == null ? void 0 : _c.colorMap;
18665
- const legendLabels = (_d = value.main) == null ? void 0 : _d.legendLabels;
18666
- const defaultColour = (_f = (_e = theme.myTheme.palette) == null ? void 0 : _e.primary) == null ? void 0 : _f.main;
18660
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
18661
+ const graphData = ((_b = (_a = value.main) == null ? void 0 : _a.data) == null ? void 0 : _b.length) ? value.main.data : [];
18662
+ const disableLeftLabel = (_c = value.main) == null ? void 0 : _c.disableLeftLabel;
18663
+ const xAxisValue = ((_d = value.main) == null ? void 0 : _d.xAxisValue) || "label";
18664
+ const labelsArray = Object.keys(graphData[0]).filter((d2) => d2 !== xAxisValue);
18665
+ const colorMap = (_e = value.style) == null ? void 0 : _e.colorMap;
18666
+ const legendLabels = (_f = value.main) == null ? void 0 : _f.legendLabels;
18667
+ const legendAvailable = (_h = (_g = value == null ? void 0 : value.main) == null ? void 0 : _g.legendAvailable) != null ? _h : true;
18668
+ const defaultColour = (_j = (_i = theme.myTheme.palette) == null ? void 0 : _i.primary) == null ? void 0 : _j.main;
18667
18669
  const [hoveredBar, setHoveredBar] = useState({});
18668
- const getDataLabel = (d2) => d2[value.main.xAxisValue];
18670
+ const getDataLabel = (d2) => d2[xAxisValue];
18669
18671
  const labelsValueSum = graphData.map((currentBar) => labelsArray.reduce((sum2, k2) => sum2 += Number(currentBar[k2]), 0));
18670
18672
  const horizontalScale = createBandScale({
18671
18673
  domain: graphData.map(getDataLabel),
@@ -18764,7 +18766,7 @@ function DrawBarGraph({
18764
18766
  minWidth: `${width2}px`,
18765
18767
  width: `${width2}px`
18766
18768
  },
18767
- children: [value.main.legendAvailable && labelsArray.length > 1 && /* @__PURE__ */ jsx$1(Legend, {
18769
+ children: [legendAvailable && labelsArray.length > 1 && /* @__PURE__ */ jsx$1(Legend, {
18768
18770
  labelsArray,
18769
18771
  legendLabels,
18770
18772
  colorMap,
@@ -18798,8 +18800,8 @@ function DrawBarGraph({
18798
18800
  style: {
18799
18801
  display: hoveredBar.bar ? "block" : "none"
18800
18802
  },
18801
- x: value.main.type === "StackBarGraph" ? calcPositionofBar(hoveredBar.bar, (_g = hoveredBar.bar) == null ? void 0 : _g.bars[hoveredBar.subBarIndex], "stack") : calcPositionofBar(hoveredBar.bar, (_h = hoveredBar.bar) == null ? void 0 : _h.bars[hoveredBar.subBarIndex], "grouphov"),
18802
- width: value.main.type !== "StackBarGraph" ? calcWidthofBar(hoveredBar.bar) : Math.min((_i = hoveredBar.bar) == null ? void 0 : _i.bars[0].width, 15),
18803
+ x: value.main.type === "StackBarGraph" ? calcPositionofBar(hoveredBar.bar, (_k = hoveredBar.bar) == null ? void 0 : _k.bars[hoveredBar.subBarIndex], "stack") : calcPositionofBar(hoveredBar.bar, (_l = hoveredBar.bar) == null ? void 0 : _l.bars[hoveredBar.subBarIndex], "grouphov"),
18804
+ width: value.main.type !== "StackBarGraph" ? calcWidthofBar(hoveredBar.bar) : Math.min((_m = hoveredBar.bar) == null ? void 0 : _m.bars[0].width, 15),
18803
18805
  height: maxVerticalSpace,
18804
18806
  fill: theme.myTheme.palette.secondary.main,
18805
18807
  opacity: 1
@@ -19145,173 +19147,30 @@ ParentSize$1.propTypes = {
19145
19147
  className: _pt.string,
19146
19148
  children: _pt.func.isRequired
19147
19149
  };
19148
- const finalDataProvider = (type2, value, theme) => {
19149
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t5, _u, _v, _w, _x, _y, _z, _A, _B, _C;
19150
- switch (type2) {
19151
- case "BarGraph":
19152
- case "StackBarGraph":
19153
- case "HorizontalBarGraph":
19154
- case "HorizontalStackBarGraph":
19155
- return {
19156
- main: {
19157
- legendAvailable: true,
19158
- xAxisValue: "label",
19159
- ...value.main,
19160
- data: ((_a = value.main.data) == null ? void 0 : _a.length) ? value.main.data : [],
19161
- legend: {
19162
- direction: "row",
19163
- ...value.main.legend
19164
- }
19165
- },
19166
- style: {
19167
- containerStyle: {
19168
- background: theme.myTheme.palette.background.default,
19169
- height: "300",
19170
- ...(_b = value.style) == null ? void 0 : _b.containerStyle
19171
- },
19172
- labelStyle: {
19173
- ...(_c = value.style) == null ? void 0 : _c.labelStyle
19174
- },
19175
- barStyle: {
19176
- ...(_d = value.style) == null ? void 0 : _d.barStyle,
19177
- colorMap: (_e = value.style) == null ? void 0 : _e.colorMap
19178
- }
19179
- }
19180
- };
19181
- case "PieGraph":
19182
- return {
19183
- main: {
19184
- legendAvailable: true,
19185
- xAxisValue: "label",
19186
- outerRadius: 117,
19187
- innerRadius: 63,
19188
- ...value.main,
19189
- data: ((_f = value.main.data) == null ? void 0 : _f.length) > 0 ? value.main.data : [{ label: "No Data", value: 100 }],
19190
- legend: {
19191
- direction: "column",
19192
- ...value.main.legend
19193
- }
19194
- },
19195
- style: {
19196
- containerStyle: {
19197
- height: "300",
19198
- ...(_g = value.style) == null ? void 0 : _g.containerStyle
19199
- },
19200
- pieStyle: {
19201
- ...(_h = value.style) == null ? void 0 : _h.pieStyle,
19202
- colorMap: (_i = value.style) == null ? void 0 : _i.colorMap
19203
- }
19204
- }
19205
- };
19206
- case "LineGraph":
19207
- return {
19208
- main: {
19209
- legendAvailable: true,
19210
- xAxisValue: "label",
19211
- ...value.main,
19212
- data: ((_j = value.main.data) == null ? void 0 : _j.length) ? value.main.data : [{ "No Data": 0 }],
19213
- legend: {
19214
- direction: "row",
19215
- ...value.main.legend
19216
- }
19217
- },
19218
- style: {
19219
- containerStyle: {
19220
- background: theme.myTheme.palette.background.default,
19221
- height: "300",
19222
- ...(_k = value.style) == null ? void 0 : _k.containerStyle
19223
- },
19224
- labelStyle: {
19225
- ...(_l = value.style) == null ? void 0 : _l.labelStyle
19226
- },
19227
- lineStyle: {
19228
- ...(_m = value.style) == null ? void 0 : _m.lineStyle,
19229
- colorMap: (_n = value.style) == null ? void 0 : _n.colorMap
19230
- }
19231
- }
19232
- };
19233
- case "AreaGraph":
19234
- return {
19235
- main: {
19236
- legendAvailable: true,
19237
- xAxisValue: ((_o = value.main) == null ? void 0 : _o.xAxisValue) || "label",
19238
- xAxisType: ((_p = value.main) == null ? void 0 : _p.xAxisType) || "date",
19239
- ...value.main,
19240
- xAxisFormatType: ((_q = value.main) == null ? void 0 : _q.xAxisSchemaFormat) || ((_r = value.main) == null ? void 0 : _r.xAxisFormatType) || "Date and Month",
19241
- data: ((_s = value.main.data) == null ? void 0 : _s.length) ? value.main.data : [{ label: "", total: 0 }],
19242
- legend: {
19243
- direction: "row",
19244
- ...value.main.legend
19245
- }
19246
- },
19247
- style: {
19248
- containerStyle: {
19249
- background: theme.myTheme.palette.background.default,
19250
- height: "300",
19251
- ...(_t5 = value.style) == null ? void 0 : _t5.containerStyle
19252
- },
19253
- labelStyle: {
19254
- ...(_u = value.style) == null ? void 0 : _u.labelStyle
19255
- },
19256
- areaStyle: {
19257
- ...(_v = value.style) == null ? void 0 : _v.areaStyle,
19258
- colorMap: (_w = value.style) == null ? void 0 : _w.colorMap
19259
- }
19260
- }
19261
- };
19262
- case "StackBarLineGraph":
19263
- return {
19264
- main: {
19265
- legendAvailable: true,
19266
- xAxisValue: ((_x = value.main) == null ? void 0 : _x.xAxisValue) || "label",
19267
- ...value.main,
19268
- data: ((_y = value.main.data) == null ? void 0 : _y.length) ? value.main.data : [{}],
19269
- legend: {
19270
- direction: "row",
19271
- ...value.main.legend
19272
- }
19273
- },
19274
- style: {
19275
- containerStyle: {
19276
- background: theme.myTheme.palette.background.default,
19277
- height: "300",
19278
- ...(_z = value.style) == null ? void 0 : _z.containerStyle
19279
- },
19280
- labelStyle: {
19281
- ...(_A = value.style) == null ? void 0 : _A.labelStyle
19282
- },
19283
- stackBarLineStyle: {
19284
- ...(_B = value.style) == null ? void 0 : _B.stackBarLineStyle,
19285
- colorMap: (_C = value.style) == null ? void 0 : _C.colorMap
19286
- }
19287
- }
19288
- };
19289
- }
19290
- };
19291
19150
  const BarGraph = ({
19292
19151
  value,
19293
19152
  theme
19294
19153
  }) => {
19295
- const barData = finalDataProvider(value.main.type, value, theme);
19154
+ var _a, _b;
19296
19155
  const GraphRender = /* @__PURE__ */ jsx$1(ParentSize$1, {
19297
19156
  children: (parent) => {
19298
- var _a, _b;
19157
+ var _a2, _b2, _c, _d, _e, _f;
19299
19158
  return /* @__PURE__ */ jsx$1(DrawBarGraph, {
19300
19159
  theme,
19301
19160
  width: Math.max(parent.width, 500),
19302
- height: parseInt(barData.style.containerStyle.height || "300"),
19161
+ height: parseInt(String(((_b2 = (_a2 = value.style) == null ? void 0 : _a2.containerStyle) == null ? void 0 : _b2.height) || "300")),
19303
19162
  margin: {
19304
19163
  top: 10,
19305
19164
  right: 10,
19306
- bottom: barData.main.bottomAxisAngle ? 90 : 40,
19307
- left: ((_b = (_a = barData.style.labelStyle) == null ? void 0 : _a.margin) == null ? void 0 : _b.left) || 60
19165
+ bottom: ((_c = value.main) == null ? void 0 : _c.bottomAxisAngle) ? 90 : 40,
19166
+ left: ((_f = (_e = (_d = value.style) == null ? void 0 : _d.labelStyle) == null ? void 0 : _e.margin) == null ? void 0 : _f.left) || 60
19308
19167
  },
19309
- value: barData
19168
+ value
19310
19169
  });
19311
19170
  }
19312
19171
  });
19313
19172
  return /* @__PURE__ */ jsxs("div", {
19314
- children: [barData.main.header && /* @__PURE__ */ jsx$1("div", {
19173
+ children: [((_a = value.main) == null ? void 0 : _a.header) && /* @__PURE__ */ jsx$1("div", {
19315
19174
  style: {
19316
19175
  fontWeight: "bold",
19317
19176
  textAlign: "left",
@@ -19322,7 +19181,7 @@ const BarGraph = ({
19322
19181
  fontSize: "22px",
19323
19182
  color: theme.myTheme.palette.text.primary
19324
19183
  },
19325
- children: barData.main.header
19184
+ children: (_b = value.main) == null ? void 0 : _b.header
19326
19185
  }), GraphRender]
19327
19186
  });
19328
19187
  };
@@ -19332,7 +19191,7 @@ const DrawPieGraph = ({
19332
19191
  parentWidth,
19333
19192
  parentHeight
19334
19193
  }) => {
19335
- var _a, _b, _c;
19194
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
19336
19195
  const {
19337
19196
  TooltipInPortal
19338
19197
  } = useTooltipInPortal({
@@ -19341,14 +19200,21 @@ const DrawPieGraph = ({
19341
19200
  });
19342
19201
  const smallScreen = useMediaQuery(theme.myTheme.breakpoints.down("md"));
19343
19202
  const [active2, setActive] = useState(null);
19344
- const pieData = value.main.data;
19203
+ const pieData = ((_b = (_a = value.main) == null ? void 0 : _a.data) == null ? void 0 : _b.length) > 0 ? value.main.data : [{
19204
+ label: "No Data",
19205
+ value: 100
19206
+ }];
19207
+ const legendAvailable = (_d = (_c = value == null ? void 0 : value.main) == null ? void 0 : _c.legendAvailable) != null ? _d : true;
19208
+ const xAxisValue = ((_e = value.main) == null ? void 0 : _e.xAxisValue) || "label";
19345
19209
  const keyLabel = value.main.xAxisValue || Object.keys(pieData[0])[0];
19346
19210
  const valueLabel = value.main.yAxisValue || Object.keys(pieData[0])[1];
19347
19211
  const getValue2 = (d2) => d2[valueLabel];
19348
19212
  const dataKeyArray = pieData.map((data) => data[keyLabel]);
19349
- const colorMap = value.style.pieStyle.colorMap;
19350
- const defaultColour = (_b = (_a = theme.myTheme.palette) == null ? void 0 : _a.primary) == null ? void 0 : _b.main;
19351
- const legendLabels = (_c = value.main) == null ? void 0 : _c.legendLabels;
19213
+ const colorMap = (_f = value.style) == null ? void 0 : _f.colorMap;
19214
+ const defaultColour = (_h = (_g = theme.myTheme.palette) == null ? void 0 : _g.primary) == null ? void 0 : _h.main;
19215
+ const legendLabels = (_i = value.main) == null ? void 0 : _i.legendLabels;
19216
+ const outerRadius = (_k = (_j = value.main) == null ? void 0 : _j.outerRadius) != null ? _k : 117;
19217
+ const innerRadius = (_m = (_l = value.main) == null ? void 0 : _l.innerRadius) != null ? _m : 63;
19352
19218
  const getPieColor = createOrdinalScale$1({
19353
19219
  domain: pieData.map((l2) => l2[keyLabel]),
19354
19220
  range: dataKeyArray.map((key) => {
@@ -19401,8 +19267,8 @@ const DrawPieGraph = ({
19401
19267
  data: pieData,
19402
19268
  pieValue: getValue2,
19403
19269
  pieSortValues,
19404
- outerRadius: value.main.innerRadius - 5,
19405
- innerRadius: value.main.innerRadius - 10,
19270
+ outerRadius: innerRadius - 5,
19271
+ innerRadius: innerRadius - 10,
19406
19272
  padAngle: 0.05,
19407
19273
  children: (pie2) => {
19408
19274
  return pie2.arcs.map((arc2, index2) => {
@@ -19421,10 +19287,10 @@ const DrawPieGraph = ({
19421
19287
  outerRadius: ({
19422
19288
  data
19423
19289
  }) => {
19424
- const size = active2 && active2[value.main.xAxisValue] == data[value.main.xAxisValue] ? value.main.outerRadius + 3 : value.main.outerRadius;
19290
+ const size = active2 && active2[xAxisValue] == data[xAxisValue] ? outerRadius + 3 : outerRadius;
19425
19291
  return size;
19426
19292
  },
19427
- innerRadius: value.main.innerRadius,
19293
+ innerRadius,
19428
19294
  cornerRadius: 2,
19429
19295
  children: (pie2) => {
19430
19296
  return pie2.arcs.map((arc2, index2) => {
@@ -19479,7 +19345,7 @@ const DrawPieGraph = ({
19479
19345
  children: tooltipData[bar]
19480
19346
  })]
19481
19347
  }))
19482
- }, Math.random()), value.main.legendAvailable && (smallScreen || value.main.legendDirection === "row") && /* @__PURE__ */ jsx$1(Legend, {
19348
+ }, Math.random()), legendAvailable && (smallScreen || value.main.legendDirection === "row") && /* @__PURE__ */ jsx$1(Legend, {
19483
19349
  labelsArray: dataKeyArray,
19484
19350
  legendLabels,
19485
19351
  colorMap,
@@ -19493,7 +19359,7 @@ const DrawPieGraph = ({
19493
19359
  style: {
19494
19360
  display: smallScreen || value.main.legendDirection === "row" ? "none" : "flex"
19495
19361
  },
19496
- children: value.main.legendAvailable && /* @__PURE__ */ jsx$1(Legend, {
19362
+ children: legendAvailable && /* @__PURE__ */ jsx$1(Legend, {
19497
19363
  labelsArray: dataKeyArray,
19498
19364
  legendLabels,
19499
19365
  colorMap,
@@ -19508,19 +19374,22 @@ const PieGraph = ({
19508
19374
  value,
19509
19375
  theme
19510
19376
  }) => {
19511
- const pieData = finalDataProvider("PieGraph", value, theme);
19377
+ var _a, _b;
19512
19378
  const PieRender = /* @__PURE__ */ jsx$1(ParentSize$1, {
19513
- children: (parent) => /* @__PURE__ */ jsx$1(DrawPieGraph, {
19514
- theme,
19515
- parentWidth: parent.width,
19516
- parentHeight: parseInt(pieData.style.containerStyle.height),
19517
- parentRef: parent.ref,
19518
- resizeParent: parent.resize,
19519
- value: pieData
19520
- })
19379
+ children: (parent) => {
19380
+ var _a2, _b2;
19381
+ return /* @__PURE__ */ jsx$1(DrawPieGraph, {
19382
+ theme,
19383
+ parentWidth: parent.width,
19384
+ parentHeight: parseInt(String(((_b2 = (_a2 = value.style) == null ? void 0 : _a2.containerStyle) == null ? void 0 : _b2.height) || "300")),
19385
+ parentRef: parent.ref,
19386
+ resizeParent: parent.resize,
19387
+ value
19388
+ });
19389
+ }
19521
19390
  });
19522
19391
  return /* @__PURE__ */ jsxs("div", {
19523
- children: [pieData.main.header && /* @__PURE__ */ jsx$1("div", {
19392
+ children: [((_a = value.main) == null ? void 0 : _a.header) && /* @__PURE__ */ jsx$1("div", {
19524
19393
  style: {
19525
19394
  fontWeight: "bold",
19526
19395
  textAlign: "left",
@@ -19531,7 +19400,7 @@ const PieGraph = ({
19531
19400
  fontSize: "22px",
19532
19401
  color: theme.myTheme.palette.text.primary
19533
19402
  },
19534
- children: pieData.main.header
19403
+ children: (_b = value.main) == null ? void 0 : _b.header
19535
19404
  }), PieRender]
19536
19405
  });
19537
19406
  };
@@ -21890,15 +21759,19 @@ const DrawGraph = ({
21890
21759
  margin: margin2,
21891
21760
  value
21892
21761
  }) => {
21893
- var _a, _b, _c, _d;
21894
- const graphData = value.main.data;
21895
- const disableLeftLabel = (_a = value.main) == null ? void 0 : _a.disableLeftLabel;
21896
- const labelsArray = Object.keys(graphData[0]).filter((d2) => d2 !== value.main.xAxisValue);
21897
- const colorMap = value.style.lineStyle.colorMap;
21898
- const defaultColour = (_c = (_b = theme.myTheme.palette) == null ? void 0 : _b.primary) == null ? void 0 : _c.main;
21899
- const legendLabels = (_d = value.main) == null ? void 0 : _d.legendLabels;
21762
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
21763
+ const graphData = ((_b = (_a = value.main) == null ? void 0 : _a.data) == null ? void 0 : _b.length) ? value.main.data : [{
21764
+ "No Data": 0
21765
+ }];
21766
+ const disableLeftLabel = (_c = value.main) == null ? void 0 : _c.disableLeftLabel;
21767
+ const xAxisValue = ((_d = value.main) == null ? void 0 : _d.xAxisValue) || "label";
21768
+ const legendAvailable = (_f = (_e = value == null ? void 0 : value.main) == null ? void 0 : _e.legendAvailable) != null ? _f : true;
21769
+ const labelsArray = Object.keys(graphData[0]).filter((d2) => d2 !== xAxisValue);
21770
+ const colorMap = (_g = value.style) == null ? void 0 : _g.colorMap;
21771
+ const defaultColour = (_i = (_h = theme.myTheme.palette) == null ? void 0 : _h.primary) == null ? void 0 : _i.main;
21772
+ const legendLabels = (_j = value.main) == null ? void 0 : _j.legendLabels;
21900
21773
  const horizontalScale = createBandScale({
21901
- domain: graphData.map((d2) => d2[value.main.xAxisValue])
21774
+ domain: graphData.map((d2) => d2[xAxisValue])
21902
21775
  });
21903
21776
  const verticalScale = createLinearScale({
21904
21777
  domain: [0, Math.max(...graphData.flatMap((d2) => labelsArray.map((key) => d2[key])))]
@@ -21921,7 +21794,7 @@ const DrawGraph = ({
21921
21794
  minWidth: `${width2}px`,
21922
21795
  width: `${width2}px`
21923
21796
  },
21924
- children: [value.main.legendAvailable && /* @__PURE__ */ jsx$1(Legend, {
21797
+ children: [legendAvailable && /* @__PURE__ */ jsx$1(Legend, {
21925
21798
  labelsArray,
21926
21799
  legendLabels,
21927
21800
  colorMap,
@@ -21986,10 +21859,10 @@ const DrawGraph = ({
21986
21859
  fill: "none",
21987
21860
  fillOpacity: 0.2,
21988
21861
  stroke: (_a2 = colorMap == null ? void 0 : colorMap[elem]) != null ? _a2 : defaultColour,
21989
- xAccessor: (d2) => d2[value.main.xAxisValue],
21862
+ xAccessor: (d2) => d2[xAxisValue],
21990
21863
  yAccessor: (d2) => d2[elem]
21991
21864
  }), graphData.map((datum2, index2) => /* @__PURE__ */ jsx$1("circle", {
21992
- cx: horizontalScale(datum2[value.main.xAxisValue]) + horizontalScale.bandwidth() / 2,
21865
+ cx: horizontalScale(datum2[xAxisValue]) + horizontalScale.bandwidth() / 2,
21993
21866
  cy: verticalScale(datum2[elem]),
21994
21867
  r: 3,
21995
21868
  fill: "white",
@@ -22054,9 +21927,9 @@ const LineGraph = ({
22054
21927
  value,
22055
21928
  theme
22056
21929
  }) => {
22057
- const lineData = finalDataProvider("LineGraph", value, theme);
21930
+ var _a, _b;
22058
21931
  return /* @__PURE__ */ jsxs("div", {
22059
- children: [lineData.main.header && /* @__PURE__ */ jsx$1("div", {
21932
+ children: [((_a = value.main) == null ? void 0 : _a.header) && /* @__PURE__ */ jsx$1("div", {
22060
21933
  style: {
22061
21934
  fontWeight: "bold",
22062
21935
  textAlign: "left",
@@ -22067,21 +21940,21 @@ const LineGraph = ({
22067
21940
  fontSize: "22px",
22068
21941
  color: theme.myTheme.palette.text.primary
22069
21942
  },
22070
- children: lineData.main.header
21943
+ children: (_b = value.main) == null ? void 0 : _b.header
22071
21944
  }), /* @__PURE__ */ jsx$1(ParentSize$1, {
22072
21945
  children: (parent) => {
22073
- var _a, _b;
21946
+ var _a2, _b2, _c, _d, _e, _f;
22074
21947
  return /* @__PURE__ */ jsx$1(DrawGraph, {
22075
21948
  theme,
22076
21949
  width: Math.max(parent.width, 500),
22077
- height: parseInt(lineData.style.containerStyle.height || 400),
21950
+ height: parseInt(String(((_b2 = (_a2 = value.style) == null ? void 0 : _a2.containerStyle) == null ? void 0 : _b2.height) || 400)),
22078
21951
  margin: {
22079
21952
  top: 10,
22080
21953
  right: 10,
22081
- bottom: lineData.main.bottomAxisAngle ? 90 : 40,
22082
- left: ((_b = (_a = lineData.style.labelStyle) == null ? void 0 : _a.margin) == null ? void 0 : _b.left) || 60
21954
+ bottom: ((_c = value.main) == null ? void 0 : _c.bottomAxisAngle) ? 90 : 40,
21955
+ left: ((_f = (_e = (_d = value.style) == null ? void 0 : _d.labelStyle) == null ? void 0 : _e.margin) == null ? void 0 : _f.left) || 60
22083
21956
  },
22084
- value: lineData
21957
+ value
22085
21958
  });
22086
21959
  }
22087
21960
  })]
@@ -22171,7 +22044,7 @@ const DrawAreaGraph = ({
22171
22044
  areaValue,
22172
22045
  theme
22173
22046
  }) => {
22174
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
22047
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
22175
22048
  const {
22176
22049
  tooltipData,
22177
22050
  tooltipLeft,
@@ -22180,15 +22053,18 @@ const DrawAreaGraph = ({
22180
22053
  showTooltip,
22181
22054
  hideTooltip
22182
22055
  } = useTooltip();
22183
- const chartData = (_a = areaValue == null ? void 0 : areaValue.main) == null ? void 0 : _a.data;
22184
- const xAxisValue = (_b = areaValue == null ? void 0 : areaValue.main) == null ? void 0 : _b.xAxisValue;
22185
- const xAxisType = (_c = areaValue == null ? void 0 : areaValue.main) == null ? void 0 : _c.xAxisType;
22186
- const formatType = (_d = areaValue == null ? void 0 : areaValue.main) == null ? void 0 : _d.xAxisFormatType;
22187
- const yAxisTickCount = (_e = areaValue == null ? void 0 : areaValue.main) == null ? void 0 : _e.yAxisTickCount;
22188
- const disableLeftLabel = (_f = areaValue.main) == null ? void 0 : _f.disableLeftLabel;
22189
- const legendLabels = (_g = areaValue.main) == null ? void 0 : _g.legendLabels;
22190
- const colorMap = (_i = (_h = areaValue.style) == null ? void 0 : _h.areaStyle) == null ? void 0 : _i.colorMap;
22191
- const defaultColour = (_k = (_j = theme.myTheme.palette) == null ? void 0 : _j.primary) == null ? void 0 : _k.main;
22056
+ const chartData = ((_b = (_a = areaValue == null ? void 0 : areaValue.main) == null ? void 0 : _a.data) == null ? void 0 : _b.length) ? areaValue.main.data : [{
22057
+ label: "",
22058
+ total: 0
22059
+ }];
22060
+ const xAxisValue = ((_c = areaValue == null ? void 0 : areaValue.main) == null ? void 0 : _c.xAxisValue) || "label";
22061
+ const xAxisType = ((_d = areaValue == null ? void 0 : areaValue.main) == null ? void 0 : _d.xAxisType) || "date";
22062
+ const formatType = ((_e = areaValue == null ? void 0 : areaValue.main) == null ? void 0 : _e.xAxisSchemaFormat) || ((_f = areaValue == null ? void 0 : areaValue.main) == null ? void 0 : _f.xAxisFormatType) || "Date and Month";
22063
+ const yAxisTickCount = (_g = areaValue == null ? void 0 : areaValue.main) == null ? void 0 : _g.yAxisTickCount;
22064
+ const disableLeftLabel = (_h = areaValue.main) == null ? void 0 : _h.disableLeftLabel;
22065
+ const legendLabels = (_i = areaValue.main) == null ? void 0 : _i.legendLabels;
22066
+ const colorMap = (_j = areaValue.style) == null ? void 0 : _j.colorMap;
22067
+ const defaultColour = (_l = (_k = theme.myTheme.palette) == null ? void 0 : _k.primary) == null ? void 0 : _l.main;
22192
22068
  const isSmallScreen = width2 < 600;
22193
22069
  const longestLabelLength = useMemo(() => chartData.length ? Math.max(...chartData.map((d2) => String(d2[xAxisValue]).length)) : 0, [chartData, xAxisValue]);
22194
22070
  const dynamicBottomMargin = Math.ceil(longestLabelLength * PX_PER_CHAR$1 * LABEL_ROTATION$1);
@@ -22379,14 +22255,14 @@ const DrawAreaGraph = ({
22379
22255
  }), /* @__PURE__ */ jsx$1(AxisBottom, {
22380
22256
  top: innerHeight,
22381
22257
  scale: xScale,
22382
- label: (_l = areaValue.main) == null ? void 0 : _l.bottomLabel,
22258
+ label: (_m = areaValue.main) == null ? void 0 : _m.bottomLabel,
22383
22259
  tickFormat: formatXTick,
22384
22260
  stroke: "#d1d5db",
22385
22261
  tickStroke: "#d1d5db",
22386
22262
  tickLabelProps
22387
22263
  }), /* @__PURE__ */ jsx$1(AxisLeft, {
22388
22264
  scale: yScale,
22389
- label: !disableLeftLabel ? (_m = areaValue.main) == null ? void 0 : _m.leftLabel : void 0,
22265
+ label: !disableLeftLabel ? (_n = areaValue.main) == null ? void 0 : _n.leftLabel : void 0,
22390
22266
  stroke: "#d1d5db",
22391
22267
  tickStroke: "#d1d5db",
22392
22268
  numTicks: yAxisTickCount || 6,
@@ -22468,39 +22344,38 @@ const AreaGraph = ({
22468
22344
  value,
22469
22345
  theme
22470
22346
  }) => {
22471
- var _a, _b;
22472
- const areaData = finalDataProvider("AreaGraph", value, theme);
22347
+ var _a, _b, _c, _d, _e;
22473
22348
  const GraphRender = /* @__PURE__ */ jsx$1(ParentSize$1, {
22474
22349
  children: (parent) => {
22475
- var _a2, _b2;
22350
+ var _a2, _b2, _c2, _d2, _e2, _f;
22476
22351
  return /* @__PURE__ */ jsx$1(DrawAreaGraph, {
22477
22352
  theme,
22478
22353
  width: parent.width,
22479
- height: parseInt(areaData.style.containerStyle.height || "300"),
22354
+ height: parseInt(String(((_b2 = (_a2 = value.style) == null ? void 0 : _a2.containerStyle) == null ? void 0 : _b2.height) || "300")),
22480
22355
  margin: {
22481
22356
  top: 40,
22482
22357
  right: 20,
22483
- bottom: areaData.main.bottomAxisAngle ? 90 : 50,
22484
- left: ((_b2 = (_a2 = areaData.style.labelStyle) == null ? void 0 : _a2.margin) == null ? void 0 : _b2.left) || 60
22358
+ bottom: ((_c2 = value.main) == null ? void 0 : _c2.bottomAxisAngle) ? 90 : 50,
22359
+ left: ((_f = (_e2 = (_d2 = value.style) == null ? void 0 : _d2.labelStyle) == null ? void 0 : _e2.margin) == null ? void 0 : _f.left) || 60
22485
22360
  },
22486
- areaValue: areaData
22361
+ areaValue: value
22487
22362
  });
22488
22363
  }
22489
22364
  });
22490
22365
  return /* @__PURE__ */ jsxs("div", {
22491
- children: [areaData.main.header && /* @__PURE__ */ jsx$1("div", {
22366
+ children: [((_a = value.main) == null ? void 0 : _a.header) && /* @__PURE__ */ jsx$1("div", {
22492
22367
  style: {
22493
22368
  fontWeight: "bold",
22494
22369
  textAlign: "left",
22495
22370
  fontFamily: "inherit",
22496
- marginBottom: areaData.main.subHeader ? "6px" : "20px",
22371
+ marginBottom: ((_b = value.main) == null ? void 0 : _b.subHeader) ? "6px" : "20px",
22497
22372
  padding: "15px 0 1px 20px",
22498
22373
  width: "100%",
22499
22374
  fontSize: "22px",
22500
22375
  color: theme.myTheme.palette.text.primary
22501
22376
  },
22502
- children: (_a = areaData.main) == null ? void 0 : _a.header
22503
- }), areaData.main.subHeader && /* @__PURE__ */ jsx$1("div", {
22377
+ children: (_c = value.main) == null ? void 0 : _c.header
22378
+ }), ((_d = value.main) == null ? void 0 : _d.subHeader) && /* @__PURE__ */ jsx$1("div", {
22504
22379
  style: {
22505
22380
  textAlign: "left",
22506
22381
  fontFamily: "inherit",
@@ -22510,7 +22385,7 @@ const AreaGraph = ({
22510
22385
  fontSize: "12px",
22511
22386
  color: "#979393ff"
22512
22387
  },
22513
- children: (_b = areaData.main) == null ? void 0 : _b.subHeader
22388
+ children: (_e = value.main) == null ? void 0 : _e.subHeader
22514
22389
  }), GraphRender]
22515
22390
  });
22516
22391
  };
@@ -22523,7 +22398,7 @@ const DrawStackBarLineGraph = ({
22523
22398
  stackBarLineValue,
22524
22399
  theme
22525
22400
  }) => {
22526
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
22401
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r;
22527
22402
  const {
22528
22403
  tooltipData,
22529
22404
  tooltipLeft,
@@ -22533,16 +22408,17 @@ const DrawStackBarLineGraph = ({
22533
22408
  hideTooltip
22534
22409
  } = useTooltip();
22535
22410
  const [hoveredCategory, setHoveredCategory] = useState(null);
22536
- const chartData = (_b = (_a = stackBarLineValue == null ? void 0 : stackBarLineValue.main) == null ? void 0 : _a.data) != null ? _b : [];
22537
- const xAxisValue = (_c = stackBarLineValue == null ? void 0 : stackBarLineValue.main) == null ? void 0 : _c.xAxisValue;
22538
- const legendLabels = (_d = stackBarLineValue == null ? void 0 : stackBarLineValue.main) == null ? void 0 : _d.legendLabels;
22539
- const growthRateKey = ((_e = stackBarLineValue == null ? void 0 : stackBarLineValue.main) == null ? void 0 : _e.growthRateKey) || "growthRate";
22540
- const colorMap = (_g = (_f = stackBarLineValue == null ? void 0 : stackBarLineValue.style) == null ? void 0 : _f.stackBarLineStyle) == null ? void 0 : _g.colorMap;
22541
- const defaultColour = (_j = (_i = (_h = theme == null ? void 0 : theme.myTheme) == null ? void 0 : _h.palette) == null ? void 0 : _i.primary) == null ? void 0 : _j.main;
22542
- const yAxisTickCount = (_k = stackBarLineValue == null ? void 0 : stackBarLineValue.main) == null ? void 0 : _k.yAxisTickCount;
22543
- const disableLeftLabel = (_l = stackBarLineValue.main) == null ? void 0 : _l.disableLeftLabel;
22544
- const tooltipUnit = (_m = stackBarLineValue == null ? void 0 : stackBarLineValue.main) == null ? void 0 : _m.tooltipUnit;
22545
- const trendColor = (_n = colorMap == null ? void 0 : colorMap[growthRateKey]) != null ? _n : "#E24B4A";
22411
+ const chartData = ((_b = (_a = stackBarLineValue == null ? void 0 : stackBarLineValue.main) == null ? void 0 : _a.data) == null ? void 0 : _b.length) ? stackBarLineValue.main.data : [];
22412
+ const xAxisValue = ((_c = stackBarLineValue == null ? void 0 : stackBarLineValue.main) == null ? void 0 : _c.xAxisValue) || "label";
22413
+ const legendAvailable = (_e = (_d = stackBarLineValue == null ? void 0 : stackBarLineValue.main) == null ? void 0 : _d.legendAvailable) != null ? _e : true;
22414
+ const legendLabels = (_f = stackBarLineValue == null ? void 0 : stackBarLineValue.main) == null ? void 0 : _f.legendLabels;
22415
+ const growthRateKey = ((_g = stackBarLineValue == null ? void 0 : stackBarLineValue.main) == null ? void 0 : _g.growthRateKey) || "growthRate";
22416
+ const colorMap = (_h = stackBarLineValue == null ? void 0 : stackBarLineValue.style) == null ? void 0 : _h.colorMap;
22417
+ const defaultColour = (_k = (_j = (_i = theme == null ? void 0 : theme.myTheme) == null ? void 0 : _i.palette) == null ? void 0 : _j.primary) == null ? void 0 : _k.main;
22418
+ const yAxisTickCount = (_l = stackBarLineValue == null ? void 0 : stackBarLineValue.main) == null ? void 0 : _l.yAxisTickCount;
22419
+ const disableLeftLabel = (_m = stackBarLineValue == null ? void 0 : stackBarLineValue.main) == null ? void 0 : _m.disableLeftLabel;
22420
+ const tooltipUnit = (_n = stackBarLineValue == null ? void 0 : stackBarLineValue.main) == null ? void 0 : _n.tooltipUnit;
22421
+ const trendColor = (_o = colorMap == null ? void 0 : colorMap[growthRateKey]) != null ? _o : "#E24B4A";
22546
22422
  const isSmallScreen = width2 < 600;
22547
22423
  const longestLabelLength = useMemo(() => chartData.length ? Math.max(...chartData.map((d2) => String(d2[xAxisValue]).length)) : 0, [chartData, xAxisValue]);
22548
22424
  const dynamicBottomMargin = Math.ceil(longestLabelLength * PX_PER_CHAR * LABEL_ROTATION);
@@ -22742,7 +22618,7 @@ const DrawStackBarLineGraph = ({
22742
22618
  textAnchor: "end",
22743
22619
  dy: "0.33em"
22744
22620
  }),
22745
- label: !disableLeftLabel ? (_o = stackBarLineValue.main) == null ? void 0 : _o.leftLabel : void 0,
22621
+ label: !disableLeftLabel ? (_p = stackBarLineValue.main) == null ? void 0 : _p.leftLabel : void 0,
22746
22622
  labelProps: {
22747
22623
  fill: "#6B7280",
22748
22624
  fontSize: 11,
@@ -22754,7 +22630,7 @@ const DrawStackBarLineGraph = ({
22754
22630
  scale: trendScale,
22755
22631
  numTicks: 5,
22756
22632
  stroke: "#9CA3AF",
22757
- label: (_p = stackBarLineValue.main) == null ? void 0 : _p.rightLabel,
22633
+ label: (_q = stackBarLineValue.main) == null ? void 0 : _q.rightLabel,
22758
22634
  tickStroke: "transparent",
22759
22635
  tickLabelProps: () => ({
22760
22636
  fill: "#6B7280",
@@ -22772,12 +22648,12 @@ const DrawStackBarLineGraph = ({
22772
22648
  top: innerHeight,
22773
22649
  scale: categoryScale,
22774
22650
  stroke: "#9CA3AF",
22775
- label: (_q = stackBarLineValue.main) == null ? void 0 : _q.bottomLabel,
22651
+ label: (_r = stackBarLineValue.main) == null ? void 0 : _r.bottomLabel,
22776
22652
  tickStroke: "transparent",
22777
22653
  tickLabelProps
22778
22654
  })]
22779
22655
  })
22780
- }), stackBarLineValue.main.legendAvailable && labelsArray.length > 0 && /* @__PURE__ */ jsx$1(Legend, {
22656
+ }), legendAvailable && labelsArray.length > 0 && /* @__PURE__ */ jsx$1(Legend, {
22781
22657
  labelsArray,
22782
22658
  legendLabels,
22783
22659
  colorMap,
@@ -22845,39 +22721,38 @@ const StackBarLineGraph = ({
22845
22721
  value,
22846
22722
  theme
22847
22723
  }) => {
22848
- var _a, _b;
22849
- const stackBarLineData = finalDataProvider("StackBarLineGraph", value, theme);
22724
+ var _a, _b, _c, _d, _e;
22850
22725
  const GraphRender = /* @__PURE__ */ jsx$1(ParentSize$1, {
22851
22726
  children: (parent) => {
22852
- var _a2, _b2;
22727
+ var _a2, _b2, _c2, _d2, _e2;
22853
22728
  return /* @__PURE__ */ jsx$1(DrawStackBarLineGraph, {
22854
22729
  theme,
22855
22730
  width: parent.width,
22856
- height: parseInt(stackBarLineData.style.containerStyle.height || "300"),
22731
+ height: parseInt(String((_b2 = (_a2 = value.style) == null ? void 0 : _a2.containerStyle) == null ? void 0 : _b2.height) || "300"),
22857
22732
  margin: {
22858
22733
  top: 40,
22859
22734
  right: 80,
22860
22735
  bottom: 50,
22861
- left: ((_b2 = (_a2 = stackBarLineData.style.labelStyle) == null ? void 0 : _a2.margin) == null ? void 0 : _b2.left) || 60
22736
+ left: ((_e2 = (_d2 = (_c2 = value.style) == null ? void 0 : _c2.labelStyle) == null ? void 0 : _d2.margin) == null ? void 0 : _e2.left) || 60
22862
22737
  },
22863
- stackBarLineValue: stackBarLineData
22738
+ stackBarLineValue: value
22864
22739
  });
22865
22740
  }
22866
22741
  });
22867
22742
  return /* @__PURE__ */ jsxs("div", {
22868
- children: [stackBarLineData.main.header && /* @__PURE__ */ jsx$1("div", {
22743
+ children: [((_a = value.main) == null ? void 0 : _a.header) && /* @__PURE__ */ jsx$1("div", {
22869
22744
  style: {
22870
22745
  fontWeight: "bold",
22871
22746
  textAlign: "left",
22872
22747
  fontFamily: "inherit",
22873
- marginBottom: stackBarLineData.main.subHeader ? "6px" : "20px",
22748
+ marginBottom: ((_b = value.main) == null ? void 0 : _b.subHeader) ? "6px" : "20px",
22874
22749
  padding: "15px 0 1px 20px",
22875
22750
  width: "100%",
22876
22751
  fontSize: "22px",
22877
22752
  color: theme.myTheme.palette.text.primary
22878
22753
  },
22879
- children: (_a = stackBarLineData.main) == null ? void 0 : _a.header
22880
- }), stackBarLineData.main.subHeader && /* @__PURE__ */ jsx$1("div", {
22754
+ children: (_c = value.main) == null ? void 0 : _c.header
22755
+ }), ((_d = value.main) == null ? void 0 : _d.subHeader) && /* @__PURE__ */ jsx$1("div", {
22881
22756
  style: {
22882
22757
  textAlign: "left",
22883
22758
  fontFamily: "inherit",
@@ -22887,7 +22762,7 @@ const StackBarLineGraph = ({
22887
22762
  fontSize: "12px",
22888
22763
  color: "#979393ff"
22889
22764
  },
22890
- children: (_b = stackBarLineData.main) == null ? void 0 : _b.subHeader
22765
+ children: (_e = value.main) == null ? void 0 : _e.subHeader
22891
22766
  }), GraphRender]
22892
22767
  });
22893
22768
  };
@@ -22898,16 +22773,18 @@ var DrawHorizontalBarGraph = ({
22898
22773
  margin: margin2,
22899
22774
  barValue
22900
22775
  }) => {
22901
- var _a, _b, _c, _d, _e, _f, _g, _h;
22776
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
22902
22777
  const [hoveredBar, setHoveredBar] = useState({});
22903
- const graphData = barValue.main.data;
22904
- const disableLeftLabel = (_a = barValue.main) == null ? void 0 : _a.disableLeftLabel;
22905
- const labelsArray = Object.keys(graphData[0]).filter((d2) => d2 !== barValue.main.xAxisValue);
22906
- const colorMap = (_b = barValue.style.barStyle) == null ? void 0 : _b.colorMap;
22907
- const legendLabels = (_c = barValue.main) == null ? void 0 : _c.legendLabels;
22908
- const defaultColour = (_e = (_d = theme.myTheme.palette) == null ? void 0 : _d.primary) == null ? void 0 : _e.main;
22778
+ const graphData = ((_b = (_a = barValue.main) == null ? void 0 : _a.data) == null ? void 0 : _b.length) ? barValue.main.data : [];
22779
+ const disableLeftLabel = (_c = barValue.main) == null ? void 0 : _c.disableLeftLabel;
22780
+ const xAxisValue = ((_d = barValue.main) == null ? void 0 : _d.xAxisValue) || "label";
22781
+ const labelsArray = Object.keys(graphData[0]).filter((d2) => d2 !== xAxisValue);
22782
+ const legendAvailable = (_f = (_e = barValue == null ? void 0 : barValue.main) == null ? void 0 : _e.legendAvailable) != null ? _f : true;
22783
+ const colorMap = (_g = barValue.style) == null ? void 0 : _g.colorMap;
22784
+ const legendLabels = (_h = barValue.main) == null ? void 0 : _h.legendLabels;
22785
+ const defaultColour = (_j = (_i = theme.myTheme.palette) == null ? void 0 : _i.primary) == null ? void 0 : _j.main;
22909
22786
  const labelsValueSum = graphData.map((currentBar) => labelsArray.reduce((sum2, k2) => sum2 += Number(currentBar[k2]), 0));
22910
- const getDataLabel = (d2) => d2[barValue.main.xAxisValue];
22787
+ const getDataLabel = (d2) => d2[xAxisValue];
22911
22788
  const horizontalScale = createLinearScale({
22912
22789
  domain: barValue.main.type === "HorizontalStackBarGraph" ? [0, Math.max(...labelsValueSum)] : [0, Math.max(...graphData.flatMap((d2) => labelsArray.map((key) => Number(d2[key]))))],
22913
22790
  nice: true
@@ -23005,7 +22882,7 @@ var DrawHorizontalBarGraph = ({
23005
22882
  minWidth: `${width2}px`,
23006
22883
  width: `${width2}px`
23007
22884
  },
23008
- children: [barValue.main.legendAvailable && labelsArray.length > 1 && /* @__PURE__ */ jsx$1(Legend, {
22885
+ children: [legendAvailable && labelsArray.length > 1 && /* @__PURE__ */ jsx$1(Legend, {
23009
22886
  labelsArray,
23010
22887
  legendLabels,
23011
22888
  colorMap,
@@ -23039,9 +22916,9 @@ var DrawHorizontalBarGraph = ({
23039
22916
  style: {
23040
22917
  display: hoveredBar.bar ? "block" : "none"
23041
22918
  },
23042
- y: barValue.main.type === "HorizontalStackBarGraph" ? calcPositionofBar(hoveredBar.bar, (_f = hoveredBar.bar) == null ? void 0 : _f.bars[hoveredBar.subBarIndex], "stack") : calcPositionofBar(hoveredBar.bar, (_g = hoveredBar.bar) == null ? void 0 : _g.bars[hoveredBar.subBarIndex], "grouphov"),
22919
+ y: barValue.main.type === "HorizontalStackBarGraph" ? calcPositionofBar(hoveredBar.bar, (_k = hoveredBar.bar) == null ? void 0 : _k.bars[hoveredBar.subBarIndex], "stack") : calcPositionofBar(hoveredBar.bar, (_l = hoveredBar.bar) == null ? void 0 : _l.bars[hoveredBar.subBarIndex], "grouphov"),
23043
22920
  width: maxHorizontalSpace,
23044
- height: barValue.main.type !== "HorizontalStackBarGraph" ? calcWidthofBar(hoveredBar.bar) : Math.min((_h = hoveredBar.bar) == null ? void 0 : _h.bars[0].height, 15),
22921
+ height: barValue.main.type !== "HorizontalStackBarGraph" ? calcWidthofBar(hoveredBar.bar) : Math.min((_m = hoveredBar.bar) == null ? void 0 : _m.bars[0].height, 15),
23045
22922
  fill: theme.myTheme.palette.secondary.main,
23046
22923
  opacity: 1
23047
22924
  }), barValue.main.type === "HorizontalStackBarGraph" ? /* @__PURE__ */ jsx$1(BarStackHorizontal, {
@@ -23124,26 +23001,26 @@ const HorizontalBarGraph = ({
23124
23001
  value,
23125
23002
  theme
23126
23003
  }) => {
23127
- const barData = finalDataProvider("HorizontalBarGraph", value, theme);
23004
+ var _a, _b;
23128
23005
  const GraphRender = /* @__PURE__ */ jsx$1(ParentSize$1, {
23129
23006
  children: (parent) => {
23130
- var _a, _b;
23007
+ var _a2, _b2, _c, _d, _e, _f;
23131
23008
  return /* @__PURE__ */ jsx$1(DrawHorizontalBarGraph, {
23132
23009
  theme,
23133
23010
  width: Math.max(parent.width, 500),
23134
- height: parseInt(barData.style.containerStyle.height || "300"),
23011
+ height: parseInt(String(((_b2 = (_a2 = value.style) == null ? void 0 : _a2.containerStyle) == null ? void 0 : _b2.height) || "300")),
23135
23012
  margin: {
23136
23013
  top: 10,
23137
23014
  right: 20,
23138
- bottom: barData.main.bottomAxisAngle ? 90 : 40,
23139
- left: ((_b = (_a = barData.style.labelStyle) == null ? void 0 : _a.margin) == null ? void 0 : _b.left) || 60
23015
+ bottom: ((_c = value.main) == null ? void 0 : _c.bottomAxisAngle) ? 90 : 40,
23016
+ left: ((_f = (_e = (_d = value.style) == null ? void 0 : _d.labelStyle) == null ? void 0 : _e.margin) == null ? void 0 : _f.left) || 60
23140
23017
  },
23141
- barValue: barData
23018
+ barValue: value
23142
23019
  });
23143
23020
  }
23144
23021
  });
23145
23022
  return /* @__PURE__ */ jsxs("div", {
23146
- children: [barData.main.header && /* @__PURE__ */ jsx$1("div", {
23023
+ children: [((_a = value.main) == null ? void 0 : _a.header) && /* @__PURE__ */ jsx$1("div", {
23147
23024
  style: {
23148
23025
  fontWeight: "bold",
23149
23026
  textAlign: "left",
@@ -23154,7 +23031,7 @@ const HorizontalBarGraph = ({
23154
23031
  fontSize: "22px",
23155
23032
  color: theme.myTheme.palette.text.primary
23156
23033
  },
23157
- children: barData.main.header
23034
+ children: (_b = value.main) == null ? void 0 : _b.header
23158
23035
  }), GraphRender]
23159
23036
  });
23160
23037
  };