isotopic-distribution
Advanced tools
Comparing version 2.0.2 to 2.1.0
@@ -604,2 +604,18 @@ 'use strict'; | ||
/** | ||
* Returns the isotopic distirubtion | ||
* @param {object} [options={}] | ||
* @param {number} [options.maxValue=100] | ||
* @param {number} [options.sumValue] // if sumValue is defined, maxValue is ignored | ||
* @return {import('cheminfo-types').MeasurementXYVariables} an object containing at least the 2 properties: x:[] and y:[] | ||
*/ | ||
getVariables(options = {}) { | ||
const xy = this.getXY(options); | ||
return { | ||
x: { data: xy.x, label: 'm/z', units: 'u' }, | ||
y: { data: xy.y, label: 'Relative intensity', units: '%' }, | ||
}; | ||
} | ||
/** | ||
* Returns the isotopic distribution as the sum of gaussian | ||
@@ -606,0 +622,0 @@ * @param {object} [options={}] |
{ | ||
"name": "isotopic-distribution", | ||
"version": "2.0.2", | ||
"version": "2.1.0", | ||
"description": "Calculate the isotopic distribution of a molecular formula", | ||
@@ -23,6 +23,6 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"chemical-elements": "^2.0.1", | ||
"mf-parser": "^2.2.0", | ||
"mf-utilities": "^2.0.2", | ||
"spectrum-generator": "^8.0.6" | ||
"chemical-elements": "^2.0.2", | ||
"mf-parser": "^2.2.1", | ||
"mf-utilities": "^2.0.3", | ||
"spectrum-generator": "^8.0.7" | ||
}, | ||
@@ -32,3 +32,3 @@ "devDependencies": { | ||
}, | ||
"gitHead": "91eb5af24bbad5cde6f018447f50552140253c2f" | ||
"gitHead": "eaf15749dfc3cf47932c45669772647cf3034d69" | ||
} |
@@ -191,3 +191,3 @@ import { IsotopicDistribution } from '..'; | ||
it('create distribution of C10 and getXY with sumValue to 1', () => { | ||
it('create distribution of C10 and getXY with sumValue to 100', () => { | ||
let isotopicDistribution = new IsotopicDistribution('C10'); | ||
@@ -200,2 +200,9 @@ let xy = isotopicDistribution.getXY({ sumValue: 100 }); | ||
it('create distribution of C10 and getVariables with maxValue to 100', () => { | ||
let isotopicDistribution = new IsotopicDistribution('C10'); | ||
let variables = isotopicDistribution.getVariables(); | ||
expect(variables.x.data.length).toBe(6); | ||
expect(Math.max(...variables.y.data)).toBe(100); | ||
}); | ||
it('create distribution of Ru5 and getXY', () => { | ||
@@ -202,0 +209,0 @@ let isotopicDistribution = new IsotopicDistribution('Ru5'); |
@@ -295,2 +295,18 @@ import { ELECTRON_MASS } from 'chemical-elements'; | ||
/** | ||
* Returns the isotopic distirubtion | ||
* @param {object} [options={}] | ||
* @param {number} [options.maxValue=100] | ||
* @param {number} [options.sumValue] // if sumValue is defined, maxValue is ignored | ||
* @return {import('cheminfo-types').MeasurementXYVariables} an object containing at least the 2 properties: x:[] and y:[] | ||
*/ | ||
getVariables(options = {}) { | ||
const xy = this.getXY(options); | ||
return { | ||
x: { data: xy.x, label: 'm/z', units: 'u' }, | ||
y: { data: xy.y, label: 'Relative intensity', units: '%' }, | ||
}; | ||
} | ||
/** | ||
* Returns the isotopic distribution as the sum of gaussian | ||
@@ -297,0 +313,0 @@ * @param {object} [options={}] |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
69519
1970
Updatedchemical-elements@^2.0.2
Updatedmf-parser@^2.2.1
Updatedmf-utilities@^2.0.3
Updatedspectrum-generator@^8.0.7