@automattic/charts 1.6.0 → 1.8.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 +17 -0
- package/README.md +2 -2
- package/dist/index.cjs +380 -60
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +12 -7
- package/dist/index.d.cts +119 -30
- package/dist/index.d.ts +122 -33
- package/dist/index.js +380 -60
- package/dist/index.js.map +1 -1
- package/package.json +22 -21
- package/src/charts/area-chart/types.ts +1 -1
- package/src/charts/bar-chart/bar-chart.tsx +197 -43
- package/src/charts/bar-chart/private/comparison-bars-geometry.ts +70 -0
- package/src/charts/bar-chart/private/comparison-bars.tsx +154 -0
- package/src/charts/bar-chart/private/comparison-constants.ts +33 -0
- package/src/charts/bar-chart/private/index.ts +9 -0
- package/src/charts/bar-chart/private/test/comparison-bars-geometry.test.ts +47 -0
- package/src/charts/bar-chart/private/test/comparison-bars.test.tsx +183 -0
- package/src/charts/bar-chart/private/use-bar-chart-options.ts +46 -5
- package/src/charts/bar-chart/test/bar-chart.test.tsx +191 -1
- package/src/charts/geo-chart/geo-chart.tsx +8 -10
- package/src/charts/leaderboard-chart/leaderboard-chart.module.scss +27 -14
- package/src/charts/leaderboard-chart/leaderboard-chart.tsx +7 -4
- package/src/charts/leaderboard-chart/test/leaderboard-chart.test.tsx +51 -4
- package/src/charts/line-chart/line-chart.tsx +1 -1
- package/src/charts/line-chart/private/line-chart-annotation-label-popover.tsx +18 -2
- package/src/charts/line-chart/private/line-chart-annotation.tsx +1 -1
- package/src/charts/line-chart/types.ts +1 -1
- package/src/charts/pie-chart/pie-chart.module.scss +0 -4
- package/src/charts/pie-chart/pie-chart.tsx +3 -8
- package/src/charts/pie-semi-circle-chart/pie-semi-circle-chart.module.scss +0 -5
- package/src/charts/pie-semi-circle-chart/pie-semi-circle-chart.tsx +5 -10
- package/src/charts/private/center/center.module.scss +4 -0
- package/src/charts/private/center/center.tsx +33 -0
- package/src/charts/private/center/index.ts +2 -0
- package/src/charts/private/center/test/center.test.tsx +60 -0
- package/src/charts/private/chart-layout/chart-layout.tsx +1 -2
- package/src/charts/private/svg-empty-state/svg-empty-state.module.scss +0 -2
- package/src/charts/private/svg-empty-state/svg-empty-state.tsx +2 -4
- package/src/charts/private/x-zoom.tsx +2 -2
- package/src/components/legend/hooks/use-chart-legend-items.ts +6 -2
- package/src/components/legend/legend.tsx +1 -2
- package/src/components/legend/utils/label-transform-factory.ts +1 -1
- package/src/components/tooltip/accessible-tooltip.tsx +2 -6
- package/src/index.ts +6 -5
- package/src/providers/chart-context/global-charts-provider.tsx +2 -0
- package/src/providers/chart-context/test/chart-context.test.tsx +13 -1
- package/src/providers/chart-context/themes.ts +9 -1
- package/src/providers/chart-context/types.ts +9 -2
- package/src/types.ts +120 -11
- package/src/utils/get-styles.ts +36 -14
- package/src/utils/index.ts +6 -1
- package/src/utils/test/get-styles.test.ts +47 -1
- package/src/visx/types.ts +30 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,23 +1,63 @@
|
|
|
1
|
-
import { EventHandlerParams, EventHandlerParams as EventHandlerParams$1, GlyphProps, GridStyles, GridStyles as GridStyles$1, LineStyles, LineStyles as LineStyles$1 } from "@visx/xychart";
|
|
2
|
-
import { CSSProperties, ComponentProps, ComponentType, FC, MouseEvent, PointerEvent, PropsWithChildren, ReactNode, SVGProps } from "react";
|
|
1
|
+
import { EventHandlerParams, EventHandlerParams as EventHandlerParams$1, GlyphProps, GridStyles, GridStyles as GridStyles$1, LineStyles, LineStyles as LineStyles$1, TooltipContextType } from "@visx/xychart";
|
|
2
|
+
import { CSSProperties, ComponentClass, ComponentProps, ComponentType, FC, MouseEvent, PointerEvent, PropsWithChildren, ReactElement, ReactNode, SVGProps } from "react";
|
|
3
3
|
import { TextProps } from "@visx/text";
|
|
4
|
-
import { ScaleInput, ScaleType } from "@visx/scale";
|
|
4
|
+
import { PickD3Scale, ScaleInput, ScaleType } from "@visx/scale";
|
|
5
5
|
import { LegendOrdinal } from "@visx/legend";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { LabelProps } from "@visx/annotation/lib/components/Label.js";
|
|
10
|
-
import { LineSubjectProps } from "@visx/annotation/lib/components/LineSubject.js";
|
|
6
|
+
import { CircleSubjectProps, ConnectorProps, LabelProps, LineSubjectProps } from "@visx/annotation";
|
|
7
|
+
import { TooltipProps as TooltipProps$1, UseTooltipPortalOptions } from "@visx/tooltip";
|
|
8
|
+
import { PieProvidedProps } from "@visx/shape";
|
|
11
9
|
import { AxisRendererProps, AxisScale, Orientation, TickFormatter } from "@visx/axis";
|
|
12
|
-
import { LegendShape as LegendShape$1 } from "@visx/legend/lib/types/index.js";
|
|
13
|
-
import { TextProps as TextProps$1 } from "@visx/text/lib/Text.js";
|
|
14
|
-
import { GapSize } from "@wordpress/theme";
|
|
15
|
-
import { RenderTooltipParams, RenderTooltipParams as RenderTooltipParams$1, TooltipProps as BaseTooltipProps$1 } from "@visx/xychart/lib/components/Tooltip.js";
|
|
16
|
-
import { PieArcDatum } from "@visx/shape/lib/shapes/Pie.js";
|
|
17
10
|
|
|
18
11
|
//#region src/types.d.ts
|
|
19
12
|
type ValueOf<T> = T[keyof T];
|
|
20
13
|
type Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>;
|
|
14
|
+
/**
|
|
15
|
+
* Mirrors the WordPress Design System gap token scale used by the WordPress UI Stack.
|
|
16
|
+
*/
|
|
17
|
+
type GapSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl';
|
|
18
|
+
type LegendShapeLabel<Data, Output, ExtraAttributes = object> = {
|
|
19
|
+
datum: Data;
|
|
20
|
+
index: number;
|
|
21
|
+
text: string;
|
|
22
|
+
value?: Output;
|
|
23
|
+
} & ExtraAttributes;
|
|
24
|
+
type LegendShapeRenderProps<Data, Output> = {
|
|
25
|
+
width?: string | number;
|
|
26
|
+
height?: string | number;
|
|
27
|
+
label: LegendShapeLabel<Data, Output>;
|
|
28
|
+
item: Data;
|
|
29
|
+
itemIndex: number;
|
|
30
|
+
fill?: string;
|
|
31
|
+
size?: string | number;
|
|
32
|
+
style?: CSSProperties;
|
|
33
|
+
};
|
|
34
|
+
type LegendShape<Data, Output> = 'rect' | 'circle' | 'line' | FC<LegendShapeRenderProps<Data, Output>> | ComponentClass<LegendShapeRenderProps<Data, Output>>;
|
|
35
|
+
type GoogleDataTableColumnType = 'string' | 'number' | 'boolean' | 'date' | 'datetime' | 'timeofday';
|
|
36
|
+
declare enum GoogleDataTableColumnRoleType {
|
|
37
|
+
annotation = "annotation",
|
|
38
|
+
annotationText = "annotationText",
|
|
39
|
+
certainty = "certainty",
|
|
40
|
+
emphasis = "emphasis",
|
|
41
|
+
interval = "interval",
|
|
42
|
+
scope = "scope",
|
|
43
|
+
style = "style",
|
|
44
|
+
tooltip = "tooltip",
|
|
45
|
+
domain = "domain"
|
|
46
|
+
}
|
|
47
|
+
type GoogleDataTableColumn = {
|
|
48
|
+
type: GoogleDataTableColumnType;
|
|
49
|
+
label?: string;
|
|
50
|
+
role?: GoogleDataTableColumnRoleType;
|
|
51
|
+
pattern?: string;
|
|
52
|
+
p?: Record<string, unknown>;
|
|
53
|
+
id?: string;
|
|
54
|
+
} | string;
|
|
55
|
+
type GoogleDataTableCell = {
|
|
56
|
+
v?: unknown;
|
|
57
|
+
f?: string;
|
|
58
|
+
p?: Record<string, unknown>;
|
|
59
|
+
} | string | number | boolean | Date | null;
|
|
60
|
+
type GoogleDataTableRow = GoogleDataTableCell[];
|
|
21
61
|
type ChartType = 'area' | 'bar' | 'conversion-funnel' | 'leaderboard' | 'line' | 'pie' | 'pie-semi-circle';
|
|
22
62
|
type OrientationType = ValueOf<typeof Orientation>;
|
|
23
63
|
type AnnotationStyles = {
|
|
@@ -66,7 +106,7 @@ type DataPoint = {
|
|
|
66
106
|
* ['Canada', 38000000, 9985000]
|
|
67
107
|
* ]
|
|
68
108
|
*/
|
|
69
|
-
type GeoData = [GoogleDataTableColumn
|
|
109
|
+
type GeoData = [GoogleDataTableColumn[], ...GoogleDataTableRow[]];
|
|
70
110
|
type DataPointDate = {
|
|
71
111
|
date?: Date;
|
|
72
112
|
/**
|
|
@@ -92,7 +132,7 @@ type LeaderboardEntry = {
|
|
|
92
132
|
/**
|
|
93
133
|
* Human-readable name (e.g., 'Direct') or a JSX element (e.g., <h4>Direct</h4>)
|
|
94
134
|
*/
|
|
95
|
-
label: string |
|
|
135
|
+
label: string | ReactElement;
|
|
96
136
|
/**
|
|
97
137
|
* Value of the entry
|
|
98
138
|
*/
|
|
@@ -130,6 +170,16 @@ type LeaderboardEntry = {
|
|
|
130
170
|
* never both, since interactive elements cannot be nested in HTML.
|
|
131
171
|
*/
|
|
132
172
|
onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
|
|
173
|
+
/**
|
|
174
|
+
* Optional accessible name for the interactive row's `<button>`. Only applies
|
|
175
|
+
* when `onClick` is set — without it the row renders as a Fragment with no
|
|
176
|
+
* element to receive `aria-label`. By default the button derives its name from
|
|
177
|
+
* its rendered content (label text plus the formatted value), which is the
|
|
178
|
+
* right outcome for plain-text labels. Set this when the `label` is JSX whose
|
|
179
|
+
* text content does not yield a clean name on its own — e.g. an image-only
|
|
180
|
+
* label — to give assistive tech a deterministic, human-readable name.
|
|
181
|
+
*/
|
|
182
|
+
ariaLabel?: string;
|
|
133
183
|
};
|
|
134
184
|
type GradientStop = {
|
|
135
185
|
offset: string;
|
|
@@ -155,6 +205,15 @@ type SeriesData = {
|
|
|
155
205
|
data: DataPointDate[] | DataPoint[];
|
|
156
206
|
options?: SeriesDataOptions;
|
|
157
207
|
};
|
|
208
|
+
/**
|
|
209
|
+
* Visual styling for a bar series of a given semantic type (e.g. 'comparison').
|
|
210
|
+
* `widthFactor` is the bar width relative to the primary bar slot (1.5 = 150%);
|
|
211
|
+
* `opacity` sets the shadow translucency.
|
|
212
|
+
*/
|
|
213
|
+
type BarStyles = {
|
|
214
|
+
widthFactor?: number;
|
|
215
|
+
opacity?: number;
|
|
216
|
+
};
|
|
158
217
|
type MultipleDataPointsDate = {
|
|
159
218
|
label: string;
|
|
160
219
|
data: DataPointDate[];
|
|
@@ -217,8 +276,8 @@ type ChartTheme = {
|
|
|
217
276
|
labelStyles?: CSSProperties; /** Styles for legend container */
|
|
218
277
|
containerStyles?: CSSProperties;
|
|
219
278
|
}; /** Styles for small SVG text (eg. axis tick labels), passed through to the XYChart theme. */
|
|
220
|
-
svgLabelSmall?: TextProps
|
|
221
|
-
svgLabelBig?: TextProps
|
|
279
|
+
svgLabelSmall?: TextProps; /** Styles for large SVG text (eg. axis titles), passed through to the XYChart theme. */
|
|
280
|
+
svgLabelBig?: TextProps;
|
|
222
281
|
annotationStyles?: AnnotationStyles; /** GeoChart specific settings */
|
|
223
282
|
geoChart?: {
|
|
224
283
|
/** Default fill color for a geo chart feature (e.g. country) with no data */featureFillColor?: string;
|
|
@@ -226,7 +285,7 @@ type ChartTheme = {
|
|
|
226
285
|
leaderboardChart?: {
|
|
227
286
|
/** Gap between rows in the leaderboard grid */rowGap?: number; /** Gap between columns in the leaderboard grid */
|
|
228
287
|
columnGap?: number; /** Spacing between label and progress bars */
|
|
229
|
-
labelSpacing?:
|
|
288
|
+
labelSpacing?: GapSize; /** Primary color for current period bars */
|
|
230
289
|
primaryColor?: string; /** Secondary color for comparison period bars */
|
|
231
290
|
secondaryColor?: string; /** Delta colors: [negative, neutral, positive] */
|
|
232
291
|
deltaColors?: [string, string, string];
|
|
@@ -239,6 +298,9 @@ type ChartTheme = {
|
|
|
239
298
|
};
|
|
240
299
|
lineChart?: {
|
|
241
300
|
lineStyles?: Partial<Record<NonNullable<SeriesDataOptions['type']>, LineStyles$1>>;
|
|
301
|
+
};
|
|
302
|
+
barChart?: {
|
|
303
|
+
barStyles?: Partial<Record<NonNullable<SeriesDataOptions['type']>, BarStyles>>;
|
|
242
304
|
}; /** Sparkline specific settings */
|
|
243
305
|
sparkline?: {
|
|
244
306
|
/** Margin around the sparkline chart */margin?: {
|
|
@@ -260,6 +322,9 @@ type CompleteChartTheme = Required<ChartTheme> & {
|
|
|
260
322
|
lineChart: {
|
|
261
323
|
lineStyles: Record<NonNullable<SeriesDataOptions['type']>, LineStyles$1>;
|
|
262
324
|
};
|
|
325
|
+
barChart: {
|
|
326
|
+
barStyles: Record<NonNullable<SeriesDataOptions['type']>, BarStyles>;
|
|
327
|
+
};
|
|
263
328
|
legend: Required<NonNullable<ChartTheme['legend']>>;
|
|
264
329
|
sparkline: Required<NonNullable<ChartTheme['sparkline']>> & {
|
|
265
330
|
margin: Required<NonNullable<ChartTheme['sparkline']>['margin']>;
|
|
@@ -374,7 +439,7 @@ type ChartLegendConfig<T = DataPoint | DataPointDate | LeaderboardEntry> = {
|
|
|
374
439
|
/**
|
|
375
440
|
* Shape of the legend marker icon.
|
|
376
441
|
*/
|
|
377
|
-
shape?: LegendShape
|
|
442
|
+
shape?: LegendShape<T, number>;
|
|
378
443
|
/**
|
|
379
444
|
* Enable interactive legend items that can toggle series visibility.
|
|
380
445
|
* Supported for all chart types that render series.
|
|
@@ -578,7 +643,7 @@ interface ChartLegendOptions {
|
|
|
578
643
|
renderGlyph?: <Datum extends object>(props: GlyphProps<Datum>) => ReactNode;
|
|
579
644
|
showValues?: boolean;
|
|
580
645
|
legendValueDisplay?: LegendValueDisplay;
|
|
581
|
-
legendShape?: LegendShape
|
|
646
|
+
legendShape?: LegendShape<SeriesData[], number>;
|
|
582
647
|
}
|
|
583
648
|
/**
|
|
584
649
|
* Hook to transform chart data into legend items
|
|
@@ -587,7 +652,7 @@ interface ChartLegendOptions {
|
|
|
587
652
|
* @param legendShape - The shape type for legend items (string literal or React component)
|
|
588
653
|
* @return Array of legend items ready for display
|
|
589
654
|
*/
|
|
590
|
-
declare function useChartLegendItems<T extends SeriesData[] | DataPointDate[] | DataPointPercentageCalculated[]>(data: T, options?: ChartLegendOptions, legendShape?: LegendShape
|
|
655
|
+
declare function useChartLegendItems<T extends SeriesData[] | DataPointDate[] | DataPointPercentageCalculated[]>(data: T, options?: ChartLegendOptions, legendShape?: LegendShape<SeriesData[], number>): BaseLegendItem[];
|
|
591
656
|
//#endregion
|
|
592
657
|
//#region src/charts/private/single-chart-context/single-chart-context.d.ts
|
|
593
658
|
interface ChartInstanceRef {
|
|
@@ -608,6 +673,29 @@ interface ChartInstanceRef {
|
|
|
608
673
|
}
|
|
609
674
|
type SingleChartRef = ChartInstanceRef;
|
|
610
675
|
//#endregion
|
|
676
|
+
//#region src/visx/types.d.ts
|
|
677
|
+
type RenderTooltipParams<Datum extends object> = TooltipContextType<Datum> & {
|
|
678
|
+
colorScale?: PickD3Scale<'ordinal', string, string>;
|
|
679
|
+
};
|
|
680
|
+
interface RenderTooltipGlyphProps<Datum extends object> extends GlyphProps<Datum> {
|
|
681
|
+
glyphStyle?: SVGProps<SVGCircleElement>;
|
|
682
|
+
isNearestDatum: boolean;
|
|
683
|
+
}
|
|
684
|
+
type XyChartTooltipProps<Datum extends object> = {
|
|
685
|
+
renderTooltip: (params: RenderTooltipParams<Datum>) => ReactNode;
|
|
686
|
+
renderGlyph?: (params: RenderTooltipGlyphProps<Datum>) => ReactNode;
|
|
687
|
+
snapTooltipToDatumX?: boolean;
|
|
688
|
+
snapTooltipToDatumY?: boolean;
|
|
689
|
+
showVerticalCrosshair?: boolean;
|
|
690
|
+
showHorizontalCrosshair?: boolean;
|
|
691
|
+
showDatumGlyph?: boolean;
|
|
692
|
+
showSeriesGlyphs?: boolean;
|
|
693
|
+
verticalCrosshairStyle?: SVGProps<SVGLineElement>;
|
|
694
|
+
horizontalCrosshairStyle?: SVGProps<SVGLineElement>;
|
|
695
|
+
glyphStyle?: SVGProps<SVGCircleElement>;
|
|
696
|
+
resizeObserverPolyfill?: UseTooltipPortalOptions['polyfill'];
|
|
697
|
+
} & Omit<TooltipProps$1, 'left' | 'top' | 'children'> & Pick<UseTooltipPortalOptions, 'debounce' | 'detectBounds' | 'scroll' | 'zIndex'>;
|
|
698
|
+
//#endregion
|
|
611
699
|
//#region src/charts/line-chart/types.d.ts
|
|
612
700
|
type LineChartAnnotationProps = {
|
|
613
701
|
datum: DataPointDate;
|
|
@@ -634,7 +722,7 @@ interface LineChartProps extends BaseChartProps<SeriesData[]> {
|
|
|
634
722
|
withGradientFill: boolean;
|
|
635
723
|
smoothing?: boolean;
|
|
636
724
|
curveType?: CurveType;
|
|
637
|
-
renderTooltip?: (params: RenderTooltipParams
|
|
725
|
+
renderTooltip?: (params: RenderTooltipParams<DataPointDate>) => ReactNode;
|
|
638
726
|
withStartGlyphs?: boolean;
|
|
639
727
|
withEndGlyphs?: boolean;
|
|
640
728
|
renderGlyph?: <Datum extends object>(props: GlyphProps<Datum>) => ReactNode;
|
|
@@ -684,7 +772,7 @@ interface AreaChartProps extends BaseChartProps<SeriesData[]> {
|
|
|
684
772
|
/**
|
|
685
773
|
* Custom tooltip renderer.
|
|
686
774
|
*/
|
|
687
|
-
renderTooltip?: (params: RenderTooltipParams
|
|
775
|
+
renderTooltip?: (params: RenderTooltipParams<DataPointDate>) => ReactNode;
|
|
688
776
|
/**
|
|
689
777
|
* Whether to show crosshair lines in the tooltip.
|
|
690
778
|
*/
|
|
@@ -750,7 +838,7 @@ declare const AreaChartResponsive: AreaChartResponsiveComponent;
|
|
|
750
838
|
//#endregion
|
|
751
839
|
//#region src/charts/bar-chart/bar-chart.d.ts
|
|
752
840
|
interface BarChartProps extends BaseChartProps<SeriesData[]> {
|
|
753
|
-
renderTooltip?: (params: RenderTooltipParams
|
|
841
|
+
renderTooltip?: (params: RenderTooltipParams<DataPointDate>) => ReactNode;
|
|
754
842
|
orientation?: 'horizontal' | 'vertical';
|
|
755
843
|
withPatterns?: boolean;
|
|
756
844
|
showZeroValues?: boolean;
|
|
@@ -837,7 +925,7 @@ declare const BarListChartResponsive: ({
|
|
|
837
925
|
width,
|
|
838
926
|
height,
|
|
839
927
|
...chartProps
|
|
840
|
-
}: Omit<BarListChartProps, "
|
|
928
|
+
}: Omit<BarListChartProps, "width" | "height" | "size"> & {
|
|
841
929
|
width?: number;
|
|
842
930
|
height?: number;
|
|
843
931
|
size?: number;
|
|
@@ -981,7 +1069,7 @@ declare const GeoChartResponsive: ({
|
|
|
981
1069
|
width,
|
|
982
1070
|
height,
|
|
983
1071
|
...chartProps
|
|
984
|
-
}: Omit<GeoChartProps, "
|
|
1072
|
+
}: Omit<GeoChartProps, "width" | "height" | "size"> & {
|
|
985
1073
|
width?: number;
|
|
986
1074
|
height?: number;
|
|
987
1075
|
size?: number;
|
|
@@ -1057,7 +1145,7 @@ declare const LeaderboardChartResponsive: (({
|
|
|
1057
1145
|
width,
|
|
1058
1146
|
height,
|
|
1059
1147
|
...chartProps
|
|
1060
|
-
}: Omit<LeaderboardChartProps, "
|
|
1148
|
+
}: Omit<LeaderboardChartProps, "width" | "height" | "size"> & {
|
|
1061
1149
|
width?: number;
|
|
1062
1150
|
height?: number;
|
|
1063
1151
|
size?: number;
|
|
@@ -1448,7 +1536,7 @@ interface PieSemiCircleChartProps extends BaseChartProps<DataPointPercentage[]>
|
|
|
1448
1536
|
type PieSemiCircleChartBaseProps = Optional<PieSemiCircleChartProps, 'width'>;
|
|
1449
1537
|
type PieSemiCircleChartComponent = ChartComponentWithComposition<PieSemiCircleChartBaseProps>;
|
|
1450
1538
|
type PieSemiCircleChartResponsiveComponent = ChartComponentWithComposition<PieSemiCircleChartBaseProps & ResponsiveConfig>;
|
|
1451
|
-
type ArcData =
|
|
1539
|
+
type ArcData = PieProvidedProps<DataPointPercentageCalculated>['arcs'][number];
|
|
1452
1540
|
declare const PieSemiCircleChart: PieSemiCircleChartComponent;
|
|
1453
1541
|
declare const PieSemiCircleChartResponsive: PieSemiCircleChartResponsiveComponent;
|
|
1454
1542
|
//#endregion
|
|
@@ -1564,7 +1652,7 @@ declare const Sparkline: ({
|
|
|
1564
1652
|
width,
|
|
1565
1653
|
height,
|
|
1566
1654
|
...chartProps
|
|
1567
|
-
}: Omit<SparklineProps, "
|
|
1655
|
+
}: Omit<SparklineProps, "width" | "height" | "size"> & {
|
|
1568
1656
|
width?: number;
|
|
1569
1657
|
height?: number;
|
|
1570
1658
|
size?: number;
|
|
@@ -1621,8 +1709,8 @@ type FlattenedTooltipData = {
|
|
|
1621
1709
|
seriesIndex: number;
|
|
1622
1710
|
dataPointIndex: number;
|
|
1623
1711
|
};
|
|
1624
|
-
interface AccessibleTooltipProps extends Omit<
|
|
1625
|
-
renderTooltip?: (params: RenderTooltipParams
|
|
1712
|
+
interface AccessibleTooltipProps extends Omit<XyChartTooltipProps<DataPointDate>, 'renderTooltip'> {
|
|
1713
|
+
renderTooltip?: (params: RenderTooltipParams<DataPointDate>) => ReactNode;
|
|
1626
1714
|
selectedIndex?: number | undefined;
|
|
1627
1715
|
tooltipRef?: (element: HTMLDivElement | null) => void;
|
|
1628
1716
|
keyboardFocusedClassName?: string;
|
|
@@ -1710,11 +1798,12 @@ type GetElementStylesParams = {
|
|
|
1710
1798
|
index: number;
|
|
1711
1799
|
data?: SeriesData | DataPointPercentage;
|
|
1712
1800
|
overrideColor?: string;
|
|
1713
|
-
legendShape?: LegendShape
|
|
1801
|
+
legendShape?: LegendShape<SeriesData[], number>;
|
|
1714
1802
|
};
|
|
1715
1803
|
type ElementStyles = {
|
|
1716
1804
|
color: string;
|
|
1717
1805
|
lineStyles: LineStyles$1;
|
|
1806
|
+
barStyles: BarStyles;
|
|
1718
1807
|
glyph: <Datum extends object>(props: GlyphProps<Datum>) => ReactNode;
|
|
1719
1808
|
shapeStyles: CSSProperties & LineStyles$1;
|
|
1720
1809
|
};
|
|
@@ -1756,5 +1845,5 @@ declare const useGlobalChartsTheme: () => CompleteChartTheme;
|
|
|
1756
1845
|
*/
|
|
1757
1846
|
declare const defaultTheme: CompleteChartTheme;
|
|
1758
1847
|
//#endregion
|
|
1759
|
-
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 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 GeoChartProps, GeoChartWithProvider as GeoChartUnresponsive, type GeoData, type GeoRegion, type GeoResolution, GlobalChartsContext, GlobalChartsProvider, GlobalChartsProvider as ThemeProvider, type GoogleDataTableColumn, type GoogleDataTableColumnRoleType, type GoogleDataTableRow, type GradientConfig, type GradientStop, type GridProps, type GridStyles, LeaderboardChartResponsive as LeaderboardChart, type LeaderboardChartProps, LeaderboardChart as LeaderboardChartUnresponsive, type LeaderboardEntry, Legend, type LegendItemStyles, type LegendLabelStyles, type LegendPosition, type LegendProps, 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 RenderTooltipParams, type RenderValueProps, type ScaleOptions, type SeriesData, type SeriesDataOptions, Sparkline, type SparklineDataPoint, type SparklineProps, SparklineUnresponsive, type StepLabelRenderProps, type StepRateRenderProps, type TooltipData, type TooltipDatum, type TooltipProps, type TooltipRenderProps, type TrendDirection, TrendIndicator, type TrendIndicatorProps, defaultTheme, formatMetricValue, formatPercentage, getColorDistance, hexToRgba, isValidHexColor, lightenHexColor, mergeThemes, normalizeColorToHex, parseAsLocalDate, parseHslString, parseRgbString, useChartLegendItems, useGlobalChartsContext, useGlobalChartsTheme, useLeaderboardLegendItems, validateHexColor };
|
|
1848
|
+
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 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 GeoChartProps, GeoChartWithProvider as GeoChartUnresponsive, type GeoData, type GeoRegion, type GeoResolution, GlobalChartsContext, GlobalChartsProvider, GlobalChartsProvider as ThemeProvider, type GoogleDataTableColumn, type GoogleDataTableColumnRoleType, type GoogleDataTableRow, type GradientConfig, type GradientStop, type GridProps, type GridStyles, 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 SeriesData, type SeriesDataOptions, Sparkline, type SparklineDataPoint, type SparklineProps, SparklineUnresponsive, type StepLabelRenderProps, type StepRateRenderProps, type TooltipData, type TooltipDatum, type TooltipProps, type TooltipRenderProps, type TrendDirection, TrendIndicator, type TrendIndicatorProps, type XyChartTooltipProps, defaultTheme, formatMetricValue, formatPercentage, getColorDistance, hexToRgba, isValidHexColor, lightenHexColor, mergeThemes, normalizeColorToHex, parseAsLocalDate, parseHslString, parseRgbString, useChartLegendItems, useGlobalChartsContext, useGlobalChartsTheme, useLeaderboardLegendItems, validateHexColor };
|
|
1760
1849
|
//# sourceMappingURL=index.d.ts.map
|