impaktapps-design 0.2.94 → 0.2.96-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,7 +10459,8 @@ const ToolTip = ({
10459
10459
  style: style2,
10460
10460
  top: top2,
10461
10461
  left: left2,
10462
- tooltipData
10462
+ tooltipData,
10463
+ getLetterFrequencyColor
10463
10464
  }) => {
10464
10465
  const {
10465
10466
  TooltipInPortal
@@ -10467,37 +10468,34 @@ const ToolTip = ({
10467
10468
  detectBounds: true,
10468
10469
  scroll: true
10469
10470
  });
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");
10470
10479
  return /* @__PURE__ */ jsx(TooltipInPortal, {
10471
10480
  top: top2,
10472
10481
  left: left2,
10482
+ style: tooltipStyles2,
10473
10483
  children: /* @__PURE__ */ jsxs("div", {
10474
10484
  style: {
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"
10485
+ display: "flex",
10486
+ alignItems: "center"
10484
10487
  },
10485
10488
  children: [/* @__PURE__ */ jsx("div", {
10486
10489
  style: {
10487
- padding: "4px 10px",
10488
- color: (style2 == null ? void 0 : style2.tooltipbackground) || "white",
10489
- borderRadius: "5px",
10490
- fontWeight: 700
10491
- },
10492
- children: tooltipData[0]
10490
+ width: "12px",
10491
+ height: "12px",
10492
+ backgroundColor: getLetterFrequencyColor(tooltipData[0]),
10493
+ marginRight: "8px"
10494
+ }
10493
10495
  }), /* @__PURE__ */ jsx("div", {
10494
- style: {
10495
- padding: "4px 10px",
10496
- borderRadius: "5px",
10497
- marginTop: "10px",
10498
- fontWeight: 700
10499
- },
10500
- children: tooltipData[1]
10496
+ children: /* @__PURE__ */ jsx("strong", {
10497
+ children: `${tooltipData[0]}: ${tooltipData[1]}`
10498
+ })
10501
10499
  })]
10502
10500
  })
10503
10501
  }, Math.random());
@@ -10873,23 +10871,23 @@ function Legend({
10873
10871
  colorRange,
10874
10872
  dataKeyArray
10875
10873
  }) {
10876
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
10874
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o;
10877
10875
  const legendGlyphSize = ((_b = (_a = value == null ? void 0 : value.main) == null ? void 0 : _a.legend) == null ? void 0 : _b.colorRectWidth) || 15;
10878
10876
  const ordinalColorScale = createOrdinalScale$1({
10879
10877
  domain: dataKeyArray || ((_c = value == null ? void 0 : value.main) == null ? void 0 : _c.tooltipDataKey),
10880
- range: colorRange || ((_e = (_d = value == null ? void 0 : value.style) == null ? void 0 : _d.pieStyle) == null ? void 0 : _e.colorRange)
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)
10881
10879
  });
10882
10880
  return /* @__PURE__ */ jsxs("div", {
10883
10881
  className: "legend",
10884
10882
  style: {
10885
10883
  paddingLeft: "40px",
10886
10884
  paddingRight: "40px",
10887
- ...(_g = (_f = value == null ? void 0 : value.style) == null ? void 0 : _f.legendStyle) == null ? void 0 : _g.legend
10885
+ ...(_k = (_j = value == null ? void 0 : value.style) == null ? void 0 : _j.legendStyle) == null ? void 0 : _k.legend
10888
10886
  },
10889
10887
  children: [/* @__PURE__ */ jsx("div", {
10890
10888
  className: "title",
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
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
10893
10891
  }), /* @__PURE__ */ jsx(Ordinal, {
10894
10892
  scale: ordinalColorScale,
10895
10893
  labelFormat: (label) => `${label.toUpperCase()}`,
@@ -10898,16 +10896,18 @@ function Legend({
10898
10896
  return /* @__PURE__ */ jsx("div", {
10899
10897
  style: {
10900
10898
  display: "flex",
10901
- flexDirection: ((_b2 = (_a2 = value == null ? void 0 : value.main) == null ? void 0 : _a2.legend) == null ? void 0 : _b2.direction) || "row"
10899
+ flexDirection: ((_b2 = (_a2 = value == null ? void 0 : value.main) == null ? void 0 : _a2.legend) == null ? void 0 : _b2.direction) || "row",
10900
+ flexWrap: "wrap"
10902
10901
  },
10903
10902
  children: labels.map((label, i) => {
10904
- var _a3, _b3;
10903
+ var _a3, _b3, _c2, _d2;
10905
10904
  return /* @__PURE__ */ jsxs(LegendItem, {
10906
10905
  margin: "0 5px",
10907
10906
  onClick: (events) => {
10908
10907
  if (events)
10909
10908
  alert(`clicked: ${JSON.stringify(label)}`);
10910
10909
  },
10910
+ style: (_b3 = (_a3 = value == null ? void 0 : value.style) == null ? void 0 : _a3.legendStyle) == null ? void 0 : _b3.legendVertical,
10911
10911
  children: [/* @__PURE__ */ jsx("svg", {
10912
10912
  width: legendGlyphSize,
10913
10913
  height: legendGlyphSize,
@@ -10917,7 +10917,7 @@ function Legend({
10917
10917
  height: legendGlyphSize
10918
10918
  })
10919
10919
  }), /* @__PURE__ */ jsx(LegendLabel, {
10920
- align: `${((_b3 = (_a3 = value == null ? void 0 : value.main) == null ? void 0 : _a3.legend) == null ? void 0 : _b3.align) || "left"}`,
10920
+ align: `${((_d2 = (_c2 = value == null ? void 0 : value.main) == null ? void 0 : _c2.legend) == null ? void 0 : _d2.align) || "left"}`,
10921
10921
  margin: "0 0 0 4px",
10922
10922
  children: label.text
10923
10923
  })]
@@ -11384,15 +11384,32 @@ ParentSize$1.propTypes = {
11384
11384
  children: PropTypes.func.isRequired
11385
11385
  };
11386
11386
  const Product1 = [
11387
- { x: "a", y: 100 },
11388
- { x: "b", y: 50 },
11389
- { x: "c", y: 100 },
11390
- { x: "d", y: 80 },
11391
- { x: "f", y: 100 },
11392
- { x: "g", y: 50 }
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
+ }
11393
11410
  ];
11394
11411
  const finalDataProvider = (type2, value, theme) => {
11395
- 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;
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;
11396
11413
  switch (type2) {
11397
11414
  case "BarGraph":
11398
11415
  case "StackBarGraph":
@@ -11468,7 +11485,7 @@ const finalDataProvider = (type2, value, theme) => {
11468
11485
  case "PieGraph":
11469
11486
  return {
11470
11487
  main: {
11471
- 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 }],
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 }],
11472
11489
  header: "Pie Graph",
11473
11490
  bottomLabel: "Name of Employe",
11474
11491
  leftLabel: "Value",
@@ -11482,7 +11499,7 @@ const finalDataProvider = (type2, value, theme) => {
11482
11499
  legendTitle: "Our Assests",
11483
11500
  direction: "row",
11484
11501
  align: "right",
11485
- ...(_i = value == null ? void 0 : value.main) == null ? void 0 : _i.legend
11502
+ ...(_j = value == null ? void 0 : value.main) == null ? void 0 : _j.legend
11486
11503
  }
11487
11504
  },
11488
11505
  style: {
@@ -11492,7 +11509,7 @@ const finalDataProvider = (type2, value, theme) => {
11492
11509
  height: "310",
11493
11510
  borderRadius: "20px",
11494
11511
  padding: "10px 0 2px 0",
11495
- ...(_j = value == null ? void 0 : value.style) == null ? void 0 : _j.containerStyle
11512
+ ...(_k = value == null ? void 0 : value.style) == null ? void 0 : _k.containerStyle
11496
11513
  },
11497
11514
  headerStyle: {
11498
11515
  fontWeight: 500,
@@ -11503,17 +11520,22 @@ const finalDataProvider = (type2, value, theme) => {
11503
11520
  width: "100%",
11504
11521
  fontSize: "18px",
11505
11522
  color: theme.palette.text.primary,
11506
- ...(_k = value == null ? void 0 : value.style) == null ? void 0 : _k.headerStyle
11523
+ ...(_l = value == null ? void 0 : value.style) == null ? void 0 : _l.headerStyle
11507
11524
  },
11508
11525
  tooltipStyle: {
11509
- ...(_l = value == null ? void 0 : value.style) == null ? void 0 : _l.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
11510
11532
  },
11511
11533
  labelStyle: {
11512
11534
  labelColor: theme.palette.text.primary,
11513
11535
  labelOffset: 45,
11514
11536
  leftLabelMargin: "70",
11515
11537
  topLabelMargin: "-40",
11516
- ...(_m = value == null ? void 0 : value.style) == null ? void 0 : _m.labelStyle
11538
+ ...(_n = value == null ? void 0 : value.style) == null ? void 0 : _n.labelStyle
11517
11539
  },
11518
11540
  legendStyle: {
11519
11541
  legend: {
@@ -11526,33 +11548,40 @@ const finalDataProvider = (type2, value, theme) => {
11526
11548
  border: "1px solid rgba(255, 255, 255, 0.3)",
11527
11549
  borderRadius: " 8px",
11528
11550
  margin: "5px 5px",
11529
- ...(_o = (_n = value == null ? void 0 : value.style) == null ? void 0 : _n.legendStyle) == null ? void 0 : _o.legend
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"
11530
11558
  },
11531
11559
  legendTitle: {
11532
11560
  fontWeight: 500,
11533
11561
  marginBottom: "5px",
11534
11562
  fontFamily: "roboto",
11535
11563
  fontSize: "10px",
11536
- ...(_q = (_p = value == null ? void 0 : value.style) == null ? void 0 : _p.legendStyle) == null ? void 0 : _q.legendTitle
11564
+ ...(_r = (_q = value == null ? void 0 : value.style) == null ? void 0 : _q.legendStyle) == null ? void 0 : _r.legendTitle
11537
11565
  }
11538
11566
  },
11539
11567
  pieStyle: {
11540
- colorRange: ["#3f51b5", "rgba(200,0,31,0.9)", "rgba(25,200,205,0.6)"],
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)"],
11541
11569
  outerRadius: 120,
11542
- innerRadius: 60,
11570
+ innerRadius: 63,
11543
11571
  cornerRadius: 2,
11544
11572
  padAngle: 6e-3,
11545
- ...(_r = value == null ? void 0 : value.style) == null ? void 0 : _r.pieStyle
11573
+ ...(_t5 = value == null ? void 0 : value.style) == null ? void 0 : _t5.pieStyle
11546
11574
  }
11547
11575
  }
11548
11576
  };
11549
11577
  case "LineGraph":
11550
11578
  return {
11551
11579
  main: {
11552
- data: ((_s = value == null ? void 0 : value.main) == null ? void 0 : _s.data) || [Product1],
11580
+ data: ((_u = value == null ? void 0 : value.main) == null ? void 0 : _u.data) || Product1,
11553
11581
  header: "Line Graph Dynamic",
11554
11582
  bottomLabel: "Name of Employe",
11555
11583
  leftLabel: "Value",
11584
+ legendAvailable: true,
11556
11585
  gridHidden: true,
11557
11586
  numHidden: false,
11558
11587
  tooltipDataKey: ["MAMA New Project", "Second", "Third"],
@@ -11563,11 +11592,10 @@ const finalDataProvider = (type2, value, theme) => {
11563
11592
  ...value == null ? void 0 : value.main,
11564
11593
  legend: {
11565
11594
  labelColor: theme.palette.text.primary,
11566
- legendTitle: "Our Assests",
11567
11595
  direction: "row",
11568
11596
  align: "right",
11569
11597
  colorRectWidth: 20,
11570
- ...(_t5 = value == null ? void 0 : value.main) == null ? void 0 : _t5.legend
11598
+ ...(_v = value == null ? void 0 : value.main) == null ? void 0 : _v.legend
11571
11599
  }
11572
11600
  },
11573
11601
  style: {
@@ -11577,7 +11605,7 @@ const finalDataProvider = (type2, value, theme) => {
11577
11605
  height: "300",
11578
11606
  borderRadius: "20px",
11579
11607
  padding: "10px 0 2px 0",
11580
- ...(_u = value == null ? void 0 : value.style) == null ? void 0 : _u.containerStyle
11608
+ ...(_w = value == null ? void 0 : value.style) == null ? void 0 : _w.containerStyle
11581
11609
  },
11582
11610
  headerStyle: {
11583
11611
  fontWeight: 500,
@@ -11588,35 +11616,35 @@ const finalDataProvider = (type2, value, theme) => {
11588
11616
  width: "100%",
11589
11617
  fontSize: "18px",
11590
11618
  color: theme.palette.text.primary,
11591
- ...(_v = value == null ? void 0 : value.style) == null ? void 0 : _v.headerStyle
11619
+ ...(_x = value == null ? void 0 : value.style) == null ? void 0 : _x.headerStyle
11592
11620
  },
11593
11621
  labelStyle: {
11594
11622
  labelColor: theme.palette.text.primary,
11595
11623
  bottomLabelOffset: 20,
11596
11624
  leftLabelOffset: 50,
11597
11625
  leftLabelMargin: 80,
11598
- ...(_w = value == null ? void 0 : value.style) == null ? void 0 : _w.labelStyle
11626
+ ...(_y = value == null ? void 0 : value.style) == null ? void 0 : _y.labelStyle
11599
11627
  },
11600
11628
  lineStyle: {
11601
- colorRange: ["#3f51b5", "rgba(200,0,31,0.9)", "rgba(25,200,205,0.6)"],
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)"],
11602
11630
  lineAreaColor: "none",
11603
11631
  lineAreaOpacity: 0.2,
11604
- ...(_x = value == null ? void 0 : value.style) == null ? void 0 : _x.lineStyle
11632
+ ...(_A = value == null ? void 0 : value.style) == null ? void 0 : _A.lineStyle
11605
11633
  }
11606
11634
  }
11607
11635
  };
11608
11636
  case "HorizontalBarGraph":
11609
11637
  return {
11610
11638
  main: {
11611
- 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 }],
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 }],
11612
11640
  header: " ",
11613
11641
  bottomLabel: "Name of Employe",
11614
11642
  leftLabel: "Value",
11615
11643
  axisLeft: true,
11616
11644
  axisBottom: true,
11617
11645
  hideBottomTicks: false,
11618
- hideLeftTicks: ((_z = value == null ? void 0 : value.main) == null ? void 0 : _z.data) ? true : false,
11619
- hideLeftAxisLine: ((_A = value == null ? void 0 : value.main) == null ? void 0 : _A.data) ? true : 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,
11620
11648
  hideBottomAxisLine: false,
11621
11649
  bottomAxisWidth: "10px",
11622
11650
  ...value.main
@@ -11628,7 +11656,7 @@ const finalDataProvider = (type2, value, theme) => {
11628
11656
  height: "300",
11629
11657
  borderRadius: "20px",
11630
11658
  padding: "10px 0 2px 0",
11631
- ...(_B = value == null ? void 0 : value.style) == null ? void 0 : _B.containerStyle
11659
+ ...(_E = value == null ? void 0 : value.style) == null ? void 0 : _E.containerStyle
11632
11660
  },
11633
11661
  headerStyle: {
11634
11662
  fontWeight: 500,
@@ -11639,12 +11667,12 @@ const finalDataProvider = (type2, value, theme) => {
11639
11667
  width: "100%",
11640
11668
  fontSize: "18px",
11641
11669
  color: theme.palette.text.primary,
11642
- ...(_C = value == null ? void 0 : value.style) == null ? void 0 : _C.headerStyle
11670
+ ...(_F = value == null ? void 0 : value.style) == null ? void 0 : _F.headerStyle
11643
11671
  },
11644
11672
  tooltipStyle: {
11645
11673
  padding: "6px",
11646
11674
  borderRadius: "2px",
11647
- ...(_D = value == null ? void 0 : value.style) == null ? void 0 : _D.tooltipStyle
11675
+ ...(_G = value == null ? void 0 : value.style) == null ? void 0 : _G.tooltipStyle
11648
11676
  },
11649
11677
  labelStyle: {
11650
11678
  margin: { top: 10, left: 110, right: 40, bottom: 40 },
@@ -11655,11 +11683,11 @@ const finalDataProvider = (type2, value, theme) => {
11655
11683
  tickColor: theme.palette.text.primary,
11656
11684
  rightAxisWidth: "0.3px",
11657
11685
  fontSize: "10px",
11658
- ...(_E = value == null ? void 0 : value.style) == null ? void 0 : _E.labelStyle
11686
+ ...(_H = value == null ? void 0 : value.style) == null ? void 0 : _H.labelStyle
11659
11687
  },
11660
11688
  barStyle: {
11661
11689
  color: "#6c5efb",
11662
- ...(_F = value == null ? void 0 : value.style) == null ? void 0 : _F.barStyle
11690
+ ...(_I = value == null ? void 0 : value.style) == null ? void 0 : _I.barStyle
11663
11691
  }
11664
11692
  }
11665
11693
  };
@@ -11704,13 +11732,18 @@ const DrawPieGraph = ({
11704
11732
  parentHeight
11705
11733
  }) => {
11706
11734
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
11735
+ const [active2, setActive] = useState(null);
11707
11736
  const letters = (_a = value == null ? void 0 : value.main) == null ? void 0 : _a.data;
11708
- 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]);
11709
- const frequency = (d2) => d2[arr[1]];
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]];
11710
11742
  const getLetterFrequencyColor = createOrdinalScale$1({
11711
- domain: letters.map((l2) => l2[arr[0]]),
11743
+ domain: letters.map((l2) => l2[arr[labelKeyIndex]]),
11712
11744
  range: (_g = (_f = value == null ? void 0 : value.style) == null ? void 0 : _f.pieStyle) == null ? void 0 : _g.colorRange
11713
11745
  });
11746
+ const dataKeyArray = letters.map((data) => data.label);
11714
11747
  const {
11715
11748
  tooltipData,
11716
11749
  tooltipLeft,
@@ -11719,11 +11752,12 @@ const DrawPieGraph = ({
11719
11752
  showTooltip,
11720
11753
  hideTooltip
11721
11754
  } = useTooltip();
11722
- const handleMouse = (event, datum2) => {
11755
+ const handleMouse = (event, arc2, datum2) => {
11756
+ setActive(datum2);
11723
11757
  showTooltip({
11724
11758
  tooltipLeft: event.clientX,
11725
11759
  tooltipTop: event.clientY,
11726
- tooltipData: [datum2[arr[0]], datum2[arr[1]]]
11760
+ tooltipData: [datum2[arr[labelKeyIndex]], datum2[arr[valueKeyIndex]]]
11727
11761
  });
11728
11762
  };
11729
11763
  const innerWidth = parentWidth - 40;
@@ -11733,59 +11767,92 @@ const DrawPieGraph = ({
11733
11767
  const left2 = centerX + 20;
11734
11768
  const top2 = centerY + 20;
11735
11769
  const pieSortValues = (a2, b10) => a2 - b10;
11736
- return /* @__PURE__ */ jsxs(Fragment, {
11737
- children: [((_h = value == null ? void 0 : value.main) == null ? void 0 : _h.legendAvailable) && /* @__PURE__ */ jsx(Legend, {
11738
- value
11739
- }), /* @__PURE__ */ jsx("svg", {
11740
- width: parentWidth,
11741
- height: parentHeight,
11742
- className: "pieGraphContainer",
11743
- children: /* @__PURE__ */ jsx(Group, {
11744
- top: top2,
11745
- left: left2,
11746
- children: /* @__PURE__ */ jsx(Pie, {
11747
- data: letters,
11748
- pieSortValues,
11749
- pieValue: frequency,
11750
- outerRadius: (_j = (_i = value == null ? void 0 : value.style) == null ? void 0 : _i.pieStyle) == null ? void 0 : _j.outerRadius,
11751
- innerRadius: (_l = (_k = value == null ? void 0 : value.style) == null ? void 0 : _k.pieStyle) == null ? void 0 : _l.innerRadius,
11752
- cornerRadius: (_n = (_m = value == null ? void 0 : value.style) == null ? void 0 : _m.pieStyle) == null ? void 0 : _n.cornerRadius,
11753
- padAngle: (_p = (_o = value == null ? void 0 : value.style) == null ? void 0 : _o.pieStyle) == null ? void 0 : _p.padAngle,
11754
- children: (pie2) => {
11755
- return pie2.arcs.map((arc2, index2) => {
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
+ }) => {
11756
11810
  var _a2, _b2, _c2, _d2;
11757
- 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]];
11758
- const [centriodX, centriodY] = pie2.path.centroid(arc2);
11759
- const arcPath = pie2.path(arc2);
11760
- const arcFill = getLetterFrequencyColor(letter);
11761
- return /* @__PURE__ */ jsxs("g", {
11762
- onMouseOut: hideTooltip,
11763
- onMouseOver: (e3) => handleMouse(e3, arc2.data),
11764
- className: "pieTooltipHolder",
11765
- children: [/* @__PURE__ */ jsx("path", {
11766
- d: arcPath,
11767
- fill: arcFill
11768
- }), /* @__PURE__ */ jsx(Text, {
11769
- x: centriodX,
11770
- y: centriodY,
11771
- dy: "0.33em",
11772
- fontSize: 14,
11773
- fill: ((_d2 = (_c2 = value == null ? void 0 : value.style) == null ? void 0 : _c2.pieStyle) == null ? void 0 : _d2.pieLabelColor) || "white",
11774
- textAnchor: "middle",
11775
- pointerEvents: "none",
11776
- children: letter
11777
- })]
11778
- }, `arc-${letter}-${index2}`);
11779
- });
11780
- }
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
+ })]
11781
11836
  })
11782
- })
11783
- }), tooltipOpen && /* @__PURE__ */ jsx(ToolTip, {
11784
- style: value == null ? void 0 : value.style,
11785
- top: tooltipTop,
11786
- left: tooltipLeft,
11787
- tooltipData
11788
- })]
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
11853
+ })
11854
+ })]
11855
+ })
11789
11856
  });
11790
11857
  };
11791
11858
  const PieGraph = ({
@@ -19776,14 +19843,16 @@ const DrawGraph = ({
19776
19843
  }) => {
19777
19844
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s;
19778
19845
  const data = (_a = value == null ? void 0 : value.main) == null ? void 0 : _a.data;
19779
- const arr = value.main.xAxisValue && value.main.yAxisValue ? [value.main.xAxisValue, value.main.yAxisValue] : Object.keys(data[0][0]);
19846
+ const arr = value.main.xAxisValue && value.main.yAxisValue ? [value.main.xAxisValue, value.main.yAxisValue] : Object.keys(data[0].value[0]);
19780
19847
  const accessors = {
19781
19848
  xAccessor: (d2) => d2[arr[0]],
19782
19849
  yAccessor: (d2) => d2[arr[1]]
19783
19850
  };
19851
+ const dataKeyArray = data.map((ele) => ele.key);
19784
19852
  return /* @__PURE__ */ jsxs(Fragment, {
19785
19853
  children: [value.main.legendAvailable && /* @__PURE__ */ jsx(Legend, {
19786
- value
19854
+ value,
19855
+ dataKeyArray
19787
19856
  }), /* @__PURE__ */ jsxs(XYChart, {
19788
19857
  height: parseInt((_c = (_b = value.style) == null ? void 0 : _b.containerStyle) == null ? void 0 : _c.height),
19789
19858
  xScale: {
@@ -19825,12 +19894,12 @@ const DrawGraph = ({
19825
19894
  labelOffset: ((_q = (_p = value.style) == null ? void 0 : _p.labelStyle) == null ? void 0 : _q.bottomLabelOffset) || 32
19826
19895
  }), /* @__PURE__ */ jsx(AnimatedGrid, {
19827
19896
  columns: value.main.grid,
19828
- numTicks: value.main.numHidden ? 0 : ((_r = value.main) == null ? void 0 : _r.data[0].length) - 1
19897
+ numTicks: value.main.numHidden ? 0 : ((_r = value.main) == null ? void 0 : _r.data[0].value.length) - 1
19829
19898
  }), (_s = value.main) == null ? void 0 : _s.data.map((elem, i) => {
19830
19899
  var _a2, _b2, _c2, _d2, _e2, _f2;
19831
19900
  return /* @__PURE__ */ jsx(AnimatedLineSeries, {
19832
- dataKey: value.main.tooltipDataKey[i],
19833
- data: elem,
19901
+ dataKey: elem.key,
19902
+ data: elem.value,
19834
19903
  fill: (_b2 = (_a2 = value.style) == null ? void 0 : _a2.lineStyle) == null ? void 0 : _b2.lineAreaColor,
19835
19904
  fillOpacity: (_d2 = (_c2 = value.style) == null ? void 0 : _c2.lineStyle) == null ? void 0 : _d2.lineAreaOpacity,
19836
19905
  floodColor: "green",
@@ -20069,12 +20138,12 @@ const ProgressBar = ({
20069
20138
  children: /* @__PURE__ */ jsx("div", {
20070
20139
  className: "progress-bar-fill",
20071
20140
  style: {
20072
- width: `${progress2}%`,
20141
+ width: progress2 > 100 ? "100%" : `${progress2}%`,
20073
20142
  backgroundColor: ((_g = value == null ? void 0 : value.style) == null ? void 0 : _g.progressBarFillColor) || getColor()[1],
20074
20143
  height: "100%",
20075
20144
  borderRadius: "10px",
20076
20145
  marginBottom: "20px",
20077
- transition: "width 0.5 ease-out"
20146
+ transition: "width 0.5s ease-out"
20078
20147
  }
20079
20148
  })
20080
20149
  });
@@ -20210,7 +20279,7 @@ const ProgressBar = ({
20210
20279
  color: ((_L = (_K = theme == null ? void 0 : theme.palette) == null ? void 0 : _K.text) == null ? void 0 : _L.primary) || "#121926",
20211
20280
  fontWeight: 500
20212
20281
  },
20213
- children: ((_N = (_M = value == null ? void 0 : value.main) == null ? void 0 : _M.data) == null ? void 0 : _N.remaining) || ((_P = (_O = value == null ? void 0 : value.main) == null ? void 0 : _O.data) == null ? void 0 : _P.total) - ((_R = (_Q = value == null ? void 0 : value.main) == null ? void 0 : _Q.data) == null ? void 0 : _R.achieved)
20282
+ children: Math.max(0, ((_N = (_M = value == null ? void 0 : value.main) == null ? void 0 : _M.data) == null ? void 0 : _N.remaining) || ((_P = (_O = value == null ? void 0 : value.main) == null ? void 0 : _O.data) == null ? void 0 : _P.total) - ((_R = (_Q = value == null ? void 0 : value.main) == null ? void 0 : _Q.data) == null ? void 0 : _R.achieved))
20214
20283
  })]
20215
20284
  })]
20216
20285
  })]
@@ -43974,3 +44043,4 @@ const CustomTimer = ({
43974
44043
  });
43975
44044
  };
43976
44045
  export { BarGraph, ImpaktAppsCard as Card, HorizontalBarGraph, LineGraph, PieGraph, ProgressBar, SpeedoMeter, CustomTimer as Timer };
44046
+ //# sourceMappingURL=impaktapps-design.es.js.map