nmrium 0.38.0 → 0.38.2
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/ApodizationLine.js +27 -4
- package/lib/component/1d/ExclusionZoneAnnotation.js +1 -1
- package/lib/component/1d/ExclusionZonesAnnotations.js +1 -1
- package/lib/component/1d/FooterBanner.js +5 -5
- package/lib/component/1d/SpectraLegends.js +2 -3
- package/lib/component/1d/Viewer1D.js +1 -1
- package/lib/component/1d/database/DatabaseSpectrum.js +2 -1
- package/lib/component/1d/integral/Integral.d.ts +1 -1
- package/lib/component/1d/integral/IntegralResizable.d.ts +1 -1
- package/lib/component/1d/jCouplingGraph/JsCouplings.d.ts +1 -1
- package/lib/component/1d/multiAnalysis/MultiAnalysisRanges.js +2 -2
- package/lib/component/1d/multiplicityTree/LevelNode.d.ts +1 -1
- package/lib/component/1d/multiplicityTree/MultiplicityTree.d.ts +1 -1
- package/lib/component/1d/multiplicityTree/StringNode.d.ts +1 -1
- package/lib/component/1d/multiplicityTree/buildTreeNode.d.ts +1 -1
- package/lib/component/1d/peaks/usePeakShapesPath.d.ts +2 -1
- package/lib/component/1d/ranges/Range.d.ts +1 -1
- package/lib/component/1d/tool/PeakPointer.js +6 -6
- package/lib/component/1d/tool/XLabelPointer.js +5 -5
- package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.d.ts +1 -1
- package/lib/component/1d-2d/components/FloatMoleculeStructures/index.d.ts +1 -1
- package/lib/component/1d-2d/tools/BrushX.js +2 -3
- package/lib/component/1d-2d/tools/BrushXY.js +2 -3
- package/lib/component/1d-2d/tools/CrossLinePointer.js +4 -5
- package/lib/component/2d/Chart2D.js +4 -4
- package/lib/component/2d/FooterBanner.js +5 -5
- package/lib/component/2d/Viewer2D.js +1 -1
- package/lib/component/2d/tools/XYLabelPointer.js +5 -5
- package/lib/component/2d/zones/Signal.d.ts +1 -1
- package/lib/component/2d/zones/SignalCrosshair.d.ts +1 -1
- package/lib/component/2d/zones/Zone.d.ts +1 -1
- package/lib/component/EventsTrackers/BrushTracker.d.ts +20 -12
- package/lib/component/EventsTrackers/BrushTracker.js +35 -22
- package/lib/component/EventsTrackers/MouseTracker.d.ts +6 -2
- package/lib/component/EventsTrackers/MouseTracker.js +4 -1
- package/lib/component/NMRium.d.ts +4 -5
- package/lib/component/NMRium.js +11 -14
- package/lib/component/assignment/AssignmentsReducer.d.ts +2 -2
- package/lib/component/context/PreferencesContext.d.ts +6 -6
- package/lib/component/elements/Button.d.ts +13 -11
- package/lib/component/elements/Button.js +16 -25
- package/lib/component/elements/ColorInput.d.ts +0 -1
- package/lib/component/elements/ColorInput.js +2 -2
- package/lib/component/elements/EditableColumn.js +5 -2
- package/lib/component/elements/Input.js +2 -4
- package/lib/component/elements/Label.d.ts +1 -0
- package/lib/component/elements/Label.js +2 -2
- package/lib/component/elements/MolecularFormulaInput.d.ts +2 -2
- package/lib/component/elements/MolecularFormulaInput.js +15 -18
- package/lib/component/elements/NextPrev.d.ts +5 -3
- package/lib/component/elements/NextPrev.js +26 -8
- package/lib/component/elements/NumberInput.js +2 -2
- package/lib/component/elements/ReactTable/ReactTable.js +4 -4
- package/lib/component/elements/formik/FormikCheckBox.d.ts +2 -1
- package/lib/component/elements/formik/FormikCheckBox.js +2 -2
- package/lib/component/elements/formik/FormikColumnFormatField.d.ts +4 -0
- package/lib/component/elements/formik/FormikColumnFormatField.js +19 -16
- package/lib/component/elements/formik/FormikInput.js +10 -6
- package/lib/component/elements/formik/FormikSelect.js +1 -1
- package/lib/component/header/ApodizationOptionsPanel.js +4 -3
- package/lib/component/header/AutoPeakPickingOptionPanel.js +16 -7
- package/lib/component/header/BaseLineCorrectionPanel.js +5 -2
- package/lib/component/header/PhaseCorrectionPanel.js +5 -2
- package/lib/component/header/RangesPickingOptionPanel.js +15 -7
- package/lib/component/header/ZeroFillingOptionsPanel.js +1 -1
- package/lib/component/highlight/index.d.ts +1 -1
- package/lib/component/hooks/useActiveSpectra.d.ts +1 -1
- package/lib/component/hooks/useActiveSpectrum.d.ts +1 -1
- package/lib/component/hooks/useActiveSpectrumPeaksViewState.d.ts +1 -1
- package/lib/component/hooks/useCheckPointsNumberInWindowArea.d.ts +2 -0
- package/lib/component/hooks/useCheckPointsNumberInWindowArea.js +17 -0
- package/lib/component/hooks/useCheckToolsVisibility.d.ts +2 -2
- package/lib/component/hooks/useDatumWithSpectraStatistics.d.ts +3 -2
- package/lib/component/hooks/useExport.js +1 -1
- package/lib/component/hooks/useFilter.d.ts +2 -1
- package/lib/component/hooks/usePanelPreferences.d.ts +3 -3
- package/lib/component/hooks/usePanelPreferences.js +4 -0
- package/lib/component/hooks/useSaveSettings.d.ts +1 -1
- package/lib/component/hooks/useSaveSettings.js +1 -1
- package/lib/component/hooks/useVerticalAlign.d.ts +1 -1
- package/lib/component/loader/DropZone.js +1 -2
- package/lib/component/modal/EditPeakShapeModal.d.ts +2 -2
- package/lib/component/modal/LoadJCAMPModal.d.ts +3 -3
- package/lib/component/modal/LoadJCAMPModal.js +35 -66
- package/lib/component/modal/ModalStyle.js +0 -10
- package/lib/component/modal/MoleculeStructureEditorModal.d.ts +2 -1
- package/lib/component/modal/MoleculeStructureEditorModal.js +12 -6
- package/lib/component/modal/MultipletAnalysisModal.d.ts +2 -2
- package/lib/component/modal/PredictSpectraModal.d.ts +4 -2
- package/lib/component/modal/PredictSpectraModal.js +43 -105
- package/lib/component/modal/SaveAsModal.d.ts +2 -0
- package/lib/component/modal/SaveAsModal.js +21 -14
- package/lib/component/modal/changeSum/ChangeSumModal.js +25 -38
- package/lib/component/modal/editRange/forms/components/AddSignalFormTab.d.ts +1 -1
- package/lib/component/modal/editRange/forms/components/DeltaInput.js +2 -0
- package/lib/component/modal/editRange/forms/components/SignalsForm.d.ts +2 -2
- package/lib/component/modal/metaImportation/MetaImportationModal.js +15 -5
- package/lib/component/modal/setting/GeneralSettings.js +1 -6
- package/lib/component/modal/setting/settings-tabs/DatabasesTabContent.d.ts +1 -1
- 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/IntegralsPreferences.js +7 -15
- package/lib/component/panels/MoleculesPanel/MoleculeHeader.js +2 -2
- package/lib/component/panels/MoleculesPanel/MoleculePanel.d.ts +1 -11
- package/lib/component/panels/MoleculesPanel/MoleculePanel.js +20 -25
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.d.ts +6 -11
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +71 -81
- package/lib/component/panels/MoleculesPanel/Utilities.d.ts +1 -1
- package/lib/component/panels/MoleculesPanel/Utilities.js +3 -1
- package/lib/component/panels/MultipleSpectraAnalysisPanel/base/AnalysisColumnHeader.js +6 -6
- package/lib/component/panels/MultipleSpectraAnalysisPanel/preferences/AnalysisTablePreferences.js +2 -2
- package/lib/component/panels/MultipleSpectraAnalysisPanel/preferences/index.js +2 -2
- package/lib/component/panels/PeaksPanel/PeaksPanel.d.ts +1 -1
- package/lib/component/panels/RangesPanel/RangesHeader.js +39 -53
- package/lib/component/panels/RangesPanel/RangesPreferences.d.ts +1 -1
- package/lib/component/panels/RangesPanel/RangesPreferences.js +7 -22
- package/lib/component/panels/RangesPanel/RangesTable.d.ts +2 -2
- package/lib/component/panels/RangesPanel/RangesTableRow.d.ts +2 -2
- package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaHzColumn.d.ts +1 -1
- package/lib/component/panels/RangesPanel/hooks/useMapRanges.d.ts +1 -1
- package/lib/component/panels/SpectrumsPanel/SpectraTable.js +5 -1
- package/lib/component/panels/SpectrumsPanel/base/SpectraColumnsManager.js +10 -4
- package/lib/component/panels/SpectrumsPanel/base/setting/processSnapPlot.d.ts +2 -2
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +1 -1
- package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +1 -1
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/EditPathLength.d.ts +1 -1
- package/lib/component/panels/ZonesPanel/hooks/useMapZones.d.ts +1 -1
- package/lib/component/panels/databasePanel/DatabasePanel.d.ts +1 -1
- package/lib/component/panels/databasePanel/DatabasePanel.js +11 -28
- package/lib/component/panels/databasePanel/DatabasePreferences.js +2 -2
- package/lib/component/panels/header/DefaultPanelHeader.d.ts +2 -3
- package/lib/component/panels/header/DefaultPanelHeader.js +18 -26
- package/lib/component/panels/header/PanelHeader.d.ts +7 -0
- package/lib/component/panels/header/PanelHeader.js +12 -0
- package/lib/component/panels/predictionPanel/PredictionOptionsPanel.d.ts +9 -0
- package/lib/component/panels/predictionPanel/PredictionOptionsPanel.js +94 -0
- package/lib/component/panels/predictionPanel/PredictionPanel.d.ts +1 -1
- package/lib/component/panels/predictionPanel/PredictionPanel.js +107 -37
- package/lib/component/panels/predictionPanel/PredictionPreferences.d.ts +3 -0
- package/lib/component/panels/predictionPanel/PredictionPreferences.js +24 -0
- package/lib/component/panels/predictionPanel/PredictionSimpleOptions.d.ts +2 -0
- package/lib/component/panels/predictionPanel/PredictionSimpleOptions.js +44 -0
- package/lib/component/reducer/Reducer.d.ts +5 -87
- package/lib/component/reducer/Reducer.js +1 -25
- package/lib/component/reducer/actions/FiltersActions.d.ts +1 -2
- package/lib/component/reducer/actions/FiltersActions.js +47 -52
- package/lib/component/reducer/actions/HistoryActions.d.ts +4 -0
- package/lib/component/reducer/actions/HistoryActions.js +40 -0
- package/lib/component/reducer/actions/IntegralsActions.d.ts +1 -1
- package/lib/component/reducer/actions/LoadActions.d.ts +1 -2
- package/lib/component/reducer/actions/LoadActions.js +1 -1
- package/lib/component/reducer/actions/MoleculeActions.d.ts +7 -4
- package/lib/component/reducer/actions/MoleculeActions.js +57 -28
- package/lib/component/reducer/actions/PeaksActions.d.ts +1 -2
- package/lib/component/reducer/actions/PeaksActions.js +3 -3
- package/lib/component/reducer/actions/RangesActions.d.ts +4 -5
- package/lib/component/reducer/actions/RangesActions.js +5 -27
- package/lib/component/reducer/actions/SpectrumsActions.js +2 -2
- package/lib/component/reducer/actions/ToolsActions.d.ts +2 -2
- package/lib/component/reducer/actions/ZonesActions.d.ts +2 -1
- package/lib/component/reducer/actions/ZonesActions.js +1 -2
- package/lib/component/reducer/helper/getActiveSpectra.d.ts +1 -1
- package/lib/component/reducer/helper/getActiveSpectrum.d.ts +1 -1
- package/lib/component/reducer/helper/getVerticalAlign.d.ts +1 -1
- package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.d.ts +1 -1
- package/lib/component/reducer/preferences/preferencesReducer.d.ts +1 -1
- package/lib/component/reducer/preferences/utilities/getActiveWorkspace.d.ts +1 -1
- package/lib/component/reducer/preferences/utilities/getPreferencesByWorkspace.d.ts +2 -3
- package/lib/component/reducer/preferences/utilities/initWorkspace.d.ts +1 -1
- package/lib/component/reducer/preferences/utilities/mapNucleiFormatting.d.ts +1 -1
- package/lib/component/reducer/preferences/utilities/mapWorkspaces.d.ts +1 -1
- package/lib/component/toolbar/BasicToolBar.js +6 -11
- package/lib/component/toolbar/ToolTypes.d.ts +2 -2
- package/lib/component/toolbar/ToolTypes.js +1 -1
- package/lib/component/workspaces/assignment.d.ts +1 -1
- package/lib/component/workspaces/basic.d.ts +1 -1
- package/lib/component/workspaces/embedded.d.ts +1 -1
- package/lib/component/workspaces/exercise.d.ts +1 -1
- package/lib/component/workspaces/index.d.ts +6 -6
- package/lib/component/workspaces/prediction.d.ts +1 -1
- package/lib/component/workspaces/prediction.js +193 -0
- package/lib/component/workspaces/process1D.d.ts +1 -1
- package/lib/component/workspaces/workspaceDefaultProperties.d.ts +1 -1
- package/lib/component/workspaces/workspaceDefaultProperties.js +1 -1
- package/lib/data/PredictionManager.d.ts +2 -1
- package/lib/data/PredictionManager.js +16 -2
- package/lib/data/SpectraManager.d.ts +1 -2
- package/lib/data/constants/DefaultApodizationOptions.d.ts +2 -0
- package/lib/data/constants/DefaultApodizationOptions.js +5 -0
- package/lib/data/data1d/Spectrum1D/SumManager.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/convertDataToFloat64Array.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/generateJGraphData.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/index.d.ts +1 -5
- package/lib/data/data1d/Spectrum1D/index.js +1 -5
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +3 -3
- package/lib/data/data1d/Spectrum1D/integrals/initiateIntegrals.d.ts +2 -1
- package/lib/data/data1d/Spectrum1D/integrals/initiateIntegrals.js +1 -1
- package/lib/data/data1d/Spectrum1D/isRangeAssigned.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.d.ts +2 -1
- package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +1 -2
- package/lib/data/data1d/Spectrum1D/peaks/initiatePeaks.d.ts +3 -2
- package/lib/data/data1d/Spectrum1D/peaks/initiatePeaks.js +1 -1
- package/lib/data/data1d/Spectrum1D/peaks/lookupPeak.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.d.ts +2 -1
- package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.js +1 -2
- package/lib/data/data1d/Spectrum1D/ranges/addRange.d.ts +7 -7
- package/lib/data/data1d/Spectrum1D/ranges/addRange.js +5 -24
- package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.d.ts +2 -1
- package/lib/data/data1d/Spectrum1D/ranges/changeRange.d.ts +2 -1
- package/lib/data/data1d/Spectrum1D/ranges/changeRange.js +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/checkRangeKind.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectRange.js +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectRanges.js +1 -2
- package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.d.ts +37 -2
- package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.js +1 -1
- package/lib/data/data1d/database.js +2 -4
- package/lib/data/data1d/multipleSpectraAnalysis.d.ts +3 -30
- package/lib/data/data1d/multipleSpectraAnalysis.js +4 -15
- package/lib/data/data2d/Spectrum2D/getMissingProjection.d.ts +3 -2
- package/lib/data/data2d/Spectrum2D/getShift.js +1 -1
- package/lib/data/data2d/Spectrum2D/getSlice.d.ts +1 -1
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +1 -1
- package/lib/data/data2d/Spectrum2D/zones/detectZones.d.ts +1 -1
- package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.d.ts +1 -1
- package/lib/data/data2d/Spectrum2D/zones/initiateZones.d.ts +3 -2
- package/lib/data/data2d/Spectrum2D/zones/isZoneExists.d.ts +2 -1
- package/lib/data/data2d/Spectrum2D/zones/mapZones.d.ts +3 -2
- package/lib/data/getDefaultMatrixFilters.d.ts +1 -1
- package/lib/data/types/data1d/ComplexData1D.d.ts +2 -2
- package/lib/data/types/data1d/RangeDetectionResult.d.ts +1 -1
- package/lib/data/utilities/FindUtilities.d.ts +2 -1
- package/lib/data/utilities/RangeUtilities.d.ts +1 -1
- package/lib/data/utilities/ZoneUtilities.d.ts +1 -1
- package/lib/data/utilities/calculateSanPlot.d.ts +2 -2
- package/lib/types/NMRiumDataReturn.d.ts +1 -3
- package/lib/versionInfo.js +1 -1
- package/lib-cjs/component/1d/ApodizationLine.js +28 -5
- package/lib-cjs/component/1d/ExclusionZoneAnnotation.js +3 -26
- package/lib-cjs/component/1d/ExclusionZonesAnnotations.js +5 -28
- package/lib-cjs/component/1d/FooterBanner.js +2 -2
- package/lib-cjs/component/1d/SpectraLegends.js +1 -2
- package/lib-cjs/component/1d/database/DatabaseSpectrum.js +2 -1
- package/lib-cjs/component/1d/multiAnalysis/MultiAnalysisRanges.js +2 -2
- package/lib-cjs/component/1d/tool/PeakPointer.js +3 -3
- package/lib-cjs/component/1d/tool/XLabelPointer.js +2 -2
- package/lib-cjs/component/1d-2d/tools/BrushX.js +1 -2
- package/lib-cjs/component/1d-2d/tools/BrushXY.js +1 -2
- package/lib-cjs/component/1d-2d/tools/CrossLinePointer.js +2 -3
- package/lib-cjs/component/2d/Chart2D.js +4 -4
- package/lib-cjs/component/2d/FooterBanner.js +2 -2
- package/lib-cjs/component/2d/tools/XYLabelPointer.js +2 -2
- package/lib-cjs/component/EventsTrackers/BrushTracker.js +36 -22
- package/lib-cjs/component/EventsTrackers/MouseTracker.js +4 -1
- package/lib-cjs/component/NMRium.js +8 -11
- package/lib-cjs/component/elements/Button.js +16 -25
- package/lib-cjs/component/elements/ColorInput.js +2 -2
- package/lib-cjs/component/elements/EditableColumn.js +5 -2
- package/lib-cjs/component/elements/Input.js +2 -4
- package/lib-cjs/component/elements/Label.js +2 -2
- package/lib-cjs/component/elements/MolecularFormulaInput.js +14 -16
- package/lib-cjs/component/elements/NextPrev.js +26 -8
- package/lib-cjs/component/elements/NumberInput.js +2 -2
- package/lib-cjs/component/elements/ReactTable/ReactTable.js +4 -4
- package/lib-cjs/component/elements/formik/FormikCheckBox.js +2 -2
- package/lib-cjs/component/elements/formik/FormikColumnFormatField.js +20 -16
- package/lib-cjs/component/elements/formik/FormikInput.js +10 -6
- package/lib-cjs/component/elements/formik/FormikSelect.js +1 -1
- package/lib-cjs/component/header/ApodizationOptionsPanel.js +6 -5
- package/lib-cjs/component/header/AutoPeakPickingOptionPanel.js +15 -6
- package/lib-cjs/component/header/BaseLineCorrectionPanel.js +6 -3
- package/lib-cjs/component/header/PhaseCorrectionPanel.js +6 -26
- package/lib-cjs/component/header/RangesPickingOptionPanel.js +15 -7
- package/lib-cjs/component/header/ZeroFillingOptionsPanel.js +2 -25
- package/lib-cjs/component/hooks/useCheckPointsNumberInWindowArea.js +24 -0
- package/lib-cjs/component/hooks/useExport.js +1 -1
- package/lib-cjs/component/hooks/usePanelPreferences.js +4 -0
- package/lib-cjs/component/hooks/useSaveSettings.js +1 -1
- package/lib-cjs/component/loader/DropZone.js +1 -2
- package/lib-cjs/component/modal/LoadJCAMPModal.js +60 -67
- package/lib-cjs/component/modal/ModalStyle.js +0 -10
- package/lib-cjs/component/modal/MoleculeStructureEditorModal.js +12 -6
- package/lib-cjs/component/modal/PredictSpectraModal.js +43 -126
- package/lib-cjs/component/modal/SaveAsModal.js +22 -14
- package/lib-cjs/component/modal/changeSum/ChangeSumModal.js +24 -37
- package/lib-cjs/component/modal/editRange/forms/components/DeltaInput.js +2 -0
- package/lib-cjs/component/modal/metaImportation/MetaImportationModal.js +15 -5
- package/lib-cjs/component/modal/setting/GeneralSettings.js +1 -6
- package/lib-cjs/component/panels/IntegralsPanel/IntegralsPreferences.js +6 -14
- package/lib-cjs/component/panels/MoleculesPanel/MoleculeHeader.js +2 -2
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanel.js +19 -24
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +76 -86
- package/lib-cjs/component/panels/MoleculesPanel/Utilities.js +3 -1
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/base/AnalysisColumnHeader.js +6 -6
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/preferences/AnalysisTablePreferences.js +2 -2
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/preferences/index.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +38 -52
- package/lib-cjs/component/panels/RangesPanel/RangesPreferences.js +5 -20
- package/lib-cjs/component/panels/SpectrumsPanel/SpectraTable.js +5 -1
- package/lib-cjs/component/panels/SpectrumsPanel/base/SpectraColumnsManager.js +10 -4
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +1 -1
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +1 -1
- package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +11 -28
- package/lib-cjs/component/panels/databasePanel/DatabasePreferences.js +25 -2
- package/lib-cjs/component/panels/header/DefaultPanelHeader.js +18 -26
- package/lib-cjs/component/panels/header/PanelHeader.js +15 -0
- package/lib-cjs/component/panels/predictionPanel/PredictionOptionsPanel.js +122 -0
- package/lib-cjs/component/panels/predictionPanel/PredictionPanel.js +107 -37
- package/lib-cjs/component/panels/predictionPanel/PredictionPreferences.js +29 -0
- package/lib-cjs/component/panels/predictionPanel/PredictionSimpleOptions.js +72 -0
- package/lib-cjs/component/reducer/Reducer.js +2 -27
- package/lib-cjs/component/reducer/actions/FiltersActions.js +66 -94
- package/lib-cjs/component/reducer/actions/HistoryActions.js +45 -0
- package/lib-cjs/component/reducer/actions/MoleculeActions.js +58 -32
- package/lib-cjs/component/reducer/actions/PeaksActions.js +3 -3
- package/lib-cjs/component/reducer/actions/RangesActions.js +7 -52
- package/lib-cjs/component/reducer/actions/SpectrumsActions.js +4 -27
- package/lib-cjs/component/reducer/actions/ZonesActions.js +4 -28
- package/lib-cjs/component/toolbar/BasicToolBar.js +5 -10
- package/lib-cjs/component/toolbar/ToolTypes.js +9 -32
- package/lib-cjs/component/workspaces/prediction.js +193 -0
- package/lib-cjs/component/workspaces/workspaceDefaultProperties.js +21 -44
- package/lib-cjs/data/PredictionManager.js +16 -2
- package/lib-cjs/data/constants/DefaultApodizationOptions.js +8 -0
- package/lib-cjs/data/data1d/Spectrum1D/index.js +7 -11
- package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +9 -32
- package/lib-cjs/data/data1d/Spectrum1D/integrals/initiateIntegrals.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +1 -2
- package/lib-cjs/data/data1d/Spectrum1D/peaks/initiatePeaks.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/peaks/optimizePeaks.js +1 -2
- package/lib-cjs/data/data1d/Spectrum1D/ranges/addRange.js +7 -26
- package/lib-cjs/data/data1d/Spectrum1D/ranges/changeRange.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/ranges/detectRange.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/ranges/detectRanges.js +3 -4
- package/lib-cjs/data/data1d/Spectrum1D/ranges/initiateRanges.js +2 -2
- package/lib-cjs/data/data1d/database.js +2 -4
- package/lib-cjs/data/data1d/multipleSpectraAnalysis.js +5 -16
- package/lib-cjs/data/data2d/Spectrum2D/getShift.js +3 -26
- package/lib-cjs/data/data2d/Spectrum2D/initiateDatum2D.js +2 -25
- package/lib-cjs/versionInfo.js +1 -1
- package/package.json +25 -25
- package/lib/component/panels/predictionPanel/PredictionOptions.d.ts +0 -7
- package/lib/component/panels/predictionPanel/PredictionOptions.js +0 -74
- package/lib/component/workspaces/Workspace.d.ts +0 -188
- package/lib/component/workspaces/Workspace.js +0 -1
- package/lib/data/Filters.d.ts +0 -12
- package/lib/data/Filters.js +0 -12
- package/lib/data/FiltersManager.d.ts +0 -30
- package/lib/data/FiltersManager.js +0 -175
- package/lib/data/data1d/Spectrum1D/getShiftX.d.ts +0 -2
- package/lib/data/data1d/Spectrum1D/getShiftX.js +0 -6
- package/lib/data/data1d/Spectrum1D/getSpectrumErrorValue.d.ts +0 -2
- package/lib/data/data1d/Spectrum1D/getSpectrumErrorValue.js +0 -4
- package/lib/data/data1d/Spectrum1D/integrals/checkIntegralKind.d.ts +0 -7
- package/lib/data/data1d/Spectrum1D/integrals/checkIntegralKind.js +0 -9
- package/lib/data/data1d/Spectrum1D/integrals/mapIntegrals.d.ts +0 -12
- package/lib/data/data1d/Spectrum1D/integrals/mapIntegrals.js +0 -36
- package/lib/data/data1d/Spectrum1D/integrals/updateIntegrals.d.ts +0 -2
- package/lib/data/data1d/Spectrum1D/integrals/updateIntegrals.js +0 -6
- package/lib/data/data1d/Spectrum1D/integrals/updateIntegralsRelativeValues.d.ts +0 -2
- package/lib/data/data1d/Spectrum1D/integrals/updateIntegralsRelativeValues.js +0 -5
- package/lib/data/data1d/Spectrum1D/integrals/updateRelatives.d.ts +0 -2
- package/lib/data/data1d/Spectrum1D/integrals/updateRelatives.js +0 -26
- package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.d.ts +0 -3
- package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.js +0 -45
- package/lib/data/data1d/Spectrum1D/peaks/updatePeaks.d.ts +0 -2
- package/lib/data/data1d/Spectrum1D/peaks/updatePeaks.js +0 -7
- package/lib/data/data1d/Spectrum1D/ranges/mapRanges.d.ts +0 -4
- package/lib/data/data1d/Spectrum1D/ranges/mapRanges.js +0 -78
- package/lib/data/data1d/Spectrum1D/ranges/updateRanges.d.ts +0 -2
- package/lib/data/data1d/Spectrum1D/ranges/updateRanges.js +0 -9
- package/lib/data/data1d/Spectrum1D/ranges/updateRangesRelativeValues.d.ts +0 -2
- package/lib/data/data1d/Spectrum1D/ranges/updateRangesRelativeValues.js +0 -5
- package/lib/data/data1d/filter1d/apodization.d.ts +0 -27
- package/lib/data/data1d/filter1d/apodization.js +0 -81
- package/lib/data/data1d/filter1d/baselineCorrection.d.ts +0 -33
- package/lib/data/data1d/filter1d/baselineCorrection.js +0 -51
- package/lib/data/data1d/filter1d/digitalFilter.d.ts +0 -20
- package/lib/data/data1d/filter1d/digitalFilter.js +0 -44
- package/lib/data/data1d/filter1d/equallySpaced.d.ts +0 -33
- package/lib/data/data1d/filter1d/equallySpaced.js +0 -52
- package/lib/data/data1d/filter1d/exclusionZones.d.ts +0 -15
- package/lib/data/data1d/filter1d/exclusionZones.js +0 -32
- package/lib/data/data1d/filter1d/fft.d.ts +0 -18
- package/lib/data/data1d/filter1d/fft.js +0 -90
- package/lib/data/data1d/filter1d/phaseCorrection.d.ts +0 -26
- package/lib/data/data1d/filter1d/phaseCorrection.js +0 -64
- package/lib/data/data1d/filter1d/shiftX.d.ts +0 -20
- package/lib/data/data1d/filter1d/shiftX.js +0 -26
- package/lib/data/data1d/filter1d/signalProcessing.d.ts +0 -26
- package/lib/data/data1d/filter1d/signalProcessing.js +0 -65
- package/lib/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.d.ts +0 -2
- package/lib/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +0 -35
- package/lib/data/data1d/filter1d/zeroFilling.d.ts +0 -22
- package/lib/data/data1d/filter1d/zeroFilling.js +0 -60
- package/lib/data/data2d/filter2d/shiftX.d.ts +0 -18
- package/lib/data/data2d/filter2d/shiftX.js +0 -27
- package/lib/data/data2d/filter2d/shiftY.d.ts +0 -18
- package/lib/data/data2d/filter2d/shiftY.js +0 -27
- package/lib/data/types/view-state/PeaksViewState.d.ts +0 -17
- package/lib/data/types/view-state/PeaksViewState.js +0 -1
- package/lib/types/NMRiumGeneralPreferences.d.ts +0 -7
- package/lib/types/NMRiumGeneralPreferences.js +0 -1
- package/lib/types/NMRiumPanelPreferences.d.ts +0 -17
- package/lib/types/NMRiumPanelPreferences.js +0 -1
- package/lib/types/NMRiumToolBarPreferences.d.ts +0 -22
- package/lib/types/NMRiumToolBarPreferences.js +0 -1
- package/lib/types/PanelPreferencesType.d.ts +0 -4
- package/lib/types/PanelPreferencesType.js +0 -1
- package/lib-cjs/component/panels/predictionPanel/PredictionOptions.js +0 -102
- package/lib-cjs/component/workspaces/Workspace.js +0 -2
- package/lib-cjs/data/Filters.js +0 -38
- package/lib-cjs/data/FiltersManager.js +0 -206
- package/lib-cjs/data/data1d/Spectrum1D/getShiftX.js +0 -33
- package/lib-cjs/data/data1d/Spectrum1D/getSpectrumErrorValue.js +0 -8
- package/lib-cjs/data/data1d/Spectrum1D/integrals/checkIntegralKind.js +0 -13
- package/lib-cjs/data/data1d/Spectrum1D/integrals/mapIntegrals.js +0 -40
- package/lib-cjs/data/data1d/Spectrum1D/integrals/updateIntegrals.js +0 -10
- package/lib-cjs/data/data1d/Spectrum1D/integrals/updateIntegralsRelativeValues.js +0 -9
- package/lib-cjs/data/data1d/Spectrum1D/integrals/updateRelatives.js +0 -30
- package/lib-cjs/data/data1d/Spectrum1D/peaks/mapPeaks.js +0 -49
- package/lib-cjs/data/data1d/Spectrum1D/peaks/updatePeaks.js +0 -11
- package/lib-cjs/data/data1d/Spectrum1D/ranges/mapRanges.js +0 -82
- package/lib-cjs/data/data1d/Spectrum1D/ranges/updateRanges.js +0 -13
- package/lib-cjs/data/data1d/Spectrum1D/ranges/updateRangesRelativeValues.js +0 -9
- package/lib-cjs/data/data1d/filter1d/apodization.js +0 -88
- package/lib-cjs/data/data1d/filter1d/baselineCorrection.js +0 -60
- package/lib-cjs/data/data1d/filter1d/digitalFilter.js +0 -50
- package/lib-cjs/data/data1d/filter1d/equallySpaced.js +0 -61
- package/lib-cjs/data/data1d/filter1d/exclusionZones.js +0 -38
- package/lib-cjs/data/data1d/filter1d/fft.js +0 -96
- package/lib-cjs/data/data1d/filter1d/phaseCorrection.js +0 -70
- package/lib-cjs/data/data1d/filter1d/shiftX.js +0 -32
- package/lib-cjs/data/data1d/filter1d/signalProcessing.js +0 -95
- package/lib-cjs/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +0 -39
- package/lib-cjs/data/data1d/filter1d/zeroFilling.js +0 -66
- package/lib-cjs/data/data2d/filter2d/shiftX.js +0 -33
- package/lib-cjs/data/data2d/filter2d/shiftY.js +0 -33
- package/lib-cjs/data/types/view-state/PeaksViewState.js +0 -2
- package/lib-cjs/types/NMRiumGeneralPreferences.js +0 -2
- package/lib-cjs/types/NMRiumPanelPreferences.js +0 -2
- package/lib-cjs/types/NMRiumToolBarPreferences.js +0 -2
- package/lib-cjs/types/PanelPreferencesType.js +0 -2
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
30
|
+
const formik_1 = require("formik");
|
|
31
|
+
const merge_1 = __importDefault(require("lodash/merge"));
|
|
32
|
+
const react_1 = require("react");
|
|
33
|
+
const Yup = __importStar(require("yup"));
|
|
34
|
+
const PredictionManager_1 = require("../../../data/PredictionManager");
|
|
35
|
+
const PreferencesContext_1 = require("../../context/PreferencesContext");
|
|
36
|
+
const Label_1 = __importDefault(require("../../elements/Label"));
|
|
37
|
+
const FormikNumberInput_1 = __importDefault(require("../../elements/formik/FormikNumberInput"));
|
|
38
|
+
const FormikOnChange_1 = __importDefault(require("../../elements/formik/FormikOnChange"));
|
|
39
|
+
const FormikSelect_1 = __importDefault(require("../../elements/formik/FormikSelect"));
|
|
40
|
+
const usePanelPreferences_1 = require("../../hooks/usePanelPreferences");
|
|
41
|
+
const predictionFormValidation = Yup.object().shape({
|
|
42
|
+
'1d': Yup.object({
|
|
43
|
+
lineWidth: Yup.number().integer().min(1).required(),
|
|
44
|
+
}),
|
|
45
|
+
});
|
|
46
|
+
const labelStyle = {
|
|
47
|
+
label: { fontSize: '10px' },
|
|
48
|
+
wrapper: { display: 'flex', alignItems: 'center', height: '100%' },
|
|
49
|
+
container: { padding: '0 5px', height: '100%' },
|
|
50
|
+
};
|
|
51
|
+
const selectStyles = { width: '100%', minWidth: '75px', fontSize: '10px' };
|
|
52
|
+
function PredictionSimpleOptions() {
|
|
53
|
+
const { dispatch } = (0, PreferencesContext_1.usePreferences)();
|
|
54
|
+
const predictionPreferences = (0, usePanelPreferences_1.usePanelPreferences)('prediction');
|
|
55
|
+
const optionsChangeHandler = (0, react_1.useCallback)((values) => {
|
|
56
|
+
const value = (0, merge_1.default)({}, PredictionManager_1.defaultPredictionOptions, values);
|
|
57
|
+
dispatch({
|
|
58
|
+
type: 'SET_PANELS_PREFERENCES',
|
|
59
|
+
payload: { key: 'prediction', value },
|
|
60
|
+
});
|
|
61
|
+
}, [dispatch]);
|
|
62
|
+
return ((0, jsx_runtime_1.jsx)(formik_1.Formik, { initialValues: predictionPreferences, validationSchema: predictionFormValidation, enableReinitialize: true,
|
|
63
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
64
|
+
onSubmit: () => { }, children: (0, jsx_runtime_1.jsxs)("div", { style: {
|
|
65
|
+
display: 'flex',
|
|
66
|
+
justifyContent: 'flex-end',
|
|
67
|
+
flex: '1',
|
|
68
|
+
padding: '0 10px',
|
|
69
|
+
height: '100%',
|
|
70
|
+
}, children: [(0, jsx_runtime_1.jsx)(Label_1.default, { title: "Frequency", style: labelStyle, children: (0, jsx_runtime_1.jsx)(FormikSelect_1.default, { items: PredictionManager_1.FREQUENCIES, style: selectStyles, name: "frequency" }) }), (0, jsx_runtime_1.jsxs)(Label_1.default, { title: "Line Width", style: labelStyle, children: [(0, jsx_runtime_1.jsx)(FormikNumberInput_1.default, { name: "1d.lineWidth", type: "number", style: { margin: 0, width: '40px' } }), (0, jsx_runtime_1.jsx)("span", { style: { padding: '0 5px' }, children: "Hz" })] }), (0, jsx_runtime_1.jsx)(FormikOnChange_1.default, { enableValidation: true, onChange: optionsChangeHandler })] }) }));
|
|
71
|
+
}
|
|
72
|
+
exports.default = PredictionSimpleOptions;
|
|
@@ -23,11 +23,10 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.spectrumReducer = exports.
|
|
26
|
+
exports.spectrumReducer = exports.initState = exports.initialState = exports.getInitialState = exports.getDefaultViewState = exports.zoneStateInit = exports.rangeStateInit = void 0;
|
|
27
27
|
const uuid_1 = require("@lukeed/uuid");
|
|
28
28
|
const immer_1 = require("immer");
|
|
29
29
|
const nmr_correlation_1 = require("nmr-correlation");
|
|
30
|
-
const PredictionManager_1 = require("../../data/PredictionManager");
|
|
31
30
|
const Constants_1 = require("../panels/SummaryPanel/CorrelationTable/Constants");
|
|
32
31
|
const AssignmentsActions = __importStar(require("./actions/AssignmentsActions"));
|
|
33
32
|
const CorrelationsActions = __importStar(require("./actions/CorrelationsActions"));
|
|
@@ -73,6 +72,7 @@ function getDefaultViewState() {
|
|
|
73
72
|
levels: {},
|
|
74
73
|
},
|
|
75
74
|
verticalAlign: {},
|
|
75
|
+
predictions: {},
|
|
76
76
|
};
|
|
77
77
|
}
|
|
78
78
|
exports.getDefaultViewState = getDefaultViewState;
|
|
@@ -151,31 +151,6 @@ function initState(state) {
|
|
|
151
151
|
};
|
|
152
152
|
}
|
|
153
153
|
exports.initState = initState;
|
|
154
|
-
function dispatchMiddleware(dispatch) {
|
|
155
|
-
return (action) => {
|
|
156
|
-
switch (action.type) {
|
|
157
|
-
case 'INITIATE':
|
|
158
|
-
case 'LOAD_DROP_FILES': {
|
|
159
|
-
dispatch(action);
|
|
160
|
-
break;
|
|
161
|
-
}
|
|
162
|
-
case 'PREDICT_SPECTRA': {
|
|
163
|
-
const { molfile, options } = action.payload;
|
|
164
|
-
void (0, PredictionManager_1.predictSpectra)(molfile).then((predictedSpectra) => {
|
|
165
|
-
action.payload = { predictedSpectra, options, molfile };
|
|
166
|
-
dispatch(action);
|
|
167
|
-
}, () => {
|
|
168
|
-
dispatch(action);
|
|
169
|
-
});
|
|
170
|
-
break;
|
|
171
|
-
}
|
|
172
|
-
default:
|
|
173
|
-
dispatch(action);
|
|
174
|
-
break;
|
|
175
|
-
}
|
|
176
|
-
};
|
|
177
|
-
}
|
|
178
|
-
exports.dispatchMiddleware = dispatchMiddleware;
|
|
179
154
|
function innerSpectrumReducer(draft, action) {
|
|
180
155
|
if (!['LOAD_DROP_FILES', 'INITIATE'].includes(action.type)) {
|
|
181
156
|
draft.actionType = action.type;
|
|
@@ -1,27 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
4
|
};
|
|
@@ -29,12 +6,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
29
6
|
exports.rollbackSpectrumByFilter = exports.rollbackSpectrum = exports.handleSignalProcessingFilter = exports.handleDeleteExclusionZone = exports.handleAddExclusionZone = exports.handleSetFilterSnapshotHandler = exports.handleBaseLineCorrectionFilter = exports.handleDeleteSpectraFilter = exports.handleDeleteFilter = exports.handleEnableFilter = exports.handleCalculateZeroFillingFilter = exports.handleCalculateApodizationFilter = exports.handleCalculateBaseLineCorrection = exports.calculateBaseLineCorrection = exports.handleCalculateManualPhaseCorrection = exports.handleApplyAbsoluteFilter = exports.handleApplyAutoPhaseCorrectionFilter = exports.handleApplyManualPhaseCorrectionFilter = exports.handleApplyFFTFilter = exports.handleApplyApodizationFilter = exports.handleApplyZeroFillingFilter = exports.handleShiftSpectrumAlongXAxis = void 0;
|
|
30
7
|
const uuid_1 = require("@lukeed/uuid");
|
|
31
8
|
const immer_1 = require("immer");
|
|
32
|
-
const
|
|
33
|
-
const
|
|
34
|
-
const apodization_1 = require("../../../data/data1d/filter1d/apodization");
|
|
35
|
-
const baselineCorrection_1 = require("../../../data/data1d/filter1d/baselineCorrection");
|
|
36
|
-
const phaseCorrection_1 = require("../../../data/data1d/filter1d/phaseCorrection");
|
|
37
|
-
const zeroFilling_1 = require("../../../data/data1d/filter1d/zeroFilling");
|
|
9
|
+
const nmr_processing_1 = require("nmr-processing");
|
|
10
|
+
const DefaultApodizationOptions_1 = require("../../../data/constants/DefaultApodizationOptions");
|
|
38
11
|
const ToolTypes_1 = require("../../toolbar/ToolTypes");
|
|
39
12
|
const getSpectraByNucleus_1 = require("../../utility/getSpectraByNucleus");
|
|
40
13
|
const nucleusToString_1 = __importDefault(require("../../utility/nucleusToString"));
|
|
@@ -46,10 +19,9 @@ const getStrongestPeak_1 = require("../helper/getStrongestPeak");
|
|
|
46
19
|
const DomainActions_1 = require("./DomainActions");
|
|
47
20
|
const PreferencesActions_1 = require("./PreferencesActions");
|
|
48
21
|
const ToolsActions_1 = require("./ToolsActions");
|
|
22
|
+
const { fft, apodization, baselineCorrection, phaseCorrection, zeroFilling, shiftX, shift2DX, shift2DY, exclusionZones, signalProcessing, } = nmr_processing_1.Filters;
|
|
49
23
|
function getFilterUpdateDomainRules(filterName) {
|
|
50
|
-
return (
|
|
51
|
-
// eslint-disable-next-line import/namespace
|
|
52
|
-
Filters[filterName]?.DOMAIN_UPDATE_RULES || {
|
|
24
|
+
return (nmr_processing_1.Filters[filterName]?.DOMAIN_UPDATE_RULES || {
|
|
53
25
|
updateXDomain: false,
|
|
54
26
|
updateYDomain: false,
|
|
55
27
|
});
|
|
@@ -81,12 +53,12 @@ function rollbackSpectrumByFilter(draft, options) {
|
|
|
81
53
|
updateDomainOptions.updateYDomain =
|
|
82
54
|
updateYDomain || updateDomainOptions.updateYDomain;
|
|
83
55
|
}
|
|
84
|
-
FiltersManager.reapplyFilters(datum, filters);
|
|
56
|
+
nmr_processing_1.FiltersManager.reapplyFilters(datum, filters);
|
|
85
57
|
}
|
|
86
58
|
draft.tempData = (0, immer_1.current)(draft).data;
|
|
87
59
|
// apply the current Filters
|
|
88
60
|
if (applyFilter) {
|
|
89
|
-
FiltersManager.reapplyFilters(datum, datum.filters.slice(0, filterIndex + 1));
|
|
61
|
+
nmr_processing_1.FiltersManager.reapplyFilters(datum, datum.filters.slice(0, filterIndex + 1));
|
|
90
62
|
}
|
|
91
63
|
currentIsFid = datum.info.isFid;
|
|
92
64
|
//if we still point to the same filter then close the filter options panel and reset the selected tool to default one (zoom tool)
|
|
@@ -103,7 +75,7 @@ function rollbackSpectrumByFilter(draft, options) {
|
|
|
103
75
|
// re-implement all filters and rest all view property that related to filters
|
|
104
76
|
if (reset) {
|
|
105
77
|
draft.tempData = null;
|
|
106
|
-
FiltersManager.reapplyFilters(datum);
|
|
78
|
+
nmr_processing_1.FiltersManager.reapplyFilters(datum);
|
|
107
79
|
updateDomainOptions = { updateXDomain: true, updateYDomain: true };
|
|
108
80
|
const { toolOptions: { data }, } = (0, Reducer_1.getInitialState)();
|
|
109
81
|
draft.toolOptions.data = data;
|
|
@@ -123,12 +95,12 @@ function rollbackSpectrum(draft, options) {
|
|
|
123
95
|
const { filterKey, reset = false, updateFilterViewOptions = true } = options;
|
|
124
96
|
//return back the spectra data to point of time before applying a specific filter
|
|
125
97
|
const applyFilter = [
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
98
|
+
phaseCorrection.id,
|
|
99
|
+
fft.id,
|
|
100
|
+
shiftX.id,
|
|
101
|
+
shift2DX.id,
|
|
102
|
+
shift2DY.id,
|
|
103
|
+
signalProcessing.id,
|
|
132
104
|
].includes(filterKey);
|
|
133
105
|
rollbackSpectrumByFilter(draft, {
|
|
134
106
|
searchBy: 'name',
|
|
@@ -144,7 +116,7 @@ exports.rollbackSpectrum = rollbackSpectrum;
|
|
|
144
116
|
function updateFilterOptionsInView(draft, filterKey) {
|
|
145
117
|
const activeSpectrum = (0, getActiveSpectrum_1.getActiveSpectrum)(draft);
|
|
146
118
|
switch (filterKey) {
|
|
147
|
-
case
|
|
119
|
+
case phaseCorrection.id: {
|
|
148
120
|
// look for the strongest peak to set it as a pivot
|
|
149
121
|
const { xValue, index } = (0, getStrongestPeak_1.getStrongestPeak)(draft) || {
|
|
150
122
|
xValue: 0,
|
|
@@ -153,7 +125,7 @@ function updateFilterOptionsInView(draft, filterKey) {
|
|
|
153
125
|
draft.toolOptions.data.pivot = { value: xValue, index };
|
|
154
126
|
break;
|
|
155
127
|
}
|
|
156
|
-
case
|
|
128
|
+
case baselineCorrection.id: {
|
|
157
129
|
if (activeSpectrum) {
|
|
158
130
|
const baselineCorrectionFilter = (0, immer_1.current)(draft).data[activeSpectrum.index].filters.find((filter) => filter.name === ToolTypes_1.options.baselineCorrection.id);
|
|
159
131
|
if (baselineCorrectionFilter) {
|
|
@@ -165,8 +137,8 @@ function updateFilterOptionsInView(draft, filterKey) {
|
|
|
165
137
|
}
|
|
166
138
|
break;
|
|
167
139
|
}
|
|
168
|
-
case
|
|
169
|
-
draft.toolOptions.data.apodizationOptions =
|
|
140
|
+
case apodization.id: {
|
|
141
|
+
draft.toolOptions.data.apodizationOptions = DefaultApodizationOptions_1.defaultApodizationOptions;
|
|
170
142
|
break;
|
|
171
143
|
}
|
|
172
144
|
default:
|
|
@@ -202,18 +174,18 @@ function handleShiftSpectrumAlongXAxis(draft, action) {
|
|
|
202
174
|
if (activeSpectrum) {
|
|
203
175
|
const activeFilterIndex = getActiveFilterIndex(draft);
|
|
204
176
|
const index = activeSpectrum?.index;
|
|
205
|
-
FiltersManager.applyFilter(draft.data[index], [
|
|
206
|
-
{ name:
|
|
177
|
+
nmr_processing_1.FiltersManager.applyFilter(draft.data[index], [
|
|
178
|
+
{ name: shiftX.id, value: { shift } },
|
|
207
179
|
]);
|
|
208
180
|
if (activeFilterIndex !== -1) {
|
|
209
181
|
rollbackSpectrumByFilter(draft, {
|
|
210
182
|
searchBy: 'name',
|
|
211
|
-
key:
|
|
183
|
+
key: shiftX.id,
|
|
212
184
|
triggerSource: 'Apply',
|
|
213
185
|
});
|
|
214
186
|
}
|
|
215
187
|
else {
|
|
216
|
-
updateView(draft,
|
|
188
|
+
updateView(draft, shiftX.DOMAIN_UPDATE_RULES);
|
|
217
189
|
}
|
|
218
190
|
}
|
|
219
191
|
}
|
|
@@ -226,22 +198,22 @@ function handleApplyZeroFillingFilter(draft, action) {
|
|
|
226
198
|
const index = activeSpectrum.index;
|
|
227
199
|
const filters = [
|
|
228
200
|
{
|
|
229
|
-
name:
|
|
201
|
+
name: zeroFilling.id,
|
|
230
202
|
value: action.payload,
|
|
231
203
|
},
|
|
232
204
|
];
|
|
233
|
-
FiltersManager.applyFilter(draft.data[index], filters, {
|
|
205
|
+
nmr_processing_1.FiltersManager.applyFilter(draft.data[index], filters, {
|
|
234
206
|
filterIndex: activeFilterIndex,
|
|
235
207
|
});
|
|
236
208
|
if (activeFilterIndex !== -1) {
|
|
237
209
|
rollbackSpectrumByFilter(draft, {
|
|
238
210
|
searchBy: 'name',
|
|
239
|
-
key:
|
|
211
|
+
key: zeroFilling.id,
|
|
240
212
|
triggerSource: 'Apply',
|
|
241
213
|
});
|
|
242
214
|
}
|
|
243
215
|
else {
|
|
244
|
-
updateView(draft,
|
|
216
|
+
updateView(draft, zeroFilling.DOMAIN_UPDATE_RULES);
|
|
245
217
|
}
|
|
246
218
|
}
|
|
247
219
|
}
|
|
@@ -253,7 +225,7 @@ function handleCalculateZeroFillingFilter(draft, action) {
|
|
|
253
225
|
const index = activeSpectrum.index;
|
|
254
226
|
const { data: { x, re, im }, filters, info, } = draft.tempData[index];
|
|
255
227
|
let _data = { data: { x, re, im }, filters, info };
|
|
256
|
-
|
|
228
|
+
zeroFilling.apply(_data, action.payload);
|
|
257
229
|
const { im: newIm, re: newRe, x: newX } = _data.data;
|
|
258
230
|
const datum = draft.data[index];
|
|
259
231
|
datum.data.x = newX;
|
|
@@ -272,7 +244,7 @@ function handleCalculateApodizationFilter(draft, action) {
|
|
|
272
244
|
const { data: { x, re, im }, info, } = draft.tempData[index];
|
|
273
245
|
let _data = { data: { x, re, im }, info };
|
|
274
246
|
draft.toolOptions.data.apodizationOptions = options;
|
|
275
|
-
|
|
247
|
+
apodization.apply(_data, options);
|
|
276
248
|
const { im: newIm, re: newRe } = _data.data;
|
|
277
249
|
const datum = draft.data[index];
|
|
278
250
|
datum.data.im = newIm;
|
|
@@ -286,21 +258,21 @@ function handleApplyApodizationFilter(draft, action) {
|
|
|
286
258
|
if (activeSpectrum) {
|
|
287
259
|
const index = activeSpectrum.index;
|
|
288
260
|
const activeFilterIndex = getActiveFilterIndex(draft);
|
|
289
|
-
FiltersManager.applyFilter(draft.data[index], [
|
|
261
|
+
nmr_processing_1.FiltersManager.applyFilter(draft.data[index], [
|
|
290
262
|
{
|
|
291
|
-
name:
|
|
263
|
+
name: apodization.id,
|
|
292
264
|
value: action.payload,
|
|
293
265
|
},
|
|
294
266
|
], { filterIndex: activeFilterIndex });
|
|
295
267
|
if (activeFilterIndex !== -1) {
|
|
296
268
|
rollbackSpectrumByFilter(draft, {
|
|
297
269
|
searchBy: 'name',
|
|
298
|
-
key:
|
|
270
|
+
key: apodization.id,
|
|
299
271
|
triggerSource: 'Apply',
|
|
300
272
|
});
|
|
301
273
|
}
|
|
302
274
|
else {
|
|
303
|
-
updateView(draft,
|
|
275
|
+
updateView(draft, apodization.DOMAIN_UPDATE_RULES);
|
|
304
276
|
}
|
|
305
277
|
}
|
|
306
278
|
}
|
|
@@ -312,15 +284,15 @@ function handleApplyFFTFilter(draft) {
|
|
|
312
284
|
const { index } = activeSpectrum;
|
|
313
285
|
const activeFilterIndex = getActiveFilterIndex(draft);
|
|
314
286
|
//apply filter into the spectrum
|
|
315
|
-
FiltersManager.applyFilter(draft.data[index], [{ name:
|
|
287
|
+
nmr_processing_1.FiltersManager.applyFilter(draft.data[index], [{ name: fft.id, value: {} }], { filterIndex: activeFilterIndex });
|
|
316
288
|
if (activeFilterIndex !== -1) {
|
|
317
289
|
rollbackSpectrumByFilter(draft, {
|
|
318
290
|
searchBy: 'name',
|
|
319
|
-
key:
|
|
291
|
+
key: fft.id,
|
|
320
292
|
});
|
|
321
293
|
}
|
|
322
294
|
else {
|
|
323
|
-
updateView(draft,
|
|
295
|
+
updateView(draft, fft.DOMAIN_UPDATE_RULES);
|
|
324
296
|
}
|
|
325
297
|
}
|
|
326
298
|
}
|
|
@@ -333,21 +305,21 @@ function handleApplyManualPhaseCorrectionFilter(draft, action) {
|
|
|
333
305
|
const { ph0, ph1 } = action.payload;
|
|
334
306
|
draft.data = draft.tempData;
|
|
335
307
|
const activeFilterIndex = getActiveFilterIndex(draft);
|
|
336
|
-
FiltersManager.applyFilter(draft.data[index], [
|
|
308
|
+
nmr_processing_1.FiltersManager.applyFilter(draft.data[index], [
|
|
337
309
|
{
|
|
338
|
-
name:
|
|
310
|
+
name: phaseCorrection.id,
|
|
339
311
|
value: { ph0, ph1 },
|
|
340
312
|
},
|
|
341
313
|
], { filterIndex: activeFilterIndex });
|
|
342
314
|
if (activeFilterIndex !== -1) {
|
|
343
315
|
rollbackSpectrumByFilter(draft, {
|
|
344
316
|
searchBy: 'name',
|
|
345
|
-
key:
|
|
317
|
+
key: phaseCorrection.id,
|
|
346
318
|
triggerSource: 'Apply',
|
|
347
319
|
});
|
|
348
320
|
}
|
|
349
321
|
else {
|
|
350
|
-
updateView(draft,
|
|
322
|
+
updateView(draft, phaseCorrection.DOMAIN_UPDATE_RULES);
|
|
351
323
|
}
|
|
352
324
|
}
|
|
353
325
|
}
|
|
@@ -360,7 +332,7 @@ function handleCalculateManualPhaseCorrection(draft, action) {
|
|
|
360
332
|
const { data: { x, re, im }, info, } = draft.tempData[index];
|
|
361
333
|
const { ph0, ph1 } = action.payload;
|
|
362
334
|
let _data = { data: { x, re, im }, info };
|
|
363
|
-
|
|
335
|
+
phaseCorrection.apply(_data, { ph0, ph1 });
|
|
364
336
|
const { im: newIm, re: newRe } = _data.data;
|
|
365
337
|
const datum = draft.data[index];
|
|
366
338
|
datum.data.im = newIm;
|
|
@@ -374,21 +346,21 @@ function handleApplyAbsoluteFilter(draft) {
|
|
|
374
346
|
if (activeSpectrum) {
|
|
375
347
|
const { index } = activeSpectrum;
|
|
376
348
|
const activeFilterIndex = getActiveFilterIndex(draft);
|
|
377
|
-
FiltersManager.applyFilter(draft.data[index], [
|
|
349
|
+
nmr_processing_1.FiltersManager.applyFilter(draft.data[index], [
|
|
378
350
|
{
|
|
379
|
-
name:
|
|
351
|
+
name: phaseCorrection.id,
|
|
380
352
|
value: { absolute: true },
|
|
381
353
|
},
|
|
382
354
|
], { filterIndex: activeFilterIndex });
|
|
383
355
|
if (activeFilterIndex !== -1) {
|
|
384
356
|
rollbackSpectrumByFilter(draft, {
|
|
385
357
|
searchBy: 'name',
|
|
386
|
-
key:
|
|
358
|
+
key: phaseCorrection.id,
|
|
387
359
|
triggerSource: 'Apply',
|
|
388
360
|
});
|
|
389
361
|
}
|
|
390
362
|
else {
|
|
391
|
-
updateView(draft,
|
|
363
|
+
updateView(draft, phaseCorrection.DOMAIN_UPDATE_RULES);
|
|
392
364
|
}
|
|
393
365
|
}
|
|
394
366
|
}
|
|
@@ -399,21 +371,21 @@ function handleApplyAutoPhaseCorrectionFilter(draft) {
|
|
|
399
371
|
if (activeSpectrum) {
|
|
400
372
|
const { index } = activeSpectrum;
|
|
401
373
|
const activeFilterIndex = getActiveFilterIndex(draft);
|
|
402
|
-
FiltersManager.applyFilter(draft.data[index], [
|
|
374
|
+
nmr_processing_1.FiltersManager.applyFilter(draft.data[index], [
|
|
403
375
|
{
|
|
404
|
-
name:
|
|
376
|
+
name: phaseCorrection.id,
|
|
405
377
|
value: {},
|
|
406
378
|
},
|
|
407
379
|
], { filterIndex: activeFilterIndex });
|
|
408
380
|
if (activeFilterIndex !== -1) {
|
|
409
381
|
rollbackSpectrumByFilter(draft, {
|
|
410
382
|
searchBy: 'name',
|
|
411
|
-
key:
|
|
383
|
+
key: phaseCorrection.id,
|
|
412
384
|
triggerSource: 'Apply',
|
|
413
385
|
});
|
|
414
386
|
}
|
|
415
387
|
else {
|
|
416
|
-
updateView(draft,
|
|
388
|
+
updateView(draft, phaseCorrection.DOMAIN_UPDATE_RULES);
|
|
417
389
|
}
|
|
418
390
|
}
|
|
419
391
|
}
|
|
@@ -425,9 +397,9 @@ function handleBaseLineCorrectionFilter(draft, action) {
|
|
|
425
397
|
const { zones } = draft.toolOptions.data.baselineCorrection;
|
|
426
398
|
const { livePreview, ...options } = action.payload;
|
|
427
399
|
const activeFilterIndex = getActiveFilterIndex(draft);
|
|
428
|
-
FiltersManager.applyFilter(draft.data[activeSpectrum.index], [
|
|
400
|
+
nmr_processing_1.FiltersManager.applyFilter(draft.data[activeSpectrum.index], [
|
|
429
401
|
{
|
|
430
|
-
name:
|
|
402
|
+
name: baselineCorrection.id,
|
|
431
403
|
value: {
|
|
432
404
|
...options,
|
|
433
405
|
zones,
|
|
@@ -437,12 +409,12 @@ function handleBaseLineCorrectionFilter(draft, action) {
|
|
|
437
409
|
if (activeFilterIndex !== -1) {
|
|
438
410
|
rollbackSpectrumByFilter(draft, {
|
|
439
411
|
searchBy: 'name',
|
|
440
|
-
key:
|
|
412
|
+
key: baselineCorrection.id,
|
|
441
413
|
triggerSource: 'Apply',
|
|
442
414
|
});
|
|
443
415
|
}
|
|
444
416
|
else {
|
|
445
|
-
updateView(draft,
|
|
417
|
+
updateView(draft, baselineCorrection.DOMAIN_UPDATE_RULES);
|
|
446
418
|
}
|
|
447
419
|
}
|
|
448
420
|
}
|
|
@@ -461,7 +433,7 @@ function calculateBaseLineCorrection(draft, baseLineOptions) {
|
|
|
461
433
|
const { livePreview, ...filterOptions } = options;
|
|
462
434
|
if (livePreview) {
|
|
463
435
|
let _data = { data: { x, re, im }, info };
|
|
464
|
-
|
|
436
|
+
baselineCorrection.apply(_data, {
|
|
465
437
|
zones,
|
|
466
438
|
...filterOptions,
|
|
467
439
|
});
|
|
@@ -484,7 +456,7 @@ function handleEnableFilter(draft, action) {
|
|
|
484
456
|
const activeSpectrum = (0, getActiveSpectrum_1.getActiveSpectrum)(draft);
|
|
485
457
|
if (activeSpectrum) {
|
|
486
458
|
//apply filter into the spectrum
|
|
487
|
-
FiltersManager.enableFilter(draft.data[activeSpectrum.index], filterID, enabled);
|
|
459
|
+
nmr_processing_1.FiltersManager.enableFilter(draft.data[activeSpectrum.index], filterID, enabled);
|
|
488
460
|
(0, ToolsActions_1.resetSelectedTool)(draft);
|
|
489
461
|
(0, DomainActions_1.setDomain)(draft);
|
|
490
462
|
(0, DomainActions_1.setMode)(draft);
|
|
@@ -503,7 +475,7 @@ function handleDeleteFilter(draft, action) {
|
|
|
503
475
|
const activeSpectrum = (0, getActiveSpectrum_1.getActiveSpectrum)(draft);
|
|
504
476
|
if (activeSpectrum) {
|
|
505
477
|
//apply filter into the spectrum
|
|
506
|
-
FiltersManager.deleteFilter(draft.data[activeSpectrum.index], filterID);
|
|
478
|
+
nmr_processing_1.FiltersManager.deleteFilter(draft.data[activeSpectrum.index], filterID);
|
|
507
479
|
draft.toolOptions.data.activeFilterID = null;
|
|
508
480
|
(0, ToolsActions_1.resetSelectedTool)(draft);
|
|
509
481
|
(0, DomainActions_1.setDomain)(draft);
|
|
@@ -519,7 +491,7 @@ function handleDeleteSpectraFilter(draft, action) {
|
|
|
519
491
|
if ((0, nucleusToString_1.default)(datum?.info?.nucleus) === draft.view.spectra.activeTab) {
|
|
520
492
|
const filtersResult = datum.filters?.filter((filter) => filter.name === filterName) || [];
|
|
521
493
|
for (const filter of filtersResult) {
|
|
522
|
-
FiltersManager.deleteFilter(datum, filter.id);
|
|
494
|
+
nmr_processing_1.FiltersManager.deleteFilter(datum, filter.id);
|
|
523
495
|
}
|
|
524
496
|
}
|
|
525
497
|
}
|
|
@@ -550,14 +522,14 @@ function handleSignalProcessingFilter(draft, action) {
|
|
|
550
522
|
const activeFilterIndex = getActiveFilterIndex(draft);
|
|
551
523
|
const spectra = (0, getSpectraByNucleus_1.getSpectraByNucleus)(nucleus, data);
|
|
552
524
|
for (const spectrum of spectra) {
|
|
553
|
-
FiltersManager.applyFilter(spectrum, [
|
|
525
|
+
nmr_processing_1.FiltersManager.applyFilter(spectrum, [
|
|
554
526
|
{
|
|
555
|
-
name:
|
|
527
|
+
name: signalProcessing.id,
|
|
556
528
|
value,
|
|
557
529
|
},
|
|
558
530
|
], { filterIndex: activeFilterIndex });
|
|
559
531
|
}
|
|
560
|
-
const { updateXDomain, updateYDomain } =
|
|
532
|
+
const { updateXDomain, updateYDomain } = signalProcessing.DOMAIN_UPDATE_RULES;
|
|
561
533
|
(0, DomainActions_1.setDomain)(draft, { updateXDomain, updateYDomain });
|
|
562
534
|
}
|
|
563
535
|
exports.handleSignalProcessingFilter = handleSignalProcessingFilter;
|
|
@@ -575,9 +547,9 @@ function handleAddExclusionZone(draft, action) {
|
|
|
575
547
|
spectra = (0, getSpectraByNucleus_1.getSpectraByNucleus)(draft.view.spectra.activeTab, draft.data);
|
|
576
548
|
}
|
|
577
549
|
for (const spectrum of spectra) {
|
|
578
|
-
FiltersManager.applyFilter(spectrum, [
|
|
550
|
+
nmr_processing_1.FiltersManager.applyFilter(spectrum, [
|
|
579
551
|
{
|
|
580
|
-
name:
|
|
552
|
+
name: exclusionZones.id,
|
|
581
553
|
value: [
|
|
582
554
|
{
|
|
583
555
|
id: (0, uuid_1.v4)(),
|
|
@@ -588,7 +560,7 @@ function handleAddExclusionZone(draft, action) {
|
|
|
588
560
|
},
|
|
589
561
|
]);
|
|
590
562
|
}
|
|
591
|
-
const { updateXDomain, updateYDomain } =
|
|
563
|
+
const { updateXDomain, updateYDomain } = exclusionZones.DOMAIN_UPDATE_RULES;
|
|
592
564
|
(0, DomainActions_1.setDomain)(draft, { updateXDomain, updateYDomain });
|
|
593
565
|
}
|
|
594
566
|
exports.handleAddExclusionZone = handleAddExclusionZone;
|
|
@@ -598,14 +570,14 @@ function handleDeleteExclusionZone(draft, action) {
|
|
|
598
570
|
// if spectrum id exists, remove the selected exclusion zone in the spectrum
|
|
599
571
|
if (spectrumId) {
|
|
600
572
|
const spectrumIndex = draft.data.findIndex((spectrum) => spectrum.id === spectrumId);
|
|
601
|
-
const filter = draft.data[spectrumIndex].filters.find((_filter) => _filter.name ===
|
|
573
|
+
const filter = draft.data[spectrumIndex].filters.find((_filter) => _filter.name === exclusionZones.id);
|
|
602
574
|
if (filter) {
|
|
603
575
|
if (filter.value.length === 1) {
|
|
604
|
-
FiltersManager.deleteFilter(draft.data[spectrumIndex], filter.id);
|
|
576
|
+
nmr_processing_1.FiltersManager.deleteFilter(draft.data[spectrumIndex], filter.id);
|
|
605
577
|
}
|
|
606
578
|
else {
|
|
607
579
|
filter.value = filter.value.filter((_zone) => _zone.id !== zone?.id);
|
|
608
|
-
FiltersManager.reapplyFilters(draft.data[spectrumIndex]);
|
|
580
|
+
nmr_processing_1.FiltersManager.reapplyFilters(draft.data[spectrumIndex]);
|
|
609
581
|
}
|
|
610
582
|
}
|
|
611
583
|
}
|
|
@@ -614,9 +586,9 @@ function handleDeleteExclusionZone(draft, action) {
|
|
|
614
586
|
const data = (0, getSpectraByNucleus_1.getSpectraByNucleus)(draft.view.spectra.activeTab, draft.data);
|
|
615
587
|
for (const datum of data) {
|
|
616
588
|
for (const filter of datum.filters) {
|
|
617
|
-
if (filter.name ===
|
|
589
|
+
if (filter.name === exclusionZones.id) {
|
|
618
590
|
filter.value = filter.value.filter((_zone) => zone.from !== _zone.from && zone.to !== _zone.to);
|
|
619
|
-
FiltersManager.reapplyFilters(datum);
|
|
591
|
+
nmr_processing_1.FiltersManager.reapplyFilters(datum);
|
|
620
592
|
}
|
|
621
593
|
}
|
|
622
594
|
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.handleHistoryReset = exports.handleHistoryRedo = exports.handleHistoryUndo = void 0;
|
|
4
|
+
const DomainActions_1 = require("./DomainActions");
|
|
5
|
+
function handleHistoryUndo(draft) {
|
|
6
|
+
const { past, present, future } = draft.history;
|
|
7
|
+
const previous = past.at(-1);
|
|
8
|
+
const newPast = past.slice(0, -1);
|
|
9
|
+
const newfuture = [present, ...future];
|
|
10
|
+
const hasRedo = newfuture.length > 0;
|
|
11
|
+
const hasUndo = past.length > 0;
|
|
12
|
+
const domain = (0, DomainActions_1.getDomain)(draft.data);
|
|
13
|
+
const history = {
|
|
14
|
+
past: newPast,
|
|
15
|
+
present: previous,
|
|
16
|
+
future: newfuture,
|
|
17
|
+
hasRedo,
|
|
18
|
+
hasUndo,
|
|
19
|
+
};
|
|
20
|
+
draft.xDomain = domain.xDomain;
|
|
21
|
+
draft.yDomain = domain.yDomain;
|
|
22
|
+
draft.originDomain = domain;
|
|
23
|
+
draft.history = history;
|
|
24
|
+
}
|
|
25
|
+
exports.handleHistoryUndo = handleHistoryUndo;
|
|
26
|
+
function handleHistoryRedo(draft) {
|
|
27
|
+
const { history, data } = draft;
|
|
28
|
+
const newPresent = history.future.shift();
|
|
29
|
+
history.past.push(history.present);
|
|
30
|
+
history.present = newPresent;
|
|
31
|
+
history.hasUndo = true;
|
|
32
|
+
history.hasRedo = history.future.length > 0;
|
|
33
|
+
(0, DomainActions_1.setDomain)(data);
|
|
34
|
+
}
|
|
35
|
+
exports.handleHistoryRedo = handleHistoryRedo;
|
|
36
|
+
function handleHistoryReset(draft, action) {
|
|
37
|
+
draft.history = {
|
|
38
|
+
past: [],
|
|
39
|
+
present: action,
|
|
40
|
+
future: [],
|
|
41
|
+
hasRedo: false,
|
|
42
|
+
hasUndo: false,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
exports.handleHistoryReset = handleHistoryReset;
|