math-helper-functions
Version:
Helper with misc. math functions such as sums, averages, max, min, etc
33 lines (32 loc) • 992 B
TypeScript
/**
* Gets the max value in an array
*
* @param array Input array
* @param [property] Property to map by
* @return The maximum value in the array
*/
export declare function calcMax(array: any[], property?: string): number;
/**
* Gets the min value in an array
*
* @param array Input array
* @param [property] Property to map
* @return The minimum value in the array
*/
export declare function calcMin(array: any[], property?: string): number;
/**
* Gets the [min, max] value in an array
*
* @param array Input array
* @param [property] Property to map by
* @return The domain
*/
export declare function calcDomain(array: any[], property?: string): [number, number] | [any, any];
/**
* Gets the absolute difference between the max and min value in an array
*
* @param array Input array
* @param [property] Property to map by
* @return Absolute difference between the max and min of an array
*/
export declare function calcDiff(array: any[], property?: string): number;