@gitlab/ui 126.3.3 → 126.3.4
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/dist/components/charts/shared/tooltip/tooltip.js +2 -2
- package/dist/components/charts/stacked_column/stacked_column.js +16 -5
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/utils/charts/config.js +36 -1
- package/dist/utils/charts/mock_data.js +18 -1
- package/package.json +2 -2
- package/src/components/base/new_dropdowns/dropdown_item.scss +1 -1
- package/src/components/charts/shared/tooltip/tooltip.vue +2 -1
- package/src/components/charts/stacked_column/stacked_column.vue +16 -5
- package/src/utils/charts/config.js +28 -0
- package/src/utils/charts/mock_data.js +7 -0
|
@@ -3,7 +3,7 @@ import { uid, debounceByAnimationFrame } from '../../../../utils/utils';
|
|
|
3
3
|
import GlPopover from '../../../base/popover/popover';
|
|
4
4
|
import { popoverPlacements } from '../../../../utils/constants';
|
|
5
5
|
import { TOOLTIP_LEFT_OFFSET, TOOLTIP_TOP_OFFSET } from '../../../../utils/charts/constants';
|
|
6
|
-
import { getTooltipAxisConfig, getTooltipTitle, getTooltipContent } from '../../../../utils/charts/config';
|
|
6
|
+
import { getTooltipAxisConfig, getTooltipTitle, getTooltipContent, getTooltipParams } from '../../../../utils/charts/config';
|
|
7
7
|
import TooltipDefaultFormat from './tooltip_default_format/tooltip_default_format';
|
|
8
8
|
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
9
9
|
|
|
@@ -239,7 +239,7 @@ var script = {
|
|
|
239
239
|
const valueAxisName = (_options$valueAxis = options[valueAxis]) === null || _options$valueAxis === void 0 ? void 0 : (_options$valueAxis$ = _options$valueAxis[0]) === null || _options$valueAxis$ === void 0 ? void 0 : _options$valueAxis$.name;
|
|
240
240
|
this.title = getTooltipTitle(params, titleAxisName, dimensionIndex);
|
|
241
241
|
this.content = getTooltipContent(params, valueAxisName, metricIndex);
|
|
242
|
-
this.params = params;
|
|
242
|
+
this.params = getTooltipParams(params, options);
|
|
243
243
|
}
|
|
244
244
|
}
|
|
245
245
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import merge from 'lodash/merge';
|
|
2
|
+
import groupBy from 'lodash/groupBy';
|
|
2
3
|
import { yAxis, generateBarSeries, generateLineSeries, gridWithSecondaryYAxis, grid, defaultChartOptions, dataZoomAdjustments, mergeSeriesToOptions } from '../../../utils/charts/config';
|
|
3
4
|
import { LEGEND_AVERAGE_TEXT, LEGEND_MAX_TEXT, LEGEND_MIN_TEXT, LEGEND_CURRENT_TEXT, LEGEND_LAYOUT_INLINE, LEGEND_LAYOUT_TABLE, CHART_DEFAULT_SERIES_STACK, CHART_DEFAULT_SERIES_SECONDARY_STACK, CHART_TYPE_LINE, HEIGHT_AUTO_CLASSES } from '../../../utils/charts/constants';
|
|
4
5
|
import { colorFromDefaultPalette } from '../../../utils/charts/theme';
|
|
@@ -303,16 +304,26 @@ var script = {
|
|
|
303
304
|
params
|
|
304
305
|
} = _ref5;
|
|
305
306
|
if (!params) return {};
|
|
306
|
-
|
|
307
|
-
|
|
307
|
+
|
|
308
|
+
// Group by stack and invert order within so it matches `stacked` presentation (see https://github.com/apache/echarts/issues/14700).
|
|
309
|
+
const seriesDataGroupedByStack = groupBy(params.seriesData, _ref6 => {
|
|
310
|
+
let {
|
|
311
|
+
stack,
|
|
312
|
+
seriesIndex
|
|
313
|
+
} = _ref6;
|
|
314
|
+
return stack !== null && stack !== void 0 ? stack : seriesIndex;
|
|
315
|
+
});
|
|
316
|
+
const sortedSeriesData = Object.values(seriesDataGroupedByStack).flatMap(seriesDataStack => seriesDataStack.toSorted((a, b) => b.seriesIndex - a.seriesIndex));
|
|
317
|
+
const tooltipContentEntries = sortedSeriesData.map(_ref7 => {
|
|
308
318
|
let {
|
|
309
319
|
seriesName = '',
|
|
310
320
|
value,
|
|
311
|
-
borderColor
|
|
312
|
-
|
|
321
|
+
borderColor,
|
|
322
|
+
color
|
|
323
|
+
} = _ref7;
|
|
313
324
|
return [seriesName, {
|
|
314
325
|
value,
|
|
315
|
-
color: borderColor
|
|
326
|
+
color: borderColor !== null && borderColor !== void 0 ? borderColor : color
|
|
316
327
|
}];
|
|
317
328
|
});
|
|
318
329
|
return Object.fromEntries(tooltipContentEntries);
|