@coinbase/cds-web-visualization 3.3.0 → 3.3.2
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 +25 -0
- package/dts/index.d.ts +1 -1
- package/dts/sparkline/Counter.d.ts +7 -2
- package/dts/sparkline/Sparkline.d.ts +26 -16
- package/dts/sparkline/SparklineArea.d.ts +8 -4
- package/dts/sparkline/SparklineAreaPattern.d.ts +7 -4
- package/dts/sparkline/SparklineGradient.d.ts +16 -10
- package/dts/sparkline/SparklinePath.d.ts +8 -6
- package/dts/sparkline/__figma__/Sparkline.figma.d.ts +1 -1
- package/dts/sparkline/generateSparklineWithId.d.ts +7 -2
- package/dts/sparkline/index.d.ts +1 -1
- package/dts/sparkline/sparkline-interactive/InnerSparklineInteractiveProvider.d.ts +9 -5
- package/dts/sparkline/sparkline-interactive/SparklineInteractive.d.ts +159 -118
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveAnimatedPath.d.ts +19 -9
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveHoverDate.d.ts +4 -2
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveHoverPrice.d.ts +4 -2
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveLineVertical.d.ts +5 -3
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveMarkerDates.d.ts +11 -6
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveMarkerDates.d.ts.map +1 -1
- package/dts/sparkline/sparkline-interactive/SparklineInteractivePaths.d.ts +20 -7
- package/dts/sparkline/sparkline-interactive/SparklineInteractivePeriodSelector.d.ts +21 -16
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveProvider.d.ts +17 -12
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveScrubHandler.d.ts +23 -10
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveScrubProvider.d.ts +12 -12
- 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/fade.d.ts +1 -1
- package/dts/sparkline/sparkline-interactive/useSparklineInteractiveConstants.d.ts +11 -11
- package/dts/sparkline/sparkline-interactive-header/SparklineInteractiveHeader.d.ts +101 -93
- package/dts/sparkline/sparkline-interactive-header/__figma__/SparklineInteractiveHeader.figma.d.ts +1 -1
- package/esm/sparkline/sparkline-interactive/SparklineInteractiveMarkerDates.js +8 -4
- package/package.json +11 -11
- package/dts/sparkline/sparkline-interactive/__stories__/SparklineInteractive.stories.d.ts +0 -374
- 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__/SparklineInteractivePeriodSelector.test.d.ts +0 -2
- package/dts/sparkline/sparkline-interactive/__tests__/SparklineInteractivePeriodSelector.test.d.ts.map +0 -1
- package/dts/sparkline/sparkline-interactive-header/__stories__/SparklineInteractiveHeader.stories.d.ts +0 -87
- 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/CHANGELOG.md
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# @coinbase/cds-web-visualization
|
|
2
|
+
|
|
3
|
+
> [NPM registry](https://www.npmjs.com/package/@coinbase/cds-web-visualization)
|
|
4
|
+
|
|
5
|
+
All notable changes to this project will be documented in this file.
|
|
6
|
+
|
|
7
|
+
`@coinbase/cds-web-visualization` adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
8
|
+
|
|
9
|
+
<!-- template-start -->
|
|
10
|
+
|
|
11
|
+
## 3.3.2 (10/1/2025 PST)
|
|
12
|
+
|
|
13
|
+
#### 🐞 Fixes
|
|
14
|
+
|
|
15
|
+
- Factor sparkline container offset in axis label calculations. [[#87](https://github.com/coinbase/cds/pull/87)]
|
|
16
|
+
|
|
17
|
+
## 3.3.1 (10/1/2025 PST)
|
|
18
|
+
|
|
19
|
+
#### 🐞 Fixes
|
|
20
|
+
|
|
21
|
+
- Update links for new repo. [[#42](https://github.com/coinbase/cds/pull/42)]
|
|
22
|
+
|
|
23
|
+
## 3.3.0 (9/18/2025 PST)
|
|
24
|
+
|
|
25
|
+
- Prepare for open source release.
|
package/dts/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from './sparkline';
|
|
2
|
-
//# sourceMappingURL=index.d.ts.map
|
|
2
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
import type { CounterBaseProps } from '@coinbase/cds-web/visualizations/Counter';
|
|
2
|
-
export declare const Counter: ({
|
|
3
|
-
|
|
2
|
+
export declare const Counter: ({
|
|
3
|
+
startNum,
|
|
4
|
+
endNum,
|
|
5
|
+
renderNum,
|
|
6
|
+
durationInMillis,
|
|
7
|
+
}: CounterBaseProps) => import('react/jsx-runtime').JSX.Element;
|
|
8
|
+
//# sourceMappingURL=Counter.d.ts.map
|
|
@@ -2,21 +2,31 @@ import React from 'react';
|
|
|
2
2
|
import type { ElementChildren, SharedProps } from '@coinbase/cds-common/types';
|
|
3
3
|
import type { SparklineAreaBaseProps } from './SparklineArea';
|
|
4
4
|
export type SparklineBaseProps = SharedProps & {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
5
|
+
/** @danger Use this only if the background color beneath the Sparkline is a non-CDS color. It ensures an accessible contrast by returning either white or black when color is set to 'auto'. Accepts any valid color format (hex, RGB, RGBA). */
|
|
6
|
+
background?: string;
|
|
7
|
+
/** The color of the Sparkline graph's line. Accepts any raw color value (hex, rgba, hsl, etc) or 'auto'. Using 'auto' dynamically selects black or white for optimal accessibility. Does not work with CDS theme color names like 'fgPrimary' or CSS variables. */
|
|
8
|
+
color: string;
|
|
9
|
+
/** Height of the Sparkline */
|
|
10
|
+
height: number;
|
|
11
|
+
/** Svg path as string. CDS offers a `useSparklinePath` which is useful to generate this string. This is accessible via `import { useSparklinePath } from '@coinbase/cds-common/visualizations/useSparklinePath';`. Alternatively, you can use product tailored tooling to generate the SVG path. This component only requires a valid path string is provided. */
|
|
12
|
+
path?: string;
|
|
13
|
+
/** Width of the Sparkline */
|
|
14
|
+
width: number;
|
|
15
|
+
/** an optional SparklineArea that can be used to fill in the Sparkline */
|
|
16
|
+
children?: ElementChildren<SparklineAreaBaseProps>;
|
|
17
|
+
/** 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. */
|
|
18
|
+
yAxisScalingFactor?: number;
|
|
19
19
|
};
|
|
20
20
|
export type SparklineProps = SparklineBaseProps;
|
|
21
|
-
export declare const Sparkline: React.MemoExoticComponent<
|
|
22
|
-
|
|
21
|
+
export declare const Sparkline: React.MemoExoticComponent<
|
|
22
|
+
({
|
|
23
|
+
background,
|
|
24
|
+
color,
|
|
25
|
+
height,
|
|
26
|
+
path,
|
|
27
|
+
width,
|
|
28
|
+
yAxisScalingFactor,
|
|
29
|
+
children,
|
|
30
|
+
}: SparklineBaseProps) => import('react/jsx-runtime').JSX.Element
|
|
31
|
+
>;
|
|
32
|
+
//# sourceMappingURL=Sparkline.d.ts.map
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export type SparklineAreaBaseProps = {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
area?: string;
|
|
4
|
+
patternId?: string;
|
|
5
5
|
};
|
|
6
|
-
export declare const SparklineArea: React.MemoExoticComponent<
|
|
7
|
-
|
|
6
|
+
export declare const SparklineArea: React.MemoExoticComponent<
|
|
7
|
+
React.ForwardRefExoticComponent<
|
|
8
|
+
SparklineAreaBaseProps & React.RefAttributes<SVGPathElement | null>
|
|
9
|
+
>
|
|
10
|
+
>;
|
|
11
|
+
//# sourceMappingURL=SparklineArea.d.ts.map
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
export type SparklineAreaPatternBaseProps = {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
color: string;
|
|
3
|
+
id: string;
|
|
4
4
|
};
|
|
5
|
-
export declare const SparklineAreaPattern: ({
|
|
6
|
-
|
|
5
|
+
export declare const SparklineAreaPattern: ({
|
|
6
|
+
color,
|
|
7
|
+
id,
|
|
8
|
+
}: SparklineAreaPatternBaseProps) => import('react/jsx-runtime').JSX.Element;
|
|
9
|
+
//# sourceMappingURL=SparklineAreaPattern.d.ts.map
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { SparklinePathRef } from './SparklinePath';
|
|
3
|
-
export declare const SparklineGradient: React.MemoExoticComponent<
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
3
|
+
export declare const SparklineGradient: React.MemoExoticComponent<
|
|
4
|
+
React.ForwardRefExoticComponent<
|
|
5
|
+
import('@coinbase/cds-common').SharedProps & {
|
|
6
|
+
background?: string;
|
|
7
|
+
color: string;
|
|
8
|
+
height: number;
|
|
9
|
+
path?: string;
|
|
10
|
+
width: number;
|
|
11
|
+
children?: import('@coinbase/cds-common').ElementChildren<
|
|
12
|
+
import('./SparklineArea').SparklineAreaBaseProps
|
|
13
|
+
>;
|
|
14
|
+
yAxisScalingFactor?: number;
|
|
15
|
+
} & React.RefAttributes<SparklinePathRef>
|
|
16
|
+
>
|
|
17
|
+
>;
|
|
18
|
+
//# sourceMappingURL=SparklineGradient.d.ts.map
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export type SparklinePathRef = SVGPathElement | null;
|
|
3
3
|
export type SparklinePathBaseProps = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
/** The svg string path that is generate via useSparklinePath */
|
|
5
|
+
path?: string;
|
|
6
|
+
/** Color of the stroke for the path. */
|
|
7
|
+
stroke: string;
|
|
8
8
|
};
|
|
9
|
-
export declare const SparklinePath: React.MemoExoticComponent<
|
|
10
|
-
|
|
9
|
+
export declare const SparklinePath: React.MemoExoticComponent<
|
|
10
|
+
React.ForwardRefExoticComponent<SparklinePathBaseProps & React.RefAttributes<SparklinePathRef>>
|
|
11
|
+
>;
|
|
12
|
+
//# sourceMappingURL=SparklinePath.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export {};
|
|
2
|
-
//# sourceMappingURL=Sparkline.figma.d.ts.map
|
|
2
|
+
//# sourceMappingURL=Sparkline.figma.d.ts.map
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import type { ElementChildren } from '@coinbase/cds-common/types';
|
|
3
3
|
import type { SparklineAreaBaseProps } from './SparklineArea';
|
|
4
|
-
export declare function generateSparklineAreaWithId(
|
|
5
|
-
|
|
4
|
+
export declare function generateSparklineAreaWithId(
|
|
5
|
+
id: string,
|
|
6
|
+
children: ElementChildren<SparklineAreaBaseProps>,
|
|
7
|
+
):
|
|
8
|
+
| React.ReactElement<SparklineAreaBaseProps, string | React.JSXElementConstructor<any>>
|
|
9
|
+
| undefined;
|
|
10
|
+
//# sourceMappingURL=generateSparklineWithId.d.ts.map
|
package/dts/sparkline/index.d.ts
CHANGED
|
@@ -3,4 +3,4 @@ export * from './sparkline-interactive/SparklineInteractive';
|
|
|
3
3
|
export * from './sparkline-interactive-header/SparklineInteractiveHeader';
|
|
4
4
|
export * from './SparklineArea';
|
|
5
5
|
export * from './SparklineGradient';
|
|
6
|
-
//# sourceMappingURL=index.d.ts.map
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
type InnerSparklineInteractiveProviderProps = {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
width: number;
|
|
4
|
+
height: number;
|
|
5
|
+
children: React.ReactNode;
|
|
6
6
|
};
|
|
7
|
-
export declare const InnerSparklineInteractiveProvider: ({
|
|
7
|
+
export declare const InnerSparklineInteractiveProvider: ({
|
|
8
|
+
width,
|
|
9
|
+
height,
|
|
10
|
+
children,
|
|
11
|
+
}: InnerSparklineInteractiveProviderProps) => import('react/jsx-runtime').JSX.Element;
|
|
8
12
|
export {};
|
|
9
|
-
//# sourceMappingURL=InnerSparklineInteractiveProvider.d.ts.map
|
|
13
|
+
//# sourceMappingURL=InnerSparklineInteractiveProvider.d.ts.map
|
|
@@ -1,110 +1,120 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ThemeVars } from '@coinbase/cds-common/core/theme';
|
|
3
|
-
import type {
|
|
3
|
+
import type {
|
|
4
|
+
ChartData,
|
|
5
|
+
ChartFormatDate,
|
|
6
|
+
ChartScrubParams,
|
|
7
|
+
ChartTimeseries,
|
|
8
|
+
Placement,
|
|
9
|
+
} from '@coinbase/cds-common/types';
|
|
4
10
|
export * from '@coinbase/cds-common/types/Chart';
|
|
5
|
-
export type SparklineInteractiveDefaultFallback = Pick<
|
|
11
|
+
export type SparklineInteractiveDefaultFallback = Pick<
|
|
12
|
+
SparklineInteractiveBaseProps<string>,
|
|
13
|
+
'fallbackType' | 'compact'
|
|
14
|
+
>;
|
|
6
15
|
export type SparklineInteractiveBaseProps<Period extends string> = {
|
|
7
|
-
|
|
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
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Chart data bucketed by Period. Period is a string key
|
|
18
|
+
*/
|
|
19
|
+
data?: Record<Period, ChartData>;
|
|
20
|
+
/**
|
|
21
|
+
* 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.
|
|
22
|
+
*/
|
|
23
|
+
periods: {
|
|
24
|
+
label: string;
|
|
25
|
+
value: Period;
|
|
26
|
+
}[];
|
|
27
|
+
/**
|
|
28
|
+
* default period value that the chart will use
|
|
29
|
+
*/
|
|
30
|
+
defaultPeriod: Period;
|
|
31
|
+
/**
|
|
32
|
+
* Callback when the user selects a new period.
|
|
33
|
+
*/
|
|
34
|
+
onPeriodChanged?: (period: Period) => void;
|
|
35
|
+
/**
|
|
36
|
+
* Callback when the user starts scrubbing
|
|
37
|
+
*/
|
|
38
|
+
onScrubStart?: () => void;
|
|
39
|
+
/**
|
|
40
|
+
* Callback when a user finishes scrubbing
|
|
41
|
+
*/
|
|
42
|
+
onScrubEnd?: () => void;
|
|
43
|
+
/**
|
|
44
|
+
* Callback used when the user is scrubbing. This will be called for every data point change.
|
|
45
|
+
*/
|
|
46
|
+
onScrub?: (params: ChartScrubParams<Period>) => void;
|
|
47
|
+
/**
|
|
48
|
+
* Disables the scrub user interaction from the chart
|
|
49
|
+
*
|
|
50
|
+
* @default false
|
|
51
|
+
*/
|
|
52
|
+
disableScrubbing?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* function used to format the date that is shown in the bottom of the chart as the user scrubs
|
|
55
|
+
*/
|
|
56
|
+
formatDate: ChartFormatDate<Period>;
|
|
57
|
+
/**
|
|
58
|
+
* Color of the line*
|
|
59
|
+
*/
|
|
60
|
+
strokeColor: string;
|
|
61
|
+
/**
|
|
62
|
+
* Fallback shown in the chart when data is not available. This is usually a loading state.
|
|
63
|
+
*/
|
|
64
|
+
fallback?: React.ReactNode;
|
|
65
|
+
/**
|
|
66
|
+
* If you use the default fallback then this specifies if the fallback line is decreasing or increasing
|
|
67
|
+
*/
|
|
68
|
+
fallbackType?: 'positive' | 'negative';
|
|
69
|
+
/**
|
|
70
|
+
* Show the chart in compact height
|
|
71
|
+
*
|
|
72
|
+
* @default false
|
|
73
|
+
*/
|
|
74
|
+
compact?: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Hides the period selector at the bottom of the chart
|
|
77
|
+
*
|
|
78
|
+
* @default false
|
|
79
|
+
*/
|
|
80
|
+
hidePeriodSelector?: boolean;
|
|
81
|
+
/**
|
|
82
|
+
* Adds an area fill to the Sparkline
|
|
83
|
+
*
|
|
84
|
+
* @default true
|
|
85
|
+
*/
|
|
86
|
+
fill?: boolean;
|
|
87
|
+
/**
|
|
79
88
|
Formats the date above the chart as you scrub. Omit this if you don't want to show the date as the user scrubs
|
|
80
89
|
*/
|
|
81
|
-
|
|
82
|
-
|
|
90
|
+
formatHoverDate?: (date: Date, period: Period) => string;
|
|
91
|
+
/**
|
|
83
92
|
Formats the price above the chart as you scrub. Omit this if you don't want to show the price as the user scrubs
|
|
84
93
|
*/
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
94
|
+
formatHoverPrice?: (price: number) => string;
|
|
95
|
+
/**
|
|
96
|
+
* Adds a header node above the chart. It will be placed next to the period selector on web.
|
|
97
|
+
*/
|
|
98
|
+
headerNode?: React.ReactNode;
|
|
99
|
+
/**
|
|
100
|
+
* Optional data to show on hover/scrub instead of the original sparkline. This allows multiple timeseries lines.
|
|
101
|
+
*
|
|
102
|
+
* Period => timeseries list
|
|
103
|
+
*/
|
|
104
|
+
hoverData?: Record<Period, ChartTimeseries[]>;
|
|
105
|
+
/**
|
|
106
|
+
* Optional gutter to add to the Period selector. This is useful if you choose to use the full screen width for the chart
|
|
107
|
+
*/
|
|
108
|
+
timePeriodGutter?: ThemeVars.Space;
|
|
109
|
+
/**
|
|
110
|
+
* Optional placement prop that position the period selector component above or below the chart
|
|
111
|
+
*/
|
|
112
|
+
periodSelectorPlacement?: Extract<Placement, 'above' | 'below'>;
|
|
113
|
+
/** 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. */
|
|
114
|
+
yAxisScalingFactor?: number;
|
|
106
115
|
};
|
|
107
|
-
export type SparklineInteractiveProps<Period extends string> =
|
|
116
|
+
export type SparklineInteractiveProps<Period extends string> =
|
|
117
|
+
SparklineInteractiveBaseProps<Period> & {
|
|
108
118
|
/**
|
|
109
119
|
* Custom class name for the root element.
|
|
110
120
|
*/
|
|
@@ -113,14 +123,14 @@ export type SparklineInteractiveProps<Period extends string> = SparklineInteract
|
|
|
113
123
|
* Custom class names for the component.
|
|
114
124
|
*/
|
|
115
125
|
classNames?: {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
126
|
+
/**
|
|
127
|
+
* Custom class name for the header node.
|
|
128
|
+
*/
|
|
129
|
+
header?: string;
|
|
130
|
+
/**
|
|
131
|
+
* Custom class name for the root element.
|
|
132
|
+
*/
|
|
133
|
+
root?: string;
|
|
124
134
|
};
|
|
125
135
|
/**
|
|
126
136
|
* Custom styles for the root element.
|
|
@@ -130,20 +140,51 @@ export type SparklineInteractiveProps<Period extends string> = SparklineInteract
|
|
|
130
140
|
* Custom styles for the component.
|
|
131
141
|
*/
|
|
132
142
|
styles?: {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
143
|
+
/**
|
|
144
|
+
* Custom style for the header node.
|
|
145
|
+
*/
|
|
146
|
+
header?: React.CSSProperties;
|
|
147
|
+
/**
|
|
148
|
+
* Custom style for the root element.
|
|
149
|
+
*/
|
|
150
|
+
root?: React.CSSProperties;
|
|
141
151
|
};
|
|
142
152
|
/** Test ID for the header */
|
|
143
153
|
headerTestID?: string;
|
|
144
|
-
};
|
|
145
|
-
declare function SparklineInteractiveContentWithGeneric<Period extends string>({
|
|
154
|
+
};
|
|
155
|
+
declare function SparklineInteractiveContentWithGeneric<Period extends string>({
|
|
156
|
+
data,
|
|
157
|
+
periods,
|
|
158
|
+
defaultPeriod,
|
|
159
|
+
onPeriodChanged,
|
|
160
|
+
strokeColor,
|
|
161
|
+
onScrub,
|
|
162
|
+
onScrubStart,
|
|
163
|
+
onScrubEnd,
|
|
164
|
+
formatDate,
|
|
165
|
+
fallback,
|
|
166
|
+
hidePeriodSelector,
|
|
167
|
+
disableScrubbing,
|
|
168
|
+
fill,
|
|
169
|
+
yAxisScalingFactor,
|
|
170
|
+
compact,
|
|
171
|
+
formatHoverDate,
|
|
172
|
+
formatHoverPrice,
|
|
173
|
+
headerNode,
|
|
174
|
+
fallbackType,
|
|
175
|
+
timePeriodGutter,
|
|
176
|
+
hoverData,
|
|
177
|
+
periodSelectorPlacement,
|
|
178
|
+
className,
|
|
179
|
+
classNames,
|
|
180
|
+
style,
|
|
181
|
+
styles,
|
|
182
|
+
headerTestID,
|
|
183
|
+
}: SparklineInteractiveProps<Period>): import('react/jsx-runtime').JSX.Element;
|
|
146
184
|
export declare const SparklineInteractiveContent: typeof SparklineInteractiveContentWithGeneric;
|
|
147
|
-
declare function SparklineInteractiveWithGeneric<Period extends string>({
|
|
185
|
+
declare function SparklineInteractiveWithGeneric<Period extends string>({
|
|
186
|
+
compact,
|
|
187
|
+
...props
|
|
188
|
+
}: SparklineInteractiveProps<Period>): import('react/jsx-runtime').JSX.Element;
|
|
148
189
|
export declare const SparklineInteractive: typeof SparklineInteractiveWithGeneric;
|
|
149
|
-
//# sourceMappingURL=SparklineInteractive.d.ts.map
|
|
190
|
+
//# sourceMappingURL=SparklineInteractive.d.ts.map
|
|
@@ -1,13 +1,23 @@
|
|
|
1
1
|
import 'd3-transition';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
export type SparklineInteractiveAnimatedPathProps = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
d: string;
|
|
5
|
+
color: string;
|
|
6
|
+
area?: string;
|
|
7
|
+
selectedPeriod: string;
|
|
8
|
+
yAxisScalingFactor?: number;
|
|
9
|
+
initialPath?: string;
|
|
10
|
+
initialArea?: string;
|
|
11
11
|
};
|
|
12
|
-
export declare const SparklineInteractiveAnimatedPath: React.MemoExoticComponent<
|
|
13
|
-
|
|
12
|
+
export declare const SparklineInteractiveAnimatedPath: React.MemoExoticComponent<
|
|
13
|
+
({
|
|
14
|
+
d,
|
|
15
|
+
color,
|
|
16
|
+
selectedPeriod,
|
|
17
|
+
area,
|
|
18
|
+
yAxisScalingFactor,
|
|
19
|
+
initialPath,
|
|
20
|
+
initialArea,
|
|
21
|
+
}: SparklineInteractiveAnimatedPathProps) => import('react/jsx-runtime').JSX.Element
|
|
22
|
+
>;
|
|
23
|
+
//# sourceMappingURL=SparklineInteractiveAnimatedPath.d.ts.map
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare const SparklineInteractiveHoverDate: React.MemoExoticComponent<
|
|
3
|
-
|
|
2
|
+
export declare const SparklineInteractiveHoverDate: React.MemoExoticComponent<
|
|
3
|
+
() => import('react/jsx-runtime').JSX.Element
|
|
4
|
+
>;
|
|
5
|
+
//# sourceMappingURL=SparklineInteractiveHoverDate.d.ts.map
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare const SparklineInteractiveHoverPrice: React.MemoExoticComponent<
|
|
3
|
-
|
|
2
|
+
export declare const SparklineInteractiveHoverPrice: React.MemoExoticComponent<
|
|
3
|
+
() => import('react/jsx-runtime').JSX.Element
|
|
4
|
+
>;
|
|
5
|
+
//# sourceMappingURL=SparklineInteractiveHoverPrice.d.ts.map
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export type SparklineInteractiveLineVerticalProps = {
|
|
3
|
-
|
|
3
|
+
color: string;
|
|
4
4
|
};
|
|
5
|
-
export declare const SparklineInteractiveLineVertical: React.MemoExoticComponent<
|
|
6
|
-
|
|
5
|
+
export declare const SparklineInteractiveLineVertical: React.MemoExoticComponent<
|
|
6
|
+
({ color }: SparklineInteractiveLineVerticalProps) => import('react/jsx-runtime').JSX.Element
|
|
7
|
+
>;
|
|
8
|
+
//# 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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SparklineInteractiveMarkerDates.d.ts","sourceRoot":"","sources":["../../../src/sparkline/sparkline-interactive/SparklineInteractiveMarkerDates.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AASjE,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"SparklineInteractiveMarkerDates.d.ts","sourceRoot":"","sources":["../../../src/sparkline/sparkline-interactive/SparklineInteractiveMarkerDates.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AASjE,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAkD9E,MAAM,MAAM,oCAAoC,CAAC,MAAM,SAAS,MAAM,IAAI;IACxE,SAAS,EAAE,cAAc,CAAC;IAC1B,UAAU,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;IACpC,cAAc,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,SAAS,CAAC,KAAK,CAAC;CACpC,CAAC;AAEF,iBAAS,0CAA0C,CAAC,MAAM,SAAS,MAAM,EAAE,EACzE,UAAU,EACV,cAAc,EACd,SAAS,EACT,gBAAoB,GACrB,EAAE,oCAAoC,CAAC,MAAM,CAAC,2CA0C9C;AAED,eAAO,MAAM,+BAA+B,EAEvC,OAAO,0CAA0C,CAAC"}
|