@cloudscape-design/chart-components 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (246) hide show
  1. package/LICENSE +175 -0
  2. package/NOTICE +1 -0
  3. package/README.md +25 -0
  4. package/cartesian-chart/chart-cartesian-internal.d.ts +10 -0
  5. package/cartesian-chart/chart-cartesian-internal.js +99 -0
  6. package/cartesian-chart/chart-cartesian-internal.js.map +1 -0
  7. package/cartesian-chart/chart-series-cartesian.d.ts +7 -0
  8. package/cartesian-chart/chart-series-cartesian.js +95 -0
  9. package/cartesian-chart/chart-series-cartesian.js.map +1 -0
  10. package/cartesian-chart/index.d.ts +5 -0
  11. package/cartesian-chart/index.js +133 -0
  12. package/cartesian-chart/index.js.map +1 -0
  13. package/cartesian-chart/interfaces.d.ts +166 -0
  14. package/cartesian-chart/interfaces.js +4 -0
  15. package/cartesian-chart/interfaces.js.map +1 -0
  16. package/cartesian-chart/test-classes/styles.css.js +6 -0
  17. package/cartesian-chart/test-classes/styles.scoped.css +7 -0
  18. package/cartesian-chart/test-classes/styles.selectors.js +7 -0
  19. package/core/chart-api/chart-extra-axis-titles.d.ts +10 -0
  20. package/core/chart-api/chart-extra-axis-titles.js +42 -0
  21. package/core/chart-api/chart-extra-axis-titles.js.map +1 -0
  22. package/core/chart-api/chart-extra-context.d.ts +41 -0
  23. package/core/chart-api/chart-extra-context.js +93 -0
  24. package/core/chart-api/chart-extra-context.js.map +1 -0
  25. package/core/chart-api/chart-extra-highlight.d.ts +20 -0
  26. package/core/chart-api/chart-extra-highlight.js +205 -0
  27. package/core/chart-api/chart-extra-highlight.js.map +1 -0
  28. package/core/chart-api/chart-extra-legend.d.ts +27 -0
  29. package/core/chart-api/chart-extra-legend.js +118 -0
  30. package/core/chart-api/chart-extra-legend.js.map +1 -0
  31. package/core/chart-api/chart-extra-navigation.d.ts +84 -0
  32. package/core/chart-api/chart-extra-navigation.js +470 -0
  33. package/core/chart-api/chart-extra-navigation.js.map +1 -0
  34. package/core/chart-api/chart-extra-nodata.d.ts +15 -0
  35. package/core/chart-api/chart-extra-nodata.js +45 -0
  36. package/core/chart-api/chart-extra-nodata.js.map +1 -0
  37. package/core/chart-api/chart-extra-pointer.d.ts +33 -0
  38. package/core/chart-api/chart-extra-pointer.js +173 -0
  39. package/core/chart-api/chart-extra-pointer.js.map +1 -0
  40. package/core/chart-api/chart-extra-tooltip.d.ts +33 -0
  41. package/core/chart-api/chart-extra-tooltip.js +209 -0
  42. package/core/chart-api/chart-extra-tooltip.js.map +1 -0
  43. package/core/chart-api/index.d.ts +75 -0
  44. package/core/chart-api/index.js +383 -0
  45. package/core/chart-api/index.js.map +1 -0
  46. package/core/chart-container.d.ts +20 -0
  47. package/core/chart-container.js +55 -0
  48. package/core/chart-container.js.map +1 -0
  49. package/core/chart-core.d.ts +7 -0
  50. package/core/chart-core.js +287 -0
  51. package/core/chart-core.js.map +1 -0
  52. package/core/components/core-application.d.ts +6 -0
  53. package/core/components/core-application.js +16 -0
  54. package/core/components/core-application.js.map +1 -0
  55. package/core/components/core-filters.d.ts +9 -0
  56. package/core/components/core-filters.js +22 -0
  57. package/core/components/core-filters.js.map +1 -0
  58. package/core/components/core-legend.d.ts +13 -0
  59. package/core/components/core-legend.js +27 -0
  60. package/core/components/core-legend.js.map +1 -0
  61. package/core/components/core-no-data.d.ts +6 -0
  62. package/core/components/core-no-data.js +48 -0
  63. package/core/components/core-no-data.js.map +1 -0
  64. package/core/components/core-slots.d.ts +7 -0
  65. package/core/components/core-slots.js +11 -0
  66. package/core/components/core-slots.js.map +1 -0
  67. package/core/components/core-tooltip.d.ts +7 -0
  68. package/core/components/core-tooltip.js +183 -0
  69. package/core/components/core-tooltip.js.map +1 -0
  70. package/core/components/core-vertical-axis-title.d.ts +5 -0
  71. package/core/components/core-vertical-axis-title.js +15 -0
  72. package/core/components/core-vertical-axis-title.js.map +1 -0
  73. package/core/formatters.d.ts +2 -0
  74. package/core/formatters.js +113 -0
  75. package/core/formatters.js.map +1 -0
  76. package/core/i18n-utils.d.ts +21 -0
  77. package/core/i18n-utils.js +18 -0
  78. package/core/i18n-utils.js.map +1 -0
  79. package/core/interfaces.d.ts +436 -0
  80. package/core/interfaces.js +4 -0
  81. package/core/interfaces.js.map +1 -0
  82. package/core/styles.css.js +25 -0
  83. package/core/styles.scoped.css +115 -0
  84. package/core/styles.selectors.js +26 -0
  85. package/core/test-classes/styles.css.js +33 -0
  86. package/core/test-classes/styles.scoped.css +34 -0
  87. package/core/test-classes/styles.selectors.js +34 -0
  88. package/core/utils.d.ts +45 -0
  89. package/core/utils.js +262 -0
  90. package/core/utils.js.map +1 -0
  91. package/index.d.ts +4 -0
  92. package/index.js +5 -0
  93. package/index.js.map +1 -0
  94. package/internal/api-docs/components/cartesian-chart.js +571 -0
  95. package/internal/api-docs/components/index.d.ts +3 -0
  96. package/internal/api-docs/components/index.js +4 -0
  97. package/internal/api-docs/components/interfaces.d.ts +81 -0
  98. package/internal/api-docs/components/pie-chart.js +430 -0
  99. package/internal/api-docs/test-utils-doc/dom.js +4 -0
  100. package/internal/api-docs/test-utils-doc/selectors.js +4 -0
  101. package/internal/base-component/get-data-attributes.d.ts +1 -0
  102. package/internal/base-component/get-data-attributes.js +12 -0
  103. package/internal/base-component/get-data-attributes.js.map +1 -0
  104. package/internal/base-component/use-base-component.d.ts +13 -0
  105. package/internal/base-component/use-base-component.js +18 -0
  106. package/internal/base-component/use-base-component.js.map +1 -0
  107. package/internal/base-component/use-telemetry.d.ts +2 -0
  108. package/internal/base-component/use-telemetry.js +8 -0
  109. package/internal/base-component/use-telemetry.js.map +1 -0
  110. package/internal/chart-styles.d.ts +88 -0
  111. package/internal/chart-styles.js +145 -0
  112. package/internal/chart-styles.js.map +1 -0
  113. package/internal/components/chart-legend/index.d.ts +14 -0
  114. package/internal/components/chart-legend/index.js +245 -0
  115. package/internal/components/chart-legend/index.js.map +1 -0
  116. package/internal/components/chart-legend/styles.css.js +22 -0
  117. package/internal/components/chart-legend/styles.scoped.css +233 -0
  118. package/internal/components/chart-legend/styles.selectors.js +23 -0
  119. package/internal/components/chart-legend/test-classes/styles.css.js +11 -0
  120. package/internal/components/chart-legend/test-classes/styles.scoped.css +12 -0
  121. package/internal/components/chart-legend/test-classes/styles.selectors.js +12 -0
  122. package/internal/components/chart-series-filter/index.d.ts +17 -0
  123. package/internal/components/chart-series-filter/index.js +14 -0
  124. package/internal/components/chart-series-filter/index.js.map +1 -0
  125. package/internal/components/interfaces.d.ts +17 -0
  126. package/internal/components/interfaces.js +4 -0
  127. package/internal/components/interfaces.js.map +1 -0
  128. package/internal/components/series-details/index.d.ts +23 -0
  129. package/internal/components/series-details/index.js +45 -0
  130. package/internal/components/series-details/index.js.map +1 -0
  131. package/internal/components/series-details/styles.css.js +22 -0
  132. package/internal/components/series-details/styles.scoped.css +150 -0
  133. package/internal/components/series-details/styles.selectors.js +23 -0
  134. package/internal/components/series-details/test-classes/styles.css.js +10 -0
  135. package/internal/components/series-details/test-classes/styles.scoped.css +11 -0
  136. package/internal/components/series-details/test-classes/styles.selectors.js +11 -0
  137. package/internal/components/series-marker/index.d.ts +8 -0
  138. package/internal/components/series-marker/index.js +45 -0
  139. package/internal/components/series-marker/index.js.map +1 -0
  140. package/internal/components/series-marker/interfaces.d.ts +1 -0
  141. package/internal/components/series-marker/interfaces.js +4 -0
  142. package/internal/components/series-marker/interfaces.js.map +1 -0
  143. package/internal/components/series-marker/render-marker.d.ts +3 -0
  144. package/internal/components/series-marker/render-marker.js +74 -0
  145. package/internal/components/series-marker/render-marker.js.map +1 -0
  146. package/internal/components/series-marker/styles.css.js +7 -0
  147. package/internal/components/series-marker/styles.scoped.css +55 -0
  148. package/internal/components/series-marker/styles.selectors.js +8 -0
  149. package/internal/environment.d.ts +4 -0
  150. package/internal/environment.js +5 -0
  151. package/internal/environment.json +7 -0
  152. package/internal/events/index.d.ts +23 -0
  153. package/internal/events/index.js +41 -0
  154. package/internal/events/index.js.map +1 -0
  155. package/internal/generated/styles/tokens.d.ts +756 -0
  156. package/internal/generated/styles/tokens.js +756 -0
  157. package/internal/generated/theming/index.cjs +12584 -0
  158. package/internal/generated/theming/index.cjs.d.ts +2399 -0
  159. package/internal/generated/theming/index.d.ts +2399 -0
  160. package/internal/generated/theming/index.js +12584 -0
  161. package/internal/manifest.json +3 -0
  162. package/internal/styles.css.js +6 -0
  163. package/internal/styles.scoped.css +13 -0
  164. package/internal/styles.selectors.js +7 -0
  165. package/internal/utils/apply-display-name.d.ts +1 -0
  166. package/internal/utils/apply-display-name.js +6 -0
  167. package/internal/utils/apply-display-name.js.map +1 -0
  168. package/internal/utils/async-store.d.ts +19 -0
  169. package/internal/utils/async-store.js +58 -0
  170. package/internal/utils/async-store.js.map +1 -0
  171. package/internal/utils/chart-series.d.ts +8 -0
  172. package/internal/utils/chart-series.js +11 -0
  173. package/internal/utils/chart-series.js.map +1 -0
  174. package/internal/utils/renderer-utils.d.ts +17 -0
  175. package/internal/utils/renderer-utils.js +95 -0
  176. package/internal/utils/renderer-utils.js.map +1 -0
  177. package/internal/utils/series-data.d.ts +2 -0
  178. package/internal/utils/series-data.js +8 -0
  179. package/internal/utils/series-data.js.map +1 -0
  180. package/internal/utils/test-i18n-provider.d.ts +8 -0
  181. package/internal/utils/test-i18n-provider.js +8 -0
  182. package/internal/utils/test-i18n-provider.js.map +1 -0
  183. package/internal/utils/use-previous.d.ts +4 -0
  184. package/internal/utils/use-previous.js +14 -0
  185. package/internal/utils/use-previous.js.map +1 -0
  186. package/internal/utils/utils.d.ts +16 -0
  187. package/internal/utils/utils.js +49 -0
  188. package/internal/utils/utils.js.map +1 -0
  189. package/internal-do-not-use/core-chart/index.d.ts +4 -0
  190. package/internal-do-not-use/core-chart/index.js +13 -0
  191. package/internal-do-not-use/core-chart/index.js.map +1 -0
  192. package/internal-do-not-use/core-legend/index.d.ts +2 -0
  193. package/internal-do-not-use/core-legend/index.js +11 -0
  194. package/internal-do-not-use/core-legend/index.js.map +1 -0
  195. package/package.json +106 -0
  196. package/pie-chart/chart-inner-area.d.ts +10 -0
  197. package/pie-chart/chart-inner-area.js +63 -0
  198. package/pie-chart/chart-inner-area.js.map +1 -0
  199. package/pie-chart/chart-pie-internal.d.ts +11 -0
  200. package/pie-chart/chart-pie-internal.js +103 -0
  201. package/pie-chart/chart-pie-internal.js.map +1 -0
  202. package/pie-chart/index.d.ts +5 -0
  203. package/pie-chart/index.js +48 -0
  204. package/pie-chart/index.js.map +1 -0
  205. package/pie-chart/interfaces.d.ts +101 -0
  206. package/pie-chart/interfaces.js +4 -0
  207. package/pie-chart/interfaces.js.map +1 -0
  208. package/pie-chart/test-classes/styles.css.js +8 -0
  209. package/pie-chart/test-classes/styles.scoped.css +9 -0
  210. package/pie-chart/test-classes/styles.selectors.js +9 -0
  211. package/test-utils/dom/cartesian-chart/index.d.ts +14 -0
  212. package/test-utils/dom/cartesian-chart/index.js +24 -0
  213. package/test-utils/dom/cartesian-chart/index.js.map +1 -0
  214. package/test-utils/dom/cartesian-chart/tooltip.d.ts +28 -0
  215. package/test-utils/dom/cartesian-chart/tooltip.js +48 -0
  216. package/test-utils/dom/cartesian-chart/tooltip.js.map +1 -0
  217. package/test-utils/dom/index.d.ts +46 -0
  218. package/test-utils/dom/index.js +35 -0
  219. package/test-utils/dom/index.js.map +1 -0
  220. package/test-utils/dom/internal/base.d.ts +93 -0
  221. package/test-utils/dom/internal/base.js +146 -0
  222. package/test-utils/dom/internal/base.js.map +1 -0
  223. package/test-utils/dom/internal/core.d.ts +14 -0
  224. package/test-utils/dom/internal/core.js +37 -0
  225. package/test-utils/dom/internal/core.js.map +1 -0
  226. package/test-utils/dom/pie-chart/index.d.ts +17 -0
  227. package/test-utils/dom/pie-chart/index.js +29 -0
  228. package/test-utils/dom/pie-chart/index.js.map +1 -0
  229. package/test-utils/selectors/cartesian-chart/index.d.ts +14 -0
  230. package/test-utils/selectors/cartesian-chart/index.js +24 -0
  231. package/test-utils/selectors/cartesian-chart/index.js.map +1 -0
  232. package/test-utils/selectors/cartesian-chart/tooltip.d.ts +28 -0
  233. package/test-utils/selectors/cartesian-chart/tooltip.js +48 -0
  234. package/test-utils/selectors/cartesian-chart/tooltip.js.map +1 -0
  235. package/test-utils/selectors/index.d.ts +46 -0
  236. package/test-utils/selectors/index.js +32 -0
  237. package/test-utils/selectors/index.js.map +1 -0
  238. package/test-utils/selectors/internal/base.d.ts +93 -0
  239. package/test-utils/selectors/internal/base.js +146 -0
  240. package/test-utils/selectors/internal/base.js.map +1 -0
  241. package/test-utils/selectors/internal/core.d.ts +14 -0
  242. package/test-utils/selectors/internal/core.js +37 -0
  243. package/test-utils/selectors/internal/core.js.map +1 -0
  244. package/test-utils/selectors/pie-chart/index.d.ts +17 -0
  245. package/test-utils/selectors/pie-chart/index.js +29 -0
  246. package/test-utils/selectors/pie-chart/index.js.map +1 -0
@@ -0,0 +1,436 @@
1
+ /// <reference types="react" />
2
+ import type Highcharts from "highcharts";
3
+ import type * as InternalComponentTypes from "../internal/components/interfaces";
4
+ import { type NonCancelableEventHandler } from "../internal/events";
5
+ /**
6
+ * This interface includes common public chart properties, applicable for all chart types.
7
+ */
8
+ export interface BaseChartOptions {
9
+ /**
10
+ * The Highcharts instance, which can be obtained using `import Highcharts from "highcharts"`.
11
+ * Supported Highcharts versions: 12.
12
+ */
13
+ highcharts: null | object;
14
+ /**
15
+ * Custom content that renders when `highcharts=null`. It renders a spinner if not defined.
16
+ */
17
+ fallback?: React.ReactNode;
18
+ /**
19
+ * The height of the chart plot in pixels. It does not include legend and filter.
20
+ */
21
+ chartHeight?: number;
22
+ /**
23
+ * The chart automatically adjusts its height to fill the parent container when this property is set.
24
+ */
25
+ fitHeight?: boolean;
26
+ /**
27
+ * Defines the minimum allowed height of the chart plot. Use this when `fitHeight=true` to
28
+ * prevent the chart plot from becoming too small to display its content. When the parent
29
+ * container is shorter than the minimum height, a vertical scrollbar appears automatically.
30
+ */
31
+ chartMinHeight?: number;
32
+ /**
33
+ * Defines the minimum allowed width of the chart plot. When the parent container is narrower than the
34
+ * minimum width, the horizontal scrollbar is automatically added.
35
+ */
36
+ chartMinWidth?: number;
37
+ /**
38
+ * Defines the ARIA label for the chart container.
39
+ * This property corresponds to [lang.chartContainerLabel](https://api.highcharts.com/highcharts/lang.accessibility.chartContainerLabel),
40
+ * and requires the [accessibility module](https://www.highcharts.com/docs/accessibility/accessibility-module).
41
+ */
42
+ ariaLabel?: string;
43
+ /**
44
+ * Defines the ARIA description of the chart container.
45
+ * This property corresponds to [accessibility.description](https://api.highcharts.com/highcharts/accessibility.description),
46
+ * and requires the [accessibility module](https://www.highcharts.com/docs/accessibility/accessibility-module).
47
+ */
48
+ ariaDescription?: string;
49
+ /**
50
+ * Defines chart legend options, including:
51
+ * * `enabled` (optional, boolean) - Hides legend when set to `false`.
52
+ * * `title` (optional, string) - Visible label, shown above the legend.
53
+ * * `actions` (optional, slot) - A slot before the legend that can be used to render custom actions.
54
+ */
55
+ legend?: BaseLegendOptions;
56
+ /**
57
+ * Defines options to represent empty, no-match, loading, and error state of the chart, including:
58
+ * * `statusType` (optional, "finished" | "loading" | "error") - Specifies the current status of loading data.
59
+ * * `empty` (optional, ReactNode) - Content displayed when the chart data is empty.
60
+ * * `noMatch` (optional, ReactNode) - Content displayed when there is no data to display due to the built-in filtering.
61
+ * * `loading` (optional, ReactNode) - Content displayed when `statusType="loading"`. If omitted, the default loading state
62
+ * is shown, using `i18n.loadingText` or built-in i18n.
63
+ * * `error` (optional, ReactNode) - Content displayed when `statusType="error"`. If omitted, the default error state
64
+ * is shown, using `i18n.errorText` and `i18n.recoveryText` (when `onRecoveryClick` is provided), or built-in i18n.
65
+ * * `onRecoveryClick` (optional, function) - Called when the user clicks the recovery button that appears when using default error
66
+ * state, and only if `onRecoveryClick` is provided. Use this to enable the user to retry a failed request or provide another option
67
+ * for the user to recover from the error.
68
+ */
69
+ noData?: BaseNoDataOptions;
70
+ /**
71
+ * Defines options for filtering in the chart, including:
72
+ * * `seriesFilter` (optional, boolean) - Displays default series filter at the top of the chart.
73
+ * * `additionalFilters` (optional, slot) - A slot for custom chart filters at the top of the chart.
74
+ */
75
+ filter?: BaseFilterOptions;
76
+ }
77
+ export interface BaseLegendOptions {
78
+ enabled?: boolean;
79
+ title?: string;
80
+ actions?: React.ReactNode;
81
+ }
82
+ export interface BaseNoDataOptions {
83
+ statusType?: "finished" | "loading" | "error";
84
+ empty?: React.ReactNode;
85
+ error?: React.ReactNode;
86
+ loading?: React.ReactNode;
87
+ noMatch?: React.ReactNode;
88
+ onRecoveryClick?: NonCancelableEventHandler;
89
+ }
90
+ export interface BaseTooltipDetail {
91
+ key: React.ReactNode;
92
+ value: React.ReactNode;
93
+ }
94
+ export interface BaseI18nStrings {
95
+ loadingText?: string;
96
+ errorText?: string;
97
+ recoveryText?: string;
98
+ seriesFilterLabel?: string;
99
+ seriesFilterPlaceholder?: string;
100
+ seriesFilterSelectedAriaLabel?: string;
101
+ legendAriaLabel?: string;
102
+ detailPopoverDismissAriaLabel?: string;
103
+ chartRoleDescription?: string;
104
+ }
105
+ export interface WithCartesianI18nStrings {
106
+ /**
107
+ * An object that contains all of the localized strings required by the component.
108
+ * @i18n
109
+ *
110
+ * Available properties:
111
+ * * `loadingText` (optional, string) - Text, displayed when the chart is loading, i.e. when `noData.statusType` is set to "loading".
112
+ * * `errorText` (optional, string) - Text, displayed when the chart is in error state, i.e. when `noData.statusType` is set to "error".
113
+ * * `recoveryText` (optional, string) - Text for the recovery button, displayed next to the error text.
114
+ * * `seriesFilterLabel` (optional, string) - Text for the visible label of the default series filter.
115
+ * * `seriesFilterPlaceholder` (optional, string) - Text for the default series filter placeholder.
116
+ * * `seriesFilterSelectedAriaLabel` (optional, string) - ARIA label of the default series filter which is appended to any option that is selected.
117
+ * * `legendAriaLabel` (optional, string) - ARIA label that is associated with the legend in case there is no visible `legend.title` defined.
118
+ * * `detailPopoverDismissAriaLabel` (optional, string) - ARIA label for the details popover dismiss button.
119
+ * * `chartRoleDescription` (optional, string) - Accessible role description of the chart plot area, e.g. "interactive chart".
120
+ * * `xAxisRoleDescription` (optional, string) - Accessible role description of the x axis, e.g. "x axis".
121
+ * * `yAxisRoleDescription` (optional, string) - Accessible role description of the y axis, e.g. "y axis".
122
+ */
123
+ i18nStrings?: CartesianI18nStrings;
124
+ }
125
+ export interface WithPieI18nStrings {
126
+ /**
127
+ * An object that contains all of the localized strings required by the component.
128
+ * @i18n
129
+ *
130
+ * Available properties:
131
+ * * `loadingText` (optional, string) - Text, displayed when the chart is loading, i.e. when `noData.statusType` is set to "loading".
132
+ * * `errorText` (optional, string) - Text, displayed when the chart is in error state, i.e. when `noData.statusType` is set to "error".
133
+ * * `recoveryText` (optional, string) - Text for the recovery button, displayed next to the error text.
134
+ * * `seriesFilterLabel` (optional, string) - Text for the visible label of the default series filter.
135
+ * * `seriesFilterPlaceholder` (optional, string) - Text for the default series filter placeholder.
136
+ * * `seriesFilterSelectedAriaLabel` (optional, string) - ARIA label of the default series filter which is appended to any option that is selected.
137
+ * * `legendAriaLabel` (optional, string) - ARIA label that is associated with the legend in case there is no visible `legend.title` defined.
138
+ * * `detailPopoverDismissAriaLabel` (optional, string) - ARIA label for the details popover dismiss button.
139
+ * * `chartRoleDescription` (optional, string) - Accessible role description of the chart plot area, e.g. "interactive chart".
140
+ * * `segmentRoleDescription` (optional, string) - Accessible role description of the segment.
141
+ */
142
+ i18nStrings?: PieI18nStrings;
143
+ }
144
+ export interface CartesianI18nStrings extends BaseI18nStrings {
145
+ xAxisRoleDescription?: string;
146
+ yAxisRoleDescription?: string;
147
+ }
148
+ export interface PieI18nStrings extends BaseI18nStrings {
149
+ segmentRoleDescription?: string;
150
+ }
151
+ export interface BaseFilterOptions {
152
+ seriesFilter?: boolean;
153
+ additionalFilters?: React.ReactNode;
154
+ }
155
+ export interface BaseTooltipPointFormatted {
156
+ key?: React.ReactNode;
157
+ value?: React.ReactNode;
158
+ description?: React.ReactNode;
159
+ expandable?: boolean;
160
+ subItems?: ReadonlyArray<{
161
+ key: React.ReactNode;
162
+ value: React.ReactNode;
163
+ }>;
164
+ }
165
+ export interface AreaSeriesOptions extends BaseCartesianSeriesOptions {
166
+ type: "area";
167
+ data: readonly PointDataItemType[];
168
+ }
169
+ export interface AreaSplineSeriesOptions extends BaseCartesianSeriesOptions {
170
+ type: "areaspline";
171
+ data: readonly PointDataItemType[];
172
+ }
173
+ export interface ColumnSeriesOptions extends BaseCartesianSeriesOptions {
174
+ type: "column";
175
+ data: readonly PointDataItemType[];
176
+ }
177
+ export interface LineSeriesOptions extends BaseCartesianSeriesOptions {
178
+ type: "line";
179
+ data: readonly PointDataItemType[];
180
+ }
181
+ export interface SplineSeriesOptions extends BaseCartesianSeriesOptions {
182
+ type: "spline";
183
+ data: readonly PointDataItemType[];
184
+ }
185
+ export interface ScatterSeriesOptions extends BaseCartesianSeriesOptions {
186
+ type: "scatter";
187
+ data: readonly PointDataItemType[];
188
+ marker?: PointMarkerOptions;
189
+ }
190
+ export interface ErrorBarSeriesOptions extends Omit<BaseCartesianSeriesOptions, "name"> {
191
+ type: "errorbar";
192
+ name?: string;
193
+ data: readonly RangeDataItemOptions[];
194
+ linkedTo: string;
195
+ }
196
+ export interface XThresholdSeriesOptions extends BaseCartesianSeriesOptions {
197
+ type: "x-threshold";
198
+ value: number;
199
+ }
200
+ export interface YThresholdSeriesOptions extends BaseCartesianSeriesOptions {
201
+ type: "y-threshold";
202
+ value: number;
203
+ }
204
+ export interface PieSeriesOptions extends BaseCartesianSeriesOptions {
205
+ type: "pie";
206
+ data: readonly PieSegmentOptions[];
207
+ }
208
+ export interface DonutSeriesOptions extends BaseCartesianSeriesOptions {
209
+ type: "donut";
210
+ data: readonly PieSegmentOptions[];
211
+ }
212
+ export interface PieSegmentOptions {
213
+ y: number | null;
214
+ id?: string;
215
+ name: string;
216
+ color?: string;
217
+ }
218
+ export type PointDataItemType = null | number | PointDataItemOptions;
219
+ export interface PointDataItemOptions {
220
+ x?: number;
221
+ y: number | null;
222
+ }
223
+ export interface RangeDataItemOptions {
224
+ x?: number;
225
+ low: number;
226
+ high: number;
227
+ }
228
+ interface BaseCartesianSeriesOptions {
229
+ id?: string;
230
+ name: string;
231
+ color?: string;
232
+ }
233
+ interface PointMarkerOptions {
234
+ symbol?: "circle" | "diamond" | "square" | "triangle" | "triangle-down";
235
+ }
236
+ export interface CoreCartesianOptions {
237
+ /**
238
+ * When set to `true`, adds a visual emphasis on the zero baseline axis.
239
+ */
240
+ emphasizeBaseline?: boolean;
241
+ /**
242
+ * Controls the placement of the vertical axis title.
243
+ * When set to "side", displays the title along the axis line.
244
+ */
245
+ verticalAxisTitlePlacement?: "top" | "side";
246
+ }
247
+ export interface CoreChartProps extends Pick<BaseChartOptions, "highcharts" | "fallback" | "fitHeight" | "chartHeight" | "chartMinHeight" | "chartMinWidth" | "ariaLabel" | "ariaDescription" | "filter" | "noData">, CoreCartesianOptions {
248
+ /**
249
+ * The Highcharts options. Cloudscape injects custom styles and settings, but all can be
250
+ * overridden with explicitly provided options. An exception is event handlers - those are
251
+ * not overridden, but merged with Cloudscape event handlers so that both are getting called.
252
+ */
253
+ options: CoreChartProps.ChartOptions;
254
+ /**
255
+ * The Cloudscape tooltip, that comes with a vertical cursor when used on cartesian series.
256
+ * The tooltip content is only shown when `getContent` property is defined, which is called
257
+ * for each visited { x, y } point.
258
+ */
259
+ tooltip?: CoreChartProps.TooltipOptions;
260
+ /**
261
+ * A custom slot above the chart plot, chart's axis title, and filter.
262
+ */
263
+ header?: CoreChartProps.HeaderOptions;
264
+ /**
265
+ * Prop for passing a custom navigation control component to be rendered with the chart.
266
+ * Use this property to add timeline navigation, range selectors, or other custom navigation elements.
267
+ */
268
+ navigator?: React.ReactNode;
269
+ /**
270
+ * A custom slot below the chart plot and legend.
271
+ */
272
+ footer?: CoreChartProps.FooterOptions;
273
+ /**
274
+ * Chart legend options.
275
+ */
276
+ legend?: CoreChartProps.LegendOptions;
277
+ /**
278
+ * The callback to init the chart's API when it is ready. The API includes the Highcharts chart object, and
279
+ * additional Cloudscape methods.
280
+ */
281
+ callback?: (chart: CoreChartProps.ChartAPI) => void;
282
+ /**
283
+ * This is used to provide a test-utils selector. Do not use this property to provide custom styles.
284
+ */
285
+ className?: string;
286
+ /**
287
+ * IDs of visible series or points.
288
+ */
289
+ visibleItems?: readonly string[];
290
+ /**
291
+ * Called when a legend item is highlighted.
292
+ */
293
+ onLegendItemHighlight?: NonCancelableEventHandler<CoreChartProps.LegendItemHighlightDetail>;
294
+ /**
295
+ * Called when series/points visibility changes due to user interaction with legend or filter.
296
+ */
297
+ onVisibleItemsChange?: NonCancelableEventHandler<CoreChartProps.VisibleItemsChangeDetail>;
298
+ /**
299
+ * Called whenever chart tooltip is rendered to provide content for tooltip's header, body, and (optional) footer.
300
+ */
301
+ getTooltipContent?: CoreChartProps.GetTooltipContent;
302
+ /**
303
+ * Called whenever a legend item is hovered to provide content for legend tooltip's header, body, and (optional) footer.
304
+ * If not provided, no tooltip will be displayed.
305
+ */
306
+ getLegendTooltipContent?: CoreChartProps.GetLegendTooltipContent;
307
+ /**
308
+ * Called whenever chart point or group is highlighted.
309
+ */
310
+ onHighlight?: NonCancelableEventHandler<CoreChartProps.HighlightChangeDetail>;
311
+ /**
312
+ * Called whenever chart point or group loses highlight.
313
+ */
314
+ onClearHighlight?: NonCancelableEventHandler<CoreChartProps.HighlightClearDetail>;
315
+ /**
316
+ * Use Cloudscape keyboard navigation.
317
+ */
318
+ keyboardNavigation?: boolean;
319
+ /**
320
+ * An object that contains all of the localized strings required by the component.
321
+ * @i18n
322
+ */
323
+ i18nStrings?: CartesianI18nStrings & PieI18nStrings;
324
+ }
325
+ export declare namespace CoreChartProps {
326
+ interface ChartAPI {
327
+ chart: Highcharts.Chart;
328
+ highcharts: typeof Highcharts;
329
+ highlightItems(itemIds: readonly string[]): void;
330
+ setItemsVisible(itemIds: readonly string[]): void;
331
+ highlightChartPoint(point: Highcharts.Point): void;
332
+ highlightChartGroup(group: readonly Highcharts.Point[]): void;
333
+ clearChartHighlight(): void;
334
+ }
335
+ type ChartOptions = Omit<Highcharts.Options, "xAxis" | "yAxis"> & {
336
+ xAxis?: XAxisOptions | XAxisOptions[];
337
+ yAxis?: YAxisOptions | YAxisOptions[];
338
+ };
339
+ type XAxisOptions = Highcharts.XAxisOptions & {
340
+ valueFormatter?: (value: null | number) => string;
341
+ };
342
+ type YAxisOptions = Highcharts.YAxisOptions & {
343
+ valueFormatter?: (value: null | number) => string;
344
+ };
345
+ interface HeaderOptions {
346
+ content: React.ReactNode;
347
+ }
348
+ interface FooterOptions {
349
+ content: React.ReactNode;
350
+ }
351
+ interface LegendOptions extends BaseLegendOptions {
352
+ bottomMaxHeight?: number;
353
+ position?: "bottom" | "side";
354
+ }
355
+ type LegendItem = InternalComponentTypes.LegendItem;
356
+ type LegendTooltipContent = InternalComponentTypes.LegendTooltipContent;
357
+ type GetLegendTooltipContent = InternalComponentTypes.GetLegendTooltipContent;
358
+ type GetLegendTooltipContentProps = InternalComponentTypes.GetLegendTooltipContentProps;
359
+ interface TooltipOptions {
360
+ enabled?: boolean;
361
+ placement?: "middle" | "outside" | "target";
362
+ size?: "small" | "medium" | "large";
363
+ }
364
+ type GetTooltipContent = (props: GetTooltipContentProps) => TooltipContentRenderer;
365
+ interface GetTooltipContentProps {
366
+ point: null | Highcharts.Point;
367
+ group: readonly Highcharts.Point[];
368
+ }
369
+ interface TooltipContentRenderer {
370
+ point?: (props: TooltipPointProps) => TooltipPointFormatted;
371
+ details?: (props: TooltipDetailsProps) => readonly TooltipDetail[];
372
+ header?: (props: TooltipSlotProps) => React.ReactNode;
373
+ body?: (props: TooltipSlotProps) => React.ReactNode;
374
+ footer?: (props: TooltipSlotProps) => React.ReactNode;
375
+ }
376
+ type TooltipPointFormatted = BaseTooltipPointFormatted;
377
+ interface TooltipContentItem {
378
+ point: Highcharts.Point;
379
+ errorRanges: Highcharts.Point[];
380
+ }
381
+ interface TooltipPointProps {
382
+ item: TooltipContentItem;
383
+ }
384
+ interface TooltipSlotProps {
385
+ x: number;
386
+ items: TooltipContentItem[];
387
+ }
388
+ interface TooltipDetailsProps {
389
+ point: Highcharts.Point;
390
+ }
391
+ type TooltipDetail = BaseTooltipDetail;
392
+ interface LegendItemHighlightDetail {
393
+ item: LegendItem;
394
+ }
395
+ interface VisibleItemsChangeDetail {
396
+ items: readonly LegendItem[];
397
+ isApiCall: boolean;
398
+ }
399
+ interface HighlightChangeDetail {
400
+ point: null | Highcharts.Point;
401
+ group: readonly Highcharts.Point[];
402
+ isApiCall: boolean;
403
+ }
404
+ interface HighlightClearDetail {
405
+ isApiCall: boolean;
406
+ }
407
+ type I18nStrings = CartesianI18nStrings & PieI18nStrings;
408
+ }
409
+ export interface CoreLegendProps {
410
+ items: readonly CoreLegendProps.Item[];
411
+ title?: string;
412
+ ariaLabel?: string;
413
+ actions?: React.ReactNode;
414
+ alignment?: "horizontal" | "vertical";
415
+ onClearHighlight?: NonCancelableEventHandler;
416
+ onItemHighlight?: NonCancelableEventHandler<CoreLegendProps.ItemHighlightDetail>;
417
+ onVisibleItemsChange?: NonCancelableEventHandler<CoreLegendProps.VisibleItemsChangeDetail>;
418
+ getLegendTooltipContent?: CoreLegendProps.GetTooltipContent;
419
+ }
420
+ export declare namespace CoreLegendProps {
421
+ type Item = InternalComponentTypes.LegendItem;
422
+ type GetTooltipContent = InternalComponentTypes.GetLegendTooltipContent;
423
+ interface ItemHighlightDetail {
424
+ item: Item;
425
+ }
426
+ interface VisibleItemsChangeDetail {
427
+ items: readonly string[];
428
+ }
429
+ }
430
+ export interface Rect {
431
+ x: number;
432
+ y: number;
433
+ height: number;
434
+ width: number;
435
+ }
436
+ export {};
@@ -0,0 +1,4 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ export {};
4
+ //# sourceMappingURL=interfaces.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/core/interfaces.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC","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 type * as InternalComponentTypes from \"../internal/components/interfaces\";\nimport { type NonCancelableEventHandler } from \"../internal/events\";\n\n// All charts take `highcharts` instance, that can be served statically or dynamically.\n// Although it has to be of type Highcharts, the TS type we use is `null | object`, so\n// that it is ignored by the documenter.\n\n/**\n * This interface includes common public chart properties, applicable for all chart types.\n */\nexport interface BaseChartOptions {\n /**\n * The Highcharts instance, which can be obtained using `import Highcharts from \"highcharts\"`.\n * Supported Highcharts versions: 12.\n */\n highcharts: null | object;\n\n /**\n * Custom content that renders when `highcharts=null`. It renders a spinner if not defined.\n */\n fallback?: React.ReactNode;\n\n /**\n * The height of the chart plot in pixels. It does not include legend and filter.\n */\n chartHeight?: number;\n\n /**\n * The chart automatically adjusts its height to fill the parent container when this property is set.\n */\n fitHeight?: boolean;\n\n /**\n * Defines the minimum allowed height of the chart plot. Use this when `fitHeight=true` to\n * prevent the chart plot from becoming too small to display its content. When the parent\n * container is shorter than the minimum height, a vertical scrollbar appears automatically.\n */\n chartMinHeight?: number;\n\n /**\n * Defines the minimum allowed width of the chart plot. When the parent container is narrower than the\n * minimum width, the horizontal scrollbar is automatically added.\n */\n chartMinWidth?: number;\n\n /**\n * Defines the ARIA label for the chart container.\n * This property corresponds to [lang.chartContainerLabel](https://api.highcharts.com/highcharts/lang.accessibility.chartContainerLabel),\n * and requires the [accessibility module](https://www.highcharts.com/docs/accessibility/accessibility-module).\n */\n ariaLabel?: string;\n\n /**\n * Defines the ARIA description of the chart container.\n * This property corresponds to [accessibility.description](https://api.highcharts.com/highcharts/accessibility.description),\n * and requires the [accessibility module](https://www.highcharts.com/docs/accessibility/accessibility-module).\n */\n ariaDescription?: string;\n\n /**\n * Defines chart legend options, including:\n * * `enabled` (optional, boolean) - Hides legend when set to `false`.\n * * `title` (optional, string) - Visible label, shown above the legend.\n * * `actions` (optional, slot) - A slot before the legend that can be used to render custom actions.\n */\n legend?: BaseLegendOptions;\n\n /**\n * Defines options to represent empty, no-match, loading, and error state of the chart, including:\n * * `statusType` (optional, \"finished\" | \"loading\" | \"error\") - Specifies the current status of loading data.\n * * `empty` (optional, ReactNode) - Content displayed when the chart data is empty.\n * * `noMatch` (optional, ReactNode) - Content displayed when there is no data to display due to the built-in filtering.\n * * `loading` (optional, ReactNode) - Content displayed when `statusType=\"loading\"`. If omitted, the default loading state\n * is shown, using `i18n.loadingText` or built-in i18n.\n * * `error` (optional, ReactNode) - Content displayed when `statusType=\"error\"`. If omitted, the default error state\n * is shown, using `i18n.errorText` and `i18n.recoveryText` (when `onRecoveryClick` is provided), or built-in i18n.\n * * `onRecoveryClick` (optional, function) - Called when the user clicks the recovery button that appears when using default error\n * state, and only if `onRecoveryClick` is provided. Use this to enable the user to retry a failed request or provide another option\n * for the user to recover from the error.\n */\n noData?: BaseNoDataOptions;\n\n /**\n * Defines options for filtering in the chart, including:\n * * `seriesFilter` (optional, boolean) - Displays default series filter at the top of the chart.\n * * `additionalFilters` (optional, slot) - A slot for custom chart filters at the top of the chart.\n */\n filter?: BaseFilterOptions;\n}\n\nexport interface BaseLegendOptions {\n enabled?: boolean;\n title?: string;\n actions?: React.ReactNode;\n}\n\nexport interface BaseNoDataOptions {\n statusType?: \"finished\" | \"loading\" | \"error\";\n empty?: React.ReactNode;\n error?: React.ReactNode;\n loading?: React.ReactNode;\n noMatch?: React.ReactNode;\n onRecoveryClick?: NonCancelableEventHandler;\n}\n\nexport interface BaseTooltipDetail {\n key: React.ReactNode;\n value: React.ReactNode;\n}\n\nexport interface BaseI18nStrings {\n loadingText?: string;\n errorText?: string;\n recoveryText?: string;\n seriesFilterLabel?: string;\n seriesFilterPlaceholder?: string;\n seriesFilterSelectedAriaLabel?: string;\n legendAriaLabel?: string;\n detailPopoverDismissAriaLabel?: string;\n chartRoleDescription?: string;\n}\n\nexport interface WithCartesianI18nStrings {\n /**\n * An object that contains all of the localized strings required by the component.\n * @i18n\n *\n * Available properties:\n * * `loadingText` (optional, string) - Text, displayed when the chart is loading, i.e. when `noData.statusType` is set to \"loading\".\n * * `errorText` (optional, string) - Text, displayed when the chart is in error state, i.e. when `noData.statusType` is set to \"error\".\n * * `recoveryText` (optional, string) - Text for the recovery button, displayed next to the error text.\n * * `seriesFilterLabel` (optional, string) - Text for the visible label of the default series filter.\n * * `seriesFilterPlaceholder` (optional, string) - Text for the default series filter placeholder.\n * * `seriesFilterSelectedAriaLabel` (optional, string) - ARIA label of the default series filter which is appended to any option that is selected.\n * * `legendAriaLabel` (optional, string) - ARIA label that is associated with the legend in case there is no visible `legend.title` defined.\n * * `detailPopoverDismissAriaLabel` (optional, string) - ARIA label for the details popover dismiss button.\n * * `chartRoleDescription` (optional, string) - Accessible role description of the chart plot area, e.g. \"interactive chart\".\n * * `xAxisRoleDescription` (optional, string) - Accessible role description of the x axis, e.g. \"x axis\".\n * * `yAxisRoleDescription` (optional, string) - Accessible role description of the y axis, e.g. \"y axis\".\n */\n i18nStrings?: CartesianI18nStrings;\n}\n\nexport interface WithPieI18nStrings {\n /**\n * An object that contains all of the localized strings required by the component.\n * @i18n\n *\n * Available properties:\n * * `loadingText` (optional, string) - Text, displayed when the chart is loading, i.e. when `noData.statusType` is set to \"loading\".\n * * `errorText` (optional, string) - Text, displayed when the chart is in error state, i.e. when `noData.statusType` is set to \"error\".\n * * `recoveryText` (optional, string) - Text for the recovery button, displayed next to the error text.\n * * `seriesFilterLabel` (optional, string) - Text for the visible label of the default series filter.\n * * `seriesFilterPlaceholder` (optional, string) - Text for the default series filter placeholder.\n * * `seriesFilterSelectedAriaLabel` (optional, string) - ARIA label of the default series filter which is appended to any option that is selected.\n * * `legendAriaLabel` (optional, string) - ARIA label that is associated with the legend in case there is no visible `legend.title` defined.\n * * `detailPopoverDismissAriaLabel` (optional, string) - ARIA label for the details popover dismiss button.\n * * `chartRoleDescription` (optional, string) - Accessible role description of the chart plot area, e.g. \"interactive chart\".\n * * `segmentRoleDescription` (optional, string) - Accessible role description of the segment.\n */\n i18nStrings?: PieI18nStrings;\n}\n\nexport interface CartesianI18nStrings extends BaseI18nStrings {\n xAxisRoleDescription?: string;\n yAxisRoleDescription?: string;\n}\n\nexport interface PieI18nStrings extends BaseI18nStrings {\n segmentRoleDescription?: string;\n}\n\nexport interface BaseFilterOptions {\n seriesFilter?: boolean;\n additionalFilters?: React.ReactNode;\n}\n\nexport interface BaseTooltipPointFormatted {\n key?: React.ReactNode;\n value?: React.ReactNode;\n description?: React.ReactNode;\n expandable?: boolean;\n subItems?: ReadonlyArray<{ key: React.ReactNode; value: React.ReactNode }>;\n}\n\nexport interface AreaSeriesOptions extends BaseCartesianSeriesOptions {\n type: \"area\";\n data: readonly PointDataItemType[];\n}\n\nexport interface AreaSplineSeriesOptions extends BaseCartesianSeriesOptions {\n type: \"areaspline\";\n data: readonly PointDataItemType[];\n}\n\nexport interface ColumnSeriesOptions extends BaseCartesianSeriesOptions {\n type: \"column\";\n data: readonly PointDataItemType[];\n}\n\nexport interface LineSeriesOptions extends BaseCartesianSeriesOptions {\n type: \"line\";\n data: readonly PointDataItemType[];\n}\n\nexport interface SplineSeriesOptions extends BaseCartesianSeriesOptions {\n type: \"spline\";\n data: readonly PointDataItemType[];\n}\n\nexport interface ScatterSeriesOptions extends BaseCartesianSeriesOptions {\n type: \"scatter\";\n data: readonly PointDataItemType[];\n marker?: PointMarkerOptions;\n}\n\nexport interface ErrorBarSeriesOptions extends Omit<BaseCartesianSeriesOptions, \"name\"> {\n type: \"errorbar\";\n name?: string;\n data: readonly RangeDataItemOptions[];\n linkedTo: string;\n}\n\nexport interface XThresholdSeriesOptions extends BaseCartesianSeriesOptions {\n type: \"x-threshold\";\n value: number;\n}\n\nexport interface YThresholdSeriesOptions extends BaseCartesianSeriesOptions {\n type: \"y-threshold\";\n value: number;\n}\n\nexport interface PieSeriesOptions extends BaseCartesianSeriesOptions {\n type: \"pie\";\n data: readonly PieSegmentOptions[];\n}\n\nexport interface DonutSeriesOptions extends BaseCartesianSeriesOptions {\n type: \"donut\";\n data: readonly PieSegmentOptions[];\n}\n\nexport interface PieSegmentOptions {\n y: number | null;\n id?: string;\n name: string;\n color?: string;\n}\n\nexport type PointDataItemType = null | number | PointDataItemOptions;\n\nexport interface PointDataItemOptions {\n x?: number;\n y: number | null;\n}\n\nexport interface RangeDataItemOptions {\n x?: number;\n low: number;\n high: number;\n}\n\ninterface BaseCartesianSeriesOptions {\n id?: string;\n name: string;\n color?: string;\n}\n\n// The symbols union matches that of Highcharts.PointMarkerOptionsObject\ninterface PointMarkerOptions {\n symbol?: \"circle\" | \"diamond\" | \"square\" | \"triangle\" | \"triangle-down\";\n}\n\nexport interface CoreCartesianOptions {\n /**\n * When set to `true`, adds a visual emphasis on the zero baseline axis.\n */\n emphasizeBaseline?: boolean;\n /**\n * Controls the placement of the vertical axis title.\n * When set to \"side\", displays the title along the axis line.\n */\n verticalAxisTitlePlacement?: \"top\" | \"side\";\n}\n\nexport interface CoreChartProps\n extends Pick<\n BaseChartOptions,\n | \"highcharts\"\n | \"fallback\"\n | \"fitHeight\"\n | \"chartHeight\"\n | \"chartMinHeight\"\n | \"chartMinWidth\"\n | \"ariaLabel\"\n | \"ariaDescription\"\n | \"filter\"\n | \"noData\"\n >,\n CoreCartesianOptions {\n /**\n * The Highcharts options. Cloudscape injects custom styles and settings, but all can be\n * overridden with explicitly provided options. An exception is event handlers - those are\n * not overridden, but merged with Cloudscape event handlers so that both are getting called.\n */\n options: CoreChartProps.ChartOptions;\n /**\n * The Cloudscape tooltip, that comes with a vertical cursor when used on cartesian series.\n * The tooltip content is only shown when `getContent` property is defined, which is called\n * for each visited { x, y } point.\n */\n tooltip?: CoreChartProps.TooltipOptions;\n /**\n * A custom slot above the chart plot, chart's axis title, and filter.\n */\n header?: CoreChartProps.HeaderOptions;\n /**\n * Prop for passing a custom navigation control component to be rendered with the chart.\n * Use this property to add timeline navigation, range selectors, or other custom navigation elements.\n */\n navigator?: React.ReactNode;\n /**\n * A custom slot below the chart plot and legend.\n */\n footer?: CoreChartProps.FooterOptions;\n /**\n * Chart legend options.\n */\n legend?: CoreChartProps.LegendOptions;\n /**\n * The callback to init the chart's API when it is ready. The API includes the Highcharts chart object, and\n * additional Cloudscape methods.\n */\n callback?: (chart: CoreChartProps.ChartAPI) => void;\n /**\n * This is used to provide a test-utils selector. Do not use this property to provide custom styles.\n */\n className?: string;\n /**\n * IDs of visible series or points.\n */\n visibleItems?: readonly string[];\n /**\n * Called when a legend item is highlighted.\n */\n onLegendItemHighlight?: NonCancelableEventHandler<CoreChartProps.LegendItemHighlightDetail>;\n /**\n * Called when series/points visibility changes due to user interaction with legend or filter.\n */\n onVisibleItemsChange?: NonCancelableEventHandler<CoreChartProps.VisibleItemsChangeDetail>;\n /**\n * Called whenever chart tooltip is rendered to provide content for tooltip's header, body, and (optional) footer.\n */\n getTooltipContent?: CoreChartProps.GetTooltipContent;\n /**\n * Called whenever a legend item is hovered to provide content for legend tooltip's header, body, and (optional) footer.\n * If not provided, no tooltip will be displayed.\n */\n getLegendTooltipContent?: CoreChartProps.GetLegendTooltipContent;\n /**\n * Called whenever chart point or group is highlighted.\n */\n onHighlight?: NonCancelableEventHandler<CoreChartProps.HighlightChangeDetail>;\n /**\n * Called whenever chart point or group loses highlight.\n */\n onClearHighlight?: NonCancelableEventHandler<CoreChartProps.HighlightClearDetail>;\n /**\n * Use Cloudscape keyboard navigation.\n */\n keyboardNavigation?: boolean;\n /**\n * An object that contains all of the localized strings required by the component.\n * @i18n\n */\n i18nStrings?: CartesianI18nStrings & PieI18nStrings;\n}\n\nexport namespace CoreChartProps {\n // The API methods allow programmatic triggering of chart's behaviors, some of which are not accessible via React state.\n // This enables advanced integration scenarios, such as building a custom legend, or making multiple charts synchronized.\n export interface ChartAPI {\n chart: Highcharts.Chart;\n highcharts: typeof Highcharts;\n highlightItems(itemIds: readonly string[]): void;\n setItemsVisible(itemIds: readonly string[]): void;\n highlightChartPoint(point: Highcharts.Point): void;\n highlightChartGroup(group: readonly Highcharts.Point[]): void;\n clearChartHighlight(): void;\n }\n\n // The extended version of Highcharts.Options. The axes types are extended with Cloudscape value formatter.\n // We use a custom formatter because we cannot use the built-in Highcharts formatter for our tooltip.\n export type ChartOptions = Omit<Highcharts.Options, \"xAxis\" | \"yAxis\"> & {\n xAxis?: XAxisOptions | XAxisOptions[];\n yAxis?: YAxisOptions | YAxisOptions[];\n };\n export type XAxisOptions = Highcharts.XAxisOptions & { valueFormatter?: (value: null | number) => string };\n export type YAxisOptions = Highcharts.YAxisOptions & { valueFormatter?: (value: null | number) => string };\n\n export interface HeaderOptions {\n content: React.ReactNode;\n }\n export interface FooterOptions {\n content: React.ReactNode;\n }\n\n export interface LegendOptions extends BaseLegendOptions {\n bottomMaxHeight?: number;\n position?: \"bottom\" | \"side\";\n }\n export type LegendItem = InternalComponentTypes.LegendItem;\n export type LegendTooltipContent = InternalComponentTypes.LegendTooltipContent;\n export type GetLegendTooltipContent = InternalComponentTypes.GetLegendTooltipContent;\n export type GetLegendTooltipContentProps = InternalComponentTypes.GetLegendTooltipContentProps;\n\n export interface TooltipOptions {\n enabled?: boolean;\n placement?: \"middle\" | \"outside\" | \"target\";\n size?: \"small\" | \"medium\" | \"large\";\n }\n\n export type GetTooltipContent = (props: GetTooltipContentProps) => TooltipContentRenderer;\n export interface GetTooltipContentProps {\n point: null | Highcharts.Point;\n group: readonly Highcharts.Point[];\n }\n export interface TooltipContentRenderer {\n point?: (props: TooltipPointProps) => TooltipPointFormatted;\n details?: (props: TooltipDetailsProps) => readonly TooltipDetail[];\n header?: (props: TooltipSlotProps) => React.ReactNode;\n body?: (props: TooltipSlotProps) => React.ReactNode;\n footer?: (props: TooltipSlotProps) => React.ReactNode;\n }\n export type TooltipPointFormatted = BaseTooltipPointFormatted;\n export interface TooltipContentItem {\n point: Highcharts.Point;\n errorRanges: Highcharts.Point[];\n }\n export interface TooltipPointProps {\n item: TooltipContentItem;\n }\n export interface TooltipSlotProps {\n x: number;\n items: TooltipContentItem[];\n }\n\n export interface TooltipDetailsProps {\n point: Highcharts.Point;\n }\n\n export type TooltipDetail = BaseTooltipDetail;\n\n export interface LegendItemHighlightDetail {\n item: LegendItem;\n }\n export interface VisibleItemsChangeDetail {\n items: readonly LegendItem[];\n isApiCall: boolean;\n }\n export interface HighlightChangeDetail {\n point: null | Highcharts.Point;\n group: readonly Highcharts.Point[];\n isApiCall: boolean;\n }\n export interface HighlightClearDetail {\n isApiCall: boolean;\n }\n\n export type I18nStrings = CartesianI18nStrings & PieI18nStrings;\n}\n\nexport interface CoreLegendProps {\n items: readonly CoreLegendProps.Item[];\n title?: string;\n ariaLabel?: string;\n actions?: React.ReactNode;\n alignment?: \"horizontal\" | \"vertical\";\n onClearHighlight?: NonCancelableEventHandler;\n onItemHighlight?: NonCancelableEventHandler<CoreLegendProps.ItemHighlightDetail>;\n onVisibleItemsChange?: NonCancelableEventHandler<CoreLegendProps.VisibleItemsChangeDetail>;\n getLegendTooltipContent?: CoreLegendProps.GetTooltipContent;\n}\n\nexport namespace CoreLegendProps {\n export type Item = InternalComponentTypes.LegendItem;\n export type GetTooltipContent = InternalComponentTypes.GetLegendTooltipContent;\n export interface ItemHighlightDetail {\n item: Item;\n }\n export interface VisibleItemsChangeDetail {\n items: readonly string[];\n }\n}\n\n// Utility types\n\nexport interface Rect {\n x: number;\n y: number;\n height: number;\n width: number;\n}\n"]}
@@ -0,0 +1,25 @@
1
+
2
+ import './styles.scoped.css';
3
+ export default {
4
+ "root": "awsui_root_113qp_14k3e_5",
5
+ "highcharts-grid-line": "awsui_highcharts-grid-line_113qp_14k3e_8",
6
+ "root-fit-height": "awsui_root-fit-height_113qp_14k3e_12",
7
+ "no-data-container": "awsui_no-data-container_113qp_14k3e_16",
8
+ "no-data": "awsui_no-data_113qp_14k3e_16",
9
+ "no-data-wrapper": "awsui_no-data-wrapper_113qp_14k3e_34",
10
+ "no-data-empty": "awsui_no-data-empty_113qp_14k3e_42",
11
+ "chart-filters": "awsui_chart-filters_113qp_14k3e_46",
12
+ "chart-filters-series": "awsui_chart-filters-series_113qp_14k3e_52",
13
+ "axis-vertical-title": "awsui_axis-vertical-title_113qp_14k3e_56",
14
+ "axis-vertical-title-item": "awsui_axis-vertical-title-item_113qp_14k3e_64",
15
+ "error-range": "awsui_error-range_113qp_14k3e_71",
16
+ "tooltip-default-header": "awsui_tooltip-default-header_113qp_14k3e_77",
17
+ "chart-container-root": "awsui_chart-container-root_113qp_14k3e_83",
18
+ "chart-container-fit-height": "awsui_chart-container-fit-height_113qp_14k3e_87",
19
+ "chart-container-min-width": "awsui_chart-container-min-width_113qp_14k3e_93",
20
+ "chart-plot-and-legend-wrapper": "awsui_chart-plot-and-legend-wrapper_113qp_14k3e_97",
21
+ "chart-plot-wrapper": "awsui_chart-plot-wrapper_113qp_14k3e_101",
22
+ "side-legend-container": "awsui_side-legend-container_113qp_14k3e_106",
23
+ "application": "awsui_application_113qp_14k3e_113"
24
+ };
25
+
@@ -0,0 +1,115 @@
1
+ /*
2
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ SPDX-License-Identifier: Apache-2.0
4
+ */
5
+ .awsui_root_113qp_14k3e_5:not(#\9) {
6
+ position: relative;
7
+ }
8
+ .awsui_root_113qp_14k3e_5 .awsui_highcharts-grid-line_113qp_14k3e_8:not(#\9) {
9
+ pointer-events: none;
10
+ }
11
+
12
+ .awsui_root-fit-height_113qp_14k3e_12:not(#\9) {
13
+ block-size: 100%;
14
+ }
15
+
16
+ .awsui_no-data-container_113qp_14k3e_16:not(#\9) {
17
+ position: absolute;
18
+ inset: 0;
19
+ display: flex;
20
+ align-items: center;
21
+ justify-content: center;
22
+ }
23
+
24
+ .awsui_no-data_113qp_14k3e_16:not(#\9) {
25
+ overflow-x: auto;
26
+ overflow-y: hidden;
27
+ padding-block: var(--space-static-xs-gnm0mz, 8px);
28
+ padding-inline: var(--space-static-m-m6qboo, 16px);
29
+ background-color: var(--color-background-container-content-6u8rvp, #ffffff);
30
+ border-radius: 8px;
31
+ border: 1px solid var(--color-border-divider-default-nr68jt, #c6c6cd);
32
+ }
33
+
34
+ .awsui_no-data-wrapper_113qp_14k3e_34:not(#\9) {
35
+ overflow: hidden;
36
+ padding-block: var(--space-static-xxs-ns94dp, 4px);
37
+ padding-inline: var(--space-static-xxs-ns94dp, 4px);
38
+ border-radius: 8px;
39
+ background-color: var(--color-background-container-content-6u8rvp, #ffffff);
40
+ }
41
+
42
+ .awsui_no-data-empty_113qp_14k3e_42:not(#\9) {
43
+ color: var(--color-text-empty-tlohug, #656871);
44
+ }
45
+
46
+ .awsui_chart-filters_113qp_14k3e_46:not(#\9) {
47
+ padding-block-end: var(--space-scaled-l-sej05l, 20px);
48
+ display: flex;
49
+ flex-wrap: wrap;
50
+ gap: var(--space-scaled-l-sej05l, 20px);
51
+ }
52
+ .awsui_chart-filters-series_113qp_14k3e_52:not(#\9) {
53
+ flex: 280px 0 1;
54
+ }
55
+
56
+ .awsui_axis-vertical-title_113qp_14k3e_56:not(#\9) {
57
+ display: flex;
58
+ gap: var(--space-static-xs-gnm0mz, 8px);
59
+ justify-content: space-between;
60
+ block-size: 24px;
61
+ margin-bottom: 4px;
62
+ }
63
+
64
+ .awsui_axis-vertical-title-item_113qp_14k3e_64:not(#\9) {
65
+ font-weight: bold;
66
+ overflow: hidden;
67
+ white-space: nowrap;
68
+ text-overflow: ellipsis;
69
+ }
70
+
71
+ .awsui_error-range_113qp_14k3e_71:not(#\9) {
72
+ display: flex;
73
+ justify-content: space-between;
74
+ gap: var(--space-scaled-s-8ozaad, 12px);
75
+ }
76
+
77
+ .awsui_tooltip-default-header_113qp_14k3e_77:not(#\9) {
78
+ display: inline-flex;
79
+ align-items: center;
80
+ gap: var(--space-static-xxs-ns94dp, 4px);
81
+ }
82
+
83
+ .awsui_chart-container-root_113qp_14k3e_83:not(#\9) {
84
+ block-size: 100%;
85
+ }
86
+
87
+ .awsui_chart-container-fit-height_113qp_14k3e_87:not(#\9) {
88
+ overflow-x: auto;
89
+ position: absolute;
90
+ inset: 0;
91
+ }
92
+
93
+ .awsui_chart-container-min-width_113qp_14k3e_93:not(#\9) {
94
+ overflow-x: auto;
95
+ }
96
+
97
+ .awsui_chart-plot-and-legend-wrapper_113qp_14k3e_97:not(#\9) {
98
+ display: flex;
99
+ }
100
+
101
+ .awsui_chart-plot-wrapper_113qp_14k3e_101:not(#\9) {
102
+ position: relative;
103
+ flex: 1;
104
+ }
105
+
106
+ .awsui_side-legend-container_113qp_14k3e_106:not(#\9) {
107
+ flex: 0;
108
+ overflow-y: auto;
109
+ max-inline-size: 30%;
110
+ min-inline-size: max(20%, 150px);
111
+ }
112
+
113
+ .awsui_application_113qp_14k3e_113:not(#\9) {
114
+ outline: none;
115
+ }
@@ -0,0 +1,26 @@
1
+
2
+ // es-module interop with Babel and Typescript
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ module.exports.default = {
5
+ "root": "awsui_root_113qp_14k3e_5",
6
+ "highcharts-grid-line": "awsui_highcharts-grid-line_113qp_14k3e_8",
7
+ "root-fit-height": "awsui_root-fit-height_113qp_14k3e_12",
8
+ "no-data-container": "awsui_no-data-container_113qp_14k3e_16",
9
+ "no-data": "awsui_no-data_113qp_14k3e_16",
10
+ "no-data-wrapper": "awsui_no-data-wrapper_113qp_14k3e_34",
11
+ "no-data-empty": "awsui_no-data-empty_113qp_14k3e_42",
12
+ "chart-filters": "awsui_chart-filters_113qp_14k3e_46",
13
+ "chart-filters-series": "awsui_chart-filters-series_113qp_14k3e_52",
14
+ "axis-vertical-title": "awsui_axis-vertical-title_113qp_14k3e_56",
15
+ "axis-vertical-title-item": "awsui_axis-vertical-title-item_113qp_14k3e_64",
16
+ "error-range": "awsui_error-range_113qp_14k3e_71",
17
+ "tooltip-default-header": "awsui_tooltip-default-header_113qp_14k3e_77",
18
+ "chart-container-root": "awsui_chart-container-root_113qp_14k3e_83",
19
+ "chart-container-fit-height": "awsui_chart-container-fit-height_113qp_14k3e_87",
20
+ "chart-container-min-width": "awsui_chart-container-min-width_113qp_14k3e_93",
21
+ "chart-plot-and-legend-wrapper": "awsui_chart-plot-and-legend-wrapper_113qp_14k3e_97",
22
+ "chart-plot-wrapper": "awsui_chart-plot-wrapper_113qp_14k3e_101",
23
+ "side-legend-container": "awsui_side-legend-container_113qp_14k3e_106",
24
+ "application": "awsui_application_113qp_14k3e_113"
25
+ };
26
+