@coinbase/cds-web-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 +36 -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 +34 -0
- package/dts/chart/Path.d.ts.map +1 -0
- package/dts/chart/PeriodSelector.d.ts +61 -0
- package/dts/chart/PeriodSelector.d.ts.map +1 -0
- package/dts/chart/Point.d.ts +153 -0
- package/dts/chart/Point.d.ts.map +1 -0
- package/dts/chart/area/Area.d.ts +48 -0
- package/dts/chart/area/Area.d.ts.map +1 -0
- package/dts/chart/area/AreaChart.d.ts +52 -0
- package/dts/chart/area/AreaChart.d.ts.map +1 -0
- package/dts/chart/area/DottedArea.d.ts +68 -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 +208 -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 +91 -0
- package/dts/chart/bar/Bar.d.ts.map +1 -0
- package/dts/chart/bar/BarChart.d.ts +53 -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 +17 -0
- package/dts/chart/bar/DefaultBar.d.ts.map +1 -0
- package/dts/chart/bar/DefaultBarStack.d.ts +16 -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 +14 -0
- package/dts/chart/line/DottedLine.d.ts.map +1 -0
- package/dts/chart/line/GradientLine.d.ts +42 -0
- package/dts/chart/line/GradientLine.d.ts.map +1 -0
- package/dts/chart/line/Line.d.ts +80 -0
- package/dts/chart/line/Line.d.ts.map +1 -0
- package/dts/chart/line/LineChart.d.ts +59 -0
- package/dts/chart/line/LineChart.d.ts.map +1 -0
- package/dts/chart/line/ReferenceLine.d.ts +131 -0
- package/dts/chart/line/ReferenceLine.d.ts.map +1 -0
- package/dts/chart/line/SolidLine.d.ts +14 -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 +149 -0
- package/dts/chart/scrubber/Scrubber.d.ts.map +1 -0
- package/dts/chart/scrubber/ScrubberBeacon.d.ts +93 -0
- package/dts/chart/scrubber/ScrubberBeacon.d.ts.map +1 -0
- package/dts/chart/scrubber/ScrubberBeaconLabel.d.ts +7 -0
- package/dts/chart/scrubber/ScrubberBeaconLabel.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 +114 -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 +67 -0
- package/dts/sparkline/Sparkline.d.ts.map +1 -0
- package/dts/sparkline/SparklineArea.d.ts +15 -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/SparklinePath.d.ts +12 -0
- package/dts/sparkline/SparklinePath.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/InnerSparklineInteractiveProvider.d.ts +13 -0
- package/dts/sparkline/sparkline-interactive/InnerSparklineInteractiveProvider.d.ts.map +1 -0
- package/dts/sparkline/sparkline-interactive/SparklineInteractive.d.ts +199 -0
- package/dts/sparkline/sparkline-interactive/SparklineInteractive.d.ts.map +1 -0
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveAnimatedPath.d.ts +26 -0
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveAnimatedPath.d.ts.map +1 -0
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveHoverDate.d.ts +5 -0
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveHoverDate.d.ts.map +1 -0
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveHoverPrice.d.ts +5 -0
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveHoverPrice.d.ts.map +1 -0
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveLineVertical.d.ts +8 -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/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 +25 -0
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveProvider.d.ts.map +1 -0
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveScrubHandler.d.ts +30 -0
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveScrubHandler.d.ts.map +1 -0
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveScrubProvider.d.ts +18 -0
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveScrubProvider.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/fade.d.ts +3 -0
- package/dts/sparkline/sparkline-interactive/fade.d.ts.map +1 -0
- package/dts/sparkline/sparkline-interactive/useSparklineInteractiveConstants.d.ts +13 -0
- package/dts/sparkline/sparkline-interactive/useSparklineInteractiveConstants.d.ts.map +1 -0
- package/dts/sparkline/sparkline-interactive-header/SparklineInteractiveHeader.d.ts +112 -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/esm/chart/CartesianChart.css +1 -0
- package/esm/chart/CartesianChart.js +258 -0
- package/esm/chart/ChartProvider.js +10 -0
- package/esm/chart/Path.js +89 -0
- package/esm/chart/PeriodSelector.css +1 -0
- package/esm/chart/PeriodSelector.js +126 -0
- package/esm/chart/Point.css +2 -0
- package/esm/chart/Point.js +171 -0
- package/esm/chart/area/Area.js +85 -0
- package/esm/chart/area/AreaChart.js +164 -0
- package/esm/chart/area/DottedArea.js +141 -0
- package/esm/chart/area/GradientArea.js +111 -0
- package/esm/chart/area/SolidArea.js +29 -0
- package/esm/chart/area/index.js +7 -0
- package/esm/chart/axis/Axis.js +46 -0
- package/esm/chart/axis/XAxis.css +2 -0
- package/esm/chart/axis/XAxis.js +195 -0
- package/esm/chart/axis/YAxis.css +2 -0
- package/esm/chart/axis/YAxis.js +183 -0
- package/esm/chart/axis/index.js +5 -0
- package/esm/chart/bar/Bar.js +59 -0
- package/esm/chart/bar/BarChart.js +147 -0
- package/esm/chart/bar/BarPlot.js +96 -0
- package/esm/chart/bar/BarStack.js +519 -0
- package/esm/chart/bar/BarStackGroup.js +96 -0
- package/esm/chart/bar/DefaultBar.js +64 -0
- package/esm/chart/bar/DefaultBarStack.js +60 -0
- package/esm/chart/bar/index.js +9 -0
- package/esm/chart/index.js +14 -0
- package/esm/chart/line/DottedLine.js +38 -0
- package/esm/chart/line/GradientLine.js +58 -0
- package/esm/chart/line/Line.js +159 -0
- package/esm/chart/line/LineChart.js +120 -0
- package/esm/chart/line/ReferenceLine.js +142 -0
- package/esm/chart/line/SolidLine.js +34 -0
- package/esm/chart/line/index.js +8 -0
- package/esm/chart/scrubber/Scrubber.js +483 -0
- package/esm/chart/scrubber/ScrubberBeacon.js +195 -0
- package/esm/chart/scrubber/ScrubberBeaconLabel.js +33 -0
- package/esm/chart/scrubber/ScrubberProvider.js +228 -0
- package/esm/chart/scrubber/index.js +2 -0
- package/esm/chart/text/ChartText.js +236 -0
- package/esm/chart/text/SmartChartTextGroup.js +226 -0
- package/esm/chart/text/index.js +4 -0
- package/esm/chart/utils/axis.js +593 -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 +204 -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.css +3 -0
- package/esm/sparkline/Counter.js +35 -0
- package/esm/sparkline/Sparkline.js +164 -0
- package/esm/sparkline/SparklineArea.js +18 -0
- package/esm/sparkline/SparklineAreaPattern.js +37 -0
- package/esm/sparkline/SparklineGradient.js +30 -0
- package/esm/sparkline/SparklinePath.js +19 -0
- package/esm/sparkline/__figma__/Sparkline.figma.js +24 -0
- package/esm/sparkline/generateSparklineWithId.js +7 -0
- package/esm/sparkline/index.js +5 -0
- package/esm/sparkline/sparkline-interactive/InnerSparklineInteractiveProvider.js +21 -0
- package/esm/sparkline/sparkline-interactive/SparklineInteractive.js +317 -0
- package/esm/sparkline/sparkline-interactive/SparklineInteractiveAnimatedPath.js +108 -0
- package/esm/sparkline/sparkline-interactive/SparklineInteractiveHoverDate.css +2 -0
- package/esm/sparkline/sparkline-interactive/SparklineInteractiveHoverDate.js +26 -0
- package/esm/sparkline/sparkline-interactive/SparklineInteractiveHoverPrice.css +2 -0
- package/esm/sparkline/sparkline-interactive/SparklineInteractiveHoverPrice.js +24 -0
- package/esm/sparkline/sparkline-interactive/SparklineInteractiveLineVertical.css +4 -0
- package/esm/sparkline/sparkline-interactive/SparklineInteractiveLineVertical.js +65 -0
- package/esm/sparkline/sparkline-interactive/SparklineInteractiveMarkerDates.css +1 -0
- package/esm/sparkline/sparkline-interactive/SparklineInteractiveMarkerDates.js +80 -0
- package/esm/sparkline/sparkline-interactive/SparklineInteractivePaths.js +56 -0
- package/esm/sparkline/sparkline-interactive/SparklineInteractivePeriodSelector.js +70 -0
- package/esm/sparkline/sparkline-interactive/SparklineInteractiveProvider.js +45 -0
- package/esm/sparkline/sparkline-interactive/SparklineInteractiveScrubHandler.css +5 -0
- package/esm/sparkline/sparkline-interactive/SparklineInteractiveScrubHandler.js +199 -0
- package/esm/sparkline/sparkline-interactive/SparklineInteractiveScrubProvider.js +39 -0
- package/esm/sparkline/sparkline-interactive/SparklineInteractiveTimeseriesPaths.js +92 -0
- package/esm/sparkline/sparkline-interactive/__figma__/SparklineInteractive.figma.js +89 -0
- package/esm/sparkline/sparkline-interactive/fade.css +2 -0
- package/esm/sparkline/sparkline-interactive/fade.js +14 -0
- package/esm/sparkline/sparkline-interactive/useSparklineInteractiveConstants.js +28 -0
- package/esm/sparkline/sparkline-interactive-header/SparklineInteractiveHeader.js +225 -0
- package/esm/sparkline/sparkline-interactive-header/__figma__/SparklineInteractiveHeader.figma.js +108 -0
- package/package.json +68 -6
- package/index.js +0 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from './area/index';
|
|
2
|
+
export * from './axis/index';
|
|
3
|
+
export * from './bar/index';
|
|
4
|
+
export * from './CartesianChart';
|
|
5
|
+
export * from './ChartProvider';
|
|
6
|
+
export * from './line/index';
|
|
7
|
+
export * from './Path';
|
|
8
|
+
export * from './PeriodSelector';
|
|
9
|
+
export * from './Point';
|
|
10
|
+
export * from './scrubber/index';
|
|
11
|
+
export * from './text/index';
|
|
12
|
+
export * from './utils/index';
|
|
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,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,kBAAkB,CAAC;AACjC,cAAc,SAAS,CAAC;AACxB,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type SVGProps } from 'react';
|
|
2
|
+
import type { SharedProps } from '@coinbase/cds-common/types';
|
|
3
|
+
import { type PathProps } from '../Path';
|
|
4
|
+
import type { LineComponentProps } from './Line';
|
|
5
|
+
export type DottedLineProps = SharedProps &
|
|
6
|
+
Omit<PathProps, 'fill' | 'strokeWidth'> &
|
|
7
|
+
Pick<LineComponentProps, 'strokeWidth'> & {
|
|
8
|
+
fill?: SVGProps<SVGPathElement>['fill'];
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* A customizable dotted line component which uses path element.
|
|
12
|
+
*/
|
|
13
|
+
export declare const DottedLine: import('react').NamedExoticComponent<DottedLineProps>;
|
|
14
|
+
//# sourceMappingURL=DottedLine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DottedLine.d.ts","sourceRoot":"","sources":["../../../src/chart/line/DottedLine.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAE9D,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC;AAE/C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAEjD,MAAM,MAAM,eAAe,GAAG,WAAW,GACvC,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,aAAa,CAAC,GACvC,IAAI,CAAC,kBAAkB,EAAE,aAAa,CAAC,GAAG;IACxC,IAAI,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;CACzC,CAAC;AAEJ;;GAEG;AACH,eAAO,MAAM,UAAU,uDA2BtB,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { SharedProps } from '@coinbase/cds-common/types';
|
|
2
|
+
import { type PathProps } from '../Path';
|
|
3
|
+
import type { LineComponentProps } from './Line';
|
|
4
|
+
export type GradientLineProps = SharedProps &
|
|
5
|
+
Omit<PathProps, 'stroke' | 'strokeOpacity' | 'strokeWidth'> &
|
|
6
|
+
Pick<LineComponentProps, 'strokeWidth'> & {
|
|
7
|
+
/**
|
|
8
|
+
* The color of the line.
|
|
9
|
+
* @default 'var(--color-bgLine)'
|
|
10
|
+
*/
|
|
11
|
+
stroke?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Opacity of the line.
|
|
14
|
+
* @default 1
|
|
15
|
+
*/
|
|
16
|
+
strokeOpacity?: number;
|
|
17
|
+
/**
|
|
18
|
+
* The color of the start of the gradient.
|
|
19
|
+
* @default stroke or 'var(--color-bgLine)'
|
|
20
|
+
*/
|
|
21
|
+
startColor?: string;
|
|
22
|
+
/**
|
|
23
|
+
* The color of the end of the gradient.
|
|
24
|
+
* @default stroke or 'var(--color-bgLine)'
|
|
25
|
+
*/
|
|
26
|
+
endColor?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Opacity of the start color.
|
|
29
|
+
* @default strokeOpacity
|
|
30
|
+
*/
|
|
31
|
+
startOpacity?: number;
|
|
32
|
+
/**
|
|
33
|
+
* Opacity of the end color.
|
|
34
|
+
* @default strokeOpacity
|
|
35
|
+
*/
|
|
36
|
+
endOpacity?: number;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* A gradient line component which uses path element.
|
|
40
|
+
*/
|
|
41
|
+
export declare const GradientLine: import('react').NamedExoticComponent<GradientLineProps>;
|
|
42
|
+
//# sourceMappingURL=GradientLine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GradientLine.d.ts","sourceRoot":"","sources":["../../../src/chart/line/GradientLine.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAE9D,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC;AAE/C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAEjD,MAAM,MAAM,iBAAiB,GAAG,WAAW,GACzC,IAAI,CAAC,SAAS,EAAE,QAAQ,GAAG,eAAe,GAAG,aAAa,CAAC,GAC3D,IAAI,CAAC,kBAAkB,EAAE,aAAa,CAAC,GAAG;IACxC;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;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,yDAqCxB,CAAC"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { SVGProps } from 'react';
|
|
3
|
+
import type { SharedProps } from '@coinbase/cds-common/types';
|
|
4
|
+
import { type AreaComponent } from '../area/Area';
|
|
5
|
+
import { type PointConfig, type RenderPointsParams } from '../Point';
|
|
6
|
+
import { type ChartPathCurveType } from '../utils';
|
|
7
|
+
export type LineComponentProps = {
|
|
8
|
+
d: SVGProps<SVGPathElement>['d'];
|
|
9
|
+
stroke: string;
|
|
10
|
+
strokeOpacity?: number;
|
|
11
|
+
strokeWidth?: number;
|
|
12
|
+
testID?: string;
|
|
13
|
+
animate?: boolean;
|
|
14
|
+
};
|
|
15
|
+
export type LineComponent = React.FC<LineComponentProps>;
|
|
16
|
+
export type LineProps = SharedProps & {
|
|
17
|
+
/**
|
|
18
|
+
* The ID of the series to render. Will be used to find the data from the chart context.
|
|
19
|
+
*/
|
|
20
|
+
seriesId: string;
|
|
21
|
+
/**
|
|
22
|
+
* The curve interpolation method to use for the line.
|
|
23
|
+
* @default 'linear'
|
|
24
|
+
*/
|
|
25
|
+
curve?: ChartPathCurveType;
|
|
26
|
+
/**
|
|
27
|
+
* The type of line to render.
|
|
28
|
+
* @default 'solid'
|
|
29
|
+
*/
|
|
30
|
+
type?: 'solid' | 'dotted' | 'gradient';
|
|
31
|
+
/**
|
|
32
|
+
* Handler for when a dot is clicked.
|
|
33
|
+
* Automatically makes dots appear pressable when provided.
|
|
34
|
+
*/
|
|
35
|
+
onPointClick?: PointConfig['onClick'];
|
|
36
|
+
/**
|
|
37
|
+
* Show area fill under the line.
|
|
38
|
+
*/
|
|
39
|
+
showArea?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* The type of area fill to add to the line.
|
|
42
|
+
* @default 'gradient'
|
|
43
|
+
*/
|
|
44
|
+
areaType?: 'gradient' | 'solid' | 'dotted';
|
|
45
|
+
/**
|
|
46
|
+
* Baseline value for the area.
|
|
47
|
+
* When set, overrides the default baseline.
|
|
48
|
+
*/
|
|
49
|
+
areaBaseline?: number;
|
|
50
|
+
/**
|
|
51
|
+
* Component to render the line.
|
|
52
|
+
* Takes precedence over the type prop if provided.
|
|
53
|
+
*/
|
|
54
|
+
LineComponent?: LineComponent;
|
|
55
|
+
/**
|
|
56
|
+
* Custom component to render line area fill.
|
|
57
|
+
*/
|
|
58
|
+
AreaComponent?: AreaComponent;
|
|
59
|
+
/**
|
|
60
|
+
* The color of the line.
|
|
61
|
+
* @default color of the series or 'var(--color-fgPrimary)'
|
|
62
|
+
*/
|
|
63
|
+
stroke?: string;
|
|
64
|
+
/**
|
|
65
|
+
* Opacity of the line.
|
|
66
|
+
* @default 1
|
|
67
|
+
*/
|
|
68
|
+
opacity?: number;
|
|
69
|
+
/**
|
|
70
|
+
* Callback function to determine how to render points at each data point in the series.
|
|
71
|
+
* Called for every entry in the data array.
|
|
72
|
+
*
|
|
73
|
+
* @param params - Contains the data and pixel coordinates of the data point.
|
|
74
|
+
* @returns true for default point, false/null/undefined for no point, or PointConfig for custom point
|
|
75
|
+
*/
|
|
76
|
+
renderPoints?: (params: RenderPointsParams) => boolean | null | undefined | PointConfig;
|
|
77
|
+
strokeWidth?: number;
|
|
78
|
+
};
|
|
79
|
+
export declare const Line: React.NamedExoticComponent<LineProps>;
|
|
80
|
+
//# 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,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAG9D,OAAO,EAAQ,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAGxD,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,QAAQ,CAAC,cAAc,CAAC,CAAC,GAAG,CAAC,CAAC;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,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;;;OAGG;IACH,YAAY,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IACtC;;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;;;;;;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,uCAsKhB,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { type XAxisProps } from '../axis/XAxis';
|
|
2
|
+
import { type YAxisProps } from '../axis/YAxis';
|
|
3
|
+
import { type CartesianChartProps } from '../CartesianChart';
|
|
4
|
+
import { type AxisConfigProps, type Series } from '../utils';
|
|
5
|
+
import { type LineProps } from './Line';
|
|
6
|
+
export type LineSeries = Series &
|
|
7
|
+
Partial<
|
|
8
|
+
Pick<
|
|
9
|
+
LineProps,
|
|
10
|
+
| 'curve'
|
|
11
|
+
| 'onPointClick'
|
|
12
|
+
| 'showArea'
|
|
13
|
+
| 'areaType'
|
|
14
|
+
| 'areaBaseline'
|
|
15
|
+
| 'type'
|
|
16
|
+
| 'type'
|
|
17
|
+
| 'LineComponent'
|
|
18
|
+
| 'AreaComponent'
|
|
19
|
+
| 'stroke'
|
|
20
|
+
| 'opacity'
|
|
21
|
+
| 'renderPoints'
|
|
22
|
+
| 'strokeWidth'
|
|
23
|
+
>
|
|
24
|
+
>;
|
|
25
|
+
export type LineChartProps = Omit<CartesianChartProps, 'xAxis' | 'yAxis' | 'series'> &
|
|
26
|
+
Pick<
|
|
27
|
+
LineProps,
|
|
28
|
+
| 'showArea'
|
|
29
|
+
| 'areaType'
|
|
30
|
+
| 'type'
|
|
31
|
+
| 'onPointClick'
|
|
32
|
+
| 'LineComponent'
|
|
33
|
+
| 'AreaComponent'
|
|
34
|
+
| 'curve'
|
|
35
|
+
| 'renderPoints'
|
|
36
|
+
| 'strokeWidth'
|
|
37
|
+
> & {
|
|
38
|
+
/**
|
|
39
|
+
* Configuration objects that define how to visualize the data.
|
|
40
|
+
* Each series supports Line component props for individual customization.
|
|
41
|
+
*/
|
|
42
|
+
series?: Array<LineSeries>;
|
|
43
|
+
/**
|
|
44
|
+
* Whether to show the X axis.
|
|
45
|
+
*/
|
|
46
|
+
showXAxis?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Whether to show the Y axis.
|
|
49
|
+
*/
|
|
50
|
+
showYAxis?: boolean;
|
|
51
|
+
xAxis?: Partial<AxisConfigProps> & XAxisProps;
|
|
52
|
+
yAxis?: Partial<AxisConfigProps> & YAxisProps;
|
|
53
|
+
};
|
|
54
|
+
export declare const LineChart: import('react').MemoExoticComponent<
|
|
55
|
+
import('react').ForwardRefExoticComponent<
|
|
56
|
+
Omit<LineChartProps, 'ref'> & import('react').RefAttributes<SVGSVGElement>
|
|
57
|
+
>
|
|
58
|
+
>;
|
|
59
|
+
//# sourceMappingURL=LineChart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LineChart.d.ts","sourceRoot":"","sources":["../../../src/chart/line/LineChart.tsx"],"names":[],"mappings":"AAEA,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,cAAc,GACd,UAAU,GACV,UAAU,GACV,cAAc,GACd,MAAM,GACN,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,cAAc,GACd,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,4JAkHrB,CAAC"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { SharedProps } from '@coinbase/cds-common/types';
|
|
3
|
+
import type {
|
|
4
|
+
ChartTextChildren,
|
|
5
|
+
ChartTextProps,
|
|
6
|
+
TextHorizontalAlignment,
|
|
7
|
+
TextVerticalAlignment,
|
|
8
|
+
} from '../text/ChartText';
|
|
9
|
+
import type { LineComponent } from './Line';
|
|
10
|
+
/**
|
|
11
|
+
* Configuration for ReferenceLine label rendering using ChartText.
|
|
12
|
+
*/
|
|
13
|
+
export type ReferenceLineLabelProps = Pick<
|
|
14
|
+
ChartTextProps,
|
|
15
|
+
| 'dx'
|
|
16
|
+
| 'dy'
|
|
17
|
+
| 'font'
|
|
18
|
+
| 'fontFamily'
|
|
19
|
+
| 'fontSize'
|
|
20
|
+
| 'fontWeight'
|
|
21
|
+
| 'color'
|
|
22
|
+
| 'elevation'
|
|
23
|
+
| 'inset'
|
|
24
|
+
| 'background'
|
|
25
|
+
| 'borderRadius'
|
|
26
|
+
| 'disableRepositioning'
|
|
27
|
+
| 'bounds'
|
|
28
|
+
| 'styles'
|
|
29
|
+
| 'classNames'
|
|
30
|
+
| 'horizontalAlignment'
|
|
31
|
+
| 'verticalAlignment'
|
|
32
|
+
>;
|
|
33
|
+
type BaseReferenceLineProps = SharedProps & {
|
|
34
|
+
/**
|
|
35
|
+
* Label content to display near the reference line.
|
|
36
|
+
* Can be a string or ReactNode for rich formatting.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* // Simple string label
|
|
40
|
+
* label="Target Price"
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* // ReactNode with styling
|
|
44
|
+
* label={<tspan style={{ fontWeight: 'bold', fill: 'red' }}>Stop Loss</tspan>}
|
|
45
|
+
*/
|
|
46
|
+
label?: ChartTextChildren;
|
|
47
|
+
/**
|
|
48
|
+
* Component to render the line.
|
|
49
|
+
* @default DottedLine
|
|
50
|
+
*/
|
|
51
|
+
LineComponent?: LineComponent;
|
|
52
|
+
/**
|
|
53
|
+
* The color of the line.
|
|
54
|
+
* @default 'var(--color-bgLine)'
|
|
55
|
+
*/
|
|
56
|
+
stroke?: string;
|
|
57
|
+
/**
|
|
58
|
+
* Props for the label rendering.
|
|
59
|
+
* Consolidates styling and positioning options for the ChartText component.
|
|
60
|
+
* Alignment defaults are set based on line orientation and can be overridden here.
|
|
61
|
+
*/
|
|
62
|
+
labelProps?: ReferenceLineLabelProps;
|
|
63
|
+
/**
|
|
64
|
+
* Custom class name for the root element.
|
|
65
|
+
*/
|
|
66
|
+
className?: string;
|
|
67
|
+
/**
|
|
68
|
+
* Custom inline styles for the root element.
|
|
69
|
+
*/
|
|
70
|
+
style?: React.CSSProperties;
|
|
71
|
+
/**
|
|
72
|
+
* Custom class names for the component parts.
|
|
73
|
+
*/
|
|
74
|
+
classNames?: {
|
|
75
|
+
/**
|
|
76
|
+
* Custom class name for the root element.
|
|
77
|
+
*/
|
|
78
|
+
root?: string;
|
|
79
|
+
/**
|
|
80
|
+
* Custom class name for the text label.
|
|
81
|
+
*/
|
|
82
|
+
label?: string;
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* Custom styles for the component parts.
|
|
86
|
+
*/
|
|
87
|
+
styles?: {
|
|
88
|
+
/**
|
|
89
|
+
* Custom styles for the root element.
|
|
90
|
+
*/
|
|
91
|
+
root?: React.CSSProperties;
|
|
92
|
+
/**
|
|
93
|
+
* Custom styles for the text label.
|
|
94
|
+
*/
|
|
95
|
+
label?: React.CSSProperties;
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
export type HorizontalReferenceLineProps = BaseReferenceLineProps & {
|
|
99
|
+
/**
|
|
100
|
+
* Y-value for horizontal reference line (data value).
|
|
101
|
+
*/
|
|
102
|
+
dataY: number;
|
|
103
|
+
/**
|
|
104
|
+
* The ID of the y-axis to use for positioning.
|
|
105
|
+
* Defaults to defaultAxisId if not specified.
|
|
106
|
+
*/
|
|
107
|
+
yAxisId?: string;
|
|
108
|
+
/**
|
|
109
|
+
* Position of the label along the horizontal line.
|
|
110
|
+
* @default 'right'
|
|
111
|
+
*/
|
|
112
|
+
labelPosition?: TextHorizontalAlignment;
|
|
113
|
+
dataX?: never;
|
|
114
|
+
};
|
|
115
|
+
export type VerticalReferenceLineProps = BaseReferenceLineProps & {
|
|
116
|
+
/**
|
|
117
|
+
* X-value for vertical reference line (data index).
|
|
118
|
+
*/
|
|
119
|
+
dataX: number;
|
|
120
|
+
/**
|
|
121
|
+
* Position of the label along the vertical line.
|
|
122
|
+
* @default 'top'
|
|
123
|
+
*/
|
|
124
|
+
labelPosition?: TextVerticalAlignment;
|
|
125
|
+
dataY?: never;
|
|
126
|
+
yAxisId?: never;
|
|
127
|
+
};
|
|
128
|
+
export type ReferenceLineProps = HorizontalReferenceLineProps | VerticalReferenceLineProps;
|
|
129
|
+
export declare const ReferenceLine: React.NamedExoticComponent<ReferenceLineProps>;
|
|
130
|
+
export {};
|
|
131
|
+
//# sourceMappingURL=ReferenceLine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReferenceLine.d.ts","sourceRoot":"","sources":["../../../src/chart/line/ReferenceLine.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAC7C,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,MAAM,GACN,YAAY,GACZ,UAAU,GACV,YAAY,GACZ,OAAO,GACP,WAAW,GACX,OAAO,GACP,YAAY,GACZ,cAAc,GACd,sBAAsB,GACtB,QAAQ,GACR,QAAQ,GACR,YAAY,GACZ,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;IACrC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B;;OAEG;IACH,UAAU,CAAC,EAAE;QACX;;WAEG;QACH,IAAI,CAAC,EAAE,MAAM,CAAC;QACd;;WAEG;QACH,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IACF;;OAEG;IACH,MAAM,CAAC,EAAE;QACP;;WAEG;QACH,IAAI,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QAC3B;;WAEG;QACH,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;KAC7B,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG,sBAAsB,GAAG;IAClE;;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,MAAM,MAAM,0BAA0B,GAAG,sBAAsB,GAAG;IAChE;;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,gDAmIzB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type SVGProps } from 'react';
|
|
2
|
+
import type { SharedProps } from '@coinbase/cds-common/types';
|
|
3
|
+
import { type PathProps } from '../Path';
|
|
4
|
+
import type { LineComponentProps } from './Line';
|
|
5
|
+
export type SolidLineProps = SharedProps &
|
|
6
|
+
Omit<PathProps, 'fill' | 'strokeWidth'> &
|
|
7
|
+
Pick<LineComponentProps, 'strokeWidth'> & {
|
|
8
|
+
fill?: SVGProps<SVGPathElement>['fill'];
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* A customizable solid line component which uses path element.
|
|
12
|
+
*/
|
|
13
|
+
export declare const SolidLine: import('react').NamedExoticComponent<SolidLineProps>;
|
|
14
|
+
//# sourceMappingURL=SolidLine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SolidLine.d.ts","sourceRoot":"","sources":["../../../src/chart/line/SolidLine.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAE9D,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC;AAE/C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAEjD,MAAM,MAAM,cAAc,GAAG,WAAW,GACtC,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,aAAa,CAAC,GACvC,IAAI,CAAC,kBAAkB,EAAE,aAAa,CAAC,GAAG;IACxC,IAAI,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;CACzC,CAAC;AAEJ;;GAEG;AACH,eAAO,MAAM,SAAS,sDAuBrB,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,149 @@
|
|
|
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
|
+
import { type ScrubberBeaconLabelProps } from './ScrubberBeaconLabel';
|
|
6
|
+
export type ScrubberRef = ScrubberBeaconRef;
|
|
7
|
+
/**
|
|
8
|
+
* Configuration for scrubber functionality across chart components.
|
|
9
|
+
* Provides consistent API with smart defaults and component customization.
|
|
10
|
+
*/
|
|
11
|
+
export type ScrubberProps = SharedProps &
|
|
12
|
+
Pick<ScrubberBeaconProps, 'idlePulse'> & {
|
|
13
|
+
/**
|
|
14
|
+
* An array of series IDs that will receive visual emphasis as the user scrubs through the chart.
|
|
15
|
+
* Use this prop to restrict the scrubbing visual behavior to specific series.
|
|
16
|
+
* By default, all series will be highlighted by the Scrubber.
|
|
17
|
+
*/
|
|
18
|
+
seriesIds?: string[];
|
|
19
|
+
/**
|
|
20
|
+
* Hides the scrubber line
|
|
21
|
+
*/
|
|
22
|
+
hideLine?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Whether to hide the overlay rect which obscures future data.
|
|
25
|
+
*/
|
|
26
|
+
hideOverlay?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Offset of the overlay rect relative to the drawing area.
|
|
29
|
+
* Useful for when scrubbing over lines, where the stroke width would cause part of the line to be visible.
|
|
30
|
+
* @default 2
|
|
31
|
+
*/
|
|
32
|
+
overlayOffset?: number;
|
|
33
|
+
/**
|
|
34
|
+
* Label text displayed above the scrubber line.
|
|
35
|
+
*/
|
|
36
|
+
label?: ReferenceLineProps['label'] | ((dataIndex: number) => ReferenceLineProps['label']);
|
|
37
|
+
/**
|
|
38
|
+
* Props passed to the scrubber line's label.
|
|
39
|
+
*/
|
|
40
|
+
labelProps?: ReferenceLineProps['labelProps'];
|
|
41
|
+
/**
|
|
42
|
+
* Stroke color for the scrubber line.
|
|
43
|
+
*/
|
|
44
|
+
lineStroke?: ReferenceLineProps['stroke'];
|
|
45
|
+
/**
|
|
46
|
+
* Custom styles for scrubber elements.
|
|
47
|
+
*/
|
|
48
|
+
styles?: {
|
|
49
|
+
overlay?: React.CSSProperties;
|
|
50
|
+
beacon?: React.CSSProperties;
|
|
51
|
+
line?: React.CSSProperties;
|
|
52
|
+
beaconLabel?: React.CSSProperties;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Custom class names for scrubber elements.
|
|
56
|
+
*/
|
|
57
|
+
classNames?: {
|
|
58
|
+
overlay?: string;
|
|
59
|
+
beacon?: string;
|
|
60
|
+
line?: string;
|
|
61
|
+
beaconLabel?: string;
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Custom component for the scrubber beacon.
|
|
65
|
+
*/
|
|
66
|
+
BeaconComponent?: React.ComponentType<ScrubberBeaconProps>;
|
|
67
|
+
/**
|
|
68
|
+
* Custom component for the scrubber beacon label.
|
|
69
|
+
*/
|
|
70
|
+
BeaconLabelComponent?: React.ComponentType<ScrubberBeaconLabelProps>;
|
|
71
|
+
/**
|
|
72
|
+
* Custom component for the scrubber line.
|
|
73
|
+
*/
|
|
74
|
+
LineComponent?: React.ComponentType<ReferenceLineProps>;
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* Unified component that manages all scrubber elements (beacons, line, labels)
|
|
78
|
+
* with intelligent collision detection and consistent positioning.
|
|
79
|
+
*/
|
|
80
|
+
export declare const Scrubber: React.MemoExoticComponent<
|
|
81
|
+
React.ForwardRefExoticComponent<
|
|
82
|
+
SharedProps &
|
|
83
|
+
Pick<ScrubberBeaconProps, 'idlePulse'> & {
|
|
84
|
+
/**
|
|
85
|
+
* An array of series IDs that will receive visual emphasis as the user scrubs through the chart.
|
|
86
|
+
* Use this prop to restrict the scrubbing visual behavior to specific series.
|
|
87
|
+
* By default, all series will be highlighted by the Scrubber.
|
|
88
|
+
*/
|
|
89
|
+
seriesIds?: string[];
|
|
90
|
+
/**
|
|
91
|
+
* Hides the scrubber line
|
|
92
|
+
*/
|
|
93
|
+
hideLine?: boolean;
|
|
94
|
+
/**
|
|
95
|
+
* Whether to hide the overlay rect which obscures future data.
|
|
96
|
+
*/
|
|
97
|
+
hideOverlay?: boolean;
|
|
98
|
+
/**
|
|
99
|
+
* Offset of the overlay rect relative to the drawing area.
|
|
100
|
+
* Useful for when scrubbing over lines, where the stroke width would cause part of the line to be visible.
|
|
101
|
+
* @default 2
|
|
102
|
+
*/
|
|
103
|
+
overlayOffset?: number;
|
|
104
|
+
/**
|
|
105
|
+
* Label text displayed above the scrubber line.
|
|
106
|
+
*/
|
|
107
|
+
label?: ReferenceLineProps['label'] | ((dataIndex: number) => ReferenceLineProps['label']);
|
|
108
|
+
/**
|
|
109
|
+
* Props passed to the scrubber line's label.
|
|
110
|
+
*/
|
|
111
|
+
labelProps?: ReferenceLineProps['labelProps'];
|
|
112
|
+
/**
|
|
113
|
+
* Stroke color for the scrubber line.
|
|
114
|
+
*/
|
|
115
|
+
lineStroke?: ReferenceLineProps['stroke'];
|
|
116
|
+
/**
|
|
117
|
+
* Custom styles for scrubber elements.
|
|
118
|
+
*/
|
|
119
|
+
styles?: {
|
|
120
|
+
overlay?: React.CSSProperties;
|
|
121
|
+
beacon?: React.CSSProperties;
|
|
122
|
+
line?: React.CSSProperties;
|
|
123
|
+
beaconLabel?: React.CSSProperties;
|
|
124
|
+
};
|
|
125
|
+
/**
|
|
126
|
+
* Custom class names for scrubber elements.
|
|
127
|
+
*/
|
|
128
|
+
classNames?: {
|
|
129
|
+
overlay?: string;
|
|
130
|
+
beacon?: string;
|
|
131
|
+
line?: string;
|
|
132
|
+
beaconLabel?: string;
|
|
133
|
+
};
|
|
134
|
+
/**
|
|
135
|
+
* Custom component for the scrubber beacon.
|
|
136
|
+
*/
|
|
137
|
+
BeaconComponent?: React.ComponentType<ScrubberBeaconProps>;
|
|
138
|
+
/**
|
|
139
|
+
* Custom component for the scrubber beacon label.
|
|
140
|
+
*/
|
|
141
|
+
BeaconLabelComponent?: React.ComponentType<ScrubberBeaconLabelProps>;
|
|
142
|
+
/**
|
|
143
|
+
* Custom component for the scrubber line.
|
|
144
|
+
*/
|
|
145
|
+
LineComponent?: React.ComponentType<ReferenceLineProps>;
|
|
146
|
+
} & React.RefAttributes<ScrubberBeaconRef>
|
|
147
|
+
>
|
|
148
|
+
>;
|
|
149
|
+
//# sourceMappingURL=Scrubber.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Scrubber.d.ts","sourceRoot":"","sources":["../../../src/chart/scrubber/Scrubber.tsx"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import type { SharedProps } from '@coinbase/cds-common/types';
|
|
2
|
+
export type ScrubberBeaconRef = {
|
|
3
|
+
/**
|
|
4
|
+
* Triggers a single pulse animation.
|
|
5
|
+
* Only works when the scrubber is in idle state (not actively scrubbing).
|
|
6
|
+
*/
|
|
7
|
+
pulse: () => void;
|
|
8
|
+
};
|
|
9
|
+
export type ScrubberBeaconProps = SharedProps & {
|
|
10
|
+
/**
|
|
11
|
+
* Optional data X coordinate to position the beacon.
|
|
12
|
+
* If not provided, uses the scrubber position from context.
|
|
13
|
+
*/
|
|
14
|
+
dataX?: number;
|
|
15
|
+
/**
|
|
16
|
+
* Optional data Y coordinate to position the beacon.
|
|
17
|
+
* If not provided, looks up the Y value from series data at scrubber position.
|
|
18
|
+
*/
|
|
19
|
+
dataY?: number;
|
|
20
|
+
/**
|
|
21
|
+
* Filter to only show dot for specific series (used for hover-based positioning).
|
|
22
|
+
*/
|
|
23
|
+
seriesId?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Color of the beacon point.
|
|
26
|
+
* If not provided, uses the series color.
|
|
27
|
+
*/
|
|
28
|
+
color?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Opacity of the beacon.
|
|
31
|
+
* @default 1
|
|
32
|
+
*/
|
|
33
|
+
opacity?: number;
|
|
34
|
+
/**
|
|
35
|
+
* Pulse the scrubber beacon while it is at rest.
|
|
36
|
+
*/
|
|
37
|
+
idlePulse?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Custom className for styling.
|
|
40
|
+
*/
|
|
41
|
+
className?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Custom inline styles.
|
|
44
|
+
*/
|
|
45
|
+
style?: React.CSSProperties;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* The ScrubberBeacon is a special instance of a Point used to mark the scrubber's position on a specific series.
|
|
49
|
+
* It renders a glow effect around the point to highlight the scrubber position.
|
|
50
|
+
*/
|
|
51
|
+
export declare const ScrubberBeacon: import('react').MemoExoticComponent<
|
|
52
|
+
import('react').ForwardRefExoticComponent<
|
|
53
|
+
SharedProps & {
|
|
54
|
+
/**
|
|
55
|
+
* Optional data X coordinate to position the beacon.
|
|
56
|
+
* If not provided, uses the scrubber position from context.
|
|
57
|
+
*/
|
|
58
|
+
dataX?: number;
|
|
59
|
+
/**
|
|
60
|
+
* Optional data Y coordinate to position the beacon.
|
|
61
|
+
* If not provided, looks up the Y value from series data at scrubber position.
|
|
62
|
+
*/
|
|
63
|
+
dataY?: number;
|
|
64
|
+
/**
|
|
65
|
+
* Filter to only show dot for specific series (used for hover-based positioning).
|
|
66
|
+
*/
|
|
67
|
+
seriesId?: string;
|
|
68
|
+
/**
|
|
69
|
+
* Color of the beacon point.
|
|
70
|
+
* If not provided, uses the series color.
|
|
71
|
+
*/
|
|
72
|
+
color?: string;
|
|
73
|
+
/**
|
|
74
|
+
* Opacity of the beacon.
|
|
75
|
+
* @default 1
|
|
76
|
+
*/
|
|
77
|
+
opacity?: number;
|
|
78
|
+
/**
|
|
79
|
+
* Pulse the scrubber beacon while it is at rest.
|
|
80
|
+
*/
|
|
81
|
+
idlePulse?: boolean;
|
|
82
|
+
/**
|
|
83
|
+
* Custom className for styling.
|
|
84
|
+
*/
|
|
85
|
+
className?: string;
|
|
86
|
+
/**
|
|
87
|
+
* Custom inline styles.
|
|
88
|
+
*/
|
|
89
|
+
style?: React.CSSProperties;
|
|
90
|
+
} & import('react').RefAttributes<ScrubberBeaconRef>
|
|
91
|
+
>
|
|
92
|
+
>;
|
|
93
|
+
//# sourceMappingURL=ScrubberBeacon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScrubberBeacon.d.ts","sourceRoot":"","sources":["../../../src/chart/scrubber/ScrubberBeacon.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAiB9D,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;;OAGG;IACH,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB,CAAC;AAMF,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;IACpB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc;IA1CzB;;;OAGG;YACK,MAAM;IACd;;;OAGG;YACK,MAAM;IACd;;OAEG;eACQ,MAAM;IACjB;;;OAGG;YACK,MAAM;IACd;;;OAGG;cACO,MAAM;IAChB;;OAEG;gBACS,OAAO;IACnB;;OAEG;gBACS,MAAM;IAClB;;OAEG;YACK,KAAK,CAAC,aAAa;sDAqM5B,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type ChartTextProps } from '../text';
|
|
2
|
+
export type ScrubberBeaconLabelProps = ChartTextProps;
|
|
3
|
+
/**
|
|
4
|
+
* The ScrubberBeaconLabel is a special instance of ChartText used to label a series' scrubber beacon (i.e. a point on the series pinned to the scrubber position).
|
|
5
|
+
*/
|
|
6
|
+
export declare const ScrubberBeaconLabel: import('react').NamedExoticComponent<ChartTextProps>;
|
|
7
|
+
//# sourceMappingURL=ScrubberBeaconLabel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScrubberBeaconLabel.d.ts","sourceRoot":"","sources":["../../../src/chart/scrubber/ScrubberBeaconLabel.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzD,MAAM,MAAM,wBAAwB,GAAG,cAAc,CAAC;AAEtD;;GAEG;AACH,eAAO,MAAM,mBAAmB,sDAsB/B,CAAC"}
|