nmrium 0.54.0 → 0.56.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 +3 -1
- package/lib/component/1d/Viewer1D.js +36 -11
- 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/matrix/Boxplot.d.ts +6 -0
- package/lib/component/1d/matrix/Boxplot.js +97 -0
- package/lib/component/1d/matrix/Stocsy.d.ts +5 -0
- package/lib/component/1d/matrix/Stocsy.js +101 -0
- package/lib/component/1d/matrix/useMatrix.d.ts +29 -0
- package/lib/component/1d/matrix/useMatrix.js +93 -0
- 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/utilities/scale.d.ts +2 -1
- package/lib/component/1d/utilities/scale.js +6 -1
- 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/PrepareExportContext.d.ts +21 -0
- package/lib/component/context/PrepareExportContext.js +124 -0
- 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/useExport.d.ts +1 -1
- package/lib/component/hooks/useExport.js +4 -4
- 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.d.ts +2 -3
- package/lib/component/hooks/usePanelPreferences.js +4 -3
- package/lib/component/hooks/useSaveSettings.js +7 -14
- package/lib/component/hooks/useToggleSpectraVisibility.d.ts +10 -0
- package/lib/component/hooks/useToggleSpectraVisibility.js +41 -0
- 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/MatrixGenerationPanel/MatrixGenerationPanel.d.ts +2 -2
- package/lib/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +121 -36
- package/lib/component/panels/Panels.js +1 -1
- package/lib/component/panels/SpectraPanel/SpectraPanelHeader.js +4 -27
- 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/databasePanel/DatabaseTable.js +2 -2
- package/lib/component/panels/multipleAnalysisPanel/preferences/index.js +1 -1
- package/lib/component/reducer/IgnoreActions.js +1 -0
- package/lib/component/reducer/Reducer.d.ts +6 -0
- package/lib/component/reducer/Reducer.js +6 -0
- package/lib/component/reducer/actions/DomainActions.d.ts +12 -4
- package/lib/component/reducer/actions/DomainActions.js +35 -5
- package/lib/component/reducer/actions/FiltersActions.js +2 -2
- package/lib/component/reducer/actions/LoadActions.js +5 -2
- package/lib/component/reducer/actions/RangesActions.js +12 -6
- package/lib/component/reducer/actions/SpectraActions.d.ts +1 -0
- package/lib/component/reducer/actions/SpectraActions.js +7 -2
- 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.d.ts +47 -2
- package/lib/component/reducer/preferences/actions/matrixGeneration.js +63 -26
- 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/panelsPreferencesDefaultValues.d.ts +5 -2
- package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js +17 -1
- package/lib/component/reducer/preferences/preferencesReducer.d.ts +9 -25
- package/lib/component/reducer/preferences/preferencesReducer.js +28 -19
- package/lib/component/toolbar/ToolBar.js +23 -20
- package/lib/component/utility/PathBuilder.d.ts +1 -0
- package/lib/component/utility/PathBuilder.js +8 -1
- 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/data/types/common/DeepPartial.d.ts +3 -0
- package/lib/data/types/common/DeepPartial.js +1 -0
- package/lib/versionInfo.js +1 -1
- package/package.json +39 -39
- package/lib/component/elements/CustomToolTip.d.ts +0 -8
- package/lib/component/elements/CustomToolTip.js +0 -107
- 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
|
@@ -3,11 +3,11 @@ import { SvgNmrAlignBottom, SvgNmrAlignCenter, SvgNmrApodization, SvgNmrBaseline
|
|
|
3
3
|
import { useCallback } from 'react';
|
|
4
4
|
import { FaSearchPlus, FaExpand, FaDiceFour, FaFileImport, FaFileExport, } from 'react-icons/fa';
|
|
5
5
|
import { PiKnifeBold } from 'react-icons/pi';
|
|
6
|
-
import { Toolbar } from 'react-science/ui';
|
|
6
|
+
import { Toolbar, TooltipHelpContent, } 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 {
|
|
10
|
+
import { usePreferences } from '../context/PreferencesContext';
|
|
11
11
|
import { ToolbarPopoverItem, } from '../elements/ToolbarPopoverItem';
|
|
12
12
|
import useCheckExperimentalFeature from '../hooks/useCheckExperimentalFeature';
|
|
13
13
|
import { useCheckToolsVisibility, } from '../hooks/useCheckToolsVisibility';
|
|
@@ -49,6 +49,7 @@ export default function ToolBar() {
|
|
|
49
49
|
const exportMenu = isExperimentalFeature
|
|
50
50
|
? EXPORT_MENU
|
|
51
51
|
: EXPORT_MENU.filter((item) => item.id !== 'nmre');
|
|
52
|
+
const { current: { general: { invert }, }, } = usePreferences();
|
|
52
53
|
const handleOnFFTFilter = useCallback(() => {
|
|
53
54
|
dispatch({
|
|
54
55
|
type: 'APPLY_FFT_FILTER',
|
|
@@ -85,7 +86,7 @@ export default function ToolBar() {
|
|
|
85
86
|
function exportHandler(data) {
|
|
86
87
|
switch (data?.id) {
|
|
87
88
|
case 'svg':
|
|
88
|
-
|
|
89
|
+
saveAsSVGHandler();
|
|
89
90
|
break;
|
|
90
91
|
case 'png':
|
|
91
92
|
void saveAsPNGHandler();
|
|
@@ -110,8 +111,8 @@ export default function ToolBar() {
|
|
|
110
111
|
title: options.zoom.label,
|
|
111
112
|
subTitles: [
|
|
112
113
|
{ title: 'Vertical', shortcuts: ['Scroll wheel'] },
|
|
113
|
-
{ title: 'Horizontal', shortcuts: ['
|
|
114
|
-
{ title: 'Pan', shortcuts: ['Right
|
|
114
|
+
{ title: 'Horizontal', shortcuts: ['⇧', 'Scroll wheel'] },
|
|
115
|
+
{ title: 'Pan', shortcuts: ['Right button'] },
|
|
115
116
|
],
|
|
116
117
|
},
|
|
117
118
|
icon: _jsx(FaSearchPlus, {}),
|
|
@@ -124,7 +125,7 @@ export default function ToolBar() {
|
|
|
124
125
|
{ title: 'Horizontal', shortcuts: ['f'] },
|
|
125
126
|
{ title: 'Horizontal and Vertical', shortcuts: ['f', 'f'] },
|
|
126
127
|
],
|
|
127
|
-
description: '
|
|
128
|
+
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
129
|
link: 'https://docs.nmrium.org/help/zoom-and-scale',
|
|
129
130
|
},
|
|
130
131
|
onClick: handleFullZoomOut,
|
|
@@ -135,7 +136,7 @@ export default function ToolBar() {
|
|
|
135
136
|
tooltip: {
|
|
136
137
|
title: options.peakPicking.label,
|
|
137
138
|
shortcuts: ['p'],
|
|
138
|
-
description: '
|
|
139
|
+
description: 'Detect peaks manually or automatically in the spectrum.',
|
|
139
140
|
link: 'https://docs.nmrium.org/20_1d-spectra/peaks/peaks',
|
|
140
141
|
},
|
|
141
142
|
icon: _jsx(SvgNmrPeakPicking, {}),
|
|
@@ -145,7 +146,7 @@ export default function ToolBar() {
|
|
|
145
146
|
tooltip: {
|
|
146
147
|
title: options.integral.label,
|
|
147
148
|
shortcuts: ['i'],
|
|
148
|
-
description:
|
|
149
|
+
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
150
|
link: 'https://docs.nmrium.org/help/integrations',
|
|
150
151
|
},
|
|
151
152
|
icon: _jsx(SvgNmrIntegrate, {}),
|
|
@@ -155,7 +156,7 @@ export default function ToolBar() {
|
|
|
155
156
|
tooltip: {
|
|
156
157
|
title: options.zonePicking.label,
|
|
157
158
|
shortcuts: ['r'],
|
|
158
|
-
description:
|
|
159
|
+
description: `Draw 2D zones by clicking, dragging, and releasing${!invert ? 'while holding SHIFT' : ''}. Alternatively, detect zones automatically.`,
|
|
159
160
|
link: 'https://docs.nmrium.org/30_2d-spectra/zones/zones',
|
|
160
161
|
},
|
|
161
162
|
icon: _jsx(FaDiceFour, {}),
|
|
@@ -164,7 +165,7 @@ export default function ToolBar() {
|
|
|
164
165
|
id: 'slicing',
|
|
165
166
|
tooltip: {
|
|
166
167
|
title: options.slicing.label,
|
|
167
|
-
description: '
|
|
168
|
+
description: 'Display the horizontal and vertical slices of the selected 2D spectrum at the level of the pointer.',
|
|
168
169
|
link: 'https://docs.nmrium.org/30_2d-spectra/slicing/slicing',
|
|
169
170
|
},
|
|
170
171
|
icon: _jsx(PiKnifeBold, {}),
|
|
@@ -174,7 +175,7 @@ export default function ToolBar() {
|
|
|
174
175
|
tooltip: {
|
|
175
176
|
title: options.rangePicking.label,
|
|
176
177
|
shortcuts: ['r'],
|
|
177
|
-
description:
|
|
178
|
+
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
179
|
link: 'https://docs.nmrium.org/20_1d-spectra/ranges/ranges',
|
|
179
180
|
},
|
|
180
181
|
icon: _jsx(SvgNmrRangePicking, {}),
|
|
@@ -191,6 +192,7 @@ export default function ToolBar() {
|
|
|
191
192
|
tooltip: {
|
|
192
193
|
title: options.apodization.label,
|
|
193
194
|
shortcuts: ['a'],
|
|
195
|
+
description: 'Apply mathematical function that the FID is multiplied by before Fourier Transform.',
|
|
194
196
|
},
|
|
195
197
|
icon: _jsx(SvgNmrApodization, {}),
|
|
196
198
|
},
|
|
@@ -199,7 +201,7 @@ export default function ToolBar() {
|
|
|
199
201
|
tooltip: {
|
|
200
202
|
title: options.zeroFilling.label,
|
|
201
203
|
shortcuts: ['z'],
|
|
202
|
-
description: '
|
|
204
|
+
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
205
|
link: 'https://docs.nmrium.org/20_1d-spectra/preprocessing/preprocessing#zero-filling',
|
|
204
206
|
},
|
|
205
207
|
icon: _jsx(SvgNmrZeroFilling, {}),
|
|
@@ -209,7 +211,7 @@ export default function ToolBar() {
|
|
|
209
211
|
tooltip: {
|
|
210
212
|
title: options.phaseCorrection.label,
|
|
211
213
|
shortcuts: ['a'],
|
|
212
|
-
description:
|
|
214
|
+
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
215
|
link: 'https://docs.nmrium.org/20_1d-spectra/phase/phase',
|
|
214
216
|
},
|
|
215
217
|
icon: _jsx(SvgNmrPhaseCorrection, {}),
|
|
@@ -228,7 +230,7 @@ export default function ToolBar() {
|
|
|
228
230
|
tooltip: {
|
|
229
231
|
title: options.baselineCorrection.label,
|
|
230
232
|
shortcuts: ['b'],
|
|
231
|
-
description:
|
|
233
|
+
description: `Correct the baseline of the spectrum. You should draw zones corresponding to the noise using click, drag, release${!invert ? 'while holding SHIFT' : ''}.`,
|
|
232
234
|
link: 'https://docs.nmrium.org/20_1d-spectra/baseline/baseline',
|
|
233
235
|
},
|
|
234
236
|
icon: _jsx(SvgNmrBaselineCorrection, {}),
|
|
@@ -238,6 +240,7 @@ export default function ToolBar() {
|
|
|
238
240
|
tooltip: {
|
|
239
241
|
title: options.exclusionZones.label,
|
|
240
242
|
shortcuts: ['e'],
|
|
243
|
+
description: `Define exclusion zones by clicking, dragging, releasing${!invert ? ' while holding SHIFT' : ''}. This option is practical for excluding large peaks like solvents.`,
|
|
241
244
|
},
|
|
242
245
|
icon: _jsx(SvgNmrMultipleAnalysis, {}),
|
|
243
246
|
checkOptions: { checkSpectrumType: false },
|
|
@@ -248,7 +251,7 @@ export default function ToolBar() {
|
|
|
248
251
|
tooltip: {
|
|
249
252
|
title: options.fft.label,
|
|
250
253
|
shortcuts: ['t'],
|
|
251
|
-
description: '
|
|
254
|
+
description: 'Perform a Fourier transform on the FID.',
|
|
252
255
|
link: 'https://docs.nmrium.org/20_1d-spectra/ft/ft/',
|
|
253
256
|
},
|
|
254
257
|
onClick: handleOnFFTFilter,
|
|
@@ -285,7 +288,7 @@ export default function ToolBar() {
|
|
|
285
288
|
tooltip: {
|
|
286
289
|
title: options.spectraStackAlignments.label,
|
|
287
290
|
shortcuts: ['s'],
|
|
288
|
-
description: '
|
|
291
|
+
description: 'Toggle between stack mode and all the spectra aligned at the bottom.',
|
|
289
292
|
},
|
|
290
293
|
icon: verticalAlign === 'stack' ? (_jsx(SvgNmrOverlay3Aligned, {})) : (_jsx(SvgNmrOverlay3, {})),
|
|
291
294
|
condition: ftCounter > 1,
|
|
@@ -295,7 +298,7 @@ export default function ToolBar() {
|
|
|
295
298
|
id: 'realImaginary',
|
|
296
299
|
tooltip: {
|
|
297
300
|
title: `Display ${isRealSpectrumShown ? 'real' : 'imaginary'}`,
|
|
298
|
-
description: '
|
|
301
|
+
description: 'Toggle between the imaginary and real parts of the spectrum.',
|
|
299
302
|
link: 'https://docs.nmrium.org/20_1d-spectra/views/views',
|
|
300
303
|
},
|
|
301
304
|
icon: _jsx(SvgNmrRealImag, {}),
|
|
@@ -306,7 +309,7 @@ export default function ToolBar() {
|
|
|
306
309
|
tooltip: {
|
|
307
310
|
title: `Baseline ${verticalAlign === 'bottom' ? 'center' : 'bottom'}`,
|
|
308
311
|
shortcuts: ['c'],
|
|
309
|
-
description: '
|
|
312
|
+
description: 'Toggle between alignment of the spectra in the center or at the bottom of the display.',
|
|
310
313
|
},
|
|
311
314
|
icon: verticalAlign === 'bottom' ? (_jsx(SvgNmrAlignCenter, {})) : (_jsx(SvgNmrAlignBottom, {})),
|
|
312
315
|
condition: ftCounter > 0 || fidCounter > 0,
|
|
@@ -321,12 +324,12 @@ export default function ToolBar() {
|
|
|
321
324
|
return null;
|
|
322
325
|
if (isPopoverToolItem(item)) {
|
|
323
326
|
const { menuItems, onClick } = item;
|
|
324
|
-
return (_jsx(ToolbarPopoverItem, { options: menuItems, tooltip: typeof tooltip === 'string' ? (tooltip) : (_jsx(
|
|
327
|
+
return (_jsx(ToolbarPopoverItem, { options: menuItems, tooltip: typeof tooltip === 'string' ? (tooltip) : (_jsx(TooltipHelpContent, { ...tooltip })), tooltipProps: {
|
|
325
328
|
minimal: true,
|
|
326
329
|
}, id: id, active: selectedTool === id, icon: icon, onClick: onClick }, id));
|
|
327
330
|
}
|
|
328
331
|
const { onClick } = item;
|
|
329
|
-
return (_jsx(Toolbar.Item, { onClick: onClick || (() => handleChange(id)), tooltip: typeof tooltip === 'string' ? (tooltip) : (_jsx(
|
|
332
|
+
return (_jsx(Toolbar.Item, { onClick: onClick || (() => handleChange(id)), tooltip: typeof tooltip === 'string' ? (tooltip) : (_jsx(TooltipHelpContent, { ...tooltip })), tooltipProps: {
|
|
330
333
|
minimal: true,
|
|
331
334
|
}, id: id, active: selectedTool === id, icon: icon }, id));
|
|
332
335
|
}) })] }));
|
|
@@ -19,11 +19,18 @@ export class PathBuilder {
|
|
|
19
19
|
toString() {
|
|
20
20
|
return this.array.join(' ');
|
|
21
21
|
}
|
|
22
|
+
concatPath(pathBuilder) {
|
|
23
|
+
return this.array.concat(pathBuilder.array).join(' ');
|
|
24
|
+
}
|
|
22
25
|
}
|
|
23
26
|
/**
|
|
24
27
|
* Clamp values to avoid rendering issues of the SVG.
|
|
25
28
|
* This assumes that the viewport has pixel coordinates (so the max values are outside of the visible area)
|
|
26
29
|
*/
|
|
27
30
|
function clamp(value) {
|
|
28
|
-
|
|
31
|
+
if (value < -1e5)
|
|
32
|
+
return -1e5;
|
|
33
|
+
if (value > 1e5)
|
|
34
|
+
return 1e5;
|
|
35
|
+
return value;
|
|
29
36
|
}
|
|
@@ -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
|
},
|