Important: This documentation is about an older version. It's relevant only to the release noted, many of the features and functions have been updated or replaced. Please view the current version.
FieldCache class
Signature
export declare class FieldCache
Import
import { FieldCache } from '@grafana/data';
Constructors
Properties
Methods
constructor(data)
Constructs a new instance of the FieldCache
class
Signature
constructor(data: DataFrame);
Parameters
fields property
Signature
fields: FieldWithIndex[];
getFieldByName method
Returns the first field with the given name.
Signature
getFieldByName(name: string): FieldWithIndex | undefined;
Parameters
Returns:
FieldWithIndex | undefined
getFields method
Signature
getFields(type?: FieldType): FieldWithIndex[];
Parameters
Returns:
FieldWithIndex[]
getFieldsByLabel method
Returns the fields with the given label.
Signature
getFieldsByLabel(label: string, value: string): FieldWithIndex[];
Parameters
Returns:
FieldWithIndex[]
getFirstFieldOfType method
Signature
getFirstFieldOfType(type: FieldType, includeHidden?: boolean): FieldWithIndex | undefined;
Parameters
Returns:
FieldWithIndex | undefined
hasFieldNamed method
Signature
hasFieldNamed(name: string): boolean;
Parameters
Returns:
boolean
hasFieldOfType method
Signature
hasFieldOfType(type: FieldType): boolean;
Parameters
Returns:
boolean
hasFieldWithNameAndType method
Signature
hasFieldWithNameAndType(name: string, type: FieldType): boolean;
Parameters
Returns:
boolean