nmrium 0.52.0 → 0.53.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/ranges/AssignmentLabel.d.ts +7 -0
- package/lib/component/1d/ranges/AssignmentLabel.js +10 -0
- package/lib/component/1d/ranges/Range.js +2 -1
- package/lib/component/elements/EditableColumn.js +3 -3
- package/lib/component/hooks/useActiveSpectrumRangesViewState.js +1 -0
- package/lib/component/hooks/useActiveSpectrumZonesViewState.js +1 -0
- package/lib/component/hooks/useToolsFunctions.js +7 -1
- package/lib/component/main/NMRiumStateProvider.js +1 -1
- package/lib/component/modal/ImportPublicationStringModal.d.ts +5 -3
- package/lib/component/modal/ImportPublicationStringModal.js +7 -4
- package/lib/component/panels/RangesPanel/RangesHeader.js +21 -7
- package/lib/component/panels/RangesPanel/RangesPreferences.js +8 -2
- package/lib/component/panels/RangesPanel/RangesTable.js +1 -1
- package/lib/component/panels/RangesPanel/RangesTableRow.js +2 -1
- package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentColumn.d.ts +7 -0
- package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentColumn.js +16 -0
- package/lib/component/panels/spectrumSimulation/SpectrumSimulation.js +8 -1
- package/lib/component/panels/spectrumSimulation/SpectrumSimulationSimpleOptions.js +1 -1
- package/lib/component/panels/spectrumSimulation/SpinSystemTable.js +1 -1
- package/lib/component/reducer/Reducer.js +2 -0
- package/lib/component/reducer/actions/FiltersActions.js +337 -317
- package/lib/component/reducer/actions/RangesActions.d.ts +7 -2
- package/lib/component/reducer/actions/RangesActions.js +16 -2
- package/lib/component/reducer/actions/ToolsActions.js +13 -20
- package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js +6 -4
- package/lib/component/toolbar/ToolBar.js +1 -1
- package/lib/component/utility/export.js +1 -1
- package/lib/versionInfo.js +1 -1
- package/package.json +15 -15
|
@@ -70,7 +70,11 @@ type ToggleRangesViewAction = ActionType<'TOGGLE_RANGES_VIEW_PROPERTY', {
|
|
|
70
70
|
type DeleteRangePeakAction = ActionType<'DELETE_RANGE_PEAK', {
|
|
71
71
|
id: string;
|
|
72
72
|
}>;
|
|
73
|
-
|
|
73
|
+
type ChangeRangeAssignmentLabelAction = ActionType<'CHANGE_RANGE_ASSIGNMENT_LABEL', {
|
|
74
|
+
rangeID: string;
|
|
75
|
+
value: string;
|
|
76
|
+
}>;
|
|
77
|
+
export type RangesActions = AutoRangesDetectionAction | DeleteRangeAction | ChangeRangeSignalKindAction | SaveEditedRangeAction | DeleteSignalAction | UnlinkRangeAction | SetDiaIDRangeAction | ResizeRangeAction | ChangeRangeSumAction | AddRangeAction | ChangeRangeRelativeValueAction | ChangeRangeSignalValueAction | UpdateRangAction | CutRangAction | ToggleRangesViewAction | DeleteRangePeakAction | ChangeRangeAssignmentLabelAction | ActionType<'AUTO_RANGES_SPECTRA_PICKING' | 'CHANGE_RANGES_SUM_FLAG' | 'TOGGLE_RANGES_PEAKS_DISPLAYING_MODE'>;
|
|
74
78
|
declare function handleAutoRangesDetection(draft: Draft<State>, action: AutoRangesDetectionAction): void;
|
|
75
79
|
declare function handleAutoSpectraRangesDetection(draft: Draft<State>): void;
|
|
76
80
|
declare function handleDeleteRange(draft: Draft<State>, action: DeleteRangeAction): void;
|
|
@@ -92,4 +96,5 @@ declare function handleToggleRangesViewProperty(draft: Draft<State>, action: Tog
|
|
|
92
96
|
declare function handleCutRange(draft: Draft<State>, action: CutRangAction): void;
|
|
93
97
|
declare function handleChangePeaksDisplayingMode(draft: Draft<State>): void;
|
|
94
98
|
declare function handleDeleteRangePeak(draft: Draft<State>, action: DeleteRangePeakAction): void;
|
|
95
|
-
|
|
99
|
+
declare function handleChangeRangeAssignmentLabel(draft: Draft<State>, action: ChangeRangeAssignmentLabelAction): void;
|
|
100
|
+
export { handleCutRange, handleAutoRangesDetection, handleDeleteRange, deleteSignal1D, handleDeleteSignal, handleChangeRangeSum, handleAddRange, handleResizeRange, handleChangeRangeRelativeValue, handleChangeRangeSignalValue, handleChangeRangeSignalKind, handleSaveEditedRange, handleUnlinkRange, unlinkRange, handleSetDiaIDRange, handleChangeRangesSumFlag, handleUpdateRange, handleAutoSpectraRangesDetection, handleToggleRangesViewProperty, handleChangePeaksDisplayingMode, handleDeleteRangePeak, handleChangeRangeAssignmentLabel, };
|
|
@@ -4,7 +4,7 @@ import cloneDeep from 'lodash/cloneDeep';
|
|
|
4
4
|
import { xFindClosestIndex } from 'ml-spectra-processing';
|
|
5
5
|
import { Filters, FiltersManager } from 'nmr-processing';
|
|
6
6
|
import { DATUM_KIND, SIGNAL_INLCUDED_KINDS, } from '../../../data/constants/signalsKinds';
|
|
7
|
-
import { addRange, changeRangeSignal, detectRanges, updateRangesRelativeValues, changeRange, changeRangeRelativeValue, } from '../../../data/data1d/Spectrum1D';
|
|
7
|
+
import { addRange, changeRangeSignal, detectRanges, updateRangesRelativeValues, changeRange, changeRangeRelativeValue, isSpectrum1D, } from '../../../data/data1d/Spectrum1D';
|
|
8
8
|
import { initSumOptions, setSumOptions, } from '../../../data/data1d/Spectrum1D/SumManager';
|
|
9
9
|
import { unlink, unlinkInAssignmentData, } from '../../../data/utilities/RangeUtilities';
|
|
10
10
|
import { getActiveSpectrum } from '../helper/getActiveSpectrum';
|
|
@@ -366,4 +366,18 @@ function handleDeleteRangePeak(draft, action) {
|
|
|
366
366
|
}
|
|
367
367
|
}
|
|
368
368
|
}
|
|
369
|
-
|
|
369
|
+
function handleChangeRangeAssignmentLabel(draft, action) {
|
|
370
|
+
const { rangeID, value } = action.payload;
|
|
371
|
+
const activeSpectrum = getActiveSpectrum(draft);
|
|
372
|
+
if (activeSpectrum?.id) {
|
|
373
|
+
const { index } = activeSpectrum;
|
|
374
|
+
const spectrum = draft.data[index];
|
|
375
|
+
if (isSpectrum1D(spectrum)) {
|
|
376
|
+
const range = spectrum.ranges.values.find((range) => range.id === rangeID);
|
|
377
|
+
if (range) {
|
|
378
|
+
range.assignment = value;
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
export { handleCutRange, handleAutoRangesDetection, handleDeleteRange, deleteSignal1D, handleDeleteSignal, handleChangeRangeSum, handleAddRange, handleResizeRange, handleChangeRangeRelativeValue, handleChangeRangeSignalValue, handleChangeRangeSignalKind, handleSaveEditedRange, handleUnlinkRange, unlinkRange, handleSetDiaIDRange, handleChangeRangesSumFlag, handleUpdateRange, handleAutoSpectraRangesDetection, handleToggleRangesViewProperty, handleChangePeaksDisplayingMode, handleDeleteRangePeak, handleChangeRangeAssignmentLabel, };
|
|
@@ -215,9 +215,9 @@ function handleZoom(draft, action) {
|
|
|
215
215
|
const { options, trackID } = action.payload;
|
|
216
216
|
const { displayerMode, yDomains, toolOptions: { selectedTool }, } = draft;
|
|
217
217
|
const scaleRatio = toScaleRatio(options);
|
|
218
|
+
const { altKey, shiftKey } = options;
|
|
218
219
|
switch (displayerMode) {
|
|
219
220
|
case '2D': {
|
|
220
|
-
const { shiftKey } = options;
|
|
221
221
|
if (trackID === 'CENTER_2D') {
|
|
222
222
|
// change the vertical scale for traces in 2D phase correction
|
|
223
223
|
if (selectedTool === 'phaseCorrectionTwoDimensions') {
|
|
@@ -226,7 +226,7 @@ function handleZoom(draft, action) {
|
|
|
226
226
|
return;
|
|
227
227
|
}
|
|
228
228
|
//zoom in/out in 2d
|
|
229
|
-
if (
|
|
229
|
+
if (shiftKey) {
|
|
230
230
|
zoomWithScroll(draft, {
|
|
231
231
|
zoomOptions: options,
|
|
232
232
|
dimension: '2D',
|
|
@@ -249,21 +249,13 @@ function handleZoom(draft, action) {
|
|
|
249
249
|
}
|
|
250
250
|
case '1D': {
|
|
251
251
|
const activeSpectra = getActiveSpectra(draft);
|
|
252
|
-
const { shiftKey } = options;
|
|
253
252
|
// Horizontal zoom in/out 1d spectra by mouse wheel
|
|
254
|
-
if (
|
|
253
|
+
if (shiftKey) {
|
|
255
254
|
zoomWithScroll(draft, { zoomOptions: options, dimension: '1D' });
|
|
256
255
|
return;
|
|
257
256
|
}
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
for (const key of Object.keys(yDomains)) {
|
|
261
|
-
const domain = yDomains[key];
|
|
262
|
-
yDomains[key] = wheelZoom(options, domain);
|
|
263
|
-
}
|
|
264
|
-
return;
|
|
265
|
-
}
|
|
266
|
-
if (activeSpectra.length === 1 && shiftKey) {
|
|
257
|
+
// rescale the integral in ranges and integrals
|
|
258
|
+
if (altKey && activeSpectra?.length === 1) {
|
|
267
259
|
switch (selectedTool) {
|
|
268
260
|
case 'rangePicking': {
|
|
269
261
|
setRangesViewProperty(draft, 'integralsScaleRatio', (scale) => scale * scaleRatio);
|
|
@@ -276,14 +268,15 @@ function handleZoom(draft, action) {
|
|
|
276
268
|
default:
|
|
277
269
|
break;
|
|
278
270
|
}
|
|
271
|
+
return;
|
|
279
272
|
}
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
273
|
+
// reselect the spectra vertically
|
|
274
|
+
const keys = !activeSpectra
|
|
275
|
+
? Object.keys(yDomains)
|
|
276
|
+
: activeSpectra.map(({ id }) => id);
|
|
277
|
+
for (const key of keys) {
|
|
278
|
+
const domain = yDomains[key];
|
|
279
|
+
yDomains[key] = wheelZoom(options, domain);
|
|
287
280
|
}
|
|
288
281
|
break;
|
|
289
282
|
}
|
|
@@ -64,21 +64,22 @@ const getZoneDefaultValues = (nucleus) => {
|
|
|
64
64
|
return { nuclei: {} };
|
|
65
65
|
}
|
|
66
66
|
if (is2DNucleus(nucleus)) {
|
|
67
|
-
const
|
|
67
|
+
const preferences2D = {
|
|
68
68
|
showSerialNumber: true,
|
|
69
69
|
showKind: true,
|
|
70
70
|
showDeleteAction: true,
|
|
71
71
|
showZoomAction: true,
|
|
72
72
|
showEditAction: true,
|
|
73
73
|
showAssignment: true,
|
|
74
|
+
showAssignmentLabel: false,
|
|
74
75
|
};
|
|
75
|
-
return { ...common, ...getPreferences(
|
|
76
|
+
return { ...common, ...getPreferences(preferences2D, nucleus) };
|
|
76
77
|
}
|
|
77
78
|
else {
|
|
78
|
-
const
|
|
79
|
+
const preferences1D = {
|
|
79
80
|
deltaPPM: { show: true, format: '0.00' },
|
|
80
81
|
};
|
|
81
|
-
return { ...common, ...getPreferences(
|
|
82
|
+
return { ...common, ...getPreferences(preferences1D, nucleus) };
|
|
82
83
|
}
|
|
83
84
|
};
|
|
84
85
|
const getRangeDefaultValues = (nucleus) => {
|
|
@@ -98,6 +99,7 @@ const getRangeDefaultValues = (nucleus) => {
|
|
|
98
99
|
showDeleteAction: true,
|
|
99
100
|
showZoomAction: true,
|
|
100
101
|
showEditAction: true,
|
|
102
|
+
showAssignmentLabel: false,
|
|
101
103
|
};
|
|
102
104
|
return getPreferences(preferences, nucleus);
|
|
103
105
|
};
|
|
@@ -15,7 +15,7 @@ import { useDialogToggle } from '../hooks/useDialogToggle';
|
|
|
15
15
|
import useExport from '../hooks/useExport';
|
|
16
16
|
import useToolsFunctions from '../hooks/useToolsFunctions';
|
|
17
17
|
import { useVerticalAlign } from '../hooks/useVerticalAlign';
|
|
18
|
-
import ImportPublicationStringModal from '../modal/ImportPublicationStringModal';
|
|
18
|
+
import { ImportPublicationStringModal } from '../modal/ImportPublicationStringModal';
|
|
19
19
|
import { LoadJCAMPModal } from '../modal/LoadJCAMPModal';
|
|
20
20
|
import SaveAsModal from '../modal/SaveAsModal';
|
|
21
21
|
import { MetaImportationModal } from '../modal/metaImportation/MetaImportationModal';
|
|
@@ -167,7 +167,7 @@ async function copyPNGToClipboard(rootRef, elementID, css) {
|
|
|
167
167
|
catch (error) {
|
|
168
168
|
if (error instanceof ReferenceError) {
|
|
169
169
|
// eslint-disable-next-line no-alert
|
|
170
|
-
alert('Your browser does not support this feature, please use Google Chrome or Firefox');
|
|
170
|
+
window.alert('Your browser does not support this feature, please use Google Chrome or Firefox');
|
|
171
171
|
}
|
|
172
172
|
// TODO: handle error.
|
|
173
173
|
reportError(error);
|
package/lib/versionInfo.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default { version: 'v0.
|
|
1
|
+
export default { version: 'v0.53.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.53.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"module": "lib/component/main/index.js",
|
|
7
7
|
"types": "lib/component/main/index.d.ts",
|
|
@@ -57,9 +57,9 @@
|
|
|
57
57
|
"react-dom": ">=18.0.0"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@blueprintjs/core": "^5.10.
|
|
61
|
-
"@blueprintjs/icons": "^5.
|
|
62
|
-
"@blueprintjs/select": "^5.1.
|
|
60
|
+
"@blueprintjs/core": "^5.10.1",
|
|
61
|
+
"@blueprintjs/icons": "^5.9.0",
|
|
62
|
+
"@blueprintjs/select": "^5.1.3",
|
|
63
63
|
"@emotion/react": "^11.11.4",
|
|
64
64
|
"@emotion/styled": "^11.11.0",
|
|
65
65
|
"@lukeed/uuid": "^2.0.1",
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
"ml-tree-similarity": "^2.2.0",
|
|
91
91
|
"multiplet-analysis": "^2.1.2",
|
|
92
92
|
"nmr-correlation": "^2.3.3",
|
|
93
|
-
"nmr-load-save": "^0.
|
|
93
|
+
"nmr-load-save": "^0.29.1",
|
|
94
94
|
"nmr-processing": "^12.0.1",
|
|
95
95
|
"nmredata": "^0.9.9",
|
|
96
96
|
"numeral": "^2.0.6",
|
|
@@ -117,24 +117,24 @@
|
|
|
117
117
|
"yup": "^1.4.0"
|
|
118
118
|
},
|
|
119
119
|
"devDependencies": {
|
|
120
|
-
"@babel/plugin-transform-modules-commonjs": "^7.
|
|
121
|
-
"@babel/preset-react": "^7.
|
|
122
|
-
"@babel/preset-typescript": "^7.
|
|
120
|
+
"@babel/plugin-transform-modules-commonjs": "^7.24.1",
|
|
121
|
+
"@babel/preset-react": "^7.24.1",
|
|
122
|
+
"@babel/preset-typescript": "^7.24.1",
|
|
123
123
|
"@playwright/test": "^1.42.1",
|
|
124
124
|
"@simbathesailor/use-what-changed": "^2.0.0",
|
|
125
125
|
"@types/d3": "^7.4.3",
|
|
126
126
|
"@types/lodash": "^4.17.0",
|
|
127
|
-
"@types/node": "^20.11.
|
|
127
|
+
"@types/node": "^20.11.30",
|
|
128
128
|
"@types/papaparse": "^5.3.14",
|
|
129
|
-
"@types/react": "^18.2.
|
|
129
|
+
"@types/react": "^18.2.67",
|
|
130
130
|
"@types/react-dom": "^18.2.22",
|
|
131
|
-
"@types/react-table": "^7.7.
|
|
131
|
+
"@types/react-table": "^7.7.20",
|
|
132
132
|
"@vitejs/plugin-react-swc": "^3.6.0",
|
|
133
133
|
"@vitest/coverage-v8": "^1.4.0",
|
|
134
134
|
"cross-env": "^7.0.3",
|
|
135
135
|
"cspell": "^8.6.0",
|
|
136
136
|
"eslint": "^8.57.0",
|
|
137
|
-
"eslint-config-cheminfo-react": "^
|
|
137
|
+
"eslint-config-cheminfo-react": "^11.0.1",
|
|
138
138
|
"eslint-config-cheminfo-typescript": "^12.2.0",
|
|
139
139
|
"modern-normalize": "^2.0.0",
|
|
140
140
|
"postcss-styled-syntax": "^0.6.4",
|
|
@@ -148,8 +148,8 @@
|
|
|
148
148
|
"serve": "^14.2.1",
|
|
149
149
|
"stylelint": "^16.2.1",
|
|
150
150
|
"stylelint-config-standard": "^36.0.0",
|
|
151
|
-
"typescript": "^5.4.
|
|
152
|
-
"vite": "^5.
|
|
151
|
+
"typescript": "^5.4.3",
|
|
152
|
+
"vite": "^5.2.2",
|
|
153
153
|
"vitest": "^1.4.0"
|
|
154
154
|
}
|
|
155
|
-
}
|
|
155
|
+
}
|