@coinbase/cds-mcp-server 8.17.2 → 8.17.4

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