@coinbase/cds-web-visualization 3.3.2 → 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 +50 -2
- package/dts/chart/CartesianChart.d.ts +72 -0
- package/dts/chart/CartesianChart.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 +54 -0
- package/dts/chart/Path.d.ts.map +1 -0
- package/dts/chart/PeriodSelector.d.ts +57 -0
- package/dts/chart/PeriodSelector.d.ts.map +1 -0
- package/dts/chart/area/Area.d.ts +78 -0
- package/dts/chart/area/Area.d.ts.map +1 -0
- package/dts/chart/area/AreaChart.d.ts +79 -0
- package/dts/chart/area/AreaChart.d.ts.map +1 -0
- package/dts/chart/area/DottedArea.d.ts +45 -0
- package/dts/chart/area/DottedArea.d.ts.map +1 -0
- package/dts/chart/area/GradientArea.d.ts +39 -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 +255 -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 +94 -0
- package/dts/chart/bar/Bar.d.ts.map +1 -0
- package/dts/chart/bar/BarChart.d.ts +62 -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 +103 -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 +17 -0
- package/dts/chart/bar/DefaultBar.d.ts.map +1 -0
- package/dts/chart/bar/DefaultBarStack.d.ts +16 -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 +35 -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 +14 -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 +26 -0
- package/dts/chart/line/DottedLine.d.ts.map +1 -0
- package/dts/chart/line/Line.d.ts +122 -0
- package/dts/chart/line/Line.d.ts.map +1 -0
- package/dts/chart/line/LineChart.d.ts +77 -0
- package/dts/chart/line/LineChart.d.ts.map +1 -0
- package/dts/chart/line/ReferenceLine.d.ts +178 -0
- package/dts/chart/line/ReferenceLine.d.ts.map +1 -0
- package/dts/chart/line/SolidLine.d.ts +25 -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 +201 -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 +24 -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 +10 -0
- package/dts/chart/scrubber/DefaultScrubberLabel.d.ts.map +1 -0
- package/dts/chart/scrubber/Scrubber.d.ts +290 -0
- package/dts/chart/scrubber/Scrubber.d.ts.map +1 -0
- package/dts/chart/scrubber/ScrubberBeaconGroup.d.ts +70 -0
- package/dts/chart/scrubber/ScrubberBeaconGroup.d.ts.map +1 -0
- package/dts/chart/scrubber/ScrubberBeaconLabelGroup.d.ts +32 -0
- package/dts/chart/scrubber/ScrubberBeaconLabelGroup.d.ts.map +1 -0
- package/dts/chart/scrubber/ScrubberProvider.d.ts +17 -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 +117 -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 +117 -0
- package/dts/chart/utils/chart.d.ts.map +1 -0
- package/dts/chart/utils/context.d.ts +101 -0
- package/dts/chart/utils/context.d.ts.map +1 -0
- package/dts/chart/utils/gradient.d.ts +104 -0
- package/dts/chart/utils/gradient.d.ts.map +1 -0
- package/dts/chart/utils/index.d.ts +12 -0
- package/dts/chart/utils/index.d.ts.map +1 -0
- package/dts/chart/utils/interpolate.d.ts +112 -0
- package/dts/chart/utils/interpolate.d.ts.map +1 -0
- package/dts/chart/utils/path.d.ts +130 -0
- package/dts/chart/utils/path.d.ts.map +1 -0
- package/dts/chart/utils/point.d.ts +104 -0
- package/dts/chart/utils/point.d.ts.map +1 -0
- package/dts/chart/utils/scale.d.ts +43 -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 +65 -0
- package/dts/chart/utils/transition.d.ts.map +1 -0
- package/dts/index.d.ts +1 -0
- package/dts/index.d.ts.map +1 -1
- package/dts/sparkline/Sparkline.d.ts +44 -9
- package/dts/sparkline/Sparkline.d.ts.map +1 -1
- package/dts/sparkline/SparklineArea.d.ts +4 -0
- package/dts/sparkline/SparklineArea.d.ts.map +1 -1
- package/dts/sparkline/SparklineAreaPattern.d.ts +5 -0
- package/dts/sparkline/SparklineAreaPattern.d.ts.map +1 -1
- package/dts/sparkline/SparklineGradient.d.ts +5 -0
- package/dts/sparkline/SparklineGradient.d.ts.map +1 -1
- package/dts/sparkline/generateSparklineWithId.d.ts +1 -0
- package/dts/sparkline/generateSparklineWithId.d.ts.map +1 -1
- package/dts/sparkline/sparkline-interactive/SparklineInteractive.d.ts +9 -0
- package/dts/sparkline/sparkline-interactive/SparklineInteractive.d.ts.map +1 -1
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveAnimatedPath.d.ts +3 -0
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveAnimatedPath.d.ts.map +1 -1
- package/dts/sparkline/sparkline-interactive/SparklineInteractivePaths.d.ts +2 -1
- package/dts/sparkline/sparkline-interactive/SparklineInteractivePaths.d.ts.map +1 -1
- package/esm/chart/CartesianChart.css +1 -0
- package/esm/chart/CartesianChart.js +313 -0
- package/esm/chart/ChartProvider.js +10 -0
- package/esm/chart/Path.js +95 -0
- package/esm/chart/PeriodSelector.css +1 -0
- package/esm/chart/PeriodSelector.js +112 -0
- package/esm/chart/area/Area.js +75 -0
- package/esm/chart/area/AreaChart.js +173 -0
- package/esm/chart/area/DottedArea.js +87 -0
- package/esm/chart/area/GradientArea.js +65 -0
- package/esm/chart/area/SolidArea.js +47 -0
- package/esm/chart/area/index.js +7 -0
- package/esm/chart/axis/Axis.js +25 -0
- package/esm/chart/axis/DefaultAxisTickLabel.js +15 -0
- package/esm/chart/axis/XAxis.css +2 -0
- package/esm/chart/axis/XAxis.js +219 -0
- package/esm/chart/axis/YAxis.css +2 -0
- package/esm/chart/axis/YAxis.js +214 -0
- package/esm/chart/axis/index.js +6 -0
- package/esm/chart/bar/Bar.js +61 -0
- package/esm/chart/bar/BarChart.js +130 -0
- package/esm/chart/bar/BarPlot.js +97 -0
- package/esm/chart/bar/BarStack.js +561 -0
- package/esm/chart/bar/BarStackGroup.js +86 -0
- package/esm/chart/bar/DefaultBar.js +61 -0
- package/esm/chart/bar/DefaultBarStack.js +58 -0
- package/esm/chart/bar/index.js +9 -0
- package/esm/chart/gradient/Gradient.js +104 -0
- package/esm/chart/gradient/index.js +1 -0
- package/esm/chart/index.js +15 -0
- package/esm/chart/line/DefaultReferenceLineLabel.js +81 -0
- package/esm/chart/line/DottedLine.js +59 -0
- package/esm/chart/line/Line.js +185 -0
- package/esm/chart/line/LineChart.js +132 -0
- package/esm/chart/line/ReferenceLine.js +140 -0
- package/esm/chart/line/SolidLine.js +55 -0
- package/esm/chart/line/index.js +8 -0
- package/esm/chart/point/DefaultPointLabel.js +44 -0
- package/esm/chart/point/Point.css +2 -0
- package/esm/chart/point/Point.js +180 -0
- package/esm/chart/point/index.js +2 -0
- package/esm/chart/scrubber/DefaultScrubberBeacon.js +155 -0
- package/esm/chart/scrubber/DefaultScrubberBeaconLabel.js +46 -0
- package/esm/chart/scrubber/DefaultScrubberLabel.js +30 -0
- package/esm/chart/scrubber/Scrubber.js +189 -0
- package/esm/chart/scrubber/ScrubberBeaconGroup.js +166 -0
- package/esm/chart/scrubber/ScrubberBeaconLabelGroup.js +186 -0
- package/esm/chart/scrubber/ScrubberProvider.js +228 -0
- package/esm/chart/scrubber/index.js +4 -0
- package/esm/chart/text/ChartText.js +230 -0
- package/esm/chart/text/ChartTextGroup.js +227 -0
- package/esm/chart/text/index.js +4 -0
- package/esm/chart/utils/axis.js +593 -0
- package/esm/chart/utils/bar.js +24 -0
- package/esm/chart/utils/chart.js +255 -0
- package/esm/chart/utils/context.js +15 -0
- package/esm/chart/utils/gradient.js +257 -0
- package/esm/chart/utils/index.js +13 -0
- package/esm/chart/utils/interpolate.js +644 -0
- package/esm/chart/utils/path.js +227 -0
- package/esm/chart/utils/point.js +187 -0
- package/esm/chart/utils/scale.js +48 -0
- package/esm/chart/utils/scrubber.js +132 -0
- package/esm/chart/utils/transition.js +111 -0
- package/esm/index.js +4 -1
- package/esm/sparkline/Sparkline.js +129 -15
- package/esm/sparkline/SparklineArea.js +7 -2
- package/esm/sparkline/SparklineAreaPattern.js +4 -2
- package/esm/sparkline/SparklineGradient.js +16 -58
- 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/SparklineInteractiveMarkerDates.js +1 -1
- package/esm/sparkline/sparkline-interactive/SparklineInteractivePaths.js +4 -0
- package/package.json +13 -9
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { BarComponentProps } from './Bar';
|
|
3
|
+
export type DefaultBarProps = BarComponentProps & {
|
|
4
|
+
/**
|
|
5
|
+
* Custom class name for the bar.
|
|
6
|
+
*/
|
|
7
|
+
className?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Custom styles for the bar.
|
|
10
|
+
*/
|
|
11
|
+
style?: React.CSSProperties;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Default bar component that renders a solid bar with animation.
|
|
15
|
+
*/
|
|
16
|
+
export declare const DefaultBar: React.NamedExoticComponent<DefaultBarProps>;
|
|
17
|
+
//# sourceMappingURL=DefaultBar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DefaultBar.d.ts","sourceRoot":"","sources":["../../../src/chart/bar/DefaultBar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAM7C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE/C,MAAM,MAAM,eAAe,GAAG,iBAAiB,GAAG;IAChD;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,6CAyCtB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { BarStackComponentProps } from './BarStack';
|
|
2
|
+
export type DefaultBarStackProps = BarStackComponentProps & {
|
|
3
|
+
/**
|
|
4
|
+
* Custom class name for the stack group.
|
|
5
|
+
*/
|
|
6
|
+
className?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Custom styles for the stack group.
|
|
9
|
+
*/
|
|
10
|
+
style?: React.CSSProperties;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Default stack component that renders children in a group with animated clip path.
|
|
14
|
+
*/
|
|
15
|
+
export declare const DefaultBarStack: import('react').NamedExoticComponent<DefaultBarStackProps>;
|
|
16
|
+
//# sourceMappingURL=DefaultBarStack.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DefaultBarStack.d.ts","sourceRoot":"","sources":["../../../src/chart/bar/DefaultBarStack.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAEzD,MAAM,MAAM,oBAAoB,GAAG,sBAAsB,GAAG;IAC1D;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,4DAgD3B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/chart/bar/index.ts"],"names":[],"mappings":"AACA,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type Transition } from 'framer-motion';
|
|
2
|
+
import type { GradientDefinition } from '../utils';
|
|
3
|
+
export type GradientBaseProps = {
|
|
4
|
+
/**
|
|
5
|
+
* Gradient definition with stops, axis, and other configuration.
|
|
6
|
+
*/
|
|
7
|
+
gradient: GradientDefinition;
|
|
8
|
+
/**
|
|
9
|
+
* Y-axis ID to use for gradient processing.
|
|
10
|
+
* When provided, the gradient will align with the specified y-axis range.
|
|
11
|
+
* This ensures gradients work correctly when the axis has a custom range configuration.
|
|
12
|
+
*/
|
|
13
|
+
yAxisId?: string;
|
|
14
|
+
};
|
|
15
|
+
export type GradientProps = GradientBaseProps & {
|
|
16
|
+
/**
|
|
17
|
+
* Unique ID for the gradient definition.
|
|
18
|
+
* Will be used in `url(#${id})` references.
|
|
19
|
+
*/
|
|
20
|
+
id: string;
|
|
21
|
+
/**
|
|
22
|
+
* Whether to animate gradient changes.
|
|
23
|
+
*/
|
|
24
|
+
animate?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Transition configuration for animation.
|
|
27
|
+
*/
|
|
28
|
+
transition?: Transition;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Renders an SVG linearGradient element based on a GradientDefinition.
|
|
32
|
+
* The gradient can be referenced via `fill="url(#${id})"` or `stroke="url(#${id})"`.
|
|
33
|
+
*/
|
|
34
|
+
export declare const Gradient: import('react').NamedExoticComponent<GradientProps>;
|
|
35
|
+
//# sourceMappingURL=Gradient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Gradient.d.ts","sourceRoot":"","sources":["../../../src/chart/gradient/Gradient.tsx"],"names":[],"mappings":"AACA,OAAO,EAAe,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AAG7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAGnD,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;OAEG;IACH,QAAQ,EAAE,kBAAkB,CAAC;IAC7B;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,iBAAiB,GAAG;IAC9C;;;OAGG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,QAAQ,qDAgGpB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/chart/gradient/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export * from './area/index';
|
|
2
|
+
export * from './axis/index';
|
|
3
|
+
export * from './bar/index';
|
|
4
|
+
export * from './CartesianChart';
|
|
5
|
+
export * from './ChartProvider';
|
|
6
|
+
export * from './gradient/index';
|
|
7
|
+
export * from './line/index';
|
|
8
|
+
export * from './Path';
|
|
9
|
+
export * from './PeriodSelector';
|
|
10
|
+
export * from './point/index';
|
|
11
|
+
export * from './scrubber/index';
|
|
12
|
+
export * from './text/index';
|
|
13
|
+
export * from './utils/index';
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/chart/index.ts"],"names":[],"mappings":"AACA,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ReferenceLineLabelComponentProps } from './ReferenceLine';
|
|
2
|
+
export type DefaultReferenceLineLabelProps = ReferenceLineLabelComponentProps;
|
|
3
|
+
/**
|
|
4
|
+
* DefaultReferenceLineLabel is the default label component for ReferenceLine.
|
|
5
|
+
* Provides standard styling with elevation, inset, and color defaults.
|
|
6
|
+
* When elevated, automatically adds bounds to prevent shadow cutoff at chart edges.
|
|
7
|
+
*/
|
|
8
|
+
export declare const DefaultReferenceLineLabel: import('react').NamedExoticComponent<ReferenceLineLabelComponentProps>;
|
|
9
|
+
//# sourceMappingURL=DefaultReferenceLineLabel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DefaultReferenceLineLabel.d.ts","sourceRoot":"","sources":["../../../src/chart/line/DefaultReferenceLineLabel.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,iBAAiB,CAAC;AAExE,MAAM,MAAM,8BAA8B,GAAG,gCAAgC,CAAC;AAQ9E;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,wEAyDrC,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type SVGProps } from 'react';
|
|
2
|
+
import type { SharedProps } from '@coinbase/cds-common/types';
|
|
3
|
+
import { type PathProps } from '../Path';
|
|
4
|
+
import type { LineComponentProps } from './Line';
|
|
5
|
+
export type DottedLineProps = SharedProps &
|
|
6
|
+
Pick<
|
|
7
|
+
PathProps,
|
|
8
|
+
| 'className'
|
|
9
|
+
| 'clipOffset'
|
|
10
|
+
| 'clipRect'
|
|
11
|
+
| 'strokeLinecap'
|
|
12
|
+
| 'strokeLinejoin'
|
|
13
|
+
| 'strokeDasharray'
|
|
14
|
+
| 'strokeDashoffset'
|
|
15
|
+
| 'style'
|
|
16
|
+
| 'vectorEffect'
|
|
17
|
+
> &
|
|
18
|
+
LineComponentProps & {
|
|
19
|
+
fill?: SVGProps<SVGPathElement>['fill'];
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* A customizable dotted line component.
|
|
23
|
+
* Supports gradient for gradient effects on the dots.
|
|
24
|
+
*/
|
|
25
|
+
export declare const DottedLine: import('react').NamedExoticComponent<DottedLineProps>;
|
|
26
|
+
//# sourceMappingURL=DottedLine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DottedLine.d.ts","sourceRoot":"","sources":["../../../src/chart/line/DottedLine.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,QAAQ,EAAS,MAAM,OAAO,CAAC;AACnD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAG9D,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC;AAE/C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAEjD,MAAM,MAAM,eAAe,GAAG,WAAW,GACvC,IAAI,CACF,SAAS,EACP,WAAW,GACX,YAAY,GACZ,UAAU,GACV,eAAe,GACf,gBAAgB,GAChB,iBAAiB,GACjB,kBAAkB,GAClB,OAAO,GACP,cAAc,CACjB,GACD,kBAAkB,GAAG;IACnB,IAAI,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;CACzC,CAAC;AAEJ;;;GAGG;AACH,eAAO,MAAM,UAAU,uDAkDtB,CAAC"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { SVGProps } from 'react';
|
|
3
|
+
import type { SharedProps } from '@coinbase/cds-common/types';
|
|
4
|
+
import { type Transition } from 'framer-motion';
|
|
5
|
+
import { type AreaComponent } from '../area/Area';
|
|
6
|
+
import { type PointBaseProps, type PointProps } from '../point';
|
|
7
|
+
import { type ChartPathCurveType, type GradientDefinition } from '../utils';
|
|
8
|
+
export type LineBaseProps = SharedProps & {
|
|
9
|
+
/**
|
|
10
|
+
* The ID of the series to render. Will be used to find the data from the chart context.
|
|
11
|
+
*/
|
|
12
|
+
seriesId: string;
|
|
13
|
+
/**
|
|
14
|
+
* The curve interpolation method to use for the line.
|
|
15
|
+
* @default 'bump'
|
|
16
|
+
*/
|
|
17
|
+
curve?: ChartPathCurveType;
|
|
18
|
+
/**
|
|
19
|
+
* The type of line to render.
|
|
20
|
+
* @default 'solid'
|
|
21
|
+
*/
|
|
22
|
+
type?: 'solid' | 'dotted';
|
|
23
|
+
/**
|
|
24
|
+
* Whether to show area fill under the line.
|
|
25
|
+
*/
|
|
26
|
+
showArea?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* The type of area fill to add to the line.
|
|
29
|
+
* @default 'gradient'
|
|
30
|
+
*/
|
|
31
|
+
areaType?: 'gradient' | 'solid' | 'dotted';
|
|
32
|
+
/**
|
|
33
|
+
* Baseline value for the area.
|
|
34
|
+
* When set, overrides the default baseline.
|
|
35
|
+
*/
|
|
36
|
+
areaBaseline?: number;
|
|
37
|
+
/**
|
|
38
|
+
* Component to render the line.
|
|
39
|
+
* Takes precedence over the type prop if provided.
|
|
40
|
+
*/
|
|
41
|
+
LineComponent?: LineComponent;
|
|
42
|
+
/**
|
|
43
|
+
* Custom component to render line area fill.
|
|
44
|
+
*/
|
|
45
|
+
AreaComponent?: AreaComponent;
|
|
46
|
+
/**
|
|
47
|
+
* Opacity of the line's stroke.
|
|
48
|
+
* Will also be applied to points and area fill.
|
|
49
|
+
* @default 1
|
|
50
|
+
*/
|
|
51
|
+
opacity?: number;
|
|
52
|
+
/**
|
|
53
|
+
* Controls whether and how to render points at each data point in the series.
|
|
54
|
+
* - `true`: Show all points with default styling
|
|
55
|
+
* - `false` or `undefined`: Hide all points
|
|
56
|
+
* - Function: Called for every entry in the data array to customize individual points
|
|
57
|
+
*
|
|
58
|
+
* @param defaults - The default point props computed by the Line component
|
|
59
|
+
* @returns true for default point, false/null/undefined for no point, or Partial<PointProps> to customize
|
|
60
|
+
*/
|
|
61
|
+
points?:
|
|
62
|
+
| boolean
|
|
63
|
+
| ((defaults: PointBaseProps) => boolean | null | undefined | Partial<PointProps>);
|
|
64
|
+
/**
|
|
65
|
+
* When true, the area is connected across null values.
|
|
66
|
+
*/
|
|
67
|
+
connectNulls?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* The color of the line.
|
|
70
|
+
* @default color of the series or 'var(--color-fgPrimary)'
|
|
71
|
+
*/
|
|
72
|
+
stroke?: string;
|
|
73
|
+
/**
|
|
74
|
+
* Opacity of the line
|
|
75
|
+
* @note when combined with gradient, both will be applied
|
|
76
|
+
* @default 1
|
|
77
|
+
*/
|
|
78
|
+
strokeOpacity?: number;
|
|
79
|
+
/**
|
|
80
|
+
* Width of the line
|
|
81
|
+
* @default 2
|
|
82
|
+
*/
|
|
83
|
+
strokeWidth?: number;
|
|
84
|
+
/**
|
|
85
|
+
* Gradient configuration.
|
|
86
|
+
* When provided, creates gradient or threshold-based coloring.
|
|
87
|
+
*/
|
|
88
|
+
gradient?: GradientDefinition;
|
|
89
|
+
/**
|
|
90
|
+
* Whether to animate the line.
|
|
91
|
+
* Overrides the animate value from the chart context.
|
|
92
|
+
*/
|
|
93
|
+
animate?: boolean;
|
|
94
|
+
};
|
|
95
|
+
export type LineProps = LineBaseProps & {
|
|
96
|
+
/**
|
|
97
|
+
* Transition configuration for line animations.
|
|
98
|
+
*/
|
|
99
|
+
transition?: Transition;
|
|
100
|
+
/**
|
|
101
|
+
* Handler for when a point is clicked.
|
|
102
|
+
* Passed through to Point components rendered via points.
|
|
103
|
+
*/
|
|
104
|
+
onPointClick?: PointProps['onClick'];
|
|
105
|
+
};
|
|
106
|
+
export type LineComponentProps = Pick<
|
|
107
|
+
LineProps,
|
|
108
|
+
'stroke' | 'strokeOpacity' | 'strokeWidth' | 'gradient' | 'animate' | 'transition'
|
|
109
|
+
> & {
|
|
110
|
+
/**
|
|
111
|
+
* Path of the line
|
|
112
|
+
*/
|
|
113
|
+
d: SVGProps<SVGPathElement>['d'];
|
|
114
|
+
/**
|
|
115
|
+
* ID of the y-axis to use.
|
|
116
|
+
* If not provided, defaults to the default y-axis.
|
|
117
|
+
*/
|
|
118
|
+
yAxisId?: string;
|
|
119
|
+
};
|
|
120
|
+
export type LineComponent = React.FC<LineComponentProps>;
|
|
121
|
+
export declare const Line: React.NamedExoticComponent<LineProps>;
|
|
122
|
+
//# sourceMappingURL=Line.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Line.d.ts","sourceRoot":"","sources":["../../../src/chart/line/Line.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAC7C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAe,KAAK,U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B,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,aAAa,GAAG;IACtC;;OAEG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB;;;OAGG;IACH,YAAY,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,IAAI,CACnC,SAAS,EACT,QAAQ,GAAG,eAAe,GAAG,aAAa,GAAG,UAAU,GAAG,SAAS,GAAG,YAAY,CACnF,GAAG;IACF;;OAEG;IACH,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC,GAAG,CAAC,CAAC;IACjC;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAAC,CAAC;AAEzD,eAAO,MAAM,IAAI,uCA8MhB,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { type XAxisProps } from '../axis/XAxis';
|
|
2
|
+
import { type YAxisProps } from '../axis/YAxis';
|
|
3
|
+
import { type CartesianChartBaseProps, type CartesianChartProps } from '../CartesianChart';
|
|
4
|
+
import { type AxisConfigProps, type Series } from '../utils';
|
|
5
|
+
import { type LineProps } from './Line';
|
|
6
|
+
export type LineSeries = Series &
|
|
7
|
+
Partial<
|
|
8
|
+
Pick<
|
|
9
|
+
LineProps,
|
|
10
|
+
| 'curve'
|
|
11
|
+
| 'showArea'
|
|
12
|
+
| 'areaType'
|
|
13
|
+
| 'areaBaseline'
|
|
14
|
+
| 'type'
|
|
15
|
+
| 'LineComponent'
|
|
16
|
+
| 'AreaComponent'
|
|
17
|
+
| 'stroke'
|
|
18
|
+
| 'strokeWidth'
|
|
19
|
+
| 'strokeOpacity'
|
|
20
|
+
| 'opacity'
|
|
21
|
+
| 'points'
|
|
22
|
+
| 'connectNulls'
|
|
23
|
+
| 'transition'
|
|
24
|
+
| 'onPointClick'
|
|
25
|
+
>
|
|
26
|
+
>;
|
|
27
|
+
export type LineChartBaseProps = Omit<CartesianChartBaseProps, 'xAxis' | 'yAxis' | 'series'> &
|
|
28
|
+
Pick<
|
|
29
|
+
LineProps,
|
|
30
|
+
| 'showArea'
|
|
31
|
+
| 'areaType'
|
|
32
|
+
| 'type'
|
|
33
|
+
| 'LineComponent'
|
|
34
|
+
| 'AreaComponent'
|
|
35
|
+
| 'curve'
|
|
36
|
+
| 'points'
|
|
37
|
+
| 'strokeWidth'
|
|
38
|
+
| 'strokeOpacity'
|
|
39
|
+
| 'connectNulls'
|
|
40
|
+
| 'transition'
|
|
41
|
+
| 'onPointClick'
|
|
42
|
+
| 'opacity'
|
|
43
|
+
> & {
|
|
44
|
+
/**
|
|
45
|
+
* Configuration objects that define how to visualize the data.
|
|
46
|
+
* Each series supports Line component props for individual customization.
|
|
47
|
+
*/
|
|
48
|
+
series?: Array<LineSeries>;
|
|
49
|
+
/**
|
|
50
|
+
* Whether to show the X axis.
|
|
51
|
+
*/
|
|
52
|
+
showXAxis?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Whether to show the Y axis.
|
|
55
|
+
*/
|
|
56
|
+
showYAxis?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Configuration for x-axis.
|
|
59
|
+
* Accepts axis config and axis props.
|
|
60
|
+
* To show the axis, set `showXAxis` to true.
|
|
61
|
+
*/
|
|
62
|
+
xAxis?: Partial<AxisConfigProps> & XAxisProps;
|
|
63
|
+
/**
|
|
64
|
+
* Configuration for y-axis.
|
|
65
|
+
* Accepts axis config and axis props.
|
|
66
|
+
* To show the axis, set `showYAxis` to true.
|
|
67
|
+
*/
|
|
68
|
+
yAxis?: Partial<AxisConfigProps> & YAxisProps;
|
|
69
|
+
};
|
|
70
|
+
export type LineChartProps = LineChartBaseProps &
|
|
71
|
+
Omit<CartesianChartProps, 'xAxis' | 'yAxis' | 'series'>;
|
|
72
|
+
export declare const LineChart: import('react').MemoExoticComponent<
|
|
73
|
+
import('react').ForwardRefExoticComponent<
|
|
74
|
+
Omit<LineChartProps, 'ref'> & import('react').RefAttributes<SVGSVGElement>
|
|
75
|
+
>
|
|
76
|
+
>;
|
|
77
|
+
//# sourceMappingURL=LineChart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LineChart.d.ts","sourceRoot":"","sources":["../../../src/chart/line/LineChart.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAEL,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EACzB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,KAAK,eAAe,EAAoC,KAAK,MAAM,EAAE,MAAM,UAAU,CAAC;AAE/F,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,QAAQ,CAAC;AAE9C,MAAM,MAAM,UAAU,GAAG,MAAM,GAC7B,OAAO,CACL,IAAI,CACF,SAAS,EACP,OAAO,GACP,UAAU,GACV,UAAU,GACV,cAAc,GACd,MAAM,GACN,eAAe,GACf,eAAe,GACf,QAAQ,GACR,aAAa,GACb,eAAe,GACf,SAAS,GACT,QAAQ,GACR,cAAc,GACd,YAAY,GACZ,cAAc,CACjB,CACF,CAAC;AAEJ,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,uBAAuB,EAAE,OAAO,GAAG,OAAO,GAAG,QAAQ,CAAC,GAC1F,IAAI,CACF,SAAS,EACP,UAAU,GACV,UAAU,GACV,MAAM,GACN,eAAe,GACf,eAAe,GACf,OAAO,GACP,QAAQ,GACR,aAAa,GACb,eAAe,GACf,cAAc,GACd,YAAY,GACZ,cAAc,GACd,SAAS,CACZ,GAAG;IACF;;;OAGG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;IAC3B;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,UAAU,CAAC;IAC9C;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,UAAU,CAAC;CAC/C,CAAC;AAEJ,MAAM,MAAM,cAAc,GAAG,kBAAkB,GAC7C,IAAI,CAAC,mBAAmB,EAAE,OAAO,GAAG,OAAO,GAAG,QAAQ,CAAC,CAAC;AAE1D,eAAO,MAAM,SAAS,4JA0HrB,CAAC"}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { SharedProps } from '@coinbase/cds-common/types';
|
|
3
|
+
import type {
|
|
4
|
+
ChartTextChildren,
|
|
5
|
+
ChartTextProps,
|
|
6
|
+
TextHorizontalAlignment,
|
|
7
|
+
TextVerticalAlignment,
|
|
8
|
+
} from '../text/ChartText';
|
|
9
|
+
import type { ChartInset } from '../utils';
|
|
10
|
+
import type { LineComponent } from './Line';
|
|
11
|
+
export type ReferenceLineLabelComponentProps = Pick<
|
|
12
|
+
ChartTextProps,
|
|
13
|
+
| 'x'
|
|
14
|
+
| 'y'
|
|
15
|
+
| 'children'
|
|
16
|
+
| 'testID'
|
|
17
|
+
| 'dx'
|
|
18
|
+
| 'dy'
|
|
19
|
+
| 'font'
|
|
20
|
+
| 'fontFamily'
|
|
21
|
+
| 'fontSize'
|
|
22
|
+
| 'fontWeight'
|
|
23
|
+
| 'color'
|
|
24
|
+
| 'elevated'
|
|
25
|
+
| 'inset'
|
|
26
|
+
| 'background'
|
|
27
|
+
| 'borderRadius'
|
|
28
|
+
| 'disableRepositioning'
|
|
29
|
+
| 'styles'
|
|
30
|
+
| 'classNames'
|
|
31
|
+
| 'horizontalAlignment'
|
|
32
|
+
| 'verticalAlignment'
|
|
33
|
+
| 'className'
|
|
34
|
+
| 'style'
|
|
35
|
+
| 'opacity'
|
|
36
|
+
> & {
|
|
37
|
+
/**
|
|
38
|
+
* Bounds inset for label to prevent cutoff at chart edges.
|
|
39
|
+
* @default { top: 4, bottom: 20, left: 12, right: 12 } when elevated is true, otherwise undefined
|
|
40
|
+
*/
|
|
41
|
+
boundsInset?: number | ChartInset;
|
|
42
|
+
};
|
|
43
|
+
export type ReferenceLineLabelComponent = React.FC<ReferenceLineLabelComponentProps>;
|
|
44
|
+
export type ReferenceLineBaseProps = SharedProps & {
|
|
45
|
+
/**
|
|
46
|
+
* Label content to display near the reference line.
|
|
47
|
+
* Can be a string or ReactNode for rich formatting.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* // Simple string label
|
|
51
|
+
* label="Target Price"
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* // ReactNode with styling
|
|
55
|
+
* label={<tspan style={{ fontWeight: 'bold', fill: 'red' }}>Stop Loss</tspan>}
|
|
56
|
+
*/
|
|
57
|
+
label?: ChartTextChildren;
|
|
58
|
+
/**
|
|
59
|
+
* Component to render the line.
|
|
60
|
+
* @default DottedLine
|
|
61
|
+
*/
|
|
62
|
+
LineComponent?: LineComponent;
|
|
63
|
+
/**
|
|
64
|
+
* Component to render the label.
|
|
65
|
+
* @default DefaultReferenceLineLabel
|
|
66
|
+
*/
|
|
67
|
+
LabelComponent?: ReferenceLineLabelComponent;
|
|
68
|
+
/**
|
|
69
|
+
* Whether to elevate the label with a shadow.
|
|
70
|
+
* When true, applies elevation and automatically adds bounds to keep label within chart area.
|
|
71
|
+
*/
|
|
72
|
+
labelElevated?: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Font style for the label text.
|
|
75
|
+
*/
|
|
76
|
+
labelFont?: ChartTextProps['font'];
|
|
77
|
+
/**
|
|
78
|
+
* Horizontal offset for the label in pixels.
|
|
79
|
+
*/
|
|
80
|
+
labelDx?: number;
|
|
81
|
+
/**
|
|
82
|
+
* Vertical offset for the label in pixels.
|
|
83
|
+
*/
|
|
84
|
+
labelDy?: number;
|
|
85
|
+
/**
|
|
86
|
+
* Horizontal alignment of the label text.
|
|
87
|
+
*/
|
|
88
|
+
labelHorizontalAlignment?: TextHorizontalAlignment;
|
|
89
|
+
/**
|
|
90
|
+
* Vertical alignment of the label text.
|
|
91
|
+
*/
|
|
92
|
+
labelVerticalAlignment?: TextVerticalAlignment;
|
|
93
|
+
/**
|
|
94
|
+
* Bounds inset for the label to prevent cutoff at chart edges.
|
|
95
|
+
* Especially useful when labelElevated is true to prevent shadow clipping.
|
|
96
|
+
* Can be a number (applied to all sides) or a ChartInset object.
|
|
97
|
+
* @default { top: 4, bottom: 20, left: 12, right: 12 } when labelElevated is true, otherwise none
|
|
98
|
+
*/
|
|
99
|
+
labelBoundsInset?: number | ChartInset;
|
|
100
|
+
/**
|
|
101
|
+
* The color of the line.
|
|
102
|
+
* @default 'var(--color-bgLine)'
|
|
103
|
+
*/
|
|
104
|
+
stroke?: string;
|
|
105
|
+
/**
|
|
106
|
+
* Opacity applied to both the line and label.
|
|
107
|
+
* @default 1
|
|
108
|
+
*/
|
|
109
|
+
opacity?: number;
|
|
110
|
+
};
|
|
111
|
+
export type HorizontalReferenceLineProps = ReferenceLineBaseProps & {
|
|
112
|
+
/**
|
|
113
|
+
* Y-value for horizontal reference line (data value).
|
|
114
|
+
*/
|
|
115
|
+
dataY: number;
|
|
116
|
+
/**
|
|
117
|
+
* The ID of the y-axis to use for positioning.
|
|
118
|
+
* Defaults to defaultAxisId if not specified.
|
|
119
|
+
*/
|
|
120
|
+
yAxisId?: string;
|
|
121
|
+
/**
|
|
122
|
+
* Position of the label along the horizontal line.
|
|
123
|
+
* @default 'right'
|
|
124
|
+
*/
|
|
125
|
+
labelPosition?: TextHorizontalAlignment;
|
|
126
|
+
dataX?: never;
|
|
127
|
+
};
|
|
128
|
+
export type VerticalReferenceLineProps = ReferenceLineBaseProps & {
|
|
129
|
+
/**
|
|
130
|
+
* X-value for vertical reference line (data index).
|
|
131
|
+
*/
|
|
132
|
+
dataX: number;
|
|
133
|
+
/**
|
|
134
|
+
* Position of the label along the vertical line.
|
|
135
|
+
* @default 'top'
|
|
136
|
+
*/
|
|
137
|
+
labelPosition?: TextVerticalAlignment;
|
|
138
|
+
dataY?: never;
|
|
139
|
+
yAxisId?: never;
|
|
140
|
+
};
|
|
141
|
+
export type ReferenceLineProps = (HorizontalReferenceLineProps | VerticalReferenceLineProps) & {
|
|
142
|
+
/**
|
|
143
|
+
* Custom class name for the root element.
|
|
144
|
+
*/
|
|
145
|
+
className?: string;
|
|
146
|
+
/**
|
|
147
|
+
* Custom inline styles for the root element.
|
|
148
|
+
*/
|
|
149
|
+
style?: React.CSSProperties;
|
|
150
|
+
/**
|
|
151
|
+
* Custom class names for the component parts.
|
|
152
|
+
*/
|
|
153
|
+
classNames?: {
|
|
154
|
+
/**
|
|
155
|
+
* Custom class name for the root element.
|
|
156
|
+
*/
|
|
157
|
+
root?: string;
|
|
158
|
+
/**
|
|
159
|
+
* Custom class name for the text label.
|
|
160
|
+
*/
|
|
161
|
+
label?: string;
|
|
162
|
+
};
|
|
163
|
+
/**
|
|
164
|
+
* Custom styles for the component parts.
|
|
165
|
+
*/
|
|
166
|
+
styles?: {
|
|
167
|
+
/**
|
|
168
|
+
* Custom styles for the root element.
|
|
169
|
+
*/
|
|
170
|
+
root?: React.CSSProperties;
|
|
171
|
+
/**
|
|
172
|
+
* Custom styles for the text label.
|
|
173
|
+
*/
|
|
174
|
+
label?: React.CSSProperties;
|
|
175
|
+
};
|
|
176
|
+
};
|
|
177
|
+
export declare const ReferenceLine: React.NamedExoticComponent<ReferenceLineProps>;
|
|
178
|
+
//# sourceMappingURL=ReferenceLine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReferenceLine.d.ts","sourceRoot":"","sources":["../../../src/chart/line/ReferenceLine.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAe,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,EAAE,WAAW,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1
|
+
import { type SVGProps } from 'react';
|
|
2
|
+
import type { SharedProps } from '@coinbase/cds-common/types';
|
|
3
|
+
import { type PathProps } from '../Path';
|
|
4
|
+
import type { LineComponentProps } from './Line';
|
|
5
|
+
export type SolidLineProps = SharedProps &
|
|
6
|
+
Pick<
|
|
7
|
+
PathProps,
|
|
8
|
+
| 'className'
|
|
9
|
+
| 'clipOffset'
|
|
10
|
+
| 'clipRect'
|
|
11
|
+
| 'strokeLinecap'
|
|
12
|
+
| 'strokeLinejoin'
|
|
13
|
+
| 'strokeDasharray'
|
|
14
|
+
| 'strokeDashoffset'
|
|
15
|
+
| 'style'
|
|
16
|
+
> &
|
|
17
|
+
LineComponentProps & {
|
|
18
|
+
fill?: SVGProps<SVGPathElement>['fill'];
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* A customizable solid line component.
|
|
22
|
+
* Supports gradient for gradient effects and smooth data transitions.
|
|
23
|
+
*/
|
|
24
|
+
export declare const SolidLine: import('react').NamedExoticComponent<SolidLineProps>;
|
|
25
|
+
//# sourceMappingURL=SolidLine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SolidLine.d.ts","sourceRoot":"","sources":["../../../src/chart/line/SolidLine.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,QAAQ,EAAS,MAAM,OAAO,CAAC;AACnD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAG9D,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC;AAE/C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAEjD,MAAM,MAAM,cAAc,GAAG,WAAW,GACtC,IAAI,CACF,SAAS,EACP,WAAW,GACX,YAAY,GACZ,UAAU,GACV,eAAe,GACf,gBAAgB,GAChB,iBAAiB,GACjB,kBAAkB,GAClB,OAAO,CACV,GACD,kBAAkB,GAAG;IACnB,IAAI,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;CACzC,CAAC;AAEJ;;;GAGG;AACH,eAAO,MAAM,SAAS,sDA8CrB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/chart/line/index.ts"],"names":[],"mappings":"AACA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ChartTextProps } from '../text';
|
|
2
|
+
import type { PointLabelProps } from './Point';
|
|
3
|
+
export type DefaultPointLabelProps = PointLabelProps &
|
|
4
|
+
Omit<ChartTextProps, 'children' | 'x' | 'y' | 'horizontalAlignment' | 'verticalAlignment'>;
|
|
5
|
+
/**
|
|
6
|
+
* DefaultPointLabel is the default label component for point labels.
|
|
7
|
+
* It renders text at the specified position relative to the point.
|
|
8
|
+
*/
|
|
9
|
+
export declare const DefaultPointLabel: import('react').NamedExoticComponent<DefaultPointLabelProps>;
|
|
10
|
+
//# sourceMappingURL=DefaultPointLabel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DefaultPointLabel.d.ts","sourceRoot":"","sources":["../../../src/chart/point/DefaultPointLabel.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,SAAS,CAAC;AAGzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,MAAM,MAAM,sBAAsB,GAAG,eAAe,GAClD,IAAI,CAAC,cAAc,EAAE,UAAU,GAAG,GAAG,GAAG,GAAG,GAAG,qBAAqB,GAAG,mBAAmB,CAAC,CAAC;AAE7F;;;GAGG;AACH,eAAO,MAAM,iBAAiB,8DAwB7B,CAAC"}
|