Files
grafana/docs/sources/packages_api/data/dataframeview.md
Marcus Andersson 6bc369629d Docs: adding first version of the auto-generated packages API docs. (#22107)
* trying out api-extractor.

* works with our setup of build.

* wip.

* changed the packages so it works better with the api-extractor.

* Changes to make the api-extractor to work.

* cleaned up the api-extractor config files.

* added some more documentation.

* added tsdoc-metadata to gitignore.

* removed the generated docs (will do that in another PR).

* added execute permission to script for generating dosc.

* added so we will push generated docs to branch.

* will clean packages_api on abort.

* Fixed failing tests.

* fixed formatting issue with typedoc comment.

* temporarily disabled tslint rules about namespace until https://github.com/microsoft/rushstack/issues/1029 is resolved

* temporary enabled bable namespaces.

* updated build script.

* updated script.

* updated script with some colors.

* changed to camelCase.

* removed spacing.

* Starting to add documentation guidelines.

* added examples headline.

* added menu options.

* added parameters and return values.

* Fixed merge error.

* Added first version of auto-generated docs.

* changed so we use the eslint ignore syntax.

* changed to correct eslint ingnore comment.

* fixed some spelling errors reported by codespell.

* added script to generate docs in current folder.

* updated api docs.

* lerna bootstrap.

* added eror to the ingore words list.

* removed file that should be ignored.

* updated locKFILE.

* referenced the code comments guidelines.

* updated packages.

* updated deps.

* updated the autogenerated dosc.

* adding missing new line.
2020-02-26 10:03:53 +01:00

6.0 KiB

+++

-----------------------------------------------------------------------

Do not edit this file. It is automatically generated by API Documenter.

-----------------------------------------------------------------------

title = "DataFrameView" keywords = ["grafana","documentation","sdk","@grafana/data"] type = "docs" draft = true +++

DataFrameView class

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

This abstraction will present the contents of a DataFrame as if it were a well typed javascript object Vector.

Signature

export declare class DataFrameView<T = any> implements Vector<T> 

Import

import { DataFrameView } from '@grafana/data';

Remarks

The DataFrameView.get() is optimized for use in a loop and will return same object. See function for more details.

Constructors

Constructor Modifiers Description
constructor(data) (BETA) Constructs a new instance of the DataFrameView class

Properties

Property Modifiers Type Description
dataFrame DataFrame (BETA)
length number (BETA)

Methods

Method Modifiers Description
forEachRow(iterator) (BETA)
get(idx) (BETA) The contents of the object returned from this function are optimized for use in a loop. All calls return the same object but the index has changed.
getFieldDisplayProcessor(colIndex) (BETA) Helper function to return the DisplayProcessor for a given field column.
map(iterator) (BETA)
toArray() (BETA)
toJSON() (BETA)

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

constructor(data)

Constructs a new instance of the DataFrameView class

Signature

constructor(data: DataFrame);

Parameters

Parameter Type Description
data DataFrame

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

dataFrame property

Signature

get dataFrame(): DataFrame;

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

length property

Signature

get length(): number;

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

forEachRow method

Signature

forEachRow(iterator: (row: T) => void): void;

Parameters

Parameter Type Description
iterator (row: T) => void

Returns:

void

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

get method

The contents of the object returned from this function are optimized for use in a loop. All calls return the same object but the index has changed.

Signature

get(idx: number): T;

Parameters

Parameter Type Description
idx number The index of the object you currently are inspecting

Returns:

T

Example

  // `first`, `second` and `third` will all point to the same contents at index 2:
  const first = view.get(0);
  const second = view.get(1);
  const third = view.get(2);

  // If you need three different objects, consider something like:
  const first = { ...view.get(0) };
  const second = { ...view.get(1) };
  const third = { ...view.get(2) };

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

getFieldDisplayProcessor method

Helper function to return the DisplayProcessor for a given field column.

Signature

getFieldDisplayProcessor(colIndex: number): DisplayProcessor | null;

Parameters

Parameter Type Description
colIndex number the field column index for the data frame.

Returns:

DisplayProcessor | null

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

map method

Signature

map<V>(iterator: (item: T, index: number) => V): V[];

Parameters

Parameter Type Description
iterator (item: T, index: number) => V

Returns:

V[]

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

toArray method

Signature

toArray(): T[];

Returns:

T[]

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

toJSON method

Signature

toJSON(): T[];

Returns:

T[]