@coinbase/cds-mobile-visualization 3.3.0 → 3.4.0-beta.10
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 +80 -0
- package/dts/chart/CartesianChart.d.ts +125 -0
- package/dts/chart/CartesianChart.d.ts.map +1 -0
- package/dts/chart/ChartContextBridge.d.ts +28 -0
- package/dts/chart/ChartContextBridge.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 +91 -0
- package/dts/chart/Path.d.ts.map +1 -0
- package/dts/chart/PeriodSelector.d.ts +85 -0
- package/dts/chart/PeriodSelector.d.ts.map +1 -0
- package/dts/chart/area/Area.d.ts +77 -0
- package/dts/chart/area/Area.d.ts.map +1 -0
- package/dts/chart/area/AreaChart.d.ts +131 -0
- package/dts/chart/area/AreaChart.d.ts.map +1 -0
- package/dts/chart/area/DottedArea.d.ts +46 -0
- package/dts/chart/area/DottedArea.d.ts.map +1 -0
- package/dts/chart/area/GradientArea.d.ts +36 -0
- package/dts/chart/area/GradientArea.d.ts.map +1 -0
- package/dts/chart/area/SolidArea.d.ts +23 -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 +194 -0
- package/dts/chart/axis/Axis.d.ts.map +1 -0
- 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 +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 +5 -0
- package/dts/chart/axis/index.d.ts.map +1 -0
- package/dts/chart/bar/Bar.d.ts +92 -0
- package/dts/chart/bar/Bar.d.ts.map +1 -0
- package/dts/chart/bar/BarChart.d.ts +113 -0
- package/dts/chart/bar/BarChart.d.ts.map +1 -0
- package/dts/chart/bar/BarPlot.d.ts +30 -0
- package/dts/chart/bar/BarPlot.d.ts.map +1 -0
- package/dts/chart/bar/BarStack.d.ts +102 -0
- package/dts/chart/bar/BarStack.d.ts.map +1 -0
- package/dts/chart/bar/BarStackGroup.d.ts +36 -0
- package/dts/chart/bar/BarStackGroup.d.ts.map +1 -0
- package/dts/chart/bar/DefaultBar.d.ts +7 -0
- package/dts/chart/bar/DefaultBar.d.ts.map +1 -0
- package/dts/chart/bar/DefaultBarStack.d.ts +7 -0
- package/dts/chart/bar/DefaultBarStack.d.ts.map +1 -0
- package/dts/chart/bar/index.d.ts +8 -0
- package/dts/chart/bar/index.d.ts.map +1 -0
- package/dts/chart/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 +15 -0
- package/dts/chart/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 +20 -0
- package/dts/chart/line/DottedLine.d.ts.map +1 -0
- package/dts/chart/line/Line.d.ts +115 -0
- package/dts/chart/line/Line.d.ts.map +1 -0
- package/dts/chart/line/LineChart.d.ts +118 -0
- package/dts/chart/line/LineChart.d.ts.map +1 -0
- package/dts/chart/line/ReferenceLine.d.ts +139 -0
- package/dts/chart/line/ReferenceLine.d.ts.map +1 -0
- package/dts/chart/line/SolidLine.d.ts +15 -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/point/DefaultPointLabel.d.ts +10 -0
- package/dts/chart/point/DefaultPointLabel.d.ts.map +1 -0
- package/dts/chart/point/Point.d.ts +120 -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 +8 -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 +233 -0
- package/dts/chart/scrubber/Scrubber.d.ts.map +1 -0
- package/dts/chart/scrubber/ScrubberBeaconGroup.d.ts +44 -0
- package/dts/chart/scrubber/ScrubberBeaconGroup.d.ts.map +1 -0
- package/dts/chart/scrubber/ScrubberBeaconLabelGroup.d.ts +31 -0
- package/dts/chart/scrubber/ScrubberBeaconLabelGroup.d.ts.map +1 -0
- package/dts/chart/scrubber/ScrubberProvider.d.ts +20 -0
- package/dts/chart/scrubber/ScrubberProvider.d.ts.map +1 -0
- package/dts/chart/scrubber/index.d.ts +5 -0
- package/dts/chart/scrubber/index.d.ts.map +1 -0
- package/dts/chart/text/ChartText.d.ts +164 -0
- package/dts/chart/text/ChartText.d.ts.map +1 -0
- package/dts/chart/text/ChartTextGroup.d.ts +61 -0
- package/dts/chart/text/ChartTextGroup.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 +124 -0
- package/dts/chart/utils/chart.d.ts.map +1 -0
- package/dts/chart/utils/context.d.ts +116 -0
- package/dts/chart/utils/context.d.ts.map +1 -0
- 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 +11 -0
- package/dts/chart/utils/index.d.ts.map +1 -0
- package/dts/chart/utils/path.d.ts +160 -0
- package/dts/chart/utils/path.d.ts.map +1 -0
- package/dts/chart/utils/point.d.ts +134 -0
- package/dts/chart/utils/point.d.ts.map +1 -0
- package/dts/chart/utils/scale.d.ts +134 -0
- package/dts/chart/utils/scale.d.ts.map +1 -0
- package/dts/chart/utils/scrubber.d.ts +39 -0
- package/dts/chart/utils/scrubber.d.ts.map +1 -0
- package/dts/chart/utils/transition.d.ts +140 -0
- package/dts/chart/utils/transition.d.ts.map +1 -0
- package/dts/index.d.ts +2 -1
- package/dts/index.d.ts.map +1 -1
- package/dts/sparkline/Counter.d.ts +7 -2
- package/dts/sparkline/Sparkline.d.ts +67 -16
- package/dts/sparkline/Sparkline.d.ts.map +1 -1
- package/dts/sparkline/SparklineArea.d.ts +10 -4
- package/dts/sparkline/SparklineArea.d.ts.map +1 -1
- package/dts/sparkline/SparklineAreaPattern.d.ts +12 -4
- package/dts/sparkline/SparklineAreaPattern.d.ts.map +1 -1
- package/dts/sparkline/SparklineGradient.d.ts +21 -10
- package/dts/sparkline/SparklineGradient.d.ts.map +1 -1
- package/dts/sparkline/__figma__/Sparkline.figma.d.ts +1 -1
- package/dts/sparkline/generateSparklineWithId.d.ts +8 -2
- package/dts/sparkline/generateSparklineWithId.d.ts.map +1 -1
- package/dts/sparkline/index.d.ts +1 -1
- package/dts/sparkline/sparkline-interactive/SparklineAccessibleView.d.ts +8 -3
- package/dts/sparkline/sparkline-interactive/SparklineInteractive.d.ts +132 -110
- package/dts/sparkline/sparkline-interactive/SparklineInteractive.d.ts.map +1 -1
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveAnimatedPath.d.ts +22 -9
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveAnimatedPath.d.ts.map +1 -1
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveHoverDate.d.ts +18 -7
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveLineVertical.d.ts +9 -4
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveMarkerDates.d.ts +11 -6
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveMinMax.d.ts +7 -5
- package/dts/sparkline/sparkline-interactive/SparklineInteractivePanGestureHandler.d.ts +22 -10
- package/dts/sparkline/sparkline-interactive/SparklineInteractivePaths.d.ts +21 -7
- package/dts/sparkline/sparkline-interactive/SparklineInteractivePaths.d.ts.map +1 -1
- package/dts/sparkline/sparkline-interactive/SparklineInteractivePeriodSelector.d.ts +21 -16
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveProvider.d.ts +29 -23
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveTimeseriesPaths.d.ts +22 -14
- package/dts/sparkline/sparkline-interactive/__figma__/SparklineInteractive.figma.d.ts +1 -1
- package/dts/sparkline/sparkline-interactive/useInterruptiblePathAnimation.d.ts +9 -5
- package/dts/sparkline/sparkline-interactive/useMinMaxTransform.d.ts +11 -6
- package/dts/sparkline/sparkline-interactive/useOpacityAnimation.d.ts +5 -2
- package/dts/sparkline/sparkline-interactive/useSparklineInteractiveConstants.d.ts +17 -17
- package/dts/sparkline/sparkline-interactive/useSparklineInteractiveLineStyles.d.ts +16 -13
- package/dts/sparkline/sparkline-interactive-header/SparklineInteractiveHeader.d.ts +106 -98
- package/dts/sparkline/sparkline-interactive-header/__figma__/SparklineInteractiveHeader.figma.d.ts +1 -1
- package/dts/sparkline/sparkline-interactive-header/useSparklineInteractiveHeaderStyles.d.ts +22 -19
- package/esm/chart/CartesianChart.js +335 -0
- package/esm/chart/ChartContextBridge.js +148 -0
- package/esm/chart/ChartProvider.js +10 -0
- package/esm/chart/Path.js +218 -0
- package/esm/chart/PeriodSelector.js +136 -0
- package/esm/chart/__stories__/CartesianChart.stories.js +723 -0
- package/esm/chart/__stories__/Chart.stories.js +77 -0
- package/esm/chart/__stories__/PeriodSelector.stories.js +322 -0
- package/esm/chart/area/Area.js +75 -0
- package/esm/chart/area/AreaChart.js +151 -0
- package/esm/chart/area/DottedArea.js +80 -0
- package/esm/chart/area/GradientArea.js +54 -0
- package/esm/chart/area/SolidArea.js +38 -0
- package/esm/chart/area/__stories__/AreaChart.stories.js +100 -0
- package/esm/chart/area/index.js +7 -0
- package/esm/chart/axis/Axis.js +45 -0
- package/esm/chart/axis/DefaultAxisTickLabel.js +11 -0
- package/esm/chart/axis/XAxis.js +188 -0
- package/esm/chart/axis/YAxis.js +177 -0
- package/esm/chart/axis/__stories__/Axis.stories.js +276 -0
- package/esm/chart/axis/index.js +6 -0
- package/esm/chart/bar/Bar.js +69 -0
- package/esm/chart/bar/BarChart.js +125 -0
- package/esm/chart/bar/BarPlot.js +102 -0
- package/esm/chart/bar/BarStack.js +551 -0
- package/esm/chart/bar/BarStackGroup.js +79 -0
- package/esm/chart/bar/DefaultBar.js +56 -0
- package/esm/chart/bar/DefaultBarStack.js +47 -0
- package/esm/chart/bar/__stories__/BarChart.stories.js +668 -0
- package/esm/chart/bar/index.js +9 -0
- package/esm/chart/gradient/Gradient.js +53 -0
- package/esm/chart/gradient/index.js +1 -0
- package/esm/chart/index.js +16 -0
- package/esm/chart/line/DefaultReferenceLineLabel.js +66 -0
- package/esm/chart/line/DottedLine.js +50 -0
- package/esm/chart/line/Line.js +178 -0
- package/esm/chart/line/LineChart.js +121 -0
- package/esm/chart/line/ReferenceLine.js +132 -0
- package/esm/chart/line/SolidLine.js +46 -0
- package/esm/chart/line/__stories__/LineChart.stories.js +2372 -0
- package/esm/chart/line/__stories__/ReferenceLine.stories.js +132 -0
- package/esm/chart/line/index.js +8 -0
- package/esm/chart/point/DefaultPointLabel.js +39 -0
- package/esm/chart/point/Point.js +188 -0
- package/esm/chart/point/index.js +2 -0
- package/esm/chart/scrubber/DefaultScrubberBeacon.js +179 -0
- package/esm/chart/scrubber/DefaultScrubberBeaconLabel.js +43 -0
- package/esm/chart/scrubber/DefaultScrubberLabel.js +28 -0
- package/esm/chart/scrubber/Scrubber.js +166 -0
- package/esm/chart/scrubber/ScrubberBeaconGroup.js +161 -0
- package/esm/chart/scrubber/ScrubberBeaconLabelGroup.js +185 -0
- package/esm/chart/scrubber/ScrubberProvider.js +135 -0
- package/esm/chart/scrubber/index.js +4 -0
- package/esm/chart/text/ChartText.js +305 -0
- package/esm/chart/text/ChartTextGroup.js +211 -0
- package/esm/chart/text/index.js +4 -0
- package/esm/chart/utils/axis.js +592 -0
- package/esm/chart/utils/bar.js +24 -0
- package/esm/chart/utils/chart.js +270 -0
- package/esm/chart/utils/context.js +15 -0
- package/esm/chart/utils/gradient.js +305 -0
- package/esm/chart/utils/index.js +12 -0
- package/esm/chart/utils/path.js +274 -0
- package/esm/chart/utils/point.js +229 -0
- package/esm/chart/utils/scale.js +277 -0
- package/esm/chart/utils/scrubber.js +139 -0
- package/esm/chart/utils/transition.js +185 -0
- package/esm/index.js +4 -1
- package/esm/sparkline/Sparkline.js +129 -16
- package/esm/sparkline/SparklineArea.js +7 -2
- package/esm/sparkline/SparklineAreaPattern.js +4 -2
- package/esm/sparkline/SparklineGradient.js +4 -0
- package/esm/sparkline/__stories__/Sparkline.stories.js +11 -7
- package/esm/sparkline/__stories__/SparklineGradient.stories.js +7 -4
- package/esm/sparkline/generateSparklineWithId.js +3 -2
- package/esm/sparkline/sparkline-interactive/SparklineInteractive.js +5 -1
- package/esm/sparkline/sparkline-interactive/SparklineInteractiveAnimatedPath.js +5 -2
- package/esm/sparkline/sparkline-interactive/SparklineInteractivePaths.js +4 -0
- package/esm/sparkline/sparkline-interactive/__stories__/SparklineInteractive.stories.js +76 -24
- package/esm/sparkline/sparkline-interactive-header/__stories__/SparklineInteractiveHeader.stories.js +17 -9
- package/package.json +17 -11
- package/dts/sparkline/__stories__/Sparkline.stories.d.ts +0 -3
- package/dts/sparkline/__stories__/Sparkline.stories.d.ts.map +0 -1
- package/dts/sparkline/__stories__/SparklineGradient.stories.d.ts +0 -3
- package/dts/sparkline/__stories__/SparklineGradient.stories.d.ts.map +0 -1
- package/dts/sparkline/sparkline-interactive/__stories__/SparklineInteractive.stories.d.ts +0 -3
- package/dts/sparkline/sparkline-interactive/__stories__/SparklineInteractive.stories.d.ts.map +0 -1
- package/dts/sparkline/sparkline-interactive/__tests__/SparklineInteractive.test.d.ts +0 -2
- package/dts/sparkline/sparkline-interactive/__tests__/SparklineInteractive.test.d.ts.map +0 -1
- package/dts/sparkline/sparkline-interactive/__tests__/SparklineInteractiveHoverDate.test.d.ts +0 -2
- package/dts/sparkline/sparkline-interactive/__tests__/SparklineInteractiveHoverDate.test.d.ts.map +0 -1
- package/dts/sparkline/sparkline-interactive/__tests__/SparklineInteractivePanGestureHandler.test.d.ts +0 -2
- package/dts/sparkline/sparkline-interactive/__tests__/SparklineInteractivePanGestureHandler.test.d.ts.map +0 -1
- package/dts/sparkline/sparkline-interactive/__tests__/SparklineInteractivePeriodSelector.test.d.ts +0 -2
- package/dts/sparkline/sparkline-interactive/__tests__/SparklineInteractivePeriodSelector.test.d.ts.map +0 -1
- package/dts/sparkline/sparkline-interactive/__tests__/SparklineInteractiveTimeseriesPaths.test.d.ts +0 -2
- package/dts/sparkline/sparkline-interactive/__tests__/SparklineInteractiveTimeseriesPaths.test.d.ts.map +0 -1
- package/dts/sparkline/sparkline-interactive/__tests__/useMinMaxTransform.test.d.ts +0 -2
- package/dts/sparkline/sparkline-interactive/__tests__/useMinMaxTransform.test.d.ts.map +0 -1
- package/dts/sparkline/sparkline-interactive/useInterruptiblePathAnimation.test.disable.d.ts +0 -2
- package/dts/sparkline/sparkline-interactive/useInterruptiblePathAnimation.test.disable.d.ts.map +0 -1
- package/dts/sparkline/sparkline-interactive-header/__stories__/SparklineInteractiveHeader.stories.d.ts +0 -4
- package/dts/sparkline/sparkline-interactive-header/__stories__/SparklineInteractiveHeader.stories.d.ts.map +0 -1
- package/dts/sparkline/sparkline-interactive-header/__tests__/SparklineInteractiveHeader.test.d.ts +0 -2
- package/dts/sparkline/sparkline-interactive-header/__tests__/SparklineInteractiveHeader.test.d.ts.map +0 -1
- package/dts/sparkline/sparkline-interactive-header/__tests__/useSparklineInteractiveHeaderStyles.test.d.ts +0 -2
- package/dts/sparkline/sparkline-interactive-header/__tests__/useSparklineInteractiveHeaderStyles.test.d.ts.map +0 -1
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Rect } from '@coinbase/cds-common';
|
|
3
|
+
import type { ChartScaleFunction, Series, Transition } from '../utils';
|
|
4
|
+
import { type BarProps } from './Bar';
|
|
5
|
+
export type BarStackBaseProps = Pick<
|
|
6
|
+
BarProps,
|
|
7
|
+
'BarComponent' | 'fillOpacity' | 'stroke' | 'strokeWidth' | 'borderRadius'
|
|
8
|
+
> & {
|
|
9
|
+
/**
|
|
10
|
+
* Array of series configurations that belong to this stack.
|
|
11
|
+
*/
|
|
12
|
+
series: Series[];
|
|
13
|
+
/**
|
|
14
|
+
* The category index for this stack.
|
|
15
|
+
*/
|
|
16
|
+
categoryIndex: number;
|
|
17
|
+
/**
|
|
18
|
+
* X position for this stack.
|
|
19
|
+
*/
|
|
20
|
+
x: number;
|
|
21
|
+
/**
|
|
22
|
+
* Width of this stack.
|
|
23
|
+
*/
|
|
24
|
+
width: number;
|
|
25
|
+
/**
|
|
26
|
+
* Y scale function.
|
|
27
|
+
*/
|
|
28
|
+
yScale: ChartScaleFunction;
|
|
29
|
+
/**
|
|
30
|
+
* Chart rect for bounds.
|
|
31
|
+
*/
|
|
32
|
+
rect: Rect;
|
|
33
|
+
/**
|
|
34
|
+
* Y axis ID to use.
|
|
35
|
+
* If not provided, will use the yAxisId from the first series.
|
|
36
|
+
*/
|
|
37
|
+
yAxisId?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Custom component to render the stack container.
|
|
40
|
+
* Can be used to add clip paths, outlines, or other custom styling.
|
|
41
|
+
* @default DefaultBarStack
|
|
42
|
+
*/
|
|
43
|
+
BarStackComponent?: BarStackComponent;
|
|
44
|
+
/**
|
|
45
|
+
* Whether to round the baseline of a bar (where the value is 0).
|
|
46
|
+
*/
|
|
47
|
+
roundBaseline?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Gap between bars in the stack.
|
|
50
|
+
*/
|
|
51
|
+
stackGap?: number;
|
|
52
|
+
/**
|
|
53
|
+
* Minimum size for individual bars in the stack.
|
|
54
|
+
*/
|
|
55
|
+
barMinSize?: number;
|
|
56
|
+
/**
|
|
57
|
+
* Minimum size for the entire stack.
|
|
58
|
+
*/
|
|
59
|
+
stackMinSize?: number;
|
|
60
|
+
};
|
|
61
|
+
export type BarStackProps = BarStackBaseProps & {
|
|
62
|
+
/**
|
|
63
|
+
* Transition configurations for different animation phases.
|
|
64
|
+
*/
|
|
65
|
+
transition?: Transition;
|
|
66
|
+
};
|
|
67
|
+
export type BarStackComponentProps = Pick<
|
|
68
|
+
BarStackProps,
|
|
69
|
+
'x' | 'width' | 'categoryIndex' | 'borderRadius' | 'transition'
|
|
70
|
+
> & {
|
|
71
|
+
/**
|
|
72
|
+
* The y position of the stack.
|
|
73
|
+
*/
|
|
74
|
+
y: number;
|
|
75
|
+
/**
|
|
76
|
+
* The height of the stack.
|
|
77
|
+
*/
|
|
78
|
+
height: number;
|
|
79
|
+
/**
|
|
80
|
+
* The bar elements to render within the stack.
|
|
81
|
+
*/
|
|
82
|
+
children: React.ReactNode;
|
|
83
|
+
/**
|
|
84
|
+
* Whether to round the top corners.
|
|
85
|
+
*/
|
|
86
|
+
roundTop?: boolean;
|
|
87
|
+
/**
|
|
88
|
+
* Whether to round the bottom corners.
|
|
89
|
+
*/
|
|
90
|
+
roundBottom?: boolean;
|
|
91
|
+
/**
|
|
92
|
+
* The y-origin for animations (baseline position).
|
|
93
|
+
*/
|
|
94
|
+
yOrigin?: number;
|
|
95
|
+
};
|
|
96
|
+
export type BarStackComponent = React.FC<BarStackComponentProps>;
|
|
97
|
+
/**
|
|
98
|
+
* BarStack component that renders a single stack of bars at a specific category index.
|
|
99
|
+
* Handles the stacking logic for bars within a single category.
|
|
100
|
+
*/
|
|
101
|
+
export declare const BarStack: React.NamedExoticComponent<BarStackProps>;
|
|
102
|
+
//# sourceMappingURL=BarStack.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BarStack.d.ts","sourceRoot":"","sources":["../../../src/chart/bar/BarStack.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAC7C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAIjD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAIvE,OAAO,EAAO,KAAK,QAAQ,EAAE,MAAM,OAAO,CAAC;AAK3C,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAClC,QAAQ,EACR,cAAc,GAAG,aAAa,GAAG,QAAQ,GAAG,aAAa,GAAG,cAAc,CAC3E,GAAG;IACF;;OAEG;IACH,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,CAAC,EAAE,MAAM,CAAC;IACV;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,MAAM,EAAE,kBAAkB,CAAC;IAC3B;;OAEG;IACH,IAAI,EAAE,IAAI,CAAC;IACX;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,iBAAiB,GAAG;IAC9C;;OAEG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,IAAI,CACvC,aAAa,EACb,GAAG,GAAG,OAAO,GAAG,eAAe,GAAG,cAAc,GAAG,YAAY,CAChE,GAAG;IACF;;OAEG;IACH,CAAC,EAAE,MAAM,CAAC;IACV;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAAC,CAAC;AAEjE;;;GAGG;AACH,eAAO,MAAM,QAAQ,2CAmlBpB,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type BarStackProps } from './BarStack';
|
|
2
|
+
export type BarStackGroupProps = Pick<
|
|
3
|
+
BarStackProps,
|
|
4
|
+
| 'BarComponent'
|
|
5
|
+
| 'fillOpacity'
|
|
6
|
+
| 'stroke'
|
|
7
|
+
| 'strokeWidth'
|
|
8
|
+
| 'borderRadius'
|
|
9
|
+
| 'roundBaseline'
|
|
10
|
+
| 'stackGap'
|
|
11
|
+
| 'barMinSize'
|
|
12
|
+
| 'stackMinSize'
|
|
13
|
+
| 'BarStackComponent'
|
|
14
|
+
| 'transition'
|
|
15
|
+
> &
|
|
16
|
+
Pick<BarStackProps, 'series' | 'yAxisId'> & {
|
|
17
|
+
/**
|
|
18
|
+
* Index of this stack within the category (0-based).
|
|
19
|
+
*/
|
|
20
|
+
stackIndex: number;
|
|
21
|
+
/**
|
|
22
|
+
* Total number of stacks per category.
|
|
23
|
+
*/
|
|
24
|
+
totalStacks: number;
|
|
25
|
+
/**
|
|
26
|
+
* Padding between bar groups (0-1).
|
|
27
|
+
* @default 0.1
|
|
28
|
+
*/
|
|
29
|
+
barPadding?: number;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* BarStackGroup component that renders a group of stacks across all categories.
|
|
33
|
+
* Delegates the actual stacking logic to BarStack for each category.
|
|
34
|
+
*/
|
|
35
|
+
export declare const BarStackGroup: import('react').NamedExoticComponent<BarStackGroupProps>;
|
|
36
|
+
//# sourceMappingURL=BarStackGroup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BarStackGroup.d.ts","sourceRoot":"","sources":["../../../src/chart/bar/BarStackGroup.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAY,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AAE1D,MAAM,MAAM,kBAAkB,GAAG,IAAI,CACnC,aAAa,EACX,cAAc,GACd,aAAa,GACb,QAAQ,GACR,aAAa,GACb,cAAc,GACd,eAAe,GACf,UAAU,GACV,YAAY,GACZ,cAAc,GACd,mBAAmB,GACnB,YAAY,CACf,GACC,IAAI,CAAC,aAAa,EAAE,QAAQ,GAAG,SAAS,CAAC,GAAG;IAC1C;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEJ;;;GAGG;AACH,eAAO,MAAM,aAAa,0DAoEzB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { BarComponentProps } from './Bar';
|
|
2
|
+
export type DefaultBarProps = BarComponentProps;
|
|
3
|
+
/**
|
|
4
|
+
* Default bar component that renders a solid bar with animation support.
|
|
5
|
+
*/
|
|
6
|
+
export declare const DefaultBar: import('react').NamedExoticComponent<BarComponentProps>;
|
|
7
|
+
//# sourceMappingURL=DefaultBar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DefaultBar.d.ts","sourceRoot":"","sources":["../../../src/chart/bar/DefaultBar.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE/C,MAAM,MAAM,eAAe,GAAG,iBAAiB,CAAC;AAEhD;;GAEG;AACH,eAAO,MAAM,UAAU,yDAwEtB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { BarStackComponentProps } from './BarStack';
|
|
2
|
+
export type DefaultBarStackProps = BarStackComponentProps;
|
|
3
|
+
/**
|
|
4
|
+
* Default stack component that renders children in a group with animated clip path.
|
|
5
|
+
*/
|
|
6
|
+
export declare const DefaultBarStack: import('react').NamedExoticComponent<BarStackComponentProps>;
|
|
7
|
+
//# sourceMappingURL=DefaultBarStack.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DefaultBarStack.d.ts","sourceRoot":"","sources":["../../../src/chart/bar/DefaultBarStack.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAEzD,MAAM,MAAM,oBAAoB,GAAG,sBAAsB,CAAC;AAE1D;;GAEG;AACH,eAAO,MAAM,eAAe,8DAoC3B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/chart/bar/index.ts"],"names":[],"mappings":"AACA,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { GradientDefinition } from '../utils';
|
|
2
|
+
export type GradientBaseProps = {
|
|
3
|
+
/**
|
|
4
|
+
* Gradient definition with stops, axis, and other configuration.
|
|
5
|
+
*/
|
|
6
|
+
gradient: GradientDefinition;
|
|
7
|
+
/**
|
|
8
|
+
* Y-axis ID to use for gradient processing.
|
|
9
|
+
* When provided, the gradient will align with the specified y-axis range.
|
|
10
|
+
* This ensures gradients work correctly when the axis has a custom range configuration.
|
|
11
|
+
*/
|
|
12
|
+
yAxisId?: string;
|
|
13
|
+
};
|
|
14
|
+
export type GradientProps = GradientBaseProps;
|
|
15
|
+
/**
|
|
16
|
+
* Renders a Skia LinearGradient element based on a GradientDefinition.
|
|
17
|
+
* The gradient should be used as a child of a Path component.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* <Path d={pathString} stroke="red">
|
|
21
|
+
* {gradient && <Gradient gradient={gradient} yAxisId={yAxisId} />}
|
|
22
|
+
* </Path>
|
|
23
|
+
*/
|
|
24
|
+
export declare const Gradient: import('react').NamedExoticComponent<GradientBaseProps>;
|
|
25
|
+
//# sourceMappingURL=Gradient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Gradient.d.ts","sourceRoot":"","sources":["../../../src/chart/gradient/Gradient.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAGnD,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;OAEG;IACH,QAAQ,EAAE,kBAAkB,CAAC;IAC7B;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,iBAAiB,CAAC;AAE9C;;;;;;;;GAQG;AACH,eAAO,MAAM,QAAQ,yDA8BnB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/chart/gradient/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export * from './area';
|
|
2
|
+
export * from './axis';
|
|
3
|
+
export * from './bar';
|
|
4
|
+
export * from './CartesianChart';
|
|
5
|
+
export * from './ChartContextBridge';
|
|
6
|
+
export * from './ChartProvider';
|
|
7
|
+
export * from './gradient';
|
|
8
|
+
export * from './line';
|
|
9
|
+
export * from './Path';
|
|
10
|
+
export * from './PeriodSelector';
|
|
11
|
+
export * from './point';
|
|
12
|
+
export * from './scrubber';
|
|
13
|
+
export * from './text';
|
|
14
|
+
export * from './utils';
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/chart/index.ts"],"names":[],"mappings":"AACA,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,OAAO,CAAC;AACtB,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,kBAAkB,CAAC;AACjC,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ReferenceLineLabelComponentProps } from './ReferenceLine';
|
|
2
|
+
export type DefaultReferenceLineLabelProps = ReferenceLineLabelComponentProps;
|
|
3
|
+
/**
|
|
4
|
+
* DefaultReferenceLineLabel is the default label component for ReferenceLine.
|
|
5
|
+
* Provides standard styling with elevation, inset, and color defaults.
|
|
6
|
+
* When elevated, automatically adds bounds to prevent shadow cutoff at chart edges.
|
|
7
|
+
*/
|
|
8
|
+
export declare const DefaultReferenceLineLabel: import('react').NamedExoticComponent<ReferenceLineLabelComponentProps>;
|
|
9
|
+
//# sourceMappingURL=DefaultReferenceLineLabel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DefaultReferenceLineLabel.d.ts","sourceRoot":"","sources":["../../../src/chart/line/DefaultReferenceLineLabel.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,iBAAiB,CAAC;AAExE,MAAM,MAAM,8BAA8B,GAAG,gCAAgC,CAAC;AAQ9E;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,wEAoCrC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type PathProps } from '../Path';
|
|
2
|
+
import type { LineComponentProps } from './Line';
|
|
3
|
+
export type DottedLineProps = Pick<
|
|
4
|
+
PathProps,
|
|
5
|
+
'initialPath' | 'children' | 'strokeCap' | 'strokeJoin' | 'clipRect' | 'clipPath' | 'clipOffset'
|
|
6
|
+
> &
|
|
7
|
+
LineComponentProps & {
|
|
8
|
+
fill?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Stroke dash array for the dotted pattern.
|
|
11
|
+
* @default [0, 4]
|
|
12
|
+
*/
|
|
13
|
+
dashIntervals?: number[];
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* A customizable dotted line component.
|
|
17
|
+
* Supports gradient for gradient effects on the dots and smooth data transitions via AnimatedPath.
|
|
18
|
+
*/
|
|
19
|
+
export declare const DottedLine: import('react').NamedExoticComponent<DottedLineProps>;
|
|
20
|
+
//# sourceMappingURL=DottedLine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DottedLine.d.ts","sourceRoot":"","sources":["../../../src/chart/line/DottedLine.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC;AAE/C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAEjD,MAAM,MAAM,eAAe,GAAG,IAAI,CAChC,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;IACd;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;CAC1B,CAAC;AAEJ;;;GAGG;AACH,eAAO,MAAM,UAAU,uDAqCtB,CAAC"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type AnimatedProp } from '@shopify/react-native-skia';
|
|
3
|
+
import { type AreaComponent } from '../area/Area';
|
|
4
|
+
import { type PointBaseProps, type PointProps } from '../point';
|
|
5
|
+
import { type ChartPathCurveType, type GradientDefinition, type Transition } from '../utils';
|
|
6
|
+
export type LineBaseProps = {
|
|
7
|
+
/**
|
|
8
|
+
* The ID of the series to render. Will be used to find the data from the chart context.
|
|
9
|
+
*/
|
|
10
|
+
seriesId: string;
|
|
11
|
+
/**
|
|
12
|
+
* The curve interpolation method to use for the line.
|
|
13
|
+
* @default 'bump'
|
|
14
|
+
*/
|
|
15
|
+
curve?: ChartPathCurveType;
|
|
16
|
+
/**
|
|
17
|
+
* The type of line to render.
|
|
18
|
+
* @default 'solid'
|
|
19
|
+
*/
|
|
20
|
+
type?: 'solid' | 'dotted';
|
|
21
|
+
/**
|
|
22
|
+
* Whether to show area fill under the line.
|
|
23
|
+
*/
|
|
24
|
+
showArea?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* The type of area fill to add to the line.
|
|
27
|
+
* @default 'gradient'
|
|
28
|
+
*/
|
|
29
|
+
areaType?: 'gradient' | 'solid' | 'dotted';
|
|
30
|
+
/**
|
|
31
|
+
* Baseline value for the area.
|
|
32
|
+
* When set, overrides the default baseline.
|
|
33
|
+
*/
|
|
34
|
+
areaBaseline?: number;
|
|
35
|
+
/**
|
|
36
|
+
* Component to render the line.
|
|
37
|
+
* Takes precedence over the type prop if provided.
|
|
38
|
+
*/
|
|
39
|
+
LineComponent?: LineComponent;
|
|
40
|
+
/**
|
|
41
|
+
* Custom component to render line area fill.
|
|
42
|
+
*/
|
|
43
|
+
AreaComponent?: AreaComponent;
|
|
44
|
+
/**
|
|
45
|
+
* Opacity of the line's stroke.
|
|
46
|
+
* Will also be applied to points and area fill.
|
|
47
|
+
* @default 1
|
|
48
|
+
*/
|
|
49
|
+
opacity?: number;
|
|
50
|
+
/**
|
|
51
|
+
* Controls whether and how to render points at each data point in the series.
|
|
52
|
+
* - `true`: Show all points with default styling
|
|
53
|
+
* - `false` or `undefined`: Hide all points
|
|
54
|
+
* - Function: Called for every entry in the data array to customize individual points
|
|
55
|
+
*
|
|
56
|
+
* @param defaults - The default point props computed by the Line component
|
|
57
|
+
* @returns true for default point, false/null/undefined for no point, or Partial<PointProps> to customize
|
|
58
|
+
*/
|
|
59
|
+
points?:
|
|
60
|
+
| boolean
|
|
61
|
+
| ((defaults: PointBaseProps) => boolean | null | undefined | Partial<PointProps>);
|
|
62
|
+
/**
|
|
63
|
+
* When true, the area is connected across null values.
|
|
64
|
+
*/
|
|
65
|
+
connectNulls?: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* The color of the line.
|
|
68
|
+
* @default color of the series or theme.color.fgPrimary
|
|
69
|
+
*/
|
|
70
|
+
stroke?: string;
|
|
71
|
+
/**
|
|
72
|
+
* Opacity of the line
|
|
73
|
+
* @note when combined with gradient, both will be applied
|
|
74
|
+
* @default 1
|
|
75
|
+
*/
|
|
76
|
+
strokeOpacity?: AnimatedProp<number>;
|
|
77
|
+
/**
|
|
78
|
+
* Width of the line
|
|
79
|
+
* @default 2
|
|
80
|
+
*/
|
|
81
|
+
strokeWidth?: number;
|
|
82
|
+
/**
|
|
83
|
+
* Gradient configuration.
|
|
84
|
+
* When provided, creates gradient or threshold-based coloring.
|
|
85
|
+
*/
|
|
86
|
+
gradient?: GradientDefinition;
|
|
87
|
+
/**
|
|
88
|
+
* Whether to animate the line.
|
|
89
|
+
* Overrides the animate value from the chart context.
|
|
90
|
+
*/
|
|
91
|
+
animate?: boolean;
|
|
92
|
+
};
|
|
93
|
+
export type LineProps = LineBaseProps & {
|
|
94
|
+
/**
|
|
95
|
+
* Transition configuration for line animations.
|
|
96
|
+
*/
|
|
97
|
+
transition?: Transition;
|
|
98
|
+
};
|
|
99
|
+
export type LineComponentProps = Pick<
|
|
100
|
+
LineProps,
|
|
101
|
+
'stroke' | 'strokeOpacity' | 'strokeWidth' | 'gradient' | 'animate' | 'transition'
|
|
102
|
+
> & {
|
|
103
|
+
/**
|
|
104
|
+
* Path of the line
|
|
105
|
+
*/
|
|
106
|
+
d: AnimatedProp<string | undefined>;
|
|
107
|
+
/**
|
|
108
|
+
* ID of the y-axis to use.
|
|
109
|
+
* If not provided, defaults to the default y-axis.
|
|
110
|
+
*/
|
|
111
|
+
yAxisId?: string;
|
|
112
|
+
};
|
|
113
|
+
export type LineComponent = React.FC<LineComponentProps>;
|
|
114
|
+
export declare const Line: React.NamedExoticComponent<LineProps>;
|
|
115
|
+
//# 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,KAAmC,MAAM,OAAO,CAAC;AAGxD,OAAO,EAAE,KAAK,YAAY,EAAS,MAAM,4BAA4B,CAAC;AAEtE,OAAO,EAAQ,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAExD,OAAO,EAAS,KAAK,cAAc,EAAE,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AACvE,OAAO,EAGL,KAAK,kBAAkB,EAGvB,KAAK,kBAAkB,EACvB,KAAK,UAAU,EAChB,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;IACtC;;OAEG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,IAAI,CACnC,SAAS,EACT,QAAQ,GAAG,eAAe,GAAG,aAAa,GAAG,UAAU,GAAG,SAAS,GAAG,YAAY,CACnF,GAAG;IACF;;OAEG;IACH,CAAC,EAAE,YAAY,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IACpC;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAAC,CAAC;AAEzD,eAAO,MAAM,IAAI,uCAyMhB,CAAC"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import type { View } from 'react-native';
|
|
2
|
+
import { type XAxisProps } from '../axis/XAxis';
|
|
3
|
+
import { type YAxisProps } from '../axis/YAxis';
|
|
4
|
+
import { type CartesianChartBaseProps, type CartesianChartProps } from '../CartesianChart';
|
|
5
|
+
import { type AxisConfigProps, type Series } from '../utils';
|
|
6
|
+
import { type LineProps } from './Line';
|
|
7
|
+
export type LineSeries = Series &
|
|
8
|
+
Partial<
|
|
9
|
+
Pick<
|
|
10
|
+
LineProps,
|
|
11
|
+
| 'curve'
|
|
12
|
+
| 'showArea'
|
|
13
|
+
| 'areaType'
|
|
14
|
+
| 'areaBaseline'
|
|
15
|
+
| 'type'
|
|
16
|
+
| 'LineComponent'
|
|
17
|
+
| 'AreaComponent'
|
|
18
|
+
| 'stroke'
|
|
19
|
+
| 'strokeWidth'
|
|
20
|
+
| 'strokeOpacity'
|
|
21
|
+
| 'opacity'
|
|
22
|
+
| 'points'
|
|
23
|
+
| 'connectNulls'
|
|
24
|
+
| 'transition'
|
|
25
|
+
>
|
|
26
|
+
>;
|
|
27
|
+
export type LineChartBaseProps = Omit<CartesianChartBaseProps, 'xAxis' | 'yAxis' | 'series'> &
|
|
28
|
+
Pick<
|
|
29
|
+
LineProps,
|
|
30
|
+
| 'showArea'
|
|
31
|
+
| 'areaType'
|
|
32
|
+
| 'type'
|
|
33
|
+
| 'LineComponent'
|
|
34
|
+
| 'AreaComponent'
|
|
35
|
+
| 'curve'
|
|
36
|
+
| 'points'
|
|
37
|
+
| 'strokeWidth'
|
|
38
|
+
| 'strokeOpacity'
|
|
39
|
+
| 'connectNulls'
|
|
40
|
+
| 'transition'
|
|
41
|
+
| 'opacity'
|
|
42
|
+
> & {
|
|
43
|
+
/**
|
|
44
|
+
* Configuration objects that define how to visualize the data.
|
|
45
|
+
* Each series supports Line component props for individual customization.
|
|
46
|
+
*/
|
|
47
|
+
series?: Array<LineSeries>;
|
|
48
|
+
/**
|
|
49
|
+
* Whether to show the X axis.
|
|
50
|
+
*/
|
|
51
|
+
showXAxis?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Whether to show the Y axis.
|
|
54
|
+
*/
|
|
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
|
+
*/
|
|
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
|
+
*/
|
|
67
|
+
yAxis?: Partial<AxisConfigProps> & YAxisProps;
|
|
68
|
+
};
|
|
69
|
+
export type LineChartProps = LineChartBaseProps &
|
|
70
|
+
Omit<CartesianChartProps, 'xAxis' | 'yAxis' | 'series'>;
|
|
71
|
+
export declare const LineChart: import('react').MemoExoticComponent<
|
|
72
|
+
import('react').ForwardRefExoticComponent<
|
|
73
|
+
Omit<CartesianChartBaseProps, 'series' | 'xAxis' | 'yAxis'> &
|
|
74
|
+
Pick<
|
|
75
|
+
LineProps,
|
|
76
|
+
| 'type'
|
|
77
|
+
| 'opacity'
|
|
78
|
+
| 'strokeWidth'
|
|
79
|
+
| 'curve'
|
|
80
|
+
| 'connectNulls'
|
|
81
|
+
| 'transition'
|
|
82
|
+
| 'strokeOpacity'
|
|
83
|
+
| 'AreaComponent'
|
|
84
|
+
| 'showArea'
|
|
85
|
+
| 'areaType'
|
|
86
|
+
| 'LineComponent'
|
|
87
|
+
| 'points'
|
|
88
|
+
> & {
|
|
89
|
+
/**
|
|
90
|
+
* Configuration objects that define how to visualize the data.
|
|
91
|
+
* Each series supports Line component props for individual customization.
|
|
92
|
+
*/
|
|
93
|
+
series?: Array<LineSeries>;
|
|
94
|
+
/**
|
|
95
|
+
* Whether to show the X axis.
|
|
96
|
+
*/
|
|
97
|
+
showXAxis?: boolean;
|
|
98
|
+
/**
|
|
99
|
+
* Whether to show the Y axis.
|
|
100
|
+
*/
|
|
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
|
+
*/
|
|
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
|
+
*/
|
|
113
|
+
yAxis?: Partial<AxisConfigProps> & YAxisProps;
|
|
114
|
+
} & Omit<CartesianChartProps, 'series' | 'xAxis' | 'yAxis'> &
|
|
115
|
+
import('react').RefAttributes<View>
|
|
116
|
+
>
|
|
117
|
+
>;
|
|
118
|
+
//# sourceMappingURL=LineChart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LineChart.d.ts","sourceRoot":"","sources":["../../../src/chart/line/LineChart.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,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;mGA6HhD,CAAC"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import type { AnimatedProp } from '@shopify/react-native-skia';
|
|
2
|
+
import type {
|
|
3
|
+
ChartTextChildren,
|
|
4
|
+
ChartTextProps,
|
|
5
|
+
TextHorizontalAlignment,
|
|
6
|
+
TextVerticalAlignment,
|
|
7
|
+
} from '../text/ChartText';
|
|
8
|
+
import type { ChartInset } from '../utils';
|
|
9
|
+
import type { LineComponent } from './Line';
|
|
10
|
+
export type ReferenceLineLabelComponentProps = Pick<
|
|
11
|
+
ChartTextProps,
|
|
12
|
+
| 'x'
|
|
13
|
+
| 'y'
|
|
14
|
+
| 'children'
|
|
15
|
+
| 'color'
|
|
16
|
+
| 'inset'
|
|
17
|
+
| 'background'
|
|
18
|
+
| 'borderRadius'
|
|
19
|
+
| 'disableRepositioning'
|
|
20
|
+
| 'horizontalAlignment'
|
|
21
|
+
| 'verticalAlignment'
|
|
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 = {
|
|
40
|
+
/**
|
|
41
|
+
* Label content to display near the reference line.
|
|
42
|
+
* Can be a string or ReactNode for rich formatting.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* // Simple string label
|
|
46
|
+
* label="Target Price"
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* // ReactNode with styling
|
|
50
|
+
* label={<tspan style={{ fontWeight: 'bold', fill: 'red' }}>Stop Loss</tspan>}
|
|
51
|
+
*/
|
|
52
|
+
label?: ChartTextChildren;
|
|
53
|
+
/**
|
|
54
|
+
* Component to render the line.
|
|
55
|
+
* @default DottedLine
|
|
56
|
+
*/
|
|
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;
|
|
95
|
+
/**
|
|
96
|
+
* The color of the line.
|
|
97
|
+
* @default theme.color.bgLine
|
|
98
|
+
*/
|
|
99
|
+
stroke?: string;
|
|
100
|
+
/**
|
|
101
|
+
* Opacity applied to both the line and label.
|
|
102
|
+
* @default 1
|
|
103
|
+
*/
|
|
104
|
+
opacity?: AnimatedProp<number>;
|
|
105
|
+
};
|
|
106
|
+
type HorizontalReferenceLineProps = ReferenceLineBaseProps & {
|
|
107
|
+
/**
|
|
108
|
+
* Y-value for horizontal reference line (data value).
|
|
109
|
+
*/
|
|
110
|
+
dataY: AnimatedProp<number>;
|
|
111
|
+
/**
|
|
112
|
+
* The ID of the y-axis to use for positioning.
|
|
113
|
+
* Defaults to defaultAxisId if not specified.
|
|
114
|
+
*/
|
|
115
|
+
yAxisId?: string;
|
|
116
|
+
/**
|
|
117
|
+
* Position of the label along the horizontal line.
|
|
118
|
+
* @default 'right'
|
|
119
|
+
*/
|
|
120
|
+
labelPosition?: TextHorizontalAlignment;
|
|
121
|
+
dataX?: never;
|
|
122
|
+
};
|
|
123
|
+
type VerticalReferenceLineProps = ReferenceLineBaseProps & {
|
|
124
|
+
/**
|
|
125
|
+
* X-value for vertical reference line (data index).
|
|
126
|
+
*/
|
|
127
|
+
dataX: AnimatedProp<number>;
|
|
128
|
+
/**
|
|
129
|
+
* Position of the label along the vertical line.
|
|
130
|
+
* @default 'top'
|
|
131
|
+
*/
|
|
132
|
+
labelPosition?: TextVerticalAlignment;
|
|
133
|
+
dataY?: never;
|
|
134
|
+
yAxisId?: never;
|
|
135
|
+
};
|
|
136
|
+
export type ReferenceLineProps = HorizontalReferenceLineProps | VerticalReferenceLineProps;
|
|
137
|
+
export declare const ReferenceLine: import('react').NamedExoticComponent<ReferenceLineProps>;
|
|
138
|
+
export {};
|
|
139
|
+
//# sourceMappingURL=ReferenceLine.d.ts.map
|