DataLinks: allow using values from other fields in the same row (#21478)

This commit is contained in:
Ryan McKinley
2020-01-15 12:02:52 -08:00
committed by GitHub
parent 3f957a3735
commit 76ba2db4e7
7 changed files with 351 additions and 9 deletions
@@ -11,6 +11,7 @@ import {
ThresholdsMode,
FieldColorMode,
ColorScheme,
TimeZone,
} from '../types';
import { fieldMatchers, ReducerID, reduceField } from '../transformations';
import { FieldMatcher } from '../types/transformations';
@@ -34,6 +35,7 @@ export interface ApplyFieldOverrideOptions {
fieldOptions: FieldConfigSource;
replaceVariables: InterpolateFunction;
theme: GrafanaTheme;
timeZone?: TimeZone;
autoMinMax?: boolean;
}
@@ -164,7 +166,11 @@ export function applyFieldOverrides(options: ApplyFieldOverrideOptions): DataFra
type,
};
// and set the display processor using it
f.display = getDisplayProcessor({ field: f, theme: options.theme });
f.display = getDisplayProcessor({
field: f,
theme: options.theme,
timeZone: options.timeZone,
});
return f;
});
@@ -11,6 +11,7 @@ import { stylesFactory } from '../../themes';
export enum VariableOrigin {
Series = 'series',
Field = 'field',
Fields = 'fields',
Value = 'value',
BuiltIn = 'built-in',
Template = 'template',