@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
|
@@ -2,114 +2,129 @@ import React from 'react';
|
|
|
2
2
|
import { type StyleProp, type ViewStyle } from 'react-native';
|
|
3
3
|
import type { ThemeVars } from '@coinbase/cds-common/core/theme';
|
|
4
4
|
import type { Placement } from '@coinbase/cds-common/types';
|
|
5
|
-
import type {
|
|
5
|
+
import type {
|
|
6
|
+
ChartData,
|
|
7
|
+
ChartFormatAmount,
|
|
8
|
+
ChartFormatDate,
|
|
9
|
+
ChartScrubParams,
|
|
10
|
+
ChartTimeseries,
|
|
11
|
+
} from '@coinbase/cds-common/types/Chart';
|
|
6
12
|
export * from '@coinbase/cds-common/types/Chart';
|
|
7
13
|
export type SparklineInteractiveBaseProps<Period extends string> = {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Type of fill to use for the area
|
|
16
|
+
* @default 'gradient'
|
|
17
|
+
*/
|
|
18
|
+
fillType?: 'dotted' | 'gradient';
|
|
19
|
+
/**
|
|
20
|
+
* Chart data bucketed by Period. Period is a string key
|
|
21
|
+
*/
|
|
22
|
+
data?: Record<Period, ChartData>;
|
|
23
|
+
/**
|
|
24
|
+
* A list of periods that the chart will use. label is what is shown in the bottom of the chart and the value is the key.
|
|
25
|
+
*/
|
|
26
|
+
periods: {
|
|
27
|
+
label: string;
|
|
28
|
+
value: Period;
|
|
29
|
+
}[];
|
|
30
|
+
/**
|
|
31
|
+
* default period value that the chart will use
|
|
32
|
+
*/
|
|
33
|
+
defaultPeriod: Period;
|
|
34
|
+
/**
|
|
35
|
+
* Callback when the user selects a new period.
|
|
36
|
+
*/
|
|
37
|
+
onPeriodChanged?: (period: Period) => void;
|
|
38
|
+
/**
|
|
39
|
+
* Callback when the user starts scrubbing
|
|
40
|
+
*/
|
|
41
|
+
onScrubStart?: () => void;
|
|
42
|
+
/**
|
|
43
|
+
* Callback when a user finishes scrubbing
|
|
44
|
+
*/
|
|
45
|
+
onScrubEnd?: () => void;
|
|
46
|
+
/**
|
|
47
|
+
* Callback used when the user is scrubbing. This will be called for every data point change.
|
|
48
|
+
*/
|
|
49
|
+
onScrub?: (params: ChartScrubParams<Period>) => void;
|
|
50
|
+
/**
|
|
51
|
+
* Disables the scrub user interaction from the chart
|
|
52
|
+
*
|
|
53
|
+
* @default false
|
|
54
|
+
*/
|
|
55
|
+
disableScrubbing?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* function used to format the date that is shown in the bottom of the chart as the user scrubs
|
|
58
|
+
*/
|
|
59
|
+
formatDate: ChartFormatDate<Period>;
|
|
60
|
+
/**
|
|
61
|
+
* Color of the line*
|
|
62
|
+
*/
|
|
63
|
+
strokeColor: string;
|
|
64
|
+
/**
|
|
65
|
+
* Fallback shown in the chart when data is not available. This is usually a loading state.
|
|
66
|
+
*/
|
|
67
|
+
fallback?: React.ReactNode;
|
|
68
|
+
/**
|
|
69
|
+
* If you use the default fallback then this specifies if the fallback line is decreasing or increasing
|
|
70
|
+
*/
|
|
71
|
+
fallbackType?: 'positive' | 'negative';
|
|
72
|
+
/**
|
|
73
|
+
* Show the chart in compact height
|
|
74
|
+
*
|
|
75
|
+
* @default false
|
|
76
|
+
*/
|
|
77
|
+
compact?: boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Hides the period selector at the bottom of the chart
|
|
80
|
+
*
|
|
81
|
+
* @default false
|
|
82
|
+
*/
|
|
83
|
+
hidePeriodSelector?: boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Adds an area fill to the Sparkline
|
|
86
|
+
*
|
|
87
|
+
* @default true
|
|
88
|
+
*/
|
|
89
|
+
fill?: boolean;
|
|
90
|
+
/**
|
|
80
91
|
Formats the date above the chart as you scrub. Omit this if you don't want to show the date as the user scrubs
|
|
81
92
|
*/
|
|
82
|
-
|
|
83
|
-
|
|
93
|
+
formatHoverDate?: (date: Date, period: Period) => string;
|
|
94
|
+
/**
|
|
84
95
|
Formats the price above the chart as you scrub. Omit this if you don't want to show the price as the user scrubs
|
|
85
96
|
*/
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
97
|
+
formatHoverPrice?: (price: number) => string;
|
|
98
|
+
/**
|
|
99
|
+
* Adds a header node above the chart. It will be placed next to the period selector on web.
|
|
100
|
+
*/
|
|
101
|
+
headerNode?: React.ReactNode;
|
|
102
|
+
/**
|
|
103
|
+
* Optional data to show on hover/scrub instead of the original sparkline. This allows multiple timeseries lines.
|
|
104
|
+
*
|
|
105
|
+
* Period => timeseries list
|
|
106
|
+
*/
|
|
107
|
+
hoverData?: Record<Period, ChartTimeseries[]>;
|
|
108
|
+
/**
|
|
109
|
+
* Optional gutter to add to the Period selector. This is useful if you choose to use the full screen width for the chart
|
|
110
|
+
*/
|
|
111
|
+
timePeriodGutter?: ThemeVars.Space;
|
|
112
|
+
/**
|
|
113
|
+
* Optional placement prop that position the period selector component above or below the chart
|
|
114
|
+
*/
|
|
115
|
+
periodSelectorPlacement?: Extract<Placement, 'above' | 'below'>;
|
|
116
|
+
/** Scales the sparkline to show more or less variance. Use a number less than 1 for less variance and a number greater than 1 for more variance. If you use a number greater than 1 it may clip the boundaries of the sparkline. */
|
|
117
|
+
yAxisScalingFactor?: number;
|
|
107
118
|
};
|
|
108
|
-
export type SparklineInteractiveDefaultFallback = Pick<
|
|
119
|
+
export type SparklineInteractiveDefaultFallback = Pick<
|
|
120
|
+
SparklineInteractiveBaseProps<string>,
|
|
121
|
+
'fallbackType' | 'compact'
|
|
122
|
+
>;
|
|
109
123
|
export type SparklineInteractiveHoverDateRefProps<Period extends string> = {
|
|
110
|
-
|
|
124
|
+
update: (params: ChartScrubParams<Period>) => void;
|
|
111
125
|
};
|
|
112
|
-
export type SparklineInteractiveProps<Period extends string> =
|
|
126
|
+
export type SparklineInteractiveProps<Period extends string> =
|
|
127
|
+
SparklineInteractiveBaseProps<Period> & {
|
|
113
128
|
/**
|
|
114
129
|
* Hides the min and max label
|
|
115
130
|
*
|
|
@@ -145,18 +160,25 @@ export type SparklineInteractiveProps<Period extends string> = SparklineInteract
|
|
|
145
160
|
* Custom styles for the component.
|
|
146
161
|
*/
|
|
147
162
|
styles?: {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
163
|
+
/**
|
|
164
|
+
* Custom style for the header node.
|
|
165
|
+
*/
|
|
166
|
+
header?: StyleProp<ViewStyle>;
|
|
167
|
+
/**
|
|
168
|
+
* Custom style for the root element.
|
|
169
|
+
*/
|
|
170
|
+
root?: StyleProp<ViewStyle>;
|
|
156
171
|
};
|
|
157
172
|
/** Test ID for the header */
|
|
158
173
|
headerTestID?: string;
|
|
159
|
-
};
|
|
160
|
-
declare function SparklineInteractiveWithGeneric<Period extends string>({
|
|
174
|
+
};
|
|
175
|
+
declare function SparklineInteractiveWithGeneric<Period extends string>({
|
|
176
|
+
compact,
|
|
177
|
+
gutter,
|
|
178
|
+
...props
|
|
179
|
+
}: SparklineInteractiveProps<Period>): import('react/jsx-runtime').JSX.Element;
|
|
180
|
+
/**
|
|
181
|
+
* @deprecated Use LineChart instead.
|
|
182
|
+
*/
|
|
161
183
|
export declare const SparklineInteractive: typeof SparklineInteractiveWithGeneric;
|
|
162
|
-
//# sourceMappingURL=SparklineInteractive.d.ts.map
|
|
184
|
+
//# sourceMappingURL=SparklineInteractive.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SparklineInteractive.d.ts","sourceRoot":"","sources":["../../../src/sparkline/sparkline-interactive/SparklineInteractive.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkE,MAAM,OAAO,CAAC;AACvF,OAAO,EAAY,KAAK,SAAS,EAAoB,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAC1F,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,KAAK,EAAE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,IAAI,EAAE,MAAM,EAAE,MAAM,KAAK,MAAM,CAAC;IACzD;;OAEG;IACH,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IAC7C;;OAEG;IACH,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC7B;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,EAAE,CAAC,CAAC;IAC9C;;OAEG;IACH,gBAAgB,CAAC,EAAE,SAAS,CAAC,KAAK,CAAC;IACnC;;OAEG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC,SAAS,EAAE,OAAO,GAAG,OAAO,CAAC,CAAC;IAChE,oOAAoO;IACpO,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,mCAAmC,GAAG,IAAI,CACpD,6BAA6B,CAAC,MAAM,CAAC,EACrC,cAAc,GAAG,SAAS,CAC3B,CAAC;AAiEF,MAAM,MAAM,qCAAqC,CAAC,MAAM,SAAS,MAAM,IAAI;IACzE,MAAM,EAAE,CAAC,MAAM,EAAE,gBAAgB,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC;CACpD,CAAC;
|
|
1
|
+
{"version":3,"file":"SparklineInteractive.d.ts","sourceRoot":"","sources":["../../../src/sparkline/sparkline-interactive/SparklineInteractive.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkE,MAAM,OAAO,CAAC;AACvF,OAAO,EAAY,KAAK,SAAS,EAAoB,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAC1F,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,KAAK,EACV,SAAS,EAET,iBAAiB,EACjB,eAAe,EAEf,gBAAgB,EAChB,eAAe,EAChB,MAAM,kCAAkC,CAAC;AA2B1C,cAAc,kCAAkC,CAAC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AAC,SAAS,CAAC,CAAC;KAC7B,CAAC;IACF,6BAA6B;IAC7B,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEJ,iBAAS,+BAA+B,CAAC,MAAM,SAAS,MAAM,EAAE,EAC9D,OAAO,EACP,MAAM,EACN,GAAG,KAAK,EACT,EAAE,yBAAyB,CAAC,MAAM,CAAC,2CAMnC;AAED;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAE5B,OAAO,+BAA+B,CAAC"}
|
|
@@ -1,12 +1,25 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { type SparklineFillType } from '../Sparkline';
|
|
2
3
|
export type SparklineInteractiveAnimatedPathProps = {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
d: string;
|
|
5
|
+
color: string;
|
|
6
|
+
area?: string;
|
|
7
|
+
selectedPeriod: string;
|
|
8
|
+
fillType?: SparklineFillType;
|
|
9
|
+
yAxisScalingFactor?: number;
|
|
10
|
+
initialPath?: string;
|
|
11
|
+
initialArea?: string;
|
|
10
12
|
};
|
|
11
|
-
export declare const SparklineInteractiveAnimatedPath: React.MemoExoticComponent<
|
|
12
|
-
|
|
13
|
+
export declare const SparklineInteractiveAnimatedPath: React.MemoExoticComponent<
|
|
14
|
+
({
|
|
15
|
+
d,
|
|
16
|
+
color,
|
|
17
|
+
selectedPeriod,
|
|
18
|
+
area,
|
|
19
|
+
fillType,
|
|
20
|
+
yAxisScalingFactor,
|
|
21
|
+
initialPath,
|
|
22
|
+
initialArea,
|
|
23
|
+
}: SparklineInteractiveAnimatedPathProps) => import('react/jsx-runtime').JSX.Element
|
|
24
|
+
>;
|
|
25
|
+
//# sourceMappingURL=SparklineInteractiveAnimatedPath.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SparklineInteractiveAnimatedPath.d.ts","sourceRoot":"","sources":["../../../src/sparkline/sparkline-interactive/SparklineInteractiveAnimatedPath.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwD,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"SparklineInteractiveAnimatedPath.d.ts","sourceRoot":"","sources":["../../../src/sparkline/sparkline-interactive/SparklineInteractiveAnimatedPath.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwD,MAAM,OAAO,CAAC;AAK7E,OAAO,EAAa,KAAK,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAOjE,MAAM,MAAM,qCAAqC,GAAG;IAClD,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,gCAAgC,0HAUxC,qCAAqC,6CAkHzC,CAAC"}
|
|
@@ -2,16 +2,27 @@ import React from 'react';
|
|
|
2
2
|
import { Animated } from 'react-native';
|
|
3
3
|
import type { ChartScrubParams } from '@coinbase/cds-common/types/Chart';
|
|
4
4
|
import type { SparklineInteractiveBaseProps } from './SparklineInteractive';
|
|
5
|
-
type Props<Period extends string> = Pick<
|
|
6
|
-
|
|
5
|
+
type Props<Period extends string> = Pick<
|
|
6
|
+
SparklineInteractiveBaseProps<Period>,
|
|
7
|
+
'formatHoverDate'
|
|
8
|
+
> & {
|
|
9
|
+
shouldTakeUpHeight: boolean;
|
|
7
10
|
};
|
|
8
|
-
export declare function setTransform(
|
|
11
|
+
export declare function setTransform(
|
|
12
|
+
x: number,
|
|
13
|
+
elWidth: number,
|
|
14
|
+
containerWidth: number,
|
|
15
|
+
transform: Animated.ValueXY,
|
|
16
|
+
gutter: number,
|
|
17
|
+
): void;
|
|
9
18
|
export type SparklineInteractiveHoverDateRefProps<Period extends string> = {
|
|
10
|
-
|
|
19
|
+
update: (params: ChartScrubParams<Period>) => void;
|
|
11
20
|
};
|
|
12
|
-
type ForwardRefWithPeriod<Period extends string> = React.ForwardRefExoticComponent<
|
|
21
|
+
type ForwardRefWithPeriod<Period extends string> = React.ForwardRefExoticComponent<
|
|
22
|
+
Props<Period> & {
|
|
13
23
|
ref?: React.Ref<SparklineInteractiveHoverDateRefProps<Period>>;
|
|
14
|
-
}
|
|
24
|
+
}
|
|
25
|
+
>;
|
|
15
26
|
export declare const SparklineInteractiveHoverDate: ForwardRefWithPeriod<any>;
|
|
16
27
|
export {};
|
|
17
|
-
//# sourceMappingURL=SparklineInteractiveHoverDate.d.ts.map
|
|
28
|
+
//# sourceMappingURL=SparklineInteractiveHoverDate.d.ts.map
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
type SparklineInteractiveLineVerticalMobileProps = {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
color: string;
|
|
4
|
+
showHoverDate: boolean;
|
|
5
5
|
};
|
|
6
|
-
export declare const SparklineInteractiveLineVertical: React.MemoExoticComponent<
|
|
6
|
+
export declare const SparklineInteractiveLineVertical: React.MemoExoticComponent<
|
|
7
|
+
({
|
|
8
|
+
color,
|
|
9
|
+
showHoverDate,
|
|
10
|
+
}: SparklineInteractiveLineVerticalMobileProps) => import('react/jsx-runtime').JSX.Element
|
|
11
|
+
>;
|
|
7
12
|
export {};
|
|
8
|
-
//# sourceMappingURL=SparklineInteractiveLineVertical.d.ts.map
|
|
13
|
+
//# sourceMappingURL=SparklineInteractiveLineVertical.d.ts.map
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import type { ThemeVars } from '@coinbase/cds-common/core/theme';
|
|
2
2
|
import type { ChartFormatDate, ChartGetMarker } from './SparklineInteractive';
|
|
3
3
|
export type SparklineInteractiveMarkerDatesProps<Period extends string> = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
getMarker: ChartGetMarker;
|
|
5
|
+
formatDate: ChartFormatDate<Period>;
|
|
6
|
+
selectedPeriod: Period;
|
|
7
|
+
timePeriodGutter?: ThemeVars.Space;
|
|
8
8
|
};
|
|
9
|
-
declare function SparklineInteractiveMarkerDatesWithGeneric<Period extends string>({
|
|
9
|
+
declare function SparklineInteractiveMarkerDatesWithGeneric<Period extends string>({
|
|
10
|
+
formatDate,
|
|
11
|
+
selectedPeriod,
|
|
12
|
+
getMarker,
|
|
13
|
+
timePeriodGutter,
|
|
14
|
+
}: SparklineInteractiveMarkerDatesProps<Period>): import('react/jsx-runtime').JSX.Element;
|
|
10
15
|
export declare const SparklineInteractiveMarkerDates: typeof SparklineInteractiveMarkerDatesWithGeneric;
|
|
11
16
|
export {};
|
|
12
|
-
//# sourceMappingURL=SparklineInteractiveMarkerDates.d.ts.map
|
|
17
|
+
//# sourceMappingURL=SparklineInteractiveMarkerDates.d.ts.map
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ChartDataPoint, ChartFormatAmount, ChartXFunction } from '@coinbase/cds-common/types';
|
|
3
3
|
export type SparklineInteractiveMinMaxProps = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
dataPoint: ChartDataPoint | undefined;
|
|
5
|
+
formatMinMaxLabel: ChartFormatAmount;
|
|
6
|
+
xFunction: ChartXFunction;
|
|
7
7
|
};
|
|
8
|
-
export declare const SparklineInteractiveMinMax: React.FunctionComponent<
|
|
9
|
-
|
|
8
|
+
export declare const SparklineInteractiveMinMax: React.FunctionComponent<
|
|
9
|
+
React.PropsWithChildren<SparklineInteractiveMinMaxProps>
|
|
10
|
+
>;
|
|
11
|
+
//# sourceMappingURL=SparklineInteractiveMinMax.d.ts.map
|
|
@@ -1,14 +1,26 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ChartGetMarker, ChartScrubParams } from '@coinbase/cds-common/types/Chart';
|
|
3
3
|
import { type SparklineInteractiveProps } from './SparklineInteractive';
|
|
4
|
-
export type SparklineInteractivePanGestureHandlerProps<Period extends string> = Pick<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
export type SparklineInteractivePanGestureHandlerProps<Period extends string> = Pick<
|
|
5
|
+
SparklineInteractiveProps<Period>,
|
|
6
|
+
'allowOverflowGestures'
|
|
7
|
+
> & {
|
|
8
|
+
onScrub?: (params: ChartScrubParams<Period>) => void;
|
|
9
|
+
getMarker: ChartGetMarker;
|
|
10
|
+
selectedPeriod: Period;
|
|
11
|
+
onScrubEnd?: () => void;
|
|
12
|
+
onScrubStart?: () => void;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
children: React.ReactNode;
|
|
12
15
|
};
|
|
13
|
-
export declare const SparklineInteractivePanGestureHandler: <Period extends string>({
|
|
14
|
-
|
|
16
|
+
export declare const SparklineInteractivePanGestureHandler: <Period extends string>({
|
|
17
|
+
onScrubEnd,
|
|
18
|
+
onScrubStart,
|
|
19
|
+
onScrub,
|
|
20
|
+
getMarker,
|
|
21
|
+
selectedPeriod,
|
|
22
|
+
children,
|
|
23
|
+
disabled,
|
|
24
|
+
allowOverflowGestures,
|
|
25
|
+
}: SparklineInteractivePanGestureHandlerProps<Period>) => import('react/jsx-runtime').JSX.Element;
|
|
26
|
+
//# sourceMappingURL=SparklineInteractivePanGestureHandler.d.ts.map
|
|
@@ -1,11 +1,25 @@
|
|
|
1
1
|
import type { SparklineInteractiveBaseProps } from './SparklineInteractive';
|
|
2
|
-
export type SparklineInteractivePathsProps<Period extends string> = Pick<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
export type SparklineInteractivePathsProps<Period extends string> = Pick<
|
|
3
|
+
SparklineInteractiveBaseProps<Period>,
|
|
4
|
+
'fill' | 'fillType' | 'yAxisScalingFactor' | 'strokeColor' | 'hoverData' | 'compact'
|
|
5
|
+
> & {
|
|
6
|
+
showHoverData: boolean;
|
|
7
|
+
path: string;
|
|
8
|
+
area: string;
|
|
9
|
+
selectedPeriod: Period;
|
|
7
10
|
};
|
|
8
|
-
declare function SparklineInteractivePathsWithGeneric<Period extends string>({
|
|
11
|
+
declare function SparklineInteractivePathsWithGeneric<Period extends string>({
|
|
12
|
+
showHoverData,
|
|
13
|
+
fill,
|
|
14
|
+
fillType,
|
|
15
|
+
path,
|
|
16
|
+
area,
|
|
17
|
+
selectedPeriod,
|
|
18
|
+
yAxisScalingFactor,
|
|
19
|
+
strokeColor,
|
|
20
|
+
hoverData,
|
|
21
|
+
compact,
|
|
22
|
+
}: SparklineInteractivePathsProps<Period>): import('react/jsx-runtime').JSX.Element;
|
|
9
23
|
export declare const SparklineInteractivePaths: typeof SparklineInteractivePathsWithGeneric;
|
|
10
24
|
export {};
|
|
11
|
-
//# sourceMappingURL=SparklineInteractivePaths.d.ts.map
|
|
25
|
+
//# sourceMappingURL=SparklineInteractivePaths.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SparklineInteractivePaths.d.ts","sourceRoot":"","sources":["../../../src/sparkline/sparkline-interactive/SparklineInteractivePaths.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,wBAAwB,CAAC;AAQ5E,MAAM,MAAM,8BAA8B,CAAC,MAAM,SAAS,MAAM,IAAI,IAAI,CACtE,6BAA6B,CAAC,MAAM,CAAC,EACrC,MAAM,GAAG,oBAAoB,GAAG,aAAa,GAAG,WAAW,GAAG,SAAS,
|
|
1
|
+
{"version":3,"file":"SparklineInteractivePaths.d.ts","sourceRoot":"","sources":["../../../src/sparkline/sparkline-interactive/SparklineInteractivePaths.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,wBAAwB,CAAC;AAQ5E,MAAM,MAAM,8BAA8B,CAAC,MAAM,SAAS,MAAM,IAAI,IAAI,CACtE,6BAA6B,CAAC,MAAM,CAAC,EACrC,MAAM,GAAG,UAAU,GAAG,oBAAoB,GAAG,aAAa,GAAG,WAAW,GAAG,SAAS,CACrF,GAAG;IACF,aAAa,EAAE,OAAO,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,iBAAS,oCAAoC,CAAC,MAAM,SAAS,MAAM,EAAE,EACnE,aAAa,EACb,IAAI,EACJ,QAAqB,EACrB,IAAI,EACJ,IAAI,EACJ,cAAc,EACd,kBAAkB,EAClB,WAAW,EACX,SAAS,EACT,OAAO,GACR,EAAE,8BAA8B,CAAC,MAAM,CAAC,2CA0CxC;AAED,eAAO,MAAM,yBAAyB,EAEjC,OAAO,oCAAoC,CAAC"}
|
|
@@ -1,20 +1,25 @@
|
|
|
1
1
|
export type SparklineInteractivePeriodSelectorProps<Period extends string> = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
selectedPeriod: Period;
|
|
3
|
+
setSelectedPeriod: (period: Period) => void;
|
|
4
|
+
periods: {
|
|
5
|
+
label: string;
|
|
6
|
+
value: Period;
|
|
7
|
+
}[];
|
|
8
|
+
color: string;
|
|
9
9
|
};
|
|
10
10
|
export type SparklineInteractivePeriodProps<Period extends string> = {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
period: {
|
|
12
|
+
label: string;
|
|
13
|
+
value: Period;
|
|
14
|
+
};
|
|
15
|
+
selectedPeriod: Period;
|
|
16
|
+
setSelectedPeriod: SparklineInteractivePeriodSelectorProps<Period>['setSelectedPeriod'];
|
|
17
|
+
color: string;
|
|
18
18
|
};
|
|
19
|
-
export declare const SparklineInteractivePeriodSelector: <Period extends string>({
|
|
20
|
-
|
|
19
|
+
export declare const SparklineInteractivePeriodSelector: <Period extends string>({
|
|
20
|
+
selectedPeriod,
|
|
21
|
+
setSelectedPeriod,
|
|
22
|
+
periods,
|
|
23
|
+
color,
|
|
24
|
+
}: SparklineInteractivePeriodSelectorProps<Period>) => import('react/jsx-runtime').JSX.Element;
|
|
25
|
+
//# sourceMappingURL=SparklineInteractivePeriodSelector.d.ts.map
|
|
@@ -3,31 +3,37 @@ import { Animated } from 'react-native';
|
|
|
3
3
|
import type { SharedValue } from 'react-native-reanimated';
|
|
4
4
|
import type { ThemeVars } from '@coinbase/cds-common/core/theme';
|
|
5
5
|
type SparklineInteractiveProviderProps = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
compact?: boolean;
|
|
8
|
+
gutter?: ThemeVars.Space;
|
|
9
9
|
};
|
|
10
10
|
type SparklineInteractiveContextInterface = {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
11
|
+
isFallbackVisible: boolean;
|
|
12
|
+
markerXPosition: SharedValue<number>;
|
|
13
|
+
markerGestureState: SharedValue<0 | 1>;
|
|
14
|
+
showFallback: () => void;
|
|
15
|
+
hideFallback: () => void;
|
|
16
|
+
chartOpacity: Animated.Value;
|
|
17
|
+
animateChartIn: Animated.CompositeAnimation;
|
|
18
|
+
markerOpacity: Animated.Value;
|
|
19
|
+
animateMarkerIn: Animated.CompositeAnimation;
|
|
20
|
+
animateMarkerOut: Animated.CompositeAnimation;
|
|
21
|
+
minMaxOpacity: Animated.Value;
|
|
22
|
+
animateMinMaxIn: Animated.CompositeAnimation;
|
|
23
|
+
animateMinxMaxOut: Animated.CompositeAnimation;
|
|
24
|
+
hoverDateOpacity: Animated.Value;
|
|
25
|
+
animateHoverDateIn: Animated.CompositeAnimation;
|
|
26
|
+
animateHoverDateOut: Animated.CompositeAnimation;
|
|
27
|
+
compact: boolean;
|
|
28
|
+
gutter: ThemeVars.Space;
|
|
29
29
|
};
|
|
30
|
-
export declare const SparklineInteractiveProvider: React.MemoExoticComponent<
|
|
30
|
+
export declare const SparklineInteractiveProvider: React.MemoExoticComponent<
|
|
31
|
+
({
|
|
32
|
+
children,
|
|
33
|
+
compact,
|
|
34
|
+
gutter: propGutter,
|
|
35
|
+
}: SparklineInteractiveProviderProps) => import('react/jsx-runtime').JSX.Element
|
|
36
|
+
>;
|
|
31
37
|
export declare function useSparklineInteractiveContext(): SparklineInteractiveContextInterface;
|
|
32
38
|
export {};
|
|
33
|
-
//# sourceMappingURL=SparklineInteractiveProvider.d.ts.map
|
|
39
|
+
//# sourceMappingURL=SparklineInteractiveProvider.d.ts.map
|