@cloudscape-design/components 3.0.341 → 3.0.342
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/area-chart/chart-container.d.ts +3 -1
- package/area-chart/chart-container.d.ts.map +1 -1
- package/area-chart/chart-container.js +3 -2
- package/area-chart/chart-container.js.map +1 -1
- package/area-chart/internal.d.ts +1 -1
- package/area-chart/internal.d.ts.map +1 -1
- package/area-chart/internal.js +3 -2
- package/area-chart/internal.js.map +1 -1
- package/area-chart/model/index.d.ts +1 -0
- package/area-chart/model/index.d.ts.map +1 -1
- package/area-chart/model/index.js.map +1 -1
- package/area-chart/model/use-chart-model.d.ts +2 -1
- package/area-chart/model/use-chart-model.d.ts.map +1 -1
- package/area-chart/model/use-chart-model.js +8 -2
- package/area-chart/model/use-chart-model.js.map +1 -1
- package/internal/analytics/index.d.ts.map +1 -1
- package/internal/analytics/index.js +1 -0
- package/internal/analytics/index.js.map +1 -1
- package/internal/analytics/interfaces.d.ts +13 -2
- package/internal/analytics/interfaces.d.ts.map +1 -1
- package/internal/analytics/interfaces.js.map +1 -1
- package/internal/components/cartesian-chart/chart-container.d.ts +2 -0
- package/internal/components/cartesian-chart/chart-container.d.ts.map +1 -1
- package/internal/components/cartesian-chart/chart-container.js +16 -3
- package/internal/components/cartesian-chart/chart-container.js.map +1 -1
- package/internal/components/cartesian-chart/interfaces.d.ts +5 -0
- package/internal/components/cartesian-chart/interfaces.d.ts.map +1 -1
- package/internal/components/cartesian-chart/interfaces.js.map +1 -1
- package/internal/components/cartesian-chart/styles.css.js +27 -23
- package/internal/components/cartesian-chart/styles.scoped.css +54 -27
- package/internal/components/cartesian-chart/styles.selectors.js +27 -23
- package/internal/components/chart-plot/index.d.ts +2 -2
- package/internal/components/chart-plot/index.d.ts.map +1 -1
- package/internal/components/chart-plot/index.js +3 -1
- package/internal/components/chart-plot/index.js.map +1 -1
- package/internal/components/chart-wrapper/index.d.ts +1 -0
- package/internal/components/chart-wrapper/index.d.ts.map +1 -1
- package/internal/components/chart-wrapper/index.js +21 -6
- package/internal/components/chart-wrapper/index.js.map +1 -1
- package/internal/components/chart-wrapper/styles.css.js +9 -6
- package/internal/components/chart-wrapper/styles.scoped.css +20 -6
- package/internal/components/chart-wrapper/styles.selectors.js +9 -6
- package/internal/environment.js +1 -1
- package/internal/manifest.json +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 +8 -2
- package/mixed-line-bar-chart/chart-container.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 +3 -3
- package/mixed-line-bar-chart/internal.js.map +1 -1
- package/package.json +1 -1
- package/pie-chart/index.d.ts +1 -1
- package/pie-chart/index.d.ts.map +1 -1
- package/pie-chart/index.js +10 -3
- package/pie-chart/index.js.map +1 -1
- package/pie-chart/interfaces.d.ts +5 -0
- package/pie-chart/interfaces.d.ts.map +1 -1
- package/pie-chart/interfaces.js.map +1 -1
- package/pie-chart/labels.d.ts +3 -2
- package/pie-chart/labels.d.ts.map +1 -1
- package/pie-chart/labels.js +4 -4
- package/pie-chart/labels.js.map +1 -1
- package/pie-chart/pie-chart.d.ts +2 -1
- package/pie-chart/pie-chart.d.ts.map +1 -1
- package/pie-chart/pie-chart.js +18 -14
- package/pie-chart/pie-chart.js.map +1 -1
- package/pie-chart/segments.d.ts +3 -2
- package/pie-chart/segments.d.ts.map +1 -1
- package/pie-chart/segments.js +2 -6
- package/pie-chart/segments.js.map +1 -1
- package/pie-chart/styles.css.js +27 -23
- package/pie-chart/styles.scoped.css +58 -38
- package/pie-chart/styles.selectors.js +27 -23
- package/pie-chart/utils.d.ts +12 -2
- package/pie-chart/utils.d.ts.map +1 -1
- package/pie-chart/utils.js +37 -9
- package/pie-chart/utils.js.map +1 -1
|
@@ -2,12 +2,25 @@
|
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
import React, { forwardRef } from 'react';
|
|
4
4
|
import styles from './styles.css.js';
|
|
5
|
-
|
|
5
|
+
import clsx from 'clsx';
|
|
6
|
+
const CONTENT_MIN_HEIGHT_BOUNDARY = 40;
|
|
7
|
+
export const CartesianChartContainer = forwardRef(({ minHeight, fitHeight, leftAxisLabel, leftAxisLabelMeasure, bottomAxisLabel, chartPlot, popover, }, ref) => {
|
|
8
|
+
if (fitHeight) {
|
|
9
|
+
return (React.createElement("div", { className: clsx(styles['chart-container'], styles['fit-height']), ref: ref },
|
|
10
|
+
leftAxisLabel,
|
|
11
|
+
React.createElement("div", { className: clsx(styles['chart-container-outer'], styles['fit-height']) },
|
|
12
|
+
leftAxisLabelMeasure,
|
|
13
|
+
React.createElement("div", { className: styles['chart-container-inner'] },
|
|
14
|
+
React.createElement("div", { className: clsx(styles['chart-container-plot-wrapper'], styles['fit-height']), style: { minHeight: Math.max(minHeight, CONTENT_MIN_HEIGHT_BOUNDARY) } },
|
|
15
|
+
React.createElement("div", { className: clsx(styles['chart-container-plot'], styles['fit-height']) }, chartPlot)),
|
|
16
|
+
React.createElement("div", { className: clsx(styles['chart-container-bottom-labels'], styles['fit-height']) }, bottomAxisLabel)),
|
|
17
|
+
popover)));
|
|
18
|
+
}
|
|
6
19
|
return (React.createElement("div", { className: styles['chart-container'], ref: ref },
|
|
7
20
|
leftAxisLabel,
|
|
8
|
-
React.createElement("div", { className: styles['chart-
|
|
21
|
+
React.createElement("div", { className: styles['chart-container-outer'] },
|
|
9
22
|
leftAxisLabelMeasure,
|
|
10
|
-
React.createElement("div", { className: styles['chart-
|
|
23
|
+
React.createElement("div", { className: styles['chart-container-inner'] },
|
|
11
24
|
chartPlot,
|
|
12
25
|
bottomAxisLabel),
|
|
13
26
|
popover)));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chart-container.js","sourceRoot":"lib/default/","sources":["internal/components/cartesian-chart/chart-container.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,MAAM,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"chart-container.js","sourceRoot":"lib/default/","sources":["internal/components/cartesian-chart/chart-container.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,IAAI,MAAM,MAAM,CAAC;AAYxB,MAAM,2BAA2B,GAAG,EAAE,CAAC;AAEvC,MAAM,CAAC,MAAM,uBAAuB,GAAG,UAAU,CAC/C,CACE,EACE,SAAS,EACT,SAAS,EACT,aAAa,EACb,oBAAoB,EACpB,eAAe,EACf,SAAS,EACT,OAAO,GACsB,EAC/B,GAA8B,EAC9B,EAAE;IACF,IAAI,SAAS,EAAE;QACb,OAAO,CACL,6BAAK,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG;YAC5E,aAAa;YAEd,6BAAK,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,uBAAuB,CAAC,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC;gBACxE,oBAAoB;gBAErB,6BAAK,SAAS,EAAE,MAAM,CAAC,uBAAuB,CAAC;oBAC7C,6BACE,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,8BAA8B,CAAC,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC,EAC7E,KAAK,EAAE,EAAE,SAAS,EAAE,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,2BAA2B,CAAC,EAAE;wBAEtE,6BAAK,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,sBAAsB,CAAC,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC,IAAG,SAAS,CAAO,CACzF;oBAEN,6BAAK,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,+BAA+B,CAAC,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC,IAChF,eAAe,CACZ,CACF;gBAEL,OAAO,CACJ,CACF,CACP,CAAC;KACH;IAED,OAAO,CACL,6BAAK,SAAS,EAAE,MAAM,CAAC,iBAAiB,CAAC,EAAE,GAAG,EAAE,GAAG;QAChD,aAAa;QAEd,6BAAK,SAAS,EAAE,MAAM,CAAC,uBAAuB,CAAC;YAC5C,oBAAoB;YAErB,6BAAK,SAAS,EAAE,MAAM,CAAC,uBAAuB,CAAC;gBAC5C,SAAS;gBACT,eAAe,CACZ;YAEL,OAAO,CACJ,CACF,CACP,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React, { forwardRef } from 'react';\nimport styles from './styles.css.js';\nimport clsx from 'clsx';\n\ninterface CartesianChartContainerProps {\n minHeight: number;\n fitHeight: boolean;\n leftAxisLabel: React.ReactNode;\n leftAxisLabelMeasure: React.ReactNode;\n bottomAxisLabel: React.ReactNode;\n chartPlot: React.ReactNode;\n popover: React.ReactNode;\n}\n\nconst CONTENT_MIN_HEIGHT_BOUNDARY = 40;\n\nexport const CartesianChartContainer = forwardRef(\n (\n {\n minHeight,\n fitHeight,\n leftAxisLabel,\n leftAxisLabelMeasure,\n bottomAxisLabel,\n chartPlot,\n popover,\n }: CartesianChartContainerProps,\n ref: React.Ref<HTMLDivElement>\n ) => {\n if (fitHeight) {\n return (\n <div className={clsx(styles['chart-container'], styles['fit-height'])} ref={ref}>\n {leftAxisLabel}\n\n <div className={clsx(styles['chart-container-outer'], styles['fit-height'])}>\n {leftAxisLabelMeasure}\n\n <div className={styles['chart-container-inner']}>\n <div\n className={clsx(styles['chart-container-plot-wrapper'], styles['fit-height'])}\n style={{ minHeight: Math.max(minHeight, CONTENT_MIN_HEIGHT_BOUNDARY) }}\n >\n <div className={clsx(styles['chart-container-plot'], styles['fit-height'])}>{chartPlot}</div>\n </div>\n\n <div className={clsx(styles['chart-container-bottom-labels'], styles['fit-height'])}>\n {bottomAxisLabel}\n </div>\n </div>\n\n {popover}\n </div>\n </div>\n );\n }\n\n return (\n <div className={styles['chart-container']} ref={ref}>\n {leftAxisLabel}\n\n <div className={styles['chart-container-outer']}>\n {leftAxisLabelMeasure}\n\n <div className={styles['chart-container-inner']}>\n {chartPlot}\n {bottomAxisLabel}\n </div>\n\n {popover}\n </div>\n </div>\n );\n }\n);\n"]}
|
|
@@ -71,6 +71,7 @@ export interface CartesianChartProps<T extends ChartDataTypes, Series> extends B
|
|
|
71
71
|
/**
|
|
72
72
|
* An optional pixel value number that fixes the height of the chart area.
|
|
73
73
|
* If not set explicitly, the component will use a default height that is defined internally.
|
|
74
|
+
* When used with `fitHeight`, this property defines the minimum height of the chart area.
|
|
74
75
|
*/
|
|
75
76
|
height?: number;
|
|
76
77
|
/**
|
|
@@ -155,6 +156,10 @@ export interface CartesianChartProps<T extends ChartDataTypes, Series> extends B
|
|
|
155
156
|
* Called when the highlighted series has changed because of user interaction.
|
|
156
157
|
*/
|
|
157
158
|
onHighlightChange?: NonCancelableEventHandler<CartesianChartProps.HighlightChangeDetail<Series>>;
|
|
159
|
+
/**
|
|
160
|
+
* Enable this property to make the chart fit into the available height of the parent container.
|
|
161
|
+
*/
|
|
162
|
+
fitHeight?: boolean;
|
|
158
163
|
}
|
|
159
164
|
export declare namespace CartesianChartProps {
|
|
160
165
|
interface FilterChangeDetail<Series> {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"lib/default/","sources":["internal/components/cartesian-chart/interfaces.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,yB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MAAM,MAAM,OAAO,CAAC,CAAC,SAAS,cAAc,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC;AAC/D,MAAM,MAAM,OAAO,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"lib/default/","sources":["internal/components/cartesian-chart/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { BaseComponentProps } from '../../base-component';\nimport { NonCancelableEventHandler } from '../../events';\n\nexport interface CartesianChartProps<T extends ChartDataTypes, Series> extends BaseComponentProps {\n /**\n * Determines the type of scale for values on the x axis.\n */\n xScaleType?: ScaleType;\n\n /**\n * Determines the type of scale for values on the y axis.\n */\n yScaleType?: 'linear' | 'log';\n\n /**\n * Determines the domain of the x axis, i.e. the range of values that will be visible in the chart.\n * For numerical and time-based data this is represented as an array with two values: `[minimumValue, maximumValue]`.\n * For categorical data this is represented as an array of strings that determine the categories to display.\n *\n * It is recommended to set this explicitly. If not, the component will determine a domain that fits all data points.\n * When controlling this directly, make sure to update the value based on filtering changes.\n */\n xDomain?: T extends unknown ? ReadonlyArray<T> : ReadonlyArray<T>;\n\n /**\n * Determines the domain of the y axis, i.e. the range of values that will be visible in the chart.\n * The domain is defined by a tuple: `[minimumValue, maximumValue]`.\n *\n * It is recommended to set this explicitly. If not, the component will determine a domain that fits all data points.\n * When controlling this directly, make sure to update the value based on filtering changes.\n */\n yDomain?: ReadonlyArray<number>;\n\n /**\n * The title of the x axis.\n */\n xTitle?: string;\n\n /**\n * The title of the y axis.\n */\n yTitle?: string;\n\n /**\n * Optional title for the legend.\n */\n legendTitle?: string;\n\n /**\n * ARIA label that is assigned to the chart itself. It should match the visible label on the page, e.g. in the container header.\n * Do not use `ariaLabel` and `ariaLabelledby` at the same time.\n */\n ariaLabel?: string;\n\n /**\n * Sets `aria-labelledby` on the chart itself.\n * If there is a visible label for the chart on the page, e.g. in the container header, set this property to the ID of that header element.\n * Do not use `ariaLabel` and `ariaLabelledby` at the same time.\n */\n ariaLabelledby?: string;\n\n /**\n * A description of the chart that assistive technologies can use (through `aria-describedby`).\n * Provide a concise summary of the data visualized in the chart.\n */\n ariaDescription?: string;\n\n /**\n * An object containing all the necessary localized strings required by the component.\n * @i18n\n */\n i18nStrings?: CartesianChartProps.I18nStrings<T>;\n\n /**\n * Function to format the displayed label of an x axis tick.\n */\n xTickFormatter?: CartesianChartProps.TickFormatter<T>;\n\n /**\n * Function to format the displayed label of a y axis tick.\n */\n yTickFormatter?: CartesianChartProps.TickFormatter<number>;\n\n /**\n * An optional pixel value number that fixes the height of the chart area.\n * If not set explicitly, the component will use a default height that is defined internally.\n */\n height?: number;\n\n /**\n * Determines the maximum width the detail popover will be limited to.\n */\n detailPopoverSize?: 'small' | 'medium' | 'large';\n\n /**\n * Additional content that is displayed at the bottom of the detail popover.\n */\n detailPopoverFooter?: CartesianChartProps.DetailPopoverFooter<T>;\n\n /**\n * When set to `true`, the legend beneath the chart is not displayed.\n * It is highly recommended to keep this set to `false`.\n */\n hideLegend?: boolean;\n\n /**\n * When set to `true`, the default filtering dropdown is not displayed.\n * It is still possible to render additional filters with the `additionalFilters` slot.\n */\n hideFilter?: boolean;\n\n /**\n * Additional filters that are added above the chart component.\n * Make sure to update the `data` property when any of your custom filters change the data to be displayed.\n */\n additionalFilters?: React.ReactNode;\n\n /**\n * The currently highlighted data series, usually through hovering over a series or the legend.\n * A value of `null` means no series is highlighted.\n *\n * - If you do not set this property, series are highlighted automatically when hovering over one of the triggers (uncontrolled behavior).\n * - If you explicitly set this property, you must set an `onHighlightChange` listener to update this property when a series should be highlighted (controlled behavior).\n */\n highlightedSeries?: Series | null;\n\n /**\n * An array of series objects that determines which of the data series are currently displayed, i.e. not filtered out.\n * - If you do not set this property, series are shown and hidden automatically when using the default filter component (uncontrolled behavior).\n * - If you explicitly set this property, you must set an `onFilterChange` listener to update this property when the visible series should change, or when one of your custom filters changes the number of visible series (controlled behavior).\n */\n visibleSeries?: ReadonlyArray<Series>;\n\n /**\n * Specifies the current status of loading data.\n * * `loading`: data fetching is in progress.\n * * `finished`: data has loaded successfully.\n * * `error`: an error occurred during fetch. You should provide user an option to recover.\n **/\n statusType?: 'loading' | 'finished' | 'error';\n\n /**\n * Content that is displayed when the data passed to the component is empty.\n */\n empty?: React.ReactNode;\n\n /**\n * Content that is displayed when there is no data to display due to the built-in filtering.\n */\n noMatch?: React.ReactNode;\n\n /**\n * Text that is displayed when the chart is loading, i.e. when `statusType` is set to `\"loading\"`.\n * @i18n\n */\n loadingText?: string;\n\n /**\n * Text that is displayed when the chart is in error state, i.e. when `statusType` is set to `\"error\"`.\n * @i18n\n */\n errorText?: string;\n\n /**\n * Text for the recovery button that is displayed next to the error text.\n * @i18n\n **/\n recoveryText?: string;\n\n /**\n * Called when the user clicks the recovery button that appears when there is an error state.\n * Use this to enable the user to retry a failed request or provide another option for the user\n * to recover from the error.\n */\n onRecoveryClick?: NonCancelableEventHandler;\n\n /**\n * Called when the values of the internal filter component changed.\n * This will **not** be called for any custom filter components you have defined in `additionalFilters`.\n */\n onFilterChange?: NonCancelableEventHandler<CartesianChartProps.FilterChangeDetail<Series>>;\n\n /**\n * Called when the highlighted series has changed because of user interaction.\n */\n onHighlightChange?: NonCancelableEventHandler<CartesianChartProps.HighlightChangeDetail<Series>>;\n}\n\nexport namespace CartesianChartProps {\n export interface FilterChangeDetail<Series> {\n visibleSeries: ReadonlyArray<Series>;\n }\n\n export interface HighlightChangeDetail<Series> {\n highlightedSeries: Series | null;\n }\n\n export interface TickFormatter<T> {\n (value: T): string;\n }\n\n export interface ValueFormatter<YType, XType = null> {\n (yValue: YType, xValue: XType): string;\n }\n\n export interface DetailPopoverFooter<T> {\n (xValue: T): React.ReactNode;\n }\n\n export interface I18nStrings<T> {\n /** Visible label of the default filter */\n filterLabel?: string;\n\n /** Placeholder text of the default filter */\n filterPlaceholder?: string;\n\n /** ARIA label for the default filter which is appended to any option that is selected */\n filterSelectedAriaLabel?: string;\n\n /** ARIA label that is associated with the legend in case there is no visible `legendTitle` defined */\n legendAriaLabel?: string;\n\n /** ARIA label for details popover dismiss button */\n detailPopoverDismissAriaLabel?: string;\n\n /** Name of the ARIA role description of the chart, e.g. \"line chart\" */\n chartAriaRoleDescription?: string;\n\n /** Name of the ARIA role description of the x axis, e.g. \"x axis\" */\n xAxisAriaRoleDescription?: string;\n\n /** Name of the ARIA role description of the y axis, e.g. \"y axis\" */\n yAxisAriaRoleDescription?: string;\n\n /** @deprecated Use `xTickFormatter` on the component instead. */\n xTickFormatter?: TickFormatter<T>;\n\n /** @deprecated Use `yTickFormatter` on the component instead. */\n yTickFormatter?: TickFormatter<number>;\n }\n}\n\nexport type ChartDataTypes = number | string | Date;\n\nexport type ScaleType = 'linear' | 'log' | 'time' | 'categorical';\nexport type XScaleType = 'linear' | 'log' | 'time' | 'categorical';\nexport type YScaleType = 'linear' | 'log';\nexport type ScaleRange = [number, number];\n\nexport type ChartDomain<T extends ChartDataTypes> = T extends unknown ? ReadonlyArray<T> : ReadonlyArray<T>;\nexport type XDomain<T extends ChartDataTypes> = ChartDomain<T>;\nexport type YDomain = ChartDomain<number>;\n"]}
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"lib/default/","sources":["internal/components/cartesian-chart/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { BaseComponentProps } from '../../base-component';\nimport { NonCancelableEventHandler } from '../../events';\n\nexport interface CartesianChartProps<T extends ChartDataTypes, Series> extends BaseComponentProps {\n /**\n * Determines the type of scale for values on the x axis.\n */\n xScaleType?: ScaleType;\n\n /**\n * Determines the type of scale for values on the y axis.\n */\n yScaleType?: 'linear' | 'log';\n\n /**\n * Determines the domain of the x axis, i.e. the range of values that will be visible in the chart.\n * For numerical and time-based data this is represented as an array with two values: `[minimumValue, maximumValue]`.\n * For categorical data this is represented as an array of strings that determine the categories to display.\n *\n * It is recommended to set this explicitly. If not, the component will determine a domain that fits all data points.\n * When controlling this directly, make sure to update the value based on filtering changes.\n */\n xDomain?: T extends unknown ? ReadonlyArray<T> : ReadonlyArray<T>;\n\n /**\n * Determines the domain of the y axis, i.e. the range of values that will be visible in the chart.\n * The domain is defined by a tuple: `[minimumValue, maximumValue]`.\n *\n * It is recommended to set this explicitly. If not, the component will determine a domain that fits all data points.\n * When controlling this directly, make sure to update the value based on filtering changes.\n */\n yDomain?: ReadonlyArray<number>;\n\n /**\n * The title of the x axis.\n */\n xTitle?: string;\n\n /**\n * The title of the y axis.\n */\n yTitle?: string;\n\n /**\n * Optional title for the legend.\n */\n legendTitle?: string;\n\n /**\n * ARIA label that is assigned to the chart itself. It should match the visible label on the page, e.g. in the container header.\n * Do not use `ariaLabel` and `ariaLabelledby` at the same time.\n */\n ariaLabel?: string;\n\n /**\n * Sets `aria-labelledby` on the chart itself.\n * If there is a visible label for the chart on the page, e.g. in the container header, set this property to the ID of that header element.\n * Do not use `ariaLabel` and `ariaLabelledby` at the same time.\n */\n ariaLabelledby?: string;\n\n /**\n * A description of the chart that assistive technologies can use (through `aria-describedby`).\n * Provide a concise summary of the data visualized in the chart.\n */\n ariaDescription?: string;\n\n /**\n * An object containing all the necessary localized strings required by the component.\n * @i18n\n */\n i18nStrings?: CartesianChartProps.I18nStrings<T>;\n\n /**\n * Function to format the displayed label of an x axis tick.\n */\n xTickFormatter?: CartesianChartProps.TickFormatter<T>;\n\n /**\n * Function to format the displayed label of a y axis tick.\n */\n yTickFormatter?: CartesianChartProps.TickFormatter<number>;\n\n /**\n * An optional pixel value number that fixes the height of the chart area.\n * If not set explicitly, the component will use a default height that is defined internally.\n * When used with `fitHeight`, this property defines the minimum height of the chart area.\n */\n height?: number;\n\n /**\n * Determines the maximum width the detail popover will be limited to.\n */\n detailPopoverSize?: 'small' | 'medium' | 'large';\n\n /**\n * Additional content that is displayed at the bottom of the detail popover.\n */\n detailPopoverFooter?: CartesianChartProps.DetailPopoverFooter<T>;\n\n /**\n * When set to `true`, the legend beneath the chart is not displayed.\n * It is highly recommended to keep this set to `false`.\n */\n hideLegend?: boolean;\n\n /**\n * When set to `true`, the default filtering dropdown is not displayed.\n * It is still possible to render additional filters with the `additionalFilters` slot.\n */\n hideFilter?: boolean;\n\n /**\n * Additional filters that are added above the chart component.\n * Make sure to update the `data` property when any of your custom filters change the data to be displayed.\n */\n additionalFilters?: React.ReactNode;\n\n /**\n * The currently highlighted data series, usually through hovering over a series or the legend.\n * A value of `null` means no series is highlighted.\n *\n * - If you do not set this property, series are highlighted automatically when hovering over one of the triggers (uncontrolled behavior).\n * - If you explicitly set this property, you must set an `onHighlightChange` listener to update this property when a series should be highlighted (controlled behavior).\n */\n highlightedSeries?: Series | null;\n\n /**\n * An array of series objects that determines which of the data series are currently displayed, i.e. not filtered out.\n * - If you do not set this property, series are shown and hidden automatically when using the default filter component (uncontrolled behavior).\n * - If you explicitly set this property, you must set an `onFilterChange` listener to update this property when the visible series should change, or when one of your custom filters changes the number of visible series (controlled behavior).\n */\n visibleSeries?: ReadonlyArray<Series>;\n\n /**\n * Specifies the current status of loading data.\n * * `loading`: data fetching is in progress.\n * * `finished`: data has loaded successfully.\n * * `error`: an error occurred during fetch. You should provide user an option to recover.\n **/\n statusType?: 'loading' | 'finished' | 'error';\n\n /**\n * Content that is displayed when the data passed to the component is empty.\n */\n empty?: React.ReactNode;\n\n /**\n * Content that is displayed when there is no data to display due to the built-in filtering.\n */\n noMatch?: React.ReactNode;\n\n /**\n * Text that is displayed when the chart is loading, i.e. when `statusType` is set to `\"loading\"`.\n * @i18n\n */\n loadingText?: string;\n\n /**\n * Text that is displayed when the chart is in error state, i.e. when `statusType` is set to `\"error\"`.\n * @i18n\n */\n errorText?: string;\n\n /**\n * Text for the recovery button that is displayed next to the error text.\n * @i18n\n **/\n recoveryText?: string;\n\n /**\n * Called when the user clicks the recovery button that appears when there is an error state.\n * Use this to enable the user to retry a failed request or provide another option for the user\n * to recover from the error.\n */\n onRecoveryClick?: NonCancelableEventHandler;\n\n /**\n * Called when the values of the internal filter component changed.\n * This will **not** be called for any custom filter components you have defined in `additionalFilters`.\n */\n onFilterChange?: NonCancelableEventHandler<CartesianChartProps.FilterChangeDetail<Series>>;\n\n /**\n * Called when the highlighted series has changed because of user interaction.\n */\n onHighlightChange?: NonCancelableEventHandler<CartesianChartProps.HighlightChangeDetail<Series>>;\n\n /**\n * Enable this property to make the chart fit into the available height of the parent container.\n */\n fitHeight?: boolean;\n}\n\nexport namespace CartesianChartProps {\n export interface FilterChangeDetail<Series> {\n visibleSeries: ReadonlyArray<Series>;\n }\n\n export interface HighlightChangeDetail<Series> {\n highlightedSeries: Series | null;\n }\n\n export interface TickFormatter<T> {\n (value: T): string;\n }\n\n export interface ValueFormatter<YType, XType = null> {\n (yValue: YType, xValue: XType): string;\n }\n\n export interface DetailPopoverFooter<T> {\n (xValue: T): React.ReactNode;\n }\n\n export interface I18nStrings<T> {\n /** Visible label of the default filter */\n filterLabel?: string;\n\n /** Placeholder text of the default filter */\n filterPlaceholder?: string;\n\n /** ARIA label for the default filter which is appended to any option that is selected */\n filterSelectedAriaLabel?: string;\n\n /** ARIA label that is associated with the legend in case there is no visible `legendTitle` defined */\n legendAriaLabel?: string;\n\n /** ARIA label for details popover dismiss button */\n detailPopoverDismissAriaLabel?: string;\n\n /** Name of the ARIA role description of the chart, e.g. \"line chart\" */\n chartAriaRoleDescription?: string;\n\n /** Name of the ARIA role description of the x axis, e.g. \"x axis\" */\n xAxisAriaRoleDescription?: string;\n\n /** Name of the ARIA role description of the y axis, e.g. \"y axis\" */\n yAxisAriaRoleDescription?: string;\n\n /** @deprecated Use `xTickFormatter` on the component instead. */\n xTickFormatter?: TickFormatter<T>;\n\n /** @deprecated Use `yTickFormatter` on the component instead. */\n yTickFormatter?: TickFormatter<number>;\n }\n}\n\nexport type ChartDataTypes = number | string | Date;\n\nexport type ScaleType = 'linear' | 'log' | 'time' | 'categorical';\nexport type XScaleType = 'linear' | 'log' | 'time' | 'categorical';\nexport type YScaleType = 'linear' | 'log';\nexport type ScaleRange = [number, number];\n\nexport type ChartDomain<T extends ChartDataTypes> = T extends unknown ? ReadonlyArray<T> : ReadonlyArray<T>;\nexport type XDomain<T extends ChartDataTypes> = ChartDomain<T>;\nexport type YDomain = ChartDomain<number>;\n"]}
|
|
@@ -1,28 +1,32 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"axis": "
|
|
5
|
-
"vertical-marker": "awsui_vertical-
|
|
6
|
-
"axis--emphasized": "awsui_axis--
|
|
7
|
-
"axis-label": "awsui_axis-
|
|
8
|
-
"axis-label--x": "awsui_axis-label--
|
|
9
|
-
"axis-label--y": "awsui_axis-label--
|
|
10
|
-
"grid": "
|
|
11
|
-
"ticks__line": "
|
|
12
|
-
"ticks__text": "
|
|
13
|
-
"ticks--y": "awsui_ticks--
|
|
14
|
-
"ticks--x": "awsui_ticks--
|
|
15
|
-
"ticks--bottom": "awsui_ticks--
|
|
16
|
-
"labels-left": "awsui_labels-
|
|
17
|
-
"ticks": "
|
|
18
|
-
"labels-left__label": "awsui_labels-
|
|
19
|
-
"labels-left--hidden": "awsui_labels-left--
|
|
20
|
-
"labels-bottom": "awsui_labels-
|
|
21
|
-
"vertical-marker-circle": "awsui_vertical-marker-
|
|
22
|
-
"vertical-marker-circle-active": "awsui_vertical-marker-circle-
|
|
23
|
-
"focus-outline": "awsui_focus-
|
|
24
|
-
"chart-container": "awsui_chart-
|
|
25
|
-
"
|
|
26
|
-
"chart-
|
|
4
|
+
"axis": "awsui_axis_f0fot_1xwwo_9",
|
|
5
|
+
"vertical-marker": "awsui_vertical-marker_f0fot_1xwwo_10",
|
|
6
|
+
"axis--emphasized": "awsui_axis--emphasized_f0fot_1xwwo_15",
|
|
7
|
+
"axis-label": "awsui_axis-label_f0fot_1xwwo_19",
|
|
8
|
+
"axis-label--x": "awsui_axis-label--x_f0fot_1xwwo_24",
|
|
9
|
+
"axis-label--y": "awsui_axis-label--y_f0fot_1xwwo_25",
|
|
10
|
+
"grid": "awsui_grid_f0fot_1xwwo_29",
|
|
11
|
+
"ticks__line": "awsui_ticks__line_f0fot_1xwwo_34",
|
|
12
|
+
"ticks__text": "awsui_ticks__text_f0fot_1xwwo_39",
|
|
13
|
+
"ticks--y": "awsui_ticks--y_f0fot_1xwwo_44",
|
|
14
|
+
"ticks--x": "awsui_ticks--x_f0fot_1xwwo_45",
|
|
15
|
+
"ticks--bottom": "awsui_ticks--bottom_f0fot_1xwwo_49",
|
|
16
|
+
"labels-left": "awsui_labels-left_f0fot_1xwwo_54",
|
|
17
|
+
"ticks": "awsui_ticks_f0fot_1xwwo_34",
|
|
18
|
+
"labels-left__label": "awsui_labels-left__label_f0fot_1xwwo_69",
|
|
19
|
+
"labels-left--hidden": "awsui_labels-left--hidden_f0fot_1xwwo_73",
|
|
20
|
+
"labels-bottom": "awsui_labels-bottom_f0fot_1xwwo_81",
|
|
21
|
+
"vertical-marker-circle": "awsui_vertical-marker-circle_f0fot_1xwwo_92",
|
|
22
|
+
"vertical-marker-circle-active": "awsui_vertical-marker-circle-active_f0fot_1xwwo_98",
|
|
23
|
+
"focus-outline": "awsui_focus-outline_f0fot_1xwwo_103",
|
|
24
|
+
"chart-container": "awsui_chart-container_f0fot_1xwwo_111",
|
|
25
|
+
"fit-height": "awsui_fit-height_f0fot_1xwwo_116",
|
|
26
|
+
"chart-container-outer": "awsui_chart-container-outer_f0fot_1xwwo_121",
|
|
27
|
+
"chart-container-inner": "awsui_chart-container-inner_f0fot_1xwwo_128",
|
|
28
|
+
"chart-container-plot-wrapper": "awsui_chart-container-plot-wrapper_f0fot_1xwwo_135",
|
|
29
|
+
"chart-container-plot": "awsui_chart-container-plot_f0fot_1xwwo_135",
|
|
30
|
+
"chart-container-bottom-labels": "awsui_chart-container-bottom-labels_f0fot_1xwwo_150"
|
|
27
31
|
};
|
|
28
32
|
|
|
@@ -6,101 +6,101 @@
|
|
|
6
6
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
7
7
|
SPDX-License-Identifier: Apache-2.0
|
|
8
8
|
*/
|
|
9
|
-
.
|
|
10
|
-
.awsui_vertical-
|
|
9
|
+
.awsui_axis_f0fot_1xwwo_9:not(#\9),
|
|
10
|
+
.awsui_vertical-marker_f0fot_1xwwo_10:not(#\9) {
|
|
11
11
|
stroke: var(--color-charts-line-axis-j3qg2k, #d1d5db);
|
|
12
12
|
stroke-width: 1px;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
.awsui_axis--
|
|
15
|
+
.awsui_axis--emphasized_f0fot_1xwwo_15:not(#\9) {
|
|
16
16
|
stroke-width: 2px;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
.awsui_axis-
|
|
19
|
+
.awsui_axis-label_f0fot_1xwwo_19:not(#\9) {
|
|
20
20
|
font-weight: bold;
|
|
21
21
|
fill: var(--color-text-body-default-su7kuo, #000716);
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
.awsui_axis-label--
|
|
25
|
-
.awsui_axis-label--
|
|
24
|
+
.awsui_axis-label--x_f0fot_1xwwo_24:not(#\9),
|
|
25
|
+
.awsui_axis-label--y_f0fot_1xwwo_25:not(#\9) {
|
|
26
26
|
/* used in test-utils */
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
.
|
|
29
|
+
.awsui_grid_f0fot_1xwwo_29:not(#\9) {
|
|
30
30
|
stroke: var(--color-charts-line-grid-mz4lye, #d1d5db);
|
|
31
31
|
stroke-width: 1px;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
.
|
|
34
|
+
.awsui_ticks__line_f0fot_1xwwo_34:not(#\9) {
|
|
35
35
|
stroke: var(--color-charts-line-tick-arwxlx, #d1d5db);
|
|
36
36
|
stroke-width: 1px;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
.
|
|
39
|
+
.awsui_ticks__text_f0fot_1xwwo_39:not(#\9) {
|
|
40
40
|
font-size: var(--font-chart-detail-size-gtiv3j, 12px);
|
|
41
41
|
fill: var(--color-text-body-secondary-he5d85, #414d5c);
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
.awsui_ticks--
|
|
45
|
-
.awsui_ticks--
|
|
44
|
+
.awsui_ticks--y_f0fot_1xwwo_44:not(#\9),
|
|
45
|
+
.awsui_ticks--x_f0fot_1xwwo_45:not(#\9) {
|
|
46
46
|
/* used in test-utils */
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
.awsui_ticks--
|
|
49
|
+
.awsui_ticks--bottom_f0fot_1xwwo_49 > .awsui_ticks__text_f0fot_1xwwo_39:not(#\9) {
|
|
50
50
|
text-anchor: middle;
|
|
51
51
|
dominant-baseline: hanging;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
.awsui_labels-
|
|
54
|
+
.awsui_labels-left_f0fot_1xwwo_54 > .awsui_ticks_f0fot_1xwwo_34 > .awsui_ticks__text_f0fot_1xwwo_39:not(#\9) {
|
|
55
55
|
text-anchor: end;
|
|
56
56
|
dominant-baseline: central;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
.awsui_labels-
|
|
59
|
+
.awsui_labels-left_f0fot_1xwwo_54:not(#\9) {
|
|
60
60
|
position: relative;
|
|
61
61
|
margin-right: 12px;
|
|
62
62
|
}
|
|
63
|
-
.awsui_labels-
|
|
63
|
+
.awsui_labels-left_f0fot_1xwwo_54 > .awsui_axis-label_f0fot_1xwwo_19:not(#\9) {
|
|
64
64
|
position: absolute;
|
|
65
65
|
visibility: visible;
|
|
66
66
|
white-space: nowrap;
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
.awsui_labels-
|
|
69
|
+
.awsui_labels-left__label_f0fot_1xwwo_69:not(#\9) {
|
|
70
70
|
position: absolute;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
.awsui_labels-left--
|
|
73
|
+
.awsui_labels-left--hidden_f0fot_1xwwo_73:not(#\9) {
|
|
74
74
|
visibility: hidden;
|
|
75
75
|
}
|
|
76
|
-
.awsui_labels-left--
|
|
76
|
+
.awsui_labels-left--hidden_f0fot_1xwwo_73 > .awsui_labels-left__label_f0fot_1xwwo_69:not(#\9) {
|
|
77
77
|
position: relative;
|
|
78
78
|
white-space: nowrap;
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
.awsui_labels-
|
|
81
|
+
.awsui_labels-bottom_f0fot_1xwwo_81:not(#\9) {
|
|
82
82
|
position: relative;
|
|
83
83
|
display: block;
|
|
84
84
|
width: 100%;
|
|
85
85
|
overflow: visible;
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
-
.awsui_vertical-
|
|
88
|
+
.awsui_vertical-marker_f0fot_1xwwo_10:not(#\9) {
|
|
89
89
|
pointer-events: none;
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
-
.awsui_vertical-marker-
|
|
92
|
+
.awsui_vertical-marker-circle_f0fot_1xwwo_92:not(#\9) {
|
|
93
93
|
fill: var(--color-background-container-content-og3y0v, #ffffff);
|
|
94
94
|
pointer-events: none;
|
|
95
95
|
stroke-width: var(--border-line-chart-width-qfyiov, 2px);
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
.awsui_vertical-marker-circle-
|
|
98
|
+
.awsui_vertical-marker-circle-active_f0fot_1xwwo_98:not(#\9) {
|
|
99
99
|
cursor: pointer;
|
|
100
100
|
stroke-width: var(--border-line-chart-width-qfyiov, 2px);
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
.awsui_focus-
|
|
103
|
+
.awsui_focus-outline_f0fot_1xwwo_103:not(#\9) {
|
|
104
104
|
outline: none;
|
|
105
105
|
pointer-events: none;
|
|
106
106
|
fill: none;
|
|
@@ -108,18 +108,45 @@
|
|
|
108
108
|
stroke-width: 2px;
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
-
.awsui_chart-
|
|
111
|
+
.awsui_chart-container_f0fot_1xwwo_111:not(#\9) {
|
|
112
112
|
display: flex;
|
|
113
113
|
width: 100%;
|
|
114
114
|
flex-direction: column;
|
|
115
115
|
}
|
|
116
|
+
.awsui_chart-container_f0fot_1xwwo_111.awsui_fit-height_f0fot_1xwwo_116:not(#\9) {
|
|
117
|
+
height: 100%;
|
|
118
|
+
min-height: inherit;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.awsui_chart-container-outer_f0fot_1xwwo_121:not(#\9) {
|
|
122
|
+
display: flex;
|
|
123
|
+
}
|
|
124
|
+
.awsui_chart-container-outer_f0fot_1xwwo_121.awsui_fit-height_f0fot_1xwwo_116:not(#\9) {
|
|
125
|
+
flex: 1;
|
|
126
|
+
}
|
|
116
127
|
|
|
117
|
-
.awsui_chart-
|
|
128
|
+
.awsui_chart-container-inner_f0fot_1xwwo_128:not(#\9) {
|
|
129
|
+
position: relative;
|
|
118
130
|
display: flex;
|
|
119
131
|
flex-direction: column;
|
|
120
132
|
width: 100%;
|
|
121
133
|
}
|
|
122
134
|
|
|
123
|
-
.awsui_chart-
|
|
124
|
-
display:
|
|
135
|
+
.awsui_chart-container-plot-wrapper_f0fot_1xwwo_135.awsui_fit-height_f0fot_1xwwo_116:not(#\9) {
|
|
136
|
+
display: block;
|
|
137
|
+
position: relative;
|
|
138
|
+
flex: 1;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.awsui_chart-container-plot_f0fot_1xwwo_135.awsui_fit-height_f0fot_1xwwo_116:not(#\9) {
|
|
142
|
+
display: block;
|
|
143
|
+
position: absolute;
|
|
144
|
+
top: 0;
|
|
145
|
+
right: 0;
|
|
146
|
+
bottom: 0;
|
|
147
|
+
left: 0;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.awsui_chart-container-bottom-labels_f0fot_1xwwo_150.awsui_fit-height_f0fot_1xwwo_116:not(#\9) {
|
|
151
|
+
display: block;
|
|
125
152
|
}
|
|
@@ -2,28 +2,32 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"axis": "
|
|
6
|
-
"vertical-marker": "awsui_vertical-
|
|
7
|
-
"axis--emphasized": "awsui_axis--
|
|
8
|
-
"axis-label": "awsui_axis-
|
|
9
|
-
"axis-label--x": "awsui_axis-label--
|
|
10
|
-
"axis-label--y": "awsui_axis-label--
|
|
11
|
-
"grid": "
|
|
12
|
-
"ticks__line": "
|
|
13
|
-
"ticks__text": "
|
|
14
|
-
"ticks--y": "awsui_ticks--
|
|
15
|
-
"ticks--x": "awsui_ticks--
|
|
16
|
-
"ticks--bottom": "awsui_ticks--
|
|
17
|
-
"labels-left": "awsui_labels-
|
|
18
|
-
"ticks": "
|
|
19
|
-
"labels-left__label": "awsui_labels-
|
|
20
|
-
"labels-left--hidden": "awsui_labels-left--
|
|
21
|
-
"labels-bottom": "awsui_labels-
|
|
22
|
-
"vertical-marker-circle": "awsui_vertical-marker-
|
|
23
|
-
"vertical-marker-circle-active": "awsui_vertical-marker-circle-
|
|
24
|
-
"focus-outline": "awsui_focus-
|
|
25
|
-
"chart-container": "awsui_chart-
|
|
26
|
-
"
|
|
27
|
-
"chart-
|
|
5
|
+
"axis": "awsui_axis_f0fot_1xwwo_9",
|
|
6
|
+
"vertical-marker": "awsui_vertical-marker_f0fot_1xwwo_10",
|
|
7
|
+
"axis--emphasized": "awsui_axis--emphasized_f0fot_1xwwo_15",
|
|
8
|
+
"axis-label": "awsui_axis-label_f0fot_1xwwo_19",
|
|
9
|
+
"axis-label--x": "awsui_axis-label--x_f0fot_1xwwo_24",
|
|
10
|
+
"axis-label--y": "awsui_axis-label--y_f0fot_1xwwo_25",
|
|
11
|
+
"grid": "awsui_grid_f0fot_1xwwo_29",
|
|
12
|
+
"ticks__line": "awsui_ticks__line_f0fot_1xwwo_34",
|
|
13
|
+
"ticks__text": "awsui_ticks__text_f0fot_1xwwo_39",
|
|
14
|
+
"ticks--y": "awsui_ticks--y_f0fot_1xwwo_44",
|
|
15
|
+
"ticks--x": "awsui_ticks--x_f0fot_1xwwo_45",
|
|
16
|
+
"ticks--bottom": "awsui_ticks--bottom_f0fot_1xwwo_49",
|
|
17
|
+
"labels-left": "awsui_labels-left_f0fot_1xwwo_54",
|
|
18
|
+
"ticks": "awsui_ticks_f0fot_1xwwo_34",
|
|
19
|
+
"labels-left__label": "awsui_labels-left__label_f0fot_1xwwo_69",
|
|
20
|
+
"labels-left--hidden": "awsui_labels-left--hidden_f0fot_1xwwo_73",
|
|
21
|
+
"labels-bottom": "awsui_labels-bottom_f0fot_1xwwo_81",
|
|
22
|
+
"vertical-marker-circle": "awsui_vertical-marker-circle_f0fot_1xwwo_92",
|
|
23
|
+
"vertical-marker-circle-active": "awsui_vertical-marker-circle-active_f0fot_1xwwo_98",
|
|
24
|
+
"focus-outline": "awsui_focus-outline_f0fot_1xwwo_103",
|
|
25
|
+
"chart-container": "awsui_chart-container_f0fot_1xwwo_111",
|
|
26
|
+
"fit-height": "awsui_fit-height_f0fot_1xwwo_116",
|
|
27
|
+
"chart-container-outer": "awsui_chart-container-outer_f0fot_1xwwo_121",
|
|
28
|
+
"chart-container-inner": "awsui_chart-container-inner_f0fot_1xwwo_128",
|
|
29
|
+
"chart-container-plot-wrapper": "awsui_chart-container-plot-wrapper_f0fot_1xwwo_135",
|
|
30
|
+
"chart-container-plot": "awsui_chart-container-plot_f0fot_1xwwo_135",
|
|
31
|
+
"chart-container-bottom-labels": "awsui_chart-container-bottom-labels_f0fot_1xwwo_150"
|
|
28
32
|
};
|
|
29
33
|
|
|
@@ -6,8 +6,8 @@ export interface ChartPlotRef {
|
|
|
6
6
|
focusApplication(): void;
|
|
7
7
|
}
|
|
8
8
|
export interface ChartPlotProps {
|
|
9
|
-
width: number;
|
|
10
|
-
height: number;
|
|
9
|
+
width: number | string;
|
|
10
|
+
height: number | string;
|
|
11
11
|
transform?: string;
|
|
12
12
|
offsetTop?: number;
|
|
13
13
|
offsetBottom?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"lib/default/","sources":["internal/components/chart-plot/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAUjF,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAMvC,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,aAAa,CAAC;IACnB,SAAS,IAAI,IAAI,CAAC;IAClB,gBAAgB,IAAI,IAAI,CAAC;CAC1B;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"lib/default/","sources":["internal/components/chart-plot/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAUjF,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAMvC,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,aAAa,CAAC;IACnB,SAAS,IAAI,IAAI,CAAC;IAClB,gBAAgB,IAAI,IAAI,CAAC;CAC1B;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,gBAAgB,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;IACpD,gBAAgB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IAChD,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,cAAc,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACjC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,KAAK,IAAI,CAAC;IAC/D,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,KAAK,IAAI,CAAC;IAC/D,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,KAAK,IAAI,CAAC;IAC9D,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,OAAO,EAAE,OAAO,GAAG,UAAU,KAAK,IAAI,CAAC;IACxF,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IACxD,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IAC9D,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED;;;;;;;;;EASE;;AACF,wBAAqC"}
|
|
@@ -89,7 +89,9 @@ function ChartPlot(_a, ref) {
|
|
|
89
89
|
}
|
|
90
90
|
: {};
|
|
91
91
|
return (React.createElement(React.Fragment, null,
|
|
92
|
-
React.createElement("svg", Object.assign({}, restProps, { focusable: plotFocusable, tabIndex: plotTabIndex, role: "application", "aria-hidden": "false" }, plotAria, { ref: svgRef,
|
|
92
|
+
React.createElement("svg", Object.assign({}, restProps, { focusable: plotFocusable, tabIndex: plotTabIndex, role: "application", "aria-hidden": "false" }, plotAria, { ref: svgRef, style: {
|
|
93
|
+
width,
|
|
94
|
+
height,
|
|
93
95
|
marginTop: offsetTop,
|
|
94
96
|
marginBottom: offsetBottom,
|
|
95
97
|
marginLeft: offsetLeft,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["internal/components/chart-plot/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjF,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,UAAU,MAAM,sBAAsB,CAAC;AAC9C,OAAO,qBAAyC,MAAM,0BAA0B,CAAC;AACjF,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAE3C,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,MAAM,yBAAyB,GAAG,CAAC,CAAC;AACpC,MAAM,4BAA4B,GAAG,CAAC,CAAC;AAqCvC;;;;;;;;;EASE;AACF,eAAe,UAAU,CAAC,SAAS,CAAC,CAAC;AAErC,SAAS,SAAS,CAChB,EA0BiB,EACjB,GAA4B;QA3B5B,EACE,KAAK,EACL,MAAM,EACN,SAAS,EACT,SAAS,EACT,YAAY,EACZ,UAAU,EACV,WAAW,EACX,SAAS,EACT,cAAc,EACd,mBAAmB,EACnB,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,WAAW,EACX,SAAS,EACT,QAAQ,EACR,WAAW,EACX,SAAS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EAC1C,gBAAgB,EAAE,gBAAgB,EAClC,GAAG,EAAE,cAAc,EACnB,OAAO,EAAE,kBAAkB,EAC3B,MAAM,EAAE,iBAAiB,EACzB,SAAS,EAAE,oBAAoB,GAC/B;gBAGD,eAAe,IAAI,aAAa,IAAI,CACnC,6CAAkB,MAAM,EAAC,EAAE,EAAE,qBAAqB,IAC/C,eAAe,CACX,CACR;gBAEA,QAAQ;gBAET,oBAAC,YAAY,IACX,UAAU,EAAE,gBAAgB,EAC5B,UAAU,EAAE,oBAAoB,IAAI,gBAAgB,EACpD,MAAM,EAAE,wBAAwB,GAChC,CACA,CACA;QAEN,oBAAC,UAAU,QAAE,cAAc,CAAc,CACxC,CACJ,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { forwardRef, useImperativeHandle, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport styles from './styles.css.js';\nimport { useUniqueId } from '../../hooks/use-unique-id';\n\nimport { KeyCode } from '../../keycode';\nimport LiveRegion from '../live-region/index';\nimport ApplicationController, { ApplicationRef } from './application-controller';\nimport FocusOutline from './focus-outline';\nimport { Offset } from '../interfaces';\nimport { useInternalI18n } from '../../i18n/context.js';\n\nconst DEFAULT_PLOT_FOCUS_OFFSET = 3;\nconst DEFAULT_ELEMENT_FOCUS_OFFSET = 3;\n\nexport interface ChartPlotRef {\n svg: SVGSVGElement;\n focusPlot(): void;\n focusApplication(): void;\n}\n\nexport interface ChartPlotProps {\n width: number;\n height: number;\n transform?: string;\n offsetTop?: number;\n offsetBottom?: number;\n offsetLeft?: number;\n offsetRight?: number;\n focusOffset?: number;\n ariaLabel?: string;\n ariaLabelledby?: string;\n ariaDescription?: string;\n ariaDescribedby?: string;\n ariaRoleDescription?: string;\n activeElementKey?: null | string | number | boolean;\n activeElementRef?: React.RefObject<SVGGElement>;\n activeElementFocusOffset?: Offset;\n ariaLiveRegion?: React.ReactNode;\n isClickable?: boolean;\n isPrecise?: boolean;\n onMouseDown?: (event: React.MouseEvent<SVGSVGElement>) => void;\n onMouseMove?: (event: React.MouseEvent<SVGSVGElement>) => void;\n onMouseOut?: (event: React.MouseEvent<SVGSVGElement>) => void;\n onFocus?: (event: React.FocusEvent<SVGGElement>, trigger: 'mouse' | 'keyboard') => void;\n onBlur?: (event: React.FocusEvent<SVGGElement>) => void;\n onKeyDown?: (event: React.KeyboardEvent<SVGGElement>) => void;\n children: React.ReactNode;\n}\n\n/**\n An extension for the SVG to be used for charts. It includes a controller element to\n handle the focus and keyboard interactions in a way that is supported by screen readers.\n\n The application mimics the aria-activedescendant behavior which is unsupported by Safari. The\n activeElementRef is the pointer to the secondary-focus element and activeElementKey denotes when\n the focus transition was made.\n\n Alternatively, ariaLiveRegion can be used to make announcements.\n*/\nexport default forwardRef(ChartPlot);\n\nfunction ChartPlot(\n {\n width,\n height,\n transform,\n offsetTop,\n offsetBottom,\n offsetLeft,\n offsetRight,\n ariaLabel,\n ariaLabelledby,\n ariaRoleDescription,\n ariaDescription,\n ariaDescribedby,\n activeElementKey,\n activeElementRef,\n ariaLiveRegion,\n isClickable,\n isPrecise,\n children,\n onMouseDown,\n onKeyDown,\n onFocus,\n onBlur,\n focusOffset = DEFAULT_PLOT_FOCUS_OFFSET,\n activeElementFocusOffset = DEFAULT_ELEMENT_FOCUS_OFFSET,\n ...restProps\n }: ChartPlotProps,\n ref: React.Ref<ChartPlotRef>\n) {\n const i18n = useInternalI18n('[charts]');\n const svgRef = useRef<SVGSVGElement>(null);\n const applicationRef = useRef<ApplicationRef>(null);\n const plotClickedRef = useRef(false);\n const [isPlotFocused, setPlotFocused] = useState(false);\n const [isApplicationFocused, setApplicationFocused] = useState(false);\n\n const internalDescriptionId = useUniqueId('awsui-chart-plot__description');\n const ariaDescriptionId = [ariaDescription && internalDescriptionId, ariaDescribedby].filter(Boolean).join(' ');\n\n useImperativeHandle(ref, () => ({\n svg: svgRef.current!,\n focusPlot: () => svgRef.current!.focus(),\n focusApplication: () => applicationRef.current!.focus(),\n }));\n\n const onPlotMouseDown = (event: React.MouseEvent<SVGSVGElement, MouseEvent>) => {\n onMouseDown && onMouseDown(event);\n // Record the click was made for the application focus handler.\n plotClickedRef.current = true;\n };\n const onPlotFocus = (event: React.FocusEvent<SVGSVGElement>) => {\n if (event.target === svgRef.current && !plotClickedRef.current) {\n setPlotFocused(true);\n }\n // The click should focus the underling application bypassing the svg.\n else if (plotClickedRef.current) {\n applicationRef.current!.focus();\n }\n };\n const onPlotBlur = (event: React.FocusEvent<SVGSVGElement>) => {\n if (event.target === svgRef.current) {\n setPlotFocused(false);\n }\n };\n // Once one of the expected keys is pressed the focus is delegated to the application controller.\n const onPlotKeyDown = (event: React.KeyboardEvent) => {\n if (isPlotFocused) {\n // Delegate the focus to the application if one of the expected keys was pressed.\n const codes = [KeyCode.space, KeyCode.enter, KeyCode.up, KeyCode.left, KeyCode.right, KeyCode.down];\n if (codes.indexOf(event.keyCode) !== -1) {\n applicationRef.current!.focus();\n }\n }\n };\n\n const onApplicationFocus = (event: React.FocusEvent<SVGGElement>) => {\n onFocus && onFocus(event, plotClickedRef.current ? 'mouse' : 'keyboard');\n // \"Release\" the click reference to not affect the next call of this handler.\n plotClickedRef.current = false;\n setApplicationFocused(true);\n };\n const onApplicationBlur = (event: React.FocusEvent<SVGGElement>) => {\n onBlur && onBlur(event);\n setApplicationFocused(false);\n };\n const onApplicationKeyDown = onKeyDown;\n\n const plotFocusable = !isApplicationFocused;\n const plotTabIndex = plotFocusable ? 0 : -1;\n const plotAria = !isApplicationFocused\n ? {\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n 'aria-describedby': ariaDescriptionId,\n 'aria-roledescription': i18n('i18nStrings.chartAriaRoleDescription', ariaRoleDescription),\n }\n : {};\n\n return (\n <>\n <svg\n {...restProps}\n focusable={plotFocusable}\n tabIndex={plotTabIndex}\n role=\"application\"\n aria-hidden=\"false\"\n {...plotAria}\n ref={svgRef}\n width={width}\n height={height}\n style={{\n marginTop: offsetTop,\n marginBottom: offsetBottom,\n marginLeft: offsetLeft,\n marginRight: offsetRight,\n }}\n className={clsx(styles.root, {\n [styles.clickable]: isClickable,\n [styles.precise]: isPrecise,\n })}\n onMouseDown={onPlotMouseDown}\n onFocus={onPlotFocus}\n onBlur={onPlotBlur}\n onKeyDown={onPlotKeyDown}\n >\n <FocusOutline elementRef={svgRef} elementKey={isPlotFocused} offset={focusOffset} />\n\n <g transform={transform}>\n <ApplicationController\n activeElementKey={activeElementKey || null}\n activeElementRef={activeElementRef}\n ref={applicationRef}\n onFocus={onApplicationFocus}\n onBlur={onApplicationBlur}\n onKeyDown={onApplicationKeyDown}\n />\n\n {/* Only show description when plot is focusable to avoid repetition in Safari and Firefox */}\n {ariaDescription && plotFocusable && (\n <desc aria-hidden=\"true\" id={internalDescriptionId}>\n {ariaDescription}\n </desc>\n )}\n\n {children}\n\n <FocusOutline\n elementRef={activeElementRef}\n elementKey={isApplicationFocused && activeElementKey}\n offset={activeElementFocusOffset}\n />\n </g>\n </svg>\n\n <LiveRegion>{ariaLiveRegion}</LiveRegion>\n </>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["internal/components/chart-plot/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjF,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,UAAU,MAAM,sBAAsB,CAAC;AAC9C,OAAO,qBAAyC,MAAM,0BAA0B,CAAC;AACjF,OAAO,YAAY,MAAM,iBAAiB,CAAC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,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE;gBAC3B,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,WAAW;gBAC/B,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,SAAS;aAC5B,CAAC,EACF,WAAW,EAAE,eAAe,EAC5B,OAAO,EAAE,WAAW,EACpB,MAAM,EAAE,UAAU,EAClB,SAAS,EAAE,aAAa;YAExB,oBAAC,YAAY,IAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,EAAE,WAAW,GAAI;YAEpF,2BAAG,SAAS,EAAE,SAAS;gBACrB,oBAAC,qBAAqB,IACpB,gBAAgB,EAAE,gBAAgB,IAAI,IAAI,EAC1C,gBAAgB,EAAE,gBAAgB,EAClC,GAAG,EAAE,cAAc,EACnB,OAAO,EAAE,kBAAkB,EAC3B,MAAM,EAAE,iBAAiB,EACzB,SAAS,EAAE,oBAAoB,GAC/B;gBAGD,eAAe,IAAI,aAAa,IAAI,CACnC,6CAAkB,MAAM,EAAC,EAAE,EAAE,qBAAqB,IAC/C,eAAe,CACX,CACR;gBAEA,QAAQ;gBAET,oBAAC,YAAY,IACX,UAAU,EAAE,gBAAgB,EAC5B,UAAU,EAAE,oBAAoB,IAAI,gBAAgB,EACpD,MAAM,EAAE,wBAAwB,GAChC,CACA,CACA;QAEN,oBAAC,UAAU,QAAE,cAAc,CAAc,CACxC,CACJ,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { forwardRef, useImperativeHandle, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport styles from './styles.css.js';\nimport { useUniqueId } from '../../hooks/use-unique-id';\n\nimport { KeyCode } from '../../keycode';\nimport LiveRegion from '../live-region/index';\nimport ApplicationController, { ApplicationRef } from './application-controller';\nimport FocusOutline from './focus-outline';\nimport { Offset } from '../interfaces';\nimport { useInternalI18n } from '../../i18n/context.js';\n\nconst DEFAULT_PLOT_FOCUS_OFFSET = 3;\nconst DEFAULT_ELEMENT_FOCUS_OFFSET = 3;\n\nexport interface ChartPlotRef {\n svg: SVGSVGElement;\n focusPlot(): void;\n focusApplication(): void;\n}\n\nexport interface ChartPlotProps {\n width: number | string;\n height: number | string;\n transform?: string;\n offsetTop?: number;\n offsetBottom?: number;\n offsetLeft?: number;\n offsetRight?: number;\n focusOffset?: number;\n ariaLabel?: string;\n ariaLabelledby?: string;\n ariaDescription?: string;\n ariaDescribedby?: string;\n ariaRoleDescription?: string;\n activeElementKey?: null | string | number | boolean;\n activeElementRef?: React.RefObject<SVGGElement>;\n activeElementFocusOffset?: Offset;\n ariaLiveRegion?: React.ReactNode;\n isClickable?: boolean;\n isPrecise?: boolean;\n onMouseDown?: (event: React.MouseEvent<SVGSVGElement>) => void;\n onMouseMove?: (event: React.MouseEvent<SVGSVGElement>) => void;\n onMouseOut?: (event: React.MouseEvent<SVGSVGElement>) => void;\n onFocus?: (event: React.FocusEvent<SVGGElement>, trigger: 'mouse' | 'keyboard') => void;\n onBlur?: (event: React.FocusEvent<SVGGElement>) => void;\n onKeyDown?: (event: React.KeyboardEvent<SVGGElement>) => void;\n children: React.ReactNode;\n}\n\n/**\n An extension for the SVG to be used for charts. It includes a controller element to\n handle the focus and keyboard interactions in a way that is supported by screen readers.\n\n The application mimics the aria-activedescendant behavior which is unsupported by Safari. The\n activeElementRef is the pointer to the secondary-focus element and activeElementKey denotes when\n the focus transition was made.\n\n Alternatively, ariaLiveRegion can be used to make announcements.\n*/\nexport default forwardRef(ChartPlot);\n\nfunction ChartPlot(\n {\n width,\n height,\n transform,\n offsetTop,\n offsetBottom,\n offsetLeft,\n offsetRight,\n ariaLabel,\n ariaLabelledby,\n ariaRoleDescription,\n ariaDescription,\n ariaDescribedby,\n activeElementKey,\n activeElementRef,\n ariaLiveRegion,\n isClickable,\n isPrecise,\n children,\n onMouseDown,\n onKeyDown,\n onFocus,\n onBlur,\n focusOffset = DEFAULT_PLOT_FOCUS_OFFSET,\n activeElementFocusOffset = DEFAULT_ELEMENT_FOCUS_OFFSET,\n ...restProps\n }: ChartPlotProps,\n ref: React.Ref<ChartPlotRef>\n) {\n const i18n = useInternalI18n('[charts]');\n const svgRef = useRef<SVGSVGElement>(null);\n const applicationRef = useRef<ApplicationRef>(null);\n const plotClickedRef = useRef(false);\n const [isPlotFocused, setPlotFocused] = useState(false);\n const [isApplicationFocused, setApplicationFocused] = useState(false);\n\n const internalDescriptionId = useUniqueId('awsui-chart-plot__description');\n const ariaDescriptionId = [ariaDescription && internalDescriptionId, ariaDescribedby].filter(Boolean).join(' ');\n\n useImperativeHandle(ref, () => ({\n svg: svgRef.current!,\n focusPlot: () => svgRef.current!.focus(),\n focusApplication: () => applicationRef.current!.focus(),\n }));\n\n const onPlotMouseDown = (event: React.MouseEvent<SVGSVGElement, MouseEvent>) => {\n onMouseDown && onMouseDown(event);\n // Record the click was made for the application focus handler.\n plotClickedRef.current = true;\n };\n const onPlotFocus = (event: React.FocusEvent<SVGSVGElement>) => {\n if (event.target === svgRef.current && !plotClickedRef.current) {\n setPlotFocused(true);\n }\n // The click should focus the underling application bypassing the svg.\n else if (plotClickedRef.current) {\n applicationRef.current!.focus();\n }\n };\n const onPlotBlur = (event: React.FocusEvent<SVGSVGElement>) => {\n if (event.target === svgRef.current) {\n setPlotFocused(false);\n }\n };\n // Once one of the expected keys is pressed the focus is delegated to the application controller.\n const onPlotKeyDown = (event: React.KeyboardEvent) => {\n if (isPlotFocused) {\n // Delegate the focus to the application if one of the expected keys was pressed.\n const codes = [KeyCode.space, KeyCode.enter, KeyCode.up, KeyCode.left, KeyCode.right, KeyCode.down];\n if (codes.indexOf(event.keyCode) !== -1) {\n applicationRef.current!.focus();\n }\n }\n };\n\n const onApplicationFocus = (event: React.FocusEvent<SVGGElement>) => {\n onFocus && onFocus(event, plotClickedRef.current ? 'mouse' : 'keyboard');\n // \"Release\" the click reference to not affect the next call of this handler.\n plotClickedRef.current = false;\n setApplicationFocused(true);\n };\n const onApplicationBlur = (event: React.FocusEvent<SVGGElement>) => {\n onBlur && onBlur(event);\n setApplicationFocused(false);\n };\n const onApplicationKeyDown = onKeyDown;\n\n const plotFocusable = !isApplicationFocused;\n const plotTabIndex = plotFocusable ? 0 : -1;\n const plotAria = !isApplicationFocused\n ? {\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n 'aria-describedby': ariaDescriptionId,\n 'aria-roledescription': i18n('i18nStrings.chartAriaRoleDescription', ariaRoleDescription),\n }\n : {};\n\n return (\n <>\n <svg\n {...restProps}\n focusable={plotFocusable}\n tabIndex={plotTabIndex}\n role=\"application\"\n aria-hidden=\"false\"\n {...plotAria}\n ref={svgRef}\n style={{\n width,\n height,\n marginTop: offsetTop,\n marginBottom: offsetBottom,\n marginLeft: offsetLeft,\n marginRight: offsetRight,\n }}\n className={clsx(styles.root, {\n [styles.clickable]: isClickable,\n [styles.precise]: isPrecise,\n })}\n onMouseDown={onPlotMouseDown}\n onFocus={onPlotFocus}\n onBlur={onPlotBlur}\n onKeyDown={onPlotKeyDown}\n >\n <FocusOutline elementRef={svgRef} elementKey={isPlotFocused} offset={focusOffset} />\n\n <g transform={transform}>\n <ApplicationController\n activeElementKey={activeElementKey || null}\n activeElementRef={activeElementRef}\n ref={applicationRef}\n onFocus={onApplicationFocus}\n onBlur={onApplicationBlur}\n onKeyDown={onApplicationKeyDown}\n />\n\n {/* Only show description when plot is focusable to avoid repetition in Safari and Firefox */}\n {ariaDescription && plotFocusable && (\n <desc aria-hidden=\"true\" id={internalDescriptionId}>\n {ariaDescription}\n </desc>\n )}\n\n {children}\n\n <FocusOutline\n elementRef={activeElementRef}\n elementKey={isApplicationFocused && activeElementKey}\n offset={activeElementFocusOffset}\n />\n </g>\n </svg>\n\n <LiveRegion>{ariaLiveRegion}</LiveRegion>\n </>\n );\n}\n"]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BaseComponentProps } from '../../base-component/index.js';
|
|
3
3
|
interface ChartWrapperProps extends BaseComponentProps {
|
|
4
|
+
fitHeight: boolean;
|
|
4
5
|
defaultFilter: React.ReactNode;
|
|
5
6
|
additionalFilters: React.ReactNode;
|
|
6
7
|
reserveFilterSpace: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"lib/default/","sources":["internal/components/chart-wrapper/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAI1C,OAAO,EAAE,kBAAkB,EAAgB,MAAM,+BAA+B,CAAC;AAIjF,UAAU,iBAAkB,SAAQ,kBAAkB;IACpD,aAAa,EAAE,KAAK,CAAC,SAAS,CAAC;IAC/B,iBAAiB,EAAE,KAAK,CAAC,SAAS,CAAC;IACnC,kBAAkB,EAAE,OAAO,CAAC;IAC5B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,WAAW,EAAE,KAAK,CAAC,SAAS,CAAC;IAC7B,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,MAAM,CAAC,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,GAAG,IAAI,CAAC;IACvC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"lib/default/","sources":["internal/components/chart-wrapper/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAI1C,OAAO,EAAE,kBAAkB,EAAgB,MAAM,+BAA+B,CAAC;AAIjF,UAAU,iBAAkB,SAAQ,kBAAkB;IACpD,SAAS,EAAE,OAAO,CAAC;IACnB,aAAa,EAAE,KAAK,CAAC,SAAS,CAAC;IAC/B,iBAAiB,EAAE,KAAK,CAAC,SAAS,CAAC;IACnC,kBAAkB,EAAE,OAAO,CAAC;IAC5B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,WAAW,EAAE,KAAK,CAAC,SAAS,CAAC;IAC7B,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,MAAM,CAAC,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,GAAG,IAAI,CAAC;IACvC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,eAAO,MAAM,YAAY,0FAkFxB,CAAC"}
|
|
@@ -8,19 +8,34 @@ import { getBaseProps } from '../../base-component/index.js';
|
|
|
8
8
|
import InternalBox from '../../../box/internal.js';
|
|
9
9
|
import InternalSpaceBetween from '../../../space-between/internal.js';
|
|
10
10
|
export const ChartWrapper = forwardRef((_a, ref) => {
|
|
11
|
-
var { defaultFilter, additionalFilters, reserveFilterSpace, reserveLegendSpace, chartStatus, chart, legend, onBlur, contentClassName, contentMinHeight } = _a, props = __rest(_a, ["defaultFilter", "additionalFilters", "reserveFilterSpace", "reserveLegendSpace", "chartStatus", "chart", "legend", "onBlur", "contentClassName", "contentMinHeight"]);
|
|
11
|
+
var { defaultFilter, additionalFilters, reserveFilterSpace, reserveLegendSpace, chartStatus, chart, legend, onBlur, contentClassName, contentMinHeight, fitHeight } = _a, props = __rest(_a, ["defaultFilter", "additionalFilters", "reserveFilterSpace", "reserveLegendSpace", "chartStatus", "chart", "legend", "onBlur", "contentClassName", "contentMinHeight", "fitHeight"]);
|
|
12
12
|
const baseProps = getBaseProps(props);
|
|
13
|
+
const filtersNode = (defaultFilter || additionalFilters) && (React.createElement(InternalBox, { className: styles['filter-container'], margin: { bottom: 'l' } },
|
|
14
|
+
React.createElement(InternalSpaceBetween, { size: "l", direction: "horizontal", className: clsx({ [styles['has-default-filter']]: !!defaultFilter }) },
|
|
15
|
+
defaultFilter,
|
|
16
|
+
additionalFilters)));
|
|
17
|
+
const legendNode = legend && React.createElement(InternalBox, { margin: { top: 'm' } }, legend);
|
|
18
|
+
if (fitHeight) {
|
|
19
|
+
return (React.createElement("div", Object.assign({ ref: ref }, baseProps, { className: clsx(baseProps.className, styles.wrapper, styles['wrapper--fit-height']), onBlur: onBlur }),
|
|
20
|
+
React.createElement("div", { className: clsx(styles['inner-wrapper'], styles['inner-wrapper--fit-height']) },
|
|
21
|
+
filtersNode,
|
|
22
|
+
React.createElement("div", { className: clsx(styles.content, contentClassName, {
|
|
23
|
+
[styles['content--reserve-filter']]: reserveFilterSpace,
|
|
24
|
+
[styles['content--reserve-legend']]: reserveLegendSpace,
|
|
25
|
+
[styles['content--fit-height']]: true,
|
|
26
|
+
}) },
|
|
27
|
+
chartStatus,
|
|
28
|
+
chart),
|
|
29
|
+
legendNode)));
|
|
30
|
+
}
|
|
13
31
|
return (React.createElement("div", Object.assign({ ref: ref }, baseProps, { className: clsx(baseProps.className, styles.wrapper), onBlur: onBlur }),
|
|
14
|
-
|
|
15
|
-
React.createElement(InternalSpaceBetween, { size: "l", direction: "horizontal", className: clsx({ [styles['has-default-filter']]: !!defaultFilter }) },
|
|
16
|
-
defaultFilter,
|
|
17
|
-
additionalFilters))),
|
|
32
|
+
filtersNode,
|
|
18
33
|
React.createElement("div", { className: clsx(styles.content, contentClassName, {
|
|
19
34
|
[styles['content--reserve-filter']]: reserveFilterSpace,
|
|
20
35
|
[styles['content--reserve-legend']]: reserveLegendSpace,
|
|
21
36
|
}), style: { minHeight: contentMinHeight } },
|
|
22
37
|
chartStatus,
|
|
23
38
|
chart),
|
|
24
|
-
|
|
39
|
+
legendNode));
|
|
25
40
|
});
|
|
26
41
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["internal/components/chart-wrapper/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;;AAEtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAsB,YAAY,EAAE,MAAM,+BAA+B,CAAC;AACjF,OAAO,WAAW,MAAM,0BAA0B,CAAC;AACnD,OAAO,oBAAoB,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["internal/components/chart-wrapper/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;;AAEtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAsB,YAAY,EAAE,MAAM,+BAA+B,CAAC;AACjF,OAAO,WAAW,MAAM,0BAA0B,CAAC;AACnD,OAAO,oBAAoB,MAAM,oCAAoC,CAAC;AAgBtE,MAAM,CAAC,MAAM,YAAY,GAAG,UAAU,CACpC,CACE,EAaoB,EACpB,GAA8B,EAC9B,EAAE;QAfF,EACE,aAAa,EACb,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,WAAW,EACX,KAAK,EACL,MAAM,EACN,MAAM,EACN,gBAAgB,EAChB,gBAAgB,EAChB,SAAS,OAES,EADf,KAAK,cAZV,mLAaC,CADS;IAIV,MAAM,SAAS,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;IAEtC,MAAM,WAAW,GAAG,CAAC,aAAa,IAAI,iBAAiB,CAAC,IAAI,CAC1D,oBAAC,WAAW,IAAC,SAAS,EAAE,MAAM,CAAC,kBAAkB,CAAC,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE;QACzE,oBAAC,oBAAoB,IACnB,IAAI,EAAC,GAAG,EACR,SAAS,EAAC,YAAY,EACtB,SAAS,EAAE,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,CAAC,MAAM,CAAC,yBAAyB,CAAC,CAAC,EAAE,kBAAkB;aACxD,CAAC,EACF,KAAK,EAAE,EAAE,SAAS,EAAE,gBAAgB,EAAE;YAErC,WAAW;YACX,KAAK,CACF;QAEL,UAAU,CACP,CACP,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React, { forwardRef } from 'react';\nimport clsx from 'clsx';\n\nimport styles from './styles.css.js';\nimport { BaseComponentProps, getBaseProps } from '../../base-component/index.js';\nimport InternalBox from '../../../box/internal.js';\nimport InternalSpaceBetween from '../../../space-between/internal.js';\n\ninterface ChartWrapperProps extends BaseComponentProps {\n fitHeight: boolean;\n defaultFilter: React.ReactNode;\n additionalFilters: React.ReactNode;\n reserveFilterSpace: boolean;\n reserveLegendSpace: boolean;\n chartStatus: React.ReactNode;\n chart: React.ReactNode;\n legend: React.ReactNode;\n onBlur?(event: React.FocusEvent): void;\n contentClassName?: string;\n contentMinHeight?: number;\n}\n\nexport const ChartWrapper = forwardRef(\n (\n {\n defaultFilter,\n additionalFilters,\n reserveFilterSpace,\n reserveLegendSpace,\n chartStatus,\n chart,\n legend,\n onBlur,\n contentClassName,\n contentMinHeight,\n fitHeight,\n ...props\n }: ChartWrapperProps,\n ref: React.Ref<HTMLDivElement>\n ) => {\n const baseProps = getBaseProps(props);\n\n const filtersNode = (defaultFilter || additionalFilters) && (\n <InternalBox className={styles['filter-container']} margin={{ bottom: 'l' }}>\n <InternalSpaceBetween\n size=\"l\"\n direction=\"horizontal\"\n className={clsx({ [styles['has-default-filter']]: !!defaultFilter })}\n >\n {defaultFilter}\n {additionalFilters}\n </InternalSpaceBetween>\n </InternalBox>\n );\n\n const legendNode = legend && <InternalBox margin={{ top: 'm' }}>{legend}</InternalBox>;\n\n if (fitHeight) {\n return (\n <div\n ref={ref}\n {...baseProps}\n className={clsx(baseProps.className, styles.wrapper, styles['wrapper--fit-height'])}\n onBlur={onBlur}\n >\n <div className={clsx(styles['inner-wrapper'], styles['inner-wrapper--fit-height'])}>\n {filtersNode}\n\n <div\n className={clsx(styles.content, contentClassName, {\n [styles['content--reserve-filter']]: reserveFilterSpace,\n [styles['content--reserve-legend']]: reserveLegendSpace,\n [styles['content--fit-height']]: true,\n })}\n >\n {chartStatus}\n {chart}\n </div>\n\n {legendNode}\n </div>\n </div>\n );\n }\n\n return (\n <div ref={ref} {...baseProps} className={clsx(baseProps.className, styles.wrapper)} onBlur={onBlur}>\n {filtersNode}\n\n <div\n className={clsx(styles.content, contentClassName, {\n [styles['content--reserve-filter']]: reserveFilterSpace,\n [styles['content--reserve-legend']]: reserveLegendSpace,\n })}\n style={{ minHeight: contentMinHeight }}\n >\n {chartStatus}\n {chart}\n </div>\n\n {legendNode}\n </div>\n );\n }\n);\n"]}
|