IndexVector class
IndexVector is a simple vector implementation that returns the index value for each element in the vector. It is functionally equivolant a vector backed by an array with values: [0,1,2,...,length-1]
Signature
export declare class IndexVector extends FunctionalVector<number>
Import
import { IndexVector } from '@grafana/data';
Constructors
Constructor | Modifiers | Description |
---|---|---|
constructor(len) | Constructs a new instance of the IndexVector class |
Properties
Property | Modifiers | Type | Description |
---|---|---|---|
length | number |
Methods
Method | Modifiers | Description |
---|---|---|
get(index) | ||
newField(len) | static |
Returns a field representing the range [0 … length-1] |
constructor(len)
Constructs a new instance of the IndexVector
class
Signature
constructor(len: number);
Parameters
Parameter | Type | Description |
---|---|---|
len | number |
length property
Signature
get length(): number;
get method
Signature
get(index: number): number;
Parameters
Parameter | Type | Description |
---|---|---|
index | number |
Returns:
number
newField method
Returns a field representing the range [0 … length-1]
Signature
static newField(len: number): Field<number>;
Parameters
Parameter | Type | Description |
---|---|---|
len | number |
Returns:
Field<number>
Related Grafana resources
Getting started with Grafana 8
Grafana 8.0 is here! Join us for a live walkthrough on how to get started using Grafana 8 and the Grafana 8 user interface while showing how to set up monitoring for a web service that uses Prometheus and Loki to store metrics and logs.
Unify your data with Grafana plugins: Splunk, MongoDB, Datadog, and more
Show how Grafana can be used to take data from multiple different sources and unify it, without disrupting the investments that are working today.
Getting started with Grafana Enterprise and observability
Join the Grafana Labs team for a 30-minute demo of how to get started with the Grafana Stack, so you can go from zero to observability in just a few minutes.