File

core/aggregation/aggregation.service.ts

Index

Properties
Methods

Methods

determineAggregationValue
determineAggregationValue(interval: Interval)

Determines the aggregation value based on the provided interval.

Parameters :
Name Type Optional Description
interval Interval No
  • The time range interval.
Returns : AggregationOption

The corresponding aggregation value.

determineFirstNewAvailableAggregationValue
determineFirstNewAvailableAggregationValue(currentValue: AggregationOption, disabledOptions: AggregationOptionStatus)

Determines the new aggregation value based on the current value and disabled options.

Goal is to switch to the next available aggregation option if the current one is disabled.

  • If the current option is disabled, sets the control to the first available (non-disabled) option based on the following order:
    • If the current value is DAILY, it switches to HOURLY if it's not disabled, otherwise to MINUTELY if HOURLY is also disabled.
    • If the current value is HOURLY, it switches to MINUTELY if it's not disabled.
    • If all options are disabled, it sets the value to NONE.
Parameters :
Name Type Optional Description
currentValue AggregationOption No
  • The current aggregation option.
disabledOptions AggregationOptionStatus No
  • An object containing disabled options.
Returns : AggregationOption

The new aggregation option.

getDisabledAggregationOptions
getDisabledAggregationOptions(dateFrom: Date | string, dateTo: Date | string)

Determines which aggregation options should be disabled based on the time range between two dates. It calculates the time difference and checks against predefined time spans to decide if daily, hourly, or minutely aggregations should be disabled.

Parameters :
Name Type Optional Description
dateFrom Date | string No
  • The start date of the time range, as a Date object or an ISO date string.
dateTo Date | string No
  • The end date of the time range, as a Date object or an ISO date string.

An AggregationOptionStatus object indicating the disabled state of each aggregation option.

Properties

Readonly AGGREGATION_MAP
Type : object
Default value : { [INTERVAL_VALUES.minutes]: AGGREGATION_VALUES.none, [INTERVAL_VALUES.hours]: AGGREGATION_VALUES.minutely, [INTERVAL_VALUES.days]: AGGREGATION_VALUES.hourly }

results matching ""

    No results matching ""