@coinbase/cds-mobile-visualization 0.0.0 → 3.4.0-beta.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 +26 -0
- package/README.md +3 -0
- package/dts/chart/CartesianChart.d.ts +101 -0
- package/dts/chart/CartesianChart.d.ts.map +1 -0
- package/dts/chart/ChartProvider.d.ts +6 -0
- package/dts/chart/ChartProvider.d.ts.map +1 -0
- package/dts/chart/Path.d.ts +48 -0
- package/dts/chart/Path.d.ts.map +1 -0
- package/dts/chart/PeriodSelector.d.ts +85 -0
- package/dts/chart/PeriodSelector.d.ts.map +1 -0
- package/dts/chart/Point.d.ts +103 -0
- package/dts/chart/Point.d.ts.map +1 -0
- package/dts/chart/area/Area.d.ts +62 -0
- package/dts/chart/area/Area.d.ts.map +1 -0
- package/dts/chart/area/AreaChart.d.ts +90 -0
- package/dts/chart/area/AreaChart.d.ts.map +1 -0
- package/dts/chart/area/DottedArea.d.ts +27 -0
- package/dts/chart/area/DottedArea.d.ts.map +1 -0
- package/dts/chart/area/GradientArea.d.ts +30 -0
- package/dts/chart/area/GradientArea.d.ts.map +1 -0
- package/dts/chart/area/SolidArea.d.ts +8 -0
- package/dts/chart/area/SolidArea.d.ts.map +1 -0
- package/dts/chart/area/index.d.ts +6 -0
- package/dts/chart/area/index.d.ts.map +1 -0
- package/dts/chart/axis/Axis.d.ts +204 -0
- package/dts/chart/axis/Axis.d.ts.map +1 -0
- package/dts/chart/axis/XAxis.d.ts +16 -0
- package/dts/chart/axis/XAxis.d.ts.map +1 -0
- package/dts/chart/axis/YAxis.d.ts +21 -0
- package/dts/chart/axis/YAxis.d.ts.map +1 -0
- package/dts/chart/axis/index.d.ts +4 -0
- package/dts/chart/axis/index.d.ts.map +1 -0
- package/dts/chart/bar/Bar.d.ts +89 -0
- package/dts/chart/bar/Bar.d.ts.map +1 -0
- package/dts/chart/bar/BarChart.d.ts +97 -0
- package/dts/chart/bar/BarChart.d.ts.map +1 -0
- package/dts/chart/bar/BarPlot.d.ts +29 -0
- package/dts/chart/bar/BarPlot.d.ts.map +1 -0
- package/dts/chart/bar/BarStack.d.ts +111 -0
- package/dts/chart/bar/BarStack.d.ts.map +1 -0
- package/dts/chart/bar/BarStackGroup.d.ts +35 -0
- package/dts/chart/bar/BarStackGroup.d.ts.map +1 -0
- package/dts/chart/bar/DefaultBar.d.ts +7 -0
- package/dts/chart/bar/DefaultBar.d.ts.map +1 -0
- package/dts/chart/bar/DefaultBarStack.d.ts +7 -0
- package/dts/chart/bar/DefaultBarStack.d.ts.map +1 -0
- package/dts/chart/bar/index.d.ts +8 -0
- package/dts/chart/bar/index.d.ts.map +1 -0
- package/dts/chart/index.d.ts +13 -0
- package/dts/chart/index.d.ts.map +1 -0
- package/dts/chart/line/DottedLine.d.ts +12 -0
- package/dts/chart/line/DottedLine.d.ts.map +1 -0
- package/dts/chart/line/GradientLine.d.ts +45 -0
- package/dts/chart/line/GradientLine.d.ts.map +1 -0
- package/dts/chart/line/Line.d.ts +78 -0
- package/dts/chart/line/Line.d.ts.map +1 -0
- package/dts/chart/line/LineChart.d.ts +84 -0
- package/dts/chart/line/LineChart.d.ts.map +1 -0
- package/dts/chart/line/ReferenceLine.d.ts +91 -0
- package/dts/chart/line/ReferenceLine.d.ts.map +1 -0
- package/dts/chart/line/SolidLine.d.ts +12 -0
- package/dts/chart/line/SolidLine.d.ts.map +1 -0
- package/dts/chart/line/index.d.ts +7 -0
- package/dts/chart/line/index.d.ts.map +1 -0
- package/dts/chart/scrubber/Scrubber.d.ts +104 -0
- package/dts/chart/scrubber/Scrubber.d.ts.map +1 -0
- package/dts/chart/scrubber/ScrubberBeacon.d.ts +75 -0
- package/dts/chart/scrubber/ScrubberBeacon.d.ts.map +1 -0
- package/dts/chart/scrubber/ScrubberProvider.d.ts +17 -0
- package/dts/chart/scrubber/ScrubberProvider.d.ts.map +1 -0
- package/dts/chart/scrubber/index.d.ts +2 -0
- package/dts/chart/scrubber/index.d.ts.map +1 -0
- package/dts/chart/text/ChartText.d.ts +90 -0
- package/dts/chart/text/ChartText.d.ts.map +1 -0
- package/dts/chart/text/SmartChartTextGroup.d.ts +55 -0
- package/dts/chart/text/SmartChartTextGroup.d.ts.map +1 -0
- package/dts/chart/text/index.d.ts +3 -0
- package/dts/chart/text/index.d.ts.map +1 -0
- package/dts/chart/utils/axis.d.ts +342 -0
- package/dts/chart/utils/axis.d.ts.map +1 -0
- package/dts/chart/utils/bar.d.ts +20 -0
- package/dts/chart/utils/bar.d.ts.map +1 -0
- package/dts/chart/utils/chart.d.ts +97 -0
- package/dts/chart/utils/chart.d.ts.map +1 -0
- package/dts/chart/utils/context.d.ts +95 -0
- package/dts/chart/utils/context.d.ts.map +1 -0
- package/dts/chart/utils/index.d.ts +8 -0
- package/dts/chart/utils/index.d.ts.map +1 -0
- package/dts/chart/utils/path.d.ts +107 -0
- package/dts/chart/utils/path.d.ts.map +1 -0
- package/dts/chart/utils/point.d.ts +75 -0
- package/dts/chart/utils/point.d.ts.map +1 -0
- package/dts/chart/utils/scale.d.ts +43 -0
- package/dts/chart/utils/scale.d.ts.map +1 -0
- package/dts/index.d.ts +3 -0
- package/dts/index.d.ts.map +1 -0
- package/dts/sparkline/Counter.d.ts +8 -0
- package/dts/sparkline/Counter.d.ts.map +1 -0
- package/dts/sparkline/Sparkline.d.ts +73 -0
- package/dts/sparkline/Sparkline.d.ts.map +1 -0
- package/dts/sparkline/SparklineArea.d.ts +14 -0
- package/dts/sparkline/SparklineArea.d.ts.map +1 -0
- package/dts/sparkline/SparklineAreaPattern.d.ts +14 -0
- package/dts/sparkline/SparklineAreaPattern.d.ts.map +1 -0
- package/dts/sparkline/SparklineGradient.d.ts +23 -0
- package/dts/sparkline/SparklineGradient.d.ts.map +1 -0
- package/dts/sparkline/__figma__/Sparkline.figma.d.ts +2 -0
- package/dts/sparkline/__figma__/Sparkline.figma.d.ts.map +1 -0
- package/dts/sparkline/generateSparklineWithId.d.ts +11 -0
- package/dts/sparkline/generateSparklineWithId.d.ts.map +1 -0
- package/dts/sparkline/index.d.ts +6 -0
- package/dts/sparkline/index.d.ts.map +1 -0
- package/dts/sparkline/sparkline-interactive/SparklineAccessibleView.d.ts +23 -0
- package/dts/sparkline/sparkline-interactive/SparklineAccessibleView.d.ts.map +1 -0
- package/dts/sparkline/sparkline-interactive/SparklineInteractive.d.ts +184 -0
- package/dts/sparkline/sparkline-interactive/SparklineInteractive.d.ts.map +1 -0
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveAnimatedPath.d.ts +25 -0
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveAnimatedPath.d.ts.map +1 -0
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveHoverDate.d.ts +28 -0
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveHoverDate.d.ts.map +1 -0
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveLineVertical.d.ts +13 -0
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveLineVertical.d.ts.map +1 -0
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveMarkerDates.d.ts +17 -0
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveMarkerDates.d.ts.map +1 -0
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveMinMax.d.ts +11 -0
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveMinMax.d.ts.map +1 -0
- package/dts/sparkline/sparkline-interactive/SparklineInteractivePanGestureHandler.d.ts +26 -0
- package/dts/sparkline/sparkline-interactive/SparklineInteractivePanGestureHandler.d.ts.map +1 -0
- package/dts/sparkline/sparkline-interactive/SparklineInteractivePaths.d.ts +25 -0
- package/dts/sparkline/sparkline-interactive/SparklineInteractivePaths.d.ts.map +1 -0
- package/dts/sparkline/sparkline-interactive/SparklineInteractivePeriodSelector.d.ts +25 -0
- package/dts/sparkline/sparkline-interactive/SparklineInteractivePeriodSelector.d.ts.map +1 -0
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveProvider.d.ts +39 -0
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveProvider.d.ts.map +1 -0
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveTimeseriesPaths.d.ts +31 -0
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveTimeseriesPaths.d.ts.map +1 -0
- package/dts/sparkline/sparkline-interactive/__figma__/SparklineInteractive.figma.d.ts +2 -0
- package/dts/sparkline/sparkline-interactive/__figma__/SparklineInteractive.figma.d.ts.map +1 -0
- package/dts/sparkline/sparkline-interactive/useInterruptiblePathAnimation.d.ts +13 -0
- package/dts/sparkline/sparkline-interactive/useInterruptiblePathAnimation.d.ts.map +1 -0
- package/dts/sparkline/sparkline-interactive/useMinMaxTransform.d.ts +16 -0
- package/dts/sparkline/sparkline-interactive/useMinMaxTransform.d.ts.map +1 -0
- package/dts/sparkline/sparkline-interactive/useOpacityAnimation.d.ts +6 -0
- package/dts/sparkline/sparkline-interactive/useOpacityAnimation.d.ts.map +1 -0
- package/dts/sparkline/sparkline-interactive/useSparklineInteractiveConstants.d.ts +22 -0
- package/dts/sparkline/sparkline-interactive/useSparklineInteractiveConstants.d.ts.map +1 -0
- package/dts/sparkline/sparkline-interactive/useSparklineInteractiveLineStyles.d.ts +34 -0
- package/dts/sparkline/sparkline-interactive/useSparklineInteractiveLineStyles.d.ts.map +1 -0
- package/dts/sparkline/sparkline-interactive-header/SparklineInteractiveHeader.d.ts +118 -0
- package/dts/sparkline/sparkline-interactive-header/SparklineInteractiveHeader.d.ts.map +1 -0
- package/dts/sparkline/sparkline-interactive-header/__figma__/SparklineInteractiveHeader.figma.d.ts +2 -0
- package/dts/sparkline/sparkline-interactive-header/__figma__/SparklineInteractiveHeader.figma.d.ts.map +1 -0
- package/dts/sparkline/sparkline-interactive-header/useSparklineInteractiveHeaderStyles.d.ts +29 -0
- package/dts/sparkline/sparkline-interactive-header/useSparklineInteractiveHeaderStyles.d.ts.map +1 -0
- package/esm/chart/CartesianChart.js +241 -0
- package/esm/chart/ChartProvider.js +10 -0
- package/esm/chart/Path.js +133 -0
- package/esm/chart/PeriodSelector.js +136 -0
- package/esm/chart/Point.js +111 -0
- package/esm/chart/__stories__/CartesianChart.stories.js +476 -0
- package/esm/chart/__stories__/Chart.stories.js +79 -0
- package/esm/chart/__stories__/PeriodSelector.stories.js +294 -0
- package/esm/chart/area/Area.js +85 -0
- package/esm/chart/area/AreaChart.js +146 -0
- package/esm/chart/area/DottedArea.js +128 -0
- package/esm/chart/area/GradientArea.js +110 -0
- package/esm/chart/area/SolidArea.js +24 -0
- package/esm/chart/area/__stories__/AreaChart.stories.js +100 -0
- package/esm/chart/area/index.js +7 -0
- package/esm/chart/axis/Axis.js +43 -0
- package/esm/chart/axis/XAxis.js +181 -0
- package/esm/chart/axis/YAxis.js +170 -0
- package/esm/chart/axis/__stories__/Axis.stories.js +277 -0
- package/esm/chart/axis/index.js +5 -0
- package/esm/chart/bar/Bar.js +67 -0
- package/esm/chart/bar/BarChart.js +147 -0
- package/esm/chart/bar/BarPlot.js +96 -0
- package/esm/chart/bar/BarStack.js +514 -0
- package/esm/chart/bar/BarStackGroup.js +89 -0
- package/esm/chart/bar/DefaultBar.js +78 -0
- package/esm/chart/bar/DefaultBarStack.js +82 -0
- package/esm/chart/bar/__stories__/BarChart.stories.js +282 -0
- package/esm/chart/bar/index.js +9 -0
- package/esm/chart/index.js +14 -0
- package/esm/chart/line/DottedLine.js +35 -0
- package/esm/chart/line/GradientLine.js +62 -0
- package/esm/chart/line/Line.js +139 -0
- package/esm/chart/line/LineChart.js +115 -0
- package/esm/chart/line/ReferenceLine.js +115 -0
- package/esm/chart/line/SolidLine.js +31 -0
- package/esm/chart/line/__stories__/LineChart.stories.js +2248 -0
- package/esm/chart/line/__stories__/ReferenceLine.stories.js +77 -0
- package/esm/chart/line/index.js +8 -0
- package/esm/chart/scrubber/Scrubber.js +186 -0
- package/esm/chart/scrubber/ScrubberBeacon.js +199 -0
- package/esm/chart/scrubber/ScrubberProvider.js +143 -0
- package/esm/chart/scrubber/index.js +2 -0
- package/esm/chart/text/ChartText.js +237 -0
- package/esm/chart/text/SmartChartTextGroup.js +210 -0
- package/esm/chart/text/index.js +4 -0
- package/esm/chart/utils/axis.js +592 -0
- package/esm/chart/utils/bar.js +24 -0
- package/esm/chart/utils/chart.js +229 -0
- package/esm/chart/utils/context.js +15 -0
- package/esm/chart/utils/index.js +9 -0
- package/esm/chart/utils/path.js +206 -0
- package/esm/chart/utils/point.js +118 -0
- package/esm/chart/utils/scale.js +48 -0
- package/esm/index.js +4 -0
- package/esm/sparkline/Counter.js +45 -0
- package/esm/sparkline/Sparkline.js +164 -0
- package/esm/sparkline/SparklineArea.js +19 -0
- package/esm/sparkline/SparklineAreaPattern.js +38 -0
- package/esm/sparkline/SparklineGradient.js +76 -0
- package/esm/sparkline/__figma__/Sparkline.figma.js +22 -0
- package/esm/sparkline/__stories__/Sparkline.stories.js +120 -0
- package/esm/sparkline/__stories__/SparklineGradient.stories.js +123 -0
- package/esm/sparkline/generateSparklineWithId.js +7 -0
- package/esm/sparkline/index.js +5 -0
- package/esm/sparkline/sparkline-interactive/SparklineAccessibleView.js +75 -0
- package/esm/sparkline/sparkline-interactive/SparklineInteractive.js +307 -0
- package/esm/sparkline/sparkline-interactive/SparklineInteractiveAnimatedPath.js +116 -0
- package/esm/sparkline/sparkline-interactive/SparklineInteractiveHoverDate.js +131 -0
- package/esm/sparkline/sparkline-interactive/SparklineInteractiveLineVertical.js +99 -0
- package/esm/sparkline/sparkline-interactive/SparklineInteractiveMarkerDates.js +82 -0
- package/esm/sparkline/sparkline-interactive/SparklineInteractiveMinMax.js +103 -0
- package/esm/sparkline/sparkline-interactive/SparklineInteractivePanGestureHandler.js +104 -0
- package/esm/sparkline/sparkline-interactive/SparklineInteractivePaths.js +57 -0
- package/esm/sparkline/sparkline-interactive/SparklineInteractivePeriodSelector.js +124 -0
- package/esm/sparkline/sparkline-interactive/SparklineInteractiveProvider.js +80 -0
- package/esm/sparkline/sparkline-interactive/SparklineInteractiveTimeseriesPaths.js +109 -0
- package/esm/sparkline/sparkline-interactive/__figma__/SparklineInteractive.figma.js +85 -0
- package/esm/sparkline/sparkline-interactive/__stories__/SparklineInteractive.stories.js +501 -0
- package/esm/sparkline/sparkline-interactive/useInterruptiblePathAnimation.js +58 -0
- package/esm/sparkline/sparkline-interactive/useInterruptiblePathAnimation.test.disable.js +37 -0
- package/esm/sparkline/sparkline-interactive/useMinMaxTransform.js +56 -0
- package/esm/sparkline/sparkline-interactive/useOpacityAnimation.js +23 -0
- package/esm/sparkline/sparkline-interactive/useSparklineInteractiveConstants.js +47 -0
- package/esm/sparkline/sparkline-interactive/useSparklineInteractiveLineStyles.js +34 -0
- package/esm/sparkline/sparkline-interactive-header/SparklineInteractiveHeader.js +233 -0
- package/esm/sparkline/sparkline-interactive-header/__figma__/SparklineInteractiveHeader.figma.js +104 -0
- package/esm/sparkline/sparkline-interactive-header/__stories__/SparklineInteractiveHeader.stories.js +555 -0
- package/esm/sparkline/sparkline-interactive-header/useSparklineInteractiveHeaderStyles.js +117 -0
- package/package.json +65 -6
- package/index.js +0 -1
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# @coinbase/cds-mobile-visualization
|
|
2
|
+
|
|
3
|
+
> [NPM registry](https://www.npmjs.com/package/@coinbase/cds-mobile-visualization)
|
|
4
|
+
|
|
5
|
+
All notable changes to this project will be documented in this file.
|
|
6
|
+
|
|
7
|
+
`@coinbase/cds-mobile-visualization` adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
8
|
+
|
|
9
|
+
<!-- template-start -->
|
|
10
|
+
|
|
11
|
+
## 3.4.0-beta.1 (10/3/2025 PST)
|
|
12
|
+
|
|
13
|
+
#### 🚀 Updates
|
|
14
|
+
|
|
15
|
+
- Introduces new data visualization components: CartesianChart, LineChart, BarChart, etc,
|
|
16
|
+
- Deprecates Sparkline components.
|
|
17
|
+
|
|
18
|
+
## 3.3.1 (10/1/2025 PST)
|
|
19
|
+
|
|
20
|
+
#### 🐞 Fixes
|
|
21
|
+
|
|
22
|
+
- Update links for new repo. [[#42](https://github.com/coinbase/cds/pull/42)]
|
|
23
|
+
|
|
24
|
+
## 3.3.0 (9/18/2025 PST)
|
|
25
|
+
|
|
26
|
+
- Prepare for open source release.
|
package/README.md
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
# @coinbase/cds-mobile-visualization
|
|
2
|
+
|
|
3
|
+
@coinbase/cds-mobile-visualization is a domain set of components that we have identified as mobile visualization components. They were moved from cds-web in an effort to decompose our core package and make it more reliable. The decomposition of our core packages (cds-web and cds-mobile) is an ongoing effort that should be continued over time, see [Design System Package Decomposition](../../docs/package-decomposition.md) for more information.
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type View, type ViewStyle } from 'react-native';
|
|
3
|
+
import type { BoxBaseProps, BoxProps } from '@coinbase/cds-mobile/layout';
|
|
4
|
+
import { type ScrubberProviderProps } from './scrubber/ScrubberProvider';
|
|
5
|
+
import { type AxisConfigProps, type ChartInset, type Series } from './utils';
|
|
6
|
+
export type CartesianChartBaseProps = BoxBaseProps &
|
|
7
|
+
Pick<ScrubberProviderProps, 'enableScrubbing' | 'onScrubberPositionChange'> & {
|
|
8
|
+
/**
|
|
9
|
+
* Configuration objects that define how to visualize the data.
|
|
10
|
+
* Each series contains its own data array.
|
|
11
|
+
*/
|
|
12
|
+
series?: Array<Series>;
|
|
13
|
+
/**
|
|
14
|
+
* Whether to animate the chart.
|
|
15
|
+
* @default true
|
|
16
|
+
*/
|
|
17
|
+
animate?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Configuration for x-axis.
|
|
20
|
+
*/
|
|
21
|
+
xAxis?: Partial<Omit<AxisConfigProps, 'id'>>;
|
|
22
|
+
/**
|
|
23
|
+
* Configuration for y-axis(es). Can be a single config or array of configs.
|
|
24
|
+
* If array, first axis becomes default if no id is specified.
|
|
25
|
+
*/
|
|
26
|
+
yAxis?: Partial<AxisConfigProps> | Partial<AxisConfigProps>[];
|
|
27
|
+
/**
|
|
28
|
+
* Inset around the entire chart (outside the axes).
|
|
29
|
+
*/
|
|
30
|
+
inset?: number | Partial<ChartInset>;
|
|
31
|
+
};
|
|
32
|
+
export type CartesianChartProps = CartesianChartBaseProps &
|
|
33
|
+
Pick<ScrubberProviderProps, 'allowOverflowGestures'> &
|
|
34
|
+
BoxProps & {
|
|
35
|
+
/**
|
|
36
|
+
* Chart width. If not provided, will use the container's measured width.
|
|
37
|
+
*/
|
|
38
|
+
width?: number | string;
|
|
39
|
+
/**
|
|
40
|
+
* Chart height. If not provided, will use the container's measured height.
|
|
41
|
+
*/
|
|
42
|
+
height?: number | string;
|
|
43
|
+
};
|
|
44
|
+
export declare const CartesianChart: React.MemoExoticComponent<
|
|
45
|
+
React.ForwardRefExoticComponent<
|
|
46
|
+
import('@coinbase/cds-mobile/styles/styleProps').StyleProps & {
|
|
47
|
+
children?: React.ReactNode;
|
|
48
|
+
style?: import('react-native').Animated.WithAnimatedValue<
|
|
49
|
+
import('react-native').StyleProp<ViewStyle>
|
|
50
|
+
>;
|
|
51
|
+
animated?: boolean;
|
|
52
|
+
elevation?: import('@coinbase/cds-common').ElevationLevels;
|
|
53
|
+
font?: import('@coinbase/cds-common').ThemeVars.FontFamily | 'inherit';
|
|
54
|
+
pin?: import('@coinbase/cds-common').PinningDirection;
|
|
55
|
+
bordered?: boolean;
|
|
56
|
+
borderedTop?: boolean;
|
|
57
|
+
borderedBottom?: boolean;
|
|
58
|
+
borderedStart?: boolean;
|
|
59
|
+
borderedEnd?: boolean;
|
|
60
|
+
borderedHorizontal?: boolean;
|
|
61
|
+
borderedVertical?: boolean;
|
|
62
|
+
dangerouslySetBackground?: string;
|
|
63
|
+
testID?: string;
|
|
64
|
+
} & Pick<ScrubberProviderProps, 'enableScrubbing' | 'onScrubberPositionChange'> & {
|
|
65
|
+
/**
|
|
66
|
+
* Configuration objects that define how to visualize the data.
|
|
67
|
+
* Each series contains its own data array.
|
|
68
|
+
*/
|
|
69
|
+
series?: Array<Series>;
|
|
70
|
+
/**
|
|
71
|
+
* Whether to animate the chart.
|
|
72
|
+
* @default true
|
|
73
|
+
*/
|
|
74
|
+
animate?: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Configuration for x-axis.
|
|
77
|
+
*/
|
|
78
|
+
xAxis?: Partial<Omit<AxisConfigProps, 'id'>>;
|
|
79
|
+
/**
|
|
80
|
+
* Configuration for y-axis(es). Can be a single config or array of configs.
|
|
81
|
+
* If array, first axis becomes default if no id is specified.
|
|
82
|
+
*/
|
|
83
|
+
yAxis?: Partial<AxisConfigProps> | Partial<AxisConfigProps>[];
|
|
84
|
+
/**
|
|
85
|
+
* Inset around the entire chart (outside the axes).
|
|
86
|
+
*/
|
|
87
|
+
inset?: number | Partial<ChartInset>;
|
|
88
|
+
} & Pick<ScrubberProviderProps, 'allowOverflowGestures'> &
|
|
89
|
+
Omit<import('react-native').ViewProps, 'style'> & {
|
|
90
|
+
/**
|
|
91
|
+
* Chart width. If not provided, will use the container's measured width.
|
|
92
|
+
*/
|
|
93
|
+
width?: number | string;
|
|
94
|
+
/**
|
|
95
|
+
* Chart height. If not provided, will use the container's measured height.
|
|
96
|
+
*/
|
|
97
|
+
height?: number | string;
|
|
98
|
+
} & React.RefAttributes<View>
|
|
99
|
+
>
|
|
100
|
+
>;
|
|
101
|
+
//# sourceMappingURL=CartesianChart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CartesianChart.d.ts","sourceRoot":"","sources":["../../src/chart/CartesianChart.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiD,MAAM,OAAO,CAAC;AACtE,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAIzD,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAG1E,OAAO,EAAoB,KAAK,q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AM,GAAG,MAAM;IACvB;;OAEG;aACM,MAAM,GAAG,MAAM;+BAuS3B,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { CartesianChartContextValue } from './utils';
|
|
2
|
+
export declare const useCartesianChartContext: () => CartesianChartContextValue;
|
|
3
|
+
export declare const CartesianChartProvider: import('react').Provider<
|
|
4
|
+
CartesianChartContextValue | undefined
|
|
5
|
+
>;
|
|
6
|
+
//# sourceMappingURL=ChartProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChartProvider.d.ts","sourceRoot":"","sources":["../../src/chart/ChartProvider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAC;AAI1D,eAAO,MAAM,wBAAwB,QAAO,0BAQ3C,CAAC;AAEF,eAAO,MAAM,sBAAsB,kEAAiC,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { type PathProps as SvgPathProps } from 'react-native-svg';
|
|
2
|
+
import type { Rect as RectType, SharedProps } from '@coinbase/cds-common/types';
|
|
3
|
+
export type PathProps = SharedProps &
|
|
4
|
+
SvgPathProps & {
|
|
5
|
+
/**
|
|
6
|
+
* The SVG path data string
|
|
7
|
+
*/
|
|
8
|
+
d?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Path fill color
|
|
11
|
+
*/
|
|
12
|
+
fill?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Path stroke color
|
|
15
|
+
*/
|
|
16
|
+
stroke?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Path stroke width
|
|
19
|
+
*/
|
|
20
|
+
strokeWidth?: number;
|
|
21
|
+
/**
|
|
22
|
+
* Path stroke opacity
|
|
23
|
+
*/
|
|
24
|
+
strokeOpacity?: number;
|
|
25
|
+
/**
|
|
26
|
+
* Path fill opacity
|
|
27
|
+
*/
|
|
28
|
+
fillOpacity?: number;
|
|
29
|
+
/**
|
|
30
|
+
* Custom clip path rect. If provided, this overrides the default chart rect for clipping.
|
|
31
|
+
*/
|
|
32
|
+
clipRect?: RectType;
|
|
33
|
+
/**
|
|
34
|
+
* Stroke dash array for dashed lines
|
|
35
|
+
*/
|
|
36
|
+
strokeDasharray?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Whether to animate the path.
|
|
39
|
+
* Overrides the animate prop on the Chart component.
|
|
40
|
+
*/
|
|
41
|
+
animate?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* The offset to add to the clip rect boundaries.
|
|
44
|
+
*/
|
|
45
|
+
clipOffset?: number;
|
|
46
|
+
};
|
|
47
|
+
export declare const Path: import('react').NamedExoticComponent<PathProps>;
|
|
48
|
+
//# sourceMappingURL=Path.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Path.d.ts","sourceRoot":"","sources":["../../src/chart/Path.tsx"],"names":[],"mappings":"AAQA,OAAO,EAKL,KAAK,SAAS,IAAI,YAAY,EAG/B,MAAM,kBAAkB,CAAC;AAE1B,OAAO,KAAK,EAAE,IAAI,IAAI,QAAQ,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAmChF,MAAM,MAAM,SAAS,GAAG,WAAW,GACjC,YAAY,GAAG;IACb;;OAEG;IACH,CAAC,CAAC,EAAE,MAAM,CAAC;IACX;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEJ,eAAO,MAAM,IAAI,iDA2HhB,CAAC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import { type SegmentedTabsProps, type TabsActiveIndicatorProps } from '@coinbase/cds-mobile/tabs';
|
|
4
|
+
import { type TextBaseProps } from '@coinbase/cds-mobile/typography/Text';
|
|
5
|
+
export declare const PeriodSelectorActiveIndicator: ({
|
|
6
|
+
activeTabRect,
|
|
7
|
+
background,
|
|
8
|
+
position,
|
|
9
|
+
borderRadius,
|
|
10
|
+
}: TabsActiveIndicatorProps) => import('react/jsx-runtime').JSX.Element | null;
|
|
11
|
+
export type LiveTabLabelBaseProps = TextBaseProps & {
|
|
12
|
+
/**
|
|
13
|
+
* The label to display.
|
|
14
|
+
* @default 'LIVE'
|
|
15
|
+
*/
|
|
16
|
+
label?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Whether to hide the dot.
|
|
19
|
+
*/
|
|
20
|
+
hideDot?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Style prop for customization
|
|
23
|
+
*/
|
|
24
|
+
style?: any;
|
|
25
|
+
};
|
|
26
|
+
export type LiveTabLabelProps = LiveTabLabelBaseProps;
|
|
27
|
+
export declare const LiveTabLabel: React.MemoExoticComponent<
|
|
28
|
+
React.ForwardRefExoticComponent<
|
|
29
|
+
import('@coinbase/cds-mobile/styles/styleProps').StyleProps & {
|
|
30
|
+
children?: React.ReactNode;
|
|
31
|
+
style?: import('react-native').Animated.WithAnimatedValue<
|
|
32
|
+
import('react-native').StyleProp<import('react-native').TextStyle>
|
|
33
|
+
>;
|
|
34
|
+
animated?: boolean;
|
|
35
|
+
align?: 'start' | 'end' | 'center' | 'justify';
|
|
36
|
+
font?: import('@coinbase/cds-common').ThemeVars.FontFamily | 'inherit';
|
|
37
|
+
disabled?: boolean;
|
|
38
|
+
mono?: boolean;
|
|
39
|
+
underline?: boolean;
|
|
40
|
+
tabularNumbers?: boolean;
|
|
41
|
+
numberOfLines?: number;
|
|
42
|
+
ellipsize?: import('react-native').TextProps['ellipsizeMode'];
|
|
43
|
+
noWrap?: boolean;
|
|
44
|
+
dangerouslySetColor?: import('react-native').TextStyle['color'];
|
|
45
|
+
dangerouslySetBackground?: import('react-native').TextStyle['backgroundColor'];
|
|
46
|
+
renderEmptyNode?: boolean;
|
|
47
|
+
testID?: string;
|
|
48
|
+
} & {
|
|
49
|
+
/**
|
|
50
|
+
* The label to display.
|
|
51
|
+
* @default 'LIVE'
|
|
52
|
+
*/
|
|
53
|
+
label?: string;
|
|
54
|
+
/**
|
|
55
|
+
* Whether to hide the dot.
|
|
56
|
+
*/
|
|
57
|
+
hideDot?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Style prop for customization
|
|
60
|
+
*/
|
|
61
|
+
style?: any;
|
|
62
|
+
} & React.RefAttributes<View>
|
|
63
|
+
>
|
|
64
|
+
>;
|
|
65
|
+
export type PeriodSelectorProps = SegmentedTabsProps;
|
|
66
|
+
/**
|
|
67
|
+
* PeriodSelector is a specialized version of SegmentedTabs optimized for chart period selection.
|
|
68
|
+
* It provides transparent background, primary wash active state, and full-width layout by default.
|
|
69
|
+
*/
|
|
70
|
+
export declare const PeriodSelector: React.MemoExoticComponent<
|
|
71
|
+
React.ForwardRefExoticComponent<
|
|
72
|
+
Partial<
|
|
73
|
+
Pick<
|
|
74
|
+
import('@coinbase/cds-mobile/tabs').TabsProps<string>,
|
|
75
|
+
'TabComponent' | 'TabsActiveIndicatorComponent'
|
|
76
|
+
>
|
|
77
|
+
> &
|
|
78
|
+
Omit<
|
|
79
|
+
import('@coinbase/cds-mobile/tabs').TabsProps<string>,
|
|
80
|
+
'TabComponent' | 'TabsActiveIndicatorComponent'
|
|
81
|
+
> &
|
|
82
|
+
React.RefAttributes<any>
|
|
83
|
+
>
|
|
84
|
+
>;
|
|
85
|
+
//# sourceMappingURL=PeriodSelector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PeriodSelector.d.ts","sourceRoot":"","sources":["../../src/chart/PeriodSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,OAAO,CAAC;AACzD,OAAO,EAAc,IAAI,EAAkB,MAAM,cAAc,CAAC;AAGhE,OAAO,EAEL,KAAK,kBAAkB,EAEvB,KAAK,wBAAwB,EAC9B,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EAAQ,KAAK,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAGhF,eAAO,MAAM,6BAA6B,GAAI,wDAK3C,wBAAwB,mDAmD1B,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,aAAa,GAAG;IAClD;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,KAAK,CAAC,EAAE,GAAG,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,qBAAqB,CAAC;AAStD,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;IAxBvB;;;OAGG;YACK,MAAM;IACd;;OAEG;cACO,OAAO;IACjB;;OAEG;YACK,GAAG;+BAyCZ,CAAC;AASF,MAAM,MAAM,mBAAmB,GAAG,kBAAkB,CAAC;AAErD;;;GAGG;AACH,eAAO,MAAM,cAAc,6TA0B1B,CAAC"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import type { SharedProps } from '@coinbase/cds-common/types';
|
|
2
|
+
import type { ChartTextChildren } from './text/ChartText';
|
|
3
|
+
import { type ChartTextProps } from './text';
|
|
4
|
+
/**
|
|
5
|
+
* Parameters passed to renderPoints callback function.
|
|
6
|
+
*/
|
|
7
|
+
export type RenderPointsParams = {
|
|
8
|
+
/**
|
|
9
|
+
* X coordinate in SVG pixel space.
|
|
10
|
+
*/
|
|
11
|
+
x: number;
|
|
12
|
+
/**
|
|
13
|
+
* Y coordinate in SVG pixel space.
|
|
14
|
+
*/
|
|
15
|
+
y: number;
|
|
16
|
+
/**
|
|
17
|
+
* X coordinate in data space (usually same as index).
|
|
18
|
+
*/
|
|
19
|
+
dataX: number;
|
|
20
|
+
/**
|
|
21
|
+
* Y coordinate in data space (same as value).
|
|
22
|
+
*/
|
|
23
|
+
dataY: number;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Shared configuration for point appearance and behavior.
|
|
27
|
+
* Used by line-associated points rendered via Line/LineChart components.
|
|
28
|
+
*/
|
|
29
|
+
export type PointConfig = {
|
|
30
|
+
/**
|
|
31
|
+
* The fill color of the point.
|
|
32
|
+
*/
|
|
33
|
+
fill?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Optional Y-axis id to specify which axis to plot along.
|
|
36
|
+
* Defaults to the first y-axis
|
|
37
|
+
*/
|
|
38
|
+
yAxisId?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Radius of the point.
|
|
41
|
+
* @default 4
|
|
42
|
+
*/
|
|
43
|
+
radius?: number;
|
|
44
|
+
/**
|
|
45
|
+
* Opacity of the point.
|
|
46
|
+
*/
|
|
47
|
+
opacity?: number;
|
|
48
|
+
/**
|
|
49
|
+
* Handler for when the point is clicked.
|
|
50
|
+
*/
|
|
51
|
+
onPress?: (point: { x: number; y: number; dataX: number; dataY: number }) => void;
|
|
52
|
+
/**
|
|
53
|
+
* Handler for when the scrubber enters this point.
|
|
54
|
+
*/
|
|
55
|
+
onScrubberEnter?: (point: { x: number; y: number }) => void;
|
|
56
|
+
/**
|
|
57
|
+
* Color of the outer stroke around the point.
|
|
58
|
+
* @default theme.color.bg
|
|
59
|
+
*/
|
|
60
|
+
stroke?: string;
|
|
61
|
+
/**
|
|
62
|
+
* Outer stroke width of the point.
|
|
63
|
+
* Set to 0 to remove the stroke.
|
|
64
|
+
* @default 2
|
|
65
|
+
*/
|
|
66
|
+
strokeWidth?: number;
|
|
67
|
+
/**
|
|
68
|
+
* Simple text label to display at the point position.
|
|
69
|
+
* If provided, a ChartText will be automatically rendered.
|
|
70
|
+
*/
|
|
71
|
+
label?: ChartTextChildren;
|
|
72
|
+
/**
|
|
73
|
+
* Configuration for the automatically rendered label.
|
|
74
|
+
* Only used when `label` prop is provided.
|
|
75
|
+
*/
|
|
76
|
+
labelProps?: Omit<ChartTextProps, 'x' | 'y' | 'children'>;
|
|
77
|
+
/**
|
|
78
|
+
* Accessibility label for screen readers to describe the point.
|
|
79
|
+
* If not provided, a default label will be generated using the data coordinates.
|
|
80
|
+
*/
|
|
81
|
+
accessibilityLabel?: string;
|
|
82
|
+
};
|
|
83
|
+
export type PointProps = SharedProps &
|
|
84
|
+
PointConfig & {
|
|
85
|
+
/**
|
|
86
|
+
* X coordinate in data space (not pixel coordinates).
|
|
87
|
+
*/
|
|
88
|
+
dataX: number;
|
|
89
|
+
/**
|
|
90
|
+
* Y coordinate in data space (not pixel coordinates).
|
|
91
|
+
*/
|
|
92
|
+
dataY: number;
|
|
93
|
+
/**
|
|
94
|
+
* Optional pixel coordinates to use instead of calculating from dataX/dataY.
|
|
95
|
+
* Useful for performance when coordinates are already calculated.
|
|
96
|
+
*/
|
|
97
|
+
pixelCoordinates?: {
|
|
98
|
+
x: number;
|
|
99
|
+
y: number;
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
export declare const Point: import('react').NamedExoticComponent<PointProps>;
|
|
103
|
+
//# sourceMappingURL=Point.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Point.d.ts","sourceRoot":"","sources":["../../src/chart/Point.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAG9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAE1D,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,QAAQ,CAAC;AAGxD;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC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B,CAAC,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC7C,CAAC;AAEJ,eAAO,MAAM,KAAK,kDAyFjB,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Rect } from '@coinbase/cds-common/types';
|
|
3
|
+
import { type ChartPathCurveType } from '../utils';
|
|
4
|
+
export type AreaComponentProps = {
|
|
5
|
+
d: string;
|
|
6
|
+
fill: string;
|
|
7
|
+
fillOpacity?: number;
|
|
8
|
+
clipRect?: Rect;
|
|
9
|
+
stroke?: string;
|
|
10
|
+
strokeWidth?: number;
|
|
11
|
+
/**
|
|
12
|
+
* ID of the y-axis to use.
|
|
13
|
+
* If not provided, defaults to the default y-axis.
|
|
14
|
+
*/
|
|
15
|
+
yAxisId?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Baseline value for the gradient.
|
|
18
|
+
* When set, overrides the default baseline.
|
|
19
|
+
*/
|
|
20
|
+
baseline?: number;
|
|
21
|
+
};
|
|
22
|
+
export type AreaComponent = React.FC<AreaComponentProps>;
|
|
23
|
+
export type AreaProps = {
|
|
24
|
+
/**
|
|
25
|
+
* The ID of the series to render. Will be used to find the data from the chart context.
|
|
26
|
+
*/
|
|
27
|
+
seriesId: string;
|
|
28
|
+
/**
|
|
29
|
+
* The curve interpolation method to use for the line.
|
|
30
|
+
* @default 'linear'
|
|
31
|
+
*/
|
|
32
|
+
curve?: ChartPathCurveType;
|
|
33
|
+
/**
|
|
34
|
+
* The type of area to render.
|
|
35
|
+
* @default 'solid'
|
|
36
|
+
*/
|
|
37
|
+
type?: 'solid' | 'dotted' | 'gradient';
|
|
38
|
+
/**
|
|
39
|
+
* Component to render the area.
|
|
40
|
+
* Takes precedence over the type prop if provided.
|
|
41
|
+
*/
|
|
42
|
+
AreaComponent?: AreaComponent;
|
|
43
|
+
/**
|
|
44
|
+
* The color of the area.
|
|
45
|
+
* @default color of the series or theme.color.fgPrimary
|
|
46
|
+
*/
|
|
47
|
+
fill?: string;
|
|
48
|
+
/**
|
|
49
|
+
* Opacity of the area.
|
|
50
|
+
* @default 1
|
|
51
|
+
*/
|
|
52
|
+
fillOpacity?: number;
|
|
53
|
+
stroke?: string;
|
|
54
|
+
strokeWidth?: number;
|
|
55
|
+
/**
|
|
56
|
+
* Baseline value for the gradient.
|
|
57
|
+
* When set, overrides the default baseline.
|
|
58
|
+
*/
|
|
59
|
+
baseline?: number;
|
|
60
|
+
};
|
|
61
|
+
export declare const Area: React.NamedExoticComponent<AreaProps>;
|
|
62
|
+
//# sourceMappingURL=Area.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Area.d.ts","sourceRoot":"","sources":["../../../src/chart/area/Area.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAC7C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAIvD,OAAO,EAAE,KAAK,kBAAkB,EAAe,MAAM,UAAU,CAAC;AAMhE,MAAM,MAAM,kBAAkB,GAAG;IAC/B,CAAC,EAAE,MAAM,CAAC;IACV,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,IAAI,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAAC,CAAC;AAEzD,MAAM,MAAM,SAAS,GAAG;IACtB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,KAAK,CAAC,EAAE,kBAAkB,CAAC;IAC3B;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,UAAU,CAAC;IACvC;;;OAGG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,IAAI,uCAkFhB,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import type { View } from 'react-native';
|
|
2
|
+
import { type XAxisProps, type YAxisProps } from '../axis';
|
|
3
|
+
import { type CartesianChartProps } from '../CartesianChart';
|
|
4
|
+
import { type LineProps } from '../line/Line';
|
|
5
|
+
import { type AxisConfigProps, type Series } from '../utils';
|
|
6
|
+
import { type AreaProps } from './Area';
|
|
7
|
+
export type AreaSeries = Series &
|
|
8
|
+
Partial<Pick<AreaProps, 'AreaComponent' | 'curve' | 'fillOpacity' | 'type' | 'fill'>> &
|
|
9
|
+
Partial<Pick<LineProps, 'LineComponent' | 'strokeWidth' | 'stroke' | 'opacity'>>;
|
|
10
|
+
export type AreaChartProps = Omit<CartesianChartProps, 'xAxis' | 'yAxis' | 'series'> &
|
|
11
|
+
Pick<AreaProps, 'AreaComponent' | 'curve' | 'fillOpacity' | 'type'> &
|
|
12
|
+
Pick<LineProps, 'LineComponent' | 'strokeWidth'> & {
|
|
13
|
+
/**
|
|
14
|
+
* Configuration objects that define how to visualize the data.
|
|
15
|
+
* Each series supports Area and Line component props for individual customization.
|
|
16
|
+
*/
|
|
17
|
+
series?: Array<AreaSeries>;
|
|
18
|
+
/**
|
|
19
|
+
* Whether to stack the areas on top of each other.
|
|
20
|
+
* When true, each series builds cumulative values on top of the previous series.
|
|
21
|
+
*
|
|
22
|
+
* **Note**: Only applies to series data containing singular numbers (e.g., `[10, 20, 30]`).
|
|
23
|
+
* Series with [baseline, value] tuples (e.g., `[[0, 10], [0, -5]]`) will be skipped during stacking
|
|
24
|
+
* and rendered as-is.
|
|
25
|
+
*/
|
|
26
|
+
stacked?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Whether to show the X axis.
|
|
29
|
+
*/
|
|
30
|
+
showXAxis?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Whether to show the Y axis.
|
|
33
|
+
*/
|
|
34
|
+
showYAxis?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Whether to show lines on top of the areas.
|
|
37
|
+
* Useful for stacked contexts to show the outline of each area.
|
|
38
|
+
*/
|
|
39
|
+
showLines?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* The type of line to render.
|
|
42
|
+
* @default 'solid'
|
|
43
|
+
*/
|
|
44
|
+
lineType?: 'solid' | 'dotted' | 'gradient';
|
|
45
|
+
xAxis?: Partial<AxisConfigProps> & XAxisProps;
|
|
46
|
+
yAxis?: Partial<AxisConfigProps> & YAxisProps;
|
|
47
|
+
};
|
|
48
|
+
export declare const AreaChart: import('react').MemoExoticComponent<
|
|
49
|
+
import('react').ForwardRefExoticComponent<
|
|
50
|
+
Omit<CartesianChartProps, 'series' | 'xAxis' | 'yAxis'> &
|
|
51
|
+
Pick<AreaProps, 'type' | 'curve' | 'fillOpacity' | 'AreaComponent'> &
|
|
52
|
+
Pick<LineProps, 'strokeWidth' | 'LineComponent'> & {
|
|
53
|
+
/**
|
|
54
|
+
* Configuration objects that define how to visualize the data.
|
|
55
|
+
* Each series supports Area and Line component props for individual customization.
|
|
56
|
+
*/
|
|
57
|
+
series?: Array<AreaSeries>;
|
|
58
|
+
/**
|
|
59
|
+
* Whether to stack the areas on top of each other.
|
|
60
|
+
* When true, each series builds cumulative values on top of the previous series.
|
|
61
|
+
*
|
|
62
|
+
* **Note**: Only applies to series data containing singular numbers (e.g., `[10, 20, 30]`).
|
|
63
|
+
* Series with [baseline, value] tuples (e.g., `[[0, 10], [0, -5]]`) will be skipped during stacking
|
|
64
|
+
* and rendered as-is.
|
|
65
|
+
*/
|
|
66
|
+
stacked?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Whether to show the X axis.
|
|
69
|
+
*/
|
|
70
|
+
showXAxis?: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Whether to show the Y axis.
|
|
73
|
+
*/
|
|
74
|
+
showYAxis?: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Whether to show lines on top of the areas.
|
|
77
|
+
* Useful for stacked contexts to show the outline of each area.
|
|
78
|
+
*/
|
|
79
|
+
showLines?: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* The type of line to render.
|
|
82
|
+
* @default 'solid'
|
|
83
|
+
*/
|
|
84
|
+
lineType?: 'solid' | 'dotted' | 'gradient';
|
|
85
|
+
xAxis?: Partial<AxisConfigProps> & XAxisProps;
|
|
86
|
+
yAxis?: Partial<AxisConfigProps> & YAxisProps;
|
|
87
|
+
} & import('react').RefAttributes<View>
|
|
88
|
+
>
|
|
89
|
+
>;
|
|
90
|
+
//# sourceMappingURL=AreaChart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AreaChart.d.ts","sourceRoot":"","sources":["../../../src/chart/area/AreaChart.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,EAAS,KAAK,UAAU,EAAS,KAAK,UAAU,EAAE,MAAM,SAAS,CAAC;AACzE,OAAO,EAAkB,KAAK,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC7E,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EACL,KAAK,eAAe,EAIpB,KAAK,MAAM,EACZ,MAAM,UAAU,CAAC;AAElB,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,QAAQ,CAAC;AAE9C,MAA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AU;YACrC,OAAO,CAAC,eAAe,CAAC,GAAG,UAAU;yCA0KhD,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type PathProps } from '../Path';
|
|
2
|
+
import type { AreaComponentProps } from './Area';
|
|
3
|
+
export type DottedAreaProps = Omit<PathProps, 'd' | 'fill' | 'fillOpacity'> &
|
|
4
|
+
AreaComponentProps & {
|
|
5
|
+
/**
|
|
6
|
+
* Size of the pattern unit (width and height).
|
|
7
|
+
* @default 4
|
|
8
|
+
*/
|
|
9
|
+
patternSize?: number;
|
|
10
|
+
/**
|
|
11
|
+
* Size of the dots within the pattern.
|
|
12
|
+
* @default 1
|
|
13
|
+
*/
|
|
14
|
+
dotSize?: number;
|
|
15
|
+
/**
|
|
16
|
+
* Opacity at the peak values (top/bottom of gradient).
|
|
17
|
+
* @default 0.3
|
|
18
|
+
*/
|
|
19
|
+
peakOpacity?: number;
|
|
20
|
+
/**
|
|
21
|
+
* Opacity at the baseline (0 or edge closest to 0).
|
|
22
|
+
* @default 0
|
|
23
|
+
*/
|
|
24
|
+
baselineOpacity?: number;
|
|
25
|
+
};
|
|
26
|
+
export declare const DottedArea: import('react').NamedExoticComponent<DottedAreaProps>;
|
|
27
|
+
//# sourceMappingURL=DottedArea.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DottedArea.d.ts","sourceRoot":"","sources":["../../../src/chart/area/DottedArea.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC;AAE/C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAEjD,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,SAAS,EAAE,GAAG,GAAG,MAAM,GAAG,aAAa,CAAC,GACzE,kBAAkB,GAAG;IACnB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEJ,eAAO,MAAM,UAAU,uDA+HtB,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type PathProps } from '../Path';
|
|
2
|
+
import type { AreaComponentProps } from './Area';
|
|
3
|
+
export type GradientAreaProps = Omit<PathProps, 'd' | 'fill' | 'fillOpacity'> &
|
|
4
|
+
AreaComponentProps & {
|
|
5
|
+
/**
|
|
6
|
+
* The color at peak values (top/bottom of gradient).
|
|
7
|
+
* @default fill or theme.color.fgPrimary
|
|
8
|
+
*/
|
|
9
|
+
peakColor?: string;
|
|
10
|
+
/**
|
|
11
|
+
* The color at the baseline (0 or edge closest to 0).
|
|
12
|
+
* @default peakColor or fill
|
|
13
|
+
*/
|
|
14
|
+
baselineColor?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Opacity at peak values.
|
|
17
|
+
* @default 0.3
|
|
18
|
+
*/
|
|
19
|
+
peakOpacity?: number;
|
|
20
|
+
/**
|
|
21
|
+
* Opacity at the baseline.
|
|
22
|
+
* @default 0
|
|
23
|
+
*/
|
|
24
|
+
baselineOpacity?: number;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* A customizable gradient area component which uses Path.
|
|
28
|
+
*/
|
|
29
|
+
export declare const GradientArea: import('react').NamedExoticComponent<GradientAreaProps>;
|
|
30
|
+
//# sourceMappingURL=GradientArea.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GradientArea.d.ts","sourceRoot":"","sources":["../../../src/chart/area/GradientArea.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC;AAE/C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAEjD,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,SAAS,EAAE,GAAG,GAAG,MAAM,GAAG,aAAa,CAAC,GAC3E,kBAAkB,GAAG;IACnB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEJ;;GAEG;AACH,eAAO,MAAM,YAAY,yDAwHxB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type PathProps } from '../Path';
|
|
2
|
+
import type { AreaComponentProps } from './Area';
|
|
3
|
+
export type SolidAreaProps = Omit<PathProps, 'd' | 'fill' | 'fillOpacity'> & AreaComponentProps;
|
|
4
|
+
/**
|
|
5
|
+
* A customizable solid area component which uses Path.
|
|
6
|
+
*/
|
|
7
|
+
export declare const SolidArea: import('react').NamedExoticComponent<SolidAreaProps>;
|
|
8
|
+
//# sourceMappingURL=SolidArea.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SolidArea.d.ts","sourceRoot":"","sources":["../../../src/chart/area/SolidArea.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC;AAE/C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAEjD,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,SAAS,EAAE,GAAG,GAAG,MAAM,GAAG,aAAa,CAAC,GAAG,kBAAkB,CAAC;AAEhG;;GAEG;AACH,eAAO,MAAM,SAAS,sDAIrB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/chart/area/index.ts"],"names":[],"mappings":"AACA,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC"}
|