impaktapps-design 0.2.88 → 0.2.89-alpha.401
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.
- package/dist/impaktapps-design.es.js +23 -30
- package/dist/impaktapps-design.es.js.map +1 -1
- package/dist/impaktapps-design.umd.js +8 -8
- package/dist/impaktapps-design.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/component/PieGraph/DrawPieGraph.tsx +65 -9
- package/src/component/ToolTip.tsx +41 -25
- package/src/utils/finalDataProvider.ts +4 -1
|
@@ -10461,46 +10461,32 @@ const ToolTip = ({
|
|
|
10461
10461
|
left: left2,
|
|
10462
10462
|
tooltipData
|
|
10463
10463
|
}) => {
|
|
10464
|
-
|
|
10465
|
-
TooltipInPortal
|
|
10466
|
-
} = useTooltipInPortal({
|
|
10464
|
+
useTooltipInPortal({
|
|
10467
10465
|
detectBounds: true,
|
|
10468
10466
|
scroll: true
|
|
10469
10467
|
});
|
|
10470
|
-
return /* @__PURE__ */ jsx(
|
|
10468
|
+
return /* @__PURE__ */ jsx(Tooltip$1, {
|
|
10471
10469
|
top: top2,
|
|
10472
10470
|
left: left2,
|
|
10471
|
+
style: style2 == null ? void 0 : style2.tooltipStyle,
|
|
10473
10472
|
children: /* @__PURE__ */ jsxs("div", {
|
|
10474
10473
|
style: {
|
|
10475
|
-
|
|
10476
|
-
|
|
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"
|
|
10474
|
+
display: "flex",
|
|
10475
|
+
alignItems: "center"
|
|
10484
10476
|
},
|
|
10485
10477
|
children: [/* @__PURE__ */ jsx("div", {
|
|
10486
10478
|
style: {
|
|
10487
|
-
|
|
10488
|
-
|
|
10489
|
-
|
|
10490
|
-
|
|
10491
|
-
},
|
|
10492
|
-
children: tooltipData[0]
|
|
10479
|
+
width: "12px",
|
|
10480
|
+
height: "12px",
|
|
10481
|
+
marginRight: "8px"
|
|
10482
|
+
}
|
|
10493
10483
|
}), /* @__PURE__ */ jsx("div", {
|
|
10494
|
-
|
|
10495
|
-
|
|
10496
|
-
|
|
10497
|
-
marginTop: "10px",
|
|
10498
|
-
fontWeight: 700
|
|
10499
|
-
},
|
|
10500
|
-
children: tooltipData[1]
|
|
10484
|
+
children: /* @__PURE__ */ jsx("strong", {
|
|
10485
|
+
children: `${tooltipData[0]}: ${tooltipData[1]}`
|
|
10486
|
+
})
|
|
10501
10487
|
})]
|
|
10502
10488
|
})
|
|
10503
|
-
}
|
|
10489
|
+
});
|
|
10504
10490
|
};
|
|
10505
10491
|
var _excluded$F = ["flexDirection", "alignItems", "margin", "display", "children"];
|
|
10506
10492
|
function _extends$B() {
|
|
@@ -11523,6 +11509,10 @@ const finalDataProvider = (type2, value, theme) => {
|
|
|
11523
11509
|
...(_l = value == null ? void 0 : value.style) == null ? void 0 : _l.headerStyle
|
|
11524
11510
|
},
|
|
11525
11511
|
tooltipStyle: {
|
|
11512
|
+
minWidth: 80,
|
|
11513
|
+
height: 20,
|
|
11514
|
+
backgroundColor: "lightgrey",
|
|
11515
|
+
color: "black",
|
|
11526
11516
|
...(_m = value == null ? void 0 : value.style) == null ? void 0 : _m.tooltipStyle
|
|
11527
11517
|
},
|
|
11528
11518
|
labelStyle: {
|
|
@@ -11559,7 +11549,6 @@ const finalDataProvider = (type2, value, theme) => {
|
|
|
11559
11549
|
innerRadius: 60,
|
|
11560
11550
|
cornerRadius: 2,
|
|
11561
11551
|
padAngle: 6e-3,
|
|
11562
|
-
showPieLabel: true,
|
|
11563
11552
|
...(_s = value == null ? void 0 : value.style) == null ? void 0 : _s.pieStyle
|
|
11564
11553
|
}
|
|
11565
11554
|
}
|
|
@@ -11722,6 +11711,7 @@ const DrawPieGraph = ({
|
|
|
11722
11711
|
parentHeight
|
|
11723
11712
|
}) => {
|
|
11724
11713
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
|
|
11714
|
+
const [active2, setActive] = useState(null);
|
|
11725
11715
|
const letters = (_a = value == null ? void 0 : value.main) == null ? void 0 : _a.data;
|
|
11726
11716
|
const keys2 = Object.keys(letters[0]);
|
|
11727
11717
|
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;
|
|
@@ -11744,7 +11734,8 @@ const DrawPieGraph = ({
|
|
|
11744
11734
|
showTooltip,
|
|
11745
11735
|
hideTooltip
|
|
11746
11736
|
} = useTooltip();
|
|
11747
|
-
const handleMouse = (event, datum2) => {
|
|
11737
|
+
const handleMouse = (event, arc2, datum2) => {
|
|
11738
|
+
setActive(arc2.index);
|
|
11748
11739
|
showTooltip({
|
|
11749
11740
|
tooltipLeft: event.clientX,
|
|
11750
11741
|
tooltipTop: event.clientY,
|
|
@@ -11780,14 +11771,16 @@ const DrawPieGraph = ({
|
|
|
11780
11771
|
children: (pie2) => {
|
|
11781
11772
|
return pie2.arcs.map((arc2, index2) => {
|
|
11782
11773
|
var _a2, _b2, _c2, _d2;
|
|
11774
|
+
console.log("arc.data", arc2.data);
|
|
11783
11775
|
const indexParam = ((_b2 = (_a2 = value == null ? void 0 : value.style) == null ? void 0 : _a2.pieStyle) == null ? void 0 : _b2.showPieLabel) ? labelKeyIndex : valueKeyIndex;
|
|
11784
11776
|
const letter = arc2.data[arr[indexParam]];
|
|
11777
|
+
console.log("arc.data[arr[indexParam]]", arc2.data[arr[indexParam]]);
|
|
11785
11778
|
const [centriodX, centriodY] = pie2.path.centroid(arc2);
|
|
11786
11779
|
const arcPath = pie2.path(arc2);
|
|
11787
11780
|
const arcFill = getLetterFrequencyColor(letter, indexParam);
|
|
11788
11781
|
return /* @__PURE__ */ jsxs("g", {
|
|
11789
11782
|
onMouseOut: hideTooltip,
|
|
11790
|
-
onMouseOver: (e3) => handleMouse(e3, arc2
|
|
11783
|
+
onMouseOver: (e3) => handleMouse(e3, arc2, pie2),
|
|
11791
11784
|
className: "pieTooltipHolder",
|
|
11792
11785
|
children: [/* @__PURE__ */ jsx("path", {
|
|
11793
11786
|
d: arcPath,
|