@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 vote down vote up
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 vote down vote up
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 vote down vote up
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 vote down vote up
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 vote down vote up
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 vote down vote up
thresholdsOverrideProcessor = (
  value: any,
  context: FieldOverrideContext,
  settings: ThresholdsFieldConfigSettings
) => {
  return value as ThresholdsConfig; // !!!! likely not !!!!
}