impaktapps-design 0.2.97-alpha.70 → 0.2.991

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());
@@ -10896,18 +10898,16 @@ function Legend({
10896
10898
  return /* @__PURE__ */ jsx("div", {
10897
10899
  style: {
10898
10900
  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"
10901
+ flexDirection: ((_b2 = (_a2 = value == null ? void 0 : value.main) == null ? void 0 : _a2.legend) == null ? void 0 : _b2.direction) || "row"
10901
10902
  },
10902
10903
  children: labels.map((label, i) => {
10903
- var _a3, _b3, _c2, _d2;
10904
+ var _a3, _b3;
10904
10905
  return /* @__PURE__ */ jsxs(LegendItem, {
10905
10906
  margin: "0 5px",
10906
10907
  onClick: (events) => {
10907
10908
  if (events)
10908
10909
  alert(`clicked: ${JSON.stringify(label)}`);
10909
10910
  },
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: `${((_d2 = (_c2 = value == null ? void 0 : value.main) == null ? void 0 : _c2.legend) == null ? void 0 : _d2.align) || "left"}`,
10920
+ align: `${((_b3 = (_a3 = value == null ? void 0 : value.main) == null ? void 0 : _a3.legend) == null ? void 0 : _b3.align) || "left"}`,
10921
10921
  margin: "0 0 0 4px",
10922
10922
  children: label.text
10923
10923
  })]
@@ -10976,7 +10976,7 @@ function DrawBarGraph({
10976
10976
  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
10977
  });
10978
10978
  const xMax = width2 - margin2.left - margin2.right;
10979
- const yMax = height2 - margin2.top - margin2.bottom - 0;
10979
+ const yMax = height2 - margin2.top - 80;
10980
10980
  dateScale.rangeRound([0, xMax]);
10981
10981
  cityScale.rangeRound([0, dateScale.bandwidth()]);
10982
10982
  tempScale.range([yMax, 0]);
@@ -11409,7 +11409,7 @@ const Product1 = [
11409
11409
  }
11410
11410
  ];
11411
11411
  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;
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, _J, _K, _L, _M, _N, _O, _P, _Q, _R;
11413
11413
  switch (type2) {
11414
11414
  case "BarGraph":
11415
11415
  case "StackBarGraph":
@@ -11485,7 +11485,7 @@ const finalDataProvider = (type2, value, theme) => {
11485
11485
  case "PieGraph":
11486
11486
  return {
11487
11487
  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 }],
11488
+ data: ((_h = value == null ? void 0 : value.main) == null ? void 0 : _h.data) && ((_i = value.main.data) == null ? void 0 : _i.length) > 0 ? (_j = value == null ? void 0 : value.main) == null ? void 0 : _j.data : [{ label: "Kotak", value: 500 }, { label: "SBI", value: 700 }, { label: "HDFC", value: 900 }],
11489
11489
  header: "Pie Graph",
11490
11490
  bottomLabel: "Name of Employe",
11491
11491
  leftLabel: "Value",
@@ -11499,7 +11499,7 @@ const finalDataProvider = (type2, value, theme) => {
11499
11499
  legendTitle: "Our Assests",
11500
11500
  direction: "row",
11501
11501
  align: "right",
11502
- ...(_j = value == null ? void 0 : value.main) == null ? void 0 : _j.legend
11502
+ ...(_k = value == null ? void 0 : value.main) == null ? void 0 : _k.legend
11503
11503
  }
11504
11504
  },
11505
11505
  style: {
@@ -11509,7 +11509,7 @@ const finalDataProvider = (type2, value, theme) => {
11509
11509
  height: "310",
11510
11510
  borderRadius: "20px",
11511
11511
  padding: "10px 0 2px 0",
11512
- ...(_k = value == null ? void 0 : value.style) == null ? void 0 : _k.containerStyle
11512
+ ...(_l = value == null ? void 0 : value.style) == null ? void 0 : _l.containerStyle
11513
11513
  },
11514
11514
  headerStyle: {
11515
11515
  fontWeight: 500,
@@ -11520,22 +11520,17 @@ const finalDataProvider = (type2, value, theme) => {
11520
11520
  width: "100%",
11521
11521
  fontSize: "18px",
11522
11522
  color: theme.palette.text.primary,
11523
- ...(_l = value == null ? void 0 : value.style) == null ? void 0 : _l.headerStyle
11523
+ ...(_m = value == null ? void 0 : value.style) == null ? void 0 : _m.headerStyle
11524
11524
  },
11525
11525
  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
11526
+ ...(_n = value == null ? void 0 : value.style) == null ? void 0 : _n.tooltipStyle
11532
11527
  },
11533
11528
  labelStyle: {
11534
11529
  labelColor: theme.palette.text.primary,
11535
11530
  labelOffset: 45,
11536
11531
  leftLabelMargin: "70",
11537
11532
  topLabelMargin: "-40",
11538
- ...(_n = value == null ? void 0 : value.style) == null ? void 0 : _n.labelStyle
11533
+ ...(_o = value == null ? void 0 : value.style) == null ? void 0 : _o.labelStyle
11539
11534
  },
11540
11535
  legendStyle: {
11541
11536
  legend: {
@@ -11548,36 +11543,30 @@ const finalDataProvider = (type2, value, theme) => {
11548
11543
  border: "1px solid rgba(255, 255, 255, 0.3)",
11549
11544
  borderRadius: " 8px",
11550
11545
  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"
11546
+ ...(_q = (_p = value == null ? void 0 : value.style) == null ? void 0 : _p.legendStyle) == null ? void 0 : _q.legend
11558
11547
  },
11559
11548
  legendTitle: {
11560
11549
  fontWeight: 500,
11561
11550
  marginBottom: "5px",
11562
11551
  fontFamily: "roboto",
11563
11552
  fontSize: "10px",
11564
- ...(_r = (_q = value == null ? void 0 : value.style) == null ? void 0 : _q.legendStyle) == null ? void 0 : _r.legendTitle
11553
+ ...(_s = (_r = value == null ? void 0 : value.style) == null ? void 0 : _r.legendStyle) == null ? void 0 : _s.legendTitle
11565
11554
  }
11566
11555
  },
11567
11556
  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)"],
11557
+ colorRange: ((_t5 = theme == null ? void 0 : theme.chartColours) == null ? void 0 : _t5.pieChartColours) || ["#3f51b5", "rgba(200,0,31,0.9)", "rgba(25,200,205,0.6)"],
11569
11558
  outerRadius: 120,
11570
- innerRadius: 63,
11559
+ innerRadius: 60,
11571
11560
  cornerRadius: 2,
11572
11561
  padAngle: 6e-3,
11573
- ...(_t5 = value == null ? void 0 : value.style) == null ? void 0 : _t5.pieStyle
11562
+ ...(_u = value == null ? void 0 : value.style) == null ? void 0 : _u.pieStyle
11574
11563
  }
11575
11564
  }
11576
11565
  };
11577
11566
  case "LineGraph":
11578
11567
  return {
11579
11568
  main: {
11580
- data: ((_u = value == null ? void 0 : value.main) == null ? void 0 : _u.data) || Product1,
11569
+ data: ((_w = (_v = value == null ? void 0 : value.main) == null ? void 0 : _v.data) == null ? void 0 : _w.length) > 0 ? (_x = value == null ? void 0 : value.main) == null ? void 0 : _x.data : Product1,
11581
11570
  header: "Line Graph Dynamic",
11582
11571
  bottomLabel: "Name of Employe",
11583
11572
  leftLabel: "Value",
@@ -11595,7 +11584,7 @@ const finalDataProvider = (type2, value, theme) => {
11595
11584
  direction: "row",
11596
11585
  align: "right",
11597
11586
  colorRectWidth: 20,
11598
- ...(_v = value == null ? void 0 : value.main) == null ? void 0 : _v.legend
11587
+ ...(_y = value == null ? void 0 : value.main) == null ? void 0 : _y.legend
11599
11588
  }
11600
11589
  },
11601
11590
  style: {
@@ -11605,7 +11594,7 @@ const finalDataProvider = (type2, value, theme) => {
11605
11594
  height: "300",
11606
11595
  borderRadius: "20px",
11607
11596
  padding: "10px 0 2px 0",
11608
- ...(_w = value == null ? void 0 : value.style) == null ? void 0 : _w.containerStyle
11597
+ ...(_z = value == null ? void 0 : value.style) == null ? void 0 : _z.containerStyle
11609
11598
  },
11610
11599
  headerStyle: {
11611
11600
  fontWeight: 500,
@@ -11616,47 +11605,47 @@ const finalDataProvider = (type2, value, theme) => {
11616
11605
  width: "100%",
11617
11606
  fontSize: "18px",
11618
11607
  color: theme.palette.text.primary,
11619
- ...(_x = value == null ? void 0 : value.style) == null ? void 0 : _x.headerStyle
11608
+ ...(_A = value == null ? void 0 : value.style) == null ? void 0 : _A.headerStyle
11620
11609
  },
11621
11610
  labelStyle: {
11622
11611
  labelColor: theme.palette.text.primary,
11623
11612
  bottomLabelOffset: 20,
11624
11613
  leftLabelOffset: 50,
11625
11614
  leftLabelMargin: 80,
11626
- ...(_y = value == null ? void 0 : value.style) == null ? void 0 : _y.labelStyle
11615
+ ...(_B = value == null ? void 0 : value.style) == null ? void 0 : _B.labelStyle
11627
11616
  },
11628
11617
  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)"],
11618
+ colorRange: ((_C = theme == null ? void 0 : theme.chartColours) == null ? void 0 : _C.lineChartColours) || ["#3f51b5", "rgba(200,0,31,0.9)", "rgba(25,200,205,0.6)"],
11630
11619
  lineAreaColor: "none",
11631
11620
  lineAreaOpacity: 0.2,
11632
- ...(_A = value == null ? void 0 : value.style) == null ? void 0 : _A.lineStyle
11621
+ ...(_D = value == null ? void 0 : value.style) == null ? void 0 : _D.lineStyle
11633
11622
  }
11634
11623
  }
11635
11624
  };
11636
11625
  case "HorizontalBarGraph":
11637
11626
  return {
11638
11627
  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 }],
11628
+ data: ((_E = value == null ? void 0 : value.main) == null ? void 0 : _E.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
11629
  header: " ",
11641
11630
  bottomLabel: "Name of Employe",
11642
11631
  leftLabel: "Value",
11643
11632
  axisLeft: true,
11644
11633
  axisBottom: true,
11645
11634
  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,
11635
+ hideLeftTicks: ((_F = value == null ? void 0 : value.main) == null ? void 0 : _F.data) ? true : false,
11636
+ hideLeftAxisLine: ((_G = value == null ? void 0 : value.main) == null ? void 0 : _G.data) ? true : false,
11648
11637
  hideBottomAxisLine: false,
11649
11638
  bottomAxisWidth: "10px",
11650
11639
  ...value.main
11651
11640
  },
11652
11641
  style: {
11653
11642
  containerStyle: {
11654
- background: theme.palette.secondary.main,
11643
+ background: (_I = (_H = theme == null ? void 0 : theme.palette) == null ? void 0 : _H.secondary) == null ? void 0 : _I.main,
11655
11644
  width: "90%",
11656
11645
  height: "300",
11657
11646
  borderRadius: "20px",
11658
11647
  padding: "10px 0 2px 0",
11659
- ...(_E = value == null ? void 0 : value.style) == null ? void 0 : _E.containerStyle
11648
+ ...(_J = value == null ? void 0 : value.style) == null ? void 0 : _J.containerStyle
11660
11649
  },
11661
11650
  headerStyle: {
11662
11651
  fontWeight: 500,
@@ -11666,28 +11655,28 @@ const finalDataProvider = (type2, value, theme) => {
11666
11655
  padding: "15px 0 1px 20px",
11667
11656
  width: "100%",
11668
11657
  fontSize: "18px",
11669
- color: theme.palette.text.primary,
11670
- ...(_F = value == null ? void 0 : value.style) == null ? void 0 : _F.headerStyle
11658
+ color: (_L = (_K = theme == null ? void 0 : theme.palette) == null ? void 0 : _K.text) == null ? void 0 : _L.primary,
11659
+ ...(_M = value == null ? void 0 : value.style) == null ? void 0 : _M.headerStyle
11671
11660
  },
11672
11661
  tooltipStyle: {
11673
11662
  padding: "6px",
11674
11663
  borderRadius: "2px",
11675
- ...(_G = value == null ? void 0 : value.style) == null ? void 0 : _G.tooltipStyle
11664
+ ...(_N = value == null ? void 0 : value.style) == null ? void 0 : _N.tooltipStyle
11676
11665
  },
11677
11666
  labelStyle: {
11678
- margin: { top: 10, left: 110, right: 40, bottom: 40 },
11679
- tickLabelColor: theme.palette.text.primary,
11680
- leftLabelOffset: 140,
11667
+ margin: { top: 10, left: 125, right: 40, bottom: 40 },
11668
+ tickLabelColor: (_P = (_O = theme == null ? void 0 : theme.palette) == null ? void 0 : _O.text) == null ? void 0 : _P.primary,
11669
+ leftLabelOffset: 100,
11681
11670
  bottomLabelOffset: 14,
11682
11671
  tickFontSize: "10px",
11683
11672
  tickColor: theme.palette.text.primary,
11684
11673
  rightAxisWidth: "0.3px",
11685
11674
  fontSize: "10px",
11686
- ...(_H = value == null ? void 0 : value.style) == null ? void 0 : _H.labelStyle
11675
+ ...(_Q = value == null ? void 0 : value.style) == null ? void 0 : _Q.labelStyle
11687
11676
  },
11688
11677
  barStyle: {
11689
11678
  color: "#6c5efb",
11690
- ...(_I = value == null ? void 0 : value.style) == null ? void 0 : _I.barStyle
11679
+ ...(_R = value == null ? void 0 : value.style) == null ? void 0 : _R.barStyle
11691
11680
  }
11692
11681
  }
11693
11682
  };
@@ -11731,18 +11720,20 @@ const DrawPieGraph = ({
11731
11720
  parentWidth,
11732
11721
  parentHeight
11733
11722
  }) => {
11734
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
11735
- const [active2, setActive] = useState(null);
11723
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
11736
11724
  const letters = (_a = value == null ? void 0 : value.main) == null ? void 0 : _a.data;
11737
11725
  const keys2 = Object.keys(letters[0]);
11738
11726
  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
11727
  const labelKeyIndex = keys2.indexOf("label");
11740
11728
  const valueKeyIndex = labelKeyIndex === 0 ? 1 : 0;
11741
11729
  const frequency = (d2) => d2[arr[valueKeyIndex]];
11742
- const getLetterFrequencyColor = createOrdinalScale$1({
11743
- domain: letters.map((l2) => l2[arr[labelKeyIndex]]),
11744
- range: (_g = (_f = value == null ? void 0 : value.style) == null ? void 0 : _f.pieStyle) == null ? void 0 : _g.colorRange
11745
- });
11730
+ const getLetterFrequencyColor = (letter, index2) => {
11731
+ var _a2, _b2;
11732
+ return createOrdinalScale$1({
11733
+ domain: letters.map((l2) => l2[arr[index2]]),
11734
+ range: (_b2 = (_a2 = value == null ? void 0 : value.style) == null ? void 0 : _a2.pieStyle) == null ? void 0 : _b2.colorRange
11735
+ })(letter);
11736
+ };
11746
11737
  const dataKeyArray = letters.map((data) => data.label);
11747
11738
  const {
11748
11739
  tooltipData,
@@ -11752,12 +11743,11 @@ const DrawPieGraph = ({
11752
11743
  showTooltip,
11753
11744
  hideTooltip
11754
11745
  } = useTooltip();
11755
- const handleMouse = (event, arc2, datum2) => {
11756
- setActive(datum2);
11746
+ const handleMouse = (event, datum2) => {
11757
11747
  showTooltip({
11758
11748
  tooltipLeft: event.clientX,
11759
11749
  tooltipTop: event.clientY,
11760
- tooltipData: [datum2[arr[labelKeyIndex]], datum2[arr[valueKeyIndex]]]
11750
+ tooltipData: [datum2[arr[0]], datum2[arr[1]]]
11761
11751
  });
11762
11752
  };
11763
11753
  const innerWidth = parentWidth - 40;
@@ -11767,92 +11757,61 @@ const DrawPieGraph = ({
11767
11757
  const left2 = centerX + 20;
11768
11758
  const top2 = centerY + 20;
11769
11759
  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
- }) => {
11760
+ return /* @__PURE__ */ jsxs(Fragment, {
11761
+ children: [((_f = value == null ? void 0 : value.main) == null ? void 0 : _f.legendAvailable) && /* @__PURE__ */ jsx(Legend, {
11762
+ value,
11763
+ dataKeyArray
11764
+ }), /* @__PURE__ */ jsx("svg", {
11765
+ width: parentWidth,
11766
+ height: parentHeight,
11767
+ className: "pieGraphContainer",
11768
+ children: /* @__PURE__ */ jsx(Group, {
11769
+ top: top2,
11770
+ left: left2,
11771
+ children: /* @__PURE__ */ jsx(Pie, {
11772
+ data: letters,
11773
+ pieSortValues,
11774
+ pieValue: frequency,
11775
+ outerRadius: (_h = (_g = value == null ? void 0 : value.style) == null ? void 0 : _g.pieStyle) == null ? void 0 : _h.outerRadius,
11776
+ innerRadius: (_j = (_i = value == null ? void 0 : value.style) == null ? void 0 : _i.pieStyle) == null ? void 0 : _j.innerRadius,
11777
+ cornerRadius: (_l = (_k = value == null ? void 0 : value.style) == null ? void 0 : _k.pieStyle) == null ? void 0 : _l.cornerRadius,
11778
+ padAngle: (_n = (_m = value == null ? void 0 : value.style) == null ? void 0 : _m.pieStyle) == null ? void 0 : _n.padAngle,
11779
+ children: (pie2) => {
11780
+ return pie2.arcs.map((arc2, index2) => {
11810
11781
  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
11782
+ const indexParam = ((_b2 = (_a2 = value == null ? void 0 : value.style) == null ? void 0 : _a2.pieStyle) == null ? void 0 : _b2.showPieLabel) ? labelKeyIndex : valueKeyIndex;
11783
+ const letter = arc2.data[arr[indexParam]];
11784
+ const [centriodX, centriodY] = pie2.path.centroid(arc2);
11785
+ const arcPath = pie2.path(arc2);
11786
+ const arcFill = getLetterFrequencyColor(letter, indexParam);
11787
+ return /* @__PURE__ */ jsxs("g", {
11788
+ onMouseOut: hideTooltip,
11789
+ onMouseOver: (e3) => handleMouse(e3, arc2.data),
11790
+ className: "pieTooltipHolder",
11791
+ children: [/* @__PURE__ */ jsx("path", {
11792
+ d: arcPath,
11793
+ fill: arcFill
11794
+ }), /* @__PURE__ */ jsx(Text, {
11795
+ x: centriodX,
11796
+ y: centriodY,
11797
+ dy: "0.33em",
11798
+ fontSize: 14,
11799
+ fill: ((_d2 = (_c2 = value == null ? void 0 : value.style) == null ? void 0 : _c2.pieStyle) == null ? void 0 : _d2.pieLabelColor) || "white",
11800
+ textAnchor: "middle",
11801
+ pointerEvents: "none",
11802
+ children: letter
11803
+ })]
11804
+ }, `arc-${letter}-${index2}`);
11805
+ });
11806
+ }
11853
11807
  })
11854
- })]
11855
- })
11808
+ })
11809
+ }), tooltipOpen && /* @__PURE__ */ jsx(ToolTip, {
11810
+ style: value == null ? void 0 : value.style,
11811
+ top: tooltipTop,
11812
+ left: tooltipLeft,
11813
+ tooltipData
11814
+ })]
11856
11815
  });
11857
11816
  };
11858
11817
  const PieGraph = ({
@@ -20143,7 +20102,7 @@ const ProgressBar = ({
20143
20102
  height: "100%",
20144
20103
  borderRadius: "10px",
20145
20104
  marginBottom: "20px",
20146
- transition: "width 0.5s ease-out"
20105
+ transition: "width 0.5 ease-out"
20147
20106
  }
20148
20107
  })
20149
20108
  });