nmrium 0.19.1 → 0.21.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 -3
- package/lib/component/1d/ExclusionZoneAnnotation.d.ts +11 -0
- package/lib/component/1d/ExclusionZoneAnnotation.js +18 -0
- package/lib/component/1d/ExclusionZonesAnnotations.d.ts +3 -0
- package/lib/component/1d/ExclusionZonesAnnotations.js +28 -0
- package/lib/component/1d/Line.js +11 -23
- package/lib/component/1d/Viewer1D.js +36 -5
- package/lib/component/1d/ranges/Ranges.js +3 -3
- package/lib/component/1d/{BaseLineZones.d.ts → tool/BaseLineZones.d.ts} +0 -0
- package/lib/component/1d/{BaseLineZones.js → tool/BaseLineZones.js} +5 -5
- package/lib/component/1d/utilities/useIntegralPath.js +9 -10
- package/lib/component/2d/Contours.js +12 -11
- package/lib/component/2d/Left1DChart.js +7 -9
- package/lib/component/2d/Top1DChart.js +7 -7
- package/lib/component/2d/tools/slicing/HorizontalSliceChart.js +7 -7
- package/lib/component/2d/tools/slicing/VerticalSliceChart.js +7 -9
- package/lib/component/EventsTrackers/BrushTracker.js +2 -2
- package/lib/component/EventsTrackers/KeysListenerTracker.js +106 -80
- package/lib/component/NMRium.d.ts +8 -3
- package/lib/component/NMRium.js +36 -33
- package/lib/component/elements/NumberInput.d.ts +1 -2
- package/lib/component/elements/Tab/Tab.js +1 -0
- package/lib/component/header/Header.js +10 -3
- package/lib/component/hooks/useActiveSpectrumStyleOptions.d.ts +6 -0
- package/lib/component/hooks/useActiveSpectrumStyleOptions.js +15 -0
- package/lib/component/hooks/useCheckExperimentalFeature.js +2 -1
- package/lib/component/hooks/useCheckToolsVisibility.d.ts +1 -0
- package/lib/component/hooks/useCheckToolsVisibility.js +6 -0
- package/lib/component/hooks/useToolsFunctions.js +2 -1
- package/lib/component/hooks/useXYReduce.d.ts +2 -1
- package/lib/component/loader/DropZone.js +88 -88
- package/lib/component/modal/ModalStyle.js +5 -2
- package/lib/component/modal/MoleculeStructureEditorModal.js +3 -2
- package/lib/component/modal/MultipleSpectraFiltersModal/index.js +10 -1
- package/lib/component/modal/changeSum/ChangeSumModal.js +4 -2
- package/lib/component/modal/setting/DisplayTabContent.js +1 -1
- package/lib/component/modal/setting/GeneralSettings.js +1 -5
- package/lib/component/panels/IntegralsPanel/IntegralPanel.js +0 -3
- package/lib/component/panels/IntegralsPanel/IntegralsPreferences.js +4 -17
- package/lib/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.d.ts +2 -0
- package/lib/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +35 -0
- package/lib/component/panels/MoleculesPanel/MoleculePanel.js +49 -67
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +3 -8
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +2 -23
- package/lib/component/panels/Panels.js +10 -0
- package/lib/component/panels/PeaksPanel/PeaksPanel.js +0 -3
- package/lib/component/panels/PeaksPanel/PeaksPreferences.js +5 -14
- package/lib/component/panels/RangesPanel/RangesPanel.js +0 -3
- package/lib/component/panels/RangesPanel/RangesPreferences.js +5 -18
- package/lib/component/panels/SpectrumsPanel/SpectraPanelHeader.js +13 -3
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum2DHistogram.js +1 -1
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.d.ts +5 -5
- package/lib/component/panels/SummaryPanel/SummaryPanel.js +1 -1
- package/lib/component/panels/SummaryPanel/Utilities.d.ts +7 -7
- package/lib/component/panels/ZonesPanel/ZonesPanel.js +0 -3
- package/lib/component/panels/ZonesPanel/ZonesPreferences.js +5 -18
- package/lib/component/panels/ZonesPanel/ZonesTable.js +9 -2
- package/lib/component/panels/databasePanel/DatabasePanel.js +0 -3
- package/lib/component/panels/databasePanel/DatabasePreferences.js +4 -17
- package/lib/component/reducer/Reducer.d.ts +11 -27
- package/lib/component/reducer/Reducer.js +4 -5
- package/lib/component/reducer/actions/CorrelationsActions.d.ts +7 -7
- package/lib/component/reducer/actions/CorrelationsActions.js +1 -1
- package/lib/component/reducer/actions/FiltersActions.d.ts +3 -1
- package/lib/component/reducer/actions/FiltersActions.js +60 -18
- package/lib/component/reducer/actions/LoadActions.js +2 -3
- package/lib/component/reducer/actions/MoleculeActions.js +2 -2
- package/lib/component/reducer/actions/PreferencesActions.js +4 -7
- package/lib/component/reducer/actions/RangesActions.js +1 -1
- package/lib/component/reducer/actions/ToolsActions.d.ts +1 -3
- package/lib/component/reducer/actions/ToolsActions.js +13 -59
- package/lib/component/reducer/helper/ZoomHistoryManager.d.ts +1 -0
- package/lib/component/reducer/helper/ZoomHistoryManager.js +2 -1
- package/lib/component/reducer/helper/getRange.d.ts +6 -1
- package/lib/component/reducer/helper/getRange.js +1 -1
- package/lib/component/reducer/preferencesReducer.d.ts +2 -0
- package/lib/component/reducer/preferencesReducer.js +76 -36
- package/lib/component/toolbar/FunctionToolBar.js +9 -15
- package/lib/component/toolbar/ToolTypes.js +3 -3
- package/lib/component/utility/PathBuilder.d.ts +7 -0
- package/lib/component/utility/PathBuilder.js +17 -0
- package/lib/component/utility/getSpectraByNucleus.d.ts +3 -0
- package/lib/component/utility/getSpectraByNucleus.js +4 -0
- package/lib/component/workspaces/Workspace.d.ts +6 -0
- package/lib/component/workspaces/Workspace.js +1 -0
- package/lib/component/workspaces/basic.d.ts +2 -0
- package/lib/component/workspaces/basic.js +45 -0
- package/lib/component/workspaces/exercise1D.d.ts +2 -0
- package/lib/component/workspaces/exercise1D.js +45 -0
- package/lib/component/workspaces/index.d.ts +6 -0
- package/lib/component/workspaces/index.js +4 -0
- package/lib/component/workspaces/process1D.d.ts +2 -0
- package/lib/component/workspaces/process1D.js +43 -0
- package/lib/data/Filters.d.ts +2 -1
- package/lib/data/Filters.js +2 -1
- package/lib/data/data1d/Spectrum1D/ranges/addRange.js +5 -2
- package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.js +6 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectRange.js +0 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectSignal.d.ts +3 -2
- package/lib/data/data1d/Spectrum1D/ranges/detectSignal.js +23 -15
- package/lib/data/data1d/filter1d/exclusionZones.d.ts +16 -0
- package/lib/data/data1d/filter1d/exclusionZones.js +28 -0
- package/lib/data/migration/MigrationManager.js +3 -0
- package/lib/data/types/data1d/ExclusionZone.d.ts +5 -0
- package/lib/data/types/data1d/ExclusionZone.js +1 -0
- package/lib/versionInfo.js +1 -1
- package/lib-cjs/component/1d/Chart1D.js +3 -3
- package/lib-cjs/component/1d/ExclusionZoneAnnotation.js +23 -0
- package/lib-cjs/component/1d/ExclusionZonesAnnotations.js +52 -0
- package/lib-cjs/component/1d/Line.js +11 -23
- package/lib-cjs/component/1d/Viewer1D.js +36 -5
- package/lib-cjs/component/1d/ranges/Ranges.js +1 -1
- package/lib-cjs/component/1d/{BaseLineZones.js → tool/BaseLineZones.js} +5 -5
- package/lib-cjs/component/1d/utilities/useIntegralPath.js +9 -10
- package/lib-cjs/component/2d/Contours.js +12 -11
- package/lib-cjs/component/2d/Left1DChart.js +7 -9
- package/lib-cjs/component/2d/Top1DChart.js +7 -7
- package/lib-cjs/component/2d/tools/slicing/HorizontalSliceChart.js +7 -7
- package/lib-cjs/component/2d/tools/slicing/VerticalSliceChart.js +7 -9
- package/lib-cjs/component/EventsTrackers/BrushTracker.js +2 -2
- package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +106 -80
- package/lib-cjs/component/NMRium.js +37 -34
- package/lib-cjs/component/elements/Tab/Tab.js +1 -0
- package/lib-cjs/component/header/Header.js +10 -3
- package/lib-cjs/component/hooks/useActiveSpectrumStyleOptions.js +21 -0
- package/lib-cjs/component/hooks/useCheckExperimentalFeature.js +5 -1
- package/lib-cjs/component/hooks/useCheckToolsVisibility.js +13 -0
- package/lib-cjs/component/hooks/useToolsFunctions.js +2 -1
- package/lib-cjs/component/loader/DropZone.js +88 -88
- package/lib-cjs/component/modal/ModalStyle.js +5 -2
- package/lib-cjs/component/modal/MoleculeStructureEditorModal.js +3 -2
- package/lib-cjs/component/modal/MultipleSpectraFiltersModal/index.js +10 -1
- package/lib-cjs/component/modal/changeSum/ChangeSumModal.js +4 -2
- package/lib-cjs/component/modal/setting/DisplayTabContent.js +1 -1
- package/lib-cjs/component/modal/setting/GeneralSettings.js +1 -5
- package/lib-cjs/component/panels/IntegralsPanel/IntegralPanel.js +0 -3
- package/lib-cjs/component/panels/IntegralsPanel/IntegralsPreferences.js +3 -16
- package/lib-cjs/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +40 -0
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanel.js +48 -66
- package/lib-cjs/component/panels/MoleculesPanel/useAtomAssignment.js +3 -8
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +1 -22
- package/lib-cjs/component/panels/Panels.js +10 -0
- package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +0 -3
- package/lib-cjs/component/panels/PeaksPanel/PeaksPreferences.js +4 -13
- package/lib-cjs/component/panels/RangesPanel/RangesPanel.js +0 -3
- package/lib-cjs/component/panels/RangesPanel/RangesPreferences.js +4 -17
- package/lib-cjs/component/panels/SpectrumsPanel/SpectraPanelHeader.js +13 -3
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum2DHistogram.js +1 -1
- package/lib-cjs/component/panels/ZonesPanel/ZonesPanel.js +0 -3
- package/lib-cjs/component/panels/ZonesPanel/ZonesPreferences.js +4 -17
- package/lib-cjs/component/panels/ZonesPanel/ZonesTable.js +8 -1
- package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +0 -3
- package/lib-cjs/component/panels/databasePanel/DatabasePreferences.js +3 -16
- package/lib-cjs/component/reducer/Reducer.js +4 -5
- package/lib-cjs/component/reducer/actions/FiltersActions.js +62 -18
- package/lib-cjs/component/reducer/actions/LoadActions.js +2 -3
- package/lib-cjs/component/reducer/actions/MoleculeActions.js +2 -2
- package/lib-cjs/component/reducer/actions/PreferencesActions.js +4 -7
- package/lib-cjs/component/reducer/actions/RangesActions.js +1 -1
- package/lib-cjs/component/reducer/actions/ToolsActions.js +13 -61
- package/lib-cjs/component/reducer/helper/ZoomHistoryManager.js +2 -1
- package/lib-cjs/component/reducer/helper/getRange.js +1 -1
- package/lib-cjs/component/reducer/preferencesReducer.js +75 -35
- package/lib-cjs/component/toolbar/FunctionToolBar.js +9 -15
- package/lib-cjs/component/toolbar/ToolTypes.js +3 -3
- package/lib-cjs/component/utility/PathBuilder.js +21 -0
- package/lib-cjs/component/utility/getSpectraByNucleus.js +11 -0
- package/lib-cjs/component/workspaces/Workspace.js +2 -0
- package/lib-cjs/component/workspaces/basic.js +48 -0
- package/lib-cjs/component/workspaces/exercise1D.js +48 -0
- package/lib-cjs/component/workspaces/index.js +6 -0
- package/lib-cjs/component/workspaces/process1D.js +46 -0
- package/lib-cjs/data/Filters.js +3 -1
- package/lib-cjs/data/data1d/Spectrum1D/ranges/addRange.js +5 -2
- package/lib-cjs/data/data1d/Spectrum1D/ranges/autoRangesDetection.js +6 -1
- package/lib-cjs/data/data1d/Spectrum1D/ranges/detectRange.js +0 -1
- package/lib-cjs/data/data1d/Spectrum1D/ranges/detectSignal.js +24 -15
- package/lib-cjs/data/data1d/filter1d/exclusionZones.js +34 -0
- package/lib-cjs/data/migration/MigrationManager.js +3 -0
- package/lib-cjs/data/types/data1d/ExclusionZone.js +2 -0
- package/lib-cjs/versionInfo.js +1 -1
- package/package.json +28 -29
- package/lib/component/1d/ExclusionZone.d.ts +0 -8
- package/lib/component/1d/ExclusionZone.js +0 -30
- package/lib/component/1d/ExclusionZones.d.ts +0 -2
- package/lib/component/1d/ExclusionZones.js +0 -10
- package/lib/component/nmriumMode/basic.d.ts +0 -38
- package/lib/component/nmriumMode/basic.js +0 -37
- package/lib/component/nmriumMode/exercise1D.d.ts +0 -38
- package/lib/component/nmriumMode/exercise1D.js +0 -37
- package/lib/component/nmriumMode/process1D.d.ts +0 -38
- package/lib/component/nmriumMode/process1D.js +0 -37
- package/lib-cjs/component/1d/ExclusionZone.js +0 -32
- package/lib-cjs/component/1d/ExclusionZones.js +0 -16
- package/lib-cjs/component/nmriumMode/basic.js +0 -39
- package/lib-cjs/component/nmriumMode/exercise1D.js +0 -39
- package/lib-cjs/component/nmriumMode/process1D.js +0 -39
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
2
|
/** @jsxImportSource @emotion/react */
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
|
-
import { SvgNmrOverlay
|
|
4
|
+
import { SvgNmrOverlay } from 'cheminfo-font';
|
|
5
5
|
import { useCallback, useState, useRef, memo, useMemo } from 'react';
|
|
6
6
|
import { FaFileExport } from 'react-icons/fa';
|
|
7
7
|
import { IoPulseOutline } from 'react-icons/io5';
|
|
@@ -13,8 +13,6 @@ import ToggleButton from '../../elements/ToggleButton';
|
|
|
13
13
|
import { positions, useAlert } from '../../elements/popup/Alert';
|
|
14
14
|
import { useModal } from '../../elements/popup/Modal';
|
|
15
15
|
import AlignSpectraModal from '../../modal/AlignSpectraModal';
|
|
16
|
-
import ExportAsMatrixModal from '../../modal/ExportAsMatrixModal';
|
|
17
|
-
import MultipleSpectraFiltersModal from '../../modal/MultipleSpectraFiltersModal';
|
|
18
16
|
import { RESET_SELECTED_TOOL } from '../../reducer/types/Types';
|
|
19
17
|
import Events from '../../utility/Events';
|
|
20
18
|
import { copyTextToClipboard } from '../../utility/Export';
|
|
@@ -56,15 +54,6 @@ function MultipleSpectraAnalysisPanelInner({ activeTab, spectraAnalysis, }) {
|
|
|
56
54
|
width: 500,
|
|
57
55
|
});
|
|
58
56
|
}, [activeTab, modal, dispatch]);
|
|
59
|
-
const openFiltersModal = useCallback(() => {
|
|
60
|
-
dispatch({ type: RESET_SELECTED_TOOL });
|
|
61
|
-
modal.show(_jsx(MultipleSpectraFiltersModal, {}, void 0), {
|
|
62
|
-
isBackgroundBlur: false,
|
|
63
|
-
position: positions.TOP_CENTER,
|
|
64
|
-
width: 550,
|
|
65
|
-
height: 250,
|
|
66
|
-
});
|
|
67
|
-
}, [modal, dispatch]);
|
|
68
57
|
const copyToClipboardHandler = useCallback(async () => {
|
|
69
58
|
const data = getDataAsString(spectraAnalysis, activeTab);
|
|
70
59
|
const success = await copyTextToClipboard(data);
|
|
@@ -75,14 +64,6 @@ function MultipleSpectraAnalysisPanelInner({ activeTab, spectraAnalysis, }) {
|
|
|
75
64
|
alert.error('copy to clipboard failed');
|
|
76
65
|
}
|
|
77
66
|
}, [activeTab, alert, spectraAnalysis]);
|
|
78
|
-
const openExportAsMatrixModal = useCallback(() => {
|
|
79
|
-
dispatch({ type: RESET_SELECTED_TOOL });
|
|
80
|
-
modal.show(_jsx(ExportAsMatrixModal, {}, void 0), {
|
|
81
|
-
isBackgroundBlur: false,
|
|
82
|
-
position: positions.TOP_CENTER,
|
|
83
|
-
width: 500,
|
|
84
|
-
});
|
|
85
|
-
}, [modal, dispatch]);
|
|
86
67
|
return (_jsxs("div", { css: [
|
|
87
68
|
tablePanelStyle,
|
|
88
69
|
isFlipped &&
|
|
@@ -95,9 +76,7 @@ function MultipleSpectraAnalysisPanelInner({ activeTab, spectraAnalysis, }) {
|
|
|
95
76
|
// style={styles.button}
|
|
96
77
|
onClick: copyToClipboardHandler, children: _jsx(FaFileExport, {}, void 0) }, void 0), _jsx(Button, { popupTitle: "Spectra calibration",
|
|
97
78
|
// style={styles.button}
|
|
98
|
-
onClick: openAlignSpectra, children: _jsx(SvgNmrOverlay, { style: { fontSize: '18px' } }, void 0) }, void 0), _jsx(ToggleButton, { popupTitle: "Y Spectra Tracker", popupPlacement: "right", onClick: showTrackerHandler, children: _jsx(IoPulseOutline, {}, void 0) }, void 0), _jsx(
|
|
99
|
-
// style={styles.button}
|
|
100
|
-
onClick: openFiltersModal, children: _jsx(SvgNmrAddFilter, { style: { fontSize: '18px' } }, void 0) }, void 0), _jsx(Button, { popupTitle: "Export spectra as a Matrix", onClick: openExportAsMatrixModal, children: _jsx(SvgNmrExportAsMatrix, {}, void 0) }, void 0)] }, void 0)), isFlipped && (_jsx(PreferencesHeader, { onSave: saveSettingHandler, onClose: settingsPanelHandler }, void 0)), _jsx("div", { className: "inner-container", children: !isFlipped ? (_jsx(MultipleSpectraAnalysisTable, { data: data, activeTab: activeTab }, void 0)) : (_jsx(MultipleSpectraAnalysisPreferences, { data: data, onAfterSave: afterSaveHandler, ref: settingRef }, void 0)) }, void 0)] }, void 0));
|
|
79
|
+
onClick: openAlignSpectra, children: _jsx(SvgNmrOverlay, { style: { fontSize: '18px' } }, void 0) }, void 0), _jsx(ToggleButton, { popupTitle: "Y Spectra Tracker", popupPlacement: "right", onClick: showTrackerHandler, children: _jsx(IoPulseOutline, {}, void 0) }, void 0)] }, void 0)), isFlipped && (_jsx(PreferencesHeader, { onSave: saveSettingHandler, onClose: settingsPanelHandler }, void 0)), _jsx("div", { className: "inner-container", children: !isFlipped ? (_jsx(MultipleSpectraAnalysisTable, { data: data, activeTab: activeTab }, void 0)) : (_jsx(MultipleSpectraAnalysisPreferences, { data: data, onAfterSave: afterSaveHandler, ref: settingRef }, void 0)) }, void 0)] }, void 0));
|
|
101
80
|
}
|
|
102
81
|
const MemoizedMultipleSpectraAnalysisPanel = memo(MultipleSpectraAnalysisPanelInner);
|
|
103
82
|
export default function MultipleSpectraAnalysisPanel() {
|
|
@@ -9,6 +9,7 @@ import { DISPLAYER_MODE } from '../reducer/core/Constants';
|
|
|
9
9
|
import { options } from '../toolbar/ToolTypes';
|
|
10
10
|
import InformationPanel from './InformationPanel';
|
|
11
11
|
import IntegralPanel from './IntegralsPanel/IntegralPanel';
|
|
12
|
+
import MatrixGenerationPanel from './MatrixGenerationPanel/MatrixGenerationPanel';
|
|
12
13
|
import MoleculePanel from './MoleculesPanel/MoleculePanel';
|
|
13
14
|
import MultipleSpectraAnalysisPanel from './MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel';
|
|
14
15
|
import PeaksPanel from './PeaksPanel/PeaksPanel';
|
|
@@ -69,6 +70,14 @@ const accordionItems = [
|
|
|
69
70
|
hidePreferenceKey: 'hideMultipleSpectraAnalysisPanel',
|
|
70
71
|
mode: null,
|
|
71
72
|
},
|
|
73
|
+
{
|
|
74
|
+
title: 'Matrix Generation',
|
|
75
|
+
component: _jsx(MatrixGenerationPanel, {}, void 0),
|
|
76
|
+
openWhen: [],
|
|
77
|
+
hidePreferenceKey: '',
|
|
78
|
+
mode: null,
|
|
79
|
+
isExperimental: true,
|
|
80
|
+
},
|
|
72
81
|
{
|
|
73
82
|
title: 'Zones',
|
|
74
83
|
component: _jsx(ZonesPanel, {}, void 0),
|
|
@@ -103,6 +112,7 @@ export const PANELS_ACCORDION = {
|
|
|
103
112
|
peakPicking: 'Peaks',
|
|
104
113
|
integral: 'Integrals',
|
|
105
114
|
rangesPicking: 'Ranges',
|
|
115
|
+
zone2D: 'Zones',
|
|
106
116
|
};
|
|
107
117
|
function PanelsInner({ displayerMode }) {
|
|
108
118
|
const preferences = usePreferences();
|
|
@@ -32,9 +32,6 @@ function PeaksPanelInner({ peaks, info, xDomain, activeTab, preferences, }) {
|
|
|
32
32
|
}, [modal, yesHandler]);
|
|
33
33
|
const settingsPanelHandler = useCallback(() => {
|
|
34
34
|
setFlipStatus(!isFlipped);
|
|
35
|
-
if (!isFlipped) {
|
|
36
|
-
settingRef.current.cancelSetting();
|
|
37
|
-
}
|
|
38
35
|
}, [isFlipped]);
|
|
39
36
|
const saveSettingHandler = useCallback(() => {
|
|
40
37
|
settingRef.current.saveSetting();
|
|
@@ -7,7 +7,7 @@ import FormikForm from '../../elements/formik/FormikForm';
|
|
|
7
7
|
import { useAlert } from '../../elements/popup/Alert';
|
|
8
8
|
import useNucleus from '../../hooks/useNucleus';
|
|
9
9
|
import { SET_PANELS_PREFERENCES } from '../../reducer/preferencesReducer';
|
|
10
|
-
import {
|
|
10
|
+
import { getValue as getValueByKeyPath } from '../../utility/LocalStorage';
|
|
11
11
|
import { peaksDefaultValues } from '../extra/preferences/defaultValues';
|
|
12
12
|
const styles = {
|
|
13
13
|
container: {
|
|
@@ -83,7 +83,6 @@ const formatFields = [
|
|
|
83
83
|
];
|
|
84
84
|
function PeaksPreferencesInner({ nucleus, preferences, innerRef, }) {
|
|
85
85
|
const alert = useAlert();
|
|
86
|
-
const [, setSettingsData] = useStateWithLocalStorage('nmr-general-settings');
|
|
87
86
|
const formRef = useRef(null);
|
|
88
87
|
const updateValues = useCallback(() => {
|
|
89
88
|
if (nucleus) {
|
|
@@ -98,27 +97,19 @@ function PeaksPreferencesInner({ nucleus, preferences, innerRef, }) {
|
|
|
98
97
|
useEffect(() => {
|
|
99
98
|
updateValues();
|
|
100
99
|
}, [updateValues]);
|
|
101
|
-
const saveHandler = useCallback((values
|
|
100
|
+
const saveHandler = useCallback((values) => {
|
|
102
101
|
preferences.dispatch({
|
|
103
102
|
type: SET_PANELS_PREFERENCES,
|
|
104
103
|
payload: { key: 'peaks', value: values },
|
|
105
104
|
});
|
|
106
|
-
|
|
107
|
-
alert.success('Peaks preferences saved successfully');
|
|
105
|
+
alert.success('Peaks preferences saved successfully');
|
|
108
106
|
}, [alert, preferences]);
|
|
109
107
|
useImperativeHandle(innerRef, () => ({
|
|
110
108
|
saveSetting: () => {
|
|
111
109
|
formRef.current.submitForm();
|
|
112
110
|
},
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
},
|
|
116
|
-
}), [updateValues]);
|
|
117
|
-
const handleSubmit = useCallback((values) => {
|
|
118
|
-
saveHandler(values, true);
|
|
119
|
-
setSettingsData(values, 'formatting.panels.peaks');
|
|
120
|
-
}, [saveHandler, setSettingsData]);
|
|
121
|
-
return (_jsx("div", { style: styles.container, children: _jsx(FormikForm, { onSubmit: handleSubmit, ref: formRef, children: nucleus?.map((nucleusLabel) => (_jsxs("div", { style: styles.groupContainer, children: [_jsx(IsotopesViewer, { style: styles.header, value: nucleusLabel }, void 0), formatFields.map((field) => (_jsx(FormikColumnFormatField, { label: field.label, checkControllerName: `${nucleusLabel}.${field.checkController}`, formatControllerName: `${nucleusLabel}.${field.formatController}`, hideFormat: field.formatController === 'deltaPPMFormat' }, field.id)))] }, nucleusLabel))) }, void 0) }, void 0));
|
|
111
|
+
}), []);
|
|
112
|
+
return (_jsx("div", { style: styles.container, children: _jsx(FormikForm, { onSubmit: saveHandler, ref: formRef, children: nucleus?.map((nucleusLabel) => (_jsxs("div", { style: styles.groupContainer, children: [_jsx(IsotopesViewer, { style: styles.header, value: nucleusLabel }, void 0), formatFields.map((field) => (_jsx(FormikColumnFormatField, { label: field.label, checkControllerName: `${nucleusLabel}.${field.checkController}`, formatControllerName: `${nucleusLabel}.${field.formatController}`, hideFormat: field.formatController === 'deltaPPMFormat' }, field.id)))] }, nucleusLabel))) }, void 0) }, void 0));
|
|
122
113
|
}
|
|
123
114
|
const MemoizedPeaksPreferences = memo(PeaksPreferencesInner);
|
|
124
115
|
// TODO: remove this hacky use of ref.
|
|
@@ -100,9 +100,6 @@ function RangesTablePanelInner({ ranges, data, info, xDomain, preferences, activ
|
|
|
100
100
|
}, [isFilterActive]);
|
|
101
101
|
const settingsPanelHandler = useCallback(() => {
|
|
102
102
|
setFlipStatus(!isFlipped);
|
|
103
|
-
if (!isFlipped) {
|
|
104
|
-
settingRef.current.cancelSetting();
|
|
105
|
-
}
|
|
106
103
|
}, [isFlipped]);
|
|
107
104
|
const saveSettingHandler = useCallback(() => {
|
|
108
105
|
settingRef.current.saveSetting();
|
|
@@ -9,7 +9,7 @@ import FormikInput from '../../elements/formik/FormikInput';
|
|
|
9
9
|
import { useAlert } from '../../elements/popup/Alert';
|
|
10
10
|
import useNucleus from '../../hooks/useNucleus';
|
|
11
11
|
import { SET_PANELS_PREFERENCES } from '../../reducer/preferencesReducer';
|
|
12
|
-
import {
|
|
12
|
+
import { getValue as getValueByKeyPath } from '../../utility/LocalStorage';
|
|
13
13
|
import { getRangeDefaultValues } from '../extra/preferences/defaultValues';
|
|
14
14
|
const styles = {
|
|
15
15
|
container: {
|
|
@@ -71,7 +71,6 @@ const formatFields = [
|
|
|
71
71
|
];
|
|
72
72
|
function RangesPreferencesInner({ nucleus, preferences, innerRef, }) {
|
|
73
73
|
const alert = useAlert();
|
|
74
|
-
const [, setSettingsData] = useStateWithLocalStorage('nmr-general-settings');
|
|
75
74
|
const formRef = useRef();
|
|
76
75
|
const updateValues = useCallback(() => {
|
|
77
76
|
if (nucleus) {
|
|
@@ -86,31 +85,19 @@ function RangesPreferencesInner({ nucleus, preferences, innerRef, }) {
|
|
|
86
85
|
useEffect(() => {
|
|
87
86
|
updateValues();
|
|
88
87
|
}, [updateValues]);
|
|
89
|
-
const
|
|
90
|
-
setSettingsData(values, 'formatting.panels.ranges');
|
|
91
|
-
};
|
|
92
|
-
const saveHandler = useCallback((values, showMessage = false) => {
|
|
88
|
+
const saveHandler = useCallback((values) => {
|
|
93
89
|
preferences.dispatch({
|
|
94
90
|
type: SET_PANELS_PREFERENCES,
|
|
95
91
|
payload: { key: 'ranges', value: values },
|
|
96
92
|
});
|
|
97
|
-
|
|
98
|
-
alert.success('ranges preferences saved successfully');
|
|
99
|
-
}
|
|
93
|
+
alert.success('ranges preferences saved successfully');
|
|
100
94
|
}, [alert, preferences]);
|
|
101
95
|
useImperativeHandle(innerRef, () => ({
|
|
102
96
|
saveSetting: () => {
|
|
103
97
|
formRef.current.submitForm();
|
|
104
98
|
},
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
},
|
|
108
|
-
}), [updateValues]);
|
|
109
|
-
const handleSubmit = (values) => {
|
|
110
|
-
saveHandler(values, true);
|
|
111
|
-
saveToLocalStorgate(values);
|
|
112
|
-
};
|
|
113
|
-
return (_jsx("div", { style: styles.container, children: _jsx(FormikForm, { onSubmit: handleSubmit, ref: formRef, children: nucleus?.map((nucleusLabel) => (_jsxs("div", { style: styles.groupContainer, children: [_jsx(IsotopesViewer, { style: styles.header, value: nucleusLabel }, void 0), formatFields.map((field) => (_jsx(FormikColumnFormatField, { label: field.label, checkControllerName: `${nucleusLabel}.${field.checkController}`, formatControllerName: `${nucleusLabel}.${field.formatController}` }, field.id))), _jsx(Label, { title: "J Graph tolerance (Hz) :", style: { label: styles.inputLabel, wrapper: styles.inputWrapper }, children: _jsx(FormikInput, { name: `${nucleusLabel}.jGraphTolerance`, type: "number" }, void 0) }, void 0)] }, nucleusLabel))) }, void 0) }, void 0));
|
|
99
|
+
}), []);
|
|
100
|
+
return (_jsx("div", { style: styles.container, children: _jsx(FormikForm, { onSubmit: saveHandler, ref: formRef, children: nucleus?.map((nucleusLabel) => (_jsxs("div", { style: styles.groupContainer, children: [_jsx(IsotopesViewer, { style: styles.header, value: nucleusLabel }, void 0), formatFields.map((field) => (_jsx(FormikColumnFormatField, { label: field.label, checkControllerName: `${nucleusLabel}.${field.checkController}`, formatControllerName: `${nucleusLabel}.${field.formatController}` }, field.id))), _jsx(Label, { title: "J Graph tolerance (Hz) :", style: { label: styles.inputLabel, wrapper: styles.inputWrapper }, children: _jsx(FormikInput, { name: `${nucleusLabel}.jGraphTolerance`, type: "number" }, void 0) }, void 0)] }, nucleusLabel))) }, void 0) }, void 0));
|
|
114
101
|
}
|
|
115
102
|
const MemoizedRangesPreferences = memo(RangesPreferencesInner);
|
|
116
103
|
// TODO: remove this hacky use of ref.
|
|
@@ -7,10 +7,11 @@ import { useDispatch } from '../../context/DispatchContext';
|
|
|
7
7
|
import Button from '../../elements/ButtonToolTip';
|
|
8
8
|
import { useAlert } from '../../elements/popup/Alert';
|
|
9
9
|
import { useModal } from '../../elements/popup/Modal';
|
|
10
|
+
import { useCheckToolsVisibility } from '../../hooks/useCheckToolsVisibility';
|
|
10
11
|
import { DISPLAYER_MODE } from '../../reducer/core/Constants';
|
|
11
12
|
import { ADD_MISSING_PROJECTION, CHANGE_VISIBILITY, DELETE_SPECTRA, RESET_SPECTRA_SCALE, SET_SPECTRA_SAME_TOP, AUTO_RANGES_SPECTRA_PICKING, AUTO_ZONES_SPECTRA_PICKING, } from '../../reducer/types/Types';
|
|
12
13
|
import DefaultPanelHeader from '../header/DefaultPanelHeader';
|
|
13
|
-
function SpectraPanelHeaderInner({ data, activeSpectrum, activeTab, displayerMode, spectrums, }) {
|
|
14
|
+
function SpectraPanelHeaderInner({ data, activeSpectrum, activeTab, displayerMode, spectrums, isAutomaticPickingVisible, }) {
|
|
14
15
|
const modal = useModal();
|
|
15
16
|
const alert = useAlert();
|
|
16
17
|
const dispatch = useDispatch();
|
|
@@ -72,10 +73,19 @@ function SpectraPanelHeaderInner({ data, activeSpectrum, activeTab, displayerMod
|
|
|
72
73
|
hideLoading();
|
|
73
74
|
}, 0);
|
|
74
75
|
}, [dispatch, alert]);
|
|
75
|
-
return (_jsxs(DefaultPanelHeader, { onDelete: handleDelete, counter: spectrums?.length, deleteToolTip: "Delete all spectra", children: [_jsx(Button, { popupTitle: "Hide all spectra", onClick: hideAllSpectrumsHandler, children: _jsx(FaEyeSlash, {}, void 0) }, void 0), _jsx(Button, { popupTitle: "Show all spectra", onClick: showAllSpectrumsHandler, children: _jsx(FaEye, {}, void 0) }, void 0), activeSpectrum && activeTab && activeTab.split(',').length > 1 && (_jsx(Button, { popupTitle: "Add missing projection", onClick: addMissingProjectionHandler, children: _jsx(FaCreativeCommonsSamplingPlus, {}, void 0) }, void 0)), displayerMode === DISPLAYER_MODE.DM_1D && spectrums.length > 1 && (_jsxs(_Fragment, { children: [_jsx(Button, { popupTitle: "Reset Scale", onClick: resetScaleHandler, children: _jsx(SvgNmrResetScale, {}, void 0) }, void 0), _jsx(Button, { popupTitle: "Same Top", onClick: setSameTopHandler, children: _jsx(SvgNmrSameTop, {}, void 0) }, void 0)] }, void 0)), data && data.length > 0 && (_jsx(Button, { popupTitle: "Automatic Ranges/Zones picking for all spectra", onClick: automaticPickingHandler, children: _jsx(SvgNmrRangePicking, {}, void 0) }, void 0))] }, void 0));
|
|
76
|
+
return (_jsxs(DefaultPanelHeader, { onDelete: handleDelete, counter: spectrums?.length, deleteToolTip: "Delete all spectra", children: [_jsx(Button, { popupTitle: "Hide all spectra", onClick: hideAllSpectrumsHandler, children: _jsx(FaEyeSlash, {}, void 0) }, void 0), _jsx(Button, { popupTitle: "Show all spectra", onClick: showAllSpectrumsHandler, children: _jsx(FaEye, {}, void 0) }, void 0), activeSpectrum && activeTab && activeTab.split(',').length > 1 && (_jsx(Button, { popupTitle: "Add missing projection", onClick: addMissingProjectionHandler, children: _jsx(FaCreativeCommonsSamplingPlus, {}, void 0) }, void 0)), displayerMode === DISPLAYER_MODE.DM_1D && spectrums.length > 1 && (_jsxs(_Fragment, { children: [_jsx(Button, { popupTitle: "Reset Scale", onClick: resetScaleHandler, children: _jsx(SvgNmrResetScale, {}, void 0) }, void 0), _jsx(Button, { popupTitle: "Same Top", onClick: setSameTopHandler, children: _jsx(SvgNmrSameTop, {}, void 0) }, void 0)] }, void 0)), data && data.length > 0 && isAutomaticPickingVisible && (_jsx(Button, { popupTitle: "Automatic Ranges/Zones picking for all spectra", onClick: automaticPickingHandler, children: _jsx(SvgNmrRangePicking, {}, void 0) }, void 0))] }, void 0));
|
|
76
77
|
}
|
|
77
78
|
const MemoizedSpectraPanelHeader = memo(SpectraPanelHeaderInner);
|
|
78
79
|
export default function SpectrumsTabs({ spectrums }) {
|
|
79
80
|
const { data, activeSpectrum, activeTab, displayerMode } = useChartData();
|
|
80
|
-
|
|
81
|
+
const isToolVisible = useCheckToolsVisibility();
|
|
82
|
+
const isAutomaticPickingVisible = isToolVisible('hideAutoRangesTool');
|
|
83
|
+
return (_jsx(MemoizedSpectraPanelHeader, { ...{
|
|
84
|
+
data,
|
|
85
|
+
activeSpectrum,
|
|
86
|
+
activeTab,
|
|
87
|
+
displayerMode,
|
|
88
|
+
spectrums,
|
|
89
|
+
isAutomaticPickingVisible,
|
|
90
|
+
} }, void 0));
|
|
81
91
|
}
|
|
@@ -42,7 +42,7 @@ function Spectrum2DHistogram({ color = 'red', data, options = {}, }) {
|
|
|
42
42
|
}
|
|
43
43
|
return { sanPlot, lines };
|
|
44
44
|
}, [data.z, options, yLogBase]);
|
|
45
|
-
return (_jsxs("div", { children: [_jsx("
|
|
45
|
+
return (_jsxs("div", { children: [_jsx("div", { style: { textAlign: 'center', paddingBottom: 5, paddingTop: 5 }, children: "San Plot" }, void 0), _jsxs("div", { style: {
|
|
46
46
|
borderTop: '1px solid #ededed',
|
|
47
47
|
marginTop: '10px',
|
|
48
48
|
paddingTop: '10px',
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Correlation, Link } from 'nmr-correlation';
|
|
2
2
|
interface MoveLinkProps {
|
|
3
|
-
correlationDim1:
|
|
4
|
-
correlationDim2:
|
|
5
|
-
link:
|
|
6
|
-
correlations:
|
|
3
|
+
correlationDim1: Correlation;
|
|
4
|
+
correlationDim2: Correlation;
|
|
5
|
+
link: Link;
|
|
6
|
+
correlations: Correlation[];
|
|
7
7
|
onEdit: (action: string, valueDim1: string, valueDim2: string | undefined) => void;
|
|
8
8
|
}
|
|
9
9
|
declare function MoveLink({ correlationDim1, correlationDim2, link, correlations, onEdit, }: MoveLinkProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
2
|
/** @jsxImportSource @emotion/react */
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
|
-
import { getLinkDelta, getLinkDim } from 'nmr-correlation';
|
|
4
|
+
import { getLinkDelta, getLinkDim, } from 'nmr-correlation';
|
|
5
5
|
import { memo, useCallback, useEffect, useMemo, useState } from 'react';
|
|
6
6
|
import { FaFlask, FaSlidersH } from 'react-icons/fa';
|
|
7
7
|
import { findRange, findSignal1D, findSignal2D, findSpectrum, findZone, } from '../../../data/utilities/FindUtilities';
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Link, Correlation } from 'nmr-correlation';
|
|
2
2
|
import { Datum2D } from '../../../data/types/data2d';
|
|
3
3
|
declare function getAtomType(nucleus: string): string;
|
|
4
4
|
declare function getLabelColor(correlationData: any, correlation: any): string | null;
|
|
5
|
-
declare function findSignalMatch1D(spectrum: Datum2D, link:
|
|
6
|
-
declare function findSignalMatch2D(spectrum: Datum2D, link:
|
|
7
|
-
declare function getAbbreviation(link:
|
|
5
|
+
declare function findSignalMatch1D(spectrum: Datum2D, link: Link, factor: number, xDomain0: number, xDomain1: number): boolean;
|
|
6
|
+
declare function findSignalMatch2D(spectrum: Datum2D, link: Link, factor: number, xDomain0: number, xDomain1: number, yDomain0: number, yDomain1: number): boolean;
|
|
7
|
+
declare function getAbbreviation(link: Link): string;
|
|
8
8
|
declare function buildNewLink1D(link: any): Link;
|
|
9
|
-
declare function buildNewLink2D(link:
|
|
10
|
-
declare function cloneCorrelationAndEditLink(correlation:
|
|
9
|
+
declare function buildNewLink2D(link: Link, axis: 'x' | 'y'): Link;
|
|
10
|
+
declare function cloneCorrelationAndEditLink(correlation: Correlation, link: Link, axis: 'x' | 'y', action: 'add' | 'remove' | 'unmove'): Correlation;
|
|
11
11
|
declare function getEditedCorrelations({ correlationDim1, correlationDim2, selectedCorrelationValueDim1, selectedCorrelationValueDim2, action, link, correlations, }: {
|
|
12
12
|
correlationDim1: any;
|
|
13
13
|
correlationDim2: any;
|
|
@@ -17,7 +17,7 @@ declare function getEditedCorrelations({ correlationDim1, correlationDim2, selec
|
|
|
17
17
|
link: any;
|
|
18
18
|
correlations: any;
|
|
19
19
|
}): {
|
|
20
|
-
editedCorrelations:
|
|
20
|
+
editedCorrelations: Correlation[];
|
|
21
21
|
buildCorrelationDataOptions: {
|
|
22
22
|
skipDataUpdate?: boolean | undefined;
|
|
23
23
|
};
|
|
@@ -118,9 +118,6 @@ function ZonesPanelInner({ zones, activeTab, xDomain, yDomain }) {
|
|
|
118
118
|
}, [assignmentData, dispatch, modal]);
|
|
119
119
|
const settingsPanelHandler = useCallback(() => {
|
|
120
120
|
setFlipStatus(!isFlipped);
|
|
121
|
-
if (!isFlipped) {
|
|
122
|
-
settingRef.current.cancelSetting();
|
|
123
|
-
}
|
|
124
121
|
}, [isFlipped]);
|
|
125
122
|
const saveSettingHandler = useCallback(() => {
|
|
126
123
|
settingRef.current.saveSetting();
|
|
@@ -7,7 +7,7 @@ import FormikForm from '../../elements/formik/FormikForm';
|
|
|
7
7
|
import { useAlert } from '../../elements/popup/Alert';
|
|
8
8
|
import useNucleus from '../../hooks/useNucleus';
|
|
9
9
|
import { SET_PANELS_PREFERENCES } from '../../reducer/preferencesReducer';
|
|
10
|
-
import {
|
|
10
|
+
import { getValue as getValueByKeyPath } from '../../utility/LocalStorage';
|
|
11
11
|
import { zoneDefaultValues } from '../extra/preferences/defaultValues';
|
|
12
12
|
const styles = {
|
|
13
13
|
container: {
|
|
@@ -71,7 +71,6 @@ const formatFields = [
|
|
|
71
71
|
];
|
|
72
72
|
function ZonesPreferencesInner({ nucleus, innerRef, }) {
|
|
73
73
|
const alert = useAlert();
|
|
74
|
-
const [, setSettingsData] = useStateWithLocalStorage('nmr-general-settings');
|
|
75
74
|
const preferences = usePreferences();
|
|
76
75
|
const formRef = useRef();
|
|
77
76
|
const updateValues = useCallback(() => {
|
|
@@ -87,31 +86,19 @@ function ZonesPreferencesInner({ nucleus, innerRef, }) {
|
|
|
87
86
|
useEffect(() => {
|
|
88
87
|
updateValues();
|
|
89
88
|
}, [updateValues]);
|
|
90
|
-
const
|
|
91
|
-
setSettingsData(values, 'formatting.panels.ranges');
|
|
92
|
-
};
|
|
93
|
-
const saveHandler = useCallback((values, showMessage = false) => {
|
|
89
|
+
const saveHandler = useCallback((values) => {
|
|
94
90
|
preferences.dispatch({
|
|
95
91
|
type: SET_PANELS_PREFERENCES,
|
|
96
92
|
payload: { key: 'zones', value: values },
|
|
97
93
|
});
|
|
98
|
-
|
|
99
|
-
alert.success('zones preferences saved successfully');
|
|
100
|
-
}
|
|
94
|
+
alert.success('zones preferences saved successfully');
|
|
101
95
|
}, [alert, preferences]);
|
|
102
96
|
useImperativeHandle(innerRef, () => ({
|
|
103
97
|
saveSetting: () => {
|
|
104
98
|
formRef.current.submitForm();
|
|
105
99
|
},
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
},
|
|
109
|
-
}), [updateValues]);
|
|
110
|
-
const handleSubmit = (values) => {
|
|
111
|
-
saveHandler(values, true);
|
|
112
|
-
saveToLocalStorgate(values);
|
|
113
|
-
};
|
|
114
|
-
return (_jsx("div", { style: styles.container, children: _jsx(FormikForm, { onSubmit: handleSubmit, ref: formRef, children: nucleus?.map((nucleusLabel) => (_jsxs("div", { style: styles.groupContainer, children: [_jsx(IsotopesViewer, { style: styles.header, value: nucleusLabel }, void 0), formatFields.map((field) => (_jsx(FormikColumnFormatField, { label: field.label, checkControllerName: `${nucleusLabel}.${field.checkController}`, formatControllerName: `${nucleusLabel}.${field.formatController}` }, field.id)))] }, nucleusLabel))) }, void 0) }, void 0));
|
|
100
|
+
}), []);
|
|
101
|
+
return (_jsx("div", { style: styles.container, children: _jsx(FormikForm, { onSubmit: saveHandler, ref: formRef, children: nucleus?.map((nucleusLabel) => (_jsxs("div", { style: styles.groupContainer, children: [_jsx(IsotopesViewer, { style: styles.header, value: nucleusLabel }, void 0), formatFields.map((field) => (_jsx(FormikColumnFormatField, { label: field.label, checkControllerName: `${nucleusLabel}.${field.checkController}`, formatControllerName: `${nucleusLabel}.${field.formatController}` }, field.id)))] }, nucleusLabel))) }, void 0) }, void 0));
|
|
115
102
|
}
|
|
116
103
|
const MemoizedZonesPreferences = memo(ZonesPreferencesInner);
|
|
117
104
|
// TODO: remove this hacky use of ref.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@emotion/react/jsx-runtime";
|
|
2
2
|
/** @jsxImportSource @emotion/react */
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
4
|
import { useMemo, useCallback, useRef } from 'react';
|
|
@@ -109,6 +109,13 @@ function ZonesTable({ tableData, onUnlink, context, nuclei }) {
|
|
|
109
109
|
}, [tableData]);
|
|
110
110
|
const { items: sortedData, isSortedDesc, onSort } = useTableSortBy(data);
|
|
111
111
|
const rows = useMemo(() => sortedData.map((rowData, index) => (_jsx(ZonesTableRow, { rowIndex: index, rowData: rowData, onUnlink: onUnlink, onContextMenu: (e, rowData) => contextMenuHandler(e, rowData) }, `${rowData.tableMetaInfo.id}`))), [contextMenuHandler, sortedData, onUnlink]);
|
|
112
|
-
return (_jsxs("div", { children: [_jsxs("table", { css: tableStyle, children: [_jsxs("thead", { children: [_jsxs("tr", { children: [_jsx("th", { rowSpan: 2, children: "#" }, void 0), _jsx("th", { colSpan: 2, children: "\u03B4 (ppm)" }, void 0), _jsx("th", { colSpan: 2, children: _jsx(FaLink, {}, void 0) }, void 0), _jsx("th", { colSpan: 2, children: "\u03A3" }, void 0), _jsx("th", { rowSpan: 2, children: "Kind" }, void 0), _jsx("th", { rowSpan: 2, children: '' }, void 0)] }, void 0), _jsxs("tr", { children: [
|
|
112
|
+
return (_jsxs("div", { children: [_jsxs("table", { css: tableStyle, children: [_jsxs("thead", { children: [_jsxs("tr", { children: [_jsx("th", { rowSpan: 2, children: "#" }, void 0), _jsx("th", { colSpan: 2, children: "\u03B4 (ppm)" }, void 0), _jsx("th", { colSpan: 2, children: _jsx(FaLink, {}, void 0) }, void 0), _jsx("th", { colSpan: 2, children: "\u03A3" }, void 0), _jsx("th", { rowSpan: 2, children: "Kind" }, void 0), _jsx("th", { rowSpan: 2, children: '' }, void 0)] }, void 0), _jsxs("tr", { children: [_jsx("th", { id: "tableMetaInfo.signal.x.delta", ...onSort, children: _jsxs(SurroundedText, { text: "F2", children: [nuclei[0], ' ', isSortedDesc('tableMetaInfo.signal.x.delta').content] }, void 0) }, void 0), _jsx("th", { id: "tableMetaInfo.signal.y.delta", ...onSort, children: _jsxs(SurroundedText, { text: "F1", children: [nuclei[1], ' ', isSortedDesc('tableMetaInfo.signal.y.delta').content] }, void 0) }, void 0), _jsx("th", { children: _jsx(SurroundedText, { text: "F2", children: nuclei[0] }, void 0) }, void 0), _jsx("th", { children: _jsx(SurroundedText, { text: "F1", children: nuclei[1] }, void 0) }, void 0), _jsx("th", { children: _jsx(SurroundedText, { text: "F2", children: nuclei[0] }, void 0) }, void 0), _jsx("th", { children: _jsx(SurroundedText, { text: "F1", children: nuclei[1] }, void 0) }, void 0)] }, void 0)] }, void 0), _jsx("tbody", { children: rows }, void 0)] }, void 0), _jsx(ContextMenu, { ref: contextRef, context: context }, void 0)] }, void 0));
|
|
113
|
+
}
|
|
114
|
+
function SurroundedText(props) {
|
|
115
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", { style: {
|
|
116
|
+
position: 'absolute',
|
|
117
|
+
fontSize: 8,
|
|
118
|
+
color: '#3539E6',
|
|
119
|
+
}, children: props.text }, void 0), _jsx("div", { style: { marginLeft: 5 }, children: props.children }, void 0)] }, void 0));
|
|
113
120
|
}
|
|
114
121
|
export default ZonesTable;
|
|
@@ -61,9 +61,6 @@ function DatabasePanelInner({ nucleus, selectedTool }) {
|
|
|
61
61
|
const { item } = useAccordionContext('Database');
|
|
62
62
|
const settingsPanelHandler = useCallback(() => {
|
|
63
63
|
setFlipStatus(!isFlipped);
|
|
64
|
-
if (!isFlipped) {
|
|
65
|
-
settingRef.current.cancelSetting();
|
|
66
|
-
}
|
|
67
64
|
}, [isFlipped]);
|
|
68
65
|
const saveSettingHandler = useCallback(() => {
|
|
69
66
|
settingRef.current.saveSetting();
|
|
@@ -5,7 +5,7 @@ import FormikColumnFormatField from '../../elements/formik/FormikColumnFormatFie
|
|
|
5
5
|
import FormikForm from '../../elements/formik/FormikForm';
|
|
6
6
|
import { useAlert } from '../../elements/popup/Alert';
|
|
7
7
|
import { SET_PANELS_PREFERENCES } from '../../reducer/preferencesReducer';
|
|
8
|
-
import {
|
|
8
|
+
import { getValue as getValueByKeyPath } from '../../utility/LocalStorage';
|
|
9
9
|
import { databaseDefaultValues } from '../extra/preferences/defaultValues';
|
|
10
10
|
const styles = {
|
|
11
11
|
container: {
|
|
@@ -43,7 +43,6 @@ const styles = {
|
|
|
43
43
|
function DatabasePreferences(props, ref) {
|
|
44
44
|
const preferences = usePreferences();
|
|
45
45
|
const alert = useAlert();
|
|
46
|
-
const [, setSettingsData] = useStateWithLocalStorage('nmr-general-settings');
|
|
47
46
|
const formRef = useRef();
|
|
48
47
|
const updateValues = useCallback(() => {
|
|
49
48
|
const databasePreferences = getValueByKeyPath(preferences, `formatting.panels.database`);
|
|
@@ -52,30 +51,18 @@ function DatabasePreferences(props, ref) {
|
|
|
52
51
|
useEffect(() => {
|
|
53
52
|
updateValues();
|
|
54
53
|
}, [updateValues]);
|
|
55
|
-
const
|
|
56
|
-
setSettingsData(values, 'formatting.panels.database');
|
|
57
|
-
};
|
|
58
|
-
const saveHandler = useCallback((values, showMessage = false) => {
|
|
54
|
+
const saveHandler = useCallback((values) => {
|
|
59
55
|
preferences.dispatch({
|
|
60
56
|
type: SET_PANELS_PREFERENCES,
|
|
61
57
|
payload: { key: 'database', value: values },
|
|
62
58
|
});
|
|
63
|
-
|
|
64
|
-
alert.success('database preferences saved successfully');
|
|
65
|
-
}
|
|
59
|
+
alert.success('database preferences saved successfully');
|
|
66
60
|
}, [alert, preferences]);
|
|
67
61
|
useImperativeHandle(ref, () => ({
|
|
68
62
|
saveSetting: () => {
|
|
69
63
|
formRef.current.submitForm();
|
|
70
64
|
},
|
|
71
|
-
cancelSetting: () => {
|
|
72
|
-
updateValues();
|
|
73
|
-
},
|
|
74
65
|
}));
|
|
75
|
-
|
|
76
|
-
saveHandler(values, true);
|
|
77
|
-
saveToLocalStorage(values);
|
|
78
|
-
};
|
|
79
|
-
return (_jsx("div", { style: styles.container, children: _jsx(FormikForm, { onSubmit: handleSubmit, ref: formRef, children: _jsxs("div", { style: styles.groupContainer, children: [_jsx(FormikColumnFormatField, { label: "Smiles", checkControllerName: "showSmiles", hideFormat: true }, void 0), _jsx(FormikColumnFormatField, { label: "Solvent", checkControllerName: "showSolvent", hideFormat: true }, void 0), _jsx(FormikColumnFormatField, { label: "Names", checkControllerName: "showNames", hideFormat: true }, void 0), _jsx(FormikColumnFormatField, { label: "Range", checkControllerName: "showRange", hideFormat: true }, void 0), _jsx(FormikColumnFormatField, { label: "\u03B4 (ppm)", checkControllerName: "showDelta", hideFormat: true }, void 0), _jsx(FormikColumnFormatField, { label: "Assignment", checkControllerName: "showAssignment", hideFormat: true }, void 0), _jsx(FormikColumnFormatField, { label: "J (Hz)", checkControllerName: "showCoupling", hideFormat: true }, void 0), _jsx(FormikColumnFormatField, { label: "Multiplicity", checkControllerName: "showMultiplicity", hideFormat: true }, void 0)] }, void 0) }, void 0) }, void 0));
|
|
66
|
+
return (_jsx("div", { style: styles.container, children: _jsx(FormikForm, { onSubmit: saveHandler, ref: formRef, children: _jsxs("div", { style: styles.groupContainer, children: [_jsx(FormikColumnFormatField, { label: "Smiles", checkControllerName: "showSmiles", hideFormat: true }, void 0), _jsx(FormikColumnFormatField, { label: "Solvent", checkControllerName: "showSolvent", hideFormat: true }, void 0), _jsx(FormikColumnFormatField, { label: "Names", checkControllerName: "showNames", hideFormat: true }, void 0), _jsx(FormikColumnFormatField, { label: "Range", checkControllerName: "showRange", hideFormat: true }, void 0), _jsx(FormikColumnFormatField, { label: "\u03B4 (ppm)", checkControllerName: "showDelta", hideFormat: true }, void 0), _jsx(FormikColumnFormatField, { label: "Assignment", checkControllerName: "showAssignment", hideFormat: true }, void 0), _jsx(FormikColumnFormatField, { label: "J (Hz)", checkControllerName: "showCoupling", hideFormat: true }, void 0), _jsx(FormikColumnFormatField, { label: "Multiplicity", checkControllerName: "showMultiplicity", hideFormat: true }, void 0)] }, void 0) }, void 0) }, void 0));
|
|
80
67
|
}
|
|
81
68
|
export default forwardRef(DatabasePreferences);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import {
|
|
2
|
+
import { CorrelationData } from 'nmr-correlation';
|
|
3
3
|
import { SpectraAnalysis } from '../../data/data1d/MultipleAnalysis';
|
|
4
4
|
import { Molecule } from '../../data/molecules/Molecule';
|
|
5
5
|
import { Range } from '../../data/types/data1d';
|
|
@@ -20,11 +20,6 @@ export interface Margin {
|
|
|
20
20
|
left: number;
|
|
21
21
|
}
|
|
22
22
|
export declare const initialState: State;
|
|
23
|
-
export interface ExclusionZoneState {
|
|
24
|
-
id: string;
|
|
25
|
-
from: number;
|
|
26
|
-
to: number;
|
|
27
|
-
}
|
|
28
23
|
export declare type VerticalAlignment = 'bottom' | 'center' | 'stack';
|
|
29
24
|
export interface VerticalAlign {
|
|
30
25
|
align: VerticalAlignment;
|
|
@@ -164,7 +159,7 @@ export interface State {
|
|
|
164
159
|
/**
|
|
165
160
|
* Correlation data
|
|
166
161
|
*/
|
|
167
|
-
correlations:
|
|
162
|
+
correlations: CorrelationData;
|
|
168
163
|
/**
|
|
169
164
|
* Zoom Manager for vertical scale for spectra, integral, And undo zoom in per tab (nucleus)
|
|
170
165
|
* @default {history: {},spectra: {},integral: {}}
|
|
@@ -203,10 +198,6 @@ export interface State {
|
|
|
203
198
|
* list of zones for Baseline correction filter
|
|
204
199
|
*/
|
|
205
200
|
baseLineZones: any;
|
|
206
|
-
/**
|
|
207
|
-
* list of exclusive zones per nucleus
|
|
208
|
-
*/
|
|
209
|
-
exclusionZones: Record<string, Array<ExclusionZoneState>>;
|
|
210
201
|
/**
|
|
211
202
|
* pivot point for manual phase correction
|
|
212
203
|
* @default {value:0,index:0}
|
|
@@ -323,9 +314,6 @@ export declare const spectrumReducer: (base: {
|
|
|
323
314
|
readonly id: string;
|
|
324
315
|
readonly originalX: number;
|
|
325
316
|
readonly kind?: string | undefined;
|
|
326
|
-
readonly x: number;
|
|
327
|
-
readonly y: number;
|
|
328
|
-
readonly width: number;
|
|
329
317
|
readonly fwhm?: number | undefined;
|
|
330
318
|
readonly shape?: {
|
|
331
319
|
readonly kind: "gaussian";
|
|
@@ -339,6 +327,9 @@ export declare const spectrumReducer: (base: {
|
|
|
339
327
|
readonly fwhm?: number | undefined;
|
|
340
328
|
readonly mu?: number | undefined;
|
|
341
329
|
} | undefined;
|
|
330
|
+
readonly x: number;
|
|
331
|
+
readonly y: number;
|
|
332
|
+
readonly width: number;
|
|
342
333
|
}[];
|
|
343
334
|
readonly options: any;
|
|
344
335
|
};
|
|
@@ -388,9 +379,6 @@ export declare const spectrumReducer: (base: {
|
|
|
388
379
|
readonly integration?: number | undefined;
|
|
389
380
|
readonly peaks?: readonly {
|
|
390
381
|
readonly kind?: string | undefined;
|
|
391
|
-
readonly x: number;
|
|
392
|
-
readonly y: number;
|
|
393
|
-
readonly width: number;
|
|
394
382
|
readonly fwhm?: number | undefined;
|
|
395
383
|
readonly shape?: {
|
|
396
384
|
readonly kind: "gaussian";
|
|
@@ -404,6 +392,9 @@ export declare const spectrumReducer: (base: {
|
|
|
404
392
|
readonly fwhm?: number | undefined;
|
|
405
393
|
readonly mu?: number | undefined;
|
|
406
394
|
} | undefined;
|
|
395
|
+
readonly x: number;
|
|
396
|
+
readonly y: number;
|
|
397
|
+
readonly width: number;
|
|
407
398
|
}[] | undefined;
|
|
408
399
|
readonly statistic?: {
|
|
409
400
|
readonly mean: number;
|
|
@@ -718,13 +709,6 @@ export declare const spectrumReducer: (base: {
|
|
|
718
709
|
readonly selectedOptionPanel: string | null;
|
|
719
710
|
readonly data: {
|
|
720
711
|
readonly baseLineZones: any;
|
|
721
|
-
readonly exclusionZones: {
|
|
722
|
-
readonly [x: string]: readonly {
|
|
723
|
-
readonly id: string;
|
|
724
|
-
readonly from: number;
|
|
725
|
-
readonly to: number;
|
|
726
|
-
}[];
|
|
727
|
-
};
|
|
728
712
|
readonly pivot: {
|
|
729
713
|
readonly value: number;
|
|
730
714
|
readonly index: number;
|
|
@@ -757,9 +741,6 @@ export declare const spectrumReducer: (base: {
|
|
|
757
741
|
readonly integration?: number | undefined;
|
|
758
742
|
readonly peaks?: readonly {
|
|
759
743
|
readonly kind?: string | undefined;
|
|
760
|
-
readonly x: number;
|
|
761
|
-
readonly y: number;
|
|
762
|
-
readonly width: number;
|
|
763
744
|
readonly fwhm?: number | undefined;
|
|
764
745
|
readonly shape?: {
|
|
765
746
|
readonly kind: "gaussian";
|
|
@@ -773,6 +754,9 @@ export declare const spectrumReducer: (base: {
|
|
|
773
754
|
readonly fwhm?: number | undefined;
|
|
774
755
|
readonly mu?: number | undefined;
|
|
775
756
|
} | undefined;
|
|
757
|
+
readonly x: number;
|
|
758
|
+
readonly y: number;
|
|
759
|
+
readonly width: number;
|
|
776
760
|
}[] | undefined;
|
|
777
761
|
readonly statistic?: {
|
|
778
762
|
readonly mean: number;
|
|
@@ -85,7 +85,6 @@ export const initialState = {
|
|
|
85
85
|
selectedOptionPanel: null,
|
|
86
86
|
data: {
|
|
87
87
|
baseLineZones: [],
|
|
88
|
-
exclusionZones: {},
|
|
89
88
|
pivot: { value: 0, index: 0 },
|
|
90
89
|
zonesNoiseFactor: 1,
|
|
91
90
|
activeFilterID: null,
|
|
@@ -249,6 +248,10 @@ function innerSpectrumReducer(draft, action) {
|
|
|
249
248
|
return FiltersActions.filterSnapshotHandler(draft, action);
|
|
250
249
|
case types.APPLY_MULTIPLE_SPECTRA_FILTER:
|
|
251
250
|
return FiltersActions.handleMultipleSpectraFilter(draft, action);
|
|
251
|
+
case types.ADD_EXCLUSION_ZONE:
|
|
252
|
+
return FiltersActions.handleAddExclusionZone(draft, action);
|
|
253
|
+
case types.DELETE_EXCLUSION_ZONE:
|
|
254
|
+
return FiltersActions.handleDeleteExclusionZone(draft, action);
|
|
252
255
|
case types.CHANGE_VISIBILITY:
|
|
253
256
|
return SpectrumsActions.handleSpectrumVisibility(draft, action);
|
|
254
257
|
case types.CHANGE_PEAKS_MARKERS_VISIBILITY:
|
|
@@ -349,10 +352,6 @@ function innerSpectrumReducer(draft, action) {
|
|
|
349
352
|
return ToolsActions.handleAddBaseLineZone(draft, action.zone);
|
|
350
353
|
case types.DELETE_BASE_LINE_ZONE:
|
|
351
354
|
return ToolsActions.handleDeleteBaseLineZone(draft, action.id);
|
|
352
|
-
case types.ADD_EXCLUSION_ZONE:
|
|
353
|
-
return ToolsActions.handleAddExclusionZone(draft, action);
|
|
354
|
-
case types.DELETE_EXCLUSION_ZONE:
|
|
355
|
-
return ToolsActions.handleDeleteExclusionZone(draft, action);
|
|
356
355
|
case types.APPLY_BASE_LINE_CORRECTION_FILTER:
|
|
357
356
|
return FiltersActions.handleBaseLineCorrectionFilter(draft, action);
|
|
358
357
|
case types.SET_KEY_PREFERENCES:
|