@gitlab/ui 111.8.0 → 111.8.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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [111.8.1](https://gitlab.com/gitlab-org/gitlab-ui/compare/v111.8.0...v111.8.1) (2025-03-27)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **GlLineChart, GlAreaChart, GlStackedColumn:** Fix tooltip updates ([7ac5e58](https://gitlab.com/gitlab-org/gitlab-ui/commit/7ac5e589838ad720e2767fb986b628b026467745))
7
+
1
8
  # [111.8.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v111.7.1...v111.8.0) (2025-03-26)
2
9
 
3
10
 
@@ -146,18 +146,7 @@ var script = {
146
146
  return generateAnnotationSeries(this.annotations);
147
147
  },
148
148
  options() {
149
- const defaultAreaChartOptions = {
150
- xAxis: {
151
- axisPointer: {
152
- show: true,
153
- lineStyle: {
154
- type: 'solid'
155
- },
156
- label: {
157
- formatter: this.formatTooltipText
158
- }
159
- }
160
- },
149
+ const areaChartOptions = {
161
150
  yAxis: {
162
151
  axisTick: {
163
152
  show: false
@@ -167,7 +156,20 @@ var script = {
167
156
  show: false
168
157
  }
169
158
  };
170
- const mergedOptions = merge({}, defaultChartOptions, defaultAreaChartOptions, this.option, dataZoomAdjustments(this.option.dataZoom));
159
+
160
+ // `formatTooltipText` is deprecated, these added options should be
161
+ // removed when `formatTooltipText` is removed.
162
+ const deprecatedTooltipFormatterOptions = {
163
+ xAxis: {
164
+ axisPointer: {
165
+ show: true,
166
+ label: {
167
+ formatter: this.formatTooltipText
168
+ }
169
+ }
170
+ }
171
+ };
172
+ const mergedOptions = merge({}, defaultChartOptions, areaChartOptions, this.formatTooltipText ? deprecatedTooltipFormatterOptions : {}, this.option, dataZoomAdjustments(this.option.dataZoom));
171
173
  // All chart options can be merged but series
172
174
  // needs to be handled specially.
173
175
  return mergeSeriesToOptions(mergeAnnotationAxisToOptions(mergedOptions, this.hasAnnotations), this.series);
@@ -140,14 +140,8 @@ var script = {
140
140
  return generateAnnotationSeries(this.annotations);
141
141
  },
142
142
  options() {
143
- const defaultLineChartOptions = {
143
+ const lineChartOptions = {
144
144
  xAxis: {
145
- axisPointer: {
146
- show: true,
147
- label: {
148
- formatter: this.formatTooltipText
149
- }
150
- },
151
145
  axisTick: {
152
146
  alignWithLabel: true,
153
147
  show: true,
@@ -160,7 +154,20 @@ var script = {
160
154
  show: false
161
155
  }
162
156
  };
163
- const mergedOptions = merge({}, defaultChartOptions, defaultLineChartOptions, this.option, dataZoomAdjustments(this.option.dataZoom));
157
+
158
+ // `formatTooltipText` is deprecated, these added options should be
159
+ // removed when `formatTooltipText` is removed.
160
+ const deprecatedTooltipFormatterOptions = {
161
+ xAxis: {
162
+ axisPointer: {
163
+ show: true,
164
+ label: {
165
+ formatter: this.formatTooltipText
166
+ }
167
+ }
168
+ }
169
+ };
170
+ const mergedOptions = merge({}, defaultChartOptions, lineChartOptions, this.formatTooltipText ? deprecatedTooltipFormatterOptions : {}, this.option, dataZoomAdjustments(this.option.dataZoom));
164
171
  // All chart options can be merged but series
165
172
  // needs to be handled specially
166
173
  return mergeSeriesToOptions(mergeAnnotationAxisToOptions(mergedOptions, this.hasAnnotations), this.series);
@@ -1,5 +1,5 @@
1
1
  import merge from 'lodash/merge';
2
- import { yAxis, generateBarSeries, generateLineSeries, defaultChartOptions, gridWithSecondaryYAxis, grid, dataZoomAdjustments, mergeSeriesToOptions } from '../../../utils/charts/config';
2
+ import { yAxis, generateBarSeries, generateLineSeries, gridWithSecondaryYAxis, grid, defaultChartOptions, dataZoomAdjustments, mergeSeriesToOptions } from '../../../utils/charts/config';
3
3
  import { LEGEND_AVERAGE_TEXT, LEGEND_MAX_TEXT, LEGEND_MIN_TEXT, LEGEND_CURRENT_TEXT, LEGEND_LAYOUT_INLINE, LEGEND_LAYOUT_TABLE, CHART_TYPE_LINE, HEIGHT_AUTO_CLASSES } from '../../../utils/charts/constants';
4
4
  import { colorFromDefaultPalette } from '../../../utils/charts/theme';
5
5
  import { columnOptions } from '../../../utils/constants';
@@ -205,7 +205,7 @@ var script = {
205
205
  return [...this.barSeries, ...this.lineSeries, ...this.secondarySeries];
206
206
  },
207
207
  options() {
208
- const mergedOptions = merge({}, defaultChartOptions, {
208
+ const stackedColumnChartOptions = {
209
209
  grid: this.hasSecondaryAxis ? gridWithSecondaryYAxis : grid,
210
210
  xAxis: {
211
211
  boundaryGap: true,
@@ -217,11 +217,7 @@ var script = {
217
217
  show: false
218
218
  },
219
219
  axisPointer: {
220
- show: true,
221
- type: 'none',
222
- label: {
223
- formatter: this.formatTooltipText
224
- }
220
+ type: 'none'
225
221
  },
226
222
  data: this.groupBy,
227
223
  name: this.xAxisTitle,
@@ -238,7 +234,21 @@ var script = {
238
234
  legend: {
239
235
  show: false
240
236
  }
241
- }, this.option, dataZoomAdjustments(this.option.dataZoom));
237
+ };
238
+
239
+ // `formatTooltipText` is deprecated, these added options should be
240
+ // removed when `formatTooltipText` is removed.
241
+ const deprecatedTooltipFormatterOptions = {
242
+ xAxis: {
243
+ axisPointer: {
244
+ show: true,
245
+ label: {
246
+ formatter: this.formatTooltipText
247
+ }
248
+ }
249
+ }
250
+ };
251
+ const mergedOptions = merge({}, defaultChartOptions, stackedColumnChartOptions, this.formatTooltipText ? deprecatedTooltipFormatterOptions : {}, this.option, dataZoomAdjustments(this.option.dataZoom));
242
252
  // All chart options can be merged but series
243
253
  // needs to be handled specially
244
254
  return mergeSeriesToOptions(mergedOptions, this.series);
@@ -37,6 +37,10 @@ const grid = {
37
37
  left: 64,
38
38
  right: 32
39
39
  };
40
+
41
+ /**
42
+ * Options for charts where the y-axis is the metrics axis.
43
+ */
40
44
  const defaultChartOptions = {
41
45
  grid,
42
46
  xAxis,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/ui",
3
- "version": "111.8.0",
3
+ "version": "111.8.1",
4
4
  "description": "GitLab UI Components",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -186,18 +186,7 @@ export default {
186
186
  return generateAnnotationSeries(this.annotations);
187
187
  },
188
188
  options() {
189
- const defaultAreaChartOptions = {
190
- xAxis: {
191
- axisPointer: {
192
- show: true,
193
- lineStyle: {
194
- type: 'solid',
195
- },
196
- label: {
197
- formatter: this.formatTooltipText,
198
- },
199
- },
200
- },
189
+ const areaChartOptions = {
201
190
  yAxis: {
202
191
  axisTick: {
203
192
  show: false,
@@ -207,10 +196,25 @@ export default {
207
196
  show: false,
208
197
  },
209
198
  };
199
+
200
+ // `formatTooltipText` is deprecated, these added options should be
201
+ // removed when `formatTooltipText` is removed.
202
+ const deprecatedTooltipFormatterOptions = {
203
+ xAxis: {
204
+ axisPointer: {
205
+ show: true,
206
+ label: {
207
+ formatter: this.formatTooltipText,
208
+ },
209
+ },
210
+ },
211
+ };
212
+
210
213
  const mergedOptions = merge(
211
214
  {},
212
215
  defaultChartOptions,
213
- defaultAreaChartOptions,
216
+ areaChartOptions,
217
+ this.formatTooltipText ? deprecatedTooltipFormatterOptions : {},
214
218
  this.option,
215
219
  dataZoomAdjustments(this.option.dataZoom)
216
220
  );
@@ -180,14 +180,8 @@ export default {
180
180
  return generateAnnotationSeries(this.annotations);
181
181
  },
182
182
  options() {
183
- const defaultLineChartOptions = {
183
+ const lineChartOptions = {
184
184
  xAxis: {
185
- axisPointer: {
186
- show: true,
187
- label: {
188
- formatter: this.formatTooltipText,
189
- },
190
- },
191
185
  axisTick: {
192
186
  alignWithLabel: true,
193
187
  show: true,
@@ -200,10 +194,25 @@ export default {
200
194
  show: false,
201
195
  },
202
196
  };
197
+
198
+ // `formatTooltipText` is deprecated, these added options should be
199
+ // removed when `formatTooltipText` is removed.
200
+ const deprecatedTooltipFormatterOptions = {
201
+ xAxis: {
202
+ axisPointer: {
203
+ show: true,
204
+ label: {
205
+ formatter: this.formatTooltipText,
206
+ },
207
+ },
208
+ },
209
+ };
210
+
203
211
  const mergedOptions = merge(
204
212
  {},
205
213
  defaultChartOptions,
206
- defaultLineChartOptions,
214
+ lineChartOptions,
215
+ this.formatTooltipText ? deprecatedTooltipFormatterOptions : {},
207
216
  this.option,
208
217
  dataZoomAdjustments(this.option.dataZoom)
209
218
  );
@@ -192,46 +192,58 @@ export default {
192
192
  return [...this.barSeries, ...this.lineSeries, ...this.secondarySeries];
193
193
  },
194
194
  options() {
195
- const mergedOptions = merge(
196
- {},
197
- defaultChartOptions,
198
- {
199
- grid: this.hasSecondaryAxis ? gridWithSecondaryYAxis : grid,
200
- xAxis: {
201
- boundaryGap: true,
202
- axisLabel: {
203
- margin: 20,
204
- verticalAlign: 'bottom',
205
- },
206
- axisLine: {
207
- show: false,
208
- },
209
- axisPointer: {
210
- show: true,
211
- type: 'none',
212
- label: {
213
- formatter: this.formatTooltipText,
214
- },
215
- },
216
- data: this.groupBy,
217
- name: this.xAxisTitle,
218
- type: this.xAxisType,
195
+ const stackedColumnChartOptions = {
196
+ grid: this.hasSecondaryAxis ? gridWithSecondaryYAxis : grid,
197
+ xAxis: {
198
+ boundaryGap: true,
199
+ axisLabel: {
200
+ margin: 20,
201
+ verticalAlign: 'bottom',
219
202
  },
220
- yAxis: [
221
- {
222
- ...yAxisDefaults,
223
- name: this.yAxisTitle,
224
- },
225
- {
226
- ...yAxisDefaults,
227
- name: this.secondaryDataTitle,
228
- show: this.hasSecondaryAxis,
229
- },
230
- ],
231
- legend: {
203
+ axisLine: {
232
204
  show: false,
233
205
  },
206
+ axisPointer: {
207
+ type: 'none',
208
+ },
209
+ data: this.groupBy,
210
+ name: this.xAxisTitle,
211
+ type: this.xAxisType,
212
+ },
213
+ yAxis: [
214
+ {
215
+ ...yAxisDefaults,
216
+ name: this.yAxisTitle,
217
+ },
218
+ {
219
+ ...yAxisDefaults,
220
+ name: this.secondaryDataTitle,
221
+ show: this.hasSecondaryAxis,
222
+ },
223
+ ],
224
+ legend: {
225
+ show: false,
226
+ },
227
+ };
228
+
229
+ // `formatTooltipText` is deprecated, these added options should be
230
+ // removed when `formatTooltipText` is removed.
231
+ const deprecatedTooltipFormatterOptions = {
232
+ xAxis: {
233
+ axisPointer: {
234
+ show: true,
235
+ label: {
236
+ formatter: this.formatTooltipText,
237
+ },
238
+ },
234
239
  },
240
+ };
241
+
242
+ const mergedOptions = merge(
243
+ {},
244
+ defaultChartOptions,
245
+ stackedColumnChartOptions,
246
+ this.formatTooltipText ? deprecatedTooltipFormatterOptions : {},
235
247
  this.option,
236
248
  dataZoomAdjustments(this.option.dataZoom)
237
249
  );
@@ -42,6 +42,9 @@ export const grid = {
42
42
  right: 32,
43
43
  };
44
44
 
45
+ /**
46
+ * Options for charts where the y-axis is the metrics axis.
47
+ */
45
48
  export const defaultChartOptions = {
46
49
  grid,
47
50
  xAxis,