nmrium 0.47.0 → 0.49.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/Chart1D.js +1 -1
- package/lib/component/1d/Line.js +1 -1
- package/lib/component/1d/LinesSeries.d.ts +1 -1
- package/lib/component/1d/LinesSeries.js +24 -3
- package/lib/component/1d/SpectraLegends.js +1 -1
- package/lib/component/1d/Viewer1D.js +144 -124
- package/lib/component/1d/jCouplingGraph/JsCoupling.js +1 -1
- package/lib/component/1d/peaks/Peaks.js +5 -4
- package/lib/component/1d/ranges/Atoms.d.ts +7 -0
- package/lib/component/1d/ranges/Atoms.js +43 -0
- package/lib/component/1d/ranges/Range.js +4 -2
- package/lib/component/1d/tool/BaseLine.d.ts +2 -0
- package/lib/component/1d/tool/BaseLine.js +26 -0
- package/lib/component/1d/tool/BaseLineZones.js +18 -3
- package/lib/component/1d/utilities/scale.d.ts +1 -0
- package/lib/component/1d/utilities/scale.js +2 -1
- package/lib/component/2d/Chart2D.js +6 -4
- package/lib/component/2d/Viewer2D.js +35 -26
- package/lib/component/context/KeyModifierContext.d.ts +14 -3
- package/lib/component/context/KeyModifierContext.js +35 -4
- package/lib/component/context/LoggerContext.d.ts +9 -0
- package/lib/component/context/LoggerContext.js +21 -7
- package/lib/component/context/PreferencesContext.d.ts +1 -108
- package/lib/component/context/TopicMoleculeContext.d.ts +8 -0
- package/lib/component/context/TopicMoleculeContext.js +30 -0
- package/lib/component/elements/Input.js +4 -1
- package/lib/component/elements/ResizerWithScale.js +19 -2
- package/lib/component/elements/SVGGroup.js +2 -2
- package/lib/component/elements/formik/FormikTextarea.js +8 -9
- package/lib/component/elements/linearAxis/LinearVerticalAxis.js +1 -1
- package/lib/component/elements/resizer/SVGResizer.js +1 -1
- package/lib/component/header/BaseLineCorrectionPanel.js +3 -2
- package/lib/component/header/Header.js +2 -2
- package/lib/component/hooks/useCheckToolsVisibility.js +1 -1
- package/lib/component/hooks/useExport.js +2 -2
- package/lib/component/hooks/useSetActiveSpectrumAction.d.ts +3 -0
- package/lib/component/hooks/useSetActiveSpectrumAction.js +16 -0
- package/lib/component/hooks/useToolsFunctions.js +4 -2
- package/lib/component/hooks/useVerticalAlign.d.ts +1 -1
- package/lib/component/main/InnerNMRium.js +3 -2
- package/lib/component/modal/ExportAsJcampModal.js +1 -1
- package/lib/component/modal/ImportPublicationStringModal.d.ts +2 -1
- package/lib/component/modal/ImportPublicationStringModal.js +76 -32
- package/lib/component/modal/editRange/forms/validation/EditRangeValidation.js +2 -4
- package/lib/component/modal/setting/settings-tabs/GeneralTabContent.js +9 -11
- package/lib/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +2 -1
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.d.ts +2 -1
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +6 -5
- package/lib/component/panels/RangesPanel/RangesTable.js +1 -1
- package/lib/component/panels/SpectrumsPanel/SpectraPreferences.js +39 -5
- package/lib/component/panels/SpectrumsPanel/SpectraTable.js +28 -40
- package/lib/component/panels/SpectrumsPanel/SpectrumListPanel.js +4 -2
- package/lib/component/panels/SpectrumsPanel/SpectrumsTabs.js +3 -9
- package/lib/component/panels/SpectrumsPanel/base/RenderAsHTML.d.ts +7 -0
- package/lib/component/panels/SpectrumsPanel/base/RenderAsHTML.js +21 -0
- package/lib/component/panels/SpectrumsPanel/base/SpectraColumnsManager.js +19 -16
- package/lib/component/panels/SpectrumsPanel/base/SpectrumName.js +0 -1
- package/lib/component/panels/databasePanel/DatabasePanel.js +6 -1
- package/lib/component/panels/multipleAnalysisPanel/AnalysisChart.js +1 -1
- package/lib/component/panels/predictionPanel/PredictionPanel.js +3 -1
- package/lib/component/panels/spectrumSimulation/SpectrumSimulation.js +15 -4
- package/lib/component/reducer/Reducer.js +2 -0
- package/lib/component/reducer/actions/DomainActions.d.ts +2 -2
- package/lib/component/reducer/actions/DomainActions.js +2 -2
- package/lib/component/reducer/actions/FiltersActions.d.ts +3 -4
- package/lib/component/reducer/actions/FiltersActions.js +93 -57
- package/lib/component/reducer/actions/LoadActions.js +10 -8
- package/lib/component/reducer/actions/SpectrumsActions.d.ts +8 -1
- package/lib/component/reducer/actions/SpectrumsActions.js +8 -4
- package/lib/component/reducer/actions/ToolsActions.d.ts +8 -5
- package/lib/component/reducer/actions/ToolsActions.js +51 -44
- package/lib/component/reducer/helper/getVerticalAlign.d.ts +1 -1
- package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js +0 -4
- package/lib/component/toolbar/BasicToolBar.js +11 -29
- package/lib/component/utility/export.d.ts +3 -2
- package/lib/component/utility/export.js +45 -26
- package/lib/component/workspaces/exercise.js +1 -0
- package/lib/component/workspaces/prediction.js +1 -16
- package/lib/component/workspaces/simulation.js +1 -2
- package/lib/component/workspaces/workspaceDefaultProperties.js +4 -3
- package/lib/data/data1d/Spectrum1D/index.d.ts +0 -1
- package/lib/data/data1d/Spectrum1D/index.js +0 -1
- package/lib/data/data1d/multipleSpectraAnalysis.js +27 -40
- package/lib/data/data2d/Spectrum2D/getMissingProjection.js +10 -1
- package/lib/versionInfo.js +1 -1
- package/package.json +31 -30
- package/lib/data/data1d/Spectrum1D/generateSpectrumFromPublicationString.d.ts +0 -2
- package/lib/data/data1d/Spectrum1D/generateSpectrumFromPublicationString.js +0 -6
|
@@ -99,15 +99,19 @@ export function generateAnalyzeSpectra(multipleSpectraAnalysis, spectra, nucleus
|
|
|
99
99
|
const newData = Object.fromEntries(Object.entries(data).map((spectra) => {
|
|
100
100
|
const result = Object.fromEntries(Object.keys(columns).map((key) => {
|
|
101
101
|
const isFormula = columns[key].type === AnalysisColumnsTypes.FORMULA;
|
|
102
|
-
|
|
103
|
-
key
|
|
104
|
-
|
|
105
|
-
|
|
102
|
+
if (isFormula) {
|
|
103
|
+
const { SID, id } = spectra[1][key];
|
|
104
|
+
return [
|
|
105
|
+
key,
|
|
106
|
+
{
|
|
107
|
+
SID,
|
|
108
|
+
id,
|
|
106
109
|
colKey: key,
|
|
107
110
|
value: calculate(columns, data[spectra[0]], columns[key].formula),
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
+
},
|
|
112
|
+
];
|
|
113
|
+
}
|
|
114
|
+
return [key, { ...spectra[1][key], colKey: key }];
|
|
111
115
|
}));
|
|
112
116
|
return [spectra[0], result];
|
|
113
117
|
}));
|
|
@@ -147,52 +151,35 @@ export function getDataAsString(spectraAnalysis, spectra, spectraPanelPreference
|
|
|
147
151
|
const spectraData = convertSpectraArrayToObject(spectra);
|
|
148
152
|
if (spectraAnalysis) {
|
|
149
153
|
const { values, options: { columns }, } = spectraAnalysis;
|
|
150
|
-
|
|
154
|
+
//columns labels
|
|
155
|
+
const letters = Object.keys(columns);
|
|
156
|
+
const columnsLabels = letters.slice();
|
|
157
|
+
let index = 0;
|
|
151
158
|
// listed the spectra panel columns
|
|
152
159
|
for (const col of spectraPanelPreferences.columns) {
|
|
153
|
-
if (col.visible) {
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
result += `${col.label}\t`;
|
|
157
|
-
}
|
|
160
|
+
if (col.visible && 'jpath' in col) {
|
|
161
|
+
columnsLabels.splice(index, 0, col.label);
|
|
162
|
+
index++;
|
|
158
163
|
}
|
|
159
164
|
}
|
|
160
|
-
|
|
161
|
-
// listed the spectra analysis panel columns
|
|
162
|
-
for (const letter of letters) {
|
|
163
|
-
result += `${letter}\t`;
|
|
164
|
-
}
|
|
165
|
-
result += '\n';
|
|
165
|
+
let result = `${columnsLabels.join('\t')}\n`;
|
|
166
166
|
for (const spectrumAnalysis of Object.values(values)) {
|
|
167
167
|
const spectrum = spectraData[spectrumAnalysis[letters[0]].SID];
|
|
168
|
+
const cellsValues = [];
|
|
168
169
|
// listed the spectra cell values
|
|
169
170
|
for (const col of spectraPanelPreferences.columns) {
|
|
170
|
-
if (col.visible) {
|
|
171
|
-
const
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
switch (name) {
|
|
175
|
-
case 'name':
|
|
176
|
-
result += `${spectrum.info.name}\t`;
|
|
177
|
-
break;
|
|
178
|
-
case 'solvent':
|
|
179
|
-
result += `${spectrum.info.solvent || `null`}\t`;
|
|
180
|
-
break;
|
|
181
|
-
default:
|
|
182
|
-
break;
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
else {
|
|
186
|
-
const path = col?.jpath;
|
|
187
|
-
result += `${lodashGet(spectrum, path, `null`)}\t`;
|
|
188
|
-
}
|
|
171
|
+
if (col.visible && 'jpath' in col) {
|
|
172
|
+
const jpath = col?.jpath;
|
|
173
|
+
const value = lodashGet(spectrum, jpath, `null`);
|
|
174
|
+
cellsValues.push(value);
|
|
189
175
|
}
|
|
190
176
|
}
|
|
191
177
|
// listed the spectra analysis cell values
|
|
192
178
|
for (const letter of letters) {
|
|
193
|
-
|
|
179
|
+
const value = spectrumAnalysis[letter][columns[letter].valueKey];
|
|
180
|
+
cellsValues.push(value);
|
|
194
181
|
}
|
|
195
|
-
result += '\n
|
|
182
|
+
result += `${cellsValues.join('\t')}\n`;
|
|
196
183
|
}
|
|
197
184
|
return result;
|
|
198
185
|
}
|
|
@@ -33,7 +33,9 @@ export function getMissingProjection(datum, nucleus, datumInfo, usedColors) {
|
|
|
33
33
|
if (index === -1)
|
|
34
34
|
index = 0;
|
|
35
35
|
const info = {
|
|
36
|
-
|
|
36
|
+
...getInfo(datumInfo, index),
|
|
37
|
+
experiment: '1d',
|
|
38
|
+
pulseSequence: 'projection',
|
|
37
39
|
isFid: false,
|
|
38
40
|
isComplex: false, // if isComplex is true that mean it contains real/ imaginary x set, if not hid re/im button .
|
|
39
41
|
dimension: 1,
|
|
@@ -41,3 +43,10 @@ export function getMissingProjection(datum, nucleus, datumInfo, usedColors) {
|
|
|
41
43
|
const data = getProjection(datum, index);
|
|
42
44
|
return initiateDatum1D({ info, data }, { usedColors });
|
|
43
45
|
}
|
|
46
|
+
function getInfo(info, index) {
|
|
47
|
+
const newInfo = {};
|
|
48
|
+
for (const key in info) {
|
|
49
|
+
newInfo[key] = Array.isArray(info[key]) ? info[key][index] : info[key];
|
|
50
|
+
}
|
|
51
|
+
return newInfo;
|
|
52
|
+
}
|
package/lib/versionInfo.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default { version: 'v0.
|
|
1
|
+
export default { version: 'v0.49.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.49.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"module": "lib/component/main/index.js",
|
|
7
7
|
"types": "lib/component/main/index.d.ts",
|
|
@@ -23,6 +23,7 @@
|
|
|
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",
|
|
26
|
+
"playwright": "playwright test --ui",
|
|
26
27
|
"prepack": "npm run clean-lib && npm run compile",
|
|
27
28
|
"prepublishOnly": "npm run set-version-npm",
|
|
28
29
|
"prettier": "prettier --check src test-e2e",
|
|
@@ -45,7 +46,7 @@
|
|
|
45
46
|
"url": "git+https://github.com/cheminfo/nmrium.git"
|
|
46
47
|
},
|
|
47
48
|
"volta": {
|
|
48
|
-
"node": "20.
|
|
49
|
+
"node": "20.11.0"
|
|
49
50
|
},
|
|
50
51
|
"overrides": {
|
|
51
52
|
"react": "$react",
|
|
@@ -56,20 +57,20 @@
|
|
|
56
57
|
"react-dom": ">=18.0.0"
|
|
57
58
|
},
|
|
58
59
|
"dependencies": {
|
|
59
|
-
"@blueprintjs/core": "^5.
|
|
60
|
-
"@blueprintjs/icons": "^5.
|
|
61
|
-
"@emotion/react": "^11.11.
|
|
60
|
+
"@blueprintjs/core": "^5.9.1",
|
|
61
|
+
"@blueprintjs/icons": "^5.7.1",
|
|
62
|
+
"@emotion/react": "^11.11.3",
|
|
62
63
|
"@emotion/styled": "^11.11.0",
|
|
63
64
|
"@lukeed/uuid": "^2.0.1",
|
|
64
|
-
"cheminfo-font": "^1.
|
|
65
|
+
"cheminfo-font": "^1.13.0",
|
|
65
66
|
"cheminfo-types": "^1.7.2",
|
|
66
|
-
"clipboard-polyfill": "^4.0.
|
|
67
|
+
"clipboard-polyfill": "^4.0.2",
|
|
67
68
|
"convert-to-jcamp": "^5.4.9",
|
|
68
69
|
"d3": "^7.8.5",
|
|
69
70
|
"eventemitter3": "^5.0.1",
|
|
70
71
|
"fifo-logger": "^0.6.1",
|
|
71
72
|
"file-saver": "^2.0.5",
|
|
72
|
-
"filelist-utils": "^1.
|
|
73
|
+
"filelist-utils": "^1.11.0",
|
|
73
74
|
"formik": "^2.4.5",
|
|
74
75
|
"immer": "^10.0.3",
|
|
75
76
|
"jszip": "^3.10.1",
|
|
@@ -82,22 +83,22 @@
|
|
|
82
83
|
"ml-conrec": "^5.0.2",
|
|
83
84
|
"ml-gsd": "^12.1.3",
|
|
84
85
|
"ml-matrix": "^6.11.0",
|
|
85
|
-
"ml-spectra-processing": "^12.
|
|
86
|
+
"ml-spectra-processing": "^12.10.1",
|
|
86
87
|
"ml-stat": "^1.3.3",
|
|
87
88
|
"multiplet-analysis": "^2.1.2",
|
|
88
89
|
"nmr-correlation": "^2.3.3",
|
|
89
|
-
"nmr-load-save": "^0.
|
|
90
|
-
"nmr-processing": "^11.
|
|
90
|
+
"nmr-load-save": "^0.26.0",
|
|
91
|
+
"nmr-processing": "^11.10.0",
|
|
91
92
|
"nmredata": "^0.9.9",
|
|
92
93
|
"numeral": "^2.0.6",
|
|
93
|
-
"openchemlib": "^8.
|
|
94
|
-
"openchemlib-utils": "^5.
|
|
94
|
+
"openchemlib": "^8.8.1",
|
|
95
|
+
"openchemlib-utils": "^5.8.0",
|
|
95
96
|
"papaparse": "^5.4.1",
|
|
96
97
|
"re-resizable": "6.9.11",
|
|
97
98
|
"react-d3-utils": "^1.0.0",
|
|
98
99
|
"react-dropzone": "^14.2.3",
|
|
99
100
|
"react-error-boundary": "^4.0.12",
|
|
100
|
-
"react-icons": "^
|
|
101
|
+
"react-icons": "^5.0.1",
|
|
101
102
|
"react-inspector": "^6.0.2",
|
|
102
103
|
"react-mf": "^2.0.2",
|
|
103
104
|
"react-ocl": "^6.1.0",
|
|
@@ -108,7 +109,7 @@
|
|
|
108
109
|
"react-slider": "^2.0.6",
|
|
109
110
|
"react-table": "^7.8.0",
|
|
110
111
|
"react-transition-group": "^4.4.5",
|
|
111
|
-
"react-use": "^17.
|
|
112
|
+
"react-use": "^17.5.0",
|
|
112
113
|
"smart-array-filter": "^4.0.2",
|
|
113
114
|
"yup": "^1.3.3"
|
|
114
115
|
},
|
|
@@ -116,36 +117,36 @@
|
|
|
116
117
|
"@babel/plugin-transform-modules-commonjs": "^7.23.3",
|
|
117
118
|
"@babel/preset-react": "^7.23.3",
|
|
118
119
|
"@babel/preset-typescript": "^7.23.3",
|
|
119
|
-
"@playwright/test": "^1.
|
|
120
|
+
"@playwright/test": "^1.41.2",
|
|
120
121
|
"@simbathesailor/use-what-changed": "^2.0.0",
|
|
121
122
|
"@types/d3": "^7.4.3",
|
|
122
123
|
"@types/lodash": "^4.14.202",
|
|
123
|
-
"@types/node": "^20.
|
|
124
|
+
"@types/node": "^20.11.16",
|
|
124
125
|
"@types/papaparse": "^5.3.14",
|
|
125
|
-
"@types/react": "^18.2.
|
|
126
|
+
"@types/react": "^18.2.51",
|
|
126
127
|
"@types/react-dom": "^18.2.18",
|
|
127
|
-
"@types/react-table": "^7.7.
|
|
128
|
-
"@vitejs/plugin-react-swc": "^3.
|
|
129
|
-
"@vitest/coverage-v8": "^1.
|
|
128
|
+
"@types/react-table": "^7.7.19",
|
|
129
|
+
"@vitejs/plugin-react-swc": "^3.6.0",
|
|
130
|
+
"@vitest/coverage-v8": "^1.2.2",
|
|
130
131
|
"cross-env": "^7.0.3",
|
|
131
|
-
"cspell": "^8.
|
|
132
|
+
"cspell": "^8.3.2",
|
|
132
133
|
"eslint": "^8.56.0",
|
|
133
134
|
"eslint-config-cheminfo-react": "^10.1.0",
|
|
134
135
|
"eslint-config-cheminfo-typescript": "^12.1.0",
|
|
135
136
|
"modern-normalize": "^2.0.0",
|
|
136
|
-
"postcss-styled-syntax": "^0.
|
|
137
|
-
"prettier": "^3.
|
|
137
|
+
"postcss-styled-syntax": "^0.6.4",
|
|
138
|
+
"prettier": "^3.2.4",
|
|
138
139
|
"rc-menu": "^9.12.4",
|
|
139
140
|
"react": "^18.2.0",
|
|
140
141
|
"react-dom": "^18.2.0",
|
|
141
|
-
"react-router-dom": "^6.
|
|
142
|
+
"react-router-dom": "^6.22.0",
|
|
142
143
|
"rimraf": "^5.0.5",
|
|
143
144
|
"rollup-plugin-analyzer": "^4.0.0",
|
|
144
145
|
"serve": "^14.2.1",
|
|
145
|
-
"stylelint": "^16.
|
|
146
|
-
"stylelint-config-standard": "^
|
|
146
|
+
"stylelint": "^16.2.1",
|
|
147
|
+
"stylelint-config-standard": "^36.0.0",
|
|
147
148
|
"typescript": "^5.3.3",
|
|
148
|
-
"vite": "^5.0.
|
|
149
|
-
"vitest": "^1.
|
|
149
|
+
"vite": "^5.0.12",
|
|
150
|
+
"vitest": "^1.2.2"
|
|
150
151
|
}
|
|
151
|
-
}
|
|
152
|
+
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { resurrect } from 'nmr-processing';
|
|
2
|
-
import { generateSpectrumFromRanges } from './ranges/generateSpectrumFromRanges';
|
|
3
|
-
export function generateSpectrumFromPublicationString(publicationString, usedColors) {
|
|
4
|
-
const { ranges, experiment: { nucleus, solvent }, parts, } = resurrect(publicationString);
|
|
5
|
-
return generateSpectrumFromRanges(ranges, { nucleus, solvent, name: parts[0] }, usedColors);
|
|
6
|
-
}
|