@coinbase/cds-web-visualization 3.4.0-beta.8 → 3.4.0
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 +130 -0
- package/dts/chart/CartesianChart.d.ts +40 -4
- package/dts/chart/CartesianChart.d.ts.map +1 -1
- package/dts/chart/ChartProvider.d.ts +3 -0
- package/dts/chart/ChartProvider.d.ts.map +1 -1
- package/dts/chart/Path.d.ts +51 -12
- package/dts/chart/Path.d.ts.map +1 -1
- package/dts/chart/PeriodSelector.d.ts +25 -4
- package/dts/chart/PeriodSelector.d.ts.map +1 -1
- package/dts/chart/area/Area.d.ts +13 -11
- package/dts/chart/area/Area.d.ts.map +1 -1
- package/dts/chart/area/AreaChart.d.ts +18 -5
- package/dts/chart/area/AreaChart.d.ts.map +1 -1
- package/dts/chart/area/DottedArea.d.ts.map +1 -1
- package/dts/chart/area/GradientArea.d.ts.map +1 -1
- package/dts/chart/area/SolidArea.d.ts.map +1 -1
- package/dts/chart/axis/Axis.d.ts +29 -29
- package/dts/chart/axis/Axis.d.ts.map +1 -1
- package/dts/chart/axis/XAxis.d.ts +6 -0
- package/dts/chart/axis/XAxis.d.ts.map +1 -1
- package/dts/chart/axis/YAxis.d.ts +2 -1
- package/dts/chart/axis/YAxis.d.ts.map +1 -1
- package/dts/chart/bar/Bar.d.ts +51 -51
- package/dts/chart/bar/Bar.d.ts.map +1 -1
- package/dts/chart/bar/BarChart.d.ts +29 -6
- package/dts/chart/bar/BarChart.d.ts.map +1 -1
- package/dts/chart/bar/BarPlot.d.ts +2 -1
- package/dts/chart/bar/BarPlot.d.ts.map +1 -1
- package/dts/chart/bar/BarStack.d.ts +58 -20
- package/dts/chart/bar/BarStack.d.ts.map +1 -1
- package/dts/chart/bar/BarStackGroup.d.ts +2 -1
- package/dts/chart/bar/BarStackGroup.d.ts.map +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 +7 -0
- package/dts/chart/gradient/Gradient.d.ts.map +1 -1
- package/dts/chart/index.d.ts +1 -0
- package/dts/chart/index.d.ts.map +1 -1
- package/dts/chart/legend/DefaultLegendEntry.d.ts +21 -0
- package/dts/chart/legend/DefaultLegendEntry.d.ts.map +1 -0
- package/dts/chart/legend/DefaultLegendShape.d.ts +7 -0
- package/dts/chart/legend/DefaultLegendShape.d.ts.map +1 -0
- package/dts/chart/legend/Legend.d.ts +169 -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/DottedLine.d.ts.map +1 -1
- package/dts/chart/line/Line.d.ts +45 -24
- package/dts/chart/line/Line.d.ts.map +1 -1
- package/dts/chart/line/LineChart.d.ts +5 -3
- package/dts/chart/line/LineChart.d.ts.map +1 -1
- package/dts/chart/line/ReferenceLine.d.ts +9 -0
- package/dts/chart/line/ReferenceLine.d.ts.map +1 -1
- package/dts/chart/line/SolidLine.d.ts.map +1 -1
- package/dts/chart/point/Point.d.ts +26 -2
- package/dts/chart/point/Point.d.ts.map +1 -1
- package/dts/chart/scrubber/DefaultScrubberBeacon.d.ts +34 -17
- package/dts/chart/scrubber/DefaultScrubberBeacon.d.ts.map +1 -1
- package/dts/chart/scrubber/DefaultScrubberBeaconLabel.d.ts.map +1 -1
- package/dts/chart/scrubber/DefaultScrubberLabel.d.ts +2 -1
- package/dts/chart/scrubber/DefaultScrubberLabel.d.ts.map +1 -1
- package/dts/chart/scrubber/Scrubber.d.ts +148 -46
- package/dts/chart/scrubber/Scrubber.d.ts.map +1 -1
- package/dts/chart/scrubber/ScrubberBeaconGroup.d.ts +10 -0
- package/dts/chart/scrubber/ScrubberBeaconGroup.d.ts.map +1 -1
- package/dts/chart/scrubber/ScrubberBeaconLabelGroup.d.ts +25 -1
- package/dts/chart/scrubber/ScrubberBeaconLabelGroup.d.ts.map +1 -1
- package/dts/chart/scrubber/ScrubberProvider.d.ts.map +1 -1
- package/dts/chart/text/ChartText.d.ts.map +1 -1
- package/dts/chart/utils/axis.d.ts +48 -9
- package/dts/chart/utils/axis.d.ts.map +1 -1
- package/dts/chart/utils/bar.d.ts +188 -0
- package/dts/chart/utils/bar.d.ts.map +1 -1
- package/dts/chart/utils/chart.d.ts +32 -0
- package/dts/chart/utils/chart.d.ts.map +1 -1
- package/dts/chart/utils/context.d.ts +20 -4
- package/dts/chart/utils/context.d.ts.map +1 -1
- package/dts/chart/utils/gradient.d.ts +3 -1
- package/dts/chart/utils/gradient.d.ts.map +1 -1
- package/dts/chart/utils/path.d.ts +26 -0
- package/dts/chart/utils/path.d.ts.map +1 -1
- package/dts/chart/utils/point.d.ts +18 -7
- package/dts/chart/utils/point.d.ts.map +1 -1
- package/dts/chart/utils/scale.d.ts +11 -0
- package/dts/chart/utils/scale.d.ts.map +1 -1
- package/dts/chart/utils/scrubber.d.ts +2 -1
- package/dts/chart/utils/scrubber.d.ts.map +1 -1
- package/dts/chart/utils/transition.d.ts +50 -14
- package/dts/chart/utils/transition.d.ts.map +1 -1
- package/dts/sparkline/Sparkline.d.ts +2 -1
- package/dts/sparkline/Sparkline.d.ts.map +1 -1
- package/dts/sparkline/SparklineArea.d.ts +2 -1
- package/dts/sparkline/SparklineArea.d.ts.map +1 -1
- package/dts/sparkline/SparklineGradient.d.ts +2 -1
- package/dts/sparkline/SparklineGradient.d.ts.map +1 -1
- package/dts/sparkline/sparkline-interactive/SparklineInteractive.d.ts +2 -1
- package/dts/sparkline/sparkline-interactive/SparklineInteractive.d.ts.map +1 -1
- package/esm/chart/CartesianChart.js +154 -90
- package/esm/chart/ChartProvider.js +2 -2
- package/esm/chart/Path.js +35 -19
- package/esm/chart/PeriodSelector.js +33 -15
- package/esm/chart/area/Area.js +21 -9
- package/esm/chart/area/AreaChart.js +28 -25
- package/esm/chart/area/DottedArea.js +18 -9
- package/esm/chart/area/GradientArea.js +16 -8
- package/esm/chart/area/SolidArea.js +8 -3
- package/esm/chart/axis/Axis.js +3 -17
- package/esm/chart/axis/XAxis.js +153 -50
- package/esm/chart/axis/YAxis.js +146 -36
- package/esm/chart/bar/Bar.js +16 -8
- package/esm/chart/bar/BarChart.js +38 -33
- package/esm/chart/bar/BarPlot.js +20 -25
- package/esm/chart/bar/BarStack.js +109 -505
- package/esm/chart/bar/BarStackGroup.js +36 -27
- package/esm/chart/bar/DefaultBar.js +34 -26
- package/esm/chart/bar/DefaultBarStack.js +31 -18
- package/esm/chart/gradient/Gradient.js +3 -2
- package/esm/chart/index.js +1 -0
- package/esm/chart/legend/DefaultLegendEntry.css +1 -0
- package/esm/chart/legend/DefaultLegendEntry.js +50 -0
- package/esm/chart/legend/DefaultLegendShape.css +5 -0
- package/esm/chart/legend/DefaultLegendShape.js +47 -0
- package/esm/chart/legend/Legend.js +76 -0
- package/esm/chart/legend/index.js +3 -0
- package/esm/chart/line/DottedLine.js +7 -2
- package/esm/chart/line/Line.js +41 -42
- package/esm/chart/line/LineChart.js +18 -13
- package/esm/chart/line/ReferenceLine.js +6 -2
- package/esm/chart/line/SolidLine.js +8 -3
- package/esm/chart/point/Point.js +41 -24
- package/esm/chart/scrubber/DefaultScrubberBeacon.js +64 -65
- package/esm/chart/scrubber/DefaultScrubberBeaconLabel.js +25 -14
- package/esm/chart/scrubber/DefaultScrubberLabel.js +26 -8
- package/esm/chart/scrubber/Scrubber.js +54 -43
- package/esm/chart/scrubber/ScrubberBeaconGroup.js +60 -35
- package/esm/chart/scrubber/ScrubberBeaconLabelGroup.js +31 -8
- package/esm/chart/scrubber/ScrubberProvider.js +44 -39
- package/esm/chart/text/ChartText.js +3 -2
- package/esm/chart/utils/axis.js +90 -43
- package/esm/chart/utils/bar.js +863 -0
- package/esm/chart/utils/chart.js +34 -7
- package/esm/chart/utils/context.js +7 -0
- package/esm/chart/utils/gradient.js +6 -4
- package/esm/chart/utils/path.js +88 -61
- package/esm/chart/utils/point.js +57 -30
- package/esm/chart/utils/scale.js +13 -2
- package/esm/chart/utils/scrubber.js +9 -4
- package/esm/chart/utils/transition.js +68 -41
- package/esm/sparkline/Sparkline.js +2 -1
- package/esm/sparkline/SparklineArea.js +2 -1
- package/esm/sparkline/SparklineGradient.js +2 -1
- package/esm/sparkline/__figma__/Sparkline.figma.js +1 -1
- package/esm/sparkline/sparkline-interactive/SparklineInteractive.js +2 -1
- package/esm/sparkline/sparkline-interactive/__figma__/SparklineInteractive.figma.js +1 -1
- package/esm/sparkline/sparkline-interactive-header/__figma__/SparklineInteractiveHeader.figma.js +1 -1
- package/package.json +12 -11
package/dts/chart/utils/bar.d.ts
CHANGED
|
@@ -1,3 +1,61 @@
|
|
|
1
|
+
import type { Rect } from '@coinbase/cds-common/types';
|
|
2
|
+
import type { Transition } from 'framer-motion';
|
|
3
|
+
import type { BarComponent } from '../bar/Bar';
|
|
4
|
+
import type { BarSeries } from '../bar/BarStack';
|
|
5
|
+
import type { CartesianChartLayout } from './context';
|
|
6
|
+
import type { GradientDefinition, GradientStop } from './gradient';
|
|
7
|
+
import type { ChartScaleFunction } from './scale';
|
|
8
|
+
/**
|
|
9
|
+
* A bar-specific transition that extends Transition with stagger support.
|
|
10
|
+
* When `staggerDelay` is provided, bars will animate with increasing delays
|
|
11
|
+
* based on their position along the category axis (vertical: left-to-right,
|
|
12
|
+
* horizontal: top-to-bottom).
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* // Bars stagger in from left to right over 0.25s, each animating for 0.75s
|
|
16
|
+
* { type: 'tween', duration: 0.75, staggerDelay: 0.25 }
|
|
17
|
+
*/
|
|
18
|
+
export type BarTransition = Transition & {
|
|
19
|
+
/**
|
|
20
|
+
* Maximum stagger delay (seconds) distributed across bars by x position.
|
|
21
|
+
* Leftmost bar starts immediately, rightmost starts after this delay.
|
|
22
|
+
*/
|
|
23
|
+
staggerDelay?: number;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Computes a bar's normalized [0, 1] position along the category axis, used for
|
|
27
|
+
* stagger-delay calculations.
|
|
28
|
+
*
|
|
29
|
+
* Vertical charts stagger left-to-right (x axis); horizontal charts stagger
|
|
30
|
+
* top-to-bottom (y axis). Returns 0 when the drawing area has no extent.
|
|
31
|
+
*
|
|
32
|
+
* @param layout - The layout of the chart
|
|
33
|
+
* @param x - Bar's left edge in pixels
|
|
34
|
+
* @param y - Bar's top edge in pixels
|
|
35
|
+
*/
|
|
36
|
+
export declare const getNormalizedStagger: (
|
|
37
|
+
layout: CartesianChartLayout,
|
|
38
|
+
x: number,
|
|
39
|
+
y: number,
|
|
40
|
+
drawingArea: Rect,
|
|
41
|
+
) => number;
|
|
42
|
+
/**
|
|
43
|
+
* Strips `staggerDelay` from a transition and computes a positional delay.
|
|
44
|
+
*
|
|
45
|
+
* @param transition - The transition config (may include staggerDelay)
|
|
46
|
+
* @param normalizedPosition - The bar's normalized position along the category axis (0–1)
|
|
47
|
+
* @returns A standard Transition with computed delay
|
|
48
|
+
*/
|
|
49
|
+
export declare const withStaggerDelayTransition: (
|
|
50
|
+
transition: BarTransition | null,
|
|
51
|
+
normalizedPosition: number,
|
|
52
|
+
) => Transition | null;
|
|
53
|
+
/**
|
|
54
|
+
* Default bar enter transition. Uses the default spring with a stagger delay
|
|
55
|
+
* so bars spring into place from left to right.
|
|
56
|
+
* `{ type: 'spring', stiffness: 900, damping: 120, mass: 4, staggerDelay: 0.25 }`
|
|
57
|
+
*/
|
|
58
|
+
export declare const defaultBarEnterTransition: BarTransition;
|
|
1
59
|
/**
|
|
2
60
|
* Calculates the size adjustment needed for bars when accounting for gaps between them.
|
|
3
61
|
* This function helps determine how much to reduce each bar's width to accommodate
|
|
@@ -17,4 +75,134 @@
|
|
|
17
75
|
* ```
|
|
18
76
|
*/
|
|
19
77
|
export declare function getBarSizeAdjustment(barCount: number, gapSize: number): number;
|
|
78
|
+
type StackGroup = {
|
|
79
|
+
stackId: string;
|
|
80
|
+
series: BarSeries[];
|
|
81
|
+
xAxisId?: string;
|
|
82
|
+
yAxisId?: string;
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* Groups bar series into stack groups scoped by stackId + axis IDs.
|
|
86
|
+
*
|
|
87
|
+
* Series with no `stackId` are treated as independent stacks keyed by series id.
|
|
88
|
+
* Axis IDs are included in the group key so series on different axes never stack together.
|
|
89
|
+
*/
|
|
90
|
+
export declare function getStackGroups(series: BarSeries[], defaultAxisId?: string): StackGroup[];
|
|
91
|
+
/**
|
|
92
|
+
* Computes stack clip origin [start, end] that covers the bounding box
|
|
93
|
+
* of all bars at their stacked starting positions (as computed by `getBarOrigins`).
|
|
94
|
+
*
|
|
95
|
+
* This is passed to `DefaultBarStack` so the clip animation starts in sync with the
|
|
96
|
+
* individual bar animations — no bars leak outside the clip on frame 0.
|
|
97
|
+
*
|
|
98
|
+
* @param barOrigins - Per-bar initial origins from `getBarOrigins`
|
|
99
|
+
* @param barMinSizes - Per-bar minimum sizes in pixels (or a uniform value)
|
|
100
|
+
* @returns [originStart, originEnd] or undefined when barMinSize is 0 / no bars
|
|
101
|
+
*/
|
|
102
|
+
export declare function getStackOrigin(
|
|
103
|
+
barOrigins: number[],
|
|
104
|
+
barMinSizes: number[] | number,
|
|
105
|
+
): [number, number] | undefined;
|
|
106
|
+
/**
|
|
107
|
+
* Computes the initial clip rect used for stack enter animations.
|
|
108
|
+
*/
|
|
109
|
+
export declare function getStackInitialClipRect(
|
|
110
|
+
stackRect: Rect,
|
|
111
|
+
layout: CartesianChartLayout,
|
|
112
|
+
origin?: number | [number, number],
|
|
113
|
+
): Rect;
|
|
114
|
+
/**
|
|
115
|
+
* Threshold for treating a position as touching the baseline.
|
|
116
|
+
* Positions within this distance are considered at the baseline for rounding purposes.
|
|
117
|
+
*/
|
|
118
|
+
export declare const EPSILON = 0.0001;
|
|
119
|
+
/**
|
|
120
|
+
* Computes and clamps the stack baseline position on the value axis.
|
|
121
|
+
*
|
|
122
|
+
* - If the full domain is positive, baseline is domain min.
|
|
123
|
+
* - If the full domain is negative, baseline is domain max.
|
|
124
|
+
* - If the domain crosses zero, baseline is 0.
|
|
125
|
+
*/
|
|
126
|
+
export declare function getStackBaseline(
|
|
127
|
+
valueScale: ChartScaleFunction,
|
|
128
|
+
stackRect: Rect,
|
|
129
|
+
layout: CartesianChartLayout,
|
|
130
|
+
): number;
|
|
131
|
+
type SeriesGradientEntry = {
|
|
132
|
+
seriesId: string;
|
|
133
|
+
gradient: GradientDefinition;
|
|
134
|
+
scale: ChartScaleFunction;
|
|
135
|
+
stops: GradientStop[];
|
|
136
|
+
} | null;
|
|
137
|
+
/**
|
|
138
|
+
* Computes the positioned bar entries and bounding rect for a single stack at one category index.
|
|
139
|
+
*
|
|
140
|
+
* This is the pure computation extracted from `BarStack`'s `useMemo` so it can be tested
|
|
141
|
+
* independently and reused across contexts.
|
|
142
|
+
*
|
|
143
|
+
* @param params.series - Series configs for this stack
|
|
144
|
+
* @param params.seriesData - Stacked data for each series, keyed by series id
|
|
145
|
+
* @param params.categoryIndex - Index of the category being rendered
|
|
146
|
+
* @param params.indexPos - Pixel position along the categorical axis
|
|
147
|
+
* @param params.thickness - Bar thickness in pixels
|
|
148
|
+
* @param params.valueScale - Scale function for the value axis
|
|
149
|
+
* @param params.seriesGradients - Precomputed gradient configs per series (null entries are skipped)
|
|
150
|
+
* @param params.roundBaseline - Whether to round the face touching the baseline
|
|
151
|
+
* @param params.layout - The layout of the chart
|
|
152
|
+
* @param params.baseline - Pixel position of the zero value on the value axis
|
|
153
|
+
* @param params.stackGap - Gap between adjacent bars in pixels
|
|
154
|
+
* @param params.barMinSize - Minimum individual bar size in pixels
|
|
155
|
+
* @param params.stackMinSize - Minimum total stack size in pixels
|
|
156
|
+
* @param params.defaultFill - Fallback fill color when a series has no color or gradient
|
|
157
|
+
* @returns Positioned bar entries and the stack's bounding rect
|
|
158
|
+
*/
|
|
159
|
+
export declare function getBars(params: {
|
|
160
|
+
series: BarSeries[];
|
|
161
|
+
seriesData: Record<string, ([number, number] | null)[]>;
|
|
162
|
+
categoryIndex: number;
|
|
163
|
+
categoryValue: number;
|
|
164
|
+
indexPos: number;
|
|
165
|
+
thickness: number;
|
|
166
|
+
valueScale: ChartScaleFunction;
|
|
167
|
+
seriesGradients: SeriesGradientEntry[];
|
|
168
|
+
roundBaseline?: boolean;
|
|
169
|
+
layout: CartesianChartLayout;
|
|
170
|
+
baseline: number;
|
|
171
|
+
stackGap?: number;
|
|
172
|
+
barMinSize?: number;
|
|
173
|
+
stackMinSize?: number;
|
|
174
|
+
defaultFill: string;
|
|
175
|
+
borderRadius?: number;
|
|
176
|
+
defaultFillOpacity?: number;
|
|
177
|
+
defaultStroke?: string;
|
|
178
|
+
defaultStrokeWidth?: number;
|
|
179
|
+
defaultBarComponent?: BarComponent;
|
|
180
|
+
}): {
|
|
181
|
+
x: number;
|
|
182
|
+
y: number;
|
|
183
|
+
width: number;
|
|
184
|
+
height: number;
|
|
185
|
+
dataX: number | [number, number];
|
|
186
|
+
dataY: number | [number, number];
|
|
187
|
+
origin: number;
|
|
188
|
+
borderRadius: number | undefined;
|
|
189
|
+
fillOpacity: number | undefined;
|
|
190
|
+
stroke: string | undefined;
|
|
191
|
+
strokeWidth: number | undefined;
|
|
192
|
+
minSize: number;
|
|
193
|
+
BarComponent: BarComponent | undefined;
|
|
194
|
+
roundTop?: boolean;
|
|
195
|
+
roundBottom?: boolean;
|
|
196
|
+
seriesId: string;
|
|
197
|
+
fill?: string;
|
|
198
|
+
/** Position along the value axis in pixels (axis-agnostic, used by layout helpers). */
|
|
199
|
+
valuePos: number;
|
|
200
|
+
/** Size along the value axis in pixels (axis-agnostic, used by layout helpers). */
|
|
201
|
+
length: number;
|
|
202
|
+
/** The raw data value as [baseline, value], used by layout helpers for gap/rounding logic. */
|
|
203
|
+
dataValue: [number, number];
|
|
204
|
+
/** Whether gap distribution should be applied to this bar in a stack. */
|
|
205
|
+
shouldApplyGap?: boolean;
|
|
206
|
+
}[];
|
|
207
|
+
export {};
|
|
20
208
|
//# sourceMappingURL=bar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bar.d.ts","sourceRoot":"","sources":["../../../src/chart/utils/bar.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAM9E"}
|
|
1
|
+
{"version":3,"file":"bar.d.ts","sourceRoot":"","sources":["../../../src/chart/utils/bar.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,OAAO,KAAK,EAAgB,YAAY,EAAE,MAAM,YAAY,CAAC;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAIjD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,KAAK,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAEnE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAGlD;;;;;;;;;GASG;AACH,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG;IACvC;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,oBAAoB,GAC/B,QAAQ,oBAAoB,EAC5B,GAAG,MAAM,EACT,GAAG,MAAM,EACT,aAAa,IAAI,KAChB,MAKF,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,GACrC,YAAY,aAAa,GAAG,IAAI,EAChC,oBAAoB,MAAM,KACzB,UAAU,GAAG,IAQf,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,EAAE,aAGvC,CAAC;AAEF;;;;;;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C;IACpB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC;IACxD,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,kBAAkB,CAAC;IAC/B,eAAe,EAAE,mBAAmB,EAAE,CAAC;IACvC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,MAAM,EAAE,oBAAoB,CAAC;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,mBAAmB,CAAC,EAAE,YAAY,CAAC;CACpC;;;;;;;;;;;;;;;;;;IAxrBC,uFAAuF;cAC7E,MAAM;IAChB,mFAAmF;YAC3E,MAAM;IACd,8FAA8F;eACnF,CAAC,MAAM,EAAE,MAAM,CAAC;IAC3B,yEAAyE;qBACxD,OAAO;IA81BzB"}
|
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
import type { GradientDefinition } from './gradient';
|
|
2
2
|
export declare const defaultStackId = 'DEFAULT_STACK_ID';
|
|
3
|
+
/**
|
|
4
|
+
* Shape variants available for legend items.
|
|
5
|
+
*/
|
|
6
|
+
export type LegendShapeVariant = 'circle' | 'square' | 'squircle' | 'pill';
|
|
7
|
+
/**
|
|
8
|
+
* Shape for legend items. Can be a preset variant or a custom ReactNode.
|
|
9
|
+
*/
|
|
10
|
+
export type LegendShape = LegendShapeVariant | React.ReactNode;
|
|
11
|
+
/**
|
|
12
|
+
* Position of the legend relative to the chart.
|
|
13
|
+
*/
|
|
14
|
+
export type LegendPosition = 'top' | 'bottom' | 'left' | 'right';
|
|
3
15
|
export type AxisBounds = {
|
|
4
16
|
min: number;
|
|
5
17
|
max: number;
|
|
@@ -39,9 +51,16 @@ export type Series = {
|
|
|
39
51
|
* Takes precedence over color except for scrubber beacon labels.
|
|
40
52
|
*/
|
|
41
53
|
gradient?: GradientDefinition;
|
|
54
|
+
/**
|
|
55
|
+
* Id of the x-axis this series uses.
|
|
56
|
+
* Defaults to defaultAxisId if not specified.
|
|
57
|
+
* @note Only used for axis selection when layout is 'horizontal'. Vertical layout uses a single x-axis.
|
|
58
|
+
*/
|
|
59
|
+
xAxisId?: string;
|
|
42
60
|
/**
|
|
43
61
|
* Id of the y-axis this series uses.
|
|
44
62
|
* Defaults to defaultAxisId if not specified.
|
|
63
|
+
* @note Only used for axis selection when layout is 'vertical'. Horizontal layout supports a single y-axis.
|
|
45
64
|
*/
|
|
46
65
|
yAxisId?: string;
|
|
47
66
|
/**
|
|
@@ -50,6 +69,12 @@ export type Series = {
|
|
|
50
69
|
* If not specified, the series will not be stacked.
|
|
51
70
|
*/
|
|
52
71
|
stackId?: string;
|
|
72
|
+
/**
|
|
73
|
+
* Shape of the legend item for this series.
|
|
74
|
+
* Can be a preset shape variant or a custom ReactNode.
|
|
75
|
+
* @default 'circle'
|
|
76
|
+
*/
|
|
77
|
+
legendShape?: LegendShape;
|
|
53
78
|
};
|
|
54
79
|
/**
|
|
55
80
|
* Calculates the domain of a chart from series data.
|
|
@@ -97,6 +122,13 @@ export type ChartInset = {
|
|
|
97
122
|
bottom: number;
|
|
98
123
|
right: number;
|
|
99
124
|
};
|
|
125
|
+
export declare const defaultVerticalLayoutChartInset: ChartInset;
|
|
126
|
+
export declare const defaultHorizontalLayoutChartInset: ChartInset;
|
|
127
|
+
/**
|
|
128
|
+
* @deprecated Use `defaultVerticalLayoutChartInset` for vertical layout charts or. This will be removed in a future major release.
|
|
129
|
+
* @deprecationExpectedRemoval v4
|
|
130
|
+
* `defaultHorizontalLayoutChartInset` for horizontal layout charts.
|
|
131
|
+
*/
|
|
100
132
|
export declare const defaultChartInset: ChartInset;
|
|
101
133
|
/**
|
|
102
134
|
* Normalize padding to include all sides with a value.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chart.d.ts","sourceRoot":"","sources":["../../../src/chart/utils/chart.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAErD,eAAO,MAAM,cAAc,qBAAqB,CAAC;AAEjD,MAAM,MAAM,UAAU,GAAG;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,aAAa,GAAI,QAAQ,OAAO,CAAC,UAAU,CAAC,KAAG,MAAM,IAAI,UAChB,CAAC;AAEvD,MAAM,MAAM,MAAM,GAAG;IACnB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC;IAC7D;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAC9B
|
|
1
|
+
{"version":3,"file":"chart.d.ts","sourceRoot":"","sources":["../../../src/chart/utils/chart.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAErD,eAAO,MAAM,cAAc,qBAAqB,CAAC;AAEjD;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,Q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GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC,CA0E5C,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,GACtB,OAAO,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC,KAC3D,KAAK,CAAC,MAAM,GAAG,IAAI,CAerB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,aAAa,GACxB,QAAQ,MAAM,EAAE,EAChB,MAAM,MAAM,EACZ,MAAM,MAAM,KACX,OAAO,CAAC,UAAU,CA2EpB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,+BAA+B,EAAE,UAK7C,CAAC;AAEF,eAAO,MAAM,iCAAiC,EAAE,UAK/C,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,EAAE,UAA4C,CAAC;AAE7E;;;;;GAKG;AACH;;;;;GAKG;AACH,eAAO,MAAM,aAAa,GACxB,QAAQ,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,EACpC,WAAW,UAAU,KACpB,UAuBF,CAAC"}
|
|
@@ -2,11 +2,25 @@ import type { Rect } from '@coinbase/cds-common/types';
|
|
|
2
2
|
import type { AxisConfig } from './axis';
|
|
3
3
|
import type { Series } from './chart';
|
|
4
4
|
import type { ChartScaleFunction } from './scale';
|
|
5
|
+
/**
|
|
6
|
+
* Chart layout for Cartesian charts.
|
|
7
|
+
* Describes the direction bars/areas grow.
|
|
8
|
+
* - 'vertical': Bars grow vertically (up/down). X is category axis, Y is value axis.
|
|
9
|
+
* - 'horizontal': Bars grow horizontally (left/right). Y is category axis, X is value axis.
|
|
10
|
+
*/
|
|
11
|
+
export type CartesianChartLayout = 'horizontal' | 'vertical';
|
|
5
12
|
/**
|
|
6
13
|
* Context value for Cartesian (X/Y) coordinate charts.
|
|
7
14
|
* Contains axis-specific methods and properties for rectangular coordinate systems.
|
|
8
15
|
*/
|
|
9
16
|
export type CartesianChartContextValue = {
|
|
17
|
+
/**
|
|
18
|
+
* Chart layout - describes the direction bars/areas grow.
|
|
19
|
+
* @default 'vertical'
|
|
20
|
+
* - 'vertical': Bars grow vertically (up/down). X is category axis, Y is value axis.
|
|
21
|
+
* - 'horizontal': Bars grow horizontally (left/right). Y is category axis, X is value axis.
|
|
22
|
+
*/
|
|
23
|
+
layout: CartesianChartLayout;
|
|
10
24
|
/**
|
|
11
25
|
* The series data for the chart.
|
|
12
26
|
*/
|
|
@@ -35,18 +49,20 @@ export type CartesianChartContextValue = {
|
|
|
35
49
|
*/
|
|
36
50
|
height: number;
|
|
37
51
|
/**
|
|
38
|
-
* Get x-axis configuration.
|
|
52
|
+
* Get x-axis configuration by ID.
|
|
53
|
+
* @param id - The axis ID. Defaults to defaultAxisId.
|
|
39
54
|
*/
|
|
40
|
-
getXAxis: () => AxisConfig | undefined;
|
|
55
|
+
getXAxis: (id?: string) => AxisConfig | undefined;
|
|
41
56
|
/**
|
|
42
57
|
* Get y-axis configuration by ID.
|
|
43
58
|
* @param id - The axis ID. Defaults to defaultAxisId.
|
|
44
59
|
*/
|
|
45
60
|
getYAxis: (id?: string) => AxisConfig | undefined;
|
|
46
61
|
/**
|
|
47
|
-
* Get x-axis scale function.
|
|
62
|
+
* Get x-axis scale function by ID.
|
|
63
|
+
* @param id - The axis ID. Defaults to defaultAxisId.
|
|
48
64
|
*/
|
|
49
|
-
getXScale: () => ChartScaleFunction | undefined;
|
|
65
|
+
getXScale: (id?: string) => ChartScaleFunction | undefined;
|
|
50
66
|
/**
|
|
51
67
|
* Get y-axis scale function by ID.
|
|
52
68
|
* @param id - The axis ID. Defaults to defaultAxisId.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/chart/utils/context.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAEvD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAElD;;;GAGG;AACH,MAAM,MAAM,0BAA0B,GAAG;IACvC;;OAEG;IACH,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB;;;OAGG;IACH,SAAS,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;IACrD;;;;OAIG;IACH,aAAa,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,KAAK,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,SAAS,CAAC;IACjF;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/chart/utils/context.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAEvD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAElD;;;;;GAKG;AACH,MAAM,MAAM,oBAAoB,GAAG,YAAY,GAAG,UAAU,CAAC;AAE7D;;;GAGG;AACH,MAAM,MAAM,0BAA0B,GAAG;IACvC;;;;;OAKG;IACH,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AC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC;;;OAGG;IACH,eAAe,EAAE,OAAO,CAAC;IACzB;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;OAGG;IACH,wBAAwB,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;CAC/D,CAAC;AAEF,eAAO,MAAM,eAAe,2DAA6D,CAAC;AAE1F,eAAO,MAAM,kBAAkB,QAAO,oBAMrC,CAAC"}
|
|
@@ -92,7 +92,8 @@ export declare const getBaseline: (axisBounds: AxisBounds, baseline?: number) =>
|
|
|
92
92
|
* @param fill - The color to use for the gradient
|
|
93
93
|
* @param peakOpacity - Opacity at the peak of the gradient
|
|
94
94
|
* @param baselineOpacity - Opacity at the baseline
|
|
95
|
-
* @
|
|
95
|
+
* @param axis - The axis the gradient maps to ('y' for vertical, 'x' for horizontal layout)
|
|
96
|
+
* @returns A gradient definition with stops in ascending order
|
|
96
97
|
*/
|
|
97
98
|
export declare const createGradient: (
|
|
98
99
|
axisBounds: AxisBounds,
|
|
@@ -100,5 +101,6 @@ export declare const createGradient: (
|
|
|
100
101
|
fill: string,
|
|
101
102
|
peakOpacity: number,
|
|
102
103
|
baselineOpacity: number,
|
|
104
|
+
axis?: 'x' | 'y',
|
|
103
105
|
) => GradientDefinition;
|
|
104
106
|
//# sourceMappingURL=gradient.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gradient.d.ts","sourceRoot":"","sources":["../../../src/chart/utils/gradient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,EAAE,KAAK,kBAAkB,EAAsB,MAAM,SAAS,CAAC;AAEtE;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;IACf,+CAA+C;IAC/C,KAAK,EAAE,MAAM,CAAC;IAC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EAAE,YAAY,EAAE,GAAG,CAAC,CAAC,MAAM,EAAE,UAAU,KAAK,YAAY,EAAE,CAAC,CAAC;CAClE,CAAC;AA8DF;;;;;;GAMG;AACH,eAAO,MAAM,uBAAuB,GAClC,OAAO,YAAY,EAAE,EACrB,WAAW,MAAM,EACjB,OAAO,kBAAkB,KACxB,MAAM,GAAG,SAiEX,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,iBAAiB,GAC5B,UAAU,kBAAkB,EAC5B,QAAQ,kBAAkB,EAC1B,QAAQ,kBAAkB,KACzB,YAAY,EAAE,GAAG,SAqBnB,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,GAAI,YAAY,UAAU,EAAE,WAAU,MAAU,KAAG,MAc1E,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,cAAc,GACzB,YAAY,UAAU,EACtB,eAAe,MAAM,EACrB,MAAM,MAAM,EACZ,aAAa,MAAM,EACnB,iBAAiB,MAAM,EACvB,OAAM,GAAG,GAAG,GAAS,KACpB,kBA0BF,CAAC"}
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
+
import type { Transition } from 'framer-motion';
|
|
2
|
+
import type { CartesianChartLayout } from './context';
|
|
1
3
|
import { type ChartScaleFunction } from './scale';
|
|
4
|
+
/**
|
|
5
|
+
* Default enter transition for path-based components (Line, Area).
|
|
6
|
+
* `{ type: 'tween', duration: 0.5 }`
|
|
7
|
+
*/
|
|
8
|
+
export declare const defaultPathEnterTransition: Transition;
|
|
2
9
|
export type ChartPathCurveType =
|
|
3
10
|
| 'bump'
|
|
4
11
|
| 'catmullRom'
|
|
@@ -13,10 +20,12 @@ export type ChartPathCurveType =
|
|
|
13
20
|
* Get the d3 curve function for a path.
|
|
14
21
|
* See https://d3js.org/d3-shape/curve
|
|
15
22
|
* @param curve - The curve type. Defaults to 'linear'.
|
|
23
|
+
* @param layout - The chart layout. Defaults to 'vertical'.
|
|
16
24
|
* @returns The d3 curve function.
|
|
17
25
|
*/
|
|
18
26
|
export declare const getPathCurveFunction: (
|
|
19
27
|
curve?: ChartPathCurveType,
|
|
28
|
+
layout?: CartesianChartLayout,
|
|
20
29
|
) => import('d3-shape').CurveFactory;
|
|
21
30
|
/**
|
|
22
31
|
* Generates an SVG line path string from data using chart scale functions.
|
|
@@ -33,7 +42,9 @@ export declare const getLinePath: ({
|
|
|
33
42
|
xScale,
|
|
34
43
|
yScale,
|
|
35
44
|
xData,
|
|
45
|
+
yData,
|
|
36
46
|
connectNulls,
|
|
47
|
+
layout,
|
|
37
48
|
}: {
|
|
38
49
|
data: (
|
|
39
50
|
| number
|
|
@@ -47,11 +58,17 @@ export declare const getLinePath: ({
|
|
|
47
58
|
xScale: ChartScaleFunction;
|
|
48
59
|
yScale: ChartScaleFunction;
|
|
49
60
|
xData?: number[];
|
|
61
|
+
yData?: number[];
|
|
50
62
|
/**
|
|
51
63
|
* When true, null values are skipped and the line connects across gaps.
|
|
52
64
|
* By default, null values create gaps in the line.
|
|
53
65
|
*/
|
|
54
66
|
connectNulls?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Chart layout.
|
|
69
|
+
* @default 'horizontal'
|
|
70
|
+
*/
|
|
71
|
+
layout?: CartesianChartLayout;
|
|
55
72
|
}) => string;
|
|
56
73
|
/**
|
|
57
74
|
* Generates an SVG area path string from data using chart scale functions.
|
|
@@ -81,18 +98,26 @@ export declare const getAreaPath: ({
|
|
|
81
98
|
xScale,
|
|
82
99
|
yScale,
|
|
83
100
|
xData,
|
|
101
|
+
yData,
|
|
84
102
|
connectNulls,
|
|
103
|
+
layout,
|
|
85
104
|
}: {
|
|
86
105
|
data: (number | null)[] | Array<[number, number] | null>;
|
|
87
106
|
xScale: ChartScaleFunction;
|
|
88
107
|
yScale: ChartScaleFunction;
|
|
89
108
|
curve: ChartPathCurveType;
|
|
90
109
|
xData?: number[];
|
|
110
|
+
yData?: number[];
|
|
91
111
|
/**
|
|
92
112
|
* When true, null values are skipped and the area connects across gaps.
|
|
93
113
|
* By default null values create gaps in the area.
|
|
94
114
|
*/
|
|
95
115
|
connectNulls?: boolean;
|
|
116
|
+
/**
|
|
117
|
+
* Chart layout.
|
|
118
|
+
* @default 'horizontal'
|
|
119
|
+
*/
|
|
120
|
+
layout?: CartesianChartLayout;
|
|
96
121
|
}) => string;
|
|
97
122
|
/**
|
|
98
123
|
* Converts line coordinates to an SVG path string.
|
|
@@ -126,5 +151,6 @@ export declare const getBarPath: (
|
|
|
126
151
|
radius: number,
|
|
127
152
|
roundTop: boolean,
|
|
128
153
|
roundBottom: boolean,
|
|
154
|
+
layout?: CartesianChartLayout,
|
|
129
155
|
) => string;
|
|
130
156
|
//# sourceMappingURL=path.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../../../src/chart/utils/path.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,KAAK,kBAAkB,EAAsB,MAAM,SAAS,CAAC;AAEtE,MAAM,MAAM,kBAAkB,GAC1B,MAAM,GACN,YAAY,GACZ,QAAQ,GACR,cAAc,GACd,UAAU,GACV,SAAS,GACT,MAAM,GACN,YAAY,GACZ,WAAW,CAAC;AAEhB
|
|
1
|
+
{"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../../../src/chart/utils/path.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAEtD,OAAO,EAAE,KAAK,kBAAkB,EAAsB,MAAM,SAAS,CAAC;AAEtE;;;GAGG;AACH,eAAO,MAAM,0BAA0B,EAAE,UAGxC,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAC1B,MAAM,GACN,YAAY,GACZ,QAAQ,GACR,cAAc,GACd,UAAU,GACV,SAAS,GACT,MAAM,GACN,YAAY,GACZ,WAAW,CAAC;AA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M,KAAG,MAE3E,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,UAAU,GACrB,GAAG,MAAM,EACT,GAAG,MAAM,EACT,OAAO,MAAM,EACb,QAAQ,MAAM,EACd,QAAQ,MAAM,EACd,UAAU,OAAO,EACjB,aAAa,OAAO,EACpB,SAAQ,oBAAiC,KACxC,MA0BF,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { TextHorizontalAlignment, TextVerticalAlignment } from '../text';
|
|
2
|
-
import {
|
|
2
|
+
import type { CartesianChartLayout } from './context';
|
|
3
|
+
import { type ChartScaleFunction, type PointAnchor } from './scale';
|
|
3
4
|
/**
|
|
4
5
|
* Position a label should be placed relative to the point
|
|
5
6
|
*
|
|
@@ -10,13 +11,17 @@ import { type ChartScaleFunction } from './scale';
|
|
|
10
11
|
export type PointLabelPosition = 'top' | 'bottom' | 'left' | 'right' | 'center';
|
|
11
12
|
/**
|
|
12
13
|
* Get a point from a data value and a scale.
|
|
13
|
-
*
|
|
14
|
-
* @
|
|
15
|
-
* @param
|
|
16
|
-
* @param
|
|
17
|
-
* @returns
|
|
14
|
+
*
|
|
15
|
+
* @param dataValue - The data value to convert to a pixel position.
|
|
16
|
+
* @param scale - The scale function.
|
|
17
|
+
* @param anchor (@default 'middle') - For band scales, where to anchor the point within the band.
|
|
18
|
+
* @returns The pixel value (@default 0 if data value is not defined in scale).
|
|
18
19
|
*/
|
|
19
|
-
export declare const getPointOnScale: (
|
|
20
|
+
export declare const getPointOnScale: (
|
|
21
|
+
dataValue: number,
|
|
22
|
+
scale: ChartScaleFunction,
|
|
23
|
+
anchor?: PointAnchor,
|
|
24
|
+
) => number;
|
|
20
25
|
/**
|
|
21
26
|
* Projects a data point to pixel coordinates using the chart scale.
|
|
22
27
|
* Automatically handles log scale transformations for zero/negative values.
|
|
@@ -64,6 +69,7 @@ export declare const projectPoints: ({
|
|
|
64
69
|
yScale,
|
|
65
70
|
xData,
|
|
66
71
|
yData,
|
|
72
|
+
layout,
|
|
67
73
|
}: {
|
|
68
74
|
data: (
|
|
69
75
|
| number
|
|
@@ -77,6 +83,11 @@ export declare const projectPoints: ({
|
|
|
77
83
|
yData?: number[];
|
|
78
84
|
xScale: ChartScaleFunction;
|
|
79
85
|
yScale: ChartScaleFunction;
|
|
86
|
+
/**
|
|
87
|
+
* Chart layout.
|
|
88
|
+
* @default 'vertical'
|
|
89
|
+
*/
|
|
90
|
+
layout?: CartesianChartLayout;
|
|
80
91
|
}) => Array<{
|
|
81
92
|
x: number;
|
|
82
93
|
y: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"point.d.ts","sourceRoot":"","sources":["../../../src/chart/utils/point.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAE9E,OAAO,EAAE,KAAK,kBAAkB,
|
|
1
|
+
{"version":3,"file":"point.d.ts","sourceRoot":"","sources":["../../../src/chart/utils/point.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAE9E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EAEL,KAAK,kBAAkB,EAGvB,KAAK,WAAW,EACjB,MAAM,SAAS,CAAC;AAEjB;;;;;;GAMG;AACH,MAAM,MAAM,kBAAkB,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;AAEhF;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,GAC1B,WAAW,MAAM,EACjB,OAAO,kBAAkB,EACzB,SAAQ,WAAsB,KAC7B,MAgCF,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,YAAY,GAAI,2BAK1B;IACD,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,MAAM,EAAE,kBAAkB,CAAC;IAC3B,MAAM,EAAE,kBAAkB,CAAC;CAC5B,KAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAEzB,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,aAAa,GAAI,iDAO3B;IACD,IAAI,EAAE,CAAC,MAAM,GAAG,IAAI,GAAG;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,EAAE,CAAC;IACnD,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,EAAE,kBAAkB,CAAC;IAC3B,MAAM,EAAE,kBAAkB,CAAC;IAC3B;;;OAGG;IACH,MAAM,CAAC,EAAE,oBAAoB,CAAC;CAC/B,KAAG,KAAK,CAAC;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CA4CxC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,wBAAwB,GACnC,UAAU,kBAAkB,KAC3B;IAAE,mBAAmB,EAAE,uBAAuB,CAAC;IAAC,iBAAiB,EAAE,qBAAqB,CAAA;CAyB1F,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB,GAC9B,GAAG,MAAM,EACT,GAAG,MAAM,EACT,UAAU,kBAAkB,EAC5B,QAAQ,MAAM,KACb;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CA0BxB,CAAC"}
|
|
@@ -40,4 +40,15 @@ export declare const getCategoricalScale: ({
|
|
|
40
40
|
range: AxisBounds;
|
|
41
41
|
padding?: number;
|
|
42
42
|
}) => CategoricalScale;
|
|
43
|
+
/**
|
|
44
|
+
* Anchor position for points on a scale. Currently used only for band scales.
|
|
45
|
+
*
|
|
46
|
+
* For band scales, this determines where within the band to position a point:
|
|
47
|
+
* - `'stepStart'` - At the start of the step
|
|
48
|
+
* - `'bandStart'` - At the start of the band
|
|
49
|
+
* - `'middle'` - At the center of the band
|
|
50
|
+
* - `'bandEnd'` - At the end of the band
|
|
51
|
+
* - `'stepEnd'` - At the end of the step
|
|
52
|
+
*/
|
|
53
|
+
export type PointAnchor = 'stepStart' | 'bandStart' | 'middle' | 'bandEnd' | 'stepEnd';
|
|
43
54
|
//# sourceMappingURL=scale.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scale.d.ts","sourceRoot":"","sources":["../../../src/chart/utils/scale.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAGzE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAG1C,MAAM,MAAM,kBAAkB,GAAG,QAAQ,GAAG,KAAK,GAAG,MAAM,CAAC;AAE3D,MAAM,MAAM,YAAY,GACpB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,GAClC,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;AAE5C,MAAM,MAAM,gBAAgB,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;AAEjD,MAAM,MAAM,kBAAkB,GAAG,YAAY,GAAG,gBAAgB,CAAC;AAEjE,eAAO,MAAM,kBAAkB,GAAI,OAAO,kBAAkB,KAAG,KAAK,IAAI,gBAEvE,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,OAAO,kBAAkB,KAAG,KAAK,IAAI,YAEnE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,GACrB,OAAO,kBAAkB,KACxB,KAAK,IAAI,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAEjD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,eAAe,GAAI,+BAI7B;IACD,SAAS,EAAE,QAAQ,GAAG,KAAK,C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AK,EAAE,UAAU,CAAC;CACnB,KAAG,YAGH,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,mBAAmB,GAAI,6BAIjC;IACD,MAAM,EAAE,UAAU,CAAC;IACnB,KAAK,EAAE,UAAU,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,KAAG,gBAQH,CAAC;AAEF;;;;;;;;;GASG;AACH,MAAM,MAAM,WAAW,GAAG,WAAW,GAAG,WAAW,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC"}
|
|
@@ -11,13 +11,14 @@ export type LabelDimensions = {
|
|
|
11
11
|
};
|
|
12
12
|
/**
|
|
13
13
|
* Determines which side (left/right) to place scrubber labels based on available space.
|
|
14
|
-
*
|
|
14
|
+
* Honors the preferred side when there's enough space, otherwise switches to the opposite side.
|
|
15
15
|
*/
|
|
16
16
|
export declare const getLabelPosition: (
|
|
17
17
|
beaconX: number,
|
|
18
18
|
maxLabelWidth: number,
|
|
19
19
|
drawingArea: Rect,
|
|
20
20
|
xOffset?: number,
|
|
21
|
+
preferredSide?: ScrubberLabelPosition,
|
|
21
22
|
) => ScrubberLabelPosition;
|
|
22
23
|
type LabelDimension = {
|
|
23
24
|
seriesId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scrubber.d.ts","sourceRoot":"","sources":["../../../src/chart/utils/scrubber.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAEvD,MAAM,MAAM,qBAAqB,GAAG,MAAM,GAAG,OAAO,CAAC;AAErD,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;;GA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