@cloudscape-design/chart-components 1.0.162 → 1.0.164
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/core/chart-api/chart-extra-pointer.d.ts +3 -2
- package/core/chart-api/chart-extra-pointer.js +15 -6
- package/core/chart-api/chart-extra-pointer.js.map +1 -1
- package/core/chart-api/chart-extra-zoom.d.ts +58 -1
- package/core/chart-api/chart-extra-zoom.js +451 -23
- package/core/chart-api/chart-extra-zoom.js.map +1 -1
- package/core/chart-api/index.d.ts +11 -2
- package/core/chart-api/index.js +25 -9
- package/core/chart-api/index.js.map +1 -1
- package/core/chart-core.js +11 -5
- package/core/chart-core.js.map +1 -1
- package/core/chart-zoom/zoom-state-machine.d.ts +65 -0
- package/core/chart-zoom/zoom-state-machine.js +77 -0
- package/core/chart-zoom/zoom-state-machine.js.map +1 -0
- package/core/chart-zoom/zoom-utils.d.ts +8 -0
- package/core/chart-zoom/zoom-utils.js +47 -0
- package/core/chart-zoom/zoom-utils.js.map +1 -0
- package/core/components/{core-zoom.d.ts → core-zoom-controls.d.ts} +0 -3
- package/core/components/core-zoom-controls.js +30 -0
- package/core/components/core-zoom-controls.js.map +1 -0
- package/core/components/core-zoom-cursor.d.ts +7 -0
- package/core/components/core-zoom-cursor.js +10 -0
- package/core/components/core-zoom-cursor.js.map +1 -0
- package/core/components/core-zoom-live-region.d.ts +4 -0
- package/core/components/core-zoom-live-region.js +11 -0
- package/core/components/core-zoom-live-region.js.map +1 -0
- package/core/i18n-utils.d.ts +8 -0
- package/core/i18n-utils.js +15 -4
- package/core/i18n-utils.js.map +1 -1
- package/core/styles.css.js +24 -22
- package/core/styles.scoped.css +62 -22
- package/core/styles.selectors.js +24 -22
- package/core/test-classes/styles.css.js +38 -33
- package/core/test-classes/styles.scoped.css +38 -33
- package/core/test-classes/styles.selectors.js +38 -33
- package/core/utils.d.ts +1 -0
- package/core/utils.js +6 -0
- package/core/utils.js.map +1 -1
- package/internal/chart-styles.d.ts +12 -0
- package/internal/chart-styles.js +13 -1
- package/internal/chart-styles.js.map +1 -1
- package/internal/environment.js +1 -1
- package/internal/environment.json +1 -1
- package/internal/manifest.json +1 -1
- package/package.json +2 -2
- package/core/components/core-zoom.js +0 -20
- package/core/components/core-zoom.js.map +0 -1
package/core/styles.selectors.js
CHANGED
|
@@ -2,27 +2,29 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"no-data": "awsui_no-
|
|
10
|
-
"no-data
|
|
11
|
-
"no-data-
|
|
12
|
-
"
|
|
13
|
-
"chart-
|
|
14
|
-
"chart-filters
|
|
15
|
-
"
|
|
16
|
-
"axis-vertical-title
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"chart-container-
|
|
21
|
-
"chart-container-
|
|
22
|
-
"chart-
|
|
23
|
-
"chart-plot-wrapper": "awsui_chart-plot-
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
5
|
+
"focus-outline": "awsui_focus-outline_113qp_14oxf_11",
|
|
6
|
+
"root": "awsui_root_113qp_14oxf_15",
|
|
7
|
+
"highcharts-grid-line": "awsui_highcharts-grid-line_113qp_14oxf_18",
|
|
8
|
+
"root-fit-height": "awsui_root-fit-height_113qp_14oxf_22",
|
|
9
|
+
"no-data-container": "awsui_no-data-container_113qp_14oxf_26",
|
|
10
|
+
"no-data": "awsui_no-data_113qp_14oxf_26",
|
|
11
|
+
"no-data-wrapper": "awsui_no-data-wrapper_113qp_14oxf_44",
|
|
12
|
+
"no-data-empty": "awsui_no-data-empty_113qp_14oxf_52",
|
|
13
|
+
"chart-zoom-controls": "awsui_chart-zoom-controls_113qp_14oxf_56",
|
|
14
|
+
"chart-filters": "awsui_chart-filters_113qp_14oxf_63",
|
|
15
|
+
"chart-filters-series": "awsui_chart-filters-series_113qp_14oxf_69",
|
|
16
|
+
"axis-vertical-title": "awsui_axis-vertical-title_113qp_14oxf_73",
|
|
17
|
+
"axis-vertical-title-item": "awsui_axis-vertical-title-item_113qp_14oxf_81",
|
|
18
|
+
"error-range": "awsui_error-range_113qp_14oxf_88",
|
|
19
|
+
"tooltip-default-header": "awsui_tooltip-default-header_113qp_14oxf_94",
|
|
20
|
+
"chart-container-root": "awsui_chart-container-root_113qp_14oxf_100",
|
|
21
|
+
"chart-container-fit-height": "awsui_chart-container-fit-height_113qp_14oxf_104",
|
|
22
|
+
"chart-container-min-width": "awsui_chart-container-min-width_113qp_14oxf_110",
|
|
23
|
+
"chart-plot-and-legend-wrapper": "awsui_chart-plot-and-legend-wrapper_113qp_14oxf_114",
|
|
24
|
+
"chart-plot-wrapper": "awsui_chart-plot-wrapper_113qp_14oxf_118",
|
|
25
|
+
"bottom-legend-container": "awsui_bottom-legend-container_113qp_14oxf_123",
|
|
26
|
+
"side-legend-container": "awsui_side-legend-container_113qp_14oxf_130",
|
|
27
|
+
"application": "awsui_application_113qp_14oxf_139",
|
|
28
|
+
"chart-zoom-cursor": "awsui_chart-zoom-cursor_113qp_14oxf_143"
|
|
27
29
|
};
|
|
28
30
|
|
|
@@ -1,38 +1,43 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"root": "
|
|
5
|
-
"fallback": "
|
|
6
|
-
"no-data": "awsui_no-
|
|
7
|
-
"legend-primary": "awsui_legend-
|
|
8
|
-
"legend-secondary": "awsui_legend-
|
|
9
|
-
"legend-item-warning": "awsui_legend-item-
|
|
10
|
-
"chart-plot": "awsui_chart-
|
|
11
|
-
"chart-plot-wrapper": "awsui_chart-plot-
|
|
12
|
-
"chart-filters": "awsui_chart-
|
|
13
|
-
"chart-filters-series": "awsui_chart-filters-
|
|
14
|
-
"chart-filters-additional": "awsui_chart-filters-
|
|
15
|
-
"chart-header": "awsui_chart-
|
|
16
|
-
"chart-footer": "awsui_chart-
|
|
17
|
-
"chart-navigator": "awsui_chart-
|
|
18
|
-
"
|
|
19
|
-
"zoom-
|
|
20
|
-
"zoom-
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"axis-
|
|
27
|
-
"axis-
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
4
|
+
"root": "awsui_root_m8vem_rjdwj_5",
|
|
5
|
+
"fallback": "awsui_fallback_m8vem_rjdwj_6",
|
|
6
|
+
"no-data": "awsui_no-data_m8vem_rjdwj_7",
|
|
7
|
+
"legend-primary": "awsui_legend-primary_m8vem_rjdwj_8",
|
|
8
|
+
"legend-secondary": "awsui_legend-secondary_m8vem_rjdwj_9",
|
|
9
|
+
"legend-item-warning": "awsui_legend-item-warning_m8vem_rjdwj_10",
|
|
10
|
+
"chart-plot": "awsui_chart-plot_m8vem_rjdwj_11",
|
|
11
|
+
"chart-plot-wrapper": "awsui_chart-plot-wrapper_m8vem_rjdwj_12",
|
|
12
|
+
"chart-filters": "awsui_chart-filters_m8vem_rjdwj_13",
|
|
13
|
+
"chart-filters-series": "awsui_chart-filters-series_m8vem_rjdwj_14",
|
|
14
|
+
"chart-filters-additional": "awsui_chart-filters-additional_m8vem_rjdwj_15",
|
|
15
|
+
"chart-header": "awsui_chart-header_m8vem_rjdwj_16",
|
|
16
|
+
"chart-footer": "awsui_chart-footer_m8vem_rjdwj_17",
|
|
17
|
+
"chart-navigator": "awsui_chart-navigator_m8vem_rjdwj_18",
|
|
18
|
+
"zoom-button": "awsui_zoom-button_m8vem_rjdwj_19",
|
|
19
|
+
"exit-zoom-button": "awsui_exit-zoom-button_m8vem_rjdwj_20",
|
|
20
|
+
"reset-zoom-button": "awsui_reset-zoom-button_m8vem_rjdwj_21",
|
|
21
|
+
"zoom-cursor": "awsui_zoom-cursor_m8vem_rjdwj_22",
|
|
22
|
+
"zoom-range": "awsui_zoom-range_m8vem_rjdwj_23",
|
|
23
|
+
"zoom-range-borders": "awsui_zoom-range-borders_m8vem_rjdwj_24",
|
|
24
|
+
"zoom-selection": "awsui_zoom-selection_m8vem_rjdwj_25",
|
|
25
|
+
"zoom-selection-start": "awsui_zoom-selection-start_m8vem_rjdwj_26",
|
|
26
|
+
"axis-x": "awsui_axis-x_m8vem_rjdwj_27",
|
|
27
|
+
"axis-x-title": "awsui_axis-x-title_m8vem_rjdwj_28",
|
|
28
|
+
"axis-y": "awsui_axis-y_m8vem_rjdwj_29",
|
|
29
|
+
"axis-y-title": "awsui_axis-y-title_m8vem_rjdwj_30",
|
|
30
|
+
"axis-vertical": "awsui_axis-vertical_m8vem_rjdwj_31",
|
|
31
|
+
"axis-vertical-title": "awsui_axis-vertical-title_m8vem_rjdwj_32",
|
|
32
|
+
"axis-horizontal": "awsui_axis-horizontal_m8vem_rjdwj_33",
|
|
33
|
+
"no-data-empty": "awsui_no-data-empty_m8vem_rjdwj_34",
|
|
34
|
+
"no-data-no-match": "awsui_no-data-no-match_m8vem_rjdwj_35",
|
|
35
|
+
"no-data-loading": "awsui_no-data-loading_m8vem_rjdwj_36",
|
|
36
|
+
"no-data-error": "awsui_no-data-error_m8vem_rjdwj_37",
|
|
37
|
+
"no-data-retry": "awsui_no-data-retry_m8vem_rjdwj_38",
|
|
38
|
+
"emphasized-baseline": "awsui_emphasized-baseline_m8vem_rjdwj_39",
|
|
39
|
+
"application": "awsui_application_m8vem_rjdwj_40",
|
|
40
|
+
"highlight-marker": "awsui_highlight-marker_m8vem_rjdwj_41",
|
|
41
|
+
"highlight-marker-selected": "awsui_highlight-marker-selected_m8vem_rjdwj_42"
|
|
37
42
|
};
|
|
38
43
|
|
|
@@ -2,38 +2,43 @@
|
|
|
2
2
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
|
-
.
|
|
6
|
-
.
|
|
7
|
-
.awsui_no-
|
|
8
|
-
.awsui_legend-
|
|
9
|
-
.awsui_legend-
|
|
10
|
-
.awsui_legend-item-
|
|
11
|
-
.awsui_chart-
|
|
12
|
-
.awsui_chart-plot-
|
|
13
|
-
.awsui_chart-
|
|
14
|
-
.awsui_chart-filters-
|
|
15
|
-
.awsui_chart-filters-
|
|
16
|
-
.awsui_chart-
|
|
17
|
-
.awsui_chart-
|
|
18
|
-
.awsui_chart-
|
|
19
|
-
.
|
|
20
|
-
.
|
|
21
|
-
.
|
|
22
|
-
.
|
|
23
|
-
.
|
|
24
|
-
.
|
|
25
|
-
.
|
|
26
|
-
.
|
|
27
|
-
.awsui_axis-
|
|
28
|
-
.awsui_axis-
|
|
29
|
-
.
|
|
30
|
-
.
|
|
31
|
-
.
|
|
32
|
-
.
|
|
33
|
-
.
|
|
34
|
-
.
|
|
35
|
-
.
|
|
36
|
-
.
|
|
37
|
-
.
|
|
5
|
+
.awsui_root_m8vem_rjdwj_5:not(#\9),
|
|
6
|
+
.awsui_fallback_m8vem_rjdwj_6:not(#\9),
|
|
7
|
+
.awsui_no-data_m8vem_rjdwj_7:not(#\9),
|
|
8
|
+
.awsui_legend-primary_m8vem_rjdwj_8:not(#\9),
|
|
9
|
+
.awsui_legend-secondary_m8vem_rjdwj_9:not(#\9),
|
|
10
|
+
.awsui_legend-item-warning_m8vem_rjdwj_10:not(#\9),
|
|
11
|
+
.awsui_chart-plot_m8vem_rjdwj_11:not(#\9),
|
|
12
|
+
.awsui_chart-plot-wrapper_m8vem_rjdwj_12:not(#\9),
|
|
13
|
+
.awsui_chart-filters_m8vem_rjdwj_13:not(#\9),
|
|
14
|
+
.awsui_chart-filters-series_m8vem_rjdwj_14:not(#\9),
|
|
15
|
+
.awsui_chart-filters-additional_m8vem_rjdwj_15:not(#\9),
|
|
16
|
+
.awsui_chart-header_m8vem_rjdwj_16:not(#\9),
|
|
17
|
+
.awsui_chart-footer_m8vem_rjdwj_17:not(#\9),
|
|
18
|
+
.awsui_chart-navigator_m8vem_rjdwj_18:not(#\9),
|
|
19
|
+
.awsui_zoom-button_m8vem_rjdwj_19:not(#\9),
|
|
20
|
+
.awsui_exit-zoom-button_m8vem_rjdwj_20:not(#\9),
|
|
21
|
+
.awsui_reset-zoom-button_m8vem_rjdwj_21:not(#\9),
|
|
22
|
+
.awsui_zoom-cursor_m8vem_rjdwj_22:not(#\9),
|
|
23
|
+
.awsui_zoom-range_m8vem_rjdwj_23:not(#\9),
|
|
24
|
+
.awsui_zoom-range-borders_m8vem_rjdwj_24:not(#\9),
|
|
25
|
+
.awsui_zoom-selection_m8vem_rjdwj_25:not(#\9),
|
|
26
|
+
.awsui_zoom-selection-start_m8vem_rjdwj_26:not(#\9),
|
|
27
|
+
.awsui_axis-x_m8vem_rjdwj_27:not(#\9),
|
|
28
|
+
.awsui_axis-x-title_m8vem_rjdwj_28:not(#\9),
|
|
29
|
+
.awsui_axis-y_m8vem_rjdwj_29:not(#\9),
|
|
30
|
+
.awsui_axis-y-title_m8vem_rjdwj_30:not(#\9),
|
|
31
|
+
.awsui_axis-vertical_m8vem_rjdwj_31:not(#\9),
|
|
32
|
+
.awsui_axis-vertical-title_m8vem_rjdwj_32:not(#\9),
|
|
33
|
+
.awsui_axis-horizontal_m8vem_rjdwj_33:not(#\9),
|
|
34
|
+
.awsui_no-data-empty_m8vem_rjdwj_34:not(#\9),
|
|
35
|
+
.awsui_no-data-no-match_m8vem_rjdwj_35:not(#\9),
|
|
36
|
+
.awsui_no-data-loading_m8vem_rjdwj_36:not(#\9),
|
|
37
|
+
.awsui_no-data-error_m8vem_rjdwj_37:not(#\9),
|
|
38
|
+
.awsui_no-data-retry_m8vem_rjdwj_38:not(#\9),
|
|
39
|
+
.awsui_emphasized-baseline_m8vem_rjdwj_39:not(#\9),
|
|
40
|
+
.awsui_application_m8vem_rjdwj_40:not(#\9),
|
|
41
|
+
.awsui_highlight-marker_m8vem_rjdwj_41:not(#\9),
|
|
42
|
+
.awsui_highlight-marker-selected_m8vem_rjdwj_42:not(#\9) {
|
|
38
43
|
/* used in test-utils */
|
|
39
44
|
}
|
|
@@ -2,38 +2,43 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"root": "
|
|
6
|
-
"fallback": "
|
|
7
|
-
"no-data": "awsui_no-
|
|
8
|
-
"legend-primary": "awsui_legend-
|
|
9
|
-
"legend-secondary": "awsui_legend-
|
|
10
|
-
"legend-item-warning": "awsui_legend-item-
|
|
11
|
-
"chart-plot": "awsui_chart-
|
|
12
|
-
"chart-plot-wrapper": "awsui_chart-plot-
|
|
13
|
-
"chart-filters": "awsui_chart-
|
|
14
|
-
"chart-filters-series": "awsui_chart-filters-
|
|
15
|
-
"chart-filters-additional": "awsui_chart-filters-
|
|
16
|
-
"chart-header": "awsui_chart-
|
|
17
|
-
"chart-footer": "awsui_chart-
|
|
18
|
-
"chart-navigator": "awsui_chart-
|
|
19
|
-
"
|
|
20
|
-
"zoom-
|
|
21
|
-
"zoom-
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"axis-
|
|
28
|
-
"axis-
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
5
|
+
"root": "awsui_root_m8vem_rjdwj_5",
|
|
6
|
+
"fallback": "awsui_fallback_m8vem_rjdwj_6",
|
|
7
|
+
"no-data": "awsui_no-data_m8vem_rjdwj_7",
|
|
8
|
+
"legend-primary": "awsui_legend-primary_m8vem_rjdwj_8",
|
|
9
|
+
"legend-secondary": "awsui_legend-secondary_m8vem_rjdwj_9",
|
|
10
|
+
"legend-item-warning": "awsui_legend-item-warning_m8vem_rjdwj_10",
|
|
11
|
+
"chart-plot": "awsui_chart-plot_m8vem_rjdwj_11",
|
|
12
|
+
"chart-plot-wrapper": "awsui_chart-plot-wrapper_m8vem_rjdwj_12",
|
|
13
|
+
"chart-filters": "awsui_chart-filters_m8vem_rjdwj_13",
|
|
14
|
+
"chart-filters-series": "awsui_chart-filters-series_m8vem_rjdwj_14",
|
|
15
|
+
"chart-filters-additional": "awsui_chart-filters-additional_m8vem_rjdwj_15",
|
|
16
|
+
"chart-header": "awsui_chart-header_m8vem_rjdwj_16",
|
|
17
|
+
"chart-footer": "awsui_chart-footer_m8vem_rjdwj_17",
|
|
18
|
+
"chart-navigator": "awsui_chart-navigator_m8vem_rjdwj_18",
|
|
19
|
+
"zoom-button": "awsui_zoom-button_m8vem_rjdwj_19",
|
|
20
|
+
"exit-zoom-button": "awsui_exit-zoom-button_m8vem_rjdwj_20",
|
|
21
|
+
"reset-zoom-button": "awsui_reset-zoom-button_m8vem_rjdwj_21",
|
|
22
|
+
"zoom-cursor": "awsui_zoom-cursor_m8vem_rjdwj_22",
|
|
23
|
+
"zoom-range": "awsui_zoom-range_m8vem_rjdwj_23",
|
|
24
|
+
"zoom-range-borders": "awsui_zoom-range-borders_m8vem_rjdwj_24",
|
|
25
|
+
"zoom-selection": "awsui_zoom-selection_m8vem_rjdwj_25",
|
|
26
|
+
"zoom-selection-start": "awsui_zoom-selection-start_m8vem_rjdwj_26",
|
|
27
|
+
"axis-x": "awsui_axis-x_m8vem_rjdwj_27",
|
|
28
|
+
"axis-x-title": "awsui_axis-x-title_m8vem_rjdwj_28",
|
|
29
|
+
"axis-y": "awsui_axis-y_m8vem_rjdwj_29",
|
|
30
|
+
"axis-y-title": "awsui_axis-y-title_m8vem_rjdwj_30",
|
|
31
|
+
"axis-vertical": "awsui_axis-vertical_m8vem_rjdwj_31",
|
|
32
|
+
"axis-vertical-title": "awsui_axis-vertical-title_m8vem_rjdwj_32",
|
|
33
|
+
"axis-horizontal": "awsui_axis-horizontal_m8vem_rjdwj_33",
|
|
34
|
+
"no-data-empty": "awsui_no-data-empty_m8vem_rjdwj_34",
|
|
35
|
+
"no-data-no-match": "awsui_no-data-no-match_m8vem_rjdwj_35",
|
|
36
|
+
"no-data-loading": "awsui_no-data-loading_m8vem_rjdwj_36",
|
|
37
|
+
"no-data-error": "awsui_no-data-error_m8vem_rjdwj_37",
|
|
38
|
+
"no-data-retry": "awsui_no-data-retry_m8vem_rjdwj_38",
|
|
39
|
+
"emphasized-baseline": "awsui_emphasized-baseline_m8vem_rjdwj_39",
|
|
40
|
+
"application": "awsui_application_m8vem_rjdwj_40",
|
|
41
|
+
"highlight-marker": "awsui_highlight-marker_m8vem_rjdwj_41",
|
|
42
|
+
"highlight-marker-selected": "awsui_highlight-marker-selected_m8vem_rjdwj_42"
|
|
38
43
|
};
|
|
39
44
|
|
package/core/utils.d.ts
CHANGED
|
@@ -92,4 +92,5 @@ export declare function getPointAccessibleDescription(point: SafePoint, labels:
|
|
|
92
92
|
sizeAxis?: readonly CoreChartProps.SizeAxisOptions[];
|
|
93
93
|
}): string;
|
|
94
94
|
export declare function getGroupAccessibleDescription(group: readonly SafePoint[]): string;
|
|
95
|
+
export declare function isInsidePlot(chart: SafeChart, chartX: number, chartY: number): boolean;
|
|
95
96
|
export {};
|
package/core/utils.js
CHANGED
|
@@ -374,4 +374,10 @@ function getChartRect(rect, chart, canBeInverted) {
|
|
|
374
374
|
height: rect.height,
|
|
375
375
|
};
|
|
376
376
|
}
|
|
377
|
+
export function isInsidePlot(chart, chartX, chartY) {
|
|
378
|
+
return (chartX >= chart.plotLeft &&
|
|
379
|
+
chartX <= chart.plotLeft + chart.plotWidth &&
|
|
380
|
+
chartY >= chart.plotTop &&
|
|
381
|
+
chartY <= chart.plotTop + chart.plotHeight);
|
|
382
|
+
}
|
|
377
383
|
//# sourceMappingURL=utils.js.map
|
package/core/utils.js.map
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":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type Highcharts from \"highcharts\";\n\nimport { ChartSeriesMarkerType } from \"../internal/components/series-marker\";\nimport { ChartSeriesMarkerStatus } from \"../internal/components/series-marker/interfaces\";\nimport {\n getChartSeries,\n getPointZone,\n getSeriesData,\n SafeChart,\n SafePoint,\n SafeSeries,\n} from \"../internal/utils/highcharts\";\nimport { castArray } from \"../internal/utils/utils\";\nimport { getFormatter } from \"./formatters\";\nimport { ChartLabels } from \"./i18n-utils\";\nimport { CoreChartProps, Rect } from \"./interfaces\";\n\nexport interface LegendItemSpec {\n id: string;\n name: string;\n markerType: ChartSeriesMarkerType;\n color: string;\n visible: boolean;\n isSecondary: boolean;\n status?: ChartSeriesMarkerStatus;\n markerAriaLabel?: string;\n}\n\n// The below functions extract unique identifier from series, point, or options. The identifier can be item's ID or name.\n// We expect that items requiring referencing (e.g. in order to control their visibility) have the unique identifier defined.\n// Otherwise, we return a randomized id that is to ensure no accidental matches.\nexport function getSeriesId(series: SafeSeries): string {\n return getOptionsId(series.options);\n}\nexport function getPointId(point: SafePoint): string {\n return getOptionsId(point.options);\n}\nexport function getOptionsId(options: { id?: string; name?: string }): string {\n return options.id ?? options.name ?? noIdPlaceholder();\n}\nfunction noIdPlaceholder(): string {\n const rand = (Math.random() * 1_000_000).toFixed(0).padStart(6, \"0\");\n return \"awsui-no-id-placeholder-\" + rand;\n}\n\n// There are more possible values that series.stacking can take, but we only explicitly support \"normal\".\nexport function isSeriesStacked(series: SafeSeries) {\n return (series.options as any).stacking === \"normal\";\n}\n\n// The threshold series are custom series, implemented as a combination of line series, and plot lines.\n// As Highcharts does not support custom series declaration, we annotate threshold series by using the\n// series.custom property. This is then used in our utilities to recognize threshold series, and retrieve\n// the associated threshold value.\ninterface ThresholdOptions<T extends \"x-threshold\" | \"y-threshold\"> {\n custom: {\n awsui: {\n type: T;\n threshold: number;\n };\n };\n}\nexport function createThresholdMetadata<T extends \"x-threshold\" | \"y-threshold\">(\n type: T,\n value: number,\n): ThresholdOptions<T> {\n return { custom: { awsui: { type, threshold: value } } };\n}\nexport function isXThreshold(s: SafeSeries): s is SafeSeries & { options: ThresholdOptions<\"x-threshold\"> } {\n return typeof s.options.custom === \"object\" && s.options.custom.awsui?.type === \"x-threshold\";\n}\nexport function isYThreshold(s: SafeSeries): s is SafeSeries & { options: ThresholdOptions<\"y-threshold\"> } {\n return typeof s.options.custom === \"object\" && s.options.custom.awsui?.type === \"y-threshold\";\n}\n\n// We extend bubble series by introducing sizeAxis - which is used to define title and formatter for bubble series size values.\n// In case there are multiple such axes - the bubble series can target a specific one by setting sizeAxis to the respective size\n// axis id. As there is no such prop in Highcharts series type - we pass it using the custom options object.\nexport interface BubbleOptions {\n custom: {\n awsui: {\n sizeAxis?: string;\n };\n };\n}\nexport function createBubbleMetadata(options: { sizeAxis?: string }): BubbleOptions {\n return { custom: { awsui: options } };\n}\nexport function getBubbleSeriesSizeAxis(series: SafeSeries): undefined | string {\n const { custom } = series.options as Highcharts.SeriesOptionsType & BubbleOptions;\n return custom?.awsui?.sizeAxis;\n}\n\nexport function getPointMarkerType(point?: SafePoint): ChartSeriesMarkerType {\n const pointZone = point && getPointZone(point);\n return getSeriesMarkerType(point?.series, pointZone?.dashStyle);\n}\n\nexport function getSeriesMarkerType(series?: SafeSeries, dashStyle?: Highcharts.DashStyleValue): ChartSeriesMarkerType {\n if (!series) {\n return \"large-square\";\n }\n const seriesSymbol = \"symbol\" in series && typeof series.symbol === \"string\" ? series.symbol : \"circle\";\n // In Highcharts, dashStyle supports different types of dashes: https://jsfiddle.net/gh/get/library/pure/highcharts/highcharts/tree/master/samples/highcharts/plotoptions/series-dashstyle-all/\n // Return a dashed legend symbol for all of these dashes, excluding the default \"Solid\" option\n if (\n (dashStyle && dashStyle !== \"Solid\") ||\n (\"dashStyle\" in series.options && series.options.dashStyle && series.options.dashStyle !== \"Solid\")\n ) {\n return \"dashed\";\n }\n switch (series.type) {\n case \"area\":\n case \"areaspline\":\n return \"hollow-square\";\n case \"line\":\n case \"spline\":\n return \"line\";\n case \"scatter\":\n switch (seriesSymbol) {\n case \"square\":\n return \"square\";\n case \"diamond\":\n return \"diamond\";\n case \"triangle\":\n return \"triangle\";\n case \"triangle-down\":\n return \"triangle-down\";\n case \"circle\":\n default:\n return \"circle\";\n }\n case \"column\":\n case \"pie\":\n return \"large-square\";\n case \"bubble\":\n return \"circle\";\n case \"errorbar\":\n default:\n return \"large-square\";\n }\n}\n\n// Highcharts supports color objects to represent gradients and more, but we only support string\n// colors in our markers. In case a non-string color is defined, we use black color as as fallback.\nexport function getSeriesColor(series?: SafeSeries): string {\n return typeof series?.color === \"string\" ? series.color : \"black\";\n}\nexport function getPointColor(point?: SafePoint): string {\n const pointZone = point && getPointZone(point);\n const zoneColor = typeof pointZone?.color === \"string\" ? pointZone.color : undefined;\n const pointColor = typeof point?.color === \"string\" ? point.color : undefined;\n return zoneColor ?? pointColor ?? \"black\";\n}\n\n// The custom legend implementation does not rely on the Highcharts legend. When Highcharts legend is disabled,\n// the chart object does not include information on legend items. Instead, we collect series and pie segments\n// using this custom function, respecting Highcharts' showInLegend flag (defined for series only).\n\n// There exists a Highcharts APIs to access legend items, but it is unfortunately not available, when\n// Highcharts legend is disabled. Instead, we use this custom method to collect legend items from the chart.\nexport function getChartLegendItems({\n chart,\n getItemOptions = () => ({}),\n itemMarkerStatusAriaLabel,\n}: {\n chart: SafeChart;\n getItemOptions?: CoreChartProps.GetItemOptions;\n itemMarkerStatusAriaLabel?: ChartLabels[\"itemMarkerLabel\"];\n}): readonly LegendItemSpec[] {\n const legendItems: LegendItemSpec[] = [];\n const isInverted = chart.inverted ?? false;\n const addSeriesItem = (series: SafeSeries, isSecondary: boolean) => {\n // The pie series is not shown in the legend. Instead, we show pie segments.\n if (series.type === \"pie\") {\n return;\n }\n // We only support errorbar series that are linked to other series. Those are not represented separately\n // in the legend, but can be controlled from the outside, using controllable items visibility API.\n if (series.type === \"errorbar\") {\n return;\n }\n // We respect Highcharts showInLegend option to allow hiding certain series from the legend.\n // The same is not supported for pie chart segments.\n if (series.options.showInLegend !== false) {\n const seriesId = getSeriesId(series);\n const itemProps = getItemOptions(seriesId);\n const status = itemProps.status;\n legendItems.push({\n id: seriesId,\n name: series.name,\n markerType: getSeriesMarkerType(series),\n color: getSeriesColor(series),\n visible: series.visible,\n isSecondary,\n status: status,\n markerAriaLabel: itemMarkerStatusAriaLabel?.(status),\n });\n }\n };\n const addPointItem = (point: SafePoint, isSecondary: boolean) => {\n if (point?.series?.type === \"pie\") {\n const pointId = getPointId(point);\n legendItems.push({\n id: pointId,\n name: point.name,\n markerType: getSeriesMarkerType(point.series),\n color: getPointColor(point),\n visible: point.visible,\n status: getItemOptions(pointId).status,\n isSecondary,\n });\n }\n };\n for (const s of getChartSeries(chart)) {\n const valueAxis = isInverted ? s.xAxis : s.yAxis;\n const isSecondary = valueAxis?.options?.opposite ?? false;\n addSeriesItem(s, isSecondary);\n getSeriesData(s, { includeHiddenPoints: true }).forEach((p) => addPointItem(p, isSecondary));\n }\n return legendItems;\n}\n\nexport type LegendItemOptions = Highcharts.SeriesOptionsType | Highcharts.PointOptionsType;\n\nexport function getVisibleLegendItems(options: Highcharts.Options) {\n // Highcharts implicitly inverts the chart when its type or any series type is \"bar\", even if chart.inverted is unset.\n const isInverted =\n options.chart?.inverted === true ||\n options.chart?.type === \"bar\" ||\n options.series?.some((series) => \"type\" in series && series.type === \"bar\") === true;\n\n const valueAxes = (isInverted ? castArray(options.xAxis) : castArray(options.yAxis)) ?? [];\n const defaultOpposite = valueAxes.length > 0 ? (valueAxes[0].opposite ?? false) : false;\n\n const primaryAxis = valueAxes.find((a) => !(a.opposite ?? false));\n const secondaryAxis = valueAxes.find((a) => a.opposite === true);\n\n const primaryItems: LegendItemOptions[] = [];\n const secondaryItems: LegendItemOptions[] = [];\n const addLegendItem = (item: LegendItemOptions) => {\n if (isSecondaryLegendItem(item, isInverted, defaultOpposite, valueAxes)) {\n secondaryItems.push(item);\n } else {\n primaryItems.push(item);\n }\n };\n\n options.series?.forEach((series) => {\n if (!(\"type\" in series)) {\n return;\n }\n\n // The pie series is not shown in the legend. Instead, we show pie segments (points).\n if (series.type === \"pie\") {\n if (Array.isArray(series.data)) {\n series.data.forEach((point) => addLegendItem(point));\n }\n return;\n }\n // We only support errorbar series that are linked to other series. Those are not represented separately\n // in the legend, but can be controlled from the outside, using controllable items visibility API.\n if (series.type === \"errorbar\") {\n return;\n }\n if (series.showInLegend !== false) {\n addLegendItem(series);\n }\n });\n\n return { primaryItems, secondaryItems, primaryAxisId: primaryAxis?.id, secondaryAxisId: secondaryAxis?.id };\n}\n\nfunction isSecondaryLegendItem(\n item: LegendItemOptions,\n isInverted: boolean,\n defaultOpposite: boolean,\n valueAxes: Array<{ id?: string; opposite?: boolean }>,\n): boolean {\n // Only items that have an associated axis can be considered secondary\n if (item && typeof item === \"object\" && (\"xAxis\" in item || \"yAxis\" in item)) {\n const axisRef = isInverted ? (item.xAxis ?? 0) : (item.yAxis ?? 0);\n // An axis reference can be an index into the axes array or an explicitly passed id\n const valueAxis = typeof axisRef === \"number\" ? valueAxes[axisRef] : valueAxes.find((a) => a.id === axisRef);\n return valueAxis?.opposite ?? false;\n }\n return defaultOpposite;\n}\n\nexport function getLegendsProps(\n options: CoreChartProps.ChartOptions,\n legendOptions: CoreChartProps.LegendOptions | undefined,\n) {\n // While Highcharts supports more than two axes, this\n // implementation supports at most two, in which case one\n // of them must be set as opposite (secondary).\n const { primaryItems, secondaryItems, primaryAxisId, secondaryAxisId } = getVisibleLegendItems(options);\n return {\n primary:\n primaryItems.length === 0\n ? undefined\n : ({\n isSecondary: false,\n axisId: primaryAxisId,\n title: legendOptions?.title,\n actions: legendOptions?.actions,\n alignment: legendOptions?.position === \"side\" ? \"vertical\" : \"horizontal\",\n horizontalAlignment: secondaryItems.length === 0 ? legendOptions?.horizontalAlignment : \"start\",\n enableHorizontalScroll: legendOptions?.enableHorizontalScroll,\n } as const),\n secondary:\n secondaryItems.length === 0\n ? undefined\n : ({\n isSecondary: true,\n axisId: secondaryAxisId,\n title: legendOptions?.secondaryLegendTitle,\n actions: legendOptions?.secondaryLegendActions,\n alignment: legendOptions?.position === \"side\" ? \"vertical\" : \"horizontal\",\n horizontalAlignment: \"end\",\n enableHorizontalScroll: legendOptions?.enableHorizontalScroll,\n } as const),\n };\n}\n\n// This function returns coordinates of a rectangle, including the target point.\n// There are differences in how the rectangle is computed, but in all cases it is supposed to\n// enclose the point's visual representation in the chart, with no extra offsets.\nexport function getPointRect(point: SafePoint): Rect {\n if (!point.series) {\n return { x: 0, y: 0, width: 0, height: 0 };\n }\n\n switch (point.series.type) {\n case \"column\":\n return getColumnPointRect(point);\n case \"errorbar\":\n return getErrorBarPointRect(point);\n default:\n return getDefaultPointRect(point);\n }\n}\n\n// The group rect is only used for cartesian charts. It returns coordinates of a rectangle,\n// which includes all given points, but also stretched vertically or horizontally (in inverted charts)\n// to the entire chart's height or width.\nexport function getGroupRect(points: readonly SafePoint[]): Rect {\n if (points.length === 0 || !points[0].series) {\n return { x: 0, y: 0, width: 0, height: 0 };\n }\n const chart = points[0].series.chart;\n const rects = points.map(getPointRect);\n const [first, ...rest] = rects;\n let minX = first.x,\n minY = first.y,\n maxX = first.x + first.width,\n maxY = first.y + first.height;\n for (const r of rest) {\n minX = Math.min(minX, r.x);\n minY = Math.min(minY, r.y);\n maxX = Math.max(maxX, r.x + r.width);\n maxY = Math.max(maxY, r.y + r.height);\n }\n return safeRect(\n chart.inverted\n ? { x: chart.plotLeft, y: minY, width: chart.plotWidth, height: maxY - minY }\n : { x: minX, y: chart.plotTop, width: maxX - minX, height: chart.plotHeight },\n );\n}\n\n// We ensure rect width and height are non-zero to ensure its position is calculated correctly in Firefox.\nexport function safeRect(rect: Rect): Rect {\n return { ...rect, width: Math.max(0.1, rect.width), height: Math.max(0.1, rect.height) };\n}\n\nexport function getChartAccessibleDescription(chart: SafeChart) {\n return chart.options.lang?.accessibility?.chartContainerLabel ?? \"\";\n}\n\nexport function matchSizeAxis(sizeAxis: readonly CoreChartProps.SizeAxisOptions[], series: SafeSeries) {\n return sizeAxis.find((a) => a.id === getBubbleSeriesSizeAxis(series)) ?? sizeAxis[0];\n}\n\nexport function getPointAccessibleDescription(\n point: SafePoint,\n labels: ChartLabels,\n additionalProps?: {\n sizeAxis?: readonly CoreChartProps.SizeAxisOptions[];\n },\n) {\n if (point.series.xAxis && point.series.yAxis) {\n const formattedX = getFormatter(point.series.xAxis)(point.x);\n const formattedY = getFormatter(point.series.yAxis)(point.y);\n let formattedSize = \"\";\n if (additionalProps?.sizeAxis && point.series.type === \"bubble\") {\n const matchedSizeAxis = matchSizeAxis(additionalProps.sizeAxis, point.series);\n const size = point.options.z ?? null;\n const sizeFormatter = getFormatter(matchedSizeAxis);\n formattedSize = sizeFormatter(size);\n }\n return `${formattedX} ${formattedY}${formattedSize ? \" \" + formattedSize : \"\"}, ${point.series.name}`;\n } else if (point.series.type === \"pie\") {\n const segmentLabel = labels.chartSegmentLabel ? `${labels.chartSegmentLabel} ` : \"\";\n return `${segmentLabel}${point.name}, ${point.y}. ${point.series.name}`;\n } else {\n return \"\";\n }\n}\n\nexport function getGroupAccessibleDescription(group: readonly SafePoint[]) {\n const firstPoint = group[0];\n return getFormatter(firstPoint.series.xAxis)(firstPoint.x);\n}\n\n// The area-, line-, or scatter series markers are rendered as single graphic elements,\n// and we can use their respective b-boxes to compute rects.\nfunction getDefaultPointRect(point: SafePoint): Rect {\n const chart = point.series.chart;\n if (point.graphic) {\n const box = point.graphic.getBBox();\n return getChartRect(box, chart, false);\n }\n return getPointRectFromCoordinates(point);\n}\n\n// The column series graphic elements are rectangles, and they are inverted if the chart is inverted,\n// so that rect's width becomes height and vice-versa.\nfunction getColumnPointRect(point: SafePoint): Rect {\n const chart = point.series.chart;\n if (point.graphic) {\n return getChartRect(point.graphic.getBBox(), chart, true);\n }\n return getPointRectFromCoordinates(point);\n}\n\n// The errorbar series point rect cannot be computed from the respective graphic element (it gives wrong position).\n// Instead, we have to rely on the internal \"whiskers\" element b-box, which can be inverted, too.\nfunction getErrorBarPointRect(point: SafePoint): Rect {\n const chart = point.series.chart;\n if (\"whiskers\" in point) {\n return getChartRect((point.whiskers as Highcharts.SVGElement).getBBox(), chart, true);\n }\n return getPointRectFromCoordinates(point);\n}\n\n// The point graphic is not present in large charts to optimize performance.\n// In that case we compute point rects from their coordinates. We also assume the point\n// size is small, and thereby give it 0 width and height, which is alright as there is a\n// small offset that we use for focus outline anyways.\n// See: https://www.highcharts.com/blog/news/175-highcharts-performance-boost/\nfunction getPointRectFromCoordinates(point: SafePoint) {\n const chart = point.series.chart;\n const plotX = point.plotX ?? 0;\n const plotY = point.plotY ?? 0;\n return getChartRect({ x: plotX, y: plotY, width: 0, height: 0 }, chart, true);\n}\n\nfunction getChartRect(rect: Rect, chart: SafeChart, canBeInverted: boolean): Rect {\n return canBeInverted && chart.inverted\n ? {\n x: chart.plotWidth + chart.plotLeft - (rect.y + rect.height),\n y: chart.plotHeight + chart.plotTop - (rect.x + rect.width),\n width: rect.height,\n height: rect.width,\n }\n : {\n x: chart.plotLeft + rect.x,\n y: chart.plotTop + rect.y,\n width: rect.width,\n height: rect.height,\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/core/utils.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAMtC,OAAO,EACL,cAAc,EACd,YAAY,EACZ,aAAa,GAId,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAe5C,yHAAyH;AACzH,6HAA6H;AAC7H,gFAAgF;AAChF,MAAM,UAAU,WAAW,CAAC,MAAkB;IAC5C,OAAO,YAAY,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AACtC,CAAC;AACD,MAAM,UA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AE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;AAChF,CAAC;AAED,SAAS,YAAY,CAAC,IAAU,EAAE,KAAgB,EAAE,aAAsB;IACxE,OAAO,aAAa,IAAI,KAAK,CAAC,QAAQ;QACpC,CAAC,CAAC;YACE,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC,QAAQ,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;YAC5D,CAAC,EAAE,KAAK,CAAC,UAAU,GAAG,KAAK,CAAC,OAAO,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC;YAC3D,KAAK,EAAE,IAAI,CAAC,MAAM;YAClB,MAAM,EAAE,IAAI,CAAC,KAAK;SACnB;QACH,CAAC,CAAC;YACE,CAAC,EAAE,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAC;YAC1B,CAAC,EAAE,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC;YACzB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,MAAM,EAAE,IAAI,CAAC,MAAM;SACpB,CAAC;AACR,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,KAAgB,EAAE,MAAc,EAAE,MAAc;IAC3E,OAAO,CACL,MAAM,IAAI,KAAK,CAAC,QAAQ;QACxB,MAAM,IAAI,KAAK,CAAC,QAAQ,GAAG,KAAK,CAAC,SAAS;QAC1C,MAAM,IAAI,KAAK,CAAC,OAAO;QACvB,MAAM,IAAI,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC,UAAU,CAC3C,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type Highcharts from \"highcharts\";\n\nimport { ChartSeriesMarkerType } from \"../internal/components/series-marker\";\nimport { ChartSeriesMarkerStatus } from \"../internal/components/series-marker/interfaces\";\nimport {\n getChartSeries,\n getPointZone,\n getSeriesData,\n SafeChart,\n SafePoint,\n SafeSeries,\n} from \"../internal/utils/highcharts\";\nimport { castArray } from \"../internal/utils/utils\";\nimport { getFormatter } from \"./formatters\";\nimport { ChartLabels } from \"./i18n-utils\";\nimport { CoreChartProps, Rect } from \"./interfaces\";\n\nexport interface LegendItemSpec {\n id: string;\n name: string;\n markerType: ChartSeriesMarkerType;\n color: string;\n visible: boolean;\n isSecondary: boolean;\n status?: ChartSeriesMarkerStatus;\n markerAriaLabel?: string;\n}\n\n// The below functions extract unique identifier from series, point, or options. The identifier can be item's ID or name.\n// We expect that items requiring referencing (e.g. in order to control their visibility) have the unique identifier defined.\n// Otherwise, we return a randomized id that is to ensure no accidental matches.\nexport function getSeriesId(series: SafeSeries): string {\n return getOptionsId(series.options);\n}\nexport function getPointId(point: SafePoint): string {\n return getOptionsId(point.options);\n}\nexport function getOptionsId(options: { id?: string; name?: string }): string {\n return options.id ?? options.name ?? noIdPlaceholder();\n}\nfunction noIdPlaceholder(): string {\n const rand = (Math.random() * 1_000_000).toFixed(0).padStart(6, \"0\");\n return \"awsui-no-id-placeholder-\" + rand;\n}\n\n// There are more possible values that series.stacking can take, but we only explicitly support \"normal\".\nexport function isSeriesStacked(series: SafeSeries) {\n return (series.options as any).stacking === \"normal\";\n}\n\n// The threshold series are custom series, implemented as a combination of line series, and plot lines.\n// As Highcharts does not support custom series declaration, we annotate threshold series by using the\n// series.custom property. This is then used in our utilities to recognize threshold series, and retrieve\n// the associated threshold value.\ninterface ThresholdOptions<T extends \"x-threshold\" | \"y-threshold\"> {\n custom: {\n awsui: {\n type: T;\n threshold: number;\n };\n };\n}\nexport function createThresholdMetadata<T extends \"x-threshold\" | \"y-threshold\">(\n type: T,\n value: number,\n): ThresholdOptions<T> {\n return { custom: { awsui: { type, threshold: value } } };\n}\nexport function isXThreshold(s: SafeSeries): s is SafeSeries & { options: ThresholdOptions<\"x-threshold\"> } {\n return typeof s.options.custom === \"object\" && s.options.custom.awsui?.type === \"x-threshold\";\n}\nexport function isYThreshold(s: SafeSeries): s is SafeSeries & { options: ThresholdOptions<\"y-threshold\"> } {\n return typeof s.options.custom === \"object\" && s.options.custom.awsui?.type === \"y-threshold\";\n}\n\n// We extend bubble series by introducing sizeAxis - which is used to define title and formatter for bubble series size values.\n// In case there are multiple such axes - the bubble series can target a specific one by setting sizeAxis to the respective size\n// axis id. As there is no such prop in Highcharts series type - we pass it using the custom options object.\nexport interface BubbleOptions {\n custom: {\n awsui: {\n sizeAxis?: string;\n };\n };\n}\nexport function createBubbleMetadata(options: { sizeAxis?: string }): BubbleOptions {\n return { custom: { awsui: options } };\n}\nexport function getBubbleSeriesSizeAxis(series: SafeSeries): undefined | string {\n const { custom } = series.options as Highcharts.SeriesOptionsType & BubbleOptions;\n return custom?.awsui?.sizeAxis;\n}\n\nexport function getPointMarkerType(point?: SafePoint): ChartSeriesMarkerType {\n const pointZone = point && getPointZone(point);\n return getSeriesMarkerType(point?.series, pointZone?.dashStyle);\n}\n\nexport function getSeriesMarkerType(series?: SafeSeries, dashStyle?: Highcharts.DashStyleValue): ChartSeriesMarkerType {\n if (!series) {\n return \"large-square\";\n }\n const seriesSymbol = \"symbol\" in series && typeof series.symbol === \"string\" ? series.symbol : \"circle\";\n // In Highcharts, dashStyle supports different types of dashes: https://jsfiddle.net/gh/get/library/pure/highcharts/highcharts/tree/master/samples/highcharts/plotoptions/series-dashstyle-all/\n // Return a dashed legend symbol for all of these dashes, excluding the default \"Solid\" option\n if (\n (dashStyle && dashStyle !== \"Solid\") ||\n (\"dashStyle\" in series.options && series.options.dashStyle && series.options.dashStyle !== \"Solid\")\n ) {\n return \"dashed\";\n }\n switch (series.type) {\n case \"area\":\n case \"areaspline\":\n return \"hollow-square\";\n case \"line\":\n case \"spline\":\n return \"line\";\n case \"scatter\":\n switch (seriesSymbol) {\n case \"square\":\n return \"square\";\n case \"diamond\":\n return \"diamond\";\n case \"triangle\":\n return \"triangle\";\n case \"triangle-down\":\n return \"triangle-down\";\n case \"circle\":\n default:\n return \"circle\";\n }\n case \"column\":\n case \"pie\":\n return \"large-square\";\n case \"bubble\":\n return \"circle\";\n case \"errorbar\":\n default:\n return \"large-square\";\n }\n}\n\n// Highcharts supports color objects to represent gradients and more, but we only support string\n// colors in our markers. In case a non-string color is defined, we use black color as as fallback.\nexport function getSeriesColor(series?: SafeSeries): string {\n return typeof series?.color === \"string\" ? series.color : \"black\";\n}\nexport function getPointColor(point?: SafePoint): string {\n const pointZone = point && getPointZone(point);\n const zoneColor = typeof pointZone?.color === \"string\" ? pointZone.color : undefined;\n const pointColor = typeof point?.color === \"string\" ? point.color : undefined;\n return zoneColor ?? pointColor ?? \"black\";\n}\n\n// The custom legend implementation does not rely on the Highcharts legend. When Highcharts legend is disabled,\n// the chart object does not include information on legend items. Instead, we collect series and pie segments\n// using this custom function, respecting Highcharts' showInLegend flag (defined for series only).\n\n// There exists a Highcharts APIs to access legend items, but it is unfortunately not available, when\n// Highcharts legend is disabled. Instead, we use this custom method to collect legend items from the chart.\nexport function getChartLegendItems({\n chart,\n getItemOptions = () => ({}),\n itemMarkerStatusAriaLabel,\n}: {\n chart: SafeChart;\n getItemOptions?: CoreChartProps.GetItemOptions;\n itemMarkerStatusAriaLabel?: ChartLabels[\"itemMarkerLabel\"];\n}): readonly LegendItemSpec[] {\n const legendItems: LegendItemSpec[] = [];\n const isInverted = chart.inverted ?? false;\n const addSeriesItem = (series: SafeSeries, isSecondary: boolean) => {\n // The pie series is not shown in the legend. Instead, we show pie segments.\n if (series.type === \"pie\") {\n return;\n }\n // We only support errorbar series that are linked to other series. Those are not represented separately\n // in the legend, but can be controlled from the outside, using controllable items visibility API.\n if (series.type === \"errorbar\") {\n return;\n }\n // We respect Highcharts showInLegend option to allow hiding certain series from the legend.\n // The same is not supported for pie chart segments.\n if (series.options.showInLegend !== false) {\n const seriesId = getSeriesId(series);\n const itemProps = getItemOptions(seriesId);\n const status = itemProps.status;\n legendItems.push({\n id: seriesId,\n name: series.name,\n markerType: getSeriesMarkerType(series),\n color: getSeriesColor(series),\n visible: series.visible,\n isSecondary,\n status: status,\n markerAriaLabel: itemMarkerStatusAriaLabel?.(status),\n });\n }\n };\n const addPointItem = (point: SafePoint, isSecondary: boolean) => {\n if (point?.series?.type === \"pie\") {\n const pointId = getPointId(point);\n legendItems.push({\n id: pointId,\n name: point.name,\n markerType: getSeriesMarkerType(point.series),\n color: getPointColor(point),\n visible: point.visible,\n status: getItemOptions(pointId).status,\n isSecondary,\n });\n }\n };\n for (const s of getChartSeries(chart)) {\n const valueAxis = isInverted ? s.xAxis : s.yAxis;\n const isSecondary = valueAxis?.options?.opposite ?? false;\n addSeriesItem(s, isSecondary);\n getSeriesData(s, { includeHiddenPoints: true }).forEach((p) => addPointItem(p, isSecondary));\n }\n return legendItems;\n}\n\nexport type LegendItemOptions = Highcharts.SeriesOptionsType | Highcharts.PointOptionsType;\n\nexport function getVisibleLegendItems(options: Highcharts.Options) {\n // Highcharts implicitly inverts the chart when its type or any series type is \"bar\", even if chart.inverted is unset.\n const isInverted =\n options.chart?.inverted === true ||\n options.chart?.type === \"bar\" ||\n options.series?.some((series) => \"type\" in series && series.type === \"bar\") === true;\n\n const valueAxes = (isInverted ? castArray(options.xAxis) : castArray(options.yAxis)) ?? [];\n const defaultOpposite = valueAxes.length > 0 ? (valueAxes[0].opposite ?? false) : false;\n\n const primaryAxis = valueAxes.find((a) => !(a.opposite ?? false));\n const secondaryAxis = valueAxes.find((a) => a.opposite === true);\n\n const primaryItems: LegendItemOptions[] = [];\n const secondaryItems: LegendItemOptions[] = [];\n const addLegendItem = (item: LegendItemOptions) => {\n if (isSecondaryLegendItem(item, isInverted, defaultOpposite, valueAxes)) {\n secondaryItems.push(item);\n } else {\n primaryItems.push(item);\n }\n };\n\n options.series?.forEach((series) => {\n if (!(\"type\" in series)) {\n return;\n }\n\n // The pie series is not shown in the legend. Instead, we show pie segments (points).\n if (series.type === \"pie\") {\n if (Array.isArray(series.data)) {\n series.data.forEach((point) => addLegendItem(point));\n }\n return;\n }\n // We only support errorbar series that are linked to other series. Those are not represented separately\n // in the legend, but can be controlled from the outside, using controllable items visibility API.\n if (series.type === \"errorbar\") {\n return;\n }\n if (series.showInLegend !== false) {\n addLegendItem(series);\n }\n });\n\n return { primaryItems, secondaryItems, primaryAxisId: primaryAxis?.id, secondaryAxisId: secondaryAxis?.id };\n}\n\nfunction isSecondaryLegendItem(\n item: LegendItemOptions,\n isInverted: boolean,\n defaultOpposite: boolean,\n valueAxes: Array<{ id?: string; opposite?: boolean }>,\n): boolean {\n // Only items that have an associated axis can be considered secondary\n if (item && typeof item === \"object\" && (\"xAxis\" in item || \"yAxis\" in item)) {\n const axisRef = isInverted ? (item.xAxis ?? 0) : (item.yAxis ?? 0);\n // An axis reference can be an index into the axes array or an explicitly passed id\n const valueAxis = typeof axisRef === \"number\" ? valueAxes[axisRef] : valueAxes.find((a) => a.id === axisRef);\n return valueAxis?.opposite ?? false;\n }\n return defaultOpposite;\n}\n\nexport function getLegendsProps(\n options: CoreChartProps.ChartOptions,\n legendOptions: CoreChartProps.LegendOptions | undefined,\n) {\n // While Highcharts supports more than two axes, this\n // implementation supports at most two, in which case one\n // of them must be set as opposite (secondary).\n const { primaryItems, secondaryItems, primaryAxisId, secondaryAxisId } = getVisibleLegendItems(options);\n return {\n primary:\n primaryItems.length === 0\n ? undefined\n : ({\n isSecondary: false,\n axisId: primaryAxisId,\n title: legendOptions?.title,\n actions: legendOptions?.actions,\n alignment: legendOptions?.position === \"side\" ? \"vertical\" : \"horizontal\",\n horizontalAlignment: secondaryItems.length === 0 ? legendOptions?.horizontalAlignment : \"start\",\n enableHorizontalScroll: legendOptions?.enableHorizontalScroll,\n } as const),\n secondary:\n secondaryItems.length === 0\n ? undefined\n : ({\n isSecondary: true,\n axisId: secondaryAxisId,\n title: legendOptions?.secondaryLegendTitle,\n actions: legendOptions?.secondaryLegendActions,\n alignment: legendOptions?.position === \"side\" ? \"vertical\" : \"horizontal\",\n horizontalAlignment: \"end\",\n enableHorizontalScroll: legendOptions?.enableHorizontalScroll,\n } as const),\n };\n}\n\n// This function returns coordinates of a rectangle, including the target point.\n// There are differences in how the rectangle is computed, but in all cases it is supposed to\n// enclose the point's visual representation in the chart, with no extra offsets.\nexport function getPointRect(point: SafePoint): Rect {\n if (!point.series) {\n return { x: 0, y: 0, width: 0, height: 0 };\n }\n\n switch (point.series.type) {\n case \"column\":\n return getColumnPointRect(point);\n case \"errorbar\":\n return getErrorBarPointRect(point);\n default:\n return getDefaultPointRect(point);\n }\n}\n\n// The group rect is only used for cartesian charts. It returns coordinates of a rectangle,\n// which includes all given points, but also stretched vertically or horizontally (in inverted charts)\n// to the entire chart's height or width.\nexport function getGroupRect(points: readonly SafePoint[]): Rect {\n if (points.length === 0 || !points[0].series) {\n return { x: 0, y: 0, width: 0, height: 0 };\n }\n const chart = points[0].series.chart;\n const rects = points.map(getPointRect);\n const [first, ...rest] = rects;\n let minX = first.x,\n minY = first.y,\n maxX = first.x + first.width,\n maxY = first.y + first.height;\n for (const r of rest) {\n minX = Math.min(minX, r.x);\n minY = Math.min(minY, r.y);\n maxX = Math.max(maxX, r.x + r.width);\n maxY = Math.max(maxY, r.y + r.height);\n }\n return safeRect(\n chart.inverted\n ? { x: chart.plotLeft, y: minY, width: chart.plotWidth, height: maxY - minY }\n : { x: minX, y: chart.plotTop, width: maxX - minX, height: chart.plotHeight },\n );\n}\n\n// We ensure rect width and height are non-zero to ensure its position is calculated correctly in Firefox.\nexport function safeRect(rect: Rect): Rect {\n return { ...rect, width: Math.max(0.1, rect.width), height: Math.max(0.1, rect.height) };\n}\n\nexport function getChartAccessibleDescription(chart: SafeChart) {\n return chart.options.lang?.accessibility?.chartContainerLabel ?? \"\";\n}\n\nexport function matchSizeAxis(sizeAxis: readonly CoreChartProps.SizeAxisOptions[], series: SafeSeries) {\n return sizeAxis.find((a) => a.id === getBubbleSeriesSizeAxis(series)) ?? sizeAxis[0];\n}\n\nexport function getPointAccessibleDescription(\n point: SafePoint,\n labels: ChartLabels,\n additionalProps?: {\n sizeAxis?: readonly CoreChartProps.SizeAxisOptions[];\n },\n) {\n if (point.series.xAxis && point.series.yAxis) {\n const formattedX = getFormatter(point.series.xAxis)(point.x);\n const formattedY = getFormatter(point.series.yAxis)(point.y);\n let formattedSize = \"\";\n if (additionalProps?.sizeAxis && point.series.type === \"bubble\") {\n const matchedSizeAxis = matchSizeAxis(additionalProps.sizeAxis, point.series);\n const size = point.options.z ?? null;\n const sizeFormatter = getFormatter(matchedSizeAxis);\n formattedSize = sizeFormatter(size);\n }\n return `${formattedX} ${formattedY}${formattedSize ? \" \" + formattedSize : \"\"}, ${point.series.name}`;\n } else if (point.series.type === \"pie\") {\n const segmentLabel = labels.chartSegmentLabel ? `${labels.chartSegmentLabel} ` : \"\";\n return `${segmentLabel}${point.name}, ${point.y}. ${point.series.name}`;\n } else {\n return \"\";\n }\n}\n\nexport function getGroupAccessibleDescription(group: readonly SafePoint[]) {\n const firstPoint = group[0];\n return getFormatter(firstPoint.series.xAxis)(firstPoint.x);\n}\n\n// The area-, line-, or scatter series markers are rendered as single graphic elements,\n// and we can use their respective b-boxes to compute rects.\nfunction getDefaultPointRect(point: SafePoint): Rect {\n const chart = point.series.chart;\n if (point.graphic) {\n const box = point.graphic.getBBox();\n return getChartRect(box, chart, false);\n }\n return getPointRectFromCoordinates(point);\n}\n\n// The column series graphic elements are rectangles, and they are inverted if the chart is inverted,\n// so that rect's width becomes height and vice-versa.\nfunction getColumnPointRect(point: SafePoint): Rect {\n const chart = point.series.chart;\n if (point.graphic) {\n return getChartRect(point.graphic.getBBox(), chart, true);\n }\n return getPointRectFromCoordinates(point);\n}\n\n// The errorbar series point rect cannot be computed from the respective graphic element (it gives wrong position).\n// Instead, we have to rely on the internal \"whiskers\" element b-box, which can be inverted, too.\nfunction getErrorBarPointRect(point: SafePoint): Rect {\n const chart = point.series.chart;\n if (\"whiskers\" in point) {\n return getChartRect((point.whiskers as Highcharts.SVGElement).getBBox(), chart, true);\n }\n return getPointRectFromCoordinates(point);\n}\n\n// The point graphic is not present in large charts to optimize performance.\n// In that case we compute point rects from their coordinates. We also assume the point\n// size is small, and thereby give it 0 width and height, which is alright as there is a\n// small offset that we use for focus outline anyways.\n// See: https://www.highcharts.com/blog/news/175-highcharts-performance-boost/\nfunction getPointRectFromCoordinates(point: SafePoint) {\n const chart = point.series.chart;\n const plotX = point.plotX ?? 0;\n const plotY = point.plotY ?? 0;\n return getChartRect({ x: plotX, y: plotY, width: 0, height: 0 }, chart, true);\n}\n\nfunction getChartRect(rect: Rect, chart: SafeChart, canBeInverted: boolean): Rect {\n return canBeInverted && chart.inverted\n ? {\n x: chart.plotWidth + chart.plotLeft - (rect.y + rect.height),\n y: chart.plotHeight + chart.plotTop - (rect.x + rect.width),\n width: rect.height,\n height: rect.width,\n }\n : {\n x: chart.plotLeft + rect.x,\n y: chart.plotTop + rect.y,\n width: rect.width,\n height: rect.height,\n };\n}\n\nexport function isInsidePlot(chart: SafeChart, chartX: number, chartY: number): boolean {\n return (\n chartX >= chart.plotLeft &&\n chartX <= chart.plotLeft + chart.plotWidth &&\n chartY >= chart.plotTop &&\n chartY <= chart.plotTop + chart.plotHeight\n );\n}\n"]}
|
|
@@ -72,6 +72,7 @@ export declare const cursorLine: {
|
|
|
72
72
|
zIndex: number;
|
|
73
73
|
"pointer-events": string;
|
|
74
74
|
};
|
|
75
|
+
export declare const zoomDividerThickness = 1;
|
|
75
76
|
export declare const zoomRangeBand: {
|
|
76
77
|
fill: string;
|
|
77
78
|
zIndex: number;
|
|
@@ -83,6 +84,17 @@ export declare const zoomRangeBorders: {
|
|
|
83
84
|
zIndex: number;
|
|
84
85
|
"pointer-events": string;
|
|
85
86
|
};
|
|
87
|
+
export declare const zoomSelectionBand: {
|
|
88
|
+
fill: string;
|
|
89
|
+
opacity: number;
|
|
90
|
+
zIndex: number;
|
|
91
|
+
"pointer-events": string;
|
|
92
|
+
};
|
|
93
|
+
export declare const zoomSelectionDivider: {
|
|
94
|
+
fill: string;
|
|
95
|
+
zIndex: number;
|
|
96
|
+
"pointer-events": string;
|
|
97
|
+
};
|
|
86
98
|
export declare const focusOutlineOffsets: {
|
|
87
99
|
chart: number;
|
|
88
100
|
group: number;
|
package/internal/chart-styles.js
CHANGED
|
@@ -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 { colorBackgroundContainerContent, colorBackgroundItemSelected, colorBorderItemSelected, colorChartsLineTick, colorChartsPaletteCategorical1, colorChartsPaletteCategorical2, colorChartsPaletteCategorical3, colorChartsPaletteCategorical4, colorChartsPaletteCategorical5, colorChartsPaletteCategorical6, colorChartsPaletteCategorical7, colorChartsPaletteCategorical8, colorChartsPaletteCategorical9, colorChartsPaletteCategorical10, colorChartsThresholdNeutral, colorTextBodyDefault, colorTextBodySecondary, fontFamilyBase, fontSizeBodyM, fontSizeBodyS, fontWeightHeadingS, } from "@cloudscape-design/design-tokens";
|
|
3
|
+
import { colorBackgroundContainerContent, colorBackgroundItemSelected, colorBackgroundToggleButtonNormalPressed, colorBorderItemSelected, colorChartsLineTick, colorChartsPaletteCategorical1, colorChartsPaletteCategorical2, colorChartsPaletteCategorical3, colorChartsPaletteCategorical4, colorChartsPaletteCategorical5, colorChartsPaletteCategorical6, colorChartsPaletteCategorical7, colorChartsPaletteCategorical8, colorChartsPaletteCategorical9, colorChartsPaletteCategorical10, colorChartsThresholdNeutral, colorTextBodyDefault, colorTextBodySecondary, fontFamilyBase, fontSizeBodyM, fontSizeBodyS, fontWeightHeadingS, } from "@cloudscape-design/design-tokens";
|
|
4
4
|
import styles from "./styles.css.js";
|
|
5
5
|
// Here we define chart styles and colors, used across multiple components, including core chart, cartesian- and pie charts,
|
|
6
6
|
// series markers.
|
|
@@ -104,6 +104,7 @@ export const cursorLine = {
|
|
|
104
104
|
zIndex: 5,
|
|
105
105
|
"pointer-events": "none",
|
|
106
106
|
};
|
|
107
|
+
export const zoomDividerThickness = 1;
|
|
107
108
|
export const zoomRangeBand = {
|
|
108
109
|
fill: colorBackgroundItemSelected,
|
|
109
110
|
zIndex: 0,
|
|
@@ -115,6 +116,17 @@ export const zoomRangeBorders = {
|
|
|
115
116
|
zIndex: 3,
|
|
116
117
|
"pointer-events": "none",
|
|
117
118
|
};
|
|
119
|
+
export const zoomSelectionBand = {
|
|
120
|
+
fill: colorBackgroundToggleButtonNormalPressed,
|
|
121
|
+
opacity: 0.5,
|
|
122
|
+
zIndex: 4,
|
|
123
|
+
"pointer-events": "none",
|
|
124
|
+
};
|
|
125
|
+
export const zoomSelectionDivider = {
|
|
126
|
+
fill: colorBorderItemSelected,
|
|
127
|
+
zIndex: 5,
|
|
128
|
+
"pointer-events": "none",
|
|
129
|
+
};
|
|
118
130
|
export const focusOutlineOffsets = {
|
|
119
131
|
chart: -1,
|
|
120
132
|
group: 4,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chart-styles.js","sourceRoot":"","sources":["../../../src/internal/chart-styles.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAItC,OAAO,EACL,+BAA+B,EAC/B,2BAA2B,EAC3B,uBAAuB,EACvB,mBAAmB,EACnB,8BAA8B,EAC9B,8BAA8B,EAC9B,8BAA8B,EAC9B,8BAA8B,EAC9B,8BAA8B,EAC9B,8BAA8B,EAC9B,8BAA8B,EAC9B,8BAA8B,EAC9B,8BAA8B,EAC9B,+BAA+B,EAC/B,2BAA2B,EAC3B,oBAAoB,EACpB,sBAAsB,EACtB,cAAc,EACd,aAAa,EACb,aAAa,EACb,kBAAkB,GACnB,MAAM,kCAAkC,CAAC;AAE1C,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,4HAA4H;AAC5H,kBAAkB;AAElB,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,8BAA8B;IAC9B,8BAA8B;IAC9B,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E,sBAAsB;CAC9B,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG,eAAe,cAAc,iCAAiC,aAAa,UAAU,sBAAsB,EAAE,CAAC;AAErJ,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type Highcharts from \"highcharts\";\n\nimport {\n colorBackgroundContainerContent,\n colorBackgroundItemSelected,\n colorBorderItemSelected,\n colorChartsLineTick,\n colorChartsPaletteCategorical1,\n colorChartsPaletteCategorical2,\n colorChartsPaletteCategorical3,\n colorChartsPaletteCategorical4,\n colorChartsPaletteCategorical5,\n colorChartsPaletteCategorical6,\n colorChartsPaletteCategorical7,\n colorChartsPaletteCategorical8,\n colorChartsPaletteCategorical9,\n colorChartsPaletteCategorical10,\n colorChartsThresholdNeutral,\n colorTextBodyDefault,\n colorTextBodySecondary,\n fontFamilyBase,\n fontSizeBodyM,\n fontSizeBodyS,\n fontWeightHeadingS,\n} from \"@cloudscape-design/design-tokens\";\n\nimport styles from \"./styles.css.js\";\n\n// Here we define chart styles and colors, used across multiple components, including core chart, cartesian- and pie charts,\n// series markers.\n\nexport const colors = [\n colorChartsPaletteCategorical1,\n colorChartsPaletteCategorical2,\n colorChartsPaletteCategorical3,\n colorChartsPaletteCategorical4,\n colorChartsPaletteCategorical5,\n colorChartsPaletteCategorical6,\n colorChartsPaletteCategorical7,\n colorChartsPaletteCategorical8,\n colorChartsPaletteCategorical9,\n colorChartsPaletteCategorical10,\n];\n\nexport const chart: Highcharts.ChartOptions = {\n spacing: [10, 10, 0, 0],\n backgroundColor: \"transparent\",\n};\n\nexport const axisTitleCss: Highcharts.CSSObject = {\n color: colorTextBodyDefault,\n fontSize: fontSizeBodyM,\n fontWeight: fontWeightHeadingS,\n};\n\nexport const axisLabelsCss: Highcharts.CSSObject = {\n color: colorTextBodySecondary,\n fontSize: fontSizeBodyS,\n};\n\nexport const xAxisOptions: Highcharts.XAxisOptions = {\n tickColor: colorChartsLineTick,\n lineColor: colorChartsLineTick,\n gridLineColor: colorChartsLineTick,\n lineWidth: 1,\n crosshair: false,\n};\n\nexport const yAxisOptions: Highcharts.YAxisOptions = {\n tickColor: colorChartsLineTick,\n lineColor: colorChartsLineTick,\n gridLineColor: colorChartsLineTick,\n lineWidth: 0,\n crosshair: false,\n};\n\nexport const chartPlotCss: Highcharts.CSSObject = {\n font: fontFamilyBase,\n color: colorTextBodyDefault,\n fontSize: fontSizeBodyM,\n};\n\nexport const seriesBorderColor = colorBackgroundContainerContent;\n\nexport const hiddenSeriesMarker = { enabled: false, radius: 3, symbol: \"circle\" };\n\nexport const areaSeries = {\n fillOpacity: 0.4,\n marker: hiddenSeriesMarker,\n};\n\nexport const lineSeries = {\n marker: hiddenSeriesMarker,\n};\n\nexport const columnSeries = {\n groupPadding: 0.075,\n borderRadius: 4,\n borderWidth: 2,\n marker: hiddenSeriesMarker,\n};\n\nexport const errorbarSeries = {\n color: colorChartsThresholdNeutral,\n stemColor: colorChartsThresholdNeutral,\n whiskerColor: colorChartsThresholdNeutral,\n};\n\nexport const pieSeries = {\n borderWidth: 2,\n // This sets the color of the empty pie/donut ring.\n // See: https://github.com/highcharts/highcharts/issues/23073.\n color: \"transparent\",\n size: \"60%\",\n};\nexport const donutSeries = {\n ...pieSeries,\n innerSize: \"80%\",\n};\n\nexport const pieSeriesDataLabels = {\n connectorColor: colorChartsThresholdNeutral,\n};\n\nexport const dimmedPlotLineOpacity = 0.4;\n\nexport const seriesDataLabelsCss: Highcharts.CSSObject = {\n font: fontFamilyBase,\n color: colorTextBodyDefault,\n fontSize: fontSizeBodyM,\n fontWeight: fontWeightHeadingS,\n textOutline: \"\",\n};\n\nexport const seriesOpacityInactive = 0.3;\n\nexport const verticalAxisTitleBlockSize = 24;\nexport const verticalAxisTitleMargin = 4;\n\nexport const navigationFocusOutline = {\n class: styles[\"focus-outline\"],\n \"stroke-width\": 2,\n rx: 4,\n zIndex: 10,\n};\n\nexport const cursorLine = {\n fill: colorChartsLineTick,\n zIndex: 5,\n \"pointer-events\": \"none\",\n};\n\nexport const zoomRangeBand = {\n fill: colorBackgroundItemSelected,\n zIndex: 0,\n \"pointer-events\": \"none\",\n};\n\nexport const zoomRangeBorders = {\n stroke: colorBorderItemSelected,\n \"stroke-width\": 1,\n zIndex: 3,\n \"pointer-events\": \"none\",\n};\n\nexport const focusOutlineOffsets = {\n chart: -1,\n group: 4,\n point: 6,\n pointByType: { column: 2, pie: 2 } as Record<string, number | undefined>,\n};\n\nexport const thresholdSeries: Partial<Highcharts.SeriesLineOptions> = {\n dashStyle: \"ShortDash\",\n lineWidth: 0,\n color: colorChartsThresholdNeutral,\n};\n\nexport const thresholdPlotLine: Partial<Highcharts.XAxisPlotLinesOptions | Highcharts.YAxisPlotLinesOptions> = {\n width: 2,\n dashStyle: \"ShortDash\",\n zIndex: 3,\n color: colorChartsThresholdNeutral,\n};\n\nexport const chatPlotBaseline: Partial<Highcharts.XAxisPlotLinesOptions> = {\n color: colorChartsLineTick,\n width: 2,\n zIndex: 2,\n};\n\nexport const innerAreaTitleCss: Highcharts.CSSObject = {\n fontSize: \"28\",\n fontWeight: \"bold\",\n};\n\nexport const innerAreaDescriptionCss: Highcharts.CSSObject = {\n fontSize: \"18\",\n fontWeight: \"bold\",\n color: colorTextBodySecondary,\n};\n\nexport const segmentDescriptionStyle = `font-family:${fontFamilyBase};font-weight:normal;font-size:${fontSizeBodyS};color:${colorTextBodySecondary}`;\n\nexport const tooltipSnap = 4;\n"]}
|
|
1
|
+
{"version":3,"file":"chart-styles.js","sourceRoot":"","sources":["../../../src/internal/chart-styles.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAItC,OAAO,EACL,+BAA+B,EAC/B,2BAA2B,EAC3B,wCAAwC,EACxC,uBAAuB,EACvB,mBAAmB,EACnB,8BAA8B,EAC9B,8BAA8B,EAC9B,8BAA8B,EAC9B,8BA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CAAC;IACR,WAAW,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAwC;CACzE,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAA0C;IACpE,SAAS,EAAE,WAAW;IACtB,SAAS,EAAE,CAAC;IACZ,KAAK,EAAE,2BAA2B;CACnC,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAiF;IAC7G,KAAK,EAAE,CAAC;IACR,SAAS,EAAE,WAAW;IACtB,MAAM,EAAE,CAAC;IACT,KAAK,EAAE,2BAA2B;CACnC,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAA8C;IACzE,KAAK,EAAE,mBAAmB;IAC1B,KAAK,EAAE,CAAC;IACR,MAAM,EAAE,CAAC;CACV,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAyB;IACrD,QAAQ,EAAE,IAAI;IACd,UAAU,EAAE,MAAM;CACnB,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAyB;IAC3D,QAAQ,EAAE,IAAI;IACd,UAAU,EAAE,MAAM;IAClB,KAAK,EAAE,sBAAsB;CAC9B,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG,eAAe,cAAc,iCAAiC,aAAa,UAAU,sBAAsB,EAAE,CAAC;AAErJ,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type Highcharts from \"highcharts\";\n\nimport {\n colorBackgroundContainerContent,\n colorBackgroundItemSelected,\n colorBackgroundToggleButtonNormalPressed,\n colorBorderItemSelected,\n colorChartsLineTick,\n colorChartsPaletteCategorical1,\n colorChartsPaletteCategorical2,\n colorChartsPaletteCategorical3,\n colorChartsPaletteCategorical4,\n colorChartsPaletteCategorical5,\n colorChartsPaletteCategorical6,\n colorChartsPaletteCategorical7,\n colorChartsPaletteCategorical8,\n colorChartsPaletteCategorical9,\n colorChartsPaletteCategorical10,\n colorChartsThresholdNeutral,\n colorTextBodyDefault,\n colorTextBodySecondary,\n fontFamilyBase,\n fontSizeBodyM,\n fontSizeBodyS,\n fontWeightHeadingS,\n} from \"@cloudscape-design/design-tokens\";\n\nimport styles from \"./styles.css.js\";\n\n// Here we define chart styles and colors, used across multiple components, including core chart, cartesian- and pie charts,\n// series markers.\n\nexport const colors = [\n colorChartsPaletteCategorical1,\n colorChartsPaletteCategorical2,\n colorChartsPaletteCategorical3,\n colorChartsPaletteCategorical4,\n colorChartsPaletteCategorical5,\n colorChartsPaletteCategorical6,\n colorChartsPaletteCategorical7,\n colorChartsPaletteCategorical8,\n colorChartsPaletteCategorical9,\n colorChartsPaletteCategorical10,\n];\n\nexport const chart: Highcharts.ChartOptions = {\n spacing: [10, 10, 0, 0],\n backgroundColor: \"transparent\",\n};\n\nexport const axisTitleCss: Highcharts.CSSObject = {\n color: colorTextBodyDefault,\n fontSize: fontSizeBodyM,\n fontWeight: fontWeightHeadingS,\n};\n\nexport const axisLabelsCss: Highcharts.CSSObject = {\n color: colorTextBodySecondary,\n fontSize: fontSizeBodyS,\n};\n\nexport const xAxisOptions: Highcharts.XAxisOptions = {\n tickColor: colorChartsLineTick,\n lineColor: colorChartsLineTick,\n gridLineColor: colorChartsLineTick,\n lineWidth: 1,\n crosshair: false,\n};\n\nexport const yAxisOptions: Highcharts.YAxisOptions = {\n tickColor: colorChartsLineTick,\n lineColor: colorChartsLineTick,\n gridLineColor: colorChartsLineTick,\n lineWidth: 0,\n crosshair: false,\n};\n\nexport const chartPlotCss: Highcharts.CSSObject = {\n font: fontFamilyBase,\n color: colorTextBodyDefault,\n fontSize: fontSizeBodyM,\n};\n\nexport const seriesBorderColor = colorBackgroundContainerContent;\n\nexport const hiddenSeriesMarker = { enabled: false, radius: 3, symbol: \"circle\" };\n\nexport const areaSeries = {\n fillOpacity: 0.4,\n marker: hiddenSeriesMarker,\n};\n\nexport const lineSeries = {\n marker: hiddenSeriesMarker,\n};\n\nexport const columnSeries = {\n groupPadding: 0.075,\n borderRadius: 4,\n borderWidth: 2,\n marker: hiddenSeriesMarker,\n};\n\nexport const errorbarSeries = {\n color: colorChartsThresholdNeutral,\n stemColor: colorChartsThresholdNeutral,\n whiskerColor: colorChartsThresholdNeutral,\n};\n\nexport const pieSeries = {\n borderWidth: 2,\n // This sets the color of the empty pie/donut ring.\n // See: https://github.com/highcharts/highcharts/issues/23073.\n color: \"transparent\",\n size: \"60%\",\n};\nexport const donutSeries = {\n ...pieSeries,\n innerSize: \"80%\",\n};\n\nexport const pieSeriesDataLabels = {\n connectorColor: colorChartsThresholdNeutral,\n};\n\nexport const dimmedPlotLineOpacity = 0.4;\n\nexport const seriesDataLabelsCss: Highcharts.CSSObject = {\n font: fontFamilyBase,\n color: colorTextBodyDefault,\n fontSize: fontSizeBodyM,\n fontWeight: fontWeightHeadingS,\n textOutline: \"\",\n};\n\nexport const seriesOpacityInactive = 0.3;\n\nexport const verticalAxisTitleBlockSize = 24;\nexport const verticalAxisTitleMargin = 4;\n\nexport const navigationFocusOutline = {\n class: styles[\"focus-outline\"],\n \"stroke-width\": 2,\n rx: 4,\n zIndex: 10,\n};\n\nexport const cursorLine = {\n fill: colorChartsLineTick,\n zIndex: 5,\n \"pointer-events\": \"none\",\n};\n\nexport const zoomDividerThickness = 1;\n\nexport const zoomRangeBand = {\n fill: colorBackgroundItemSelected,\n zIndex: 0,\n \"pointer-events\": \"none\",\n};\n\nexport const zoomRangeBorders = {\n stroke: colorBorderItemSelected,\n \"stroke-width\": 1,\n zIndex: 3,\n \"pointer-events\": \"none\",\n};\n\nexport const zoomSelectionBand = {\n fill: colorBackgroundToggleButtonNormalPressed,\n opacity: 0.5,\n zIndex: 4,\n \"pointer-events\": \"none\",\n};\n\nexport const zoomSelectionDivider = {\n fill: colorBorderItemSelected,\n zIndex: 5,\n \"pointer-events\": \"none\",\n};\n\nexport const focusOutlineOffsets = {\n chart: -1,\n group: 4,\n point: 6,\n pointByType: { column: 2, pie: 2 } as Record<string, number | undefined>,\n};\n\nexport const thresholdSeries: Partial<Highcharts.SeriesLineOptions> = {\n dashStyle: \"ShortDash\",\n lineWidth: 0,\n color: colorChartsThresholdNeutral,\n};\n\nexport const thresholdPlotLine: Partial<Highcharts.XAxisPlotLinesOptions | Highcharts.YAxisPlotLinesOptions> = {\n width: 2,\n dashStyle: \"ShortDash\",\n zIndex: 3,\n color: colorChartsThresholdNeutral,\n};\n\nexport const chatPlotBaseline: Partial<Highcharts.XAxisPlotLinesOptions> = {\n color: colorChartsLineTick,\n width: 2,\n zIndex: 2,\n};\n\nexport const innerAreaTitleCss: Highcharts.CSSObject = {\n fontSize: \"28\",\n fontWeight: \"bold\",\n};\n\nexport const innerAreaDescriptionCss: Highcharts.CSSObject = {\n fontSize: \"18\",\n fontWeight: \"bold\",\n color: colorTextBodySecondary,\n};\n\nexport const segmentDescriptionStyle = `font-family:${fontFamilyBase};font-weight:normal;font-size:${fontSizeBodyS};color:${colorTextBodySecondary}`;\n\nexport const tooltipSnap = 4;\n"]}
|
package/internal/environment.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export var PACKAGE_SOURCE = "chart-components";
|
|
2
|
-
export var PACKAGE_VERSION = "1.0.0 (
|
|
2
|
+
export var PACKAGE_VERSION = "1.0.0 (31ed2474)";
|
|
3
3
|
export var THEME = "open-source-visual-refresh";
|
|
4
4
|
export var ALWAYS_VISUAL_REFRESH = true;
|
|
5
5
|
export var SYSTEM = "core";
|