impaktapps-design 0.2.993-alpha.237 → 0.2.993-alpha.239

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.
@@ -22161,7 +22161,7 @@ LinearGradient.propTypes = {
22161
22161
  children: _pt.node,
22162
22162
  vertical: _pt.bool
22163
22163
  };
22164
- const PX_PER_CHAR$1 = 7;
22164
+ const PX_PER_CHAR$1 = 9;
22165
22165
  const LABEL_ROTATION$1 = Math.sin(40 * Math.PI / 180);
22166
22166
  const DrawAreaGraph = ({
22167
22167
  width: width2,
@@ -22170,7 +22170,7 @@ const DrawAreaGraph = ({
22170
22170
  areaValue,
22171
22171
  theme
22172
22172
  }) => {
22173
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
22173
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
22174
22174
  const {
22175
22175
  tooltipData,
22176
22176
  tooltipLeft,
@@ -22188,6 +22188,7 @@ const DrawAreaGraph = ({
22188
22188
  const legendLabels = (_g = areaValue.main) == null ? void 0 : _g.legendLabels;
22189
22189
  const colorMap = (_i = (_h = areaValue.style) == null ? void 0 : _h.areaStyle) == null ? void 0 : _i.colorMap;
22190
22190
  const defaultColour = (_k = (_j = theme.myTheme.palette) == null ? void 0 : _j.primary) == null ? void 0 : _k.main;
22191
+ const xAxisTickCount = (_l = areaValue == null ? void 0 : areaValue.main) == null ? void 0 : _l.xAxisTickCount;
22191
22192
  const isSmallScreen = width2 < 600;
22192
22193
  const longestLabelLength = useMemo(() => Math.max(...chartData.map((d2) => String(d2[xAxisValue]).length)), [chartData, xAxisValue]);
22193
22194
  const dynamicBottomMargin = Math.ceil(longestLabelLength * PX_PER_CHAR$1 * LABEL_ROTATION$1);
@@ -22378,14 +22379,16 @@ const DrawAreaGraph = ({
22378
22379
  }), /* @__PURE__ */ jsx$1(AxisBottom, {
22379
22380
  top: innerHeight,
22380
22381
  scale: xScale,
22381
- label: (_l = areaValue.main) == null ? void 0 : _l.bottomLabel,
22382
+ label: (_m = areaValue.main) == null ? void 0 : _m.bottomLabel,
22382
22383
  tickFormat: formatXTick,
22383
22384
  stroke: "#d1d5db",
22384
22385
  tickStroke: "#d1d5db",
22386
+ tickTransform: xAxisType === "date" ? "translate(8, 0)" : void 0,
22387
+ numTicks: xAxisTickCount || 20,
22385
22388
  tickLabelProps
22386
22389
  }), /* @__PURE__ */ jsx$1(AxisLeft, {
22387
22390
  scale: yScale,
22388
- label: !disableLeftLabel ? (_m = areaValue.main) == null ? void 0 : _m.leftLabel : void 0,
22391
+ label: !disableLeftLabel ? (_n = areaValue.main) == null ? void 0 : _n.leftLabel : void 0,
22389
22392
  stroke: "#d1d5db",
22390
22393
  tickStroke: "#d1d5db",
22391
22394
  numTicks: yAxisTickCount || 6,
@@ -22514,7 +22517,7 @@ const AreaGraph = ({
22514
22517
  });
22515
22518
  };
22516
22519
  const GROWTH_RATE_KEY = "growthRate";
22517
- const PX_PER_CHAR = 7;
22520
+ const PX_PER_CHAR = 9;
22518
22521
  const LABEL_ROTATION = Math.sin(40 * Math.PI / 180);
22519
22522
  const DrawStackBarLineGraph = ({
22520
22523
  width: width2,
@@ -22523,7 +22526,7 @@ const DrawStackBarLineGraph = ({
22523
22526
  stackBarLineValue,
22524
22527
  theme
22525
22528
  }) => {
22526
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
22529
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o;
22527
22530
  const {
22528
22531
  tooltipData,
22529
22532
  tooltipLeft,
@@ -22540,7 +22543,8 @@ const DrawStackBarLineGraph = ({
22540
22543
  const defaultColour = (_h = (_g = (_f = theme == null ? void 0 : theme.myTheme) == null ? void 0 : _f.palette) == null ? void 0 : _g.primary) == null ? void 0 : _h.main;
22541
22544
  const yAxisTickCount = (_i = stackBarLineValue == null ? void 0 : stackBarLineValue.main) == null ? void 0 : _i.yAxisTickCount;
22542
22545
  const disableLeftLabel = (_j = stackBarLineValue.main) == null ? void 0 : _j.disableLeftLabel;
22543
- const trendColor = (_k = colorMap == null ? void 0 : colorMap[GROWTH_RATE_KEY]) != null ? _k : "#E24B4A";
22546
+ const xAxisTickCount = (_k = stackBarLineValue == null ? void 0 : stackBarLineValue.main) == null ? void 0 : _k.xAxisTickCount;
22547
+ const trendColor = (_l = colorMap == null ? void 0 : colorMap[GROWTH_RATE_KEY]) != null ? _l : "#E24B4A";
22544
22548
  const isSmallScreen = width2 < 600;
22545
22549
  const longestLabelLength = useMemo(() => Math.max(...chartData.map((d2) => String(d2[xAxisValue]).length)), [chartData, xAxisValue]);
22546
22550
  const dynamicBottomMargin = Math.ceil(longestLabelLength * PX_PER_CHAR * LABEL_ROTATION);
@@ -22738,7 +22742,7 @@ const DrawStackBarLineGraph = ({
22738
22742
  textAnchor: "end",
22739
22743
  dy: "0.33em"
22740
22744
  }),
22741
- label: !disableLeftLabel ? (_l = stackBarLineValue.main) == null ? void 0 : _l.leftLabel : void 0,
22745
+ label: !disableLeftLabel ? (_m = stackBarLineValue.main) == null ? void 0 : _m.leftLabel : void 0,
22742
22746
  labelProps: {
22743
22747
  fill: "#6B7280",
22744
22748
  fontSize: 11,
@@ -22750,7 +22754,7 @@ const DrawStackBarLineGraph = ({
22750
22754
  scale: trendScale,
22751
22755
  numTicks: 5,
22752
22756
  stroke: "#9CA3AF",
22753
- label: (_m = stackBarLineValue.main) == null ? void 0 : _m.rightLabel,
22757
+ label: (_n = stackBarLineValue.main) == null ? void 0 : _n.rightLabel,
22754
22758
  tickStroke: "transparent",
22755
22759
  tickLabelProps: () => ({
22756
22760
  fill: "#6B7280",
@@ -22768,8 +22772,9 @@ const DrawStackBarLineGraph = ({
22768
22772
  top: innerHeight,
22769
22773
  scale: categoryScale,
22770
22774
  stroke: "#9CA3AF",
22771
- label: (_n = stackBarLineValue.main) == null ? void 0 : _n.bottomLabel,
22775
+ label: (_o = stackBarLineValue.main) == null ? void 0 : _o.bottomLabel,
22772
22776
  tickStroke: "transparent",
22777
+ numTicks: xAxisTickCount || 20,
22773
22778
  tickLabelProps
22774
22779
  })]
22775
22780
  })