@coinbase/cds-web-visualization 3.4.0-beta.2 → 3.4.0-beta.20
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 +115 -0
- package/dts/chart/CartesianChart.d.ts +56 -3
- package/dts/chart/CartesianChart.d.ts.map +1 -1
- package/dts/chart/ChartProvider.d.ts +3 -0
- package/dts/chart/ChartProvider.d.ts.map +1 -1
- package/dts/chart/Path.d.ts +64 -7
- package/dts/chart/Path.d.ts.map +1 -1
- package/dts/chart/PeriodSelector.d.ts +5 -15
- package/dts/chart/PeriodSelector.d.ts.map +1 -1
- package/dts/chart/area/Area.d.ts +50 -25
- package/dts/chart/area/Area.d.ts.map +1 -1
- package/dts/chart/area/AreaChart.d.ts +46 -6
- package/dts/chart/area/AreaChart.d.ts.map +1 -1
- package/dts/chart/area/DottedArea.d.ts +21 -44
- package/dts/chart/area/DottedArea.d.ts.map +1 -1
- package/dts/chart/area/GradientArea.d.ts +21 -12
- package/dts/chart/area/GradientArea.d.ts.map +1 -1
- package/dts/chart/area/SolidArea.d.ts +16 -1
- package/dts/chart/area/SolidArea.d.ts.map +1 -1
- package/dts/chart/axis/Axis.d.ts +109 -63
- package/dts/chart/axis/Axis.d.ts.map +1 -1
- package/dts/chart/axis/DefaultAxisTickLabel.d.ts +8 -0
- package/dts/chart/axis/DefaultAxisTickLabel.d.ts.map +1 -0
- package/dts/chart/axis/XAxis.d.ts +1 -1
- package/dts/chart/axis/XAxis.d.ts.map +1 -1
- package/dts/chart/axis/YAxis.d.ts +2 -2
- package/dts/chart/axis/YAxis.d.ts.map +1 -1
- package/dts/chart/axis/index.d.ts +1 -0
- package/dts/chart/axis/index.d.ts.map +1 -1
- package/dts/chart/bar/Bar.d.ts +50 -12
- package/dts/chart/bar/Bar.d.ts.map +1 -1
- package/dts/chart/bar/BarChart.d.ts +20 -8
- package/dts/chart/bar/BarChart.d.ts.map +1 -1
- package/dts/chart/bar/BarPlot.d.ts +3 -1
- package/dts/chart/bar/BarPlot.d.ts.map +1 -1
- package/dts/chart/bar/BarStack.d.ts +41 -46
- package/dts/chart/bar/BarStack.d.ts.map +1 -1
- package/dts/chart/bar/BarStackGroup.d.ts +2 -0
- package/dts/chart/bar/BarStackGroup.d.ts.map +1 -1
- package/dts/chart/bar/DefaultBar.d.ts.map +1 -1
- package/dts/chart/bar/DefaultBarStack.d.ts.map +1 -1
- package/dts/chart/gradient/Gradient.d.ts +35 -0
- package/dts/chart/gradient/Gradient.d.ts.map +1 -0
- package/dts/chart/gradient/index.d.ts +2 -0
- package/dts/chart/gradient/index.d.ts.map +1 -0
- package/dts/chart/index.d.ts +3 -1
- package/dts/chart/index.d.ts.map +1 -1
- package/dts/chart/legend/DefaultLegendEntry.d.ts +21 -0
- package/dts/chart/legend/DefaultLegendEntry.d.ts.map +1 -0
- package/dts/chart/legend/DefaultLegendShape.d.ts +7 -0
- package/dts/chart/legend/DefaultLegendShape.d.ts.map +1 -0
- package/dts/chart/legend/Legend.d.ts +169 -0
- package/dts/chart/legend/Legend.d.ts.map +1 -0
- package/dts/chart/legend/index.d.ts +4 -0
- package/dts/chart/legend/index.d.ts.map +1 -0
- package/dts/chart/line/DefaultReferenceLineLabel.d.ts +9 -0
- package/dts/chart/line/DefaultReferenceLineLabel.d.ts.map +1 -0
- package/dts/chart/line/DottedLine.d.ts +15 -3
- package/dts/chart/line/DottedLine.d.ts.map +1 -1
- package/dts/chart/line/Line.d.ts +84 -28
- package/dts/chart/line/Line.d.ts.map +1 -1
- package/dts/chart/line/LineChart.d.ts +28 -8
- package/dts/chart/line/LineChart.d.ts.map +1 -1
- package/dts/chart/line/ReferenceLine.d.ts +91 -44
- package/dts/chart/line/ReferenceLine.d.ts.map +1 -1
- package/dts/chart/line/SolidLine.d.ts +14 -3
- package/dts/chart/line/SolidLine.d.ts.map +1 -1
- package/dts/chart/line/index.d.ts +1 -1
- package/dts/chart/line/index.d.ts.map +1 -1
- package/dts/chart/point/DefaultPointLabel.d.ts +10 -0
- package/dts/chart/point/DefaultPointLabel.d.ts.map +1 -0
- package/dts/chart/point/Point.d.ts +217 -0
- package/dts/chart/point/Point.d.ts.map +1 -0
- package/dts/chart/point/index.d.ts +3 -0
- package/dts/chart/point/index.d.ts.map +1 -0
- package/dts/chart/scrubber/DefaultScrubberBeacon.d.ts +41 -0
- package/dts/chart/scrubber/DefaultScrubberBeacon.d.ts.map +1 -0
- package/dts/chart/scrubber/DefaultScrubberBeaconLabel.d.ts +12 -0
- package/dts/chart/scrubber/DefaultScrubberBeaconLabel.d.ts.map +1 -0
- package/dts/chart/scrubber/DefaultScrubberLabel.d.ts +10 -0
- package/dts/chart/scrubber/DefaultScrubberLabel.d.ts.map +1 -0
- package/dts/chart/scrubber/Scrubber.d.ts +287 -70
- package/dts/chart/scrubber/Scrubber.d.ts.map +1 -1
- package/dts/chart/scrubber/ScrubberBeaconGroup.d.ts +80 -0
- package/dts/chart/scrubber/ScrubberBeaconGroup.d.ts.map +1 -0
- package/dts/chart/scrubber/ScrubberBeaconLabelGroup.d.ts +47 -0
- package/dts/chart/scrubber/ScrubberBeaconLabelGroup.d.ts.map +1 -0
- package/dts/chart/scrubber/index.d.ts +3 -0
- package/dts/chart/scrubber/index.d.ts.map +1 -1
- package/dts/chart/text/ChartText.d.ts +46 -43
- package/dts/chart/text/ChartText.d.ts.map +1 -1
- package/dts/chart/text/{SmartChartTextGroup.d.ts → ChartTextGroup.d.ts} +9 -3
- package/dts/chart/text/ChartTextGroup.d.ts.map +1 -0
- package/dts/chart/text/index.d.ts +1 -1
- package/dts/chart/text/index.d.ts.map +1 -1
- package/dts/chart/utils/axis.d.ts +25 -1
- package/dts/chart/utils/axis.d.ts.map +1 -1
- package/dts/chart/utils/bar.d.ts +34 -0
- package/dts/chart/utils/bar.d.ts.map +1 -1
- package/dts/chart/utils/chart.d.ts +45 -7
- package/dts/chart/utils/chart.d.ts.map +1 -1
- package/dts/chart/utils/context.d.ts +6 -0
- package/dts/chart/utils/context.d.ts.map +1 -1
- package/dts/chart/utils/gradient.d.ts +104 -0
- package/dts/chart/utils/gradient.d.ts.map +1 -0
- package/dts/chart/utils/index.d.ts +4 -0
- package/dts/chart/utils/index.d.ts.map +1 -1
- package/dts/chart/utils/interpolate.d.ts +112 -0
- package/dts/chart/utils/interpolate.d.ts.map +1 -0
- package/dts/chart/utils/path.d.ts +30 -1
- package/dts/chart/utils/path.d.ts.map +1 -1
- package/dts/chart/utils/point.d.ts +40 -7
- package/dts/chart/utils/point.d.ts.map +1 -1
- package/dts/chart/utils/scale.d.ts +11 -0
- package/dts/chart/utils/scale.d.ts.map +1 -1
- package/dts/chart/utils/scrubber.d.ts +40 -0
- package/dts/chart/utils/scrubber.d.ts.map +1 -0
- package/dts/chart/utils/transition.d.ts +101 -0
- package/dts/chart/utils/transition.d.ts.map +1 -0
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveMarkerDates.d.ts.map +1 -1
- package/esm/chart/CartesianChart.js +170 -83
- package/esm/chart/ChartProvider.js +2 -2
- package/esm/chart/Path.js +59 -54
- package/esm/chart/PeriodSelector.js +36 -32
- package/esm/chart/area/Area.js +26 -34
- package/esm/chart/area/AreaChart.js +29 -15
- package/esm/chart/area/DottedArea.js +39 -89
- package/esm/chart/area/GradientArea.js +37 -80
- package/esm/chart/area/SolidArea.js +32 -11
- package/esm/chart/axis/Axis.js +4 -39
- package/esm/chart/axis/DefaultAxisTickLabel.js +15 -0
- package/esm/chart/axis/XAxis.js +184 -63
- package/esm/chart/axis/YAxis.js +190 -57
- package/esm/chart/axis/index.js +1 -0
- package/esm/chart/bar/Bar.js +7 -1
- package/esm/chart/bar/BarChart.js +17 -32
- package/esm/chart/bar/BarPlot.js +5 -2
- package/esm/chart/bar/BarStack.js +74 -22
- package/esm/chart/bar/BarStackGroup.js +8 -18
- package/esm/chart/bar/DefaultBar.js +23 -28
- package/esm/chart/bar/DefaultBarStack.js +24 -20
- package/esm/chart/gradient/Gradient.js +104 -0
- package/esm/chart/gradient/index.js +1 -0
- package/esm/chart/index.js +3 -1
- package/esm/chart/legend/DefaultLegendEntry.css +1 -0
- package/esm/chart/legend/DefaultLegendEntry.js +50 -0
- package/esm/chart/legend/DefaultLegendShape.css +5 -0
- package/esm/chart/legend/DefaultLegendShape.js +47 -0
- package/esm/chart/legend/Legend.js +76 -0
- package/esm/chart/legend/index.js +3 -0
- package/esm/chart/line/DefaultReferenceLineLabel.js +81 -0
- package/esm/chart/line/DottedLine.js +41 -17
- package/esm/chart/line/Line.js +87 -75
- package/esm/chart/line/LineChart.js +24 -8
- package/esm/chart/line/ReferenceLine.js +41 -43
- package/esm/chart/line/SolidLine.js +39 -15
- package/esm/chart/line/index.js +1 -1
- package/esm/chart/{line/GradientLine.js → point/DefaultPointLabel.js} +31 -45
- package/esm/chart/point/Point.css +2 -0
- package/esm/chart/{Point.js → point/Point.js} +87 -62
- package/esm/chart/point/index.js +2 -0
- package/esm/chart/scrubber/DefaultScrubberBeacon.js +154 -0
- package/esm/chart/scrubber/DefaultScrubberBeaconLabel.js +57 -0
- package/esm/chart/scrubber/{ScrubberBeaconLabel.js → DefaultScrubberLabel.js} +15 -18
- package/esm/chart/scrubber/Scrubber.js +97 -392
- package/esm/chart/scrubber/ScrubberBeaconGroup.js +174 -0
- package/esm/chart/scrubber/ScrubberBeaconLabelGroup.js +201 -0
- package/esm/chart/scrubber/index.js +3 -1
- package/esm/chart/text/ChartText.js +15 -20
- package/esm/chart/text/{SmartChartTextGroup.js → ChartTextGroup.js} +4 -3
- package/esm/chart/text/index.js +1 -1
- package/esm/chart/utils/axis.js +47 -31
- package/esm/chart/utils/bar.js +48 -0
- package/esm/chart/utils/chart.js +42 -3
- package/esm/chart/utils/gradient.js +257 -0
- package/esm/chart/utils/index.js +4 -0
- package/esm/chart/utils/interpolate.js +644 -0
- package/esm/chart/utils/path.js +41 -9
- package/esm/chart/utils/point.js +99 -12
- package/esm/chart/utils/scale.js +13 -2
- package/esm/chart/utils/scrubber.js +137 -0
- package/esm/chart/utils/transition.js +133 -0
- package/esm/sparkline/__figma__/Sparkline.figma.js +1 -1
- package/esm/sparkline/sparkline-interactive/SparklineInteractiveMarkerDates.js +8 -4
- package/esm/sparkline/sparkline-interactive/__figma__/SparklineInteractive.figma.js +1 -1
- package/esm/sparkline/sparkline-interactive-header/__figma__/SparklineInteractiveHeader.figma.js +1 -1
- package/package.json +12 -11
- package/dts/chart/Point.d.ts +0 -153
- package/dts/chart/Point.d.ts.map +0 -1
- package/dts/chart/line/GradientLine.d.ts +0 -42
- package/dts/chart/line/GradientLine.d.ts.map +0 -1
- package/dts/chart/scrubber/ScrubberBeacon.d.ts +0 -93
- package/dts/chart/scrubber/ScrubberBeacon.d.ts.map +0 -1
- package/dts/chart/scrubber/ScrubberBeaconLabel.d.ts +0 -7
- package/dts/chart/scrubber/ScrubberBeaconLabel.d.ts.map +0 -1
- package/dts/chart/text/SmartChartTextGroup.d.ts.map +0 -1
- package/esm/chart/Point.css +0 -2
- package/esm/chart/scrubber/ScrubberBeacon.js +0 -195
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type XAxisProps } from '../axis/XAxis';
|
|
2
2
|
import { type YAxisProps } from '../axis/YAxis';
|
|
3
|
-
import { type CartesianChartProps } from '../CartesianChart';
|
|
3
|
+
import { type CartesianChartBaseProps, type CartesianChartProps } from '../CartesianChart';
|
|
4
4
|
import { type AxisConfigProps, type Series } from '../utils';
|
|
5
5
|
import { type LineProps } from './Line';
|
|
6
6
|
export type LineSeries = Series &
|
|
@@ -8,32 +8,40 @@ export type LineSeries = Series &
|
|
|
8
8
|
Pick<
|
|
9
9
|
LineProps,
|
|
10
10
|
| 'curve'
|
|
11
|
-
| 'onPointClick'
|
|
12
11
|
| 'showArea'
|
|
13
12
|
| 'areaType'
|
|
14
13
|
| 'areaBaseline'
|
|
15
14
|
| 'type'
|
|
16
|
-
| 'type'
|
|
17
15
|
| 'LineComponent'
|
|
18
16
|
| 'AreaComponent'
|
|
19
17
|
| 'stroke'
|
|
20
|
-
| 'opacity'
|
|
21
|
-
| 'renderPoints'
|
|
22
18
|
| 'strokeWidth'
|
|
19
|
+
| 'strokeOpacity'
|
|
20
|
+
| 'opacity'
|
|
21
|
+
| 'points'
|
|
22
|
+
| 'connectNulls'
|
|
23
|
+
| 'transitions'
|
|
24
|
+
| 'transition'
|
|
25
|
+
| 'onPointClick'
|
|
23
26
|
>
|
|
24
27
|
>;
|
|
25
|
-
export type
|
|
28
|
+
export type LineChartBaseProps = Omit<CartesianChartBaseProps, 'xAxis' | 'yAxis' | 'series'> &
|
|
26
29
|
Pick<
|
|
27
30
|
LineProps,
|
|
28
31
|
| 'showArea'
|
|
29
32
|
| 'areaType'
|
|
30
33
|
| 'type'
|
|
31
|
-
| 'onPointClick'
|
|
32
34
|
| 'LineComponent'
|
|
33
35
|
| 'AreaComponent'
|
|
34
36
|
| 'curve'
|
|
35
|
-
| '
|
|
37
|
+
| 'points'
|
|
36
38
|
| 'strokeWidth'
|
|
39
|
+
| 'strokeOpacity'
|
|
40
|
+
| 'connectNulls'
|
|
41
|
+
| 'transitions'
|
|
42
|
+
| 'transition'
|
|
43
|
+
| 'onPointClick'
|
|
44
|
+
| 'opacity'
|
|
37
45
|
> & {
|
|
38
46
|
/**
|
|
39
47
|
* Configuration objects that define how to visualize the data.
|
|
@@ -48,9 +56,21 @@ export type LineChartProps = Omit<CartesianChartProps, 'xAxis' | 'yAxis' | 'seri
|
|
|
48
56
|
* Whether to show the Y axis.
|
|
49
57
|
*/
|
|
50
58
|
showYAxis?: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Configuration for x-axis.
|
|
61
|
+
* Accepts axis config and axis props.
|
|
62
|
+
* To show the axis, set `showXAxis` to true.
|
|
63
|
+
*/
|
|
51
64
|
xAxis?: Partial<AxisConfigProps> & XAxisProps;
|
|
65
|
+
/**
|
|
66
|
+
* Configuration for y-axis.
|
|
67
|
+
* Accepts axis config and axis props.
|
|
68
|
+
* To show the axis, set `showYAxis` to true.
|
|
69
|
+
*/
|
|
52
70
|
yAxis?: Partial<AxisConfigProps> & YAxisProps;
|
|
53
71
|
};
|
|
72
|
+
export type LineChartProps = LineChartBaseProps &
|
|
73
|
+
Omit<CartesianChartProps, 'xAxis' | 'yAxis' | 'series'>;
|
|
54
74
|
export declare const LineChart: import('react').MemoExoticComponent<
|
|
55
75
|
import('react').ForwardRefExoticComponent<
|
|
56
76
|
Omit<LineChartProps, 'ref'> & import('react').RefAttributes<SVGSVGElement>
|
|
@@ -1 +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,
|
|
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,EAEL,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EACzB,MAAM,mBAAmB,CAAC;AAC3B,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,aAAa,GACb,eAAe,GACf,SAAS,GACT,QAAQ,GACR,cAAc,GACd,aAAa,GACb,YAAY,GACZ,cAAc,CACjB,CACF,CAAC;AAEJ,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,uBAAuB,EAAE,OAAO,GAAG,OAAO,GAAG,QAAQ,CAAC,GAC1F,IAAI,CACF,SAAS,EACP,UAAU,GACV,UAAU,GACV,MAAM,GACN,eAAe,GACf,eAAe,GACf,OAAO,GACP,QAAQ,GACR,aAAa,GACb,eAAe,GACf,cAAc,GACd,aAAa,GACb,YAAY,GACZ,cAAc,GACd,SAAS,CACZ,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;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,UAAU,CAAC;IAC9C;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,UAAU,CAAC;CAC/C,CAAC;AAEJ,MAAM,MAAM,cAAc,GAAG,kBAAkB,GAC7C,IAAI,CAAC,mBAAmB,EAAE,OAAO,GAAG,OAAO,GAAG,QAAQ,CAAC,CAAC;AAE1D,eAAO,MAAM,SAAS,4JA+HrB,CAAC"}
|
|
@@ -6,12 +6,14 @@ import type {
|
|
|
6
6
|
TextHorizontalAlignment,
|
|
7
7
|
TextVerticalAlignment,
|
|
8
8
|
} from '../text/ChartText';
|
|
9
|
+
import type { ChartInset } from '../utils';
|
|
9
10
|
import type { LineComponent } from './Line';
|
|
10
|
-
|
|
11
|
-
* Configuration for ReferenceLine label rendering using ChartText.
|
|
12
|
-
*/
|
|
13
|
-
export type ReferenceLineLabelProps = Pick<
|
|
11
|
+
export type ReferenceLineLabelComponentProps = Pick<
|
|
14
12
|
ChartTextProps,
|
|
13
|
+
| 'x'
|
|
14
|
+
| 'y'
|
|
15
|
+
| 'children'
|
|
16
|
+
| 'testID'
|
|
15
17
|
| 'dx'
|
|
16
18
|
| 'dy'
|
|
17
19
|
| 'font'
|
|
@@ -19,18 +21,27 @@ export type ReferenceLineLabelProps = Pick<
|
|
|
19
21
|
| 'fontSize'
|
|
20
22
|
| 'fontWeight'
|
|
21
23
|
| 'color'
|
|
22
|
-
| '
|
|
24
|
+
| 'elevated'
|
|
23
25
|
| 'inset'
|
|
24
26
|
| 'background'
|
|
25
27
|
| 'borderRadius'
|
|
26
28
|
| 'disableRepositioning'
|
|
27
|
-
| 'bounds'
|
|
28
29
|
| 'styles'
|
|
29
30
|
| 'classNames'
|
|
30
31
|
| 'horizontalAlignment'
|
|
31
32
|
| 'verticalAlignment'
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
| 'className'
|
|
34
|
+
| 'style'
|
|
35
|
+
| 'opacity'
|
|
36
|
+
> & {
|
|
37
|
+
/**
|
|
38
|
+
* Bounds inset for label to prevent cutoff at chart edges.
|
|
39
|
+
* @default { top: 4, bottom: 20, left: 12, right: 12 } when elevated is true, otherwise undefined
|
|
40
|
+
*/
|
|
41
|
+
boundsInset?: number | ChartInset;
|
|
42
|
+
};
|
|
43
|
+
export type ReferenceLineLabelComponent = React.FC<ReferenceLineLabelComponentProps>;
|
|
44
|
+
export type ReferenceLineBaseProps = SharedProps & {
|
|
34
45
|
/**
|
|
35
46
|
* Label content to display near the reference line.
|
|
36
47
|
* Can be a string or ReactNode for rich formatting.
|
|
@@ -49,17 +60,85 @@ type BaseReferenceLineProps = SharedProps & {
|
|
|
49
60
|
* @default DottedLine
|
|
50
61
|
*/
|
|
51
62
|
LineComponent?: LineComponent;
|
|
63
|
+
/**
|
|
64
|
+
* Component to render the label.
|
|
65
|
+
* @default DefaultReferenceLineLabel
|
|
66
|
+
*/
|
|
67
|
+
LabelComponent?: ReferenceLineLabelComponent;
|
|
68
|
+
/**
|
|
69
|
+
* Whether to elevate the label with a shadow.
|
|
70
|
+
* When true, applies elevation and automatically adds bounds to keep label within chart area.
|
|
71
|
+
*/
|
|
72
|
+
labelElevated?: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Font style for the label text.
|
|
75
|
+
*/
|
|
76
|
+
labelFont?: ChartTextProps['font'];
|
|
77
|
+
/**
|
|
78
|
+
* Horizontal offset for the label in pixels.
|
|
79
|
+
*/
|
|
80
|
+
labelDx?: number;
|
|
81
|
+
/**
|
|
82
|
+
* Vertical offset for the label in pixels.
|
|
83
|
+
*/
|
|
84
|
+
labelDy?: number;
|
|
85
|
+
/**
|
|
86
|
+
* Horizontal alignment of the label text.
|
|
87
|
+
*/
|
|
88
|
+
labelHorizontalAlignment?: TextHorizontalAlignment;
|
|
89
|
+
/**
|
|
90
|
+
* Vertical alignment of the label text.
|
|
91
|
+
*/
|
|
92
|
+
labelVerticalAlignment?: TextVerticalAlignment;
|
|
93
|
+
/**
|
|
94
|
+
* Bounds inset for the label to prevent cutoff at chart edges.
|
|
95
|
+
* Especially useful when labelElevated is true to prevent shadow clipping.
|
|
96
|
+
* Can be a number (applied to all sides) or a ChartInset object.
|
|
97
|
+
* @default { top: 4, bottom: 20, left: 12, right: 12 } when labelElevated is true, otherwise none
|
|
98
|
+
*/
|
|
99
|
+
labelBoundsInset?: number | ChartInset;
|
|
52
100
|
/**
|
|
53
101
|
* The color of the line.
|
|
54
102
|
* @default 'var(--color-bgLine)'
|
|
55
103
|
*/
|
|
56
104
|
stroke?: string;
|
|
57
105
|
/**
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
|
|
106
|
+
* Opacity applied to both the line and label.
|
|
107
|
+
* @default 1
|
|
108
|
+
*/
|
|
109
|
+
opacity?: number;
|
|
110
|
+
};
|
|
111
|
+
export type HorizontalReferenceLineProps = ReferenceLineBaseProps & {
|
|
112
|
+
/**
|
|
113
|
+
* Y-value for horizontal reference line (data value).
|
|
114
|
+
*/
|
|
115
|
+
dataY: number;
|
|
116
|
+
/**
|
|
117
|
+
* The ID of the y-axis to use for positioning.
|
|
118
|
+
* Defaults to defaultAxisId if not specified.
|
|
119
|
+
*/
|
|
120
|
+
yAxisId?: string;
|
|
121
|
+
/**
|
|
122
|
+
* Position of the label along the horizontal line.
|
|
123
|
+
* @default 'right'
|
|
124
|
+
*/
|
|
125
|
+
labelPosition?: TextHorizontalAlignment;
|
|
126
|
+
dataX?: never;
|
|
127
|
+
};
|
|
128
|
+
export type VerticalReferenceLineProps = ReferenceLineBaseProps & {
|
|
129
|
+
/**
|
|
130
|
+
* X-value for vertical reference line (data index).
|
|
131
|
+
*/
|
|
132
|
+
dataX: number;
|
|
133
|
+
/**
|
|
134
|
+
* Position of the label along the vertical line.
|
|
135
|
+
* @default 'top'
|
|
61
136
|
*/
|
|
62
|
-
|
|
137
|
+
labelPosition?: TextVerticalAlignment;
|
|
138
|
+
dataY?: never;
|
|
139
|
+
yAxisId?: never;
|
|
140
|
+
};
|
|
141
|
+
export type ReferenceLineProps = (HorizontalReferenceLineProps | VerticalReferenceLineProps) & {
|
|
63
142
|
/**
|
|
64
143
|
* Custom class name for the root element.
|
|
65
144
|
*/
|
|
@@ -95,37 +174,5 @@ type BaseReferenceLineProps = SharedProps & {
|
|
|
95
174
|
label?: React.CSSProperties;
|
|
96
175
|
};
|
|
97
176
|
};
|
|
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
177
|
export declare const ReferenceLine: React.NamedExoticComponent<ReferenceLineProps>;
|
|
130
|
-
export {};
|
|
131
178
|
//# sourceMappingURL=ReferenceLine.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReferenceLine.d.ts","sourceRoot":"","sources":["../../../src/chart/line/ReferenceLine.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"ReferenceLine.d.ts","sourceRoot":"","sources":["../../../src/chart/line/ReferenceLine.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAe,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAI9D,OAAO,KAAK,EACV,iBAAiB,EACjB,cAAc,EACd,uBAAuB,EACvB,qBAAqB,EACtB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAK3C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAE5C,MAAM,MAAM,gCAAgC,GAAG,IAAI,CACjD,cAAc,EACZ,GAAG,GACH,GAAG,GACH,UAAU,GACV,QAAQ,GACR,IAAI,GACJ,IAAI,GACJ,MAAM,GACN,YAAY,GACZ,UAAU,GACV,YAAY,GACZ,OAAO,GACP,UAAU,GACV,OAAO,GACP,YAAY,GACZ,cAAc,GACd,sBAAsB,GACtB,QAAQ,GACR,YAAY,GACZ,qBAAqB,GACrB,mBAAmB,GACnB,WAAW,GACX,OAAO,GACP,SAAS,CACZ,GAAG;IAC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C,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,OAAO,CAAC,EAAE,KAAK,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,CAAC,4BAA4B,GAAG,0BAA0B,CAAC,GAAG;IAC7F;;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,eAAO,MAAM,aAAa,gDA2IzB,CAAC"}
|
|
@@ -3,12 +3,23 @@ import type { SharedProps } from '@coinbase/cds-common/types';
|
|
|
3
3
|
import { type PathProps } from '../Path';
|
|
4
4
|
import type { LineComponentProps } from './Line';
|
|
5
5
|
export type SolidLineProps = SharedProps &
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
Pick<
|
|
7
|
+
PathProps,
|
|
8
|
+
| 'className'
|
|
9
|
+
| 'clipOffset'
|
|
10
|
+
| 'clipRect'
|
|
11
|
+
| 'strokeLinecap'
|
|
12
|
+
| 'strokeLinejoin'
|
|
13
|
+
| 'strokeDasharray'
|
|
14
|
+
| 'strokeDashoffset'
|
|
15
|
+
| 'style'
|
|
16
|
+
> &
|
|
17
|
+
LineComponentProps & {
|
|
8
18
|
fill?: SVGProps<SVGPathElement>['fill'];
|
|
9
19
|
};
|
|
10
20
|
/**
|
|
11
|
-
* A customizable solid line component
|
|
21
|
+
* A customizable solid line component.
|
|
22
|
+
* Supports gradient for gradient effects and smooth data transitions.
|
|
12
23
|
*/
|
|
13
24
|
export declare const SolidLine: import('react').NamedExoticComponent<SolidLineProps>;
|
|
14
25
|
//# sourceMappingURL=SolidLine.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolidLine.d.ts","sourceRoot":"","sources":["../../../src/chart/line/SolidLine.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,QAAQ,
|
|
1
|
+
{"version":3,"file":"SolidLine.d.ts","sourceRoot":"","sources":["../../../src/chart/line/SolidLine.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,QAAQ,EAAS,MAAM,OAAO,CAAC;AACnD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAG9D,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,CACF,SAAS,EACP,WAAW,GACX,YAAY,GACZ,UAAU,GACV,eAAe,GACf,gBAAgB,GAChB,iBAAiB,GACjB,kBAAkB,GAClB,OAAO,CACV,GACD,kBAAkB,GAAG;IACnB,IAAI,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;CACzC,CAAC;AAEJ;;;GAGG;AACH,eAAO,MAAM,SAAS,sDAgDrB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/chart/line/index.ts"],"names":[],"mappings":"AACA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/chart/line/index.ts"],"names":[],"mappings":"AACA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ChartTextProps } from '../text';
|
|
2
|
+
import type { PointLabelProps } from './Point';
|
|
3
|
+
export type DefaultPointLabelProps = PointLabelProps &
|
|
4
|
+
Omit<ChartTextProps, 'children' | 'x' | 'y' | 'horizontalAlignment' | 'verticalAlignment'>;
|
|
5
|
+
/**
|
|
6
|
+
* DefaultPointLabel is the default label component for point labels.
|
|
7
|
+
* It renders text at the specified position relative to the point.
|
|
8
|
+
*/
|
|
9
|
+
export declare const DefaultPointLabel: import('react').NamedExoticComponent<DefaultPointLabelProps>;
|
|
10
|
+
//# sourceMappingURL=DefaultPointLabel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DefaultPointLabel.d.ts","sourceRoot":"","sources":["../../../src/chart/point/DefaultPointLabel.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,SAAS,CAAC;AAGzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,MAAM,MAAM,sBAAsB,GAAG,eAAe,GAClD,IAAI,CAAC,cAAc,EAAE,UAAU,GAAG,GAAG,GAAG,GAAG,GAAG,qBAAqB,GAAG,mBAAmB,CAAC,CAAC;AAE7F;;;GAGG;AACH,eAAO,MAAM,iBAAiB,8DAwB7B,CAAC"}
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import React, { type SVGProps } from 'react';
|
|
2
|
+
import type { SharedProps } from '@coinbase/cds-common/types';
|
|
3
|
+
import { type Transition } from 'framer-motion';
|
|
4
|
+
import type { ChartTextChildren, ChartTextProps } from '../text/ChartText';
|
|
5
|
+
import { type PointLabelPosition } from '../utils';
|
|
6
|
+
export type PointBaseProps = SharedProps & {
|
|
7
|
+
/**
|
|
8
|
+
* X coordinate in data space (not pixel coordinates).
|
|
9
|
+
*/
|
|
10
|
+
dataX: number;
|
|
11
|
+
/**
|
|
12
|
+
* Y coordinate in data space (not pixel coordinates).
|
|
13
|
+
*/
|
|
14
|
+
dataY: number;
|
|
15
|
+
/**
|
|
16
|
+
* The fill color of the point.
|
|
17
|
+
* @default 'var(--color-fgPrimary)'
|
|
18
|
+
*/
|
|
19
|
+
fill?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Optional Y-axis id to specify which axis to plot along.
|
|
22
|
+
* @default first y-axis defined in chart props.
|
|
23
|
+
*/
|
|
24
|
+
yAxisId?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Radius of the point.
|
|
27
|
+
* @default 5
|
|
28
|
+
*/
|
|
29
|
+
radius?: number;
|
|
30
|
+
/**
|
|
31
|
+
* Opacity of the point.
|
|
32
|
+
*/
|
|
33
|
+
opacity?: number;
|
|
34
|
+
/**
|
|
35
|
+
* Color of the outer stroke around the point.
|
|
36
|
+
* @default 'var(--color-bg)'
|
|
37
|
+
*/
|
|
38
|
+
stroke?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Outer stroke width of the point.
|
|
41
|
+
* Set to 0 to remove the stroke.
|
|
42
|
+
* @default 2
|
|
43
|
+
*/
|
|
44
|
+
strokeWidth?: number;
|
|
45
|
+
/**
|
|
46
|
+
* When set, overrides the chart's animation setting for this specific point.
|
|
47
|
+
*/
|
|
48
|
+
animate?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Custom component to render the label.
|
|
51
|
+
* @default DefaultPointLabel
|
|
52
|
+
*/
|
|
53
|
+
LabelComponent?: PointLabelComponent;
|
|
54
|
+
/**
|
|
55
|
+
* Position of the label relative to the point.
|
|
56
|
+
* @default 'center'
|
|
57
|
+
*/
|
|
58
|
+
labelPosition?: PointLabelPosition;
|
|
59
|
+
/**
|
|
60
|
+
* Distance in pixels to offset the label from the point.
|
|
61
|
+
* @default 2 * radius
|
|
62
|
+
*/
|
|
63
|
+
labelOffset?: number;
|
|
64
|
+
/**
|
|
65
|
+
* Font style for the label text.
|
|
66
|
+
*/
|
|
67
|
+
labelFont?: ChartTextProps['font'];
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* Props for point label components.
|
|
71
|
+
*/
|
|
72
|
+
export type PointLabelProps = {
|
|
73
|
+
/**
|
|
74
|
+
* X coordinate in SVG pixel space.
|
|
75
|
+
*/
|
|
76
|
+
x: number;
|
|
77
|
+
/**
|
|
78
|
+
* Y coordinate in SVG pixel space.
|
|
79
|
+
*/
|
|
80
|
+
y: number;
|
|
81
|
+
/**
|
|
82
|
+
* X coordinate in data space (usually same as index).
|
|
83
|
+
*/
|
|
84
|
+
dataX: number;
|
|
85
|
+
/**
|
|
86
|
+
* Y coordinate in data space (same as value).
|
|
87
|
+
*/
|
|
88
|
+
dataY: number;
|
|
89
|
+
/**
|
|
90
|
+
* Fill color for the point.
|
|
91
|
+
*/
|
|
92
|
+
fill: string;
|
|
93
|
+
/**
|
|
94
|
+
* Position of the label relative to the point.
|
|
95
|
+
* @default 'center'
|
|
96
|
+
*/
|
|
97
|
+
position?: PointLabelPosition;
|
|
98
|
+
/**
|
|
99
|
+
* Distance in pixels to offset the label from the point.
|
|
100
|
+
*/
|
|
101
|
+
offset?: number;
|
|
102
|
+
/**
|
|
103
|
+
* Content to display in the label.
|
|
104
|
+
*/
|
|
105
|
+
children: ChartTextChildren;
|
|
106
|
+
};
|
|
107
|
+
export type PointLabelComponent = React.FC<PointLabelProps>;
|
|
108
|
+
export type PointProps = PointBaseProps &
|
|
109
|
+
Omit<
|
|
110
|
+
SVGProps<SVGCircleElement>,
|
|
111
|
+
| 'onClick'
|
|
112
|
+
| 'onAnimationStart'
|
|
113
|
+
| 'onAnimationEnd'
|
|
114
|
+
| 'onAnimationIteration'
|
|
115
|
+
| 'onAnimationStartCapture'
|
|
116
|
+
| 'onAnimationEndCapture'
|
|
117
|
+
| 'onAnimationIterationCapture'
|
|
118
|
+
| 'onDrag'
|
|
119
|
+
| 'onDragEnd'
|
|
120
|
+
| 'onDragStart'
|
|
121
|
+
| 'onDragCapture'
|
|
122
|
+
| 'onDragEndCapture'
|
|
123
|
+
| 'onDragStartCapture'
|
|
124
|
+
| 'cx'
|
|
125
|
+
| 'cy'
|
|
126
|
+
| 'r'
|
|
127
|
+
| 'fill'
|
|
128
|
+
| 'stroke'
|
|
129
|
+
| 'strokeWidth'
|
|
130
|
+
| 'opacity'
|
|
131
|
+
| 'className'
|
|
132
|
+
| 'style'
|
|
133
|
+
| 'aria-label'
|
|
134
|
+
| 'role'
|
|
135
|
+
| 'tabIndex'
|
|
136
|
+
| 'onKeyDown'
|
|
137
|
+
> & {
|
|
138
|
+
/**
|
|
139
|
+
* Simple text label to display at the point position.
|
|
140
|
+
* If provided, a label component will be automatically rendered.
|
|
141
|
+
*/
|
|
142
|
+
label?: ChartTextChildren;
|
|
143
|
+
/**
|
|
144
|
+
* Handler for when the point is clicked.
|
|
145
|
+
*/
|
|
146
|
+
onClick?: (
|
|
147
|
+
event: React.MouseEvent,
|
|
148
|
+
point: {
|
|
149
|
+
x: number;
|
|
150
|
+
y: number;
|
|
151
|
+
dataX: number;
|
|
152
|
+
dataY: number;
|
|
153
|
+
},
|
|
154
|
+
) => void;
|
|
155
|
+
/**
|
|
156
|
+
* Custom class name for the point.
|
|
157
|
+
*/
|
|
158
|
+
className?: string;
|
|
159
|
+
/**
|
|
160
|
+
* Custom styles for the point.
|
|
161
|
+
*/
|
|
162
|
+
style?: React.CSSProperties;
|
|
163
|
+
/**
|
|
164
|
+
* Custom class names for the component.
|
|
165
|
+
*/
|
|
166
|
+
classNames?: {
|
|
167
|
+
/**
|
|
168
|
+
* Custom class name for the point root element.
|
|
169
|
+
*/
|
|
170
|
+
root?: string;
|
|
171
|
+
/**
|
|
172
|
+
* Custom class name for the inner circle element.
|
|
173
|
+
*/
|
|
174
|
+
point?: string;
|
|
175
|
+
};
|
|
176
|
+
/**
|
|
177
|
+
* Custom styles for the component.
|
|
178
|
+
*/
|
|
179
|
+
styles?: {
|
|
180
|
+
/**
|
|
181
|
+
* Custom styles for the point root element.
|
|
182
|
+
*/
|
|
183
|
+
root?: React.CSSProperties;
|
|
184
|
+
/**
|
|
185
|
+
* Custom styles for the inner circle element.
|
|
186
|
+
*/
|
|
187
|
+
point?: React.CSSProperties;
|
|
188
|
+
};
|
|
189
|
+
/**
|
|
190
|
+
* Accessibility label for screen readers to describe the point.
|
|
191
|
+
* If not provided, a default label will be generated using the data coordinates.
|
|
192
|
+
*/
|
|
193
|
+
accessibilityLabel?: string;
|
|
194
|
+
/**
|
|
195
|
+
* Transition configuration for enter and update animations.
|
|
196
|
+
* @note Disable an animation by passing in null.
|
|
197
|
+
*/
|
|
198
|
+
transitions?: {
|
|
199
|
+
/**
|
|
200
|
+
* Transition for the initial enter/reveal animation.
|
|
201
|
+
* Set to `null` to disable.
|
|
202
|
+
*/
|
|
203
|
+
enter?: Transition | null;
|
|
204
|
+
/**
|
|
205
|
+
* Transition for subsequent data update animations.
|
|
206
|
+
* Set to `null` to disable.
|
|
207
|
+
*/
|
|
208
|
+
update?: Transition | null;
|
|
209
|
+
};
|
|
210
|
+
/**
|
|
211
|
+
* Transition for updates.
|
|
212
|
+
* @deprecated Use `transitions.update` instead.
|
|
213
|
+
*/
|
|
214
|
+
transition?: Transition;
|
|
215
|
+
};
|
|
216
|
+
export declare const Point: React.NamedExoticComponent<PointProps>;
|
|
217
|
+
//# sourceMappingURL=Point.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Point.d.ts","sourceRoot":"","sources":["../../../src/chart/point/Point.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAQ,KAAK,QAAQ,EAAW,MAAM,OAAO,CAAC;AAC5D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAG9D,OAAO,EAAe,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AAG7D,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EAIL,KAAK,kBAAkB,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AAI,CAAC;QAC1B;;;WAGG;QACH,MAAM,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC;KAC5B,CAAC;IACF;;;OAGG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB,CAAC;AAEJ,eAAO,MAAM,KAAK,wCA8NjB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/chart/point/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { type Transition } from 'framer-motion';
|
|
2
|
+
import type { ScrubberBeaconProps, ScrubberBeaconRef } from './Scrubber';
|
|
3
|
+
export type DefaultScrubberBeaconProps = ScrubberBeaconProps & {
|
|
4
|
+
/**
|
|
5
|
+
* Radius of the beacon circle.
|
|
6
|
+
* @default 5
|
|
7
|
+
*/
|
|
8
|
+
radius?: number;
|
|
9
|
+
/**
|
|
10
|
+
* Stroke width of the beacon circle.
|
|
11
|
+
* @default 2
|
|
12
|
+
*/
|
|
13
|
+
strokeWidth?: number;
|
|
14
|
+
};
|
|
15
|
+
export declare const DefaultScrubberBeacon: import('react').MemoExoticComponent<
|
|
16
|
+
import('react').ForwardRefExoticComponent<
|
|
17
|
+
import('@coinbase/cds-common').SharedProps &
|
|
18
|
+
import('./Scrubber').ScrubberBeaconBaseProps & {
|
|
19
|
+
transitions?: {
|
|
20
|
+
enter?: Transition | null;
|
|
21
|
+
update?: Transition | null;
|
|
22
|
+
pulse?: Transition;
|
|
23
|
+
pulseRepeatDelay?: number;
|
|
24
|
+
};
|
|
25
|
+
className?: string;
|
|
26
|
+
style?: React.CSSProperties;
|
|
27
|
+
} & {
|
|
28
|
+
/**
|
|
29
|
+
* Radius of the beacon circle.
|
|
30
|
+
* @default 5
|
|
31
|
+
*/
|
|
32
|
+
radius?: number;
|
|
33
|
+
/**
|
|
34
|
+
* Stroke width of the beacon circle.
|
|
35
|
+
* @default 2
|
|
36
|
+
*/
|
|
37
|
+
strokeWidth?: number;
|
|
38
|
+
} & import('react').RefAttributes<ScrubberBeaconRef>
|
|
39
|
+
>
|
|
40
|
+
>;
|
|
41
|
+
//# sourceMappingURL=DefaultScrubberBeacon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DefaultScrubberBeacon.d.ts","sourceRoot":"","sources":["../../../src/chart/scrubber/DefaultScrubberBeacon.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,UAAU,EAGhB,MAAM,eAAe,CAAC;AAKvB,OAAO,KAAK,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAkBzE,MAAM,MAAM,0BAA0B,GAAG,mBAAmB,GAAG;IAC7D;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,qBAAqB;;aA+C1B,CAAD;cAEA,CAAC;aAI8B,CAAC;wBAM/B,CAAR;;;;;IAvEE;;;OAGG;aACM,MAAM;IACf;;;OAGG;kBACW,MAAM;sDAoKrB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type ChartTextProps } from '../text';
|
|
2
|
+
import type { ScrubberBeaconLabelProps } from './Scrubber';
|
|
3
|
+
export type DefaultScrubberBeaconLabelProps = ScrubberBeaconLabelProps &
|
|
4
|
+
Pick<
|
|
5
|
+
ChartTextProps,
|
|
6
|
+
'background' | 'elevated' | 'borderRadius' | 'font' | 'verticalAlignment' | 'inset' | 'opacity'
|
|
7
|
+
>;
|
|
8
|
+
/**
|
|
9
|
+
* DefaultScrubberBeaconLabel 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).
|
|
10
|
+
*/
|
|
11
|
+
export declare const DefaultScrubberBeaconLabel: import('react').NamedExoticComponent<DefaultScrubberBeaconLabelProps>;
|
|
12
|
+
//# sourceMappingURL=DefaultScrubberBeaconLabel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DefaultScrubberBeaconLabel.d.ts","sourceRoot":"","sources":["../../../src/chart/scrubber/DefaultScrubberBeaconLabel.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAK3D,MAAM,MAAM,+BAA+B,GAAG,wBAAwB,GACpE,IAAI,CACF,cAAc,EACd,YAAY,GAAG,UAAU,GAAG,cAAc,GAAG,MAAM,GAAG,mBAAmB,GAAG,OAAO,GAAG,SAAS,CAChG,CAAC;AAEJ;;GAEG;AACH,eAAO,MAAM,0BAA0B,uEAsCtC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ScrubberLabelProps } from './Scrubber';
|
|
2
|
+
export type DefaultScrubberLabelProps = ScrubberLabelProps;
|
|
3
|
+
/**
|
|
4
|
+
* DefaultScrubberLabel is the default label component for the scrubber line.
|
|
5
|
+
* It will center the label vertically with the top available area.
|
|
6
|
+
*/
|
|
7
|
+
export declare const DefaultScrubberLabel: import('react').NamedExoticComponent<
|
|
8
|
+
import('..').ReferenceLineLabelComponentProps
|
|
9
|
+
>;
|
|
10
|
+
//# sourceMappingURL=DefaultScrubberLabel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DefaultScrubberLabel.d.ts","sourceRoot":"","sources":["../../../src/chart/scrubber/DefaultScrubberLabel.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAErD,MAAM,MAAM,yBAAyB,GAAG,kBAAkB,CAAC;AAE3D;;;GAGG;AACH,eAAO,MAAM,oBAAoB,qFAYhC,CAAC"}
|