@coinbase/cds-web-visualization 3.4.0-beta.4 → 3.4.0-beta.6

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.
Files changed (167) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dts/chart/CartesianChart.d.ts +38 -2
  3. package/dts/chart/CartesianChart.d.ts.map +1 -1
  4. package/dts/chart/Path.d.ts +27 -7
  5. package/dts/chart/Path.d.ts.map +1 -1
  6. package/dts/chart/PeriodSelector.d.ts +0 -4
  7. package/dts/chart/PeriodSelector.d.ts.map +1 -1
  8. package/dts/chart/area/Area.d.ts +54 -24
  9. package/dts/chart/area/Area.d.ts.map +1 -1
  10. package/dts/chart/area/AreaChart.d.ts +33 -6
  11. package/dts/chart/area/AreaChart.d.ts.map +1 -1
  12. package/dts/chart/area/DottedArea.d.ts +21 -44
  13. package/dts/chart/area/DottedArea.d.ts.map +1 -1
  14. package/dts/chart/area/GradientArea.d.ts +21 -12
  15. package/dts/chart/area/GradientArea.d.ts.map +1 -1
  16. package/dts/chart/area/SolidArea.d.ts +16 -1
  17. package/dts/chart/area/SolidArea.d.ts.map +1 -1
  18. package/dts/chart/axis/Axis.d.ts +89 -43
  19. package/dts/chart/axis/Axis.d.ts.map +1 -1
  20. package/dts/chart/axis/DefaultAxisTickLabel.d.ts +8 -0
  21. package/dts/chart/axis/DefaultAxisTickLabel.d.ts.map +1 -0
  22. package/dts/chart/axis/XAxis.d.ts +1 -1
  23. package/dts/chart/axis/XAxis.d.ts.map +1 -1
  24. package/dts/chart/axis/YAxis.d.ts +1 -1
  25. package/dts/chart/axis/YAxis.d.ts.map +1 -1
  26. package/dts/chart/axis/index.d.ts +1 -0
  27. package/dts/chart/axis/index.d.ts.map +1 -1
  28. package/dts/chart/bar/Bar.d.ts +16 -13
  29. package/dts/chart/bar/Bar.d.ts.map +1 -1
  30. package/dts/chart/bar/BarChart.d.ts +17 -8
  31. package/dts/chart/bar/BarChart.d.ts.map +1 -1
  32. package/dts/chart/bar/BarPlot.d.ts +2 -1
  33. package/dts/chart/bar/BarPlot.d.ts.map +1 -1
  34. package/dts/chart/bar/BarStack.d.ts +40 -48
  35. package/dts/chart/bar/BarStack.d.ts.map +1 -1
  36. package/dts/chart/bar/BarStackGroup.d.ts +1 -0
  37. package/dts/chart/bar/BarStackGroup.d.ts.map +1 -1
  38. package/dts/chart/bar/DefaultBar.d.ts.map +1 -1
  39. package/dts/chart/bar/DefaultBarStack.d.ts.map +1 -1
  40. package/dts/chart/gradient/Gradient.d.ts +35 -0
  41. package/dts/chart/gradient/Gradient.d.ts.map +1 -0
  42. package/dts/chart/gradient/index.d.ts +2 -0
  43. package/dts/chart/gradient/index.d.ts.map +1 -0
  44. package/dts/chart/index.d.ts +2 -1
  45. package/dts/chart/index.d.ts.map +1 -1
  46. package/dts/chart/line/DefaultReferenceLineLabel.d.ts +9 -0
  47. package/dts/chart/line/DefaultReferenceLineLabel.d.ts.map +1 -0
  48. package/dts/chart/line/DottedLine.d.ts +15 -3
  49. package/dts/chart/line/DottedLine.d.ts.map +1 -1
  50. package/dts/chart/line/Line.d.ts +70 -28
  51. package/dts/chart/line/Line.d.ts.map +1 -1
  52. package/dts/chart/line/LineChart.d.ts +26 -8
  53. package/dts/chart/line/LineChart.d.ts.map +1 -1
  54. package/dts/chart/line/ReferenceLine.d.ts +85 -44
  55. package/dts/chart/line/ReferenceLine.d.ts.map +1 -1
  56. package/dts/chart/line/SolidLine.d.ts +14 -3
  57. package/dts/chart/line/SolidLine.d.ts.map +1 -1
  58. package/dts/chart/line/index.d.ts +1 -1
  59. package/dts/chart/line/index.d.ts.map +1 -1
  60. package/dts/chart/point/DefaultPointLabel.d.ts +10 -0
  61. package/dts/chart/point/DefaultPointLabel.d.ts.map +1 -0
  62. package/dts/chart/point/Point.d.ts +201 -0
  63. package/dts/chart/point/Point.d.ts.map +1 -0
  64. package/dts/chart/point/index.d.ts +3 -0
  65. package/dts/chart/point/index.d.ts.map +1 -0
  66. package/dts/chart/scrubber/DefaultScrubberBeacon.d.ts +24 -0
  67. package/dts/chart/scrubber/DefaultScrubberBeacon.d.ts.map +1 -0
  68. package/dts/chart/scrubber/DefaultScrubberBeaconLabel.d.ts +12 -0
  69. package/dts/chart/scrubber/DefaultScrubberBeaconLabel.d.ts.map +1 -0
  70. package/dts/chart/scrubber/DefaultScrubberLabel.d.ts +10 -0
  71. package/dts/chart/scrubber/DefaultScrubberLabel.d.ts.map +1 -0
  72. package/dts/chart/scrubber/Scrubber.d.ts +203 -64
  73. package/dts/chart/scrubber/Scrubber.d.ts.map +1 -1
  74. package/dts/chart/scrubber/ScrubberBeaconGroup.d.ts +70 -0
  75. package/dts/chart/scrubber/ScrubberBeaconGroup.d.ts.map +1 -0
  76. package/dts/chart/scrubber/ScrubberBeaconLabelGroup.d.ts +32 -0
  77. package/dts/chart/scrubber/ScrubberBeaconLabelGroup.d.ts.map +1 -0
  78. package/dts/chart/scrubber/index.d.ts +3 -0
  79. package/dts/chart/scrubber/index.d.ts.map +1 -1
  80. package/dts/chart/text/ChartText.d.ts +46 -43
  81. package/dts/chart/text/ChartText.d.ts.map +1 -1
  82. package/dts/chart/text/{SmartChartTextGroup.d.ts → ChartTextGroup.d.ts} +9 -3
  83. package/dts/chart/text/ChartTextGroup.d.ts.map +1 -0
  84. package/dts/chart/text/index.d.ts +1 -1
  85. package/dts/chart/text/index.d.ts.map +1 -1
  86. package/dts/chart/utils/chart.d.ts +27 -7
  87. package/dts/chart/utils/chart.d.ts.map +1 -1
  88. package/dts/chart/utils/context.d.ts +6 -0
  89. package/dts/chart/utils/context.d.ts.map +1 -1
  90. package/dts/chart/utils/gradient.d.ts +104 -0
  91. package/dts/chart/utils/gradient.d.ts.map +1 -0
  92. package/dts/chart/utils/index.d.ts +4 -0
  93. package/dts/chart/utils/index.d.ts.map +1 -1
  94. package/dts/chart/utils/interpolate.d.ts +112 -0
  95. package/dts/chart/utils/interpolate.d.ts.map +1 -0
  96. package/dts/chart/utils/path.d.ts +24 -1
  97. package/dts/chart/utils/path.d.ts.map +1 -1
  98. package/dts/chart/utils/point.d.ts +29 -0
  99. package/dts/chart/utils/point.d.ts.map +1 -1
  100. package/dts/chart/utils/scrubber.d.ts +39 -0
  101. package/dts/chart/utils/scrubber.d.ts.map +1 -0
  102. package/dts/chart/utils/transition.d.ts +65 -0
  103. package/dts/chart/utils/transition.d.ts.map +1 -0
  104. package/esm/chart/CartesianChart.js +140 -85
  105. package/esm/chart/Path.js +51 -46
  106. package/esm/chart/PeriodSelector.js +4 -18
  107. package/esm/chart/area/Area.js +24 -34
  108. package/esm/chart/area/AreaChart.js +24 -15
  109. package/esm/chart/area/DottedArea.js +35 -89
  110. package/esm/chart/area/GradientArea.js +34 -80
  111. package/esm/chart/area/SolidArea.js +29 -11
  112. package/esm/chart/axis/Axis.js +4 -25
  113. package/esm/chart/axis/DefaultAxisTickLabel.js +15 -0
  114. package/esm/chart/axis/XAxis.js +53 -36
  115. package/esm/chart/axis/YAxis.js +55 -32
  116. package/esm/chart/axis/index.js +1 -0
  117. package/esm/chart/bar/Bar.js +3 -1
  118. package/esm/chart/bar/BarChart.js +15 -32
  119. package/esm/chart/bar/BarPlot.js +3 -2
  120. package/esm/chart/bar/BarStack.js +65 -23
  121. package/esm/chart/bar/BarStackGroup.js +7 -17
  122. package/esm/chart/bar/DefaultBar.js +4 -7
  123. package/esm/chart/bar/DefaultBarStack.js +5 -7
  124. package/esm/chart/gradient/Gradient.js +104 -0
  125. package/esm/chart/gradient/index.js +1 -0
  126. package/esm/chart/index.js +2 -1
  127. package/esm/chart/line/DefaultReferenceLineLabel.js +81 -0
  128. package/esm/chart/line/DottedLine.js +38 -17
  129. package/esm/chart/line/Line.js +96 -70
  130. package/esm/chart/line/LineChart.js +18 -6
  131. package/esm/chart/line/ReferenceLine.js +34 -41
  132. package/esm/chart/line/SolidLine.js +36 -15
  133. package/esm/chart/line/index.js +1 -1
  134. package/esm/chart/{line/GradientLine.js → point/DefaultPointLabel.js} +31 -45
  135. package/esm/chart/point/Point.css +2 -0
  136. package/esm/chart/{Point.js → point/Point.js} +66 -57
  137. package/esm/chart/point/index.js +2 -0
  138. package/esm/chart/scrubber/DefaultScrubberBeacon.js +155 -0
  139. package/esm/chart/scrubber/{ScrubberBeaconLabel.js → DefaultScrubberBeaconLabel.js} +23 -10
  140. package/esm/chart/scrubber/DefaultScrubberLabel.js +30 -0
  141. package/esm/chart/scrubber/Scrubber.js +98 -392
  142. package/esm/chart/scrubber/ScrubberBeaconGroup.js +166 -0
  143. package/esm/chart/scrubber/ScrubberBeaconLabelGroup.js +186 -0
  144. package/esm/chart/scrubber/index.js +3 -1
  145. package/esm/chart/text/ChartText.js +13 -19
  146. package/esm/chart/text/{SmartChartTextGroup.js → ChartTextGroup.js} +4 -3
  147. package/esm/chart/text/index.js +1 -1
  148. package/esm/chart/utils/chart.js +29 -3
  149. package/esm/chart/utils/gradient.js +257 -0
  150. package/esm/chart/utils/index.js +4 -0
  151. package/esm/chart/utils/interpolate.js +644 -0
  152. package/esm/chart/utils/path.js +32 -9
  153. package/esm/chart/utils/point.js +69 -0
  154. package/esm/chart/utils/scrubber.js +132 -0
  155. package/esm/chart/utils/transition.js +111 -0
  156. package/package.json +9 -9
  157. package/dts/chart/Point.d.ts +0 -153
  158. package/dts/chart/Point.d.ts.map +0 -1
  159. package/dts/chart/line/GradientLine.d.ts +0 -42
  160. package/dts/chart/line/GradientLine.d.ts.map +0 -1
  161. package/dts/chart/scrubber/ScrubberBeacon.d.ts +0 -93
  162. package/dts/chart/scrubber/ScrubberBeacon.d.ts.map +0 -1
  163. package/dts/chart/scrubber/ScrubberBeaconLabel.d.ts +0 -7
  164. package/dts/chart/scrubber/ScrubberBeaconLabel.d.ts.map +0 -1
  165. package/dts/chart/text/SmartChartTextGroup.d.ts.map +0 -1
  166. package/esm/chart/Point.css +0 -2
  167. package/esm/chart/scrubber/ScrubberBeacon.js +0 -195
@@ -1,4 +1,4 @@
1
- const _excluded = ["d", "fill", "fillOpacity", "peakColor", "baselineColor", "peakOpacity", "baselineOpacity", "baseline", "yAxisId"];
1
+ const _excluded = ["d", "fill", "fillOpacity", "peakOpacity", "baselineOpacity", "baseline", "yAxisId", "gradient", "animate", "transition"];
2
2
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
3
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
4
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
@@ -6,106 +6,60 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
6
6
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
7
  function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
8
8
  function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
9
- import { memo, useId } from 'react';
9
+ import { memo, useId, useMemo } from 'react';
10
10
  import { useCartesianChartContext } from '../ChartProvider';
11
+ import { Gradient } from '../gradient';
11
12
  import { Path } from '../Path';
13
+ import { createGradient, getBaseline } from '../utils';
12
14
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
13
15
  /**
14
- * A customizable gradient area component which uses Path.
16
+ * A customizable gradient area component which uses Path with SVG linearGradient.
17
+ *
18
+ * When no gradient is provided, automatically creates an appropriate gradient:
19
+ * - For data crossing zero: Creates a diverging gradient with peak opacity at both extremes
20
+ * and baseline opacity at zero (or the specified baseline).
21
+ * - For all-positive or all-negative data: Creates a simple gradient from baseline to peak.
15
22
  */
16
23
  export const GradientArea = /*#__PURE__*/memo(_ref => {
17
24
  let {
18
25
  d,
19
26
  fill = 'var(--color-fgPrimary)',
20
27
  fillOpacity = 1,
21
- peakColor,
22
- baselineColor,
23
28
  peakOpacity = 0.3,
24
29
  baselineOpacity = 0,
25
30
  baseline,
26
- yAxisId
31
+ yAxisId,
32
+ gradient: gradientProp,
33
+ animate,
34
+ transition
27
35
  } = _ref,
28
36
  pathProps = _objectWithoutProperties(_ref, _excluded);
29
- const context = useCartesianChartContext();
37
+ const {
38
+ getYAxis
39
+ } = useCartesianChartContext();
30
40
  const patternId = useId();
31
-
32
- // Get the y-scale for the specified axis (or default)
33
- const yScale = context.getYScale(yAxisId);
34
- const yRange = yScale === null || yScale === void 0 ? void 0 : yScale.range();
35
- const yDomain = yScale === null || yScale === void 0 ? void 0 : yScale.domain();
36
-
37
- // Use chart range if available, otherwise fall back to percentage
38
- const useUserSpaceUnits = yRange !== undefined;
39
- const gradientY1 = useUserSpaceUnits ? yRange[1] : '0%';
40
- const gradientY2 = useUserSpaceUnits ? yRange[0] : '100%';
41
-
42
- // Auto-calculate baseline position based on domain
43
- let baselinePosition;
44
- let baselinePercentage;
45
- if (yScale && yDomain) {
46
- const [minValue, maxValue] = yDomain;
47
- let dataBaseline;
48
- if (minValue >= 0) {
49
- // All positive: baseline at min
50
- dataBaseline = minValue;
51
- } else if (maxValue <= 0) {
52
- // All negative: baseline at max
53
- dataBaseline = maxValue;
54
- } else {
55
- // Crosses zero: baseline at 0
56
- dataBaseline = 0;
57
- }
58
- if (useUserSpaceUnits) {
59
- // Get the actual y coordinate for the baseline
60
- const scaledValue = yScale(baseline !== null && baseline !== void 0 ? baseline : dataBaseline);
61
- if (typeof scaledValue === 'number') {
62
- baselinePosition = scaledValue;
63
- }
64
- } else {
65
- // Calculate percentage position
66
- baselinePercentage = "".concat((maxValue - (baseline !== null && baseline !== void 0 ? baseline : dataBaseline)) / (maxValue - minValue) * 100, "%");
67
- }
68
- }
69
- const effectivePeakColor = peakColor !== null && peakColor !== void 0 ? peakColor : fill;
70
- const effectiveBaselineColor = baselineColor !== null && baselineColor !== void 0 ? baselineColor : fill;
41
+ const yAxisConfig = getYAxis(yAxisId);
42
+ const gradient = useMemo(() => {
43
+ if (gradientProp) return gradientProp;
44
+ if (!yAxisConfig) return;
45
+ const baselineValue = getBaseline(yAxisConfig.domain, baseline);
46
+ return createGradient(yAxisConfig.domain, baselineValue, fill, peakOpacity, baselineOpacity);
47
+ }, [gradientProp, yAxisConfig, fill, baseline, peakOpacity, baselineOpacity]);
71
48
  return /*#__PURE__*/_jsxs(_Fragment, {
72
- children: [/*#__PURE__*/_jsx("defs", {
73
- children: /*#__PURE__*/_jsx("linearGradient", {
74
- gradientUnits: useUserSpaceUnits ? 'userSpaceOnUse' : 'objectBoundingBox',
49
+ children: [gradient && /*#__PURE__*/_jsx("defs", {
50
+ children: /*#__PURE__*/_jsx(Gradient, {
51
+ animate: animate,
52
+ gradient: gradient,
75
53
  id: patternId,
76
- x1: useUserSpaceUnits ? 0 : '0%',
77
- x2: useUserSpaceUnits ? 0 : '0%',
78
- y1: gradientY1,
79
- y2: gradientY2,
80
- children: baselinePosition !== undefined || baselinePercentage !== undefined ? /*#__PURE__*/_jsxs(_Fragment, {
81
- children: [/*#__PURE__*/_jsx("stop", {
82
- offset: "0%",
83
- stopColor: effectivePeakColor,
84
- stopOpacity: peakOpacity
85
- }), /*#__PURE__*/_jsx("stop", {
86
- offset: baselinePercentage !== null && baselinePercentage !== void 0 ? baselinePercentage : "".concat((baselinePosition - yRange[1]) / (yRange[0] - yRange[1]) * 100, "%"),
87
- stopColor: effectiveBaselineColor,
88
- stopOpacity: baselineOpacity
89
- }), /*#__PURE__*/_jsx("stop", {
90
- offset: "100%",
91
- stopColor: effectivePeakColor,
92
- stopOpacity: peakOpacity
93
- })]
94
- }) : /*#__PURE__*/_jsxs(_Fragment, {
95
- children: [/*#__PURE__*/_jsx("stop", {
96
- offset: "0%",
97
- stopColor: effectivePeakColor,
98
- stopOpacity: peakOpacity
99
- }), /*#__PURE__*/_jsx("stop", {
100
- offset: "100%",
101
- stopColor: effectiveBaselineColor,
102
- stopOpacity: baselineOpacity
103
- })]
104
- })
54
+ transition: transition,
55
+ yAxisId: yAxisId
105
56
  })
106
57
  }), /*#__PURE__*/_jsx(Path, _objectSpread({
58
+ animate: animate,
107
59
  d: d,
108
- fill: "url(#".concat(patternId, ")")
60
+ fill: gradient ? "url(#".concat(patternId, ")") : fill,
61
+ fillOpacity: fillOpacity,
62
+ transition: transition
109
63
  }, pathProps))]
110
64
  });
111
65
  });
@@ -1,4 +1,4 @@
1
- const _excluded = ["d", "fill", "fillOpacity", "yAxisId", "baseline"];
1
+ const _excluded = ["d", "fill", "fillOpacity", "yAxisId", "animate", "transition", "gradient"];
2
2
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
3
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
4
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
@@ -6,24 +6,42 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
6
6
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
7
  function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
8
8
  function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
9
- import { memo } from 'react';
9
+ import { memo, useId } from 'react';
10
+ import { Gradient } from '../gradient';
10
11
  import { Path } from '../Path';
11
- import { jsx as _jsx } from "react/jsx-runtime";
12
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
12
13
  /**
13
14
  * A customizable solid area component which uses Path.
15
+ * When a gradient is provided, renders with gradient fill.
16
+ * Otherwise, renders with solid fill.
14
17
  */
15
18
  export const SolidArea = /*#__PURE__*/memo(_ref => {
16
19
  let {
17
20
  d,
18
- fill,
21
+ fill = 'var(--color-fgPrimary)',
19
22
  fillOpacity = 1,
20
23
  yAxisId,
21
- baseline
24
+ animate,
25
+ transition,
26
+ gradient
22
27
  } = _ref,
23
- props = _objectWithoutProperties(_ref, _excluded);
24
- return /*#__PURE__*/_jsx(Path, _objectSpread({
25
- d: d,
26
- fill: fill,
27
- fillOpacity: fillOpacity
28
- }, props));
28
+ pathProps = _objectWithoutProperties(_ref, _excluded);
29
+ const patternId = useId();
30
+ return /*#__PURE__*/_jsxs(_Fragment, {
31
+ children: [gradient && /*#__PURE__*/_jsx("defs", {
32
+ children: /*#__PURE__*/_jsx(Gradient, {
33
+ animate: animate,
34
+ gradient: gradient,
35
+ id: patternId,
36
+ transition: transition,
37
+ yAxisId: yAxisId
38
+ })
39
+ }), /*#__PURE__*/_jsx(Path, _objectSpread({
40
+ animate: animate,
41
+ d: d,
42
+ fill: gradient ? "url(#".concat(patternId, ")") : fill,
43
+ fillOpacity: fillOpacity,
44
+ transition: transition
45
+ }, pathProps))]
46
+ });
29
47
  });
@@ -1,28 +1,7 @@
1
+ import { accessoryFadeTransitionDuration } from '../utils';
1
2
  export const axisLineStyles = "\n stroke: var(--color-fg);\n stroke-linecap: square;\n stroke-width: 1px;\n";
2
3
  export const axisTickMarkStyles = "\n stroke: var(--color-fg);\n stroke-linecap: square;\n stroke-width: 1px;\n";
3
4
 
4
- /**
5
- * Animation variants for grouped axis tick labels - initial mount
6
- */
7
- export const axisTickLabelsInitialAnimationVariants = {
8
- initial: {
9
- opacity: 0
10
- },
11
- animate: {
12
- opacity: 1,
13
- transition: {
14
- duration: 0.15,
15
- delay: 0.85 // Initial animation: wait 850ms then fade in over 150ms
16
- }
17
- },
18
- exit: {
19
- opacity: 0,
20
- transition: {
21
- duration: 0.15
22
- }
23
- }
24
- };
25
-
26
5
  /**
27
6
  * Animation variants for axis elements - updates (used for both grid lines and tick labels)
28
7
  */
@@ -33,14 +12,14 @@ export const axisUpdateAnimationVariants = {
33
12
  animate: {
34
13
  opacity: 1,
35
14
  transition: {
36
- duration: 0.15,
37
- delay: 0.15 // For updates: fade out 150ms, then fade in 150ms
15
+ duration: accessoryFadeTransitionDuration,
16
+ delay: accessoryFadeTransitionDuration
38
17
  }
39
18
  },
40
19
  exit: {
41
20
  opacity: 0,
42
21
  transition: {
43
- duration: 0.15
22
+ duration: accessoryFadeTransitionDuration
44
23
  }
45
24
  }
46
25
  };
@@ -0,0 +1,15 @@
1
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
2
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
3
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
4
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
5
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
6
+ import { memo } from 'react';
7
+ import { ChartText } from '../text';
8
+ import { jsx as _jsx } from "react/jsx-runtime";
9
+ /**
10
+ * DefaultAxisTickLabel is the default label component for axis tick labels.
11
+ * Provides standard styling for both X and Y axis tick labels.
12
+ */
13
+ export const DefaultAxisTickLabel = /*#__PURE__*/memo(props => {
14
+ return /*#__PURE__*/_jsx(ChartText, _objectSpread({}, props));
15
+ });
@@ -1,4 +1,4 @@
1
- const _excluded = ["position", "showGrid", "requestedTickCount", "ticks", "tickLabelFormatter", "style", "className", "styles", "classNames", "GridLineComponent", "tickMarkLabelGap", "height", "minTickLabelGap", "showTickMarks", "showLine", "tickMarkSize", "tickInterval", "tickMinStep", "tickMaxStep"];
1
+ const _excluded = ["position", "showGrid", "requestedTickCount", "ticks", "tickLabelFormatter", "TickLabelComponent", "style", "className", "styles", "classNames", "GridLineComponent", "LineComponent", "TickMarkLineComponent", "tickMarkLabelGap", "minTickLabelGap", "showTickMarks", "showLine", "tickMarkSize", "tickInterval", "tickMinStep", "tickMaxStep", "label", "labelGap", "height"];
2
2
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
3
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
4
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
@@ -12,10 +12,15 @@ import { AnimatePresence, m as motion } from 'framer-motion';
12
12
  import { useCartesianChartContext } from '../ChartProvider';
13
13
  import { DottedLine } from '../line/DottedLine';
14
14
  import { ReferenceLine } from '../line/ReferenceLine';
15
- import { SmartChartTextGroup } from '../text/SmartChartTextGroup';
16
- import { getAxisTicksData, isCategoricalScale } from '../utils';
17
- import { axisLineStyles, axisTickLabelsInitialAnimationVariants, axisTickMarkStyles, axisUpdateAnimationVariants } from './Axis';
15
+ import { SolidLine } from '../line/SolidLine';
16
+ import { ChartText } from '../text/ChartText';
17
+ import { ChartTextGroup } from '../text/ChartTextGroup';
18
+ import { getAxisTicksData, isCategoricalScale, lineToPath } from '../utils';
19
+ import { axisLineStyles, axisTickMarkStyles, axisUpdateAnimationVariants } from './Axis';
20
+ import { DefaultAxisTickLabel } from './DefaultAxisTickLabel';
18
21
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
22
+ const AXIS_HEIGHT = 32;
23
+ const LABEL_SIZE = 20;
19
24
  const axisTickMarkCss = "cds-axisTickMarkCss-a6j4s2q";
20
25
  const axisLineCss = "cds-axisLineCss-a12llxjj";
21
26
  export const XAxis = /*#__PURE__*/memo(_ref => {
@@ -25,20 +30,25 @@ export const XAxis = /*#__PURE__*/memo(_ref => {
25
30
  requestedTickCount,
26
31
  ticks,
27
32
  tickLabelFormatter,
33
+ TickLabelComponent = DefaultAxisTickLabel,
28
34
  style,
29
35
  className,
30
36
  styles,
31
37
  classNames,
32
38
  GridLineComponent = DottedLine,
39
+ LineComponent = SolidLine,
40
+ TickMarkLineComponent = SolidLine,
33
41
  tickMarkLabelGap = 2,
34
- height = 32,
35
42
  minTickLabelGap = 4,
36
43
  showTickMarks,
37
44
  showLine,
38
45
  tickMarkSize = 4,
39
46
  tickInterval = 32,
40
47
  tickMinStep = 1,
41
- tickMaxStep
48
+ tickMaxStep,
49
+ label,
50
+ labelGap = 4,
51
+ height = label ? AXIS_HEIGHT + LABEL_SIZE : AXIS_HEIGHT
42
52
  } = _ref,
43
53
  props = _objectWithoutProperties(_ref, _excluded);
44
54
  const registrationId = useId();
@@ -114,9 +124,10 @@ export const XAxis = /*#__PURE__*/memo(_ref => {
114
124
  if (!axisBounds) return null;
115
125
  return ticksData.map(tick => {
116
126
  const tickOffset = tickMarkLabelGap + (showTickMarks ? tickMarkSize : 0);
117
- const availableSpace = axisBounds.height - tickOffset;
127
+ const availableSpace = AXIS_HEIGHT - tickOffset;
118
128
  const labelOffset = availableSpace / 2;
119
- const labelY = position === 'top' ? axisBounds.y + labelOffset - tickOffset : axisBounds.y + labelOffset + tickOffset;
129
+ const baseY = position === 'top' && label ? axisBounds.y + LABEL_SIZE : axisBounds.y;
130
+ const labelY = position === 'top' ? baseY + labelOffset - tickOffset : baseY + labelOffset + tickOffset;
120
131
  return {
121
132
  x: tick.position,
122
133
  y: labelY,
@@ -130,8 +141,10 @@ export const XAxis = /*#__PURE__*/memo(_ref => {
130
141
  }
131
142
  };
132
143
  });
133
- }, [axisBounds, ticksData, tickMarkLabelGap, showTickMarks, tickMarkSize, position, formatTick, classNames === null || classNames === void 0 ? void 0 : classNames.tickLabel, styles === null || styles === void 0 ? void 0 : styles.tickLabel]);
134
- if (!xScale) return;
144
+ }, [axisBounds, ticksData, tickMarkLabelGap, showTickMarks, tickMarkSize, position, formatTick, classNames === null || classNames === void 0 ? void 0 : classNames.tickLabel, styles === null || styles === void 0 ? void 0 : styles.tickLabel, label]);
145
+ if (!xScale || !axisBounds) return;
146
+ const labelX = axisBounds.x + axisBounds.width / 2;
147
+ const labelY = position === 'bottom' ? axisBounds.y + axisBounds.height - LABEL_SIZE / 2 : axisBounds.y + LABEL_SIZE / 2;
135
148
  return /*#__PURE__*/_jsxs("g", _objectSpread(_objectSpread({
136
149
  className: cx(className, classNames === null || classNames === void 0 ? void 0 : classNames.root),
137
150
  "data-axis": "x",
@@ -155,40 +168,44 @@ export const XAxis = /*#__PURE__*/memo(_ref => {
155
168
  children: verticalLine
156
169
  }, "grid-".concat(tick.tick, "-").concat(index));
157
170
  })
158
- }), chartTextData && /*#__PURE__*/_jsx(AnimatePresence, {
159
- children: /*#__PURE__*/_jsx(motion.g, {
160
- animate: "animate",
161
- exit: "exit",
162
- initial: "initial",
163
- variants: animate ? axisTickLabelsInitialAnimationVariants : undefined,
164
- children: /*#__PURE__*/_jsx(SmartChartTextGroup, {
165
- prioritizeEndLabels: true,
166
- labels: chartTextData,
167
- minGap: minTickLabelGap
168
- })
169
- })
171
+ }), chartTextData && /*#__PURE__*/_jsx(ChartTextGroup, {
172
+ prioritizeEndLabels: true,
173
+ LabelComponent: TickLabelComponent,
174
+ labels: chartTextData,
175
+ minGap: minTickLabelGap
170
176
  }), axisBounds && showTickMarks && /*#__PURE__*/_jsx("g", {
171
177
  "data-testid": "tick-marks",
172
178
  children: ticksData.map((tick, index) => {
173
179
  const tickY = position === 'bottom' ? axisBounds.y : axisBounds.y + axisBounds.height;
174
- const tickMarkSizePixels = tickMarkSize;
175
- const tickY2 = position === 'bottom' ? axisBounds.y + tickMarkSizePixels : axisBounds.y + axisBounds.height - tickMarkSizePixels;
176
- return /*#__PURE__*/_jsx("line", {
180
+ const tickY2 = position === 'bottom' ? tickY + tickMarkSize : tickY - tickMarkSize;
181
+ return /*#__PURE__*/_jsx(TickMarkLineComponent, {
182
+ animate: false,
177
183
  className: cx(axisTickMarkCss, classNames === null || classNames === void 0 ? void 0 : classNames.tickMark),
178
- style: styles === null || styles === void 0 ? void 0 : styles.tickMark,
179
- x1: tick.position,
180
- x2: tick.position,
181
- y1: tickY,
182
- y2: tickY2
184
+ clipRect: null,
185
+ d: lineToPath(tick.position, tickY2, tick.position, tickY),
186
+ stroke: "var(--color-fg)",
187
+ strokeLinecap: "square",
188
+ strokeWidth: 1,
189
+ style: styles === null || styles === void 0 ? void 0 : styles.tickMark
183
190
  }, "tick-mark-".concat(tick.tick, "-").concat(index));
184
191
  })
185
- }), axisBounds && showLine && /*#__PURE__*/_jsx("line", {
192
+ }), showLine && /*#__PURE__*/_jsx(LineComponent, {
193
+ animate: false,
186
194
  className: cx(axisLineCss, classNames === null || classNames === void 0 ? void 0 : classNames.line),
187
- style: styles === null || styles === void 0 ? void 0 : styles.line,
188
- x1: axisBounds.x,
189
- x2: axisBounds.x + axisBounds.width,
190
- y1: position === 'bottom' ? axisBounds.y : axisBounds.y + axisBounds.height,
191
- y2: position === 'bottom' ? axisBounds.y : axisBounds.y + axisBounds.height
195
+ d: lineToPath(axisBounds.x, position === 'bottom' ? axisBounds.y : axisBounds.y + axisBounds.height, axisBounds.x + axisBounds.width, position === 'bottom' ? axisBounds.y : axisBounds.y + axisBounds.height),
196
+ stroke: "var(--color-fg)",
197
+ strokeLinecap: "square",
198
+ strokeWidth: 1,
199
+ style: styles === null || styles === void 0 ? void 0 : styles.line
200
+ }), label && /*#__PURE__*/_jsx(ChartText, {
201
+ disableRepositioning: true,
202
+ className: classNames === null || classNames === void 0 ? void 0 : classNames.label,
203
+ horizontalAlignment: "center",
204
+ style: styles === null || styles === void 0 ? void 0 : styles.label,
205
+ verticalAlignment: "middle",
206
+ x: labelX,
207
+ y: labelY,
208
+ children: label
192
209
  })]
193
210
  }));
194
211
  });
@@ -1,4 +1,4 @@
1
- const _excluded = ["axisId", "position", "showGrid", "requestedTickCount", "ticks", "tickLabelFormatter", "style", "className", "styles", "classNames", "GridLineComponent", "tickMarkLabelGap", "width", "minTickLabelGap", "showTickMarks", "showLine", "tickMarkSize", "tickInterval"];
1
+ const _excluded = ["axisId", "position", "showGrid", "requestedTickCount", "ticks", "tickLabelFormatter", "TickLabelComponent", "style", "className", "styles", "classNames", "GridLineComponent", "LineComponent", "TickMarkLineComponent", "tickMarkLabelGap", "minTickLabelGap", "showTickMarks", "showLine", "tickMarkSize", "tickInterval", "label", "labelGap", "width"];
2
2
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
3
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
4
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
@@ -12,10 +12,15 @@ import { AnimatePresence, m as motion } from 'framer-motion';
12
12
  import { useCartesianChartContext } from '../ChartProvider';
13
13
  import { DottedLine } from '../line/DottedLine';
14
14
  import { ReferenceLine } from '../line/ReferenceLine';
15
- import { SmartChartTextGroup } from '../text/SmartChartTextGroup';
16
- import { getAxisTicksData, isCategoricalScale } from '../utils';
17
- import { axisLineStyles, axisTickLabelsInitialAnimationVariants, axisTickMarkStyles, axisUpdateAnimationVariants } from './Axis';
15
+ import { SolidLine } from '../line/SolidLine';
16
+ import { ChartText } from '../text/ChartText';
17
+ import { ChartTextGroup } from '../text/ChartTextGroup';
18
+ import { getAxisTicksData, isCategoricalScale, lineToPath } from '../utils';
19
+ import { axisLineStyles, axisTickMarkStyles, axisUpdateAnimationVariants } from './Axis';
20
+ import { DefaultAxisTickLabel } from './DefaultAxisTickLabel';
18
21
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
22
+ const AXIS_WIDTH = 44;
23
+ const LABEL_SIZE = 20;
19
24
  const axisTickMarkCss = "cds-axisTickMarkCss-au2toz5";
20
25
  const axisLineCss = "cds-axisLineCss-akmofp5";
21
26
  export const YAxis = /*#__PURE__*/memo(_ref => {
@@ -26,18 +31,23 @@ export const YAxis = /*#__PURE__*/memo(_ref => {
26
31
  requestedTickCount,
27
32
  ticks,
28
33
  tickLabelFormatter,
34
+ TickLabelComponent = DefaultAxisTickLabel,
29
35
  style,
30
36
  className,
31
37
  styles,
32
38
  classNames,
33
39
  GridLineComponent = DottedLine,
40
+ LineComponent = SolidLine,
41
+ TickMarkLineComponent = SolidLine,
34
42
  tickMarkLabelGap = 8,
35
- width = 44,
36
43
  minTickLabelGap = 0,
37
44
  showTickMarks,
38
45
  showLine,
39
46
  tickMarkSize = 4,
40
- tickInterval
47
+ tickInterval,
48
+ label,
49
+ labelGap = 4,
50
+ width = label ? AXIS_WIDTH + LABEL_SIZE : AXIS_WIDTH
41
51
  } = _ref,
42
52
  props = _objectWithoutProperties(_ref, _excluded);
43
53
  const registrationId = useId();
@@ -118,7 +128,9 @@ export const YAxis = /*#__PURE__*/memo(_ref => {
118
128
  };
119
129
  });
120
130
  }, [axisBounds, ticksData, tickMarkLabelGap, showTickMarks, tickMarkSize, position, formatTick, classNames === null || classNames === void 0 ? void 0 : classNames.tickLabel, styles === null || styles === void 0 ? void 0 : styles.tickLabel]);
121
- if (!yScale) return;
131
+ if (!yScale || !axisBounds) return;
132
+ const labelX = position === 'left' ? axisBounds.x + LABEL_SIZE / 2 : axisBounds.x + axisBounds.width - LABEL_SIZE / 2;
133
+ const labelY = axisBounds.y + axisBounds.height / 2;
122
134
  return /*#__PURE__*/_jsxs("g", _objectSpread(_objectSpread({
123
135
  className: cx(className, classNames === null || classNames === void 0 ? void 0 : classNames.root),
124
136
  "data-axis": "y",
@@ -143,40 +155,51 @@ export const YAxis = /*#__PURE__*/memo(_ref => {
143
155
  children: horizontalLine
144
156
  }, "grid-".concat(tick.tick, "-").concat(index));
145
157
  })
146
- }), chartTextData && /*#__PURE__*/_jsx(AnimatePresence, {
147
- children: /*#__PURE__*/_jsx(motion.g, {
148
- animate: "animate",
149
- exit: "exit",
150
- initial: "initial",
151
- variants: animate ? axisTickLabelsInitialAnimationVariants : undefined,
152
- children: /*#__PURE__*/_jsx(SmartChartTextGroup, {
153
- prioritizeEndLabels: true,
154
- labels: chartTextData,
155
- minGap: minTickLabelGap
156
- })
157
- })
158
- }), axisBounds && showTickMarks && /*#__PURE__*/_jsx("g", {
158
+ }), chartTextData && /*#__PURE__*/_jsx(ChartTextGroup, {
159
+ prioritizeEndLabels: true,
160
+ LabelComponent: TickLabelComponent,
161
+ labels: chartTextData,
162
+ minGap: minTickLabelGap
163
+ }), showTickMarks && /*#__PURE__*/_jsx("g", {
159
164
  "data-testid": "tick-marks",
160
165
  children: ticksData.map((tick, index) => {
161
166
  const tickX = position === 'left' ? axisBounds.x + axisBounds.width : axisBounds.x;
162
167
  const tickMarkSizePixels = tickMarkSize;
163
168
  const tickX2 = position === 'left' ? axisBounds.x + axisBounds.width - tickMarkSizePixels : axisBounds.x + tickMarkSizePixels;
164
- return /*#__PURE__*/_jsx("line", {
169
+ return /*#__PURE__*/_jsx(TickMarkLineComponent, {
170
+ animate: false,
165
171
  className: cx(axisTickMarkCss, classNames === null || classNames === void 0 ? void 0 : classNames.tickMark),
166
- style: styles === null || styles === void 0 ? void 0 : styles.tickMark,
167
- x1: tickX,
168
- x2: tickX2,
169
- y1: tick.position,
170
- y2: tick.position
172
+ clipRect: null,
173
+ d: lineToPath(tickX, tick.position, tickX2, tick.position),
174
+ stroke: "var(--color-fg)",
175
+ strokeLinecap: "square",
176
+ strokeWidth: 1,
177
+ style: styles === null || styles === void 0 ? void 0 : styles.tickMark
171
178
  }, "tick-mark-".concat(tick.tick, "-").concat(index));
172
179
  })
173
- }), axisBounds && showLine && /*#__PURE__*/_jsx("line", {
180
+ }), showLine && /*#__PURE__*/_jsx(LineComponent, {
181
+ animate: false,
174
182
  className: cx(axisLineCss, classNames === null || classNames === void 0 ? void 0 : classNames.line),
175
- style: styles === null || styles === void 0 ? void 0 : styles.line,
176
- x1: position === 'left' ? axisBounds.x + axisBounds.width : axisBounds.x,
177
- x2: position === 'left' ? axisBounds.x + axisBounds.width : axisBounds.x,
178
- y1: axisBounds.y,
179
- y2: axisBounds.y + axisBounds.height
183
+ d: lineToPath(position === 'left' ? axisBounds.x + axisBounds.width : axisBounds.x, axisBounds.y, position === 'left' ? axisBounds.x + axisBounds.width : axisBounds.x, axisBounds.y + axisBounds.height),
184
+ stroke: "var(--color-fg)",
185
+ strokeLinecap: "square",
186
+ strokeWidth: 1,
187
+ style: styles === null || styles === void 0 ? void 0 : styles.line
188
+ }), label && /*#__PURE__*/_jsx("g", {
189
+ style: {
190
+ transformOrigin: "".concat(labelX, "px ").concat(labelY, "px"),
191
+ transform: "rotate(".concat(position === 'left' ? -90 : 90, "deg)")
192
+ },
193
+ children: /*#__PURE__*/_jsx(ChartText, {
194
+ disableRepositioning: true,
195
+ className: classNames === null || classNames === void 0 ? void 0 : classNames.label,
196
+ horizontalAlignment: "center",
197
+ style: styles === null || styles === void 0 ? void 0 : styles.label,
198
+ verticalAlignment: "middle",
199
+ x: labelX,
200
+ y: labelY,
201
+ children: label
202
+ })
180
203
  })]
181
204
  }));
182
205
  });
@@ -1,5 +1,6 @@
1
1
  // codegen:start {preset: barrel, include: ./*.tsx, exclude: ./__stories__/*.tsx}
2
2
  export * from './Axis';
3
+ export * from './DefaultAxisTickLabel';
3
4
  export * from './XAxis';
4
5
  export * from './YAxis';
5
6
  // codegen:end
@@ -30,7 +30,8 @@ export const Bar = /*#__PURE__*/memo(_ref => {
30
30
  strokeWidth,
31
31
  borderRadius = 4,
32
32
  roundTop = true,
33
- roundBottom = true
33
+ roundBottom = true,
34
+ transition
34
35
  } = _ref;
35
36
  const barPath = useMemo(() => {
36
37
  return getBarPath(x, y, width, height, borderRadius, roundTop, roundBottom);
@@ -52,6 +53,7 @@ export const Bar = /*#__PURE__*/memo(_ref => {
52
53
  roundTop: roundTop,
53
54
  stroke: stroke,
54
55
  strokeWidth: strokeWidth,
56
+ transition: transition,
55
57
  width: width,
56
58
  x: x,
57
59
  y: y