nmrium 0.20.2 → 0.23.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/FooterBanner.js +1 -1
- 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 +10 -6
- package/lib/component/NMRium.js +3 -9
- package/lib/component/elements/EditableColumn.d.ts +1 -1
- 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 +87 -87
- package/lib/component/modal/PredictSpectraModal.d.ts +0 -28
- package/lib/component/modal/PredictSpectraModal.js +2 -32
- 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 +5 -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.d.ts +10 -1
- package/lib/component/panels/MoleculesPanel/MoleculePanel.js +27 -17
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.d.ts +9 -1
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +2 -2
- package/lib/component/panels/Panels.d.ts +1 -1
- package/lib/component/panels/Panels.js +17 -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 +1 -1
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +1 -1
- package/lib/component/panels/SummaryPanel/SummaryPanel.js +39 -42
- 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/panels/predictionPanel/PredictionOptions.d.ts +6 -0
- package/lib/component/panels/predictionPanel/PredictionOptions.js +88 -0
- package/lib/component/panels/predictionPanel/PredictionPanel.d.ts +2 -0
- package/lib/component/panels/predictionPanel/PredictionPanel.js +33 -0
- package/lib/component/reducer/IgnoreActions.js +2 -1
- package/lib/component/reducer/Reducer.d.ts +9 -23
- package/lib/component/reducer/Reducer.js +7 -8
- 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 +29 -1
- package/lib/component/reducer/actions/MoleculeActions.js +1 -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 +86 -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 +46 -0
- package/lib/component/workspaces/exercise1D.d.ts +2 -0
- package/lib/component/workspaces/exercise1D.js +46 -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 +44 -0
- package/lib/data/PredictionManager.d.ts +35 -3
- package/lib/data/PredictionManager.js +45 -7
- 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/FooterBanner.js +1 -1
- 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 +3 -10
- 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 +87 -87
- package/lib-cjs/component/modal/PredictSpectraModal.js +3 -33
- 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 +5 -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 +27 -17
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +2 -2
- package/lib-cjs/component/panels/Panels.js +18 -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/panels/predictionPanel/PredictionOptions.js +112 -0
- package/lib-cjs/component/panels/predictionPanel/PredictionPanel.js +39 -0
- 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 +29 -1
- package/lib-cjs/component/reducer/actions/MoleculeActions.js +1 -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 -38
- 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 +49 -0
- package/lib-cjs/component/workspaces/exercise1D.js +49 -0
- package/lib-cjs/component/workspaces/index.js +6 -0
- package/lib-cjs/component/workspaces/process1D.js +47 -0
- package/lib-cjs/data/PredictionManager.js +46 -8
- 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 +1 -1
- 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
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
22
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
26
|
+
/** @jsxImportSource @emotion/react */
|
|
27
|
+
const react_1 = require("@emotion/react");
|
|
28
|
+
const react_2 = require("react");
|
|
29
|
+
const Yup = __importStar(require("yup"));
|
|
30
|
+
const PredictionManager_1 = require("../../../data/PredictionManager");
|
|
31
|
+
const IsotopesViewer_1 = __importDefault(require("../../elements/IsotopesViewer"));
|
|
32
|
+
const Label_1 = __importDefault(require("../../elements/Label"));
|
|
33
|
+
const FormikErrorsSummary_1 = __importDefault(require("../../elements/formik/FormikErrorsSummary"));
|
|
34
|
+
const FormikForm_1 = __importDefault(require("../../elements/formik/FormikForm"));
|
|
35
|
+
const FormikInput_1 = __importDefault(require("../../elements/formik/FormikInput"));
|
|
36
|
+
const FormikSelect_1 = __importDefault(require("../../elements/formik/FormikSelect"));
|
|
37
|
+
const styles = (0, react_1.css) `
|
|
38
|
+
padding: 10px;
|
|
39
|
+
border-top: solid #f2f2f2 1px;
|
|
40
|
+
|
|
41
|
+
.row {
|
|
42
|
+
flex: row;
|
|
43
|
+
display: flex;
|
|
44
|
+
padding-bottom: 10px;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.inner-content {
|
|
48
|
+
flex: 1;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.custom-label {
|
|
52
|
+
width: 160px;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.footer-container {
|
|
56
|
+
display: flex;
|
|
57
|
+
flex-direction: row-reverse;
|
|
58
|
+
align-items: flex-end;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.btn:not([disabled]):hover {
|
|
62
|
+
background-color: #ffffff;
|
|
63
|
+
}
|
|
64
|
+
.btn:hover {
|
|
65
|
+
background-color: #f2f2f2 !important;
|
|
66
|
+
}
|
|
67
|
+
.btn:disabled {
|
|
68
|
+
opacity: 0.5;
|
|
69
|
+
}
|
|
70
|
+
.btn {
|
|
71
|
+
border: none;
|
|
72
|
+
padding: 0 15px;
|
|
73
|
+
background-color: #ffffff;
|
|
74
|
+
border-radius: 5px;
|
|
75
|
+
height: 25px;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.input {
|
|
79
|
+
font-size: 14px;
|
|
80
|
+
border-radius: 5px;
|
|
81
|
+
border: 1px solid #cccccc;
|
|
82
|
+
padding: 5px;
|
|
83
|
+
width: 100px;
|
|
84
|
+
margin-right: 10px;
|
|
85
|
+
height: initial !important;
|
|
86
|
+
}
|
|
87
|
+
`;
|
|
88
|
+
const predictionFormValidation = Yup.object().shape({
|
|
89
|
+
frequency: Yup.number().integer().required().label('Frequency'),
|
|
90
|
+
'1d': Yup.object({
|
|
91
|
+
'1H': Yup.object({
|
|
92
|
+
from: Yup.number().integer().required().label("1H ' From ' "),
|
|
93
|
+
to: Yup.number().integer().required().label("1H ' To ' "),
|
|
94
|
+
}),
|
|
95
|
+
'13C': Yup.object().shape({
|
|
96
|
+
from: Yup.number().integer().required().label("13C ' From ' "),
|
|
97
|
+
to: Yup.number().integer().required().label("13C ' To ' "),
|
|
98
|
+
}),
|
|
99
|
+
lineWidth: Yup.number().integer().min(1).required().label('Line Width'),
|
|
100
|
+
}),
|
|
101
|
+
});
|
|
102
|
+
function PredictionOptions({ onPredict = () => null }) {
|
|
103
|
+
const refForm = (0, react_2.useRef)();
|
|
104
|
+
const handleSave = (0, react_2.useCallback)(() => {
|
|
105
|
+
refForm.current.submitForm();
|
|
106
|
+
}, []);
|
|
107
|
+
const submitHandler = (0, react_2.useCallback)(async (values) => {
|
|
108
|
+
onPredict(values);
|
|
109
|
+
}, [onPredict]);
|
|
110
|
+
return ((0, jsx_runtime_1.jsxs)("div", { css: styles, children: [(0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsxs)(FormikForm_1.default, { ref: refForm, initialValues: PredictionManager_1.defaultPredictionOptions, validationSchema: predictionFormValidation, onSubmit: submitHandler, children: [(0, jsx_runtime_1.jsx)(FormikErrorsSummary_1.default, {}, void 0), (0, jsx_runtime_1.jsxs)("div", { className: "row margin-10", children: [(0, jsx_runtime_1.jsx)("span", { className: "custom-label", children: "Frequency : " }, void 0), (0, jsx_runtime_1.jsx)(FormikSelect_1.default, { data: PredictionManager_1.FREQUENCIES, style: { width: 290, height: 30, margin: 0 }, name: "frequency" }, void 0)] }, void 0), (0, jsx_runtime_1.jsxs)("div", { className: "row", children: [(0, jsx_runtime_1.jsx)(IsotopesViewer_1.default, { value: "1H", className: "custom-label" }, void 0), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "From", children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "1d.1H.from", type: "number" }, void 0) }, void 0), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "To", style: { label: { padding: '0 10px' } }, children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "1d.1H.to", type: "number" }, void 0) }, void 0)] }, void 0), (0, jsx_runtime_1.jsxs)("div", { className: "row", children: [(0, jsx_runtime_1.jsx)(IsotopesViewer_1.default, { value: "13C", className: "custom-label" }, void 0), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "From", children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "1d.13C.from", type: "number" }, void 0) }, void 0), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "To", style: { label: { padding: '0 10px' } }, children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "1d.13C.to", type: "number" }, void 0) }, void 0)] }, void 0), (0, jsx_runtime_1.jsxs)("div", { className: "row margin-10 padding-h-10", children: [(0, jsx_runtime_1.jsx)("span", { className: "custom-label", children: "Line Width : " }, void 0), (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "1d.lineWidth", type: "number", style: { input: { margin: 0 } } }, void 0), (0, jsx_runtime_1.jsx)("span", { style: { paddingLeft: '0.4rem' }, children: " Hz " }, void 0)] }, void 0)] }, void 0) }, void 0), (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)("button", { type: "button", onClick: handleSave, className: "btn", children: "Predict spectrum" }, void 0) }, void 0)] }, void 0));
|
|
111
|
+
}
|
|
112
|
+
exports.default = PredictionOptions;
|
|
@@ -0,0 +1,39 @@
|
|
|
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
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
const DispatchContext_1 = require("../../context/DispatchContext");
|
|
9
|
+
const Alert_1 = require("../../elements/popup/Alert");
|
|
10
|
+
const Types_1 = require("../../reducer/types/Types");
|
|
11
|
+
const MoleculePanel_1 = __importDefault(require("../MoleculesPanel/MoleculePanel"));
|
|
12
|
+
const PredictionOptions_1 = __importDefault(require("./PredictionOptions"));
|
|
13
|
+
function PredictionPane() {
|
|
14
|
+
const [molecule, setMolecule] = (0, react_1.useState)();
|
|
15
|
+
const changeHandler = (0, react_1.useCallback)((molecule) => {
|
|
16
|
+
setMolecule(molecule);
|
|
17
|
+
}, []);
|
|
18
|
+
const dispatch = (0, DispatchContext_1.useDispatch)();
|
|
19
|
+
const alert = (0, Alert_1.useAlert)();
|
|
20
|
+
const predictHandler = (0, react_1.useCallback)(async (values) => {
|
|
21
|
+
if (molecule) {
|
|
22
|
+
dispatch({
|
|
23
|
+
type: Types_1.SET_LOADING_FLAG,
|
|
24
|
+
isLoading: true,
|
|
25
|
+
});
|
|
26
|
+
const hideLoading = await alert.showLoading(`Predict 1H, 13C, COSY, HSQC, and HMBC in progress`);
|
|
27
|
+
dispatch({
|
|
28
|
+
type: Types_1.PREDICT_SPECTRA,
|
|
29
|
+
payload: { mol: molecule, options: values },
|
|
30
|
+
});
|
|
31
|
+
hideLoading();
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
alert.error('No Molecule selected');
|
|
35
|
+
}
|
|
36
|
+
}, [alert, dispatch, molecule]);
|
|
37
|
+
return ((0, jsx_runtime_1.jsx)(MoleculePanel_1.default, { onMoleculeChange: changeHandler, actionsOptions: { hidePredict: true, hideDelete: true, hideExport: true }, children: (0, jsx_runtime_1.jsx)(PredictionOptions_1.default, { onPredict: predictHandler }, void 0) }, void 0));
|
|
38
|
+
}
|
|
39
|
+
exports.default = PredictionPane;
|
|
@@ -37,7 +37,7 @@ const ignoreActions = [
|
|
|
37
37
|
types.SET_DIMENSIONS,
|
|
38
38
|
types.SET_X_DOMAIN,
|
|
39
39
|
types.SET_Y_DOMAIN,
|
|
40
|
-
types.
|
|
40
|
+
types.SET_ZOOM,
|
|
41
41
|
types.TOGGLE_REAL_IMAGINARY_VISIBILITY,
|
|
42
42
|
types.CALCULATE_MANUAL_PHASE_CORRECTION_FILTER,
|
|
43
43
|
types.CHANGE_SPECTRUM_DISPLAY_VIEW_MODE,
|
|
@@ -49,6 +49,7 @@ const ignoreActions = [
|
|
|
49
49
|
types.CHANGE_PEAKS_MARKERS_VISIBILITY,
|
|
50
50
|
types.CHANGE_ACTIVE_SPECTRUM,
|
|
51
51
|
types.CHANGE_SPECTRUM_COLOR,
|
|
52
|
+
types.SET_MOUSE_OVER_DISPLAYER,
|
|
52
53
|
];
|
|
53
54
|
function checkActionType(type) {
|
|
54
55
|
if (!ignoreActions.includes(type))
|
|
@@ -50,7 +50,6 @@ const SpectrumsActions = __importStar(require("./actions/SpectrumsActions"));
|
|
|
50
50
|
const ToolsActions = __importStar(require("./actions/ToolsActions"));
|
|
51
51
|
const ZonesActions = __importStar(require("./actions/ZonesActions"));
|
|
52
52
|
const Constants_2 = require("./core/Constants");
|
|
53
|
-
const Zoom1DManager_1 = require("./helper/Zoom1DManager");
|
|
54
53
|
const HistoryTypes_1 = require("./types/HistoryTypes");
|
|
55
54
|
const types = __importStar(require("./types/Types"));
|
|
56
55
|
exports.initialState = {
|
|
@@ -69,6 +68,7 @@ exports.initialState = {
|
|
|
69
68
|
yDomains: {},
|
|
70
69
|
shareYDomain: false,
|
|
71
70
|
},
|
|
71
|
+
integralsYDomains: {},
|
|
72
72
|
activeTab: '',
|
|
73
73
|
width: 0,
|
|
74
74
|
height: 0,
|
|
@@ -101,8 +101,6 @@ exports.initialState = {
|
|
|
101
101
|
displayerKey: '',
|
|
102
102
|
zoom: {
|
|
103
103
|
history: {},
|
|
104
|
-
spectra: {},
|
|
105
|
-
integral: {},
|
|
106
104
|
},
|
|
107
105
|
overDisplayer: false,
|
|
108
106
|
toolOptions: {
|
|
@@ -126,14 +124,11 @@ function initState(state) {
|
|
|
126
124
|
const correlations = (0, nmr_correlation_1.buildCorrelationData)([], {
|
|
127
125
|
tolerance: Constants_1.DefaultTolerance,
|
|
128
126
|
});
|
|
129
|
-
const spectra = (0, Zoom1DManager_1.initZoom1D)();
|
|
130
|
-
const integral = (0, Zoom1DManager_1.initZoom1D)();
|
|
131
|
-
const zoom = { spectra, integral, history: {} };
|
|
132
127
|
return {
|
|
133
128
|
...state,
|
|
134
129
|
correlations,
|
|
135
130
|
displayerKey,
|
|
136
|
-
|
|
131
|
+
history: {},
|
|
137
132
|
};
|
|
138
133
|
}
|
|
139
134
|
exports.initState = initState;
|
|
@@ -299,7 +294,7 @@ function innerSpectrumReducer(draft, action) {
|
|
|
299
294
|
return SpectrumsActions.generateSpectrumFromPublicationStringHandler(draft, action);
|
|
300
295
|
case types.TOGGLE_REAL_IMAGINARY_VISIBILITY:
|
|
301
296
|
return ToolsActions.handleToggleRealImaginaryVisibility(draft);
|
|
302
|
-
case types.
|
|
297
|
+
case types.SET_ZOOM:
|
|
303
298
|
return ToolsActions.handleZoom(draft, action);
|
|
304
299
|
case types.SET_SPECTRA_SAME_TOP:
|
|
305
300
|
return ToolsActions.setSpectraSameTopHandler(draft);
|
|
@@ -393,6 +388,8 @@ function innerSpectrumReducer(draft, action) {
|
|
|
393
388
|
return ZonesActions.handleDeleteZone(draft, action);
|
|
394
389
|
case types.DELETE_2D_SIGNAL:
|
|
395
390
|
return ZonesActions.handleDeleteSignal(draft, action);
|
|
391
|
+
case types.SET_2D_SIGNAL_PATH_LENGTH:
|
|
392
|
+
return ZonesActions.handleSetSignalPathLength(draft, action);
|
|
396
393
|
case types.RESET_DOMAIN:
|
|
397
394
|
return DomainActions.handelResetDomain(draft);
|
|
398
395
|
case types.CHANGE_ZONE_SIGNAL_VALUE:
|
|
@@ -405,6 +402,8 @@ function innerSpectrumReducer(draft, action) {
|
|
|
405
402
|
return ZonesActions.handleSetDiaIDZone(draft, action);
|
|
406
403
|
case types.AUTO_ZONES_SPECTRA_PICKING:
|
|
407
404
|
return ZonesActions.handleAutoSpectraZonesDetection(draft);
|
|
405
|
+
case types.SAVE_EDITED_ZONE:
|
|
406
|
+
return ZonesActions.handleSaveEditedZone(draft, action);
|
|
408
407
|
case types.ANALYZE_SPECTRA:
|
|
409
408
|
return SpectraAnalysisActions.analyzeSpectra(draft, action);
|
|
410
409
|
case types.DELETE_ANALYZE_SPECTRA_RANGE:
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.handleRangeResurrecting = void 0;
|
|
4
4
|
const generateSpectrumFromRanges_1 = require("../../../data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges");
|
|
5
|
+
const Zoom1DManager_1 = require("../helper/Zoom1DManager");
|
|
5
6
|
const DomainActions_1 = require("./DomainActions");
|
|
6
|
-
const Zoom_1 = require("./Zoom");
|
|
7
7
|
function handleRangeResurrecting(draft, action) {
|
|
8
8
|
const { ranges, info } = action.payload;
|
|
9
9
|
const datum = (0, generateSpectrumFromRanges_1.generateSpectrumFromRanges)(ranges, info, draft.usedColors);
|
|
10
10
|
draft.data.push(datum);
|
|
11
11
|
(0, DomainActions_1.setDomain)(draft, { yDomain: { isShared: false } });
|
|
12
|
-
(0,
|
|
12
|
+
(0, Zoom1DManager_1.setZoom)(draft, { scale: 0.8, spectrumID: datum.id });
|
|
13
13
|
}
|
|
14
14
|
exports.handleRangeResurrecting = handleRangeResurrecting;
|
|
@@ -3,7 +3,7 @@ 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.setMode = exports.setDomain = exports.handelResetDomain = exports.setYDomain = exports.setXDomain = exports.setOriginalDomain = exports.getDomain = void 0;
|
|
6
|
+
exports.setIntegralsYDomain = exports.setMode = exports.setDomain = exports.handelResetDomain = exports.setYDomain = exports.setXDomain = exports.setOriginalDomain = exports.getDomain = void 0;
|
|
7
7
|
const d3_1 = require("d3");
|
|
8
8
|
const get1DDataXY_1 = require("../../../data/data1d/Spectrum1D/get1DDataXY");
|
|
9
9
|
const Spectrum2D_1 = require("../../../data/data2d/Spectrum2D");
|
|
@@ -157,6 +157,26 @@ function setDomain(draft, options) {
|
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
159
|
exports.setDomain = setDomain;
|
|
160
|
+
function getSpectrumIntegralsDomain(datum) {
|
|
161
|
+
const { integrals, ranges } = datum;
|
|
162
|
+
let max = Number.NEGATIVE_INFINITY;
|
|
163
|
+
for (const integral of integrals.values) {
|
|
164
|
+
max = Math.max(max, integral.absolute);
|
|
165
|
+
}
|
|
166
|
+
for (const range of ranges.values) {
|
|
167
|
+
max = Math.max(max, range.absolute);
|
|
168
|
+
}
|
|
169
|
+
return [0, max];
|
|
170
|
+
}
|
|
171
|
+
function setIntegralsYDomain(draft, data) {
|
|
172
|
+
for (const spectrum of Array.isArray(data) ? data : [data]) {
|
|
173
|
+
if (spectrum?.info?.dimension === 1) {
|
|
174
|
+
draft.integralsYDomains[spectrum.id] =
|
|
175
|
+
getSpectrumIntegralsDomain(spectrum);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
exports.setIntegralsYDomain = setIntegralsYDomain;
|
|
160
180
|
function setOriginalDomain(draft, originDomain) {
|
|
161
181
|
draft.originDomain = originDomain;
|
|
162
182
|
}
|
|
@@ -10,6 +10,7 @@ const Spectrum1D_1 = require("../../../data/data1d/Spectrum1D");
|
|
|
10
10
|
const SumManager_1 = require("../../../data/data1d/Spectrum1D/SumManager");
|
|
11
11
|
const generateID_1 = __importDefault(require("../../../data/utilities/generateID"));
|
|
12
12
|
const getRange_1 = __importDefault(require("../helper/getRange"));
|
|
13
|
+
const DomainActions_1 = require("./DomainActions");
|
|
13
14
|
function handleChangeIntegralSum(draft, options) {
|
|
14
15
|
const { data, activeSpectrum, activeTab: nucleus } = draft;
|
|
15
16
|
if (activeSpectrum?.id) {
|
|
@@ -43,6 +44,7 @@ function addIntegral(draft, action) {
|
|
|
43
44
|
nucleus,
|
|
44
45
|
});
|
|
45
46
|
(0, Spectrum1D_1.updateIntegralsRelativeValues)(datum);
|
|
47
|
+
(0, DomainActions_1.setIntegralsYDomain)(draft, datum);
|
|
46
48
|
}
|
|
47
49
|
}
|
|
48
50
|
exports.addIntegral = addIntegral;
|
|
@@ -26,6 +26,11 @@ const MoleculeManager = __importStar(require("../../../data/molecules/MoleculeMa
|
|
|
26
26
|
const Constants_1 = require("../../panels/SummaryPanel/CorrelationTable/Constants");
|
|
27
27
|
const PreferencesActions_1 = require("./PreferencesActions");
|
|
28
28
|
const ToolsActions_1 = require("./ToolsActions");
|
|
29
|
+
function resetState(draft) {
|
|
30
|
+
draft.activeSpectrum = null;
|
|
31
|
+
draft.activeTab = '';
|
|
32
|
+
draft.tabActiveSpectrum = {};
|
|
33
|
+
}
|
|
29
34
|
function setIsLoading(draft, isLoading) {
|
|
30
35
|
draft.isLoading = isLoading;
|
|
31
36
|
}
|
|
@@ -51,9 +56,30 @@ function setData(draft, data) {
|
|
|
51
56
|
});
|
|
52
57
|
}
|
|
53
58
|
else {
|
|
54
|
-
|
|
59
|
+
// in case of older NMRium data are imported, convert hybridization string to number array
|
|
60
|
+
// @TODO remove following command to overwrite correlations at some point in future
|
|
61
|
+
draft.correlations =
|
|
62
|
+
convertHybridizationStringValuesInCorrelations(correlations);
|
|
63
|
+
// draft.correlations = correlations // original command without overwriting
|
|
55
64
|
}
|
|
56
65
|
}
|
|
66
|
+
function convertHybridizationStringValuesInCorrelations(correlations) {
|
|
67
|
+
return {
|
|
68
|
+
...correlations,
|
|
69
|
+
values: correlations.values.map((correlation) => {
|
|
70
|
+
if (typeof correlation.hybridization === 'string') {
|
|
71
|
+
let values = [];
|
|
72
|
+
if (correlation.hybridization.length > 0) {
|
|
73
|
+
const hybridizationString = correlation.hybridization.replaceAll('SP', '');
|
|
74
|
+
const value = Number(hybridizationString);
|
|
75
|
+
values.push(value);
|
|
76
|
+
}
|
|
77
|
+
correlation.hybridization = values;
|
|
78
|
+
}
|
|
79
|
+
return correlation;
|
|
80
|
+
}),
|
|
81
|
+
};
|
|
82
|
+
}
|
|
57
83
|
function setPreferences(draft, data) {
|
|
58
84
|
const emptyPreferences = {
|
|
59
85
|
verticalAlign: null,
|
|
@@ -98,6 +124,7 @@ function loadJcampFile(draft, actions) {
|
|
|
98
124
|
}
|
|
99
125
|
exports.loadJcampFile = loadJcampFile;
|
|
100
126
|
function handleLoadJsonFile(draft, action) {
|
|
127
|
+
resetState(draft);
|
|
101
128
|
setData(draft, action.payload);
|
|
102
129
|
const preferences = action.payload?.preferences || {};
|
|
103
130
|
(0, ToolsActions_1.setActiveTab)(draft, { tab: preferences?.activeTab || '' });
|
|
@@ -123,6 +150,7 @@ function handleLoadZIPFile(draft, action) {
|
|
|
123
150
|
}
|
|
124
151
|
exports.handleLoadZIPFile = handleLoadZIPFile;
|
|
125
152
|
function handleLoadNmredata(draft, action) {
|
|
153
|
+
resetState(draft);
|
|
126
154
|
setData(draft, action.payload);
|
|
127
155
|
(0, ToolsActions_1.setActiveTab)(draft);
|
|
128
156
|
(0, PreferencesActions_1.changeSpectrumVerticalAlignment)(draft, { align: 'auto-check' });
|
|
@@ -80,7 +80,7 @@ function predictSpectraFromMoleculeHandler(draft, action) {
|
|
|
80
80
|
draft.isLoading = false;
|
|
81
81
|
}
|
|
82
82
|
else {
|
|
83
|
-
for (const spectrum of (0, PredictionManager_1.generateSpectra)(data, options
|
|
83
|
+
for (const spectrum of (0, PredictionManager_1.generateSpectra)(data, options)) {
|
|
84
84
|
draft.data.push(spectrum);
|
|
85
85
|
draft.tabActiveSpectrum[(0, nucleusToString_1.default)(spectrum.info.nucleus)] = {
|
|
86
86
|
id: spectrum.id,
|
|
@@ -9,7 +9,6 @@ const GroupByInfoKey_1 = __importDefault(require("../../utility/GroupByInfoKey")
|
|
|
9
9
|
const nucleusToString_1 = __importDefault(require("../../utility/nucleusToString"));
|
|
10
10
|
const Constants_1 = require("../core/Constants");
|
|
11
11
|
const DomainActions_1 = require("./DomainActions");
|
|
12
|
-
const Zoom_1 = require("./Zoom");
|
|
13
12
|
function changeSpectrumVerticalAlignment(draft, options) {
|
|
14
13
|
if (draft.data && draft.data.length > 0) {
|
|
15
14
|
let dataPerNucleus = [];
|
|
@@ -117,7 +116,6 @@ function applyKeyPreferencesHandler(draft, keyCode) {
|
|
|
117
116
|
}
|
|
118
117
|
else {
|
|
119
118
|
draft.zoom = preferences.zoom;
|
|
120
|
-
(0, Zoom_1.setZoom)(draft);
|
|
121
119
|
}
|
|
122
120
|
}
|
|
123
121
|
}
|
|
@@ -60,6 +60,7 @@ function handleAutoRangesDetection(draft, options) {
|
|
|
60
60
|
nucleus,
|
|
61
61
|
});
|
|
62
62
|
handleOnChangeRangesData(draft);
|
|
63
|
+
(0, DomainActions_1.setIntegralsYDomain)(draft, datum);
|
|
63
64
|
}
|
|
64
65
|
}
|
|
65
66
|
exports.handleAutoRangesDetection = handleAutoRangesDetection;
|
|
@@ -245,6 +246,7 @@ function handleAddRange(draft, action) {
|
|
|
245
246
|
const [from, to] = range;
|
|
246
247
|
(0, Spectrum1D_1.addRange)(draft.data[index], { from, to, nucleus, molecules });
|
|
247
248
|
handleOnChangeRangesData(draft);
|
|
249
|
+
(0, DomainActions_1.setIntegralsYDomain)(draft, draft.data[index]);
|
|
248
250
|
}
|
|
249
251
|
}
|
|
250
252
|
exports.handleAddRange = handleAddRange;
|
|
@@ -30,10 +30,10 @@ const Spectrum1D_1 = require("../../../data/data1d/Spectrum1D");
|
|
|
30
30
|
const Spectrum2D_1 = require("../../../data/data2d/Spectrum2D");
|
|
31
31
|
const ToolTypes_1 = require("../../toolbar/ToolTypes");
|
|
32
32
|
const GroupByInfoKey_1 = __importDefault(require("../../utility/GroupByInfoKey"));
|
|
33
|
+
const Zoom1DManager_1 = require("../helper/Zoom1DManager");
|
|
33
34
|
const DomainActions_1 = require("./DomainActions");
|
|
34
35
|
const FiltersActions_1 = require("./FiltersActions");
|
|
35
36
|
const ToolsActions_1 = require("./ToolsActions");
|
|
36
|
-
const Zoom_1 = require("./Zoom");
|
|
37
37
|
function checkIsVisible2D(datum) {
|
|
38
38
|
if (datum.display.isPositiveVisible === false &&
|
|
39
39
|
datum.display.isNegativeVisible === false) {
|
|
@@ -215,6 +215,6 @@ function generateSpectrumFromPublicationStringHandler(draft, action) {
|
|
|
215
215
|
const spectrum = (0, Spectrum1D_1.generateSpectrumFromPublicationString)(publicationString, draft.usedColors);
|
|
216
216
|
draft.data.push(spectrum);
|
|
217
217
|
(0, ToolsActions_1.setActiveTab)(draft);
|
|
218
|
-
(0,
|
|
218
|
+
(0, Zoom1DManager_1.setZoom)(draft, { scale: 0.8, spectrumID: spectrum.id });
|
|
219
219
|
}
|
|
220
220
|
exports.generateSpectrumFromPublicationStringHandler = generateSpectrumFromPublicationStringHandler;
|
|
@@ -33,13 +33,13 @@ const DimensionLayout_1 = require("../../2d/utilities/DimensionLayout");
|
|
|
33
33
|
const scale_2 = require("../../2d/utilities/scale");
|
|
34
34
|
const ToolTypes_1 = require("../../toolbar/ToolTypes");
|
|
35
35
|
const GroupByInfoKey_1 = __importDefault(require("../../utility/GroupByInfoKey"));
|
|
36
|
+
const getSpectraByNucleus_1 = require("../../utility/getSpectraByNucleus");
|
|
36
37
|
const Constants_1 = require("../core/Constants");
|
|
37
|
-
const Zoom1DManager_1 =
|
|
38
|
+
const Zoom1DManager_1 = require("../helper/Zoom1DManager");
|
|
38
39
|
const ZoomHistoryManager_1 = __importDefault(require("../helper/ZoomHistoryManager"));
|
|
39
40
|
const DomainActions_1 = require("./DomainActions");
|
|
40
41
|
const FiltersActions_1 = require("./FiltersActions");
|
|
41
42
|
const PreferencesActions_1 = require("./PreferencesActions");
|
|
42
|
-
const Zoom_1 = require("./Zoom");
|
|
43
43
|
function getStrongestPeak(draft) {
|
|
44
44
|
const { activeSpectrum, data } = draft;
|
|
45
45
|
if (activeSpectrum) {
|
|
@@ -213,7 +213,7 @@ function handleBrushEnd(draft, action) {
|
|
|
213
213
|
break;
|
|
214
214
|
}
|
|
215
215
|
if (brushHistory) {
|
|
216
|
-
brushHistory.push({ xDomain:
|
|
216
|
+
brushHistory.push({ xDomain: draft.xDomain, yDomain: draft.yDomain });
|
|
217
217
|
}
|
|
218
218
|
}
|
|
219
219
|
else {
|
|
@@ -239,34 +239,37 @@ function getSpectrumID(draft, index) {
|
|
|
239
239
|
return spectrum?.id ? spectrum.id : null;
|
|
240
240
|
}
|
|
241
241
|
function handleZoom(draft, action) {
|
|
242
|
-
const {
|
|
243
|
-
const { activeSpectrum, toolOptions: { data: { showRangesIntegrals }, }, } = draft;
|
|
244
|
-
if (
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
}
|
|
252
|
-
case DimensionLayout_1.LAYOUT.LEFT_1D: {
|
|
253
|
-
const id = getSpectrumID(draft, 1);
|
|
254
|
-
(0, Zoom_1.wheel)(deltaY, deltaMode, draft, id);
|
|
255
|
-
(0, Zoom_1.setZoom1D)(draft, draft.margin.left, 10, 1);
|
|
256
|
-
break;
|
|
242
|
+
const { event, trackID, selectedTool } = action;
|
|
243
|
+
const { activeSpectrum, toolOptions: { data: { showRangesIntegrals }, }, displayerMode, } = draft;
|
|
244
|
+
if (displayerMode === Constants_1.DISPLAYER_MODE.DM_2D) {
|
|
245
|
+
const index = trackID === DimensionLayout_1.LAYOUT.TOP_1D ? 0 : trackID === DimensionLayout_1.LAYOUT.LEFT_1D ? 1 : null;
|
|
246
|
+
if (index !== null) {
|
|
247
|
+
const id = getSpectrumID(draft, index);
|
|
248
|
+
if (id) {
|
|
249
|
+
const domain = draft.yDomains[id];
|
|
250
|
+
draft.yDomains[id] = (0, Zoom1DManager_1.wheelZoom)(event, domain);
|
|
257
251
|
}
|
|
258
|
-
default:
|
|
259
|
-
break;
|
|
260
252
|
}
|
|
261
253
|
}
|
|
262
|
-
else if (activeSpectrum?.id &&
|
|
263
|
-
shiftKey &&
|
|
264
|
-
(showRangesIntegrals || selectedTool === ToolTypes_1.options.integral.id)) {
|
|
265
|
-
(0, Zoom1DManager_1.default)(draft.zoom.integral).wheel(deltaY, activeSpectrum?.id);
|
|
266
|
-
}
|
|
267
254
|
else {
|
|
268
|
-
(
|
|
269
|
-
|
|
255
|
+
if (activeSpectrum?.id) {
|
|
256
|
+
if ((showRangesIntegrals || selectedTool === ToolTypes_1.options.integral.id) &&
|
|
257
|
+
event.shiftKey) {
|
|
258
|
+
const domain = draft.integralsYDomains[activeSpectrum?.id];
|
|
259
|
+
draft.integralsYDomains[activeSpectrum?.id] = (0, Zoom1DManager_1.wheelZoom)(event, domain);
|
|
260
|
+
}
|
|
261
|
+
else {
|
|
262
|
+
const domain = draft.yDomains[activeSpectrum?.id];
|
|
263
|
+
draft.yDomains[activeSpectrum?.id] = (0, Zoom1DManager_1.wheelZoom)(event, domain);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
else {
|
|
267
|
+
const spectra = (0, getSpectraByNucleus_1.getSpectraByNucleus)(draft.activeTab, draft.data);
|
|
268
|
+
for (const spectrum of spectra) {
|
|
269
|
+
const domain = draft.yDomains[spectrum.id];
|
|
270
|
+
draft.yDomains[spectrum.id] = (0, Zoom1DManager_1.wheelZoom)(event, domain);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
270
273
|
}
|
|
271
274
|
}
|
|
272
275
|
exports.handleZoom = handleZoom;
|
|
@@ -276,58 +279,41 @@ function zoomOut(draft, action) {
|
|
|
276
279
|
const zoomHistory = (0, ZoomHistoryManager_1.default)(draft.zoom.history, draft.activeTab);
|
|
277
280
|
if (draft.displayerMode === Constants_1.DISPLAYER_MODE.DM_1D) {
|
|
278
281
|
switch (zoomType) {
|
|
279
|
-
case
|
|
282
|
+
case Zoom1DManager_1.ZoomType.HORIZONTAL: {
|
|
280
283
|
draft.xDomain = draft.originDomain.xDomain;
|
|
284
|
+
zoomHistory.clear();
|
|
281
285
|
break;
|
|
282
286
|
}
|
|
283
|
-
case
|
|
284
|
-
(0,
|
|
287
|
+
case Zoom1DManager_1.ZoomType.VERTICAL:
|
|
288
|
+
(0, Zoom1DManager_1.setZoom)(draft, { scale: 0.8 });
|
|
285
289
|
break;
|
|
286
|
-
case
|
|
290
|
+
case Zoom1DManager_1.ZoomType.STEP_HORIZONTAL: {
|
|
287
291
|
const zoomValue = zoomHistory.pop();
|
|
288
292
|
draft.xDomain = zoomValue
|
|
289
293
|
? zoomValue.xDomain
|
|
290
294
|
: draft.originDomain.xDomain;
|
|
291
|
-
(0,
|
|
295
|
+
(0, Zoom1DManager_1.setZoom)(draft, { scale: 0.8 });
|
|
292
296
|
break;
|
|
293
297
|
}
|
|
294
298
|
default: {
|
|
295
299
|
draft.xDomain = draft.originDomain.xDomain;
|
|
296
|
-
(0,
|
|
300
|
+
(0, Zoom1DManager_1.setZoom)(draft, { scale: 0.8 });
|
|
297
301
|
break;
|
|
298
302
|
}
|
|
299
303
|
}
|
|
300
304
|
}
|
|
301
305
|
else {
|
|
302
306
|
const { xDomain, yDomain, yDomains } = draft.originDomain;
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
const activeSpectrum = draft.tabActiveSpectrum[draft.activeTab.split(',')[1]];
|
|
314
|
-
draft.yDomain = yDomain;
|
|
315
|
-
if (activeSpectrum?.id) {
|
|
316
|
-
draft.yDomains[activeSpectrum.id] = yDomains[activeSpectrum.id];
|
|
317
|
-
}
|
|
318
|
-
break;
|
|
319
|
-
}
|
|
320
|
-
case DimensionLayout_1.LAYOUT.CENTER_2D: {
|
|
321
|
-
const zoomValue = zoomHistory.pop();
|
|
322
|
-
draft.xDomain = zoomValue ? zoomValue.xDomain : xDomain;
|
|
323
|
-
draft.yDomain = zoomValue ? zoomValue.yDomain : yDomain;
|
|
324
|
-
break;
|
|
325
|
-
}
|
|
326
|
-
default:
|
|
327
|
-
draft.xDomain = xDomain;
|
|
328
|
-
draft.yDomain = yDomain;
|
|
329
|
-
draft.yDomains = yDomains;
|
|
330
|
-
break;
|
|
307
|
+
if ([DimensionLayout_1.LAYOUT.TOP_1D, DimensionLayout_1.LAYOUT.LEFT_1D, DimensionLayout_1.LAYOUT.CENTER_2D].includes(trackID)) {
|
|
308
|
+
const zoomValue = zoomHistory.pop();
|
|
309
|
+
draft.xDomain = zoomValue ? zoomValue.xDomain : xDomain;
|
|
310
|
+
draft.yDomain = zoomValue ? zoomValue.yDomain : yDomain;
|
|
311
|
+
}
|
|
312
|
+
else {
|
|
313
|
+
zoomHistory.clear();
|
|
314
|
+
draft.xDomain = xDomain;
|
|
315
|
+
draft.yDomain = yDomain;
|
|
316
|
+
draft.yDomains = yDomains;
|
|
331
317
|
}
|
|
332
318
|
}
|
|
333
319
|
}
|
|
@@ -442,6 +428,7 @@ function setActiveTab(draft, options) {
|
|
|
442
428
|
resetTool(draft);
|
|
443
429
|
Processing2DData(draft, dataGroupByNucleus);
|
|
444
430
|
(0, DomainActions_1.setDomain)(draft, domainOptions);
|
|
431
|
+
(0, DomainActions_1.setIntegralsYDomain)(draft, dataGroupByNucleus[currentTab]);
|
|
445
432
|
const zoomHistory = (0, ZoomHistoryManager_1.default)(draft.zoom.history, draft.activeTab);
|
|
446
433
|
const zoomValue = zoomHistory.getLast();
|
|
447
434
|
if (zoomValue) {
|
|
@@ -482,7 +469,7 @@ exports.levelChangeHandler = levelChangeHandler;
|
|
|
482
469
|
function setSpectraSameTopHandler(draft) {
|
|
483
470
|
if (draft.displayerMode === Constants_1.DISPLAYER_MODE.DM_1D) {
|
|
484
471
|
draft.originDomain.shareYDomain = false;
|
|
485
|
-
(0,
|
|
472
|
+
(0, Zoom1DManager_1.setZoom)(draft, { scale: 0.8 });
|
|
486
473
|
}
|
|
487
474
|
}
|
|
488
475
|
exports.setSpectraSameTopHandler = setSpectraSameTopHandler;
|
|
@@ -490,6 +477,6 @@ function resetSpectraScale(draft) {
|
|
|
490
477
|
draft.originDomain.shareYDomain = true;
|
|
491
478
|
draft.yDomains = draft.originDomain.yDomains;
|
|
492
479
|
draft.yDomain = draft.originDomain.yDomain;
|
|
493
|
-
(0,
|
|
480
|
+
(0, Zoom1DManager_1.setZoom)(draft, { scale: 0.8 });
|
|
494
481
|
}
|
|
495
482
|
exports.resetSpectraScale = resetSpectraScale;
|