Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Gauge] Vis editors gauge legacy percent mode. #126318

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
064e917
Added transparent background
Kuznietsov Feb 18, 2022
adb0404
Added gauge/goal visType.
Kuznietsov Feb 18, 2022
e21f21a
Merge branch 'main' into vis_editors_gauge-integration
Kuznietsov Feb 21, 2022
6a8c677
Fixed palette, scale and types.
Kuznietsov Feb 21, 2022
6f309f0
Merge branch 'main' into vis_editors_gauge-integration
kibanamachine Feb 21, 2022
7afcbc6
updated tests
Kuznietsov Feb 21, 2022
247689f
Cleaned up the code.
Kuznietsov Feb 21, 2022
29e9835
Updated limits.
Kuznietsov Feb 21, 2022
eae8f8a
Set legacy chart as default.
Kuznietsov Feb 21, 2022
e0200bc
Removed deprecation message.
Kuznietsov Feb 21, 2022
b370834
Added percent format params, comming from visdimensions.
Kuznietsov Feb 21, 2022
2b8bbe8
Merge branch 'main' into gauge-transparent-background
kibanamachine Feb 21, 2022
ff70db1
Updated snapshot.
Kuznietsov Feb 21, 2022
a2f442c
Merge branch 'gauge-transparent-background' of github.com:Kunzetsov/k…
Kuznietsov Feb 21, 2022
6b07be8
Merge branch 'gauge-transparent-background' into vis_editors_gauge-in…
Kuznietsov Feb 21, 2022
c2e8bab
Added support of labels/sublabels.
Kuznietsov Feb 21, 2022
48bbd6b
Merge branch 'main' into vis_editors_gauge-integration
kibanamachine Feb 21, 2022
10d9440
Merge branch 'main' into vis_editors_gauge-integration
kibanamachine Feb 22, 2022
573a5fe
fixed vistype toast test.
Kuznietsov Feb 22, 2022
3d96912
fixed i18n.
Kuznietsov Feb 22, 2022
d5d70b9
Updated i18n label.
Kuznietsov Feb 22, 2022
2e1717f
Merge branch 'main' into vis_editors_gauge-integration
kibanamachine Feb 22, 2022
9d5c1e4
Added support of showElasticChartsOptions
Kuznietsov Feb 22, 2022
d5d50b9
Added autoextend ranges elastic charts tooltip.
Kuznietsov Feb 22, 2022
2b28506
The outline elastic-charts message added.
Kuznietsov Feb 22, 2022
4b00e2c
outline renaming and metric/buckets limitations
Kuznietsov Feb 22, 2022
b601cbc
Merge branch 'main' into vis_editors_gauge-integration
kibanamachine Feb 23, 2022
08c2a54
Added legacy percentage mode to the gauge.
Kuznietsov Feb 24, 2022
127b03e
Merge branch 'main' into vis_editors_gauge-integration
kibanamachine Feb 24, 2022
b1f15c4
Merge branch 'main' into vis_editors_gauge-integration
kibanamachine Feb 28, 2022
ddb1a09
Moved chart to the percentage mode.
Kuznietsov Mar 1, 2022
e5c10d2
fixed test snapshots and rangeMax.
Kuznietsov Mar 2, 2022
6c48ded
Merge branch 'main' into vis_editors_gauge-integration
Kuznietsov Mar 2, 2022
f58e675
Merge branch 'vis_editors_gauge-integration' into vis_editors_gauge-l…
Kuznietsov Mar 2, 2022
c6b54e7
Fixed type.
Kuznietsov Mar 2, 2022
9eb731d
reverted mistaken change of sample_vis.test.mocks.
Kuznietsov Mar 2, 2022
9a94282
Warning message added to gauge split chart.
Kuznietsov Mar 3, 2022
4fd9c74
Added warning message to the splitChart button at goal/gauge.
Kuznietsov Mar 3, 2022
272427b
Fixed warning message
Kuznietsov Mar 3, 2022
55180a6
Merge branch 'main' into vis_editors_gauge-integration
kibanamachine Mar 3, 2022
325b2cb
Merge branch 'vis_editors_gauge-integration' into vis_editors_gauge-l…
Kuznietsov Mar 3, 2022
ee76ae8
Merge branch 'main' into vis_editors_gauge-legacy_percent_mode
Kuznietsov Mar 4, 2022
c59177a
Fixed bug with percentage mode coloring.
Kuznietsov Mar 4, 2022
5be4282
Merge branch 'main' into vis_editors_gauge-legacy_percent_mode
kibanamachine Mar 4, 2022
6114f75
Merge branch 'main' into vis_editors_gauge-legacy_percent_mode
kibanamachine Mar 7, 2022
a68edf2
Merge branch 'main' into vis_editors_gauge-legacy_percent_mode
kibanamachine Mar 8, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,14 @@ export const gaugeFunction = (): GaugeExpressionFunctionDefinition => ({
defaultMessage: 'Specifies the mode of centralMajor',
}),
},
// used only in legacy gauge, consider it as @deprecated
percentageMode: {
types: ['boolean'],
default: false,
help: i18n.translate('expressionGauge.functions.gauge.percentageMode.help', {
defaultMessage: 'Enables relative precentage mode',
}),
},
ariaLabel: {
types: ['string'],
help: i18n.translate('expressionGauge.functions.gaugeChart.config.ariaLabel.help', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ export interface GaugeState {
colorMode?: GaugeColorMode;
palette?: PaletteOutput<CustomPaletteParams>;
shape: GaugeShape;
/** @deprecated This field is deprecated and going to be removed in the futher release versions. */
percentageMode?: boolean;
}

export type GaugeArguments = GaugeState & {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

import type { ChartsPluginSetup } from '../../../../charts/public';
import type { ChartsPluginSetup, PaletteRegistry } from '../../../../charts/public';
import type { IFieldFormat, SerializedFieldFormat } from '../../../../field_formats/common';
import type { GaugeExpressionProps } from './expression_functions';

Expand All @@ -15,6 +15,7 @@ export type FormatFactory = (mapping?: SerializedFieldFormat) => IFieldFormat;
export type GaugeRenderProps = GaugeExpressionProps & {
formatFactory: FormatFactory;
chartsThemeService: ChartsPluginSetup['theme'];
paletteService: PaletteRegistry;
};

export interface ColorStop {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ jest.mock('@elastic/charts', () => {
});

const chartsThemeService = chartPluginMock.createSetupContract().theme;
const paletteThemeService = chartPluginMock.createSetupContract().palettes;
const formatService = fieldFormatsServiceMock.createStartContract();
const args: GaugeArguments = {
labelMajor: 'Gauge',
Expand Down Expand Up @@ -81,12 +82,13 @@ const createData = (
describe('GaugeComponent', function () {
let wrapperProps: GaugeRenderProps;

beforeAll(() => {
beforeAll(async () => {
wrapperProps = {
data: createData(),
chartsThemeService,
args,
formatFactory: formatService.deserialize,
paletteService: await paletteThemeService.getPalettes(),
};
});

Expand Down
Loading