widgets/implementations/datapoints-table/datapoints-table-view/datapoints-table-view.service.ts
constructor(measurementService: MeasurementService)
|
||||||
Parameters :
|
adjustDate | ||||||||||||||||||||
adjustDate(date: string | Date, minutes: number, roundSeconds)
|
||||||||||||||||||||
Adjusts the given date by adding the specified number of minutes and setting seconds to 0. Example :
Parameters :
Returns :
string
The adjusted date in ISO string format. |
filterOutInactiveDatapoints | ||||||||
filterOutInactiveDatapoints(datapoints: KPIDetails[])
|
||||||||
Filters out inactive data points from the given array.
Parameters :
Returns :
KPIDetails[]
An array of data points that are active. |
findMinMaxValues | ||||||||
findMinMaxValues(valuesArray: MinMaxValues[])
|
||||||||
Finds the overall minimum and maximum values from an array of objects containing 'min' and 'max' properties. If the array contains only one object, that object's 'min' and 'max' values will be returned. Example :
const result = findMinMaxValues(values); // result is { min: 1, max: 10 }
Parameters :
Returns :
Value | null
An object with the smallest 'min' and largest 'max' values found in the array. |
generateDataPointMap | ||||||||||||
generateDataPointMap(dataList: DatapointTableItem[], columnsHeadersReferences: TableColumnHeader[])
|
||||||||||||
Generates and populates a map with data points. This function processes the provided data points and organizes them into a map structure where each key is a unique combination of date and device identifiers, and the value is an array of data points (or null values) associated with that key. This structured data is then used in the data point table to render the data appropriately.
Parameters :
Returns :
DataPointsTableMap
A map where the key is a datapoint identifier containing the date and device name, and the value is an array of data point table items or null. |
Async getAllActiveSeriesDataMap | ||||||||||||||||
getAllActiveSeriesDataMap(datapointsValuesDataMap: DatapointsValuesDataMap, config: DatapointsTableConfig, roundSeconds: boolean)
|
||||||||||||||||
Retrieves the active data points series data and returns it as a map. Example :
Parameters :
Returns :
Promise<Map<string | number, ISeries>>
A Promise that resolves to a Map object with data point IDs as keys and DataObject as values or undefined when all series has forbidden access. |
getColumnHeaders | ||||||||
getColumnHeaders(datapointsWithValues: KPIDetails[])
|
||||||||
Creates the column headers for the devices in the data points table.
Parameters :
Returns :
TableColumnHeader[]
An array of column headers for the devices. |
getDatapointsWithValues | ||||||||||||
getDatapointsWithValues(datapoints: KPIDetails[], datapointsSeriesDataMap: DatapointsSeriesDataMap)
|
||||||||||||
Creates an array of DatapointsWithValues based on the provided datapoints and datapointsSeriesDataMap. Finds an index of a current data point within series object and based on that index filters values array.
Parameters :
Returns :
DatapointWithValues[]
An array of DatapointsWithValues. |
getSeriesWithoutPermissionToRead | |||||||||
getSeriesWithoutPermissionToRead(activeDatapointsSeriesData: Map
|
|||||||||
Parameters :
Returns :
literal type[]
|
groupByDateAndDevice | ||||||||||||
groupByDateAndDevice(dataList: DatapointTableItem[], references: TableColumnHeader[])
|
||||||||||||
Groups a list of data points by date and device, based on given references.
Parameters :
Returns :
GroupedDatapointTableItem[]
An array of grouped data points, where each group corresponds to a unique date and device. |
groupSeriesByDeviceId | ||||||
groupSeriesByDeviceId(activeDatapoints: KPIDetails[])
|
||||||
Returns a map of active data points device IDs with their corresponding series. Example output: Example :
Parameters :
Returns :
DatapointsValuesDataMap
A map where the key is the data point ID and the value is an array of data point series. |
hasMultipleDatapoints | ||||||
hasMultipleDatapoints(datapoints: KPIDetails[])
|
||||||
Parameters :
Returns :
boolean
|
Async loadSeriesData | ||||||||||||
loadSeriesData(params: ISeriesFilter, roundSeconds: boolean)
|
||||||||||||
Asynchronously loads series data based on the provided parameters. This method constructs a filter for retrieving series data within a specified date range, from a specific source, and optionally applying an aggregation type.
Parameters :
Returns :
Promise<IResult<ISeries>>
A promise that resolves to series data wrapped in result object. |
mapDatapointsWithValuesToList | ||||||
mapDatapointsWithValuesToList(datapointsWithValues: DatapointWithValues[])
|
||||||
Parameters :
Returns :
DatapointTableItem[]
|
mergeDatapoints | ||||||||
mergeDatapoints(map: DataPointsTableMap)
|
||||||||
Merges the data points from the given map into an array of grouped data point table items.
Parameters :
Returns :
GroupedDatapointTableItem[]
An array of grouped data point table items. |
prepareTimeRange | ||||||||||||||||
prepareTimeRange(interval: TimeRangeInterval, dateFromInput: string, dateToInput: string)
|
||||||||||||||||
Prepares the updated time range based on the selected interval. In case of a 'custom' interval or no quantity, the original date range is returned.
Parameters :
Returns :
literal type
An object containing the |
sortDataByDateDescending | ||||||
sortDataByDateDescending(data: GroupedDatapointTableItem[])
|
||||||
Parameters :
Returns :
GroupedDatapointTableItem[]
|
subtractTime | ||||||||||||||||
subtractTime(date: Date, amount: number, unit: string)
|
||||||||||||||||
Subtracts an amount of time from a given date.
Parameters :
Returns :
Date
A new date with the specified time subtracted. |