@grafana/data#FieldOverrideContext TypeScript Examples
The following examples show how to use
@grafana/data#FieldOverrideContext.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: number.tsx From grafana-chinese with Apache License 2.0 | 6 votes |
numberOverrideProcessor = (
value: any,
context: FieldOverrideContext,
settings: NumberFieldConfigSettings
) => {
const v = parseFloat(`${value}`);
if (settings.max && v > settings.max) {
// ????
}
return v;
}
Example #2
Source File: string.tsx From grafana-chinese with Apache License 2.0 | 6 votes |
stringOverrideProcessor = (
value: any,
context: FieldOverrideContext,
settings: StringFieldConfigSettings
) => {
if (settings.expandTemplateVars && context.replaceVariables) {
return context.replaceVariables(value, context.field!.config.scopedVars);
}
return `${value}`;
}
Example #3
Source File: links.tsx From grafana-chinese with Apache License 2.0 | 5 votes |
dataLinksOverrideProcessor = (
value: any,
context: FieldOverrideContext,
_settings: DataLinksFieldConfigSettings
) => {
return value as DataLink[];
}
Example #4
Source File: mappings.tsx From grafana-chinese with Apache License 2.0 | 5 votes |
valueMappingsOverrideProcessor = (
value: any,
context: FieldOverrideContext,
settings: ValueMappingFieldConfigSettings
) => {
return value as ValueMapping[]; // !!!! likely not !!!!
}
Example #5
Source File: select.tsx From grafana-chinese with Apache License 2.0 | 5 votes |
selectOverrideProcessor = (
value: any,
context: FieldOverrideContext,
settings: SelectFieldConfigSettings<any>
) => {
return value;
}
Example #6
Source File: thresholds.tsx From grafana-chinese with Apache License 2.0 | 5 votes |
thresholdsOverrideProcessor = (
value: any,
context: FieldOverrideContext,
settings: ThresholdsFieldConfigSettings
) => {
return value as ThresholdsConfig; // !!!! likely not !!!!
}