@gooddata/sdk-ui-charts 11.37.0-alpha.0 → 11.37.0-alpha.1

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.
@@ -1,6 +1,6 @@
1
1
  // (C) 2007-2026 GoodData Corporation
2
2
  import { VisualizationTypes } from "@gooddata/sdk-ui";
3
- import { DEFAULT_CATEGORIES_LIMIT, DEFAULT_DATA_POINTS_LIMIT, DEFAULT_SERIES_LIMIT, HEATMAP_DATA_POINTS_LIMIT, PIE_CHART_LIMIT, SANKEY_CHART_DATA_POINT_LIMIT, SANKEY_CHART_NODE_LIMIT, SOFT_DEFAULT_CATEGORIES_LIMIT, SOFT_DEFAULT_DATA_POINTS_LIMIT, SOFT_DEFAULT_SERIES_LIMIT, SOFT_PIE_CHART_LIMIT, SOFT_SANKEY_CHART_DATA_POINT_LIMIT, SOFT_SANKEY_CHART_NODE_LIMIT, SOFT_WATERFALL_CHART_DATA_POINT_LIMIT, WATERFALL_CHART_DATA_POINT_LIMIT, } from "../../constants/limits.js";
3
+ import { DEFAULT_CATEGORIES_LIMIT, DEFAULT_DATA_POINTS_LIMIT, DEFAULT_SERIES_LIMIT, HEATMAP_DATA_POINTS_LIMIT, PIE_CHART_LIMIT, SANKEY_CHART_DATA_POINT_LIMIT, SANKEY_CHART_NODE_LIMIT, SOFT_DEFAULT_CATEGORIES_LIMIT, SOFT_DEFAULT_DATA_POINTS_LIMIT, SOFT_DEFAULT_SERIES_LIMIT, SOFT_PIE_CHART_LIMIT, SOFT_SANKEY_CHART_DATA_POINT_LIMIT, SOFT_SANKEY_CHART_NODE_LIMIT, SOFT_STACKED_COLUMN_BAR_SERIES_LIMIT, SOFT_WATERFALL_CHART_DATA_POINT_LIMIT, STACKED_COLUMN_BAR_SERIES_LIMIT, WATERFALL_CHART_DATA_POINT_LIMIT, } from "../../constants/limits.js";
4
4
  import { isDataOfReasonableSize } from "../_chartCreators/highChartsCreators.js";
5
5
  import { isOneOfTypes, isTreemap } from "../_util/common.js";
6
6
  import { unsupportedNegativeValuesTypes } from "./chartCapabilities.js";
@@ -11,7 +11,8 @@ export function isNegativeValueIncluded(series) {
11
11
  }
12
12
  return series.some((seriesItem) => (seriesItem.data || []).some(({ y, value, weight }) => isNegativeNumber(y) || isNegativeNumber(value) || isNegativeNumber(weight)));
13
13
  }
14
- function getChartLimits(type) {
14
+ function getChartLimits(type, chartOptions) {
15
+ const isStacked = !!chartOptions?.stacking;
15
16
  switch (type) {
16
17
  case VisualizationTypes.SCATTER:
17
18
  return {
@@ -51,6 +52,12 @@ function getChartLimits(type) {
51
52
  categories: WATERFALL_CHART_DATA_POINT_LIMIT,
52
53
  dataPoints: WATERFALL_CHART_DATA_POINT_LIMIT,
53
54
  };
55
+ case VisualizationTypes.COLUMN:
56
+ case VisualizationTypes.BAR:
57
+ return {
58
+ series: isStacked ? STACKED_COLUMN_BAR_SERIES_LIMIT : DEFAULT_SERIES_LIMIT,
59
+ categories: DEFAULT_CATEGORIES_LIMIT,
60
+ };
54
61
  default:
55
62
  return {
56
63
  series: DEFAULT_SERIES_LIMIT,
@@ -58,7 +65,8 @@ function getChartLimits(type) {
58
65
  };
59
66
  }
60
67
  }
61
- function getSoftChartLimits(type) {
68
+ function getSoftChartLimits(type, chartOptions) {
69
+ const isStacked = !!chartOptions?.stacking;
62
70
  switch (type) {
63
71
  case VisualizationTypes.SCATTER:
64
72
  return {
@@ -98,6 +106,12 @@ function getSoftChartLimits(type) {
98
106
  categories: SOFT_WATERFALL_CHART_DATA_POINT_LIMIT,
99
107
  dataPoints: SOFT_WATERFALL_CHART_DATA_POINT_LIMIT,
100
108
  };
109
+ case VisualizationTypes.COLUMN:
110
+ case VisualizationTypes.BAR:
111
+ return {
112
+ series: isStacked ? SOFT_STACKED_COLUMN_BAR_SERIES_LIMIT : SOFT_DEFAULT_SERIES_LIMIT,
113
+ categories: SOFT_DEFAULT_CATEGORIES_LIMIT,
114
+ };
101
115
  default:
102
116
  return {
103
117
  series: SOFT_DEFAULT_SERIES_LIMIT,
@@ -121,7 +135,9 @@ function getTreemapDataForValidation(data) {
121
135
  export function validateData(limits, chartOptions) {
122
136
  const type = chartOptions.type;
123
137
  const { isViewByTwoAttributes } = chartOptions;
124
- const finalLimits = limits || getChartLimits(type);
138
+ // Consumer-supplied limits intentionally replace per-type defaults.
139
+ // The stacked column/bar series cap applies only when default limits are used.
140
+ const finalLimits = limits || getChartLimits(type, chartOptions);
125
141
  let dataToValidate = chartOptions.data;
126
142
  if (isTreemap(type)) {
127
143
  dataToValidate = getTreemapDataForValidation(chartOptions.data);
@@ -133,7 +149,7 @@ export function validateData(limits, chartOptions) {
133
149
  }
134
150
  export function getIsFilteringRecommended(chartOptions) {
135
151
  const { type, isViewByTwoAttributes } = chartOptions;
136
- const limits = getSoftChartLimits(type);
152
+ const limits = getSoftChartLimits(type, chartOptions);
137
153
  const dataToValidate = isTreemap(type)
138
154
  ? getTreemapDataForValidation(chartOptions.data)
139
155
  : chartOptions.data;
@@ -144,7 +160,7 @@ export function getIsFilteringRecommended(chartOptions) {
144
160
  */
145
161
  export function getDataTooLargeErrorMessage(limits, chartOptions) {
146
162
  const { type, isViewByTwoAttributes } = chartOptions;
147
- const { series: seriesLimit, categories: categoriesLimit, nodes: nodesLimit, dataPoints: dataPointsLimit, } = limits || getChartLimits(type);
163
+ const { series: seriesLimit, categories: categoriesLimit, nodes: nodesLimit, dataPoints: dataPointsLimit, } = limits || getChartLimits(type, chartOptions);
148
164
  const dataToValidate = isTreemap(type)
149
165
  ? getTreemapDataForValidation(chartOptions.data)
150
166
  : chartOptions.data;
@@ -6,6 +6,7 @@ export declare const HEATMAP_DATA_POINTS_LIMIT = 10000;
6
6
  export declare const SANKEY_CHART_NODE_LIMIT = 10000;
7
7
  export declare const SANKEY_CHART_DATA_POINT_LIMIT = 10000;
8
8
  export declare const WATERFALL_CHART_DATA_POINT_LIMIT = 10000;
9
+ export declare const STACKED_COLUMN_BAR_SERIES_LIMIT = 1000;
9
10
  /**
10
11
  * Soft limits are used for checking whether the chart should be recommended to be filtered out
11
12
  * due to too many data points.
@@ -20,3 +21,4 @@ export declare const SOFT_PIE_CHART_LIMIT = 20;
20
21
  export declare const SOFT_SANKEY_CHART_NODE_LIMIT = 50;
21
22
  export declare const SOFT_SANKEY_CHART_DATA_POINT_LIMIT = 500;
22
23
  export declare const SOFT_WATERFALL_CHART_DATA_POINT_LIMIT = 400;
24
+ export declare const SOFT_STACKED_COLUMN_BAR_SERIES_LIMIT = 50;
@@ -1,4 +1,4 @@
1
- // (C) 2007-2024 GoodData Corporation
1
+ // (C) 2007-2026 GoodData Corporation
2
2
  export const DEFAULT_SERIES_LIMIT = 10000;
3
3
  export const DEFAULT_CATEGORIES_LIMIT = 10000;
4
4
  export const DEFAULT_DATA_POINTS_LIMIT = 10000;
@@ -7,6 +7,9 @@ export const HEATMAP_DATA_POINTS_LIMIT = 10000;
7
7
  export const SANKEY_CHART_NODE_LIMIT = 10000;
8
8
  export const SANKEY_CHART_DATA_POINT_LIMIT = 10000;
9
9
  export const WATERFALL_CHART_DATA_POINT_LIMIT = 10000;
10
+ // Stacked column/bar charts freeze the main thread well before the generic 10k series cap
11
+ // (Highcharts can't draw more than ~1500 stacks), so they need a tighter limit than other chart types.
12
+ export const STACKED_COLUMN_BAR_SERIES_LIMIT = 1000;
10
13
  /**
11
14
  * Soft limits are used for checking whether the chart should be recommended to be filtered out
12
15
  * due to too many data points.
@@ -21,3 +24,4 @@ export const SOFT_PIE_CHART_LIMIT = 20;
21
24
  export const SOFT_SANKEY_CHART_NODE_LIMIT = 50;
22
25
  export const SOFT_SANKEY_CHART_DATA_POINT_LIMIT = 500;
23
26
  export const SOFT_WATERFALL_CHART_DATA_POINT_LIMIT = 400;
27
+ export const SOFT_STACKED_COLUMN_BAR_SERIES_LIMIT = 50;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gooddata/sdk-ui-charts",
3
- "version": "11.37.0-alpha.0",
3
+ "version": "11.37.0-alpha.1",
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.0",
72
- "@gooddata/sdk-model": "11.37.0-alpha.0",
73
- "@gooddata/sdk-ui-kit": "11.37.0-alpha.0",
74
- "@gooddata/sdk-backend-spi": "11.37.0-alpha.0",
75
- "@gooddata/sdk-ui": "11.37.0-alpha.0",
76
- "@gooddata/sdk-ui-theme-provider": "11.37.0-alpha.0",
77
- "@gooddata/util": "11.37.0-alpha.0",
78
- "@gooddata/sdk-ui-vis-commons": "11.37.0-alpha.0"
72
+ "@gooddata/sdk-backend-spi": "11.37.0-alpha.1",
73
+ "@gooddata/sdk-model": "11.37.0-alpha.1",
74
+ "@gooddata/sdk-ui": "11.37.0-alpha.1",
75
+ "@gooddata/sdk-ui-theme-provider": "11.37.0-alpha.1",
76
+ "@gooddata/sdk-ui-kit": "11.37.0-alpha.1",
77
+ "@gooddata/sdk-ui-vis-commons": "11.37.0-alpha.1",
78
+ "@gooddata/util": "11.37.0-alpha.1"
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.0",
122
122
  "vitest-dom": "0.1.1",
123
- "@gooddata/eslint-config": "11.37.0-alpha.0",
124
- "@gooddata/reference-workspace": "11.37.0-alpha.0",
125
- "@gooddata/oxlint-config": "11.37.0-alpha.0",
126
- "@gooddata/stylelint-config": "11.37.0-alpha.0",
127
- "@gooddata/sdk-backend-mockingbird": "11.37.0-alpha.0"
123
+ "@gooddata/eslint-config": "11.37.0-alpha.1",
124
+ "@gooddata/oxlint-config": "11.37.0-alpha.1",
125
+ "@gooddata/sdk-backend-mockingbird": "11.37.0-alpha.1",
126
+ "@gooddata/reference-workspace": "11.37.0-alpha.1",
127
+ "@gooddata/stylelint-config": "11.37.0-alpha.1"
128
128
  },
129
129
  "peerDependencies": {
130
130
  "react": "^18.0.0 || ^19.0.0",