AppendedVectors class

This may be more trouble than it is worth. This trades some computation time for RAM – rather than allocate a new array the size of all previous arrays, this just points the correct index to their original array values

Signature

  1. export declare class AppendedVectors<T = any> implements Vector<T>

Import

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

Constructors

ConstructorModifiersDescription
constructor(startAt)Constructs a new instance of the AppendedVectors class

Properties

PropertyModifiersTypeDescription
lengthnumber
sourceArray<AppendedVectorInfo<T>>

Methods

MethodModifiersDescription
append(v)
get(index)
setLength(length)Make the vector look like it is this long
toArray()
toJSON()

constructor(startAt)

Constructs a new instance of the AppendedVectors class

Signature

  1. constructor(startAt?: number);

Parameters

ParameterTypeDescription
startAtnumber

length property

Signature

  1. length: number;

source property

Signature

  1. source: Array<AppendedVectorInfo<T>>;

append method

Signature

  1. append(v: Vector<T>): AppendedVectorInfo<T>;

Parameters

ParameterTypeDescription
vVector<T>

Returns:

AppendedVectorInfo<T>

get method

Signature

  1. get(index: number): T;

Parameters

ParameterTypeDescription
indexnumber

Returns:

T

setLength method

Make the vector look like it is this long

Signature

  1. setLength(length: number): void;

Parameters

ParameterTypeDescription
lengthnumber

Returns:

void

toArray method

Signature

  1. toArray(): T[];

Returns:

T[]

toJSON method

Signature

  1. toJSON(): T[];

Returns:

T[]