@automattic/charts 4.8.0 → 4.10.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 +28 -0
- package/dist/index.cjs +766 -277
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +72 -8
- package/dist/index.d.cts +54 -15
- package/dist/index.d.ts +54 -15
- package/dist/index.js +770 -281
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/charts/area-chart/area-chart.tsx +7 -3
- package/src/charts/area-chart/test/area-chart.test.tsx +15 -14
- package/src/charts/area-chart/test/tooltip-resolution.test.tsx +2 -2
- package/src/charts/bar-chart/bar-chart.tsx +12 -4
- package/src/charts/bar-chart/test/bar-chart.test.tsx +74 -63
- package/src/charts/bar-list-chart/bar-list-chart.tsx +3 -0
- package/src/charts/bar-list-chart/test/bar-list-chart.test.tsx +3 -1
- package/src/charts/conversion-funnel-chart/conversion-funnel-chart.tsx +23 -7
- package/src/charts/conversion-funnel-chart/test/conversion-funnel-chart.test.tsx +22 -0
- package/src/charts/conversion-funnel-chart/types.ts +1 -1
- package/src/charts/geo-chart/geo-chart.tsx +17 -2
- package/src/charts/geo-chart/test/geo-chart.test.tsx +9 -4
- package/src/charts/geo-chart/types.ts +1 -1
- package/src/charts/heatmap-chart/heatmap-chart.module.scss +10 -4
- package/src/charts/heatmap-chart/heatmap-chart.tsx +144 -37
- package/src/charts/heatmap-chart/private/column-groups.ts +79 -8
- package/src/charts/heatmap-chart/private/fit-compact-cells.ts +72 -0
- package/src/charts/heatmap-chart/private/heatmap-legend.tsx +14 -2
- package/src/charts/heatmap-chart/private/index.ts +4 -2
- package/src/charts/heatmap-chart/test/column-groups.test.ts +41 -4
- package/src/charts/heatmap-chart/test/fit-compact-cells.test.ts +59 -0
- package/src/charts/heatmap-chart/test/heatmap-chart.test.tsx +132 -7
- 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/leaderboard-chart.module.scss +52 -4
- package/src/charts/leaderboard-chart/leaderboard-chart.tsx +60 -9
- package/src/charts/leaderboard-chart/test/leaderboard-chart.test.tsx +80 -1
- package/src/charts/leaderboard-chart/types.ts +7 -1
- package/src/charts/line-chart/line-chart.tsx +8 -2
- package/src/charts/line-chart/private/line-chart-annotation-label-popover.tsx +19 -9
- package/src/charts/line-chart/test/default-tooltip-formatting.test.tsx +1 -1
- package/src/charts/line-chart/test/line-chart.test.tsx +37 -35
- package/src/charts/line-chart/test/tooltip-resolution.test.tsx +2 -2
- package/src/charts/line-chart/types.ts +3 -3
- package/src/charts/pie-chart/pie-chart.module.scss +3 -0
- package/src/charts/pie-chart/pie-chart.tsx +144 -139
- package/src/charts/pie-chart/test/pie-chart.test.tsx +167 -0
- package/src/charts/pie-semi-circle-chart/pie-semi-circle-chart.module.scss +3 -0
- package/src/charts/pie-semi-circle-chart/pie-semi-circle-chart.tsx +117 -120
- package/src/charts/pie-semi-circle-chart/test/pie-semi-circle-chart.test.tsx +54 -0
- package/src/charts/private/chart-composition/use-chart-children.ts +11 -6
- package/src/charts/private/pie-keyboard-navigation/index.ts +4 -0
- package/src/charts/private/pie-keyboard-navigation/order-arcs-for-navigation.ts +10 -0
- package/src/charts/private/pie-keyboard-navigation/pie-keyboard-navigation.module.scss +16 -0
- package/src/charts/private/pie-keyboard-navigation/pie-selection-announcement.tsx +14 -0
- package/src/charts/private/pie-keyboard-navigation/pie-selection-output.tsx +82 -0
- package/src/charts/private/pie-keyboard-navigation/pie-tooltip.tsx +49 -0
- package/src/charts/private/pie-keyboard-navigation/selected-segment-ring.tsx +47 -0
- package/src/charts/private/pie-keyboard-navigation/test/order-arcs-for-navigation.test.ts +34 -0
- package/src/charts/private/pie-keyboard-navigation/test/selected-segment-ring.test.ts +14 -0
- package/src/charts/private/pie-keyboard-navigation/use-pie-keyboard-navigation.ts +139 -0
- package/src/charts/private/x-zoom/test/x-zoom.test.tsx +3 -2
- package/src/charts/test/accessible-name.test.tsx +181 -0
- package/src/components/legend/hooks/test/use-chart-legend-items.test.tsx +63 -3
- package/src/components/legend/hooks/use-chart-legend-items.ts +63 -1
- package/src/components/legend/private/base-legend.tsx +27 -15
- package/src/components/legend/test/legend.test.tsx +42 -0
- package/src/components/legend/types.ts +2 -0
- package/src/components/tooltip/test/xy-chart-tooltip.test.tsx +20 -19
- package/src/components/tooltip/xy-chart-tooltip.tsx +3 -3
- package/src/hooks/test/use-xychart-theme.test.tsx +22 -0
- package/src/hooks/use-xychart-theme.ts +33 -2
- package/src/index.ts +1 -0
- package/src/types.ts +37 -3
- package/src/utils/resolve-font-size.ts +9 -10
- package/src/utils/test/resolve-font-size.test.ts +11 -2
package/dist/index.css
CHANGED
|
@@ -547,9 +547,9 @@
|
|
|
547
547
|
}
|
|
548
548
|
|
|
549
549
|
.a8ccharts-O3YMOW-heatmap-chart__group-label {
|
|
550
|
-
color: var(--a8c-charts-color-label
|
|
551
|
-
font-size: var(--wpds-typography-font-size-
|
|
552
|
-
line-height: var(--wpds-typography-line-height-
|
|
550
|
+
color: var(--a8c-charts-color-label);
|
|
551
|
+
font-size: var(--wpds-typography-font-size-md, 13px);
|
|
552
|
+
line-height: var(--wpds-typography-line-height-sm, 20px);
|
|
553
553
|
white-space: nowrap;
|
|
554
554
|
text-align: center;
|
|
555
555
|
padding-block-start: var(--wpds-dimension-padding-xs, 4px);
|
|
@@ -639,6 +639,10 @@
|
|
|
639
639
|
background: color-mix(in sRGB, var(--a8c-charts-color-heatmap-high, var(--a8c-charts-color-heatmap-primary)) calc(var(--a8c-charts-heatmap-cell-intensity) * 100%), var(--a8c-charts-color-heatmap-low, color-mix(in sRGB, var(--a8c-charts-color-heatmap-primary) 15%, var(--a8c-charts-color-background, #fff))));
|
|
640
640
|
}
|
|
641
641
|
|
|
642
|
+
.a8ccharts-O3YMOW-heatmap-chart__legend-swatch--empty {
|
|
643
|
+
background: var(--a8c-charts-color-track);
|
|
644
|
+
}
|
|
645
|
+
|
|
642
646
|
.a8ccharts-O3YMOW-heatmap-chart__legend-scale--bar {
|
|
643
647
|
border-radius: var(--a8c-charts-border-radius-cell);
|
|
644
648
|
overflow: hidden;
|
|
@@ -766,6 +770,12 @@
|
|
|
766
770
|
inset: 0;
|
|
767
771
|
}
|
|
768
772
|
|
|
773
|
+
.a8ccharts-GovfoW-rowItem {
|
|
774
|
+
grid-column: 1 / -1;
|
|
775
|
+
grid-template-columns: subgrid;
|
|
776
|
+
display: grid;
|
|
777
|
+
}
|
|
778
|
+
|
|
769
779
|
.a8ccharts-GovfoW-row {
|
|
770
780
|
grid-column: 1 / -1;
|
|
771
781
|
grid-template-columns: subgrid;
|
|
@@ -793,23 +803,23 @@
|
|
|
793
803
|
transition: transform var(--wpds-motion-duration-sm, .1s) var(--wpds-motion-easing-subtle, cubic-bezier(.15, 0, .15, 1));
|
|
794
804
|
}
|
|
795
805
|
|
|
796
|
-
.a8ccharts-GovfoW-interactiveRow:hover, .a8ccharts-GovfoW-interactiveRow:focus-visible {
|
|
806
|
+
.a8ccharts-GovfoW-interactiveRow:hover:not(:has(:is(a, button):not(.a8ccharts-GovfoW-rowButton):hover)), .a8ccharts-GovfoW-interactiveRow:focus-visible, .a8ccharts-GovfoW-interactiveRow:has( > .a8ccharts-GovfoW-rowButton:focus-visible) {
|
|
797
807
|
--a8c-charts-dimension-leaderboard-bar-hover-inset: var(--wpds-dimension-gap-2xl, 32px);
|
|
798
808
|
}
|
|
799
809
|
|
|
800
|
-
.a8ccharts-GovfoW-interactiveRow:hover .a8ccharts-GovfoW-bar, .a8ccharts-GovfoW-interactiveRow:focus-visible .a8ccharts-GovfoW-bar {
|
|
810
|
+
.a8ccharts-GovfoW-interactiveRow:hover:not(:has(:is(a, button):not(.a8ccharts-GovfoW-rowButton):hover)) .a8ccharts-GovfoW-bar, .a8ccharts-GovfoW-interactiveRow:focus-visible .a8ccharts-GovfoW-bar, .a8ccharts-GovfoW-interactiveRow:has( > .a8ccharts-GovfoW-rowButton:focus-visible) .a8ccharts-GovfoW-bar {
|
|
801
811
|
opacity: .5;
|
|
802
812
|
}
|
|
803
813
|
|
|
804
|
-
.a8ccharts-GovfoW-interactiveRow:hover .a8ccharts-GovfoW-valueContainer, .a8ccharts-GovfoW-interactiveRow:focus-visible .a8ccharts-GovfoW-valueContainer {
|
|
814
|
+
.a8ccharts-GovfoW-interactiveRow:hover:not(:has(:is(a, button):not(.a8ccharts-GovfoW-rowButton):hover)) .a8ccharts-GovfoW-valueContainer, .a8ccharts-GovfoW-interactiveRow:focus-visible .a8ccharts-GovfoW-valueContainer, .a8ccharts-GovfoW-interactiveRow:has( > .a8ccharts-GovfoW-rowButton:focus-visible) .a8ccharts-GovfoW-valueContainer {
|
|
805
815
|
transform: translateX(calc(var(--a8c-charts-dimension-leaderboard-bar-hover-inset) * -1));
|
|
806
816
|
}
|
|
807
817
|
|
|
808
|
-
.a8ccharts-GovfoW-interactiveRow:hover .a8ccharts-GovfoW-chevron, .a8ccharts-GovfoW-interactiveRow:focus-visible .a8ccharts-GovfoW-chevron {
|
|
818
|
+
.a8ccharts-GovfoW-interactiveRow:hover:not(:has(:is(a, button):not(.a8ccharts-GovfoW-rowButton):hover)) .a8ccharts-GovfoW-chevron, .a8ccharts-GovfoW-interactiveRow:focus-visible .a8ccharts-GovfoW-chevron, .a8ccharts-GovfoW-interactiveRow:has( > .a8ccharts-GovfoW-rowButton:focus-visible) .a8ccharts-GovfoW-chevron {
|
|
809
819
|
opacity: 1;
|
|
810
820
|
}
|
|
811
821
|
|
|
812
|
-
[dir="rtl"] .a8ccharts-GovfoW-interactiveRow:hover .a8ccharts-GovfoW-valueContainer, [dir="rtl"] .a8ccharts-GovfoW-interactiveRow:focus-visible .a8ccharts-GovfoW-valueContainer {
|
|
822
|
+
[dir="rtl"] .a8ccharts-GovfoW-interactiveRow:hover:not(:has(:is(a, button):not(.a8ccharts-GovfoW-rowButton):hover)) .a8ccharts-GovfoW-valueContainer, [dir="rtl"] .a8ccharts-GovfoW-interactiveRow:focus-visible .a8ccharts-GovfoW-valueContainer, [dir="rtl"] .a8ccharts-GovfoW-interactiveRow:has( > .a8ccharts-GovfoW-rowButton:focus-visible) .a8ccharts-GovfoW-valueContainer {
|
|
813
823
|
transform: translateX(var(--a8c-charts-dimension-leaderboard-bar-hover-inset));
|
|
814
824
|
}
|
|
815
825
|
|
|
@@ -819,6 +829,39 @@
|
|
|
819
829
|
outline-offset: calc(-1 * var(--wpds-border-width-focus, var(--wp-admin-border-width-focus, 2px)));
|
|
820
830
|
}
|
|
821
831
|
|
|
832
|
+
.a8ccharts-GovfoW-layeredRow {
|
|
833
|
+
isolation: isolate;
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
.a8ccharts-GovfoW-layeredRow > :not(.a8ccharts-GovfoW-rowButton, .a8ccharts-GovfoW-chevron) {
|
|
837
|
+
z-index: 1;
|
|
838
|
+
pointer-events: none;
|
|
839
|
+
position: relative;
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
.a8ccharts-GovfoW-layeredRow :is(a, button):not(.a8ccharts-GovfoW-rowButton) {
|
|
843
|
+
z-index: 1;
|
|
844
|
+
pointer-events: auto;
|
|
845
|
+
position: relative;
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
.a8ccharts-GovfoW-rowButton {
|
|
849
|
+
appearance: none;
|
|
850
|
+
cursor: pointer;
|
|
851
|
+
z-index: 0;
|
|
852
|
+
background: none;
|
|
853
|
+
border: 0;
|
|
854
|
+
padding: 0;
|
|
855
|
+
position: absolute;
|
|
856
|
+
inset: 0;
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
.a8ccharts-GovfoW-rowButton:focus-visible {
|
|
860
|
+
border-radius: var(--wpds-border-radius-sm, 2px);
|
|
861
|
+
outline: var(--wpds-border-width-focus, var(--wp-admin-border-width-focus, 2px)) solid var(--wpds-color-stroke-focus, var(--wp-admin-theme-color, #3858e9));
|
|
862
|
+
outline-offset: calc(-1 * var(--wpds-border-width-focus, var(--wp-admin-border-width-focus, 2px)));
|
|
863
|
+
}
|
|
864
|
+
|
|
822
865
|
.a8ccharts-GovfoW-chevron {
|
|
823
866
|
inset-inline-end: var(--wpds-dimension-padding-xs, 4px);
|
|
824
867
|
opacity: 0;
|
|
@@ -840,6 +883,23 @@
|
|
|
840
883
|
transition: none;
|
|
841
884
|
}
|
|
842
885
|
}
|
|
886
|
+
.a8ccharts-V2HDKq-selected-ring__contrast, .a8ccharts-V2HDKq-selected-ring__focus {
|
|
887
|
+
fill: none;
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
.a8ccharts-V2HDKq-selected-ring__contrast {
|
|
891
|
+
stroke: var(--a8c-charts-color-background, #fff);
|
|
892
|
+
stroke-width: calc(4 * var(--wpds-border-width-focus, var(--wp-admin-border-width-focus, 2px)));
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
.a8ccharts-V2HDKq-selected-ring__focus {
|
|
896
|
+
stroke: var(--wpds-color-stroke-focus, var(--wp-admin-theme-color, #3858e9));
|
|
897
|
+
stroke-width: calc(2 * var(--wpds-border-width-focus, var(--wp-admin-border-width-focus, 2px)));
|
|
898
|
+
}
|
|
899
|
+
.a8ccharts-gnszbG-pie-chart {
|
|
900
|
+
isolation: isolate;
|
|
901
|
+
}
|
|
902
|
+
|
|
843
903
|
.a8ccharts-gnszbG-pie-chart__plot {
|
|
844
904
|
position: relative;
|
|
845
905
|
}
|
|
@@ -868,6 +928,10 @@
|
|
|
868
928
|
.a8ccharts-gnszbG-pie-chart__label-text--white {
|
|
869
929
|
fill: #fff;
|
|
870
930
|
}
|
|
931
|
+
.a8ccharts-YtTOxW-pie-semi-circle-chart {
|
|
932
|
+
isolation: isolate;
|
|
933
|
+
}
|
|
934
|
+
|
|
871
935
|
.a8ccharts-YtTOxW-pie-semi-circle-chart__plot {
|
|
872
936
|
position: relative;
|
|
873
937
|
}
|
package/dist/index.d.cts
CHANGED
|
@@ -145,7 +145,7 @@ type DataPointDate = {
|
|
|
145
145
|
/** Per-point fill override for BarChart; other built-in charts ignore it. */
|
|
146
146
|
color?: string;
|
|
147
147
|
};
|
|
148
|
-
type
|
|
148
|
+
type LeaderboardEntryFields = {
|
|
149
149
|
/**
|
|
150
150
|
* Unique internal key (e.g., 'key-direct')
|
|
151
151
|
*/
|
|
@@ -191,7 +191,8 @@ type LeaderboardEntry = {
|
|
|
191
191
|
* For links or other interactive affordances (external-link icons, info
|
|
192
192
|
* tooltips), put them in the `label` render prop instead of using onClick —
|
|
193
193
|
* a row is either a button (onClick) or carries interactive label content,
|
|
194
|
-
* never both, since interactive elements cannot be nested in HTML.
|
|
194
|
+
* never both, since interactive elements cannot be nested in HTML. The
|
|
195
|
+
* exception is a row that sets `hasInteractiveLabel`.
|
|
195
196
|
*/
|
|
196
197
|
onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
|
|
197
198
|
/**
|
|
@@ -205,6 +206,18 @@ type LeaderboardEntry = {
|
|
|
205
206
|
*/
|
|
206
207
|
ariaLabel?: string;
|
|
207
208
|
};
|
|
209
|
+
type LeaderboardEntry = LeaderboardEntryFields & ({
|
|
210
|
+
hasInteractiveLabel?: false;
|
|
211
|
+
} | {
|
|
212
|
+
/**
|
|
213
|
+
* Set when the `label` holds its own link or button. The row's button
|
|
214
|
+
* then sits behind the row instead of around it, so both stay operable.
|
|
215
|
+
* Requires `onClick`, and `ariaLabel` since the button wraps no text.
|
|
216
|
+
*/
|
|
217
|
+
hasInteractiveLabel: true;
|
|
218
|
+
onClick: (event: MouseEvent<HTMLButtonElement>) => void;
|
|
219
|
+
ariaLabel: string;
|
|
220
|
+
});
|
|
208
221
|
type GradientStop = {
|
|
209
222
|
offset: string;
|
|
210
223
|
color?: string;
|
|
@@ -315,9 +328,15 @@ type ChartTheme = {
|
|
|
315
328
|
*
|
|
316
329
|
* `fontFamily: 'inherit'` is load-bearing here — it overrides the font stack
|
|
317
330
|
* `buildChartTheme` injects inline on SVG `<text>`.
|
|
331
|
+
*
|
|
332
|
+
* Give `fontSize` in pixels (`12` or `'12px'`). Margins and pie labels cannot measure `rem`, `em`, `%` or `var()`, so they use the default size and labels can clip (CHARTS-303). An invalid size is dropped.
|
|
318
333
|
*/
|
|
319
334
|
svgLabelSmall?: Omit<TextProps, 'fill'>;
|
|
320
|
-
/**
|
|
335
|
+
/**
|
|
336
|
+
* Styles for large SVG text (eg. axis titles), passed through to the XYChart theme.
|
|
337
|
+
*
|
|
338
|
+
* Give `fontSize` in pixels, as for `svgLabelSmall`.
|
|
339
|
+
*/
|
|
321
340
|
svgLabelBig?: TextProps;
|
|
322
341
|
annotationStyles?: ThemeAnnotationStyles;
|
|
323
342
|
/** LeaderboardChart specific settings */
|
|
@@ -561,6 +580,8 @@ type ChartLegendConfig<T = DataPoint | DataPointDate | LeaderboardEntry> = {
|
|
|
561
580
|
*/
|
|
562
581
|
shapeStyles?: LegendShapeStyles;
|
|
563
582
|
};
|
|
583
|
+
/** Names a comparison series' legend item after the label of the series it is compared with. */
|
|
584
|
+
type ComparisonItemLabel = (seriesLabel: string) => string;
|
|
564
585
|
/**
|
|
565
586
|
* Legend config for charts built from `SeriesData` (line, bar, area). Adds `collapseGroups` on top
|
|
566
587
|
* of the shared config. It is intentionally absent from the base `ChartLegendConfig` so point-based
|
|
@@ -581,6 +602,11 @@ type SeriesChartLegendConfig = ChartLegendConfig<SeriesData[]> & {
|
|
|
581
602
|
* Pass a string to replace the default label.
|
|
582
603
|
*/
|
|
583
604
|
comparisonItem?: boolean | string;
|
|
605
|
+
/**
|
|
606
|
+
* Append one static item per comparison series instead, named by calling this with the label
|
|
607
|
+
* of the series it is compared with, and left out while that series is hidden.
|
|
608
|
+
*/
|
|
609
|
+
comparisonSeriesItems?: ComparisonItemLabel;
|
|
584
610
|
};
|
|
585
611
|
/**
|
|
586
612
|
* Initial visibility options for charts built from labelled series.
|
|
@@ -609,6 +635,10 @@ type BaseChartProps<T = DataPoint | DataPointDate | LeaderboardEntry> = {
|
|
|
609
635
|
* Additional CSS class name for the chart container
|
|
610
636
|
*/
|
|
611
637
|
className?: string;
|
|
638
|
+
/**
|
|
639
|
+
* Accessible name of the chart. Name it after what it shows, and give each chart on a page a different name. Each chart type has a localized default, such as "Line chart".
|
|
640
|
+
*/
|
|
641
|
+
ariaLabel?: string;
|
|
612
642
|
/**
|
|
613
643
|
* Width of the chart container in pixels. When omitted, the chart fills its parent's width.
|
|
614
644
|
*/
|
|
@@ -748,6 +778,8 @@ type BaseLegendItem = {
|
|
|
748
778
|
seriesLabels?: string[];
|
|
749
779
|
/** Set to false for a static item that cannot be toggled or dimmed. */
|
|
750
780
|
interactive?: boolean;
|
|
781
|
+
/** Label of the series this static item describes; the item is left out while it is hidden. */
|
|
782
|
+
describesSeries?: string;
|
|
751
783
|
};
|
|
752
784
|
//#endregion
|
|
753
785
|
//#region src/components/legend/legend.d.ts
|
|
@@ -775,7 +807,9 @@ interface ChartLegendOptions {
|
|
|
775
807
|
* `options.type === 'comparison'`. Skipped when that series already has its own
|
|
776
808
|
* item. Pass a string to replace the default label.
|
|
777
809
|
*/
|
|
778
|
-
comparisonItem?:
|
|
810
|
+
comparisonItem?: SeriesChartLegendConfig['comparisonItem'];
|
|
811
|
+
/** One static item per comparison series instead; see `SeriesChartLegendConfig`. */
|
|
812
|
+
comparisonSeriesItems?: SeriesChartLegendConfig['comparisonSeriesItems'];
|
|
779
813
|
}
|
|
780
814
|
/**
|
|
781
815
|
* Hook to transform chart data into legend items
|
|
@@ -880,14 +914,14 @@ type LineChartAnnotationProps = {
|
|
|
880
914
|
subjectType?: 'circle' | 'line-vertical' | 'line-horizontal';
|
|
881
915
|
styles?: AnnotationStyles;
|
|
882
916
|
testId?: string;
|
|
883
|
-
renderLabel?:
|
|
917
|
+
renderLabel?: (props: {
|
|
884
918
|
title: string;
|
|
885
919
|
subtitle?: string;
|
|
886
|
-
}
|
|
887
|
-
renderLabelPopover?:
|
|
920
|
+
}) => ReactNode;
|
|
921
|
+
renderLabelPopover?: (props: {
|
|
888
922
|
title: string;
|
|
889
923
|
subtitle?: string;
|
|
890
|
-
}
|
|
924
|
+
}) => ReactNode;
|
|
891
925
|
};
|
|
892
926
|
type CurveType = 'smooth' | 'linear' | 'monotone';
|
|
893
927
|
type RenderLineGlyphProps<Datum extends object> = GlyphProps<Datum> & {
|
|
@@ -1215,7 +1249,7 @@ interface TooltipRenderProps {
|
|
|
1215
1249
|
/**
|
|
1216
1250
|
* Props for the ConversionFunnelChart component
|
|
1217
1251
|
*/
|
|
1218
|
-
interface ConversionFunnelChartProps extends Pick<BaseChartProps, 'className' | 'chartId' | 'animation'> {
|
|
1252
|
+
interface ConversionFunnelChartProps extends Pick<BaseChartProps, 'className' | 'chartId' | 'animation' | 'ariaLabel'> {
|
|
1219
1253
|
/** Main conversion rate to highlight */
|
|
1220
1254
|
mainRate: number;
|
|
1221
1255
|
/** Change indicator (e.g., +2%, -1.5%) */
|
|
@@ -1275,7 +1309,7 @@ interface GeoChartError {
|
|
|
1275
1309
|
detailedMessage?: string;
|
|
1276
1310
|
options?: Record<string, unknown>;
|
|
1277
1311
|
}
|
|
1278
|
-
interface GeoChartProps extends Pick<BaseChartProps, 'className' | 'chartId' | 'width' | 'height'> {
|
|
1312
|
+
interface GeoChartProps extends Pick<BaseChartProps, 'className' | 'chartId' | 'ariaLabel' | 'width' | 'height'> {
|
|
1279
1313
|
/**
|
|
1280
1314
|
* Data in Google Charts native format for maximum flexibility.
|
|
1281
1315
|
* First row contains column headers, subsequent rows contain data.
|
|
@@ -1394,10 +1428,10 @@ interface HeatmapChartProps extends Omit<BaseChartProps<HeatmapColumn[]>, 'showL
|
|
|
1394
1428
|
* group past the edge, Page Up/Down by one group. Default `grid`.
|
|
1395
1429
|
*/
|
|
1396
1430
|
keyboardNavigation?: 'grid' | 'calendar';
|
|
1397
|
-
/** Accessible name of the grid. Defaults to a localized "Heatmap chart". */
|
|
1398
|
-
ariaLabel?: string;
|
|
1399
1431
|
/** Compact mode: hide in-cell values, tighten gap, thin axis labels. Default false. */
|
|
1400
1432
|
compact?: boolean;
|
|
1433
|
+
/** Compact mode only: grow the cells to fill the chart's box, wrapping the column groups onto more rows when that makes them larger. Default false. */
|
|
1434
|
+
fitCells?: boolean;
|
|
1401
1435
|
/** Render the numeric value inside each cell. Default `! compact`. */
|
|
1402
1436
|
showValues?: boolean;
|
|
1403
1437
|
/**
|
|
@@ -1485,7 +1519,7 @@ type MonthCalendarHeatmapResult = {
|
|
|
1485
1519
|
//#endregion
|
|
1486
1520
|
//#region src/charts/heatmap-chart/private/heatmap-legend.d.ts
|
|
1487
1521
|
interface HeatmapLegendProps {
|
|
1488
|
-
/** Number of swatches in the scale. Default 5. */
|
|
1522
|
+
/** Number of color swatches in the scale, not counting the empty-cell swatch. Default 5. */
|
|
1489
1523
|
steps?: number;
|
|
1490
1524
|
/**
|
|
1491
1525
|
* `swatches` spaces the steps out as cell-sized squares; `bar` joins them
|
|
@@ -1550,7 +1584,12 @@ declare const useCalendarHeatmapData: (series: DataPointDate[], options?: Calend
|
|
|
1550
1584
|
declare const useMonthCalendarHeatmapData: (valueByDay: Record<string, number | null>, range: MonthCalendarHeatmapRange, options?: MonthCalendarHeatmapOptions) => MonthCalendarHeatmapResult;
|
|
1551
1585
|
//#endregion
|
|
1552
1586
|
//#region src/charts/leaderboard-chart/types.d.ts
|
|
1553
|
-
interface LeaderboardChartProps extends Pick<BaseChartProps<LeaderboardEntry>, 'className' | '
|
|
1587
|
+
interface LeaderboardChartProps extends Pick<BaseChartProps<LeaderboardEntry>, 'className' | 'showLegend' | 'legend' | 'chartId' | 'width' | 'height' | 'size' | 'gap' | 'animation' | 'ariaLabel'> {
|
|
1588
|
+
/**
|
|
1589
|
+
* Entries to display. Declared here rather than picked, since the base type
|
|
1590
|
+
* would split the entry union into one array type per member.
|
|
1591
|
+
*/
|
|
1592
|
+
data: LeaderboardEntry[];
|
|
1554
1593
|
/**
|
|
1555
1594
|
* Whether to show comparison data
|
|
1556
1595
|
*/
|
|
@@ -2381,5 +2420,5 @@ declare const defaultTheme: CompleteChartTheme;
|
|
|
2381
2420
|
*/
|
|
2382
2421
|
declare const useChartScopeElement: () => HTMLElement | null;
|
|
2383
2422
|
//#endregion
|
|
2384
|
-
export { AccessibleTooltip, type AnnotationStyles, type ArcData, AreaChartResponsive as AreaChart, type AreaChartProps, AreaChart as AreaChartUnresponsive, type AxisOptions, type BandHighlightSelection, 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 CalendarHeatmapOptions, type CalendarHeatmapResult, type ChartFormatting, type ChartLegendConfig, type ChartLegendOptions, type ChartTheme, type CompleteChartTheme, ConversionFunnelChartWithProvider as ConversionFunnelChart, type ConversionFunnelChartProps, type CrosshairStyle, 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 GeoDisplayMode, 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 HeatmapColumnGroup, 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 MonthCalendarHeatmapOptions, type MonthCalendarHeatmapRange, type MonthCalendarHeatmapResult, 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, TooltipBox, type TooltipBoxProps, type TooltipData, type TooltipDatum, type TooltipPlacement, type TooltipProps, type TooltipRenderProps, type TrendDirection, TrendIndicator, type TrendIndicatorProps, XYChartTooltip, type XyChartTooltipProps, buildCalendarHeatmapData, buildMonthCalendarHeatmapData, defaultTheme, formatMetricValue, formatPercentage, getBucketInfo, getColorDistance, hexToRgba, isValidHexColor, lightenHexColor, mergeThemes, mixHexColors, normalizeColorToHex, parseAsLocalDate, parseHslString, prefersLightText, relativeLuminance, resolveCssVariable, useCalendarHeatmapData, useChartFormatting, useChartLegendItems, useChartRegistration, useChartScopeElement, useGlobalChartsContext, useGlobalChartsTheme, useLeaderboardLegendItems, useMonthCalendarHeatmapData, validateHexColor };
|
|
2423
|
+
export { AccessibleTooltip, type AnnotationStyles, type ArcData, AreaChartResponsive as AreaChart, type AreaChartProps, AreaChart as AreaChartUnresponsive, type AxisOptions, type BandHighlightSelection, 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 CalendarHeatmapOptions, type CalendarHeatmapResult, type ChartFormatting, type ChartLegendConfig, type ChartLegendOptions, type ChartTheme, type ComparisonItemLabel, type CompleteChartTheme, ConversionFunnelChartWithProvider as ConversionFunnelChart, type ConversionFunnelChartProps, type CrosshairStyle, 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 GeoDisplayMode, 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 HeatmapColumnGroup, 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 MonthCalendarHeatmapOptions, type MonthCalendarHeatmapRange, type MonthCalendarHeatmapResult, 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, TooltipBox, type TooltipBoxProps, type TooltipData, type TooltipDatum, type TooltipPlacement, type TooltipProps, type TooltipRenderProps, type TrendDirection, TrendIndicator, type TrendIndicatorProps, XYChartTooltip, type XyChartTooltipProps, buildCalendarHeatmapData, buildMonthCalendarHeatmapData, defaultTheme, formatMetricValue, formatPercentage, getBucketInfo, getColorDistance, hexToRgba, isValidHexColor, lightenHexColor, mergeThemes, mixHexColors, normalizeColorToHex, parseAsLocalDate, parseHslString, prefersLightText, relativeLuminance, resolveCssVariable, useCalendarHeatmapData, useChartFormatting, useChartLegendItems, useChartRegistration, useChartScopeElement, useGlobalChartsContext, useGlobalChartsTheme, useLeaderboardLegendItems, useMonthCalendarHeatmapData, validateHexColor };
|
|
2385
2424
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.ts
CHANGED
|
@@ -145,7 +145,7 @@ type DataPointDate = {
|
|
|
145
145
|
/** Per-point fill override for BarChart; other built-in charts ignore it. */
|
|
146
146
|
color?: string;
|
|
147
147
|
};
|
|
148
|
-
type
|
|
148
|
+
type LeaderboardEntryFields = {
|
|
149
149
|
/**
|
|
150
150
|
* Unique internal key (e.g., 'key-direct')
|
|
151
151
|
*/
|
|
@@ -191,7 +191,8 @@ type LeaderboardEntry = {
|
|
|
191
191
|
* For links or other interactive affordances (external-link icons, info
|
|
192
192
|
* tooltips), put them in the `label` render prop instead of using onClick —
|
|
193
193
|
* a row is either a button (onClick) or carries interactive label content,
|
|
194
|
-
* never both, since interactive elements cannot be nested in HTML.
|
|
194
|
+
* never both, since interactive elements cannot be nested in HTML. The
|
|
195
|
+
* exception is a row that sets `hasInteractiveLabel`.
|
|
195
196
|
*/
|
|
196
197
|
onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
|
|
197
198
|
/**
|
|
@@ -205,6 +206,18 @@ type LeaderboardEntry = {
|
|
|
205
206
|
*/
|
|
206
207
|
ariaLabel?: string;
|
|
207
208
|
};
|
|
209
|
+
type LeaderboardEntry = LeaderboardEntryFields & ({
|
|
210
|
+
hasInteractiveLabel?: false;
|
|
211
|
+
} | {
|
|
212
|
+
/**
|
|
213
|
+
* Set when the `label` holds its own link or button. The row's button
|
|
214
|
+
* then sits behind the row instead of around it, so both stay operable.
|
|
215
|
+
* Requires `onClick`, and `ariaLabel` since the button wraps no text.
|
|
216
|
+
*/
|
|
217
|
+
hasInteractiveLabel: true;
|
|
218
|
+
onClick: (event: MouseEvent<HTMLButtonElement>) => void;
|
|
219
|
+
ariaLabel: string;
|
|
220
|
+
});
|
|
208
221
|
type GradientStop = {
|
|
209
222
|
offset: string;
|
|
210
223
|
color?: string;
|
|
@@ -315,9 +328,15 @@ type ChartTheme = {
|
|
|
315
328
|
*
|
|
316
329
|
* `fontFamily: 'inherit'` is load-bearing here — it overrides the font stack
|
|
317
330
|
* `buildChartTheme` injects inline on SVG `<text>`.
|
|
331
|
+
*
|
|
332
|
+
* Give `fontSize` in pixels (`12` or `'12px'`). Margins and pie labels cannot measure `rem`, `em`, `%` or `var()`, so they use the default size and labels can clip (CHARTS-303). An invalid size is dropped.
|
|
318
333
|
*/
|
|
319
334
|
svgLabelSmall?: Omit<TextProps, 'fill'>;
|
|
320
|
-
/**
|
|
335
|
+
/**
|
|
336
|
+
* Styles for large SVG text (eg. axis titles), passed through to the XYChart theme.
|
|
337
|
+
*
|
|
338
|
+
* Give `fontSize` in pixels, as for `svgLabelSmall`.
|
|
339
|
+
*/
|
|
321
340
|
svgLabelBig?: TextProps;
|
|
322
341
|
annotationStyles?: ThemeAnnotationStyles;
|
|
323
342
|
/** LeaderboardChart specific settings */
|
|
@@ -561,6 +580,8 @@ type ChartLegendConfig<T = DataPoint | DataPointDate | LeaderboardEntry> = {
|
|
|
561
580
|
*/
|
|
562
581
|
shapeStyles?: LegendShapeStyles;
|
|
563
582
|
};
|
|
583
|
+
/** Names a comparison series' legend item after the label of the series it is compared with. */
|
|
584
|
+
type ComparisonItemLabel = (seriesLabel: string) => string;
|
|
564
585
|
/**
|
|
565
586
|
* Legend config for charts built from `SeriesData` (line, bar, area). Adds `collapseGroups` on top
|
|
566
587
|
* of the shared config. It is intentionally absent from the base `ChartLegendConfig` so point-based
|
|
@@ -581,6 +602,11 @@ type SeriesChartLegendConfig = ChartLegendConfig<SeriesData[]> & {
|
|
|
581
602
|
* Pass a string to replace the default label.
|
|
582
603
|
*/
|
|
583
604
|
comparisonItem?: boolean | string;
|
|
605
|
+
/**
|
|
606
|
+
* Append one static item per comparison series instead, named by calling this with the label
|
|
607
|
+
* of the series it is compared with, and left out while that series is hidden.
|
|
608
|
+
*/
|
|
609
|
+
comparisonSeriesItems?: ComparisonItemLabel;
|
|
584
610
|
};
|
|
585
611
|
/**
|
|
586
612
|
* Initial visibility options for charts built from labelled series.
|
|
@@ -609,6 +635,10 @@ type BaseChartProps<T = DataPoint | DataPointDate | LeaderboardEntry> = {
|
|
|
609
635
|
* Additional CSS class name for the chart container
|
|
610
636
|
*/
|
|
611
637
|
className?: string;
|
|
638
|
+
/**
|
|
639
|
+
* Accessible name of the chart. Name it after what it shows, and give each chart on a page a different name. Each chart type has a localized default, such as "Line chart".
|
|
640
|
+
*/
|
|
641
|
+
ariaLabel?: string;
|
|
612
642
|
/**
|
|
613
643
|
* Width of the chart container in pixels. When omitted, the chart fills its parent's width.
|
|
614
644
|
*/
|
|
@@ -748,6 +778,8 @@ type BaseLegendItem = {
|
|
|
748
778
|
seriesLabels?: string[];
|
|
749
779
|
/** Set to false for a static item that cannot be toggled or dimmed. */
|
|
750
780
|
interactive?: boolean;
|
|
781
|
+
/** Label of the series this static item describes; the item is left out while it is hidden. */
|
|
782
|
+
describesSeries?: string;
|
|
751
783
|
};
|
|
752
784
|
//#endregion
|
|
753
785
|
//#region src/components/legend/legend.d.ts
|
|
@@ -775,7 +807,9 @@ interface ChartLegendOptions {
|
|
|
775
807
|
* `options.type === 'comparison'`. Skipped when that series already has its own
|
|
776
808
|
* item. Pass a string to replace the default label.
|
|
777
809
|
*/
|
|
778
|
-
comparisonItem?:
|
|
810
|
+
comparisonItem?: SeriesChartLegendConfig['comparisonItem'];
|
|
811
|
+
/** One static item per comparison series instead; see `SeriesChartLegendConfig`. */
|
|
812
|
+
comparisonSeriesItems?: SeriesChartLegendConfig['comparisonSeriesItems'];
|
|
779
813
|
}
|
|
780
814
|
/**
|
|
781
815
|
* Hook to transform chart data into legend items
|
|
@@ -880,14 +914,14 @@ type LineChartAnnotationProps = {
|
|
|
880
914
|
subjectType?: 'circle' | 'line-vertical' | 'line-horizontal';
|
|
881
915
|
styles?: AnnotationStyles;
|
|
882
916
|
testId?: string;
|
|
883
|
-
renderLabel?:
|
|
917
|
+
renderLabel?: (props: {
|
|
884
918
|
title: string;
|
|
885
919
|
subtitle?: string;
|
|
886
|
-
}
|
|
887
|
-
renderLabelPopover?:
|
|
920
|
+
}) => ReactNode;
|
|
921
|
+
renderLabelPopover?: (props: {
|
|
888
922
|
title: string;
|
|
889
923
|
subtitle?: string;
|
|
890
|
-
}
|
|
924
|
+
}) => ReactNode;
|
|
891
925
|
};
|
|
892
926
|
type CurveType = 'smooth' | 'linear' | 'monotone';
|
|
893
927
|
type RenderLineGlyphProps<Datum extends object> = GlyphProps<Datum> & {
|
|
@@ -1215,7 +1249,7 @@ interface TooltipRenderProps {
|
|
|
1215
1249
|
/**
|
|
1216
1250
|
* Props for the ConversionFunnelChart component
|
|
1217
1251
|
*/
|
|
1218
|
-
interface ConversionFunnelChartProps extends Pick<BaseChartProps, 'className' | 'chartId' | 'animation'> {
|
|
1252
|
+
interface ConversionFunnelChartProps extends Pick<BaseChartProps, 'className' | 'chartId' | 'animation' | 'ariaLabel'> {
|
|
1219
1253
|
/** Main conversion rate to highlight */
|
|
1220
1254
|
mainRate: number;
|
|
1221
1255
|
/** Change indicator (e.g., +2%, -1.5%) */
|
|
@@ -1275,7 +1309,7 @@ interface GeoChartError {
|
|
|
1275
1309
|
detailedMessage?: string;
|
|
1276
1310
|
options?: Record<string, unknown>;
|
|
1277
1311
|
}
|
|
1278
|
-
interface GeoChartProps extends Pick<BaseChartProps, 'className' | 'chartId' | 'width' | 'height'> {
|
|
1312
|
+
interface GeoChartProps extends Pick<BaseChartProps, 'className' | 'chartId' | 'ariaLabel' | 'width' | 'height'> {
|
|
1279
1313
|
/**
|
|
1280
1314
|
* Data in Google Charts native format for maximum flexibility.
|
|
1281
1315
|
* First row contains column headers, subsequent rows contain data.
|
|
@@ -1394,10 +1428,10 @@ interface HeatmapChartProps extends Omit<BaseChartProps<HeatmapColumn[]>, 'showL
|
|
|
1394
1428
|
* group past the edge, Page Up/Down by one group. Default `grid`.
|
|
1395
1429
|
*/
|
|
1396
1430
|
keyboardNavigation?: 'grid' | 'calendar';
|
|
1397
|
-
/** Accessible name of the grid. Defaults to a localized "Heatmap chart". */
|
|
1398
|
-
ariaLabel?: string;
|
|
1399
1431
|
/** Compact mode: hide in-cell values, tighten gap, thin axis labels. Default false. */
|
|
1400
1432
|
compact?: boolean;
|
|
1433
|
+
/** Compact mode only: grow the cells to fill the chart's box, wrapping the column groups onto more rows when that makes them larger. Default false. */
|
|
1434
|
+
fitCells?: boolean;
|
|
1401
1435
|
/** Render the numeric value inside each cell. Default `! compact`. */
|
|
1402
1436
|
showValues?: boolean;
|
|
1403
1437
|
/**
|
|
@@ -1485,7 +1519,7 @@ type MonthCalendarHeatmapResult = {
|
|
|
1485
1519
|
//#endregion
|
|
1486
1520
|
//#region src/charts/heatmap-chart/private/heatmap-legend.d.ts
|
|
1487
1521
|
interface HeatmapLegendProps {
|
|
1488
|
-
/** Number of swatches in the scale. Default 5. */
|
|
1522
|
+
/** Number of color swatches in the scale, not counting the empty-cell swatch. Default 5. */
|
|
1489
1523
|
steps?: number;
|
|
1490
1524
|
/**
|
|
1491
1525
|
* `swatches` spaces the steps out as cell-sized squares; `bar` joins them
|
|
@@ -1550,7 +1584,12 @@ declare const useCalendarHeatmapData: (series: DataPointDate[], options?: Calend
|
|
|
1550
1584
|
declare const useMonthCalendarHeatmapData: (valueByDay: Record<string, number | null>, range: MonthCalendarHeatmapRange, options?: MonthCalendarHeatmapOptions) => MonthCalendarHeatmapResult;
|
|
1551
1585
|
//#endregion
|
|
1552
1586
|
//#region src/charts/leaderboard-chart/types.d.ts
|
|
1553
|
-
interface LeaderboardChartProps extends Pick<BaseChartProps<LeaderboardEntry>, 'className' | '
|
|
1587
|
+
interface LeaderboardChartProps extends Pick<BaseChartProps<LeaderboardEntry>, 'className' | 'showLegend' | 'legend' | 'chartId' | 'width' | 'height' | 'size' | 'gap' | 'animation' | 'ariaLabel'> {
|
|
1588
|
+
/**
|
|
1589
|
+
* Entries to display. Declared here rather than picked, since the base type
|
|
1590
|
+
* would split the entry union into one array type per member.
|
|
1591
|
+
*/
|
|
1592
|
+
data: LeaderboardEntry[];
|
|
1554
1593
|
/**
|
|
1555
1594
|
* Whether to show comparison data
|
|
1556
1595
|
*/
|
|
@@ -2381,5 +2420,5 @@ declare const defaultTheme: CompleteChartTheme;
|
|
|
2381
2420
|
*/
|
|
2382
2421
|
declare const useChartScopeElement: () => HTMLElement | null;
|
|
2383
2422
|
//#endregion
|
|
2384
|
-
export { AccessibleTooltip, type AnnotationStyles, type ArcData, AreaChartResponsive as AreaChart, type AreaChartProps, AreaChart as AreaChartUnresponsive, type AxisOptions, type BandHighlightSelection, 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 CalendarHeatmapOptions, type CalendarHeatmapResult, type ChartFormatting, type ChartLegendConfig, type ChartLegendOptions, type ChartTheme, type CompleteChartTheme, ConversionFunnelChartWithProvider as ConversionFunnelChart, type ConversionFunnelChartProps, type CrosshairStyle, 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 GeoDisplayMode, 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 HeatmapColumnGroup, 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 MonthCalendarHeatmapOptions, type MonthCalendarHeatmapRange, type MonthCalendarHeatmapResult, 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, TooltipBox, type TooltipBoxProps, type TooltipData, type TooltipDatum, type TooltipPlacement, type TooltipProps, type TooltipRenderProps, type TrendDirection, TrendIndicator, type TrendIndicatorProps, XYChartTooltip, type XyChartTooltipProps, buildCalendarHeatmapData, buildMonthCalendarHeatmapData, defaultTheme, formatMetricValue, formatPercentage, getBucketInfo, getColorDistance, hexToRgba, isValidHexColor, lightenHexColor, mergeThemes, mixHexColors, normalizeColorToHex, parseAsLocalDate, parseHslString, prefersLightText, relativeLuminance, resolveCssVariable, useCalendarHeatmapData, useChartFormatting, useChartLegendItems, useChartRegistration, useChartScopeElement, useGlobalChartsContext, useGlobalChartsTheme, useLeaderboardLegendItems, useMonthCalendarHeatmapData, validateHexColor };
|
|
2423
|
+
export { AccessibleTooltip, type AnnotationStyles, type ArcData, AreaChartResponsive as AreaChart, type AreaChartProps, AreaChart as AreaChartUnresponsive, type AxisOptions, type BandHighlightSelection, 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 CalendarHeatmapOptions, type CalendarHeatmapResult, type ChartFormatting, type ChartLegendConfig, type ChartLegendOptions, type ChartTheme, type ComparisonItemLabel, type CompleteChartTheme, ConversionFunnelChartWithProvider as ConversionFunnelChart, type ConversionFunnelChartProps, type CrosshairStyle, 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 GeoDisplayMode, 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 HeatmapColumnGroup, 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 MonthCalendarHeatmapOptions, type MonthCalendarHeatmapRange, type MonthCalendarHeatmapResult, 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, TooltipBox, type TooltipBoxProps, type TooltipData, type TooltipDatum, type TooltipPlacement, type TooltipProps, type TooltipRenderProps, type TrendDirection, TrendIndicator, type TrendIndicatorProps, XYChartTooltip, type XyChartTooltipProps, buildCalendarHeatmapData, buildMonthCalendarHeatmapData, defaultTheme, formatMetricValue, formatPercentage, getBucketInfo, getColorDistance, hexToRgba, isValidHexColor, lightenHexColor, mergeThemes, mixHexColors, normalizeColorToHex, parseAsLocalDate, parseHslString, prefersLightText, relativeLuminance, resolveCssVariable, useCalendarHeatmapData, useChartFormatting, useChartLegendItems, useChartRegistration, useChartScopeElement, useGlobalChartsContext, useGlobalChartsTheme, useLeaderboardLegendItems, useMonthCalendarHeatmapData, validateHexColor };
|
|
2385
2424
|
//# sourceMappingURL=index.d.ts.map
|