Home Identifier Source
import {Series} from '@esnet/pond/src/series.js'
public class | source

Series

Direct Subclass:

TimeSeries

Base class for a series of events.

A series is compact representation for a list of events, with some additional meta data on top of that.

Static Method Summary

Static Public Methods
public static

equal(series1: *, series2: *): *

public static

is(series1: *, series2: *): *

Constructor Summary

Public Constructor
public

constructor(arg1: *, arg2: *, arg3: *, arg4: *)

A Series is constructed by either:

Method Summary

Public Methods
public

at(i: *): number

Returns the number of rows in the series.

public

avg(column: *): *

public

Return the list of columns

public

Returns the number of rows in the series.

public

max(column: *): *

public

mean(column: *): *

public

medium(column: *): *

public

meta(key: *): *

Return the meta data associated with the Series.

public

min(column: *): *

public

Returns the same of the series

public

Returns the number of rows in the series.

public

stdev(column: *): *

public

sum(column: *): *

public

Returns a JSON representation, the same format as accepted by the

public

Return a string representation of the Series.

Static Public Methods

public static equal(series1: *, series2: *): * source

Params:

NameTypeAttributeDescription
series1 *
series2 *

Return:

*

public static is(series1: *, series2: *): * source

Params:

NameTypeAttributeDescription
series1 *
series2 *

Return:

*

Public Constructors

public constructor(arg1: *, arg2: *, arg3: *, arg4: *) source

A Series is constructed by either:

1) passing in another series (copy constructor) 2) passing in three arguments: name - the name of the series columns - an array containing the title of each data column data - an array containing the data of each column Note: data may be either: a) An Immutable.List of Immutable.Map data objects b) An array of objects

Internally a Series is List of Maps. Each item in the list is one data map, and is stored as an Immutable Map, where the keys are the column names and the value is the data for that column at that index.

This enables efficient extraction of Events, since the internal data of the Event can be simply a reference to the Immutable Map in this Series, combined with the time, Timerange or Index.

Params:

NameTypeAttributeDescription
arg1 *
arg2 *
arg3 *
arg4 *

Public Methods

public at(i: *): number source

Returns the number of rows in the series.

Params:

NameTypeAttributeDescription
i *

Return:

number

Size of the series

public avg(column: *): * source

Params:

NameTypeAttributeDescription
column *

Return:

*

public columns(): string[] source

Return the list of columns

Return:

string[]

The columns

public count(): number source

Returns the number of rows in the series. (Same as size())

Return:

number

Size of the series

public max(column: *): * source

Params:

NameTypeAttributeDescription
column *

Return:

*

public mean(column: *): * source

Params:

NameTypeAttributeDescription
column *

Return:

*

public medium(column: *): * source

Params:

NameTypeAttributeDescription
column *

Return:

*

public meta(key: *): * source

Return the meta data associated with the Series. To use, supply the key and the get back the value matching that key.

Params:

NameTypeAttributeDescription
key *

Return:

*

public min(column: *): * source

Params:

NameTypeAttributeDescription
column *

Return:

*

public name(): string source

Returns the same of the series

Return:

string

The name

public size(): number source

Returns the number of rows in the series.

Return:

number

Size of the series

public stdev(column: *): * source

Params:

NameTypeAttributeDescription
column *

Return:

*

public sum(column: *): * source

Params:

NameTypeAttributeDescription
column *

Return:

*

public toJSON(): Object source

Returns a JSON representation, the same format as accepted by the constructor.

Return:

Object

JSON representation

public toString(): string source

Return a string representation of the Series.

Return:

string

The Series, as a string.