import type { DataXY } from 'cheminfo-types'; import { xRescale } from 'ml-spectra-processing'; export interface RescaleFilter { name: 'rescale'; options?: RescaleOptions; } export type RescaleOptions = Omit< Exclude[1], undefined>, 'output' >; /** * Center the mean * @param data * @param options */ export function rescale( data: DataXY, options: RescaleOptions = {}, ): { data: DataXY } { xRescale(data.y, { ...options, output: data.y }); return { data }; }