@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DefaultScrubberBeaconLabel.d.ts","sourceRoot":"","sources":["../../../src/chart/scrubber/DefaultScrubberBeaconLabel.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAK3D,MAAM,MAAM,+BAA+B,GAAG,wBAAwB,GACpE,IAAI,CACF,cAAc,EACd,YAAY,GAAG,UAAU,GAAG,cAAc,GAAG,MAAM,GAAG,mBAAmB,GAAG,OAAO,GAAG,SAAS,CAChG,CAAC;AAEJ;;GAEG;AACH,eAAO,MAAM,0BAA0B,uEAkCtC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ScrubberLabelProps } from './Scrubber';
|
|
2
|
+
export type DefaultScrubberLabelProps = ScrubberLabelProps;
|
|
3
|
+
/**
|
|
4
|
+
* DefaultScrubberLabel is the default label component for the scrubber line.
|
|
5
|
+
* It will automatically add padding around the label when elevated to fit within chart bounds to prevent shadow from being cutoff.
|
|
6
|
+
* It will also center the label vertically with the top available area.
|
|
7
|
+
*/
|
|
8
|
+
export declare const DefaultScrubberLabel: import('react').NamedExoticComponent<
|
|
9
|
+
import('..').ReferenceLineLabelComponentProps
|
|
10
|
+
>;
|
|
11
|
+
//# sourceMappingURL=DefaultScrubberLabel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DefaultScrubberLabel.d.ts","sourceRoot":"","sources":["../../../src/chart/scrubber/DefaultScrubberLabel.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAErD,MAAM,MAAM,yBAAyB,GAAG,kBAAkB,CAAC;AAE3D;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,qFAahC,CAAC"}
|
|
@@ -1,25 +1,139 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type
|
|
3
|
-
import { type
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
import { type AnimatedProp, type SkParagraph } from '@shopify/react-native-skia';
|
|
3
|
+
import { type ReferenceLineBaseProps, type ReferenceLineLabelComponentProps } from '../line';
|
|
4
|
+
import type { ChartTextChildren, ChartTextProps } from '../text';
|
|
5
|
+
import { type ChartInset, type Series } from '../utils';
|
|
6
|
+
import type { Transition } from '../utils/transition';
|
|
7
|
+
import {
|
|
8
|
+
type ScrubberBeaconGroupBaseProps,
|
|
9
|
+
type ScrubberBeaconGroupProps,
|
|
10
|
+
type ScrubberBeaconGroupRef,
|
|
11
|
+
} from './ScrubberBeaconGroup';
|
|
12
|
+
import {
|
|
13
|
+
type ScrubberBeaconLabelGroupBaseProps,
|
|
14
|
+
type ScrubberBeaconLabelGroupProps,
|
|
15
|
+
} from './ScrubberBeaconLabelGroup';
|
|
16
|
+
export type ScrubberBeaconRef = {
|
|
17
|
+
/**
|
|
18
|
+
* Triggers a single pulse animation.
|
|
19
|
+
* Only works when the beacon is in idle state (not actively scrubbing).
|
|
20
|
+
*/
|
|
21
|
+
pulse: () => void;
|
|
22
|
+
};
|
|
23
|
+
export type ScrubberBeaconBaseProps = {
|
|
24
|
+
/**
|
|
25
|
+
* Id of the series.
|
|
26
|
+
*/
|
|
27
|
+
seriesId: Series['id'];
|
|
28
|
+
/**
|
|
29
|
+
* Color of the beacon.
|
|
30
|
+
*/
|
|
31
|
+
color?: AnimatedProp<string>;
|
|
32
|
+
/**
|
|
33
|
+
* X coordinate in data space.
|
|
34
|
+
*/
|
|
35
|
+
dataX: AnimatedProp<number>;
|
|
36
|
+
/**
|
|
37
|
+
* Y coordinate in data space.
|
|
38
|
+
*/
|
|
39
|
+
dataY: AnimatedProp<number>;
|
|
40
|
+
/**
|
|
41
|
+
* Whether the beacon is in idle state (not actively scrubbing).
|
|
42
|
+
*/
|
|
43
|
+
isIdle: AnimatedProp<boolean>;
|
|
44
|
+
/**
|
|
45
|
+
* Pulse the beacon while it is at rest.
|
|
46
|
+
*
|
|
47
|
+
* @note Only has an effect when `isIdle` is `true`. Pulse animations work
|
|
48
|
+
* regardless of the chart's `animate` prop.
|
|
49
|
+
*/
|
|
50
|
+
idlePulse?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Whether position animations are enabled.
|
|
53
|
+
* @default to ChartContext's animate value
|
|
54
|
+
*/
|
|
55
|
+
animate?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Opacity of the beacon.
|
|
58
|
+
* @default 1
|
|
59
|
+
*/
|
|
60
|
+
opacity?: AnimatedProp<number>;
|
|
61
|
+
/**
|
|
62
|
+
* Stroke color of the beacon circle.
|
|
63
|
+
* @default theme.color.bg
|
|
64
|
+
*/
|
|
65
|
+
stroke?: string;
|
|
66
|
+
};
|
|
67
|
+
export type ScrubberBeaconProps = ScrubberBeaconBaseProps & {
|
|
68
|
+
/**
|
|
69
|
+
* Transition configuration for beacon animations.
|
|
70
|
+
*/
|
|
71
|
+
transitions?: {
|
|
72
|
+
/**
|
|
73
|
+
* Transition for the initial enter/reveal animation.
|
|
74
|
+
* Set to `null` to disable.
|
|
75
|
+
*/
|
|
76
|
+
enter?: Transition | null;
|
|
77
|
+
/**
|
|
78
|
+
* Transition for subsequent data update animations.
|
|
79
|
+
* Set to `null` to disable.
|
|
80
|
+
*/
|
|
81
|
+
update?: Transition | null;
|
|
82
|
+
/**
|
|
83
|
+
* Transition used for the pulse animation.
|
|
84
|
+
* @default transition { type: 'timing', duration: 1600, easing: Easing.bezier(0.0, 0.0, 0.0, 1.0) }
|
|
85
|
+
*/
|
|
86
|
+
pulse?: Transition;
|
|
87
|
+
/**
|
|
88
|
+
* Delay, in milliseconds between pulse transitions
|
|
89
|
+
* when `idlePulse` is enabled.
|
|
90
|
+
* @default 400
|
|
91
|
+
*/
|
|
92
|
+
pulseRepeatDelay?: number;
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
export type ScrubberBeaconComponent = React.FC<
|
|
96
|
+
ScrubberBeaconProps & {
|
|
97
|
+
ref?: React.Ref<ScrubberBeaconRef>;
|
|
98
|
+
}
|
|
99
|
+
>;
|
|
100
|
+
export type ScrubberBeaconLabelProps = Pick<Series, 'color'> &
|
|
101
|
+
Pick<
|
|
102
|
+
ChartTextProps,
|
|
103
|
+
'x' | 'y' | 'dx' | 'horizontalAlignment' | 'onDimensionsChange' | 'opacity' | 'font'
|
|
104
|
+
> & {
|
|
105
|
+
/**
|
|
106
|
+
* Label for the series.
|
|
107
|
+
*/
|
|
108
|
+
label: ChartTextChildren;
|
|
109
|
+
/**
|
|
110
|
+
* Id of the series.
|
|
111
|
+
*/
|
|
112
|
+
seriesId: Series['id'];
|
|
113
|
+
};
|
|
114
|
+
export type ScrubberBeaconLabelComponent = React.FC<ScrubberBeaconLabelProps>;
|
|
115
|
+
export type ScrubberLabelProps = ReferenceLineLabelComponentProps;
|
|
116
|
+
export type ScrubberLabelComponent = React.FC<ScrubberLabelProps>;
|
|
117
|
+
export type ScrubberBaseProps = Pick<ScrubberBeaconGroupBaseProps, 'idlePulse'> &
|
|
118
|
+
Pick<ReferenceLineBaseProps, 'LineComponent' | 'LabelComponent' | 'labelElevated'> &
|
|
119
|
+
Pick<ScrubberBeaconGroupProps, 'BeaconComponent'> &
|
|
120
|
+
Pick<ScrubberBeaconLabelGroupProps, 'BeaconLabelComponent'> & {
|
|
11
121
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* By default, all series will be highlighted by the Scrubber.
|
|
122
|
+
* Array of series IDs to highlight when scrubbing with scrubber beacons.
|
|
123
|
+
* By default, all series will be highlighted.
|
|
15
124
|
*/
|
|
16
125
|
seriesIds?: string[];
|
|
17
126
|
/**
|
|
18
|
-
* Hides the
|
|
127
|
+
* Hides the beacon labels while keeping the line label visible (if provided).
|
|
128
|
+
*/
|
|
129
|
+
hideBeaconLabels?: boolean;
|
|
130
|
+
/**
|
|
131
|
+
* Hides the scrubber line.
|
|
132
|
+
* @note This hides Scrubber's ReferenceLine including the label.
|
|
19
133
|
*/
|
|
20
134
|
hideLine?: boolean;
|
|
21
135
|
/**
|
|
22
|
-
*
|
|
136
|
+
* Hides the overlay rect which obscures data beyond the scrubber position.
|
|
23
137
|
*/
|
|
24
138
|
hideOverlay?: boolean;
|
|
25
139
|
/**
|
|
@@ -28,48 +142,88 @@ export type ScrubberProps = SharedProps &
|
|
|
28
142
|
* @default 2
|
|
29
143
|
*/
|
|
30
144
|
overlayOffset?: number;
|
|
145
|
+
/**
|
|
146
|
+
* Minimum gap between beacon labels to prevent overlap.
|
|
147
|
+
* Measured in pixels.
|
|
148
|
+
*/
|
|
149
|
+
beaconLabelMinGap?: ScrubberBeaconLabelGroupBaseProps['labelMinGap'];
|
|
150
|
+
/**
|
|
151
|
+
* Horizontal offset for beacon labels from their beacon position.
|
|
152
|
+
* Measured in pixels.
|
|
153
|
+
*/
|
|
154
|
+
beaconLabelHorizontalOffset?: ScrubberBeaconLabelGroupBaseProps['labelHorizontalOffset'];
|
|
155
|
+
/**
|
|
156
|
+
* Preferred side for beacon labels.
|
|
157
|
+
* @note labels will switch to the opposite side if there's not enough space on the preferred side.
|
|
158
|
+
* @default 'right'
|
|
159
|
+
*/
|
|
160
|
+
beaconLabelPreferredSide?: ScrubberBeaconLabelGroupBaseProps['labelPreferredSide'];
|
|
31
161
|
/**
|
|
32
162
|
* Label text displayed above the scrubber line.
|
|
163
|
+
* Can be a static string or a function that receives the current dataIndex.
|
|
33
164
|
*/
|
|
34
|
-
label?:
|
|
165
|
+
label?: string | SkParagraph | ((dataIndex: number) => string | SkParagraph);
|
|
35
166
|
/**
|
|
36
|
-
*
|
|
167
|
+
* Font style for the scrubber line label.
|
|
37
168
|
*/
|
|
38
|
-
|
|
169
|
+
labelFont?: ChartTextProps['font'];
|
|
39
170
|
/**
|
|
40
|
-
*
|
|
171
|
+
* Bounds inset for the scrubber line label to prevent cutoff at chart edges.
|
|
172
|
+
* @default { top: 4, bottom: 20, left: 12, right: 12 } when labelElevated is true, otherwise none
|
|
41
173
|
*/
|
|
42
|
-
|
|
174
|
+
labelBoundsInset?: number | ChartInset;
|
|
43
175
|
/**
|
|
44
|
-
*
|
|
176
|
+
* Font style for the beacon labels.
|
|
45
177
|
*/
|
|
46
|
-
|
|
178
|
+
beaconLabelFont?: ChartTextProps['font'];
|
|
47
179
|
/**
|
|
48
|
-
*
|
|
180
|
+
* Stroke color for the scrubber line.
|
|
49
181
|
*/
|
|
50
|
-
|
|
182
|
+
lineStroke?: ReferenceLineBaseProps['stroke'];
|
|
183
|
+
/**
|
|
184
|
+
* Stroke color of the scrubber beacon circle.
|
|
185
|
+
* @default theme.color.bg
|
|
186
|
+
*/
|
|
187
|
+
beaconStroke?: string;
|
|
51
188
|
};
|
|
52
|
-
export type
|
|
189
|
+
export type ScrubberProps = ScrubberBaseProps & {
|
|
190
|
+
/**
|
|
191
|
+
* Transition configuration for the scrubber.
|
|
192
|
+
* Controls enter, update, and pulse animations for beacons and beacon labels.
|
|
193
|
+
*/
|
|
194
|
+
transitions?: ScrubberBeaconProps['transitions'];
|
|
195
|
+
/**
|
|
196
|
+
* Transition configuration for the scrubber beacon.
|
|
197
|
+
* @deprecated Use `transitions` instead.
|
|
198
|
+
*/
|
|
199
|
+
beaconTransitions?: ScrubberBeaconProps['transitions'];
|
|
200
|
+
};
|
|
201
|
+
export type ScrubberRef = ScrubberBeaconGroupRef;
|
|
53
202
|
/**
|
|
54
|
-
* Unified component that manages all scrubber elements (beacons, line, labels)
|
|
55
|
-
* with intelligent collision detection and consistent positioning.
|
|
203
|
+
* Unified component that manages all scrubber elements (beacons, line, labels).
|
|
56
204
|
*/
|
|
57
205
|
export declare const Scrubber: React.MemoExoticComponent<
|
|
58
206
|
React.ForwardRefExoticComponent<
|
|
59
|
-
|
|
60
|
-
Pick<
|
|
207
|
+
Pick<ScrubberBeaconGroupBaseProps, 'idlePulse'> &
|
|
208
|
+
Pick<ReferenceLineBaseProps, 'LabelComponent' | 'LineComponent' | 'labelElevated'> &
|
|
209
|
+
Pick<ScrubberBeaconGroupProps, 'BeaconComponent'> &
|
|
210
|
+
Pick<ScrubberBeaconLabelGroupProps, 'BeaconLabelComponent'> & {
|
|
61
211
|
/**
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
* By default, all series will be highlighted by the Scrubber.
|
|
212
|
+
* Array of series IDs to highlight when scrubbing with scrubber beacons.
|
|
213
|
+
* By default, all series will be highlighted.
|
|
65
214
|
*/
|
|
66
215
|
seriesIds?: string[];
|
|
67
216
|
/**
|
|
68
|
-
* Hides the
|
|
217
|
+
* Hides the beacon labels while keeping the line label visible (if provided).
|
|
218
|
+
*/
|
|
219
|
+
hideBeaconLabels?: boolean;
|
|
220
|
+
/**
|
|
221
|
+
* Hides the scrubber line.
|
|
222
|
+
* @note This hides Scrubber's ReferenceLine including the label.
|
|
69
223
|
*/
|
|
70
224
|
hideLine?: boolean;
|
|
71
225
|
/**
|
|
72
|
-
*
|
|
226
|
+
* Hides the overlay rect which obscures data beyond the scrubber position.
|
|
73
227
|
*/
|
|
74
228
|
hideOverlay?: boolean;
|
|
75
229
|
/**
|
|
@@ -78,27 +232,61 @@ export declare const Scrubber: React.MemoExoticComponent<
|
|
|
78
232
|
* @default 2
|
|
79
233
|
*/
|
|
80
234
|
overlayOffset?: number;
|
|
235
|
+
/**
|
|
236
|
+
* Minimum gap between beacon labels to prevent overlap.
|
|
237
|
+
* Measured in pixels.
|
|
238
|
+
*/
|
|
239
|
+
beaconLabelMinGap?: ScrubberBeaconLabelGroupBaseProps['labelMinGap'];
|
|
240
|
+
/**
|
|
241
|
+
* Horizontal offset for beacon labels from their beacon position.
|
|
242
|
+
* Measured in pixels.
|
|
243
|
+
*/
|
|
244
|
+
beaconLabelHorizontalOffset?: ScrubberBeaconLabelGroupBaseProps['labelHorizontalOffset'];
|
|
245
|
+
/**
|
|
246
|
+
* Preferred side for beacon labels.
|
|
247
|
+
* @note labels will switch to the opposite side if there's not enough space on the preferred side.
|
|
248
|
+
* @default 'right'
|
|
249
|
+
*/
|
|
250
|
+
beaconLabelPreferredSide?: ScrubberBeaconLabelGroupBaseProps['labelPreferredSide'];
|
|
81
251
|
/**
|
|
82
252
|
* Label text displayed above the scrubber line.
|
|
253
|
+
* Can be a static string or a function that receives the current dataIndex.
|
|
254
|
+
*/
|
|
255
|
+
label?: string | SkParagraph | ((dataIndex: number) => string | SkParagraph);
|
|
256
|
+
/**
|
|
257
|
+
* Font style for the scrubber line label.
|
|
258
|
+
*/
|
|
259
|
+
labelFont?: ChartTextProps['font'];
|
|
260
|
+
/**
|
|
261
|
+
* Bounds inset for the scrubber line label to prevent cutoff at chart edges.
|
|
262
|
+
* @default { top: 4, bottom: 20, left: 12, right: 12 } when labelElevated is true, otherwise none
|
|
83
263
|
*/
|
|
84
|
-
|
|
264
|
+
labelBoundsInset?: number | ChartInset;
|
|
85
265
|
/**
|
|
86
|
-
*
|
|
266
|
+
* Font style for the beacon labels.
|
|
87
267
|
*/
|
|
88
|
-
|
|
268
|
+
beaconLabelFont?: ChartTextProps['font'];
|
|
89
269
|
/**
|
|
90
270
|
* Stroke color for the scrubber line.
|
|
91
271
|
*/
|
|
92
|
-
lineStroke?:
|
|
272
|
+
lineStroke?: ReferenceLineBaseProps['stroke'];
|
|
273
|
+
/**
|
|
274
|
+
* Stroke color of the scrubber beacon circle.
|
|
275
|
+
* @default theme.color.bg
|
|
276
|
+
*/
|
|
277
|
+
beaconStroke?: string;
|
|
278
|
+
} & {
|
|
93
279
|
/**
|
|
94
|
-
*
|
|
280
|
+
* Transition configuration for the scrubber.
|
|
281
|
+
* Controls enter, update, and pulse animations for beacons and beacon labels.
|
|
95
282
|
*/
|
|
96
|
-
|
|
283
|
+
transitions?: ScrubberBeaconProps['transitions'];
|
|
97
284
|
/**
|
|
98
|
-
*
|
|
285
|
+
* Transition configuration for the scrubber beacon.
|
|
286
|
+
* @deprecated Use `transitions` instead.
|
|
99
287
|
*/
|
|
100
|
-
|
|
101
|
-
} & React.RefAttributes<
|
|
288
|
+
beaconTransitions?: ScrubberBeaconProps['transitions'];
|
|
289
|
+
} & React.RefAttributes<ScrubberBeaconGroupRef>
|
|
102
290
|
>
|
|
103
291
|
>;
|
|
104
292
|
//# sourceMappingURL=Scrubber.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Scrubber.d.ts","sourceRoot":"","sources":["../../../src/chart/scrubber/Scrubber.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Scrubber.d.ts","sourceRoot":"","sources":["../../../src/chart/scrubber/Scrubber.tsx"],"names":[],"mappings":"AAAA,OAAO,KAON,MAAM,OAAO,CAAC;AAQf,OAAO,EAAE,KAAK,YAAY,EAAe,KAAK,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAG9F,OAAO,EAEL,KAAK,sBAAsB,EAC3B,KAAK,gCAAgC,EACtC,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACjE,OAAO,EACL,KAAK,UAAU,EAIf,KAAK,MAAM,EAEZ,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAKtD,OAAO,EAEL,KAAK,4BAA4B,EACjC,KAAK,wBAAwB,EAC7B,KAAK,sBAAsB,EAC5B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAEL,KAAK,iCAAiC,EACtC,KAAK,6BAA6B,EACnC,MAAM,4BAA4B,CAAC;AAEpC,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;;OAGG;IACH,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACpC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IACvB;;OAEG;IACH,KAAK,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IAC7B;;OAEG;IACH,KAAK,EAAE,YAAY,CAAC,MAA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|
+
* Triggers a pulse animation on all beacons.
|
|
5
|
+
*/
|
|
6
|
+
pulse: () => void;
|
|
7
|
+
};
|
|
8
|
+
export type ScrubberBeaconGroupBaseProps = {
|
|
9
|
+
/**
|
|
10
|
+
* Array of series IDs to render beacons for.
|
|
11
|
+
*/
|
|
12
|
+
seriesIds: string[];
|
|
13
|
+
/**
|
|
14
|
+
* Pulse the beacons while at rest.
|
|
15
|
+
*/
|
|
16
|
+
idlePulse?: boolean;
|
|
17
|
+
};
|
|
18
|
+
export type ScrubberBeaconGroupProps = ScrubberBeaconGroupBaseProps & {
|
|
19
|
+
/**
|
|
20
|
+
* Transition configuration for beacon animations.
|
|
21
|
+
*/
|
|
22
|
+
transitions?: ScrubberBeaconProps['transitions'];
|
|
23
|
+
/**
|
|
24
|
+
* Custom component for the scrubber beacon.
|
|
25
|
+
* @default DefaultScrubberBeacon
|
|
26
|
+
*/
|
|
27
|
+
BeaconComponent?: ScrubberBeaconComponent;
|
|
28
|
+
/**
|
|
29
|
+
* Stroke color of the beacon circle.
|
|
30
|
+
* @default theme.color.bg
|
|
31
|
+
*/
|
|
32
|
+
stroke?: string;
|
|
33
|
+
};
|
|
34
|
+
export declare const ScrubberBeaconGroup: import('react').MemoExoticComponent<
|
|
35
|
+
import('react').ForwardRefExoticComponent<
|
|
36
|
+
ScrubberBeaconGroupBaseProps & {
|
|
37
|
+
/**
|
|
38
|
+
* Transition configuration for beacon animations.
|
|
39
|
+
*/
|
|
40
|
+
transitions?: ScrubberBeaconProps['transitions'];
|
|
41
|
+
/**
|
|
42
|
+
* Custom component for the scrubber beacon.
|
|
43
|
+
* @default DefaultScrubberBeacon
|
|
44
|
+
*/
|
|
45
|
+
BeaconComponent?: ScrubberBeaconComponent;
|
|
46
|
+
/**
|
|
47
|
+
* Stroke color of the beacon circle.
|
|
48
|
+
* @default theme.color.bg
|
|
49
|
+
*/
|
|
50
|
+
stroke?: string;
|
|
51
|
+
} & import('react').RefAttributes<ScrubberBeaconGroupRef>
|
|
52
|
+
>
|
|
53
|
+
>;
|
|
54
|
+
//# sourceMappingURL=ScrubberBeaconGroup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScrubberBeaconGroup.d.ts","sourceRoot":"","sources":["../../../src/chart/scrubber/ScrubberBeaconGroup.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,uBAAuB,EAAE,mBAAmB,EAAqB,MAAM,YAAY,CAAC;AAmHlG,MAAM,MAAM,sBAAsB,GAAG;IACnC;;OAEG;IACH,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG;IACzC;;OAEG;IACH,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,4BAA4B,GAAG;IACpE;;OAEG;IACH,WAAW,CAAC,EAAE,mBAAmB,CAAC,aAAa,CAAC,CAAC;IACjD;;;OAGG;IACH,eAAe,CAAC,EAAE,uBAAuB,CAAC;IAC1C;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,eAAO,MAAM,mBAAmB;IAhB9B;;OAEG;kBACW,mBAAmB,CAAC,aAAa,CAAC;IAChD;;;OAGG;sBACe,uBAAuB;IACzC;;;OAGG;aACM,MAAM;2DAyEhB,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { ChartTextProps } from '../text';
|
|
2
|
+
import { type ScrubberLabelPosition } from '../utils/scrubber';
|
|
3
|
+
import type {
|
|
4
|
+
ScrubberBeaconLabelComponent,
|
|
5
|
+
ScrubberBeaconLabelProps,
|
|
6
|
+
ScrubberBeaconProps,
|
|
7
|
+
} from './Scrubber';
|
|
8
|
+
export type ScrubberBeaconLabelGroupBaseProps = {
|
|
9
|
+
/**
|
|
10
|
+
* Labels to be displayed.
|
|
11
|
+
*/
|
|
12
|
+
labels: Array<Pick<ScrubberBeaconLabelProps, 'seriesId' | 'label' | 'color'>>;
|
|
13
|
+
/**
|
|
14
|
+
* Minimum gap between labels in pixels.
|
|
15
|
+
* @default 4
|
|
16
|
+
*/
|
|
17
|
+
labelMinGap?: number;
|
|
18
|
+
/**
|
|
19
|
+
* Horizontal offset of labels from the scrubber line in pixels.
|
|
20
|
+
* @default 16
|
|
21
|
+
*/
|
|
22
|
+
labelHorizontalOffset?: number;
|
|
23
|
+
/**
|
|
24
|
+
* Font style for the beacon labels.
|
|
25
|
+
*/
|
|
26
|
+
labelFont?: ChartTextProps['font'];
|
|
27
|
+
/**
|
|
28
|
+
* Preferred side for labels.
|
|
29
|
+
* @note labels will switch to the opposite side if there's not enough space on the preferred side.
|
|
30
|
+
* @default 'right'
|
|
31
|
+
*/
|
|
32
|
+
labelPreferredSide?: ScrubberLabelPosition;
|
|
33
|
+
};
|
|
34
|
+
export type ScrubberBeaconLabelGroupProps = ScrubberBeaconLabelGroupBaseProps & {
|
|
35
|
+
/**
|
|
36
|
+
* Custom component to render as a scrubber beacon label.
|
|
37
|
+
* @default DefaultScrubberBeaconLabel
|
|
38
|
+
*/
|
|
39
|
+
BeaconLabelComponent?: ScrubberBeaconLabelComponent;
|
|
40
|
+
/**
|
|
41
|
+
* Transition configuration for beacon label animations.
|
|
42
|
+
*/
|
|
43
|
+
transitions?: ScrubberBeaconProps['transitions'];
|
|
44
|
+
};
|
|
45
|
+
export declare const ScrubberBeaconLabelGroup: import('react').NamedExoticComponent<ScrubberBeaconLabelGroupProps>;
|
|
46
|
+
//# sourceMappingURL=ScrubberBeaconLabelGroup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScrubberBeaconLabelGroup.d.ts","sourceRoot":"","sources":["../../../src/chart/scrubber/ScrubberBeaconLabelGroup.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAqB,cAAc,EAAE,MAAM,SAAS,CAAC;AAEjE,OAAO,EAKL,KAAK,qBAAqB,EAC3B,MAAM,mBAAmB,CAAC;AAS3B,OAAO,KAAK,EACV,4BAA4B,EAC5B,wBAAwB,EACxB,mBAAmB,EACpB,MAAM,YAAY,CAAC;AA4EpB,MAAM,MAAM,iCAAiC,GAAG;IAC9C;;OAEG;IACH,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,wBAAwB,EAAE,UAAU,GAAG,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC;IAC9E;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B;;OAEG;IACH,SAAS,CAAC,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;IACnC;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,qBAAqB,CAAC;CAC5C,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG,iCAAiC,GAAG;IAC9E;;;OAGG;IACH,oBAAoB,CAAC,EAAE,4BAA4B,CAAC;IACpD;;OAEG;IACH,WAAW,CAAC,EAAE,mBAAmB,CAAC,aAAa,CAAC,CAAC;CAClD,CAAC;AAEF,eAAO,MAAM,wBAAwB,qEAoMpC,CAAC"}
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type ScrubberContextValue } from '../utils';
|
|
3
|
-
export type ScrubberProviderProps = Partial<
|
|
4
|
-
Pick<ScrubberContextValue, 'enableScrubbing' | 'onScrubberPositionChange'>
|
|
5
|
-
> & {
|
|
3
|
+
export type ScrubberProviderProps = Partial<Pick<ScrubberContextValue, 'enableScrubbing'>> & {
|
|
6
4
|
children: React.ReactNode;
|
|
7
5
|
/**
|
|
8
6
|
* Allows continuous gestures on the chart to continue outside the bounds of the chart element.
|
|
9
7
|
*/
|
|
10
8
|
allowOverflowGestures?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Callback fired when the scrubber position changes.
|
|
11
|
+
* Receives the dataIndex of the scrubber or undefined when not scrubbing.
|
|
12
|
+
*/
|
|
13
|
+
onScrubberPositionChange?: (index: number | undefined) => void;
|
|
11
14
|
};
|
|
12
15
|
/**
|
|
13
16
|
* A component which encapsulates the ScrubberContext.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScrubberProvider.d.ts","sourceRoot":"","sources":["../../../src/chart/scrubber/ScrubberProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"ScrubberProvider.d.ts","sourceRoot":"","sources":["../../../src/chart/scrubber/ScrubberProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+B,MAAM,OAAO,CAAC;AAOpD,OAAO,EAA4C,KAAK,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAG/F,MAAM,MAAM,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,oBAAoB,EAAE,iBAAiB,CAAC,CAAC,GAAG;IAC3F,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;OAEG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC;;;OAGG;IACH,wBAAwB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;CAChE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAsJ5D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/chart/scrubber/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/chart/scrubber/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wBAAwB,CAAC;AACvC,cAAc,YAAY,CAAC"}
|