impaktapps-design 0.2.993-alpha.235 → 0.2.993-alpha.236
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 +8 -2
- package/dist/impaktapps-design.es.js.map +1 -1
- package/dist/impaktapps-design.umd.js +21 -21
- package/dist/impaktapps-design.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/component/AreaGraph/DrawAreaGraph.tsx +7 -1
- package/src/component/StackBarLineGraph/DrawStackBarLineGraph.tsx +8 -1
|
@@ -22161,6 +22161,7 @@ LinearGradient.propTypes = {
|
|
|
22161
22161
|
children: _pt.node,
|
|
22162
22162
|
vertical: _pt.bool
|
|
22163
22163
|
};
|
|
22164
|
+
const PX_PER_CHAR$1 = 6;
|
|
22164
22165
|
const DrawAreaGraph = ({
|
|
22165
22166
|
width: width2,
|
|
22166
22167
|
height: height2,
|
|
@@ -22188,9 +22189,11 @@ const DrawAreaGraph = ({
|
|
|
22188
22189
|
const defaultColour = (_k = (_j = theme.myTheme.palette) == null ? void 0 : _j.primary) == null ? void 0 : _k.main;
|
|
22189
22190
|
const muiTheme = useTheme$1();
|
|
22190
22191
|
const isSmallScreen = useMediaQuery(muiTheme.breakpoints.down("sm"));
|
|
22192
|
+
const longestLabelLength = useMemo(() => Math.max(...chartData.map((d2) => String(d2[xAxisValue]).length)), [chartData, xAxisValue]);
|
|
22193
|
+
const dynamicBottomMargin = longestLabelLength * PX_PER_CHAR$1;
|
|
22191
22194
|
const margin2 = {
|
|
22192
22195
|
...marginProp,
|
|
22193
|
-
bottom: isSmallScreen ? Math.max(marginProp.bottom,
|
|
22196
|
+
bottom: isSmallScreen ? Math.max(marginProp.bottom, dynamicBottomMargin) : marginProp.bottom
|
|
22194
22197
|
};
|
|
22195
22198
|
const labelsArray = useMemo(() => {
|
|
22196
22199
|
if (!chartData.length)
|
|
@@ -22503,6 +22506,7 @@ const AreaGraph = ({
|
|
|
22503
22506
|
});
|
|
22504
22507
|
};
|
|
22505
22508
|
const GROWTH_RATE_KEY = "growthRate";
|
|
22509
|
+
const PX_PER_CHAR = 6;
|
|
22506
22510
|
const DrawStackBarLineGraph = ({
|
|
22507
22511
|
width: width2,
|
|
22508
22512
|
height: height2,
|
|
@@ -22530,9 +22534,11 @@ const DrawStackBarLineGraph = ({
|
|
|
22530
22534
|
const trendColor = (_k = colorMap == null ? void 0 : colorMap[GROWTH_RATE_KEY]) != null ? _k : "#E24B4A";
|
|
22531
22535
|
const muiTheme = useTheme$1();
|
|
22532
22536
|
const isSmallScreen = useMediaQuery(muiTheme.breakpoints.down("sm"));
|
|
22537
|
+
const longestLabelLength = useMemo(() => Math.max(...chartData.map((d2) => String(d2[xAxisValue]).length)), [chartData, xAxisValue]);
|
|
22538
|
+
const dynamicBottomMargin = longestLabelLength * PX_PER_CHAR;
|
|
22533
22539
|
const margin2 = {
|
|
22534
22540
|
...marginProp,
|
|
22535
|
-
bottom: isSmallScreen ? Math.max(marginProp.bottom,
|
|
22541
|
+
bottom: isSmallScreen ? Math.max(marginProp.bottom, dynamicBottomMargin) : marginProp.bottom
|
|
22536
22542
|
};
|
|
22537
22543
|
const labelsArray = useMemo(() => {
|
|
22538
22544
|
if (!chartData.length)
|