@coinbase/cds-mobile-visualization 3.3.0 → 3.4.0-beta.2
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 +30 -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 +2 -1
- package/dts/index.d.ts.map +1 -1
- package/dts/sparkline/Counter.d.ts +7 -2
- package/dts/sparkline/Sparkline.d.ts +67 -16
- package/dts/sparkline/Sparkline.d.ts.map +1 -1
- package/dts/sparkline/SparklineArea.d.ts +10 -4
- package/dts/sparkline/SparklineArea.d.ts.map +1 -1
- package/dts/sparkline/SparklineAreaPattern.d.ts +12 -4
- package/dts/sparkline/SparklineAreaPattern.d.ts.map +1 -1
- package/dts/sparkline/SparklineGradient.d.ts +21 -10
- package/dts/sparkline/SparklineGradient.d.ts.map +1 -1
- package/dts/sparkline/__figma__/Sparkline.figma.d.ts +1 -1
- package/dts/sparkline/generateSparklineWithId.d.ts +8 -2
- package/dts/sparkline/generateSparklineWithId.d.ts.map +1 -1
- package/dts/sparkline/index.d.ts +1 -1
- package/dts/sparkline/sparkline-interactive/SparklineAccessibleView.d.ts +8 -3
- package/dts/sparkline/sparkline-interactive/SparklineInteractive.d.ts +132 -110
- package/dts/sparkline/sparkline-interactive/SparklineInteractive.d.ts.map +1 -1
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveAnimatedPath.d.ts +22 -9
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveAnimatedPath.d.ts.map +1 -1
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveHoverDate.d.ts +18 -7
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveLineVertical.d.ts +9 -4
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveMarkerDates.d.ts +11 -6
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveMinMax.d.ts +7 -5
- package/dts/sparkline/sparkline-interactive/SparklineInteractivePanGestureHandler.d.ts +22 -10
- package/dts/sparkline/sparkline-interactive/SparklineInteractivePaths.d.ts +21 -7
- package/dts/sparkline/sparkline-interactive/SparklineInteractivePaths.d.ts.map +1 -1
- package/dts/sparkline/sparkline-interactive/SparklineInteractivePeriodSelector.d.ts +21 -16
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveProvider.d.ts +29 -23
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveTimeseriesPaths.d.ts +22 -14
- package/dts/sparkline/sparkline-interactive/__figma__/SparklineInteractive.figma.d.ts +1 -1
- package/dts/sparkline/sparkline-interactive/useInterruptiblePathAnimation.d.ts +9 -5
- package/dts/sparkline/sparkline-interactive/useMinMaxTransform.d.ts +11 -6
- package/dts/sparkline/sparkline-interactive/useOpacityAnimation.d.ts +5 -2
- package/dts/sparkline/sparkline-interactive/useSparklineInteractiveConstants.d.ts +17 -17
- package/dts/sparkline/sparkline-interactive/useSparklineInteractiveLineStyles.d.ts +16 -13
- package/dts/sparkline/sparkline-interactive-header/SparklineInteractiveHeader.d.ts +106 -98
- package/dts/sparkline/sparkline-interactive-header/__figma__/SparklineInteractiveHeader.figma.d.ts +1 -1
- package/dts/sparkline/sparkline-interactive-header/useSparklineInteractiveHeaderStyles.d.ts +22 -19
- 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 -1
- package/esm/sparkline/Sparkline.js +129 -16
- package/esm/sparkline/SparklineArea.js +7 -2
- package/esm/sparkline/SparklineAreaPattern.js +4 -2
- package/esm/sparkline/SparklineGradient.js +4 -0
- package/esm/sparkline/generateSparklineWithId.js +3 -2
- package/esm/sparkline/sparkline-interactive/SparklineInteractive.js +5 -1
- package/esm/sparkline/sparkline-interactive/SparklineInteractiveAnimatedPath.js +5 -2
- package/esm/sparkline/sparkline-interactive/SparklineInteractivePaths.js +4 -0
- package/esm/sparkline/sparkline-interactive/__stories__/SparklineInteractive.stories.js +27 -0
- package/package.json +11 -11
- package/dts/sparkline/__stories__/Sparkline.stories.d.ts +0 -3
- package/dts/sparkline/__stories__/Sparkline.stories.d.ts.map +0 -1
- package/dts/sparkline/__stories__/SparklineGradient.stories.d.ts +0 -3
- package/dts/sparkline/__stories__/SparklineGradient.stories.d.ts.map +0 -1
- package/dts/sparkline/sparkline-interactive/__stories__/SparklineInteractive.stories.d.ts +0 -3
- package/dts/sparkline/sparkline-interactive/__stories__/SparklineInteractive.stories.d.ts.map +0 -1
- package/dts/sparkline/sparkline-interactive/__tests__/SparklineInteractive.test.d.ts +0 -2
- package/dts/sparkline/sparkline-interactive/__tests__/SparklineInteractive.test.d.ts.map +0 -1
- package/dts/sparkline/sparkline-interactive/__tests__/SparklineInteractiveHoverDate.test.d.ts +0 -2
- package/dts/sparkline/sparkline-interactive/__tests__/SparklineInteractiveHoverDate.test.d.ts.map +0 -1
- package/dts/sparkline/sparkline-interactive/__tests__/SparklineInteractivePanGestureHandler.test.d.ts +0 -2
- package/dts/sparkline/sparkline-interactive/__tests__/SparklineInteractivePanGestureHandler.test.d.ts.map +0 -1
- package/dts/sparkline/sparkline-interactive/__tests__/SparklineInteractivePeriodSelector.test.d.ts +0 -2
- package/dts/sparkline/sparkline-interactive/__tests__/SparklineInteractivePeriodSelector.test.d.ts.map +0 -1
- package/dts/sparkline/sparkline-interactive/__tests__/SparklineInteractiveTimeseriesPaths.test.d.ts +0 -2
- package/dts/sparkline/sparkline-interactive/__tests__/SparklineInteractiveTimeseriesPaths.test.d.ts.map +0 -1
- package/dts/sparkline/sparkline-interactive/__tests__/useMinMaxTransform.test.d.ts +0 -2
- package/dts/sparkline/sparkline-interactive/__tests__/useMinMaxTransform.test.d.ts.map +0 -1
- package/dts/sparkline/sparkline-interactive/useInterruptiblePathAnimation.test.disable.d.ts +0 -2
- package/dts/sparkline/sparkline-interactive/useInterruptiblePathAnimation.test.disable.d.ts.map +0 -1
- package/dts/sparkline/sparkline-interactive-header/__stories__/SparklineInteractiveHeader.stories.d.ts +0 -4
- package/dts/sparkline/sparkline-interactive-header/__stories__/SparklineInteractiveHeader.stories.d.ts.map +0 -1
- package/dts/sparkline/sparkline-interactive-header/__tests__/SparklineInteractiveHeader.test.d.ts +0 -2
- package/dts/sparkline/sparkline-interactive-header/__tests__/SparklineInteractiveHeader.test.d.ts.map +0 -1
- package/dts/sparkline/sparkline-interactive-header/__tests__/useSparklineInteractiveHeaderStyles.test.d.ts +0 -2
- package/dts/sparkline/sparkline-interactive-header/__tests__/useSparklineInteractiveHeaderStyles.test.d.ts.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/chart/bar/index.ts"],"names":[],"mappings":"AACA,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from './area';
|
|
2
|
+
export * from './axis';
|
|
3
|
+
export * from './bar';
|
|
4
|
+
export * from './CartesianChart';
|
|
5
|
+
export * from './ChartProvider';
|
|
6
|
+
export * from './line';
|
|
7
|
+
export * from './Path';
|
|
8
|
+
export * from './PeriodSelector';
|
|
9
|
+
export * from './Point';
|
|
10
|
+
export * from './scrubber';
|
|
11
|
+
export * from './text';
|
|
12
|
+
export * from './utils';
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/chart/index.ts"],"names":[],"mappings":"AACA,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,OAAO,CAAC;AACtB,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,kBAAkB,CAAC;AACjC,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { SharedProps } from '@coinbase/cds-common/types';
|
|
2
|
+
import { type PathProps } from '../Path';
|
|
3
|
+
export type DottedLineProps = SharedProps &
|
|
4
|
+
Omit<PathProps, 'fill' | 'strokeWidth'> & {
|
|
5
|
+
fill?: string;
|
|
6
|
+
strokeWidth?: number;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* A customizable dotted line component which uses path element.
|
|
10
|
+
*/
|
|
11
|
+
export declare const DottedLine: import('react').NamedExoticComponent<DottedLineProps>;
|
|
12
|
+
//# sourceMappingURL=DottedLine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DottedLine.d.ts","sourceRoot":"","sources":["../../../src/chart/line/DottedLine.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAG9D,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC;AAE/C,MAAM,MAAM,eAAe,GAAG,WAAW,GACvC,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,aAAa,CAAC,GAAG;IACxC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEJ;;GAEG;AACH,eAAO,MAAM,UAAU,uDA6BtB,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { SharedProps } from '@coinbase/cds-common/types';
|
|
2
|
+
import { type PathProps } from '../Path';
|
|
3
|
+
export type GradientLineProps = SharedProps &
|
|
4
|
+
Omit<PathProps, 'stroke' | 'strokeOpacity' | 'strokeWidth'> & {
|
|
5
|
+
/**
|
|
6
|
+
* The color of the line.
|
|
7
|
+
* @default theme.color.bgLine
|
|
8
|
+
*/
|
|
9
|
+
stroke?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Opacity of the line.
|
|
12
|
+
* @default 1
|
|
13
|
+
*/
|
|
14
|
+
strokeOpacity?: number;
|
|
15
|
+
/**
|
|
16
|
+
* Path stroke width
|
|
17
|
+
* @default 2
|
|
18
|
+
*/
|
|
19
|
+
strokeWidth?: number;
|
|
20
|
+
/**
|
|
21
|
+
* The color of the start of the gradient.
|
|
22
|
+
* @default stroke or theme.color.bgLine
|
|
23
|
+
*/
|
|
24
|
+
startColor?: string;
|
|
25
|
+
/**
|
|
26
|
+
* The color of the end of the gradient.
|
|
27
|
+
* @default stroke or theme.color.bgLine
|
|
28
|
+
*/
|
|
29
|
+
endColor?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Opacity of the start color.
|
|
32
|
+
* @default strokeOpacity
|
|
33
|
+
*/
|
|
34
|
+
startOpacity?: number;
|
|
35
|
+
/**
|
|
36
|
+
* Opacity of the end color.
|
|
37
|
+
* @default strokeOpacity
|
|
38
|
+
*/
|
|
39
|
+
endOpacity?: number;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* A gradient line component which uses path element.
|
|
43
|
+
*/
|
|
44
|
+
export declare const GradientLine: import('react').NamedExoticComponent<GradientLineProps>;
|
|
45
|
+
//# sourceMappingURL=GradientLine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GradientLine.d.ts","sourceRoot":"","sources":["../../../src/chart/line/GradientLine.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAI9D,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC;AAE/C,MAAM,MAAM,iBAAiB,GAAG,WAAW,GACzC,IAAI,CAAC,SAAS,EAAE,QAAQ,GAAG,eAAe,GAAG,aAAa,CAAC,GAAG;IAC5D;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEJ;;GAEG;AACH,eAAO,MAAM,YAAY,yDAmDxB,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { SharedProps } from '@coinbase/cds-common/types';
|
|
3
|
+
import { type AreaComponent } from '../area/Area';
|
|
4
|
+
import { type PointConfig, type RenderPointsParams } from '../Point';
|
|
5
|
+
import { type ChartPathCurveType } from '../utils';
|
|
6
|
+
export type LineComponentProps = {
|
|
7
|
+
d: string;
|
|
8
|
+
stroke: string;
|
|
9
|
+
strokeOpacity?: number;
|
|
10
|
+
strokeWidth?: number;
|
|
11
|
+
testID?: string;
|
|
12
|
+
};
|
|
13
|
+
export type LineComponent = React.FC<LineComponentProps>;
|
|
14
|
+
export type LineProps = SharedProps & {
|
|
15
|
+
/**
|
|
16
|
+
* The ID of the series to render. Will be used to find the data from the chart context.
|
|
17
|
+
*/
|
|
18
|
+
seriesId: string;
|
|
19
|
+
/**
|
|
20
|
+
* The curve interpolation method to use for the line.
|
|
21
|
+
* @default 'linear'
|
|
22
|
+
*/
|
|
23
|
+
curve?: ChartPathCurveType;
|
|
24
|
+
/**
|
|
25
|
+
* The type of line to render.
|
|
26
|
+
* @default 'solid'
|
|
27
|
+
*/
|
|
28
|
+
type?: 'solid' | 'dotted' | 'gradient';
|
|
29
|
+
/**
|
|
30
|
+
* Show area fill under the line.
|
|
31
|
+
*/
|
|
32
|
+
showArea?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* The type of area fill to add to the line.
|
|
35
|
+
* @default 'gradient'
|
|
36
|
+
*/
|
|
37
|
+
areaType?: 'gradient' | 'solid' | 'dotted';
|
|
38
|
+
/**
|
|
39
|
+
* Baseline value for the area.
|
|
40
|
+
* When set, overrides the default baseline.
|
|
41
|
+
*/
|
|
42
|
+
areaBaseline?: number;
|
|
43
|
+
/**
|
|
44
|
+
* Component to render the line.
|
|
45
|
+
* Takes precedence over the type prop if provided.
|
|
46
|
+
*/
|
|
47
|
+
LineComponent?: LineComponent;
|
|
48
|
+
/**
|
|
49
|
+
* Custom component to render line area fill.
|
|
50
|
+
*/
|
|
51
|
+
AreaComponent?: AreaComponent;
|
|
52
|
+
/**
|
|
53
|
+
* The color of the line.
|
|
54
|
+
* @default color of the series or theme.color.fgPrimary
|
|
55
|
+
*/
|
|
56
|
+
stroke?: string;
|
|
57
|
+
/**
|
|
58
|
+
* Opacity of the line.
|
|
59
|
+
* @default 1
|
|
60
|
+
*/
|
|
61
|
+
opacity?: number;
|
|
62
|
+
/**
|
|
63
|
+
* Whether to animate the line.
|
|
64
|
+
* Overrides the animate prop on the Chart component.
|
|
65
|
+
*/
|
|
66
|
+
animate?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Callback function to determine how to render points at each data point in the series.
|
|
69
|
+
* Called for every entry in the data array.
|
|
70
|
+
*
|
|
71
|
+
* @param params - Contains the data and pixel coordinates of the data point.
|
|
72
|
+
* @returns true for default point, false/null/undefined for no point, or PointConfig for custom point
|
|
73
|
+
*/
|
|
74
|
+
renderPoints?: (params: RenderPointsParams) => boolean | null | undefined | PointConfig;
|
|
75
|
+
strokeWidth?: number;
|
|
76
|
+
};
|
|
77
|
+
export declare const Line: React.NamedExoticComponent<LineProps>;
|
|
78
|
+
//# sourceMappingURL=Line.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Line.d.ts","sourceRoot":"","sources":["../../../src/chart/line/Line.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAC7C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAG9D,OAAO,EAAQ,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAExD,OAAO,EAAS,KAAK,WAAW,EAAE,KAAK,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAC5E,OAAO,EAAE,KAAK,kBAAkB,EAAe,MAAM,UAAU,CAAC;AAMhE,MAAM,MAAM,kBAAkB,GAAG;IAC/B,CAAC,EAAE,MAAM,CAAC;IACV,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAAC,CAAC;AAEzD,MAAM,MAAM,SAAS,GAAG,WAAW,GAAG;IACpC;;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;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,UAAU,GAAG,OAAO,GAAG,QAAQ,CAAC;IAC3C;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B;;OAEG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,OAAO,GAAG,IAAI,GAAG,SAAS,GAAG,WAAW,CAAC;IACxF,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,IAAI,uCAsJhB,CAAC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type { View } from 'react-native';
|
|
2
|
+
import { type XAxisProps } from '../axis/XAxis';
|
|
3
|
+
import { type YAxisProps } from '../axis/YAxis';
|
|
4
|
+
import { type CartesianChartProps } from '../CartesianChart';
|
|
5
|
+
import { type AxisConfigProps, type Series } from '../utils';
|
|
6
|
+
import { type LineProps } from './Line';
|
|
7
|
+
export type LineSeries = Series &
|
|
8
|
+
Partial<
|
|
9
|
+
Pick<
|
|
10
|
+
LineProps,
|
|
11
|
+
| 'curve'
|
|
12
|
+
| 'showArea'
|
|
13
|
+
| 'areaType'
|
|
14
|
+
| 'areaBaseline'
|
|
15
|
+
| 'type'
|
|
16
|
+
| 'LineComponent'
|
|
17
|
+
| 'AreaComponent'
|
|
18
|
+
| 'stroke'
|
|
19
|
+
| 'opacity'
|
|
20
|
+
| 'renderPoints'
|
|
21
|
+
| 'strokeWidth'
|
|
22
|
+
>
|
|
23
|
+
>;
|
|
24
|
+
export type LineChartProps = Omit<CartesianChartProps, 'xAxis' | 'yAxis' | 'series'> &
|
|
25
|
+
Pick<
|
|
26
|
+
LineProps,
|
|
27
|
+
| 'showArea'
|
|
28
|
+
| 'areaType'
|
|
29
|
+
| 'type'
|
|
30
|
+
| 'LineComponent'
|
|
31
|
+
| 'AreaComponent'
|
|
32
|
+
| 'curve'
|
|
33
|
+
| 'renderPoints'
|
|
34
|
+
| 'strokeWidth'
|
|
35
|
+
> & {
|
|
36
|
+
/**
|
|
37
|
+
* Configuration objects that define how to visualize the data.
|
|
38
|
+
* Each series supports Line component props for individual customization.
|
|
39
|
+
*/
|
|
40
|
+
series?: Array<LineSeries>;
|
|
41
|
+
/**
|
|
42
|
+
* Whether to show the X axis.
|
|
43
|
+
*/
|
|
44
|
+
showXAxis?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Whether to show the Y axis.
|
|
47
|
+
*/
|
|
48
|
+
showYAxis?: boolean;
|
|
49
|
+
xAxis?: Partial<AxisConfigProps> & XAxisProps;
|
|
50
|
+
yAxis?: Partial<AxisConfigProps> & YAxisProps;
|
|
51
|
+
};
|
|
52
|
+
export declare const LineChart: import('react').MemoExoticComponent<
|
|
53
|
+
import('react').ForwardRefExoticComponent<
|
|
54
|
+
Omit<CartesianChartProps, 'series' | 'xAxis' | 'yAxis'> &
|
|
55
|
+
Pick<
|
|
56
|
+
LineProps,
|
|
57
|
+
| 'type'
|
|
58
|
+
| 'curve'
|
|
59
|
+
| 'strokeWidth'
|
|
60
|
+
| 'AreaComponent'
|
|
61
|
+
| 'showArea'
|
|
62
|
+
| 'areaType'
|
|
63
|
+
| 'LineComponent'
|
|
64
|
+
| 'renderPoints'
|
|
65
|
+
> & {
|
|
66
|
+
/**
|
|
67
|
+
* Configuration objects that define how to visualize the data.
|
|
68
|
+
* Each series supports Line component props for individual customization.
|
|
69
|
+
*/
|
|
70
|
+
series?: Array<LineSeries>;
|
|
71
|
+
/**
|
|
72
|
+
* Whether to show the X axis.
|
|
73
|
+
*/
|
|
74
|
+
showXAxis?: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Whether to show the Y axis.
|
|
77
|
+
*/
|
|
78
|
+
showYAxis?: boolean;
|
|
79
|
+
xAxis?: Partial<AxisConfigProps> & XAxisProps;
|
|
80
|
+
yAxis?: Partial<AxisConfigProps> & YAxisProps;
|
|
81
|
+
} & import('react').RefAttributes<View>
|
|
82
|
+
>
|
|
83
|
+
>;
|
|
84
|
+
//# sourceMappingURL=LineChart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LineChart.d.ts","sourceRoot":"","sources":["../../../src/chart/line/LineChart.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAkB,KAAK,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC7E,OAAO,EAAE,KAAK,eAAe,EAAoC,KAAK,MAAM,EAAE,MAAM,UAAU,CAAC;AAE/F,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,QAAQ,CAAC;AAE9C,MAAM,MAAM,UAAU,GAAG,MAAM,GAC7B,OAAO,CACL,IAAI,CACF,SAAS,EACP,OAAO,GACP,UAAU,GACV,UAAU,GACV,cAAc,GACd,MAAM,GACN,eAAe,GACf,eAAe,GACf,QAAQ,GACR,SAAS,GACT,cAAc,GACd,aAAa,CAChB,CACF,CAAC;AAEJ,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,mBAAmB,EAAE,OAAO,GAAG,OAAO,GAAG,QAAQ,CAAC,GAClF,IAAI,CACF,SAAS,EACP,UAAU,GACV,UAAU,GACV,MAAM,GACN,eAAe,GACf,eAAe,GACf,OAAO,GACP,cAAc,GACd,aAAa,CAChB,GAAG;IACF;;;OAGG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;IAC3B;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,UAAU,CAAC;IAC9C,KAAK,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,UAAU,CAAC;CAC/C,CAAC;AAEJ,eAAO,MAAM,SAAS;IAjBlB;;;OAGG;aACM,KAAK,CAAC,UAAU,CAAC;IAC1B;;OAEG;gBACS,OAAO;IACnB;;OAEG;gBACS,OAAO;YACX,OAAO,CAAC,eAAe,CAAC,GAAG,UAAU;YACrC,OAAO,CAAC,eAAe,CAAC,GAAG,UAAU;yCAyHhD,CAAC"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import type { SharedProps } from '@coinbase/cds-common/types';
|
|
2
|
+
import type {
|
|
3
|
+
ChartTextChildren,
|
|
4
|
+
ChartTextProps,
|
|
5
|
+
TextHorizontalAlignment,
|
|
6
|
+
TextVerticalAlignment,
|
|
7
|
+
} from '../text/ChartText';
|
|
8
|
+
import type { LineComponent } from './Line';
|
|
9
|
+
/**
|
|
10
|
+
* Configuration for ReferenceLine label rendering using ChartText.
|
|
11
|
+
*/
|
|
12
|
+
export type ReferenceLineLabelProps = Pick<
|
|
13
|
+
ChartTextProps,
|
|
14
|
+
| 'dx'
|
|
15
|
+
| 'dy'
|
|
16
|
+
| 'fontSize'
|
|
17
|
+
| 'fontWeight'
|
|
18
|
+
| 'color'
|
|
19
|
+
| 'inset'
|
|
20
|
+
| 'background'
|
|
21
|
+
| 'borderRadius'
|
|
22
|
+
| 'disableRepositioning'
|
|
23
|
+
| 'bounds'
|
|
24
|
+
| 'horizontalAlignment'
|
|
25
|
+
| 'verticalAlignment'
|
|
26
|
+
>;
|
|
27
|
+
type BaseReferenceLineProps = SharedProps & {
|
|
28
|
+
/**
|
|
29
|
+
* Label content to display near the reference line.
|
|
30
|
+
* Can be a string or ReactNode for rich formatting.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* // Simple string label
|
|
34
|
+
* label="Target Price"
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* // ReactNode with styling
|
|
38
|
+
* label={<tspan style={{ fontWeight: 'bold', fill: 'red' }}>Stop Loss</tspan>}
|
|
39
|
+
*/
|
|
40
|
+
label?: ChartTextChildren;
|
|
41
|
+
/**
|
|
42
|
+
* Component to render the line.
|
|
43
|
+
* @default DottedLine
|
|
44
|
+
*/
|
|
45
|
+
LineComponent?: LineComponent;
|
|
46
|
+
/**
|
|
47
|
+
* The color of the line.
|
|
48
|
+
* @default theme.color.bgLine
|
|
49
|
+
*/
|
|
50
|
+
stroke?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Props for the label rendering.
|
|
53
|
+
* Consolidates styling and positioning options for the ChartText component.
|
|
54
|
+
* Alignment defaults are set based on line orientation and can be overridden here.
|
|
55
|
+
*/
|
|
56
|
+
labelProps?: ReferenceLineLabelProps;
|
|
57
|
+
};
|
|
58
|
+
type HorizontalReferenceLineProps = BaseReferenceLineProps & {
|
|
59
|
+
/**
|
|
60
|
+
* Y-value for horizontal reference line (data value).
|
|
61
|
+
*/
|
|
62
|
+
dataY: number;
|
|
63
|
+
/**
|
|
64
|
+
* The ID of the y-axis to use for positioning.
|
|
65
|
+
* Defaults to defaultAxisId if not specified.
|
|
66
|
+
*/
|
|
67
|
+
yAxisId?: string;
|
|
68
|
+
/**
|
|
69
|
+
* Position of the label along the horizontal line.
|
|
70
|
+
* @default 'right'
|
|
71
|
+
*/
|
|
72
|
+
labelPosition?: TextHorizontalAlignment;
|
|
73
|
+
dataX?: never;
|
|
74
|
+
};
|
|
75
|
+
type VerticalReferenceLineProps = BaseReferenceLineProps & {
|
|
76
|
+
/**
|
|
77
|
+
* X-value for vertical reference line (data index).
|
|
78
|
+
*/
|
|
79
|
+
dataX: number;
|
|
80
|
+
/**
|
|
81
|
+
* Position of the label along the vertical line.
|
|
82
|
+
* @default 'top'
|
|
83
|
+
*/
|
|
84
|
+
labelPosition?: TextVerticalAlignment;
|
|
85
|
+
dataY?: never;
|
|
86
|
+
yAxisId?: never;
|
|
87
|
+
};
|
|
88
|
+
export type ReferenceLineProps = HorizontalReferenceLineProps | VerticalReferenceLineProps;
|
|
89
|
+
export declare const ReferenceLine: import('react').NamedExoticComponent<ReferenceLineProps>;
|
|
90
|
+
export {};
|
|
91
|
+
//# sourceMappingURL=ReferenceLine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReferenceLine.d.ts","sourceRoot":"","sources":["../../../src/chart/line/ReferenceLine.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAK9D,OAAO,KAAK,EACV,iBAAiB,EACjB,cAAc,EACd,uBAAuB,EACvB,qBAAqB,EACtB,MAAM,mBAAmB,CAAC;AAI3B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAE5C;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG,IAAI,CACxC,cAAc,EACZ,IAAI,GACJ,IAAI,GACJ,UAAU,GACV,YAAY,GACZ,OAAO,GACP,OAAO,GACP,YAAY,GACZ,cAAc,GACd,sBAAsB,GACtB,QAAQ,GACR,qBAAqB,GACrB,mBAAmB,CACtB,CAAC;AAEF,KAAK,sBAAsB,GAAG,WAAW,GAAG;IAC1C;;;;;;;;;;;OAWG;IACH,KAAK,CAAC,EAAE,iBAAiB,CAAC;IAC1B;;;OAGG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,UAAU,CAAC,EAAE,uBAAuB,CAAC;CACtC,CAAC;AAEF,KAAK,4BAA4B,GAAG,sBAAsB,GAAG;IAC3D;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,aAAa,CAAC,EAAE,uBAAuB,CAAC;IACxC,KAAK,CAAC,EAAE,KAAK,CAAC;CACf,CAAC;AAEF,KAAK,0BAA0B,GAAG,sBAAsB,GAAG;IACzD;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,aAAa,CAAC,EAAE,qBAAqB,CAAC;IACtC,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,OAAO,CAAC,EAAE,KAAK,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,4BAA4B,GAAG,0BAA0B,CAAC;AAE3F,eAAO,MAAM,aAAa,0DA8GzB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { SharedProps } from '@coinbase/cds-common/types';
|
|
2
|
+
import { type PathProps } from '../Path';
|
|
3
|
+
export type SolidLineProps = SharedProps &
|
|
4
|
+
Omit<PathProps, 'fill' | 'strokeWidth'> & {
|
|
5
|
+
fill?: string;
|
|
6
|
+
strokeWidth?: number;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* A customizable solid line component which uses path element.
|
|
10
|
+
*/
|
|
11
|
+
export declare const SolidLine: import('react').NamedExoticComponent<SolidLineProps>;
|
|
12
|
+
//# sourceMappingURL=SolidLine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SolidLine.d.ts","sourceRoot":"","sources":["../../../src/chart/line/SolidLine.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAG9D,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC;AAE/C,MAAM,MAAM,cAAc,GAAG,WAAW,GACtC,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,aAAa,CAAC,GAAG;IACxC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEJ;;GAEG;AACH,eAAO,MAAM,SAAS,sDAyBrB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/chart/line/index.ts"],"names":[],"mappings":"AACA,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { SharedProps } from '@coinbase/cds-common/types';
|
|
3
|
+
import { type ReferenceLineProps } from '../line';
|
|
4
|
+
import { type ScrubberBeaconProps, type ScrubberBeaconRef } from './ScrubberBeacon';
|
|
5
|
+
/**
|
|
6
|
+
* Configuration for scrubber functionality across chart components.
|
|
7
|
+
* Provides consistent API with smart defaults and component customization.
|
|
8
|
+
*/
|
|
9
|
+
export type ScrubberProps = SharedProps &
|
|
10
|
+
Pick<ScrubberBeaconProps, 'idlePulse'> & {
|
|
11
|
+
/**
|
|
12
|
+
* An array of series IDs that will receive visual emphasis as the user scrubs through the chart.
|
|
13
|
+
* Use this prop to restrict the scrubbing visual behavior to specific series.
|
|
14
|
+
* By default, all series will be highlighted by the Scrubber.
|
|
15
|
+
*/
|
|
16
|
+
seriesIds?: string[];
|
|
17
|
+
/**
|
|
18
|
+
* Hides the scrubber line
|
|
19
|
+
*/
|
|
20
|
+
hideLine?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Whether to hide the overlay rect which obscures future data.
|
|
23
|
+
*/
|
|
24
|
+
hideOverlay?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Offset of the overlay rect relative to the drawing area.
|
|
27
|
+
* Useful for when scrubbing over lines, where the stroke width would cause part of the line to be visible.
|
|
28
|
+
* @default 2
|
|
29
|
+
*/
|
|
30
|
+
overlayOffset?: number;
|
|
31
|
+
/**
|
|
32
|
+
* Label text displayed above the scrubber line.
|
|
33
|
+
*/
|
|
34
|
+
label?: ReferenceLineProps['label'] | ((dataIndex: number) => ReferenceLineProps['label']);
|
|
35
|
+
/**
|
|
36
|
+
* Props passed to the scrubber line's label.
|
|
37
|
+
*/
|
|
38
|
+
labelProps?: ReferenceLineProps['labelProps'];
|
|
39
|
+
/**
|
|
40
|
+
* Stroke color for the scrubber line.
|
|
41
|
+
*/
|
|
42
|
+
lineStroke?: ReferenceLineProps['stroke'];
|
|
43
|
+
/**
|
|
44
|
+
* Custom component for the scrubber beacon.
|
|
45
|
+
*/
|
|
46
|
+
BeaconComponent?: React.ComponentType<ScrubberBeaconProps>;
|
|
47
|
+
/**
|
|
48
|
+
* Custom component for the scrubber line.
|
|
49
|
+
*/
|
|
50
|
+
LineComponent?: React.ComponentType<ReferenceLineProps>;
|
|
51
|
+
};
|
|
52
|
+
export type ScrubberRef = ScrubberBeaconRef;
|
|
53
|
+
/**
|
|
54
|
+
* Unified component that manages all scrubber elements (beacons, line, labels)
|
|
55
|
+
* with intelligent collision detection and consistent positioning.
|
|
56
|
+
*/
|
|
57
|
+
export declare const Scrubber: React.MemoExoticComponent<
|
|
58
|
+
React.ForwardRefExoticComponent<
|
|
59
|
+
SharedProps &
|
|
60
|
+
Pick<ScrubberBeaconProps, 'idlePulse'> & {
|
|
61
|
+
/**
|
|
62
|
+
* An array of series IDs that will receive visual emphasis as the user scrubs through the chart.
|
|
63
|
+
* Use this prop to restrict the scrubbing visual behavior to specific series.
|
|
64
|
+
* By default, all series will be highlighted by the Scrubber.
|
|
65
|
+
*/
|
|
66
|
+
seriesIds?: string[];
|
|
67
|
+
/**
|
|
68
|
+
* Hides the scrubber line
|
|
69
|
+
*/
|
|
70
|
+
hideLine?: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Whether to hide the overlay rect which obscures future data.
|
|
73
|
+
*/
|
|
74
|
+
hideOverlay?: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Offset of the overlay rect relative to the drawing area.
|
|
77
|
+
* Useful for when scrubbing over lines, where the stroke width would cause part of the line to be visible.
|
|
78
|
+
* @default 2
|
|
79
|
+
*/
|
|
80
|
+
overlayOffset?: number;
|
|
81
|
+
/**
|
|
82
|
+
* Label text displayed above the scrubber line.
|
|
83
|
+
*/
|
|
84
|
+
label?: ReferenceLineProps['label'] | ((dataIndex: number) => ReferenceLineProps['label']);
|
|
85
|
+
/**
|
|
86
|
+
* Props passed to the scrubber line's label.
|
|
87
|
+
*/
|
|
88
|
+
labelProps?: ReferenceLineProps['labelProps'];
|
|
89
|
+
/**
|
|
90
|
+
* Stroke color for the scrubber line.
|
|
91
|
+
*/
|
|
92
|
+
lineStroke?: ReferenceLineProps['stroke'];
|
|
93
|
+
/**
|
|
94
|
+
* Custom component for the scrubber beacon.
|
|
95
|
+
*/
|
|
96
|
+
BeaconComponent?: React.ComponentType<ScrubberBeaconProps>;
|
|
97
|
+
/**
|
|
98
|
+
* Custom component for the scrubber line.
|
|
99
|
+
*/
|
|
100
|
+
LineComponent?: React.ComponentType<ReferenceLineProps>;
|
|
101
|
+
} & React.RefAttributes<ScrubberBeaconRef>
|
|
102
|
+
>
|
|
103
|
+
>;
|
|
104
|
+
//# sourceMappingURL=Scrubber.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Scrubber.d.ts","sourceRoot":"","sources":["../../../src/chart/scrubber/Scrubber.tsx"],"names":[],"mappings":"AAAA,OAAO,KAQN,MAAM,OAAO,CAAC;AAKf,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAI9D,OAAO,EAAiB,KAAK,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAGjE,OAAO,EAAkB,KAAK,mBAAmB,EAAE,KAAK,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAIpG;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,WAAW,GACrC,IAAI,CAAC,mBAAmB,EAAE,WAAW,CAAC,GAAG;IACvC;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IAErB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,KAAK,CAAC,EAAE,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,MAAM,KAAK,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAAC;IAE3F;;OAEG;IACH,UAAU,CAAC,EAAE,kBAAkB,CAAC,YAAY,CAAC,CAAC;IAE9C;;OAEG;IACH,UAAU,CAAC,EAAE,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IAE1C;;OAEG;IACH,eAAe,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,mBAAmB,CAAC,CAAC;IAE3D;;OAEG;IACH,aAAa,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,kBAAkB,CAAC,CAAC;CACzD,CAAC;AAEJ,MAAM,MAAM,WAAW,GAAG,iBAAiB,CAAC;AAE5C;;;GAGG;AACH,eAAO,MAAM,QAAQ;IAxDjB;;;;OAIG;gBACS,MAAM,EAAE;IAEpB;;OAEG;eACQ,OAAO;IAElB;;OAEG;kBACW,OAAO;IAErB;;;;OAIG;oBACa,MAAM;IAEtB;;OAEG;YACK,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,MAAM,KAAK,kBAAkB,CAAC,OAAO,CAAC,CAAC;IAE1F;;OAEG;iBACU,kBAAkB,CAAC,YAAY,CAAC;IAE7C;;OAEG;iBACU,kBAAkB,CAAC,QAAQ,CAAC;IAEzC;;OAEG;sBACe,KAAK,CAAC,aAAa,CAAC,mBAAmB,CAAC;IAE1D;;OAEG;oBACa,KAAK,CAAC,aAAa,CAAC,kBAAkB,CAAC;4CAmM1D,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { SharedProps } from '@coinbase/cds-common/types';
|
|
2
|
+
export type ScrubberBeaconRef = {
|
|
3
|
+
/**
|
|
4
|
+
* Triggers a single pulse animation.
|
|
5
|
+
*/
|
|
6
|
+
pulse: () => void;
|
|
7
|
+
};
|
|
8
|
+
export type ScrubberBeaconProps = SharedProps & {
|
|
9
|
+
/**
|
|
10
|
+
* Optional data X coordinate to position the beacon.
|
|
11
|
+
* If not provided, uses the scrubber position from context.
|
|
12
|
+
*/
|
|
13
|
+
dataX?: number;
|
|
14
|
+
/**
|
|
15
|
+
* Optional data Y coordinate to position the beacon.
|
|
16
|
+
* If not provided, looks up the Y value from series data at scrubber position.
|
|
17
|
+
*/
|
|
18
|
+
dataY?: number;
|
|
19
|
+
/**
|
|
20
|
+
* Filter to only show dot for specific series (used for hover-based positioning).
|
|
21
|
+
*/
|
|
22
|
+
seriesId?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Color of the beacon point.
|
|
25
|
+
* If not provided, uses the series color.
|
|
26
|
+
*/
|
|
27
|
+
color?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Opacity of the beacon.
|
|
30
|
+
* @default 1
|
|
31
|
+
*/
|
|
32
|
+
opacity?: number;
|
|
33
|
+
/**
|
|
34
|
+
* Pulse the scrubber beacon while it is at rest.
|
|
35
|
+
*/
|
|
36
|
+
idlePulse?: boolean;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* The ScrubberBeacon is a special instance of a Point used to mark the scrubber's position on a specific series.
|
|
40
|
+
*/
|
|
41
|
+
export declare const ScrubberBeacon: import('react').MemoExoticComponent<
|
|
42
|
+
import('react').ForwardRefExoticComponent<
|
|
43
|
+
SharedProps & {
|
|
44
|
+
/**
|
|
45
|
+
* Optional data X coordinate to position the beacon.
|
|
46
|
+
* If not provided, uses the scrubber position from context.
|
|
47
|
+
*/
|
|
48
|
+
dataX?: number;
|
|
49
|
+
/**
|
|
50
|
+
* Optional data Y coordinate to position the beacon.
|
|
51
|
+
* If not provided, looks up the Y value from series data at scrubber position.
|
|
52
|
+
*/
|
|
53
|
+
dataY?: number;
|
|
54
|
+
/**
|
|
55
|
+
* Filter to only show dot for specific series (used for hover-based positioning).
|
|
56
|
+
*/
|
|
57
|
+
seriesId?: string;
|
|
58
|
+
/**
|
|
59
|
+
* Color of the beacon point.
|
|
60
|
+
* If not provided, uses the series color.
|
|
61
|
+
*/
|
|
62
|
+
color?: string;
|
|
63
|
+
/**
|
|
64
|
+
* Opacity of the beacon.
|
|
65
|
+
* @default 1
|
|
66
|
+
*/
|
|
67
|
+
opacity?: number;
|
|
68
|
+
/**
|
|
69
|
+
* Pulse the scrubber beacon while it is at rest.
|
|
70
|
+
*/
|
|
71
|
+
idlePulse?: boolean;
|
|
72
|
+
} & import('react').RefAttributes<ScrubberBeaconRef>
|
|
73
|
+
>
|
|
74
|
+
>;
|
|
75
|
+
//# sourceMappingURL=ScrubberBeacon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScrubberBeacon.d.ts","sourceRoot":"","sources":["../../../src/chart/scrubber/ScrubberBeacon.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAe9D,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;OAEG;IACH,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,WAAW,GAAG;IAC9C;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc;IAjCzB;;;OAGG;YACK,MAAM;IACd;;;OAGG;YACK,MAAM;IACd;;OAEG;eACQ,MAAM;IACjB;;;OAGG;YACK,MAAM;IACd;;;OAGG;cACO,MAAM;IAChB;;OAEG;gBACS,OAAO;sDAgMpB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type ScrubberContextValue } from '../utils';
|
|
3
|
+
export type ScrubberProviderProps = Partial<
|
|
4
|
+
Pick<ScrubberContextValue, 'enableScrubbing' | 'onScrubberPositionChange'>
|
|
5
|
+
> & {
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* Allows continuous gestures on the chart to continue outside the bounds of the chart element.
|
|
9
|
+
*/
|
|
10
|
+
allowOverflowGestures?: boolean;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* A component which encapsulates the ScrubberContext.
|
|
14
|
+
* It depends on a ChartContext in order to provide accurate touch tracking.
|
|
15
|
+
*/
|
|
16
|
+
export declare const ScrubberProvider: React.FC<ScrubberProviderProps>;
|
|
17
|
+
//# sourceMappingURL=ScrubberProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScrubberProvider.d.ts","sourceRoot":"","sources":["../../../src/chart/scrubber/ScrubberProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAO9D,OAAO,EAAuC,KAAK,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAE1F,MAAM,MAAM,qBAAqB,GAAG,OAAO,CACzC,IAAI,CAAC,oBAAoB,EAAE,iBAAiB,GAAG,0BAA0B,CAAC,CAC3E,GAAG;IACF,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;OAEG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAkK5D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/chart/scrubber/index.ts"],"names":[],"mappings":"AACA,cAAc,YAAY,CAAC"}
|