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
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import { v4 } from '@lukeed/uuid';
|
|
2
2
|
import { current } from 'immer';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { apply as apodization, defaultApodizationOptions, } from '../../../data/data1d/filter1d/apodization';
|
|
6
|
-
import { apply as baselineCorrection, } from '../../../data/data1d/filter1d/baselineCorrection';
|
|
7
|
-
import { apply as phaseCorrection } from '../../../data/data1d/filter1d/phaseCorrection';
|
|
8
|
-
import { apply as zeroFilling } from '../../../data/data1d/filter1d/zeroFilling';
|
|
3
|
+
import { Filters, FiltersManager, } from 'nmr-processing';
|
|
4
|
+
import { defaultApodizationOptions } from '../../../data/constants/DefaultApodizationOptions';
|
|
9
5
|
import { options as Tools } from '../../toolbar/ToolTypes';
|
|
10
6
|
import { getSpectraByNucleus } from '../../utility/getSpectraByNucleus';
|
|
11
7
|
import nucleusToString from '../../utility/nucleusToString';
|
|
@@ -17,10 +13,9 @@ import { getStrongestPeak } from '../helper/getStrongestPeak';
|
|
|
17
13
|
import { setDomain, setMode } from './DomainActions';
|
|
18
14
|
import { changeSpectrumVerticalAlignment } from './PreferencesActions';
|
|
19
15
|
import { activateTool, resetSelectedTool } from './ToolsActions';
|
|
16
|
+
const { fft, apodization, baselineCorrection, phaseCorrection, zeroFilling, shiftX, shift2DX, shift2DY, exclusionZones, signalProcessing, } = Filters;
|
|
20
17
|
function getFilterUpdateDomainRules(filterName) {
|
|
21
|
-
return (
|
|
22
|
-
// eslint-disable-next-line import/namespace
|
|
23
|
-
Filters[filterName]?.DOMAIN_UPDATE_RULES || {
|
|
18
|
+
return (Filters[filterName]?.DOMAIN_UPDATE_RULES || {
|
|
24
19
|
updateXDomain: false,
|
|
25
20
|
updateYDomain: false,
|
|
26
21
|
});
|
|
@@ -93,12 +88,12 @@ function rollbackSpectrum(draft, options) {
|
|
|
93
88
|
const { filterKey, reset = false, updateFilterViewOptions = true } = options;
|
|
94
89
|
//return back the spectra data to point of time before applying a specific filter
|
|
95
90
|
const applyFilter = [
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
91
|
+
phaseCorrection.id,
|
|
92
|
+
fft.id,
|
|
93
|
+
shiftX.id,
|
|
94
|
+
shift2DX.id,
|
|
95
|
+
shift2DY.id,
|
|
96
|
+
signalProcessing.id,
|
|
102
97
|
].includes(filterKey);
|
|
103
98
|
rollbackSpectrumByFilter(draft, {
|
|
104
99
|
searchBy: 'name',
|
|
@@ -113,7 +108,7 @@ function rollbackSpectrum(draft, options) {
|
|
|
113
108
|
function updateFilterOptionsInView(draft, filterKey) {
|
|
114
109
|
const activeSpectrum = getActiveSpectrum(draft);
|
|
115
110
|
switch (filterKey) {
|
|
116
|
-
case
|
|
111
|
+
case phaseCorrection.id: {
|
|
117
112
|
// look for the strongest peak to set it as a pivot
|
|
118
113
|
const { xValue, index } = getStrongestPeak(draft) || {
|
|
119
114
|
xValue: 0,
|
|
@@ -122,7 +117,7 @@ function updateFilterOptionsInView(draft, filterKey) {
|
|
|
122
117
|
draft.toolOptions.data.pivot = { value: xValue, index };
|
|
123
118
|
break;
|
|
124
119
|
}
|
|
125
|
-
case
|
|
120
|
+
case baselineCorrection.id: {
|
|
126
121
|
if (activeSpectrum) {
|
|
127
122
|
const baselineCorrectionFilter = current(draft).data[activeSpectrum.index].filters.find((filter) => filter.name === Tools.baselineCorrection.id);
|
|
128
123
|
if (baselineCorrectionFilter) {
|
|
@@ -134,7 +129,7 @@ function updateFilterOptionsInView(draft, filterKey) {
|
|
|
134
129
|
}
|
|
135
130
|
break;
|
|
136
131
|
}
|
|
137
|
-
case
|
|
132
|
+
case apodization.id: {
|
|
138
133
|
draft.toolOptions.data.apodizationOptions = defaultApodizationOptions;
|
|
139
134
|
break;
|
|
140
135
|
}
|
|
@@ -172,17 +167,17 @@ function handleShiftSpectrumAlongXAxis(draft, action) {
|
|
|
172
167
|
const activeFilterIndex = getActiveFilterIndex(draft);
|
|
173
168
|
const index = activeSpectrum?.index;
|
|
174
169
|
FiltersManager.applyFilter(draft.data[index], [
|
|
175
|
-
{ name:
|
|
170
|
+
{ name: shiftX.id, value: { shift } },
|
|
176
171
|
]);
|
|
177
172
|
if (activeFilterIndex !== -1) {
|
|
178
173
|
rollbackSpectrumByFilter(draft, {
|
|
179
174
|
searchBy: 'name',
|
|
180
|
-
key:
|
|
175
|
+
key: shiftX.id,
|
|
181
176
|
triggerSource: 'Apply',
|
|
182
177
|
});
|
|
183
178
|
}
|
|
184
179
|
else {
|
|
185
|
-
updateView(draft,
|
|
180
|
+
updateView(draft, shiftX.DOMAIN_UPDATE_RULES);
|
|
186
181
|
}
|
|
187
182
|
}
|
|
188
183
|
}
|
|
@@ -194,7 +189,7 @@ function handleApplyZeroFillingFilter(draft, action) {
|
|
|
194
189
|
const index = activeSpectrum.index;
|
|
195
190
|
const filters = [
|
|
196
191
|
{
|
|
197
|
-
name:
|
|
192
|
+
name: zeroFilling.id,
|
|
198
193
|
value: action.payload,
|
|
199
194
|
},
|
|
200
195
|
];
|
|
@@ -204,12 +199,12 @@ function handleApplyZeroFillingFilter(draft, action) {
|
|
|
204
199
|
if (activeFilterIndex !== -1) {
|
|
205
200
|
rollbackSpectrumByFilter(draft, {
|
|
206
201
|
searchBy: 'name',
|
|
207
|
-
key:
|
|
202
|
+
key: zeroFilling.id,
|
|
208
203
|
triggerSource: 'Apply',
|
|
209
204
|
});
|
|
210
205
|
}
|
|
211
206
|
else {
|
|
212
|
-
updateView(draft,
|
|
207
|
+
updateView(draft, zeroFilling.DOMAIN_UPDATE_RULES);
|
|
213
208
|
}
|
|
214
209
|
}
|
|
215
210
|
}
|
|
@@ -220,7 +215,7 @@ function handleCalculateZeroFillingFilter(draft, action) {
|
|
|
220
215
|
const index = activeSpectrum.index;
|
|
221
216
|
const { data: { x, re, im }, filters, info, } = draft.tempData[index];
|
|
222
217
|
let _data = { data: { x, re, im }, filters, info };
|
|
223
|
-
zeroFilling(_data, action.payload);
|
|
218
|
+
zeroFilling.apply(_data, action.payload);
|
|
224
219
|
const { im: newIm, re: newRe, x: newX } = _data.data;
|
|
225
220
|
const datum = draft.data[index];
|
|
226
221
|
datum.data.x = newX;
|
|
@@ -238,7 +233,7 @@ function handleCalculateApodizationFilter(draft, action) {
|
|
|
238
233
|
const { data: { x, re, im }, info, } = draft.tempData[index];
|
|
239
234
|
let _data = { data: { x, re, im }, info };
|
|
240
235
|
draft.toolOptions.data.apodizationOptions = options;
|
|
241
|
-
apodization(_data, options);
|
|
236
|
+
apodization.apply(_data, options);
|
|
242
237
|
const { im: newIm, re: newRe } = _data.data;
|
|
243
238
|
const datum = draft.data[index];
|
|
244
239
|
datum.data.im = newIm;
|
|
@@ -253,19 +248,19 @@ function handleApplyApodizationFilter(draft, action) {
|
|
|
253
248
|
const activeFilterIndex = getActiveFilterIndex(draft);
|
|
254
249
|
FiltersManager.applyFilter(draft.data[index], [
|
|
255
250
|
{
|
|
256
|
-
name:
|
|
251
|
+
name: apodization.id,
|
|
257
252
|
value: action.payload,
|
|
258
253
|
},
|
|
259
254
|
], { filterIndex: activeFilterIndex });
|
|
260
255
|
if (activeFilterIndex !== -1) {
|
|
261
256
|
rollbackSpectrumByFilter(draft, {
|
|
262
257
|
searchBy: 'name',
|
|
263
|
-
key:
|
|
258
|
+
key: apodization.id,
|
|
264
259
|
triggerSource: 'Apply',
|
|
265
260
|
});
|
|
266
261
|
}
|
|
267
262
|
else {
|
|
268
|
-
updateView(draft,
|
|
263
|
+
updateView(draft, apodization.DOMAIN_UPDATE_RULES);
|
|
269
264
|
}
|
|
270
265
|
}
|
|
271
266
|
}
|
|
@@ -276,15 +271,15 @@ function handleApplyFFTFilter(draft) {
|
|
|
276
271
|
const { index } = activeSpectrum;
|
|
277
272
|
const activeFilterIndex = getActiveFilterIndex(draft);
|
|
278
273
|
//apply filter into the spectrum
|
|
279
|
-
FiltersManager.applyFilter(draft.data[index], [{ name:
|
|
274
|
+
FiltersManager.applyFilter(draft.data[index], [{ name: fft.id, value: {} }], { filterIndex: activeFilterIndex });
|
|
280
275
|
if (activeFilterIndex !== -1) {
|
|
281
276
|
rollbackSpectrumByFilter(draft, {
|
|
282
277
|
searchBy: 'name',
|
|
283
|
-
key:
|
|
278
|
+
key: fft.id,
|
|
284
279
|
});
|
|
285
280
|
}
|
|
286
281
|
else {
|
|
287
|
-
updateView(draft,
|
|
282
|
+
updateView(draft, fft.DOMAIN_UPDATE_RULES);
|
|
288
283
|
}
|
|
289
284
|
}
|
|
290
285
|
}
|
|
@@ -298,19 +293,19 @@ function handleApplyManualPhaseCorrectionFilter(draft, action) {
|
|
|
298
293
|
const activeFilterIndex = getActiveFilterIndex(draft);
|
|
299
294
|
FiltersManager.applyFilter(draft.data[index], [
|
|
300
295
|
{
|
|
301
|
-
name:
|
|
296
|
+
name: phaseCorrection.id,
|
|
302
297
|
value: { ph0, ph1 },
|
|
303
298
|
},
|
|
304
299
|
], { filterIndex: activeFilterIndex });
|
|
305
300
|
if (activeFilterIndex !== -1) {
|
|
306
301
|
rollbackSpectrumByFilter(draft, {
|
|
307
302
|
searchBy: 'name',
|
|
308
|
-
key:
|
|
303
|
+
key: phaseCorrection.id,
|
|
309
304
|
triggerSource: 'Apply',
|
|
310
305
|
});
|
|
311
306
|
}
|
|
312
307
|
else {
|
|
313
|
-
updateView(draft,
|
|
308
|
+
updateView(draft, phaseCorrection.DOMAIN_UPDATE_RULES);
|
|
314
309
|
}
|
|
315
310
|
}
|
|
316
311
|
}
|
|
@@ -322,7 +317,7 @@ function handleCalculateManualPhaseCorrection(draft, action) {
|
|
|
322
317
|
const { data: { x, re, im }, info, } = draft.tempData[index];
|
|
323
318
|
const { ph0, ph1 } = action.payload;
|
|
324
319
|
let _data = { data: { x, re, im }, info };
|
|
325
|
-
phaseCorrection(_data, { ph0, ph1 });
|
|
320
|
+
phaseCorrection.apply(_data, { ph0, ph1 });
|
|
326
321
|
const { im: newIm, re: newRe } = _data.data;
|
|
327
322
|
const datum = draft.data[index];
|
|
328
323
|
datum.data.im = newIm;
|
|
@@ -337,19 +332,19 @@ function handleApplyAbsoluteFilter(draft) {
|
|
|
337
332
|
const activeFilterIndex = getActiveFilterIndex(draft);
|
|
338
333
|
FiltersManager.applyFilter(draft.data[index], [
|
|
339
334
|
{
|
|
340
|
-
name:
|
|
335
|
+
name: phaseCorrection.id,
|
|
341
336
|
value: { absolute: true },
|
|
342
337
|
},
|
|
343
338
|
], { filterIndex: activeFilterIndex });
|
|
344
339
|
if (activeFilterIndex !== -1) {
|
|
345
340
|
rollbackSpectrumByFilter(draft, {
|
|
346
341
|
searchBy: 'name',
|
|
347
|
-
key:
|
|
342
|
+
key: phaseCorrection.id,
|
|
348
343
|
triggerSource: 'Apply',
|
|
349
344
|
});
|
|
350
345
|
}
|
|
351
346
|
else {
|
|
352
|
-
updateView(draft,
|
|
347
|
+
updateView(draft, phaseCorrection.DOMAIN_UPDATE_RULES);
|
|
353
348
|
}
|
|
354
349
|
}
|
|
355
350
|
}
|
|
@@ -361,19 +356,19 @@ function handleApplyAutoPhaseCorrectionFilter(draft) {
|
|
|
361
356
|
const activeFilterIndex = getActiveFilterIndex(draft);
|
|
362
357
|
FiltersManager.applyFilter(draft.data[index], [
|
|
363
358
|
{
|
|
364
|
-
name:
|
|
359
|
+
name: phaseCorrection.id,
|
|
365
360
|
value: {},
|
|
366
361
|
},
|
|
367
362
|
], { filterIndex: activeFilterIndex });
|
|
368
363
|
if (activeFilterIndex !== -1) {
|
|
369
364
|
rollbackSpectrumByFilter(draft, {
|
|
370
365
|
searchBy: 'name',
|
|
371
|
-
key:
|
|
366
|
+
key: phaseCorrection.id,
|
|
372
367
|
triggerSource: 'Apply',
|
|
373
368
|
});
|
|
374
369
|
}
|
|
375
370
|
else {
|
|
376
|
-
updateView(draft,
|
|
371
|
+
updateView(draft, phaseCorrection.DOMAIN_UPDATE_RULES);
|
|
377
372
|
}
|
|
378
373
|
}
|
|
379
374
|
}
|
|
@@ -386,7 +381,7 @@ function handleBaseLineCorrectionFilter(draft, action) {
|
|
|
386
381
|
const activeFilterIndex = getActiveFilterIndex(draft);
|
|
387
382
|
FiltersManager.applyFilter(draft.data[activeSpectrum.index], [
|
|
388
383
|
{
|
|
389
|
-
name:
|
|
384
|
+
name: baselineCorrection.id,
|
|
390
385
|
value: {
|
|
391
386
|
...options,
|
|
392
387
|
zones,
|
|
@@ -396,12 +391,12 @@ function handleBaseLineCorrectionFilter(draft, action) {
|
|
|
396
391
|
if (activeFilterIndex !== -1) {
|
|
397
392
|
rollbackSpectrumByFilter(draft, {
|
|
398
393
|
searchBy: 'name',
|
|
399
|
-
key:
|
|
394
|
+
key: baselineCorrection.id,
|
|
400
395
|
triggerSource: 'Apply',
|
|
401
396
|
});
|
|
402
397
|
}
|
|
403
398
|
else {
|
|
404
|
-
updateView(draft,
|
|
399
|
+
updateView(draft, baselineCorrection.DOMAIN_UPDATE_RULES);
|
|
405
400
|
}
|
|
406
401
|
}
|
|
407
402
|
}
|
|
@@ -419,7 +414,7 @@ function calculateBaseLineCorrection(draft, baseLineOptions) {
|
|
|
419
414
|
const { livePreview, ...filterOptions } = options;
|
|
420
415
|
if (livePreview) {
|
|
421
416
|
let _data = { data: { x, re, im }, info };
|
|
422
|
-
baselineCorrection(_data, {
|
|
417
|
+
baselineCorrection.apply(_data, {
|
|
423
418
|
zones,
|
|
424
419
|
...filterOptions,
|
|
425
420
|
});
|
|
@@ -504,12 +499,12 @@ function handleSignalProcessingFilter(draft, action) {
|
|
|
504
499
|
for (const spectrum of spectra) {
|
|
505
500
|
FiltersManager.applyFilter(spectrum, [
|
|
506
501
|
{
|
|
507
|
-
name:
|
|
502
|
+
name: signalProcessing.id,
|
|
508
503
|
value,
|
|
509
504
|
},
|
|
510
505
|
], { filterIndex: activeFilterIndex });
|
|
511
506
|
}
|
|
512
|
-
const { updateXDomain, updateYDomain } =
|
|
507
|
+
const { updateXDomain, updateYDomain } = signalProcessing.DOMAIN_UPDATE_RULES;
|
|
513
508
|
setDomain(draft, { updateXDomain, updateYDomain });
|
|
514
509
|
}
|
|
515
510
|
//action
|
|
@@ -528,7 +523,7 @@ function handleAddExclusionZone(draft, action) {
|
|
|
528
523
|
for (const spectrum of spectra) {
|
|
529
524
|
FiltersManager.applyFilter(spectrum, [
|
|
530
525
|
{
|
|
531
|
-
name:
|
|
526
|
+
name: exclusionZones.id,
|
|
532
527
|
value: [
|
|
533
528
|
{
|
|
534
529
|
id: v4(),
|
|
@@ -539,7 +534,7 @@ function handleAddExclusionZone(draft, action) {
|
|
|
539
534
|
},
|
|
540
535
|
]);
|
|
541
536
|
}
|
|
542
|
-
const { updateXDomain, updateYDomain } =
|
|
537
|
+
const { updateXDomain, updateYDomain } = exclusionZones.DOMAIN_UPDATE_RULES;
|
|
543
538
|
setDomain(draft, { updateXDomain, updateYDomain });
|
|
544
539
|
}
|
|
545
540
|
//action
|
|
@@ -548,7 +543,7 @@ function handleDeleteExclusionZone(draft, action) {
|
|
|
548
543
|
// if spectrum id exists, remove the selected exclusion zone in the spectrum
|
|
549
544
|
if (spectrumId) {
|
|
550
545
|
const spectrumIndex = draft.data.findIndex((spectrum) => spectrum.id === spectrumId);
|
|
551
|
-
const filter = draft.data[spectrumIndex].filters.find((_filter) => _filter.name ===
|
|
546
|
+
const filter = draft.data[spectrumIndex].filters.find((_filter) => _filter.name === exclusionZones.id);
|
|
552
547
|
if (filter) {
|
|
553
548
|
if (filter.value.length === 1) {
|
|
554
549
|
FiltersManager.deleteFilter(draft.data[spectrumIndex], filter.id);
|
|
@@ -564,7 +559,7 @@ function handleDeleteExclusionZone(draft, action) {
|
|
|
564
559
|
const data = getSpectraByNucleus(draft.view.spectra.activeTab, draft.data);
|
|
565
560
|
for (const datum of data) {
|
|
566
561
|
for (const filter of datum.filters) {
|
|
567
|
-
if (filter.name ===
|
|
562
|
+
if (filter.name === exclusionZones.id) {
|
|
568
563
|
filter.value = filter.value.filter((_zone) => zone.from !== _zone.from && zone.to !== _zone.to);
|
|
569
564
|
FiltersManager.reapplyFilters(datum);
|
|
570
565
|
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { setDomain, getDomain } from './DomainActions';
|
|
2
|
+
function handleHistoryUndo(draft) {
|
|
3
|
+
const { past, present, future } = draft.history;
|
|
4
|
+
const previous = past.at(-1);
|
|
5
|
+
const newPast = past.slice(0, -1);
|
|
6
|
+
const newfuture = [present, ...future];
|
|
7
|
+
const hasRedo = newfuture.length > 0;
|
|
8
|
+
const hasUndo = past.length > 0;
|
|
9
|
+
const domain = getDomain(draft.data);
|
|
10
|
+
const history = {
|
|
11
|
+
past: newPast,
|
|
12
|
+
present: previous,
|
|
13
|
+
future: newfuture,
|
|
14
|
+
hasRedo,
|
|
15
|
+
hasUndo,
|
|
16
|
+
};
|
|
17
|
+
draft.xDomain = domain.xDomain;
|
|
18
|
+
draft.yDomain = domain.yDomain;
|
|
19
|
+
draft.originDomain = domain;
|
|
20
|
+
draft.history = history;
|
|
21
|
+
}
|
|
22
|
+
function handleHistoryRedo(draft) {
|
|
23
|
+
const { history, data } = draft;
|
|
24
|
+
const newPresent = history.future.shift();
|
|
25
|
+
history.past.push(history.present);
|
|
26
|
+
history.present = newPresent;
|
|
27
|
+
history.hasUndo = true;
|
|
28
|
+
history.hasRedo = history.future.length > 0;
|
|
29
|
+
setDomain(data);
|
|
30
|
+
}
|
|
31
|
+
function handleHistoryReset(draft, action) {
|
|
32
|
+
draft.history = {
|
|
33
|
+
past: [],
|
|
34
|
+
present: action,
|
|
35
|
+
future: [],
|
|
36
|
+
hasRedo: false,
|
|
37
|
+
hasUndo: false,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
export { handleHistoryUndo, handleHistoryRedo, handleHistoryReset };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Draft } from 'immer';
|
|
2
|
-
import { Integral } from 'nmr-
|
|
2
|
+
import { Integral } from 'nmr-processing';
|
|
3
3
|
import { SetSumOptions } from '../../../data/data1d/Spectrum1D/SumManager';
|
|
4
4
|
import { State } from '../Reducer';
|
|
5
5
|
import { ActionType } from '../types/ActionType';
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Draft } from 'immer';
|
|
2
|
-
import {
|
|
2
|
+
import { Spectrum, OnLoadProcessing, NmriumState } from 'nmr-load-save';
|
|
3
3
|
import { ParseResult } from 'papaparse';
|
|
4
4
|
import { UsedColors } from '../../../types/UsedColors';
|
|
5
|
-
import { OnLoadProcessing } from '../../workspaces/Workspace';
|
|
6
5
|
import { State } from '../Reducer';
|
|
7
6
|
import { ActionType } from '../types/ActionType';
|
|
8
7
|
interface InitiateProps {
|
|
@@ -7,7 +7,7 @@ import * as MoleculeManager from '../../../data/molecules/MoleculeManager';
|
|
|
7
7
|
import { linkMetaWithSpectra } from '../../../data/parseMeta/linkMetaWithSpectra';
|
|
8
8
|
import { DefaultTolerance } from '../../panels/SummaryPanel/CorrelationTable/Constants';
|
|
9
9
|
import nucleusToString from '../../utility/nucleusToString';
|
|
10
|
-
import { getDefaultViewState, getInitialState
|
|
10
|
+
import { getDefaultViewState, getInitialState } from '../Reducer';
|
|
11
11
|
import { changeSpectrumVerticalAlignment } from './PreferencesActions';
|
|
12
12
|
import { setSpectraMetaInfo } from './SpectrumsActions';
|
|
13
13
|
import { setActiveTab } from './ToolsActions';
|
|
@@ -4,18 +4,21 @@ import { MoleculeBoundingRect, StateMolecule } from '../../../data/molecules/Mol
|
|
|
4
4
|
import { AssignmentContext } from '../../assignment/AssignmentsContext';
|
|
5
5
|
import { State } from '../Reducer';
|
|
6
6
|
import { ActionType } from '../types/ActionType';
|
|
7
|
-
|
|
7
|
+
interface AddMoleculeProps {
|
|
8
8
|
molfile: string;
|
|
9
|
-
|
|
9
|
+
floatMoleculeOnSave?: boolean;
|
|
10
|
+
}
|
|
11
|
+
type AddMoleculeAction = ActionType<'ADD_MOLECULE', AddMoleculeProps>;
|
|
10
12
|
type SetMoleculeAction = ActionType<'SET_MOLECULE', Required<StateMolecule>>;
|
|
11
13
|
type DeleteMoleculeAction = ActionType<'DELETE_MOLECULE', {
|
|
12
14
|
id: string;
|
|
13
15
|
assignmentData: AssignmentContext;
|
|
14
16
|
}>;
|
|
15
17
|
type PredictSpectraFromMoleculeAction = ActionType<'PREDICT_SPECTRA', {
|
|
16
|
-
molfile: string;
|
|
17
18
|
options: PredictionOptions;
|
|
18
|
-
predictedSpectra
|
|
19
|
+
predictedSpectra: PredictedSpectraResult;
|
|
20
|
+
molecule: StateMolecule;
|
|
21
|
+
action?: 'save' | 'add';
|
|
19
22
|
}>;
|
|
20
23
|
type ToggleMoleculeViewObjectAction = ActionType<'FLOAT_MOLECULE_OVER_SPECTRUM' | 'TOGGLE_MOLECULE_ATOM_NUMBER', {
|
|
21
24
|
id: string;
|
|
@@ -3,14 +3,12 @@ import { changeSpectraRelativeSum } from '../../../data/data1d/Spectrum1D/SumMan
|
|
|
3
3
|
import { DRAGGABLE_STRUCTURE_INITIAL_BOUNDING_REACT, } from '../../../data/molecules/Molecule';
|
|
4
4
|
import * as MoleculeManager from '../../../data/molecules/MoleculeManager';
|
|
5
5
|
import { generateColor } from '../../../data/utilities/generateColor';
|
|
6
|
-
import nucleusToString from '../../utility/nucleusToString';
|
|
7
6
|
import { DISPLAYER_MODE, MARGIN } from '../core/Constants';
|
|
8
7
|
import { unlinkRange } from './RangesActions';
|
|
9
8
|
import { setActiveTab } from './ToolsActions';
|
|
10
9
|
import { unlinkZone } from './ZonesActions';
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const { molfile } = action.payload;
|
|
10
|
+
function addMolecule(draft, props) {
|
|
11
|
+
const { molfile, floatMoleculeOnSave } = props;
|
|
14
12
|
const isEmpty = draft.molecules.length === 0;
|
|
15
13
|
MoleculeManager.addMolfile(draft.molecules, molfile);
|
|
16
14
|
/**
|
|
@@ -21,10 +19,18 @@ function handleAddMolecule(draft, action) {
|
|
|
21
19
|
if (isEmpty && molecule) {
|
|
22
20
|
changeSpectraRelativeSum(draft, molecule.id, molecule);
|
|
23
21
|
}
|
|
22
|
+
const lastAddedMolecule = draft.molecules.at(-1);
|
|
23
|
+
if (floatMoleculeOnSave && lastAddedMolecule) {
|
|
24
|
+
floatMoleculeOverSpectrum(draft, lastAddedMolecule.id, true);
|
|
25
|
+
}
|
|
26
|
+
return lastAddedMolecule;
|
|
24
27
|
}
|
|
25
28
|
//action
|
|
26
|
-
function
|
|
27
|
-
|
|
29
|
+
function handleAddMolecule(draft, action) {
|
|
30
|
+
addMolecule(draft, action.payload);
|
|
31
|
+
}
|
|
32
|
+
function setMolecule(draft, props) {
|
|
33
|
+
const { id, label, molfile } = props;
|
|
28
34
|
MoleculeManager.setMolfile(draft.molecules, {
|
|
29
35
|
id,
|
|
30
36
|
label,
|
|
@@ -36,6 +42,10 @@ function handleSetMolecule(draft, action) {
|
|
|
36
42
|
const index = draft.molecules.findIndex((molecule) => molecule.id === id);
|
|
37
43
|
changeSpectraRelativeSum(draft, id, index !== -1 ? draft.molecules[index] : draft.molecules[0] || null);
|
|
38
44
|
}
|
|
45
|
+
//action
|
|
46
|
+
function handleSetMolecule(draft, action) {
|
|
47
|
+
setMolecule(draft, action.payload);
|
|
48
|
+
}
|
|
39
49
|
function removeAssignments(draft, assignmentData) {
|
|
40
50
|
if (draft.displayerMode === DISPLAYER_MODE.DM_1D) {
|
|
41
51
|
unlinkRange(draft, { assignmentData });
|
|
@@ -62,27 +72,43 @@ function handleDeleteMolecule(draft, action) {
|
|
|
62
72
|
}
|
|
63
73
|
//action
|
|
64
74
|
function handlePredictSpectraFromMolecule(draft, action) {
|
|
65
|
-
const { predictedSpectra, options } = action.payload;
|
|
66
|
-
|
|
67
|
-
|
|
75
|
+
const { predictedSpectra, options, molecule, action: predictionAction = 'save', } = action.payload;
|
|
76
|
+
const color = generateColor(false, draft.usedColors['1d']);
|
|
77
|
+
const spectraIds = [];
|
|
78
|
+
for (const spectrum of generateSpectra(predictedSpectra, options, color)) {
|
|
79
|
+
draft.data.push(spectrum);
|
|
80
|
+
spectraIds.push(spectrum.id);
|
|
81
|
+
}
|
|
82
|
+
let id = molecule?.id;
|
|
83
|
+
//if the id object is not exits add a new molecule
|
|
84
|
+
if (!id || predictionAction === 'add') {
|
|
85
|
+
const moleculeObj = addMolecule(draft, {
|
|
86
|
+
molfile: molecule.molfile,
|
|
87
|
+
floatMoleculeOnSave: true,
|
|
88
|
+
});
|
|
89
|
+
id = moleculeObj?.id;
|
|
68
90
|
}
|
|
69
91
|
else {
|
|
70
|
-
|
|
71
|
-
for (const spectrum of generateSpectra(predictedSpectra, options, color)) {
|
|
72
|
-
draft.data.push(spectrum);
|
|
73
|
-
draft.view.spectra.activeSpectra[nucleusToString(spectrum.info.nucleus)] =
|
|
74
|
-
[
|
|
75
|
-
{
|
|
76
|
-
id: spectrum.id,
|
|
77
|
-
index: draft.data.length - 1,
|
|
78
|
-
},
|
|
79
|
-
];
|
|
80
|
-
}
|
|
81
|
-
draft.usedColors['1d'].push(color);
|
|
92
|
+
setMolecule(draft, molecule);
|
|
82
93
|
}
|
|
94
|
+
if (id) {
|
|
95
|
+
//save a set of the predicted spectra Ids by molecule ID in the view object in case we predict the spectra again we remove the old ones
|
|
96
|
+
setPredictedSpectraReference(draft, id, spectraIds);
|
|
97
|
+
}
|
|
98
|
+
draft.usedColors['1d'] = draft.usedColors['1d'].filter((previousColor) => previousColor !== color);
|
|
99
|
+
draft.usedColors['1d'].push(color);
|
|
83
100
|
draft.toolOptions.data.predictionIndex++;
|
|
84
|
-
setActiveTab(draft);
|
|
85
|
-
|
|
101
|
+
setActiveTab(draft, { refreshActiveTab: true, tab: '1H' });
|
|
102
|
+
}
|
|
103
|
+
function setPredictedSpectraReference(draft, moleculeId, spectraIds) {
|
|
104
|
+
const predictedSpectraIds = draft.view.predictions?.[moleculeId];
|
|
105
|
+
// check if the molecule predicted and return and the spectra Ids
|
|
106
|
+
if (predictedSpectraIds) {
|
|
107
|
+
//remove the old predicted spectra for the current molecule
|
|
108
|
+
draft.data = draft.data.filter((spectrum) => !predictedSpectraIds.includes(spectrum.id));
|
|
109
|
+
}
|
|
110
|
+
// set the predicted spectra ids
|
|
111
|
+
draft.view.predictions[moleculeId] = spectraIds;
|
|
86
112
|
}
|
|
87
113
|
function initMoleculeViewProperties(id, draft) {
|
|
88
114
|
// check if the molecule is exists in the view object otherwise add it with the default value
|
|
@@ -123,14 +149,17 @@ function getFloatingMoleculeInitialPosition(id, draft) {
|
|
|
123
149
|
const y = Math.floor(moleculeKeys.length / columns) * (height / rows) + top;
|
|
124
150
|
return { x, y };
|
|
125
151
|
}
|
|
152
|
+
function floatMoleculeOverSpectrum(draft, moleculeId, value) {
|
|
153
|
+
initMoleculeViewProperties(moleculeId, draft);
|
|
154
|
+
const molecule = getMoleculeViewObject(moleculeId, draft);
|
|
155
|
+
if (molecule) {
|
|
156
|
+
molecule.floating.visible = value ?? !molecule.floating.visible;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
126
159
|
//action
|
|
127
160
|
function handleFloatMoleculeOverSpectrum(draft, action) {
|
|
128
161
|
const { id } = action.payload;
|
|
129
|
-
|
|
130
|
-
const molecule = getMoleculeViewObject(id, draft);
|
|
131
|
-
if (molecule) {
|
|
132
|
-
molecule.floating.visible = !molecule.floating.visible;
|
|
133
|
-
}
|
|
162
|
+
floatMoleculeOverSpectrum(draft, id);
|
|
134
163
|
}
|
|
135
164
|
//action
|
|
136
165
|
function handleToggleMoleculeAtomsNumbers(draft, action) {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Draft } from 'immer';
|
|
2
|
-
import { Peak1D } from 'nmr-
|
|
3
|
-
import { OptionsXYAutoPeaksPicking } from 'nmr-processing';
|
|
2
|
+
import { Peak1D, OptionsXYAutoPeaksPicking } from 'nmr-processing';
|
|
4
3
|
import { defaultPeaksViewState } from '../../hooks/useActiveSpectrumPeaksViewState';
|
|
5
4
|
import { State } from '../Reducer';
|
|
6
5
|
import { ActionType } from '../types/ActionType';
|
|
@@ -61,15 +61,15 @@ function handleAddPeaks(draft, action) {
|
|
|
61
61
|
//action
|
|
62
62
|
function handleDeletePeak(draft, action) {
|
|
63
63
|
const activeSpectrum = getActiveSpectrum(draft);
|
|
64
|
-
const
|
|
64
|
+
const peakId = action?.payload?.id;
|
|
65
65
|
if (activeSpectrum) {
|
|
66
66
|
const { index } = activeSpectrum;
|
|
67
67
|
const state = original(draft);
|
|
68
|
-
if (!
|
|
68
|
+
if (!peakId) {
|
|
69
69
|
draft.data[index].peaks.values = [];
|
|
70
70
|
}
|
|
71
71
|
else {
|
|
72
|
-
const peakIndex = state.data[index].peaks.values.findIndex((p) => p.id ===
|
|
72
|
+
const peakIndex = state.data[index].peaks.values.findIndex((p) => p.id === peakId);
|
|
73
73
|
draft.data[index].peaks.values.splice(peakIndex, 1);
|
|
74
74
|
}
|
|
75
75
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Draft } from 'immer';
|
|
2
|
-
import {
|
|
2
|
+
import { Spectrum } from 'nmr-load-save';
|
|
3
|
+
import { Signal1D, Range } from 'nmr-processing';
|
|
3
4
|
import { SetSumOptions } from '../../../data/data1d/Spectrum1D/SumManager';
|
|
4
5
|
import { ChangeRangeRelativeValueProps } from '../../../data/data1d/Spectrum1D/ranges/changeRangeRelativeValue';
|
|
5
6
|
import { AssignmentContext } from '../../assignment/AssignmentsContext';
|
|
@@ -46,12 +47,10 @@ type ResizeRangeAction = ActionType<'RESIZE_RANGE', {
|
|
|
46
47
|
type ChangeRangeSumAction = ActionType<'CHANGE_RANGE_SUM', {
|
|
47
48
|
options: SetSumOptions;
|
|
48
49
|
}>;
|
|
49
|
-
|
|
50
|
+
type AddRangeAction = ActionType<'ADD_RANGE', {
|
|
50
51
|
startX: number;
|
|
51
52
|
endX: number;
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
type AddRangeAction = ActionType<'ADD_RANGE', Partial<Omit<AddRangeProps, 'id'>>>;
|
|
53
|
+
}>;
|
|
55
54
|
type ChangeRangeRelativeValueAction = ActionType<'CHANGE_RANGE_RELATIVE', ChangeRangeRelativeValueProps>;
|
|
56
55
|
type ChangeRangeSignalValueAction = ActionType<'CHANGE_RANGE_SIGNAL_VALUE', {
|
|
57
56
|
rangeID: string;
|