impaktapps-design 0.2.993-alpha.247 → 0.2.993-alpha.249
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.
|
@@ -22555,7 +22555,7 @@ const DrawStackBarLineGraph = ({
|
|
|
22555
22555
|
return [];
|
|
22556
22556
|
return Object.keys(chartData[0]).filter((k2) => k2 !== xAxisValue);
|
|
22557
22557
|
}, [chartData, xAxisValue]);
|
|
22558
|
-
const barKeys = useMemo(() => labelsArray.filter((k2) => k2 !== growthRateKey), [labelsArray]);
|
|
22558
|
+
const barKeys = useMemo(() => labelsArray.filter((k2) => k2 !== growthRateKey), [labelsArray, growthRateKey]);
|
|
22559
22559
|
const barData = useMemo(() => chartData.map((row) => {
|
|
22560
22560
|
const stripped = {
|
|
22561
22561
|
[xAxisValue]: row[xAxisValue]
|
|
@@ -22587,13 +22587,13 @@ const DrawStackBarLineGraph = ({
|
|
|
22587
22587
|
range: [innerHeight, 0],
|
|
22588
22588
|
nice: true
|
|
22589
22589
|
});
|
|
22590
|
-
}, [chartData, innerHeight]);
|
|
22590
|
+
}, [chartData, innerHeight, growthRateKey]);
|
|
22591
22591
|
const getBarCentreX = useCallback((cat) => {
|
|
22592
22592
|
var _a2;
|
|
22593
22593
|
return ((_a2 = categoryScale(cat)) != null ? _a2 : 0) + categoryScale.bandwidth() / 2;
|
|
22594
22594
|
}, [categoryScale]);
|
|
22595
22595
|
const getLineX = useCallback((d2) => getBarCentreX(d2[xAxisValue]), [getBarCentreX, xAxisValue]);
|
|
22596
|
-
const getLineY = useCallback((d2) => trendScale(Number(d2[growthRateKey]) || 0), [trendScale]);
|
|
22596
|
+
const getLineY = useCallback((d2) => trendScale(Number(d2[growthRateKey]) || 0), [trendScale, growthRateKey]);
|
|
22597
22597
|
const handleColumnEnter = useCallback((_e2, cat) => {
|
|
22598
22598
|
const full = chartData.find((d2) => d2[xAxisValue] === cat);
|
|
22599
22599
|
const dotX = getBarCentreX(cat) + margin2.left;
|
|
@@ -22604,7 +22604,7 @@ const DrawStackBarLineGraph = ({
|
|
|
22604
22604
|
tooltipLeft: dotX + 14,
|
|
22605
22605
|
tooltipTop: dotY - 12
|
|
22606
22606
|
});
|
|
22607
|
-
}, [chartData, xAxisValue, trendScale, margin2, showTooltip, getBarCentreX]);
|
|
22607
|
+
}, [chartData, xAxisValue, trendScale, margin2, showTooltip, getBarCentreX, growthRateKey]);
|
|
22608
22608
|
const handleColumnLeave = useCallback(() => {
|
|
22609
22609
|
setHoveredCategory(null);
|
|
22610
22610
|
hideTooltip();
|