Skip to content

Commit 3836a85

Browse files
jsilllpan-kot
authored andcommitted
address comments
1 parent 0cd7abc commit 3836a85

File tree

3 files changed

+14
-21
lines changed

3 files changed

+14
-21
lines changed

src/core/formatters.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
import type Highcharts from "highcharts";
55

6-
import { InternalXAxisOptions, InternalYAxisOptions } from "./interfaces";
6+
import { CoreXAxisOptions, CoreYAxisOptions } from "./interfaces";
77

88
// Takes value formatter from the axis options (InternalXAxisOptions.valueFormatter or InternalYAxisOptions.valueFormatter),
99
// or provides a default formatter for numeric and datetime values.
@@ -21,7 +21,7 @@ export function getFormatter(axis?: Highcharts.Axis) {
2121
if (axis.options.type === "category") {
2222
return axis.categories?.[value] ?? value.toString();
2323
}
24-
const axisOptions = axis.userOptions as InternalXAxisOptions | InternalYAxisOptions;
24+
const axisOptions = axis.userOptions as CoreXAxisOptions | CoreYAxisOptions;
2525
if (axisOptions.valueFormatter) {
2626
return axisOptions.valueFormatter(value);
2727
}

src/core/interfaces.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ export interface CoreChartProps
286286
* overridden with explicitly provided options. An exception is event handlers - those are
287287
* not overridden, but merged with Cloudscape event handlers so that both are getting called.
288288
*/
289-
options: InternalChartOptions;
289+
options: CoreChartOptions;
290290
/**
291291
* The Cloudscape tooltip, that comes with a vertical cursor when used on cartesian series.
292292
* The tooltip content is only shown when `getContent` property is defined, which is called
@@ -446,13 +446,13 @@ export interface TooltipPointFormatted {
446446

447447
// The extended version of Highcharts.Options. The axes types are extended with Cloudscape value formatter.
448448
// We use a custom formatter because we cannot use the built-in Highcharts formatter for our tooltip.
449-
export type InternalChartOptions = Omit<Highcharts.Options, "xAxis" | "yAxis"> & {
450-
xAxis?: InternalXAxisOptions | InternalXAxisOptions[];
451-
yAxis?: InternalYAxisOptions | InternalYAxisOptions[];
449+
export type CoreChartOptions = Omit<Highcharts.Options, "xAxis" | "yAxis"> & {
450+
xAxis?: CoreXAxisOptions | CoreXAxisOptions[];
451+
yAxis?: CoreYAxisOptions | CoreYAxisOptions[];
452452
};
453453

454-
export type InternalXAxisOptions = Highcharts.XAxisOptions & { valueFormatter?: (value: null | number) => string };
455-
export type InternalYAxisOptions = Highcharts.YAxisOptions & { valueFormatter?: (value: null | number) => string };
454+
export type CoreXAxisOptions = Highcharts.XAxisOptions & { valueFormatter?: (value: null | number) => string };
455+
export type CoreYAxisOptions = Highcharts.YAxisOptions & { valueFormatter?: (value: null | number) => string };
456456

457457
export interface VisibleItemsChangeDetail {
458458
items: readonly CoreLegendItem[];

src/internal-do-not-use/core-chart.tsx

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,23 @@ applyDisplayName(CoreChart, "CoreChart");
1616
export default CoreChart;
1717

1818
export namespace CoreChartTypes {
19-
export type BaseChartOptions = CoreInterfaces.BaseChartOptions;
20-
export type BaseFilterOptions = CoreInterfaces.BaseFilterOptions;
21-
export type BaseI18nStrings = CoreInterfaces.BaseI18nStrings;
22-
export type BaseLegendOptions = CoreInterfaces.BaseLegendOptions;
23-
export type BaseNoDataOptions = CoreInterfaces.BaseNoDataOptions;
24-
2519
export type CartesianI18nStrings = CoreInterfaces.CartesianI18nStrings;
26-
export type PieI18nStrings = CoreInterfaces.PieI18nStrings;
2720
export type CoreI18nStrings = CoreInterfaces.CoreI18nStrings;
21+
export type PieI18nStrings = CoreInterfaces.PieI18nStrings;
2822

2923
export type CoreCartesianOptions = CoreInterfaces.CoreCartesianOptions;
3024
export type CoreChartAPI = CoreInterfaces.CoreChartAPI;
25+
export type CoreChartOptions = CoreInterfaces.CoreChartOptions;
3126
export type CoreChartProps = CoreInterfaces.CoreChartProps;
3227
export type CoreFooterOptions = CoreInterfaces.CoreFooterOptions;
3328
export type CoreHeaderOptions = CoreInterfaces.CoreHeaderOptions;
3429
export type CoreLegendItem = CoreInterfaces.CoreLegendItem;
3530
export type CoreLegendOptions = CoreInterfaces.CoreLegendOptions;
36-
3731
export type CoreTooltipContent = CoreInterfaces.CoreTooltipContent;
3832
export type CoreTooltipOptions = CoreInterfaces.CoreTooltipOptions;
33+
export type CoreXAxisOptions = CoreInterfaces.CoreXAxisOptions;
34+
export type CoreYAxisOptions = CoreInterfaces.CoreYAxisOptions;
35+
3936
export type GetLegendTooltipContent = CoreInterfaces.GetLegendTooltipContent;
4037
export type GetLegendTooltipContentProps = CoreInterfaces.GetLegendTooltipContentProps;
4138
export type GetTooltipContent = CoreInterfaces.GetTooltipContent;
@@ -46,9 +43,5 @@ export namespace CoreChartTypes {
4643
export type TooltipPointProps = CoreInterfaces.TooltipPointProps;
4744
export type TooltipSlotProps = CoreInterfaces.TooltipSlotProps;
4845

49-
export type InternalChartOptions = CoreInterfaces.InternalChartOptions;
50-
export type InternalXAxisOptions = CoreInterfaces.InternalXAxisOptions;
51-
export type InternalYAxisOptions = CoreInterfaces.InternalYAxisOptions;
52-
53-
export type ChartHighlightProps = CoreInterfaces.ChartHighlightProps;
46+
export type ChartHighlightProps = CoreInterfaces.HighlightChangeDetail;
5447
}

0 commit comments

Comments
 (0)