@gooddata/sdk-ui-charts 11.53.0-alpha.6 → 11.53.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.
- package/esm/charts/headline/internal/headlines/baseHeadline/tests/BaseHeadline.test.helpers.d.ts +26 -7
- package/esm/charts/headline/internal/headlines/baseHeadline/tests/BaseHeadline.test.helpers.d.ts.map +1 -1
- package/esm/charts/headline/internal/headlines/baseHeadline/tests/BaseHeadline.test.helpers.js +36 -14
- package/esm/highcharts/adapter/chartPlugins.d.ts.map +1 -1
- package/esm/highcharts/adapter/chartPlugins.js +2 -0
- package/esm/highcharts/adapter/plugins/autohideLabels/skipDataLabelsWithoutSpace.d.ts +10 -0
- package/esm/highcharts/adapter/plugins/autohideLabels/skipDataLabelsWithoutSpace.d.ts.map +1 -0
- package/esm/highcharts/adapter/plugins/autohideLabels/skipDataLabelsWithoutSpace.js +82 -0
- package/esm/highcharts/chartTypes/_chartCreators/customConfiguration.d.ts.map +1 -1
- package/esm/highcharts/chartTypes/_chartCreators/customConfiguration.js +6 -0
- package/esm/highcharts/chartTypes/_util/common.d.ts +8 -1
- package/esm/highcharts/chartTypes/_util/common.d.ts.map +1 -1
- package/esm/highcharts/chartTypes/_util/common.js +12 -2
- package/package.json +13 -13
package/esm/charts/headline/internal/headlines/baseHeadline/tests/BaseHeadline.test.helpers.d.ts
CHANGED
|
@@ -1,10 +1,29 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type ReactElement, type ReactNode } from "react";
|
|
2
2
|
import { type IChartConfig } from "../../../../../../interfaces/chartConfig.js";
|
|
3
3
|
import { type FiredDrillEventCallback } from "../../../interfaces/DrillEvents.js";
|
|
4
|
-
|
|
5
|
-
clientHeight?: number
|
|
6
|
-
clientWidth?: number
|
|
7
|
-
config?: IChartConfig
|
|
8
|
-
fireDrillEvent?: FiredDrillEventCallback
|
|
9
|
-
}
|
|
4
|
+
interface IBaseHeadlineContextProps {
|
|
5
|
+
clientHeight?: number;
|
|
6
|
+
clientWidth?: number;
|
|
7
|
+
config?: IChartConfig;
|
|
8
|
+
fireDrillEvent?: FiredDrillEventCallback;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Provides the base headline context to the tested components through the real React context provider.
|
|
12
|
+
*
|
|
13
|
+
* Mocking the BaseHeadlineContext module instead would leak into other test files whenever tests run
|
|
14
|
+
* without isolation, as the module graph is then shared between them.
|
|
15
|
+
*/
|
|
16
|
+
export declare const createBaseHeadlineTestContext: () => {
|
|
17
|
+
/**
|
|
18
|
+
* Sets the context values used by the renders following this call.
|
|
19
|
+
*/
|
|
20
|
+
setBaseHeadline: (nextProps?: IBaseHeadlineContextProps | undefined) => void;
|
|
21
|
+
/**
|
|
22
|
+
* Wrapper to be passed to the render / renderHook options.
|
|
23
|
+
*/
|
|
24
|
+
wrapper: ({ children }: {
|
|
25
|
+
children?: ReactNode;
|
|
26
|
+
}) => ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
27
|
+
};
|
|
28
|
+
export {};
|
|
10
29
|
//# sourceMappingURL=BaseHeadline.test.helpers.d.ts.map
|
package/esm/charts/headline/internal/headlines/baseHeadline/tests/BaseHeadline.test.helpers.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseHeadline.test.helpers.d.ts","sourceRoot":"","sources":["../../../../../../../src/charts/headline/internal/headlines/baseHeadline/tests/BaseHeadline.test.helpers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"BaseHeadline.test.helpers.d.ts","sourceRoot":"","sources":["../../../../../../../src/charts/headline/internal/headlines/baseHeadline/tests/BaseHeadline.test.helpers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,SAAS,EAAiB,MAAM,OAAO,CAAC;AAIzE,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,6CAA6C,CAAC;AAChF,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAGlF,UAAU,yBAAyB;IAC/B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,cAAc,CAAC,EAAE,uBAAuB,CAAC;CAC5C;AAcD;;;;;GAKG;AACH,eAAO,MAAM,6BAA6B;IAQlC;;OAEG;;IAIH;;OAEG;;;;CAQV,CAAC"}
|
package/esm/charts/headline/internal/headlines/baseHeadline/tests/BaseHeadline.test.helpers.js
CHANGED
|
@@ -1,17 +1,39 @@
|
|
|
1
1
|
// (C) 2023-2026 GoodData Corporation
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
2
|
+
import { createElement } from "react";
|
|
3
|
+
import { afterEach, vi } from "vitest";
|
|
4
|
+
import { BaseHeadlineContext } from "../BaseHeadlineContext.js";
|
|
5
|
+
const createBaseHeadlineContextValue = (props) => ({
|
|
6
|
+
clientHeight: props?.clientHeight || 0,
|
|
7
|
+
clientWidth: props?.clientWidth || 0,
|
|
8
|
+
config: props?.config || {
|
|
9
|
+
separators: {
|
|
10
|
+
decimal: ".",
|
|
11
|
+
thousand: ",",
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
fireDrillEvent: props?.fireDrillEvent || vi.fn(),
|
|
15
|
+
});
|
|
16
|
+
/**
|
|
17
|
+
* Provides the base headline context to the tested components through the real React context provider.
|
|
18
|
+
*
|
|
19
|
+
* Mocking the BaseHeadlineContext module instead would leak into other test files whenever tests run
|
|
20
|
+
* without isolation, as the module graph is then shared between them.
|
|
21
|
+
*/
|
|
22
|
+
export const createBaseHeadlineTestContext = () => {
|
|
23
|
+
let props;
|
|
24
|
+
afterEach(() => {
|
|
25
|
+
props = undefined;
|
|
26
|
+
});
|
|
27
|
+
return {
|
|
28
|
+
/**
|
|
29
|
+
* Sets the context values used by the renders following this call.
|
|
30
|
+
*/
|
|
31
|
+
setBaseHeadline: (nextProps) => {
|
|
32
|
+
props = nextProps;
|
|
33
|
+
},
|
|
34
|
+
/**
|
|
35
|
+
* Wrapper to be passed to the render / renderHook options.
|
|
36
|
+
*/
|
|
37
|
+
wrapper: ({ children }) => createElement(BaseHeadlineContext.Provider, { value: createBaseHeadlineContextValue(props) }, children),
|
|
16
38
|
};
|
|
17
39
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chartPlugins.d.ts","sourceRoot":"","sources":["../../../src/highcharts/adapter/chartPlugins.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"chartPlugins.d.ts","sourceRoot":"","sources":["../../../src/highcharts/adapter/chartPlugins.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAiBlD,wBAAgB,gBAAgB,CAC5B,UAAU,EAAE,GAAG,EACf,4BAA4B,CAAC,EAAE,OAAO,EACtC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GACtB,IAAI,CAwBN"}
|
|
@@ -3,6 +3,7 @@ import { groupedCategories } from "./plugins/3rdParty/grouped-categories.js";
|
|
|
3
3
|
import { initAccessibleTooltipPluginOnce } from "./plugins/accessibleTooltip.js";
|
|
4
4
|
import { adjustTickAmount } from "./plugins/adjustTickAmount.js";
|
|
5
5
|
import { autohideLabels } from "./plugins/autohideLabels/autohideLabels.js";
|
|
6
|
+
import { skipDataLabelsWithoutSpace } from "./plugins/autohideLabels/skipDataLabelsWithoutSpace.js";
|
|
6
7
|
import { extendDataLabelColors } from "./plugins/dataLabelsColors.js";
|
|
7
8
|
import { groupCategoriesWrapper } from "./plugins/group-categories-wrapper.js";
|
|
8
9
|
import { linearTickPositions } from "./plugins/linearTickPositions.js";
|
|
@@ -14,6 +15,7 @@ let dataLabelColorsInitialized = false;
|
|
|
14
15
|
export function initChartPlugins(highcharts, enableAccessibleChartTooltip, theme) {
|
|
15
16
|
if (!basePluginsInitialized) {
|
|
16
17
|
autohideLabels(highcharts);
|
|
18
|
+
skipDataLabelsWithoutSpace(highcharts);
|
|
17
19
|
applyPointHaloOptions(highcharts);
|
|
18
20
|
linearTickPositions(highcharts);
|
|
19
21
|
groupedCategories(highcharts);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Skips drawing data labels that cannot be displayed anyway.
|
|
3
|
+
*
|
|
4
|
+
* Highcharts draws every data label before anything gets a chance to hide it, and each label costs
|
|
5
|
+
* a forced style recalculation in the highcharts text builder (it reads the computed font size to
|
|
6
|
+
* measure the text). On charts with many data points that adds up to seconds of blocked main
|
|
7
|
+
* thread, all of it spent on labels that the 'auto' hiding rules then hide.
|
|
8
|
+
*/
|
|
9
|
+
export declare function skipDataLabelsWithoutSpace(Highcharts: any): void;
|
|
10
|
+
//# sourceMappingURL=skipDataLabelsWithoutSpace.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skipDataLabelsWithoutSpace.d.ts","sourceRoot":"","sources":["../../../../../src/highcharts/adapter/plugins/autohideLabels/skipDataLabelsWithoutSpace.ts"],"names":[],"mappings":"AA6EA;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CAAC,UAAU,EAAE,GAAG,GAAG,IAAI,CAchE"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
// (C) 2026 GoodData Corporation
|
|
2
|
+
import { VisualizationTypes } from "@gooddata/sdk-ui";
|
|
3
|
+
import { getDataLabelsGdcVisible } from "../../../chartTypes/_chartCreators/dataLabelsHelpers.js";
|
|
4
|
+
import { getChartType } from "../../../chartTypes/_chartCreators/helpers.js";
|
|
5
|
+
/**
|
|
6
|
+
* The narrowest slot (in pixels) that could still hold a data label.
|
|
7
|
+
*
|
|
8
|
+
* A label box is never narrower than a single character plus its padding, which measures ~9.8px at
|
|
9
|
+
* our default label font. Measured on a 600px wide column chart with single character labels: all
|
|
10
|
+
* labels are still shown at 11.6px per point and all of them are hidden at 8.7px per point. The
|
|
11
|
+
* bound is set below that range so short labels keep the behaviour they have today, and so a theme
|
|
12
|
+
* with a smaller label font still errs on the side of drawing.
|
|
13
|
+
*/
|
|
14
|
+
const MIN_DATA_LABEL_SLOT = 8;
|
|
15
|
+
/**
|
|
16
|
+
* Chart types whose 'auto' label hiding is all-or-nothing per series: as soon as one pair of
|
|
17
|
+
* neighbouring labels (or a label and its column) overlaps, autohideColumnLabels/autohideBarLabels
|
|
18
|
+
* hide every label of the chart.
|
|
19
|
+
*/
|
|
20
|
+
const ALL_OR_NOTHING_LABEL_TYPES = [
|
|
21
|
+
VisualizationTypes.COLUMN,
|
|
22
|
+
VisualizationTypes.BAR,
|
|
23
|
+
VisualizationTypes.WATERFALL,
|
|
24
|
+
];
|
|
25
|
+
const isAllOrNothingType = (type) => ALL_OR_NOTHING_LABEL_TYPES.includes(type);
|
|
26
|
+
/**
|
|
27
|
+
* Decides whether the series has any chance of showing a data label.
|
|
28
|
+
*
|
|
29
|
+
* Only 'auto' visibility is considered: with labels explicitly turned on the user asked for them
|
|
30
|
+
* to be drawn regardless of overlaps.
|
|
31
|
+
*/
|
|
32
|
+
function hasSpaceForDataLabels(series) {
|
|
33
|
+
const chart = series?.chart;
|
|
34
|
+
if (!chart || getDataLabelsGdcVisible(chart) !== "auto") {
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
const chartType = getChartType(chart);
|
|
38
|
+
// The chart type picks the auto-hide rule, but the rule measures every series of the chart, and
|
|
39
|
+
// in a combo chart the two differ: a column + line combo reports 'column' (getDefaultChartType),
|
|
40
|
+
// while its line labels can stay visible because they are not bound to a column's width. Leave
|
|
41
|
+
// such mixed charts to the existing path — in both directions, since dropping the column labels
|
|
42
|
+
// early would also stop autohideColumnLabels from finding the overlap that hides the line ones.
|
|
43
|
+
const seriesTypes = (chart.series ?? []).map((chartSeries) => chartSeries?.type ?? chartType);
|
|
44
|
+
if (![chartType, ...seriesTypes].every(isAllOrNothingType)) {
|
|
45
|
+
return true;
|
|
46
|
+
}
|
|
47
|
+
// null points get no label, so they widen the gap between the labels that are drawn
|
|
48
|
+
const labelledPoints = (series.points ?? []).filter((point) => point && !point.isNull).length;
|
|
49
|
+
// bar charts are inverted: their labels are laid out along the vertical axis
|
|
50
|
+
const axisLength = chart.inverted ? chart.plotHeight : chart.plotWidth;
|
|
51
|
+
if (!labelledPoints || !axisLength) {
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
54
|
+
return axisLength / labelledPoints >= MIN_DATA_LABEL_SLOT;
|
|
55
|
+
}
|
|
56
|
+
function destroyDataLabels(series) {
|
|
57
|
+
(series.points ?? []).forEach((point) => {
|
|
58
|
+
(point.dataLabels ?? []).forEach((dataLabel) => dataLabel?.destroy?.());
|
|
59
|
+
if (point.dataLabels) {
|
|
60
|
+
point.dataLabels.length = 0;
|
|
61
|
+
}
|
|
62
|
+
point.dataLabel = undefined;
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Skips drawing data labels that cannot be displayed anyway.
|
|
67
|
+
*
|
|
68
|
+
* Highcharts draws every data label before anything gets a chance to hide it, and each label costs
|
|
69
|
+
* a forced style recalculation in the highcharts text builder (it reads the computed font size to
|
|
70
|
+
* measure the text). On charts with many data points that adds up to seconds of blocked main
|
|
71
|
+
* thread, all of it spent on labels that the 'auto' hiding rules then hide.
|
|
72
|
+
*/
|
|
73
|
+
export function skipDataLabelsWithoutSpace(Highcharts) {
|
|
74
|
+
Highcharts.wrap(Highcharts.Series.prototype, "drawDataLabels", function (proceed, ...args) {
|
|
75
|
+
if (!hasSpaceForDataLabels(this)) {
|
|
76
|
+
// labels drawn by a previous, roomier render would otherwise stay behind
|
|
77
|
+
destroyDataLabels(this);
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
proceed.apply(this, args);
|
|
81
|
+
});
|
|
82
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customConfiguration.d.ts","sourceRoot":"","sources":["../../../../src/highcharts/chartTypes/_chartCreators/customConfiguration.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAG5C,OAAO,EAAE,KAAK,MAAM,EAA4B,MAAM,qBAAqB,CAAC;AAC5E,OAAO,EAAkB,KAAK,YAAY,EAAsB,MAAM,kBAAkB,CAAC;AAGzF,OAAO,EAAoB,KAAK,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAEzF,OAAO,EAEH,KAAK,iBAAiB,EAGzB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAEH,KAAK,aAAa,EAOlB,KAAK,mCAAmC,EAC3C,MAAM,yBAAyB,CAAC;AA0GjC,eAAO,MAAM,eAAe,KAAK,CAAC;AAClC,eAAO,MAAM,2BAA2B,KAAK,CAAC;AA+D9C,wBAAgB,mCAAmC,CAC/C,IAAI,EAAE,UAAU,CAAC,gCAAgC,EACjD,QAAQ,EAAE,GAAG,GACd,MAAM,CAkBR;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,UAAU,CAAC,gCAAgC,GAAG,MAAM,CAiB3F;AAyFD,wBAAgB,kCAAkC,CAC9C,IAAI,EAAE,UAAU,CAAC,OAAO,EACxB,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,mCAAmC,GAC3C;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAmB1B;AA8CD,wBAAgB,4BAA4B,CACxC,IAAI,EAAE,UAAU,CAAC,OAAO,EACxB,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,mCAAmC,GAC3C;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CA2B1B;AA6JD,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,YAAY,GAAG,MAAM,CAarF;AAED,wBAAgB,kCAAkC,CAAC,IAAI,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,YAAY,GAAG,MAAM,CAO3F;AAwhBD,wBAAgB,gBAAgB,CAAC,cAAc,EAAE,GAAG,EAAE,GAAG,SAAS,GAAG,GAAG,CASvE;
|
|
1
|
+
{"version":3,"file":"customConfiguration.d.ts","sourceRoot":"","sources":["../../../../src/highcharts/chartTypes/_chartCreators/customConfiguration.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAG5C,OAAO,EAAE,KAAK,MAAM,EAA4B,MAAM,qBAAqB,CAAC;AAC5E,OAAO,EAAkB,KAAK,YAAY,EAAsB,MAAM,kBAAkB,CAAC;AAGzF,OAAO,EAAoB,KAAK,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAEzF,OAAO,EAEH,KAAK,iBAAiB,EAGzB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAEH,KAAK,aAAa,EAOlB,KAAK,mCAAmC,EAC3C,MAAM,yBAAyB,CAAC;AA0GjC,eAAO,MAAM,eAAe,KAAK,CAAC;AAClC,eAAO,MAAM,2BAA2B,KAAK,CAAC;AA+D9C,wBAAgB,mCAAmC,CAC/C,IAAI,EAAE,UAAU,CAAC,gCAAgC,EACjD,QAAQ,EAAE,GAAG,GACd,MAAM,CAkBR;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,UAAU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AAS,EAChB,KAAK,CAAC,EAAE,MAAM,GACf,iBAAiB,CA+BnB"}
|
|
@@ -816,6 +816,12 @@ function getDataConfiguration(chartOptions) {
|
|
|
816
816
|
case VisualizationTypes.SCATTER:
|
|
817
817
|
case VisualizationTypes.BUBBLE:
|
|
818
818
|
case VisualizationTypes.WATERFALL:
|
|
819
|
+
case VisualizationTypes.SANKEY:
|
|
820
|
+
case VisualizationTypes.DEPENDENCY_WHEEL:
|
|
821
|
+
// These types have no category axis. Sankey and dependency wheel chart options carry
|
|
822
|
+
// only a placeholder [[""]] in data.categories; passing that on to xAxis.categories
|
|
823
|
+
// makes the 'grouped-categories' plugin build a category whose 'name' is an object,
|
|
824
|
+
// which then breaks consumers expecting a string (the accessibility formatters).
|
|
819
825
|
return {
|
|
820
826
|
series,
|
|
821
827
|
};
|
|
@@ -5,7 +5,14 @@ export declare function parseValue(value: DataValue): number | null;
|
|
|
5
5
|
export declare const immutableSet: <T extends object, U>(dataSet: T, path: import("lodash-es").PropertyPath, newValue: U) => T;
|
|
6
6
|
export declare const repeatItemsNTimes: <T>(array: T[], n: number) => T[];
|
|
7
7
|
export declare const unEscapeAngleBrackets: (str: string) => string;
|
|
8
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Decodes the entities we escape before handing values over to highcharts.
|
|
10
|
+
*
|
|
11
|
+
* Takes unknown on purpose: most callers are accessibility/tooltip formatters fed from highcharts
|
|
12
|
+
* internals (category, point and series names) that are not guaranteed to be strings. Those
|
|
13
|
+
* formatters run during chart creation, so throwing here takes the whole chart down.
|
|
14
|
+
*/
|
|
15
|
+
export declare function decodeHtmlEntities(value: unknown): string;
|
|
9
16
|
export declare function isRotationInRange(rotation: number, min: number, max: number): boolean;
|
|
10
17
|
/**
|
|
11
18
|
* @internal
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../src/highcharts/chartTypes/_util/common.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,K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,MAAM,mBAAmB,cAA6D,CAAC;AAE9F,wBAAgB,iBAAiB,CAC7B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,cAAc,EAAE,MAAM,EAAE,GACzB,MAAM,CA6BR;AAED,eAAO,MAAM,mBAAmB,yCAK/B,CAAC;AAEF,eAAO,MAAM,MAAM,6BAElB,CAAC;AAmBF,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAS1F;AAED,eAAO,MAAM,iCAAiC,eAG7C,CAAC;AACF,eAAO,MAAM,YAAY,iDAAgF,CAAC;AAE1G,eAAO,MAAM,aAAa,4CAIzB,CAAC;AAIF,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,SAAS,GAAG,OAAO,CAUlF;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,SAAS,GAAG,OAAO,CAOlF"}
|
|
@@ -16,8 +16,18 @@ export const repeatItemsNTimes = (array, n) => new Array(n).fill(null).reduce((r
|
|
|
16
16
|
return result;
|
|
17
17
|
}, []);
|
|
18
18
|
export const unEscapeAngleBrackets = (str) => str?.replace(/<|</g, "<").replace(/>|>/g, ">");
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
/**
|
|
20
|
+
* Decodes the entities we escape before handing values over to highcharts.
|
|
21
|
+
*
|
|
22
|
+
* Takes unknown on purpose: most callers are accessibility/tooltip formatters fed from highcharts
|
|
23
|
+
* internals (category, point and series names) that are not guaranteed to be strings. Those
|
|
24
|
+
* formatters run during chart creation, so throwing here takes the whole chart down.
|
|
25
|
+
*/
|
|
26
|
+
export function decodeHtmlEntities(value) {
|
|
27
|
+
if (typeof value !== "string") {
|
|
28
|
+
return Number.isFinite(value) ? String(value) : "";
|
|
29
|
+
}
|
|
30
|
+
return value.replace(/</g, "<").replace(/>/g, ">").replace(/&/g, "&");
|
|
21
31
|
}
|
|
22
32
|
export function isRotationInRange(rotation, min, max) {
|
|
23
33
|
return rotation >= min && rotation <= max;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gooddata/sdk-ui-charts",
|
|
3
|
-
"version": "11.53.0
|
|
3
|
+
"version": "11.53.0",
|
|
4
4
|
"description": "GoodData.UI SDK - Charts",
|
|
5
5
|
"license": "LicenseRef-LICENSE",
|
|
6
6
|
"author": "GoodData Corporation",
|
|
@@ -69,13 +69,13 @@
|
|
|
69
69
|
"ts-invariant": "0.10.3",
|
|
70
70
|
"tslib": "2.8.1",
|
|
71
71
|
"uuid": "11.1.1",
|
|
72
|
-
"@gooddata/sdk-backend-spi": "11.53.0
|
|
73
|
-
"@gooddata/sdk-
|
|
74
|
-
"@gooddata/sdk-
|
|
75
|
-
"@gooddata/sdk-ui-theme-provider": "11.53.0
|
|
76
|
-
"@gooddata/sdk-ui
|
|
77
|
-
"@gooddata/
|
|
78
|
-
"@gooddata/
|
|
72
|
+
"@gooddata/sdk-backend-spi": "11.53.0",
|
|
73
|
+
"@gooddata/sdk-ui-kit": "11.53.0",
|
|
74
|
+
"@gooddata/sdk-model": "11.53.0",
|
|
75
|
+
"@gooddata/sdk-ui-theme-provider": "11.53.0",
|
|
76
|
+
"@gooddata/sdk-ui": "11.53.0",
|
|
77
|
+
"@gooddata/util": "11.53.0",
|
|
78
|
+
"@gooddata/sdk-ui-vis-commons": "11.53.0"
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
81
81
|
"@microsoft/api-documenter": "^7.17.0",
|
|
@@ -120,11 +120,11 @@
|
|
|
120
120
|
"typescript": "5.9.3",
|
|
121
121
|
"vitest": "4.1.8",
|
|
122
122
|
"vitest-dom": "0.1.1",
|
|
123
|
-
"@gooddata/eslint-config": "11.53.0
|
|
124
|
-
"@gooddata/
|
|
125
|
-
"@gooddata/
|
|
126
|
-
"@gooddata/sdk-backend-mockingbird": "11.53.0
|
|
127
|
-
"@gooddata/stylelint-config": "11.53.0
|
|
123
|
+
"@gooddata/eslint-config": "11.53.0",
|
|
124
|
+
"@gooddata/oxlint-config": "11.53.0",
|
|
125
|
+
"@gooddata/reference-workspace": "11.53.0",
|
|
126
|
+
"@gooddata/sdk-backend-mockingbird": "11.53.0",
|
|
127
|
+
"@gooddata/stylelint-config": "11.53.0"
|
|
128
128
|
},
|
|
129
129
|
"peerDependencies": {
|
|
130
130
|
"react": "^18.0.0 || ^19.0.0",
|