@coinbase/cds-mcp-server 8.62.1 → 8.66.1
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.
- package/CHANGELOG.md +40 -0
- package/mcp-docs/mobile/components/Accordion.txt +2 -0
- package/mcp-docs/mobile/components/AccordionItem.txt +2 -0
- package/mcp-docs/mobile/components/Alert.txt +2 -0
- package/mcp-docs/mobile/components/AreaChart.txt +92 -250
- package/mcp-docs/mobile/components/Avatar.txt +2 -0
- package/mcp-docs/mobile/components/AvatarButton.txt +2 -0
- package/mcp-docs/mobile/components/Banner.txt +3 -1
- package/mcp-docs/mobile/components/BarChart.txt +5 -1
- package/mcp-docs/mobile/components/Box.txt +2 -0
- package/mcp-docs/mobile/components/BrowserBar.txt +2 -0
- package/mcp-docs/mobile/components/Button.txt +4 -2
- package/mcp-docs/mobile/components/ButtonGroup.txt +2 -0
- package/mcp-docs/mobile/components/Calendar.txt +2 -0
- package/mcp-docs/mobile/components/Carousel.txt +2 -0
- package/mcp-docs/mobile/components/CartesianChart.txt +22 -7
- package/mcp-docs/mobile/components/CellMedia.txt +3 -1
- package/mcp-docs/mobile/components/Checkbox.txt +2 -0
- package/mcp-docs/mobile/components/CheckboxCell.txt +2 -0
- package/mcp-docs/mobile/components/CheckboxGroup.txt +2 -0
- package/mcp-docs/mobile/components/Chip.txt +2 -0
- package/mcp-docs/mobile/components/Coachmark.txt +2 -0
- package/mcp-docs/mobile/components/Collapsible.txt +2 -0
- package/mcp-docs/mobile/components/Combobox.txt +2 -0
- package/mcp-docs/mobile/components/ContainedAssetCard.txt +2 -0
- package/mcp-docs/mobile/components/ContentCard.txt +2 -0
- package/mcp-docs/mobile/components/ContentCardBody.txt +2 -0
- package/mcp-docs/mobile/components/ContentCardFooter.txt +2 -0
- package/mcp-docs/mobile/components/ContentCardHeader.txt +2 -0
- package/mcp-docs/mobile/components/ContentCell.txt +2 -0
- package/mcp-docs/mobile/components/ControlGroup.txt +2 -0
- package/mcp-docs/mobile/components/DataCard.txt +56 -0
- package/mcp-docs/mobile/components/DateInput.txt +2 -0
- package/mcp-docs/mobile/components/DatePicker.txt +2 -0
- package/mcp-docs/mobile/components/Divider.txt +2 -0
- package/mcp-docs/mobile/components/DotCount.txt +2 -0
- package/mcp-docs/mobile/components/DotStatusColor.txt +2 -0
- package/mcp-docs/mobile/components/DotSymbol.txt +3 -1
- package/mcp-docs/mobile/components/Fallback.txt +2 -0
- package/mcp-docs/mobile/components/FloatingAssetCard.txt +2 -0
- package/mcp-docs/mobile/components/HStack.txt +2 -0
- package/mcp-docs/mobile/components/HeroSquare.txt +3 -1
- package/mcp-docs/mobile/components/Icon.txt +3 -1
- package/mcp-docs/mobile/components/IconButton.txt +3 -1
- package/mcp-docs/mobile/components/InputChip.txt +2 -0
- package/mcp-docs/mobile/components/Interactable.txt +2 -0
- package/mcp-docs/mobile/components/Legend.txt +2 -0
- package/mcp-docs/mobile/components/LineChart.txt +3 -1
- package/mcp-docs/mobile/components/Link.txt +2 -0
- package/mcp-docs/mobile/components/ListCell.txt +2 -0
- package/mcp-docs/mobile/components/LogoMark.txt +2 -0
- package/mcp-docs/mobile/components/LogoWordMark.txt +2 -0
- package/mcp-docs/mobile/components/Lottie.txt +2 -0
- package/mcp-docs/mobile/components/LottieStatusAnimation.txt +2 -0
- package/mcp-docs/mobile/components/MediaCard.txt +2 -0
- package/mcp-docs/mobile/components/MediaChip.txt +2 -0
- package/mcp-docs/mobile/components/MessagingCard.txt +2 -0
- package/mcp-docs/mobile/components/Modal.txt +2 -0
- package/mcp-docs/mobile/components/ModalBody.txt +2 -0
- package/mcp-docs/mobile/components/ModalFooter.txt +2 -0
- package/mcp-docs/mobile/components/ModalHeader.txt +3 -1
- package/mcp-docs/mobile/components/MultiContentModule.txt +2 -0
- package/mcp-docs/mobile/components/NavigationTitle.txt +2 -0
- package/mcp-docs/mobile/components/NavigationTitleSelect.txt +2 -0
- package/mcp-docs/mobile/components/NudgeCard.txt +2 -0
- package/mcp-docs/mobile/components/Numpad.txt +2 -0
- package/mcp-docs/mobile/components/Overlay.txt +2 -0
- package/mcp-docs/mobile/components/PageFooter.txt +2 -0
- package/mcp-docs/mobile/components/PageHeader.txt +2 -0
- package/mcp-docs/mobile/components/PercentageBarChart.txt +819 -0
- package/mcp-docs/mobile/components/PeriodSelector.txt +4 -2
- package/mcp-docs/mobile/components/Pictogram.txt +2 -0
- package/mcp-docs/mobile/components/Point.txt +2 -0
- package/mcp-docs/mobile/components/PortalProvider.txt +2 -0
- package/mcp-docs/mobile/components/Pressable.txt +2 -0
- package/mcp-docs/mobile/components/ProgressBar.txt +2 -0
- package/mcp-docs/mobile/components/ProgressBarWithFixedLabels.txt +2 -0
- package/mcp-docs/mobile/components/ProgressBarWithFloatLabel.txt +2 -0
- package/mcp-docs/mobile/components/ProgressCircle.txt +2 -0
- package/mcp-docs/mobile/components/Radio.txt +2 -0
- package/mcp-docs/mobile/components/RadioCell.txt +2 -0
- package/mcp-docs/mobile/components/RadioGroup.txt +2 -0
- package/mcp-docs/mobile/components/ReferenceLine.txt +2 -0
- package/mcp-docs/mobile/components/RemoteImage.txt +2 -0
- package/mcp-docs/mobile/components/RemoteImageGroup.txt +2 -0
- package/mcp-docs/mobile/components/RollingNumber.txt +2 -0
- package/mcp-docs/mobile/components/Scrubber.txt +2 -0
- package/mcp-docs/mobile/components/SearchInput.txt +2 -0
- package/mcp-docs/mobile/components/SectionHeader.txt +2 -0
- package/mcp-docs/mobile/components/SegmentedTabs.txt +4 -2
- package/mcp-docs/mobile/components/Select.txt +2 -0
- package/mcp-docs/mobile/components/SelectAlpha.txt +2 -0
- package/mcp-docs/mobile/components/SelectChip.txt +2 -0
- package/mcp-docs/mobile/components/SelectChipAlpha.txt +2 -0
- package/mcp-docs/mobile/components/SelectOption.txt +2 -0
- package/mcp-docs/mobile/components/SlideButton.txt +2 -0
- package/mcp-docs/mobile/components/Spacer.txt +2 -0
- package/mcp-docs/mobile/components/Sparkline.txt +2 -0
- package/mcp-docs/mobile/components/SparklineGradient.txt +2 -0
- package/mcp-docs/mobile/components/SparklineInteractive.txt +2 -0
- package/mcp-docs/mobile/components/SparklineInteractiveHeader.txt +2 -0
- package/mcp-docs/mobile/components/Spinner.txt +2 -0
- package/mcp-docs/mobile/components/SpotIcon.txt +2 -0
- package/mcp-docs/mobile/components/SpotRectangle.txt +2 -0
- package/mcp-docs/mobile/components/SpotSquare.txt +2 -0
- package/mcp-docs/mobile/components/Stepper.txt +2 -0
- package/mcp-docs/mobile/components/SubBrandLogoMark.txt +2 -0
- package/mcp-docs/mobile/components/SubBrandLogoWordMark.txt +2 -0
- package/mcp-docs/mobile/components/Switch.txt +2 -0
- package/mcp-docs/mobile/components/TabIndicator.txt +2 -0
- package/mcp-docs/mobile/components/TabLabel.txt +2 -0
- package/mcp-docs/mobile/components/TabNavigation.txt +2 -0
- package/mcp-docs/mobile/components/TabbedChips.txt +2 -0
- package/mcp-docs/mobile/components/TabbedChipsAlpha.txt +2 -0
- package/mcp-docs/mobile/components/Tabs.txt +69 -107
- package/mcp-docs/mobile/components/Tag.txt +4 -2
- package/mcp-docs/mobile/components/Text.txt +2 -0
- package/mcp-docs/mobile/components/TextInput.txt +2 -0
- package/mcp-docs/mobile/components/ThemeProvider.txt +2 -0
- package/mcp-docs/mobile/components/Toast.txt +2 -0
- package/mcp-docs/mobile/components/Tooltip.txt +2 -0
- package/mcp-docs/mobile/components/TopNavBar.txt +2 -0
- package/mcp-docs/mobile/components/Tour.txt +13 -0
- package/mcp-docs/mobile/components/Tray.txt +2 -0
- package/mcp-docs/mobile/components/UpsellCard.txt +2 -0
- package/mcp-docs/mobile/components/VStack.txt +2 -0
- package/mcp-docs/mobile/components/XAxis.txt +2 -0
- package/mcp-docs/mobile/components/YAxis.txt +2 -0
- package/mcp-docs/mobile/getting-started/ai-overview.txt +2 -0
- package/mcp-docs/mobile/getting-started/colors.txt +66 -0
- package/mcp-docs/mobile/getting-started/installation.txt +2 -0
- package/mcp-docs/mobile/getting-started/introduction.txt +2 -0
- package/mcp-docs/mobile/getting-started/playground.txt +2 -0
- package/mcp-docs/mobile/getting-started/styling.txt +2 -0
- package/mcp-docs/mobile/getting-started/templates.txt +2 -0
- package/mcp-docs/mobile/getting-started/theming.txt +2 -0
- package/mcp-docs/mobile/guides/v8-migration-guide.txt +2 -0
- package/mcp-docs/mobile/hooks/useDimensions.txt +2 -0
- package/mcp-docs/mobile/hooks/useEventHandler.txt +2 -0
- package/mcp-docs/mobile/hooks/useMergeRefs.txt +2 -0
- package/mcp-docs/mobile/hooks/useOverlayContentContext.txt +2 -0
- package/mcp-docs/mobile/hooks/usePreviousValue.txt +2 -0
- package/mcp-docs/mobile/hooks/useRefMap.txt +2 -0
- package/mcp-docs/mobile/hooks/useTheme.txt +2 -0
- package/mcp-docs/mobile/routes.txt +3 -1
- package/mcp-docs/web/components/Accordion.txt +2 -0
- package/mcp-docs/web/components/AccordionItem.txt +2 -0
- package/mcp-docs/web/components/Alert.txt +2 -0
- package/mcp-docs/web/components/AreaChart.txt +231 -381
- package/mcp-docs/web/components/Avatar.txt +2 -0
- package/mcp-docs/web/components/AvatarButton.txt +2 -0
- package/mcp-docs/web/components/Banner.txt +3 -1
- package/mcp-docs/web/components/BarChart.txt +7 -3
- package/mcp-docs/web/components/Box.txt +2 -0
- package/mcp-docs/web/components/Button.txt +4 -2
- package/mcp-docs/web/components/ButtonGroup.txt +2 -0
- package/mcp-docs/web/components/Calendar.txt +2 -0
- package/mcp-docs/web/components/Carousel.txt +2 -0
- package/mcp-docs/web/components/CartesianChart.txt +22 -5
- package/mcp-docs/web/components/CellMedia.txt +3 -1
- package/mcp-docs/web/components/Checkbox.txt +2 -0
- package/mcp-docs/web/components/CheckboxCell.txt +2 -0
- package/mcp-docs/web/components/CheckboxGroup.txt +2 -0
- package/mcp-docs/web/components/Chip.txt +2 -0
- package/mcp-docs/web/components/Coachmark.txt +2 -0
- package/mcp-docs/web/components/Collapsible.txt +2 -0
- package/mcp-docs/web/components/Combobox.txt +2 -0
- package/mcp-docs/web/components/ContainedAssetCard.txt +2 -0
- package/mcp-docs/web/components/ContentCard.txt +2 -0
- package/mcp-docs/web/components/ContentCardBody.txt +2 -0
- package/mcp-docs/web/components/ContentCardFooter.txt +2 -0
- package/mcp-docs/web/components/ContentCardHeader.txt +2 -0
- package/mcp-docs/web/components/ContentCell.txt +2 -0
- package/mcp-docs/web/components/ControlGroup.txt +2 -0
- package/mcp-docs/web/components/DataCard.txt +100 -0
- package/mcp-docs/web/components/DateInput.txt +2 -0
- package/mcp-docs/web/components/DatePicker.txt +2 -0
- package/mcp-docs/web/components/Divider.txt +2 -0
- package/mcp-docs/web/components/DotCount.txt +2 -0
- package/mcp-docs/web/components/DotStatusColor.txt +2 -0
- package/mcp-docs/web/components/DotSymbol.txt +3 -1
- package/mcp-docs/web/components/Dropdown.txt +2 -0
- package/mcp-docs/web/components/Fallback.txt +2 -0
- package/mcp-docs/web/components/FloatingAssetCard.txt +2 -0
- package/mcp-docs/web/components/FocusTrap.txt +2 -0
- package/mcp-docs/web/components/FullscreenAlert.txt +3 -1
- package/mcp-docs/web/components/FullscreenModal.txt +2 -0
- package/mcp-docs/web/components/FullscreenModalLayout.txt +2 -0
- package/mcp-docs/web/components/Grid.txt +2 -0
- package/mcp-docs/web/components/GridColumn.txt +2 -0
- package/mcp-docs/web/components/HStack.txt +2 -0
- package/mcp-docs/web/components/HeroSquare.txt +3 -1
- package/mcp-docs/web/components/Icon.txt +3 -1
- package/mcp-docs/web/components/IconButton.txt +3 -1
- package/mcp-docs/web/components/InputChip.txt +2 -0
- package/mcp-docs/web/components/Interactable.txt +2 -0
- package/mcp-docs/web/components/Legend.txt +14 -2
- package/mcp-docs/web/components/LineChart.txt +3 -40
- package/mcp-docs/web/components/Link.txt +2 -0
- package/mcp-docs/web/components/ListCell.txt +2 -0
- package/mcp-docs/web/components/LogoMark.txt +2 -0
- package/mcp-docs/web/components/LogoWordMark.txt +2 -0
- package/mcp-docs/web/components/Lottie.txt +2 -0
- package/mcp-docs/web/components/LottieStatusAnimation.txt +2 -0
- package/mcp-docs/web/components/MediaCard.txt +2 -0
- package/mcp-docs/web/components/MediaChip.txt +2 -0
- package/mcp-docs/web/components/MediaQueryProvider.txt +2 -0
- package/mcp-docs/web/components/MessagingCard.txt +2 -0
- package/mcp-docs/web/components/Modal.txt +2 -0
- package/mcp-docs/web/components/ModalBody.txt +2 -0
- package/mcp-docs/web/components/ModalFooter.txt +2 -0
- package/mcp-docs/web/components/ModalHeader.txt +3 -1
- package/mcp-docs/web/components/MultiContentModule.txt +2 -0
- package/mcp-docs/web/components/NavigationBar.txt +2 -0
- package/mcp-docs/web/components/NavigationTitle.txt +2 -0
- package/mcp-docs/web/components/NavigationTitleSelect.txt +2 -0
- package/mcp-docs/web/components/NudgeCard.txt +2 -0
- package/mcp-docs/web/components/Overlay.txt +2 -0
- package/mcp-docs/web/components/PageFooter.txt +2 -0
- package/mcp-docs/web/components/PageHeader.txt +2 -0
- package/mcp-docs/web/components/Pagination.txt +2 -0
- package/mcp-docs/web/components/PercentageBarChart.txt +814 -0
- package/mcp-docs/web/components/PeriodSelector.txt +4 -2
- package/mcp-docs/web/components/Pictogram.txt +2 -0
- package/mcp-docs/web/components/Point.txt +2 -0
- package/mcp-docs/web/components/PopoverPanel.txt +283 -0
- package/mcp-docs/web/components/PortalProvider.txt +2 -0
- package/mcp-docs/web/components/Pressable.txt +2 -0
- package/mcp-docs/web/components/ProgressBar.txt +2 -0
- package/mcp-docs/web/components/ProgressBarWithFixedLabels.txt +2 -0
- package/mcp-docs/web/components/ProgressBarWithFloatLabel.txt +2 -0
- package/mcp-docs/web/components/ProgressCircle.txt +2 -0
- package/mcp-docs/web/components/Radio.txt +2 -0
- package/mcp-docs/web/components/RadioCell.txt +2 -0
- package/mcp-docs/web/components/RadioGroup.txt +2 -0
- package/mcp-docs/web/components/ReferenceLine.txt +2 -0
- package/mcp-docs/web/components/RemoteImage.txt +2 -0
- package/mcp-docs/web/components/RemoteImageGroup.txt +2 -0
- package/mcp-docs/web/components/RollingNumber.txt +2 -0
- package/mcp-docs/web/components/Scrubber.txt +2 -0
- package/mcp-docs/web/components/SearchInput.txt +2 -0
- package/mcp-docs/web/components/SectionHeader.txt +2 -0
- package/mcp-docs/web/components/SegmentedControl.txt +2 -0
- package/mcp-docs/web/components/SegmentedTabs.txt +4 -2
- package/mcp-docs/web/components/Select.txt +2 -0
- package/mcp-docs/web/components/SelectAlpha.txt +2 -0
- package/mcp-docs/web/components/SelectChip.txt +2 -0
- package/mcp-docs/web/components/SelectChipAlpha.txt +2 -0
- package/mcp-docs/web/components/SelectOption.txt +2 -0
- package/mcp-docs/web/components/Sidebar.txt +2 -0
- package/mcp-docs/web/components/SidebarItem.txt +3 -1
- package/mcp-docs/web/components/SidebarMoreMenu.txt +2 -0
- package/mcp-docs/web/components/Spacer.txt +2 -0
- package/mcp-docs/web/components/Sparkline.txt +2 -0
- package/mcp-docs/web/components/SparklineGradient.txt +2 -0
- package/mcp-docs/web/components/SparklineInteractive.txt +2 -0
- package/mcp-docs/web/components/SparklineInteractiveHeader.txt +2 -0
- package/mcp-docs/web/components/Spinner.txt +2 -0
- package/mcp-docs/web/components/SpotIcon.txt +2 -0
- package/mcp-docs/web/components/SpotRectangle.txt +2 -0
- package/mcp-docs/web/components/SpotSquare.txt +2 -0
- package/mcp-docs/web/components/Stepper.txt +2 -0
- package/mcp-docs/web/components/SubBrandLogoMark.txt +2 -0
- package/mcp-docs/web/components/SubBrandLogoWordMark.txt +2 -0
- package/mcp-docs/web/components/Switch.txt +2 -0
- package/mcp-docs/web/components/TabIndicator.txt +2 -0
- package/mcp-docs/web/components/TabLabel.txt +2 -0
- package/mcp-docs/web/components/TabNavigation.txt +2 -0
- package/mcp-docs/web/components/TabbedChips.txt +2 -0
- package/mcp-docs/web/components/TabbedChipsAlpha.txt +2 -0
- package/mcp-docs/web/components/Table.txt +2 -0
- package/mcp-docs/web/components/TableBody.txt +2 -0
- package/mcp-docs/web/components/TableCaption.txt +2 -0
- package/mcp-docs/web/components/TableCell.txt +2 -0
- package/mcp-docs/web/components/TableCellFallback.txt +2 -0
- package/mcp-docs/web/components/TableFooter.txt +2 -0
- package/mcp-docs/web/components/TableHeader.txt +2 -0
- package/mcp-docs/web/components/TableRow.txt +2 -0
- package/mcp-docs/web/components/Tabs.txt +72 -104
- package/mcp-docs/web/components/Tag.txt +4 -2
- package/mcp-docs/web/components/Text.txt +2 -0
- package/mcp-docs/web/components/TextInput.txt +2 -0
- package/mcp-docs/web/components/ThemeProvider.txt +2 -0
- package/mcp-docs/web/components/TileButton.txt +2 -0
- package/mcp-docs/web/components/Toast.txt +2 -0
- package/mcp-docs/web/components/Tooltip.txt +2 -0
- package/mcp-docs/web/components/Tour.txt +14 -0
- package/mcp-docs/web/components/Tray.txt +2 -0
- package/mcp-docs/web/components/UpsellCard.txt +2 -0
- package/mcp-docs/web/components/VStack.txt +2 -0
- package/mcp-docs/web/components/XAxis.txt +2 -0
- package/mcp-docs/web/components/YAxis.txt +2 -0
- package/mcp-docs/web/getting-started/ai-overview.txt +2 -0
- package/mcp-docs/web/getting-started/colors.txt +66 -0
- package/mcp-docs/web/getting-started/installation.txt +3 -1
- package/mcp-docs/web/getting-started/introduction.txt +2 -0
- package/mcp-docs/web/getting-started/playground.txt +2 -0
- package/mcp-docs/web/getting-started/styling.txt +2 -0
- package/mcp-docs/web/getting-started/templates.txt +2 -0
- package/mcp-docs/web/getting-started/theming.txt +2 -0
- package/mcp-docs/web/guides/v8-migration-guide.txt +2 -0
- package/mcp-docs/web/hooks/useBreakpoints.txt +2 -0
- package/mcp-docs/web/hooks/useDimensions.txt +2 -0
- package/mcp-docs/web/hooks/useEventHandler.txt +2 -0
- package/mcp-docs/web/hooks/useHasMounted.txt +2 -0
- package/mcp-docs/web/hooks/useIsoEffect.txt +2 -0
- package/mcp-docs/web/hooks/useMediaQuery.txt +2 -0
- package/mcp-docs/web/hooks/useMergeRefs.txt +2 -0
- package/mcp-docs/web/hooks/useOverlayContentContext.txt +2 -0
- package/mcp-docs/web/hooks/usePreviousValue.txt +2 -0
- package/mcp-docs/web/hooks/useRefMap.txt +2 -0
- package/mcp-docs/web/hooks/useScrollBlocker.txt +2 -0
- package/mcp-docs/web/hooks/useTheme.txt +2 -0
- package/mcp-docs/web/routes.txt +4 -1
- package/package.json +1 -1
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# AreaChart
|
|
2
2
|
|
|
3
|
+
**📖 Live documentation:** https://cds.coinbase.com/components/charts/AreaChart/
|
|
4
|
+
|
|
3
5
|
A chart component that displays data as filled areas beneath lines. Ideal for showing cumulative values, stacked data, or emphasizing volume over time.
|
|
4
6
|
|
|
5
7
|
## Import
|
|
@@ -10,9 +12,11 @@ import { AreaChart } from '@coinbase/cds-web-visualization'
|
|
|
10
12
|
|
|
11
13
|
## Examples
|
|
12
14
|
|
|
13
|
-
AreaChart is a
|
|
15
|
+
AreaChart is a wrapper for [CartesianChart](/components/charts/CartesianChart) that has some unique features over [LineChart](/components/charts/LineChart), such as the ability to stack areas on top of each other and a default value-axis minimum that follows the baseline (`0` when baseline is not set). Charts are built using SVGs.
|
|
16
|
+
|
|
17
|
+
### Basics
|
|
14
18
|
|
|
15
|
-
|
|
19
|
+
The only prop required is `series`, which takes an array of series objects. Each series object needs an `id` and a `data` array of numbers.
|
|
16
20
|
|
|
17
21
|
```jsx live
|
|
18
22
|
<AreaChart
|
|
@@ -34,7 +38,11 @@ AreaChart is a cartesian chart variant that allows for easy visualization of sta
|
|
|
34
38
|
/>
|
|
35
39
|
```
|
|
36
40
|
|
|
37
|
-
###
|
|
41
|
+
### Data
|
|
42
|
+
|
|
43
|
+
#### Positive and Negative
|
|
44
|
+
|
|
45
|
+
Area grows from the baseline to each value, allowing for both positive and negative data to be shown. Also, you can set `baseline` to any value you'd like.
|
|
38
46
|
|
|
39
47
|
```jsx live
|
|
40
48
|
<AreaChart
|
|
@@ -42,26 +50,86 @@ AreaChart is a cartesian chart variant that allows for easy visualization of sta
|
|
|
42
50
|
inset={0}
|
|
43
51
|
series={[
|
|
44
52
|
{
|
|
45
|
-
id: '
|
|
46
|
-
data: [
|
|
53
|
+
id: 'area',
|
|
54
|
+
data: [-40, -28, -21, -5, 48, -5, -28, 2, -29, -48, 18, -30, -29, 8],
|
|
55
|
+
gradient: {
|
|
56
|
+
stops: [
|
|
57
|
+
{ offset: 0, color: 'var(--color-fgNegative)' },
|
|
58
|
+
{ offset: 0, color: 'var(--color-fgPositive)' },
|
|
59
|
+
],
|
|
60
|
+
},
|
|
47
61
|
},
|
|
48
62
|
]}
|
|
49
|
-
type="
|
|
63
|
+
type="dotted"
|
|
50
64
|
showLines
|
|
65
|
+
showYAxis
|
|
66
|
+
yAxis={{
|
|
67
|
+
showGrid: true,
|
|
68
|
+
}}
|
|
51
69
|
/>
|
|
52
70
|
```
|
|
53
71
|
|
|
72
|
+
#### Range
|
|
73
|
+
|
|
74
|
+
You can pass in `[min, max]` tuples as data points to render an area that span a range of values.
|
|
75
|
+
|
|
76
|
+
```jsx live
|
|
77
|
+
<AreaChart
|
|
78
|
+
legend={<Legend seriesIds={['marketCap']} />}
|
|
79
|
+
showXAxis
|
|
80
|
+
showYAxis
|
|
81
|
+
height={250}
|
|
82
|
+
series={[
|
|
83
|
+
{
|
|
84
|
+
id: 'marketCap',
|
|
85
|
+
label: 'Market Cap',
|
|
86
|
+
data: [5.4, 5.8, 6.1, 5.9, 6.0, 6.3],
|
|
87
|
+
showLines: true,
|
|
88
|
+
fillOpacity: 0,
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
id: 'confidenceInterval',
|
|
92
|
+
label: 'Confidence Interval',
|
|
93
|
+
data: [
|
|
94
|
+
[5.3, 5.5],
|
|
95
|
+
[5.6, 6.0],
|
|
96
|
+
[5.8, 6.2],
|
|
97
|
+
[5.8, 6.1],
|
|
98
|
+
[5.9, 6.3],
|
|
99
|
+
[6.2, 6.5],
|
|
100
|
+
],
|
|
101
|
+
fillOpacity: 0.3,
|
|
102
|
+
},
|
|
103
|
+
]}
|
|
104
|
+
xAxis={{
|
|
105
|
+
showLine: true,
|
|
106
|
+
showTickMarks: true,
|
|
107
|
+
data: ['January', 'February', 'March', 'April', 'May', 'June'],
|
|
108
|
+
}}
|
|
109
|
+
yAxis={{
|
|
110
|
+
showGrid: true,
|
|
111
|
+
showLine: true,
|
|
112
|
+
showTickMarks: true,
|
|
113
|
+
domain: { min: 5.0, max: 7.0 },
|
|
114
|
+
tickLabelFormatter: (val) => `$${val}B`,
|
|
115
|
+
}}
|
|
116
|
+
>
|
|
117
|
+
<Line seriesId="marketCap" />
|
|
118
|
+
</AreaChart>
|
|
119
|
+
```
|
|
120
|
+
|
|
54
121
|
### Stacking
|
|
55
122
|
|
|
56
|
-
You can use the `stacked` prop to stack all areas on top of each other. You can also use the `stackId` prop on a series to create different stack groups. See [CartesianChart](/components/charts/CartesianChart/#series-stacks) for more
|
|
123
|
+
You can use the `stacked` prop to stack all areas on top of each other. You can also use the `stackId` prop on a series to create different stack groups. See [CartesianChart](/components/charts/CartesianChart/#series-stacks) for more info on stacking.
|
|
57
124
|
|
|
58
125
|
```jsx live
|
|
59
126
|
<AreaChart
|
|
60
127
|
showLines
|
|
61
128
|
stacked
|
|
62
129
|
curve="natural"
|
|
130
|
+
legend
|
|
63
131
|
height={{ base: 150, tablet: 200, desktop: 250 }}
|
|
64
|
-
inset={0}
|
|
132
|
+
inset={{ top: 0, bottom: 8, left: 0, right: 0 }}
|
|
65
133
|
series={[
|
|
66
134
|
{
|
|
67
135
|
id: 'currentRewards',
|
|
@@ -70,6 +138,8 @@ You can use the `stacked` prop to stack all areas on top of each other. You can
|
|
|
70
138
|
3700, 4170,
|
|
71
139
|
],
|
|
72
140
|
color: 'var(--color-fg)',
|
|
141
|
+
legendShape: 'squircle',
|
|
142
|
+
label: 'Current Rewards',
|
|
73
143
|
},
|
|
74
144
|
{
|
|
75
145
|
id: 'potentialRewards',
|
|
@@ -78,7 +148,9 @@ You can use the `stacked` prop to stack all areas on top of each other. You can
|
|
|
78
148
|
3520, 3900,
|
|
79
149
|
],
|
|
80
150
|
color: 'var(--color-fgPositive)',
|
|
81
|
-
LineComponent: DottedLine
|
|
151
|
+
LineComponent: (props) => <DottedLine {...props} strokeDasharray="6 6" />,
|
|
152
|
+
legendShape: 'squircle',
|
|
153
|
+
label: 'Potential Rewards',
|
|
82
154
|
},
|
|
83
155
|
]}
|
|
84
156
|
AreaComponent={(props) => <DottedArea {...props} peakOpacity={0.4} baselineOpacity={0.4} />}
|
|
@@ -86,30 +158,9 @@ You can use the `stacked` prop to stack all areas on top of each other. You can
|
|
|
86
158
|
/>
|
|
87
159
|
```
|
|
88
160
|
|
|
89
|
-
###
|
|
161
|
+
### Styling
|
|
90
162
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
```jsx live
|
|
94
|
-
<AreaChart
|
|
95
|
-
height={{ base: 150, tablet: 200, desktop: 250 }}
|
|
96
|
-
inset={0}
|
|
97
|
-
series={[
|
|
98
|
-
{
|
|
99
|
-
id: 'pageViews',
|
|
100
|
-
data: [24, 13, -98, 39, 48, 38, 43],
|
|
101
|
-
},
|
|
102
|
-
]}
|
|
103
|
-
AreaComponent={(props) => <SolidArea {...props} opacity={0.4} />}
|
|
104
|
-
showLines
|
|
105
|
-
showYAxis
|
|
106
|
-
yAxis={{
|
|
107
|
-
showGrid: true,
|
|
108
|
-
}}
|
|
109
|
-
/>
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
### Area Styles
|
|
163
|
+
#### Areas
|
|
113
164
|
|
|
114
165
|
You can have different area styles for each series.
|
|
115
166
|
|
|
@@ -142,374 +193,173 @@ You can have different area styles for each series.
|
|
|
142
193
|
/>
|
|
143
194
|
```
|
|
144
195
|
|
|
145
|
-
|
|
196
|
+
#### Axes
|
|
146
197
|
|
|
147
|
-
|
|
198
|
+
Using `showXAxis` and `showYAxis` allows you to display the axes. For more information, such as adjusting domain and range, see [XAxis](/components/charts/XAxis) and [YAxis](/components/charts/YAxis).
|
|
148
199
|
|
|
149
200
|
```jsx live
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
let direction;
|
|
176
|
-
if (previousValue >= maxDataOffset) {
|
|
177
|
-
direction = -1;
|
|
178
|
-
} else if (previousValue <= minYValue) {
|
|
179
|
-
direction = 1;
|
|
180
|
-
} else {
|
|
181
|
-
direction = Math.random() < 0.5 ? -1 : 1;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
let newValue = previousValue + offset * direction;
|
|
185
|
-
newValue = Math.max(minYValue, Math.min(maxDataOffset, newValue));
|
|
186
|
-
return newValue;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
function generateInitialData() {
|
|
190
|
-
const data = [];
|
|
191
|
-
|
|
192
|
-
let previousValue = minYValue + Math.random() * (maxDataOffset - minYValue);
|
|
193
|
-
data.push(previousValue);
|
|
194
|
-
|
|
195
|
-
for (let i = 1; i < dataCount; i++) {
|
|
196
|
-
const newValue = generateNextValue(previousValue);
|
|
197
|
-
data.push(newValue);
|
|
198
|
-
previousValue = newValue;
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
return data;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
const MemoizedDottedArea = memo((props) => (
|
|
205
|
-
<DottedArea {...props} baselineOpacity={1} peakOpacity={1} />
|
|
206
|
-
));
|
|
207
|
-
|
|
208
|
-
function AnimatedChart(props) {
|
|
209
|
-
const [data, setData] = useState(generateInitialData);
|
|
210
|
-
|
|
211
|
-
useEffect(() => {
|
|
212
|
-
const intervalId = setInterval(() => {
|
|
213
|
-
setData((currentData) => {
|
|
214
|
-
const lastValue = currentData[currentData.length - 1] ?? 0;
|
|
215
|
-
const newValue = generateNextValue(lastValue);
|
|
216
|
-
|
|
217
|
-
return [...currentData.slice(1), newValue];
|
|
218
|
-
});
|
|
219
|
-
}, updateInterval);
|
|
220
|
-
|
|
221
|
-
return () => clearInterval(intervalId);
|
|
222
|
-
}, []);
|
|
223
|
-
|
|
224
|
-
const series = seriesConfig.map((config, index) => ({
|
|
225
|
-
id: config.id,
|
|
226
|
-
label: config.label,
|
|
227
|
-
color: config.color,
|
|
228
|
-
data: index === 0 ? data : Array(dataCount).fill(seriesSpacing),
|
|
229
|
-
}));
|
|
230
|
-
|
|
231
|
-
return (
|
|
232
|
-
<AreaChart
|
|
233
|
-
overflow="visible"
|
|
234
|
-
stacked
|
|
235
|
-
height={{ base: 200, tablet: 250, desktop: 300 }}
|
|
236
|
-
series={series}
|
|
237
|
-
type="dotted"
|
|
238
|
-
showLines
|
|
239
|
-
AreaComponent={MemoizedDottedArea}
|
|
240
|
-
transitions={{
|
|
241
|
-
enter: { type: 'spring', stiffness: 700, damping: 80 },
|
|
242
|
-
update: { type: 'spring', stiffness: 700, damping: 20 },
|
|
243
|
-
}}
|
|
244
|
-
inset={0}
|
|
245
|
-
showYAxis
|
|
246
|
-
yAxis={{
|
|
247
|
-
showGrid: true,
|
|
248
|
-
width: 0,
|
|
249
|
-
tickLabelFormatter: () => '',
|
|
250
|
-
domain: { min: 0, max: domainLimit },
|
|
251
|
-
}}
|
|
252
|
-
{...props}
|
|
253
|
-
/>
|
|
254
|
-
);
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
function AnimatedChartExample() {
|
|
258
|
-
const animatedStates = [
|
|
259
|
-
{ id: 'on', label: 'On' },
|
|
260
|
-
{ id: 'off', label: 'Off' },
|
|
261
|
-
];
|
|
262
|
-
const [animatedState, setAnimatedState] = useState(animatedStates[0]);
|
|
263
|
-
|
|
264
|
-
return (
|
|
265
|
-
<VStack gap={2}>
|
|
266
|
-
<HStack justifyContent="flex-end" gap={2} alignItems="center">
|
|
267
|
-
<Text as="h3" font="headline">
|
|
268
|
-
Animations
|
|
269
|
-
</Text>
|
|
270
|
-
<SegmentedTabs
|
|
271
|
-
activeTab={animatedState}
|
|
272
|
-
onChange={setAnimatedState}
|
|
273
|
-
tabs={animatedStates}
|
|
274
|
-
/>
|
|
275
|
-
</HStack>
|
|
276
|
-
<AnimatedChart animate={animatedState.id === 'on'} />
|
|
277
|
-
</VStack>
|
|
278
|
-
);
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
return <AnimatedChartExample />;
|
|
282
|
-
}
|
|
201
|
+
<AreaChart
|
|
202
|
+
showLines
|
|
203
|
+
showXAxis
|
|
204
|
+
showYAxis
|
|
205
|
+
height={{ base: 200, tablet: 225, desktop: 250 }}
|
|
206
|
+
series={[
|
|
207
|
+
{
|
|
208
|
+
id: 'prices',
|
|
209
|
+
data: [10, 22, 29, 45, 98, 45, 22, 52, 21, 4, 68, 20, 21, 58],
|
|
210
|
+
},
|
|
211
|
+
]}
|
|
212
|
+
xAxis={{
|
|
213
|
+
showGrid: true,
|
|
214
|
+
showLine: true,
|
|
215
|
+
showTickMarks: true,
|
|
216
|
+
tickLabelFormatter: (dataX) => `Day ${dataX}`,
|
|
217
|
+
}}
|
|
218
|
+
yAxis={{
|
|
219
|
+
showGrid: true,
|
|
220
|
+
showLine: true,
|
|
221
|
+
showTickMarks: true,
|
|
222
|
+
}}
|
|
223
|
+
fillOpacity={0.5}
|
|
224
|
+
/>
|
|
283
225
|
```
|
|
284
226
|
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
You can use the `gradient` prop on `series` or `Area` components to enable gradients.
|
|
227
|
+
#### Gradient
|
|
288
228
|
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
Values in between stops will be interpolated smoothly using [srgb color space](https://www.w3.org/TR/SVG11/painting.html#ColorInterpolationProperty).
|
|
229
|
+
You can build threshold-based gradients with hard transitions by reusing stop offsets.
|
|
292
230
|
|
|
293
231
|
```jsx live
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
border: `2px solid rgb(var(--${color}50))`,
|
|
323
|
-
outlineColor: `rgb(var(--${color}80))`,
|
|
324
|
-
outline:
|
|
325
|
-
currentSpectrumColor === color ? `2px solid rgb(var(--${color}80))` : undefined,
|
|
326
|
-
}}
|
|
327
|
-
width={{ base: 16, tablet: 24, desktop: 24 }}
|
|
328
|
-
height={{ base: 16, tablet: 24, desktop: 24 }}
|
|
329
|
-
borderRadius={1000}
|
|
330
|
-
/>
|
|
331
|
-
))}
|
|
332
|
-
</HStack>
|
|
333
|
-
<AreaChart
|
|
334
|
-
enableScrubbing
|
|
335
|
-
height={{ base: 150, tablet: 200, desktop: 250 }}
|
|
336
|
-
series={[
|
|
337
|
-
{
|
|
338
|
-
id: 'prices',
|
|
339
|
-
data: data,
|
|
340
|
-
gradient: {
|
|
341
|
-
stops: ({ min, max }) => [
|
|
342
|
-
// Allows a function which accepts min/max or direct array
|
|
343
|
-
{ offset: min, color: `rgb(var(--${currentSpectrumColor}80))` },
|
|
344
|
-
{ offset: max, color: `rgb(var(--${currentSpectrumColor}20))` },
|
|
345
|
-
],
|
|
346
|
-
},
|
|
347
|
-
},
|
|
348
|
-
]}
|
|
349
|
-
showYAxis
|
|
350
|
-
yAxis={{
|
|
351
|
-
showGrid: true,
|
|
352
|
-
}}
|
|
353
|
-
>
|
|
354
|
-
<Scrubber />
|
|
355
|
-
</AreaChart>
|
|
356
|
-
</VStack>
|
|
357
|
-
);
|
|
358
|
-
}
|
|
232
|
+
<AreaChart
|
|
233
|
+
showLines
|
|
234
|
+
showYAxis
|
|
235
|
+
height={{ base: 180, tablet: 220, desktop: 260 }}
|
|
236
|
+
series={[
|
|
237
|
+
{
|
|
238
|
+
id: 'netFlow',
|
|
239
|
+
label: 'Net Flow',
|
|
240
|
+
data: [-9, -7, -3, -1, 2, 5, 3, -2, 1, 6, 8, 4],
|
|
241
|
+
gradient: {
|
|
242
|
+
stops: ({ min, max }) => [
|
|
243
|
+
{ offset: min, color: 'var(--color-fgNegative)', opacity: 0.45 },
|
|
244
|
+
{ offset: -2, color: 'var(--color-fgNegative)', opacity: 0.45 },
|
|
245
|
+
{ offset: -2, color: 'var(--color-fgWarning)', opacity: 0.45 },
|
|
246
|
+
{ offset: 2, color: 'var(--color-fgWarning)', opacity: 0.45 },
|
|
247
|
+
{ offset: 2, color: 'var(--color-fgPositive)', opacity: 0.45 },
|
|
248
|
+
{ offset: max, color: 'var(--color-fgPositive)', opacity: 0.45 },
|
|
249
|
+
],
|
|
250
|
+
},
|
|
251
|
+
type: 'gradient',
|
|
252
|
+
},
|
|
253
|
+
]}
|
|
254
|
+
yAxis={{
|
|
255
|
+
showGrid: true,
|
|
256
|
+
domain: { min: -10, max: 10 },
|
|
257
|
+
tickLabelFormatter: (value) => `${value}%`,
|
|
258
|
+
}}
|
|
259
|
+
/>
|
|
359
260
|
```
|
|
360
261
|
|
|
361
|
-
|
|
262
|
+
### Composed Examples
|
|
362
263
|
|
|
363
|
-
|
|
264
|
+
#### Custom Baseline
|
|
364
265
|
|
|
365
|
-
|
|
366
|
-
function DiscreteGradient() {
|
|
367
|
-
const spectrumColors = [
|
|
368
|
-
'blue',
|
|
369
|
-
'green',
|
|
370
|
-
'orange',
|
|
371
|
-
'yellow',
|
|
372
|
-
'gray',
|
|
373
|
-
'indigo',
|
|
374
|
-
'pink',
|
|
375
|
-
'purple',
|
|
376
|
-
'red',
|
|
377
|
-
'teal',
|
|
378
|
-
'chartreuse',
|
|
379
|
-
];
|
|
380
|
-
const data = [10, 22, 29, 45, 98, 45, 22, 52, 21, 4, 68, 20, 21, 58];
|
|
381
|
-
|
|
382
|
-
const [currentSpectrumColor, setCurrentSpectrumColor] = useState('pink');
|
|
266
|
+
You can combine a custom baseline with a scrubber label that shows both price and date.
|
|
383
267
|
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
{ offset: min + (max - min) / 3, color: `rgb(var(--${currentSpectrumColor}80))` },
|
|
416
|
-
{ offset: min + (max - min) / 3, color: `rgb(var(--${currentSpectrumColor}50))` },
|
|
417
|
-
{
|
|
418
|
-
offset: min + ((max - min) / 3) * 2,
|
|
419
|
-
color: `rgb(var(--${currentSpectrumColor}50))`,
|
|
420
|
-
},
|
|
421
|
-
{
|
|
422
|
-
offset: min + ((max - min) / 3) * 2,
|
|
423
|
-
color: `rgb(var(--${currentSpectrumColor}20))`,
|
|
424
|
-
},
|
|
425
|
-
{ offset: max, color: `rgb(var(--${currentSpectrumColor}20))` },
|
|
426
|
-
],
|
|
427
|
-
},
|
|
428
|
-
},
|
|
429
|
-
]}
|
|
430
|
-
showLines
|
|
431
|
-
strokeWidth={4}
|
|
432
|
-
showYAxis
|
|
433
|
-
yAxis={{
|
|
434
|
-
showGrid: true,
|
|
435
|
-
}}
|
|
436
|
-
fillOpacity={0.5}
|
|
437
|
-
>
|
|
438
|
-
<Scrubber />
|
|
439
|
-
</AreaChart>
|
|
440
|
-
</VStack>
|
|
268
|
+
```jsx live
|
|
269
|
+
function CustomBaseline() {
|
|
270
|
+
const candles = [...btcCandles].reverse().slice(0, 180);
|
|
271
|
+
const prices = candles.map((candle) => parseFloat(candle.close));
|
|
272
|
+
const dates = candles.map((candle) => new Date(parseInt(candle.start, 10) * 1000));
|
|
273
|
+
|
|
274
|
+
const startingPrice = prices[0];
|
|
275
|
+
|
|
276
|
+
const formatPrice = useCallback((price) => {
|
|
277
|
+
return `$${price.toLocaleString('en-US', {
|
|
278
|
+
minimumFractionDigits: 2,
|
|
279
|
+
maximumFractionDigits: 2,
|
|
280
|
+
})}`;
|
|
281
|
+
}, []);
|
|
282
|
+
|
|
283
|
+
const formatDate = useCallback((date) => {
|
|
284
|
+
return date.toLocaleDateString('en-US', { month: 'short', day: 'numeric', year: 'numeric' });
|
|
285
|
+
}, []);
|
|
286
|
+
|
|
287
|
+
const formatLabel = useCallback(
|
|
288
|
+
(dataIndex) => {
|
|
289
|
+
const price = prices[dataIndex];
|
|
290
|
+
const date = dates[dataIndex];
|
|
291
|
+
|
|
292
|
+
return (
|
|
293
|
+
<>
|
|
294
|
+
<tspan style={{ fontWeight: 'bold' }}>{formatPrice(price)}</tspan> {formatDate(date)}
|
|
295
|
+
</>
|
|
296
|
+
);
|
|
297
|
+
},
|
|
298
|
+
[dates, formatDate, formatPrice, prices],
|
|
441
299
|
);
|
|
442
|
-
}
|
|
443
|
-
```
|
|
444
300
|
|
|
445
|
-
|
|
301
|
+
const PriceLabel = memo((props) => (
|
|
302
|
+
<DefaultReferenceLineLabel
|
|
303
|
+
{...props}
|
|
304
|
+
background="var(--color-bgSecondary)"
|
|
305
|
+
borderRadius={12.5}
|
|
306
|
+
color="var(--color-fg)"
|
|
307
|
+
dx={12}
|
|
308
|
+
font="label1"
|
|
309
|
+
horizontalAlignment="left"
|
|
310
|
+
inset={{ top: 4, bottom: 4, left: 8, right: 8 }}
|
|
311
|
+
/>
|
|
312
|
+
));
|
|
446
313
|
|
|
447
|
-
|
|
314
|
+
const chartAccessibilityLabel = `Bitcoin area chart with custom baseline. Current price: ${formatPrice(
|
|
315
|
+
prices[prices.length - 1],
|
|
316
|
+
)}. Use arrow keys to navigate.`;
|
|
448
317
|
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
'green',
|
|
454
|
-
'orange',
|
|
455
|
-
'yellow',
|
|
456
|
-
'gray',
|
|
457
|
-
'indigo',
|
|
458
|
-
'pink',
|
|
459
|
-
'purple',
|
|
460
|
-
'red',
|
|
461
|
-
'teal',
|
|
462
|
-
'chartreuse',
|
|
463
|
-
];
|
|
464
|
-
const data = [10, 22, 29, 45, 98, 45, 22, 52, 21, 4, 68, 20, 21, 58];
|
|
465
|
-
|
|
466
|
-
const [currentSpectrumColor, setCurrentSpectrumColor] = useState('pink');
|
|
318
|
+
const getScrubberAccessibilityLabel = useCallback(
|
|
319
|
+
(index) => `${formatPrice(prices[index])} ${formatDate(dates[index])}`,
|
|
320
|
+
[dates, formatDate, formatPrice, prices],
|
|
321
|
+
);
|
|
467
322
|
|
|
468
323
|
return (
|
|
469
|
-
<
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
/>
|
|
487
|
-
))}
|
|
488
|
-
</HStack>
|
|
489
|
-
<AreaChart
|
|
490
|
-
enableScrubbing
|
|
491
|
-
height={{ base: 150, tablet: 200, desktop: 250 }}
|
|
492
|
-
series={[
|
|
493
|
-
{
|
|
494
|
-
id: 'prices',
|
|
495
|
-
data: data,
|
|
496
|
-
gradient: {
|
|
497
|
-
axis: 'x',
|
|
498
|
-
stops: ({ min, max }) => [
|
|
499
|
-
{ offset: min, color: `rgb(var(--${currentSpectrumColor}80))`, opacity: 0 },
|
|
500
|
-
{ offset: max, color: `rgb(var(--${currentSpectrumColor}20))`, opacity: 1 },
|
|
501
|
-
],
|
|
502
|
-
},
|
|
324
|
+
<AreaChart
|
|
325
|
+
enableScrubbing
|
|
326
|
+
showLines
|
|
327
|
+
showYAxis
|
|
328
|
+
accessibilityLabel={chartAccessibilityLabel}
|
|
329
|
+
getScrubberAccessibilityLabel={getScrubberAccessibilityLabel}
|
|
330
|
+
fillOpacity={0.5}
|
|
331
|
+
height={300}
|
|
332
|
+
series={[
|
|
333
|
+
{
|
|
334
|
+
id: 'prices',
|
|
335
|
+
data: prices,
|
|
336
|
+
gradient: {
|
|
337
|
+
stops: [
|
|
338
|
+
{ offset: startingPrice, color: 'var(--color-fgNegative)' },
|
|
339
|
+
{ offset: startingPrice, color: 'var(--color-fgPositive)' },
|
|
340
|
+
],
|
|
503
341
|
},
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
342
|
+
},
|
|
343
|
+
]}
|
|
344
|
+
yAxis={{
|
|
345
|
+
baseline: startingPrice,
|
|
346
|
+
showGrid: true,
|
|
347
|
+
tickLabelFormatter: formatPrice,
|
|
348
|
+
domain: { min: 70000, max: 120000 },
|
|
349
|
+
width: 80,
|
|
350
|
+
ticks: [80000, 100000, 120000],
|
|
351
|
+
}}
|
|
352
|
+
>
|
|
353
|
+
<Scrubber label={formatLabel} labelElevated />
|
|
354
|
+
<ReferenceLine
|
|
355
|
+
LabelComponent={PriceLabel}
|
|
356
|
+
LineComponent={(props) => (
|
|
357
|
+
<DottedLine {...props} stroke="var(--color-fg)" strokeDasharray="0 16" strokeWidth={3} />
|
|
358
|
+
)}
|
|
359
|
+
dataY={startingPrice}
|
|
360
|
+
label={formatPrice(startingPrice)}
|
|
361
|
+
/>
|
|
362
|
+
</AreaChart>
|
|
513
363
|
);
|
|
514
364
|
}
|
|
515
365
|
```
|
|
@@ -634,7 +484,7 @@ function XAxisGradient() {
|
|
|
634
484
|
| `top` | `ResponsiveProp<Top<string \| number>>` | No | `-` | - |
|
|
635
485
|
| `transform` | `inherit \| none \| revert \| -moz-initial \| initial \| revert-layer \| unset` | No | `-` | - |
|
|
636
486
|
| `transition` | `Orchestration & Repeat & Tween \| Orchestration & Repeat & Spring \| Orchestration & Repeat & Keyframes \| Orchestration & Repeat & Inertia \| Orchestration & Repeat & Just \| Orchestration & Repeat & None \| Orchestration & Repeat & PermissiveTransitionDefinition \| Orchestration & Repeat & Tween & { [key: string]: TransitionDefinition; } \| Orchestration & Repeat & Spring & { [key: string]: TransitionDefinition; } \| Orchestration & Repeat & Keyframes & { [key: string]: TransitionDefinition; } \| Orchestration & Repeat & Inertia & { [key: string]: TransitionDefinition; } \| Orchestration & Repeat & Just & { [key: string]: TransitionDefinition; } \| Orchestration & Repeat & None & { [key: string]: TransitionDefinition; } \| Orchestration & Repeat & PermissiveTransitionDefinition & { [key: string]: TransitionDefinition; }` | No | `-` | Transition for updates. |
|
|
637
|
-
| `transitions` | `{ enter?: Transition$1 \| null; update?: Transition$1 \| null \| undefined; } \| undefined` | No | `transitions = {{ enter: { type: 'tween', duration: 0.5 }, update: { type: 'spring', stiffness: 900, damping: 120, mass: 4 } }}` | Transition configuration for enter and update animations. |
|
|
487
|
+
| `transitions` | `{ enter?: Transition$1 \| null; enterOpacity?: Transition$1 \| null \| undefined; update?: Transition$1 \| null \| undefined; } \| undefined` | No | `transitions = {{ enter: { type: 'tween', duration: 0.5 }, enterOpacity: undefined, update: { type: 'spring', stiffness: 900, damping: 120, mass: 4 } }}` | Transition configuration for enter and update animations. |
|
|
638
488
|
| `type` | `dotted \| solid \| gradient` | No | `'solid'` | The type of area to render. |
|
|
639
489
|
| `userSelect` | `ResponsiveProp<text \| none \| all \| auto>` | No | `-` | - |
|
|
640
490
|
| `visibility` | `ResponsiveProp<hidden \| visible>` | No | `-` | - |
|