@automattic/charts 3.1.1 → 4.0.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 +41 -0
- package/TOKENS.md +80 -46
- package/dist/index.cjs +1224 -662
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +72 -23
- package/dist/index.d.cts +230 -162
- package/dist/index.d.ts +230 -162
- package/dist/index.js +1224 -663
- package/dist/index.js.map +1 -1
- package/package.json +10 -10
- package/src/charts/area-chart/area-chart.tsx +39 -25
- package/src/charts/area-chart/test/area-chart.test.tsx +4 -33
- package/src/charts/area-chart/test/tick-placement.test.tsx +55 -0
- package/src/charts/area-chart/test/tooltip-resolution-branches.test.tsx +86 -0
- package/src/charts/area-chart/test/tooltip-resolution.test.tsx +69 -0
- package/src/charts/area-chart/types.ts +4 -7
- package/src/charts/bar-chart/bar-chart.tsx +38 -11
- package/src/charts/bar-chart/private/test/use-bar-chart-options-formatting.test.tsx +69 -0
- package/src/charts/bar-chart/private/use-bar-chart-options.ts +27 -15
- package/src/charts/bar-chart/test/bar-chart-pointer-events.test.tsx +67 -0
- package/src/charts/bar-chart/test/bar-chart.test.tsx +79 -0
- package/src/charts/bar-list-chart/bar-list-chart.tsx +45 -2
- package/src/charts/bar-list-chart/test/bar-list-chart.test.tsx +38 -0
- package/src/charts/conversion-funnel-chart/conversion-funnel-chart.module.scss +33 -23
- package/src/charts/conversion-funnel-chart/conversion-funnel-chart.tsx +138 -182
- package/src/charts/conversion-funnel-chart/test/conversion-funnel-chart.test.tsx +46 -0
- package/src/charts/geo-chart/geo-chart.module.scss +1 -0
- package/src/charts/geo-chart/geo-chart.tsx +5 -10
- package/src/charts/geo-chart/test/geo-chart.test.tsx +2 -2
- package/src/charts/heatmap-chart/heatmap-chart.module.scss +21 -16
- package/src/charts/heatmap-chart/heatmap-chart.tsx +45 -28
- package/src/charts/heatmap-chart/private/build-calendar-data.ts +3 -0
- package/src/charts/heatmap-chart/private/heatmap-legend.tsx +11 -4
- package/src/charts/heatmap-chart/test/heatmap-chart.test.tsx +51 -12
- package/src/charts/heatmap-chart/types.ts +2 -2
- package/src/charts/leaderboard-chart/hooks/use-fitted-row-count.ts +2 -2
- package/src/charts/leaderboard-chart/hooks/use-leaderboard-legend-items.ts +3 -5
- package/src/charts/leaderboard-chart/leaderboard-chart.module.scss +31 -19
- package/src/charts/leaderboard-chart/leaderboard-chart.tsx +27 -17
- package/src/charts/leaderboard-chart/test/leaderboard-chart.test.tsx +14 -0
- package/src/charts/leaderboard-chart/test/use-leaderboard-legend-items.test.tsx +2 -9
- package/src/charts/line-chart/line-chart.module.scss +10 -18
- package/src/charts/line-chart/line-chart.tsx +109 -25
- package/src/charts/line-chart/private/line-chart-annotation.tsx +18 -19
- package/src/charts/line-chart/test/default-tooltip-formatting.test.tsx +74 -0
- package/src/charts/line-chart/test/line-chart.test.tsx +74 -3
- package/src/charts/line-chart/test/tick-placement.test.tsx +84 -0
- package/src/charts/line-chart/test/tooltip-resolution.test.tsx +140 -0
- package/src/charts/line-chart/types.ts +4 -1
- package/src/charts/pie-chart/pie-chart.module.scss +13 -1
- package/src/charts/pie-chart/pie-chart.tsx +30 -40
- package/src/charts/pie-chart/test/pie-chart.test.tsx +56 -0
- package/src/charts/pie-semi-circle-chart/pie-semi-circle-chart.module.scss +8 -3
- package/src/charts/pie-semi-circle-chart/pie-semi-circle-chart.tsx +23 -37
- package/src/charts/pie-semi-circle-chart/test/pie-semi-circle-chart.test.tsx +50 -0
- package/src/charts/private/chart-layout/chart-layout.module.scss +3 -2
- package/src/charts/private/svg-empty-state/svg-empty-state.module.scss +1 -1
- package/src/charts/private/test/axis-formatting.test.tsx +85 -0
- package/src/charts/private/test/time-axis-formatting.test.ts +109 -0
- package/src/charts/private/test/time-axis-options.test.ts +267 -0
- package/src/charts/private/test/time-axis-tick-invariants.test.ts +153 -0
- package/src/charts/private/test/time-axis-tick-values.test.ts +280 -0
- package/src/charts/private/test/time-axis.test.ts +9 -69
- package/src/charts/private/time-axis-options.ts +106 -0
- package/src/charts/private/time-axis.ts +318 -136
- package/src/charts/private/x-zoom/x-zoom.module.scss +3 -3
- package/src/charts/private/xy-plot/xy-plot.module.scss +8 -0
- package/src/charts/sparkline/sparkline.tsx +9 -3
- package/src/charts/sparkline/test/sparkline.test.tsx +29 -56
- package/src/charts/sparkline/types.ts +2 -2
- package/src/components/legend/private/base-legend.module.scss +9 -5
- package/src/components/tooltip/accessible-tooltip.tsx +38 -10
- package/src/components/tooltip/base-tooltip.module.scss +3 -3
- package/src/components/tooltip/private/bounded-tooltip.tsx +172 -0
- package/src/components/tooltip/test/accessible-tooltip.test.tsx +67 -0
- package/src/components/tooltip/test/bounded-tooltip.test.tsx +129 -0
- package/src/components/tooltip/test/xy-chart-tooltip.test.tsx +279 -0
- package/src/components/tooltip/xy-chart-tooltip.tsx +288 -0
- package/src/components/trend-indicator/trend-indicator.module.scss +2 -2
- package/src/hooks/test/use-xychart-theme-style-reads.test.tsx +17 -10
- package/src/hooks/test/use-xychart-theme.test.tsx +63 -5
- package/src/hooks/use-xychart-theme.ts +33 -23
- package/src/index.ts +4 -0
- package/src/providers/chart-context/global-charts-provider.tsx +64 -54
- package/src/providers/chart-context/hooks/use-chart-formatting.ts +22 -0
- package/src/providers/chart-context/index.ts +1 -0
- package/src/providers/chart-context/private/catalog-pointers.ts +42 -0
- package/src/providers/chart-context/private/series-palette.ts +35 -0
- package/src/providers/chart-context/test/catalog-pointers.test.ts +61 -0
- package/src/providers/chart-context/test/chart-context.test.tsx +177 -792
- package/src/providers/chart-context/test/use-global-charts-theme.test.tsx +7 -18
- package/src/providers/chart-context/themes.ts +7 -47
- package/src/providers/chart-context/types.ts +3 -0
- package/src/styles/chart-scope.scss +63 -58
- package/src/styles/test/chart-scope.test.ts +25 -40
- package/src/test-utils/series-fixtures.ts +31 -0
- package/src/types.ts +103 -73
- package/src/utils/bucket-info.ts +87 -0
- package/src/utils/color-utils.ts +0 -27
- package/src/utils/date-formatting.ts +174 -0
- package/src/utils/get-styles.ts +7 -1
- package/src/utils/index.ts +3 -0
- package/src/utils/test/bucket-info.test.ts +185 -0
- package/src/utils/test/color-utils.test.ts +1 -48
- package/src/utils/test/date-formatting.test.ts +89 -0
- package/src/utils/test/get-styles.test.ts +10 -7
- package/src/utils/test/merge-themes.test.ts +18 -46
- package/src/visx/types.ts +29 -2
- package/src/hooks/test/use-xychart-theme-provider-override.test.tsx +0 -28
- package/src/providers/chart-context/private/theme-override-vars.ts +0 -87
- package/src/providers/chart-context/private/with-catalog-pointers.ts +0 -50
- package/src/providers/chart-context/test/sparse-theme.test.ts +0 -35
- package/src/providers/chart-context/test/theme-override-vars-guard.test.tsx +0 -29
- package/src/providers/chart-context/test/theme-override-vars.test.ts +0 -118
- package/src/providers/chart-context/test/with-catalog-pointers.test.ts +0 -47
- package/src/styles/test/wpds-fallbacks.test.ts +0 -131
package/dist/index.d.cts
CHANGED
|
@@ -7,7 +7,6 @@ import { EventHandlerParams, EventHandlerParams as EventHandlerParams$1, GlyphPr
|
|
|
7
7
|
import { CSSProperties, ComponentClass, ComponentProps, ComponentType, FC, MouseEvent, PointerEvent, PropsWithChildren, ReactElement, ReactNode, SVGProps } from "react";
|
|
8
8
|
import { TooltipProps as TooltipProps$1, UseTooltipPortalOptions } from "@visx/tooltip";
|
|
9
9
|
import { PieProvidedProps } from "@visx/shape";
|
|
10
|
-
|
|
11
10
|
//#region src/types.d.ts
|
|
12
11
|
type ValueOf<T> = T[keyof T];
|
|
13
12
|
type Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>;
|
|
@@ -60,8 +59,13 @@ type GoogleDataTableCell = {
|
|
|
60
59
|
type GoogleDataTableRow = GoogleDataTableCell[];
|
|
61
60
|
type ChartType = 'area' | 'bar' | 'conversion-funnel' | 'leaderboard' | 'line' | 'pie' | 'pie-semi-circle';
|
|
62
61
|
type OrientationType = ValueOf<typeof Orientation>;
|
|
62
|
+
/**
|
|
63
|
+
* Styling for one annotation, as its `styles` prop. Colors belong here because
|
|
64
|
+
* `--a8c-charts-color-annotation` moves every annotation on the page at once and no
|
|
65
|
+
* selector narrows it to one.
|
|
66
|
+
*/
|
|
63
67
|
type AnnotationStyles = {
|
|
64
|
-
circleSubject?: Omit<CircleSubjectProps, 'x' | 'y'> & {
|
|
68
|
+
circleSubject?: Omit<CircleSubjectProps, 'x' | 'y' | 'fill'> & {
|
|
65
69
|
fill?: string;
|
|
66
70
|
};
|
|
67
71
|
lineSubject?: Omit<LineSubjectProps, 'x' | 'y'>;
|
|
@@ -71,6 +75,19 @@ type AnnotationStyles = {
|
|
|
71
75
|
y?: number | 'start' | 'end';
|
|
72
76
|
};
|
|
73
77
|
};
|
|
78
|
+
/**
|
|
79
|
+
* Annotation styling on the theme: geometry only. Colors come from
|
|
80
|
+
* `--a8c-charts-color-annotation` and `--a8c-charts-color-surface`.
|
|
81
|
+
*/
|
|
82
|
+
type ThemeAnnotationStyles = {
|
|
83
|
+
circleSubject?: Omit<CircleSubjectProps, 'x' | 'y' | 'fill' | 'stroke'>;
|
|
84
|
+
lineSubject?: Omit<LineSubjectProps, 'x' | 'y' | 'stroke'>;
|
|
85
|
+
connector?: Omit<ConnectorProps, 'x' | 'y' | 'dx' | 'dy' | 'stroke'>;
|
|
86
|
+
label?: Omit<LabelProps, 'title' | 'subtitle' | 'x' | 'y' | 'anchorLineStroke' | 'backgroundFill'> & {
|
|
87
|
+
x?: number | 'start' | 'end';
|
|
88
|
+
y?: number | 'start' | 'end';
|
|
89
|
+
};
|
|
90
|
+
};
|
|
74
91
|
type DataPoint = {
|
|
75
92
|
label: string;
|
|
76
93
|
value: number;
|
|
@@ -240,7 +257,7 @@ type DataPointPercentage = {
|
|
|
240
257
|
*/
|
|
241
258
|
valueDisplay?: string;
|
|
242
259
|
/**
|
|
243
|
-
* Color code for the segment, by default
|
|
260
|
+
* Color code for the segment, by default colors are taken from the theme but this property can overrides it
|
|
244
261
|
*/
|
|
245
262
|
color?: string;
|
|
246
263
|
/**
|
|
@@ -259,72 +276,77 @@ type DataPointPercentageCalculated = DataPointPercentage & {
|
|
|
259
276
|
percentage: number;
|
|
260
277
|
};
|
|
261
278
|
/**
|
|
262
|
-
* Base theme configuration for chart components
|
|
279
|
+
* Base theme configuration for chart components: shape and spacing. Chart colors are
|
|
280
|
+
* `--a8c-charts-color-*` roles set in CSS inside the provider tree, catalogued in
|
|
281
|
+
* `TOKENS.md`.
|
|
263
282
|
*/
|
|
264
283
|
type ChartTheme = {
|
|
265
|
-
/**
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
284
|
+
/** Optional CSS styles for grid lines. */
|
|
285
|
+
gridStyles?: Omit<GridStyles$1, 'stroke'>;
|
|
286
|
+
/** Length of axis ticks in pixels */
|
|
287
|
+
tickLength: number;
|
|
288
|
+
/** Styles for x-axis tick lines */
|
|
289
|
+
xTickLineStyles?: Omit<LineStyles$1, 'stroke'>;
|
|
290
|
+
/** Styles for x-axis line */
|
|
291
|
+
xAxisLineStyles?: Omit<LineStyles$1, 'stroke'>;
|
|
292
|
+
/**
|
|
293
|
+
* Per-series line styling — dash pattern, width, cap. These spread on top of the
|
|
294
|
+
* palette-derived stroke, so a color here would override it; a single series takes
|
|
295
|
+
* one through `options.seriesLineStyle`.
|
|
296
|
+
*/
|
|
297
|
+
seriesLineStyles?: Array<Omit<LineStyles$1, 'stroke'>>;
|
|
298
|
+
/** Array of render functions for glyphs */
|
|
299
|
+
glyphs?: Array<(<Datum extends object>(props: GlyphProps<Datum>) => ReactNode)>;
|
|
300
|
+
/** Legend specific settings */
|
|
277
301
|
legend?: {
|
|
278
|
-
/** Styles for legend shapes */
|
|
279
|
-
|
|
302
|
+
/** Styles for legend shapes */
|
|
303
|
+
shapeStyles?: Record<string, unknown>[];
|
|
304
|
+
/** Styles for legend labels. */
|
|
305
|
+
labelStyles?: Omit<CSSProperties, 'color'>;
|
|
306
|
+
/** Styles for legend container */
|
|
280
307
|
containerStyles?: CSSProperties;
|
|
281
|
-
};
|
|
282
|
-
|
|
308
|
+
};
|
|
309
|
+
/**
|
|
310
|
+
* Styles for small SVG text (eg. axis tick labels), passed through to the XYChart theme.
|
|
311
|
+
*
|
|
312
|
+
* `fontFamily: 'inherit'` is load-bearing here — it overrides the font stack
|
|
313
|
+
* `buildChartTheme` injects inline on SVG `<text>`.
|
|
314
|
+
*/
|
|
315
|
+
svgLabelSmall?: Omit<TextProps, 'fill'>;
|
|
316
|
+
/** Styles for large SVG text (eg. axis titles), passed through to the XYChart theme. */
|
|
283
317
|
svgLabelBig?: TextProps;
|
|
284
|
-
annotationStyles?:
|
|
285
|
-
|
|
286
|
-
/** Default fill color for a geo chart feature (e.g. country) with no data */featureFillColor?: string;
|
|
287
|
-
}; /** LeaderboardChart specific settings */
|
|
318
|
+
annotationStyles?: ThemeAnnotationStyles;
|
|
319
|
+
/** LeaderboardChart specific settings */
|
|
288
320
|
leaderboardChart?: {
|
|
289
|
-
/**
|
|
290
|
-
|
|
291
|
-
labelSpacing?: GapSize; /** Primary color for current period bars */
|
|
292
|
-
primaryColor?: string; /** Secondary color for comparison period bars */
|
|
293
|
-
secondaryColor?: string; /** Delta colors: [negative, neutral, positive] */
|
|
294
|
-
deltaColors?: [string, string, string];
|
|
295
|
-
}; /** ConversionFunnelChart specific settings */
|
|
296
|
-
conversionFunnelChart?: {
|
|
297
|
-
/** Primary color for funnel bars */primaryColor?: string; /** Background color for chart container */
|
|
298
|
-
backgroundColor?: string; /** Color for positive change indicators */
|
|
299
|
-
positiveChangeColor?: string; /** Color for negative change indicators */
|
|
300
|
-
negativeChangeColor?: string;
|
|
321
|
+
/** Spacing between label and progress bars */
|
|
322
|
+
labelSpacing?: GapSize;
|
|
301
323
|
};
|
|
302
324
|
lineChart?: {
|
|
303
|
-
lineStyles?: Partial<Record<NonNullable<SeriesDataOptions['type']>, LineStyles$1
|
|
325
|
+
lineStyles?: Partial<Record<NonNullable<SeriesDataOptions['type']>, Omit<LineStyles$1, 'stroke'>>>;
|
|
304
326
|
};
|
|
305
327
|
barChart?: {
|
|
306
328
|
barStyles?: Partial<Record<NonNullable<SeriesDataOptions['type']>, BarStyles>>;
|
|
307
|
-
};
|
|
329
|
+
};
|
|
330
|
+
/** Sparkline specific settings */
|
|
308
331
|
sparkline?: {
|
|
309
|
-
/** Margin around the sparkline chart */
|
|
332
|
+
/** Margin around the sparkline chart */
|
|
333
|
+
margin?: {
|
|
310
334
|
top?: number;
|
|
311
335
|
right?: number;
|
|
312
336
|
bottom?: number;
|
|
313
337
|
left?: number;
|
|
314
|
-
};
|
|
338
|
+
};
|
|
339
|
+
/** Stroke width for the sparkline line */
|
|
315
340
|
strokeWidth?: number;
|
|
316
341
|
};
|
|
317
342
|
/**
|
|
318
343
|
* HeatmapChart settings. Cell gap, radius, value size and the selection ring come from
|
|
319
|
-
* WPDS tokens in CSS, so only the
|
|
344
|
+
* WPDS tokens in CSS, so only the compact sizing lives here.
|
|
320
345
|
*/
|
|
321
346
|
heatmapChart?: {
|
|
322
|
-
/**
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
*/
|
|
326
|
-
primaryColor?: string; /** Gap in px between cells in compact mode */
|
|
327
|
-
compactCellGap?: number; /** Fixed square cell size in px for compact mode */
|
|
347
|
+
/** Gap in px between cells in compact mode */
|
|
348
|
+
compactCellGap?: number;
|
|
349
|
+
/** Fixed square cell size in px for compact mode */
|
|
328
350
|
compactCellSize?: number;
|
|
329
351
|
};
|
|
330
352
|
};
|
|
@@ -333,10 +355,9 @@ type ChartTheme = {
|
|
|
333
355
|
* Useful for merged themes where defaults are provided for all optional properties.
|
|
334
356
|
*/
|
|
335
357
|
type CompleteChartTheme = Required<ChartTheme> & {
|
|
336
|
-
leaderboardChart:
|
|
337
|
-
conversionFunnelChart: Omit<Required<NonNullable<ChartTheme['conversionFunnelChart']>>, 'primaryColor'> & Pick<NonNullable<ChartTheme['conversionFunnelChart']>, 'primaryColor'>;
|
|
358
|
+
leaderboardChart: Required<NonNullable<ChartTheme['leaderboardChart']>>;
|
|
338
359
|
lineChart: {
|
|
339
|
-
lineStyles: Record<NonNullable<SeriesDataOptions['type']>, LineStyles$1
|
|
360
|
+
lineStyles: Record<NonNullable<SeriesDataOptions['type']>, Omit<LineStyles$1, 'stroke'>>;
|
|
340
361
|
};
|
|
341
362
|
barChart: {
|
|
342
363
|
barStyles: Record<NonNullable<SeriesDataOptions['type']>, BarStyles>;
|
|
@@ -345,13 +366,47 @@ type CompleteChartTheme = Required<ChartTheme> & {
|
|
|
345
366
|
sparkline: Required<NonNullable<ChartTheme['sparkline']>> & {
|
|
346
367
|
margin: Required<NonNullable<ChartTheme['sparkline']>['margin']>;
|
|
347
368
|
};
|
|
348
|
-
heatmapChart:
|
|
369
|
+
heatmapChart: Required<NonNullable<ChartTheme['heatmapChart']>>;
|
|
349
370
|
};
|
|
350
371
|
/**
|
|
351
372
|
* Bucket resolution of time-series data, as known by the caller (e.g. a
|
|
352
373
|
* granularity selector), for consumers that don't need to infer it.
|
|
353
374
|
*/
|
|
354
375
|
type TickResolution = 'hour' | 'day' | 'week' | 'month' | 'year';
|
|
376
|
+
/**
|
|
377
|
+
* How a chart classified the buckets of the data it's drawing.
|
|
378
|
+
*/
|
|
379
|
+
type BucketInfo = {
|
|
380
|
+
/**
|
|
381
|
+
* The bucket the series has. Only reports `'week'` when declared: seven-day
|
|
382
|
+
* spacing is indistinguishable from sparse daily data.
|
|
383
|
+
*/
|
|
384
|
+
bucket: TickResolution;
|
|
385
|
+
/** The classification tick formats are keyed on. `'week'` reads as `'day'`. */
|
|
386
|
+
displayResolution: Exclude<TickResolution, 'week'>;
|
|
387
|
+
};
|
|
388
|
+
/**
|
|
389
|
+
* The locale and time zone the time axis and the built-in tooltips render dates
|
|
390
|
+
* in, set once by the host on `GlobalChartsProvider`.
|
|
391
|
+
*
|
|
392
|
+
* Both halves are plain strings the host resolves for itself, so a non-WordPress
|
|
393
|
+
* consumer needs no WordPress package to supply them. Both are optional and
|
|
394
|
+
* default to the JavaScript runtime's own — the viewer's browser locale and
|
|
395
|
+
* browser time zone — which is what every version before this one used
|
|
396
|
+
* unconditionally.
|
|
397
|
+
*
|
|
398
|
+
* `timeZone` re-dates the instants the host supplies, so a value that is really a
|
|
399
|
+
* calendar day shifts under it: `new Date( '2026-08-02' )` is UTC midnight and
|
|
400
|
+
* labels as Aug 1 in `America/Los_Angeles`. Supply true instants alongside a
|
|
401
|
+
* `timeZone`, or set only `locale` for day-bucketed data. `HeatmapChart`'s
|
|
402
|
+
* calendar labels take neither — see `buildCalendarHeatmapData`.
|
|
403
|
+
*/
|
|
404
|
+
type ChartFormatting = {
|
|
405
|
+
/** BCP-47 language tag, e.g. `de-DE`. Defaults to the runtime's locale. */
|
|
406
|
+
locale?: string;
|
|
407
|
+
/** IANA time zone name, e.g. `Asia/Tokyo`. Defaults to the runtime's zone. */
|
|
408
|
+
timeZone?: string;
|
|
409
|
+
};
|
|
355
410
|
type AxisOptions = {
|
|
356
411
|
orientation?: OrientationType;
|
|
357
412
|
numTicks?: number;
|
|
@@ -426,7 +481,9 @@ type ScaleOptions = {
|
|
|
426
481
|
paddingOuter?: number;
|
|
427
482
|
};
|
|
428
483
|
type LegendItemStyles = {
|
|
429
|
-
/** Margin around each legend item. */
|
|
484
|
+
/** Margin around each legend item. */
|
|
485
|
+
margin?: CSSProperties['margin'];
|
|
486
|
+
/** Flex direction for items within each legend entry. */
|
|
430
487
|
flexDirection?: 'row' | 'row-reverse' | 'column' | 'column-reverse';
|
|
431
488
|
};
|
|
432
489
|
type LegendLabelStyles = Pick<CSSProperties, 'justifyContent' | 'flex' | 'margin'> & {
|
|
@@ -443,8 +500,11 @@ type LegendLabelStyles = Pick<CSSProperties, 'justifyContent' | 'flex' | 'margin
|
|
|
443
500
|
textOverflow?: 'ellipsis' | 'wrap';
|
|
444
501
|
};
|
|
445
502
|
type LegendShapeStyles = {
|
|
446
|
-
/** Width of the legend shape in pixels. */
|
|
447
|
-
|
|
503
|
+
/** Width of the legend shape in pixels. */
|
|
504
|
+
width?: number;
|
|
505
|
+
/** Height of the legend shape in pixels. */
|
|
506
|
+
height?: number;
|
|
507
|
+
/** Margin around the legend shape. */
|
|
448
508
|
margin?: CSSProperties['margin'];
|
|
449
509
|
};
|
|
450
510
|
/** Position of the legend relative to chart content. */
|
|
@@ -498,7 +558,7 @@ type ChartLegendConfig<T = DataPoint | DataPointDate | LeaderboardEntry> = {
|
|
|
498
558
|
/**
|
|
499
559
|
* Legend config for charts built from `SeriesData` (line, bar, area). Adds `collapseGroups` on top
|
|
500
560
|
* of the shared config. It is intentionally absent from the base `ChartLegendConfig` so point-based
|
|
501
|
-
* charts (pie, semi-circle pie) — whose data points carry `group` only to coordinate
|
|
561
|
+
* charts (pie, semi-circle pie) — whose data points carry `group` only to coordinate colors — can't
|
|
502
562
|
* set it.
|
|
503
563
|
*/
|
|
504
564
|
type SeriesChartLegendConfig = ChartLegendConfig<SeriesData[]> & {
|
|
@@ -576,6 +636,16 @@ type BaseChartProps<T = DataPoint | DataPointDate | LeaderboardEntry> = {
|
|
|
576
636
|
* Callback function for pointer out event
|
|
577
637
|
*/
|
|
578
638
|
onPointerOut?: (event: PointerEvent<Element>) => void;
|
|
639
|
+
/**
|
|
640
|
+
* Callback for Enter or Space on the point keyboard navigation has selected:
|
|
641
|
+
* the keyboard counterpart of a click. `index` is the point's position in its
|
|
642
|
+
* series and `key` the series label.
|
|
643
|
+
*/
|
|
644
|
+
onDatumActivate?: (params: {
|
|
645
|
+
datum: DataPoint | DataPointDate;
|
|
646
|
+
index: number;
|
|
647
|
+
key: string;
|
|
648
|
+
}) => void;
|
|
579
649
|
/**
|
|
580
650
|
* Whether to show tooltips on hover. False by default.
|
|
581
651
|
*/
|
|
@@ -622,11 +692,16 @@ type BaseLegendProps = VisxLegendProps & {
|
|
|
622
692
|
items: BaseLegendItem[];
|
|
623
693
|
orientation?: 'horizontal' | 'vertical';
|
|
624
694
|
position?: LegendPosition;
|
|
625
|
-
alignment?: 'start' | 'center' | 'end';
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
695
|
+
alignment?: 'start' | 'center' | 'end';
|
|
696
|
+
/** Additional CSS class name for legend items. */
|
|
697
|
+
itemClassName?: string;
|
|
698
|
+
/** CSS styles for each legend item (margin, flexDirection). */
|
|
699
|
+
itemStyles?: LegendItemStyles;
|
|
700
|
+
/** Additional CSS class name for legend labels. */
|
|
701
|
+
labelClassName?: string;
|
|
702
|
+
/** CSS styles for legend labels (justifyContent, flex, margin). */
|
|
703
|
+
labelStyles?: LegendLabelStyles;
|
|
704
|
+
/** Styles for legend shapes (width, height, margin). */
|
|
630
705
|
shapeStyles?: LegendShapeStyles;
|
|
631
706
|
/**
|
|
632
707
|
* Function for rendering a custom legend layout.
|
|
@@ -729,8 +804,36 @@ type XyChartTooltipProps<Datum extends object> = {
|
|
|
729
804
|
verticalCrosshairStyle?: SVGProps<SVGLineElement>;
|
|
730
805
|
horizontalCrosshairStyle?: SVGProps<SVGLineElement>;
|
|
731
806
|
glyphStyle?: SVGProps<SVGCircleElement>;
|
|
807
|
+
/**
|
|
808
|
+
* Flip and clamp the tooltip box so it stays inside the nearest ancestor
|
|
809
|
+
* that clips its overflow, or the viewport when there is none. The box may
|
|
810
|
+
* leave the chart wrapper. (It used to keep a body-level portal inside the
|
|
811
|
+
* viewport.)
|
|
812
|
+
* @default true
|
|
813
|
+
*/
|
|
814
|
+
detectBounds?: boolean;
|
|
815
|
+
/**
|
|
816
|
+
* Stacking order of the tooltip box inside the chart wrapper, which isolates
|
|
817
|
+
* its stacking context: the value never competes with page chrome outside
|
|
818
|
+
* the chart.
|
|
819
|
+
* @default 3
|
|
820
|
+
*/
|
|
821
|
+
zIndex?: number;
|
|
822
|
+
/**
|
|
823
|
+
* @deprecated Accepted and ignored. The box renders inside the chart wrapper
|
|
824
|
+
* and moves with it, so it needs no scroll tracking.
|
|
825
|
+
*/
|
|
826
|
+
scroll?: boolean;
|
|
827
|
+
/**
|
|
828
|
+
* @deprecated Accepted and ignored. Nothing measures the box any more, so
|
|
829
|
+
* there is no measurement to debounce.
|
|
830
|
+
*/
|
|
831
|
+
debounce?: number;
|
|
832
|
+
/**
|
|
833
|
+
* @deprecated Accepted and ignored. No ResizeObserver is used.
|
|
834
|
+
*/
|
|
732
835
|
resizeObserverPolyfill?: UseTooltipPortalOptions['polyfill'];
|
|
733
|
-
} & Omit<TooltipProps$1, 'left' | 'top' | 'children'
|
|
836
|
+
} & Omit<TooltipProps$1, 'left' | 'top' | 'children' | 'applyPositionStyle'>;
|
|
734
837
|
//#endregion
|
|
735
838
|
//#region src/charts/line-chart/types.d.ts
|
|
736
839
|
type LineChartAnnotationProps = {
|
|
@@ -762,7 +865,9 @@ interface LineChartProps extends BaseChartProps<SeriesData[]>, SeriesVisibilityP
|
|
|
762
865
|
withGradientFill: boolean;
|
|
763
866
|
smoothing?: boolean;
|
|
764
867
|
curveType?: CurveType;
|
|
765
|
-
renderTooltip?: (params: RenderTooltipParams<DataPointDate>
|
|
868
|
+
renderTooltip?: (params: RenderTooltipParams<DataPointDate> & {
|
|
869
|
+
bucketInfo?: BucketInfo;
|
|
870
|
+
}) => ReactNode;
|
|
766
871
|
withStartGlyphs?: boolean;
|
|
767
872
|
withEndGlyphs?: boolean;
|
|
768
873
|
renderGlyph?: <Datum extends object>(props: GlyphProps<Datum>) => ReactNode;
|
|
@@ -825,7 +930,9 @@ interface AreaChartProps extends BaseChartProps<SeriesData[]>, SeriesVisibilityP
|
|
|
825
930
|
/**
|
|
826
931
|
* Custom tooltip renderer.
|
|
827
932
|
*/
|
|
828
|
-
renderTooltip?: (params: RenderTooltipParams<DataPointDate>
|
|
933
|
+
renderTooltip?: (params: RenderTooltipParams<DataPointDate> & {
|
|
934
|
+
bucketInfo?: BucketInfo;
|
|
935
|
+
}) => ReactNode;
|
|
829
936
|
/**
|
|
830
937
|
* Whether to show crosshair lines in the tooltip.
|
|
831
938
|
*/
|
|
@@ -857,12 +964,6 @@ interface AreaChartProps extends BaseChartProps<SeriesData[]>, SeriesVisibilityP
|
|
|
857
964
|
* @default true
|
|
858
965
|
*/
|
|
859
966
|
rescaleYOnVisibilityChange?: boolean;
|
|
860
|
-
/**
|
|
861
|
-
* @deprecated Use `rescaleYOnVisibilityChange`. The behaviour keys off series
|
|
862
|
-
* visibility changing, not specifically a legend toggle. Still honoured when
|
|
863
|
-
* `rescaleYOnVisibilityChange` is not set.
|
|
864
|
-
*/
|
|
865
|
-
rescaleYOnLegendToggle?: boolean;
|
|
866
967
|
children?: ReactNode;
|
|
867
968
|
}
|
|
868
969
|
//#endregion
|
|
@@ -983,19 +1084,11 @@ interface RenderValueProps {
|
|
|
983
1084
|
formatter: (value: number) => string;
|
|
984
1085
|
}
|
|
985
1086
|
declare const BarListChart: FC<BarListChartProps>;
|
|
986
|
-
declare const BarListChartResponsive: ({
|
|
987
|
-
resizeDebounceTime,
|
|
988
|
-
maxWidth,
|
|
989
|
-
aspectRatio,
|
|
990
|
-
size,
|
|
991
|
-
width,
|
|
992
|
-
height,
|
|
993
|
-
...chartProps
|
|
994
|
-
}: Omit<BarListChartProps, "height" | "size" | "width"> & {
|
|
1087
|
+
declare const BarListChartResponsive: ({ resizeDebounceTime, maxWidth, aspectRatio, size, width, height, ...chartProps }: Omit<BarListChartProps, "height" | "size" | "width"> & {
|
|
995
1088
|
width?: number;
|
|
996
1089
|
height?: number;
|
|
997
1090
|
size?: number;
|
|
998
|
-
} & ResponsiveConfig) => import("react
|
|
1091
|
+
} & ResponsiveConfig) => import("react").JSX.Element;
|
|
999
1092
|
//#endregion
|
|
1000
1093
|
//#region src/charts/conversion-funnel-chart/types.d.ts
|
|
1001
1094
|
/**
|
|
@@ -1137,24 +1230,17 @@ interface GeoChartProps extends Pick<BaseChartProps, 'className' | 'chartId' | '
|
|
|
1137
1230
|
//#endregion
|
|
1138
1231
|
//#region src/charts/geo-chart/geo-chart.d.ts
|
|
1139
1232
|
declare const GeoChartWithProvider: FC<GeoChartProps>;
|
|
1140
|
-
declare const GeoChartResponsive: ({
|
|
1141
|
-
resizeDebounceTime,
|
|
1142
|
-
maxWidth,
|
|
1143
|
-
aspectRatio,
|
|
1144
|
-
size,
|
|
1145
|
-
width,
|
|
1146
|
-
height,
|
|
1147
|
-
...chartProps
|
|
1148
|
-
}: Omit<GeoChartProps, "height" | "size" | "width"> & {
|
|
1233
|
+
declare const GeoChartResponsive: ({ resizeDebounceTime, maxWidth, aspectRatio, size, width, height, ...chartProps }: Omit<GeoChartProps, "height" | "size" | "width"> & {
|
|
1149
1234
|
width?: number;
|
|
1150
1235
|
height?: number;
|
|
1151
1236
|
size?: number;
|
|
1152
|
-
} & ResponsiveConfig) => import("react
|
|
1237
|
+
} & ResponsiveConfig) => import("react").JSX.Element;
|
|
1153
1238
|
//#endregion
|
|
1154
1239
|
//#region src/charts/heatmap-chart/types.d.ts
|
|
1155
1240
|
/** A single heatmap cell. `value: null` marks an empty cell. */
|
|
1156
1241
|
type HeatmapCell = {
|
|
1157
|
-
/** Per-cell label used in the tooltip / accessible name. */
|
|
1242
|
+
/** Per-cell label used in the tooltip / accessible name. */
|
|
1243
|
+
label?: string;
|
|
1158
1244
|
value: number | null;
|
|
1159
1245
|
/**
|
|
1160
1246
|
* Leave the cell's grid slot empty: nothing is painted and the cell is
|
|
@@ -1174,7 +1260,8 @@ type HeatmapCell = {
|
|
|
1174
1260
|
};
|
|
1175
1261
|
/** A heatmap column (rendered left→right); its cells render top→bottom. */
|
|
1176
1262
|
type HeatmapColumn = {
|
|
1177
|
-
/** x-axis label for this column. Empty/omitted renders blank. */
|
|
1263
|
+
/** x-axis label for this column. Empty/omitted renders blank. */
|
|
1264
|
+
label?: string;
|
|
1178
1265
|
data: HeatmapCell[];
|
|
1179
1266
|
};
|
|
1180
1267
|
type HeatmapTooltipData = {
|
|
@@ -1214,8 +1301,8 @@ interface HeatmapChartProps extends Omit<BaseChartProps<HeatmapColumn[]>, 'showL
|
|
|
1214
1301
|
/** Floor a cell's height (px) in non-compact mode; see `minCellWidth`. */
|
|
1215
1302
|
minCellHeight?: number;
|
|
1216
1303
|
/**
|
|
1217
|
-
* Color the cell scale interpolates toward at the highest value
|
|
1218
|
-
*
|
|
1304
|
+
* Color the cell scale interpolates toward at the highest value. Defaults to the
|
|
1305
|
+
* first series palette slot, `--a8c-charts-color-series-1`.
|
|
1219
1306
|
*/
|
|
1220
1307
|
primaryColor?: string;
|
|
1221
1308
|
renderTooltip?: (data: HeatmapTooltipData) => ReactNode;
|
|
@@ -1338,25 +1425,27 @@ declare const LeaderboardChart: FC<LeaderboardChartProps> & {
|
|
|
1338
1425
|
chartId?: string;
|
|
1339
1426
|
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
1340
1427
|
};
|
|
1341
|
-
declare const LeaderboardChartResponsive: (({
|
|
1342
|
-
resizeDebounceTime,
|
|
1343
|
-
maxWidth,
|
|
1344
|
-
aspectRatio,
|
|
1345
|
-
size,
|
|
1346
|
-
width,
|
|
1347
|
-
height,
|
|
1348
|
-
...chartProps
|
|
1349
|
-
}: Omit<LeaderboardChartProps, "height" | "size" | "width"> & {
|
|
1428
|
+
declare const LeaderboardChartResponsive: (({ resizeDebounceTime, maxWidth, aspectRatio, size, width, height, ...chartProps }: Omit<LeaderboardChartProps, "height" | "size" | "width"> & {
|
|
1350
1429
|
width?: number;
|
|
1351
1430
|
height?: number;
|
|
1352
1431
|
size?: number;
|
|
1353
|
-
} & ResponsiveConfig) => import("react
|
|
1432
|
+
} & ResponsiveConfig) => import("react").JSX.Element) & {
|
|
1354
1433
|
Legend: import("react").ForwardRefExoticComponent<Omit<BaseLegendProps, "items"> & {
|
|
1355
1434
|
items?: BaseLegendItem[];
|
|
1356
1435
|
chartId?: string;
|
|
1357
1436
|
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
1358
1437
|
};
|
|
1359
1438
|
//#endregion
|
|
1439
|
+
//#region src/utils/bucket-info.d.ts
|
|
1440
|
+
/**
|
|
1441
|
+
* How this data was classified, for consumers that render their own labels.
|
|
1442
|
+
*
|
|
1443
|
+
* @param data - The series the chart draws, in any order, dated by `date` or `dateString`.
|
|
1444
|
+
* @param tickResolution - Caller-declared bucket resolution, when known.
|
|
1445
|
+
* @return The declared or inferred bucket, and the resolution formats key on.
|
|
1446
|
+
*/
|
|
1447
|
+
declare const getBucketInfo: (data: SeriesData[], tickResolution?: TickResolution) => BucketInfo;
|
|
1448
|
+
//#endregion
|
|
1360
1449
|
//#region src/utils/date-parsing.d.ts
|
|
1361
1450
|
/**
|
|
1362
1451
|
* @file Date parsing utilities using date-fns for local timezone handling
|
|
@@ -1438,11 +1527,7 @@ type FormatMetricValueOptions = {
|
|
|
1438
1527
|
* @param options.signDisplay - Controls when to display the sign (auto, always, never, exceptZero)
|
|
1439
1528
|
* @return Formatted string
|
|
1440
1529
|
*/
|
|
1441
|
-
declare const formatMetricValue: (value: string | number, type?: MetricValueType, {
|
|
1442
|
-
decimals,
|
|
1443
|
-
useMultipliers,
|
|
1444
|
-
signDisplay
|
|
1445
|
-
}?: FormatMetricValueOptions) => string;
|
|
1530
|
+
declare const formatMetricValue: (value: string | number, type?: MetricValueType, { decimals, useMultipliers, signDisplay }?: FormatMetricValueOptions) => string;
|
|
1446
1531
|
//#endregion
|
|
1447
1532
|
//#region src/utils/format-percentage.d.ts
|
|
1448
1533
|
/**
|
|
@@ -1503,14 +1588,6 @@ declare const getColorDistance: (hsl1: [number, number, number], hsl2: [number,
|
|
|
1503
1588
|
* @return HSL tuple [h, s, l] or null if invalid
|
|
1504
1589
|
*/
|
|
1505
1590
|
declare const parseHslString: (hslString: string) => [number, number, number] | null;
|
|
1506
|
-
/**
|
|
1507
|
-
* Parse an RGB string like 'rgb(255, 0, 0)' into a hex color.
|
|
1508
|
-
*
|
|
1509
|
-
* @deprecated Use normalizeColorToHex() instead, which handles all color formats including rgb() and rgba().
|
|
1510
|
-
* @param rgbString - RGB color string (not RGBA)
|
|
1511
|
-
* @return hex color string or null if invalid
|
|
1512
|
-
*/
|
|
1513
|
-
declare const parseRgbString: (rgbString: string) => string | null;
|
|
1514
1591
|
/**
|
|
1515
1592
|
* Normalize any CSS color value to a hex color string.
|
|
1516
1593
|
* Handles hex, HSL, HSLA, RGB, RGBA, named CSS colors, and CSS variables.
|
|
@@ -1588,14 +1665,7 @@ declare const resolveCssVariable: (value: string, element?: HTMLElement | null)
|
|
|
1588
1665
|
* @param root0.legendLabels.comparison - Label for comparison period data
|
|
1589
1666
|
* @return Array of legend items for the leaderboard chart
|
|
1590
1667
|
*/
|
|
1591
|
-
declare function useLeaderboardLegendItems({
|
|
1592
|
-
data,
|
|
1593
|
-
primaryColor,
|
|
1594
|
-
secondaryColor,
|
|
1595
|
-
withComparison,
|
|
1596
|
-
withOverlayLabel,
|
|
1597
|
-
legendLabels
|
|
1598
|
-
}: {
|
|
1668
|
+
declare function useLeaderboardLegendItems({ data, primaryColor, secondaryColor, withComparison, withOverlayLabel, legendLabels }: {
|
|
1599
1669
|
data: LeaderboardEntry[];
|
|
1600
1670
|
primaryColor?: string;
|
|
1601
1671
|
secondaryColor?: string;
|
|
@@ -1790,7 +1860,7 @@ type GradientConfig = {
|
|
|
1790
1860
|
*/
|
|
1791
1861
|
from?: string;
|
|
1792
1862
|
/**
|
|
1793
|
-
* End color for gradient (defaults to
|
|
1863
|
+
* End color for gradient (defaults to `--a8c-charts-color-background`)
|
|
1794
1864
|
*/
|
|
1795
1865
|
to?: string;
|
|
1796
1866
|
/**
|
|
@@ -1826,7 +1896,7 @@ interface SparklineProps {
|
|
|
1826
1896
|
size?: number;
|
|
1827
1897
|
/**
|
|
1828
1898
|
* Color for the line stroke (hex or CSS color)
|
|
1829
|
-
* @default
|
|
1899
|
+
* @default The first series palette color (`--a8c-charts-color-series-1`)
|
|
1830
1900
|
*/
|
|
1831
1901
|
color?: string;
|
|
1832
1902
|
/**
|
|
@@ -1886,19 +1956,11 @@ declare const SparklineUnresponsive: import("react").ForwardRefExoticComponent<S
|
|
|
1886
1956
|
/**
|
|
1887
1957
|
* Responsive Sparkline chart component
|
|
1888
1958
|
*/
|
|
1889
|
-
declare const Sparkline: ({
|
|
1890
|
-
resizeDebounceTime,
|
|
1891
|
-
maxWidth,
|
|
1892
|
-
aspectRatio,
|
|
1893
|
-
size,
|
|
1894
|
-
width,
|
|
1895
|
-
height,
|
|
1896
|
-
...chartProps
|
|
1897
|
-
}: Omit<SparklineProps, "height" | "size" | "width"> & {
|
|
1959
|
+
declare const Sparkline: ({ resizeDebounceTime, maxWidth, aspectRatio, size, width, height, ...chartProps }: Omit<SparklineProps, "height" | "size" | "width"> & {
|
|
1898
1960
|
width?: number;
|
|
1899
1961
|
height?: number;
|
|
1900
1962
|
size?: number;
|
|
1901
|
-
} & ResponsiveConfig) => import("react
|
|
1963
|
+
} & ResponsiveConfig) => import("react").JSX.Element;
|
|
1902
1964
|
//#endregion
|
|
1903
1965
|
//#region src/components/tooltip/base-tooltip.d.ts
|
|
1904
1966
|
type TooltipData = {
|
|
@@ -1933,16 +1995,7 @@ type CustomTooltip = {
|
|
|
1933
1995
|
component?: never;
|
|
1934
1996
|
};
|
|
1935
1997
|
type BaseTooltipProps = TooltipCommonProps & (DefaultDataTooltip | CustomTooltip);
|
|
1936
|
-
declare const BaseTooltip: ({
|
|
1937
|
-
data,
|
|
1938
|
-
top,
|
|
1939
|
-
left,
|
|
1940
|
-
component: Component,
|
|
1941
|
-
children,
|
|
1942
|
-
className,
|
|
1943
|
-
style,
|
|
1944
|
-
renderContainer
|
|
1945
|
-
}: BaseTooltipProps) => string | number | true | import("react/jsx-runtime").JSX.Element | Iterable<ReactNode>;
|
|
1998
|
+
declare const BaseTooltip: ({ data, top, left, component: Component, children, className, style, renderContainer }: BaseTooltipProps) => string | number | true | import("react").JSX.Element | Iterable<ReactNode>;
|
|
1946
1999
|
//#endregion
|
|
1947
2000
|
//#region src/components/tooltip/accessible-tooltip.d.ts
|
|
1948
2001
|
type FlattenedTooltipData = {
|
|
@@ -2022,13 +2075,7 @@ type TrendIndicatorProps = {
|
|
|
2022
2075
|
* @param {TrendIndicatorProps} props - Component props
|
|
2023
2076
|
* @return {JSX.Element} The rendered trend indicator
|
|
2024
2077
|
*/
|
|
2025
|
-
declare function TrendIndicator({
|
|
2026
|
-
direction,
|
|
2027
|
-
value,
|
|
2028
|
-
className,
|
|
2029
|
-
style,
|
|
2030
|
-
showIcon
|
|
2031
|
-
}: TrendIndicatorProps): import("react/jsx-runtime").JSX.Element;
|
|
2078
|
+
declare function TrendIndicator({ direction, value, className, style, showIcon }: TrendIndicatorProps): import("react").JSX.Element;
|
|
2032
2079
|
//#endregion
|
|
2033
2080
|
//#region src/providers/chart-context/types.d.ts
|
|
2034
2081
|
interface ChartRegistration {
|
|
@@ -2055,6 +2102,8 @@ interface GlobalChartsContextValue {
|
|
|
2055
2102
|
unregisterChart: (id: string) => void;
|
|
2056
2103
|
getChartData: (id: string) => ChartRegistration | undefined;
|
|
2057
2104
|
theme: CompleteChartTheme;
|
|
2105
|
+
/** Locale and time zone every date the charts print is rendered in. */
|
|
2106
|
+
formatting: ChartFormatting;
|
|
2058
2107
|
getElementStyles: (params: GetElementStylesParams) => ElementStyles;
|
|
2059
2108
|
toggleSeriesVisibility: (chartId: string, seriesLabel: string) => void;
|
|
2060
2109
|
setSeriesVisibility: (chartId: string, seriesLabel: string, visible: boolean) => void;
|
|
@@ -2073,6 +2122,16 @@ declare const GlobalChartsContext: import("react").Context<GlobalChartsContextVa
|
|
|
2073
2122
|
interface GlobalChartsProviderProps {
|
|
2074
2123
|
children: ReactNode;
|
|
2075
2124
|
theme?: Partial<ChartTheme>;
|
|
2125
|
+
/**
|
|
2126
|
+
* BCP-47 language tag every date label is rendered in, e.g. `de-DE`.
|
|
2127
|
+
* Defaults to the viewer's browser locale.
|
|
2128
|
+
*/
|
|
2129
|
+
locale?: string;
|
|
2130
|
+
/**
|
|
2131
|
+
* IANA time zone every date label is dated in, e.g. `Asia/Tokyo`.
|
|
2132
|
+
* Defaults to the viewer's browser time zone.
|
|
2133
|
+
*/
|
|
2134
|
+
timeZone?: string;
|
|
2076
2135
|
}
|
|
2077
2136
|
declare const GlobalChartsProvider: FC<GlobalChartsProviderProps>;
|
|
2078
2137
|
//#endregion
|
|
@@ -2080,13 +2139,7 @@ declare const GlobalChartsProvider: FC<GlobalChartsProviderProps>;
|
|
|
2080
2139
|
declare const useGlobalChartsContext: () => GlobalChartsContextValue;
|
|
2081
2140
|
//#endregion
|
|
2082
2141
|
//#region src/providers/chart-context/hooks/use-chart-registration.d.ts
|
|
2083
|
-
declare const useChartRegistration: ({
|
|
2084
|
-
chartId,
|
|
2085
|
-
legendItems,
|
|
2086
|
-
chartType,
|
|
2087
|
-
isDataValid,
|
|
2088
|
-
metadata
|
|
2089
|
-
}: {
|
|
2142
|
+
declare const useChartRegistration: ({ chartId, legendItems, chartType, isDataValid, metadata }: {
|
|
2090
2143
|
chartId: string;
|
|
2091
2144
|
legendItems: BaseLegendItem[];
|
|
2092
2145
|
chartType: ChartType;
|
|
@@ -2102,9 +2155,24 @@ declare const useChartRegistration: ({
|
|
|
2102
2155
|
*/
|
|
2103
2156
|
declare const useGlobalChartsTheme: () => CompleteChartTheme;
|
|
2104
2157
|
//#endregion
|
|
2158
|
+
//#region src/providers/chart-context/hooks/use-chart-formatting.d.ts
|
|
2159
|
+
/**
|
|
2160
|
+
* The locale and time zone dates are rendered in, as set on `GlobalChartsProvider`.
|
|
2161
|
+
*
|
|
2162
|
+
* Falls back to the runtime's own rather than throwing: charts render outside a
|
|
2163
|
+
* provider, and a host that sets neither gets exactly the browser-default
|
|
2164
|
+
* behavior this package had before the context existed.
|
|
2165
|
+
*
|
|
2166
|
+
* @return The host's formatting context.
|
|
2167
|
+
*/
|
|
2168
|
+
declare const useChartFormatting: () => ChartFormatting;
|
|
2169
|
+
//#endregion
|
|
2105
2170
|
//#region src/providers/chart-context/themes.d.ts
|
|
2106
2171
|
/**
|
|
2107
|
-
* Default theme configuration
|
|
2172
|
+
* Default theme configuration: the shape and spacing a consumer can override.
|
|
2173
|
+
*
|
|
2174
|
+
* For a color, set the matching `--a8c-charts-color-*` role in CSS instead; the `var()`
|
|
2175
|
+
* chains that deliver those live in `private/catalog-pointers.ts`.
|
|
2108
2176
|
*/
|
|
2109
2177
|
declare const defaultTheme: CompleteChartTheme;
|
|
2110
2178
|
//#endregion
|
|
@@ -2116,5 +2184,5 @@ declare const defaultTheme: CompleteChartTheme;
|
|
|
2116
2184
|
*/
|
|
2117
2185
|
declare const useChartScopeElement: () => HTMLElement | null;
|
|
2118
2186
|
//#endregion
|
|
2119
|
-
export { AccessibleTooltip, type AnnotationStyles, type ArcData, AreaChartResponsive as AreaChart, type AreaChartProps, AreaChart as AreaChartUnresponsive, type AxisOptions, BarChartResponsive as BarChart, type BarChartProps, BarChart as BarChartUnresponsive, BarListChartResponsive as BarListChart, type BarListChartProps, BarListChart as BarListChartUnresponsive, type BaseChartProps, type BaseLegendItem, type BaseLegendProps, BaseTooltip, type BaseTooltipProps, type CalendarHeatmapResult, type ChartLegendConfig, type ChartLegendOptions, type ChartTheme, type CompleteChartTheme, ConversionFunnelChartWithProvider as ConversionFunnelChart, type ConversionFunnelChartProps, type CurveType, type DataPoint, type DataPointDate, type DataPointPercentage, type EventHandlerParams, type FunnelStep, GeoChartResponsive as GeoChart, type GeoChartError, type GeoChartProps, GeoChartWithProvider as GeoChartUnresponsive, type GeoData, type GeoRegion, type GeoResolution, GlobalChartsContext, GlobalChartsProvider, GlobalChartsProvider as ThemeProvider, type GoogleDataTableColumn, GoogleDataTableColumnRoleType, type GoogleDataTableRow, type GradientConfig, type GradientStop, type GridStyles, type HeatmapCell, HeatmapChartResponsive as HeatmapChart, type HeatmapChartProps, HeatmapChart as HeatmapChartUnresponsive, type HeatmapColumn, type HeatmapTooltipData, LeaderboardChartResponsive as LeaderboardChart, type LeaderboardChartProps, LeaderboardChart as LeaderboardChartUnresponsive, type LeaderboardEntry, Legend, type LegendItemStyles, type LegendLabelStyles, type LegendPosition, type LegendProps, type LegendShape, type LegendShapeLabel, type LegendShapeRenderProps, type LegendShapeStyles, type LegendValueDisplay, LineChartResponsive as LineChart, type LineChartAnnotationProps, type LineChartProps, LineChart as LineChartUnresponsive, type LineStyles, type MainMetricRenderProps, type MetricValueType, type MultipleDataPointsDate, type Optional, type OrientationType, PieChartResponsive as PieChart, type PieChartProps, type PieChartRenderTooltipParams, PieChart as PieChartUnresponsive, PieSemiCircleChartResponsive as PieSemiCircleChart, type PieSemiCircleChartProps, type PieSemiCircleChartRenderTooltipParams, PieSemiCircleChart as PieSemiCircleChartUnresponsive, type RenderLabelProps, type RenderLineGlyphProps, type RenderTooltipGlyphProps, type RenderTooltipParams, type RenderValueProps, type ScaleOptions, type SeriesChartLegendConfig, type SeriesData, type SeriesDataOptions, type SeriesVisibilityProps, Sparkline, type SparklineDataPoint, type SparklineProps, SparklineUnresponsive, type StepLabelRenderProps, type StepRateRenderProps, type TickResolution, type TooltipData, type TooltipDatum, type TooltipProps, type TooltipRenderProps, type TrendDirection, TrendIndicator, type TrendIndicatorProps, type XyChartTooltipProps, buildCalendarHeatmapData, defaultTheme, formatMetricValue, formatPercentage, getColorDistance, hexToRgba, isValidHexColor, lightenHexColor, mergeThemes, mixHexColors, normalizeColorToHex, parseAsLocalDate, parseHslString,
|
|
2187
|
+
export { AccessibleTooltip, type AnnotationStyles, type ArcData, AreaChartResponsive as AreaChart, type AreaChartProps, AreaChart as AreaChartUnresponsive, type AxisOptions, BarChartResponsive as BarChart, type BarChartProps, BarChart as BarChartUnresponsive, BarListChartResponsive as BarListChart, type BarListChartProps, BarListChart as BarListChartUnresponsive, type BaseChartProps, type BaseLegendItem, type BaseLegendProps, BaseTooltip, type BaseTooltipProps, type BucketInfo, type CalendarHeatmapResult, type ChartFormatting, type ChartLegendConfig, type ChartLegendOptions, type ChartTheme, type CompleteChartTheme, ConversionFunnelChartWithProvider as ConversionFunnelChart, type ConversionFunnelChartProps, type CurveType, type DataPoint, type DataPointDate, type DataPointPercentage, type EventHandlerParams, type FunnelStep, GeoChartResponsive as GeoChart, type GeoChartError, type GeoChartProps, GeoChartWithProvider as GeoChartUnresponsive, type GeoData, type GeoRegion, type GeoResolution, GlobalChartsContext, GlobalChartsProvider, GlobalChartsProvider as ThemeProvider, type GoogleDataTableColumn, GoogleDataTableColumnRoleType, type GoogleDataTableRow, type GradientConfig, type GradientStop, type GridStyles, type HeatmapCell, HeatmapChartResponsive as HeatmapChart, type HeatmapChartProps, HeatmapChart as HeatmapChartUnresponsive, type HeatmapColumn, type HeatmapTooltipData, LeaderboardChartResponsive as LeaderboardChart, type LeaderboardChartProps, LeaderboardChart as LeaderboardChartUnresponsive, type LeaderboardEntry, Legend, type LegendItemStyles, type LegendLabelStyles, type LegendPosition, type LegendProps, type LegendShape, type LegendShapeLabel, type LegendShapeRenderProps, type LegendShapeStyles, type LegendValueDisplay, LineChartResponsive as LineChart, type LineChartAnnotationProps, type LineChartProps, LineChart as LineChartUnresponsive, type LineStyles, type MainMetricRenderProps, type MetricValueType, type MultipleDataPointsDate, type Optional, type OrientationType, PieChartResponsive as PieChart, type PieChartProps, type PieChartRenderTooltipParams, PieChart as PieChartUnresponsive, PieSemiCircleChartResponsive as PieSemiCircleChart, type PieSemiCircleChartProps, type PieSemiCircleChartRenderTooltipParams, PieSemiCircleChart as PieSemiCircleChartUnresponsive, type RenderLabelProps, type RenderLineGlyphProps, type RenderTooltipGlyphProps, type RenderTooltipParams, type RenderValueProps, type ScaleOptions, type SeriesChartLegendConfig, type SeriesData, type SeriesDataOptions, type SeriesVisibilityProps, Sparkline, type SparklineDataPoint, type SparklineProps, SparklineUnresponsive, type StepLabelRenderProps, type StepRateRenderProps, type TickResolution, type TooltipData, type TooltipDatum, type TooltipProps, type TooltipRenderProps, type TrendDirection, TrendIndicator, type TrendIndicatorProps, type XyChartTooltipProps, buildCalendarHeatmapData, defaultTheme, formatMetricValue, formatPercentage, getBucketInfo, getColorDistance, hexToRgba, isValidHexColor, lightenHexColor, mergeThemes, mixHexColors, normalizeColorToHex, parseAsLocalDate, parseHslString, prefersLightText, relativeLuminance, resolveCssVariable, useChartFormatting, useChartLegendItems, useChartRegistration, useChartScopeElement, useGlobalChartsContext, useGlobalChartsTheme, useLeaderboardLegendItems, validateHexColor };
|
|
2120
2188
|
//# sourceMappingURL=index.d.cts.map
|