@cloudscape-design/components 3.0.460 → 3.0.461
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/alert/styles.css.js +25 -25
- package/alert/styles.scoped.css +53 -59
- package/alert/styles.selectors.js +25 -25
- package/anchor-navigation/styles.css.js +8 -8
- package/anchor-navigation/styles.scoped.css +30 -39
- package/anchor-navigation/styles.selectors.js +8 -8
- package/annotation-context/annotation/styles.css.js +24 -24
- package/annotation-context/annotation/styles.scoped.css +48 -55
- package/annotation-context/annotation/styles.selectors.js +24 -24
- package/app-layout/content-wrapper/styles.css.js +3 -3
- package/app-layout/content-wrapper/styles.scoped.css +15 -15
- package/app-layout/content-wrapper/styles.selectors.js +3 -3
- package/app-layout/drawer/styles.css.js +12 -12
- package/app-layout/drawer/styles.scoped.css +30 -29
- package/app-layout/drawer/styles.selectors.js +12 -12
- package/app-layout/interfaces.d.ts +4 -3
- package/app-layout/interfaces.d.ts.map +1 -1
- package/app-layout/interfaces.js.map +1 -1
- package/app-layout/mobile-toolbar/styles.css.js +8 -8
- package/app-layout/mobile-toolbar/styles.scoped.css +17 -18
- package/app-layout/mobile-toolbar/styles.selectors.js +8 -8
- package/app-layout/notifications/styles.css.js +3 -3
- package/app-layout/notifications/styles.scoped.css +6 -6
- package/app-layout/notifications/styles.selectors.js +3 -3
- package/app-layout/split-panel/styles.css.js +2 -2
- package/app-layout/split-panel/styles.scoped.css +3 -3
- package/app-layout/split-panel/styles.selectors.js +2 -2
- package/app-layout/styles.css.js +16 -16
- package/app-layout/styles.scoped.css +26 -26
- package/app-layout/styles.selectors.js +16 -16
- package/app-layout/toggles/styles.css.js +2 -2
- package/app-layout/toggles/styles.scoped.css +9 -10
- package/app-layout/toggles/styles.selectors.js +2 -2
- package/app-layout/utils/use-drawers.js.map +1 -1
- package/app-layout/visual-refresh/context.js +1 -1
- package/app-layout/visual-refresh/context.js.map +1 -1
- package/app-layout/visual-refresh/styles.css.js +80 -80
- package/app-layout/visual-refresh/styles.scoped.css +251 -268
- package/app-layout/visual-refresh/styles.selectors.js +80 -80
- package/area-chart/styles.css.js +6 -6
- package/area-chart/styles.scoped.css +11 -12
- package/area-chart/styles.selectors.js +6 -6
- package/attribute-editor/styles.css.js +14 -14
- package/attribute-editor/styles.scoped.css +29 -30
- package/attribute-editor/styles.selectors.js +14 -14
- package/autosuggest/styles.css.js +3 -3
- package/autosuggest/styles.scoped.css +5 -5
- package/autosuggest/styles.selectors.js +3 -3
- package/badge/styles.css.js +5 -5
- package/badge/styles.scoped.css +7 -11
- package/badge/styles.selectors.js +5 -5
- package/bar-chart/index.d.ts +1 -1
- package/bar-chart/index.d.ts.map +1 -1
- package/bar-chart/index.js +2 -2
- package/bar-chart/index.js.map +1 -1
- package/bar-chart/interfaces.d.ts +3 -8
- package/bar-chart/interfaces.d.ts.map +1 -1
- package/bar-chart/interfaces.js.map +1 -1
- package/box/styles.css.js +190 -190
- package/box/styles.scoped.css +240 -244
- package/box/styles.selectors.js +190 -190
- package/breadcrumb-group/item/styles.css.js +9 -9
- package/breadcrumb-group/item/styles.scoped.css +19 -20
- package/breadcrumb-group/item/styles.selectors.js +9 -9
- package/breadcrumb-group/styles.css.js +7 -7
- package/breadcrumb-group/styles.scoped.css +21 -28
- package/breadcrumb-group/styles.selectors.js +7 -7
- package/button/styles.css.js +20 -20
- package/button/styles.scoped.css +153 -155
- package/button/styles.selectors.js +20 -20
- package/button-dropdown/category-elements/styles.css.js +13 -13
- package/button-dropdown/category-elements/styles.scoped.css +50 -60
- package/button-dropdown/category-elements/styles.selectors.js +13 -13
- package/button-dropdown/item-element/styles.css.js +15 -15
- package/button-dropdown/item-element/styles.scoped.css +33 -38
- package/button-dropdown/item-element/styles.selectors.js +15 -15
- package/button-dropdown/mobile-expandable-group/styles.css.js +5 -5
- package/button-dropdown/mobile-expandable-group/styles.scoped.css +8 -8
- package/button-dropdown/mobile-expandable-group/styles.selectors.js +5 -5
- package/button-dropdown/styles.css.js +15 -15
- package/button-dropdown/styles.scoped.css +36 -39
- package/button-dropdown/styles.selectors.js +15 -15
- package/calendar/styles.css.js +18 -18
- package/calendar/styles.scoped.css +59 -75
- package/calendar/styles.selectors.js +18 -18
- package/cards/styles.css.js +38 -38
- package/cards/styles.scoped.css +94 -110
- package/cards/styles.selectors.js +38 -38
- package/code-editor/resizable-box/styles.css.js +3 -3
- package/code-editor/resizable-box/styles.scoped.css +10 -10
- package/code-editor/resizable-box/styles.selectors.js +3 -3
- package/code-editor/styles.css.js +32 -32
- package/code-editor/styles.scoped.css +198 -210
- package/code-editor/styles.selectors.js +32 -32
- package/collection-preferences/content-display/styles.css.js +11 -11
- package/collection-preferences/content-display/styles.scoped.css +30 -40
- package/collection-preferences/content-display/styles.selectors.js +11 -11
- package/collection-preferences/styles.css.js +37 -37
- package/collection-preferences/styles.scoped.css +66 -79
- package/collection-preferences/styles.selectors.js +37 -37
- package/column-layout/flexible-column-layout/styles.css.js +5 -5
- package/column-layout/flexible-column-layout/styles.scoped.css +9 -8
- package/column-layout/flexible-column-layout/styles.selectors.js +5 -5
- package/column-layout/styles.css.js +13 -13
- package/column-layout/styles.scoped.css +64 -70
- package/column-layout/styles.selectors.js +13 -13
- package/container/styles.css.js +28 -28
- package/container/styles.scoped.css +98 -106
- package/container/styles.selectors.js +28 -28
- package/content-layout/styles.css.js +7 -7
- package/content-layout/styles.scoped.css +15 -15
- package/content-layout/styles.selectors.js +7 -7
- package/date-picker/styles.css.js +7 -7
- package/date-picker/styles.scoped.css +12 -12
- package/date-picker/styles.selectors.js +7 -7
- package/date-range-picker/calendar/grids/styles.css.js +25 -25
- package/date-range-picker/calendar/grids/styles.scoped.css +60 -71
- package/date-range-picker/calendar/grids/styles.selectors.js +25 -25
- package/date-range-picker/relative-range/styles.css.js +9 -9
- package/date-range-picker/relative-range/styles.scoped.css +21 -21
- package/date-range-picker/relative-range/styles.selectors.js +9 -9
- package/date-range-picker/styles.css.js +38 -38
- package/date-range-picker/styles.scoped.css +68 -73
- package/date-range-picker/styles.selectors.js +38 -38
- package/drawer/styles.css.js +3 -3
- package/drawer/styles.scoped.css +18 -21
- package/drawer/styles.selectors.js +3 -3
- package/expandable-section/expandable-section-container.d.ts +2 -2
- package/expandable-section/expandable-section-container.d.ts.map +1 -1
- package/expandable-section/expandable-section-container.js.map +1 -1
- package/expandable-section/expandable-section-header.d.ts +2 -3
- package/expandable-section/expandable-section-header.d.ts.map +1 -1
- package/expandable-section/expandable-section-header.js +11 -7
- package/expandable-section/expandable-section-header.js.map +1 -1
- package/expandable-section/interfaces.d.ts +1 -0
- package/expandable-section/interfaces.d.ts.map +1 -1
- package/expandable-section/interfaces.js.map +1 -1
- package/expandable-section/internal.d.ts +4 -2
- package/expandable-section/internal.d.ts.map +1 -1
- package/expandable-section/internal.js.map +1 -1
- package/expandable-section/styles.css.js +32 -29
- package/expandable-section/styles.scoped.css +106 -99
- package/expandable-section/styles.selectors.js +32 -29
- package/expandable-section/utils.d.ts +3 -2
- package/expandable-section/utils.d.ts.map +1 -1
- package/expandable-section/utils.js +4 -1
- package/expandable-section/utils.js.map +1 -1
- package/file-upload/dropzone/styles.css.js +2 -2
- package/file-upload/dropzone/styles.scoped.css +4 -8
- package/file-upload/dropzone/styles.selectors.js +2 -2
- package/file-upload/file-option/styles.css.js +7 -7
- package/file-upload/file-option/styles.scoped.css +15 -15
- package/file-upload/file-option/styles.selectors.js +7 -7
- package/file-upload/styles.css.js +2 -2
- package/file-upload/styles.scoped.css +4 -4
- package/file-upload/styles.selectors.js +2 -2
- package/flashbar/styles.css.js +47 -47
- package/flashbar/styles.scoped.css +215 -220
- package/flashbar/styles.selectors.js +47 -47
- package/form/styles.css.js +9 -9
- package/form/styles.scoped.css +18 -18
- package/form/styles.selectors.js +9 -9
- package/form-field/styles.css.js +19 -19
- package/form-field/styles.scoped.css +34 -34
- package/form-field/styles.selectors.js +19 -19
- package/internal/components/cartesian-chart/interfaces.d.ts.map +1 -1
- package/internal/components/cartesian-chart/interfaces.js.map +1 -1
- package/internal/components/chart-plot/index.d.ts +1 -1
- package/internal/components/chart-plot/index.d.ts.map +1 -1
- package/internal/components/chart-plot/index.js.map +1 -1
- package/internal/components/chart-series-details/index.d.ts +12 -4
- package/internal/components/chart-series-details/index.d.ts.map +1 -1
- package/internal/components/chart-series-details/index.js +46 -10
- package/internal/components/chart-series-details/index.js.map +1 -1
- package/internal/components/chart-series-details/series-details-text.d.ts +2 -0
- package/internal/components/chart-series-details/series-details-text.d.ts.map +1 -0
- package/internal/components/chart-series-details/series-details-text.js +17 -0
- package/internal/components/chart-series-details/series-details-text.js.map +1 -0
- package/internal/components/chart-series-details/styles.css.js +19 -5
- package/internal/components/chart-series-details/styles.scoped.css +141 -15
- package/internal/components/chart-series-details/styles.selectors.js +19 -5
- package/internal/environment.js +1 -1
- package/internal/environment.json +1 -1
- package/internal/manifest.json +1 -1
- package/line-chart/interfaces.d.ts +2 -8
- package/line-chart/interfaces.d.ts.map +1 -1
- package/line-chart/interfaces.js.map +1 -1
- package/mixed-line-bar-chart/chart-container.d.ts +2 -1
- package/mixed-line-bar-chart/chart-container.d.ts.map +1 -1
- package/mixed-line-bar-chart/chart-container.js +17 -8
- package/mixed-line-bar-chart/chart-container.js.map +1 -1
- package/mixed-line-bar-chart/chart-popover.d.ts +1 -0
- package/mixed-line-bar-chart/chart-popover.d.ts.map +1 -1
- package/mixed-line-bar-chart/chart-popover.js +13 -3
- package/mixed-line-bar-chart/chart-popover.js.map +1 -1
- package/mixed-line-bar-chart/format-highlighted.d.ts +7 -2
- package/mixed-line-bar-chart/format-highlighted.d.ts.map +1 -1
- package/mixed-line-bar-chart/format-highlighted.js +25 -5
- package/mixed-line-bar-chart/format-highlighted.js.map +1 -1
- package/mixed-line-bar-chart/interfaces.d.ts +38 -6
- package/mixed-line-bar-chart/interfaces.d.ts.map +1 -1
- package/mixed-line-bar-chart/interfaces.js.map +1 -1
- package/mixed-line-bar-chart/internal.d.ts +1 -1
- package/mixed-line-bar-chart/internal.d.ts.map +1 -1
- package/mixed-line-bar-chart/internal.js +2 -2
- package/mixed-line-bar-chart/internal.js.map +1 -1
- package/modal/styles.css.js +23 -23
- package/modal/styles.scoped.css +39 -39
- package/modal/styles.selectors.js +23 -23
- package/package.json +1 -1
- package/pie-chart/interfaces.d.ts +5 -5
- package/pie-chart/interfaces.d.ts.map +1 -1
- package/pie-chart/interfaces.js.map +1 -1
- package/pie-chart/pie-chart.d.ts +1 -1
- package/pie-chart/pie-chart.d.ts.map +1 -1
- package/pie-chart/pie-chart.js +21 -18
- package/pie-chart/pie-chart.js.map +1 -1
- package/table/column-widths-utils.d.ts +1 -0
- package/table/column-widths-utils.d.ts.map +1 -1
- package/table/column-widths-utils.js +18 -0
- package/table/column-widths-utils.js.map +1 -1
- package/table/internal.d.ts.map +1 -1
- package/table/internal.js +7 -6
- package/table/internal.js.map +1 -1
- package/table/no-data-cell.d.ts +13 -0
- package/table/no-data-cell.d.ts.map +1 -0
- package/table/no-data-cell.js +24 -0
- package/table/no-data-cell.js.map +1 -0
- package/table/sticky-columns/use-sticky-columns.js +1 -1
- package/table/sticky-columns/use-sticky-columns.js.map +1 -1
- package/table/thead.d.ts +0 -1
- package/table/thead.d.ts.map +1 -1
- package/table/thead.js +3 -18
- package/table/thead.js.map +1 -1
- package/table/use-column-widths.d.ts +5 -3
- package/table/use-column-widths.d.ts.map +1 -1
- package/table/use-column-widths.js +61 -11
- package/table/use-column-widths.js.map +1 -1
- package/table/use-sticky-header.d.ts.map +1 -1
- package/table/use-sticky-header.js +0 -13
- package/table/use-sticky-header.js.map +1 -1
- package/test-utils/dom/internal/chart-popover.d.ts +8 -0
- package/test-utils/dom/internal/chart-popover.js +23 -0
- package/test-utils/dom/internal/chart-popover.js.map +1 -1
- package/test-utils/selectors/internal/chart-popover.d.ts +8 -0
- package/test-utils/selectors/internal/chart-popover.js +22 -0
- package/test-utils/selectors/internal/chart-popover.js.map +1 -1
- package/test-utils/tsconfig.tsbuildinfo +1 -1
- package/tiles/styles.css.js +29 -29
- package/tiles/styles.scoped.css +91 -97
- package/tiles/styles.selectors.js +29 -29
- package/table/node-data-cell.d.ts +0 -15
- package/table/node-data-cell.d.ts.map +0 -1
- package/table/node-data-cell.js +0 -25
- package/table/node-data-cell.js.map +0 -1
|
@@ -35,11 +35,12 @@ const BOTTOM_LABELS_OFFSET = 12;
|
|
|
35
35
|
const fallbackContainerWidth = 500;
|
|
36
36
|
export default function ChartContainer(_a) {
|
|
37
37
|
var _b, _c;
|
|
38
|
-
var { fitHeight, height: explicitPlotHeight, series, visibleSeries, highlightedSeries, onHighlightChange, highlightedPoint, setHighlightedPoint, highlightedGroupIndex, setHighlightedGroupIndex, detailPopoverFooter, detailPopoverSize = 'medium', stackedBars = false, horizontalBars = false, xScaleType, yScaleType, xTickFormatter, yTickFormatter, emphasizeBaselineAxis, xTitle, yTitle, ariaLabel, ariaLabelledby, ariaDescription, i18nStrings = {}, plotContainerRef } = _a, props = __rest(_a, ["fitHeight", "height", "series", "visibleSeries", "highlightedSeries", "onHighlightChange", "highlightedPoint", "setHighlightedPoint", "highlightedGroupIndex", "setHighlightedGroupIndex", "detailPopoverFooter", "detailPopoverSize", "stackedBars", "horizontalBars", "xScaleType", "yScaleType", "xTickFormatter", "yTickFormatter", "emphasizeBaselineAxis", "xTitle", "yTitle", "ariaLabel", "ariaLabelledby", "ariaDescription", "i18nStrings", "plotContainerRef"]);
|
|
38
|
+
var { fitHeight, height: explicitPlotHeight, series, visibleSeries, highlightedSeries, onHighlightChange, highlightedPoint, setHighlightedPoint, highlightedGroupIndex, setHighlightedGroupIndex, detailPopoverFooter, detailPopoverSize = 'medium', stackedBars = false, horizontalBars = false, xScaleType, yScaleType, xTickFormatter, yTickFormatter, emphasizeBaselineAxis, xTitle, yTitle, ariaLabel, ariaLabelledby, ariaDescription, i18nStrings = {}, plotContainerRef, detailPopoverSeriesContent } = _a, props = __rest(_a, ["fitHeight", "height", "series", "visibleSeries", "highlightedSeries", "onHighlightChange", "highlightedPoint", "setHighlightedPoint", "highlightedGroupIndex", "setHighlightedGroupIndex", "detailPopoverFooter", "detailPopoverSize", "stackedBars", "horizontalBars", "xScaleType", "yScaleType", "xTickFormatter", "yTickFormatter", "emphasizeBaselineAxis", "xTitle", "yTitle", "ariaLabel", "ariaLabelledby", "ariaDescription", "i18nStrings", "plotContainerRef", "detailPopoverSeriesContent"]);
|
|
39
39
|
const plotRef = useRef(null);
|
|
40
40
|
const verticalMarkerRef = useRef(null);
|
|
41
41
|
const [leftLabelsWidth, setLeftLabelsWidth] = useState(0);
|
|
42
42
|
const [verticalMarkerX, setVerticalMarkerX] = useState(null);
|
|
43
|
+
const [detailsPopoverText, setDetailsPopoverText] = useState('');
|
|
43
44
|
const [containerWidth, containerMeasureRef] = useContainerWidth(fallbackContainerWidth);
|
|
44
45
|
const maxLeftLabelsWidth = Math.round(containerWidth / 2);
|
|
45
46
|
const plotWidth = containerWidth
|
|
@@ -317,15 +318,23 @@ export default function ChartContainer(_a) {
|
|
|
317
318
|
// When series point is highlighted show the corresponding series and matching x-thresholds.
|
|
318
319
|
if (highlightedPoint) {
|
|
319
320
|
const seriesToShow = visibleSeries.filter(series => series.series === (highlightedPoint === null || highlightedPoint === void 0 ? void 0 : highlightedPoint.series) || isXThreshold(series.series));
|
|
320
|
-
return formatHighlighted(
|
|
321
|
+
return formatHighlighted({
|
|
322
|
+
position: highlightedX,
|
|
323
|
+
series: seriesToShow,
|
|
324
|
+
xTickFormatter,
|
|
325
|
+
detailPopoverSeriesContent,
|
|
326
|
+
});
|
|
321
327
|
}
|
|
322
328
|
// Otherwise - show all visible series details.
|
|
323
|
-
return formatHighlighted(
|
|
324
|
-
|
|
329
|
+
return formatHighlighted({
|
|
330
|
+
position: highlightedX,
|
|
331
|
+
series: visibleSeries,
|
|
332
|
+
xTickFormatter,
|
|
333
|
+
detailPopoverSeriesContent,
|
|
334
|
+
});
|
|
335
|
+
}, [highlightedX, highlightedPoint, visibleSeries, xTickFormatter, detailPopoverSeriesContent]);
|
|
325
336
|
const detailPopoverFooterContent = useMemo(() => (detailPopoverFooter && highlightedX ? detailPopoverFooter(highlightedX) : null), [detailPopoverFooter, highlightedX]);
|
|
326
|
-
const activeAriaLabel =
|
|
327
|
-
? `${highlightDetails.position}, ${highlightDetails.details.map(d => d.key + ' ' + d.value).join(',')}`
|
|
328
|
-
: '', [highlightDetails]);
|
|
337
|
+
const activeAriaLabel = highlightDetails && detailsPopoverText ? `${highlightDetails.position}, ${detailsPopoverText}` : '';
|
|
329
338
|
// Live region is used when nothing is focused e.g. when hovering.
|
|
330
339
|
const activeLiveRegion = activeAriaLabel && !highlightedPoint && highlightedGroupIndex === null ? activeAriaLabel : '';
|
|
331
340
|
const isLineXKeyboardFocused = isPlotFocused && !highlightedPoint && verticalMarkerX;
|
|
@@ -341,6 +350,6 @@ export default function ChartContainer(_a) {
|
|
|
341
350
|
React.createElement(VerticalMarker, { key: verticalLineX || '', height: plotHeight, showPoints: highlightedPoint === null, showLine: !isGroupNavigation, points: verticalMarkers, ref: verticalMarkerRef }),
|
|
342
351
|
highlightedPoint && (React.createElement(HighlightedPoint, { ref: highlightedPointRef, point: point, role: "button", ariaLabel: activeAriaLabel, ariaHasPopup: true, ariaExpanded: isPopoverPinned })),
|
|
343
352
|
isGroupNavigation && xAxisProps.scale.isCategorical() && (React.createElement(BarGroups, { ariaLabel: activeAriaLabel, isRefresh: isRefresh, isPopoverPinned: isPopoverPinned, barGroups: barGroups, highlightedGroupIndex: highlightedGroupIndex, highlightedGroupRef: highlightedGroupRef })),
|
|
344
|
-
React.createElement(BottomLabels, Object.assign({}, bottomLabelsProps, { axis: x, scale: bottomAxisProps.scale, title: bottomAxisProps.title, ariaRoleDescription: bottomAxisProps.ariaRoleDescription, height: plotHeight, width: plotWidth, offsetLeft: leftLabelsWidth + BOTTOM_LABELS_OFFSET, offsetRight: BOTTOM_LABELS_OFFSET }))), popover: React.createElement(ChartPopover, { ref: popoverRef, containerRef: containerRefObject, trackRef: highlightedElementRef, isOpen: isPopoverOpen, isPinned: isPopoverPinned, highlightDetails: highlightDetails, onDismiss: onPopoverDismiss, size: detailPopoverSize, footer: detailPopoverFooterContent, dismissAriaLabel: i18nStrings.detailPopoverDismissAriaLabel, onMouseLeave: onPopoverLeave, onBlur: onSVGBlur }) }));
|
|
353
|
+
React.createElement(BottomLabels, Object.assign({}, bottomLabelsProps, { axis: x, scale: bottomAxisProps.scale, title: bottomAxisProps.title, ariaRoleDescription: bottomAxisProps.ariaRoleDescription, height: plotHeight, width: plotWidth, offsetLeft: leftLabelsWidth + BOTTOM_LABELS_OFFSET, offsetRight: BOTTOM_LABELS_OFFSET }))), popover: React.createElement(ChartPopover, { ref: popoverRef, containerRef: containerRefObject, trackRef: highlightedElementRef, isOpen: isPopoverOpen, isPinned: isPopoverPinned, highlightDetails: highlightDetails, onDismiss: onPopoverDismiss, size: detailPopoverSize, footer: detailPopoverFooterContent, dismissAriaLabel: i18nStrings.detailPopoverDismissAriaLabel, onMouseLeave: onPopoverLeave, onBlur: onSVGBlur, setPopoverText: setDetailsPopoverText }) }));
|
|
345
354
|
}
|
|
346
355
|
//# sourceMappingURL=chart-container.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chart-container.js","sourceRoot":"lib/default/","sources":["mixed-line-bar-chart/chart-container.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAElG,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAErE,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,8CAA8C,CAAC;AACxH,OAAO,SAA2B,MAAM,mCAAmC,CAAC;AAC5E,OAAO,SAAS,MAAM,mDAAmD,CAAC;AAC1E,OAAO,aAAa,MAAM,uDAAu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a,EACrB,QAAQ,EAAE,eAAe,EACzB,gBAAgB,EAAE,gBAAgB,EAClC,SAAS,EAAE,gBAAgB,EAC3B,IAAI,EAAE,iBAAiB,EACvB,MAAM,EAAE,0BAA0B,EAClC,gBAAgB,EAAE,WAAW,CAAC,6BAA6B,EAC3D,YAAY,EAAE,cAAc,EAC5B,MAAM,EAAE,SAAS,GACjB,GAEJ,CACH,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';\n\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\n\nimport { getXTickCount, getYTickCount, createXTicks, createYTicks } from '../internal/components/cartesian-chart/ticks';\nimport ChartPlot, { ChartPlotRef } from '../internal/components/chart-plot';\nimport AxisLabel from '../internal/components/cartesian-chart/axis-label';\nimport LabelsMeasure from '../internal/components/cartesian-chart/labels-measure';\nimport LeftLabels from '../internal/components/cartesian-chart/left-labels';\nimport BottomLabels, { useBottomLabels } from '../internal/components/cartesian-chart/bottom-labels';\nimport VerticalGridLines from '../internal/components/cartesian-chart/vertical-grid-lines';\nimport EmphasizedBaseline from '../internal/components/cartesian-chart/emphasized-baseline';\nimport HighlightedPoint from '../internal/components/cartesian-chart/highlighted-point';\nimport VerticalMarker from '../internal/components/cartesian-chart/vertical-marker';\nimport { ChartScale, NumericChartScale } from '../internal/components/cartesian-chart/scales';\nimport ChartPopover from './chart-popover';\nimport { ChartDataTypes, InternalChartSeries, MixedLineBarChartProps, ScaleType, VerticalMarkerX } from './interfaces';\nimport { computeDomainX, computeDomainY } from './domain';\nimport { isXThreshold } from './utils';\nimport makeScaledSeries, { ScaledPoint } from './make-scaled-series';\nimport makeScaledBarGroups, { ScaledBarGroup } from './make-scaled-bar-groups';\nimport formatHighlighted from './format-highlighted';\nimport DataSeries from './data-series';\nimport BarGroups from './bar-groups';\nimport { useMouseHover } from './hooks/use-mouse-hover';\nimport { useNavigation } from './hooks/use-navigation';\nimport { usePopover } from './hooks/use-popover';\n\nimport { CartesianChartProps } from '../internal/components/cartesian-chart/interfaces';\nimport useContainerWidth from '../internal/utils/use-container-width';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { nodeBelongs } from '../internal/utils/node-belongs';\nimport { CartesianChartContainer } from '../internal/components/cartesian-chart/chart-container';\nimport { useHeightMeasure } from '../internal/hooks/container-queries/use-height-measure';\n\nconst LEFT_LABELS_MARGIN = 16;\nconst BOTTOM_LABELS_OFFSET = 12;\n\ntype TickFormatter = undefined | ((value: ChartDataTypes) => string);\n\nexport interface ChartContainerProps<T extends ChartDataTypes> {\n series: ReadonlyArray<InternalChartSeries<T>>;\n visibleSeries: ReadonlyArray<InternalChartSeries<T>>;\n\n fitHeight?: boolean;\n height: number;\n detailPopoverSize: MixedLineBarChartProps<T>['detailPopoverSize'];\n detailPopoverFooter: MixedLineBarChartProps<T>['detailPopoverFooter'];\n\n xScaleType: ScaleType;\n yScaleType: 'linear' | 'log';\n\n xDomain: MixedLineBarChartProps<T>['xDomain'];\n yDomain: MixedLineBarChartProps<T>['yDomain'];\n\n xTickFormatter?: CartesianChartProps.TickFormatter<T>;\n yTickFormatter?: CartesianChartProps.TickFormatter<number>;\n\n xTitle?: string;\n yTitle?: string;\n\n stackedBars?: boolean;\n emphasizeBaselineAxis: boolean;\n horizontalBars?: boolean;\n\n highlightedSeries?: MixedLineBarChartProps<T>['highlightedSeries'];\n onHighlightChange: (series: InternalChartSeries<T>['series'] | null) => void;\n highlightedPoint: ScaledPoint<T> | null;\n setHighlightedPoint: (point: ScaledPoint<T> | null) => void;\n highlightedGroupIndex: number | null;\n setHighlightedGroupIndex: (groupIndex: number | null) => void;\n\n ariaLabel: MixedLineBarChartProps<T>['ariaLabel'];\n ariaLabelledby: MixedLineBarChartProps<T>['ariaLabelledby'];\n ariaDescription: MixedLineBarChartProps<T>['ariaDescription'];\n i18nStrings: MixedLineBarChartProps<T>['i18nStrings'];\n\n plotContainerRef: React.RefObject<HTMLDivElement>;\n}\n\ninterface BaseAxisProps {\n tickCount: number;\n tickFormatter: TickFormatter;\n title?: string;\n ariaRoleDescription?: string;\n}\n\ninterface XAxisProps extends BaseAxisProps {\n axis: 'x';\n scale: ChartScale;\n ticks: ChartDataTypes[];\n}\n\ninterface YAxisProps extends BaseAxisProps {\n axis: 'y';\n scale: NumericChartScale;\n ticks: number[];\n}\n\nconst fallbackContainerWidth = 500;\n\nexport default function ChartContainer<T extends ChartDataTypes>({\n fitHeight,\n height: explicitPlotHeight,\n series,\n visibleSeries,\n highlightedSeries,\n onHighlightChange,\n highlightedPoint,\n setHighlightedPoint,\n highlightedGroupIndex,\n setHighlightedGroupIndex,\n detailPopoverFooter,\n detailPopoverSize = 'medium',\n stackedBars = false,\n horizontalBars = false,\n xScaleType,\n yScaleType,\n xTickFormatter,\n yTickFormatter,\n emphasizeBaselineAxis,\n xTitle,\n yTitle,\n ariaLabel,\n ariaLabelledby,\n ariaDescription,\n i18nStrings = {},\n plotContainerRef,\n ...props\n}: ChartContainerProps<T>) {\n const plotRef = useRef<ChartPlotRef>(null);\n const verticalMarkerRef = useRef<SVGLineElement>(null);\n\n const [leftLabelsWidth, setLeftLabelsWidth] = useState(0);\n const [verticalMarkerX, setVerticalMarkerX] = useState<VerticalMarkerX<T> | null>(null);\n const [containerWidth, containerMeasureRef] = useContainerWidth(fallbackContainerWidth);\n const maxLeftLabelsWidth = Math.round(containerWidth / 2);\n const plotWidth = containerWidth\n ? // Calculate the minimum between leftLabelsWidth and maxLeftLabelsWidth for extra safety because leftLabelsWidth could be out of date\n Math.max(0, containerWidth - Math.min(leftLabelsWidth, maxLeftLabelsWidth) - LEFT_LABELS_MARGIN)\n : fallbackContainerWidth;\n const containerRefObject = useRef(null);\n const containerRef = useMergeRefs(containerMeasureRef, containerRefObject);\n const popoverRef = useRef<HTMLElement | null>(null);\n\n const xDomain = (props.xDomain || computeDomainX(series, xScaleType)) as\n | readonly number[]\n | readonly string[]\n | readonly Date[];\n const yDomain = (props.yDomain || computeDomainY(series, yScaleType, stackedBars)) as readonly number[];\n\n const linesOnly = series.every(({ series }) => series.type === 'line' || series.type === 'threshold');\n\n function getXAxisProps(size: number, range: [from: number, until: number]): XAxisProps {\n const tickCount = getXTickCount(size);\n const scale = new ChartScale(xScaleType, xDomain, range, linesOnly);\n const ticks = createXTicks(scale, tickCount);\n return {\n axis: 'x',\n tickCount,\n scale,\n ticks,\n tickFormatter: xTickFormatter as TickFormatter,\n title: xTitle,\n ariaRoleDescription: i18nStrings.xAxisAriaRoleDescription,\n };\n }\n\n function getYAxisProps(size: number, range: [from: number, until: number]): YAxisProps {\n const tickCount = getYTickCount(size);\n const scale = new NumericChartScale(yScaleType, yDomain, range, props.yDomain ? null : tickCount);\n const ticks = createYTicks(scale, tickCount);\n return {\n axis: 'y',\n tickCount,\n scale,\n ticks,\n tickFormatter: yTickFormatter as TickFormatter,\n title: yTitle,\n ariaRoleDescription: i18nStrings.yAxisAriaRoleDescription,\n };\n }\n\n const bottomAxisProps = !horizontalBars\n ? getXAxisProps(plotWidth, [0, plotWidth])\n : getYAxisProps(plotWidth, [0, plotWidth]);\n\n const bottomLabelsProps = useBottomLabels({ ...bottomAxisProps });\n\n const plotMeasureRef = useRef<SVGLineElement>(null);\n const measuredHeight = useHeightMeasure(() => plotMeasureRef.current, !fitHeight);\n const plotHeight = fitHeight ? measuredHeight ?? 0 : explicitPlotHeight;\n\n const leftAxisProps = !horizontalBars\n ? getYAxisProps(plotHeight, [plotHeight, 0])\n : getXAxisProps(plotHeight, [0, plotHeight]);\n\n const xAxisProps = bottomAxisProps.axis === 'x' ? bottomAxisProps : leftAxisProps.axis === 'x' ? leftAxisProps : null;\n const yAxisProps = bottomAxisProps.axis === 'y' ? bottomAxisProps : leftAxisProps.axis === 'y' ? leftAxisProps : null;\n if (!xAxisProps || !yAxisProps) {\n throw new Error('Invariant violation: invalid axis props.');\n }\n\n /**\n * Interactions\n */\n const highlightedPointRef = useRef<SVGGElement>(null);\n const highlightedGroupRef = useRef<SVGRectElement>(null);\n const [isPlotFocused, setPlotFocused] = useState(false);\n\n // Some chart components are rendered against \"x\" or \"y\" axes,\n // When \"horizontalBars\" is enabled, the axes are inverted.\n const x = !horizontalBars ? 'x' : 'y';\n const y = !horizontalBars ? 'y' : 'x';\n\n const scaledSeries = makeScaledSeries(visibleSeries, xAxisProps.scale, yAxisProps.scale);\n const barGroups: ScaledBarGroup<T>[] = makeScaledBarGroups(visibleSeries, xAxisProps.scale, plotWidth, plotHeight, y);\n\n const { isPopoverOpen, isPopoverPinned, showPopover, pinPopover, dismissPopover } = usePopover();\n\n // Allows to add a delay between popover is dismissed and handlers are enabled to prevent immediate popover reopening.\n const [isHandlersDisabled, setHandlersDisabled] = useState(!isPopoverPinned);\n useEffect(() => {\n if (isPopoverPinned) {\n setHandlersDisabled(true);\n } else {\n const timeoutId = setTimeout(() => setHandlersDisabled(false), 25);\n return () => clearTimeout(timeoutId);\n }\n }, [isPopoverPinned]);\n\n const highlightSeries = useCallback(\n (series: MixedLineBarChartProps.ChartSeries<T> | null) => {\n if (series !== highlightedSeries) {\n onHighlightChange(series);\n }\n },\n [highlightedSeries, onHighlightChange]\n );\n\n const highlightPoint = useCallback(\n (point: ScaledPoint<T> | null) => {\n setHighlightedGroupIndex(null);\n setHighlightedPoint(point);\n if (point) {\n highlightSeries(point.series);\n setVerticalMarkerX({\n scaledX: point.x,\n label: point.datum?.x ?? null,\n });\n }\n },\n [setHighlightedGroupIndex, setHighlightedPoint, highlightSeries]\n );\n\n const clearAllHighlights = useCallback(() => {\n setHighlightedPoint(null);\n highlightSeries(null);\n setHighlightedGroupIndex(null);\n }, [highlightSeries, setHighlightedGroupIndex, setHighlightedPoint]);\n\n // Highlight all points at a given X in a line chart\n const highlightX = useCallback(\n (marker: VerticalMarkerX<T> | null) => {\n if (marker) {\n clearAllHighlights();\n }\n setVerticalMarkerX(marker);\n },\n [clearAllHighlights]\n );\n\n // Highlight all points and bars at a given X index in a mixed line and bar chart\n const highlightGroup = useCallback(\n (groupIndex: number) => {\n highlightSeries(null);\n setHighlightedPoint(null);\n setHighlightedGroupIndex(groupIndex);\n },\n [highlightSeries, setHighlightedPoint, setHighlightedGroupIndex]\n );\n\n const clearHighlightedSeries = useCallback(() => {\n clearAllHighlights();\n dismissPopover();\n }, [dismissPopover, clearAllHighlights]);\n\n const { isGroupNavigation, ...handlers } = useNavigation({\n series,\n visibleSeries,\n scaledSeries,\n barGroups,\n xScale: xAxisProps.scale,\n yScale: yAxisProps.scale,\n highlightedPoint,\n highlightedGroupIndex,\n highlightedSeries,\n isHandlersDisabled,\n pinPopover,\n highlightSeries,\n highlightGroup,\n highlightPoint,\n highlightX,\n clearHighlightedSeries,\n verticalMarkerX,\n });\n\n const { onSVGMouseMove, onSVGMouseOut, onPopoverLeave } = useMouseHover<T>({\n scaledSeries,\n barGroups,\n plotRef,\n popoverRef,\n highlightPoint,\n highlightGroup,\n clearHighlightedSeries,\n isGroupNavigation,\n isHandlersDisabled,\n highlightX,\n });\n\n // There are multiple ways to indicate what X is selected.\n // TODO: make a uniform verticalMarkerX state to fit all use-cases.\n const highlightedX = useMemo(() => {\n if (highlightedGroupIndex !== null) {\n return barGroups[highlightedGroupIndex].x;\n }\n if (verticalMarkerX !== null) {\n return verticalMarkerX.label;\n }\n return highlightedPoint?.datum?.x ?? null;\n }, [highlightedPoint, verticalMarkerX, highlightedGroupIndex, barGroups]);\n\n useEffect(() => {\n const onKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n dismissPopover();\n }\n };\n document.addEventListener('keydown', onKeyDown);\n return () => document.removeEventListener('keydown', onKeyDown);\n }, [dismissPopover]);\n\n useLayoutEffect(() => {\n if (highlightedX !== null || highlightedPoint !== null) {\n showPopover();\n }\n }, [highlightedX, highlightedPoint, showPopover]);\n\n const onPopoverDismiss = (outsideClick?: boolean) => {\n dismissPopover();\n\n if (!outsideClick) {\n // The delay is needed to bypass focus events caused by click or keypress needed to unpin the popover.\n setTimeout(() => {\n const isSomeInnerElementFocused = highlightedPoint || highlightedGroupIndex !== null || verticalMarkerX;\n if (isSomeInnerElementFocused) {\n plotRef.current?.focusApplication();\n } else {\n plotRef.current?.focusPlot();\n }\n }, 0);\n } else {\n clearAllHighlights();\n setVerticalMarkerX(null);\n }\n };\n\n const onSVGClick = (e: React.MouseEvent<SVGSVGElement, MouseEvent>) => {\n if (isPopoverOpen) {\n if (isPopoverPinned) {\n dismissPopover();\n } else {\n pinPopover();\n e.preventDefault();\n }\n } else {\n showPopover();\n }\n };\n\n const onSVGFocus = (event: React.FocusEvent, trigger: 'mouse' | 'keyboard') => {\n setPlotFocused(true);\n if (trigger === 'keyboard') {\n handlers.onFocus();\n } else {\n // noop: clicks are handled separately\n }\n };\n\n const onSVGBlur = (event: React.FocusEvent<Element>) => {\n setPlotFocused(false);\n const blurTarget = event.relatedTarget || event.target;\n if (\n blurTarget === null ||\n !(blurTarget instanceof Element) ||\n !nodeBelongs(containerRefObject.current, blurTarget)\n ) {\n setHighlightedPoint(null);\n setVerticalMarkerX(null);\n if (!plotContainerRef?.current?.contains(blurTarget)) {\n clearHighlightedSeries();\n }\n\n if (isPopoverOpen && !isPopoverPinned) {\n dismissPopover();\n }\n }\n };\n\n const onSVGKeyDown = handlers.onKeyDown;\n\n const xOffset = xAxisProps.scale.isCategorical() ? Math.max(0, xAxisProps.scale.d3Scale.bandwidth() - 1) / 2 : 0;\n\n let verticalLineX: number | null = null;\n if (verticalMarkerX !== null) {\n verticalLineX = verticalMarkerX.scaledX;\n } else if (isGroupNavigation && highlightedGroupIndex !== null) {\n const x = xAxisProps.scale.d3Scale(barGroups[highlightedGroupIndex].x as any) ?? null;\n if (x !== null) {\n verticalLineX = xOffset + x;\n }\n }\n\n const point = useMemo(\n () =>\n highlightedPoint\n ? {\n key: `${highlightedPoint.x}-${highlightedPoint.y}`,\n x: highlightedPoint.x,\n y: highlightedPoint.y,\n color: highlightedPoint.color,\n }\n : null,\n [highlightedPoint]\n );\n\n const verticalMarkers = useMemo(\n () =>\n verticalLineX !== null\n ? scaledSeries\n .filter(({ x, y }) => (x === verticalLineX || isNaN(x)) && !isNaN(y))\n .map(({ x, y, color }, index) => ({\n key: `${index}-${x}-${y}`,\n x: !horizontalBars ? verticalLineX || 0 : y,\n y: !horizontalBars ? y : verticalLineX || 0,\n color: color,\n }))\n : [],\n [scaledSeries, verticalLineX, horizontalBars]\n );\n\n const highlightedElementRef = isGroupNavigation\n ? highlightedGroupRef\n : highlightedPoint\n ? highlightedPointRef\n : verticalMarkerRef;\n\n const highlightDetails = useMemo(() => {\n if (highlightedX === null) {\n return null;\n }\n\n // When series point is highlighted show the corresponding series and matching x-thresholds.\n if (highlightedPoint) {\n const seriesToShow = visibleSeries.filter(\n series => series.series === highlightedPoint?.series || isXThreshold(series.series)\n );\n return formatHighlighted(highlightedX, seriesToShow, xTickFormatter);\n }\n\n // Otherwise - show all visible series details.\n return formatHighlighted(highlightedX, visibleSeries, xTickFormatter);\n }, [highlightedX, highlightedPoint, visibleSeries, xTickFormatter]);\n\n const detailPopoverFooterContent = useMemo(\n () => (detailPopoverFooter && highlightedX ? detailPopoverFooter(highlightedX) : null),\n [detailPopoverFooter, highlightedX]\n );\n\n const activeAriaLabel = useMemo(\n () =>\n highlightDetails\n ? `${highlightDetails.position}, ${highlightDetails.details.map(d => d.key + ' ' + d.value).join(',')}`\n : '',\n [highlightDetails]\n );\n\n // Live region is used when nothing is focused e.g. when hovering.\n const activeLiveRegion =\n activeAriaLabel && !highlightedPoint && highlightedGroupIndex === null ? activeAriaLabel : '';\n\n const isLineXKeyboardFocused = isPlotFocused && !highlightedPoint && verticalMarkerX;\n\n const isRefresh = useVisualRefresh();\n\n return (\n <CartesianChartContainer\n ref={containerRef}\n minHeight={explicitPlotHeight + bottomLabelsProps.height}\n fitHeight={!!fitHeight}\n leftAxisLabel={<AxisLabel axis={y} position=\"left\" title={leftAxisProps.title} />}\n leftAxisLabelMeasure={\n <LabelsMeasure\n ticks={leftAxisProps.ticks}\n scale={leftAxisProps.scale}\n tickFormatter={leftAxisProps.tickFormatter as TickFormatter}\n autoWidth={setLeftLabelsWidth}\n maxLabelsWidth={maxLeftLabelsWidth}\n />\n }\n bottomAxisLabel={<AxisLabel axis={x} position=\"bottom\" title={bottomAxisProps.title} />}\n chartPlot={\n <ChartPlot\n ref={plotRef}\n width=\"100%\"\n height={fitHeight ? `calc(100% - ${bottomLabelsProps.height}px)` : plotHeight}\n offsetBottom={bottomLabelsProps.height}\n isClickable={isPopoverOpen && !isPopoverPinned}\n ariaLabel={ariaLabel}\n ariaLabelledby={ariaLabelledby}\n ariaDescription={ariaDescription}\n ariaRoleDescription={i18nStrings?.chartAriaRoleDescription}\n ariaLiveRegion={activeLiveRegion}\n activeElementRef={highlightedElementRef}\n activeElementKey={\n isPlotFocused &&\n (highlightedGroupIndex?.toString() ??\n (isLineXKeyboardFocused ? `point-index-${handlers.xIndex}` : point?.key))\n }\n activeElementFocusOffset={isGroupNavigation ? 0 : isLineXKeyboardFocused ? { x: 8, y: 0 } : 3}\n onMouseMove={onSVGMouseMove}\n onMouseOut={onSVGMouseOut}\n onClick={onSVGClick}\n onFocus={onSVGFocus}\n onBlur={onSVGBlur}\n onKeyDown={onSVGKeyDown}\n >\n <line\n ref={plotMeasureRef}\n x1=\"0\"\n x2=\"0\"\n y1=\"0\"\n y2=\"100%\"\n stroke=\"transparent\"\n strokeWidth={1}\n style={{ pointerEvents: 'none' }}\n />\n\n <LeftLabels\n axis={y}\n ticks={leftAxisProps.ticks}\n scale={leftAxisProps.scale}\n tickFormatter={leftAxisProps.tickFormatter as TickFormatter}\n title={leftAxisProps.title}\n ariaRoleDescription={leftAxisProps.ariaRoleDescription}\n maxLabelsWidth={maxLeftLabelsWidth}\n plotWidth={plotWidth}\n plotHeight={plotHeight}\n />\n\n {horizontalBars && (\n <VerticalGridLines scale={yAxisProps.scale} ticks={yAxisProps.ticks} height={plotHeight} />\n )}\n\n {emphasizeBaselineAxis && linesOnly && (\n <EmphasizedBaseline axis={x} scale={yAxisProps.scale} width={plotWidth} height={plotHeight} />\n )}\n\n <DataSeries\n axis={x}\n plotWidth={plotWidth}\n plotHeight={plotHeight}\n highlightedSeries={highlightedSeries ?? null}\n highlightedGroupIndex={highlightedGroupIndex}\n stackedBars={stackedBars}\n isGroupNavigation={isGroupNavigation}\n visibleSeries={visibleSeries}\n xScale={xAxisProps.scale}\n yScale={yAxisProps.scale}\n />\n\n {emphasizeBaselineAxis && !linesOnly && (\n <EmphasizedBaseline axis={x} scale={yAxisProps.scale} width={plotWidth} height={plotHeight} />\n )}\n\n <VerticalMarker\n key={verticalLineX || ''}\n height={plotHeight}\n showPoints={highlightedPoint === null}\n showLine={!isGroupNavigation}\n points={verticalMarkers}\n ref={verticalMarkerRef}\n />\n\n {highlightedPoint && (\n <HighlightedPoint\n ref={highlightedPointRef}\n point={point}\n role=\"button\"\n ariaLabel={activeAriaLabel}\n ariaHasPopup={true}\n ariaExpanded={isPopoverPinned}\n />\n )}\n\n {isGroupNavigation && xAxisProps.scale.isCategorical() && (\n <BarGroups\n ariaLabel={activeAriaLabel}\n isRefresh={isRefresh}\n isPopoverPinned={isPopoverPinned}\n barGroups={barGroups}\n highlightedGroupIndex={highlightedGroupIndex}\n highlightedGroupRef={highlightedGroupRef}\n />\n )}\n\n <BottomLabels\n {...bottomLabelsProps}\n axis={x}\n scale={bottomAxisProps.scale}\n title={bottomAxisProps.title}\n ariaRoleDescription={bottomAxisProps.ariaRoleDescription}\n height={plotHeight}\n width={plotWidth}\n offsetLeft={leftLabelsWidth + BOTTOM_LABELS_OFFSET}\n offsetRight={BOTTOM_LABELS_OFFSET}\n />\n </ChartPlot>\n }\n popover={\n <ChartPopover\n ref={popoverRef}\n containerRef={containerRefObject}\n trackRef={highlightedElementRef}\n isOpen={isPopoverOpen}\n isPinned={isPopoverPinned}\n highlightDetails={highlightDetails}\n onDismiss={onPopoverDismiss}\n size={detailPopoverSize}\n footer={detailPopoverFooterContent}\n dismissAriaLabel={i18nStrings.detailPopoverDismissAriaLabel}\n onMouseLeave={onPopoverLeave}\n onBlur={onSVGBlur}\n />\n }\n />\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"chart-container.js","sourceRoot":"lib/default/","sources":["mixed-line-bar-chart/chart-container.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAElG,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAErE,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,8CAA8C,CAAC;AACxH,OAAO,SAA2B,MAAM,mCAAmC,CAAC;AAC5E,OAAO,SAAS,MAAM,mDAAmD,CAAC;AAC1E,OAAO,aAAa,MAAM,uDAAuD,CAAC;AAClF,OAAO,UAAU,MAAM,oDAAoD,CAAC;AAC5E,OAAO,YAAY,EAAE,EAAE,eAAe,EAAE,MAAM,sDAAsD,CAAC;AACrG,OAAO,iBAAiB,MAAM,4DAA4D,CAAC;AAC3F,OAAO,kBAAkB,MAAM,4DAA4D,CAAC;AAC5F,OAAO,gBAAgB,MAAM,0DAA0D,CAAC;AACxF,OAAO,cAAc,MAAM,wDAAwD,CAAC;AACpF,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAC9F,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAE3C,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,gBAAiC,MAAM,sBAAsB,CAAC;AACrE,OAAO,mBAAuC,MAAM,0BAA0B,CAAC;AAC/E,OAAO,iBAAiB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AEA,iBAAiB,IAAI,UAAU,CAAC,KAAK,CAAC,aAAa,EAAE,IAAI,CACxD,oBAAC,SAAS,IACR,SAAS,EAAE,eAAe,EAC1B,SAAS,EAAE,SAAS,EACpB,eAAe,EAAE,eAAe,EAChC,SAAS,EAAE,SAAS,EACpB,qBAAqB,EAAE,qBAAqB,EAC5C,mBAAmB,EAAE,mBAAmB,GACxC,CACH;YAED,oBAAC,YAAY,oBACP,iBAAiB,IACrB,IAAI,EAAE,CAAC,EACP,KAAK,EAAE,eAAe,CAAC,KAAK,EAC5B,KAAK,EAAE,eAAe,CAAC,KAAK,EAC5B,mBAAmB,EAAE,eAAe,CAAC,mBAAmB,EACxD,MAAM,EAAE,UAAU,EAClB,KAAK,EAAE,SAAS,EAChB,UAAU,EAAE,eAAe,GAAG,oBAAoB,EAClD,WAAW,EAAE,oBAAoB,IACjC,CACQ,EAEd,OAAO,EACL,oBAAC,YAAY,IACX,GAAG,EAAE,UAAU,EACf,YAAY,EAAE,kBAAkB,EAChC,QAAQ,EAAE,qBAAqB,EAC/B,MAAM,EAAE,aAAa,EACrB,QAAQ,EAAE,eAAe,EACzB,gBAAgB,EAAE,gBAAgB,EAClC,SAAS,EAAE,gBAAgB,EAC3B,IAAI,EAAE,iBAAiB,EACvB,MAAM,EAAE,0BAA0B,EAClC,gBAAgB,EAAE,WAAW,CAAC,6BAA6B,EAC3D,YAAY,EAAE,cAAc,EAC5B,MAAM,EAAE,SAAS,EACjB,cAAc,EAAE,qBAAqB,GACrC,GAEJ,CACH,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';\n\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\n\nimport { getXTickCount, getYTickCount, createXTicks, createYTicks } from '../internal/components/cartesian-chart/ticks';\nimport ChartPlot, { ChartPlotRef } from '../internal/components/chart-plot';\nimport AxisLabel from '../internal/components/cartesian-chart/axis-label';\nimport LabelsMeasure from '../internal/components/cartesian-chart/labels-measure';\nimport LeftLabels from '../internal/components/cartesian-chart/left-labels';\nimport BottomLabels, { useBottomLabels } from '../internal/components/cartesian-chart/bottom-labels';\nimport VerticalGridLines from '../internal/components/cartesian-chart/vertical-grid-lines';\nimport EmphasizedBaseline from '../internal/components/cartesian-chart/emphasized-baseline';\nimport HighlightedPoint from '../internal/components/cartesian-chart/highlighted-point';\nimport VerticalMarker from '../internal/components/cartesian-chart/vertical-marker';\nimport { ChartScale, NumericChartScale } from '../internal/components/cartesian-chart/scales';\nimport ChartPopover from './chart-popover';\nimport { ChartDataTypes, InternalChartSeries, MixedLineBarChartProps, ScaleType, VerticalMarkerX } from './interfaces';\nimport { computeDomainX, computeDomainY } from './domain';\nimport { isXThreshold } from './utils';\nimport makeScaledSeries, { ScaledPoint } from './make-scaled-series';\nimport makeScaledBarGroups, { ScaledBarGroup } from './make-scaled-bar-groups';\nimport formatHighlighted from './format-highlighted';\nimport DataSeries from './data-series';\nimport BarGroups from './bar-groups';\nimport { useMouseHover } from './hooks/use-mouse-hover';\nimport { useNavigation } from './hooks/use-navigation';\nimport { usePopover } from './hooks/use-popover';\n\nimport { CartesianChartProps } from '../internal/components/cartesian-chart/interfaces';\nimport useContainerWidth from '../internal/utils/use-container-width';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { nodeBelongs } from '../internal/utils/node-belongs';\nimport { CartesianChartContainer } from '../internal/components/cartesian-chart/chart-container';\nimport { useHeightMeasure } from '../internal/hooks/container-queries/use-height-measure';\n\nconst LEFT_LABELS_MARGIN = 16;\nconst BOTTOM_LABELS_OFFSET = 12;\n\ntype TickFormatter = undefined | ((value: ChartDataTypes) => string);\n\nexport interface ChartContainerProps<T extends ChartDataTypes> {\n series: ReadonlyArray<InternalChartSeries<T>>;\n visibleSeries: ReadonlyArray<InternalChartSeries<T>>;\n\n fitHeight?: boolean;\n height: number;\n detailPopoverSize: MixedLineBarChartProps<T>['detailPopoverSize'];\n detailPopoverFooter: MixedLineBarChartProps<T>['detailPopoverFooter'];\n\n xScaleType: ScaleType;\n yScaleType: 'linear' | 'log';\n\n xDomain: MixedLineBarChartProps<T>['xDomain'];\n yDomain: MixedLineBarChartProps<T>['yDomain'];\n\n xTickFormatter?: CartesianChartProps.TickFormatter<T>;\n yTickFormatter?: CartesianChartProps.TickFormatter<number>;\n\n xTitle?: string;\n yTitle?: string;\n\n stackedBars?: boolean;\n emphasizeBaselineAxis: boolean;\n horizontalBars?: boolean;\n\n highlightedSeries?: MixedLineBarChartProps<T>['highlightedSeries'];\n onHighlightChange: (series: InternalChartSeries<T>['series'] | null) => void;\n highlightedPoint: ScaledPoint<T> | null;\n setHighlightedPoint: (point: ScaledPoint<T> | null) => void;\n highlightedGroupIndex: number | null;\n setHighlightedGroupIndex: (groupIndex: number | null) => void;\n\n ariaLabel: MixedLineBarChartProps<T>['ariaLabel'];\n ariaLabelledby: MixedLineBarChartProps<T>['ariaLabelledby'];\n ariaDescription: MixedLineBarChartProps<T>['ariaDescription'];\n i18nStrings: MixedLineBarChartProps<T>['i18nStrings'];\n\n plotContainerRef: React.RefObject<HTMLDivElement>;\n\n detailPopoverSeriesContent?: MixedLineBarChartProps.DetailPopoverSeriesContent<T>;\n}\n\ninterface BaseAxisProps {\n tickCount: number;\n tickFormatter: TickFormatter;\n title?: string;\n ariaRoleDescription?: string;\n}\n\ninterface XAxisProps extends BaseAxisProps {\n axis: 'x';\n scale: ChartScale;\n ticks: ChartDataTypes[];\n}\n\ninterface YAxisProps extends BaseAxisProps {\n axis: 'y';\n scale: NumericChartScale;\n ticks: number[];\n}\n\nconst fallbackContainerWidth = 500;\n\nexport default function ChartContainer<T extends ChartDataTypes>({\n fitHeight,\n height: explicitPlotHeight,\n series,\n visibleSeries,\n highlightedSeries,\n onHighlightChange,\n highlightedPoint,\n setHighlightedPoint,\n highlightedGroupIndex,\n setHighlightedGroupIndex,\n detailPopoverFooter,\n detailPopoverSize = 'medium',\n stackedBars = false,\n horizontalBars = false,\n xScaleType,\n yScaleType,\n xTickFormatter,\n yTickFormatter,\n emphasizeBaselineAxis,\n xTitle,\n yTitle,\n ariaLabel,\n ariaLabelledby,\n ariaDescription,\n i18nStrings = {},\n plotContainerRef,\n detailPopoverSeriesContent,\n ...props\n}: ChartContainerProps<T>) {\n const plotRef = useRef<ChartPlotRef>(null);\n const verticalMarkerRef = useRef<SVGLineElement>(null);\n\n const [leftLabelsWidth, setLeftLabelsWidth] = useState(0);\n const [verticalMarkerX, setVerticalMarkerX] = useState<VerticalMarkerX<T> | null>(null);\n const [detailsPopoverText, setDetailsPopoverText] = useState('');\n const [containerWidth, containerMeasureRef] = useContainerWidth(fallbackContainerWidth);\n const maxLeftLabelsWidth = Math.round(containerWidth / 2);\n const plotWidth = containerWidth\n ? // Calculate the minimum between leftLabelsWidth and maxLeftLabelsWidth for extra safety because leftLabelsWidth could be out of date\n Math.max(0, containerWidth - Math.min(leftLabelsWidth, maxLeftLabelsWidth) - LEFT_LABELS_MARGIN)\n : fallbackContainerWidth;\n const containerRefObject = useRef(null);\n const containerRef = useMergeRefs(containerMeasureRef, containerRefObject);\n const popoverRef = useRef<HTMLElement | null>(null);\n\n const xDomain = (props.xDomain || computeDomainX(series, xScaleType)) as\n | readonly number[]\n | readonly string[]\n | readonly Date[];\n const yDomain = (props.yDomain || computeDomainY(series, yScaleType, stackedBars)) as readonly number[];\n\n const linesOnly = series.every(({ series }) => series.type === 'line' || series.type === 'threshold');\n\n function getXAxisProps(size: number, range: [from: number, until: number]): XAxisProps {\n const tickCount = getXTickCount(size);\n const scale = new ChartScale(xScaleType, xDomain, range, linesOnly);\n const ticks = createXTicks(scale, tickCount);\n return {\n axis: 'x',\n tickCount,\n scale,\n ticks,\n tickFormatter: xTickFormatter as TickFormatter,\n title: xTitle,\n ariaRoleDescription: i18nStrings.xAxisAriaRoleDescription,\n };\n }\n\n function getYAxisProps(size: number, range: [from: number, until: number]): YAxisProps {\n const tickCount = getYTickCount(size);\n const scale = new NumericChartScale(yScaleType, yDomain, range, props.yDomain ? null : tickCount);\n const ticks = createYTicks(scale, tickCount);\n return {\n axis: 'y',\n tickCount,\n scale,\n ticks,\n tickFormatter: yTickFormatter as TickFormatter,\n title: yTitle,\n ariaRoleDescription: i18nStrings.yAxisAriaRoleDescription,\n };\n }\n\n const bottomAxisProps = !horizontalBars\n ? getXAxisProps(plotWidth, [0, plotWidth])\n : getYAxisProps(plotWidth, [0, plotWidth]);\n\n const bottomLabelsProps = useBottomLabels({ ...bottomAxisProps });\n\n const plotMeasureRef = useRef<SVGLineElement>(null);\n const measuredHeight = useHeightMeasure(() => plotMeasureRef.current, !fitHeight);\n const plotHeight = fitHeight ? measuredHeight ?? 0 : explicitPlotHeight;\n\n const leftAxisProps = !horizontalBars\n ? getYAxisProps(plotHeight, [plotHeight, 0])\n : getXAxisProps(plotHeight, [0, plotHeight]);\n\n const xAxisProps = bottomAxisProps.axis === 'x' ? bottomAxisProps : leftAxisProps.axis === 'x' ? leftAxisProps : null;\n const yAxisProps = bottomAxisProps.axis === 'y' ? bottomAxisProps : leftAxisProps.axis === 'y' ? leftAxisProps : null;\n if (!xAxisProps || !yAxisProps) {\n throw new Error('Invariant violation: invalid axis props.');\n }\n\n /**\n * Interactions\n */\n const highlightedPointRef = useRef<SVGGElement>(null);\n const highlightedGroupRef = useRef<SVGRectElement>(null);\n const [isPlotFocused, setPlotFocused] = useState(false);\n\n // Some chart components are rendered against \"x\" or \"y\" axes,\n // When \"horizontalBars\" is enabled, the axes are inverted.\n const x = !horizontalBars ? 'x' : 'y';\n const y = !horizontalBars ? 'y' : 'x';\n\n const scaledSeries = makeScaledSeries(visibleSeries, xAxisProps.scale, yAxisProps.scale);\n const barGroups: ScaledBarGroup<T>[] = makeScaledBarGroups(visibleSeries, xAxisProps.scale, plotWidth, plotHeight, y);\n\n const { isPopoverOpen, isPopoverPinned, showPopover, pinPopover, dismissPopover } = usePopover();\n\n // Allows to add a delay between popover is dismissed and handlers are enabled to prevent immediate popover reopening.\n const [isHandlersDisabled, setHandlersDisabled] = useState(!isPopoverPinned);\n useEffect(() => {\n if (isPopoverPinned) {\n setHandlersDisabled(true);\n } else {\n const timeoutId = setTimeout(() => setHandlersDisabled(false), 25);\n return () => clearTimeout(timeoutId);\n }\n }, [isPopoverPinned]);\n\n const highlightSeries = useCallback(\n (series: MixedLineBarChartProps.ChartSeries<T> | null) => {\n if (series !== highlightedSeries) {\n onHighlightChange(series);\n }\n },\n [highlightedSeries, onHighlightChange]\n );\n\n const highlightPoint = useCallback(\n (point: ScaledPoint<T> | null) => {\n setHighlightedGroupIndex(null);\n setHighlightedPoint(point);\n if (point) {\n highlightSeries(point.series);\n setVerticalMarkerX({\n scaledX: point.x,\n label: point.datum?.x ?? null,\n });\n }\n },\n [setHighlightedGroupIndex, setHighlightedPoint, highlightSeries]\n );\n\n const clearAllHighlights = useCallback(() => {\n setHighlightedPoint(null);\n highlightSeries(null);\n setHighlightedGroupIndex(null);\n }, [highlightSeries, setHighlightedGroupIndex, setHighlightedPoint]);\n\n // Highlight all points at a given X in a line chart\n const highlightX = useCallback(\n (marker: VerticalMarkerX<T> | null) => {\n if (marker) {\n clearAllHighlights();\n }\n setVerticalMarkerX(marker);\n },\n [clearAllHighlights]\n );\n\n // Highlight all points and bars at a given X index in a mixed line and bar chart\n const highlightGroup = useCallback(\n (groupIndex: number) => {\n highlightSeries(null);\n setHighlightedPoint(null);\n setHighlightedGroupIndex(groupIndex);\n },\n [highlightSeries, setHighlightedPoint, setHighlightedGroupIndex]\n );\n\n const clearHighlightedSeries = useCallback(() => {\n clearAllHighlights();\n dismissPopover();\n }, [dismissPopover, clearAllHighlights]);\n\n const { isGroupNavigation, ...handlers } = useNavigation({\n series,\n visibleSeries,\n scaledSeries,\n barGroups,\n xScale: xAxisProps.scale,\n yScale: yAxisProps.scale,\n highlightedPoint,\n highlightedGroupIndex,\n highlightedSeries,\n isHandlersDisabled,\n pinPopover,\n highlightSeries,\n highlightGroup,\n highlightPoint,\n highlightX,\n clearHighlightedSeries,\n verticalMarkerX,\n });\n\n const { onSVGMouseMove, onSVGMouseOut, onPopoverLeave } = useMouseHover<T>({\n scaledSeries,\n barGroups,\n plotRef,\n popoverRef,\n highlightPoint,\n highlightGroup,\n clearHighlightedSeries,\n isGroupNavigation,\n isHandlersDisabled,\n highlightX,\n });\n\n // There are multiple ways to indicate what X is selected.\n // TODO: make a uniform verticalMarkerX state to fit all use-cases.\n const highlightedX = useMemo(() => {\n if (highlightedGroupIndex !== null) {\n return barGroups[highlightedGroupIndex].x;\n }\n if (verticalMarkerX !== null) {\n return verticalMarkerX.label;\n }\n return highlightedPoint?.datum?.x ?? null;\n }, [highlightedPoint, verticalMarkerX, highlightedGroupIndex, barGroups]);\n\n useEffect(() => {\n const onKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n dismissPopover();\n }\n };\n document.addEventListener('keydown', onKeyDown);\n return () => document.removeEventListener('keydown', onKeyDown);\n }, [dismissPopover]);\n\n useLayoutEffect(() => {\n if (highlightedX !== null || highlightedPoint !== null) {\n showPopover();\n }\n }, [highlightedX, highlightedPoint, showPopover]);\n\n const onPopoverDismiss = (outsideClick?: boolean) => {\n dismissPopover();\n\n if (!outsideClick) {\n // The delay is needed to bypass focus events caused by click or keypress needed to unpin the popover.\n setTimeout(() => {\n const isSomeInnerElementFocused = highlightedPoint || highlightedGroupIndex !== null || verticalMarkerX;\n if (isSomeInnerElementFocused) {\n plotRef.current?.focusApplication();\n } else {\n plotRef.current?.focusPlot();\n }\n }, 0);\n } else {\n clearAllHighlights();\n setVerticalMarkerX(null);\n }\n };\n\n const onSVGClick = (e: React.MouseEvent<SVGSVGElement, MouseEvent>) => {\n if (isPopoverOpen) {\n if (isPopoverPinned) {\n dismissPopover();\n } else {\n pinPopover();\n e.preventDefault();\n }\n } else {\n showPopover();\n }\n };\n\n const onSVGFocus = (event: React.FocusEvent, trigger: 'mouse' | 'keyboard') => {\n setPlotFocused(true);\n if (trigger === 'keyboard') {\n handlers.onFocus();\n } else {\n // noop: clicks are handled separately\n }\n };\n\n const onSVGBlur = (event: React.FocusEvent<Element>) => {\n setPlotFocused(false);\n const blurTarget = event.relatedTarget || event.target;\n if (\n blurTarget === null ||\n !(blurTarget instanceof Element) ||\n !nodeBelongs(containerRefObject.current, blurTarget)\n ) {\n setHighlightedPoint(null);\n setVerticalMarkerX(null);\n if (!plotContainerRef?.current?.contains(blurTarget)) {\n clearHighlightedSeries();\n }\n\n if (isPopoverOpen && !isPopoverPinned) {\n dismissPopover();\n }\n }\n };\n\n const onSVGKeyDown = handlers.onKeyDown;\n\n const xOffset = xAxisProps.scale.isCategorical() ? Math.max(0, xAxisProps.scale.d3Scale.bandwidth() - 1) / 2 : 0;\n\n let verticalLineX: number | null = null;\n if (verticalMarkerX !== null) {\n verticalLineX = verticalMarkerX.scaledX;\n } else if (isGroupNavigation && highlightedGroupIndex !== null) {\n const x = xAxisProps.scale.d3Scale(barGroups[highlightedGroupIndex].x as any) ?? null;\n if (x !== null) {\n verticalLineX = xOffset + x;\n }\n }\n\n const point = useMemo(\n () =>\n highlightedPoint\n ? {\n key: `${highlightedPoint.x}-${highlightedPoint.y}`,\n x: highlightedPoint.x,\n y: highlightedPoint.y,\n color: highlightedPoint.color,\n }\n : null,\n [highlightedPoint]\n );\n\n const verticalMarkers = useMemo(\n () =>\n verticalLineX !== null\n ? scaledSeries\n .filter(({ x, y }) => (x === verticalLineX || isNaN(x)) && !isNaN(y))\n .map(({ x, y, color }, index) => ({\n key: `${index}-${x}-${y}`,\n x: !horizontalBars ? verticalLineX || 0 : y,\n y: !horizontalBars ? y : verticalLineX || 0,\n color: color,\n }))\n : [],\n [scaledSeries, verticalLineX, horizontalBars]\n );\n\n const highlightedElementRef = isGroupNavigation\n ? highlightedGroupRef\n : highlightedPoint\n ? highlightedPointRef\n : verticalMarkerRef;\n\n const highlightDetails = useMemo(() => {\n if (highlightedX === null) {\n return null;\n }\n\n // When series point is highlighted show the corresponding series and matching x-thresholds.\n if (highlightedPoint) {\n const seriesToShow = visibleSeries.filter(\n series => series.series === highlightedPoint?.series || isXThreshold(series.series)\n );\n return formatHighlighted({\n position: highlightedX,\n series: seriesToShow,\n xTickFormatter,\n detailPopoverSeriesContent,\n });\n }\n\n // Otherwise - show all visible series details.\n return formatHighlighted({\n position: highlightedX,\n series: visibleSeries,\n xTickFormatter,\n detailPopoverSeriesContent,\n });\n }, [highlightedX, highlightedPoint, visibleSeries, xTickFormatter, detailPopoverSeriesContent]);\n\n const detailPopoverFooterContent = useMemo(\n () => (detailPopoverFooter && highlightedX ? detailPopoverFooter(highlightedX) : null),\n [detailPopoverFooter, highlightedX]\n );\n\n const activeAriaLabel =\n highlightDetails && detailsPopoverText ? `${highlightDetails.position}, ${detailsPopoverText}` : '';\n\n // Live region is used when nothing is focused e.g. when hovering.\n const activeLiveRegion =\n activeAriaLabel && !highlightedPoint && highlightedGroupIndex === null ? activeAriaLabel : '';\n\n const isLineXKeyboardFocused = isPlotFocused && !highlightedPoint && verticalMarkerX;\n\n const isRefresh = useVisualRefresh();\n\n return (\n <CartesianChartContainer\n ref={containerRef}\n minHeight={explicitPlotHeight + bottomLabelsProps.height}\n fitHeight={!!fitHeight}\n leftAxisLabel={<AxisLabel axis={y} position=\"left\" title={leftAxisProps.title} />}\n leftAxisLabelMeasure={\n <LabelsMeasure\n ticks={leftAxisProps.ticks}\n scale={leftAxisProps.scale}\n tickFormatter={leftAxisProps.tickFormatter as TickFormatter}\n autoWidth={setLeftLabelsWidth}\n maxLabelsWidth={maxLeftLabelsWidth}\n />\n }\n bottomAxisLabel={<AxisLabel axis={x} position=\"bottom\" title={bottomAxisProps.title} />}\n chartPlot={\n <ChartPlot\n ref={plotRef}\n width=\"100%\"\n height={fitHeight ? `calc(100% - ${bottomLabelsProps.height}px)` : plotHeight}\n offsetBottom={bottomLabelsProps.height}\n isClickable={isPopoverOpen && !isPopoverPinned}\n ariaLabel={ariaLabel}\n ariaLabelledby={ariaLabelledby}\n ariaDescription={ariaDescription}\n ariaRoleDescription={i18nStrings?.chartAriaRoleDescription}\n ariaLiveRegion={activeLiveRegion}\n activeElementRef={highlightedElementRef}\n activeElementKey={\n isPlotFocused &&\n (highlightedGroupIndex?.toString() ??\n (isLineXKeyboardFocused ? `point-index-${handlers.xIndex}` : point?.key))\n }\n activeElementFocusOffset={isGroupNavigation ? 0 : isLineXKeyboardFocused ? { x: 8, y: 0 } : 3}\n onMouseMove={onSVGMouseMove}\n onMouseOut={onSVGMouseOut}\n onClick={onSVGClick}\n onFocus={onSVGFocus}\n onBlur={onSVGBlur}\n onKeyDown={onSVGKeyDown}\n >\n <line\n ref={plotMeasureRef}\n x1=\"0\"\n x2=\"0\"\n y1=\"0\"\n y2=\"100%\"\n stroke=\"transparent\"\n strokeWidth={1}\n style={{ pointerEvents: 'none' }}\n />\n\n <LeftLabels\n axis={y}\n ticks={leftAxisProps.ticks}\n scale={leftAxisProps.scale}\n tickFormatter={leftAxisProps.tickFormatter as TickFormatter}\n title={leftAxisProps.title}\n ariaRoleDescription={leftAxisProps.ariaRoleDescription}\n maxLabelsWidth={maxLeftLabelsWidth}\n plotWidth={plotWidth}\n plotHeight={plotHeight}\n />\n\n {horizontalBars && (\n <VerticalGridLines scale={yAxisProps.scale} ticks={yAxisProps.ticks} height={plotHeight} />\n )}\n\n {emphasizeBaselineAxis && linesOnly && (\n <EmphasizedBaseline axis={x} scale={yAxisProps.scale} width={plotWidth} height={plotHeight} />\n )}\n\n <DataSeries\n axis={x}\n plotWidth={plotWidth}\n plotHeight={plotHeight}\n highlightedSeries={highlightedSeries ?? null}\n highlightedGroupIndex={highlightedGroupIndex}\n stackedBars={stackedBars}\n isGroupNavigation={isGroupNavigation}\n visibleSeries={visibleSeries}\n xScale={xAxisProps.scale}\n yScale={yAxisProps.scale}\n />\n\n {emphasizeBaselineAxis && !linesOnly && (\n <EmphasizedBaseline axis={x} scale={yAxisProps.scale} width={plotWidth} height={plotHeight} />\n )}\n\n <VerticalMarker\n key={verticalLineX || ''}\n height={plotHeight}\n showPoints={highlightedPoint === null}\n showLine={!isGroupNavigation}\n points={verticalMarkers}\n ref={verticalMarkerRef}\n />\n\n {highlightedPoint && (\n <HighlightedPoint\n ref={highlightedPointRef}\n point={point}\n role=\"button\"\n ariaLabel={activeAriaLabel}\n ariaHasPopup={true}\n ariaExpanded={isPopoverPinned}\n />\n )}\n\n {isGroupNavigation && xAxisProps.scale.isCategorical() && (\n <BarGroups\n ariaLabel={activeAriaLabel}\n isRefresh={isRefresh}\n isPopoverPinned={isPopoverPinned}\n barGroups={barGroups}\n highlightedGroupIndex={highlightedGroupIndex}\n highlightedGroupRef={highlightedGroupRef}\n />\n )}\n\n <BottomLabels\n {...bottomLabelsProps}\n axis={x}\n scale={bottomAxisProps.scale}\n title={bottomAxisProps.title}\n ariaRoleDescription={bottomAxisProps.ariaRoleDescription}\n height={plotHeight}\n width={plotWidth}\n offsetLeft={leftLabelsWidth + BOTTOM_LABELS_OFFSET}\n offsetRight={BOTTOM_LABELS_OFFSET}\n />\n </ChartPlot>\n }\n popover={\n <ChartPopover\n ref={popoverRef}\n containerRef={containerRefObject}\n trackRef={highlightedElementRef}\n isOpen={isPopoverOpen}\n isPinned={isPopoverPinned}\n highlightDetails={highlightDetails}\n onDismiss={onPopoverDismiss}\n size={detailPopoverSize}\n footer={detailPopoverFooterContent}\n dismissAriaLabel={i18nStrings.detailPopoverDismissAriaLabel}\n onMouseLeave={onPopoverLeave}\n onBlur={onSVGBlur}\n setPopoverText={setDetailsPopoverText}\n />\n }\n />\n );\n}\n"]}
|
|
@@ -14,6 +14,7 @@ export interface MixedChartPopoverProps<T extends ChartDataTypes> {
|
|
|
14
14
|
onMouseEnter?: (event: React.MouseEvent) => void;
|
|
15
15
|
onMouseLeave?: (event: React.MouseEvent) => void;
|
|
16
16
|
onBlur?: (event: React.FocusEvent) => void;
|
|
17
|
+
setPopoverText: (s: string) => void;
|
|
17
18
|
}
|
|
18
19
|
declare const _default: React.ForwardRefExoticComponent<MixedChartPopoverProps<ChartDataTypes> & React.RefAttributes<HTMLElement>>;
|
|
19
20
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chart-popover.d.ts","sourceRoot":"lib/default/","sources":["mixed-line-bar-chart/chart-popover.tsx"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"chart-popover.d.ts","sourceRoot":"lib/default/","sources":["mixed-line-bar-chart/chart-popover.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAKxC,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAItE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAGxD,MAAM,WAAW,sBAAsB,CAAC,CAAC,SAAS,cAAc;IAC9D,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAC9C,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;IACtC,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;IAClB,gBAAgB,EAAE,IAAI,GAAG,gBAAgB,CAAC;IAC1C,SAAS,IAAI,IAAI,CAAC;IAClB,IAAI,EAAE,sBAAsB,CAAC,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC;IACrD,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;IACjD,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;IACjD,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;IAC3C,cAAc,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CACrC;;AAED,wBAAmD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
import React from 'react';
|
|
3
|
+
import React, { useState } from 'react';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
5
|
import ChartPopover from '../internal/components/chart-popover';
|
|
6
6
|
import ChartSeriesDetails from '../internal/components/chart-series-details';
|
|
@@ -8,9 +8,19 @@ import styles from './styles.css.js';
|
|
|
8
8
|
import { Transition } from '../internal/components/transition';
|
|
9
9
|
import ChartPopoverFooter from '../internal/components/chart-popover-footer';
|
|
10
10
|
export default React.forwardRef(MixedChartPopover);
|
|
11
|
-
function MixedChartPopover({ containerRef, trackRef, isOpen, isPinned, highlightDetails, footer, onDismiss, size = 'medium', dismissAriaLabel, onMouseEnter, onMouseLeave, onBlur, }, popoverRef) {
|
|
11
|
+
function MixedChartPopover({ containerRef, trackRef, isOpen, isPinned, highlightDetails, footer, onDismiss, size = 'medium', dismissAriaLabel, onMouseEnter, onMouseLeave, onBlur, setPopoverText, }, popoverRef) {
|
|
12
|
+
const [expandedSeries, setExpandedSeries] = useState({});
|
|
12
13
|
return (React.createElement(Transition, { in: isOpen }, (state, ref) => (React.createElement("div", { ref: ref, className: clsx(state === 'exiting' && styles.exiting) }, (isOpen || state !== 'exited') && highlightDetails && (React.createElement(ChartPopover, { ref: popoverRef, title: highlightDetails.position, trackRef: trackRef, trackKey: highlightDetails.position, dismissButton: isPinned, dismissAriaLabel: dismissAriaLabel, onDismiss: onDismiss, container: containerRef.current, size: size, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, onBlur: onBlur },
|
|
13
|
-
React.createElement(ChartSeriesDetails, { details: highlightDetails.details
|
|
14
|
+
React.createElement(ChartSeriesDetails, { key: highlightDetails.position, details: highlightDetails.details, setPopoverText: setPopoverText, expandedSeries: expandedSeries[highlightDetails.position], setExpandedState: (id, isExpanded) => setExpandedSeries(oldState => {
|
|
15
|
+
const expandedSeriesInCurrentCoordinate = new Set(oldState[highlightDetails.position]);
|
|
16
|
+
if (isExpanded) {
|
|
17
|
+
expandedSeriesInCurrentCoordinate.add(id);
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
expandedSeriesInCurrentCoordinate.delete(id);
|
|
21
|
+
}
|
|
22
|
+
return Object.assign(Object.assign({}, oldState), { [highlightDetails.position]: expandedSeriesInCurrentCoordinate });
|
|
23
|
+
}) }),
|
|
14
24
|
footer && React.createElement(ChartPopoverFooter, null, footer)))))));
|
|
15
25
|
}
|
|
16
26
|
//# sourceMappingURL=chart-popover.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chart-popover.js","sourceRoot":"lib/default/","sources":["mixed-line-bar-chart/chart-popover.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"chart-popover.js","sourceRoot":"lib/default/","sources":["mixed-line-bar-chart/chart-popover.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,YAAY,MAAM,sCAAsC,CAAC;AAChE,OAAO,kBAAsC,MAAM,6CAA6C,CAAC;AAGjG,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAE/D,OAAO,kBAAkB,MAAM,6CAA6C,CAAC;AAkB7E,eAAe,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC;AAEnD,SAAS,iBAAiB,CACxB,EACE,YAAY,EACZ,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,gBAAgB,EA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vF,IAAI,UAAU,EAAE;oBACd,iCAAiC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;iBAC3C;qBAAM;oBACL,iCAAiC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;iBAC9C;gBACD,uCACK,QAAQ,KACX,CAAC,gBAAgB,CAAC,QAAQ,CAAC,EAAE,iCAAiC,IAC9D;YACJ,CAAC,CAAC,GAEJ;QACD,MAAM,IAAI,oBAAC,kBAAkB,QAAE,MAAM,CAAsB,CAC/C,CAChB,CACG,CACP,CACU,CACd,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useState } from 'react';\nimport clsx from 'clsx';\n\nimport ChartPopover from '../internal/components/chart-popover';\nimport ChartSeriesDetails, { ExpandedSeries } from '../internal/components/chart-series-details';\nimport { ChartDataTypes, MixedLineBarChartProps } from './interfaces';\n\nimport styles from './styles.css.js';\nimport { Transition } from '../internal/components/transition';\nimport { HighlightDetails } from './format-highlighted';\nimport ChartPopoverFooter from '../internal/components/chart-popover-footer';\n\nexport interface MixedChartPopoverProps<T extends ChartDataTypes> {\n containerRef: React.RefObject<HTMLDivElement>;\n trackRef: React.RefObject<SVGElement>;\n isOpen: boolean;\n isPinned: boolean;\n highlightDetails: null | HighlightDetails;\n onDismiss(): void;\n size: MixedLineBarChartProps<T>['detailPopoverSize'];\n footer?: React.ReactNode;\n dismissAriaLabel?: string;\n onMouseEnter?: (event: React.MouseEvent) => void;\n onMouseLeave?: (event: React.MouseEvent) => void;\n onBlur?: (event: React.FocusEvent) => void;\n setPopoverText: (s: string) => void;\n}\n\nexport default React.forwardRef(MixedChartPopover);\n\nfunction MixedChartPopover<T extends ChartDataTypes>(\n {\n containerRef,\n trackRef,\n isOpen,\n isPinned,\n highlightDetails,\n footer,\n onDismiss,\n size = 'medium',\n dismissAriaLabel,\n onMouseEnter,\n onMouseLeave,\n onBlur,\n setPopoverText,\n }: MixedChartPopoverProps<T>,\n popoverRef: React.Ref<HTMLElement>\n) {\n const [expandedSeries, setExpandedSeries] = useState<Record<string, ExpandedSeries>>({});\n return (\n <Transition in={isOpen}>\n {(state, ref) => (\n <div ref={ref} className={clsx(state === 'exiting' && styles.exiting)}>\n {(isOpen || state !== 'exited') && highlightDetails && (\n <ChartPopover\n ref={popoverRef}\n title={highlightDetails.position}\n trackRef={trackRef}\n trackKey={highlightDetails.position}\n dismissButton={isPinned}\n dismissAriaLabel={dismissAriaLabel}\n onDismiss={onDismiss}\n container={containerRef.current}\n size={size}\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n onBlur={onBlur}\n >\n <ChartSeriesDetails\n key={highlightDetails.position}\n details={highlightDetails.details}\n setPopoverText={setPopoverText}\n expandedSeries={expandedSeries[highlightDetails.position]}\n setExpandedState={(id, isExpanded) =>\n setExpandedSeries(oldState => {\n const expandedSeriesInCurrentCoordinate = new Set(oldState[highlightDetails.position]);\n if (isExpanded) {\n expandedSeriesInCurrentCoordinate.add(id);\n } else {\n expandedSeriesInCurrentCoordinate.delete(id);\n }\n return {\n ...oldState,\n [highlightDetails.position]: expandedSeriesInCurrentCoordinate,\n };\n })\n }\n />\n {footer && <ChartPopoverFooter>{footer}</ChartPopoverFooter>}\n </ChartPopover>\n )}\n </div>\n )}\n </Transition>\n );\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChartDataTypes, InternalChartSeries } from './interfaces';
|
|
1
|
+
import { ChartDataTypes, InternalChartSeries, MixedLineBarChartProps } from './interfaces';
|
|
2
2
|
import { ChartSeriesDetailItem } from '../internal/components/chart-series-details';
|
|
3
3
|
import { CartesianChartProps } from '../internal/components/cartesian-chart/interfaces';
|
|
4
4
|
export interface HighlightDetails {
|
|
@@ -6,5 +6,10 @@ export interface HighlightDetails {
|
|
|
6
6
|
details: ChartSeriesDetailItem[];
|
|
7
7
|
}
|
|
8
8
|
/** Formats provided x-position and its corresponding series values. */
|
|
9
|
-
export default function formatHighlighted<T extends ChartDataTypes>(position
|
|
9
|
+
export default function formatHighlighted<T extends ChartDataTypes>({ position, series, xTickFormatter, detailPopoverSeriesContent, }: {
|
|
10
|
+
position: T;
|
|
11
|
+
series: readonly InternalChartSeries<T>[];
|
|
12
|
+
xTickFormatter?: CartesianChartProps.TickFormatter<T>;
|
|
13
|
+
detailPopoverSeriesContent?: MixedLineBarChartProps.DetailPopoverSeriesContent<T>;
|
|
14
|
+
}): HighlightDetails;
|
|
10
15
|
//# sourceMappingURL=format-highlighted.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format-highlighted.d.ts","sourceRoot":"lib/default/","sources":["mixed-line-bar-chart/format-highlighted.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"format-highlighted.d.ts","sourceRoot":"lib/default/","sources":["mixed-line-bar-chart/format-highlighted.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAC3F,OAAO,EAAE,qBAAqB,EAAE,MAAM,6CAA6C,CAAC;AACpF,OAAO,EAAE,mBAAmB,EAAE,MAAM,mDAAmD,CAAC;AAIxF,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,qBAAqB,EAAE,CAAC;CAClC;AAED,uEAAuE;AACvE,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,CAAC,SAAS,cAAc,EAAE,EAClE,QAAQ,EACR,MAAM,EACN,cAAc,EACd,0BAA0B,GAC3B,EAAE;IACD,QAAQ,EAAE,CAAC,CAAC;IACZ,MAAM,EAAE,SAAS,mBAAmB,CAAC,CAAC,CAAC,EAAE,CAAC;IAC1C,cAAc,CAAC,EAAE,mBAAmB,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;IACtD,0BAA0B,CAAC,EAAE,sBAAsB,CAAC,0BAA0B,CAAC,CAAC,CAAC,CAAC;CACnF,GAAG,gBAAgB,CAYnB"}
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import { isDataSeries, isXThreshold, isYThreshold, matchesX } from './utils';
|
|
2
|
+
import { warnOnce } from '@cloudscape-design/component-toolkit/internal';
|
|
2
3
|
/** Formats provided x-position and its corresponding series values. */
|
|
3
|
-
export default function formatHighlighted(position, series, xTickFormatter) {
|
|
4
|
+
export default function formatHighlighted({ position, series, xTickFormatter, detailPopoverSeriesContent, }) {
|
|
4
5
|
const formattedPosition = xTickFormatter ? xTickFormatter(position) : position.toString();
|
|
5
6
|
const details = [];
|
|
6
7
|
series.forEach(s => {
|
|
7
|
-
const detail = getSeriesDetail(s, position);
|
|
8
|
+
const detail = getSeriesDetail({ internalSeries: s, targetX: position, detailPopoverSeriesContent });
|
|
8
9
|
if (detail) {
|
|
9
10
|
details.push(detail);
|
|
10
11
|
}
|
|
11
12
|
});
|
|
12
13
|
return { position: formattedPosition, details };
|
|
13
14
|
}
|
|
14
|
-
function getSeriesDetail(internalSeries, targetX) {
|
|
15
|
+
function getSeriesDetail({ internalSeries, targetX, detailPopoverSeriesContent, }) {
|
|
16
|
+
var _a;
|
|
15
17
|
const { series, color } = internalSeries;
|
|
16
18
|
// X-thresholds are only shown when X matches.
|
|
17
19
|
if (isXThreshold(series)) {
|
|
@@ -35,11 +37,29 @@ function getSeriesDetail(internalSeries, targetX) {
|
|
|
35
37
|
if (isDataSeries(series)) {
|
|
36
38
|
for (const datum of series.data) {
|
|
37
39
|
if (matchesX(targetX, datum.x)) {
|
|
40
|
+
const customContent = detailPopoverSeriesContent
|
|
41
|
+
? detailPopoverSeriesContent({ series, x: targetX, y: datum.y })
|
|
42
|
+
: undefined;
|
|
43
|
+
const hasSubItems = !!((_a = customContent === null || customContent === void 0 ? void 0 : customContent.subItems) === null || _a === void 0 ? void 0 : _a.length);
|
|
44
|
+
const isExpandable = (customContent === null || customContent === void 0 ? void 0 : customContent.expandable) && hasSubItems;
|
|
45
|
+
const isKeyString = typeof (customContent === null || customContent === void 0 ? void 0 : customContent.key) === 'string';
|
|
46
|
+
const key = (customContent === null || customContent === void 0 ? void 0 : customContent.key) && (!isExpandable || isKeyString) ? customContent.key : series.title;
|
|
47
|
+
if ((customContent === null || customContent === void 0 ? void 0 : customContent.expandable) && !hasSubItems) {
|
|
48
|
+
warnOnce('MixedLineBarChart', '`expandable` was set to `true` for a series without sub-items. This property will be ignored.');
|
|
49
|
+
}
|
|
50
|
+
if (isExpandable && !isKeyString) {
|
|
51
|
+
warnOnce('MixedLineBarChart', 'A ReactNode was used for the key of an expandable series. The series title will be used instead because nested interactive elements can cause accessiblity issues.');
|
|
52
|
+
}
|
|
53
|
+
if (!isKeyString && !isExpandable && (customContent === null || customContent === void 0 ? void 0 : customContent.value) && typeof customContent.value !== 'string') {
|
|
54
|
+
warnOnce('MixedLineBarChart', 'Use a ReactNode for the key or the value of a series, but not for both. It is not recommended to use links for key and value at the same time.');
|
|
55
|
+
}
|
|
38
56
|
return {
|
|
39
|
-
key
|
|
40
|
-
value: series.valueFormatter ? series.valueFormatter(datum.y, targetX) : datum.y,
|
|
57
|
+
key,
|
|
58
|
+
value: (customContent === null || customContent === void 0 ? void 0 : customContent.value) || (series.valueFormatter ? series.valueFormatter(datum.y, targetX) : datum.y),
|
|
41
59
|
color,
|
|
42
60
|
markerType: series.type === 'line' ? 'line' : 'rectangle',
|
|
61
|
+
subItems: customContent === null || customContent === void 0 ? void 0 : customContent.subItems,
|
|
62
|
+
expandableId: isExpandable ? series.title : undefined,
|
|
43
63
|
};
|
|
44
64
|
}
|
|
45
65
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format-highlighted.js","sourceRoot":"lib/default/","sources":["mixed-line-bar-chart/format-highlighted.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,E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AAb,aAAa,CAAE,UAAU,KAAI,CAAC,WAAW,EAAE;oBAC7C,QAAQ,CACN,mBAAmB,EACnB,+FAA+F,CAChG,CAAC;iBACH;gBACD,IAAI,YAAY,IAAI,CAAC,WAAW,EAAE;oBAChC,QAAQ,CACN,mBAAmB,EACnB,oKAAoK,CACrK,CAAC;iBACH;gBACD,IAAI,CAAC,WAAW,IAAI,CAAC,YAAY,KAAI,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,KAAK,CAAA,IAAI,OAAO,aAAa,CAAC,KAAK,KAAK,QAAQ,EAAE;oBACpG,QAAQ,CACN,mBAAmB,EACnB,gJAAgJ,CACjJ,CAAC;iBACH;gBAED,OAAO;oBACL,GAAG;oBACH,KAAK,EAAE,CAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,KAAK,KAAI,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;oBAC1G,KAAK;oBACL,UAAU,EAAE,MAAM,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW;oBACzD,QAAQ,EAAE,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,QAAQ;oBACjC,YAAY,EAAE,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS;iBACtD,CAAC;aACH;SACF;KACF;IAED,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { ChartDataTypes, InternalChartSeries, MixedLineBarChartProps } from './interfaces';\nimport { ChartSeriesDetailItem } from '../internal/components/chart-series-details';\nimport { CartesianChartProps } from '../internal/components/cartesian-chart/interfaces';\nimport { isDataSeries, isXThreshold, isYThreshold, matchesX } from './utils';\nimport { warnOnce } from '@cloudscape-design/component-toolkit/internal';\n\nexport interface HighlightDetails {\n position: string;\n details: ChartSeriesDetailItem[];\n}\n\n/** Formats provided x-position and its corresponding series values. */\nexport default function formatHighlighted<T extends ChartDataTypes>({\n position,\n series,\n xTickFormatter,\n detailPopoverSeriesContent,\n}: {\n position: T;\n series: readonly InternalChartSeries<T>[];\n xTickFormatter?: CartesianChartProps.TickFormatter<T>;\n detailPopoverSeriesContent?: MixedLineBarChartProps.DetailPopoverSeriesContent<T>;\n}): HighlightDetails {\n const formattedPosition = xTickFormatter ? xTickFormatter(position) : position.toString();\n\n const details: ChartSeriesDetailItem[] = [];\n series.forEach(s => {\n const detail = getSeriesDetail({ internalSeries: s, targetX: position, detailPopoverSeriesContent });\n if (detail) {\n details.push(detail);\n }\n });\n\n return { position: formattedPosition, details };\n}\n\nfunction getSeriesDetail<T>({\n internalSeries,\n targetX,\n detailPopoverSeriesContent,\n}: {\n internalSeries: InternalChartSeries<T>;\n targetX: T;\n detailPopoverSeriesContent?: MixedLineBarChartProps.DetailPopoverSeriesContent<T>;\n}): ChartSeriesDetailItem | null {\n const { series, color } = internalSeries;\n\n // X-thresholds are only shown when X matches.\n if (isXThreshold(series)) {\n return series.x === targetX\n ? {\n key: series.title,\n value: '',\n color,\n markerType: 'dashed',\n }\n : null;\n }\n\n if (isYThreshold(series)) {\n return {\n key: series.title,\n value: series.valueFormatter ? series.valueFormatter(series.y) : series.y,\n color,\n markerType: 'dashed',\n };\n }\n\n if (isDataSeries(series)) {\n for (const datum of series.data) {\n if (matchesX(targetX, datum.x)) {\n const customContent = detailPopoverSeriesContent\n ? detailPopoverSeriesContent({ series, x: targetX, y: datum.y })\n : undefined;\n const hasSubItems = !!customContent?.subItems?.length;\n const isExpandable = customContent?.expandable && hasSubItems;\n const isKeyString = typeof customContent?.key === 'string';\n const key = customContent?.key && (!isExpandable || isKeyString) ? customContent.key : series.title;\n\n if (customContent?.expandable && !hasSubItems) {\n warnOnce(\n 'MixedLineBarChart',\n '`expandable` was set to `true` for a series without sub-items. This property will be ignored.'\n );\n }\n if (isExpandable && !isKeyString) {\n warnOnce(\n 'MixedLineBarChart',\n 'A ReactNode was used for the key of an expandable series. The series title will be used instead because nested interactive elements can cause accessiblity issues.'\n );\n }\n if (!isKeyString && !isExpandable && customContent?.value && typeof customContent.value !== 'string') {\n warnOnce(\n 'MixedLineBarChart',\n 'Use a ReactNode for the key or the value of a series, but not for both. It is not recommended to use links for key and value at the same time.'\n );\n }\n\n return {\n key,\n value: customContent?.value || (series.valueFormatter ? series.valueFormatter(datum.y, targetX) : datum.y),\n color,\n markerType: series.type === 'line' ? 'line' : 'rectangle',\n subItems: customContent?.subItems,\n expandableId: isExpandable ? series.title : undefined,\n };\n }\n }\n }\n\n return null;\n}\n"]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
1
2
|
import { CartesianChartProps } from '../internal/components/cartesian-chart/interfaces';
|
|
2
3
|
export type ChartDataTypes = number | string | Date;
|
|
3
4
|
export type SeriesType = 'line' | 'bar';
|
|
@@ -8,7 +9,26 @@ export interface InternalChartSeries<T> {
|
|
|
8
9
|
color: string;
|
|
9
10
|
series: MixedLineBarChartProps.ChartSeries<T>;
|
|
10
11
|
}
|
|
11
|
-
export interface
|
|
12
|
+
export interface CommonMixedChartProps<T extends ChartDataTypes> extends CartesianChartProps<T, MixedLineBarChartProps.ChartSeries<T>> {
|
|
13
|
+
/**
|
|
14
|
+
* When set to `true`, adds a visual emphasis on the zero baseline axis.
|
|
15
|
+
* See the usage guidelines for more details.
|
|
16
|
+
*/
|
|
17
|
+
emphasizeBaselineAxis?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* A function that determines the details that are displayed in the popover for each series.
|
|
20
|
+
* Use this for wrapping keys or values in external links, or to display a metric breakdown by adding an additional level of nested items.
|
|
21
|
+
*
|
|
22
|
+
* The function is called with the parameters `{ series, x, y }` representing the series, the highlighted x coordinate value and its corresponding y value respectively,
|
|
23
|
+
* and should return the following properties:
|
|
24
|
+
* * `key` (ReactNode) - Name of the series.
|
|
25
|
+
* * `value` (ReactNode) - Value of the series at the highlighted x coordinate.
|
|
26
|
+
* * `subItems` (ReadonlyArray<{ key: ReactNode; value: ReactNode }>) - (Optional) List of nested key-value pairs.
|
|
27
|
+
* * `expandable` (boolean) - (Optional) Determines whether the optional list of nested items provided via `subItems` is expandable. This is `false` by default.
|
|
28
|
+
*/
|
|
29
|
+
detailPopoverSeriesContent?: MixedLineBarChartProps.DetailPopoverSeriesContent<T>;
|
|
30
|
+
}
|
|
31
|
+
export interface MixedLineBarChartProps<T extends ChartDataTypes> extends CommonMixedChartProps<T> {
|
|
12
32
|
/**
|
|
13
33
|
* Array that represents the source of data for the displayed chart.
|
|
14
34
|
* Each element can represent a line series, bar series, or a threshold, and can have the following properties:
|
|
@@ -30,11 +50,6 @@ export interface MixedLineBarChartProps<T extends ChartDataTypes> extends Cartes
|
|
|
30
50
|
* This can only be used when the chart consists exclusively of bar series.
|
|
31
51
|
*/
|
|
32
52
|
horizontalBars?: boolean;
|
|
33
|
-
/**
|
|
34
|
-
* When set to `true`, adds a visual emphasis on the zero baseline axis.
|
|
35
|
-
* See the usage guidelines for more details.
|
|
36
|
-
*/
|
|
37
|
-
emphasizeBaselineAxis?: boolean;
|
|
38
53
|
/**
|
|
39
54
|
* Determines the type of scale for values on the x axis.
|
|
40
55
|
* Use `categorical` for charts with bars.
|
|
@@ -81,6 +96,23 @@ export declare namespace MixedLineBarChartProps {
|
|
|
81
96
|
export type TickFormatter<T> = CartesianChartProps.TickFormatter<T>;
|
|
82
97
|
export type ValueFormatter<YType, XType = null> = CartesianChartProps.ValueFormatter<YType, XType>;
|
|
83
98
|
export type I18nStrings<T> = CartesianChartProps.I18nStrings<T>;
|
|
99
|
+
export interface DetailPopoverSeriesData<T> {
|
|
100
|
+
series: ChartSeries<T>;
|
|
101
|
+
x: T;
|
|
102
|
+
y: number;
|
|
103
|
+
}
|
|
104
|
+
export interface DetailPopoverSeriesKeyValuePair {
|
|
105
|
+
key: ReactNode;
|
|
106
|
+
value: ReactNode;
|
|
107
|
+
expandable?: boolean;
|
|
108
|
+
subItems?: ReadonlyArray<{
|
|
109
|
+
key: ReactNode;
|
|
110
|
+
value: ReactNode;
|
|
111
|
+
}>;
|
|
112
|
+
}
|
|
113
|
+
export interface DetailPopoverSeriesContent<T> {
|
|
114
|
+
(data: DetailPopoverSeriesData<T>): DetailPopoverSeriesKeyValuePair;
|
|
115
|
+
}
|
|
84
116
|
export {};
|
|
85
117
|
}
|
|
86
118
|
export interface VerticalMarkerX<T> {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"lib/default/","sources":["mixed-line-bar-chart/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mDAAmD,CAAC;AAExF,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;AAEpD,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,KAAK,CAAC;AACxC,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,KAAK,GAAG,MAAM,GAAG,aAAa,CAAC;AAClE,MAAM,MAAM,UAAU,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAE1C,MAAM,WAAW,mBAAmB,CAAC,CAAC;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,sBAAsB,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;CAC/C;
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"lib/default/","sources":["mixed-line-bar-chart/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,mBAAmB,EAAE,MAAM,mDAAmD,CAAC;AAExF,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG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C;QAC3C,CAAC,IAAI,EAAE,uBAAuB,CAAC,CAAC,CAAC,GAAG,+BAA+B,CAAC;KACrE;;CACF;AAED,MAAM,WAAW,eAAe,CAAC,CAAC;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC;CACjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"lib/default/","sources":["mixed-line-bar-chart/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { CartesianChartProps } from '../internal/components/cartesian-chart/interfaces';\n\nexport type ChartDataTypes = number | string | Date;\n\nexport type SeriesType = 'line' | 'bar';\nexport type ScaleType = 'linear' | 'log' | 'time' | 'categorical';\nexport type ScaleRange = [number, number];\n\nexport interface InternalChartSeries<T> {\n index: number;\n color: string;\n series: MixedLineBarChartProps.ChartSeries<T>;\n}\n\nexport interface
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"lib/default/","sources":["mixed-line-bar-chart/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { ReactNode } from 'react';\nimport { CartesianChartProps } from '../internal/components/cartesian-chart/interfaces';\n\nexport type ChartDataTypes = number | string | Date;\n\nexport type SeriesType = 'line' | 'bar';\nexport type ScaleType = 'linear' | 'log' | 'time' | 'categorical';\nexport type ScaleRange = [number, number];\n\nexport interface InternalChartSeries<T> {\n index: number;\n color: string;\n series: MixedLineBarChartProps.ChartSeries<T>;\n}\n\n// Properties that are shared as is (including API doc comments) by mixed, line and bar charts.\nexport interface CommonMixedChartProps<T extends ChartDataTypes>\n extends CartesianChartProps<T, MixedLineBarChartProps.ChartSeries<T>> {\n /**\n * When set to `true`, adds a visual emphasis on the zero baseline axis.\n * See the usage guidelines for more details.\n */\n emphasizeBaselineAxis?: boolean;\n\n /**\n * A function that determines the details that are displayed in the popover for each series.\n * Use this for wrapping keys or values in external links, or to display a metric breakdown by adding an additional level of nested items.\n *\n * The function is called with the parameters `{ series, x, y }` representing the series, the highlighted x coordinate value and its corresponding y value respectively,\n * and should return the following properties:\n * * `key` (ReactNode) - Name of the series.\n * * `value` (ReactNode) - Value of the series at the highlighted x coordinate.\n * * `subItems` (ReadonlyArray<{ key: ReactNode; value: ReactNode }>) - (Optional) List of nested key-value pairs.\n * * `expandable` (boolean) - (Optional) Determines whether the optional list of nested items provided via `subItems` is expandable. This is `false` by default.\n */\n detailPopoverSeriesContent?: MixedLineBarChartProps.DetailPopoverSeriesContent<T>;\n}\n\nexport interface MixedLineBarChartProps<T extends ChartDataTypes> extends CommonMixedChartProps<T> {\n /**\n * Array that represents the source of data for the displayed chart.\n * Each element can represent a line series, bar series, or a threshold, and can have the following properties:\n *\n * * `title` (string): A human-readable title for this series.\n * * `type` (string): Series type (`\"line\"`, `\"bar\"`, or `\"threshold\"`).\n * * `data` (Array): For line and bar series, an array of data points, represented as objects with `x` and `y` properties.\n * * `y` (number): For threshold series, the value of the threshold.\n * * `color` (string): (Optional) A color hex value for this series. When assigned, it takes priority over the automatically assigned color.\n * * `valueFormatter` (Function): (Optional) A function that formats data values before rendering in the UI, For example, in the details popover.\n */\n series: ReadonlyArray<MixedLineBarChartProps.ChartSeries<T>>;\n\n /**\n * When set to `true`, bars in the same data point are stacked instead of grouped next to each other.\n */\n stackedBars?: boolean;\n\n /**\n * When set to `true`, the x and y axes are flipped, which causes any bars to be rendered horizontally instead of vertically.\n * This can only be used when the chart consists exclusively of bar series.\n */\n horizontalBars?: boolean;\n\n /**\n * Determines the type of scale for values on the x axis.\n * Use `categorical` for charts with bars.\n */\n xScaleType?: ScaleType;\n}\n\nexport namespace MixedLineBarChartProps {\n export interface Datum<T> {\n x: T;\n y: number;\n }\n\n interface IDataSeries<T> {\n type: 'line' | 'bar' | 'threshold';\n title: string;\n color?: string;\n\n // This makes sure that the element type of the array is reduced to just one type,\n // even if `T` is a union type, e.g. `number | string`.\n data: T extends unknown ? ReadonlyArray<Datum<T>> : ReadonlyArray<Datum<T>>;\n valueFormatter?: T extends unknown\n ? CartesianChartProps.ValueFormatter<number, T>\n : CartesianChartProps.ValueFormatter<number, T>;\n }\n\n export interface BarDataSeries<T> extends IDataSeries<T> {\n type: 'bar';\n }\n\n export interface LineDataSeries<T> extends IDataSeries<T> {\n type: 'line';\n }\n\n export interface ThresholdSeries<T = any> extends Omit<IDataSeries<never>, 'data' | 'valueFormatter'> {\n type: 'threshold';\n y?: number;\n x?: T;\n valueFormatter?: CartesianChartProps.TickFormatter<number>;\n }\n\n export interface YThresholdSeries extends Omit<ThresholdSeries<never>, 'x'> {\n type: 'threshold';\n y: number;\n valueFormatter?: CartesianChartProps.TickFormatter<number>;\n }\n\n export interface XThresholdSeries<T> extends Omit<ThresholdSeries<T>, 'y' | 'valueFormatter'> {\n type: 'threshold';\n x: T;\n }\n\n export type DataSeries<T> = LineDataSeries<T> | BarDataSeries<T>;\n\n export type ChartSeries<T> = DataSeries<T> | ThresholdSeries<T>;\n\n export type FilterChangeDetail<T> = CartesianChartProps.FilterChangeDetail<ChartSeries<T>>;\n\n export type HighlightChangeDetail<T> = CartesianChartProps.HighlightChangeDetail<ChartSeries<T>>;\n\n export type TickFormatter<T> = CartesianChartProps.TickFormatter<T>;\n\n export type ValueFormatter<YType, XType = null> = CartesianChartProps.ValueFormatter<YType, XType>;\n\n export type I18nStrings<T> = CartesianChartProps.I18nStrings<T>;\n\n export interface DetailPopoverSeriesData<T> {\n series: ChartSeries<T>;\n x: T;\n y: number;\n }\n\n export interface DetailPopoverSeriesKeyValuePair {\n key: ReactNode;\n value: ReactNode;\n expandable?: boolean;\n subItems?: ReadonlyArray<{ key: ReactNode; value: ReactNode }>;\n }\n\n export interface DetailPopoverSeriesContent<T> {\n (data: DetailPopoverSeriesData<T>): DetailPopoverSeriesKeyValuePair;\n }\n}\n\nexport interface VerticalMarkerX<T> {\n scaledX: number;\n label: T | null;\n}\n"]}
|
|
@@ -3,6 +3,6 @@ import { ChartDataTypes, MixedLineBarChartProps } from './interfaces';
|
|
|
3
3
|
import { InternalBaseComponentProps } from '../internal/hooks/use-base-component';
|
|
4
4
|
import { SomeRequired } from '../internal/types';
|
|
5
5
|
type InternalMixedLineBarChartProps<T extends ChartDataTypes> = SomeRequired<MixedLineBarChartProps<T>, 'series' | 'height' | 'xScaleType' | 'yScaleType' | 'stackedBars' | 'horizontalBars' | 'statusType' | 'detailPopoverSize' | 'emphasizeBaselineAxis'> & InternalBaseComponentProps;
|
|
6
|
-
export default function InternalMixedLineBarChart<T extends number | string | Date>({ fitHeight, height, xScaleType, yScaleType, xDomain, yDomain, xTickFormatter, yTickFormatter, highlightedSeries: controlledHighlightedSeries, visibleSeries: controlledVisibleSeries, series: externalSeries, onFilterChange, onHighlightChange: controlledOnHighlightChange, i18nStrings, ariaLabel, ariaLabelledby, ariaDescription, xTitle, yTitle, stackedBars, horizontalBars, hideFilter, additionalFilters, hideLegend, legendTitle, statusType, detailPopoverSize, detailPopoverFooter, emphasizeBaselineAxis, empty, noMatch, errorText, loadingText, recoveryText, onRecoveryClick, __internalRootRef, ...props }: InternalMixedLineBarChartProps<T>): JSX.Element;
|
|
6
|
+
export default function InternalMixedLineBarChart<T extends number | string | Date>({ fitHeight, height, xScaleType, yScaleType, xDomain, yDomain, xTickFormatter, yTickFormatter, highlightedSeries: controlledHighlightedSeries, visibleSeries: controlledVisibleSeries, series: externalSeries, onFilterChange, onHighlightChange: controlledOnHighlightChange, i18nStrings, ariaLabel, ariaLabelledby, ariaDescription, xTitle, yTitle, stackedBars, horizontalBars, hideFilter, additionalFilters, hideLegend, legendTitle, statusType, detailPopoverSize, detailPopoverFooter, detailPopoverSeriesContent, emphasizeBaselineAxis, empty, noMatch, errorText, loadingText, recoveryText, onRecoveryClick, __internalRootRef, ...props }: InternalMixedLineBarChartProps<T>): JSX.Element;
|
|
7
7
|
export {};
|
|
8
8
|
//# sourceMappingURL=internal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"lib/default/","sources":["mixed-line-bar-chart/internal.tsx"],"names":[],"mappings":";AAYA,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAItE,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAKlF,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAMjD,KAAK,8BAA8B,CAAC,CAAC,SAAS,cAAc,IAAI,YAAY,CAC1E,sBAAsB,CAAC,CAAC,CAAC,EACvB,QAAQ,GACR,QAAQ,GACR,YAAY,GACZ,YAAY,GACZ,aAAa,GACb,gBAAgB,GAChB,YAAY,GACZ,mBAAmB,GACnB,uBAAuB,CAC1B,GACC,0BAA0B,CAAC;AAE7B,MAAM,CAAC,OAAO,UAAU,yBAAyB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,IAAI,EAAE,EAClF,SAAS,EACT,MAAM,EACN,UAAU,EACV,UAAU,EACV,OAAO,EACP,OAAO,EACP,cAAc,EACd,cAAc,EACd,iBAAiB,EAAE,2BAA2B,EAC9C,aAAa,EAAE,uBAAuB,EACtC,MAAM,EAAE,cAAc,EACtB,cAAc,EACd,iBAAiB,EAAE,2BAA2B,EAC9C,WAAW,EACX,SAAS,EACT,cAAc,EACd,eAAe,EACf,MAAM,EACN,MAAM,EACN,WAAW,EACX,cAAc,EACd,UAAU,EACV,iBAAiB,EACjB,UAAU,EACV,WAAW,EACX,UAAU,EACV,iBAAiB,EACjB,mBAAmB,EACnB,qBAAqB,EACrB,KAAK,EACL,OAAO,EACP,SAAS,EACT,WAAW,EACX,YAAY,EACZ,eAAe,EACf,iBAAwB,EACxB,GAAG,KAAK,EACT,EAAE,8BAA8B,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"lib/default/","sources":["mixed-line-bar-chart/internal.tsx"],"names":[],"mappings":";AAYA,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAItE,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAKlF,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAMjD,KAAK,8BAA8B,CAAC,CAAC,SAAS,cAAc,IAAI,YAAY,CAC1E,sBAAsB,CAAC,CAAC,CAAC,EACvB,QAAQ,GACR,QAAQ,GACR,YAAY,GACZ,YAAY,GACZ,aAAa,GACb,gBAAgB,GAChB,YAAY,GACZ,mBAAmB,GACnB,uBAAuB,CAC1B,GACC,0BAA0B,CAAC;AAE7B,MAAM,CAAC,OAAO,UAAU,yBAAyB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,IAAI,EAAE,EAClF,SAAS,EACT,MAAM,EACN,UAAU,EACV,UAAU,EACV,OAAO,EACP,OAAO,EACP,cAAc,EACd,cAAc,EACd,iBAAiB,EAAE,2BAA2B,EAC9C,aAAa,EAAE,uBAAuB,EACtC,MAAM,EAAE,cAAc,EACtB,cAAc,EACd,iBAAiB,EAAE,2BAA2B,EAC9C,WAAW,EACX,SAAS,EACT,cAAc,EACd,eAAe,EACf,MAAM,EACN,MAAM,EACN,WAAW,EACX,cAAc,EACd,UAAU,EACV,iBAAiB,EACjB,UAAU,EACV,WAAW,EACX,UAAU,EACV,iBAAiB,EACjB,mBAAmB,EACnB,0BAA0B,EAC1B,qBAAqB,EACrB,KAAK,EACL,OAAO,EACP,SAAS,EACT,WAAW,EACX,YAAY,EACZ,eAAe,EACf,iBAAwB,EACxB,GAAG,KAAK,EACT,EAAE,8BAA8B,CAAC,CAAC,CAAC,eA6NnC"}
|