import type { GeoJsonDataType } from './types'; import { DataPoint } from './DataPoint'; import { DataPrimitive, DataType, IDataSeries, TypedValue } from './DataPrimitive'; /** * DataSeries class and associated DataSeries selectors * @implements {DataPrimitive} */ export declare class DataSeries implements DataPrimitive, IDataSeries { get points(): DataPoint[]; protected internalPoints: DataPoint[]; readonly field: string; type: string; static isDataSeries(o: any): o is DataSeries; static fromRaw(pts: any[]): DataSeries; /** * * @param {array} points list of data points * @param {string} type user explicitly sets the data type */ constructor(points?: DataPoint[], type?: string, field?: string); /** * Return first dataPoint in series. * @public * @returns {DataPoint} */ firstPoint(): DataPoint; /** * Return last dataPoint in series. * @public * @returns {DataPoint} */ lastPoint(): DataPoint; /** * Finds dataPoint(s) in DataSeries by index(es). * @public * @param {...number} indexes * @returns {DataSeries} */ pointsByIndexes(...indexes: number[]): DataSeries; /** * Finds and returns the individual dataPoint at the given index. * @public * @param {number} index * @returns {DataPoint} */ pointByIndex(indexIn: number): DataPoint; /** * Finds the delta between the last point and point at the given index. * A negative index can be used, indicating an offset from the end of the sequence. * @public * @param {number} index * @returns {DataPoint} */ delta(index: number): DataPoint; /** * Sets all the values in the Data Series to a static TypedValue. * @param {TypedValue} v */ setValue(v: TypedValue): void; /** * Gets all the values + their type in the Data Series. * @returns {TypedValue[]} */ getValue(): TypedValue[]; /** * Gets all the values (only) in the Data Series. * @returns {array} */ getRawValue(): (string | number | GeoJsonDataType)[]; /** * Returns the data source field which the series belongs to. * @public * @returns {DataPoint<'string'>} */ getField(): DataPoint<'string'>; /** * Returns the inferred data type of the series. * @public * @returns {string} */ getType(): string; /** * Returns the minimum DataPoint in the series or undefined if no numbers in series. * @public * @returns {DataPoint} */ min(): DataPoint; /** * Returns the maximum DataPoint in the series. * @public * @returns {DataPoint} */ max(): DataPoint; /** * Returns the number of points in the series as a DataPoint. * * @public * @returns {DataPoint} DataPoint with count value, or undefined if the series is empty * * @example * const series = new DataSeries([ * new DataPoint('count', { type: 'number', value: 10 }), * new DataPoint('count', { type: 'number', value: 20 }), * new DataPoint('count', { type: 'number', value: 30 }) * ]); * series.count().getRawValue(); // Returns 3 */ count(): DataPoint; /** * Returns the nearest-rank percentile of all numeric values in the series as a DataPoint. * Handles both numeric types and numeric strings (as returned by SPL queries). * Non-numeric values are silently skipped. * * @public * @param {number} percentile value from 0 to 100 * @returns {DataPoint} DataPoint with percentile value, or undefined if no valid numeric values * * @example * const series = new DataSeries([ * new DataPoint('count', { type: 'number', value: 10 }), * new DataPoint('count', { type: 'number', value: 20 }), * new DataPoint('count', { type: 'number', value: 30 }) * ]); * series.percentile(90).getRawValue(); // Returns 30 */ percentile(percentile: number): DataPoint; /** * Returns the average of all numeric values in the series as a DataPoint. * Handles both numeric types and numeric strings (as returned by SPL queries). * Non-numeric values are silently skipped. * * @public * @returns {DataPoint} DataPoint with average value, or undefined if no valid numeric values * * @example * const series = new DataSeries([ * new DataPoint('count', { type: 'number', value: 10 }), * new DataPoint('count', { type: 'number', value: 20 }) * ]); * series.average().getRawValue(); // Returns 15 * * @example * const splSeries = new DataSeries([ * new DataPoint('count', { type: 'string', value: '10' }), * new DataPoint('count', { type: 'string', value: '20' }) * ]); * splSeries.average().getRawValue(); // Returns 15 */ average(): DataPoint; /** * Returns the sum of all numeric values in the series as a DataPoint. * Handles both numeric types and numeric strings (as returned by SPL queries). * Non-numeric values are silently skipped. * * @public * @returns {DataPoint} DataPoint with sum value, or undefined if no valid numeric values * * @example * // With numeric values * const series = new DataSeries([ * new DataPoint('count', { type: 'number', value: 10 }), * new DataPoint('count', { type: 'number', value: 20 }) * ]); * series.sum().getRawValue(); // Returns 30 * * @example * // With numeric strings (SPL format) * const series = new DataSeries([ * new DataPoint('count', { type: 'string', value: '10' }), * new DataPoint('count', { type: 'string', value: '20' }) * ]); * series.sum().getRawValue(); // Returns 30 */ sum(): DataPoint; private reduce; }