@coinbase/cds-mobile-visualization 3.4.0-beta.2 → 3.4.0-beta.21
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 +128 -0
- package/dts/chart/CartesianChart.d.ts +92 -34
- package/dts/chart/CartesianChart.d.ts.map +1 -1
- package/dts/chart/ChartContextBridge.d.ts +28 -0
- package/dts/chart/ChartContextBridge.d.ts.map +1 -0
- package/dts/chart/ChartProvider.d.ts +3 -0
- package/dts/chart/ChartProvider.d.ts.map +1 -1
- package/dts/chart/Path.d.ts +97 -32
- package/dts/chart/Path.d.ts.map +1 -1
- package/dts/chart/PeriodSelector.d.ts +6 -13
- package/dts/chart/PeriodSelector.d.ts.map +1 -1
- package/dts/chart/area/Area.d.ts +39 -28
- package/dts/chart/area/Area.d.ts.map +1 -1
- package/dts/chart/area/AreaChart.d.ts +51 -10
- package/dts/chart/area/AreaChart.d.ts.map +1 -1
- package/dts/chart/area/DottedArea.d.ts +21 -2
- package/dts/chart/area/DottedArea.d.ts.map +1 -1
- package/dts/chart/area/GradientArea.d.ts +19 -13
- package/dts/chart/area/GradientArea.d.ts.map +1 -1
- package/dts/chart/area/SolidArea.d.ts +17 -2
- package/dts/chart/area/SolidArea.d.ts.map +1 -1
- package/dts/chart/axis/Axis.d.ts +86 -118
- 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 +49 -12
- package/dts/chart/bar/Bar.d.ts.map +1 -1
- package/dts/chart/bar/BarChart.d.ts +40 -19
- 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 +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 +25 -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 +4 -1
- package/dts/chart/index.d.ts.map +1 -1
- package/dts/chart/legend/DefaultLegendEntry.d.ts +5 -0
- package/dts/chart/legend/DefaultLegendEntry.d.ts.map +1 -0
- package/dts/chart/legend/DefaultLegendShape.d.ts +5 -0
- package/dts/chart/legend/DefaultLegendShape.d.ts.map +1 -0
- package/dts/chart/legend/Legend.d.ts +168 -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 +13 -5
- package/dts/chart/line/DottedLine.d.ts.map +1 -1
- package/dts/chart/line/Line.d.ts +61 -27
- package/dts/chart/line/Line.d.ts.map +1 -1
- package/dts/chart/line/LineChart.d.ts +43 -9
- package/dts/chart/line/LineChart.d.ts.map +1 -1
- package/dts/chart/line/ReferenceLine.d.ts +68 -20
- package/dts/chart/line/ReferenceLine.d.ts.map +1 -1
- package/dts/chart/line/SolidLine.d.ts +8 -5
- 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 +136 -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 +38 -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 +11 -0
- package/dts/chart/scrubber/DefaultScrubberLabel.d.ts.map +1 -0
- package/dts/chart/scrubber/Scrubber.d.ts +230 -42
- package/dts/chart/scrubber/Scrubber.d.ts.map +1 -1
- package/dts/chart/scrubber/ScrubberBeaconGroup.d.ts +54 -0
- package/dts/chart/scrubber/ScrubberBeaconGroup.d.ts.map +1 -0
- package/dts/chart/scrubber/ScrubberBeaconLabelGroup.d.ts +46 -0
- package/dts/chart/scrubber/ScrubberBeaconLabelGroup.d.ts.map +1 -0
- package/dts/chart/scrubber/ScrubberProvider.d.ts +6 -3
- package/dts/chart/scrubber/ScrubberProvider.d.ts.map +1 -1
- 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 +151 -77
- 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 +52 -7
- package/dts/chart/utils/chart.d.ts.map +1 -1
- package/dts/chart/utils/context.d.ts +28 -7
- package/dts/chart/utils/context.d.ts.map +1 -1
- package/dts/chart/utils/gradient.d.ts +117 -0
- package/dts/chart/utils/gradient.d.ts.map +1 -0
- package/dts/chart/utils/index.d.ts +3 -0
- package/dts/chart/utils/index.d.ts.map +1 -1
- package/dts/chart/utils/path.d.ts +59 -0
- package/dts/chart/utils/path.d.ts.map +1 -1
- package/dts/chart/utils/point.d.ts +71 -7
- package/dts/chart/utils/point.d.ts.map +1 -1
- package/dts/chart/utils/scale.d.ts +102 -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 +178 -0
- package/dts/chart/utils/transition.d.ts.map +1 -0
- package/esm/chart/CartesianChart.js +199 -75
- package/esm/chart/ChartContextBridge.js +159 -0
- package/esm/chart/ChartProvider.js +2 -2
- package/esm/chart/Path.js +200 -114
- package/esm/chart/PeriodSelector.js +7 -3
- package/esm/chart/__stories__/CartesianChart.stories.js +307 -134
- package/esm/chart/__stories__/ChartTransitions.stories.js +629 -0
- package/esm/chart/__stories__/PeriodSelector.stories.js +201 -75
- package/esm/chart/area/Area.js +27 -35
- package/esm/chart/area/AreaChart.js +17 -12
- package/esm/chart/area/DottedArea.js +64 -108
- package/esm/chart/area/GradientArea.js +37 -91
- package/esm/chart/area/SolidArea.js +24 -8
- package/esm/chart/area/__stories__/AreaChart.stories.js +1 -1
- package/esm/chart/axis/Axis.js +5 -39
- package/esm/chart/axis/DefaultAxisTickLabel.js +11 -0
- package/esm/chart/axis/XAxis.js +148 -66
- package/esm/chart/axis/YAxis.js +149 -65
- package/esm/chart/axis/__stories__/Axis.stories.js +259 -1
- package/esm/chart/axis/index.js +1 -0
- package/esm/chart/bar/Bar.js +7 -1
- package/esm/chart/bar/BarChart.js +17 -37
- package/esm/chart/bar/BarPlot.js +43 -35
- package/esm/chart/bar/BarStack.js +84 -37
- package/esm/chart/bar/BarStackGroup.js +7 -17
- package/esm/chart/bar/DefaultBar.js +29 -51
- package/esm/chart/bar/DefaultBarStack.js +34 -58
- package/esm/chart/bar/__stories__/BarChart.stories.js +948 -88
- package/esm/chart/gradient/Gradient.js +53 -0
- package/esm/chart/gradient/index.js +1 -0
- package/esm/chart/index.js +4 -1
- package/esm/chart/legend/DefaultLegendEntry.js +42 -0
- package/esm/chart/legend/DefaultLegendShape.js +64 -0
- package/esm/chart/legend/Legend.js +59 -0
- package/esm/chart/legend/__stories__/Legend.stories.js +574 -0
- package/esm/chart/legend/index.js +3 -0
- package/esm/chart/line/DefaultReferenceLineLabel.js +66 -0
- package/esm/chart/line/DottedLine.js +31 -14
- package/esm/chart/line/Line.js +96 -68
- package/esm/chart/line/LineChart.js +21 -14
- package/esm/chart/line/ReferenceLine.js +80 -63
- package/esm/chart/line/SolidLine.js +27 -10
- package/esm/chart/line/__stories__/LineChart.stories.js +1748 -2048
- package/esm/chart/line/__stories__/ReferenceLine.stories.js +177 -28
- package/esm/chart/line/index.js +1 -1
- package/esm/chart/point/DefaultPointLabel.js +39 -0
- package/esm/chart/point/Point.js +186 -0
- package/esm/chart/point/index.js +2 -0
- package/esm/chart/scrubber/DefaultScrubberBeacon.js +180 -0
- package/esm/chart/scrubber/DefaultScrubberBeaconLabel.js +43 -0
- package/esm/chart/scrubber/DefaultScrubberLabel.js +28 -0
- package/esm/chart/scrubber/Scrubber.js +130 -144
- package/esm/chart/scrubber/ScrubberBeaconGroup.js +165 -0
- package/esm/chart/scrubber/ScrubberBeaconLabelGroup.js +208 -0
- package/esm/chart/scrubber/ScrubberProvider.js +46 -54
- package/esm/chart/scrubber/__stories__/Scrubber.stories.js +760 -0
- package/esm/chart/scrubber/index.js +3 -1
- package/esm/chart/text/ChartText.js +242 -174
- package/esm/chart/text/{SmartChartTextGroup.js → ChartTextGroup.js} +6 -5
- package/esm/chart/text/index.js +1 -1
- package/esm/chart/utils/axis.js +47 -31
- package/esm/chart/utils/bar.js +43 -0
- package/esm/chart/utils/chart.js +57 -3
- package/esm/chart/utils/gradient.js +305 -0
- package/esm/chart/utils/index.js +3 -0
- package/esm/chart/utils/path.js +84 -8
- package/esm/chart/utils/point.js +171 -17
- package/esm/chart/utils/scale.js +242 -2
- package/esm/chart/utils/scrubber.js +146 -0
- package/esm/chart/utils/transition.js +215 -0
- package/esm/sparkline/__figma__/Sparkline.figma.js +1 -1
- package/esm/sparkline/__stories__/Sparkline.stories.js +11 -7
- package/esm/sparkline/__stories__/SparklineGradient.stories.js +7 -4
- package/esm/sparkline/sparkline-interactive/__figma__/SparklineInteractive.figma.js +1 -1
- package/esm/sparkline/sparkline-interactive/__stories__/SparklineInteractive.stories.js +51 -26
- package/esm/sparkline/sparkline-interactive-header/__figma__/SparklineInteractiveHeader.figma.js +1 -1
- package/esm/sparkline/sparkline-interactive-header/__stories__/SparklineInteractiveHeader.stories.js +17 -9
- package/package.json +15 -10
- package/dts/chart/Point.d.ts +0 -103
- package/dts/chart/Point.d.ts.map +0 -1
- package/dts/chart/line/GradientLine.d.ts +0 -45
- package/dts/chart/line/GradientLine.d.ts.map +0 -1
- package/dts/chart/scrubber/ScrubberBeacon.d.ts +0 -75
- package/dts/chart/scrubber/ScrubberBeacon.d.ts.map +0 -1
- package/dts/chart/text/SmartChartTextGroup.d.ts.map +0 -1
- package/esm/chart/Point.js +0 -111
- package/esm/chart/__stories__/Chart.stories.js +0 -79
- package/esm/chart/line/GradientLine.js +0 -62
- package/esm/chart/scrubber/ScrubberBeacon.js +0 -199
package/dts/chart/line/Line.d.ts
CHANGED
|
@@ -1,33 +1,26 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type
|
|
2
|
+
import { type AnimatedProp } from '@shopify/react-native-skia';
|
|
3
3
|
import { type AreaComponent } from '../area/Area';
|
|
4
|
-
import
|
|
5
|
-
import { type
|
|
6
|
-
|
|
7
|
-
|
|
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 & {
|
|
4
|
+
import type { PathProps } from '../Path';
|
|
5
|
+
import { type PointBaseProps, type PointProps } from '../point';
|
|
6
|
+
import { type ChartPathCurveType, type GradientDefinition } from '../utils';
|
|
7
|
+
export type LineBaseProps = {
|
|
15
8
|
/**
|
|
16
9
|
* The ID of the series to render. Will be used to find the data from the chart context.
|
|
17
10
|
*/
|
|
18
11
|
seriesId: string;
|
|
19
12
|
/**
|
|
20
13
|
* The curve interpolation method to use for the line.
|
|
21
|
-
* @default '
|
|
14
|
+
* @default 'bump'
|
|
22
15
|
*/
|
|
23
16
|
curve?: ChartPathCurveType;
|
|
24
17
|
/**
|
|
25
18
|
* The type of line to render.
|
|
26
19
|
* @default 'solid'
|
|
27
20
|
*/
|
|
28
|
-
type?: 'solid' | 'dotted'
|
|
21
|
+
type?: 'solid' | 'dotted';
|
|
29
22
|
/**
|
|
30
|
-
*
|
|
23
|
+
* Whether to show area fill under the line.
|
|
31
24
|
*/
|
|
32
25
|
showArea?: boolean;
|
|
33
26
|
/**
|
|
@@ -49,30 +42,71 @@ export type LineProps = SharedProps & {
|
|
|
49
42
|
* Custom component to render line area fill.
|
|
50
43
|
*/
|
|
51
44
|
AreaComponent?: AreaComponent;
|
|
45
|
+
/**
|
|
46
|
+
* Opacity of the line's stroke.
|
|
47
|
+
* Will also be applied to points and area fill.
|
|
48
|
+
* @default 1
|
|
49
|
+
*/
|
|
50
|
+
opacity?: number;
|
|
51
|
+
/**
|
|
52
|
+
* Controls whether and how to render points at each data point in the series.
|
|
53
|
+
* - `true`: Show all points with default styling
|
|
54
|
+
* - `false` or `undefined`: Hide all points
|
|
55
|
+
* - Function: Called for every entry in the data array to customize individual points
|
|
56
|
+
*
|
|
57
|
+
* @param defaults - The default point props computed by the Line component
|
|
58
|
+
* @returns true for default point, false/null/undefined for no point, or Partial<PointProps> to customize
|
|
59
|
+
*/
|
|
60
|
+
points?:
|
|
61
|
+
| boolean
|
|
62
|
+
| ((defaults: PointBaseProps) => boolean | null | undefined | Partial<PointProps>);
|
|
63
|
+
/**
|
|
64
|
+
* When true, the area is connected across null values.
|
|
65
|
+
*/
|
|
66
|
+
connectNulls?: boolean;
|
|
52
67
|
/**
|
|
53
68
|
* The color of the line.
|
|
54
69
|
* @default color of the series or theme.color.fgPrimary
|
|
55
70
|
*/
|
|
56
71
|
stroke?: string;
|
|
57
72
|
/**
|
|
58
|
-
* Opacity of the line
|
|
73
|
+
* Opacity of the line
|
|
74
|
+
* @note when combined with gradient, both will be applied
|
|
59
75
|
* @default 1
|
|
60
76
|
*/
|
|
61
|
-
|
|
77
|
+
strokeOpacity?: AnimatedProp<number>;
|
|
62
78
|
/**
|
|
63
|
-
*
|
|
64
|
-
*
|
|
79
|
+
* Width of the line
|
|
80
|
+
* @default 2
|
|
65
81
|
*/
|
|
66
|
-
|
|
82
|
+
strokeWidth?: number;
|
|
67
83
|
/**
|
|
68
|
-
*
|
|
69
|
-
*
|
|
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
|
|
84
|
+
* Gradient configuration.
|
|
85
|
+
* When provided, creates gradient or threshold-based coloring.
|
|
73
86
|
*/
|
|
74
|
-
|
|
75
|
-
|
|
87
|
+
gradient?: GradientDefinition;
|
|
88
|
+
/**
|
|
89
|
+
* Whether to animate the line.
|
|
90
|
+
* Overrides the animate value from the chart context.
|
|
91
|
+
*/
|
|
92
|
+
animate?: boolean;
|
|
76
93
|
};
|
|
94
|
+
export type LineProps = LineBaseProps & Pick<PathProps, 'transitions' | 'transition'>;
|
|
95
|
+
export type LineComponentProps = Pick<
|
|
96
|
+
LineProps,
|
|
97
|
+
'stroke' | 'strokeOpacity' | 'strokeWidth' | 'gradient' | 'animate' | 'transitions' | 'transition'
|
|
98
|
+
> &
|
|
99
|
+
Pick<PathProps, 'clipPath' | 'strokeCap'> & {
|
|
100
|
+
/**
|
|
101
|
+
* Path of the line
|
|
102
|
+
*/
|
|
103
|
+
d: AnimatedProp<string | undefined>;
|
|
104
|
+
/**
|
|
105
|
+
* ID of the y-axis to use.
|
|
106
|
+
* If not provided, defaults to the default y-axis.
|
|
107
|
+
*/
|
|
108
|
+
yAxisId?: string;
|
|
109
|
+
};
|
|
110
|
+
export type LineComponent = React.FC<LineComponentProps>;
|
|
77
111
|
export declare const Line: React.NamedExoticComponent<LineProps>;
|
|
78
112
|
//# sourceMappingURL=Line.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Line.d.ts","sourceRoot":"","sources":["../../../src/chart/line/Line.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Line.d.ts","sourceRoot":"","sources":["../../../src/chart/line/Line.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAE7C,OAAO,EAAE,KAAK,YAAY,EAAS,MAAM,4BAA4B,CAAC;AAEtE,OAAO,EAAQ,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAExD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAS,KAAK,cAAc,EAAE,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AACvE,OAAO,EACL,KAAK,kBAAkB,EAGvB,KAAK,kBAAkB,EACxB,MAAM,UAAU,CAAC;AAOlB,MAAM,MAAM,aAAa,GAAG;IAC1B;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,KAAK,CAAC,EAAE,kBAAkB,CAAC;IAC3B;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;IAC1B;;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;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;;;;;OAQG;IACH,MAAM,CAAC,EACH,OAAO,GACP,CAAC,CAAC,QAAQ,EAAE,cAAc,KAAK,OAAO,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC;IACrF;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,aAAa,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACrC;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAC9B;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,aAAa,GAAG,IAAI,CAAC,SAAS,EAAE,aAAa,GAAG,YAAY,CAAC,CAAC;AAEtF,MAAM,MAAM,kBAAkB,GAAG,IAAI,CACnC,SAAS,EACT,QAAQ,GAAG,eAAe,GAAG,aAAa,GAAG,UAAU,GAAG,SAAS,GAAG,aAAa,GAAG,YAAY,CACnG,GACC,IAAI,CAAC,SAAS,EAAE,UAAU,GAAG,WAAW,CAAC,GAAG;IAC1C;;OAEG;IACH,CAAC,EAAE,YAAY,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IACpC;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEJ,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAAC,CAAC;AAEzD,eAAO,MAAM,IAAI,uCA+LhB,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { View } from 'react-native';
|
|
2
2
|
import { type XAxisProps } from '../axis/XAxis';
|
|
3
3
|
import { type YAxisProps } from '../axis/YAxis';
|
|
4
|
-
import { type CartesianChartProps } from '../CartesianChart';
|
|
4
|
+
import { type CartesianChartBaseProps, type CartesianChartProps } from '../CartesianChart';
|
|
5
5
|
import { type AxisConfigProps, type Series } from '../utils';
|
|
6
6
|
import { type LineProps } from './Line';
|
|
7
7
|
export type LineSeries = Series &
|
|
@@ -16,12 +16,15 @@ export type LineSeries = Series &
|
|
|
16
16
|
| 'LineComponent'
|
|
17
17
|
| 'AreaComponent'
|
|
18
18
|
| 'stroke'
|
|
19
|
-
| 'opacity'
|
|
20
|
-
| 'renderPoints'
|
|
21
19
|
| 'strokeWidth'
|
|
20
|
+
| 'strokeOpacity'
|
|
21
|
+
| 'opacity'
|
|
22
|
+
| 'points'
|
|
23
|
+
| 'connectNulls'
|
|
24
|
+
| 'transition'
|
|
22
25
|
>
|
|
23
26
|
>;
|
|
24
|
-
export type
|
|
27
|
+
export type LineChartBaseProps = Omit<CartesianChartBaseProps, 'xAxis' | 'yAxis' | 'series'> &
|
|
25
28
|
Pick<
|
|
26
29
|
LineProps,
|
|
27
30
|
| 'showArea'
|
|
@@ -30,8 +33,12 @@ export type LineChartProps = Omit<CartesianChartProps, 'xAxis' | 'yAxis' | 'seri
|
|
|
30
33
|
| 'LineComponent'
|
|
31
34
|
| 'AreaComponent'
|
|
32
35
|
| 'curve'
|
|
33
|
-
| '
|
|
36
|
+
| 'points'
|
|
34
37
|
| 'strokeWidth'
|
|
38
|
+
| 'strokeOpacity'
|
|
39
|
+
| 'connectNulls'
|
|
40
|
+
| 'transition'
|
|
41
|
+
| 'opacity'
|
|
35
42
|
> & {
|
|
36
43
|
/**
|
|
37
44
|
* Configuration objects that define how to visualize the data.
|
|
@@ -46,22 +53,38 @@ export type LineChartProps = Omit<CartesianChartProps, 'xAxis' | 'yAxis' | 'seri
|
|
|
46
53
|
* Whether to show the Y axis.
|
|
47
54
|
*/
|
|
48
55
|
showYAxis?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Configuration for x-axis.
|
|
58
|
+
* Accepts axis config and axis props.
|
|
59
|
+
* To show the axis, set `showXAxis` to true.
|
|
60
|
+
*/
|
|
49
61
|
xAxis?: Partial<AxisConfigProps> & XAxisProps;
|
|
62
|
+
/**
|
|
63
|
+
* Configuration for y-axis.
|
|
64
|
+
* Accepts axis config and axis props.
|
|
65
|
+
* To show the axis, set `showYAxis` to true.
|
|
66
|
+
*/
|
|
50
67
|
yAxis?: Partial<AxisConfigProps> & YAxisProps;
|
|
51
68
|
};
|
|
69
|
+
export type LineChartProps = LineChartBaseProps &
|
|
70
|
+
Omit<CartesianChartProps, 'xAxis' | 'yAxis' | 'series'>;
|
|
52
71
|
export declare const LineChart: import('react').MemoExoticComponent<
|
|
53
72
|
import('react').ForwardRefExoticComponent<
|
|
54
|
-
Omit<
|
|
73
|
+
Omit<CartesianChartBaseProps, 'series' | 'xAxis' | 'yAxis'> &
|
|
55
74
|
Pick<
|
|
56
75
|
LineProps,
|
|
57
76
|
| 'type'
|
|
58
|
-
| '
|
|
77
|
+
| 'opacity'
|
|
59
78
|
| 'strokeWidth'
|
|
79
|
+
| 'transition'
|
|
80
|
+
| 'curve'
|
|
81
|
+
| 'connectNulls'
|
|
82
|
+
| 'strokeOpacity'
|
|
60
83
|
| 'AreaComponent'
|
|
61
84
|
| 'showArea'
|
|
62
85
|
| 'areaType'
|
|
63
86
|
| 'LineComponent'
|
|
64
|
-
| '
|
|
87
|
+
| 'points'
|
|
65
88
|
> & {
|
|
66
89
|
/**
|
|
67
90
|
* Configuration objects that define how to visualize the data.
|
|
@@ -76,9 +99,20 @@ export declare const LineChart: import('react').MemoExoticComponent<
|
|
|
76
99
|
* Whether to show the Y axis.
|
|
77
100
|
*/
|
|
78
101
|
showYAxis?: boolean;
|
|
102
|
+
/**
|
|
103
|
+
* Configuration for x-axis.
|
|
104
|
+
* Accepts axis config and axis props.
|
|
105
|
+
* To show the axis, set `showXAxis` to true.
|
|
106
|
+
*/
|
|
79
107
|
xAxis?: Partial<AxisConfigProps> & XAxisProps;
|
|
108
|
+
/**
|
|
109
|
+
* Configuration for y-axis.
|
|
110
|
+
* Accepts axis config and axis props.
|
|
111
|
+
* To show the axis, set `showYAxis` to true.
|
|
112
|
+
*/
|
|
80
113
|
yAxis?: Partial<AxisConfigProps> & YAxisProps;
|
|
81
|
-
} &
|
|
114
|
+
} & Omit<CartesianChartProps, 'series' | 'xAxis' | 'yAxis'> &
|
|
115
|
+
import('react').RefAttributes<View>
|
|
82
116
|
>
|
|
83
117
|
>;
|
|
84
118
|
//# sourceMappingURL=LineChart.d.ts.map
|
|
@@ -1 +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,
|
|
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,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,YAAY,CACf,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,YAAY,GACZ,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;IA9BlB;;;OAGG;aACM,KAAK,CAAC,UAAU,CAAC;IAC1B;;OAEG;gBACS,OAAO;IACnB;;OAEG;gBACS,OAAO;IACnB;;;;OAIG;YACK,OAAO,CAAC,eAAe,CAAC,GAAG,UAAU;IAC7C;;;;OAIG;YACK,OAAO,CAAC,eAAe,CAAC,GAAG,UAAU;mGA8HhD,CAAC"}
|
|
@@ -1,30 +1,42 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AnimatedProp } from '@shopify/react-native-skia';
|
|
2
2
|
import type {
|
|
3
3
|
ChartTextChildren,
|
|
4
4
|
ChartTextProps,
|
|
5
5
|
TextHorizontalAlignment,
|
|
6
6
|
TextVerticalAlignment,
|
|
7
7
|
} from '../text/ChartText';
|
|
8
|
+
import type { ChartInset } from '../utils';
|
|
8
9
|
import type { LineComponent } from './Line';
|
|
9
|
-
|
|
10
|
-
* Configuration for ReferenceLine label rendering using ChartText.
|
|
11
|
-
*/
|
|
12
|
-
export type ReferenceLineLabelProps = Pick<
|
|
10
|
+
export type ReferenceLineLabelComponentProps = Pick<
|
|
13
11
|
ChartTextProps,
|
|
14
|
-
| '
|
|
15
|
-
| '
|
|
16
|
-
| '
|
|
17
|
-
| 'fontWeight'
|
|
12
|
+
| 'x'
|
|
13
|
+
| 'y'
|
|
14
|
+
| 'children'
|
|
18
15
|
| 'color'
|
|
19
16
|
| 'inset'
|
|
20
17
|
| 'background'
|
|
21
18
|
| 'borderRadius'
|
|
22
19
|
| 'disableRepositioning'
|
|
23
|
-
| 'bounds'
|
|
24
20
|
| 'horizontalAlignment'
|
|
25
21
|
| 'verticalAlignment'
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
| 'font'
|
|
23
|
+
| 'fontWeight'
|
|
24
|
+
| 'fontFamilies'
|
|
25
|
+
| 'opacity'
|
|
26
|
+
| 'dx'
|
|
27
|
+
| 'dy'
|
|
28
|
+
| 'elevated'
|
|
29
|
+
| 'paragraphAlignment'
|
|
30
|
+
> & {
|
|
31
|
+
/**
|
|
32
|
+
* Bounds inset for label to prevent cutoff at chart edges.
|
|
33
|
+
* Can be a number (applied to all sides) or a ChartInset object.
|
|
34
|
+
* @default { top: 4, bottom: 20, left: 12, right: 12 } when elevated is true, otherwise undefined
|
|
35
|
+
*/
|
|
36
|
+
boundsInset?: number | ChartInset;
|
|
37
|
+
};
|
|
38
|
+
export type ReferenceLineLabelComponent = React.FC<ReferenceLineLabelComponentProps>;
|
|
39
|
+
export type ReferenceLineBaseProps = {
|
|
28
40
|
/**
|
|
29
41
|
* Label content to display near the reference line.
|
|
30
42
|
* Can be a string or ReactNode for rich formatting.
|
|
@@ -43,23 +55,59 @@ type BaseReferenceLineProps = SharedProps & {
|
|
|
43
55
|
* @default DottedLine
|
|
44
56
|
*/
|
|
45
57
|
LineComponent?: LineComponent;
|
|
58
|
+
/**
|
|
59
|
+
* Component to render the label.
|
|
60
|
+
* @default DefaultReferenceLineLabel
|
|
61
|
+
*/
|
|
62
|
+
LabelComponent?: ReferenceLineLabelComponent;
|
|
63
|
+
/**
|
|
64
|
+
* Whether to elevate the label with a shadow.
|
|
65
|
+
* When true, applies elevation and automatically adds bounds to keep label within chart area.
|
|
66
|
+
*/
|
|
67
|
+
labelElevated?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Font style for the label text.
|
|
70
|
+
*/
|
|
71
|
+
labelFont?: ChartTextProps['font'];
|
|
72
|
+
/**
|
|
73
|
+
* Horizontal offset for the label in pixels.
|
|
74
|
+
*/
|
|
75
|
+
labelDx?: number;
|
|
76
|
+
/**
|
|
77
|
+
* Vertical offset for the label in pixels.
|
|
78
|
+
*/
|
|
79
|
+
labelDy?: number;
|
|
80
|
+
/**
|
|
81
|
+
* Horizontal alignment of the label text.
|
|
82
|
+
*/
|
|
83
|
+
labelHorizontalAlignment?: TextHorizontalAlignment;
|
|
84
|
+
/**
|
|
85
|
+
* Vertical alignment of the label text.
|
|
86
|
+
*/
|
|
87
|
+
labelVerticalAlignment?: TextVerticalAlignment;
|
|
88
|
+
/**
|
|
89
|
+
* Bounds inset for the label to prevent cutoff at chart edges.
|
|
90
|
+
* Especially useful when labelElevated is true to prevent shadow clipping.
|
|
91
|
+
* Can be a number (applied to all sides) or a ChartInset object.
|
|
92
|
+
* @default { top: 4, bottom: 20, left: 12, right: 12 } when labelElevated is true, otherwise none
|
|
93
|
+
*/
|
|
94
|
+
labelBoundsInset?: number | ChartInset;
|
|
46
95
|
/**
|
|
47
96
|
* The color of the line.
|
|
48
97
|
* @default theme.color.bgLine
|
|
49
98
|
*/
|
|
50
99
|
stroke?: string;
|
|
51
100
|
/**
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
* Alignment defaults are set based on line orientation and can be overridden here.
|
|
101
|
+
* Opacity applied to both the line and label.
|
|
102
|
+
* @default 1
|
|
55
103
|
*/
|
|
56
|
-
|
|
104
|
+
opacity?: AnimatedProp<number>;
|
|
57
105
|
};
|
|
58
|
-
type HorizontalReferenceLineProps =
|
|
106
|
+
type HorizontalReferenceLineProps = ReferenceLineBaseProps & {
|
|
59
107
|
/**
|
|
60
108
|
* Y-value for horizontal reference line (data value).
|
|
61
109
|
*/
|
|
62
|
-
dataY: number
|
|
110
|
+
dataY: AnimatedProp<number>;
|
|
63
111
|
/**
|
|
64
112
|
* The ID of the y-axis to use for positioning.
|
|
65
113
|
* Defaults to defaultAxisId if not specified.
|
|
@@ -72,11 +120,11 @@ type HorizontalReferenceLineProps = BaseReferenceLineProps & {
|
|
|
72
120
|
labelPosition?: TextHorizontalAlignment;
|
|
73
121
|
dataX?: never;
|
|
74
122
|
};
|
|
75
|
-
type VerticalReferenceLineProps =
|
|
123
|
+
type VerticalReferenceLineProps = ReferenceLineBaseProps & {
|
|
76
124
|
/**
|
|
77
125
|
* X-value for vertical reference line (data index).
|
|
78
126
|
*/
|
|
79
|
-
dataX: number
|
|
127
|
+
dataX: AnimatedProp<number>;
|
|
80
128
|
/**
|
|
81
129
|
* Position of the label along the vertical line.
|
|
82
130
|
* @default 'top'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReferenceLine.d.ts","sourceRoot":"","sources":["../../../src/chart/line/ReferenceLine.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ReferenceLine.d.ts","sourceRoot":"","sources":["../../../src/chart/line/ReferenceLine.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAG/D,OAAO,KAAK,EACV,iBAAiB,EACjB,cAAc,EACd,uBAAuB,EACvB,qBAAqB,EACtB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAM3C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAE5C,MAAM,MAAM,gCAAgC,GAAG,IAAI,CACjD,cAAc,EACZ,GAAG,GACH,GAAG,GACH,UAAU,GACV,OAAO,GACP,OAAO,GACP,YAAY,GACZ,cAAc,GACd,sBAAsB,GACtB,qBAAqB,GACrB,mBAAmB,GACnB,MAAM,GACN,YAAY,GACZ,cAAc,GACd,SAAS,GACT,IAAI,GACJ,IAAI,GACJ,UAAU,GACV,oBAAoB,CACvB,GAAG;IACF;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG,KAAK,CAAC,EAAE,CAAC,gCAAgC,CAAC,CAAC;AAErF,MAAM,MAAM,sBAAsB,GAAG;IACnC;;;;;;;;;;;OAWG;IACH,KAAK,CAAC,EAAE,iBAAiB,CAAC;IAC1B;;;OAGG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B;;;OAGG;IACH,cAAc,CAAC,EAAE,2BAA2B,CAAC;IAC7C;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;OAEG;IACH,SAAS,CAAC,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;IACnC;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,wBAAwB,CAAC,EAAE,uBAAuB,CAAC;IACnD;;OAEG;IACH,sBAAsB,CAAC,EAAE,qBAAqB,CAAC;IAC/C;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;IACvC;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,OAAO,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;CAChC,CAAC;AAEF,KAAK,4BAA4B,GAAG,sBAAsB,GAAG;IAC3D;;OAEG;IACH,KAAK,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IAC5B;;;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,YAAY,CAAC,MAAM,CAAC,CAAC;IAC5B;;;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,0DAiJzB,CAAC"}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import type { SharedProps } from '@coinbase/cds-common/types';
|
|
2
1
|
import { type PathProps } from '../Path';
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import type { LineComponentProps } from './Line';
|
|
3
|
+
export type SolidLineProps = Pick<
|
|
4
|
+
PathProps,
|
|
5
|
+
'initialPath' | 'children' | 'strokeCap' | 'strokeJoin' | 'clipRect' | 'clipPath' | 'clipOffset'
|
|
6
|
+
> &
|
|
7
|
+
LineComponentProps & {
|
|
5
8
|
fill?: string;
|
|
6
|
-
strokeWidth?: number;
|
|
7
9
|
};
|
|
8
10
|
/**
|
|
9
|
-
* A customizable solid line component
|
|
11
|
+
* A customizable solid line component.
|
|
12
|
+
* Supports gradient for gradient effects and smooth data transitions via AnimatedPath.
|
|
10
13
|
*/
|
|
11
14
|
export declare const SolidLine: import('react').NamedExoticComponent<SolidLineProps>;
|
|
12
15
|
//# sourceMappingURL=SolidLine.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolidLine.d.ts","sourceRoot":"","sources":["../../../src/chart/line/SolidLine.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SolidLine.d.ts","sourceRoot":"","sources":["../../../src/chart/line/SolidLine.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC;AAE/C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAEjD,MAAM,MAAM,cAAc,GAAG,IAAI,CAC/B,SAAS,EACT,aAAa,GAAG,UAAU,GAAG,WAAW,GAAG,YAAY,GAAG,UAAU,GAAG,UAAU,GAAG,YAAY,CACjG,GACC,kBAAkB,GAAG;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEJ;;;GAGG;AACH,eAAO,MAAM,SAAS,sDAqCrB,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,136 @@
|
|
|
1
|
+
import { type ComponentType } from 'react';
|
|
2
|
+
import type { ChartTextChildren, ChartTextProps } from '../text/ChartText';
|
|
3
|
+
import { type PointLabelPosition } from '../utils';
|
|
4
|
+
import { type Transition } from '../utils/transition';
|
|
5
|
+
export type PointBaseProps = {
|
|
6
|
+
/**
|
|
7
|
+
* X coordinate in data space (not pixel coordinates).
|
|
8
|
+
*/
|
|
9
|
+
dataX: number;
|
|
10
|
+
/**
|
|
11
|
+
* Y coordinate in data space (not pixel coordinates).
|
|
12
|
+
*/
|
|
13
|
+
dataY: number;
|
|
14
|
+
/**
|
|
15
|
+
* The fill color of the point.
|
|
16
|
+
* @default theme.color.fgPrimary
|
|
17
|
+
*/
|
|
18
|
+
fill?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Optional Y-axis id to specify which axis to plot along.
|
|
21
|
+
* @default first y-axis defined in chart props.
|
|
22
|
+
*/
|
|
23
|
+
yAxisId?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Radius of the point.
|
|
26
|
+
* @default 5
|
|
27
|
+
*/
|
|
28
|
+
radius?: number;
|
|
29
|
+
/**
|
|
30
|
+
* Opacity of the point.
|
|
31
|
+
*/
|
|
32
|
+
opacity?: number;
|
|
33
|
+
/**
|
|
34
|
+
* Color of the outer stroke around the point.
|
|
35
|
+
* @default theme.color.bg
|
|
36
|
+
*/
|
|
37
|
+
stroke?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Outer stroke width of the point.
|
|
40
|
+
* Set to 0 to remove the stroke.
|
|
41
|
+
* @default 2
|
|
42
|
+
*/
|
|
43
|
+
strokeWidth?: number;
|
|
44
|
+
/**
|
|
45
|
+
* When set, overrides the chart's animation setting for this specific point.
|
|
46
|
+
*/
|
|
47
|
+
animate?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Custom component to render the label.
|
|
50
|
+
* @default DefaultPointLabel
|
|
51
|
+
*/
|
|
52
|
+
LabelComponent?: PointLabelComponent;
|
|
53
|
+
/**
|
|
54
|
+
* Position of the label relative to the point.
|
|
55
|
+
* @default 'center'
|
|
56
|
+
*/
|
|
57
|
+
labelPosition?: PointLabelPosition;
|
|
58
|
+
/**
|
|
59
|
+
* Distance in pixels to offset the label from the point.
|
|
60
|
+
* @default 2 * radius
|
|
61
|
+
*/
|
|
62
|
+
labelOffset?: number;
|
|
63
|
+
/**
|
|
64
|
+
* Font style for the label text.
|
|
65
|
+
*/
|
|
66
|
+
labelFont?: ChartTextProps['font'];
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Props for point label components.
|
|
70
|
+
*/
|
|
71
|
+
export type PointLabelProps = {
|
|
72
|
+
/**
|
|
73
|
+
* X coordinate in SVG pixel space.
|
|
74
|
+
*/
|
|
75
|
+
x: number;
|
|
76
|
+
/**
|
|
77
|
+
* Y coordinate in SVG pixel space.
|
|
78
|
+
*/
|
|
79
|
+
y: number;
|
|
80
|
+
/**
|
|
81
|
+
* X coordinate in data space (usually same as index).
|
|
82
|
+
*/
|
|
83
|
+
dataX: number;
|
|
84
|
+
/**
|
|
85
|
+
* Y coordinate in data space (same as value).
|
|
86
|
+
*/
|
|
87
|
+
dataY: number;
|
|
88
|
+
/**
|
|
89
|
+
* Fill color for the point.
|
|
90
|
+
*/
|
|
91
|
+
fill: string;
|
|
92
|
+
/**
|
|
93
|
+
* Position of the label relative to the point.
|
|
94
|
+
* @default 'center'
|
|
95
|
+
*/
|
|
96
|
+
position?: PointLabelPosition;
|
|
97
|
+
/**
|
|
98
|
+
* Distance in pixels to offset the label from the point.
|
|
99
|
+
*/
|
|
100
|
+
offset?: number;
|
|
101
|
+
/**
|
|
102
|
+
* Content to display in the label.
|
|
103
|
+
*/
|
|
104
|
+
children: ChartTextChildren;
|
|
105
|
+
};
|
|
106
|
+
export type PointLabelComponent = ComponentType<PointLabelProps>;
|
|
107
|
+
export type PointProps = PointBaseProps & {
|
|
108
|
+
/**
|
|
109
|
+
* Simple text label to display at the point position.
|
|
110
|
+
* If provided, a label component will be automatically rendered.
|
|
111
|
+
*/
|
|
112
|
+
label?: ChartTextChildren;
|
|
113
|
+
/**
|
|
114
|
+
* Transition configuration for enter and update animations.
|
|
115
|
+
* @note Disable an animation by passing in null.
|
|
116
|
+
*/
|
|
117
|
+
transitions?: {
|
|
118
|
+
/**
|
|
119
|
+
* Transition for the initial enter/reveal animation.
|
|
120
|
+
* Set to `null` to disable.
|
|
121
|
+
*/
|
|
122
|
+
enter?: Transition | null;
|
|
123
|
+
/**
|
|
124
|
+
* Transition for subsequent data update animations.
|
|
125
|
+
* Set to `null` to disable.
|
|
126
|
+
*/
|
|
127
|
+
update?: Transition | null;
|
|
128
|
+
};
|
|
129
|
+
/**
|
|
130
|
+
* Transition for updates.
|
|
131
|
+
* @deprecated Use `transitions.update` instead.
|
|
132
|
+
*/
|
|
133
|
+
transition?: Transition;
|
|
134
|
+
};
|
|
135
|
+
export declare const Point: import('react').NamedExoticComponent<PointProps>;
|
|
136
|
+
//# 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,EAAE,KAAK,aAAa,EAA4B,MAAM,OAAO,CAAC;AAOrE,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EAAE,KAAK,kBAAkB,EAAgB,MAAM,UAAU,CAAC;AACjE,OAAO,EAKL,KAAK,UAAU,EAChB,MAAM,qBAAqB,CAAC;AAI7B,MAAM,MAAM,cAAc,GAAG;IAC3B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,cAAc,CAAC,EAAE,mBAAmB,CAAC;IACrC;;;OAGG;IACH,aAAa,CAAC,EAAE,kBAAkB,CAAC;IACnC;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,SAAS,CAAC,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;CACpC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B;;OAEG;IACH,CAAC,EAAE,MAAM,CAAC;IACV;;OAEG;IACH,CAAC,EAAE,MAAM,CAAC;IACV;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAC9B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,QAAQ,EAAE,iBAAiB,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,aAAa,CAAC,eAAe,CAAC,CAAC;AAEjE,MAAM,MAAM,UAAU,GAAG,cAAc,GAAG;IACxC;;;OAGG;IACH,KAAK,CAAC,EAAE,iBAAiB,CAAC;IAC1B;;;OAGG;IACH,WAAW,CAAC,EAAE;QACZ;;;WAGG;QACH,KAAK,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC;QAC1B;;;WAGG;QACH,MAAM,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC;KAC5B,CAAC;IACF;;;OAGG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB,CAAC;AAEF,eAAO,MAAM,KAAK,kDA2NjB,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,38 @@
|
|
|
1
|
+
import { type Transition } from '../utils/transition';
|
|
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('./Scrubber').ScrubberBeaconBaseProps & {
|
|
18
|
+
transitions?: {
|
|
19
|
+
enter?: Transition | null;
|
|
20
|
+
update?: Transition | null;
|
|
21
|
+
pulse?: Transition;
|
|
22
|
+
pulseRepeatDelay?: number;
|
|
23
|
+
};
|
|
24
|
+
} & {
|
|
25
|
+
/**
|
|
26
|
+
* Radius of the beacon circle.
|
|
27
|
+
* @default 5
|
|
28
|
+
*/
|
|
29
|
+
radius?: number;
|
|
30
|
+
/**
|
|
31
|
+
* Stroke width of the beacon circle.
|
|
32
|
+
* @default 2
|
|
33
|
+
*/
|
|
34
|
+
strokeWidth?: number;
|
|
35
|
+
} & import('react').RefAttributes<ScrubberBeaconRef>
|
|
36
|
+
>
|
|
37
|
+
>;
|
|
38
|
+
//# sourceMappingURL=DefaultScrubberBeacon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DefaultScrubberBeacon.d.ts","sourceRoot":"","sources":["../../../src/chart/scrubber/DefaultScrubberBeacon.tsx"],"names":[],"mappings":"AAkBA,OAAO,EAKL,KAAK,UAAU,EAChB,MAAM,qBAAqB,CAAC;AAE7B,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;;aAyCN,CAAC;cAId,CAAC;aAMe,CAAC;wBAGuD,CAAC;;;IAlEtF;;;OAGG;aACM,MAAM;IACf;;;OAGG;kBACW,MAAM;sDAiMrB,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.
|
|
10
|
+
*/
|
|
11
|
+
export declare const DefaultScrubberBeaconLabel: import('react').NamedExoticComponent<DefaultScrubberBeaconLabelProps>;
|
|
12
|
+
//# sourceMappingURL=DefaultScrubberBeaconLabel.d.ts.map
|