Skip to content

Commit 1bc1516

Browse files
authored
removes left over code from the gauge-metric (#15142)
removes left over code from the gauge-metric
1 parent f6b0623 commit 1bc1516

File tree

6 files changed

+7
-284
lines changed

6 files changed

+7
-284
lines changed

src/core_plugins/kbn_vislib_vis_types/public/gauge.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export default function GaugeVisType(Private) {
6464
},
6565
editorConfig: {
6666
collections: {
67-
gaugeTypes: ['Arc', 'Circle', 'Metric'],
67+
gaugeTypes: ['Arc', 'Circle'],
6868
gaugeColorMode: ['None', 'Labels', 'Background'],
6969
scales: ['linear', 'log', 'square root'],
7070
colorSchemas: Object.keys(vislibColorMaps),

src/core_plugins/kbn_vislib_vis_types/public/goal.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export default function GoalVisType(Private) {
5959
},
6060
editorConfig: {
6161
collections: {
62-
gaugeTypes: ['Arc', 'Circle', 'Metric'],
62+
gaugeTypes: ['Arc', 'Circle'],
6363
gaugeColorMode: ['None', 'Labels', 'Background'],
6464
scales: ['linear', 'log', 'square root'],
6565
colorSchemas: Object.keys(vislibColorMaps),

src/ui/public/vislib/__tests__/visualizations/gauge_chart.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,4 @@ describe('Vislib Gauge Chart Test Suite', function () {
142142
'rgb(247, 251, 255)'
143143
]);
144144
});
145-
146-
it('label can split into multiple lines', function () {
147-
generateVis({
148-
gauge: { type: 'simple' }
149-
});
150-
expect($(chartEl).find('svg:nth-child(4) > g > text > tspan').length).to.be.above(0);
151-
});
152145
});

src/ui/public/vislib/visualizations/gauge_chart.js

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -53,27 +53,10 @@ export function GaugeChartProvider(Private) {
5353

5454
const gauges = self.gauge.drawGauge(g, series, width, height);
5555

56-
if (self.gaugeConfig.type === 'simple') {
57-
const bbox = svg.node().firstChild.getBBox();
58-
const finalWidth = bbox.width + containerMargin * 2;
59-
const finalHeight = bbox.height + containerMargin * 2;
60-
svg
61-
.attr('width', () => {
62-
return finalWidth;
63-
})
64-
.attr('height', () => {
65-
return finalHeight;
66-
});
67-
68-
const transformX = finalWidth / 2;
69-
const transformY = finalHeight / 2;
70-
g.attr('transform', `translate(${transformX}, ${transformY})`);
71-
} else {
72-
svg.attr('height', height);
73-
const transformX = width / 2;
74-
const transformY = self.gaugeConfig.gaugeType === 'Arc' ? height / (2 * 0.75) : height / 2;
75-
g.attr('transform', `translate(${transformX}, ${transformY})`);
76-
}
56+
svg.attr('height', height);
57+
const transformX = width / 2;
58+
const transformY = self.gaugeConfig.gaugeType === 'Arc' ? height / (2 * 0.75) : height / 2;
59+
g.attr('transform', `translate(${transformX}, ${transformY})`);
7760

7861
self.addEvents(gauges);
7962
});
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
import { MeterGaugeProvider } from './meter';
2-
import { SimpleGaugeProvider } from './simple';
32

43
export function GaugeTypesProvider(Private) {
54

65
return {
7-
meter: Private(MeterGaugeProvider),
8-
simple: Private(SimpleGaugeProvider),
6+
meter: Private(MeterGaugeProvider)
97
};
108
}

src/ui/public/vislib/visualizations/gauges/simple.js

Lines changed: 0 additions & 251 deletions
This file was deleted.

0 commit comments

Comments
 (0)