FieldCache class

Signature

  1. export declare class FieldCache

Import

  1. import { FieldCache } from '@grafana/data';

Constructors

ConstructorModifiersDescription
constructor(data)Constructs a new instance of the FieldCache class

Properties

PropertyModifiersTypeDescription
fieldsFieldWithIndex[]

Methods

MethodModifiersDescription
getFieldByName(name)Returns the first field with the given name.
getFields(type)
getFieldsByLabel(label, value)Returns the fields with the given label.
getFirstFieldOfType(type, includeHidden)
hasFieldNamed(name)
hasFieldOfType(type)
hasFieldWithNameAndType(name, type)

constructor(data)

Constructs a new instance of the FieldCache class

Signature

  1. constructor(data: DataFrame);

Parameters

ParameterTypeDescription
dataDataFrame

fields property

Signature

  1. fields: FieldWithIndex[];

getFieldByName method

Returns the first field with the given name.

Signature

  1. getFieldByName(name: string): FieldWithIndex | undefined;

Parameters

ParameterTypeDescription
namestring

Returns:

FieldWithIndex | undefined

getFields method

Signature

  1. getFields(type?: FieldType): FieldWithIndex[];

Parameters

ParameterTypeDescription
typeFieldType

Returns:

FieldWithIndex[]

getFieldsByLabel method

Returns the fields with the given label.

Signature

  1. getFieldsByLabel(label: string, value: string): FieldWithIndex[];

Parameters

ParameterTypeDescription
labelstring
valuestring

Returns:

FieldWithIndex[]

getFirstFieldOfType method

Signature

  1. getFirstFieldOfType(type: FieldType, includeHidden?: boolean): FieldWithIndex | undefined;

Parameters

ParameterTypeDescription
typeFieldType
includeHiddenboolean

Returns:

FieldWithIndex | undefined

hasFieldNamed method

Signature

  1. hasFieldNamed(name: string): boolean;

Parameters

ParameterTypeDescription
namestring

Returns:

boolean

hasFieldOfType method

Signature

  1. hasFieldOfType(type: FieldType): boolean;

Parameters

ParameterTypeDescription
typeFieldType

Returns:

boolean

hasFieldWithNameAndType method

Signature

  1. hasFieldWithNameAndType(name: string, type: FieldType): boolean;

Parameters

ParameterTypeDescription
namestring
typeFieldType

Returns:

boolean