nmrium 0.39.0 → 0.41.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/FooterBanner.js +5 -4
- package/lib/component/1d/Viewer1D.js +121 -104
- package/lib/component/1d/database/ResurrectedDatabaseRanges.js +1 -1
- package/lib/component/1d/jCouplingGraph/JGraphContext.d.ts +1 -1
- package/lib/component/1d/jCouplingGraph/JsCouplingLinks.js +1 -1
- package/lib/component/1d/multiplicityTree/TreeColors.d.ts +1 -1
- package/lib/component/1d/multiplicityTree/TreeColors.js +1 -6
- package/lib/component/1d/multiplicityTree/TreeNodes.d.ts +1 -1
- package/lib/component/1d/tool/BaseLineZones.d.ts +1 -1
- package/lib/component/1d/tool/BaseLineZones.js +7 -4
- package/lib/component/1d/tool/PeakPointer.js +1 -1
- package/lib/component/1d/utilities/scale.js +1 -3
- package/lib/component/1d-2d/components/FloatMoleculeStructures/index.d.ts +1 -1
- package/lib/component/1d-2d/tools/BrushXY.js +10 -7
- package/lib/component/1d-2d/tools/CrossLinePointer.js +1 -1
- package/lib/component/2d/FooterBanner.js +3 -2
- package/lib/component/2d/Viewer2D.js +51 -29
- package/lib/component/2d/XAxis.js +1 -1
- package/lib/component/2d/YAxis.js +1 -1
- package/lib/component/2d/utilities/SliceScale.d.ts +2 -2
- package/lib/component/2d/utilities/scale.d.ts +5 -5
- package/lib/component/2d/zones/Signal.js +1 -2
- package/lib/component/EventsTrackers/BrushTracker.d.ts +4 -1
- package/lib/component/EventsTrackers/BrushTracker.js +21 -6
- package/lib/component/NMRium.d.ts +2 -2
- package/lib/component/NMRium.js +39 -26
- package/lib/component/assignment/AssignmentsReducer.d.ts +1 -1
- package/lib/component/assignment/actions/setActiveAssignment.js +1 -1
- package/lib/component/context/LoggerContext.js +11 -6
- package/lib/component/elements/InputRange.js +1 -1
- package/lib/component/elements/MenuButton.d.ts +1 -1
- package/lib/component/elements/MoleculeSelection.d.ts +1 -1
- package/lib/component/elements/ReactTable/ReactTable.d.ts +1 -1
- package/lib/component/elements/Tab/DeleteButton.d.ts +1 -1
- package/lib/component/elements/ToolbarMenu.d.ts +1 -1
- package/lib/component/elements/accordion/Accordion.d.ts +1 -1
- package/lib/component/elements/draggable/SVGDraggable.d.ts +1 -1
- package/lib/component/elements/draggable/useDraggable.d.ts +1 -1
- package/lib/component/elements/dropDownButton/DropDownButton.d.ts +1 -1
- package/lib/component/elements/dropDownButton/DropDownList.js +3 -1
- package/lib/component/elements/formik/SelectBox.d.ts +1 -1
- package/lib/component/elements/popup/Alert/AlertBlock.d.ts +8 -0
- package/lib/component/elements/popup/Alert/AlertBlock.js +30 -0
- package/lib/component/elements/popup/Alert/Context.d.ts +26 -2
- package/lib/component/elements/popup/Alert/Context.js +6 -2
- package/lib/component/elements/popup/Alert/Provider.d.ts +4 -3
- package/lib/component/elements/popup/Alert/Provider.js +5 -23
- package/lib/component/elements/popup/Modal/ConfirmDialog.d.ts +1 -1
- package/lib/component/elements/popup/Modal/ConfirmDialog.js +2 -1
- package/lib/component/elements/popup/Modal/Provider.js +3 -1
- package/lib/component/elements/popup/options.d.ts +22 -19
- package/lib/component/elements/resizer/Resizer.d.ts +2 -2
- package/lib/component/elements/toggle/ToggleButton.d.ts +2 -2
- package/lib/component/elements/toggle/ToggleButton.js +1 -1
- package/lib/component/header/Header.js +2 -2
- package/lib/component/header/ZeroFillingOptionsPanel.js +3 -8
- package/lib/component/highlight/index.d.ts +1 -1
- package/lib/component/hooks/useCheckToolsVisibility.js +2 -2
- package/lib/component/hooks/useExport.js +2 -1
- package/lib/component/hooks/useFormatNumberByNucleus.d.ts +1 -1
- package/lib/component/hooks/usePanelPreferences.js +2 -2
- package/lib/component/hooks/useXScale.d.ts +1 -1
- package/lib/component/hooks/useXYReduce.d.ts +2 -2
- package/lib/component/modal/AboutSpectrumSimulationModal.d.ts +2 -0
- package/lib/component/modal/AboutSpectrumSimulationModal.js +49 -0
- package/lib/component/modal/AboutUsModal.js +4 -2
- package/lib/component/modal/AlignSpectraModal.js +11 -1
- package/lib/component/modal/LogsHistoryModal.d.ts +6 -0
- package/lib/component/{header/LogsHistory.js → modal/LogsHistoryModal.js} +6 -4
- package/lib/component/modal/MultipletAnalysisModal.js +2 -1
- package/lib/component/modal/PredictSpectraModal.d.ts +1 -2
- package/lib/component/modal/PredictSpectraModal.js +25 -28
- package/lib/component/modal/changeSum/ChangeSumModal.js +1 -1
- package/lib/component/modal/editRange/forms/components/SignalsForm.js +1 -1
- package/lib/component/modal/editZone/SignalsForm.js +1 -1
- package/lib/component/modal/metaImportation/MetaImportationModal.js +1 -1
- package/lib/component/modal/setting/GeneralSettings.js +28 -27
- package/lib/component/modal/setting/settings-tabs/DisplayTabContent.js +4 -0
- package/lib/component/modal/setting/settings-tabs/FormattingTabContent.js +1 -1
- package/lib/component/modal/setting/settingsValidation.js +2 -2
- package/lib/component/panels/IntegralsPanel/IntegralPanel.d.ts +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralTable.d.ts +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralTable.js +4 -7
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.d.ts +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +19 -19
- package/lib/component/panels/MoleculesPanel/Utilities.d.ts +1 -1
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +3 -5
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +9 -13
- package/lib/component/panels/Panels.js +13 -0
- package/lib/component/panels/PeaksPanel/PeaksTable.js +1 -1
- package/lib/component/panels/RangesPanel/RangesHeader.js +9 -15
- package/lib/component/panels/RangesPanel/RangesPanel.js +7 -10
- package/lib/component/panels/SpectrumsPanel/SpectraTable.js +8 -11
- package/lib/component/panels/SpectrumsPanel/base/setting/SpectrumSetting.js +3 -1
- package/lib/component/panels/SpectrumsPanel/base/setting/processSnapPlot.js +2 -2
- package/lib/component/panels/SummaryPanel/utilities/Utilities.d.ts +2 -1
- package/lib/component/panels/SummaryPanel/utilities/Utilities.js +1 -1
- package/lib/component/panels/ZonesPanel/ZonesTable.d.ts +1 -1
- package/lib/component/panels/databasePanel/DatabasePanel.d.ts +1 -1
- package/lib/component/panels/databasePanel/DatabasePanel.js +1 -1
- package/lib/component/panels/databasePanel/DatabaseTable.js +1 -1
- package/lib/component/panels/extra/utilities/MultiplicityUtilities.js +2 -2
- package/lib/component/panels/extra/utilities/UseToggleStatus.js +1 -1
- package/lib/component/panels/filtersPanel/FiltersTable.js +2 -2
- package/lib/component/panels/predictionPanel/PredictionOptionsPanel.js +2 -1
- package/lib/component/panels/predictionPanel/PredictionPanel.js +3 -2
- package/lib/component/panels/predictionPanel/PredictionSimpleOptions.js +2 -2
- package/lib/component/panels/spectrumSimulation/SpectrumSimulation.d.ts +1 -0
- package/lib/component/panels/spectrumSimulation/SpectrumSimulation.js +88 -0
- package/lib/component/panels/spectrumSimulation/SpectrumSimulationPreferences.d.ts +11 -0
- package/lib/component/panels/spectrumSimulation/SpectrumSimulationPreferences.js +37 -0
- package/lib/component/panels/spectrumSimulation/SpectrumSimulationSimpleOptions.d.ts +4 -0
- package/lib/component/panels/spectrumSimulation/SpectrumSimulationSimpleOptions.js +25 -0
- package/lib/component/panels/spectrumSimulation/SpinSystemTable.d.ts +5 -0
- package/lib/component/panels/spectrumSimulation/SpinSystemTable.js +60 -0
- package/lib/component/reducer/Reducer.d.ts +13 -12
- package/lib/component/reducer/Reducer.js +251 -239
- package/lib/component/reducer/actions/AssignmentsActions.d.ts +1 -1
- package/lib/component/reducer/actions/AssignmentsActions.js +1 -1
- package/lib/component/reducer/actions/DatabaseActions.js +2 -1
- package/lib/component/reducer/actions/DomainActions.d.ts +7 -2
- package/lib/component/reducer/actions/DomainActions.js +30 -1
- package/lib/component/reducer/actions/FiltersActions.js +4 -4
- package/lib/component/reducer/actions/LoadActions.js +1 -1
- package/lib/component/reducer/actions/MoleculeActions.d.ts +2 -0
- package/lib/component/reducer/actions/MoleculeActions.js +51 -2
- package/lib/component/reducer/actions/SpectrumsActions.d.ts +8 -2
- package/lib/component/reducer/actions/SpectrumsActions.js +43 -4
- package/lib/component/reducer/actions/ToolsActions.js +2 -2
- package/lib/component/reducer/actions/ZonesActions.js +1 -1
- package/lib/component/reducer/helper/ZoomHistoryManager.d.ts +4 -6
- package/lib/component/reducer/preferences/actions/setActiveWorkspace.js +1 -1
- package/lib/component/reducer/preferences/actions/setPreferences.js +3 -4
- package/lib/component/reducer/preferences/preferencesReducer.d.ts +1 -1
- package/lib/component/reducer/preferences/preferencesReducer.js +5 -1
- package/lib/component/reducer/preferences/utilities/flatObject.js +1 -1
- package/lib/component/toolbar/ToolTypes.d.ts +4 -4
- package/lib/component/utility/export.d.ts +5 -4
- package/lib/component/utility/export.js +33 -61
- package/lib/component/utility/getSpectraObjectPaths.js +1 -1
- package/lib/component/utility/getUniqueNuclei.js +1 -1
- package/lib/component/utility/jpathToArray.js +1 -1
- package/lib/component/workspaces/index.d.ts +1 -0
- package/lib/component/workspaces/index.js +2 -0
- package/lib/component/workspaces/simulation.d.ts +2 -0
- package/lib/component/workspaces/simulation.js +68 -0
- package/lib/component/workspaces/workspaceDefaultProperties.js +1 -0
- package/lib/data/PredictionManager.d.ts +8 -7
- package/lib/data/PredictionManager.js +95 -22
- package/lib/data/SpectraManager.js +1 -1
- package/lib/data/constants/DefaultPathLengths.d.ts +1 -3
- package/lib/data/constants/SignalsKinds.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/generateJGraphData.js +3 -3
- package/lib/data/data1d/Spectrum1D/getReferenceShift.js +5 -4
- package/lib/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.js +12 -13
- package/lib/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.js +10 -9
- package/lib/data/data1d/database.d.ts +5 -5
- package/lib/data/data1d/database.js +3 -3
- package/lib/data/data1d/multipleSpectraAnalysis.d.ts +1 -1
- package/lib/data/data1d/multipleSpectraAnalysis.js +1 -1
- package/lib/data/data1d/spectrumSimulation.d.ts +14 -0
- package/lib/data/data1d/spectrumSimulation.js +53 -0
- package/lib/data/data2d/Spectrum2D/contours.d.ts +8 -4
- package/lib/data/data2d/Spectrum2D/contours.js +7 -1
- package/lib/data/data2d/Spectrum2D/getMissingProjection.js +6 -6
- package/lib/data/data2d/Spectrum2D/getShift.js +1 -1
- package/lib/data/data2d/Spectrum2D/getSlice.js +4 -4
- package/lib/data/data2d/Spectrum2D/zones/getDetectionZones.js +5 -5
- package/lib/data/getDefaultMatrixFilters.d.ts +2 -2
- package/lib/data/matrixGeneration.js +1 -1
- package/lib/data/molecules/MoleculeManager.d.ts +1 -1
- package/lib/data/molecules/MoleculeManager.js +7 -7
- package/lib/data/parseMeta/linkMetaWithSpectra.js +2 -1
- package/lib/data/types/data1d/MatrixOptions.d.ts +2 -2
- package/lib/data/utilities/FindUtilities.js +4 -4
- package/lib/data/utilities/RangeUtilities.d.ts +1 -1
- package/lib/data/utilities/ZoneUtilities.d.ts +1 -1
- package/lib/data/utilities/calculateSanPlot.js +3 -3
- package/lib/data/utilities/generateNumbersPowerOfX.js +1 -1
- package/lib/utils/clipboard/clipboard.d.ts +12 -0
- package/lib/utils/clipboard/clipboard.js +15 -0
- package/lib/utils/clipboard/clipboardComponents.d.ts +45 -0
- package/lib/utils/clipboard/clipboardComponents.js +150 -0
- package/lib/utils/clipboard/clipboardHooks.d.ts +94 -0
- package/lib/utils/clipboard/clipboardHooks.js +142 -0
- package/lib/utils/clipboard/types.d.ts +1 -0
- package/lib/utils/clipboard/types.js +1 -0
- package/lib/versionInfo.js +1 -1
- package/lib-cjs/component/1d/FooterBanner.js +5 -4
- package/lib-cjs/component/1d/Viewer1D.js +120 -103
- package/lib-cjs/component/1d/database/ResurrectedDatabaseRanges.js +1 -1
- package/lib-cjs/component/1d/jCouplingGraph/JsCouplingLinks.js +1 -1
- package/lib-cjs/component/1d/multiplicityTree/TreeColors.js +1 -6
- package/lib-cjs/component/1d/tool/BaseLineZones.js +6 -3
- package/lib-cjs/component/1d/tool/PeakPointer.js +1 -1
- package/lib-cjs/component/1d/utilities/scale.js +1 -3
- package/lib-cjs/component/1d-2d/tools/BrushXY.js +10 -7
- package/lib-cjs/component/1d-2d/tools/CrossLinePointer.js +1 -1
- package/lib-cjs/component/2d/FooterBanner.js +3 -2
- package/lib-cjs/component/2d/Viewer2D.js +50 -28
- package/lib-cjs/component/2d/XAxis.js +1 -1
- package/lib-cjs/component/2d/YAxis.js +1 -1
- package/lib-cjs/component/2d/zones/Signal.js +1 -2
- package/lib-cjs/component/EventsTrackers/BrushTracker.js +21 -6
- package/lib-cjs/component/NMRium.js +37 -24
- package/lib-cjs/component/assignment/actions/setActiveAssignment.js +1 -1
- package/lib-cjs/component/context/LoggerContext.js +10 -5
- package/lib-cjs/component/elements/InputRange.js +1 -1
- package/lib-cjs/component/elements/dropDownButton/DropDownList.js +3 -1
- package/lib-cjs/component/elements/popup/Alert/AlertBlock.js +36 -0
- package/lib-cjs/component/elements/popup/Alert/Context.js +6 -2
- package/lib-cjs/component/elements/popup/Alert/Provider.js +4 -22
- package/lib-cjs/component/elements/popup/Modal/ConfirmDialog.js +2 -1
- package/lib-cjs/component/elements/popup/Modal/Provider.js +3 -1
- package/lib-cjs/component/header/Header.js +2 -2
- package/lib-cjs/component/header/ZeroFillingOptionsPanel.js +3 -8
- package/lib-cjs/component/hooks/useCheckToolsVisibility.js +2 -2
- package/lib-cjs/component/hooks/useExport.js +2 -1
- package/lib-cjs/component/hooks/usePanelPreferences.js +1 -1
- package/lib-cjs/component/modal/AboutSpectrumSimulationModal.js +54 -0
- package/lib-cjs/component/modal/AboutUsModal.js +4 -2
- package/lib-cjs/component/modal/AlignSpectraModal.js +11 -1
- package/lib-cjs/component/{header/LogsHistory.js → modal/LogsHistoryModal.js} +8 -6
- package/lib-cjs/component/modal/MultipletAnalysisModal.js +2 -1
- package/lib-cjs/component/modal/PredictSpectraModal.js +24 -27
- package/lib-cjs/component/modal/changeSum/ChangeSumModal.js +1 -1
- package/lib-cjs/component/modal/editRange/forms/components/SignalsForm.js +1 -1
- package/lib-cjs/component/modal/editZone/SignalsForm.js +1 -1
- package/lib-cjs/component/modal/metaImportation/MetaImportationModal.js +1 -1
- package/lib-cjs/component/modal/setting/GeneralSettings.js +28 -27
- package/lib-cjs/component/modal/setting/settings-tabs/DisplayTabContent.js +4 -0
- package/lib-cjs/component/modal/setting/settings-tabs/FormattingTabContent.js +1 -1
- package/lib-cjs/component/modal/setting/settingsValidation.js +2 -2
- package/lib-cjs/component/panels/IntegralsPanel/IntegralTable.js +4 -7
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +18 -18
- package/lib-cjs/component/panels/MoleculesPanel/useAtomAssignment.js +3 -5
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +9 -13
- package/lib-cjs/component/panels/Panels.js +13 -0
- package/lib-cjs/component/panels/PeaksPanel/PeaksTable.js +1 -1
- package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +9 -15
- package/lib-cjs/component/panels/RangesPanel/RangesPanel.js +7 -10
- package/lib-cjs/component/panels/SpectrumsPanel/SpectraTable.js +8 -11
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/SpectrumSetting.js +3 -1
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/processSnapPlot.js +2 -2
- package/lib-cjs/component/panels/SummaryPanel/utilities/Utilities.js +1 -1
- package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +1 -1
- package/lib-cjs/component/panels/databasePanel/DatabaseTable.js +1 -1
- package/lib-cjs/component/panels/extra/utilities/MultiplicityUtilities.js +2 -2
- package/lib-cjs/component/panels/extra/utilities/UseToggleStatus.js +1 -1
- package/lib-cjs/component/panels/filtersPanel/FiltersTable.js +2 -2
- package/lib-cjs/component/panels/predictionPanel/PredictionOptionsPanel.js +2 -1
- package/lib-cjs/component/panels/predictionPanel/PredictionPanel.js +3 -2
- package/lib-cjs/component/panels/predictionPanel/PredictionSimpleOptions.js +1 -1
- package/lib-cjs/component/panels/spectrumSimulation/SpectrumSimulation.js +94 -0
- package/lib-cjs/component/panels/spectrumSimulation/SpectrumSimulationPreferences.js +42 -0
- package/lib-cjs/component/panels/spectrumSimulation/SpectrumSimulationSimpleOptions.js +31 -0
- package/lib-cjs/component/panels/spectrumSimulation/SpinSystemTable.js +67 -0
- package/lib-cjs/component/reducer/Reducer.js +251 -239
- package/lib-cjs/component/reducer/actions/AssignmentsActions.js +1 -1
- package/lib-cjs/component/reducer/actions/DatabaseActions.js +2 -1
- package/lib-cjs/component/reducer/actions/DomainActions.js +31 -1
- package/lib-cjs/component/reducer/actions/FiltersActions.js +4 -4
- package/lib-cjs/component/reducer/actions/LoadActions.js +1 -1
- package/lib-cjs/component/reducer/actions/MoleculeActions.js +54 -2
- package/lib-cjs/component/reducer/actions/SpectrumsActions.js +43 -3
- package/lib-cjs/component/reducer/actions/ToolsActions.js +2 -2
- package/lib-cjs/component/reducer/actions/ZonesActions.js +1 -1
- package/lib-cjs/component/reducer/preferences/actions/setActiveWorkspace.js +1 -1
- package/lib-cjs/component/reducer/preferences/actions/setPreferences.js +3 -4
- package/lib-cjs/component/reducer/preferences/preferencesReducer.js +5 -1
- package/lib-cjs/component/reducer/preferences/utilities/flatObject.js +1 -1
- package/lib-cjs/component/utility/export.js +33 -63
- package/lib-cjs/component/utility/getSpectraObjectPaths.js +1 -1
- package/lib-cjs/component/utility/getUniqueNuclei.js +1 -1
- package/lib-cjs/component/utility/jpathToArray.js +1 -1
- package/lib-cjs/component/workspaces/index.js +2 -0
- package/lib-cjs/component/workspaces/simulation.js +71 -0
- package/lib-cjs/component/workspaces/workspaceDefaultProperties.js +1 -0
- package/lib-cjs/data/PredictionManager.js +96 -22
- package/lib-cjs/data/SpectraManager.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/generateJGraphData.js +3 -3
- package/lib-cjs/data/data1d/Spectrum1D/getReferenceShift.js +5 -4
- package/lib-cjs/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.js +12 -13
- package/lib-cjs/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.js +10 -9
- package/lib-cjs/data/data1d/database.js +3 -3
- package/lib-cjs/data/data1d/multipleSpectraAnalysis.js +1 -1
- package/lib-cjs/data/data1d/spectrumSimulation.js +58 -0
- package/lib-cjs/data/data2d/Spectrum2D/contours.js +7 -1
- package/lib-cjs/data/data2d/Spectrum2D/getMissingProjection.js +6 -6
- package/lib-cjs/data/data2d/Spectrum2D/getShift.js +1 -1
- package/lib-cjs/data/data2d/Spectrum2D/getSlice.js +4 -4
- package/lib-cjs/data/data2d/Spectrum2D/zones/getDetectionZones.js +5 -5
- package/lib-cjs/data/matrixGeneration.js +1 -1
- package/lib-cjs/data/molecules/MoleculeManager.js +7 -7
- package/lib-cjs/data/parseMeta/linkMetaWithSpectra.js +2 -1
- package/lib-cjs/data/utilities/FindUtilities.js +4 -4
- package/lib-cjs/data/utilities/calculateSanPlot.js +3 -3
- package/lib-cjs/data/utilities/generateNumbersPowerOfX.js +1 -1
- package/lib-cjs/utils/clipboard/clipboard.js +23 -0
- package/lib-cjs/utils/clipboard/clipboardComponents.js +158 -0
- package/lib-cjs/utils/clipboard/clipboardHooks.js +147 -0
- package/lib-cjs/utils/clipboard/types.js +2 -0
- package/lib-cjs/versionInfo.js +1 -1
- package/package.json +26 -25
- package/lib/component/header/LogsHistory.d.ts +0 -1
|
@@ -47,6 +47,7 @@ export function getDefaultViewState() {
|
|
|
47
47
|
},
|
|
48
48
|
verticalAlign: {},
|
|
49
49
|
predictions: {},
|
|
50
|
+
currentSimulatedSpectrumKey: null,
|
|
50
51
|
};
|
|
51
52
|
}
|
|
52
53
|
export const getInitialState = () => ({
|
|
@@ -126,245 +127,256 @@ function innerSpectrumReducer(draft, action) {
|
|
|
126
127
|
if (!['LOAD_DROP_FILES', 'INITIATE'].includes(action.type)) {
|
|
127
128
|
draft.actionType = action.type;
|
|
128
129
|
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
130
|
+
try {
|
|
131
|
+
switch (action.type) {
|
|
132
|
+
case 'INITIATE':
|
|
133
|
+
return LoadActions.handleInitiate(draft, action);
|
|
134
|
+
case 'LOAD_DROP_FILES':
|
|
135
|
+
return LoadActions.handleLoadDropFiles(draft, action);
|
|
136
|
+
case 'SET_LOADING_FLAG':
|
|
137
|
+
return LoadActions.handleSetIsLoading(draft, action);
|
|
138
|
+
case 'ADD_PEAK':
|
|
139
|
+
return PeaksActions.handleAddPeak(draft, action);
|
|
140
|
+
case 'ADD_PEAKS':
|
|
141
|
+
return PeaksActions.handleAddPeaks(draft, action);
|
|
142
|
+
case 'DELETE_PEAK':
|
|
143
|
+
return PeaksActions.handleDeletePeak(draft, action);
|
|
144
|
+
case 'AUTO_PEAK_PICKING':
|
|
145
|
+
return PeaksActions.handleAutoPeakPicking(draft, action);
|
|
146
|
+
case 'OPTIMIZE_PEAKS':
|
|
147
|
+
return PeaksActions.handleOptimizePeaks(draft, action);
|
|
148
|
+
case 'CHANGE_PEAK_SHAPE':
|
|
149
|
+
return PeaksActions.handleChangePeakShape(draft, action);
|
|
150
|
+
case 'TOGGLE_PEAKS_VIEW_PROPERTY':
|
|
151
|
+
return PeaksActions.handleTogglePeaksViewProperty(draft, action);
|
|
152
|
+
case 'ADD_INTEGRAL':
|
|
153
|
+
return IntegralsActions.handleAddIntegral(draft, action);
|
|
154
|
+
case 'DELETE_INTEGRAL':
|
|
155
|
+
return IntegralsActions.handleDeleteIntegral(draft, action);
|
|
156
|
+
case 'RESIZE_INTEGRAL':
|
|
157
|
+
case 'CHANGE_INTEGRAL':
|
|
158
|
+
return IntegralsActions.handleChangeIntegral(draft, action);
|
|
159
|
+
case 'CHANGE_INTEGRAL_SUM':
|
|
160
|
+
return IntegralsActions.handleChangeIntegralSum(draft, action);
|
|
161
|
+
case 'CHANGE_INTEGRALS_SUM_FLAG':
|
|
162
|
+
return IntegralsActions.handleChangeIntegralsSumFlag(draft);
|
|
163
|
+
case 'CHANGE_INTEGRAL_RELATIVE':
|
|
164
|
+
return IntegralsActions.handleChangeIntegralsRelativeValue(draft, action);
|
|
165
|
+
case 'SET_X_DOMAIN':
|
|
166
|
+
return DomainActions.handleSetXDomain(draft, action);
|
|
167
|
+
case 'SET_Y_DOMAIN':
|
|
168
|
+
return DomainActions.handleSetYDomain(draft, action);
|
|
169
|
+
case 'MOVE':
|
|
170
|
+
return DomainActions.handleMoveOverXAxis(draft, action);
|
|
171
|
+
case 'SET_DIMENSIONS':
|
|
172
|
+
return DimensionsActions.handleSetDimensions(draft, action);
|
|
173
|
+
case 'SHIFT_SPECTRUM':
|
|
174
|
+
return FiltersActions.handleShiftSpectrumAlongXAxis(draft, action);
|
|
175
|
+
case 'APPLY_APODIZATION_FILTER':
|
|
176
|
+
return FiltersActions.handleApplyApodizationFilter(draft, action);
|
|
177
|
+
case 'CALCULATE_APODIZATION_FILTER':
|
|
178
|
+
return FiltersActions.handleCalculateApodizationFilter(draft, action);
|
|
179
|
+
case 'APPLY_ZERO_FILLING_FILTER':
|
|
180
|
+
return FiltersActions.handleApplyZeroFillingFilter(draft, action);
|
|
181
|
+
case 'CALCULATE_ZERO_FILLING_FILTER':
|
|
182
|
+
return FiltersActions.handleCalculateZeroFillingFilter(draft, action);
|
|
183
|
+
case 'APPLY_FFT_FILTER':
|
|
184
|
+
return FiltersActions.handleApplyFFTFilter(draft);
|
|
185
|
+
case 'APPLY_MANUAL_PHASE_CORRECTION_FILTER':
|
|
186
|
+
return FiltersActions.handleApplyManualPhaseCorrectionFilter(draft, action);
|
|
187
|
+
case 'CALCULATE_MANUAL_PHASE_CORRECTION_FILTER':
|
|
188
|
+
return FiltersActions.handleCalculateManualPhaseCorrection(draft, action);
|
|
189
|
+
case 'APPLY_AUTO_PHASE_CORRECTION_FILTER':
|
|
190
|
+
return FiltersActions.handleApplyAutoPhaseCorrectionFilter(draft);
|
|
191
|
+
case 'APPLY_ABSOLUTE_FILTER':
|
|
192
|
+
return FiltersActions.handleApplyAbsoluteFilter(draft);
|
|
193
|
+
case 'APPLY_BASE_LINE_CORRECTION_FILTER':
|
|
194
|
+
return FiltersActions.handleBaseLineCorrectionFilter(draft, action);
|
|
195
|
+
case 'CALCULATE_BASE_LINE_CORRECTION_FILTER':
|
|
196
|
+
return FiltersActions.handleCalculateBaseLineCorrection(draft, action);
|
|
197
|
+
case 'ENABLE_FILTER':
|
|
198
|
+
return FiltersActions.handleEnableFilter(draft, action);
|
|
199
|
+
case 'DELETE_FILTER':
|
|
200
|
+
return FiltersActions.handleDeleteFilter(draft, action);
|
|
201
|
+
case 'DELETE_SPECTRA_FILTER':
|
|
202
|
+
return FiltersActions.handleDeleteSpectraFilter(draft, action);
|
|
203
|
+
case 'SET_FILTER_SNAPSHOT':
|
|
204
|
+
return FiltersActions.handleSetFilterSnapshotHandler(draft, action);
|
|
205
|
+
case 'APPLY_SIGNAL_PROCESSING_FILTER':
|
|
206
|
+
return FiltersActions.handleSignalProcessingFilter(draft, action);
|
|
207
|
+
case 'ADD_EXCLUSION_ZONE':
|
|
208
|
+
return FiltersActions.handleAddExclusionZone(draft, action);
|
|
209
|
+
case 'DELETE_EXCLUSION_ZONE':
|
|
210
|
+
return FiltersActions.handleDeleteExclusionZone(draft, action);
|
|
211
|
+
case 'CHANGE_SPECTRUM_VISIBILITY':
|
|
212
|
+
return SpectrumsActions.handleChangeSpectrumVisibilityById(draft, action);
|
|
213
|
+
case 'CHANGE_SPECTRA_VISIBILITY_BY_NUCLEUS':
|
|
214
|
+
return SpectrumsActions.handleChangeSpectraVisibilityByNucleus(draft, action);
|
|
215
|
+
case 'CHANGE_ACTIVE_SPECTRUM':
|
|
216
|
+
return SpectrumsActions.handleChangeActiveSpectrum(draft, action);
|
|
217
|
+
case 'CHANGE_SPECTRUM_SETTING':
|
|
218
|
+
return SpectrumsActions.handleChangeSpectrumSetting(draft, action);
|
|
219
|
+
case 'ALIGN_SPECTRA':
|
|
220
|
+
return SpectrumsActions.handleAlignSpectraHandler(draft, action);
|
|
221
|
+
case 'DELETE_SPECTRA':
|
|
222
|
+
return SpectrumsActions.handleDeleteSpectra(draft, action);
|
|
223
|
+
case 'ADD_MISSING_PROJECTION':
|
|
224
|
+
return SpectrumsActions.handleAddMissingProjectionHandler(draft, action);
|
|
225
|
+
case 'GENERATE_SPECTRUM_FROM_PUBLICATION_STRING':
|
|
226
|
+
return SpectrumsActions.handleGenerateSpectrumFromPublicationStringHandler(draft, action);
|
|
227
|
+
case 'IMPORT_SPECTRA_META_INFO':
|
|
228
|
+
return SpectrumsActions.handleImportSpectraMetaInfo(draft, action);
|
|
229
|
+
case 'TOGGLE_SPECTRA_LEGEND':
|
|
230
|
+
return SpectrumsActions.handleToggleSpectraLegend(draft);
|
|
231
|
+
case 'RECOLOR_SPECTRA_COLOR':
|
|
232
|
+
return SpectrumsActions.handleRecolorSpectraBasedOnDistinctValue(draft, action);
|
|
233
|
+
case 'ORDER_SPECTRA':
|
|
234
|
+
return SpectrumsActions.handleOrderSpectra(draft, action);
|
|
235
|
+
case 'SIMULATE_SPECTRUM':
|
|
236
|
+
return SpectrumsActions.handleSimulateSpectrum(draft, action);
|
|
237
|
+
case 'SET_SELECTED_TOOL':
|
|
238
|
+
return ToolsActions.setSelectedTool(draft, action);
|
|
239
|
+
case 'RESET_SELECTED_TOOL':
|
|
240
|
+
return ToolsActions.handleResetSelectedTool(draft);
|
|
241
|
+
case 'FULL_ZOOM_OUT':
|
|
242
|
+
return ToolsActions.zoomOut(draft, action);
|
|
243
|
+
case 'TOGGLE_REAL_IMAGINARY_VISIBILITY':
|
|
244
|
+
return ToolsActions.handleToggleRealImaginaryVisibility(draft);
|
|
245
|
+
case 'SET_ZOOM':
|
|
246
|
+
return ToolsActions.handleZoom(draft, action);
|
|
247
|
+
case 'SET_SPECTRA_SAME_TOP':
|
|
248
|
+
return ToolsActions.setSpectraSameTopHandler(draft);
|
|
249
|
+
case 'RESET_SPECTRA_SCALE':
|
|
250
|
+
return ToolsActions.resetSpectraScale(draft);
|
|
251
|
+
case 'CHANGE_SPECTRUM_DISPLAY_VIEW_MODE':
|
|
252
|
+
return ToolsActions.handleChangeSpectrumDisplayMode(draft);
|
|
253
|
+
case 'BRUSH_END':
|
|
254
|
+
return ToolsActions.handleBrushEnd(draft, action);
|
|
255
|
+
case 'SET_VERTICAL_INDICATOR_X_POSITION':
|
|
256
|
+
return ToolsActions.setVerticalIndicatorXPosition(draft, action);
|
|
257
|
+
case 'SET_SPECTRUMS_VERTICAL_ALIGN':
|
|
258
|
+
return ToolsActions.setSpectrumsVerticalAlign(draft);
|
|
259
|
+
case 'SET_ACTIVE_TAB':
|
|
260
|
+
return ToolsActions.handelSetActiveTab(draft, action);
|
|
261
|
+
case 'ADD_BASE_LINE_ZONE':
|
|
262
|
+
return ToolsActions.handleAddBaseLineZone(draft, action);
|
|
263
|
+
case 'DELETE_BASE_LINE_ZONE':
|
|
264
|
+
return ToolsActions.handleDeleteBaseLineZone(draft, action);
|
|
265
|
+
case 'SET_2D_LEVEL':
|
|
266
|
+
return ToolsActions.levelChangeHandler(draft, action);
|
|
267
|
+
case 'ADD_MOLECULE':
|
|
268
|
+
return MoleculeActions.handleAddMolecule(draft, action);
|
|
269
|
+
case 'SET_MOLECULE':
|
|
270
|
+
return MoleculeActions.handleSetMolecule(draft, action);
|
|
271
|
+
case 'CHANGE_MOLECULE_LABEL':
|
|
272
|
+
return MoleculeActions.handleChangeMoleculeLabel(draft, action);
|
|
273
|
+
case 'DELETE_MOLECULE':
|
|
274
|
+
return MoleculeActions.handleDeleteMolecule(draft, action);
|
|
275
|
+
case 'PREDICT_SPECTRA':
|
|
276
|
+
return MoleculeActions.handlePredictSpectraFromMolecule(draft, action);
|
|
277
|
+
case 'FLOAT_MOLECULE_OVER_SPECTRUM':
|
|
278
|
+
return MoleculeActions.handleFloatMoleculeOverSpectrum(draft, action);
|
|
279
|
+
case 'TOGGLE_MOLECULE_ATOM_NUMBER':
|
|
280
|
+
return MoleculeActions.handleToggleMoleculeAtomsNumbers(draft, action);
|
|
281
|
+
case 'CHANGE_FLOAT_MOLECULE_POSITION':
|
|
282
|
+
return MoleculeActions.handleChangeFloatMoleculePosition(draft, action);
|
|
283
|
+
case 'SET_CORRELATIONS_MF':
|
|
284
|
+
return CorrelationsActions.handleSetMF(draft, action);
|
|
285
|
+
case 'SET_CORRELATIONS_TOLERANCE':
|
|
286
|
+
return CorrelationsActions.handleSetTolerance(draft, action);
|
|
287
|
+
case 'SET_CORRELATION':
|
|
288
|
+
return CorrelationsActions.handleSetCorrelation(draft, action);
|
|
289
|
+
case 'SET_CORRELATIONS':
|
|
290
|
+
return CorrelationsActions.handleSetCorrelations(draft, action);
|
|
291
|
+
case 'DELETE_CORRELATION':
|
|
292
|
+
return CorrelationsActions.handleDeleteCorrelation(draft, action);
|
|
293
|
+
case 'AUTO_RANGES_DETECTION':
|
|
294
|
+
return RangesActions.handleAutoRangesDetection(draft, action);
|
|
295
|
+
case 'ADD_RANGE':
|
|
296
|
+
return RangesActions.handleAddRange(draft, action);
|
|
297
|
+
case 'DELETE_RANGE':
|
|
298
|
+
return RangesActions.handleDeleteRange(draft, action);
|
|
299
|
+
case 'DELETE_1D_SIGNAL':
|
|
300
|
+
return RangesActions.handleDeleteSignal(draft, action);
|
|
301
|
+
case 'RESIZE_RANGE':
|
|
302
|
+
return RangesActions.handleResizeRange(draft, action);
|
|
303
|
+
case 'CHANGE_RANGE_SUM':
|
|
304
|
+
return RangesActions.handleChangeRangeSum(draft, action);
|
|
305
|
+
case 'CHANGE_RANGES_SUM_FLAG':
|
|
306
|
+
return RangesActions.handleChangeRangesSumFlag(draft);
|
|
307
|
+
case 'CHANGE_RANGE_RELATIVE':
|
|
308
|
+
return RangesActions.handleChangeRangeRelativeValue(draft, action);
|
|
309
|
+
case 'CHANGE_RANGE_SIGNAL_VALUE':
|
|
310
|
+
return RangesActions.handleChangeRangeSignalValue(draft, action);
|
|
311
|
+
case 'CHANGE_RANGE_SIGNAL_KIND':
|
|
312
|
+
return RangesActions.handleChangeRangeSignalKind(draft, action);
|
|
313
|
+
case 'SAVE_EDITED_RANGE':
|
|
314
|
+
return RangesActions.handleSaveEditedRange(draft, action);
|
|
315
|
+
case 'UNLINK_RANGE':
|
|
316
|
+
return RangesActions.handleUnlinkRange(draft, action);
|
|
317
|
+
case 'SET_DIAID_RANGE':
|
|
318
|
+
return RangesActions.handleSetDiaIDRange(draft, action);
|
|
319
|
+
case 'UPDATE_RANGE':
|
|
320
|
+
return RangesActions.handleUpdateRange(draft, action);
|
|
321
|
+
case 'SHOW_MULTIPLICITY_TREES':
|
|
322
|
+
return RangesActions.handleShowMultiplicityTrees(draft, action);
|
|
323
|
+
case 'SHOW_RANGES_INTEGRALS':
|
|
324
|
+
return RangesActions.handleShowRangesIntegrals(draft, action);
|
|
325
|
+
case 'AUTO_RANGES_SPECTRA_PICKING':
|
|
326
|
+
return RangesActions.handleAutoSpectraRangesDetection(draft);
|
|
327
|
+
case 'SHOW_J_GRAPH':
|
|
328
|
+
return RangesActions.handleShowJGraph(draft, action);
|
|
329
|
+
case 'SET_KEY_PREFERENCES':
|
|
330
|
+
return PreferencesActions.handleSetKeyPreferences(draft, action);
|
|
331
|
+
case 'APPLY_KEY_PREFERENCES':
|
|
332
|
+
return PreferencesActions.handleApplyKeyPreferences(draft, action);
|
|
333
|
+
case 'AUTO_ZONES_DETECTION':
|
|
334
|
+
return ZonesActions.handleAutoZonesDetection(draft, action);
|
|
335
|
+
case 'CHANGE_ZONES_NOISE_FACTOR':
|
|
336
|
+
return ZonesActions.handleChangeZonesFactor(draft, action);
|
|
337
|
+
case 'ADD_2D_ZONE':
|
|
338
|
+
return ZonesActions.handleAdd2dZone(draft, action);
|
|
339
|
+
case 'DELETE_2D_ZONE':
|
|
340
|
+
return ZonesActions.handleDeleteZone(draft, action);
|
|
341
|
+
case 'DELETE_2D_SIGNAL':
|
|
342
|
+
return ZonesActions.handleDeleteSignal(draft, action);
|
|
343
|
+
case 'SET_2D_SIGNAL_PATH_LENGTH':
|
|
344
|
+
return ZonesActions.handleSetSignalPathLength(draft, action);
|
|
345
|
+
case 'CHANGE_ZONE_SIGNAL_VALUE':
|
|
346
|
+
return ZonesActions.handleChangeZoneSignalDelta(draft, action);
|
|
347
|
+
case 'CHANGE_ZONE_SIGNAL_KIND':
|
|
348
|
+
return ZonesActions.handleChangeZoneSignalKind(draft, action);
|
|
349
|
+
case 'UNLINK_ZONE':
|
|
350
|
+
return ZonesActions.handleUnlinkZone(draft, action);
|
|
351
|
+
case 'SET_ZONE_DIAID':
|
|
352
|
+
return ZonesActions.handleSetDiaIDZone(draft, action);
|
|
353
|
+
case 'AUTO_ZONES_SPECTRA_PICKING':
|
|
354
|
+
return ZonesActions.handleAutoSpectraZonesDetection(draft);
|
|
355
|
+
case 'SHOW_ZONES':
|
|
356
|
+
return ZonesActions.handleShowZones(draft, action);
|
|
357
|
+
case 'SHOW_ZONES_SIGNALS':
|
|
358
|
+
return ZonesActions.handleShowSignals(draft, action);
|
|
359
|
+
case 'SHOW_ZONES_PEAKS':
|
|
360
|
+
return ZonesActions.handleShowPeaks(draft, action);
|
|
361
|
+
case 'SAVE_EDITED_ZONE':
|
|
362
|
+
return ZonesActions.handleSaveEditedZone(draft, action);
|
|
363
|
+
case 'ORDER_MULTIPLE_SPECTRA_ANALYSIS':
|
|
364
|
+
return SpectraAnalysisActions.handleOrderSpectra(draft, action);
|
|
365
|
+
case 'RESURRECTING_SPECTRUM_FROM_RANGES':
|
|
366
|
+
return DatabaseActions.handleResurrectSpectrumFromRanges(draft, action);
|
|
367
|
+
case 'RESURRECTING_SPECTRUM_FROM_JCAMP':
|
|
368
|
+
return DatabaseActions.handleResurrectSpectrumFromJcamp(draft, action);
|
|
369
|
+
case 'SET_AUTOMATIC_ASSIGNMENTS':
|
|
370
|
+
return AssignmentsActions.handleSetAutomaticAssignments(draft, action);
|
|
371
|
+
case 'SET_MOUSE_OVER_DISPLAYER':
|
|
372
|
+
return GlobalActions.handleSetIsOverDisplayer(draft, action);
|
|
373
|
+
default:
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
catch (error) {
|
|
377
|
+
draft.errorAction = error;
|
|
378
|
+
error.data = { action };
|
|
379
|
+
reportError(error);
|
|
368
380
|
}
|
|
369
381
|
}
|
|
370
382
|
export const spectrumReducer = produce(innerSpectrumReducer);
|
|
@@ -3,7 +3,7 @@ import { SpectraData1D, SpectraData2D } from 'nmr-processing';
|
|
|
3
3
|
import { State } from '../Reducer';
|
|
4
4
|
import { ActionType } from '../types/ActionType';
|
|
5
5
|
type SetAutomaticAssignmentsAction = ActionType<'SET_AUTOMATIC_ASSIGNMENTS', {
|
|
6
|
-
assignments:
|
|
6
|
+
assignments: Array<SpectraData1D | SpectraData2D>;
|
|
7
7
|
}>;
|
|
8
8
|
export type AssignmentsActions = SetAutomaticAssignmentsAction;
|
|
9
9
|
declare function handleSetAutomaticAssignments(draft: Draft<State>, action: SetAutomaticAssignmentsAction): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
function handleSetAutomaticAssignments(draft, action) {
|
|
2
2
|
const assignments = action.payload.assignments;
|
|
3
|
-
for (
|
|
3
|
+
for (const datum of assignments) {
|
|
4
4
|
const index = draft.data.findIndex((spectrum) => spectrum.id === datum.id);
|
|
5
5
|
if (index !== -1) {
|
|
6
6
|
const dimension = draft.data[index].info.dimension;
|
|
@@ -3,7 +3,8 @@ import { generateSpectrumFromRanges, } from '../../../data/data1d/Spectrum1D/ran
|
|
|
3
3
|
import { setZoom } from '../helper/Zoom1DManager';
|
|
4
4
|
import { setDomain, setIntegralsYDomain } from './DomainActions';
|
|
5
5
|
function handleResurrectSpectrumFromJcamp(draft, action) {
|
|
6
|
-
|
|
6
|
+
const { ranges } = action.payload;
|
|
7
|
+
let { spectrum } = action.payload;
|
|
7
8
|
spectrum = {
|
|
8
9
|
...spectrum,
|
|
9
10
|
ranges: {
|
|
@@ -8,7 +8,11 @@ type SetXDomainAction = ActionType<'SET_X_DOMAIN', {
|
|
|
8
8
|
type SetYDomainAction = ActionType<'SET_Y_DOMAIN', {
|
|
9
9
|
yDomain: [number, number];
|
|
10
10
|
}>;
|
|
11
|
-
|
|
11
|
+
type MoveXAxisAction = ActionType<'MOVE', {
|
|
12
|
+
shiftX: number;
|
|
13
|
+
shiftY: number;
|
|
14
|
+
}>;
|
|
15
|
+
export type DomainActions = SetXDomainAction | SetYDomainAction | MoveXAxisAction;
|
|
12
16
|
declare function getDomain(draft: Draft<State>): {
|
|
13
17
|
xDomain: [number, number] | [undefined, undefined];
|
|
14
18
|
yDomain: [number, number] | [undefined, undefined];
|
|
@@ -25,4 +29,5 @@ declare function setIntegralsYDomain(draft: Draft<State>, data: Spectrum1D[] | S
|
|
|
25
29
|
declare function setMode(draft: Draft<State>): void;
|
|
26
30
|
declare function handleSetXDomain(draft: Draft<State>, action: SetXDomainAction): void;
|
|
27
31
|
declare function handleSetYDomain(draft: Draft<State>, action: SetYDomainAction): void;
|
|
28
|
-
|
|
32
|
+
declare function handleMoveOverXAxis(draft: Draft<State>, action: MoveXAxisAction): void;
|
|
33
|
+
export { getDomain, setDomain, setMode, setIntegralsYDomain, handleSetXDomain, handleSetYDomain, handleMoveOverXAxis, };
|
|
@@ -194,4 +194,33 @@ function handleSetYDomain(draft, action) {
|
|
|
194
194
|
draft.yDomain = yDomain;
|
|
195
195
|
addToBrushHistory(draft, { xDomain: draft.xDomain, yDomain });
|
|
196
196
|
}
|
|
197
|
-
|
|
197
|
+
function handleMoveOverXAxis(draft, action) {
|
|
198
|
+
const { shiftX, shiftY } = action.payload;
|
|
199
|
+
const [x1, x2] = draft.xDomain;
|
|
200
|
+
const [y1, y2] = draft.yDomain;
|
|
201
|
+
const [x1Origin, x2Origin] = draft.originDomain.xDomain;
|
|
202
|
+
const [y1Origin, y2Origin] = draft.originDomain.yDomain;
|
|
203
|
+
let x1Domain = x1 - shiftX;
|
|
204
|
+
let x2Domain = x2 - shiftX;
|
|
205
|
+
let y1Domain = y1 - shiftY;
|
|
206
|
+
let y2Domain = y2 - shiftY;
|
|
207
|
+
if (x1Domain < x1Origin) {
|
|
208
|
+
x1Domain = x1Origin;
|
|
209
|
+
x2Domain = x2;
|
|
210
|
+
}
|
|
211
|
+
if (x2Domain > x2Origin) {
|
|
212
|
+
x2Domain = x2Origin;
|
|
213
|
+
x1Domain = x1;
|
|
214
|
+
}
|
|
215
|
+
if (y1Domain < y1Origin) {
|
|
216
|
+
y1Domain = y1Origin;
|
|
217
|
+
y2Domain = y2;
|
|
218
|
+
}
|
|
219
|
+
if (y2Domain > y2Origin) {
|
|
220
|
+
y2Domain = y2Origin;
|
|
221
|
+
y1Domain = y1;
|
|
222
|
+
}
|
|
223
|
+
draft.xDomain = [x1Domain, x2Domain];
|
|
224
|
+
draft.yDomain = [y1Domain, y2Domain];
|
|
225
|
+
}
|
|
226
|
+
export { getDomain, setDomain, setMode, setIntegralsYDomain, handleSetXDomain, handleSetYDomain, handleMoveOverXAxis, };
|