Constructor
new VDataFrame(buckets, series, signalFilteropt, columnExpandModeopt, signalQueueModeopt)
The constructor for the data frame. It is called via VDataReader.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
buckets |
Array.<VDataBucket> | the list of buckets | ||
series |
Map | the map of signal series | ||
signalFilter |
VDataSignalFilter |
<optional> |
null | the signal filter |
columnExpandMode |
string |
<optional> |
null | the column expand mode |
signalQueueMode |
string |
<optional> |
null | the signal queue mode |
Methods
cols(includeTimeopt) → {Array.<string>}
Get a list of column names. The order of the column names is same as order
of signal values in each row. To include the time column at first index set
the includeTime parameter to true.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
includeTime |
boolean |
<optional> |
false | whether to include time column at first index |
Returns:
array of column names
- Type
- Array.<string>
getColumnExpandMode() → {number}
Get the column expand mode for expanding complex type.
Returns:
- Type
- number
getColumnExpandMode() → {string}
Get the signal queue mode for value triage when there are multiple
values at the same time.
Returns:
- Type
- string
getEndTime() → {number}
Get the last time of signals in the frame. Note that this time may be
the evenly-split end time of the last bucket and slightly different
from the actual last signal time.
Returns:
millisecond since EPOCH
- Type
- number
getSignalFilter() → {VDataSignalFilter}
Get the signal filter.
Returns:
- Type
- VDataSignalFilter
getStartTime() → {number}
Get the earliest time of signals in the frame. Note that this time may be
the evenly-split start time of the first bucket and slightly different
from the actual first signal time.
Returns:
millisecond since EPOCH
- Type
- number
object1s() → {Array.<Object>}
Return a sorted 2-d array (row-columns) of all data objects at the sampled 1-Hz interval.
The first item of each row is time, followed by values.
Returns:
- Type
- Array.<Object>
objects(densifyRowsAheadopt, densifyOutputItvopt) → {Array.<Object>}
Get a sorted 2-d array (row-columns) of time and all data values. The values are
read all into memory and avoid sorting. It is CPU-efficient but consumes more memory.
Therefore, this method is suitable for reading data files smaller than 10MB.
The first item of each row is time, followed by values.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
densifyRowsAhead |
* |
<optional> |
0 | number of rows to look ahead to fill sparse data |
densifyOutputItv |
* |
<optional> |
0 | millis interval to down-sample data |
Returns:
- Type
- Array.<Object>
sampling(frequency) → {Array.<Object>}
Return a sorted 2-d array (row-columns) of all data objects sampled down to the specified
frequency in milliseconds. For example, 1-Hz equals a frequency of 1000 (ms).
The first item of each row is time, followed by values.
Parameters:
Name | Type | Description |
---|---|---|
frequency |
number | the sampled frequency with value greater than 1 |
Returns:
- Type
- Array.<Object>
series() → {Map}
Get a map of all selected signal series.
Returns:
map of series by their names
- Type
- Map
setColumnExpandMode(mode)
Set the column expand mode for expanding complex type.
Parameters:
Name | Type | Description |
---|---|---|
mode |
number | the expand mode |
setEndTime(time)
Set the end time of the frame.
Parameters:
Name | Type | Description |
---|---|---|
time |
number | millisecond since EPOCH |
setSignalFilter(signalFilter)
Set the signal filter.
Parameters:
Name | Type | Description |
---|---|---|
signalFilter |
VDataSignalFilter | the filter |
setSignalQueueMode(mode)
Set the signal queue mode for value triage when there are multiple
values at the same time.
Parameters:
Name | Type | Description |
---|---|---|
mode |
string | the queue mode |
setStartTime(time)
Set the start time of the frame.
Parameters:
Name | Type | Description |
---|---|---|
time |
number | millisecond since EPOCH |
values(densifyRowsAheadopt, densifyOutputItvopt, signalQueueRowsopt) → {Array.<Object>}
Get a sorted 2-d array (row-columns) of time and all data values. The values are
read via a iterator-like processing which is more memory-efficient but consumes
more CPU. Therefore, this method is suitable for reading data files larger than 10MB.
The first item of each row is time, followed by values.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
densifyRowsAhead |
* |
<optional> |
0 | number of rows to look ahead to fill sparse data |
densifyOutputItv |
* |
<optional> |
0 | millis interval to down-sample data |
signalQueueRows |
* |
<optional> |
0 | number of rows to hold in queue for sorting |
Returns:
- Type
- Array.<Object>