nmrium 0.20.1 → 0.22.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/ExclusionZonesAnnotations.js +1 -2
- package/lib/component/1d/Integral.js +1 -6
- package/lib/component/1d/Viewer1D.js +4 -4
- package/lib/component/1d/ranges/RangeIntegral.js +2 -6
- package/lib/component/1d/utilities/scale.d.ts +1 -1
- package/lib/component/1d/utilities/scale.js +7 -6
- package/lib/component/2d/Viewer2D.js +5 -5
- package/lib/component/EventsTrackers/KeysListenerTracker.js +98 -81
- package/lib/component/NMRium.d.ts +9 -2
- package/lib/component/NMRium.js +9 -9
- package/lib/component/elements/EditableColumn.d.ts +1 -1
- package/lib/component/elements/NumberInput.d.ts +1 -2
- package/lib/component/elements/Tab/Tab.js +1 -0
- package/lib/component/header/Header.js +13 -10
- 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/{1d/utilities → hooks}/useIntegralPath.d.ts +0 -0
- package/lib/component/hooks/useIntegralPath.js +53 -0
- package/lib/component/hooks/useToolsFunctions.js +6 -6
- package/lib/component/hooks/useXScale.d.ts +2 -0
- package/lib/component/hooks/useXScale.js +7 -0
- package/lib/component/loader/DropZone.js +88 -88
- package/lib/component/modal/changeSum/ChangeSumModal.js +4 -2
- package/lib/component/modal/editRange/forms/validation/EditRangeValidation.js +1 -1
- package/lib/component/modal/editZone/EditPathLengthFormik.d.ts +5 -0
- package/lib/component/modal/editZone/EditPathLengthFormik.js +72 -0
- package/lib/component/modal/editZone/EditZoneModal.d.ts +8 -0
- package/lib/component/modal/editZone/EditZoneModal.js +96 -0
- package/lib/component/modal/editZone/SignalFormTab.d.ts +6 -0
- package/lib/component/modal/editZone/SignalFormTab.js +6 -0
- package/lib/component/modal/editZone/SignalsForm.d.ts +2 -0
- package/lib/component/modal/editZone/SignalsForm.js +62 -0
- package/lib/component/modal/editZone/validation/EditZoneValidation.d.ts +534 -0
- package/lib/component/modal/editZone/validation/EditZoneValidation.js +17 -0
- package/lib/component/modal/editZone/validation/isDefaultPathLength.d.ts +3 -0
- package/lib/component/modal/editZone/validation/isDefaultPathLength.js +7 -0
- package/lib/component/modal/setting/ControllersTabContent.js +1 -1
- package/lib/component/modal/setting/DisplayTabContent.js +1 -1
- package/lib/component/modal/setting/GeneralSettings.d.ts +1 -2
- package/lib/component/modal/setting/GeneralSettings.js +13 -9
- package/lib/component/panels/AutomaticAssignment/AutomaticAssignment.d.ts +2 -0
- package/lib/component/panels/AutomaticAssignment/AutomaticAssignment.js +13 -0
- package/lib/component/panels/AutomaticAssignment/AutomaticAssignmentTable.d.ts +7 -0
- package/lib/component/panels/AutomaticAssignment/AutomaticAssignmentTable.js +38 -0
- package/lib/component/panels/IntegralsPanel/IntegralPanel.js +0 -3
- package/lib/component/panels/IntegralsPanel/IntegralsPreferences.js +4 -17
- package/lib/component/panels/MoleculesPanel/MoleculePanel.js +1 -1
- package/lib/component/panels/Panels.d.ts +1 -1
- package/lib/component/panels/Panels.js +10 -14
- 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 +2 -5
- package/lib/component/panels/RangesPanel/RangesPreferences.js +5 -18
- package/lib/component/panels/SpectrumsPanel/SpectraPanelHeader.js +13 -3
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +7 -2
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnHeader.js +7 -2
- package/lib/component/panels/SummaryPanel/CorrelationTable/Constants.d.ts +1 -6
- package/lib/component/panels/SummaryPanel/CorrelationTable/Constants.js +1 -7
- package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTable.d.ts +2 -3
- package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTable.js +4 -5
- package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.d.ts +2 -3
- package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +21 -25
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/EditLinkModal.js +24 -30
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/EditPathLength.d.ts +8 -0
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/EditPathLength.js +89 -0
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.d.ts +6 -6
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +1 -1
- package/lib/component/panels/SummaryPanel/SummaryPanel.js +40 -43
- package/lib/component/panels/SummaryPanel/utilities/IsInView.d.ts +6 -0
- package/lib/component/panels/SummaryPanel/utilities/IsInView.js +16 -0
- package/lib/component/panels/SummaryPanel/utilities/Utilities.d.ts +29 -0
- package/lib/component/panels/SummaryPanel/{Utilities.js → utilities/Utilities.js} +155 -19
- package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.d.ts +1 -0
- package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +26 -3
- package/lib/component/panels/ZonesPanel/ZonesPanel.js +12 -7
- package/lib/component/panels/ZonesPanel/ZonesPreferences.js +5 -18
- package/lib/component/panels/ZonesPanel/ZonesTable.d.ts +3 -2
- package/lib/component/panels/ZonesPanel/ZonesTable.js +5 -2
- package/lib/component/panels/databasePanel/DatabasePanel.js +0 -3
- package/lib/component/panels/databasePanel/DatabasePreferences.js +4 -17
- package/lib/component/reducer/IgnoreActions.js +2 -1
- package/lib/component/reducer/Reducer.d.ts +20 -34
- package/lib/component/reducer/Reducer.js +7 -8
- package/lib/component/reducer/actions/CorrelationsActions.d.ts +7 -7
- package/lib/component/reducer/actions/CorrelationsActions.js +1 -1
- package/lib/component/reducer/actions/DatabaseActions.js +1 -1
- package/lib/component/reducer/actions/DomainActions.d.ts +3 -1
- package/lib/component/reducer/actions/DomainActions.js +20 -1
- package/lib/component/reducer/actions/IntegralsActions.js +2 -0
- package/lib/component/reducer/actions/LoadActions.js +22 -1
- package/lib/component/reducer/actions/PreferencesActions.js +0 -2
- package/lib/component/reducer/actions/RangesActions.js +3 -1
- package/lib/component/reducer/actions/SpectrumsActions.js +1 -1
- package/lib/component/reducer/actions/ToolsActions.js +43 -56
- package/lib/component/reducer/actions/ZonesActions.d.ts +3 -1
- package/lib/component/reducer/actions/ZonesActions.js +33 -2
- package/lib/component/reducer/helper/Zoom1DManager.d.ts +17 -21
- package/lib/component/reducer/helper/Zoom1DManager.js +53 -69
- package/lib/component/reducer/helper/ZoomHistoryManager.d.ts +1 -0
- package/lib/component/reducer/helper/ZoomHistoryManager.js +2 -1
- package/lib/component/reducer/preferencesReducer.d.ts +3 -8
- package/lib/component/reducer/preferencesReducer.js +87 -37
- package/lib/component/reducer/types/Types.d.ts +3 -1
- package/lib/component/reducer/types/Types.js +3 -1
- package/lib/component/toolbar/FunctionToolBar.js +7 -10
- package/lib/component/toolbar/ToolTypes.js +3 -3
- 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/constants/DefaultPathLengths.d.ts +6 -0
- package/lib/data/constants/DefaultPathLengths.js +8 -0
- package/lib/data/data1d/Spectrum1D/getSpectrumErrorValue.d.ts +2 -0
- package/lib/data/data1d/Spectrum1D/getSpectrumErrorValue.js +4 -0
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +7 -19
- package/lib/data/data1d/Spectrum1D/integrals/initiateIntegrals.d.ts +11 -0
- package/lib/data/data1d/Spectrum1D/integrals/initiateIntegrals.js +11 -0
- package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +2 -21
- package/lib/data/data1d/Spectrum1D/peaks/initiatePeaks.d.ts +9 -0
- package/lib/data/data1d/Spectrum1D/peaks/initiatePeaks.js +7 -0
- package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.d.ts +2 -0
- package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.js +29 -0
- package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.d.ts +13 -0
- package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.js +14 -0
- package/lib/data/data1d/Spectrum1D/ranges/mapRanges.js +13 -8
- package/lib/data/migration/MigrationManager.js +3 -0
- package/lib/versionInfo.js +1 -1
- package/lib-cjs/component/1d/ExclusionZonesAnnotations.js +1 -2
- package/lib-cjs/component/1d/Integral.js +1 -6
- package/lib-cjs/component/1d/Viewer1D.js +4 -4
- package/lib-cjs/component/1d/ranges/RangeIntegral.js +2 -6
- package/lib-cjs/component/1d/utilities/scale.js +7 -6
- package/lib-cjs/component/2d/Viewer2D.js +4 -4
- package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +98 -81
- package/lib-cjs/component/NMRium.js +10 -10
- package/lib-cjs/component/elements/Tab/Tab.js +1 -0
- package/lib-cjs/component/header/Header.js +13 -10
- package/lib-cjs/component/hooks/useCheckExperimentalFeature.js +5 -1
- package/lib-cjs/component/hooks/useCheckToolsVisibility.js +13 -0
- package/lib-cjs/component/hooks/useIntegralPath.js +56 -0
- package/lib-cjs/component/hooks/useToolsFunctions.js +6 -6
- package/lib-cjs/component/hooks/useXScale.js +11 -0
- package/lib-cjs/component/loader/DropZone.js +88 -88
- package/lib-cjs/component/modal/changeSum/ChangeSumModal.js +4 -2
- package/lib-cjs/component/modal/editRange/forms/validation/EditRangeValidation.js +1 -1
- package/lib-cjs/component/modal/editZone/EditPathLengthFormik.js +77 -0
- package/lib-cjs/component/modal/editZone/EditZoneModal.js +101 -0
- package/lib-cjs/component/modal/editZone/SignalFormTab.js +11 -0
- package/lib-cjs/component/modal/editZone/SignalsForm.js +67 -0
- package/lib-cjs/component/modal/editZone/validation/EditZoneValidation.js +38 -0
- package/lib-cjs/component/modal/editZone/validation/isDefaultPathLength.js +12 -0
- package/lib-cjs/component/modal/setting/ControllersTabContent.js +1 -1
- package/lib-cjs/component/modal/setting/DisplayTabContent.js +1 -1
- package/lib-cjs/component/modal/setting/GeneralSettings.js +12 -8
- package/lib-cjs/component/panels/AutomaticAssignment/AutomaticAssignment.js +18 -0
- package/lib-cjs/component/panels/AutomaticAssignment/AutomaticAssignmentTable.js +43 -0
- 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/MoleculesPanel/MoleculePanel.js +1 -1
- package/lib-cjs/component/panels/Panels.js +11 -15
- 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 +2 -5
- 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/SummaryPanel/CorrelationTable/AdditionalColumnField.js +7 -2
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnHeader.js +7 -2
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/Constants.js +1 -8
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTable.js +4 -5
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +21 -25
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/editLink/EditLinkModal.js +43 -30
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/editLink/EditPathLength.js +94 -0
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +1 -1
- package/lib-cjs/component/panels/SummaryPanel/SummaryPanel.js +38 -41
- package/lib-cjs/component/panels/SummaryPanel/utilities/IsInView.js +18 -0
- package/lib-cjs/component/panels/SummaryPanel/{Utilities.js → utilities/Utilities.js} +157 -19
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +24 -1
- package/lib-cjs/component/panels/ZonesPanel/ZonesPanel.js +12 -7
- package/lib-cjs/component/panels/ZonesPanel/ZonesPreferences.js +4 -17
- package/lib-cjs/component/panels/ZonesPanel/ZonesTable.js +5 -2
- 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/IgnoreActions.js +2 -1
- package/lib-cjs/component/reducer/Reducer.js +7 -8
- package/lib-cjs/component/reducer/actions/DatabaseActions.js +2 -2
- package/lib-cjs/component/reducer/actions/DomainActions.js +21 -1
- package/lib-cjs/component/reducer/actions/IntegralsActions.js +2 -0
- package/lib-cjs/component/reducer/actions/LoadActions.js +22 -1
- package/lib-cjs/component/reducer/actions/PreferencesActions.js +0 -2
- package/lib-cjs/component/reducer/actions/RangesActions.js +2 -0
- package/lib-cjs/component/reducer/actions/SpectrumsActions.js +2 -2
- package/lib-cjs/component/reducer/actions/ToolsActions.js +50 -63
- package/lib-cjs/component/reducer/actions/ZonesActions.js +35 -2
- package/lib-cjs/component/reducer/helper/Zoom1DManager.js +55 -73
- package/lib-cjs/component/reducer/helper/ZoomHistoryManager.js +2 -1
- package/lib-cjs/component/reducer/preferencesReducer.js +87 -37
- package/lib-cjs/component/reducer/types/Types.js +6 -4
- package/lib-cjs/component/toolbar/FunctionToolBar.js +7 -10
- package/lib-cjs/component/toolbar/ToolTypes.js +3 -3
- 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/constants/DefaultPathLengths.js +10 -0
- package/lib-cjs/data/data1d/Spectrum1D/getSpectrumErrorValue.js +8 -0
- package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +7 -19
- package/lib-cjs/data/data1d/Spectrum1D/integrals/initiateIntegrals.js +18 -0
- package/lib-cjs/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +2 -21
- package/lib-cjs/data/data1d/Spectrum1D/peaks/initiatePeaks.js +14 -0
- package/lib-cjs/data/data1d/Spectrum1D/peaks/mapPeaks.js +36 -0
- package/lib-cjs/data/data1d/Spectrum1D/ranges/initiateRanges.js +21 -0
- package/lib-cjs/data/data1d/Spectrum1D/ranges/mapRanges.js +13 -8
- package/lib-cjs/data/migration/MigrationManager.js +3 -0
- package/lib-cjs/versionInfo.js +1 -1
- package/package.json +15 -16
- package/lib/component/1d/utilities/useIntegralPath.js +0 -63
- 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/component/panels/SummaryPanel/Utilities.d.ts +0 -25
- package/lib/component/reducer/actions/Zoom.d.ts +0 -16
- package/lib/component/reducer/actions/Zoom.js +0 -92
- package/lib-cjs/component/1d/utilities/useIntegralPath.js +0 -66
- 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
- package/lib-cjs/component/reducer/actions/Zoom.js +0 -116
|
@@ -3,33 +3,31 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.preferencesInitialState = exports.SET_PANELS_PREFERENCES = exports.SET_PREFERENCES = exports.INIT_PREFERENCES = void 0;
|
|
6
|
+
exports.preferencesInitialState = exports.SET_PANELS_PREFERENCES = exports.RESET_PREFERENCES = exports.SET_PREFERENCES = exports.INIT_PREFERENCES = void 0;
|
|
7
7
|
const immer_1 = require("immer");
|
|
8
8
|
const merge_1 = __importDefault(require("lodash/merge"));
|
|
9
9
|
const NMRium_1 = require("../NMRium");
|
|
10
|
-
const basic_1 = __importDefault(require("../nmriumMode/basic"));
|
|
11
|
-
const exercise1D_1 = __importDefault(require("../nmriumMode/exercise1D"));
|
|
12
|
-
const process1D_1 = __importDefault(require("../nmriumMode/process1D"));
|
|
13
10
|
const LocalStorage_1 = require("../utility/LocalStorage");
|
|
11
|
+
const workspaces_1 = __importDefault(require("../workspaces"));
|
|
14
12
|
exports.INIT_PREFERENCES = 'INIT_PREFERENCES';
|
|
15
13
|
exports.SET_PREFERENCES = 'SET_PREFERENCES';
|
|
14
|
+
exports.RESET_PREFERENCES = 'RESET_PREFERENCES';
|
|
16
15
|
exports.SET_PANELS_PREFERENCES = 'SET_PANELS_PREFERENCES';
|
|
17
|
-
const
|
|
18
|
-
function
|
|
19
|
-
switch (
|
|
20
|
-
case NMRium_1.
|
|
21
|
-
return
|
|
22
|
-
case NMRium_1.
|
|
23
|
-
return
|
|
16
|
+
const LOCAL_STORAGE_VERSION = 3;
|
|
17
|
+
function getPreferencesByWorkspace(workspace) {
|
|
18
|
+
switch (workspace) {
|
|
19
|
+
case NMRium_1.NMRiumWorkspaces.EXERCISE_1D:
|
|
20
|
+
return workspaces_1.default.exercise1D;
|
|
21
|
+
case NMRium_1.NMRiumWorkspaces.PROCESS_1D:
|
|
22
|
+
return workspaces_1.default.process1D;
|
|
24
23
|
default:
|
|
25
|
-
return
|
|
24
|
+
return workspaces_1.default.basic;
|
|
26
25
|
}
|
|
27
26
|
}
|
|
28
27
|
exports.preferencesInitialState = {
|
|
29
28
|
basePreferences: {},
|
|
30
|
-
display:
|
|
29
|
+
display: workspaces_1.default.basic.display,
|
|
31
30
|
controllers: {
|
|
32
|
-
mws: { low: 2, high: 20 },
|
|
33
31
|
dimmedSpectraTransparency: 0.1,
|
|
34
32
|
},
|
|
35
33
|
formatting: {
|
|
@@ -45,7 +43,15 @@ exports.preferencesInitialState = {
|
|
|
45
43
|
panels: {},
|
|
46
44
|
},
|
|
47
45
|
dispatch: null,
|
|
46
|
+
workspace: 'default',
|
|
48
47
|
};
|
|
48
|
+
function getTruthyObjectValues(data) {
|
|
49
|
+
return JSON.parse(JSON.stringify(data), (key, value) => {
|
|
50
|
+
if (value) {
|
|
51
|
+
return value;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
}
|
|
49
55
|
function mapNucleus(draft) {
|
|
50
56
|
if (draft.formatting.nucleus && Array.isArray(draft.formatting.nucleus)) {
|
|
51
57
|
draft.formatting.nucleusByKey = draft.formatting.nucleus.reduce((acc, item) => {
|
|
@@ -56,51 +62,93 @@ function mapNucleus(draft) {
|
|
|
56
62
|
}
|
|
57
63
|
function handleInit(draft, action) {
|
|
58
64
|
const nmrLocalStorageVersion = (0, LocalStorage_1.getLocalStorage)('nmr-local-storage-version', false);
|
|
59
|
-
|
|
60
|
-
|
|
65
|
+
let localData = (0, LocalStorage_1.getLocalStorage)('nmr-general-settings');
|
|
66
|
+
// remove old nmr-local-storage-version key
|
|
67
|
+
if (nmrLocalStorageVersion && localData?.version) {
|
|
68
|
+
(0, LocalStorage_1.removeData)('nmr-local-storage-version');
|
|
69
|
+
}
|
|
70
|
+
if (!localData?.version || localData?.version !== LOCAL_STORAGE_VERSION) {
|
|
61
71
|
(0, LocalStorage_1.removeData)('nmr-general-settings');
|
|
62
|
-
(0, LocalStorage_1.storeData)('nmr-local-storage-version', LOCAL_STORGAE_VERSION);
|
|
63
72
|
}
|
|
64
|
-
const localData = (0, LocalStorage_1.getLocalStorage)('nmr-general-settings');
|
|
65
73
|
if (action.payload) {
|
|
66
|
-
const { dispatch,
|
|
67
|
-
draft.
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
const { dispatch, workspace, ...resProps } = action.payload;
|
|
75
|
+
draft.workspace = workspace;
|
|
76
|
+
const workspacePreferences = getPreferencesByWorkspace(workspace);
|
|
77
|
+
if (!localData ||
|
|
78
|
+
!localData?.workspaces[workspace] ||
|
|
79
|
+
workspacePreferences.version !== localData?.workspaces[workspace]?.version) {
|
|
80
|
+
localData = localData || {};
|
|
81
|
+
localData = {
|
|
82
|
+
version: LOCAL_STORAGE_VERSION,
|
|
83
|
+
workspaces: {
|
|
84
|
+
...localData.workspaces,
|
|
85
|
+
[workspace]: {
|
|
86
|
+
...workspacePreferences,
|
|
87
|
+
controllers: draft.controllers,
|
|
88
|
+
formatting: draft.formatting,
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
};
|
|
92
|
+
(0, LocalStorage_1.storeData)('nmr-general-settings', JSON.stringify(localData));
|
|
93
|
+
}
|
|
94
|
+
draft.basePreferences = (0, merge_1.default)({}, workspacePreferences, resProps);
|
|
95
|
+
const hiddenModeFeatures = getTruthyObjectValues(draft.basePreferences.display);
|
|
96
|
+
let hiddenLocalStorageFeatures = {};
|
|
76
97
|
draft.dispatch = dispatch;
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
98
|
+
const localStorageModePreferences = localData?.workspaces[workspace] || null;
|
|
99
|
+
if (localStorageModePreferences) {
|
|
100
|
+
Object.entries(localStorageModePreferences).forEach(([k, v]) => {
|
|
101
|
+
if (k === 'display') {
|
|
102
|
+
hiddenLocalStorageFeatures = getTruthyObjectValues(v);
|
|
103
|
+
}
|
|
104
|
+
else if (!['dispatch', 'basePreferences'].includes(k)) {
|
|
80
105
|
draft[k] = (0, merge_1.default)({}, resProps[k] ? resProps[k] : {}, v);
|
|
81
106
|
}
|
|
82
107
|
});
|
|
83
108
|
mapNucleus(draft);
|
|
84
109
|
}
|
|
110
|
+
draft.display = (0, merge_1.default)({}, getPreferencesByWorkspace(NMRium_1.NMRiumWorkspaces.DEFAULT).display, hiddenModeFeatures, hiddenLocalStorageFeatures);
|
|
85
111
|
}
|
|
86
112
|
}
|
|
87
113
|
function handleSetPreferences(draft, action) {
|
|
88
114
|
if (action.payload) {
|
|
89
|
-
const
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
115
|
+
const { controllers, formatting, display } = action.payload;
|
|
116
|
+
let localData = (0, LocalStorage_1.getLocalStorage)('nmr-general-settings');
|
|
117
|
+
localData.workspaces = {
|
|
118
|
+
...localData.workspaces,
|
|
119
|
+
[draft.workspace]: {
|
|
120
|
+
...localData.workspaces[draft.workspace],
|
|
121
|
+
controllers,
|
|
122
|
+
formatting,
|
|
123
|
+
display,
|
|
124
|
+
},
|
|
125
|
+
};
|
|
126
|
+
(0, LocalStorage_1.storeData)('nmr-general-settings', JSON.stringify(localData));
|
|
127
|
+
draft.controllers = controllers;
|
|
128
|
+
draft.formatting = formatting;
|
|
129
|
+
draft.display.panels = display.panels;
|
|
130
|
+
draft.display.general.hideExperimentalFeatures =
|
|
131
|
+
display.general.hideExperimentalFeatures;
|
|
95
132
|
mapNucleus(draft);
|
|
96
133
|
}
|
|
97
134
|
}
|
|
98
135
|
function handleSetPanelsPreferences(draft, action) {
|
|
99
136
|
if (action.payload) {
|
|
100
137
|
const { key, value } = action.payload;
|
|
138
|
+
let localData = (0, LocalStorage_1.getLocalStorage)('nmr-general-settings');
|
|
139
|
+
localData.workspaces[draft.workspace].formatting.panels[key] = value;
|
|
140
|
+
(0, LocalStorage_1.storeData)('nmr-general-settings', JSON.stringify(localData));
|
|
101
141
|
draft.formatting.panels[key] = value;
|
|
102
142
|
}
|
|
103
143
|
}
|
|
144
|
+
function handleResetPreferences(draft) {
|
|
145
|
+
let localData = (0, LocalStorage_1.getLocalStorage)('nmr-general-settings');
|
|
146
|
+
const hiddenFeatures = getTruthyObjectValues(draft.basePreferences.display);
|
|
147
|
+
const workSpaceDisplayPreferences = (0, merge_1.default)({}, getPreferencesByWorkspace(draft.workspace).display, hiddenFeatures);
|
|
148
|
+
localData.workspaces[draft.workspace].display = workSpaceDisplayPreferences;
|
|
149
|
+
draft.display = workSpaceDisplayPreferences;
|
|
150
|
+
(0, LocalStorage_1.storeData)('nmr-general-settings', JSON.stringify(localData));
|
|
151
|
+
}
|
|
104
152
|
function innerPreferencesReducer(draft, action) {
|
|
105
153
|
switch (action.type) {
|
|
106
154
|
case exports.INIT_PREFERENCES:
|
|
@@ -109,6 +157,8 @@ function innerPreferencesReducer(draft, action) {
|
|
|
109
157
|
return handleSetPreferences(draft, action);
|
|
110
158
|
case exports.SET_PANELS_PREFERENCES:
|
|
111
159
|
return handleSetPanelsPreferences(draft, action);
|
|
160
|
+
case exports.RESET_PREFERENCES:
|
|
161
|
+
return handleResetPreferences(draft);
|
|
112
162
|
default:
|
|
113
163
|
return draft;
|
|
114
164
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.APPLY_MANUAL_PHASE_CORRECTION_FILTER = exports.CALCULATE_MANUAL_PHASE_CORRECTION_FILTER = exports.APPLY_FFT_FILTER = exports.APPLY_ZERO_FILLING_FILTER = exports.DELETE_SPECTRA_FILTER = exports.DELETE_FILTER = exports.ENABLE_FILTER = exports.RESET_DOMAIN = exports.BRUSH_END = exports.RESIZE_INTEGRAL = exports.CHANGE_SPECTRUM_DISPLAY_VIEW_MODE = exports.DELETE_SPECTRA = exports.SET_CORRELATIONS_TOLERANCE = exports.SET_CORRELATIONS_MF = exports.DELETE_CORRELATION = exports.SET_CORRELATIONS = exports.SET_CORRELATION = exports.DELETE_MOLECULE = exports.SET_MOLECULE = exports.ADD_MOLECULE = exports.
|
|
4
|
-
exports.
|
|
5
|
-
exports.SHOW_J_GRAPH = exports.RESURRECTING_SPECTRUM_FROM_RANGES = exports.GENERATE_SPECTRUM_FROM_PUBLICATION_STRING = exports.AUTO_ZONES_SPECTRA_PICKING = exports.AUTO_RANGES_SPECTRA_PICKING = exports.SHOW_RANGES_INTEGRALS = exports.SHOW_MULTIPLICTY_TREES = exports.CHANGE_TEMP_RANGE = exports.CHANGE_ZONES_NOISE_FACTOR = exports.CHANGE_INTEGRALS_SUM_FLAG = exports.CHANGE_RANGES_SUM_FLAG = exports.DELETE_EXCLUSION_ZONE = exports.ADD_EXCLUSION_ZONE = exports.APPLY_MULTIPLE_SPECTRA_FILTER = exports.SET_MOUSE_OVER_DISPLAYER = void 0;
|
|
3
|
+
exports.APPLY_MANUAL_PHASE_CORRECTION_FILTER = exports.CALCULATE_MANUAL_PHASE_CORRECTION_FILTER = exports.APPLY_FFT_FILTER = exports.APPLY_ZERO_FILLING_FILTER = exports.DELETE_SPECTRA_FILTER = exports.DELETE_FILTER = exports.ENABLE_FILTER = exports.RESET_DOMAIN = exports.BRUSH_END = exports.RESIZE_INTEGRAL = exports.CHANGE_SPECTRUM_DISPLAY_VIEW_MODE = exports.DELETE_SPECTRA = exports.SET_CORRELATIONS_TOLERANCE = exports.SET_CORRELATIONS_MF = exports.DELETE_CORRELATION = exports.SET_CORRELATIONS = exports.SET_CORRELATION = exports.DELETE_MOLECULE = exports.SET_MOLECULE = exports.ADD_MOLECULE = exports.SET_ZOOM = exports.TOGGLE_REAL_IMAGINARY_VISIBILITY = exports.DELETE_INTEGRAL = exports.ADD_INTEGRAL = exports.CHANGE_SPECTRUM_COLOR = exports.CHANGE_ACTIVE_SPECTRUM = exports.CHANGE_PEAKS_MARKERS_VISIBILITY = exports.CHANGE_VISIBILITY = exports.FULL_ZOOM_OUT = exports.CHANGE_SPECTRUM_TYPE = exports.CHANGE_SPECTRUM_SETTING = exports.SET_SELECTED_FILTER = exports.SET_SELECTED_TOOL = exports.SET_DIMENSIONS = exports.SET_WIDTH = exports.SET_ORIGINAL_DOMAIN = exports.SET_Y_DOMAIN = exports.SET_X_DOMAIN = exports.SHIFT_SPECTRUM = exports.DELETE_PEAK_NOTATION = exports.ADD_PEAKS = exports.ADD_PEAK = exports.LOAD_JDF_FILE = exports.LOAD_ZIP_FILE = exports.LOAD_MOL_FILE = exports.LOAD_NMREDATA_FILE = exports.LOAD_JCAMP_FILE = exports.LOAD_JSON_FILE = exports.SAVE_DATA_AS_JSON = exports.INITIATE = void 0;
|
|
4
|
+
exports.PREDICT_SPECTRA = exports.SET_DIAID_ZONE = exports.UNLINK_ZONE = exports.SAVE_EDITED_ZONE = exports.CHANGE_ZONE_SIGNAL_KIND = exports.CHANGE_ZONE_SIGNAL_VALUE = exports.ALIGN_SPECTRA = exports.FILTER_SPECTRA_COLUMN = exports.SET_ANALYZE_SPECTRA_COLUMNS = exports.RESIZE_ANALYZE_SPECTRA_RANGE = exports.DELETE_ANALYZE_SPECTRA_RANGE = exports.ANALYZE_SPECTRA = exports.CHANGE_INTEGRAL_RELATIVE = exports.SET_DIAID_RANGE = exports.UNLINK_RANGE = exports.SAVE_EDITED_RANGE = exports.CHANGE_RANGE_SIGNAL_KIND = exports.CHANGE_RANGE_SIGNAL_VALUE = exports.CHANGE_RANGE_RELATIVE = exports.SET_FILTER_SNAPSHOT = exports.ADD_MISSING_PROJECTION = exports.SET_2D_SIGNAL_PATH_LENGTH = exports.DELETE_2D_SIGNAL = exports.DELETE_2D_ZONE = exports.ADD_2D_ZONE = exports.SET_2D_LEVEL = exports.ADD_RANGE = exports.CHANGE_RANGE_SUM = exports.RESIZE_RANGE = exports.APPLY_KEY_PREFERENCES = exports.SET_KEY_PREFERENCES = exports.APPLY_BASE_LINE_CORRECTION_FILTER = exports.DELETE_BASE_LINE_ZONE = exports.ADD_BASE_LINE_ZONE = exports.CHANGE_INTEGRAL_SUM = exports.SET_ACTIVE_TAB = exports.CHANGE_INTEGRAL_DATA = exports.SAVE_AS_SVG = exports.SET_SPECTRUMS_VERTICAL_ALIGN = exports.RESET_SELECTED_TOOL = exports.SET_LOADING_FLAG = exports.SET_SELECTED_OPTIONS_PANEL = exports.DELETE_1D_SIGNAL = exports.DELETE_RANGE = exports.AUTO_ZONES_DETECTION = exports.AUTO_RANGES_DETECTION = exports.AUTO_PEAK_PICKING = exports.SET_VERTICAL_INDICATOR_X_POSITION = exports.APPLY_ABSOLUTE_FILTER = exports.APPLY_AUTO_PHASE_CORRECTION_FILTER = void 0;
|
|
5
|
+
exports.SHOW_J_GRAPH = exports.RESURRECTING_SPECTRUM_FROM_RANGES = exports.GENERATE_SPECTRUM_FROM_PUBLICATION_STRING = exports.AUTO_ZONES_SPECTRA_PICKING = exports.AUTO_RANGES_SPECTRA_PICKING = exports.SHOW_RANGES_INTEGRALS = exports.SHOW_MULTIPLICTY_TREES = exports.CHANGE_TEMP_RANGE = exports.CHANGE_ZONES_NOISE_FACTOR = exports.CHANGE_INTEGRALS_SUM_FLAG = exports.CHANGE_RANGES_SUM_FLAG = exports.DELETE_EXCLUSION_ZONE = exports.ADD_EXCLUSION_ZONE = exports.APPLY_MULTIPLE_SPECTRA_FILTER = exports.SET_MOUSE_OVER_DISPLAYER = exports.RESET_SPECTRA_SCALE = exports.SET_SPECTRA_SAME_TOP = void 0;
|
|
6
6
|
exports.INITIATE = 'INITIATE';
|
|
7
7
|
exports.SAVE_DATA_AS_JSON = 'SAVE_DATA_AS_JSON';
|
|
8
8
|
exports.LOAD_JSON_FILE = 'LOAD_JSON_FILE';
|
|
@@ -32,7 +32,7 @@ exports.CHANGE_SPECTRUM_COLOR = 'CHANGE_SPECTRUM_COLOR';
|
|
|
32
32
|
exports.ADD_INTEGRAL = 'ADD_INTEGRAL';
|
|
33
33
|
exports.DELETE_INTEGRAL = 'DELETE_INTEGRAL';
|
|
34
34
|
exports.TOGGLE_REAL_IMAGINARY_VISIBILITY = 'TOGGLE_REAL_IMAGINARY_VISIBILITY';
|
|
35
|
-
exports.
|
|
35
|
+
exports.SET_ZOOM = 'SET_ZOOM';
|
|
36
36
|
exports.ADD_MOLECULE = 'ADD_MOLECULE';
|
|
37
37
|
exports.SET_MOLECULE = 'SET_MOLECULE';
|
|
38
38
|
exports.DELETE_MOLECULE = 'DELETE_MOLECULE';
|
|
@@ -81,6 +81,7 @@ exports.SET_2D_LEVEL = 'SET_2D_LEVEL';
|
|
|
81
81
|
exports.ADD_2D_ZONE = 'ADD_2D_ZONE';
|
|
82
82
|
exports.DELETE_2D_ZONE = 'DELETE_2D_ZONE';
|
|
83
83
|
exports.DELETE_2D_SIGNAL = 'DELETE_2D_SIGNAL';
|
|
84
|
+
exports.SET_2D_SIGNAL_PATH_LENGTH = 'SET_2D_SIGNAL_PATH_LENGTH';
|
|
84
85
|
exports.ADD_MISSING_PROJECTION = 'ADD_MISSING_PROJECTION';
|
|
85
86
|
exports.SET_FILTER_SNAPSHOT = 'SET_FILTER_SNAPSHOT';
|
|
86
87
|
exports.CHANGE_RANGE_RELATIVE = 'CHANGE_RANGE_RELATIVE';
|
|
@@ -98,6 +99,7 @@ exports.FILTER_SPECTRA_COLUMN = 'FILTER_SPECTRA_COLUMN';
|
|
|
98
99
|
exports.ALIGN_SPECTRA = 'ALIGN_SPECTRA';
|
|
99
100
|
exports.CHANGE_ZONE_SIGNAL_VALUE = 'CHANGE_ZONE_SIGNAL_VALUE';
|
|
100
101
|
exports.CHANGE_ZONE_SIGNAL_KIND = 'CHANGE_ZONE_SIGNAL_KIND';
|
|
102
|
+
exports.SAVE_EDITED_ZONE = 'SAVE_EDITED_ZONE';
|
|
101
103
|
exports.UNLINK_ZONE = 'UNLINK_ZONE';
|
|
102
104
|
exports.SET_DIAID_ZONE = 'SET_DIAID_ZONE';
|
|
103
105
|
exports.PREDICT_SPECTRA = 'PREDICT_SPECTRA';
|
|
@@ -25,15 +25,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
25
25
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
26
26
|
const analysis_ui_components_1 = require("analysis-ui-components");
|
|
27
27
|
const cheminfo_font_1 = require("cheminfo-font");
|
|
28
|
-
const get_1 = __importDefault(require("lodash/get"));
|
|
29
28
|
const react_1 = require("react");
|
|
30
29
|
const fa_1 = require("react-icons/fa");
|
|
31
30
|
const Filters = __importStar(require("../../data/Filters"));
|
|
32
31
|
const ChartContext_1 = require("../context/ChartContext");
|
|
33
32
|
const DispatchContext_1 = require("../context/DispatchContext");
|
|
34
|
-
const PreferencesContext_1 = require("../context/PreferencesContext");
|
|
35
33
|
const ToggleButton_1 = __importDefault(require("../elements/toggle/ToggleButton"));
|
|
36
34
|
const ToggleButtonGroup_1 = __importDefault(require("../elements/toggle/ToggleButtonGroup"));
|
|
35
|
+
const useCheckToolsVisibility_1 = require("../hooks/useCheckToolsVisibility");
|
|
37
36
|
const useDatumWithSpectraStatistics_1 = __importDefault(require("../hooks/useDatumWithSpectraStatistics"));
|
|
38
37
|
const useToolsFunctions_1 = __importDefault(require("../hooks/useToolsFunctions"));
|
|
39
38
|
const Constants_1 = require("../reducer/core/Constants");
|
|
@@ -41,7 +40,7 @@ const Types_1 = require("../reducer/types/Types");
|
|
|
41
40
|
const ToolTypes_1 = require("./ToolTypes");
|
|
42
41
|
function FunctionToolBarInner({ defaultValue, activeSpectrum, info, datum, displayerMode, ftCounter, mode, }) {
|
|
43
42
|
const [option, setOption] = (0, react_1.useState)('');
|
|
44
|
-
const
|
|
43
|
+
const isButtonVisible = (0, useCheckToolsVisibility_1.useCheckToolsVisibility)();
|
|
45
44
|
const dispatch = (0, DispatchContext_1.useDispatch)();
|
|
46
45
|
const { handleChangeOption, handleFullZoomOut } = (0, useToolsFunctions_1.default)();
|
|
47
46
|
const handleChange = (0, react_1.useCallback)((selectedOption) => {
|
|
@@ -58,25 +57,23 @@ function FunctionToolBarInner({ defaultValue, activeSpectrum, info, datum, displ
|
|
|
58
57
|
});
|
|
59
58
|
dispatch({ type: Types_1.SET_SELECTED_FILTER, selectedFilter: null });
|
|
60
59
|
}, [dispatch]);
|
|
61
|
-
const isButtonVisible = (0, react_1.useCallback)((toolKey) => {
|
|
62
|
-
return !(0, get_1.default)(preferences, `display.toolBarButtons.${toolKey}`);
|
|
63
|
-
}, [preferences]);
|
|
64
60
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(ToggleButtonGroup_1.default, { value: option, onChange: handleChange, children: [isButtonVisible('hideZoomTool') && ((0, jsx_runtime_1.jsx)(ToggleButton_1.default, { value: ToolTypes_1.options.zoom.id, id: "zoomIn", title: `${ToolTypes_1.options.zoom.label} ( Press z )`, children: (0, jsx_runtime_1.jsx)("div", { style: { fontSize: 14 }, children: (0, jsx_runtime_1.jsx)(fa_1.FaSearchPlus, {}, void 0) }, void 0) }, ToolTypes_1.options.zoom.id)), isButtonVisible('hideZoomOutTool') && ((0, jsx_runtime_1.jsx)(analysis_ui_components_1.Toolbar.Item, { id: "zoom-out", onClick: handleFullZoomOut, title: "Horizontal zoom out ( Press f ), Horizontal and Vertical zoom out, double click ( Press ff )", children: (0, jsx_runtime_1.jsx)("div", { style: { fontSize: 14 }, children: (0, jsx_runtime_1.jsx)(fa_1.FaExpand, {}, void 0) }, void 0) }, void 0)), displayerMode === Constants_1.DISPLAYER_MODE.DM_1D &&
|
|
65
61
|
isButtonVisible('hidePeakTool') && ((0, jsx_runtime_1.jsx)(ToggleButton_1.default, { value: ToolTypes_1.options.peakPicking.id, title: `${ToolTypes_1.options.peakPicking.label} ( Press p )`, isVisible: activeSpectrum && !info?.isFid ? true : false, id: "peakPicking", children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrPeakPicking, {}, void 0) }, ToolTypes_1.options.peakPicking.id)), displayerMode === Constants_1.DISPLAYER_MODE.DM_1D &&
|
|
66
62
|
isButtonVisible('hideIntegralTool') && ((0, jsx_runtime_1.jsx)(ToggleButton_1.default, { value: ToolTypes_1.options.integral.id, isVisible: activeSpectrum && !info?.isFid ? true : false, id: "integralPicking", title: `${ToolTypes_1.options.integral.label} ( Press i )`, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrIntegrate, {}, void 0) }, ToolTypes_1.options.integral.id)), displayerMode === Constants_1.DISPLAYER_MODE.DM_2D &&
|
|
67
|
-
isButtonVisible('
|
|
68
|
-
isButtonVisible('
|
|
63
|
+
isButtonVisible('hideZonePickingTool') && ((0, jsx_runtime_1.jsx)(ToggleButton_1.default, { value: ToolTypes_1.options.zone2D.id, id: "zone2d", isVisible: activeSpectrum && !info?.isFid ? true : false, title: `${ToolTypes_1.options.zone2D.label} ( Press r )`, children: (0, jsx_runtime_1.jsx)(fa_1.FaDiceFour, {}, void 0) }, ToolTypes_1.options.zone2D.id)), displayerMode === Constants_1.DISPLAYER_MODE.DM_2D &&
|
|
64
|
+
isButtonVisible('hideSlicingTool') && ((0, jsx_runtime_1.jsx)(ToggleButton_1.default, { value: ToolTypes_1.options.slicingTool.id, isVisible: activeSpectrum && !info?.isFid ? true : false, id: "slic", title: `${ToolTypes_1.options.slicingTool.label}`, children: (0, jsx_runtime_1.jsx)("p", { children: "Slic" }, void 0) }, ToolTypes_1.options.slicingTool.id)), displayerMode === Constants_1.DISPLAYER_MODE.DM_1D &&
|
|
65
|
+
isButtonVisible('hideAutoRangesTool') && ((0, jsx_runtime_1.jsx)(ToggleButton_1.default, { value: ToolTypes_1.options.rangesPicking.id, isVisible: activeSpectrum && !info?.isFid ? true : false, title: `${ToolTypes_1.options.rangesPicking.label} ( Press r )`, id: "ranges-pick", children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrRangePicking, {}, void 0) }, ToolTypes_1.options.rangesPicking.id)), displayerMode === Constants_1.DISPLAYER_MODE.DM_1D &&
|
|
69
66
|
isButtonVisible('hideMultipleSpectraAnalysisTool') &&
|
|
70
67
|
ftCounter > 1 &&
|
|
71
68
|
mode === 'RTL' && ((0, jsx_runtime_1.jsx)(ToggleButton_1.default, { value: ToolTypes_1.options.multipleSpectraAnalysis.id, id: "multipleSpectraAnalysis", title: ToolTypes_1.options.multipleSpectraAnalysis.label, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrMultipleAnalysis, {}, void 0) }, ToolTypes_1.options.multipleSpectraAnalysis.id)), displayerMode === Constants_1.DISPLAYER_MODE.DM_1D &&
|
|
72
69
|
isButtonVisible('hideZeroFillingTool') && ((0, jsx_runtime_1.jsx)(ToggleButton_1.default, { value: ToolTypes_1.options.zeroFilling.id, isVisible: Filters.zeroFilling.isApplicable({ info }), id: "zeroFilling", title: ToolTypes_1.options.zeroFilling.label, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrZeroFilling, {}, void 0) }, ToolTypes_1.options.zeroFilling.id)), displayerMode === Constants_1.DISPLAYER_MODE.DM_1D &&
|
|
73
|
-
isButtonVisible('hidePhaseCorrectionTool') && ((0, jsx_runtime_1.jsx)(ToggleButton_1.default, { value: ToolTypes_1.options.phaseCorrection.id, id: "phaseCorrection", title: ToolTypes_1.options.phaseCorrection.label
|
|
70
|
+
isButtonVisible('hidePhaseCorrectionTool') && ((0, jsx_runtime_1.jsx)(ToggleButton_1.default, { value: ToolTypes_1.options.phaseCorrection.id, id: "phaseCorrection", title: `${ToolTypes_1.options.phaseCorrection.label} ( Press a )`, isVisible: activeSpectrum &&
|
|
74
71
|
info &&
|
|
75
72
|
Filters.phaseCorrection.isApplicable({ info }) &&
|
|
76
73
|
datum.im
|
|
77
74
|
? true
|
|
78
75
|
: false, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrPhaseCorrection, {}, void 0) }, ToolTypes_1.options.phaseCorrection.id)), displayerMode === Constants_1.DISPLAYER_MODE.DM_1D &&
|
|
79
|
-
isButtonVisible('hideBaseLineCorrectionTool') && ((0, jsx_runtime_1.jsx)(ToggleButton_1.default, { value: ToolTypes_1.options.baseLineCorrection.id, id: "baseLineCorrection", title: ToolTypes_1.options.baseLineCorrection.label
|
|
76
|
+
isButtonVisible('hideBaseLineCorrectionTool') && ((0, jsx_runtime_1.jsx)(ToggleButton_1.default, { value: ToolTypes_1.options.baseLineCorrection.id, id: "baseLineCorrection", title: `${ToolTypes_1.options.baseLineCorrection.label} ( Press b )`, isVisible: activeSpectrum &&
|
|
80
77
|
info &&
|
|
81
78
|
Filters.baselineCorrection.isApplicable({ info })
|
|
82
79
|
? true
|
|
@@ -66,7 +66,7 @@ exports.options = {
|
|
|
66
66
|
},
|
|
67
67
|
rangesPicking: {
|
|
68
68
|
id: 'rangesPicking',
|
|
69
|
-
label: 'Ranges Picking
|
|
69
|
+
label: 'Ranges Picking',
|
|
70
70
|
hasOptionPanel: true,
|
|
71
71
|
isFilter: false,
|
|
72
72
|
},
|
|
@@ -78,13 +78,13 @@ exports.options = {
|
|
|
78
78
|
},
|
|
79
79
|
phaseCorrection: {
|
|
80
80
|
id: Filters.phaseCorrection.id,
|
|
81
|
-
label:
|
|
81
|
+
label: Filters.phaseCorrection.name,
|
|
82
82
|
hasOptionPanel: true,
|
|
83
83
|
isFilter: true,
|
|
84
84
|
},
|
|
85
85
|
baseLineCorrection: {
|
|
86
86
|
id: 'baseLineCorrection',
|
|
87
|
-
label: 'baseline correction
|
|
87
|
+
label: 'baseline correction',
|
|
88
88
|
hasOptionPanel: true,
|
|
89
89
|
isFilter: true,
|
|
90
90
|
},
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.basic = void 0;
|
|
4
|
+
exports.basic = {
|
|
5
|
+
version: 1,
|
|
6
|
+
label: 'Default Mode',
|
|
7
|
+
display: {
|
|
8
|
+
general: {
|
|
9
|
+
disableMultipletAnalysis: false,
|
|
10
|
+
hideSetSumFromMolecule: false,
|
|
11
|
+
hideGeneralSettings: false,
|
|
12
|
+
hideExperimentalFeatures: false,
|
|
13
|
+
},
|
|
14
|
+
panels: {
|
|
15
|
+
hideSpectraPanel: false,
|
|
16
|
+
hideInformationPanel: false,
|
|
17
|
+
hidePeaksPanel: false,
|
|
18
|
+
hideIntegralsPanel: false,
|
|
19
|
+
hideRangesPanel: false,
|
|
20
|
+
hideStructuresPanel: false,
|
|
21
|
+
hideFiltersPanel: false,
|
|
22
|
+
hideZonesPanel: false,
|
|
23
|
+
hideSummaryPanel: false,
|
|
24
|
+
hideMultipleSpectraAnalysisPanel: false,
|
|
25
|
+
hideDatabasePanel: false,
|
|
26
|
+
},
|
|
27
|
+
toolBarButtons: {
|
|
28
|
+
hideZoomTool: false,
|
|
29
|
+
hideZoomOutTool: false,
|
|
30
|
+
hideImport: false,
|
|
31
|
+
hideExportAs: false,
|
|
32
|
+
hideSpectraStackAlignments: false,
|
|
33
|
+
hideSpectraCenterAlignments: false,
|
|
34
|
+
hideRealImaginary: false,
|
|
35
|
+
hidePeakTool: false,
|
|
36
|
+
hideIntegralTool: false,
|
|
37
|
+
hideZonePickingTool: false,
|
|
38
|
+
hideSlicingTool: false,
|
|
39
|
+
hideAutoRangesTool: false,
|
|
40
|
+
hideZeroFillingTool: false,
|
|
41
|
+
hidePhaseCorrectionTool: false,
|
|
42
|
+
hideBaseLineCorrectionTool: false,
|
|
43
|
+
hideFFTTool: false,
|
|
44
|
+
hideMultipleSpectraAnalysisTool: false,
|
|
45
|
+
hideExclusionZonesTool: false,
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.exercise1D = void 0;
|
|
4
|
+
exports.exercise1D = {
|
|
5
|
+
version: 1,
|
|
6
|
+
label: 'Exercise 1D Mode',
|
|
7
|
+
display: {
|
|
8
|
+
general: {
|
|
9
|
+
disableMultipletAnalysis: true,
|
|
10
|
+
hideSetSumFromMolecule: true,
|
|
11
|
+
hideGeneralSettings: true,
|
|
12
|
+
hideExperimentalFeatures: true,
|
|
13
|
+
},
|
|
14
|
+
panels: {
|
|
15
|
+
hideSpectraPanel: false,
|
|
16
|
+
hideInformationPanel: true,
|
|
17
|
+
hidePeaksPanel: true,
|
|
18
|
+
hideIntegralsPanel: false,
|
|
19
|
+
hideRangesPanel: true,
|
|
20
|
+
hideStructuresPanel: true,
|
|
21
|
+
hideFiltersPanel: true,
|
|
22
|
+
hideZonesPanel: true,
|
|
23
|
+
hideSummaryPanel: true,
|
|
24
|
+
hideMultipleSpectraAnalysisPanel: true,
|
|
25
|
+
hideDatabasePanel: true,
|
|
26
|
+
},
|
|
27
|
+
toolBarButtons: {
|
|
28
|
+
hideZoomTool: false,
|
|
29
|
+
hideZoomOutTool: false,
|
|
30
|
+
hideImport: true,
|
|
31
|
+
hideExportAs: true,
|
|
32
|
+
hideSpectraStackAlignments: false,
|
|
33
|
+
hideSpectraCenterAlignments: false,
|
|
34
|
+
hideRealImaginary: true,
|
|
35
|
+
hidePeakTool: false,
|
|
36
|
+
hideIntegralTool: false,
|
|
37
|
+
hideZonePickingTool: true,
|
|
38
|
+
hideSlicingTool: true,
|
|
39
|
+
hideAutoRangesTool: true,
|
|
40
|
+
hideZeroFillingTool: true,
|
|
41
|
+
hidePhaseCorrectionTool: true,
|
|
42
|
+
hideBaseLineCorrectionTool: true,
|
|
43
|
+
hideFFTTool: true,
|
|
44
|
+
hideMultipleSpectraAnalysisTool: true,
|
|
45
|
+
hideExclusionZonesTool: true,
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const basic_1 = require("./basic");
|
|
4
|
+
const exercise1D_1 = require("./exercise1D");
|
|
5
|
+
const process1D_1 = require("./process1D");
|
|
6
|
+
exports.default = { exercise1D: exercise1D_1.exercise1D, basic: basic_1.basic, process1D: process1D_1.process1D };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.process1D = void 0;
|
|
4
|
+
exports.process1D = {
|
|
5
|
+
version: 1,
|
|
6
|
+
label: 'Process 1D Mode',
|
|
7
|
+
display: {
|
|
8
|
+
general: {
|
|
9
|
+
disableMultipletAnalysis: true,
|
|
10
|
+
hideSetSumFromMolecule: false,
|
|
11
|
+
hideGeneralSettings: false,
|
|
12
|
+
hideExperimentalFeatures: false,
|
|
13
|
+
},
|
|
14
|
+
panels: {
|
|
15
|
+
hideSpectraPanel: false,
|
|
16
|
+
hideInformationPanel: false,
|
|
17
|
+
hidePeaksPanel: false,
|
|
18
|
+
hideIntegralsPanel: false,
|
|
19
|
+
hideRangesPanel: true,
|
|
20
|
+
hideStructuresPanel: false,
|
|
21
|
+
hideFiltersPanel: false,
|
|
22
|
+
hideZonesPanel: true,
|
|
23
|
+
hideSummaryPanel: true,
|
|
24
|
+
hideMultipleSpectraAnalysisPanel: true,
|
|
25
|
+
hideDatabasePanel: false,
|
|
26
|
+
},
|
|
27
|
+
toolBarButtons: {
|
|
28
|
+
hideZoomTool: false,
|
|
29
|
+
hideZoomOutTool: false,
|
|
30
|
+
hideImport: true,
|
|
31
|
+
hideExportAs: true,
|
|
32
|
+
hideSpectraStackAlignments: false,
|
|
33
|
+
hideSpectraCenterAlignments: false,
|
|
34
|
+
hideRealImaginary: false,
|
|
35
|
+
hidePeakTool: false,
|
|
36
|
+
hideIntegralTool: false,
|
|
37
|
+
hideAutoRangesTool: true,
|
|
38
|
+
hideZeroFillingTool: false,
|
|
39
|
+
hidePhaseCorrectionTool: false,
|
|
40
|
+
hideBaseLineCorrectionTool: false,
|
|
41
|
+
hideFFTTool: false,
|
|
42
|
+
hideMultipleSpectraAnalysisTool: true,
|
|
43
|
+
hideExclusionZonesTool: true,
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const DefaultPathLengths = {
|
|
4
|
+
hmbc: { from: 2, to: 3 },
|
|
5
|
+
cosy: { from: 3, to: 4 },
|
|
6
|
+
hsqc: { from: 1, to: 1 },
|
|
7
|
+
hmqc: { from: 1, to: 1 },
|
|
8
|
+
inadequate: { from: 1, to: 1 },
|
|
9
|
+
};
|
|
10
|
+
exports.default = DefaultPathLengths;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getSpectrumErrorValue = void 0;
|
|
4
|
+
function getSpectrumErrorValue(datum) {
|
|
5
|
+
const { x } = datum.data;
|
|
6
|
+
return (x[x.length - 1] - x[0]) / 10000;
|
|
7
|
+
}
|
|
8
|
+
exports.getSpectrumErrorValue = getSpectrumErrorValue;
|
|
@@ -23,11 +23,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
23
23
|
};
|
|
24
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
25
|
exports.initiateDatum1D = void 0;
|
|
26
|
-
const merge_1 = __importDefault(require("lodash/merge"));
|
|
27
26
|
const FiltersTypes = __importStar(require("../../Filters"));
|
|
28
27
|
const FiltersManager = __importStar(require("../../FiltersManager"));
|
|
29
28
|
const generateID_1 = __importDefault(require("../../utilities/generateID"));
|
|
30
29
|
const getColor_1 = __importDefault(require("../../utilities/getColor"));
|
|
30
|
+
const initiateIntegrals_1 = require("./integrals/initiateIntegrals");
|
|
31
|
+
const initiatePeaks_1 = require("./peaks/initiatePeaks");
|
|
32
|
+
const initiateRanges_1 = require("./ranges/initiateRanges");
|
|
31
33
|
function initiateDatum1D(options, usedColors = {}) {
|
|
32
34
|
const datum = {};
|
|
33
35
|
datum.id = options.id || (0, generateID_1.default)();
|
|
@@ -60,27 +62,13 @@ function initiateDatum1D(options, usedColors = {}) {
|
|
|
60
62
|
im: [],
|
|
61
63
|
}, options.data);
|
|
62
64
|
datum.originalData = datum.data;
|
|
63
|
-
datum.
|
|
65
|
+
datum.filters = Object.assign([], options.filters); //array of object {name: "FilterName", options: FilterOptions = {value | object} }
|
|
66
|
+
datum.peaks = (0, initiatePeaks_1.initiatePeaks)(options, datum);
|
|
64
67
|
// array of object {index: xIndex, xShift}
|
|
65
68
|
// in case the peak does not exactly correspond to the point value
|
|
66
69
|
// we can think about a second attributed `xShift`
|
|
67
|
-
datum.integrals = (0,
|
|
68
|
-
|
|
69
|
-
options: {
|
|
70
|
-
sum: undefined,
|
|
71
|
-
isSumConstant: true,
|
|
72
|
-
sumAuto: true,
|
|
73
|
-
},
|
|
74
|
-
}, options.integrals); // array of object (from: xIndex, to: xIndex)
|
|
75
|
-
datum.filters = Object.assign([], options.filters); //array of object {name: "FilterName", options: FilterOptions = {value | object} }
|
|
76
|
-
datum.ranges = (0, merge_1.default)({
|
|
77
|
-
values: [],
|
|
78
|
-
options: {
|
|
79
|
-
sum: undefined,
|
|
80
|
-
isSumConstant: true,
|
|
81
|
-
sumAuto: true,
|
|
82
|
-
},
|
|
83
|
-
}, options.ranges);
|
|
70
|
+
datum.integrals = (0, initiateIntegrals_1.initiateIntegrals)(options); // array of object (from: xIndex, to: xIndex)
|
|
71
|
+
datum.ranges = (0, initiateRanges_1.initiateRanges)(options, datum);
|
|
84
72
|
//reapply filters after load the original data
|
|
85
73
|
FiltersManager.reapplyFilters(datum);
|
|
86
74
|
preprocessing(datum);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.initiateIntegrals = void 0;
|
|
7
|
+
const merge_1 = __importDefault(require("lodash/merge"));
|
|
8
|
+
function initiateIntegrals(options) {
|
|
9
|
+
return (0, merge_1.default)({
|
|
10
|
+
values: [],
|
|
11
|
+
options: {
|
|
12
|
+
sum: undefined,
|
|
13
|
+
isSumConstant: true,
|
|
14
|
+
sumAuto: true,
|
|
15
|
+
},
|
|
16
|
+
}, options.integrals);
|
|
17
|
+
}
|
|
18
|
+
exports.initiateIntegrals = initiateIntegrals;
|
|
@@ -6,14 +6,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.autoPeakPicking = void 0;
|
|
7
7
|
const ml_array_median_1 = __importDefault(require("ml-array-median"));
|
|
8
8
|
const nmr_processing_1 = require("nmr-processing");
|
|
9
|
-
const
|
|
10
|
-
const getShiftX_1 = require("../shift/getShiftX");
|
|
9
|
+
const mapPeaks_1 = require("./mapPeaks");
|
|
11
10
|
function autoPeakPicking(datum1D, options) {
|
|
12
11
|
const { minMaxRatio, maxNumberOfPeaks, noiseFactor, lookNegative, windowFromIndex, windowToIndex, } = options;
|
|
13
12
|
// we calculate the noise but this could be improved
|
|
14
13
|
const noise = (0, ml_array_median_1.default)(datum1D.data.re.map((y) => Math.abs(y)));
|
|
15
14
|
let { re, x } = datum1D.data;
|
|
16
|
-
let { values: currentPeaks = [] } = datum1D.peaks || {};
|
|
17
15
|
if (windowFromIndex !== undefined && windowToIndex !== undefined) {
|
|
18
16
|
x = x.slice(windowFromIndex, windowToIndex);
|
|
19
17
|
re = re.slice(windowFromIndex, windowToIndex);
|
|
@@ -29,23 +27,6 @@ function autoPeakPicking(datum1D, options) {
|
|
|
29
27
|
peaks.sort((a, b) => b.y - a.y);
|
|
30
28
|
if (maxNumberOfPeaks < peaks.length)
|
|
31
29
|
peaks = peaks.slice(0, maxNumberOfPeaks);
|
|
32
|
-
|
|
33
|
-
const error = (x[x.length - 1] - x[0]) / 10000;
|
|
34
|
-
return peaks.reduce((acc, newPeak) => {
|
|
35
|
-
// check if the peak is already exists
|
|
36
|
-
for (const { x } of currentPeaks) {
|
|
37
|
-
if (Math.abs(newPeak.x - x) < error) {
|
|
38
|
-
return acc;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
acc.push({
|
|
42
|
-
id: (0, generateID_1.default)(),
|
|
43
|
-
originalX: newPeak.x - shiftX,
|
|
44
|
-
x: newPeak.x,
|
|
45
|
-
y: newPeak.y,
|
|
46
|
-
width: newPeak.width,
|
|
47
|
-
});
|
|
48
|
-
return acc;
|
|
49
|
-
}, []);
|
|
30
|
+
return (0, mapPeaks_1.mapPeaks)(peaks, datum1D);
|
|
50
31
|
}
|
|
51
32
|
exports.autoPeakPicking = autoPeakPicking;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.initiatePeaks = void 0;
|
|
7
|
+
const merge_1 = __importDefault(require("lodash/merge"));
|
|
8
|
+
const mapPeaks_1 = require("./mapPeaks");
|
|
9
|
+
function initiatePeaks(options, datum) {
|
|
10
|
+
return (0, merge_1.default)({ values: [], options: {} }, options.peaks, {
|
|
11
|
+
values: (0, mapPeaks_1.mapPeaks)(options?.peaks?.values || [], datum),
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
exports.initiatePeaks = initiatePeaks;
|