@gitlab/ui 56.3.0 → 56.4.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 +14 -0
- package/dist/components/charts/area/area.js +17 -3
- package/dist/components/charts/bar/bar.js +17 -3
- package/dist/components/charts/chart/chart.js +3 -0
- package/dist/components/charts/column/column.js +17 -3
- package/dist/components/charts/discrete_scatter/discrete_scatter.js +17 -2
- package/dist/components/charts/gauge/gauge.js +1 -1
- package/dist/components/charts/heatmap/heatmap.js +17 -3
- package/dist/components/charts/line/line.js +17 -3
- package/dist/components/charts/sparkline/sparkline.js +11 -4
- package/dist/components/charts/stacked_column/stacked_column.js +17 -3
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/utils/charts/constants.js +5 -1
- package/package.json +5 -5
- package/src/components/base/drawer/drawer.scss +7 -6
- package/src/components/charts/area/area.spec.js +9 -0
- package/src/components/charts/area/area.stories.js +3 -0
- package/src/components/charts/area/area.vue +22 -2
- package/src/components/charts/bar/bar.spec.js +11 -2
- package/src/components/charts/bar/bar.stories.js +21 -7
- package/src/components/charts/bar/bar.vue +22 -3
- package/src/components/charts/chart/chart.vue +3 -0
- package/src/components/charts/column/column.stories.js +3 -0
- package/src/components/charts/column/column.vue +26 -3
- package/src/components/charts/column/column_chart.spec.js +9 -0
- package/src/components/charts/discrete_scatter/discrete_scatter.spec.js +41 -0
- package/src/components/charts/discrete_scatter/discrete_scatter.stories.js +3 -0
- package/src/components/charts/discrete_scatter/discrete_scatter.vue +22 -2
- package/src/components/charts/gauge/gauge.stories.js +5 -2
- package/src/components/charts/gauge/gauge.vue +1 -3
- package/src/components/charts/heatmap/heatmap.spec.js +25 -5
- package/src/components/charts/heatmap/heatmap.stories.js +3 -0
- package/src/components/charts/heatmap/heatmap.vue +22 -3
- package/src/components/charts/line/line.spec.js +9 -0
- package/src/components/charts/line/line.stories.js +3 -0
- package/src/components/charts/line/line.vue +22 -2
- package/src/components/charts/sparkline/sparkline.spec.js +28 -1
- package/src/components/charts/sparkline/sparkline.stories.js +18 -10
- package/src/components/charts/sparkline/sparkline.vue +14 -3
- package/src/components/charts/stacked_column/stacked_column.spec.js +9 -0
- package/src/components/charts/stacked_column/stacked_column.stories.js +3 -0
- package/src/components/charts/stacked_column/stacked_column.vue +22 -2
- package/src/utils/charts/constants.js +4 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [56.4.1](https://gitlab.com/gitlab-org/gitlab-ui/compare/v56.4.0...v56.4.1) (2023-03-14)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* Limit drawer component width to 100% on small devices ([767acd9](https://gitlab.com/gitlab-org/gitlab-ui/commit/767acd944b65ab9680ef612fc62a9b815db7d12f))
|
|
7
|
+
|
|
8
|
+
# [56.4.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v56.3.0...v56.4.0) (2023-03-13)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* **charts:** fill to container height when height is "auto" ([dab39d8](https://gitlab.com/gitlab-org/gitlab-ui/commit/dab39d8116f97ef5c459e8872bfa97058dae65d4))
|
|
14
|
+
|
|
1
15
|
# [56.3.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v56.2.1...v56.3.0) (2023-03-08)
|
|
2
16
|
|
|
3
17
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import merge from 'lodash/merge';
|
|
2
2
|
import { defaultAreaOpacity, lineStyle, getThresholdConfig, generateAnnotationSeries, defaultChartOptions, dataZoomAdjustments, mergeSeriesToOptions, mergeAnnotationAxisToOptions, grid, getDefaultTooltipContent } from '../../../utils/charts/config';
|
|
3
|
-
import { LEGEND_AVERAGE_TEXT, LEGEND_MAX_TEXT, LEGEND_MIN_TEXT, LEGEND_CURRENT_TEXT, LEGEND_LAYOUT_INLINE, LEGEND_LAYOUT_TABLE, DATA_TOOLTIP_LEFT_OFFSET, ANNOTATION_TOOLTIP_TOP_OFFSET } from '../../../utils/charts/constants';
|
|
3
|
+
import { LEGEND_AVERAGE_TEXT, LEGEND_MAX_TEXT, LEGEND_MIN_TEXT, LEGEND_CURRENT_TEXT, LEGEND_LAYOUT_INLINE, LEGEND_LAYOUT_TABLE, DATA_TOOLTIP_LEFT_OFFSET, ANNOTATION_TOOLTIP_TOP_OFFSET, HEIGHT_AUTO_CLASSES } from '../../../utils/charts/constants';
|
|
4
4
|
import { colorFromDefaultPalette } from '../../../utils/charts/theme';
|
|
5
5
|
import { seriesHasAnnotations, isDataPointAnnotation } from '../../../utils/charts/utils';
|
|
6
6
|
import { debounceByAnimationFrame } from '../../../utils/utils';
|
|
@@ -81,6 +81,14 @@ var script = {
|
|
|
81
81
|
validator(layout) {
|
|
82
82
|
return [LEGEND_LAYOUT_INLINE, LEGEND_LAYOUT_TABLE].indexOf(layout) !== -1;
|
|
83
83
|
}
|
|
84
|
+
},
|
|
85
|
+
/**
|
|
86
|
+
* Sets the chart's height in pixels. Set to `"auto"` to use the height of the container.
|
|
87
|
+
*/
|
|
88
|
+
height: {
|
|
89
|
+
type: [Number, String],
|
|
90
|
+
required: false,
|
|
91
|
+
default: null
|
|
84
92
|
}
|
|
85
93
|
},
|
|
86
94
|
data() {
|
|
@@ -197,6 +205,9 @@ var script = {
|
|
|
197
205
|
}
|
|
198
206
|
return acc;
|
|
199
207
|
}, []);
|
|
208
|
+
},
|
|
209
|
+
autoHeight() {
|
|
210
|
+
return this.height === 'auto';
|
|
200
211
|
}
|
|
201
212
|
},
|
|
202
213
|
beforeDestroy() {
|
|
@@ -282,14 +293,17 @@ var script = {
|
|
|
282
293
|
onLabelChange(params) {
|
|
283
294
|
this.selectedFormatTooltipText(params);
|
|
284
295
|
}
|
|
285
|
-
}
|
|
296
|
+
},
|
|
297
|
+
HEIGHT_AUTO_CLASSES
|
|
286
298
|
};
|
|
287
299
|
|
|
288
300
|
/* script */
|
|
289
301
|
const __vue_script__ = script;
|
|
290
302
|
|
|
291
303
|
/* template */
|
|
292
|
-
var __vue_render__ = function () {
|
|
304
|
+
var __vue_render__ = function () {
|
|
305
|
+
var _obj;
|
|
306
|
+
var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"position-relative",class:( _obj = {}, _obj[_vm.$options.HEIGHT_AUTO_CLASSES] = _vm.autoHeight, _obj )},[_c('chart',_vm._g(_vm._b({class:{ 'gl-flex-grow-1': _vm.autoHeight },attrs:{"height":_vm.height,"options":_vm.options},on:{"created":_vm.onCreated}},'chart',_vm.$attrs,false),_vm.$listeners)),_vm._v(" "),(_vm.shouldShowAnnotationsTooltip)?_c('chart-tooltip',{ref:"annotationsTooltip",attrs:{"id":"annotationsTooltip","show":_vm.showAnnotationsTooltip,"chart":_vm.chart,"top":_vm.annotationsTooltipPosition.top,"left":_vm.annotationsTooltipPosition.left,"placement":"bottom"},scopedSlots:_vm._u([{key:"title",fn:function(){return [_c('div',[_vm._v(_vm._s(_vm.annotationsTooltipTitle))])]},proxy:true}],null,false,1889294429)},[_vm._v(" "),_c('div',[_vm._v(_vm._s(_vm.annotationsTooltipContent))])]):_vm._e(),_vm._v(" "),(_vm.chart)?_c('chart-tooltip',{ref:"dataTooltip",staticClass:"gl-pointer-events-none",attrs:{"id":"dataTooltip","show":_vm.showDataTooltip,"chart":_vm.chart,"top":_vm.dataTooltipPosition.top,"left":_vm.dataTooltipPosition.left},scopedSlots:_vm._u([{key:"title",fn:function(){return [(_vm.formatTooltipText)?_vm._t("tooltip-title"):[_vm._v("\n "+_vm._s(_vm.dataTooltipTitle)+"\n "),(_vm.options.xAxis.name)?[_vm._v("("+_vm._s(_vm.options.xAxis.name)+")")]:_vm._e()]]},proxy:true}],null,true)},[_vm._v(" "),(_vm.formatTooltipText)?_vm._t("tooltip-content"):_c('tooltip-default-format',{attrs:{"tooltip-content":_vm.dataTooltipContent}})],2):_vm._e(),_vm._v(" "),(_vm.compiledOptions)?_c('chart-legend',{style:(_vm.legendStyle),attrs:{"chart":_vm.chart,"series-info":_vm.seriesInfo,"text-style":_vm.compiledOptions.textStyle,"min-text":_vm.legendMinText,"max-text":_vm.legendMaxText,"average-text":_vm.legendAverageText,"current-text":_vm.legendCurrentText,"layout":_vm.legendLayout}}):_vm._e()],1)};
|
|
293
307
|
var __vue_staticRenderFns__ = [];
|
|
294
308
|
|
|
295
309
|
/* style */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import merge from 'lodash/merge';
|
|
2
2
|
import truncate from 'lodash/truncate';
|
|
3
3
|
import { dataZoomAdjustments, mergeSeriesToOptions, grid } from '../../../utils/charts/config';
|
|
4
|
-
import { TOOLTIP_LEFT_OFFSET } from '../../../utils/charts/constants';
|
|
4
|
+
import { TOOLTIP_LEFT_OFFSET, HEIGHT_AUTO_CLASSES } from '../../../utils/charts/constants';
|
|
5
5
|
import { colorFromDefaultPalette } from '../../../utils/charts/theme';
|
|
6
6
|
import { engineeringNotation } from '../../../utils/number_utils';
|
|
7
7
|
import { debounceByAnimationFrame, hexToRgba } from '../../../utils/utils';
|
|
@@ -83,6 +83,14 @@ var script = {
|
|
|
83
83
|
type: String,
|
|
84
84
|
required: false,
|
|
85
85
|
default: 'value'
|
|
86
|
+
},
|
|
87
|
+
/**
|
|
88
|
+
* Sets the chart's height in pixels. Set to `"auto"` to use the height of the container.
|
|
89
|
+
*/
|
|
90
|
+
height: {
|
|
91
|
+
type: [Number, String],
|
|
92
|
+
required: false,
|
|
93
|
+
default: null
|
|
86
94
|
}
|
|
87
95
|
},
|
|
88
96
|
data() {
|
|
@@ -151,6 +159,9 @@ var script = {
|
|
|
151
159
|
// All chart options can be merged but series
|
|
152
160
|
// needs to be handled specially
|
|
153
161
|
return mergeSeriesToOptions(mergedOptions, this.series);
|
|
162
|
+
},
|
|
163
|
+
autoHeight() {
|
|
164
|
+
return this.height === 'auto';
|
|
154
165
|
}
|
|
155
166
|
},
|
|
156
167
|
beforeDestroy() {
|
|
@@ -218,14 +229,17 @@ var script = {
|
|
|
218
229
|
tooltipContent
|
|
219
230
|
};
|
|
220
231
|
}
|
|
221
|
-
}
|
|
232
|
+
},
|
|
233
|
+
HEIGHT_AUTO_CLASSES
|
|
222
234
|
};
|
|
223
235
|
|
|
224
236
|
/* script */
|
|
225
237
|
const __vue_script__ = script;
|
|
226
238
|
|
|
227
239
|
/* template */
|
|
228
|
-
var __vue_render__ = function () {
|
|
240
|
+
var __vue_render__ = function () {
|
|
241
|
+
var _obj;
|
|
242
|
+
var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"position-relative",class:( _obj = {}, _obj[_vm.$options.HEIGHT_AUTO_CLASSES] = _vm.autoHeight, _obj )},[_c('chart',_vm._g(_vm._b({class:{ 'gl-flex-grow-1': _vm.autoHeight },attrs:{"height":_vm.height,"options":_vm.options},on:{"created":_vm.onCreated}},'chart',_vm.$attrs,false),_vm.$listeners)),_vm._v(" "),(_vm.chart)?_c('chart-tooltip',{attrs:{"show":_vm.showTooltip,"chart":_vm.chart,"top":_vm.tooltipPosition.top,"left":_vm.tooltipPosition.left},scopedSlots:_vm._u([{key:"title",fn:function(){return [_c('div',[_vm._v(_vm._s(_vm.tooltipTitle)+" ("+_vm._s(_vm.yAxisTitle)+")")])]},proxy:true}],null,false,1644826356)},[_vm._v(" "),_c('tooltip-default-format',{attrs:{"tooltip-content":_vm.tooltipContent}})],1):_vm._e()],1)};
|
|
229
243
|
var __vue_staticRenderFns__ = [];
|
|
230
244
|
|
|
231
245
|
/* style */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import merge from 'lodash/merge';
|
|
2
2
|
import { yAxis, generateBarSeries, generateLineSeries, defaultChartOptions, gridWithSecondaryYAxis, grid, dataZoomAdjustments, mergeSeriesToOptions, getDefaultTooltipContent } from '../../../utils/charts/config';
|
|
3
|
-
import { CHART_TYPE_LINE, TOOLTIP_LEFT_OFFSET } from '../../../utils/charts/constants';
|
|
3
|
+
import { CHART_TYPE_LINE, TOOLTIP_LEFT_OFFSET, HEIGHT_AUTO_CLASSES } from '../../../utils/charts/constants';
|
|
4
4
|
import { colorFromDefaultPalette } from '../../../utils/charts/theme';
|
|
5
5
|
import { columnOptions } from '../../../utils/constants';
|
|
6
6
|
import { debounceByAnimationFrame } from '../../../utils/utils';
|
|
@@ -62,6 +62,14 @@ var script = {
|
|
|
62
62
|
type: String,
|
|
63
63
|
required: true,
|
|
64
64
|
validator: value => ['value', 'category', 'time', 'log'].indexOf(value) !== -1
|
|
65
|
+
},
|
|
66
|
+
/**
|
|
67
|
+
* Sets the chart's height in pixels. Set to `"auto"` to use the height of the container.
|
|
68
|
+
*/
|
|
69
|
+
height: {
|
|
70
|
+
type: [Number, String],
|
|
71
|
+
required: false,
|
|
72
|
+
default: null
|
|
65
73
|
}
|
|
66
74
|
},
|
|
67
75
|
data() {
|
|
@@ -175,6 +183,9 @@ var script = {
|
|
|
175
183
|
// All chart options can be merged but series
|
|
176
184
|
// needs to be handled specially
|
|
177
185
|
return mergeSeriesToOptions(mergedOptions, this.series);
|
|
186
|
+
},
|
|
187
|
+
autoHeight() {
|
|
188
|
+
return this.height === 'auto';
|
|
178
189
|
}
|
|
179
190
|
},
|
|
180
191
|
beforeDestroy() {
|
|
@@ -203,14 +214,17 @@ var script = {
|
|
|
203
214
|
this.$set(this, 'tooltipContent', tooltipContent);
|
|
204
215
|
this.tooltipTitle = xLabels.join(', ');
|
|
205
216
|
}
|
|
206
|
-
}
|
|
217
|
+
},
|
|
218
|
+
HEIGHT_AUTO_CLASSES
|
|
207
219
|
};
|
|
208
220
|
|
|
209
221
|
/* script */
|
|
210
222
|
const __vue_script__ = script;
|
|
211
223
|
|
|
212
224
|
/* template */
|
|
213
|
-
var __vue_render__ = function () {
|
|
225
|
+
var __vue_render__ = function () {
|
|
226
|
+
var _obj;
|
|
227
|
+
var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"position-relative",class:( _obj = {}, _obj[_vm.$options.HEIGHT_AUTO_CLASSES] = _vm.autoHeight, _obj )},[_c('chart',_vm._g(_vm._b({class:{ 'gl-flex-grow-1': _vm.autoHeight },attrs:{"height":_vm.height,"options":_vm.options},on:{"created":_vm.onCreated}},'chart',_vm.$attrs,false),_vm.$listeners)),_vm._v(" "),(_vm.chart)?_c('chart-tooltip',{attrs:{"show":_vm.showTooltip,"chart":_vm.chart,"top":_vm.tooltipPosition.top,"left":_vm.tooltipPosition.left},scopedSlots:_vm._u([{key:"title",fn:function(){return [_c('div',[_vm._v(_vm._s(_vm.tooltipTitle)+" ("+_vm._s(_vm.xAxisTitle)+")")])]},proxy:true}],null,false,643259221)},[_vm._v(" "),_c('tooltip-default-format',{attrs:{"tooltip-content":_vm.tooltipContent}})],1):_vm._e()],1)};
|
|
214
228
|
var __vue_staticRenderFns__ = [];
|
|
215
229
|
|
|
216
230
|
/* style */
|
|
@@ -2,6 +2,7 @@ import merge from 'lodash/merge';
|
|
|
2
2
|
import { defaultChartOptions, dataZoomAdjustments, mergeSeriesToOptions } from '../../../utils/charts/config';
|
|
3
3
|
import { colorFromDefaultPalette } from '../../../utils/charts/theme';
|
|
4
4
|
import { debounceByAnimationFrame } from '../../../utils/utils';
|
|
5
|
+
import { HEIGHT_AUTO_CLASSES } from '../../../utils/charts/constants';
|
|
5
6
|
import TooltipDefaultFormat from '../../shared_components/charts/tooltip_default_format';
|
|
6
7
|
import Chart from '../chart/chart';
|
|
7
8
|
import ChartTooltip from '../tooltip/tooltip';
|
|
@@ -43,6 +44,14 @@ var script = {
|
|
|
43
44
|
type: Function,
|
|
44
45
|
required: false,
|
|
45
46
|
default: null
|
|
47
|
+
},
|
|
48
|
+
/**
|
|
49
|
+
* Sets the chart's height in pixels. Set to `"auto"` to use the height of the container.
|
|
50
|
+
*/
|
|
51
|
+
height: {
|
|
52
|
+
type: [Number, String],
|
|
53
|
+
required: false,
|
|
54
|
+
default: null
|
|
46
55
|
}
|
|
47
56
|
},
|
|
48
57
|
data() {
|
|
@@ -106,6 +115,9 @@ var script = {
|
|
|
106
115
|
// All chart options can be merged but series
|
|
107
116
|
// needs to be handled specially
|
|
108
117
|
return mergeSeriesToOptions(mergedOptions, this.series);
|
|
118
|
+
},
|
|
119
|
+
autoHeight() {
|
|
120
|
+
return this.height === 'auto';
|
|
109
121
|
}
|
|
110
122
|
},
|
|
111
123
|
methods: {
|
|
@@ -146,14 +158,17 @@ var script = {
|
|
|
146
158
|
};
|
|
147
159
|
}
|
|
148
160
|
}
|
|
149
|
-
}
|
|
161
|
+
},
|
|
162
|
+
HEIGHT_AUTO_CLASSES
|
|
150
163
|
};
|
|
151
164
|
|
|
152
165
|
/* script */
|
|
153
166
|
const __vue_script__ = script;
|
|
154
167
|
|
|
155
168
|
/* template */
|
|
156
|
-
var __vue_render__ = function () {
|
|
169
|
+
var __vue_render__ = function () {
|
|
170
|
+
var _obj;
|
|
171
|
+
var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"position-relative",class:( _obj = {}, _obj[_vm.$options.HEIGHT_AUTO_CLASSES] = _vm.autoHeight, _obj )},[_c('chart',_vm._g(_vm._b({class:{ 'gl-flex-grow-1': _vm.autoHeight },attrs:{"height":_vm.height,"options":_vm.options},on:{"created":_vm.onCreated}},'chart',_vm.$attrs,false),_vm.$listeners)),_vm._v(" "),(_vm.chart)?_c('chart-tooltip',{attrs:{"show":_vm.showTooltip,"chart":_vm.chart,"top":_vm.tooltipPosition.top,"left":_vm.tooltipPosition.left},scopedSlots:_vm._u([{key:"title",fn:function(){return [_vm._t("tooltip-title",function(){return [_vm._v(_vm._s(_vm.tooltipTitle)+" ("+_vm._s(_vm.xAxisTitle)+")")]})]},proxy:true}],null,true)},[_vm._v(" "),_vm._t("tooltip-content",function(){return [_c('tooltip-default-format',{attrs:{"tooltip-content":_vm.tooltipContent}})]})],2):_vm._e()],1)};
|
|
157
172
|
var __vue_staticRenderFns__ = [];
|
|
158
173
|
|
|
159
174
|
/* style */
|
|
@@ -172,7 +172,7 @@ var script = {
|
|
|
172
172
|
const __vue_script__ = script;
|
|
173
173
|
|
|
174
174
|
/* template */
|
|
175
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('
|
|
175
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('chart',_vm._g(_vm._b({attrs:{"options":_vm.options},on:{"created":_vm.onCreated}},'chart',_vm.$attrs,false),_vm.$listeners))};
|
|
176
176
|
var __vue_staticRenderFns__ = [];
|
|
177
177
|
|
|
178
178
|
/* style */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import merge from 'lodash/merge';
|
|
2
2
|
import { getDefaultTooltipContent } from '../../../utils/charts/config';
|
|
3
|
-
import { TOOLTIP_LEFT_OFFSET } from '../../../utils/charts/constants';
|
|
3
|
+
import { TOOLTIP_LEFT_OFFSET, HEIGHT_AUTO_CLASSES } from '../../../utils/charts/constants';
|
|
4
4
|
import { heatmapHues } from '../../../utils/charts/theme';
|
|
5
5
|
import { engineeringNotation } from '../../../utils/number_utils';
|
|
6
6
|
import { debounceByAnimationFrame } from '../../../utils/utils';
|
|
@@ -98,6 +98,14 @@ var script = {
|
|
|
98
98
|
type: Boolean,
|
|
99
99
|
required: false,
|
|
100
100
|
default: true
|
|
101
|
+
},
|
|
102
|
+
/**
|
|
103
|
+
* Sets the chart's height in pixels. Set to `"auto"` to use the height of the container.
|
|
104
|
+
*/
|
|
105
|
+
height: {
|
|
106
|
+
type: [Number, String],
|
|
107
|
+
required: false,
|
|
108
|
+
default: null
|
|
101
109
|
}
|
|
102
110
|
},
|
|
103
111
|
data() {
|
|
@@ -212,6 +220,9 @@ var script = {
|
|
|
212
220
|
type: 'solid'
|
|
213
221
|
};
|
|
214
222
|
});
|
|
223
|
+
},
|
|
224
|
+
autoHeight() {
|
|
225
|
+
return this.height === 'auto';
|
|
215
226
|
}
|
|
216
227
|
},
|
|
217
228
|
beforeDestroy() {
|
|
@@ -256,14 +267,17 @@ var script = {
|
|
|
256
267
|
};
|
|
257
268
|
}
|
|
258
269
|
}
|
|
259
|
-
}
|
|
270
|
+
},
|
|
271
|
+
HEIGHT_AUTO_CLASSES
|
|
260
272
|
};
|
|
261
273
|
|
|
262
274
|
/* script */
|
|
263
275
|
const __vue_script__ = script;
|
|
264
276
|
|
|
265
277
|
/* template */
|
|
266
|
-
var __vue_render__ = function () {
|
|
278
|
+
var __vue_render__ = function () {
|
|
279
|
+
var _obj;
|
|
280
|
+
var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"gl-heatmap",class:( _obj = {}, _obj[_vm.$options.HEIGHT_AUTO_CLASSES] = _vm.autoHeight, _obj )},[_c('chart',_vm._g(_vm._b({class:{ 'gl-flex-grow-1': _vm.autoHeight },attrs:{"height":_vm.height,"options":_vm.computedOptions},on:{"created":_vm.onCreated}},'chart',_vm.$attrs,false),_vm.$listeners)),_vm._v(" "),(_vm.chart)?_c('chart-tooltip',{attrs:{"show":_vm.tooltip.show,"chart":_vm.chart,"top":_vm.tooltip.top,"left":_vm.tooltip.left},scopedSlots:_vm._u([{key:"title",fn:function(){return [(_vm.formatTooltipText)?_vm._t("tooltip-title"):_c('div',[_vm._v("\n "+_vm._s(_vm.tooltip.title)+"\n "),(_vm.computedOptions.xAxis.name)?[_vm._v("("+_vm._s(_vm.computedOptions.xAxis.name)+")")]:_vm._e()],2)]},proxy:true}],null,true)},[_vm._v(" "),(_vm.formatTooltipText)?_vm._t("tooltip-content"):_c('tooltip-default-format',{attrs:{"tooltip-content":_vm.tooltip.content}})],2):_vm._e(),_vm._v(" "),(_vm.compiledOptions)?_c('chart-legend',{style:(_vm.legendStyle),attrs:{"chart":_vm.chart,"series-info":_vm.seriesInfo,"text-style":_vm.compiledOptions.textStyle,"max-text":_vm.legendMaxText,"average-text":_vm.legendAverageText}}):_vm._e()],1)};
|
|
267
281
|
var __vue_staticRenderFns__ = [];
|
|
268
282
|
|
|
269
283
|
/* style */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import merge from 'lodash/merge';
|
|
2
2
|
import { symbolSize, lineStyle, getThresholdConfig, generateAnnotationSeries, defaultChartOptions, dataZoomAdjustments, mergeSeriesToOptions, mergeAnnotationAxisToOptions, grid, getDefaultTooltipContent } from '../../../utils/charts/config';
|
|
3
|
-
import { LEGEND_AVERAGE_TEXT, LEGEND_MAX_TEXT, LEGEND_MIN_TEXT, LEGEND_CURRENT_TEXT, LEGEND_LAYOUT_INLINE, LEGEND_LAYOUT_TABLE, DATA_TOOLTIP_LEFT_OFFSET, ANNOTATION_TOOLTIP_TOP_OFFSET } from '../../../utils/charts/constants';
|
|
3
|
+
import { LEGEND_AVERAGE_TEXT, LEGEND_MAX_TEXT, LEGEND_MIN_TEXT, LEGEND_CURRENT_TEXT, LEGEND_LAYOUT_INLINE, LEGEND_LAYOUT_TABLE, DATA_TOOLTIP_LEFT_OFFSET, ANNOTATION_TOOLTIP_TOP_OFFSET, HEIGHT_AUTO_CLASSES } from '../../../utils/charts/constants';
|
|
4
4
|
import { colorFromDefaultPalette } from '../../../utils/charts/theme';
|
|
5
5
|
import { seriesHasAnnotations, isDataPointAnnotation } from '../../../utils/charts/utils';
|
|
6
6
|
import { debounceByAnimationFrame } from '../../../utils/utils';
|
|
@@ -83,6 +83,14 @@ var script = {
|
|
|
83
83
|
type: Boolean,
|
|
84
84
|
required: false,
|
|
85
85
|
default: true
|
|
86
|
+
},
|
|
87
|
+
/**
|
|
88
|
+
* Sets the chart's height in pixels. Set to `"auto"` to use the height of the container.
|
|
89
|
+
*/
|
|
90
|
+
height: {
|
|
91
|
+
type: [Number, String],
|
|
92
|
+
required: false,
|
|
93
|
+
default: null
|
|
86
94
|
}
|
|
87
95
|
},
|
|
88
96
|
data() {
|
|
@@ -200,6 +208,9 @@ var script = {
|
|
|
200
208
|
}
|
|
201
209
|
return acc;
|
|
202
210
|
}, []);
|
|
211
|
+
},
|
|
212
|
+
autoHeight() {
|
|
213
|
+
return this.height === 'auto';
|
|
203
214
|
}
|
|
204
215
|
},
|
|
205
216
|
beforeDestroy() {
|
|
@@ -285,14 +296,17 @@ var script = {
|
|
|
285
296
|
onLabelChange(params) {
|
|
286
297
|
this.selectedFormatTooltipText(params);
|
|
287
298
|
}
|
|
288
|
-
}
|
|
299
|
+
},
|
|
300
|
+
HEIGHT_AUTO_CLASSES
|
|
289
301
|
};
|
|
290
302
|
|
|
291
303
|
/* script */
|
|
292
304
|
const __vue_script__ = script;
|
|
293
305
|
|
|
294
306
|
/* template */
|
|
295
|
-
var __vue_render__ = function () {
|
|
307
|
+
var __vue_render__ = function () {
|
|
308
|
+
var _obj;
|
|
309
|
+
var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"position-relative",class:( _obj = {}, _obj[_vm.$options.HEIGHT_AUTO_CLASSES] = _vm.autoHeight, _obj )},[_c('chart',_vm._g(_vm._b({class:{ 'gl-flex-grow-1': _vm.autoHeight },attrs:{"height":_vm.height,"options":_vm.options},on:{"created":_vm.onCreated}},'chart',_vm.$attrs,false),_vm.$listeners)),_vm._v(" "),(_vm.shouldShowAnnotationsTooltip)?_c('chart-tooltip',{ref:"annotationsTooltip",attrs:{"id":"annotationsTooltip","show":_vm.showAnnotationsTooltip,"chart":_vm.chart,"top":_vm.annotationsTooltipPosition.top,"left":_vm.annotationsTooltipPosition.left,"placement":"bottom"},scopedSlots:_vm._u([{key:"title",fn:function(){return [_c('div',[_vm._v(_vm._s(_vm.annotationsTooltipTitle))])]},proxy:true}],null,false,1889294429)},[_vm._v(" "),_c('div',[_vm._v(_vm._s(_vm.annotationsTooltipContent))])]):_vm._e(),_vm._v(" "),(_vm.chart)?_c('chart-tooltip',{ref:"dataTooltip",staticClass:"gl-pointer-events-none",attrs:{"id":"dataTooltip","show":_vm.showDataTooltip,"chart":_vm.chart,"top":_vm.dataTooltipPosition.top,"left":_vm.dataTooltipPosition.left},scopedSlots:_vm._u([{key:"title",fn:function(){return [(_vm.formatTooltipText)?_vm._t("tooltip-title"):_c('div',[_vm._v("\n "+_vm._s(_vm.dataTooltipTitle)+"\n "),(_vm.options.xAxis.name)?[_vm._v("("+_vm._s(_vm.options.xAxis.name)+")")]:_vm._e()],2)]},proxy:true}],null,true)},[_vm._v(" "),(_vm.formatTooltipText)?_vm._t("tooltip-content"):_c('tooltip-default-format',{attrs:{"tooltip-content":_vm.dataTooltipContent}})],2):_vm._e(),_vm._v(" "),(_vm.hasLegend)?_c('chart-legend',{style:(_vm.legendStyle),attrs:{"chart":_vm.chart,"series-info":_vm.seriesInfo,"text-style":_vm.compiledOptions.textStyle,"min-text":_vm.legendMinText,"max-text":_vm.legendMaxText,"average-text":_vm.legendAverageText,"current-text":_vm.legendCurrentText,"layout":_vm.legendLayout}}):_vm._e()],1)};
|
|
296
310
|
var __vue_staticRenderFns__ = [];
|
|
297
311
|
|
|
298
312
|
/* style */
|
|
@@ -2,6 +2,7 @@ import merge from 'lodash/merge';
|
|
|
2
2
|
import { graphic } from 'echarts';
|
|
3
3
|
import { GlResizeObserverDirective } from '../../../directives/resize_observer/resize_observer';
|
|
4
4
|
import { defaultChartOptions, mergeSeriesToOptions, symbolSize } from '../../../utils/charts/config';
|
|
5
|
+
import { HEIGHT_AUTO_HORIZONTAL_LAYOUT_CLASSES } from '../../../utils/charts/constants';
|
|
5
6
|
import Chart from '../chart/chart';
|
|
6
7
|
import ChartTooltip from '../tooltip/tooltip';
|
|
7
8
|
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
@@ -44,10 +45,10 @@ var script = {
|
|
|
44
45
|
default: ''
|
|
45
46
|
},
|
|
46
47
|
/**
|
|
47
|
-
* Sets the chart's height in
|
|
48
|
+
* Sets the chart's height in pixels. Set to `"auto"` to use the height of the container.
|
|
48
49
|
*/
|
|
49
50
|
height: {
|
|
50
|
-
type: Number,
|
|
51
|
+
type: [Number, String],
|
|
51
52
|
required: false,
|
|
52
53
|
default: 50
|
|
53
54
|
},
|
|
@@ -167,6 +168,9 @@ var script = {
|
|
|
167
168
|
lastYValue() {
|
|
168
169
|
const latestEntry = this.data.slice(-1)[0];
|
|
169
170
|
return latestEntry[1];
|
|
171
|
+
},
|
|
172
|
+
autoHeight() {
|
|
173
|
+
return this.height === 'auto';
|
|
170
174
|
}
|
|
171
175
|
},
|
|
172
176
|
methods: {
|
|
@@ -218,14 +222,17 @@ var script = {
|
|
|
218
222
|
this.setTooltipPosition(data);
|
|
219
223
|
}
|
|
220
224
|
}
|
|
221
|
-
}
|
|
225
|
+
},
|
|
226
|
+
HEIGHT_AUTO_HORIZONTAL_LAYOUT_CLASSES
|
|
222
227
|
};
|
|
223
228
|
|
|
224
229
|
/* script */
|
|
225
230
|
const __vue_script__ = script;
|
|
226
231
|
|
|
227
232
|
/* template */
|
|
228
|
-
var __vue_render__ = function () {
|
|
233
|
+
var __vue_render__ = function () {
|
|
234
|
+
var _obj;
|
|
235
|
+
var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{directives:[{name:"resize-observer",rawName:"v-resize-observer",value:(_vm.handleResize),expression:"handleResize"}],staticClass:"gl-display-flex gl-align-items-center",class:{ 'gl-h-full': _vm.autoHeight },on:{"mouseleave":_vm.hideTooltip}},[_vm._t("default"),_vm._v(" "),_c('div',{staticClass:"gl-flex-grow-1 gl-relative",class:( _obj = {}, _obj[_vm.$options.HEIGHT_AUTO_HORIZONTAL_LAYOUT_CLASSES] = _vm.autoHeight, _obj ),attrs:{"data-testid":"chart-container"}},[_c('chart',_vm._g(_vm._b({class:{ 'gl-flex-grow-1': _vm.autoHeight },attrs:{"height":_vm.height,"options":_vm.options},on:{"created":_vm.onChartCreated}},'chart',_vm.$attrs,false),_vm.$listeners)),_vm._v(" "),(_vm.chartInstance)?_c('chart-tooltip',{style:({ pointerEvents: 'none' }),attrs:{"show":_vm.tooltip.show,"chart":_vm.chartInstance,"top":_vm.tooltip.position.top,"left":_vm.tooltip.position.left,"placement":"top"},scopedSlots:_vm._u([{key:"title",fn:function(){return [_c('div',{staticClass:"gl-white-space-nowrap",attrs:{"data-testid":"tooltip-title"}},[_vm._v("\n "+_vm._s(_vm.tooltip.title)+"\n ")])]},proxy:true},{key:"default",fn:function(){return [_c('div',{staticClass:"gl-display-flex",attrs:{"data-testid":"tooltip-content"}},[(_vm.tooltipLabel)?_c('span',{staticClass:"gl-pr-6 gl-mr-auto"},[_vm._v(_vm._s(_vm.tooltipLabel))]):_vm._e(),_vm._v(" "),_c('strong',[_vm._v(_vm._s(_vm.tooltip.content))])])]},proxy:true}],null,false,2830367259)}):_vm._e()],1),_vm._v(" "),(_vm.showLastYValue)?_c('span',{staticClass:"gl-display-inline-flex gl-justify-content-center gl-ml-5",attrs:{"data-testid":"last-y-value"}},[_vm._v("\n "+_vm._s(_vm.lastYValue)+"\n ")]):_vm._e()],2)};
|
|
229
236
|
var __vue_staticRenderFns__ = [];
|
|
230
237
|
|
|
231
238
|
/* style */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import merge from 'lodash/merge';
|
|
2
2
|
import { yAxis, generateBarSeries, generateLineSeries, defaultChartOptions, gridWithSecondaryYAxis, grid, dataZoomAdjustments, mergeSeriesToOptions } from '../../../utils/charts/config';
|
|
3
|
-
import { LEGEND_AVERAGE_TEXT, LEGEND_MAX_TEXT, LEGEND_MIN_TEXT, LEGEND_CURRENT_TEXT, LEGEND_LAYOUT_INLINE, LEGEND_LAYOUT_TABLE, CHART_TYPE_LINE, ANNOTATION_TOOLTIP_TOP_OFFSET } from '../../../utils/charts/constants';
|
|
3
|
+
import { LEGEND_AVERAGE_TEXT, LEGEND_MAX_TEXT, LEGEND_MIN_TEXT, LEGEND_CURRENT_TEXT, LEGEND_LAYOUT_INLINE, LEGEND_LAYOUT_TABLE, CHART_TYPE_LINE, ANNOTATION_TOOLTIP_TOP_OFFSET, HEIGHT_AUTO_CLASSES } from '../../../utils/charts/constants';
|
|
4
4
|
import { colorFromDefaultPalette } from '../../../utils/charts/theme';
|
|
5
5
|
import { columnOptions } from '../../../utils/constants';
|
|
6
6
|
import { debounceByAnimationFrame } from '../../../utils/utils';
|
|
@@ -116,6 +116,14 @@ var script = {
|
|
|
116
116
|
type: Array,
|
|
117
117
|
required: false,
|
|
118
118
|
default: null
|
|
119
|
+
},
|
|
120
|
+
/**
|
|
121
|
+
* Sets the chart's height in pixels. Set to `"auto"` to use the height of the container.
|
|
122
|
+
*/
|
|
123
|
+
height: {
|
|
124
|
+
type: [Number, String],
|
|
125
|
+
required: false,
|
|
126
|
+
default: null
|
|
119
127
|
}
|
|
120
128
|
},
|
|
121
129
|
data() {
|
|
@@ -251,6 +259,9 @@ var script = {
|
|
|
251
259
|
});
|
|
252
260
|
return acc;
|
|
253
261
|
}, []);
|
|
262
|
+
},
|
|
263
|
+
autoHeight() {
|
|
264
|
+
return this.height === 'auto';
|
|
254
265
|
}
|
|
255
266
|
},
|
|
256
267
|
beforeDestroy() {
|
|
@@ -298,14 +309,17 @@ var script = {
|
|
|
298
309
|
this.defaultFormatTooltipText(params);
|
|
299
310
|
}
|
|
300
311
|
}
|
|
301
|
-
}
|
|
312
|
+
},
|
|
313
|
+
HEIGHT_AUTO_CLASSES
|
|
302
314
|
};
|
|
303
315
|
|
|
304
316
|
/* script */
|
|
305
317
|
const __vue_script__ = script;
|
|
306
318
|
|
|
307
319
|
/* template */
|
|
308
|
-
var __vue_render__ = function () {
|
|
320
|
+
var __vue_render__ = function () {
|
|
321
|
+
var _obj;
|
|
322
|
+
var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"position-relative",class:( _obj = {}, _obj[_vm.$options.HEIGHT_AUTO_CLASSES] = _vm.autoHeight, _obj )},[_c('chart',_vm._g(_vm._b({class:{ 'gl-flex-grow-1': _vm.autoHeight },attrs:{"height":_vm.height,"options":_vm.options},on:{"created":_vm.onCreated}},'chart',_vm.$attrs,false),_vm.$listeners)),_vm._v(" "),(_vm.chart)?_c('chart-tooltip',{attrs:{"show":_vm.showTooltip,"chart":_vm.chart,"top":_vm.tooltipPosition.top,"left":_vm.tooltipPosition.left},scopedSlots:_vm._u([{key:"title",fn:function(){return [_vm._t("tooltip-title",function(){return [_vm._v(_vm._s(_vm.tooltipTitle)+" ("+_vm._s(_vm.xAxisTitle)+")")]})]},proxy:true}],null,true)},[_vm._v(" "),_vm._t("tooltip-content",function(){return [_c('tooltip-default-format',{attrs:{"tooltip-content":_vm.tooltipContent}})]})],2):_vm._e(),_vm._v(" "),(_vm.compiledOptions)?_c('chart-legend',{style:(_vm.legendStyle),attrs:{"chart":_vm.chart,"series-info":_vm.seriesInfo,"text-style":_vm.compiledOptions.textStyle,"min-text":_vm.legendMinText,"max-text":_vm.legendMaxText,"average-text":_vm.legendAverageText,"current-text":_vm.legendCurrentText,"layout":_vm.legendLayout}}):_vm._e()],1)};
|
|
309
323
|
var __vue_staticRenderFns__ = [];
|
|
310
324
|
|
|
311
325
|
/* style */
|