nmrium 0.58.0 → 0.59.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/component/1d/integral/IntegralResizable.js +2 -2
- package/lib/component/1d/matrix/useMatrix.d.ts +1 -1
- package/lib/component/1d/multiAnalysis/AnalysisRange.js +1 -1
- package/lib/component/1d/ranges/Atoms.js +6 -4
- package/lib/component/2d/Viewer2D.js +6 -2
- package/lib/component/2d/zones/Zone.js +2 -2
- package/lib/component/EventsTrackers/KeysListenerTracker.js +8 -8
- package/lib/component/context/ChartContext.js +12 -1
- package/lib/component/context/ShareDataContext.d.ts +1 -1
- package/lib/component/context/ShareDataContext.js +2 -4
- package/lib/component/context/ToasterContext.d.ts +1 -0
- package/lib/component/context/ToasterContext.js +12 -3
- package/lib/component/elements/ActionsButtonsPopover.js +1 -3
- package/lib/component/elements/Alert.d.ts +20 -0
- package/lib/component/elements/Alert.js +80 -0
- package/lib/component/elements/ContextMenuBluePrint.d.ts +7 -2
- package/lib/component/elements/ContextMenuBluePrint.js +9 -3
- package/lib/component/elements/ReactTable/Elements/ReactTableRow.js +1 -1
- package/lib/component/elements/ReactTable/ReactTableFlexLayout.d.ts +0 -3
- package/lib/component/elements/ReactTable/ReactTableFlexLayout.js +1 -1
- package/lib/component/elements/Select2.d.ts +12 -7
- package/lib/component/elements/Select2.js +5 -4
- package/lib/component/elements/Select2Controller.d.ts +2 -2
- package/lib/component/elements/Select2Controller.js +5 -5
- package/lib/component/elements/ToolbarPopoverItem.d.ts +7 -6
- package/lib/component/elements/ToolbarPopoverItem.js +13 -5
- package/lib/component/elements/print/PrintContent.d.ts +17 -0
- package/lib/component/elements/print/PrintContent.js +281 -0
- package/lib/component/elements/print/PrintProvider.d.ts +12 -0
- package/lib/component/elements/print/PrintProvider.js +28 -0
- package/lib/component/elements/print/index.d.ts +2 -0
- package/lib/component/elements/print/index.js +2 -0
- package/lib/component/header/BaseLineCorrectionPanel.js +3 -0
- package/lib/component/hooks/useToggleSpectraVisibility.d.ts +14 -9
- package/lib/component/hooks/useToggleSpectraVisibility.js +45 -16
- package/lib/component/loader/DropZone.js +3 -67
- package/lib/component/loader/useLoadFiles.d.ts +1 -0
- package/lib/component/loader/useLoadFiles.js +78 -0
- package/lib/component/main/InnerNMRium.d.ts +4 -3
- package/lib/component/main/InnerNMRium.js +4 -9
- package/lib/component/main/InnerNMRiumContents.d.ts +3 -2
- package/lib/component/main/InnerNMRiumContents.js +33 -29
- package/lib/component/main/NMRium.d.ts +2 -5
- package/lib/component/main/NMRium.js +1 -1
- package/lib/component/main/NMRiumRefAPI.d.ts +7 -0
- package/lib/component/main/NMRiumRefAPI.js +12 -0
- package/lib/component/main/NMRiumViewer.d.ts +10 -0
- package/lib/component/main/NMRiumViewer.js +35 -0
- package/lib/component/main/index.d.ts +1 -0
- package/lib/component/modal/CopyClipboardModal.d.ts +3 -2
- package/lib/component/modal/CopyClipboardModal.js +18 -32
- package/lib/component/modal/ExportAsJcampModal.d.ts +6 -3
- package/lib/component/modal/ExportAsJcampModal.js +69 -35
- package/lib/component/modal/ImportPublicationStringModal.js +1 -1
- package/lib/component/modal/setting/GeneralSettings.js +4 -2
- package/lib/component/modal/setting/settings-tabs/ExternalAPIsTabContent.d.ts +1 -0
- package/lib/component/modal/setting/settings-tabs/ExternalAPIsTabContent.js +89 -0
- package/lib/component/modal/setting/settingsValidation.js +15 -1
- package/lib/component/panels/IntegralsPanel/IntegralPanel.js +8 -5
- package/lib/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +5 -1
- package/lib/component/panels/Panels.js +2 -2
- package/lib/component/panels/PeaksPanel/PeaksPanel.js +8 -5
- package/lib/component/panels/RangesPanel/RangesHeader.js +52 -12
- package/lib/component/panels/SpectraPanel/SpectraPanelHeader.js +13 -6
- package/lib/component/panels/SpectraPanel/SpectraTable.js +63 -21
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnHeader.js +6 -2
- package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +6 -2
- package/lib/component/panels/SummaryPanel/SummaryPanel.js +4 -0
- package/lib/component/panels/ZonesPanel/ZonesPanel.js +16 -8
- package/lib/component/panels/databasePanel/DatabasePanel.js +7 -8
- package/lib/component/panels/filtersPanel/FilterPanel.js +9 -6
- package/lib/component/panels/filtersPanel/FiltersTable.js +12 -10
- package/lib/component/panels/header/DefaultPanelHeader.d.ts +1 -0
- package/lib/component/panels/header/DefaultPanelHeader.js +2 -2
- package/lib/component/panels/multipleAnalysisPanel/AlignSpectra.js +10 -12
- package/lib/component/reducer/IgnoreActions.js +1 -0
- package/lib/component/reducer/Reducer.js +2 -4
- package/lib/component/reducer/actions/DatabaseActions.d.ts +15 -13
- package/lib/component/reducer/actions/DatabaseActions.js +52 -34
- package/lib/component/reducer/actions/DomainActions.d.ts +2 -2
- package/lib/component/reducer/actions/FiltersActions.js +9 -4
- package/lib/component/reducer/actions/SpectraActions.d.ts +2 -1
- package/lib/component/reducer/actions/SpectraActions.js +53 -43
- package/lib/component/reducer/helper/removeSpectrumRelatedObjectsById.d.ts +3 -0
- package/lib/component/reducer/helper/removeSpectrumRelatedObjectsById.js +16 -0
- package/lib/component/reducer/preferences/actions/changePrintPageSettings.d.ts +3 -0
- package/lib/component/reducer/preferences/actions/changePrintPageSettings.js +6 -0
- package/lib/component/reducer/preferences/preferencesReducer.d.ts +3 -2
- package/lib/component/reducer/preferences/preferencesReducer.js +4 -1
- package/lib/component/toolbar/ToolBar.js +33 -14
- package/lib/component/workspaces/workspaceDefaultProperties.js +2 -0
- package/lib/data/SpectraManager.d.ts +7 -10
- package/lib/data/SpectraManager.js +51 -30
- package/lib/data/data1d/Spectrum1D/SumManager.d.ts +0 -1
- package/lib/data/data1d/Spectrum1D/SumManager.js +2 -10
- package/lib/data/data1d/Spectrum1D/get1DColor.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/index.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/index.js +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/createRange.d.ts +10 -10
- package/lib/data/data1d/Spectrum1D/ranges/detectSignals.js +2 -1
- package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.d.ts +10 -10
- package/lib/data/data1d/Spectrum1D/ranges/resizeRange.d.ts +10 -10
- package/lib/data/data1d/Spectrum1D/ranges/resurrectSpectrum.d.ts +13 -0
- package/lib/data/data1d/Spectrum1D/ranges/resurrectSpectrum.js +65 -0
- package/lib/data/molecules/MoleculeManager.js +16 -38
- package/lib/data/utilities/getCustomColor.d.ts +1 -1
- package/lib/data/utilities/removeByPaths.d.ts +3 -0
- package/lib/data/utilities/removeByPaths.js +33 -0
- package/lib/versionInfo.js +1 -1
- package/package.json +34 -34
- package/lib/data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges.d.ts +0 -11
- package/lib/data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges.js +0 -29
|
@@ -7,14 +7,11 @@ export function fromJSON(mols, reservedMolecules = []) {
|
|
|
7
7
|
const molecules = [];
|
|
8
8
|
for (const mol of mols) {
|
|
9
9
|
const molecule = OCLMolecule.fromMolfile(mol.molfile);
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
id: mol.id,
|
|
16
|
-
}));
|
|
17
|
-
}
|
|
10
|
+
molecules.push(initMolecule({
|
|
11
|
+
molfile: molecule.toMolfileV3(),
|
|
12
|
+
label: mol.label || `P${getLabelNumber(reservedNumbers)}`,
|
|
13
|
+
id: mol.id,
|
|
14
|
+
}));
|
|
18
15
|
}
|
|
19
16
|
return molecules;
|
|
20
17
|
}
|
|
@@ -23,42 +20,23 @@ export function addMolfile(molecules, molfile) {
|
|
|
23
20
|
// try to parse molfile
|
|
24
21
|
// this will throw if the molecule can not be parsed !
|
|
25
22
|
const molecule = OCLMolecule.fromMolfile(molfile);
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
label: `P${getLabelNumber(reservedNumbers)}`,
|
|
31
|
-
}));
|
|
32
|
-
}
|
|
33
|
-
// we will split if we have many fragments
|
|
23
|
+
molecules.push(initMolecule({
|
|
24
|
+
molfile: molecule.toMolfileV3(),
|
|
25
|
+
label: `P${getLabelNumber(reservedNumbers)}`,
|
|
26
|
+
}));
|
|
34
27
|
}
|
|
35
28
|
export function setMolfile(molecules, currentMolecule) {
|
|
36
29
|
const { molfile, id, label } = currentMolecule;
|
|
37
|
-
const reservedNumbers = extractLabelsNumbers(molecules);
|
|
38
30
|
// try to parse molfile
|
|
39
31
|
// this will throw if the molecule can not be parsed !
|
|
40
32
|
const molecule = OCLMolecule.fromMolfile(molfile);
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}));
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
else if (fragments.length === 1) {
|
|
52
|
-
const fragment = fragments[0];
|
|
53
|
-
const _mol = initMolecule({
|
|
54
|
-
molfile: fragment.toMolfileV3(),
|
|
55
|
-
id,
|
|
56
|
-
label,
|
|
57
|
-
});
|
|
58
|
-
const molIndex = molecules.findIndex((m) => m.id === id);
|
|
59
|
-
molecules.splice(molIndex, 1, _mol);
|
|
60
|
-
}
|
|
61
|
-
// we will split if we have many fragments
|
|
33
|
+
const _mol = initMolecule({
|
|
34
|
+
molfile: molecule.toMolfileV3(),
|
|
35
|
+
id,
|
|
36
|
+
label,
|
|
37
|
+
});
|
|
38
|
+
const molIndex = molecules.findIndex((m) => m.id === id);
|
|
39
|
+
molecules.splice(molIndex, 1, _mol);
|
|
62
40
|
}
|
|
63
41
|
export function extractNumber(value) {
|
|
64
42
|
return /(?<number>\d+)/.exec(value)?.groups?.number || null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Color2D, Spectrum1D, Spectrum2D, SpectrumOneDimensionColor, SpectrumTwoDimensionsColor } from 'nmr-load-save';
|
|
2
2
|
type ReturnColor<ColorType> = ColorType extends SpectrumOneDimensionColor ? string : Color2D;
|
|
3
|
-
export declare function getCustomColor<
|
|
3
|
+
export declare function getCustomColor<ColorType extends SpectrumOneDimensionColor | SpectrumTwoDimensionsColor>(spectrum: Spectrum1D | Spectrum2D, colors?: ColorType[]): ReturnColor<ColorType> | null;
|
|
4
4
|
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export function removeByPaths(obj, pathsWithKeys, matchValue) {
|
|
2
|
+
for (const [path, key] of pathsWithKeys) {
|
|
3
|
+
remove(obj, path, key, matchValue);
|
|
4
|
+
}
|
|
5
|
+
}
|
|
6
|
+
function remove(obj, path, key, value) {
|
|
7
|
+
const pathParts = path.split('.');
|
|
8
|
+
let current = obj;
|
|
9
|
+
for (let i = 0; i < pathParts.length - 1; i++) {
|
|
10
|
+
current = current[pathParts[i]];
|
|
11
|
+
if (current === undefined || current === null) {
|
|
12
|
+
// eslint-disable-next-line no-console
|
|
13
|
+
console.error('Path not found:', path);
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
const finalKey = pathParts.at(-1);
|
|
18
|
+
if (!finalKey)
|
|
19
|
+
return;
|
|
20
|
+
const target = current[finalKey];
|
|
21
|
+
if (Array.isArray(target)) {
|
|
22
|
+
if (target.length > 0 && typeof target[0] === 'object' && key) {
|
|
23
|
+
current[finalKey] = target.filter((item) => item[key] !== value);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
else if (typeof target === 'object' && target !== null) {
|
|
27
|
+
// eslint-disable-next-line unicorn/no-lonely-if
|
|
28
|
+
if (Object.hasOwn(target, value)) {
|
|
29
|
+
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
|
|
30
|
+
delete target[value];
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
package/lib/versionInfo.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default { version: 'v0.
|
|
1
|
+
export default { version: 'v0.59.0' };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nmrium",
|
|
3
3
|
"description": "React component to display and process nuclear magnetic resonance (NMR) spectra.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.59.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"module": "lib/component/main/index.js",
|
|
7
7
|
"types": "lib/component/main/index.d.ts",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"compile": "tsc --project tsconfig.esm.json",
|
|
20
20
|
"copy-samples-toc": "cp src/demo/samples.json build/",
|
|
21
21
|
"clean-lib": "rimraf lib",
|
|
22
|
-
"dev": "vite --host localhost --port 3000 --
|
|
22
|
+
"dev": "vite --host localhost --port 3000 --open",
|
|
23
23
|
"eslint": "eslint . --cache",
|
|
24
24
|
"eslint-fix": "npm run eslint -- --fix",
|
|
25
25
|
"install:clean": "rm -rf node_modules/ && rm -rf package-lock.json && npm install && npm start",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"url": "git+https://github.com/cheminfo/nmrium.git"
|
|
47
47
|
},
|
|
48
48
|
"volta": {
|
|
49
|
-
"node": "
|
|
49
|
+
"node": "22.5.1"
|
|
50
50
|
},
|
|
51
51
|
"overrides": {
|
|
52
52
|
"react": "$react",
|
|
@@ -57,22 +57,22 @@
|
|
|
57
57
|
"react-dom": ">=18.0.0"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@blueprintjs/core": "^5.
|
|
61
|
-
"@blueprintjs/icons": "^5.
|
|
62
|
-
"@blueprintjs/select": "^5.2.
|
|
63
|
-
"@emotion/react": "^11.
|
|
64
|
-
"@emotion/styled": "^11.
|
|
60
|
+
"@blueprintjs/core": "^5.11.0",
|
|
61
|
+
"@blueprintjs/icons": "^5.11.0",
|
|
62
|
+
"@blueprintjs/select": "^5.2.2",
|
|
63
|
+
"@emotion/react": "^11.13.0",
|
|
64
|
+
"@emotion/styled": "^11.13.0",
|
|
65
65
|
"@hookform/resolvers": "^3.9.0",
|
|
66
66
|
"@lukeed/uuid": "^2.0.1",
|
|
67
67
|
"cheminfo-font": "^1.13.0",
|
|
68
|
-
"cheminfo-types": "^1.
|
|
68
|
+
"cheminfo-types": "^1.8.0",
|
|
69
69
|
"clipboard-polyfill": "^4.1.0",
|
|
70
70
|
"convert-to-jcamp": "^5.4.10",
|
|
71
71
|
"d3": "^7.9.0",
|
|
72
72
|
"eventemitter3": "^5.0.1",
|
|
73
73
|
"fifo-logger": "^1.0.0",
|
|
74
74
|
"file-saver": "^2.0.5",
|
|
75
|
-
"filelist-utils": "^1.11.
|
|
75
|
+
"filelist-utils": "^1.11.1",
|
|
76
76
|
"formik": "^2.4.6",
|
|
77
77
|
"immer": "^10.1.1",
|
|
78
78
|
"jszip": "^3.10.1",
|
|
@@ -86,71 +86,71 @@
|
|
|
86
86
|
"ml-gsd": "^12.1.6",
|
|
87
87
|
"ml-matrix": "^6.11.1",
|
|
88
88
|
"ml-signal-processing": "^1.0.4",
|
|
89
|
-
"ml-spectra-processing": "^14.5.
|
|
89
|
+
"ml-spectra-processing": "^14.5.3",
|
|
90
90
|
"ml-stat": "^1.3.3",
|
|
91
91
|
"ml-tree-similarity": "^2.2.0",
|
|
92
92
|
"multiplet-analysis": "^2.1.2",
|
|
93
93
|
"nmr-correlation": "^2.3.3",
|
|
94
|
-
"nmr-load-save": "^0.
|
|
95
|
-
"nmr-processing": "^12.
|
|
94
|
+
"nmr-load-save": "^0.36.0",
|
|
95
|
+
"nmr-processing": "^12.11.0",
|
|
96
96
|
"nmredata": "^0.9.11",
|
|
97
97
|
"numeral": "^2.0.6",
|
|
98
|
-
"openchemlib": "^8.
|
|
99
|
-
"openchemlib-utils": "^6.
|
|
98
|
+
"openchemlib": "^8.15.0",
|
|
99
|
+
"openchemlib-utils": "^6.4.1",
|
|
100
100
|
"papaparse": "^5.4.1",
|
|
101
101
|
"re-resizable": "6.9.17",
|
|
102
102
|
"react-d3-utils": "^1.0.0",
|
|
103
103
|
"react-dropzone": "^14.2.3",
|
|
104
104
|
"react-error-boundary": "^4.0.13",
|
|
105
|
-
"react-hook-form": "^7.52.
|
|
105
|
+
"react-hook-form": "^7.52.2",
|
|
106
106
|
"react-icons": "^5.2.1",
|
|
107
107
|
"react-inspector": "^6.0.2",
|
|
108
108
|
"react-mf": "^2.0.3",
|
|
109
109
|
"react-ocl": "^6.1.0",
|
|
110
110
|
"react-ocl-nmr": "^3.0.2",
|
|
111
|
-
"react-plot": "^
|
|
112
|
-
"react-rnd": "^10.4.
|
|
113
|
-
"react-science": "^
|
|
111
|
+
"react-plot": "^2.0.0",
|
|
112
|
+
"react-rnd": "^10.4.12",
|
|
113
|
+
"react-science": "^6.0.0",
|
|
114
114
|
"react-table": "^7.8.0",
|
|
115
115
|
"react-transition-group": "^4.4.5",
|
|
116
|
-
"react-use": "^17.5.
|
|
116
|
+
"react-use": "^17.5.1",
|
|
117
117
|
"smart-array-filter": "^4.0.2",
|
|
118
118
|
"yup": "^1.4.0"
|
|
119
119
|
},
|
|
120
120
|
"devDependencies": {
|
|
121
|
-
"@babel/plugin-transform-modules-commonjs": "^7.24.
|
|
121
|
+
"@babel/plugin-transform-modules-commonjs": "^7.24.8",
|
|
122
122
|
"@babel/preset-react": "^7.24.7",
|
|
123
123
|
"@babel/preset-typescript": "^7.24.7",
|
|
124
|
-
"@playwright/test": "^1.
|
|
124
|
+
"@playwright/test": "^1.46.0",
|
|
125
125
|
"@simbathesailor/use-what-changed": "^2.0.0",
|
|
126
126
|
"@types/d3": "^7.4.3",
|
|
127
|
-
"@types/lodash": "^4.17.
|
|
128
|
-
"@types/node": "^
|
|
127
|
+
"@types/lodash": "^4.17.7",
|
|
128
|
+
"@types/node": "^22.1.0",
|
|
129
129
|
"@types/papaparse": "^5.3.14",
|
|
130
130
|
"@types/react": "^18.3.3",
|
|
131
131
|
"@types/react-dom": "^18.3.0",
|
|
132
132
|
"@types/react-table": "^7.7.20",
|
|
133
133
|
"@vitejs/plugin-react-swc": "^3.7.0",
|
|
134
|
-
"@vitest/coverage-v8": "^2.0.
|
|
134
|
+
"@vitest/coverage-v8": "^2.0.5",
|
|
135
135
|
"cross-env": "^7.0.3",
|
|
136
|
-
"cspell": "^8.
|
|
136
|
+
"cspell": "^8.13.2",
|
|
137
137
|
"eslint": "^8.57.0",
|
|
138
|
-
"eslint-config-cheminfo-react": "^
|
|
139
|
-
"eslint-config-cheminfo-typescript": "^
|
|
138
|
+
"eslint-config-cheminfo-react": "^13.0.0",
|
|
139
|
+
"eslint-config-cheminfo-typescript": "^15.0.0",
|
|
140
140
|
"modern-normalize": "^2.0.0",
|
|
141
141
|
"postcss-styled-syntax": "^0.6.4",
|
|
142
|
-
"prettier": "^3.3.
|
|
142
|
+
"prettier": "^3.3.3",
|
|
143
143
|
"rc-menu": "^9.14.1",
|
|
144
144
|
"react": "^18.3.1",
|
|
145
145
|
"react-dom": "^18.3.1",
|
|
146
|
-
"react-router-dom": "^6.
|
|
146
|
+
"react-router-dom": "^6.26.0",
|
|
147
147
|
"rimraf": "^6.0.1",
|
|
148
148
|
"rollup-plugin-analyzer": "^4.0.0",
|
|
149
149
|
"serve": "^14.2.3",
|
|
150
|
-
"stylelint": "^16.
|
|
150
|
+
"stylelint": "^16.8.1",
|
|
151
151
|
"stylelint-config-standard": "^36.0.1",
|
|
152
|
-
"typescript": "^5.5.
|
|
153
|
-
"vite": "^5.
|
|
154
|
-
"vitest": "^2.0.
|
|
152
|
+
"typescript": "^5.5.4",
|
|
153
|
+
"vite": "^5.4.0",
|
|
154
|
+
"vitest": "^2.0.5"
|
|
155
155
|
}
|
|
156
156
|
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Spectrum1D } from 'nmr-load-save';
|
|
2
|
-
import { NMRRange } from 'nmr-processing';
|
|
3
|
-
import { UsedColors } from '../../../../types/UsedColors';
|
|
4
|
-
export interface ResurrectSpectrumInfo {
|
|
5
|
-
nucleus: string;
|
|
6
|
-
solvent: string;
|
|
7
|
-
name?: string;
|
|
8
|
-
frequency?: number;
|
|
9
|
-
color?: string;
|
|
10
|
-
}
|
|
11
|
-
export declare function generateSpectrumFromRanges(ranges: NMRRange[], info: ResurrectSpectrumInfo, usedColors: UsedColors): Spectrum1D | undefined;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { rangesToXY } from 'nmr-processing';
|
|
2
|
-
import { initiateDatum1D } from '../initiateDatum1D';
|
|
3
|
-
export function generateSpectrumFromRanges(ranges, info, usedColors) {
|
|
4
|
-
const { nucleus, solvent, name = null, frequency = 400 } = info;
|
|
5
|
-
try {
|
|
6
|
-
const { x, y } = rangesToXY(ranges, {
|
|
7
|
-
nucleus,
|
|
8
|
-
frequency,
|
|
9
|
-
nbPoints: 2 ** 17,
|
|
10
|
-
});
|
|
11
|
-
const datum = initiateDatum1D({
|
|
12
|
-
data: { x, im: null, re: y },
|
|
13
|
-
info: {
|
|
14
|
-
nucleus,
|
|
15
|
-
originFrequency: frequency,
|
|
16
|
-
baseFrequency: frequency,
|
|
17
|
-
pulseSequence: '',
|
|
18
|
-
solvent,
|
|
19
|
-
isFt: true,
|
|
20
|
-
name,
|
|
21
|
-
},
|
|
22
|
-
ranges: { values: ranges, options: { sum: 100 } },
|
|
23
|
-
}, { usedColors });
|
|
24
|
-
return datum;
|
|
25
|
-
}
|
|
26
|
-
catch (error) {
|
|
27
|
-
reportError(error);
|
|
28
|
-
}
|
|
29
|
-
}
|