Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

spectrum-generator

Package Overview
Dependencies
Maintainers
4
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

spectrum-generator - npm Package Compare versions

Comparing version 6.0.0 to 6.0.1

3

lib-esm/Spectrum2DGenerator.js

@@ -119,4 +119,3 @@ import { getShape2D } from 'ml-peak-shape-generator';

}
this.shape.fwhmX = fwhm.x;
this.shape.fwhmY = fwhm.y;
this.shape.fwhm = fwhm;
for (let xIndex = firstPoint.x; xIndex < lastPoint.x; xIndex++) {

@@ -123,0 +122,0 @@ for (let yIndex = firstPoint.y; yIndex < lastPoint.y; yIndex++) {

@@ -54,3 +54,2 @@ import { getShape1D } from 'ml-peak-shape-generator';

}
return this;
}

@@ -85,5 +84,3 @@ /**

this.maxPeakHeight = intensity;
let { fwhm = peakFWHM === undefined
? this.peakWidthFct(xPosition)
: peakFWHM, widthLeft, widthRight, shape: shapeOptions, } = options;
let { fwhm = peakFWHM === undefined ? this.peakWidthFct(xPosition) : peakFWHM, widthLeft, widthRight, shape: shapeOptions, } = options;
if (peakShapeOptions) {

@@ -123,3 +120,2 @@ shapeOptions = shapeOptions

}
return this;
}

@@ -126,0 +122,0 @@ /**

@@ -76,3 +76,9 @@ import type { Shape2D, XYNumber } from 'ml-peak-shape-generator';

}
export declare class Spectrum2DGenerator {
export interface ISpectrum2DGenerator {
addPeaks(peaks: Peak2D[] | Peak2DSeries, options?: AddPeak2DOptions): void;
addPeak(peak: Peak2D, options?: AddPeak2DOptions): void;
getSpectrum(options?: GetSpectrum2DOptions | boolean): void;
reset(): void;
}
export declare class Spectrum2DGenerator implements ISpectrum2DGenerator {
private from;

@@ -79,0 +85,0 @@ private to;

@@ -122,4 +122,3 @@ "use strict";

}
this.shape.fwhmX = fwhm.x;
this.shape.fwhmY = fwhm.y;
this.shape.fwhm = fwhm;
for (let xIndex = firstPoint.x; xIndex < lastPoint.x; xIndex++) {

@@ -126,0 +125,0 @@ for (let yIndex = firstPoint.y; yIndex < lastPoint.y; yIndex++) {

@@ -100,3 +100,12 @@ import type { DataXY } from 'cheminfo-types';

}
export declare class SpectrumGenerator {
export interface ISpectrumGenerator {
interval: number;
addPeaks(peaks: Peak1D[] | PeakSeries, options?: AddPeakOptions): void;
addPeak(peak: Peak1D, options?: AddPeakOptions): void;
addBaseline(baselineFct: NumToNumFn): void;
addNoise(percent: number, options?: AddNoiseOptions): void;
getSpectrum(options: GetSpectrumOptions | boolean): DataXY;
reset(): void;
}
export declare class SpectrumGenerator implements ISpectrumGenerator {
private from;

@@ -115,3 +124,3 @@ private to;

*/
addPeaks(peaks: Peak1D[] | PeakSeries, options?: AddPeakOptions): this;
addPeaks(peaks: Peak1D[] | PeakSeries, options?: AddPeakOptions): void;
/**

@@ -122,3 +131,3 @@ * Add a single peak to the spectrum.

*/
addPeak(peak: Peak1D, options?: AddPeakOptions): this;
addPeak(peak: Peak1D, options?: AddPeakOptions): void;
/**

@@ -133,3 +142,3 @@ * Add a baseline to the spectrum.

*/
addNoise(percent: number, options: AddNoiseOptions): this;
addNoise(percent: number, options?: AddNoiseOptions): this;
/**

@@ -136,0 +145,0 @@ * Get the generated spectrum.

@@ -60,3 +60,2 @@ "use strict";

}
return this;
}

@@ -91,5 +90,3 @@ /**

this.maxPeakHeight = intensity;
let { fwhm = peakFWHM === undefined
? this.peakWidthFct(xPosition)
: peakFWHM, widthLeft, widthRight, shape: shapeOptions, } = options;
let { fwhm = peakFWHM === undefined ? this.peakWidthFct(xPosition) : peakFWHM, widthLeft, widthRight, shape: shapeOptions, } = options;
if (peakShapeOptions) {

@@ -129,3 +126,2 @@ shapeOptions = shapeOptions

}
return this;
}

@@ -132,0 +128,0 @@ /**

{
"name": "spectrum-generator",
"version": "6.0.0",
"version": "6.0.1",
"description": "generate a spectrum from discrete peaks",

@@ -68,5 +68,5 @@ "main": "./lib/index.js",

"ml-array-min": "^1.2.2",
"ml-peak-shape-generator": "^3.0.1",
"ml-peak-shape-generator": "^3.0.3",
"ml-xsadd": "^2.0.0"
}
}

@@ -93,3 +93,10 @@ import { getShape2D } from 'ml-peak-shape-generator';

export class Spectrum2DGenerator {
export interface ISpectrum2DGenerator {
addPeaks(peaks: Peak2D[] | Peak2DSeries, options?: AddPeak2DOptions): void;
addPeak(peak: Peak2D, options?: AddPeak2DOptions): void;
getSpectrum(options?: GetSpectrum2DOptions | boolean): void;
reset(): void;
}
export class Spectrum2DGenerator implements ISpectrum2DGenerator {
private from: XYNumber;

@@ -242,3 +249,2 @@ private to: XYNumber;

fwhm = ensureXYNumber(fwhm);
let factor =

@@ -264,4 +270,3 @@ options.factor === undefined ? this.shape.getFactor() : options.factor;

this.shape.fwhmX = fwhm.x;
this.shape.fwhmY = fwhm.y;
this.shape.fwhm = fwhm;
for (let xIndex = firstPoint.x; xIndex < lastPoint.x; xIndex++) {

@@ -268,0 +273,0 @@ for (let yIndex = firstPoint.y; yIndex < lastPoint.y; yIndex++) {

import type { DataXY } from 'cheminfo-types';
import { getShape1D } from 'ml-peak-shape-generator';
import type { Shape1D, Shape1DClass} from 'ml-peak-shape-generator';
import type { Shape1D, Shape1DClass } from 'ml-peak-shape-generator';

@@ -107,3 +107,13 @@ import type { PeakSeries, Peak1D } from './types/Peaks1D';

export class SpectrumGenerator {
export interface ISpectrumGenerator {
interval: number;
addPeaks(peaks: Peak1D[] | PeakSeries, options?: AddPeakOptions): void;
addPeak(peak: Peak1D, options?: AddPeakOptions): void;
addBaseline(baselineFct: NumToNumFn): void;
addNoise(percent: number, options?: AddNoiseOptions): void;
getSpectrum(options: GetSpectrumOptions | boolean): DataXY;
reset(): void;
}
export class SpectrumGenerator implements ISpectrumGenerator {
private from: number;

@@ -155,2 +165,3 @@ private to: number;

}
/**

@@ -183,4 +194,2 @@ * Add a series of peaks to the spectrum.

}
return this;
}

@@ -224,5 +233,3 @@ /**

let {
fwhm = peakFWHM === undefined
? this.peakWidthFct(xPosition)
: peakFWHM,
fwhm = peakFWHM === undefined ? this.peakWidthFct(xPosition) : peakFWHM,
widthLeft,

@@ -246,4 +253,5 @@ widthRight,

if (!widthLeft || !widthRight)
{throw new Error('Width left or right is undefined or zero');}
if (!widthLeft || !widthRight) {
throw new Error('Width left or right is undefined or zero');
}

@@ -284,4 +292,2 @@ let factor =

}
return this;
}

@@ -302,3 +308,3 @@

*/
public addNoise(percent: number, options: AddNoiseOptions) {
public addNoise(percent: number, options?: AddNoiseOptions) {
addNoise(this.data, percent, options);

@@ -305,0 +311,0 @@ return this;

declare module 'ml-spectra-processing' {
import { DoubleArray } from 'cheminfo-types';
function xyMaxYPoint(data: {
x: DoubleArray;
y: DoubleArray;
}): {
function xyMaxYPoint(data: { x: DoubleArray; y: DoubleArray }): {
x: number;

@@ -9,0 +6,0 @@ y: number;

@@ -5,3 +5,2 @@ import type { DataXY } from 'cheminfo-types';

type Distributions = 'uniform' | 'normal';

@@ -8,0 +7,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc