nmrium 0.54.0 → 0.55.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/XAxis.js +1 -1
- package/lib/component/1d/integral/IntegralsSeries.js +2 -2
- package/lib/component/1d/integral/Integration.d.ts +3 -1
- package/lib/component/1d/integral/Integration.js +3 -2
- package/lib/component/1d/peaks/PeakEditionManager.js +5 -3
- package/lib/component/1d/ranges/AssignmentActionsButtons.d.ts +1 -0
- package/lib/component/1d/ranges/AssignmentActionsButtons.js +3 -3
- package/lib/component/1d/ranges/AssignmentLabel.d.ts +1 -1
- package/lib/component/1d/ranges/AssignmentLabel.js +31 -4
- package/lib/component/1d/ranges/Atoms.js +4 -5
- package/lib/component/1d/ranges/Range.js +48 -6
- package/lib/component/1d/ranges/Ranges.js +2 -1
- package/lib/component/1d/ranges/RangesIntegrals.js +11 -4
- package/lib/component/1d-2d/FieldEdition.d.ts +13 -0
- package/lib/component/1d-2d/FieldEdition.js +42 -0
- package/lib/component/2d/Chart2D.js +5 -3
- package/lib/component/2d/zones/Zone.js +18 -2
- package/lib/component/2d/zones/ZonesAssignmentsLabels.d.ts +7 -0
- package/lib/component/2d/zones/ZonesAssignmentsLabels.js +286 -0
- package/lib/component/EventsTrackers/KeysListenerTracker.js +14 -1
- package/lib/component/context/ShareDataContext.d.ts +10 -0
- package/lib/component/context/ShareDataContext.js +22 -0
- package/lib/component/elements/ActionsButtonsPopover.d.ts +10 -0
- package/lib/component/elements/ActionsButtonsPopover.js +22 -0
- package/lib/component/elements/ReactTable/Elements/ReactTableRow.js +7 -5
- package/lib/component/elements/ReactTable/ReactTable.d.ts +2 -2
- package/lib/component/elements/SVGButton.d.ts +14 -0
- package/lib/component/elements/SVGButton.js +6 -0
- package/lib/component/elements/SVGGroup.js +15 -13
- package/lib/component/elements/SVGText.d.ts +8 -0
- package/lib/component/elements/SVGText.js +24 -0
- package/lib/component/elements/draggable/SVGDraggable.d.ts +2 -2
- package/lib/component/elements/formik/FormikInput.d.ts +2 -1
- package/lib/component/elements/formik/FormikInput.js +4 -3
- package/lib/component/header/Header.js +7 -10
- package/lib/component/hooks/useActiveSpectrumZonesViewState.js +1 -0
- package/lib/component/hooks/useCheckPointsNumberInWindowArea.d.ts +1 -1
- package/lib/component/hooks/useFormatNumberByNucleus.d.ts +1 -1
- package/lib/component/hooks/useFormatNumberByNucleus.js +8 -7
- package/lib/component/hooks/useIntegralPath.d.ts +2 -0
- package/lib/component/hooks/useIntegralPath.js +3 -1
- package/lib/component/hooks/usePanelPreferences.js +1 -2
- package/lib/component/hooks/useSaveSettings.js +7 -14
- package/lib/component/hooks/useTriggerNewAssignmentLabel.d.ts +4 -0
- package/lib/component/hooks/useTriggerNewAssignmentLabel.js +8 -0
- package/lib/component/hooks/useWorkspaceAction.d.ts +7 -0
- package/lib/component/hooks/useWorkspaceAction.js +89 -0
- package/lib/component/loader/DropZone.js +0 -3
- package/lib/component/main/InnerNMRium.js +3 -1
- package/lib/component/main/InnerNMRiumContents.js +14 -2
- package/lib/component/main/NMRiumStateProvider.js +4 -2
- package/lib/component/modal/editRange/forms/components/DeltaInput.js +3 -3
- package/lib/component/modal/editRange/forms/components/NewSignalTab.js +17 -12
- package/lib/component/modal/editRange/forms/components/signal-tabs/SignalJCouplingsTable.js +30 -13
- package/lib/component/modal/editRange/forms/components/signal-tabs/SignalPeaksTable.js +26 -16
- package/lib/component/modal/setting/GeneralSettings.js +7 -21
- package/lib/component/modal/setting/WorkspaceItem.js +1 -1
- package/lib/component/modal/setting/settings-tabs/NucleiTabContent.d.ts +2 -0
- package/lib/component/modal/setting/settings-tabs/NucleiTabContent.js +99 -0
- package/lib/component/modal/setting/settingsValidation.js +36 -40
- package/lib/component/panels/SpectraPanel/SpectraPreferences.js +13 -1
- package/lib/component/panels/SpectraPanel/base/setting/PlotChart.js +1 -1
- package/lib/component/panels/SpectraPanel/base/setting/Spectrum2DHistogram.js +1 -1
- package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentLabelColumn.d.ts +6 -0
- package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentLabelColumn.js +16 -0
- package/lib/component/panels/ZonesPanel/ZonesPanel.js +18 -2
- package/lib/component/panels/ZonesPanel/ZonesPreferences.js +15 -9
- package/lib/component/panels/ZonesPanel/ZonesTable.js +2 -2
- package/lib/component/panels/ZonesPanel/ZonesTableRow.js +3 -2
- package/lib/component/panels/multipleAnalysisPanel/preferences/index.js +1 -1
- package/lib/component/reducer/IgnoreActions.js +1 -0
- package/lib/component/reducer/Reducer.js +6 -0
- package/lib/component/reducer/actions/DomainActions.d.ts +7 -2
- package/lib/component/reducer/actions/DomainActions.js +29 -1
- package/lib/component/reducer/actions/RangesActions.js +12 -6
- package/lib/component/reducer/actions/ZonesActions.d.ts +15 -2
- package/lib/component/reducer/actions/ZonesActions.js +47 -13
- package/lib/component/reducer/helper/setRangesViewProperty.d.ts +1 -0
- package/lib/component/reducer/helper/setRangesViewProperty.js +11 -11
- package/lib/component/reducer/preferences/actions/addWorkspace.js +4 -23
- package/lib/component/reducer/preferences/actions/analyzeSpectra.js +4 -4
- package/lib/component/reducer/preferences/actions/initPreferences.js +2 -4
- package/lib/component/reducer/preferences/actions/matrixGeneration.js +3 -3
- package/lib/component/reducer/preferences/actions/removeWorkspace.js +0 -5
- package/lib/component/reducer/preferences/actions/setActiveWorkspace.js +0 -4
- package/lib/component/reducer/preferences/actions/setPanelsPreferences.js +1 -1
- package/lib/component/reducer/preferences/actions/setPreferences.js +2 -16
- package/lib/component/reducer/preferences/preferencesReducer.d.ts +7 -0
- package/lib/component/reducer/preferences/preferencesReducer.js +21 -18
- package/lib/component/toolbar/ToolBar.js +18 -14
- package/lib/component/utility/PreferencesHelper.js +5 -4
- package/lib/component/utility/export.js +4 -0
- package/lib/component/workspaces/assignment.js +0 -1
- package/lib/component/workspaces/basic.js +0 -1
- package/lib/component/workspaces/embedded.js +0 -1
- package/lib/component/workspaces/exercise.js +26 -29
- package/lib/component/workspaces/prediction.js +171 -174
- package/lib/component/workspaces/process1D.js +0 -1
- package/lib/component/workspaces/simulation.js +35 -38
- package/lib/component/workspaces/workspaceDefaultProperties.js +9 -11
- package/lib/versionInfo.js +1 -1
- package/package.json +31 -31
- package/lib/component/modal/setting/settings-tabs/FormattingTabContent.d.ts +0 -2
- package/lib/component/modal/setting/settings-tabs/FormattingTabContent.js +0 -80
- package/lib/component/reducer/preferences/utilities/mapNucleiFormatting.d.ts +0 -2
- package/lib/component/reducer/preferences/utilities/mapNucleiFormatting.js +0 -10
|
@@ -7,6 +7,7 @@ import { Toolbar } from 'react-science/ui';
|
|
|
7
7
|
import { useChartData } from '../context/ChartContext';
|
|
8
8
|
import { useDispatch } from '../context/DispatchContext';
|
|
9
9
|
import { useLoader } from '../context/LoaderContext';
|
|
10
|
+
import { usePreferences } from '../context/PreferencesContext';
|
|
10
11
|
import { CustomToolTip } from '../elements/CustomToolTip';
|
|
11
12
|
import { ToolbarPopoverItem, } from '../elements/ToolbarPopoverItem';
|
|
12
13
|
import useCheckExperimentalFeature from '../hooks/useCheckExperimentalFeature';
|
|
@@ -49,6 +50,7 @@ export default function ToolBar() {
|
|
|
49
50
|
const exportMenu = isExperimentalFeature
|
|
50
51
|
? EXPORT_MENU
|
|
51
52
|
: EXPORT_MENU.filter((item) => item.id !== 'nmre');
|
|
53
|
+
const { current: { general: { invert }, }, } = usePreferences();
|
|
52
54
|
const handleOnFFTFilter = useCallback(() => {
|
|
53
55
|
dispatch({
|
|
54
56
|
type: 'APPLY_FFT_FILTER',
|
|
@@ -110,7 +112,7 @@ export default function ToolBar() {
|
|
|
110
112
|
title: options.zoom.label,
|
|
111
113
|
subTitles: [
|
|
112
114
|
{ title: 'Vertical', shortcuts: ['Scroll wheel'] },
|
|
113
|
-
{ title: 'Horizontal', shortcuts: ['
|
|
115
|
+
{ title: 'Horizontal', shortcuts: ['SHIFT', 'Scroll wheel'] },
|
|
114
116
|
{ title: 'Pan', shortcuts: ['Right mouse'] },
|
|
115
117
|
],
|
|
116
118
|
},
|
|
@@ -124,7 +126,7 @@ export default function ToolBar() {
|
|
|
124
126
|
{ title: 'Horizontal', shortcuts: ['f'] },
|
|
125
127
|
{ title: 'Horizontal and Vertical', shortcuts: ['f', 'f'] },
|
|
126
128
|
],
|
|
127
|
-
description: '
|
|
129
|
+
description: 'Zoom out by double-clicking the left mouse button, and fully zoom out horizontally by pressing the key "f". Alternatively, press the key "ff" to fit the spectra horizontally and vertically.',
|
|
128
130
|
link: 'https://docs.nmrium.org/help/zoom-and-scale',
|
|
129
131
|
},
|
|
130
132
|
onClick: handleFullZoomOut,
|
|
@@ -135,7 +137,7 @@ export default function ToolBar() {
|
|
|
135
137
|
tooltip: {
|
|
136
138
|
title: options.peakPicking.label,
|
|
137
139
|
shortcuts: ['p'],
|
|
138
|
-
description: '
|
|
140
|
+
description: 'Detect peaks manually or automatically in the spectrum.',
|
|
139
141
|
link: 'https://docs.nmrium.org/20_1d-spectra/peaks/peaks',
|
|
140
142
|
},
|
|
141
143
|
icon: _jsx(SvgNmrPeakPicking, {}),
|
|
@@ -145,7 +147,7 @@ export default function ToolBar() {
|
|
|
145
147
|
tooltip: {
|
|
146
148
|
title: options.integral.label,
|
|
147
149
|
shortcuts: ['i'],
|
|
148
|
-
description:
|
|
150
|
+
description: `Manually integrate the spectrum. Click, drag, and release ${!invert ? 'while holding SHIFT' : ''} to draw the integral. Resize the integrals by moving the edges. Cut an integral with ${!invert ? 'SHIFT +' : ''} click.`,
|
|
149
151
|
link: 'https://docs.nmrium.org/help/integrations',
|
|
150
152
|
},
|
|
151
153
|
icon: _jsx(SvgNmrIntegrate, {}),
|
|
@@ -155,7 +157,7 @@ export default function ToolBar() {
|
|
|
155
157
|
tooltip: {
|
|
156
158
|
title: options.zonePicking.label,
|
|
157
159
|
shortcuts: ['r'],
|
|
158
|
-
description:
|
|
160
|
+
description: `Draw 2D zones by clicking, dragging, and releasing${!invert ? 'while holding SHIFT' : ''}. Alternatively, detect zones automatically.`,
|
|
159
161
|
link: 'https://docs.nmrium.org/30_2d-spectra/zones/zones',
|
|
160
162
|
},
|
|
161
163
|
icon: _jsx(FaDiceFour, {}),
|
|
@@ -164,7 +166,7 @@ export default function ToolBar() {
|
|
|
164
166
|
id: 'slicing',
|
|
165
167
|
tooltip: {
|
|
166
168
|
title: options.slicing.label,
|
|
167
|
-
description: '
|
|
169
|
+
description: 'Display the horizontal and vertical slices of the selected 2D spectrum at the level of the pointer.',
|
|
168
170
|
link: 'https://docs.nmrium.org/30_2d-spectra/slicing/slicing',
|
|
169
171
|
},
|
|
170
172
|
icon: _jsx(PiKnifeBold, {}),
|
|
@@ -174,7 +176,7 @@ export default function ToolBar() {
|
|
|
174
176
|
tooltip: {
|
|
175
177
|
title: options.rangePicking.label,
|
|
176
178
|
shortcuts: ['r'],
|
|
177
|
-
description:
|
|
179
|
+
description: `Define ranges and analyse multiplet automatically or manually. Click, drag, and release ${!invert ? 'while holding SHIFT' : ''} to draw the range. Ranges can be resized by moving the edges.`,
|
|
178
180
|
link: 'https://docs.nmrium.org/20_1d-spectra/ranges/ranges',
|
|
179
181
|
},
|
|
180
182
|
icon: _jsx(SvgNmrRangePicking, {}),
|
|
@@ -191,6 +193,7 @@ export default function ToolBar() {
|
|
|
191
193
|
tooltip: {
|
|
192
194
|
title: options.apodization.label,
|
|
193
195
|
shortcuts: ['a'],
|
|
196
|
+
description: 'Apply mathematical function that the FID is multiplied by before Fourier Transform.',
|
|
194
197
|
},
|
|
195
198
|
icon: _jsx(SvgNmrApodization, {}),
|
|
196
199
|
},
|
|
@@ -199,7 +202,7 @@ export default function ToolBar() {
|
|
|
199
202
|
tooltip: {
|
|
200
203
|
title: options.zeroFilling.label,
|
|
201
204
|
shortcuts: ['z'],
|
|
202
|
-
description: '
|
|
205
|
+
description: 'Improve spectrum quality by increasing the number of points. By default, the number of points is twice as many as in the original FID.',
|
|
203
206
|
link: 'https://docs.nmrium.org/20_1d-spectra/preprocessing/preprocessing#zero-filling',
|
|
204
207
|
},
|
|
205
208
|
icon: _jsx(SvgNmrZeroFilling, {}),
|
|
@@ -209,7 +212,7 @@ export default function ToolBar() {
|
|
|
209
212
|
tooltip: {
|
|
210
213
|
title: options.phaseCorrection.label,
|
|
211
214
|
shortcuts: ['a'],
|
|
212
|
-
description:
|
|
215
|
+
description: `Correct the spectrum phase manually or automatically. For manual phase correction, define the pivot${!invert ? ' using SHIFT +' : ''} click, then press the PH0 and PH1 button, and move the mouse horizontally.`,
|
|
213
216
|
link: 'https://docs.nmrium.org/20_1d-spectra/phase/phase',
|
|
214
217
|
},
|
|
215
218
|
icon: _jsx(SvgNmrPhaseCorrection, {}),
|
|
@@ -228,7 +231,7 @@ export default function ToolBar() {
|
|
|
228
231
|
tooltip: {
|
|
229
232
|
title: options.baselineCorrection.label,
|
|
230
233
|
shortcuts: ['b'],
|
|
231
|
-
description:
|
|
234
|
+
description: `Correct the baseline of the spectrum. You should draw zones corresponding to the noise using click, drag, release${!invert ? 'while holding SHIFT' : ''}.`,
|
|
232
235
|
link: 'https://docs.nmrium.org/20_1d-spectra/baseline/baseline',
|
|
233
236
|
},
|
|
234
237
|
icon: _jsx(SvgNmrBaselineCorrection, {}),
|
|
@@ -238,6 +241,7 @@ export default function ToolBar() {
|
|
|
238
241
|
tooltip: {
|
|
239
242
|
title: options.exclusionZones.label,
|
|
240
243
|
shortcuts: ['e'],
|
|
244
|
+
description: `Define exclusion zones by clicking, dragging, releasing${!invert ? ' while holding SHIFT' : ''}. This option is practical for excluding large peaks like solvents.`,
|
|
241
245
|
},
|
|
242
246
|
icon: _jsx(SvgNmrMultipleAnalysis, {}),
|
|
243
247
|
checkOptions: { checkSpectrumType: false },
|
|
@@ -248,7 +252,7 @@ export default function ToolBar() {
|
|
|
248
252
|
tooltip: {
|
|
249
253
|
title: options.fft.label,
|
|
250
254
|
shortcuts: ['t'],
|
|
251
|
-
description: '
|
|
255
|
+
description: 'Perform a Fourier transform on the FID.',
|
|
252
256
|
link: 'https://docs.nmrium.org/20_1d-spectra/ft/ft/',
|
|
253
257
|
},
|
|
254
258
|
onClick: handleOnFFTFilter,
|
|
@@ -285,7 +289,7 @@ export default function ToolBar() {
|
|
|
285
289
|
tooltip: {
|
|
286
290
|
title: options.spectraStackAlignments.label,
|
|
287
291
|
shortcuts: ['s'],
|
|
288
|
-
description: '
|
|
292
|
+
description: 'Toggle between stack mode and all the spectra aligned at the bottom.',
|
|
289
293
|
},
|
|
290
294
|
icon: verticalAlign === 'stack' ? (_jsx(SvgNmrOverlay3Aligned, {})) : (_jsx(SvgNmrOverlay3, {})),
|
|
291
295
|
condition: ftCounter > 1,
|
|
@@ -295,7 +299,7 @@ export default function ToolBar() {
|
|
|
295
299
|
id: 'realImaginary',
|
|
296
300
|
tooltip: {
|
|
297
301
|
title: `Display ${isRealSpectrumShown ? 'real' : 'imaginary'}`,
|
|
298
|
-
description: '
|
|
302
|
+
description: 'Toggle between the imaginary and real parts of the spectrum.',
|
|
299
303
|
link: 'https://docs.nmrium.org/20_1d-spectra/views/views',
|
|
300
304
|
},
|
|
301
305
|
icon: _jsx(SvgNmrRealImag, {}),
|
|
@@ -306,7 +310,7 @@ export default function ToolBar() {
|
|
|
306
310
|
tooltip: {
|
|
307
311
|
title: `Baseline ${verticalAlign === 'bottom' ? 'center' : 'bottom'}`,
|
|
308
312
|
shortcuts: ['c'],
|
|
309
|
-
description: '
|
|
313
|
+
description: 'Toggle between alignment of the spectra in the center or at the bottom of the display.',
|
|
310
314
|
},
|
|
311
315
|
icon: verticalAlign === 'bottom' ? (_jsx(SvgNmrAlignCenter, {})) : (_jsx(SvgNmrAlignBottom, {})),
|
|
312
316
|
condition: ftCounter > 0 || fidCounter > 0,
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { readSettings } from '../reducer/preferences/preferencesReducer';
|
|
2
|
+
import { getValue } from './LocalStorage';
|
|
2
3
|
function GetPreference(preferences, key) {
|
|
3
|
-
const localData =
|
|
4
|
-
const val = getValue(preferences, `
|
|
5
|
-
getValue(localData, `
|
|
4
|
+
const localData = readSettings() || {};
|
|
5
|
+
const val = getValue(preferences, `panels.[${key}]`) ||
|
|
6
|
+
getValue(localData, `panels.[${key}]`);
|
|
6
7
|
return val;
|
|
7
8
|
}
|
|
8
9
|
export { GetPreference };
|
|
@@ -107,6 +107,8 @@ function exportAsPng(rootRef, elementID, fileName = 'experiment') {
|
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
// hack way to copy the image to the clipboard
|
|
110
|
+
// TODO: remove when Firefox widely supports ClipboardItem
|
|
111
|
+
// https://caniuse.com/mdn-api_clipboarditem
|
|
110
112
|
function copyDataURLClipboardFireFox(image) {
|
|
111
113
|
const img = document.createElement('img');
|
|
112
114
|
img.src = image;
|
|
@@ -117,6 +119,7 @@ function copyDataURLClipboardFireFox(image) {
|
|
|
117
119
|
const range = document.createRange();
|
|
118
120
|
range.selectNode(img);
|
|
119
121
|
window.getSelection()?.addRange(range);
|
|
122
|
+
// eslint-disable-next-line deprecation/deprecation
|
|
120
123
|
document.execCommand('Copy');
|
|
121
124
|
img.remove();
|
|
122
125
|
}
|
|
@@ -136,6 +139,7 @@ async function copyBlobToClipboard(canvas) {
|
|
|
136
139
|
return;
|
|
137
140
|
const isSafari = /^(?<safari>(?!chrome|android).)*safari/i.test(navigator.userAgent);
|
|
138
141
|
if (typeof ClipboardItem !== 'undefined') {
|
|
142
|
+
// eslint-disable-next-line @typescript-eslint/use-unknown-in-catch-callback-variable
|
|
139
143
|
await writeImageToClipboard(b, isSafari).catch(reportError);
|
|
140
144
|
}
|
|
141
145
|
else {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export const exercise = {
|
|
2
|
-
version: 2,
|
|
3
2
|
label: 'Exercise',
|
|
4
3
|
display: {
|
|
5
4
|
general: {
|
|
@@ -34,35 +33,33 @@ export const exercise = {
|
|
|
34
33
|
spectraRendering: 'auto',
|
|
35
34
|
loggingLevel: 'info',
|
|
36
35
|
popupLoggingLevel: 'error',
|
|
37
|
-
invert:
|
|
36
|
+
invert: true,
|
|
38
37
|
},
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
showDeleteAction: true,
|
|
65
|
-
},
|
|
38
|
+
nuclei: [],
|
|
39
|
+
panels: {
|
|
40
|
+
integrals: {
|
|
41
|
+
nuclei: {
|
|
42
|
+
'1H': {
|
|
43
|
+
showSerialNumber: true,
|
|
44
|
+
relative: { show: true, format: '0.00' },
|
|
45
|
+
absolute: { show: false, format: '0.00' },
|
|
46
|
+
from: { show: true, format: '0.00' },
|
|
47
|
+
to: { show: true, format: '0.00' },
|
|
48
|
+
color: 'black',
|
|
49
|
+
strokeWidth: 1,
|
|
50
|
+
showKind: false,
|
|
51
|
+
showDeleteAction: true,
|
|
52
|
+
},
|
|
53
|
+
'13C': {
|
|
54
|
+
showSerialNumber: true,
|
|
55
|
+
relative: { show: true, format: '0.00' },
|
|
56
|
+
absolute: { show: false, format: '0.00' },
|
|
57
|
+
from: { show: true, format: '0.00' },
|
|
58
|
+
to: { show: true, format: '0.00' },
|
|
59
|
+
color: 'black',
|
|
60
|
+
strokeWidth: 1,
|
|
61
|
+
showKind: false,
|
|
62
|
+
showDeleteAction: true,
|
|
66
63
|
},
|
|
67
64
|
},
|
|
68
65
|
},
|