Class: SeriesBuilder

SeriesBuilder

new SeriesBuilder()

Creates a new SeriesBuilder. A SeriesBuilder consists of a number of ColumnReaders that reads columns and give them a name. Ex: A series builder can be constructed to read column 3 as 'x' and column 7 and 8 as 'y1' and 'y2'. The output would then be points/rows of the form {x: 11, y1: 22, y2: 33}

The name of the builder is taken from the second column. In the above example it would be the column with index 7.

Methods

addColumnReader(columnIndex, configName)

Creates and adds ColumnReader from the given columnIndex and configName. ColumnIndex can be undefined and in that case the reader will be given an index when columns are populated.

Parameters:
Name Type Description
columnIndex Number | undefined
configName

getReferencedColumnIndexes()

Returns an array of column indexes that the builder will use when reading data.

Returns:

hasReader(configName)

Returns true if the builder has a reader for the given configName.

Parameters:
Name Type Description
configName
Returns:

populateColumns()

Populates readers with column indexes. A reader can be added without a specific index and for those readers the index is taken sequentially from the free columns (this is handled by the ColumnCursor instance).

Returns:

read(columns, rowIndex)

Reads a row from the dataset and returns a point or array depending on the names of the readers.

Parameters:
Name Type Description
columns
rowIndex
Returns: