impaktapps-design 0.2.93 → 0.2.94-alpha.1

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.
@@ -10459,8 +10459,7 @@ const ToolTip = ({
10459
10459
  style: style2,
10460
10460
  top: top2,
10461
10461
  left: left2,
10462
- tooltipData,
10463
- getLetterFrequencyColor
10462
+ tooltipData
10464
10463
  }) => {
10465
10464
  const {
10466
10465
  TooltipInPortal
@@ -10468,34 +10467,37 @@ const ToolTip = ({
10468
10467
  detectBounds: true,
10469
10468
  scroll: true
10470
10469
  });
10471
- const tooltipStyles2 = {
10472
- ...defaultStyles,
10473
- minWidth: 100,
10474
- height: 20,
10475
- backgroundColor: "lightgrey",
10476
- color: "black"
10477
- };
10478
- console.log("ver 0.2.89-alpha.407");
10479
10470
  return /* @__PURE__ */ jsx(TooltipInPortal, {
10480
10471
  top: top2,
10481
10472
  left: left2,
10482
- style: tooltipStyles2,
10483
10473
  children: /* @__PURE__ */ jsxs("div", {
10484
10474
  style: {
10485
- display: "flex",
10486
- alignItems: "center"
10475
+ minWidth: 60,
10476
+ textAlign: "center",
10477
+ background: "black",
10478
+ padding: "10px",
10479
+ boxShadow: "2px 2px 5px black",
10480
+ color: "#6c5efb",
10481
+ backgroundColor: "black",
10482
+ ...style2 == null ? void 0 : style2.tooltipStyle,
10483
+ margin: "-20px"
10487
10484
  },
10488
10485
  children: [/* @__PURE__ */ jsx("div", {
10489
10486
  style: {
10490
- width: "12px",
10491
- height: "12px",
10492
- backgroundColor: getLetterFrequencyColor(tooltipData[0]),
10493
- marginRight: "8px"
10494
- }
10487
+ padding: "4px 10px",
10488
+ color: (style2 == null ? void 0 : style2.tooltipbackground) || "white",
10489
+ borderRadius: "5px",
10490
+ fontWeight: 700
10491
+ },
10492
+ children: tooltipData[0]
10495
10493
  }), /* @__PURE__ */ jsx("div", {
10496
- children: /* @__PURE__ */ jsx("strong", {
10497
- children: `${tooltipData[0]}: ${tooltipData[1]}`
10498
- })
10494
+ style: {
10495
+ padding: "4px 10px",
10496
+ borderRadius: "5px",
10497
+ marginTop: "10px",
10498
+ fontWeight: 700
10499
+ },
10500
+ children: tooltipData[1]
10499
10501
  })]
10500
10502
  })
10501
10503
  }, Math.random());
@@ -10871,43 +10873,40 @@ function Legend({
10871
10873
  colorRange,
10872
10874
  dataKeyArray
10873
10875
  }) {
10874
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o;
10876
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
10875
10877
  const legendGlyphSize = ((_b = (_a = value == null ? void 0 : value.main) == null ? void 0 : _a.legend) == null ? void 0 : _b.colorRectWidth) || 15;
10876
10878
  const ordinalColorScale = createOrdinalScale$1({
10877
10879
  domain: dataKeyArray || ((_c = value == null ? void 0 : value.main) == null ? void 0 : _c.tooltipDataKey),
10878
- range: colorRange || ((_e = (_d = value == null ? void 0 : value.style) == null ? void 0 : _d.barStyle) == null ? void 0 : _e.colorRange) || ((_g = (_f = value == null ? void 0 : value.style) == null ? void 0 : _f.pieStyle) == null ? void 0 : _g.colorRange) || ((_i = (_h = value == null ? void 0 : value.style) == null ? void 0 : _h.lineStyle) == null ? void 0 : _i.colorRange)
10880
+ range: colorRange || ((_e = (_d = value == null ? void 0 : value.style) == null ? void 0 : _d.pieStyle) == null ? void 0 : _e.colorRange)
10879
10881
  });
10880
10882
  return /* @__PURE__ */ jsxs("div", {
10881
10883
  className: "legend",
10882
10884
  style: {
10883
10885
  paddingLeft: "40px",
10884
10886
  paddingRight: "40px",
10885
- ...(_k = (_j = value == null ? void 0 : value.style) == null ? void 0 : _j.legendStyle) == null ? void 0 : _k.legend
10887
+ ...(_g = (_f = value == null ? void 0 : value.style) == null ? void 0 : _f.legendStyle) == null ? void 0 : _g.legend
10886
10888
  },
10887
10889
  children: [/* @__PURE__ */ jsx("div", {
10888
10890
  className: "title",
10889
- style: (_m = (_l = value == null ? void 0 : value.style) == null ? void 0 : _l.legendStyle) == null ? void 0 : _m.legendTitle,
10890
- children: (_o = (_n = value == null ? void 0 : value.main) == null ? void 0 : _n.legend) == null ? void 0 : _o.legendTitle
10891
+ style: (_i = (_h = value == null ? void 0 : value.style) == null ? void 0 : _h.legendStyle) == null ? void 0 : _i.legendTitle,
10892
+ children: (_k = (_j = value == null ? void 0 : value.main) == null ? void 0 : _j.legend) == null ? void 0 : _k.legendTitle
10891
10893
  }), /* @__PURE__ */ jsx(Ordinal, {
10892
10894
  scale: ordinalColorScale,
10893
- labelFormat: (label) => `${label.toUpperCase()}`,
10894
10895
  children: (labels) => {
10895
10896
  var _a2, _b2;
10896
10897
  return /* @__PURE__ */ jsx("div", {
10897
10898
  style: {
10898
10899
  display: "flex",
10899
- flexDirection: ((_b2 = (_a2 = value == null ? void 0 : value.main) == null ? void 0 : _a2.legend) == null ? void 0 : _b2.direction) || "row",
10900
- flexWrap: "wrap"
10900
+ flexDirection: ((_b2 = (_a2 = value == null ? void 0 : value.main) == null ? void 0 : _a2.legend) == null ? void 0 : _b2.direction) || "row"
10901
10901
  },
10902
10902
  children: labels.map((label, i) => {
10903
- var _a3, _b3, _c2, _d2;
10903
+ var _a3, _b3;
10904
10904
  return /* @__PURE__ */ jsxs(LegendItem, {
10905
10905
  margin: "0 5px",
10906
10906
  onClick: (events) => {
10907
10907
  if (events)
10908
10908
  alert(`clicked: ${JSON.stringify(label)}`);
10909
10909
  },
10910
- style: (_b3 = (_a3 = value == null ? void 0 : value.style) == null ? void 0 : _a3.legendStyle) == null ? void 0 : _b3.legendVertical,
10911
10910
  children: [/* @__PURE__ */ jsx("svg", {
10912
10911
  width: legendGlyphSize,
10913
10912
  height: legendGlyphSize,
@@ -10917,7 +10916,7 @@ function Legend({
10917
10916
  height: legendGlyphSize
10918
10917
  })
10919
10918
  }), /* @__PURE__ */ jsx(LegendLabel, {
10920
- align: `${((_d2 = (_c2 = value == null ? void 0 : value.main) == null ? void 0 : _c2.legend) == null ? void 0 : _d2.align) || "left"}`,
10919
+ align: `${((_b3 = (_a3 = value == null ? void 0 : value.main) == null ? void 0 : _a3.legend) == null ? void 0 : _b3.align) || "left"}`,
10921
10920
  margin: "0 0 0 4px",
10922
10921
  children: label.text
10923
10922
  })]
@@ -10976,7 +10975,7 @@ function DrawBarGraph({
10976
10975
  range: [((_e = (_d = (_c = value.style) == null ? void 0 : _c.barStyle) == null ? void 0 : _d.color) == null ? void 0 : _e.firstBarColor) || "#aeeef8", ((_h = (_g = (_f = value.style) == null ? void 0 : _f.barStyle) == null ? void 0 : _g.color) == null ? void 0 : _h.secondBarColor) || "#e5fd3d", ((_k = (_j = (_i = value.style) == null ? void 0 : _i.barStyle) == null ? void 0 : _j.color) == null ? void 0 : _k.thirdBarColor) || "#9caff6"]
10977
10976
  });
10978
10977
  const xMax = width2 - margin2.left - margin2.right;
10979
- const yMax = height2 - margin2.top - margin2.bottom - 0;
10978
+ const yMax = height2 - margin2.top - 100;
10980
10979
  dateScale.rangeRound([0, xMax]);
10981
10980
  cityScale.rangeRound([0, dateScale.bandwidth()]);
10982
10981
  tempScale.range([yMax, 0]);
@@ -11384,32 +11383,15 @@ ParentSize$1.propTypes = {
11384
11383
  children: PropTypes.func.isRequired
11385
11384
  };
11386
11385
  const Product1 = [
11387
- {
11388
- "key": "key1",
11389
- "value": [
11390
- { "x": "01:00", "y": 123 },
11391
- { "x": "02:00", "y": 118 },
11392
- { "x": "03:00", "y": 141 },
11393
- { "x": "04:00", "y": 114 },
11394
- { "x": "05:00", "y": 108 },
11395
- { "x": "06:00", "y": 123 },
11396
- { "x": "07:00", "y": 128 },
11397
- { "x": "08:00", "y": 134 },
11398
- { "x": "09:00", "y": 131 },
11399
- { "x": "10:00", "y": 134 },
11400
- { "x": "11:00", "y": 118 },
11401
- { "x": "11:00", "y": 10 },
11402
- { "x": "12:00", "y": 130 },
11403
- { "x": "13:00", "y": 133 },
11404
- { "x": "14:00", "y": 132 },
11405
- { "x": "15:00", "y": 1 },
11406
- { "x": "15:00", "y": 137 },
11407
- { "x": "16:00", "y": 120 }
11408
- ]
11409
- }
11386
+ { x: "a", y: 100 },
11387
+ { x: "b", y: 50 },
11388
+ { x: "c", y: 100 },
11389
+ { x: "d", y: 80 },
11390
+ { x: "f", y: 100 },
11391
+ { x: "g", y: 50 }
11410
11392
  ];
11411
11393
  const finalDataProvider = (type2, value, theme) => {
11412
- 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, _D, _E, _F, _G, _H, _I;
11394
+ 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, _D, _E, _F;
11413
11395
  switch (type2) {
11414
11396
  case "BarGraph":
11415
11397
  case "StackBarGraph":
@@ -11485,7 +11467,7 @@ const finalDataProvider = (type2, value, theme) => {
11485
11467
  case "PieGraph":
11486
11468
  return {
11487
11469
  main: {
11488
- data: ((_h = value == null ? void 0 : value.main) == null ? void 0 : _h.data) && value.main.data.length > 0 ? (_i = value == null ? void 0 : value.main) == null ? void 0 : _i.data : [{ label: "Kotak", value: 500 }, { label: "SBI", value: 700 }, { label: "HDFC", value: 900 }],
11470
+ data: ((_h = value == null ? void 0 : value.main) == null ? void 0 : _h.data) || [{ branch: "Kotak", value: 500 }, { branch: "SBI", value: 700 }, { branch: "HDFC", value: 900 }],
11489
11471
  header: "Pie Graph",
11490
11472
  bottomLabel: "Name of Employe",
11491
11473
  leftLabel: "Value",
@@ -11499,7 +11481,7 @@ const finalDataProvider = (type2, value, theme) => {
11499
11481
  legendTitle: "Our Assests",
11500
11482
  direction: "row",
11501
11483
  align: "right",
11502
- ...(_j = value == null ? void 0 : value.main) == null ? void 0 : _j.legend
11484
+ ...(_i = value == null ? void 0 : value.main) == null ? void 0 : _i.legend
11503
11485
  }
11504
11486
  },
11505
11487
  style: {
@@ -11509,7 +11491,7 @@ const finalDataProvider = (type2, value, theme) => {
11509
11491
  height: "310",
11510
11492
  borderRadius: "20px",
11511
11493
  padding: "10px 0 2px 0",
11512
- ...(_k = value == null ? void 0 : value.style) == null ? void 0 : _k.containerStyle
11494
+ ...(_j = value == null ? void 0 : value.style) == null ? void 0 : _j.containerStyle
11513
11495
  },
11514
11496
  headerStyle: {
11515
11497
  fontWeight: 500,
@@ -11520,22 +11502,17 @@ const finalDataProvider = (type2, value, theme) => {
11520
11502
  width: "100%",
11521
11503
  fontSize: "18px",
11522
11504
  color: theme.palette.text.primary,
11523
- ...(_l = value == null ? void 0 : value.style) == null ? void 0 : _l.headerStyle
11505
+ ...(_k = value == null ? void 0 : value.style) == null ? void 0 : _k.headerStyle
11524
11506
  },
11525
11507
  tooltipStyle: {
11526
- width: "100%",
11527
- minWidth: 80,
11528
- height: 20,
11529
- backgroundColor: "lightgrey",
11530
- color: "black",
11531
- ...(_m = value == null ? void 0 : value.style) == null ? void 0 : _m.tooltipStyle
11508
+ ...(_l = value == null ? void 0 : value.style) == null ? void 0 : _l.tooltipStyle
11532
11509
  },
11533
11510
  labelStyle: {
11534
11511
  labelColor: theme.palette.text.primary,
11535
11512
  labelOffset: 45,
11536
11513
  leftLabelMargin: "70",
11537
11514
  topLabelMargin: "-40",
11538
- ...(_n = value == null ? void 0 : value.style) == null ? void 0 : _n.labelStyle
11515
+ ...(_m = value == null ? void 0 : value.style) == null ? void 0 : _m.labelStyle
11539
11516
  },
11540
11517
  legendStyle: {
11541
11518
  legend: {
@@ -11548,40 +11525,33 @@ const finalDataProvider = (type2, value, theme) => {
11548
11525
  border: "1px solid rgba(255, 255, 255, 0.3)",
11549
11526
  borderRadius: " 8px",
11550
11527
  margin: "5px 5px",
11551
- ...(_p = (_o = value == null ? void 0 : value.style) == null ? void 0 : _o.legendStyle) == null ? void 0 : _p.legend
11552
- },
11553
- legendVertical: {
11554
- paddingBottom: "8px",
11555
- flexDirection: "row",
11556
- display: "flex",
11557
- alignItems: "center"
11528
+ ...(_o = (_n = value == null ? void 0 : value.style) == null ? void 0 : _n.legendStyle) == null ? void 0 : _o.legend
11558
11529
  },
11559
11530
  legendTitle: {
11560
11531
  fontWeight: 500,
11561
11532
  marginBottom: "5px",
11562
11533
  fontFamily: "roboto",
11563
11534
  fontSize: "10px",
11564
- ...(_r = (_q = value == null ? void 0 : value.style) == null ? void 0 : _q.legendStyle) == null ? void 0 : _r.legendTitle
11535
+ ...(_q = (_p = value == null ? void 0 : value.style) == null ? void 0 : _p.legendStyle) == null ? void 0 : _q.legendTitle
11565
11536
  }
11566
11537
  },
11567
11538
  pieStyle: {
11568
- colorRange: ((_s = theme == null ? void 0 : theme.chartColours) == null ? void 0 : _s.pieChartColours) || ["#3f51b5", "rgba(200,0,31,0.9)", "rgba(25,200,205,0.6)"],
11539
+ colorRange: ["#3f51b5", "rgba(200,0,31,0.9)", "rgba(25,200,205,0.6)"],
11569
11540
  outerRadius: 120,
11570
- innerRadius: 63,
11541
+ innerRadius: 60,
11571
11542
  cornerRadius: 2,
11572
11543
  padAngle: 6e-3,
11573
- ...(_t5 = value == null ? void 0 : value.style) == null ? void 0 : _t5.pieStyle
11544
+ ...(_r = value == null ? void 0 : value.style) == null ? void 0 : _r.pieStyle
11574
11545
  }
11575
11546
  }
11576
11547
  };
11577
11548
  case "LineGraph":
11578
11549
  return {
11579
11550
  main: {
11580
- data: ((_u = value == null ? void 0 : value.main) == null ? void 0 : _u.data) || Product1,
11551
+ data: ((_s = value == null ? void 0 : value.main) == null ? void 0 : _s.data) || [Product1],
11581
11552
  header: "Line Graph Dynamic",
11582
11553
  bottomLabel: "Name of Employe",
11583
11554
  leftLabel: "Value",
11584
- legendAvailable: true,
11585
11555
  gridHidden: true,
11586
11556
  numHidden: false,
11587
11557
  tooltipDataKey: ["MAMA New Project", "Second", "Third"],
@@ -11592,10 +11562,11 @@ const finalDataProvider = (type2, value, theme) => {
11592
11562
  ...value == null ? void 0 : value.main,
11593
11563
  legend: {
11594
11564
  labelColor: theme.palette.text.primary,
11565
+ legendTitle: "Our Assests",
11595
11566
  direction: "row",
11596
11567
  align: "right",
11597
11568
  colorRectWidth: 20,
11598
- ...(_v = value == null ? void 0 : value.main) == null ? void 0 : _v.legend
11569
+ ...(_t5 = value == null ? void 0 : value.main) == null ? void 0 : _t5.legend
11599
11570
  }
11600
11571
  },
11601
11572
  style: {
@@ -11605,7 +11576,7 @@ const finalDataProvider = (type2, value, theme) => {
11605
11576
  height: "300",
11606
11577
  borderRadius: "20px",
11607
11578
  padding: "10px 0 2px 0",
11608
- ...(_w = value == null ? void 0 : value.style) == null ? void 0 : _w.containerStyle
11579
+ ...(_u = value == null ? void 0 : value.style) == null ? void 0 : _u.containerStyle
11609
11580
  },
11610
11581
  headerStyle: {
11611
11582
  fontWeight: 500,
@@ -11616,35 +11587,35 @@ const finalDataProvider = (type2, value, theme) => {
11616
11587
  width: "100%",
11617
11588
  fontSize: "18px",
11618
11589
  color: theme.palette.text.primary,
11619
- ...(_x = value == null ? void 0 : value.style) == null ? void 0 : _x.headerStyle
11590
+ ...(_v = value == null ? void 0 : value.style) == null ? void 0 : _v.headerStyle
11620
11591
  },
11621
11592
  labelStyle: {
11622
11593
  labelColor: theme.palette.text.primary,
11623
11594
  bottomLabelOffset: 20,
11624
11595
  leftLabelOffset: 50,
11625
11596
  leftLabelMargin: 80,
11626
- ...(_y = value == null ? void 0 : value.style) == null ? void 0 : _y.labelStyle
11597
+ ...(_w = value == null ? void 0 : value.style) == null ? void 0 : _w.labelStyle
11627
11598
  },
11628
11599
  lineStyle: {
11629
- colorRange: ((_z = theme == null ? void 0 : theme.chartColours) == null ? void 0 : _z.lineChartColours) || ["#3f51b5", "rgba(200,0,31,0.9)", "rgba(25,200,205,0.6)"],
11600
+ colorRange: ["#3f51b5", "rgba(200,0,31,0.9)", "rgba(25,200,205,0.6)"],
11630
11601
  lineAreaColor: "none",
11631
11602
  lineAreaOpacity: 0.2,
11632
- ...(_A = value == null ? void 0 : value.style) == null ? void 0 : _A.lineStyle
11603
+ ...(_x = value == null ? void 0 : value.style) == null ? void 0 : _x.lineStyle
11633
11604
  }
11634
11605
  }
11635
11606
  };
11636
11607
  case "HorizontalBarGraph":
11637
11608
  return {
11638
11609
  main: {
11639
- data: ((_B = value == null ? void 0 : value.main) == null ? void 0 : _B.data) || [{ y: "Anant Sharma", x: 60 }, { y: "Pankaj Chauhan", x: 60 }, { y: "satendra Raghav", x: 150 }, { y: "Vivek Pahadi", x: 80 }, { y: "Siddarth verma", x: 100 }],
11610
+ data: ((_y = value == null ? void 0 : value.main) == null ? void 0 : _y.data) || [{ y: "Anant Sharma", x: 60 }, { y: "Pankaj Chauhan", x: 60 }, { y: "satendra Raghav", x: 150 }, { y: "Vivek Pahadi", x: 80 }, { y: "Siddarth verma", x: 100 }],
11640
11611
  header: " ",
11641
11612
  bottomLabel: "Name of Employe",
11642
11613
  leftLabel: "Value",
11643
11614
  axisLeft: true,
11644
11615
  axisBottom: true,
11645
11616
  hideBottomTicks: false,
11646
- hideLeftTicks: ((_C = value == null ? void 0 : value.main) == null ? void 0 : _C.data) ? true : false,
11647
- hideLeftAxisLine: ((_D = value == null ? void 0 : value.main) == null ? void 0 : _D.data) ? true : false,
11617
+ hideLeftTicks: ((_z = value == null ? void 0 : value.main) == null ? void 0 : _z.data) ? true : false,
11618
+ hideLeftAxisLine: ((_A = value == null ? void 0 : value.main) == null ? void 0 : _A.data) ? true : false,
11648
11619
  hideBottomAxisLine: false,
11649
11620
  bottomAxisWidth: "10px",
11650
11621
  ...value.main
@@ -11656,7 +11627,7 @@ const finalDataProvider = (type2, value, theme) => {
11656
11627
  height: "300",
11657
11628
  borderRadius: "20px",
11658
11629
  padding: "10px 0 2px 0",
11659
- ...(_E = value == null ? void 0 : value.style) == null ? void 0 : _E.containerStyle
11630
+ ...(_B = value == null ? void 0 : value.style) == null ? void 0 : _B.containerStyle
11660
11631
  },
11661
11632
  headerStyle: {
11662
11633
  fontWeight: 500,
@@ -11667,12 +11638,12 @@ const finalDataProvider = (type2, value, theme) => {
11667
11638
  width: "100%",
11668
11639
  fontSize: "18px",
11669
11640
  color: theme.palette.text.primary,
11670
- ...(_F = value == null ? void 0 : value.style) == null ? void 0 : _F.headerStyle
11641
+ ...(_C = value == null ? void 0 : value.style) == null ? void 0 : _C.headerStyle
11671
11642
  },
11672
11643
  tooltipStyle: {
11673
11644
  padding: "6px",
11674
11645
  borderRadius: "2px",
11675
- ...(_G = value == null ? void 0 : value.style) == null ? void 0 : _G.tooltipStyle
11646
+ ...(_D = value == null ? void 0 : value.style) == null ? void 0 : _D.tooltipStyle
11676
11647
  },
11677
11648
  labelStyle: {
11678
11649
  margin: { top: 10, left: 110, right: 40, bottom: 40 },
@@ -11683,11 +11654,11 @@ const finalDataProvider = (type2, value, theme) => {
11683
11654
  tickColor: theme.palette.text.primary,
11684
11655
  rightAxisWidth: "0.3px",
11685
11656
  fontSize: "10px",
11686
- ...(_H = value == null ? void 0 : value.style) == null ? void 0 : _H.labelStyle
11657
+ ...(_E = value == null ? void 0 : value.style) == null ? void 0 : _E.labelStyle
11687
11658
  },
11688
11659
  barStyle: {
11689
11660
  color: "#6c5efb",
11690
- ...(_I = value == null ? void 0 : value.style) == null ? void 0 : _I.barStyle
11661
+ ...(_F = value == null ? void 0 : value.style) == null ? void 0 : _F.barStyle
11691
11662
  }
11692
11663
  }
11693
11664
  };
@@ -11732,18 +11703,13 @@ const DrawPieGraph = ({
11732
11703
  parentHeight
11733
11704
  }) => {
11734
11705
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
11735
- const [active2, setActive] = useState(null);
11736
11706
  const letters = (_a = value == null ? void 0 : value.main) == null ? void 0 : _a.data;
11737
- const keys2 = Object.keys(letters[0]);
11738
- const arr = ((_b = value == null ? void 0 : value.main) == null ? void 0 : _b.xAxisValue) && ((_c = value == null ? void 0 : value.main) == null ? void 0 : _c.yAxisValue) ? [(_d = value == null ? void 0 : value.main) == null ? void 0 : _d.xAxisValue, (_e = value == null ? void 0 : value.main) == null ? void 0 : _e.yAxisValue] : keys2;
11739
- const labelKeyIndex = keys2.indexOf("label");
11740
- const valueKeyIndex = labelKeyIndex === 0 ? 1 : 0;
11741
- const frequency = (d2) => d2[arr[valueKeyIndex]];
11707
+ const arr = ((_b = value == null ? void 0 : value.main) == null ? void 0 : _b.xAxisValue) && ((_c = value == null ? void 0 : value.main) == null ? void 0 : _c.yAxisValue) ? [(_d = value == null ? void 0 : value.main) == null ? void 0 : _d.xAxisValue, (_e = value == null ? void 0 : value.main) == null ? void 0 : _e.yAxisValue] : Object.keys(letters[0]);
11708
+ const frequency = (d2) => d2[arr[1]];
11742
11709
  const getLetterFrequencyColor = createOrdinalScale$1({
11743
- domain: letters.map((l2) => l2[arr[labelKeyIndex]]),
11710
+ domain: letters.map((l2) => l2[arr[0]]),
11744
11711
  range: (_g = (_f = value == null ? void 0 : value.style) == null ? void 0 : _f.pieStyle) == null ? void 0 : _g.colorRange
11745
11712
  });
11746
- const dataKeyArray = letters.map((data) => data.label);
11747
11713
  const {
11748
11714
  tooltipData,
11749
11715
  tooltipLeft,
@@ -11752,12 +11718,11 @@ const DrawPieGraph = ({
11752
11718
  showTooltip,
11753
11719
  hideTooltip
11754
11720
  } = useTooltip();
11755
- const handleMouse = (event, arc2, datum2) => {
11756
- setActive(datum2);
11721
+ const handleMouse = (event, datum2) => {
11757
11722
  showTooltip({
11758
11723
  tooltipLeft: event.clientX,
11759
11724
  tooltipTop: event.clientY,
11760
- tooltipData: [datum2[arr[labelKeyIndex]], datum2[arr[valueKeyIndex]]]
11725
+ tooltipData: [datum2[arr[0]], datum2[arr[1]]]
11761
11726
  });
11762
11727
  };
11763
11728
  const innerWidth = parentWidth - 40;
@@ -11767,92 +11732,59 @@ const DrawPieGraph = ({
11767
11732
  const left2 = centerX + 20;
11768
11733
  const top2 = centerY + 20;
11769
11734
  const pieSortValues = (a2, b10) => a2 - b10;
11770
- return /* @__PURE__ */ jsx(Fragment, {
11771
- children: /* @__PURE__ */ jsxs("div", {
11772
- style: {
11773
- display: "flex",
11774
- justifyContent: "space-between"
11775
- },
11776
- children: [/* @__PURE__ */ jsx("svg", {
11777
- width: parentWidth,
11778
- height: parentHeight,
11779
- className: "pieGraphContainer",
11780
- children: /* @__PURE__ */ jsxs(Group, {
11781
- top: top2,
11782
- left: left2,
11783
- children: [/* @__PURE__ */ jsx(Pie, {
11784
- data: letters,
11785
- pieValue: frequency,
11786
- outerRadius: ((_i = (_h = value == null ? void 0 : value.style) == null ? void 0 : _h.pieStyle) == null ? void 0 : _i.outerRadius) - 35,
11787
- innerRadius: ((_k = (_j = value == null ? void 0 : value.style) == null ? void 0 : _j.pieStyle) == null ? void 0 : _k.innerRadius) - 5,
11788
- padAngle: 0.05,
11789
- children: (pie2) => {
11790
- return pie2.arcs.map((arc2, index2) => {
11791
- const letter = arc2.data[arr[labelKeyIndex]];
11792
- pie2.path.centroid(arc2);
11793
- const arcPath = pie2.path(arc2);
11794
- const arcFill = getLetterFrequencyColor(letter);
11795
- return /* @__PURE__ */ jsx("g", {
11796
- children: /* @__PURE__ */ jsx("path", {
11797
- d: arcPath,
11798
- fill: arcFill
11799
- })
11800
- }, `arc-${letter}-${index2}`);
11801
- });
11802
- }
11803
- }), /* @__PURE__ */ jsx(Pie, {
11804
- data: letters,
11805
- pieSortValues,
11806
- pieValue: frequency,
11807
- outerRadius: ({
11808
- data
11809
- }) => {
11735
+ return /* @__PURE__ */ jsxs(Fragment, {
11736
+ children: [((_h = value == null ? void 0 : value.main) == null ? void 0 : _h.legendAvailable) && /* @__PURE__ */ jsx(Legend, {
11737
+ value
11738
+ }), /* @__PURE__ */ jsx("svg", {
11739
+ width: parentWidth,
11740
+ height: parentHeight,
11741
+ className: "pieGraphContainer",
11742
+ children: /* @__PURE__ */ jsx(Group, {
11743
+ top: top2,
11744
+ left: left2,
11745
+ children: /* @__PURE__ */ jsx(Pie, {
11746
+ data: letters,
11747
+ pieSortValues,
11748
+ pieValue: frequency,
11749
+ outerRadius: (_j = (_i = value == null ? void 0 : value.style) == null ? void 0 : _i.pieStyle) == null ? void 0 : _j.outerRadius,
11750
+ innerRadius: (_l = (_k = value == null ? void 0 : value.style) == null ? void 0 : _k.pieStyle) == null ? void 0 : _l.innerRadius,
11751
+ cornerRadius: (_n = (_m = value == null ? void 0 : value.style) == null ? void 0 : _m.pieStyle) == null ? void 0 : _n.cornerRadius,
11752
+ padAngle: (_p = (_o = value == null ? void 0 : value.style) == null ? void 0 : _o.pieStyle) == null ? void 0 : _p.padAngle,
11753
+ children: (pie2) => {
11754
+ return pie2.arcs.map((arc2, index2) => {
11810
11755
  var _a2, _b2, _c2, _d2;
11811
- const size = active2 && active2.label == data.label ? (_b2 = (_a2 = value == null ? void 0 : value.style) == null ? void 0 : _a2.pieStyle) == null ? void 0 : _b2.outerRadius : ((_d2 = (_c2 = value == null ? void 0 : value.style) == null ? void 0 : _c2.pieStyle) == null ? void 0 : _d2.outerRadius) - 3;
11812
- return size;
11813
- },
11814
- innerRadius: (_m = (_l = value == null ? void 0 : value.style) == null ? void 0 : _l.pieStyle) == null ? void 0 : _m.innerRadius,
11815
- cornerRadius: (_o = (_n = value == null ? void 0 : value.style) == null ? void 0 : _n.pieStyle) == null ? void 0 : _o.cornerRadius,
11816
- children: (pie2) => {
11817
- return pie2.arcs.map((arc2, index2) => {
11818
- console.log("arc.data", arc2.data);
11819
- const letter = arc2.data[arr[labelKeyIndex]];
11820
- pie2.path.centroid(arc2);
11821
- const arcPath = pie2.path(arc2);
11822
- const arcFill = getLetterFrequencyColor(letter);
11823
- return /* @__PURE__ */ jsx("g", {
11824
- onMouseOut: hideTooltip,
11825
- onMouseLeave: () => setActive(null),
11826
- onMouseOver: (e3) => handleMouse(e3, arc2, arc2.data),
11827
- className: "pieTooltipHolder",
11828
- children: /* @__PURE__ */ jsx("path", {
11829
- d: arcPath,
11830
- fill: arcFill
11831
- })
11832
- }, `arc-${letter}-${index2}`);
11833
- });
11834
- }
11835
- })]
11836
- })
11837
- }), tooltipOpen && /* @__PURE__ */ jsx(ToolTip, {
11838
- style: value == null ? void 0 : value.style,
11839
- top: tooltipTop,
11840
- left: tooltipLeft,
11841
- tooltipData,
11842
- getLetterFrequencyColor
11843
- }), /* @__PURE__ */ jsx("div", {
11844
- style: {
11845
- width: "100px",
11846
- display: "flex",
11847
- marginTop: "20px",
11848
- marginRight: "130px"
11849
- },
11850
- children: ((_p = value == null ? void 0 : value.main) == null ? void 0 : _p.legendAvailable) && /* @__PURE__ */ jsx(Legend, {
11851
- value,
11852
- dataKeyArray
11756
+ const letter = ((_b2 = (_a2 = value == null ? void 0 : value.style) == null ? void 0 : _a2.pieStyle) == null ? void 0 : _b2.showPieLabel) ? arc2.data[arr[0]] : arc2.data[arr[1]];
11757
+ const [centriodX, centriodY] = pie2.path.centroid(arc2);
11758
+ const arcPath = pie2.path(arc2);
11759
+ const arcFill = getLetterFrequencyColor(letter);
11760
+ return /* @__PURE__ */ jsxs("g", {
11761
+ onMouseOut: hideTooltip,
11762
+ onMouseOver: (e3) => handleMouse(e3, arc2.data),
11763
+ className: "pieTooltipHolder",
11764
+ children: [/* @__PURE__ */ jsx("path", {
11765
+ d: arcPath,
11766
+ fill: arcFill
11767
+ }), /* @__PURE__ */ jsx(Text, {
11768
+ x: centriodX,
11769
+ y: centriodY,
11770
+ dy: "0.33em",
11771
+ fontSize: 14,
11772
+ fill: ((_d2 = (_c2 = value == null ? void 0 : value.style) == null ? void 0 : _c2.pieStyle) == null ? void 0 : _d2.pieLabelColor) || "white",
11773
+ textAnchor: "middle",
11774
+ pointerEvents: "none",
11775
+ children: letter
11776
+ })]
11777
+ }, `arc-${letter}-${index2}`);
11778
+ });
11779
+ }
11853
11780
  })
11854
- })]
11855
- })
11781
+ })
11782
+ }), tooltipOpen && /* @__PURE__ */ jsx(ToolTip, {
11783
+ style: value == null ? void 0 : value.style,
11784
+ top: tooltipTop,
11785
+ left: tooltipLeft,
11786
+ tooltipData
11787
+ })]
11856
11788
  });
11857
11789
  };
11858
11790
  const PieGraph = ({
@@ -19843,16 +19775,14 @@ const DrawGraph = ({
19843
19775
  }) => {
19844
19776
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s;
19845
19777
  const data = (_a = value == null ? void 0 : value.main) == null ? void 0 : _a.data;
19846
- const arr = value.main.xAxisValue && value.main.yAxisValue ? [value.main.xAxisValue, value.main.yAxisValue] : Object.keys(data[0].value[0]);
19778
+ const arr = value.main.xAxisValue && value.main.yAxisValue ? [value.main.xAxisValue, value.main.yAxisValue] : Object.keys(data[0][0]);
19847
19779
  const accessors = {
19848
19780
  xAccessor: (d2) => d2[arr[0]],
19849
19781
  yAccessor: (d2) => d2[arr[1]]
19850
19782
  };
19851
- const dataKeyArray = data.map((ele) => ele.key);
19852
19783
  return /* @__PURE__ */ jsxs(Fragment, {
19853
19784
  children: [value.main.legendAvailable && /* @__PURE__ */ jsx(Legend, {
19854
- value,
19855
- dataKeyArray
19785
+ value
19856
19786
  }), /* @__PURE__ */ jsxs(XYChart, {
19857
19787
  height: parseInt((_c = (_b = value.style) == null ? void 0 : _b.containerStyle) == null ? void 0 : _c.height),
19858
19788
  xScale: {
@@ -19894,12 +19824,12 @@ const DrawGraph = ({
19894
19824
  labelOffset: ((_q = (_p = value.style) == null ? void 0 : _p.labelStyle) == null ? void 0 : _q.bottomLabelOffset) || 32
19895
19825
  }), /* @__PURE__ */ jsx(AnimatedGrid, {
19896
19826
  columns: value.main.grid,
19897
- numTicks: value.main.numHidden ? 0 : ((_r = value.main) == null ? void 0 : _r.data[0].value.length) - 1
19827
+ numTicks: value.main.numHidden ? 0 : ((_r = value.main) == null ? void 0 : _r.data[0].length) - 1
19898
19828
  }), (_s = value.main) == null ? void 0 : _s.data.map((elem, i) => {
19899
19829
  var _a2, _b2, _c2, _d2, _e2, _f2;
19900
19830
  return /* @__PURE__ */ jsx(AnimatedLineSeries, {
19901
- dataKey: elem.key,
19902
- data: elem.value,
19831
+ dataKey: value.main.tooltipDataKey[i],
19832
+ data: elem,
19903
19833
  fill: (_b2 = (_a2 = value.style) == null ? void 0 : _a2.lineStyle) == null ? void 0 : _b2.lineAreaColor,
19904
19834
  fillOpacity: (_d2 = (_c2 = value.style) == null ? void 0 : _c2.lineStyle) == null ? void 0 : _d2.lineAreaOpacity,
19905
19835
  floodColor: "green",
@@ -19960,7 +19890,7 @@ var DrawHorizontalBarGraph = withTooltip(({
19960
19890
  barValue
19961
19891
  }) => {
19962
19892
  var _a, _b, _c;
19963
- const xMax = width2 - margin2.left - margin2.right;
19893
+ const xMax = width2 - margin2.left - margin2.right + 100;
19964
19894
  const yMax = height2 - margin2.top - margin2.bottom;
19965
19895
  const tooltipStyles2 = {
19966
19896
  ...defaultStyles,
@@ -20114,7 +20044,7 @@ const ProgressBar = ({
20114
20044
  const [progress2, setProgress] = useState(((_b = (_a = value == null ? void 0 : value.main) == null ? void 0 : _a.data) == null ? void 0 : _b.achieved) / ((_d = (_c = value == null ? void 0 : value.main) == null ? void 0 : _c.data) == null ? void 0 : _d.total) * 100);
20115
20045
  useEffect(() => {
20116
20046
  var _a2, _b2, _c2, _d2;
20117
- setProgress(Math.min(100, ((_b2 = (_a2 = value == null ? void 0 : value.main) == null ? void 0 : _a2.data) == null ? void 0 : _b2.achieved) / ((_d2 = (_c2 = value == null ? void 0 : value.main) == null ? void 0 : _c2.data) == null ? void 0 : _d2.total) * 100));
20047
+ setProgress(((_b2 = (_a2 = value == null ? void 0 : value.main) == null ? void 0 : _a2.data) == null ? void 0 : _b2.achieved) / ((_d2 = (_c2 = value == null ? void 0 : value.main) == null ? void 0 : _c2.data) == null ? void 0 : _d2.total) * 100);
20118
20048
  }, [value.main.data]);
20119
20049
  const getColor = () => {
20120
20050
  if (progress2 < 40) {
@@ -20138,7 +20068,7 @@ const ProgressBar = ({
20138
20068
  children: /* @__PURE__ */ jsx("div", {
20139
20069
  className: "progress-bar-fill",
20140
20070
  style: {
20141
- width: `${progress2 > 100 ? 100 : progress2}%`,
20071
+ width: progress2 > 100 ? "100%" : `${progress2}%`,
20142
20072
  backgroundColor: ((_g = value == null ? void 0 : value.style) == null ? void 0 : _g.progressBarFillColor) || getColor()[1],
20143
20073
  height: "100%",
20144
20074
  borderRadius: "10px",
@@ -20204,7 +20134,7 @@ const ProgressBar = ({
20204
20134
  children: /* @__PURE__ */ jsx("div", {
20205
20135
  className: "progress-bar-fill",
20206
20136
  style: {
20207
- width: `${progress2}%`,
20137
+ width: progress2 > 100 ? "100%" : `${progress2}%`,
20208
20138
  backgroundColor: getColor()[1],
20209
20139
  height: "100%",
20210
20140
  borderRadius: "10px",
@@ -44043,4 +43973,3 @@ const CustomTimer = ({
44043
43973
  });
44044
43974
  };
44045
43975
  export { BarGraph, ImpaktAppsCard as Card, HorizontalBarGraph, LineGraph, PieGraph, ProgressBar, SpeedoMeter, CustomTimer as Timer };
44046
- //# sourceMappingURL=impaktapps-design.es.js.map