@coinbase/cds-mcp-server 8.17.2 → 8.17.3

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 (269) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/mcp-docs/mobile/components/Accordion.txt +189 -0
  3. package/mcp-docs/mobile/components/AccordionItem.txt +30 -0
  4. package/mcp-docs/mobile/components/Alert.txt +156 -0
  5. package/mcp-docs/mobile/components/AreaChart.txt +266 -0
  6. package/mcp-docs/mobile/components/Avatar.txt +196 -0
  7. package/mcp-docs/mobile/components/AvatarButton.txt +226 -0
  8. package/mcp-docs/mobile/components/Banner.txt +222 -0
  9. package/mcp-docs/mobile/components/BarChart.txt +816 -0
  10. package/mcp-docs/mobile/components/Box.txt +174 -0
  11. package/mcp-docs/mobile/components/BrowserBar.txt +147 -0
  12. package/mcp-docs/mobile/components/Button.txt +199 -0
  13. package/mcp-docs/mobile/components/ButtonGroup.txt +80 -0
  14. package/mcp-docs/mobile/components/Carousel.txt +1084 -0
  15. package/mcp-docs/mobile/components/CartesianChart.txt +826 -0
  16. package/mcp-docs/mobile/components/CellMedia.txt +71 -0
  17. package/mcp-docs/mobile/components/Checkbox.txt +246 -0
  18. package/mcp-docs/mobile/components/CheckboxCell.txt +202 -0
  19. package/mcp-docs/mobile/components/CheckboxGroup.txt +285 -0
  20. package/mcp-docs/mobile/components/Chip.txt +195 -0
  21. package/mcp-docs/mobile/components/Coachmark.txt +158 -0
  22. package/mcp-docs/mobile/components/Collapsible.txt +105 -0
  23. package/mcp-docs/mobile/components/ContainedAssetCard.txt +135 -0
  24. package/mcp-docs/mobile/components/ContentCard.txt +366 -0
  25. package/mcp-docs/mobile/components/ContentCardBody.txt +136 -0
  26. package/mcp-docs/mobile/components/ContentCardFooter.txt +128 -0
  27. package/mcp-docs/mobile/components/ContentCardHeader.txt +146 -0
  28. package/mcp-docs/mobile/components/ContentCell.txt +227 -0
  29. package/mcp-docs/mobile/components/ControlGroup.txt +444 -0
  30. package/mcp-docs/mobile/components/DatePicker.txt +497 -0
  31. package/mcp-docs/mobile/components/Divider.txt +139 -0
  32. package/mcp-docs/mobile/components/DotCount.txt +146 -0
  33. package/mcp-docs/mobile/components/DotStatusColor.txt +59 -0
  34. package/mcp-docs/mobile/components/DotSymbol.txt +135 -0
  35. package/mcp-docs/mobile/components/Fallback.txt +158 -0
  36. package/mcp-docs/mobile/components/FloatingAssetCard.txt +156 -0
  37. package/mcp-docs/mobile/components/HStack.txt +235 -0
  38. package/mcp-docs/mobile/components/HeroSquare.txt +48 -0
  39. package/mcp-docs/mobile/components/Icon.txt +52 -0
  40. package/mcp-docs/mobile/components/IconButton.txt +269 -0
  41. package/mcp-docs/mobile/components/InputChip.txt +188 -0
  42. package/mcp-docs/mobile/components/Interactable.txt +187 -0
  43. package/mcp-docs/mobile/components/LineChart.txt +1325 -0
  44. package/mcp-docs/mobile/components/Link.txt +292 -0
  45. package/mcp-docs/mobile/components/ListCell.txt +391 -0
  46. package/mcp-docs/mobile/components/LogoMark.txt +85 -0
  47. package/mcp-docs/mobile/components/LogoWordMark.txt +94 -0
  48. package/mcp-docs/mobile/components/Lottie.txt +139 -0
  49. package/mcp-docs/mobile/components/LottieStatusAnimation.txt +47 -0
  50. package/mcp-docs/mobile/components/Modal.txt +84 -0
  51. package/mcp-docs/mobile/components/ModalBody.txt +34 -0
  52. package/mcp-docs/mobile/components/ModalFooter.txt +25 -0
  53. package/mcp-docs/mobile/components/ModalHeader.txt +28 -0
  54. package/mcp-docs/mobile/components/MultiContentModule.txt +380 -0
  55. package/mcp-docs/mobile/components/NavigationTitle.txt +132 -0
  56. package/mcp-docs/mobile/components/NavigationTitleSelect.txt +142 -0
  57. package/mcp-docs/mobile/components/NudgeCard.txt +90 -0
  58. package/mcp-docs/mobile/components/Numpad.txt +341 -0
  59. package/mcp-docs/mobile/components/Overlay.txt +152 -0
  60. package/mcp-docs/mobile/components/PageFooter.txt +161 -0
  61. package/mcp-docs/mobile/components/PageHeader.txt +186 -0
  62. package/mcp-docs/mobile/components/PeriodSelector.txt +408 -0
  63. package/mcp-docs/mobile/components/Pictogram.txt +48 -0
  64. package/mcp-docs/mobile/components/Point.txt +205 -0
  65. package/mcp-docs/mobile/components/PortalProvider.txt +79 -0
  66. package/mcp-docs/mobile/components/Pressable.txt +211 -0
  67. package/mcp-docs/mobile/components/ProgressBar.txt +130 -0
  68. package/mcp-docs/mobile/components/ProgressBarWithFixedLabels.txt +161 -0
  69. package/mcp-docs/mobile/components/ProgressBarWithFloatLabel.txt +138 -0
  70. package/mcp-docs/mobile/components/ProgressCircle.txt +237 -0
  71. package/mcp-docs/mobile/components/Radio.txt +242 -0
  72. package/mcp-docs/mobile/components/RadioCell.txt +202 -0
  73. package/mcp-docs/mobile/components/RadioGroup.txt +282 -0
  74. package/mcp-docs/mobile/components/ReferenceLine.txt +153 -0
  75. package/mcp-docs/mobile/components/RemoteImage.txt +106 -0
  76. package/mcp-docs/mobile/components/RemoteImageGroup.txt +61 -0
  77. package/mcp-docs/mobile/components/RollingNumber.txt +789 -0
  78. package/mcp-docs/mobile/components/Scrubber.txt +204 -0
  79. package/mcp-docs/mobile/components/SearchInput.txt +192 -0
  80. package/mcp-docs/mobile/components/SectionHeader.txt +205 -0
  81. package/mcp-docs/mobile/components/SegmentedTabs.txt +316 -0
  82. package/mcp-docs/mobile/components/Select.txt +212 -0
  83. package/mcp-docs/mobile/components/SelectChip.txt +324 -0
  84. package/mcp-docs/mobile/components/SelectOption.txt +85 -0
  85. package/mcp-docs/mobile/components/SlideButton.txt +331 -0
  86. package/mcp-docs/mobile/components/Spacer.txt +84 -0
  87. package/mcp-docs/mobile/components/Sparkline.txt +123 -0
  88. package/mcp-docs/mobile/components/SparklineGradient.txt +107 -0
  89. package/mcp-docs/mobile/components/SparklineInteractive.txt +157 -0
  90. package/mcp-docs/mobile/components/SparklineInteractiveHeader.txt +73 -0
  91. package/mcp-docs/mobile/components/Spinner.txt +49 -0
  92. package/mcp-docs/mobile/components/SpotIcon.txt +48 -0
  93. package/mcp-docs/mobile/components/SpotRectangle.txt +48 -0
  94. package/mcp-docs/mobile/components/SpotSquare.txt +48 -0
  95. package/mcp-docs/mobile/components/Stepper.txt +528 -0
  96. package/mcp-docs/mobile/components/SubBrandLogoMark.txt +126 -0
  97. package/mcp-docs/mobile/components/SubBrandLogoWordMark.txt +126 -0
  98. package/mcp-docs/mobile/components/Switch.txt +98 -0
  99. package/mcp-docs/mobile/components/TabIndicator.txt +49 -0
  100. package/mcp-docs/mobile/components/TabLabel.txt +154 -0
  101. package/mcp-docs/mobile/components/TabNavigation.txt +147 -0
  102. package/mcp-docs/mobile/components/TabbedChips.txt +143 -0
  103. package/mcp-docs/mobile/components/Tabs.txt +191 -0
  104. package/mcp-docs/mobile/components/Tag.txt +301 -0
  105. package/mcp-docs/mobile/components/Text.txt +212 -0
  106. package/mcp-docs/mobile/components/TextInput.txt +718 -0
  107. package/mcp-docs/mobile/components/ThemeProvider.txt +133 -0
  108. package/mcp-docs/mobile/components/Toast.txt +197 -0
  109. package/mcp-docs/mobile/components/Tooltip.txt +60 -0
  110. package/mcp-docs/mobile/components/TopNavBar.txt +162 -0
  111. package/mcp-docs/mobile/components/Tour.txt +159 -0
  112. package/mcp-docs/mobile/components/Tray.txt +253 -0
  113. package/mcp-docs/mobile/components/UpsellCard.txt +322 -0
  114. package/mcp-docs/mobile/components/VStack.txt +223 -0
  115. package/mcp-docs/mobile/components/XAxis.txt +622 -0
  116. package/mcp-docs/mobile/components/YAxis.txt +568 -0
  117. package/mcp-docs/mobile/getting-started/introduction.txt +99 -0
  118. package/mcp-docs/mobile/getting-started/mcp-server.txt +94 -0
  119. package/mcp-docs/mobile/getting-started/playground.txt +25 -0
  120. package/mcp-docs/mobile/hooks/useDimensions.txt +47 -0
  121. package/mcp-docs/mobile/hooks/useOverlayContentContext.txt +215 -0
  122. package/mcp-docs/mobile/hooks/useTheme.txt +110 -0
  123. package/mcp-docs/mobile/routes.txt +132 -0
  124. package/mcp-docs/web/components/Accordion.txt +190 -0
  125. package/mcp-docs/web/components/AccordionItem.txt +32 -0
  126. package/mcp-docs/web/components/Alert.txt +165 -0
  127. package/mcp-docs/web/components/AreaChart.txt +511 -0
  128. package/mcp-docs/web/components/Avatar.txt +212 -0
  129. package/mcp-docs/web/components/AvatarButton.txt +241 -0
  130. package/mcp-docs/web/components/Banner.txt +227 -0
  131. package/mcp-docs/web/components/BarChart.txt +1268 -0
  132. package/mcp-docs/web/components/Box.txt +176 -0
  133. package/mcp-docs/web/components/Button.txt +213 -0
  134. package/mcp-docs/web/components/ButtonGroup.txt +80 -0
  135. package/mcp-docs/web/components/Calendar.txt +182 -0
  136. package/mcp-docs/web/components/Carousel.txt +1576 -0
  137. package/mcp-docs/web/components/CartesianChart.txt +1045 -0
  138. package/mcp-docs/web/components/CellMedia.txt +57 -0
  139. package/mcp-docs/web/components/Checkbox.txt +189 -0
  140. package/mcp-docs/web/components/CheckboxCell.txt +203 -0
  141. package/mcp-docs/web/components/CheckboxGroup.txt +220 -0
  142. package/mcp-docs/web/components/Chip.txt +197 -0
  143. package/mcp-docs/web/components/Coachmark.txt +189 -0
  144. package/mcp-docs/web/components/Collapsible.txt +120 -0
  145. package/mcp-docs/web/components/ContainedAssetCard.txt +233 -0
  146. package/mcp-docs/web/components/ContentCard.txt +368 -0
  147. package/mcp-docs/web/components/ContentCardBody.txt +138 -0
  148. package/mcp-docs/web/components/ContentCardFooter.txt +130 -0
  149. package/mcp-docs/web/components/ContentCardHeader.txt +148 -0
  150. package/mcp-docs/web/components/ContentCell.txt +220 -0
  151. package/mcp-docs/web/components/ControlGroup.txt +437 -0
  152. package/mcp-docs/web/components/DatePicker.txt +506 -0
  153. package/mcp-docs/web/components/Divider.txt +144 -0
  154. package/mcp-docs/web/components/DotCount.txt +150 -0
  155. package/mcp-docs/web/components/DotStatusColor.txt +59 -0
  156. package/mcp-docs/web/components/DotSymbol.txt +138 -0
  157. package/mcp-docs/web/components/Dropdown.txt +120 -0
  158. package/mcp-docs/web/components/Fallback.txt +164 -0
  159. package/mcp-docs/web/components/FloatingAssetCard.txt +251 -0
  160. package/mcp-docs/web/components/FullscreenAlert.txt +70 -0
  161. package/mcp-docs/web/components/FullscreenModal.txt +146 -0
  162. package/mcp-docs/web/components/FullscreenModalLayout.txt +188 -0
  163. package/mcp-docs/web/components/Grid.txt +237 -0
  164. package/mcp-docs/web/components/GridColumn.txt +210 -0
  165. package/mcp-docs/web/components/HStack.txt +237 -0
  166. package/mcp-docs/web/components/HeroSquare.txt +49 -0
  167. package/mcp-docs/web/components/Icon.txt +146 -0
  168. package/mcp-docs/web/components/IconButton.txt +391 -0
  169. package/mcp-docs/web/components/InputChip.txt +188 -0
  170. package/mcp-docs/web/components/Interactable.txt +194 -0
  171. package/mcp-docs/web/components/LineChart.txt +1577 -0
  172. package/mcp-docs/web/components/Link.txt +244 -0
  173. package/mcp-docs/web/components/ListCell.txt +397 -0
  174. package/mcp-docs/web/components/LogoMark.txt +85 -0
  175. package/mcp-docs/web/components/LogoWordMark.txt +94 -0
  176. package/mcp-docs/web/components/Lottie.txt +158 -0
  177. package/mcp-docs/web/components/LottieStatusAnimation.txt +58 -0
  178. package/mcp-docs/web/components/MediaQueryProvider.txt +109 -0
  179. package/mcp-docs/web/components/Modal.txt +193 -0
  180. package/mcp-docs/web/components/ModalBody.txt +118 -0
  181. package/mcp-docs/web/components/ModalFooter.txt +120 -0
  182. package/mcp-docs/web/components/ModalHeader.txt +124 -0
  183. package/mcp-docs/web/components/MultiContentModule.txt +382 -0
  184. package/mcp-docs/web/components/NavigationBar.txt +103 -0
  185. package/mcp-docs/web/components/NavigationTitle.txt +26 -0
  186. package/mcp-docs/web/components/NavigationTitleSelect.txt +46 -0
  187. package/mcp-docs/web/components/NudgeCard.txt +182 -0
  188. package/mcp-docs/web/components/Overlay.txt +172 -0
  189. package/mcp-docs/web/components/PageFooter.txt +185 -0
  190. package/mcp-docs/web/components/PageHeader.txt +244 -0
  191. package/mcp-docs/web/components/Pagination.txt +500 -0
  192. package/mcp-docs/web/components/PeriodSelector.txt +704 -0
  193. package/mcp-docs/web/components/Pictogram.txt +49 -0
  194. package/mcp-docs/web/components/Point.txt +461 -0
  195. package/mcp-docs/web/components/PortalProvider.txt +77 -0
  196. package/mcp-docs/web/components/Pressable.txt +194 -0
  197. package/mcp-docs/web/components/ProgressBar.txt +164 -0
  198. package/mcp-docs/web/components/ProgressBarWithFixedLabels.txt +213 -0
  199. package/mcp-docs/web/components/ProgressBarWithFloatLabel.txt +182 -0
  200. package/mcp-docs/web/components/ProgressCircle.txt +444 -0
  201. package/mcp-docs/web/components/Radio.txt +220 -0
  202. package/mcp-docs/web/components/RadioCell.txt +216 -0
  203. package/mcp-docs/web/components/RadioGroup.txt +289 -0
  204. package/mcp-docs/web/components/ReferenceLine.txt +452 -0
  205. package/mcp-docs/web/components/RemoteImage.txt +166 -0
  206. package/mcp-docs/web/components/RemoteImageGroup.txt +87 -0
  207. package/mcp-docs/web/components/RollingNumber.txt +1022 -0
  208. package/mcp-docs/web/components/Scrubber.txt +232 -0
  209. package/mcp-docs/web/components/SearchInput.txt +118 -0
  210. package/mcp-docs/web/components/SectionHeader.txt +218 -0
  211. package/mcp-docs/web/components/SegmentedTabs.txt +325 -0
  212. package/mcp-docs/web/components/Select.txt +225 -0
  213. package/mcp-docs/web/components/SelectChip.txt +315 -0
  214. package/mcp-docs/web/components/SelectOption.txt +166 -0
  215. package/mcp-docs/web/components/Sidebar.txt +350 -0
  216. package/mcp-docs/web/components/SidebarItem.txt +132 -0
  217. package/mcp-docs/web/components/SidebarMoreMenu.txt +31 -0
  218. package/mcp-docs/web/components/Spacer.txt +174 -0
  219. package/mcp-docs/web/components/Sparkline.txt +123 -0
  220. package/mcp-docs/web/components/SparklineGradient.txt +107 -0
  221. package/mcp-docs/web/components/SparklineInteractive.txt +154 -0
  222. package/mcp-docs/web/components/SparklineInteractiveHeader.txt +77 -0
  223. package/mcp-docs/web/components/Spinner.txt +129 -0
  224. package/mcp-docs/web/components/SpotIcon.txt +49 -0
  225. package/mcp-docs/web/components/SpotRectangle.txt +49 -0
  226. package/mcp-docs/web/components/SpotSquare.txt +49 -0
  227. package/mcp-docs/web/components/Stepper.txt +683 -0
  228. package/mcp-docs/web/components/SubBrandLogoMark.txt +126 -0
  229. package/mcp-docs/web/components/SubBrandLogoWordMark.txt +126 -0
  230. package/mcp-docs/web/components/Switch.txt +86 -0
  231. package/mcp-docs/web/components/TabIndicator.txt +49 -0
  232. package/mcp-docs/web/components/TabLabel.txt +159 -0
  233. package/mcp-docs/web/components/TabNavigation.txt +160 -0
  234. package/mcp-docs/web/components/TabbedChips.txt +156 -0
  235. package/mcp-docs/web/components/Table.txt +368 -0
  236. package/mcp-docs/web/components/TableBody.txt +84 -0
  237. package/mcp-docs/web/components/TableCaption.txt +103 -0
  238. package/mcp-docs/web/components/TableCell.txt +166 -0
  239. package/mcp-docs/web/components/TableCellFallback.txt +98 -0
  240. package/mcp-docs/web/components/TableFooter.txt +84 -0
  241. package/mcp-docs/web/components/TableHeader.txt +101 -0
  242. package/mcp-docs/web/components/TableRow.txt +141 -0
  243. package/mcp-docs/web/components/Tabs.txt +213 -0
  244. package/mcp-docs/web/components/Tag.txt +305 -0
  245. package/mcp-docs/web/components/Text.txt +233 -0
  246. package/mcp-docs/web/components/TextInput.txt +653 -0
  247. package/mcp-docs/web/components/ThemeProvider.txt +200 -0
  248. package/mcp-docs/web/components/TileButton.txt +159 -0
  249. package/mcp-docs/web/components/Toast.txt +204 -0
  250. package/mcp-docs/web/components/Tooltip.txt +90 -0
  251. package/mcp-docs/web/components/Tour.txt +180 -0
  252. package/mcp-docs/web/components/Tray.txt +289 -0
  253. package/mcp-docs/web/components/UpsellCard.txt +320 -0
  254. package/mcp-docs/web/components/VStack.txt +225 -0
  255. package/mcp-docs/web/components/XAxis.txt +620 -0
  256. package/mcp-docs/web/components/YAxis.txt +549 -0
  257. package/mcp-docs/web/getting-started/introduction.txt +99 -0
  258. package/mcp-docs/web/getting-started/mcp-server.txt +94 -0
  259. package/mcp-docs/web/getting-started/playground.txt +25 -0
  260. package/mcp-docs/web/hooks/useBreakpoints.txt +33 -0
  261. package/mcp-docs/web/hooks/useDimensions.txt +55 -0
  262. package/mcp-docs/web/hooks/useHasMounted.txt +55 -0
  263. package/mcp-docs/web/hooks/useIsoEffect.txt +42 -0
  264. package/mcp-docs/web/hooks/useMediaQuery.txt +94 -0
  265. package/mcp-docs/web/hooks/useOverlayContentContext.txt +217 -0
  266. package/mcp-docs/web/hooks/useScrollBlocker.txt +63 -0
  267. package/mcp-docs/web/hooks/useTheme.txt +105 -0
  268. package/mcp-docs/web/routes.txt +155 -0
  269. package/package.json +1 -1
@@ -0,0 +1,620 @@
1
+ # XAxis
2
+
3
+ A horizontal axis component for CartesianChart. Displays tick marks, labels, gridlines, and supports custom formatting and data domains.
4
+
5
+ ## Import
6
+
7
+ ```jsx
8
+ import { XAxis } from '@coinbase/cds-web-visualization'
9
+ ```
10
+
11
+ ## Props
12
+
13
+ | Prop | Type | Required | Default | Description |
14
+ | --- | --- | --- | --- | --- |
15
+ | `GridLineComponent` | `LineComponent` | No | `DottedLine` | Component to render the grid lines. |
16
+ | `className` | `string` | No | `-` | Custom className for the axis. |
17
+ | `classNames` | `{ root?: string; tickLabel?: string \| undefined; gridLine?: string \| undefined; line?: string \| undefined; tickMark?: string \| undefined; } \| undefined` | No | `-` | Custom classNames for the axis. |
18
+ | `height` | `number` | No | `32` | Height of the axis. This value is inclusive of the padding. |
19
+ | `minTickLabelGap` | `number` | No | `4` | Minimum gap between tick labels. Labels will be hidden if they are closer than this gap. |
20
+ | `position` | `top \| bottom` | No | `'bottom'` | The position of the axis relative to the charts drawing area. |
21
+ | `requestedTickCount` | `number` | No | `5 (for y-axis)` | Requested number of ticks to display. This value is passed into d3 and may not be respected. |
22
+ | `showGrid` | `boolean` | No | `-` | Whether to show grid lines at each tick position. |
23
+ | `showLine` | `boolean` | No | `-` | Whether to show the axis line. |
24
+ | `showTickMarks` | `boolean` | No | `-` | Whether to show tick marks on the axis. |
25
+ | `style` | `CSSProperties` | No | `-` | Custom style for the axis. |
26
+ | `styles` | `{ root?: CSSProperties; tickLabel?: CSSProperties \| undefined; gridLine?: CSSProperties \| undefined; line?: CSSProperties \| undefined; tickMark?: CSSProperties \| undefined; } \| undefined` | No | `-` | Custom styles for the axis. |
27
+ | `tickInterval` | `number` | No | `32 (for x-axis)` | Interval at which to show ticks. When provided, calculates tick count based on available space. |
28
+ | `tickLabelFormatter` | `((value: any) => ChartTextChildren)` | No | `-` | Formatter function for axis tick values. Tick values will be wrapped in ChartText component. |
29
+ | `tickMarkLabelGap` | `number` | No | `2 for x-axis, 8 for y-axis` | Space between the axis tick mark and labels. If tick marks are not shown, this is the gap between the axis and the chart. |
30
+ | `tickMarkSize` | `number` | No | `4` | Size of the tick marks. |
31
+ | `tickMaxStep` | `number` | No | `-` | Maximum step size for tick generation. Prevents the step from being larger than this value. |
32
+ | `tickMinStep` | `number` | No | `1` | Minimum step size for tick generation. Prevents the step from being smaller than this value. |
33
+ | `ticks` | `number[] \| ((value: number) => boolean)` | No | `-` | Custom tick configuration for the axis. When provided, this overrides the requestedTickCount property. - **Array**: Uses these exact values for tick positioning and labels. - **Function**: Filters based on the predicate function. - For **x-axis**: Checks every data index (0, 1, 2, ..., dataLength-1) - For **y-axis**: Filters d3-generated tick values |
34
+
35
+
36
+ ## Examples
37
+
38
+ ### Basic Example
39
+
40
+ The XAxis component provides a horizontal axis for charts with automatic tick generation and labeling.
41
+
42
+ ```jsx live
43
+ <CartesianChart
44
+ enableScrubbing
45
+ height={250}
46
+ series={[
47
+ {
48
+ id: 'prices',
49
+ data: [10, 22, 29, 45, 98, 45, 22, 52, 21, 4, 68, 20, 21, 58],
50
+ },
51
+ ]}
52
+ xAxis={{
53
+ data: ['April 1', 'April 2', 'April 3', 'April 4', 'April 5', 'April 6', 'April 7'],
54
+ }}
55
+ >
56
+ <XAxis showLine showTickMarks showGrid />
57
+ <Line seriesId="prices" curve="monotone" showArea />
58
+ <Scrubber />
59
+ </CartesianChart>
60
+ ```
61
+
62
+ ### Axis Config
63
+
64
+ Properties related to the scale of an axis are set on the Chart component. This includes `scaleType`, `domain`, `domainLimit`, `range`, `data`, and `categoryPadding`.
65
+
66
+ #### Scale Type
67
+
68
+ XAxis supports `linear` (default), `log`, and `band` scale types.
69
+ `linear` and `log` are numeric scales while `band` is a categorical scale.
70
+ `band` scale is required for bar charts.
71
+
72
+ ```jsx live
73
+ <CartesianChart
74
+ height={250}
75
+ series={[
76
+ {
77
+ id: 'prices',
78
+ data: [10, 22, 29, 45, 98, 45, 22, 52, 21, 4, 68, 20, 21, 58],
79
+ },
80
+ ]}
81
+ xAxis={{
82
+ scaleType: 'band',
83
+ }}
84
+ >
85
+ <XAxis showLine showTickMarks showGrid />
86
+ <Line seriesId="prices" curve="monotone" showArea />
87
+ </CartesianChart>
88
+ ```
89
+
90
+ #### Domain
91
+
92
+ An axis's domain is the range of values that the axis will display.
93
+ You can pass in either an object (AxisBounds) with `min` and `max` properties (both optional), or a function that receives initial `AxisBounds` and returns an adjusted `AxisBounds`.
94
+
95
+ ```jsx live
96
+ <CartesianChart
97
+ height={250}
98
+ series={[
99
+ {
100
+ id: 'prices',
101
+ data: [10, 22, 29, 45, 98, 45, 22, 52, 21, 4, 68, 20, 21, 58],
102
+ },
103
+ ]}
104
+ xAxis={{
105
+ domain: ({ min, max }) => ({ min: min - 5, max: max + 5 }),
106
+ }}
107
+ >
108
+ <XAxis showLine showTickMarks showGrid tickInterval={16} />
109
+ <Line seriesId="prices" curve="monotone" showArea />
110
+ </CartesianChart>
111
+ ```
112
+
113
+ ##### Domain Limit
114
+
115
+ For numeric scales, you can set the domain limit to `nice` or `strict` (default for XAxis). `nice` will round the domain to human-friendly values, while `strict` will use the exact min/max values from the data. See [d3-scale](https://d3js.org/d3-scale/linear#linear_nice) for more details.
116
+
117
+ #### Range
118
+
119
+ An axis's range is the range of values that the axis will display in pixels. This is most useful for adjusting the sizing of the data inside of the chart's drawing area.
120
+
121
+ You can pass in either an object (AxisBounds) with `min` and `max` properties (both optional), or a function that receives initial `AxisBounds` and returns an adjusted `AxisBounds`.
122
+
123
+ ```jsx live
124
+ <CartesianChart
125
+ height={250}
126
+ series={[
127
+ {
128
+ id: 'prices',
129
+ data: [10, 22, 29, 45, 98, 45, 22, 52, 21, 4, 68, 20, 21, 58],
130
+ },
131
+ ]}
132
+ xAxis={{
133
+ range: ({ min, max }) => ({ min, max: max - 64 }),
134
+ }}
135
+ >
136
+ <Line seriesId="prices" curve="monotone" showArea />
137
+ </CartesianChart>
138
+ ```
139
+
140
+ #### Data
141
+
142
+ Data sets x values for the axis.
143
+
144
+ ##### String Data
145
+
146
+ Using string data will allow you to set string x values for each data point.
147
+
148
+ ```jsx live
149
+ <CartesianChart
150
+ height={250}
151
+ series={[
152
+ {
153
+ id: 'prices',
154
+ data: [10, 22, 29, 45, 98, 45, 22, 52, 21, 4, 68, 20, 21, 58],
155
+ },
156
+ ]}
157
+ xAxis={{
158
+ data: ['April 1', 'April 2', 'April 3', 'April 4', 'April 5', 'April 6', 'April 7'],
159
+ }}
160
+ >
161
+ <XAxis showLine showTickMarks showGrid />
162
+ <Line seriesId="prices" curve="monotone" showArea />
163
+ </CartesianChart>
164
+ ```
165
+
166
+ ##### Number Data
167
+
168
+ Using number data with a numeric scale will allow you to adjust the x values for each data point.
169
+
170
+ ```jsx live
171
+ <LineChart
172
+ enableScrubbing
173
+ series={[
174
+ {
175
+ id: 'line',
176
+ data: [2, 5.5, 2, 8.5, 1.5, 5],
177
+ },
178
+ ]}
179
+ height={250}
180
+ showArea
181
+ renderPoints={() => true}
182
+ curve="natural"
183
+ showXAxis
184
+ xAxis={{ data: [1, 2, 3, 5, 8, 10], showLine: true, showTickMarks: true, showGrid: true }}
185
+ showYAxis
186
+ yAxis={{
187
+ domain: { min: 0 },
188
+ position: 'left',
189
+ showLine: true,
190
+ showTickMarks: true,
191
+ showGrid: true,
192
+ }}
193
+ >
194
+ <Scrubber />
195
+ </LineChart>
196
+ ```
197
+
198
+ #### Category Padding
199
+
200
+ For band scales, you can set the category padding to adjust the spacing between categories. The default is 0.1. This is a value between 0 and 1, where 0.1 = 10% spacing.
201
+
202
+ ```jsx live
203
+ <BarChart
204
+ showXAxis
205
+ height={400}
206
+ series={[
207
+ {
208
+ id: 'weekly-data',
209
+ data: [45, 52, 38, 45, 19, 23, 32],
210
+ },
211
+ ]}
212
+ xAxis={{
213
+ data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
214
+ showTickMarks: true,
215
+ showLine: true,
216
+ categoryPadding: 0.5,
217
+ }}
218
+ />
219
+ ```
220
+
221
+ ### Axis Props
222
+
223
+ Properties related to the visual appearance of the XAxis are set on the component itself. This includes `position`, `showGrid`, `showLine`, `showTickMarks`, `size`, `tickInterval`, `ticks`, `tickLabelFormatter`, and `tickMarkSize`.
224
+
225
+ #### Position
226
+
227
+ You can set the position of an axis to `top` or `bottom` (default).
228
+
229
+ ```jsx live
230
+ function XAxisPositionExample() {
231
+ const lineA = [5, 5, 10, 90, 85, 70, 30, 25, 25];
232
+ const lineB = [90, 85, 70, 25, 23, 40, 45, 40, 50];
233
+
234
+ const timeData = useMemo(
235
+ () =>
236
+ [
237
+ new Date(2023, 7, 31),
238
+ new Date(2023, 7, 31, 12),
239
+ new Date(2023, 8, 1),
240
+ new Date(2023, 8, 1, 12),
241
+ new Date(2023, 8, 2),
242
+ new Date(2023, 8, 2, 12),
243
+ new Date(2023, 8, 3),
244
+ new Date(2023, 8, 3, 12),
245
+ new Date(2023, 8, 4),
246
+ ].map((d) => d.getTime()),
247
+ [],
248
+ );
249
+
250
+ const dateFormatter = useCallback(
251
+ (index: number) => {
252
+ return new Date(timeData[index]).toLocaleDateString('en-US', {
253
+ month: '2-digit',
254
+ day: '2-digit',
255
+ });
256
+ },
257
+ [timeData],
258
+ );
259
+
260
+ const timeOfDayFormatter = useCallback(
261
+ (index: number) => {
262
+ return new Date(timeData[index]).toLocaleTimeString('en-US', {
263
+ hour: '2-digit',
264
+ });
265
+ },
266
+ [timeData],
267
+ );
268
+
269
+ const timeOfDayTicks = useMemo(() => {
270
+ return timeData.map((d, index) => index);
271
+ }, [timeData]);
272
+
273
+ const dateTicks = useMemo(() => {
274
+ return timeData.map((d, index) => index).filter((d) => d % 2 === 0);
275
+ }, [timeData]);
276
+
277
+ return (
278
+ <LineChart
279
+ enableScrubbing
280
+ curve="monotone"
281
+ height={400}
282
+ series={[
283
+ {
284
+ id: 'lineA',
285
+ data: lineA,
286
+ color: 'var(--color-accentBoldBlue)',
287
+ },
288
+ {
289
+ id: 'lineB',
290
+ data: lineB,
291
+ color: 'var(--color-accentBoldGreen)',
292
+ },
293
+ ]}
294
+ yAxis={{
295
+ domain: { min: 0, max: 100 },
296
+ }}
297
+ >
298
+ <XAxis
299
+ showLine
300
+ showTickMarks
301
+ position="top"
302
+ tickLabelFormatter={dateFormatter}
303
+ ticks={dateTicks}
304
+ />
305
+ <XAxis
306
+ showGrid
307
+ showLine
308
+ showTickMarks
309
+ tickLabelFormatter={timeOfDayFormatter}
310
+ ticks={timeOfDayTicks}
311
+ />
312
+ <Scrubber />
313
+ </LineChart>
314
+ );
315
+ };
316
+ ```
317
+
318
+ #### Grid
319
+
320
+ You can show grid lines at each tick position using the `showGrid` prop.
321
+
322
+ ```jsx live
323
+ function XAxisGridExample() {
324
+ const [showGrid, setShowGrid] = useState(true);
325
+ return (
326
+ <VStack gap={2}>
327
+ <HStack gap={2} style={{ flexWrap: 'wrap' }}>
328
+ <Switch checked={showGrid} onChange={() => setShowGrid(!showGrid)}>
329
+ Show Grid
330
+ </Switch>
331
+ </HStack>
332
+ <CartesianChart
333
+ enableScrubbing
334
+ height={250}
335
+ series={[
336
+ {
337
+ id: 'prices',
338
+ data: [10, 22, 29, 45, 98, 45, 22, 52, 21, 4, 68, 20, 21, 58],
339
+ },
340
+ ]}
341
+ xAxis={{
342
+ data: ['April 1', 'April 2', 'April 3', 'April 4', 'April 5', 'April 6', 'April 7'],
343
+ }}
344
+ >
345
+ <XAxis showLine showTickMarks showGrid={showGrid} />
346
+ <Line seriesId="prices" curve="monotone" showArea />
347
+ <Scrubber />
348
+ </CartesianChart>
349
+ </VStack>
350
+ );
351
+ }
352
+ ```
353
+
354
+ You can also customize the grid lines using the `GridLineComponent` prop.
355
+
356
+ ```jsx live
357
+ function CustomGridLineExample() {
358
+ const ThinSolidLine = memo((props: SolidLineProps) => <SolidLine {...props} strokeWidth={1} />);
359
+
360
+ return (
361
+ <CartesianChart
362
+ enableScrubbing
363
+ height={250}
364
+ series={[
365
+ {
366
+ id: 'prices',
367
+ data: [10, 22, 29, 45, 98, 45, 22, 52, 21, 4, 68, 20, 21, 58],
368
+ },
369
+ ]}
370
+ xAxis={{
371
+ data: ['April 1', 'April 2', 'April 3', 'April 4', 'April 5', 'April 6', 'April 7'],
372
+ }}
373
+ >
374
+ <XAxis showLine showTickMarks showGrid GridLineComponent={ThinSolidLine} />
375
+ <Line seriesId="prices" curve="monotone" showArea />
376
+ <Scrubber />
377
+ </CartesianChart>
378
+ );
379
+ }
380
+ ```
381
+
382
+ #### Line
383
+
384
+ You can show the axis line using the `showLine` prop.
385
+
386
+ ```jsx live
387
+ function XAxisLineExample() {
388
+ const [showLine, setShowLine] = useState(true);
389
+ return (
390
+ <VStack gap={2}>
391
+ <HStack gap={2} style={{ flexWrap: 'wrap' }}>
392
+ <Switch checked={showLine} onChange={() => setShowLine(!showLine)}>
393
+ Show Line
394
+ </Switch>
395
+ </HStack>
396
+ <CartesianChart
397
+ enableScrubbing
398
+ height={250}
399
+ series={[
400
+ {
401
+ id: 'prices',
402
+ data: [10, 22, 29, 45, 98, 45, 22, 52, 21, 4, 68, 20, 21, 58],
403
+ },
404
+ ]}
405
+ xAxis={{
406
+ data: ['April 1', 'April 2', 'April 3', 'April 4', 'April 5', 'April 6', 'April 7'],
407
+ }}
408
+ >
409
+ <XAxis showLine={showLine} showTickMarks showGrid />
410
+ <Line seriesId="prices" curve="monotone" showArea />
411
+ <Scrubber />
412
+ </CartesianChart>
413
+ </VStack>
414
+ );
415
+ }
416
+ ```
417
+
418
+ You can also customize the axis line using the `classNames` and `styles` props.
419
+
420
+ ```jsx live
421
+ function XAxisLineStylesExample() {
422
+ const [showLine, setShowLine] = useState(true);
423
+ return (
424
+ <VStack gap={2}>
425
+ <HStack gap={2} style={{ flexWrap: 'wrap' }}>
426
+ <Switch checked={showLine} onChange={() => setShowLine(!showLine)}>
427
+ Show Line
428
+ </Switch>
429
+ </HStack>
430
+ <CartesianChart
431
+ enableScrubbing
432
+ height={250}
433
+ series={[
434
+ {
435
+ id: 'prices',
436
+ data: [10, 22, 29, 45, 98, 45, 22, 52, 21, 4, 68, 20, 21, 58],
437
+ },
438
+ ]}
439
+ >
440
+ <XAxis
441
+ showLine={showLine}
442
+ showGrid
443
+ styles={{ line: { stroke: 'var(--color-accentBoldGreen)', strokeWidth: 4 } }}
444
+ />
445
+ <Line seriesId="prices" curve="monotone" showArea />
446
+ <Scrubber />
447
+ </CartesianChart>
448
+ </VStack>
449
+ );
450
+ }
451
+ ```
452
+
453
+ #### Size
454
+
455
+ The `size` prop sets the size of the axis in pixels. The default is 32 for XAxis, but can be adjusted to fit the size of your data.
456
+
457
+ ```jsx live
458
+ <CartesianChart
459
+ enableScrubbing
460
+ height={250}
461
+ series={[
462
+ {
463
+ id: 'prices',
464
+ data: [10, 22, 29, 45, 98, 45, 22, 52, 21, 4, 68, 20, 21, 58],
465
+ },
466
+ ]}
467
+ xAxis={{
468
+ data: ['April 1', 'April 2', 'April 3', 'April 4', 'April 5', 'April 6', 'April 7'],
469
+ }}
470
+ >
471
+ <XAxis showLine showTickMarks showGrid height={64} />
472
+ <Line seriesId="prices" curve="monotone" showArea />
473
+ <Scrubber />
474
+ </CartesianChart>
475
+ ```
476
+
477
+ #### Ticks
478
+
479
+ You can use the `ticks`, `requestedTickCount`, and `tickInterval` (default for XAxis) props to control the number and placement of ticks on the XAxis.
480
+
481
+ `ticks` accepts an array of numbers, which corresponds to the values of that axis that you would like to display ticks for.
482
+
483
+ ```jsx live
484
+ <CartesianChart
485
+ enableScrubbing
486
+ height={250}
487
+ series={[
488
+ {
489
+ id: 'prices',
490
+ data: [10, 22, 29, 45, 98, 45, 22, 52, 21, 4, 68, 20, 21, 58],
491
+ },
492
+ ]}
493
+ >
494
+ <XAxis showLine showTickMarks showGrid ticks={[0, 2, 4, 6]} />
495
+ <Line seriesId="prices" curve="monotone" showArea />
496
+ <Scrubber />
497
+ </CartesianChart>
498
+ ```
499
+
500
+ Using `requestedTickCount` will use [D3's ticks function](https://d3js.org/d3-array/ticks#ticks) to determine the number and placement of ticks. Note that this count is not guaranteed to be respected.
501
+
502
+ ```jsx live
503
+ <CartesianChart
504
+ enableScrubbing
505
+ height={250}
506
+ series={[
507
+ {
508
+ id: 'prices',
509
+ data: [10, 22, 29, 45, 98, 45, 22, 52, 21, 4, 68, 20, 21, 58],
510
+ },
511
+ ]}
512
+ >
513
+ <XAxis showLine showTickMarks showGrid requestedTickCount={4} />
514
+ <Line seriesId="prices" curve="monotone" showArea />
515
+ <Scrubber />
516
+ </CartesianChart>
517
+ ```
518
+
519
+ `tickInterval`, which accepts a number for the gap between ticks in pixels, will measure the available space and try to create evenly spaced ticks. It will always include the first and last values of the domain.
520
+
521
+ ```jsx live
522
+ <CartesianChart
523
+ enableScrubbing
524
+ height={250}
525
+ series={[
526
+ {
527
+ id: 'prices',
528
+ data: [10, 22, 29, 45, 98, 45, 22, 52, 21, 4, 68, 20, 21, 58],
529
+ },
530
+ ]}
531
+ >
532
+ <XAxis showLine showTickMarks showGrid tickInterval={16} />
533
+ <Line seriesId="prices" curve="monotone" showArea />
534
+ <Scrubber />
535
+ </CartesianChart>
536
+ ```
537
+
538
+ #### Tick Marks
539
+
540
+ You can show tick marks on the axis using the `showTickMarks` prop. You can also customize the tick mark size using the `tickMarkSize` prop.
541
+
542
+ ```jsx live
543
+ function XAxisTickMarksExample() {
544
+ const [showTickMarks, setShowTickMarks] = useState(true);
545
+ return (
546
+ <VStack gap={2}>
547
+ <HStack gap={2} style={{ flexWrap: 'wrap' }}>
548
+ <Switch checked={showTickMarks} onChange={() => setShowTickMarks(!showTickMarks)}>
549
+ Show Tick Marks
550
+ </Switch>
551
+ </HStack>
552
+ <CartesianChart
553
+ enableScrubbing
554
+ height={250}
555
+ series={[
556
+ {
557
+ id: 'prices',
558
+ data: [10, 22, 29, 45, 98, 45, 22, 52, 21, 4, 68, 20, 21, 58],
559
+ },
560
+ ]}
561
+ xAxis={{
562
+ data: ['April 1', 'April 2', 'April 3', 'April 4', 'April 5', 'April 6', 'April 7'],
563
+ }}
564
+ >
565
+ <XAxis showLine showTickMarks={showTickMarks} tickMarkSize={16} showGrid />
566
+ <Line seriesId="prices" curve="monotone" showArea />
567
+ <Scrubber />
568
+ </CartesianChart>
569
+ </VStack>
570
+ );
571
+ }
572
+ ```
573
+
574
+ #### Tick Labels
575
+
576
+ You can customize the tick labels using the `tickLabelFormatter` prop. It will receive the x data value of the tick. Meaning, if data is provided for the axis, it will receive the string label for the tick.
577
+
578
+ ```jsx live
579
+ <CartesianChart
580
+ enableScrubbing
581
+ height={250}
582
+ series={[
583
+ {
584
+ id: 'prices',
585
+ data: [10, 22, 29, 45, 98, 45, 22, 52, 21, 4, 68, 20, 21, 58],
586
+ },
587
+ ]}
588
+ xAxis={{
589
+ data: ['April 1', 'April 2', 'April 3', 'April 4', 'April 5', 'April 6', 'April 7'],
590
+ }}
591
+ >
592
+ <XAxis showGrid tickLabelFormatter={(value) => `Day of ${value}`} />
593
+ <Line seriesId="prices" curve="monotone" showArea />
594
+ <Scrubber />
595
+ </CartesianChart>
596
+ ```
597
+
598
+ If no data is set for the axis, it will receive the regular number value of the tick, which is normally the index corresponding to each value in the series.
599
+
600
+ ```jsx live
601
+ <CartesianChart
602
+ enableScrubbing
603
+ height={250}
604
+ series={[
605
+ {
606
+ id: 'prices',
607
+ data: [10, 22, 29, 45, 98, 45, 22, 52, 21, 4, 68, 20, 21, 58],
608
+ },
609
+ ]}
610
+ xAxis={{
611
+ domain: { min: -4, max: 16 },
612
+ }}
613
+ >
614
+ <XAxis showGrid tickLabelFormatter={(value) => value * 2} />
615
+ <Line seriesId="prices" curve="monotone" showArea />
616
+ <Scrubber />
617
+ </CartesianChart>
618
+ ```
619
+
620
+