ir-spectrum 3.0.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +15 -15
- package/package.json +15 -14
- package/src/from/fromJcamp.js +3 -3
- package/src/from/fromSPC.js +3 -3
- package/src/jsgraph/getAnnotations.js +6 -6
package/lib/index.js
CHANGED
|
@@ -28,7 +28,7 @@ function getPeakKind(transmittance, minTransmittance, maxTransmittance) {
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
|
-
* @typedef {
|
|
31
|
+
* @typedef {object} Peak
|
|
32
32
|
* @property {number} wavenumber
|
|
33
33
|
* @property {number} transmittance
|
|
34
34
|
* @property {number} absorbance
|
|
@@ -38,14 +38,14 @@ function getPeakKind(transmittance, minTransmittance, maxTransmittance) {
|
|
|
38
38
|
|
|
39
39
|
/**
|
|
40
40
|
* Creates annotations for jsgraph that allows to display the result of peak picking
|
|
41
|
-
* @param {
|
|
41
|
+
* @param {Array<Peak>} peaks
|
|
42
42
|
* @param {object} [options={}]
|
|
43
43
|
* @param {string} [options.fillColor='green']
|
|
44
44
|
* @param {string} [options.strokeColor='red']
|
|
45
|
-
* @param {string} [options.showKind=true] Display the kind, 'm', 'w', 'S'
|
|
46
|
-
* @param {string} [options.showAssignment=true] Display the assignment
|
|
47
|
-
* @param {
|
|
48
|
-
* @param {string} [options.mode='t100'] 't100'=transmittance in %, 't'=transmittance, 'a'=absorbance
|
|
45
|
+
* @param {string} [options.showKind=true] - Display the kind, 'm', 'w', 'S'
|
|
46
|
+
* @param {string} [options.showAssignment=true] - Display the assignment
|
|
47
|
+
* @param {Function} [options.createFct] - (annotation, peak) => {}: callback allowing to add properties
|
|
48
|
+
* @param {string} [options.mode='t100'] - 't100'=transmittance in %, 't'=transmittance, 'a'=absorbance
|
|
49
49
|
* @returns array
|
|
50
50
|
*/
|
|
51
51
|
|
|
@@ -244,9 +244,9 @@ function spectrumCallback(variables) {
|
|
|
244
244
|
* @param {ArrayBuffer|string} jcamp
|
|
245
245
|
* @param {object} [options={}]
|
|
246
246
|
* @param {string|number} [options.id=Math.random()]
|
|
247
|
-
* @param {string} [options.label=options.id] human redeable label
|
|
248
|
-
* @param {string} [options.spectrumCallback] a callback to apply on variables when creating spectrum. Default will add a and t
|
|
249
|
-
* @
|
|
247
|
+
* @param {string} [options.label=options.id] - human redeable label
|
|
248
|
+
* @param {string} [options.spectrumCallback] - a callback to apply on variables when creating spectrum. Default will add a and t
|
|
249
|
+
* @returns {Analysis} - New class element with the given data
|
|
250
250
|
*/
|
|
251
251
|
function fromJcamp(jcamp, options = {}) {
|
|
252
252
|
return commonSpectrum.fromJcamp(jcamp, { ...options, spectrumCallback });
|
|
@@ -257,9 +257,9 @@ function fromJcamp(jcamp, options = {}) {
|
|
|
257
257
|
* @param {ArrayBuffer} buffer
|
|
258
258
|
* @param {object} [options={}]
|
|
259
259
|
* @param {object} [options.id=Math.random()]
|
|
260
|
-
* @param {string} [options.label=options.id] human redeable label
|
|
261
|
-
* @param {string} [options.spectrumCallback] a callback to apply on variables when creating spectrum. Default will add a and t
|
|
262
|
-
* @
|
|
260
|
+
* @param {string} [options.label=options.id] - human redeable label
|
|
261
|
+
* @param {string} [options.spectrumCallback] - a callback to apply on variables when creating spectrum. Default will add a and t
|
|
262
|
+
* @returns {Analysis} - New class element with the given data
|
|
263
263
|
*/
|
|
264
264
|
|
|
265
265
|
function fromSPC(buffer, options = {}) {
|
|
@@ -293,15 +293,15 @@ function autoPeakPicking(spectrum, options) {
|
|
|
293
293
|
|
|
294
294
|
const JSGraph = { ...commonSpectrum.JSGraph, getAnnotations };
|
|
295
295
|
|
|
296
|
-
Object.defineProperty(exports,
|
|
296
|
+
Object.defineProperty(exports, "AnalysesManager", {
|
|
297
297
|
enumerable: true,
|
|
298
298
|
get: function () { return commonSpectrum.AnalysesManager; }
|
|
299
299
|
});
|
|
300
|
-
Object.defineProperty(exports,
|
|
300
|
+
Object.defineProperty(exports, "Analysis", {
|
|
301
301
|
enumerable: true,
|
|
302
302
|
get: function () { return commonSpectrum.Analysis; }
|
|
303
303
|
});
|
|
304
|
-
Object.defineProperty(exports,
|
|
304
|
+
Object.defineProperty(exports, "toJcamp", {
|
|
305
305
|
enumerable: true,
|
|
306
306
|
get: function () { return commonSpectrum.toJcamp; }
|
|
307
307
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ir-spectrum",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "src/index.js",
|
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
"prepack": "rollup -c",
|
|
17
17
|
"prettier": "prettier --check src",
|
|
18
18
|
"prettier-write": "prettier --write src",
|
|
19
|
-
"test": "npm run test-coverage && npm run eslint",
|
|
20
|
-
"test-coverage": "
|
|
21
|
-
"test-only": "
|
|
19
|
+
"test": "npm run test-coverage && npm run eslint && npm run prettier",
|
|
20
|
+
"test-coverage": "vitest run --coverage",
|
|
21
|
+
"test-only": "vitest run"
|
|
22
22
|
},
|
|
23
23
|
"repository": {
|
|
24
24
|
"type": "git",
|
|
@@ -35,22 +35,23 @@
|
|
|
35
35
|
"testEnvironment": "node"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@babel/plugin-transform-modules-commonjs": "^7.
|
|
39
|
-
"@
|
|
38
|
+
"@babel/plugin-transform-modules-commonjs": "^7.25.9",
|
|
39
|
+
"@vitest/coverage-v8": "^2.1.5",
|
|
40
40
|
"cheminfo-build": "^1.2.0",
|
|
41
41
|
"codecov": "^3.8.3",
|
|
42
|
-
"eslint": "^
|
|
43
|
-
"eslint-config-cheminfo": "^
|
|
42
|
+
"eslint": "^9.14.0",
|
|
43
|
+
"eslint-config-cheminfo": "^12.0.1",
|
|
44
44
|
"esm": "^3.2.25",
|
|
45
|
-
"jest": "^29.6.3",
|
|
46
45
|
"jest-matcher-deep-close-to": "^3.0.2",
|
|
47
|
-
"prettier": "^3.
|
|
48
|
-
"rollup": "^
|
|
46
|
+
"prettier": "^3.3.3",
|
|
47
|
+
"rollup": "^4.26.0",
|
|
48
|
+
"vitest": "^2.1.5"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"common-spectrum": "2.
|
|
52
|
-
"ml-gsd": "^12.1.
|
|
53
|
-
"spc-parser": "^0.
|
|
51
|
+
"common-spectrum": "2.12.0",
|
|
52
|
+
"ml-gsd": "^12.1.8",
|
|
53
|
+
"spc-parser": "^1.0.0",
|
|
54
|
+
"uninstall": "^0.0.0"
|
|
54
55
|
},
|
|
55
56
|
"info": {
|
|
56
57
|
"logo": "https://raw.githubusercontent.com/cheminfo/font/master/src/ir/assignment.svg",
|
package/src/from/fromJcamp.js
CHANGED
|
@@ -7,9 +7,9 @@ import { spectrumCallback } from './utils/spectrumCallback';
|
|
|
7
7
|
* @param {ArrayBuffer|string} jcamp
|
|
8
8
|
* @param {object} [options={}]
|
|
9
9
|
* @param {string|number} [options.id=Math.random()]
|
|
10
|
-
* @param {string} [options.label=options.id] human redeable label
|
|
11
|
-
* @param {string} [options.spectrumCallback] a callback to apply on variables when creating spectrum. Default will add a and t
|
|
12
|
-
* @
|
|
10
|
+
* @param {string} [options.label=options.id] - human redeable label
|
|
11
|
+
* @param {string} [options.spectrumCallback] - a callback to apply on variables when creating spectrum. Default will add a and t
|
|
12
|
+
* @returns {Analysis} - New class element with the given data
|
|
13
13
|
*/
|
|
14
14
|
export function fromJcamp(jcamp, options = {}) {
|
|
15
15
|
return commonFromJcamp(jcamp, { ...options, spectrumCallback });
|
package/src/from/fromSPC.js
CHANGED
|
@@ -8,9 +8,9 @@ import { spectrumCallback } from './utils/spectrumCallback';
|
|
|
8
8
|
* @param {ArrayBuffer} buffer
|
|
9
9
|
* @param {object} [options={}]
|
|
10
10
|
* @param {object} [options.id=Math.random()]
|
|
11
|
-
* @param {string} [options.label=options.id] human redeable label
|
|
12
|
-
* @param {string} [options.spectrumCallback] a callback to apply on variables when creating spectrum. Default will add a and t
|
|
13
|
-
* @
|
|
11
|
+
* @param {string} [options.label=options.id] - human redeable label
|
|
12
|
+
* @param {string} [options.spectrumCallback] - a callback to apply on variables when creating spectrum. Default will add a and t
|
|
13
|
+
* @returns {Analysis} - New class element with the given data
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
16
|
export function fromSPC(buffer, options = {}) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @typedef {
|
|
2
|
+
* @typedef {object} Peak
|
|
3
3
|
* @property {number} wavenumber
|
|
4
4
|
* @property {number} transmittance
|
|
5
5
|
* @property {number} absorbance
|
|
@@ -9,14 +9,14 @@
|
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Creates annotations for jsgraph that allows to display the result of peak picking
|
|
12
|
-
* @param {
|
|
12
|
+
* @param {Array<Peak>} peaks
|
|
13
13
|
* @param {object} [options={}]
|
|
14
14
|
* @param {string} [options.fillColor='green']
|
|
15
15
|
* @param {string} [options.strokeColor='red']
|
|
16
|
-
* @param {string} [options.showKind=true] Display the kind, 'm', 'w', 'S'
|
|
17
|
-
* @param {string} [options.showAssignment=true] Display the assignment
|
|
18
|
-
* @param {
|
|
19
|
-
* @param {string} [options.mode='t100'] 't100'=transmittance in %, 't'=transmittance, 'a'=absorbance
|
|
16
|
+
* @param {string} [options.showKind=true] - Display the kind, 'm', 'w', 'S'
|
|
17
|
+
* @param {string} [options.showAssignment=true] - Display the assignment
|
|
18
|
+
* @param {Function} [options.createFct] - (annotation, peak) => {}: callback allowing to add properties
|
|
19
|
+
* @param {string} [options.mode='t100'] - 't100'=transmittance in %, 't'=transmittance, 'a'=absorbance
|
|
20
20
|
* @returns array
|
|
21
21
|
*/
|
|
22
22
|
|