@coinbase/cds-mobile-visualization 3.4.0-beta.2 → 3.4.0-beta.20

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 (211) hide show
  1. package/CHANGELOG.md +122 -0
  2. package/dts/chart/CartesianChart.d.ts +92 -34
  3. package/dts/chart/CartesianChart.d.ts.map +1 -1
  4. package/dts/chart/ChartContextBridge.d.ts +28 -0
  5. package/dts/chart/ChartContextBridge.d.ts.map +1 -0
  6. package/dts/chart/ChartProvider.d.ts +3 -0
  7. package/dts/chart/ChartProvider.d.ts.map +1 -1
  8. package/dts/chart/Path.d.ts +97 -32
  9. package/dts/chart/Path.d.ts.map +1 -1
  10. package/dts/chart/PeriodSelector.d.ts +6 -13
  11. package/dts/chart/PeriodSelector.d.ts.map +1 -1
  12. package/dts/chart/area/Area.d.ts +39 -28
  13. package/dts/chart/area/Area.d.ts.map +1 -1
  14. package/dts/chart/area/AreaChart.d.ts +51 -10
  15. package/dts/chart/area/AreaChart.d.ts.map +1 -1
  16. package/dts/chart/area/DottedArea.d.ts +21 -2
  17. package/dts/chart/area/DottedArea.d.ts.map +1 -1
  18. package/dts/chart/area/GradientArea.d.ts +19 -13
  19. package/dts/chart/area/GradientArea.d.ts.map +1 -1
  20. package/dts/chart/area/SolidArea.d.ts +17 -2
  21. package/dts/chart/area/SolidArea.d.ts.map +1 -1
  22. package/dts/chart/axis/Axis.d.ts +86 -118
  23. package/dts/chart/axis/Axis.d.ts.map +1 -1
  24. package/dts/chart/axis/DefaultAxisTickLabel.d.ts +8 -0
  25. package/dts/chart/axis/DefaultAxisTickLabel.d.ts.map +1 -0
  26. package/dts/chart/axis/XAxis.d.ts +1 -1
  27. package/dts/chart/axis/XAxis.d.ts.map +1 -1
  28. package/dts/chart/axis/YAxis.d.ts +2 -2
  29. package/dts/chart/axis/YAxis.d.ts.map +1 -1
  30. package/dts/chart/axis/index.d.ts +1 -0
  31. package/dts/chart/axis/index.d.ts.map +1 -1
  32. package/dts/chart/bar/Bar.d.ts +49 -12
  33. package/dts/chart/bar/Bar.d.ts.map +1 -1
  34. package/dts/chart/bar/BarChart.d.ts +40 -19
  35. package/dts/chart/bar/BarChart.d.ts.map +1 -1
  36. package/dts/chart/bar/BarPlot.d.ts +3 -1
  37. package/dts/chart/bar/BarPlot.d.ts.map +1 -1
  38. package/dts/chart/bar/BarStack.d.ts +41 -46
  39. package/dts/chart/bar/BarStack.d.ts.map +1 -1
  40. package/dts/chart/bar/BarStackGroup.d.ts +2 -0
  41. package/dts/chart/bar/BarStackGroup.d.ts.map +1 -1
  42. package/dts/chart/bar/DefaultBar.d.ts +1 -1
  43. package/dts/chart/bar/DefaultBar.d.ts.map +1 -1
  44. package/dts/chart/bar/DefaultBarStack.d.ts.map +1 -1
  45. package/dts/chart/gradient/Gradient.d.ts +25 -0
  46. package/dts/chart/gradient/Gradient.d.ts.map +1 -0
  47. package/dts/chart/gradient/index.d.ts +2 -0
  48. package/dts/chart/gradient/index.d.ts.map +1 -0
  49. package/dts/chart/index.d.ts +4 -1
  50. package/dts/chart/index.d.ts.map +1 -1
  51. package/dts/chart/legend/DefaultLegendEntry.d.ts +5 -0
  52. package/dts/chart/legend/DefaultLegendEntry.d.ts.map +1 -0
  53. package/dts/chart/legend/DefaultLegendShape.d.ts +5 -0
  54. package/dts/chart/legend/DefaultLegendShape.d.ts.map +1 -0
  55. package/dts/chart/legend/Legend.d.ts +168 -0
  56. package/dts/chart/legend/Legend.d.ts.map +1 -0
  57. package/dts/chart/legend/index.d.ts +4 -0
  58. package/dts/chart/legend/index.d.ts.map +1 -0
  59. package/dts/chart/line/DefaultReferenceLineLabel.d.ts +9 -0
  60. package/dts/chart/line/DefaultReferenceLineLabel.d.ts.map +1 -0
  61. package/dts/chart/line/DottedLine.d.ts +13 -5
  62. package/dts/chart/line/DottedLine.d.ts.map +1 -1
  63. package/dts/chart/line/Line.d.ts +61 -27
  64. package/dts/chart/line/Line.d.ts.map +1 -1
  65. package/dts/chart/line/LineChart.d.ts +43 -9
  66. package/dts/chart/line/LineChart.d.ts.map +1 -1
  67. package/dts/chart/line/ReferenceLine.d.ts +68 -20
  68. package/dts/chart/line/ReferenceLine.d.ts.map +1 -1
  69. package/dts/chart/line/SolidLine.d.ts +8 -5
  70. package/dts/chart/line/SolidLine.d.ts.map +1 -1
  71. package/dts/chart/line/index.d.ts +1 -1
  72. package/dts/chart/line/index.d.ts.map +1 -1
  73. package/dts/chart/point/DefaultPointLabel.d.ts +10 -0
  74. package/dts/chart/point/DefaultPointLabel.d.ts.map +1 -0
  75. package/dts/chart/point/Point.d.ts +136 -0
  76. package/dts/chart/point/Point.d.ts.map +1 -0
  77. package/dts/chart/point/index.d.ts +3 -0
  78. package/dts/chart/point/index.d.ts.map +1 -0
  79. package/dts/chart/scrubber/DefaultScrubberBeacon.d.ts +38 -0
  80. package/dts/chart/scrubber/DefaultScrubberBeacon.d.ts.map +1 -0
  81. package/dts/chart/scrubber/DefaultScrubberBeaconLabel.d.ts +12 -0
  82. package/dts/chart/scrubber/DefaultScrubberBeaconLabel.d.ts.map +1 -0
  83. package/dts/chart/scrubber/DefaultScrubberLabel.d.ts +11 -0
  84. package/dts/chart/scrubber/DefaultScrubberLabel.d.ts.map +1 -0
  85. package/dts/chart/scrubber/Scrubber.d.ts +230 -42
  86. package/dts/chart/scrubber/Scrubber.d.ts.map +1 -1
  87. package/dts/chart/scrubber/ScrubberBeaconGroup.d.ts +54 -0
  88. package/dts/chart/scrubber/ScrubberBeaconGroup.d.ts.map +1 -0
  89. package/dts/chart/scrubber/ScrubberBeaconLabelGroup.d.ts +46 -0
  90. package/dts/chart/scrubber/ScrubberBeaconLabelGroup.d.ts.map +1 -0
  91. package/dts/chart/scrubber/ScrubberProvider.d.ts +6 -3
  92. package/dts/chart/scrubber/ScrubberProvider.d.ts.map +1 -1
  93. package/dts/chart/scrubber/index.d.ts +3 -0
  94. package/dts/chart/scrubber/index.d.ts.map +1 -1
  95. package/dts/chart/text/ChartText.d.ts +151 -77
  96. package/dts/chart/text/ChartText.d.ts.map +1 -1
  97. package/dts/chart/text/{SmartChartTextGroup.d.ts → ChartTextGroup.d.ts} +9 -3
  98. package/dts/chart/text/ChartTextGroup.d.ts.map +1 -0
  99. package/dts/chart/text/index.d.ts +1 -1
  100. package/dts/chart/text/index.d.ts.map +1 -1
  101. package/dts/chart/utils/axis.d.ts +25 -1
  102. package/dts/chart/utils/axis.d.ts.map +1 -1
  103. package/dts/chart/utils/bar.d.ts +34 -0
  104. package/dts/chart/utils/bar.d.ts.map +1 -1
  105. package/dts/chart/utils/chart.d.ts +52 -7
  106. package/dts/chart/utils/chart.d.ts.map +1 -1
  107. package/dts/chart/utils/context.d.ts +28 -7
  108. package/dts/chart/utils/context.d.ts.map +1 -1
  109. package/dts/chart/utils/gradient.d.ts +117 -0
  110. package/dts/chart/utils/gradient.d.ts.map +1 -0
  111. package/dts/chart/utils/index.d.ts +3 -0
  112. package/dts/chart/utils/index.d.ts.map +1 -1
  113. package/dts/chart/utils/path.d.ts +59 -0
  114. package/dts/chart/utils/path.d.ts.map +1 -1
  115. package/dts/chart/utils/point.d.ts +71 -7
  116. package/dts/chart/utils/point.d.ts.map +1 -1
  117. package/dts/chart/utils/scale.d.ts +102 -0
  118. package/dts/chart/utils/scale.d.ts.map +1 -1
  119. package/dts/chart/utils/scrubber.d.ts +40 -0
  120. package/dts/chart/utils/scrubber.d.ts.map +1 -0
  121. package/dts/chart/utils/transition.d.ts +178 -0
  122. package/dts/chart/utils/transition.d.ts.map +1 -0
  123. package/esm/chart/CartesianChart.js +199 -75
  124. package/esm/chart/ChartContextBridge.js +159 -0
  125. package/esm/chart/ChartProvider.js +2 -2
  126. package/esm/chart/Path.js +200 -114
  127. package/esm/chart/PeriodSelector.js +7 -3
  128. package/esm/chart/__stories__/CartesianChart.stories.js +307 -134
  129. package/esm/chart/__stories__/ChartTransitions.stories.js +629 -0
  130. package/esm/chart/__stories__/PeriodSelector.stories.js +201 -75
  131. package/esm/chart/area/Area.js +27 -35
  132. package/esm/chart/area/AreaChart.js +17 -12
  133. package/esm/chart/area/DottedArea.js +64 -108
  134. package/esm/chart/area/GradientArea.js +37 -91
  135. package/esm/chart/area/SolidArea.js +24 -8
  136. package/esm/chart/area/__stories__/AreaChart.stories.js +1 -1
  137. package/esm/chart/axis/Axis.js +5 -39
  138. package/esm/chart/axis/DefaultAxisTickLabel.js +11 -0
  139. package/esm/chart/axis/XAxis.js +148 -66
  140. package/esm/chart/axis/YAxis.js +149 -65
  141. package/esm/chart/axis/__stories__/Axis.stories.js +259 -1
  142. package/esm/chart/axis/index.js +1 -0
  143. package/esm/chart/bar/Bar.js +7 -1
  144. package/esm/chart/bar/BarChart.js +17 -37
  145. package/esm/chart/bar/BarPlot.js +43 -35
  146. package/esm/chart/bar/BarStack.js +84 -37
  147. package/esm/chart/bar/BarStackGroup.js +7 -17
  148. package/esm/chart/bar/DefaultBar.js +29 -51
  149. package/esm/chart/bar/DefaultBarStack.js +34 -58
  150. package/esm/chart/bar/__stories__/BarChart.stories.js +948 -88
  151. package/esm/chart/gradient/Gradient.js +53 -0
  152. package/esm/chart/gradient/index.js +1 -0
  153. package/esm/chart/index.js +4 -1
  154. package/esm/chart/legend/DefaultLegendEntry.js +42 -0
  155. package/esm/chart/legend/DefaultLegendShape.js +64 -0
  156. package/esm/chart/legend/Legend.js +59 -0
  157. package/esm/chart/legend/__stories__/Legend.stories.js +574 -0
  158. package/esm/chart/legend/index.js +3 -0
  159. package/esm/chart/line/DefaultReferenceLineLabel.js +66 -0
  160. package/esm/chart/line/DottedLine.js +31 -14
  161. package/esm/chart/line/Line.js +96 -68
  162. package/esm/chart/line/LineChart.js +21 -14
  163. package/esm/chart/line/ReferenceLine.js +80 -63
  164. package/esm/chart/line/SolidLine.js +27 -10
  165. package/esm/chart/line/__stories__/LineChart.stories.js +1748 -2048
  166. package/esm/chart/line/__stories__/ReferenceLine.stories.js +177 -28
  167. package/esm/chart/line/index.js +1 -1
  168. package/esm/chart/point/DefaultPointLabel.js +39 -0
  169. package/esm/chart/point/Point.js +186 -0
  170. package/esm/chart/point/index.js +2 -0
  171. package/esm/chart/scrubber/DefaultScrubberBeacon.js +180 -0
  172. package/esm/chart/scrubber/DefaultScrubberBeaconLabel.js +43 -0
  173. package/esm/chart/scrubber/DefaultScrubberLabel.js +28 -0
  174. package/esm/chart/scrubber/Scrubber.js +130 -144
  175. package/esm/chart/scrubber/ScrubberBeaconGroup.js +165 -0
  176. package/esm/chart/scrubber/ScrubberBeaconLabelGroup.js +208 -0
  177. package/esm/chart/scrubber/ScrubberProvider.js +46 -54
  178. package/esm/chart/scrubber/__stories__/Scrubber.stories.js +760 -0
  179. package/esm/chart/scrubber/index.js +3 -1
  180. package/esm/chart/text/ChartText.js +242 -174
  181. package/esm/chart/text/{SmartChartTextGroup.js → ChartTextGroup.js} +6 -5
  182. package/esm/chart/text/index.js +1 -1
  183. package/esm/chart/utils/axis.js +47 -31
  184. package/esm/chart/utils/bar.js +43 -0
  185. package/esm/chart/utils/chart.js +57 -3
  186. package/esm/chart/utils/gradient.js +305 -0
  187. package/esm/chart/utils/index.js +3 -0
  188. package/esm/chart/utils/path.js +84 -8
  189. package/esm/chart/utils/point.js +171 -17
  190. package/esm/chart/utils/scale.js +242 -2
  191. package/esm/chart/utils/scrubber.js +146 -0
  192. package/esm/chart/utils/transition.js +220 -0
  193. package/esm/sparkline/__figma__/Sparkline.figma.js +1 -1
  194. package/esm/sparkline/__stories__/Sparkline.stories.js +11 -7
  195. package/esm/sparkline/__stories__/SparklineGradient.stories.js +7 -4
  196. package/esm/sparkline/sparkline-interactive/__figma__/SparklineInteractive.figma.js +1 -1
  197. package/esm/sparkline/sparkline-interactive/__stories__/SparklineInteractive.stories.js +51 -26
  198. package/esm/sparkline/sparkline-interactive-header/__figma__/SparklineInteractiveHeader.figma.js +1 -1
  199. package/esm/sparkline/sparkline-interactive-header/__stories__/SparklineInteractiveHeader.stories.js +17 -9
  200. package/package.json +15 -10
  201. package/dts/chart/Point.d.ts +0 -103
  202. package/dts/chart/Point.d.ts.map +0 -1
  203. package/dts/chart/line/GradientLine.d.ts +0 -45
  204. package/dts/chart/line/GradientLine.d.ts.map +0 -1
  205. package/dts/chart/scrubber/ScrubberBeacon.d.ts +0 -75
  206. package/dts/chart/scrubber/ScrubberBeacon.d.ts.map +0 -1
  207. package/dts/chart/text/SmartChartTextGroup.d.ts.map +0 -1
  208. package/esm/chart/Point.js +0 -111
  209. package/esm/chart/__stories__/Chart.stories.js +0 -79
  210. package/esm/chart/line/GradientLine.js +0 -62
  211. package/esm/chart/scrubber/ScrubberBeacon.js +0 -199
package/CHANGELOG.md CHANGED
@@ -8,6 +8,128 @@ All notable changes to this project will be documented in this file.
8
8
 
9
9
  <!-- template-start -->
10
10
 
11
+ ## 3.4.0-beta.20 (2/27/2026 PST)
12
+
13
+ #### 🚀 Updates
14
+
15
+ - Add styles props to PeriodSelector. [[#438](https://github.com/coinbase/cds/pull/438/)]
16
+
17
+ #### 📘 Misc
18
+
19
+ - Update outdated doc links. [[#440](https://github.com/coinbase/cds/pull/440)]
20
+
21
+ ## 3.4.0-beta.19 (2/20/2026 PST)
22
+
23
+ #### 🚀 Updates
24
+
25
+ - Support custom enter transitions [[#400](https://github.com/coinbase/cds/pull/400/)]
26
+
27
+ ## 3.4.0-beta.18 (2/6/2026 PST)
28
+
29
+ #### 🚀 Updates
30
+
31
+ - Fix line chart enter animations not properly syncing with scrubber. [[#374](https://github.com/coinbase/cds/pull/374)]
32
+
33
+ ## 3.4.0-beta.17 (2/4/2026 PST)
34
+
35
+ #### 🚀 Updates
36
+
37
+ - Add support preferred side for scrubber beacon label group. [[#366](https://github.com/coinbase/cds/pull/366)]
38
+
39
+ ## 3.4.0-beta.16 (1/28/2026 PST)
40
+
41
+ #### 🐞 Fixes
42
+
43
+ - Fix every context rendering a second time in CDS Chart for performance. [[#339](https://github.com/avocado-cb/cds/pull/339)] [DEX2-874]
44
+
45
+ ## 3.4.0-beta.15 (1/27/2026 PST)
46
+
47
+ #### 🐞 Fixes
48
+
49
+ - Fix padding on PeriodSelector. [[#330](https://github.com/coinbase/cds/pull/330)]
50
+
51
+ ## 3.4.0-beta.14 (1/22/2026 PST)
52
+
53
+ #### 🚀 Updates
54
+
55
+ - Add chart Legend component. [[#302](https://github.com/coinbase/cds/pull/302)]
56
+ - Add support for hideBeaconLabels in Scrubber. [[#302](https://github.com/coinbase/cds/pull/302)]
57
+ - Add support for custom bar components. [[#302](https://github.com/coinbase/cds/pull/302)]
58
+
59
+ ## 3.4.0-beta.13 (1/20/2026 PST)
60
+
61
+ #### 🚀 Updates
62
+
63
+ - Feat: support styling default scrubber beacon. [[#315](https://github.com/coinbase/cds/pull/315)]
64
+ - Fix: idlePulse works on mobile even when Chart animation is off, matching web. [[#315](https://github.com/coinbase/cds/pull/315)]
65
+
66
+ #### 📘 Misc
67
+
68
+ - Internal: code connect file lint fixes. [[#311](https://github.com/coinbase/cds/pull/311)]
69
+ - Internal: update figma code connect config and some mapping files. [[#304](https://github.com/coinbase/cds/pull/304)]
70
+
71
+ ## 3.4.0-beta.12 (1/8/2026 PST)
72
+
73
+ #### 🐞 Fixes
74
+
75
+ - Fix pulse with spread operator broken on new react-native architecture. [[#296](https://github.com/coinbase/cds/pull/296)]
76
+
77
+ ## 3.4.0-beta.11 (1/7/2026 PST)
78
+
79
+ #### 🐞 Fixes
80
+
81
+ - Allow customization of axis tick mark and grid line alignment in band scale. [[#291](https://github.com/coinbase/cds/pull/291)]
82
+
83
+ ## 3.4.0-beta.10 (1/6/2026 PST)
84
+
85
+ #### 🐞 Fixes
86
+
87
+ - Fix axis clip line issues when multiple axes are present on one side. [[#285](https://github.com/coinbase/cds/pull/285)]
88
+
89
+ ## 3.4.0-beta.9 (12/18/2025 PST)
90
+
91
+ #### 🐞 Fixes
92
+
93
+ - Fix: update package exports. [[#261](https://github.com/coinbase/cds/pull/261)]
94
+
95
+ #### 📘 Misc
96
+
97
+ - Update storybook to use new Text import. [[#238](https://github.com/coinbase/cds/pull/238)]
98
+
99
+ ## 3.4.0-beta.8 (12/2/2025 PST)
100
+
101
+ #### 🐞 Fixes
102
+
103
+ - Fix reanimated animation warning. [[#211](https://github.com/coinbase/cds/pull/211)]
104
+
105
+ ## 3.4.0-beta.7 (12/2/2025 PST)
106
+
107
+ #### 🐞 Fixes
108
+
109
+ - Fix babel build issue with transitions. [[#201](https://github.com/coinbase/cds/pull/201)]
110
+ - Improve opacity customization for ReferenceLine. [[#201](https://github.com/coinbase/cds/pull/201)]
111
+
112
+ ## 3.4.0-beta.6 (10/16/2025 PST)
113
+
114
+ #### 🚀 Updates
115
+
116
+ - Support connecting null values in Area and Line
117
+ - Added label to XAxis and YAxis
118
+ - Switched charts to @shopify/react-native-skia
119
+ - Added gradient support
120
+
121
+ ## 3.4.0-beta.5 (11/4/2025 PST)
122
+
123
+ This is an artificial version bump with no new change.
124
+
125
+ ## 3.4.0-beta.4 (10/27/2025 PST)
126
+
127
+ This is an artificial version bump with no new change.
128
+
129
+ ## 3.4.0-beta.3 (10/6/2025 PST)
130
+
131
+ This is an artificial version bump with no new change.
132
+
11
133
  ## 3.4.0-beta.2 (10/6/2025 PST)
12
134
 
13
135
  This is an artificial version bump with no new change.
@@ -1,9 +1,10 @@
1
1
  import React from 'react';
2
- import { type View, type ViewStyle } from 'react-native';
2
+ import { type StyleProp, type View, type ViewStyle } from 'react-native';
3
3
  import type { BoxBaseProps, BoxProps } from '@coinbase/cds-mobile/layout';
4
+ import { type SkTypefaceFontProvider } from '@shopify/react-native-skia';
4
5
  import { type ScrubberProviderProps } from './scrubber/ScrubberProvider';
5
- import { type AxisConfigProps, type ChartInset, type Series } from './utils';
6
- export type CartesianChartBaseProps = BoxBaseProps &
6
+ import { type AxisConfigProps, type ChartInset, type LegendPosition, type Series } from './utils';
7
+ export type CartesianChartBaseProps = Omit<BoxBaseProps, 'fontFamily'> &
7
8
  Pick<ScrubberProviderProps, 'enableScrubbing' | 'onScrubberPositionChange'> & {
8
9
  /**
9
10
  * Configuration objects that define how to visualize the data.
@@ -21,47 +22,67 @@ export type CartesianChartBaseProps = BoxBaseProps &
21
22
  xAxis?: Partial<Omit<AxisConfigProps, 'id'>>;
22
23
  /**
23
24
  * Configuration for y-axis(es). Can be a single config or array of configs.
24
- * If array, first axis becomes default if no id is specified.
25
25
  */
26
26
  yAxis?: Partial<AxisConfigProps> | Partial<AxisConfigProps>[];
27
27
  /**
28
28
  * Inset around the entire chart (outside the axes).
29
29
  */
30
30
  inset?: number | Partial<ChartInset>;
31
+ /**
32
+ * Whether to show the legend or a custom legend element.
33
+ * - `true` renders the default Legend component
34
+ * - A React element renders that element as the legend
35
+ * - `false` or omitted hides the legend
36
+ */
37
+ legend?: boolean | React.ReactNode;
38
+ /**
39
+ * Position of the legend relative to the chart.
40
+ * @default 'bottom'
41
+ */
42
+ legendPosition?: LegendPosition;
43
+ /**
44
+ * Accessibility label for the legend group.
45
+ * @default 'Legend'
46
+ */
47
+ legendAccessibilityLabel?: string;
31
48
  };
32
49
  export type CartesianChartProps = CartesianChartBaseProps &
33
50
  Pick<ScrubberProviderProps, 'allowOverflowGestures'> &
34
- BoxProps & {
51
+ Omit<BoxProps, 'fontFamily'> & {
52
+ /**
53
+ * Default font families to use within ChartText.
54
+ * If not provided, will be the default for the system.
55
+ * @example
56
+ * ['Helvetica', 'sans-serif']
57
+ */
58
+ fontFamilies?: string[];
59
+ /**
60
+ * Skia font provider to allow for custom fonts.
61
+ * If not provided, the only available fonts will be those defined by the system.
62
+ */
63
+ fontProvider?: SkTypefaceFontProvider;
35
64
  /**
36
- * Chart width. If not provided, will use the container's measured width.
65
+ * Custom styles for the root element.
37
66
  */
38
- width?: number | string;
67
+ style?: StyleProp<ViewStyle>;
39
68
  /**
40
- * Chart height. If not provided, will use the container's measured height.
69
+ * Custom styles for the component.
41
70
  */
42
- height?: number | string;
71
+ styles?: {
72
+ /**
73
+ * Custom styles for the root element.
74
+ */
75
+ root?: StyleProp<ViewStyle>;
76
+ /**
77
+ * Custom styles for the chart canvas element.
78
+ */
79
+ chart?: StyleProp<ViewStyle>;
80
+ };
43
81
  };
44
82
  export declare const CartesianChart: React.MemoExoticComponent<
45
83
  React.ForwardRefExoticComponent<
46
- import('@coinbase/cds-mobile/styles/styleProps').StyleProps & {
47
- children?: React.ReactNode;
48
- style?: import('react-native').Animated.WithAnimatedValue<
49
- import('react-native').StyleProp<ViewStyle>
50
- >;
51
- animated?: boolean;
52
- elevation?: import('@coinbase/cds-common').ElevationLevels;
53
- font?: import('@coinbase/cds-common').ThemeVars.FontFamily | 'inherit';
54
- pin?: import('@coinbase/cds-common').PinningDirection;
55
- bordered?: boolean;
56
- borderedTop?: boolean;
57
- borderedBottom?: boolean;
58
- borderedStart?: boolean;
59
- borderedEnd?: boolean;
60
- borderedHorizontal?: boolean;
61
- borderedVertical?: boolean;
62
- dangerouslySetBackground?: string;
63
- testID?: string;
64
- } & Pick<ScrubberProviderProps, 'enableScrubbing' | 'onScrubberPositionChange'> & {
84
+ Omit<BoxBaseProps, 'fontFamily'> &
85
+ Pick<ScrubberProviderProps, 'enableScrubbing' | 'onScrubberPositionChange'> & {
65
86
  /**
66
87
  * Configuration objects that define how to visualize the data.
67
88
  * Each series contains its own data array.
@@ -78,23 +99,60 @@ export declare const CartesianChart: React.MemoExoticComponent<
78
99
  xAxis?: Partial<Omit<AxisConfigProps, 'id'>>;
79
100
  /**
80
101
  * Configuration for y-axis(es). Can be a single config or array of configs.
81
- * If array, first axis becomes default if no id is specified.
82
102
  */
83
103
  yAxis?: Partial<AxisConfigProps> | Partial<AxisConfigProps>[];
84
104
  /**
85
105
  * Inset around the entire chart (outside the axes).
86
106
  */
87
107
  inset?: number | Partial<ChartInset>;
108
+ /**
109
+ * Whether to show the legend or a custom legend element.
110
+ * - `true` renders the default Legend component
111
+ * - A React element renders that element as the legend
112
+ * - `false` or omitted hides the legend
113
+ */
114
+ legend?: boolean | React.ReactNode;
115
+ /**
116
+ * Position of the legend relative to the chart.
117
+ * @default 'bottom'
118
+ */
119
+ legendPosition?: LegendPosition;
120
+ /**
121
+ * Accessibility label for the legend group.
122
+ * @default 'Legend'
123
+ */
124
+ legendAccessibilityLabel?: string;
88
125
  } & Pick<ScrubberProviderProps, 'allowOverflowGestures'> &
89
- Omit<import('react-native').ViewProps, 'style'> & {
126
+ Omit<BoxProps, 'fontFamily'> & {
127
+ /**
128
+ * Default font families to use within ChartText.
129
+ * If not provided, will be the default for the system.
130
+ * @example
131
+ * ['Helvetica', 'sans-serif']
132
+ */
133
+ fontFamilies?: string[];
134
+ /**
135
+ * Skia font provider to allow for custom fonts.
136
+ * If not provided, the only available fonts will be those defined by the system.
137
+ */
138
+ fontProvider?: SkTypefaceFontProvider;
90
139
  /**
91
- * Chart width. If not provided, will use the container's measured width.
140
+ * Custom styles for the root element.
92
141
  */
93
- width?: number | string;
142
+ style?: StyleProp<ViewStyle>;
94
143
  /**
95
- * Chart height. If not provided, will use the container's measured height.
144
+ * Custom styles for the component.
96
145
  */
97
- height?: number | string;
146
+ styles?: {
147
+ /**
148
+ * Custom styles for the root element.
149
+ */
150
+ root?: StyleProp<ViewStyle>;
151
+ /**
152
+ * Custom styles for the chart canvas element.
153
+ */
154
+ chart?: StyleProp<ViewStyle>;
155
+ };
98
156
  } & React.RefAttributes<View>
99
157
  >
100
158
  >;
@@ -1 +1 @@
1
- {"version":3,"file":"CartesianChart.d.ts","sourceRoot":"","sources":["../../src/chart/CartesianChart.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiD,MAAM,OAAO,CAAC;AACtE,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAIzD,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAG1E,OAAO,EAAoB,KAAK,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAE3F,OAAO,EAEL,KAAK,eAAe,EAEpB,KAAK,UAAU,EAUf,KAAK,MAAM,E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3
+ * Adapted from its-fine to enable context sharing across React renderers
4
+ * https://github.com/pmndrs/its-fine/blob/598b81f02778c22ed21121c2b1a786bdefb14e23/src/index.tsx
5
+ */
6
+ import * as React from 'react';
7
+ /**
8
+ * A react-internal tree node provider that binds React children to the React tree for chart context bridging.
9
+ */
10
+ export declare class ChartBridgeProvider extends React.Component<{
11
+ children?: React.ReactNode;
12
+ }> {
13
+ private _reactInternals;
14
+ render(): import('react/jsx-runtime').JSX.Element;
15
+ }
16
+ export type ContextMap = Map<React.Context<any>, any> & {
17
+ get<T>(context: React.Context<T>): T | undefined;
18
+ };
19
+ /**
20
+ * Represents a chart context bridge provider component.
21
+ */
22
+ export type ChartContextBridge = React.FC<React.PropsWithChildren<object>>;
23
+ /**
24
+ * Returns a ChartContextBridge of live context providers to pierce Context across renderers.
25
+ * Pass ChartContextBridge as a component to a secondary renderer (e.g., Skia Canvas) to enable context-sharing in charts.
26
+ */
27
+ export declare function useChartContextBridge(): ChartContextBridge;
28
+ //# sourceMappingURL=ChartContextBridge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChartContextBridge.d.ts","sourceRoot":"","sources":["../../src/chart/ChartContextBridge.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAuF/B;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,KAAK,CAAC,SAAS,CAAC;IAAE,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,CAAC;IACtF,OAAO,CAAC,eAAe,CAAY;IAEnC,MAAM;CAOP;AA4BD,MAAM,MAAM,UAAU,GAAG,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,GAAG;IACtD,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC;CAClD,CAAC;AAmCF;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC;AAE3E;;;GAGG;AACH,wBAAgB,qBAAqB,IAAI,kBAAkB,CAgB1D"}
@@ -1,4 +1,7 @@
1
1
  import type { CartesianChartContextValue } from './utils';
2
+ export declare const CartesianChartContext: import('react').Context<
3
+ CartesianChartContextValue | undefined
4
+ >;
2
5
  export declare const useCartesianChartContext: () => CartesianChartContextValue;
3
6
  export declare const CartesianChartProvider: import('react').Provider<
4
7
  CartesianChartContextValue | undefined
@@ -1 +1 @@
1
- {"version":3,"file":"ChartProvider.d.ts","sourceRoot":"","sources":["../../src/chart/ChartProvider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAC;AAI1D,eAAO,MAAM,wBAAwB,QAAO,0BAQ3C,CAAC;AAEF,eAAO,MAAM,sBAAsB,kEAAiC,CAAC"}
1
+ {"version":3,"file":"ChartProvider.d.ts","sourceRoot":"","sources":["../../src/chart/ChartProvider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAC;AAE1D,eAAO,MAAM,qBAAqB,iEAEjC,CAAC;AAEF,eAAO,MAAM,wBAAwB,QAAO,0BAQ3C,CAAC;AAEF,eAAO,MAAM,sBAAsB,kEAAiC,CAAC"}
@@ -1,48 +1,113 @@
1
- import { type PathProps as SvgPathProps } from 'react-native-svg';
2
- import type { Rect as RectType, SharedProps } from '@coinbase/cds-common/types';
3
- export type PathProps = SharedProps &
4
- SvgPathProps & {
1
+ import type { Rect } from '@coinbase/cds-common/types';
2
+ import { type AnimatedProp, type PathProps as SkiaPathProps } from '@shopify/react-native-skia';
3
+ import { type Transition } from './utils/transition';
4
+ /**
5
+ * Duration in milliseconds for path enter transition.
6
+ */
7
+ export declare const pathEnterTransitionDuration = 500;
8
+ export type PathBaseProps = {
9
+ /**
10
+ * Whether to animate this path. Overrides the animate prop on the Chart component.
11
+ */
12
+ animate?: boolean;
13
+ /**
14
+ * Initial path for enter animation.
15
+ * When provided, the first animation will go from initialPath to d.
16
+ * If not provided, defaults to d (no enter animation).
17
+ */
18
+ initialPath?: string;
19
+ /**
20
+ * Fill color for the path.
21
+ * When provided, will render a fill with the given color.
22
+ * If not provided, will not render a fill.
23
+ */
24
+ fill?: string;
25
+ /**
26
+ * Opacity for the path fill.
27
+ */
28
+ fillOpacity?: number;
29
+ /**
30
+ * Stroke color for the path.
31
+ * When provided, will render a fill with the given color.
32
+ * If not provided, will not render a fill.
33
+ */
34
+ stroke?: string;
35
+ /**
36
+ * Opacity for the path stroke.
37
+ */
38
+ strokeOpacity?: AnimatedProp<number>;
39
+ };
40
+ export type PathProps = PathBaseProps &
41
+ Pick<
42
+ SkiaPathProps,
43
+ | 'antiAlias'
44
+ | 'blendMode'
45
+ | 'children'
46
+ | 'dither'
47
+ | 'invertClip'
48
+ | 'origin'
49
+ | 'matrix'
50
+ | 'strokeCap'
51
+ | 'strokeJoin'
52
+ | 'strokeMiter'
53
+ | 'strokeWidth'
54
+ | 'style'
55
+ | 'transform'
56
+ > & {
5
57
  /**
6
- * The SVG path data string
58
+ * Transition configuration for enter and update animations.
59
+ * @note Disable an animation by passing in null.
60
+ *
61
+ * @default transitions = {{
62
+ * enter: { type: 'timing', duration: 500 },
63
+ * update: { type: 'spring', stiffness: 900, damping: 120 }
64
+ * }}
65
+ *
66
+ * @example
67
+ * // Custom enter and update transitions
68
+ * transitions={{ enter: { type: 'timing', duration: 300 }, update: { type: 'spring', damping: 20 } }}
69
+ *
70
+ * @example
71
+ * // Disable enter animation
72
+ * transitions={{ enter: null }}
7
73
  */
8
- d?: string;
74
+ transitions?: {
75
+ /**
76
+ * Transition for the initial enter/reveal animation.
77
+ * Set to `null` to disable.
78
+ */
79
+ enter?: Transition | null;
80
+ /**
81
+ * Transition for subsequent data update animations.
82
+ * Set to `null` to disable.
83
+ */
84
+ update?: Transition | null;
85
+ };
9
86
  /**
10
- * Path fill color
87
+ * Transition for updates.
88
+ * @deprecated Use `transitions.update` instead.
11
89
  */
12
- fill?: string;
90
+ transition?: Transition;
13
91
  /**
14
- * Path stroke color
92
+ * The SVG path data string.
15
93
  */
16
- stroke?: string;
94
+ d?: AnimatedProp<string | undefined>;
17
95
  /**
18
- * Path stroke width
96
+ * Offset added to the clip rect boundaries.
19
97
  */
20
- strokeWidth?: number;
21
- /**
22
- * Path stroke opacity
23
- */
24
- strokeOpacity?: number;
98
+ clipOffset?: number;
25
99
  /**
26
- * Path fill opacity
100
+ * Custom clip path.
101
+ * When set, overrides clipRect.
102
+ * @note pass null to disable clipping.
27
103
  */
28
- fillOpacity?: number;
104
+ clipPath?: string | null;
29
105
  /**
30
106
  * Custom clip path rect. If provided, this overrides the default chart rect for clipping.
107
+ * @default drawingArea of chart + clipOffset
108
+ * Will be overridden by clipPath if set.
31
109
  */
32
- clipRect?: RectType;
33
- /**
34
- * Stroke dash array for dashed lines
35
- */
36
- strokeDasharray?: string;
37
- /**
38
- * Whether to animate the path.
39
- * Overrides the animate prop on the Chart component.
40
- */
41
- animate?: boolean;
42
- /**
43
- * The offset to add to the clip rect boundaries.
44
- */
45
- clipOffset?: number;
110
+ clipRect?: Rect;
46
111
  };
47
112
  export declare const Path: import('react').NamedExoticComponent<PathProps>;
48
113
  //# sourceMappingURL=Path.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Path.d.ts","sourceRoot":"","sources":["../../src/chart/Path.tsx"],"names":[],"mappings":"AAQA,OAAO,EAKL,KAAK,SAAS,IAAI,YAAY,EAG/B,MAAM,kBAAkB,CAAC;AAE1B,OAAO,KAAK,EAAE,IAAI,IAAI,QAAQ,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAmChF,MAAM,MAAM,SAAS,GAAG,WAAW,GACjC,YAAY,GAAG;IACb;;OAEG;IACH,CAAC,CAAC,EAAE,MAAM,CAAC;IACX;;OAE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AW,GACX,WAAW,GACX,UAAU,GACV,QAAQ,GACR,YAAY,GACZ,QAAQ,GACR,QAAQ,GACR,WAAW,GACX,YAAY,GACZ,aAAa,GACb,aAAa,GACb,OAAO,GACP,WAAW,CACd,GAAG;IACF;;;;;;;;;;;;;;;;OAgBG;IACH,WAAW,CAAC,EAAE;QACZ;;;WAGG;QACH,KAAK,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC;QAC1B;;;WAGG;QACH,MAAM,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC;KAC5B,CAAC;IACF;;;OAGG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB;;OAEG;IACH,CAAC,CAAC,EAAE,YAAY,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IACrC;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,IAAI,CAAC;CACjB,CAAC;AA0EJ,eAAO,MAAM,IAAI,iDAyKf,CAAC"}
@@ -1,13 +1,13 @@
1
1
  import React from 'react';
2
2
  import { View } from 'react-native';
3
3
  import { type SegmentedTabsProps, type TabsActiveIndicatorProps } from '@coinbase/cds-mobile/tabs';
4
- import { type TextBaseProps } from '@coinbase/cds-mobile/typography/Text';
4
+ import { type TextBaseProps } from '@coinbase/cds-mobile/typography';
5
5
  export declare const PeriodSelectorActiveIndicator: ({
6
6
  activeTabRect,
7
7
  background,
8
8
  position,
9
9
  borderRadius,
10
- }: TabsActiveIndicatorProps) => import('react/jsx-runtime').JSX.Element | null;
10
+ }: TabsActiveIndicatorProps) => import('react/jsx-runtime').JSX.Element | undefined;
11
11
  export type LiveTabLabelBaseProps = TextBaseProps & {
12
12
  /**
13
13
  * The label to display.
@@ -62,23 +62,16 @@ export declare const LiveTabLabel: React.MemoExoticComponent<
62
62
  } & React.RefAttributes<View>
63
63
  >
64
64
  >;
65
- export type PeriodSelectorProps = SegmentedTabsProps;
65
+ export type PeriodSelectorProps = Omit<SegmentedTabsProps, 'styles'> &
66
+ Pick<SegmentedTabsProps, 'styles'>;
66
67
  /**
67
68
  * PeriodSelector is a specialized version of SegmentedTabs optimized for chart period selection.
68
69
  * It provides transparent background, primary wash active state, and full-width layout by default.
69
70
  */
70
71
  export declare const PeriodSelector: React.MemoExoticComponent<
71
72
  React.ForwardRefExoticComponent<
72
- Partial<
73
- Pick<
74
- import('@coinbase/cds-mobile/tabs').TabsProps<string>,
75
- 'TabComponent' | 'TabsActiveIndicatorComponent'
76
- >
77
- > &
78
- Omit<
79
- import('@coinbase/cds-mobile/tabs').TabsProps<string>,
80
- 'TabComponent' | 'TabsActiveIndicatorComponent'
81
- > &
73
+ Omit<SegmentedTabsProps, 'styles'> &
74
+ Pick<SegmentedTabsProps, 'styles'> &
82
75
  React.RefAttributes<any>
83
76
  >
84
77
  >;
@@ -1 +1 @@
1
- {"version":3,"file":"PeriodSelector.d.ts","sourceRoot":"","sources":["../../src/chart/PeriodSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,OAAO,CAAC;AACzD,OAAO,EAAc,IAAI,EAAkB,MAAM,cAAc,CAAC;AAGhE,OAAO,EAEL,KAAK,kBAAkB,EAEvB,KAAK,wBAAwB,EAC9B,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EAAQ,KAAK,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAGhF,eAAO,MAAM,6BAA6B,GAAI,wDAK3C,wBAAwB,mDAmD1B,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,aAAa,GAAG;IAClD;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,KAAK,CAAC,EAAE,GAAG,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,qBAAqB,CAAC;AAStD,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;IAxBvB;;;OAGG;YACK,MAAM;IACd;;OAEG;cACO,OAAO;IACjB;;OAEG;YACK,GAAG;+BAyCZ,CAAC;AASF,MAAM,MAAM,mBAAmB,GAAG,kBAAkB,CAAC;AAErD;;;GAGG;AACH,eAAO,MAAM,cAAc,6TA0B1B,CAAC"}
1
+ {"version":3,"file":"PeriodSelector.d.ts","sourceRoot":"","sources":["../../src/chart/PeriodSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,OAAO,CAAC;AACzD,OAAO,EAAc,IAAI,EAAkB,MAAM,cAAc,CAAC;AAGhE,OAAO,EAEL,KAAK,kBAAkB,EAEvB,KAAK,wBAAwB,EAC9B,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EAAQ,KAAK,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAG3E,eAAO,MAAM,6BAA6B,GAAI,wDAK3C,wBAAwB,wDAmD1B,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,aAAa,GAAG;IAClD;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,KAAK,CAAC,EAAE,GAAG,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,qBAAqB,CAAC;AAStD,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;IAxBvB;;;OAGG;YACK,MAAM;IACd;;OAEG;cACO,OAAO;IACjB;;OAEG;YACK,GAAG;+BAyCZ,CAAC;AASF,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,kBAAkB,EAAE,QAAQ,CAAC,GAClE,IAAI,CAAC,kBAAkB,EAAE,QAAQ,CAAC,CAAC;AAErC;;;GAGG;AACH,eAAO,MAAM,cAAc,gKA0B1B,CAAC"}
@@ -1,33 +1,15 @@
1
1
  import React from 'react';
2
- import type { Rect } from '@coinbase/cds-common/types';
2
+ import type { PathBaseProps, PathProps } from '../Path';
3
3
  import { type ChartPathCurveType } from '../utils';
4
- export type AreaComponentProps = {
5
- d: string;
6
- fill: string;
7
- fillOpacity?: number;
8
- clipRect?: Rect;
9
- stroke?: string;
10
- strokeWidth?: number;
11
- /**
12
- * ID of the y-axis to use.
13
- * If not provided, defaults to the default y-axis.
14
- */
15
- yAxisId?: string;
16
- /**
17
- * Baseline value for the gradient.
18
- * When set, overrides the default baseline.
19
- */
20
- baseline?: number;
21
- };
22
- export type AreaComponent = React.FC<AreaComponentProps>;
23
- export type AreaProps = {
4
+ import type { GradientDefinition } from '../utils/gradient';
5
+ export type AreaBaseProps = {
24
6
  /**
25
7
  * The ID of the series to render. Will be used to find the data from the chart context.
26
8
  */
27
9
  seriesId: string;
28
10
  /**
29
11
  * The curve interpolation method to use for the line.
30
- * @default 'linear'
12
+ * @default 'bump'
31
13
  */
32
14
  curve?: ChartPathCurveType;
33
15
  /**
@@ -40,23 +22,52 @@ export type AreaProps = {
40
22
  * Takes precedence over the type prop if provided.
41
23
  */
42
24
  AreaComponent?: AreaComponent;
25
+ /**
26
+ * When true, the area is connected across null values.
27
+ */
28
+ connectNulls?: boolean;
43
29
  /**
44
30
  * The color of the area.
45
- * @default color of the series or theme.color.fgPrimary
31
+ * @default color of the series or 'var(--color-fgPrimary)'
46
32
  */
47
- fill?: string;
33
+ fill?: PathBaseProps['fill'];
48
34
  /**
49
- * Opacity of the area.
35
+ * Opacity of the area
36
+ * @note when combined with gradient, both will be applied
50
37
  * @default 1
51
38
  */
52
- fillOpacity?: number;
53
- stroke?: string;
54
- strokeWidth?: number;
39
+ fillOpacity?: PathBaseProps['fillOpacity'];
55
40
  /**
56
41
  * Baseline value for the gradient.
57
42
  * When set, overrides the default baseline.
58
43
  */
59
44
  baseline?: number;
45
+ /**
46
+ * Gradient configuration.
47
+ * When provided, creates gradient or threshold-based coloring.
48
+ */
49
+ gradient?: GradientDefinition;
50
+ /**
51
+ * Whether to animate the area.
52
+ * Overrides the animate value from the chart context.
53
+ */
54
+ animate?: PathBaseProps['animate'];
55
+ };
56
+ export type AreaProps = AreaBaseProps & Pick<PathProps, 'transitions' | 'transition'>;
57
+ export type AreaComponentProps = Pick<
58
+ AreaProps,
59
+ 'fill' | 'fillOpacity' | 'baseline' | 'gradient' | 'animate' | 'transitions' | 'transition'
60
+ > & {
61
+ /**
62
+ * Path of the area
63
+ */
64
+ d: string;
65
+ /**
66
+ * ID of the y-axis to use.
67
+ * If not provided, defaults to the default y-axis.
68
+ */
69
+ yAxisId?: string;
60
70
  };
71
+ export type AreaComponent = React.FC<AreaComponentProps>;
61
72
  export declare const Area: React.NamedExoticComponent<AreaProps>;
62
73
  //# sourceMappingURL=Area.d.ts.map