nmrium 0.29.0 → 0.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -2
- package/lib/component/1d/ApodizationLine.d.ts +3 -0
- package/lib/component/1d/ApodizationLine.js +49 -0
- package/lib/component/1d/Chart1D.js +4 -2
- package/lib/component/1d/ExclusionZoneAnnotation.d.ts +1 -1
- package/lib/component/1d/ExclusionZoneAnnotation.js +14 -7
- package/lib/component/1d/FooterBanner.js +3 -1
- package/lib/component/1d/IntegralResizable.js +5 -4
- package/lib/component/1d/IntegralsSeries.js +3 -1
- package/lib/component/1d/LinesSeries.js +7 -5
- package/lib/component/1d/SpectraTracker.js +1 -1
- package/lib/component/1d/Viewer1D.js +10 -13
- package/lib/component/1d/database/DatabaseElements.js +2 -2
- package/lib/component/1d/database/DatabaseSpectrum.js +3 -3
- package/lib/component/1d/database/ResurrectedDatabaseRanges.js +3 -3
- package/lib/component/1d/jCouplingGraph/JGraph.js +5 -1
- package/lib/component/1d/multiAnalysis/AnalysisRange.js +16 -14
- package/lib/component/1d/multiAnalysis/MultiAnalysisRanges.js +1 -1
- package/lib/component/1d/multiplicityTree/MultiplicityTree.js +6 -5
- package/lib/component/1d/{PeakAnnotation.d.ts → peaks/PeakAnnotation.d.ts} +1 -2
- package/lib/component/1d/{PeakAnnotation.js → peaks/PeakAnnotation.js} +8 -9
- package/lib/component/1d/{PeakAnnotations.d.ts → peaks/PeakAnnotations.d.ts} +0 -0
- package/lib/component/1d/peaks/PeakAnnotations.js +28 -0
- package/lib/component/1d/peaks/PeaksShapes.d.ts +3 -0
- package/lib/component/1d/peaks/PeaksShapes.js +37 -0
- package/lib/component/1d/peaks/usePeakShapesPath.d.ts +13 -0
- package/lib/component/1d/peaks/usePeakShapesPath.js +49 -0
- package/lib/component/1d/ranges/Range.js +4 -4
- package/lib/component/1d/ranges/Ranges.js +8 -2
- package/lib/component/1d/tool/PeakPointer.js +3 -1
- package/lib/component/1d/tool/XLabelPointer.js +3 -1
- package/lib/component/2d/Contours.js +3 -1
- package/lib/component/2d/FooterBanner.js +5 -3
- package/lib/component/2d/Viewer2D.js +6 -6
- package/lib/component/2d/XAxis.js +2 -2
- package/lib/component/2d/YAxis.js +2 -2
- package/lib/component/2d/tools/XYLabelPointer.js +3 -1
- package/lib/component/2d/tools/slicing/SlicingView.js +3 -1
- package/lib/component/2d/zones/IndicationLines.js +1 -1
- package/lib/component/2d/zones/Signal.d.ts +3 -2
- package/lib/component/2d/zones/Signal.js +3 -3
- package/lib/component/2d/zones/Zone.d.ts +1 -1
- package/lib/component/2d/zones/Zone.js +4 -4
- package/lib/component/2d/zones/Zones.js +14 -19
- package/lib/component/EventsTrackers/KeysListenerTracker.js +91 -52
- package/lib/component/NMRium.d.ts +2 -0
- package/lib/component/NMRium.js +14 -3
- package/lib/component/assignment/AssignmentsContext.d.ts +1 -1
- package/lib/component/context/GlobalContext.d.ts +1 -1
- package/lib/component/context/GlobalContext.js +3 -3
- package/lib/component/elements/ActiveButton.d.ts +17 -0
- package/lib/component/elements/ActiveButton.js +28 -0
- package/lib/component/elements/Button.d.ts +6 -6
- package/lib/component/elements/Button.js +5 -5
- package/lib/component/elements/ButtonToolTip.js +1 -1
- package/lib/component/elements/CheckBox.d.ts +2 -6
- package/lib/component/elements/CheckBox.js +4 -6
- package/lib/component/elements/Input.d.ts +5 -4
- package/lib/component/elements/Input.js +1 -1
- package/lib/component/elements/Label.d.ts +8 -6
- package/lib/component/elements/Label.js +3 -3
- package/lib/component/elements/MoleculeSelection.d.ts +2 -2
- package/lib/component/elements/MoleculeSelection.js +1 -1
- package/lib/component/elements/NextPrev.js +1 -1
- package/lib/component/elements/ReactTable/Elements/ReactTableRow.d.ts +2 -2
- package/lib/component/elements/ReactTable/Elements/ReactTableRow.js +2 -2
- package/lib/component/elements/ReactTable/ReactTable.d.ts +2 -2
- package/lib/component/elements/Select.d.ts +7 -11
- package/lib/component/elements/Select.js +6 -8
- package/lib/component/elements/Tab/Tab.js +1 -1
- package/lib/component/elements/Table/Table.d.ts +1 -2
- package/lib/component/elements/Table/Table.js +2 -2
- package/lib/component/elements/ToggleButton.d.ts +1 -2
- package/lib/component/elements/ToggleButton.js +3 -2
- package/lib/component/elements/accordion/AccordionItem.js +2 -2
- package/lib/component/elements/formik/FormikNumberInput.d.ts +1 -1
- package/lib/component/elements/formik/FormikOnChange.d.ts +3 -2
- package/lib/component/elements/formik/FormikOnChange.js +11 -5
- package/lib/component/elements/popup/Modal/ConfirmDialog.js +1 -1
- package/lib/component/elements/popup/Modal/Provider.d.ts +3 -3
- package/lib/component/elements/popup/Modal/Provider.js +8 -11
- package/lib/component/elements/resizer/DivResizer.js +3 -3
- package/lib/component/elements/resizer/Resizer.d.ts +1 -0
- package/lib/component/elements/resizer/SVGResizer.js +3 -3
- package/lib/component/header/ApodizationOptionsPanel.d.ts +2 -0
- package/lib/component/header/ApodizationOptionsPanel.js +81 -0
- package/lib/component/header/AutoPeakPickingOptionPanel.d.ts +2 -1
- package/lib/component/header/AutoPeakPickingOptionPanel.js +40 -36
- package/lib/component/header/BaseLineCorrectionPanel.d.ts +1 -2
- package/lib/component/header/BaseLineCorrectionPanel.js +84 -52
- package/lib/component/header/Header.js +5 -2
- package/lib/component/header/HeaderContainer.d.ts +7 -0
- package/lib/component/header/HeaderContainer.js +10 -0
- package/lib/component/header/ManualPhaseCorrectionPanel.js +27 -29
- package/lib/component/header/RangesPickingOptionPanel.js +19 -21
- package/lib/component/header/ZeroFillingOptionsPanel.js +52 -47
- package/lib/component/header/Zones2DOptionPanel.js +11 -13
- package/lib/component/highlight/index.d.ts +27 -10
- package/lib/component/highlight/index.js +19 -17
- package/lib/component/hooks/useActiveSpectrumStyleOptions.js +2 -2
- package/lib/component/hooks/useCheckToolsVisibility.d.ts +10 -1
- package/lib/component/hooks/useCheckToolsVisibility.js +31 -1
- package/lib/component/hooks/useDatumWithSpectraStatistics.js +3 -1
- package/lib/component/hooks/useExport.d.ts +0 -1
- package/lib/component/hooks/useExport.js +1 -17
- package/lib/component/hooks/useFilter.d.ts +1 -0
- package/lib/component/hooks/useFilter.js +7 -0
- package/lib/component/hooks/useIntegralPath.js +5 -2
- package/lib/component/hooks/useNucleus.js +4 -4
- package/lib/component/hooks/useSpectraPerNucleus.js +1 -1
- package/lib/component/hooks/useSpectrum.js +3 -1
- package/lib/component/hooks/useToolsFunctions.js +1 -1
- package/lib/component/loader/DropZone.js +8 -148
- package/lib/component/modal/AlignSpectraModal.js +1 -2
- package/lib/component/modal/EditPeakShapeModal.d.ts +9 -0
- package/lib/component/modal/EditPeakShapeModal.js +85 -0
- package/lib/component/modal/MoleculeStructureEditorModal.d.ts +3 -3
- package/lib/component/modal/MoleculeStructureEditorModal.js +2 -3
- package/lib/component/modal/MultipleSpectraFiltersModal/index.js +1 -2
- package/lib/component/modal/PredictSpectraModal.js +1 -1
- package/lib/component/modal/changeSum/ChangeSumModal.d.ts +1 -1
- package/lib/component/modal/changeSum/ChangeSumModal.js +9 -11
- package/lib/component/modal/changeSum/SelectMolecule.js +2 -2
- package/lib/component/modal/editRange/EditRangeModal.js +3 -3
- package/lib/component/modal/editRange/forms/components/CouplingsTable.js +4 -9
- package/lib/component/modal/setting/DatabasesTabContent.js +2 -2
- package/lib/component/modal/setting/DisplayTabContent.js +1 -1
- package/lib/component/modal/setting/FormattingTabContent.js +2 -2
- package/lib/component/modal/setting/GeneralSettings.js +1 -1
- package/lib/component/modal/setting/ToolsTabContent.js +17 -13
- package/lib/component/modal/setting/WorkspaceItem.d.ts +2 -2
- package/lib/component/modal/setting/WorkspaceItem.js +2 -2
- package/lib/component/panels/IntegralsPanel/IntegralPanel.js +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralTable.js +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculeHeader.d.ts +3 -3
- package/lib/component/panels/MoleculesPanel/MoleculeHeader.js +3 -3
- package/lib/component/panels/MoleculesPanel/MoleculePanel.d.ts +5 -4
- package/lib/component/panels/MoleculesPanel/MoleculePanel.js +13 -10
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.d.ts +4 -2
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +6 -6
- package/lib/component/panels/MoleculesPanel/Utilities.d.ts +1 -2
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.d.ts +5 -3
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +12 -4
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +1 -1
- package/lib/component/panels/Panels.js +3 -3
- package/lib/component/panels/PeaksPanel/PeaksPanel.js +47 -22
- package/lib/component/panels/PeaksPanel/PeaksPreferences.js +17 -0
- package/lib/component/panels/PeaksPanel/PeaksTable.js +44 -13
- package/lib/component/panels/RangesPanel/RangesHeader.d.ts +2 -1
- package/lib/component/panels/RangesPanel/RangesHeader.js +10 -9
- package/lib/component/panels/RangesPanel/RangesPanel.js +7 -3
- package/lib/component/panels/RangesPanel/RangesTableRow.js +4 -4
- package/lib/component/panels/RangesPanel/TableColumns/ActionsColumn.js +1 -1
- package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +3 -2
- package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.d.ts +3 -3
- package/lib/component/panels/RangesPanel/hooks/useMapRanges.js +3 -3
- package/lib/component/panels/SpectrumsPanel/SpectraPanelHeader.js +3 -1
- package/lib/component/panels/SpectrumsPanel/SpectrumListItem.js +1 -1
- package/lib/component/panels/SpectrumsPanel/SpectrumsTabs.js +3 -1
- package/lib/component/panels/SpectrumsPanel/base/ColorIndicator.js +2 -2
- package/lib/component/panels/SpectrumsPanel/base/ShowHideMarkersButton.d.ts +1 -1
- package/lib/component/panels/SpectrumsPanel/base/ShowHideMarkersButton.js +4 -1
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +4 -4
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +1 -2
- package/lib/component/panels/SummaryPanel/SummaryPanel.js +2 -3
- package/lib/component/panels/SummaryPanel/utilities/useInView.js +3 -1
- package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +1 -1
- package/lib/component/panels/ZonesPanel/ZonesPanel.js +19 -10
- package/lib/component/panels/databasePanel/DatabasePanel.js +5 -13
- package/lib/component/panels/databasePanel/DatabaseTable.js +3 -3
- package/lib/component/panels/filtersPanel/FilterPanel.js +1 -1
- package/lib/component/panels/filtersPanel/FiltersTable.js +2 -2
- package/lib/component/panels/header/DefaultPanelHeader.js +3 -12
- package/lib/component/panels/header/SpectraAutomaticPickingButton.js +1 -1
- package/lib/component/panels/predictionPanel/PredictionOptions.d.ts +2 -1
- package/lib/component/panels/predictionPanel/PredictionOptions.js +2 -2
- package/lib/component/panels/predictionPanel/PredictionPanel.js +15 -3
- package/lib/component/reducer/IgnoreActions.js +5 -0
- package/lib/component/reducer/Reducer.d.ts +141 -51
- package/lib/component/reducer/Reducer.js +69 -45
- package/lib/component/reducer/actions/DomainActions.d.ts +1 -1
- package/lib/component/reducer/actions/DomainActions.js +11 -9
- package/lib/component/reducer/actions/FiltersActions.d.ts +13 -7
- package/lib/component/reducer/actions/FiltersActions.js +326 -204
- package/lib/component/reducer/actions/IntegralsActions.js +15 -10
- package/lib/component/reducer/actions/LoadActions.d.ts +2 -5
- package/lib/component/reducer/actions/LoadActions.js +19 -34
- package/lib/component/reducer/actions/MoleculeActions.d.ts +2 -1
- package/lib/component/reducer/actions/MoleculeActions.js +48 -19
- package/lib/component/reducer/actions/PeaksActions.d.ts +4 -1
- package/lib/component/reducer/actions/PeaksActions.js +52 -13
- package/lib/component/reducer/actions/PreferencesActions.js +8 -10
- package/lib/component/reducer/actions/RangesActions.d.ts +3 -3
- package/lib/component/reducer/actions/RangesActions.js +87 -29
- package/lib/component/reducer/actions/SpectraAnalysisAction.js +5 -5
- package/lib/component/reducer/actions/SpectrumsActions.js +14 -11
- package/lib/component/reducer/actions/ToolsActions.js +47 -95
- package/lib/component/reducer/actions/ZonesActions.d.ts +4 -1
- package/lib/component/reducer/actions/ZonesActions.js +68 -17
- package/lib/component/reducer/helper/Zoom1DManager.js +2 -1
- package/lib/component/reducer/helper/getActiveSpectrumOrFail.d.ts +3 -0
- package/lib/component/reducer/helper/getActiveSpectrumOrFail.js +6 -0
- package/lib/component/reducer/helper/getSpectrum.js +3 -2
- package/lib/component/reducer/helper/getStrongestPeak.d.ts +7 -0
- package/lib/component/reducer/helper/getStrongestPeak.js +15 -0
- package/lib/component/reducer/preferences/actions/addWorkspace.js +2 -2
- package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js +3 -0
- package/lib/component/reducer/preferences/preferencesReducer.d.ts +23 -15
- package/lib/component/reducer/preferences/preferencesReducer.js +1 -1
- package/lib/component/reducer/types/Types.d.ts +12 -0
- package/lib/component/reducer/types/Types.js +12 -0
- package/lib/component/tool/BrushX.js +1 -1
- package/lib/component/tool/BrushXY.js +4 -3
- package/lib/component/tool/CrossLinePointer.js +5 -4
- package/lib/component/tool/FloatMoleculeStructures/DraggableStructure.d.ts +8 -2
- package/lib/component/tool/FloatMoleculeStructures/DraggableStructure.js +22 -7
- package/lib/component/tool/FloatMoleculeStructures/index.d.ts +3 -2
- package/lib/component/tool/FloatMoleculeStructures/index.js +19 -6
- package/lib/component/toolbar/BasicToolBar.js +7 -14
- package/lib/component/toolbar/FunctionToolBar.js +13 -23
- package/lib/component/toolbar/ToolTypes.d.ts +7 -1
- package/lib/component/toolbar/ToolTypes.js +119 -9
- package/lib/component/utility/assert.d.ts +1 -0
- package/lib/component/utility/assert.js +5 -0
- package/lib/component/workspaces/Workspace.d.ts +4 -1
- package/lib/component/workspaces/basic.js +12 -11
- package/lib/component/workspaces/embedded.js +14 -13
- package/lib/component/workspaces/exercise.js +10 -6
- package/lib/component/workspaces/prediction.js +14 -13
- package/lib/component/workspaces/process1D.js +20 -19
- package/lib/component/workspaces/workspaceDefaultProperties.js +14 -15
- package/lib/constants.js +1 -1
- package/lib/data/Filters.d.ts +2 -2
- package/lib/data/Filters.js +2 -2
- package/lib/data/FiltersManager.js +3 -3
- package/lib/data/PredictionManager.d.ts +0 -1
- package/lib/data/PredictionManager.js +15 -15
- package/lib/data/SpectraManager.d.ts +2 -5
- package/lib/data/SpectraManager.js +4 -95
- package/lib/data/constants/SignalsKinds.d.ts +0 -1
- package/lib/data/constants/SignalsKinds.js +0 -8
- package/lib/data/data1d/Data1DManager.js +5 -5
- package/lib/data/data1d/Spectrum1D/SumManager.d.ts +5 -5
- package/lib/data/data1d/Spectrum1D/SumManager.js +18 -12
- package/lib/data/data1d/Spectrum1D/generateJGraphData.js +2 -2
- package/lib/data/data1d/Spectrum1D/index.d.ts +2 -1
- package/lib/data/data1d/Spectrum1D/index.js +2 -1
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +3 -3
- package/lib/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.js +1 -1
- package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +5 -2
- package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.js +15 -16
- package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.d.ts +8 -0
- package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.js +24 -0
- package/lib/data/data1d/Spectrum1D/ranges/addRange.js +3 -3
- package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.js +2 -0
- package/lib/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.js +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectRange.js +2 -2
- package/lib/data/data1d/Spectrum1D/ranges/mapRanges.js +3 -3
- package/lib/data/data1d/database.js +4 -6
- package/lib/data/data1d/filter1d/apodization.d.ts +25 -0
- package/lib/data/data1d/filter1d/apodization.js +63 -0
- package/lib/data/data1d/filter1d/baselineCorrection.d.ts +24 -7
- package/lib/data/data1d/filter1d/baselineCorrection.js +10 -17
- package/lib/data/data1d/filter1d/fft.js +11 -0
- package/lib/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.d.ts +2 -0
- package/lib/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +35 -0
- package/lib/data/data1d/filter1d/zeroFillingAndApodization.d.ts +9 -0
- package/lib/data/data1d/filter1d/zeroFillingAndApodization.js +24 -0
- package/lib/data/data2d/Processing2D.d.ts +3 -3
- package/lib/data/data2d/Processing2D.js +3 -2
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +3 -3
- package/lib/data/data2d/Spectrum2D/zones/detectZones.js +3 -3
- package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.js +3 -3
- package/lib/data/data2d/Spectrum2D/zones/getDetectionZones.d.ts +1 -1
- package/lib/data/molecules/Molecule.d.ts +20 -6
- package/lib/data/molecules/Molecule.js +5 -8
- package/lib/data/molecules/MoleculeManager.d.ts +4 -4
- package/lib/data/molecules/MoleculeManager.js +5 -5
- package/lib/data/types/data1d/SumOptions.d.ts +1 -1
- package/lib/data/utilities/generateNumbersPowerOfX.d.ts +0 -1
- package/lib/data/utilities/generateNumbersPowerOfX.js +0 -1
- package/lib/data/utilities/isInRange.d.ts +7 -0
- package/lib/data/utilities/isInRange.js +4 -0
- package/lib/types/NMRiumDataReturn.d.ts +2 -2
- package/lib/types/NMRiumGeneralPreferences.d.ts +0 -2
- package/lib/types/NMRiumToolBarPreferences.d.ts +14 -13
- package/lib/versionInfo.js +1 -1
- package/lib-cjs/component/1d/ApodizationLine.js +77 -0
- package/lib-cjs/component/1d/Chart1D.js +4 -2
- package/lib-cjs/component/1d/ExclusionZoneAnnotation.js +15 -8
- package/lib-cjs/component/1d/FooterBanner.js +3 -1
- package/lib-cjs/component/1d/IntegralResizable.js +4 -3
- package/lib-cjs/component/1d/IntegralsSeries.js +3 -1
- package/lib-cjs/component/1d/LinesSeries.js +6 -4
- package/lib-cjs/component/1d/SpectraTracker.js +1 -1
- package/lib-cjs/component/1d/Viewer1D.js +10 -13
- package/lib-cjs/component/1d/database/DatabaseElements.js +1 -1
- package/lib-cjs/component/1d/database/DatabaseSpectrum.js +2 -2
- package/lib-cjs/component/1d/database/ResurrectedDatabaseRanges.js +2 -2
- package/lib-cjs/component/1d/jCouplingGraph/JGraph.js +5 -1
- package/lib-cjs/component/1d/multiAnalysis/AnalysisRange.js +15 -13
- package/lib-cjs/component/1d/multiAnalysis/MultiAnalysisRanges.js +1 -1
- package/lib-cjs/component/1d/multiplicityTree/MultiplicityTree.js +4 -3
- package/lib-cjs/component/1d/{PeakAnnotation.js → peaks/PeakAnnotation.js} +8 -9
- package/lib-cjs/component/1d/peaks/PeakAnnotations.js +33 -0
- package/lib-cjs/component/1d/peaks/PeaksShapes.js +42 -0
- package/lib-cjs/component/1d/peaks/usePeakShapesPath.js +53 -0
- package/lib-cjs/component/1d/ranges/Range.js +3 -3
- package/lib-cjs/component/1d/ranges/Ranges.js +7 -1
- package/lib-cjs/component/1d/tool/PeakPointer.js +3 -1
- package/lib-cjs/component/1d/tool/XLabelPointer.js +3 -1
- package/lib-cjs/component/2d/Contours.js +3 -1
- package/lib-cjs/component/2d/FooterBanner.js +5 -3
- package/lib-cjs/component/2d/Viewer2D.js +6 -6
- package/lib-cjs/component/2d/XAxis.js +2 -2
- package/lib-cjs/component/2d/YAxis.js +2 -2
- package/lib-cjs/component/2d/tools/XYLabelPointer.js +3 -1
- package/lib-cjs/component/2d/tools/slicing/SlicingView.js +3 -1
- package/lib-cjs/component/2d/zones/IndicationLines.js +1 -1
- package/lib-cjs/component/2d/zones/Signal.js +3 -3
- package/lib-cjs/component/2d/zones/Zone.js +3 -3
- package/lib-cjs/component/2d/zones/Zones.js +13 -18
- package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +89 -50
- package/lib-cjs/component/NMRium.js +14 -3
- package/lib-cjs/component/context/GlobalContext.js +4 -4
- package/lib-cjs/component/elements/ActiveButton.js +33 -0
- package/lib-cjs/component/elements/Button.js +5 -5
- package/lib-cjs/component/elements/ButtonToolTip.js +1 -1
- package/lib-cjs/component/elements/CheckBox.js +3 -5
- package/lib-cjs/component/elements/Input.js +1 -1
- package/lib-cjs/component/elements/Label.js +3 -3
- package/lib-cjs/component/elements/MoleculeSelection.js +1 -1
- package/lib-cjs/component/elements/NextPrev.js +1 -1
- package/lib-cjs/component/elements/ReactTable/Elements/ReactTableRow.js +1 -1
- package/lib-cjs/component/elements/Select.js +6 -8
- package/lib-cjs/component/elements/Tab/Tab.js +1 -1
- package/lib-cjs/component/elements/Table/Table.js +2 -2
- package/lib-cjs/component/elements/ToggleButton.js +3 -2
- package/lib-cjs/component/elements/accordion/AccordionItem.js +2 -2
- package/lib-cjs/component/elements/formik/FormikOnChange.js +10 -4
- package/lib-cjs/component/elements/popup/Modal/ConfirmDialog.js +1 -1
- package/lib-cjs/component/elements/popup/Modal/Provider.js +8 -11
- package/lib-cjs/component/elements/resizer/DivResizer.js +3 -3
- package/lib-cjs/component/elements/resizer/SVGResizer.js +2 -2
- package/lib-cjs/component/header/ApodizationOptionsPanel.js +110 -0
- package/lib-cjs/component/header/AutoPeakPickingOptionPanel.js +39 -35
- package/lib-cjs/component/header/BaseLineCorrectionPanel.js +82 -49
- package/lib-cjs/component/header/Header.js +5 -2
- package/lib-cjs/component/header/HeaderContainer.js +14 -0
- package/lib-cjs/component/header/ManualPhaseCorrectionPanel.js +26 -28
- package/lib-cjs/component/header/RangesPickingOptionPanel.js +19 -21
- package/lib-cjs/component/header/ZeroFillingOptionsPanel.js +73 -45
- package/lib-cjs/component/header/Zones2DOptionPanel.js +11 -13
- package/lib-cjs/component/highlight/index.js +20 -18
- package/lib-cjs/component/hooks/useActiveSpectrumStyleOptions.js +2 -2
- package/lib-cjs/component/hooks/useCheckToolsVisibility.js +31 -1
- package/lib-cjs/component/hooks/useDatumWithSpectraStatistics.js +3 -1
- package/lib-cjs/component/hooks/useExport.js +0 -16
- package/lib-cjs/component/hooks/useFilter.js +14 -0
- package/lib-cjs/component/hooks/useIntegralPath.js +5 -2
- package/lib-cjs/component/hooks/useNucleus.js +4 -4
- package/lib-cjs/component/hooks/useSpectraPerNucleus.js +1 -1
- package/lib-cjs/component/hooks/useSpectrum.js +3 -1
- package/lib-cjs/component/hooks/useToolsFunctions.js +1 -1
- package/lib-cjs/component/loader/DropZone.js +7 -150
- package/lib-cjs/component/modal/AlignSpectraModal.js +1 -2
- package/lib-cjs/component/modal/EditPeakShapeModal.js +113 -0
- package/lib-cjs/component/modal/MoleculeStructureEditorModal.js +2 -3
- package/lib-cjs/component/modal/MultipleSpectraFiltersModal/index.js +1 -2
- package/lib-cjs/component/modal/PredictSpectraModal.js +1 -1
- package/lib-cjs/component/modal/changeSum/ChangeSumModal.js +9 -11
- package/lib-cjs/component/modal/changeSum/SelectMolecule.js +2 -2
- package/lib-cjs/component/modal/editRange/EditRangeModal.js +3 -3
- package/lib-cjs/component/modal/editRange/forms/components/CouplingsTable.js +3 -8
- package/lib-cjs/component/modal/setting/DatabasesTabContent.js +2 -2
- package/lib-cjs/component/modal/setting/DisplayTabContent.js +1 -1
- package/lib-cjs/component/modal/setting/FormattingTabContent.js +2 -2
- package/lib-cjs/component/modal/setting/GeneralSettings.js +1 -1
- package/lib-cjs/component/modal/setting/ToolsTabContent.js +17 -13
- package/lib-cjs/component/modal/setting/WorkspaceItem.js +2 -2
- package/lib-cjs/component/panels/IntegralsPanel/IntegralPanel.js +1 -1
- package/lib-cjs/component/panels/IntegralsPanel/IntegralTable.js +1 -1
- package/lib-cjs/component/panels/MoleculesPanel/MoleculeHeader.js +3 -3
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanel.js +12 -9
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +6 -6
- package/lib-cjs/component/panels/MoleculesPanel/useAtomAssignment.js +11 -3
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +1 -1
- package/lib-cjs/component/panels/Panels.js +3 -3
- package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +45 -20
- package/lib-cjs/component/panels/PeaksPanel/PeaksPreferences.js +17 -0
- package/lib-cjs/component/panels/PeaksPanel/PeaksTable.js +42 -11
- package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +10 -9
- package/lib-cjs/component/panels/RangesPanel/RangesPanel.js +7 -3
- package/lib-cjs/component/panels/RangesPanel/RangesTableRow.js +3 -3
- package/lib-cjs/component/panels/RangesPanel/TableColumns/ActionsColumn.js +1 -1
- package/lib-cjs/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +2 -1
- package/lib-cjs/component/panels/RangesPanel/hooks/useMapRanges.js +3 -6
- package/lib-cjs/component/panels/SpectrumsPanel/SpectraPanelHeader.js +3 -1
- package/lib-cjs/component/panels/SpectrumsPanel/SpectrumListItem.js +1 -1
- package/lib-cjs/component/panels/SpectrumsPanel/SpectrumsTabs.js +3 -1
- package/lib-cjs/component/panels/SpectrumsPanel/base/ColorIndicator.js +2 -2
- package/lib-cjs/component/panels/SpectrumsPanel/base/ShowHideMarkersButton.js +4 -1
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +4 -4
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +1 -2
- package/lib-cjs/component/panels/SummaryPanel/SummaryPanel.js +2 -3
- package/lib-cjs/component/panels/SummaryPanel/utilities/useInView.js +3 -1
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +1 -1
- package/lib-cjs/component/panels/ZonesPanel/ZonesPanel.js +18 -9
- package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +5 -13
- package/lib-cjs/component/panels/databasePanel/DatabaseTable.js +2 -2
- package/lib-cjs/component/panels/filtersPanel/FilterPanel.js +1 -1
- package/lib-cjs/component/panels/filtersPanel/FiltersTable.js +2 -2
- package/lib-cjs/component/panels/header/DefaultPanelHeader.js +3 -12
- package/lib-cjs/component/panels/header/SpectraAutomaticPickingButton.js +1 -1
- package/lib-cjs/component/panels/predictionPanel/PredictionOptions.js +2 -2
- package/lib-cjs/component/panels/predictionPanel/PredictionPanel.js +15 -3
- package/lib-cjs/component/reducer/IgnoreActions.js +5 -0
- package/lib-cjs/component/reducer/Reducer.js +72 -50
- package/lib-cjs/component/reducer/actions/DomainActions.js +11 -9
- package/lib-cjs/component/reducer/actions/FiltersActions.js +332 -205
- package/lib-cjs/component/reducer/actions/IntegralsActions.js +15 -10
- package/lib-cjs/component/reducer/actions/LoadActions.js +18 -36
- package/lib-cjs/component/reducer/actions/MoleculeActions.js +49 -19
- package/lib-cjs/component/reducer/actions/PeaksActions.js +54 -12
- package/lib-cjs/component/reducer/actions/PreferencesActions.js +8 -10
- package/lib-cjs/component/reducer/actions/RangesActions.js +87 -29
- package/lib-cjs/component/reducer/actions/SpectraAnalysisAction.js +5 -5
- package/lib-cjs/component/reducer/actions/SpectrumsActions.js +14 -11
- package/lib-cjs/component/reducer/actions/ToolsActions.js +46 -94
- package/lib-cjs/component/reducer/actions/ZonesActions.js +71 -17
- package/lib-cjs/component/reducer/helper/Zoom1DManager.js +2 -1
- package/lib-cjs/component/reducer/helper/getActiveSpectrumOrFail.js +10 -0
- package/lib-cjs/component/reducer/helper/getSpectrum.js +3 -2
- package/lib-cjs/component/reducer/helper/getStrongestPeak.js +19 -0
- package/lib-cjs/component/reducer/preferences/actions/addWorkspace.js +2 -5
- package/lib-cjs/component/reducer/preferences/panelsPreferencesDefaultValues.js +3 -0
- package/lib-cjs/component/reducer/preferences/preferencesReducer.js +1 -1
- package/lib-cjs/component/reducer/types/Types.js +15 -3
- package/lib-cjs/component/tool/BrushX.js +1 -1
- package/lib-cjs/component/tool/BrushXY.js +4 -3
- package/lib-cjs/component/tool/CrossLinePointer.js +5 -4
- package/lib-cjs/component/tool/FloatMoleculeStructures/DraggableStructure.js +21 -6
- package/lib-cjs/component/tool/FloatMoleculeStructures/index.js +19 -6
- package/lib-cjs/component/toolbar/BasicToolBar.js +7 -14
- package/lib-cjs/component/toolbar/FunctionToolBar.js +12 -22
- package/lib-cjs/component/toolbar/ToolTypes.js +119 -9
- package/lib-cjs/component/utility/assert.js +9 -0
- package/lib-cjs/component/workspaces/basic.js +12 -11
- package/lib-cjs/component/workspaces/embedded.js +14 -13
- package/lib-cjs/component/workspaces/exercise.js +10 -6
- package/lib-cjs/component/workspaces/prediction.js +14 -13
- package/lib-cjs/component/workspaces/process1D.js +20 -19
- package/lib-cjs/component/workspaces/workspaceDefaultProperties.js +14 -15
- package/lib-cjs/constants.js +1 -1
- package/lib-cjs/data/Filters.js +3 -3
- package/lib-cjs/data/FiltersManager.js +3 -6
- package/lib-cjs/data/PredictionManager.js +15 -15
- package/lib-cjs/data/SpectraManager.js +5 -100
- package/lib-cjs/data/constants/SignalsKinds.js +0 -8
- package/lib-cjs/data/data1d/Data1DManager.js +5 -5
- package/lib-cjs/data/data1d/Spectrum1D/SumManager.js +18 -12
- package/lib-cjs/data/data1d/Spectrum1D/generateJGraphData.js +2 -5
- package/lib-cjs/data/data1d/Spectrum1D/index.js +3 -1
- package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +3 -3
- package/lib-cjs/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +5 -2
- package/lib-cjs/data/data1d/Spectrum1D/peaks/mapPeaks.js +15 -19
- package/lib-cjs/data/data1d/Spectrum1D/peaks/optimizePeaks.js +28 -0
- package/lib-cjs/data/data1d/Spectrum1D/ranges/addRange.js +3 -3
- package/lib-cjs/data/data1d/Spectrum1D/ranges/autoRangesDetection.js +2 -0
- package/lib-cjs/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/ranges/detectRange.js +2 -5
- package/lib-cjs/data/data1d/Spectrum1D/ranges/mapRanges.js +3 -6
- package/lib-cjs/data/data1d/database.js +4 -6
- package/lib-cjs/data/data1d/filter1d/apodization.js +70 -0
- package/lib-cjs/data/data1d/filter1d/baselineCorrection.js +11 -18
- package/lib-cjs/data/data1d/filter1d/fft.js +11 -0
- package/lib-cjs/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +39 -0
- package/lib-cjs/data/data1d/filter1d/zeroFillingAndApodization.js +30 -0
- package/lib-cjs/data/data2d/Processing2D.js +3 -2
- package/lib-cjs/data/data2d/Spectrum2D/initiateDatum2D.js +3 -6
- package/lib-cjs/data/data2d/Spectrum2D/zones/detectZones.js +3 -6
- package/lib-cjs/data/data2d/Spectrum2D/zones/detectZonesManual.js +3 -6
- package/lib-cjs/data/molecules/Molecule.js +5 -8
- package/lib-cjs/data/molecules/MoleculeManager.js +5 -5
- package/lib-cjs/data/utilities/generateNumbersPowerOfX.js +0 -1
- package/lib-cjs/data/utilities/isInRange.js +7 -0
- package/lib-cjs/versionInfo.js +1 -1
- package/package.json +36 -35
- package/lib/component/1d/PeakAnnotations.js +0 -41
- package/lib/component/utility/nmredataToNmrium.d.ts +0 -4
- package/lib/component/utility/nmredataToNmrium.js +0 -66
- package/lib/component/utility/nmriumToNmredata.d.ts +0 -2
- package/lib/component/utility/nmriumToNmredata.js +0 -80
- package/lib/component/utility/util/nmredata/addRanges.d.ts +0 -1
- package/lib/component/utility/util/nmredata/addRanges.js +0 -52
- package/lib/component/utility/util/nmredata/addSource.d.ts +0 -6
- package/lib/component/utility/util/nmredata/addSource.js +0 -54
- package/lib/component/utility/util/nmredata/addZones.d.ts +0 -1
- package/lib/component/utility/util/nmredata/addZones.js +0 -41
- package/lib/component/utility/util/nmredata/flat2DSignals.d.ts +0 -1
- package/lib/component/utility/util/nmredata/flat2DSignals.js +0 -7
- package/lib/component/utility/util/nmredata/get1DSignals.d.ts +0 -10
- package/lib/component/utility/util/nmredata/get1DSignals.js +0 -96
- package/lib/component/utility/util/nmredata/get2DSignals.d.ts +0 -8
- package/lib/component/utility/util/nmredata/get2DSignals.js +0 -59
- package/lib/component/utility/util/nmredata/getCouplingObserved.d.ts +0 -1
- package/lib/component/utility/util/nmredata/getCouplingObserved.js +0 -11
- package/lib/component/utility/util/nmredata/getLabels.d.ts +0 -9
- package/lib/component/utility/util/nmredata/getLabels.js +0 -66
- package/lib/component/utility/util/nmredata/getToFix.d.ts +0 -1
- package/lib/component/utility/util/nmredata/getToFix.js +0 -19
- package/lib/data/data1d/filter1d/lineBroadening.d.ts +0 -14
- package/lib/data/data1d/filter1d/lineBroadening.js +0 -57
- package/lib/data/migration/MigrationManager.d.ts +0 -2
- package/lib/data/migration/MigrationManager.js +0 -17
- package/lib/data/migration/changeKeys.d.ts +0 -1
- package/lib/data/migration/changeKeys.js +0 -9
- package/lib/data/migration/migrateToVersion1.d.ts +0 -11
- package/lib/data/migration/migrateToVersion1.js +0 -32
- package/lib/data/migration/migrateToVersion2.d.ts +0 -1
- package/lib/data/migration/migrateToVersion2.js +0 -111
- package/lib/data/utilities/generateID.d.ts +0 -1
- package/lib/data/utilities/generateID.js +0 -9
- package/lib-cjs/component/1d/PeakAnnotations.js +0 -46
- package/lib-cjs/component/utility/nmredataToNmrium.js +0 -73
- package/lib-cjs/component/utility/nmriumToNmredata.js +0 -87
- package/lib-cjs/component/utility/util/nmredata/addRanges.js +0 -56
- package/lib-cjs/component/utility/util/nmredata/addSource.js +0 -61
- package/lib-cjs/component/utility/util/nmredata/addZones.js +0 -48
- package/lib-cjs/component/utility/util/nmredata/flat2DSignals.js +0 -11
- package/lib-cjs/component/utility/util/nmredata/get1DSignals.js +0 -100
- package/lib-cjs/component/utility/util/nmredata/get2DSignals.js +0 -63
- package/lib-cjs/component/utility/util/nmredata/getCouplingObserved.js +0 -15
- package/lib-cjs/component/utility/util/nmredata/getLabels.js +0 -70
- package/lib-cjs/component/utility/util/nmredata/getToFix.js +0 -23
- package/lib-cjs/data/data1d/filter1d/lineBroadening.js +0 -63
- package/lib-cjs/data/migration/MigrationManager.js +0 -24
- package/lib-cjs/data/migration/changeKeys.js +0 -13
- package/lib-cjs/data/migration/migrateToVersion1.js +0 -35
- package/lib-cjs/data/migration/migrateToVersion2.js +0 -114
- package/lib-cjs/data/utilities/generateID.js +0 -12
|
@@ -1,174 +1,209 @@
|
|
|
1
|
+
import { v4 } from '@lukeed/uuid';
|
|
1
2
|
import { current } from 'immer';
|
|
2
3
|
import * as Filters from '../../../data/Filters';
|
|
3
4
|
import * as FiltersManager from '../../../data/FiltersManager';
|
|
4
5
|
import { updateXShift } from '../../../data/data1d/Spectrum1D';
|
|
6
|
+
import { apply as apodization, defaultApodizationOptions, } from '../../../data/data1d/filter1d/apodization';
|
|
5
7
|
import { apply as autoPhaseCorrection } from '../../../data/data1d/filter1d/autoPhaseCorrection';
|
|
6
8
|
import { apply as baselineCorrection } from '../../../data/data1d/filter1d/baselineCorrection';
|
|
7
9
|
import { apply as phaseCorrection } from '../../../data/data1d/filter1d/phaseCorrection';
|
|
10
|
+
import { apply as zeroFilling } from '../../../data/data1d/filter1d/zeroFilling';
|
|
8
11
|
import { updateShift as update2dShift } from '../../../data/data2d/Spectrum2D';
|
|
9
|
-
import
|
|
12
|
+
import { options } from '../../toolbar/ToolTypes';
|
|
10
13
|
import { getSpectraByNucleus } from '../../utility/getSpectraByNucleus';
|
|
11
14
|
import nucleusToString from '../../utility/nucleusToString';
|
|
12
15
|
import zoomHistoryManager from '../helper/ZoomHistoryManager';
|
|
16
|
+
import { getActiveSpectrumOrFail } from '../helper/getActiveSpectrumOrFail';
|
|
13
17
|
import getRange from '../helper/getRange';
|
|
18
|
+
import { getStrongestPeak } from '../helper/getStrongestPeak';
|
|
14
19
|
import { setDomain, setMode } from './DomainActions';
|
|
15
20
|
import { changeSpectrumVerticalAlignment } from './PreferencesActions';
|
|
16
21
|
import { resetSelectedTool } from './ToolsActions';
|
|
17
22
|
function shiftSpectrumAlongXAxis(draft, shiftValue) {
|
|
18
23
|
//apply filter into the spectrum
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
24
|
+
const activeSpectrum = getActiveSpectrumOrFail(draft);
|
|
25
|
+
const index = activeSpectrum?.index;
|
|
26
|
+
FiltersManager.applyFilter(draft.data[index], [
|
|
27
|
+
{ name: Filters.shiftX.id, options: shiftValue },
|
|
28
|
+
]);
|
|
29
|
+
updateXShift(draft.data[index]);
|
|
30
|
+
resetSelectedTool(draft);
|
|
31
|
+
setDomain(draft);
|
|
28
32
|
}
|
|
29
|
-
function applyZeroFillingFilter(draft,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
33
|
+
function applyZeroFillingFilter(draft, action) {
|
|
34
|
+
const activeSpectrum = getActiveSpectrumOrFail(draft);
|
|
35
|
+
const index = activeSpectrum.index;
|
|
36
|
+
const { size } = action.payload;
|
|
37
|
+
const filters = [
|
|
38
|
+
{
|
|
39
|
+
name: Filters.zeroFilling.id,
|
|
40
|
+
options: size,
|
|
41
|
+
},
|
|
42
|
+
];
|
|
43
|
+
FiltersManager.applyFilter(draft.data[index], filters);
|
|
44
|
+
resetSelectedTool(draft);
|
|
45
|
+
setDomain(draft);
|
|
46
|
+
setMode(draft);
|
|
47
|
+
}
|
|
48
|
+
function calculateApodizationFilter(draft, action) {
|
|
49
|
+
const activeSpectrum = getActiveSpectrumOrFail(draft);
|
|
50
|
+
const index = activeSpectrum.index;
|
|
51
|
+
const options = action.payload;
|
|
52
|
+
const { data: { x, re, im }, info, } = draft.data[index];
|
|
53
|
+
let _data = { data: { x, re, im }, info };
|
|
54
|
+
draft.toolOptions.data.apodizationOptions = options;
|
|
55
|
+
apodization(_data, options);
|
|
56
|
+
const { im: newIm, re: newRe } = _data.data;
|
|
57
|
+
draft.tempData[index].data.im = newIm;
|
|
58
|
+
draft.tempData[index].data.re = newRe;
|
|
59
|
+
}
|
|
60
|
+
function applyApodizationFilter(draft, action) {
|
|
61
|
+
const activeSpectrum = getActiveSpectrumOrFail(draft);
|
|
62
|
+
const index = activeSpectrum.index;
|
|
63
|
+
const options = action.payload;
|
|
64
|
+
const filters = [
|
|
65
|
+
{
|
|
66
|
+
name: Filters.apodization.id,
|
|
67
|
+
options,
|
|
68
|
+
},
|
|
69
|
+
];
|
|
70
|
+
FiltersManager.applyFilter(draft.data[index], filters);
|
|
71
|
+
resetSelectedTool(draft);
|
|
72
|
+
setDomain(draft);
|
|
73
|
+
setMode(draft);
|
|
74
|
+
}
|
|
75
|
+
function calculateZeroFillingFilter(draft, action) {
|
|
76
|
+
const activeSpectrum = getActiveSpectrumOrFail(draft);
|
|
77
|
+
const index = activeSpectrum.index;
|
|
78
|
+
const { size } = action.payload;
|
|
79
|
+
const { data: { x, re, im }, filters, info, } = draft.data[index];
|
|
80
|
+
let _data = { data: { x, re, im }, filters, info };
|
|
81
|
+
zeroFilling(_data, size);
|
|
82
|
+
const { im: newIm, re: newRe, x: newX } = _data.data;
|
|
83
|
+
draft.tempData[index].data.x = newX;
|
|
84
|
+
draft.tempData[index].data.im = newIm;
|
|
85
|
+
draft.tempData[index].data.re = newRe;
|
|
86
|
+
draft.xDomain = [newX[0], newX[newX.length - 1]];
|
|
44
87
|
}
|
|
45
88
|
function applyFFTFilter(draft) {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
89
|
+
const activeSpectrum = getActiveSpectrumOrFail(draft);
|
|
90
|
+
const { index } = activeSpectrum;
|
|
91
|
+
//apply filter into the spectrum
|
|
92
|
+
FiltersManager.applyFilter(draft.data[index], [
|
|
93
|
+
{ name: Filters.fft.id, options: {} },
|
|
94
|
+
]);
|
|
95
|
+
resetSelectedTool(draft);
|
|
96
|
+
changeSpectrumVerticalAlignment(draft, { align: 'bottom' });
|
|
97
|
+
setDomain(draft, { yDomain: { isChanged: true } });
|
|
98
|
+
setMode(draft);
|
|
57
99
|
}
|
|
58
100
|
function applyManualPhaseCorrectionFilter(draft, filterOptions) {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
101
|
+
const activeSpectrum = getActiveSpectrumOrFail(draft);
|
|
102
|
+
const { index } = activeSpectrum;
|
|
103
|
+
const { ph0, ph1 } = filterOptions;
|
|
104
|
+
FiltersManager.applyFilter(draft.data[index], [
|
|
105
|
+
{ name: Filters.phaseCorrection.id, options: { ph0, ph1 } },
|
|
106
|
+
]);
|
|
107
|
+
resetSelectedTool(draft);
|
|
108
|
+
draft.tempData = null;
|
|
109
|
+
setDomain(draft);
|
|
69
110
|
}
|
|
70
111
|
function applyAbsoluteFilter(draft) {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
112
|
+
const activeSpectrum = getActiveSpectrumOrFail(draft);
|
|
113
|
+
const { index } = activeSpectrum;
|
|
114
|
+
FiltersManager.applyFilter(draft.data[index], [
|
|
115
|
+
{ name: Filters.absolute.id, options: {} },
|
|
116
|
+
]);
|
|
117
|
+
resetSelectedTool(draft);
|
|
118
|
+
draft.tempData = null;
|
|
119
|
+
setDomain(draft);
|
|
80
120
|
}
|
|
81
121
|
function applyAutoPhaseCorrectionFilter(draft) {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}
|
|
122
|
+
const activeSpectrum = getActiveSpectrumOrFail(draft);
|
|
123
|
+
const { index } = activeSpectrum;
|
|
124
|
+
const { ph0, ph1 } = autoPhaseCorrection(draft.data[index]);
|
|
125
|
+
FiltersManager.applyFilter(draft.data[index], [
|
|
126
|
+
{ name: Filters.phaseCorrection.id, options: { ph0, ph1 } },
|
|
127
|
+
]);
|
|
128
|
+
resetSelectedTool(draft);
|
|
129
|
+
draft.tempData = null;
|
|
130
|
+
setDomain(draft);
|
|
92
131
|
}
|
|
93
132
|
function calculateBaseLineCorrection(draft, action) {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
let _data = { data: { x, re, im }, info };
|
|
106
|
-
baselineCorrection(_data, {
|
|
107
|
-
zones,
|
|
108
|
-
...filterOptions,
|
|
109
|
-
});
|
|
110
|
-
const { im: newIm, re: newRe } = _data.data;
|
|
111
|
-
draft.tempData[index].data.im = newIm;
|
|
112
|
-
draft.tempData[index].data.re = newRe;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
function calculateManualPhaseCorrection(draft, filterOptions) {
|
|
117
|
-
if (draft.activeSpectrum) {
|
|
118
|
-
const { index } = draft.activeSpectrum;
|
|
119
|
-
const { data: { x, re, im }, info, } = draft.data[index];
|
|
120
|
-
const { ph0, ph1 } = filterOptions;
|
|
133
|
+
const activeSpectrum = getActiveSpectrumOrFail(draft);
|
|
134
|
+
const { index } = activeSpectrum;
|
|
135
|
+
const { data: { x, re, im }, info, } = draft.data[index];
|
|
136
|
+
// save the baseline options temporary
|
|
137
|
+
draft.toolOptions.data.baselineCorrection = {
|
|
138
|
+
...draft.toolOptions.data.baselineCorrection,
|
|
139
|
+
...(action?.options ? { options: action.options } : {}),
|
|
140
|
+
};
|
|
141
|
+
const { zones, options } = draft.toolOptions.data.baselineCorrection;
|
|
142
|
+
const { livePreview, ...filterOptions } = options;
|
|
143
|
+
if (livePreview) {
|
|
121
144
|
let _data = { data: { x, re, im }, info };
|
|
122
|
-
|
|
145
|
+
baselineCorrection(_data, {
|
|
146
|
+
zones,
|
|
147
|
+
...filterOptions,
|
|
148
|
+
});
|
|
123
149
|
const { im: newIm, re: newRe } = _data.data;
|
|
124
150
|
draft.tempData[index].data.im = newIm;
|
|
125
151
|
draft.tempData[index].data.re = newRe;
|
|
126
152
|
}
|
|
127
153
|
}
|
|
154
|
+
function calculateManualPhaseCorrection(draft, filterOptions) {
|
|
155
|
+
const activeSpectrum = getActiveSpectrumOrFail(draft);
|
|
156
|
+
const { index } = activeSpectrum;
|
|
157
|
+
const { data: { x, re, im }, info, } = draft.data[index];
|
|
158
|
+
const { ph0, ph1 } = filterOptions;
|
|
159
|
+
let _data = { data: { x, re, im }, info };
|
|
160
|
+
phaseCorrection(_data, { ph0, ph1 });
|
|
161
|
+
const { im: newIm, re: newRe } = _data.data;
|
|
162
|
+
draft.tempData[index].data.im = newIm;
|
|
163
|
+
draft.tempData[index].data.re = newRe;
|
|
164
|
+
}
|
|
128
165
|
function enableFilter(draft, filterID, checked) {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
}
|
|
166
|
+
const activeSpectrum = getActiveSpectrumOrFail(draft);
|
|
167
|
+
const { index } = activeSpectrum;
|
|
168
|
+
//apply filter into the spectrum
|
|
169
|
+
FiltersManager.enableFilter(draft.data[index], filterID, checked);
|
|
170
|
+
if (draft.data[index].info?.dimension === 1) {
|
|
171
|
+
updateXShift(draft.data[index]);
|
|
172
|
+
}
|
|
173
|
+
else if (draft.data[index].info?.dimension === 2) {
|
|
174
|
+
update2dShift(draft.data[index]);
|
|
175
|
+
}
|
|
176
|
+
resetSelectedTool(draft);
|
|
177
|
+
setDomain(draft);
|
|
178
|
+
setMode(draft);
|
|
179
|
+
const zoomHistory = zoomHistoryManager(draft.zoom.history, draft.view.spectra.activeTab);
|
|
180
|
+
const zoomValue = zoomHistory.getLast();
|
|
181
|
+
if (zoomValue) {
|
|
182
|
+
draft.xDomain = zoomValue.xDomain;
|
|
183
|
+
draft.yDomain = zoomValue.yDomain;
|
|
148
184
|
}
|
|
149
185
|
}
|
|
150
186
|
function deleteFilter(draft, actions) {
|
|
151
187
|
const filterID = actions.payload.id;
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
}
|
|
162
|
-
resetSelectedTool(draft);
|
|
163
|
-
setDomain(draft);
|
|
164
|
-
setMode(draft);
|
|
188
|
+
const activeSpectrum = getActiveSpectrumOrFail(draft);
|
|
189
|
+
const { index } = activeSpectrum;
|
|
190
|
+
//apply filter into the spectrum
|
|
191
|
+
FiltersManager.deleteFilter(draft.data[index], filterID);
|
|
192
|
+
if (draft.data[index].info?.dimension === 1) {
|
|
193
|
+
updateXShift(draft.data[index]);
|
|
194
|
+
}
|
|
195
|
+
else if (draft.data[index].info?.dimension === 2) {
|
|
196
|
+
update2dShift(draft.data[index]);
|
|
165
197
|
}
|
|
198
|
+
resetSelectedTool(draft);
|
|
199
|
+
setDomain(draft);
|
|
200
|
+
setMode(draft);
|
|
166
201
|
}
|
|
167
202
|
function deleteSpectraFilter(draft, actions) {
|
|
168
203
|
const filterType = actions.payload.filterType;
|
|
169
|
-
if (draft.activeTab) {
|
|
204
|
+
if (draft.view.spectra.activeTab) {
|
|
170
205
|
for (const datum of draft.data) {
|
|
171
|
-
if (nucleusToString(datum?.info?.nucleus) === draft.activeTab) {
|
|
206
|
+
if (nucleusToString(datum?.info?.nucleus) === draft.view.spectra.activeTab) {
|
|
172
207
|
const filtersResult = datum.filters?.filter((filter) => filter.name === filterType) || [];
|
|
173
208
|
filtersResult.forEach((filter) => {
|
|
174
209
|
FiltersManager.deleteFilter(datum, filter.id);
|
|
@@ -187,90 +222,88 @@ function deleteSpectraFilter(draft, actions) {
|
|
|
187
222
|
}
|
|
188
223
|
}
|
|
189
224
|
function handleBaseLineCorrectionFilter(draft, action) {
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
225
|
+
const activeSpectrum = getActiveSpectrumOrFail(draft);
|
|
226
|
+
const { index } = activeSpectrum;
|
|
227
|
+
const { zones } = draft.toolOptions.data.baselineCorrection;
|
|
228
|
+
const { livePreview, ...options } = action.options;
|
|
229
|
+
FiltersManager.applyFilter(draft.data[index], [
|
|
230
|
+
{
|
|
231
|
+
name: Filters.baselineCorrection.id,
|
|
232
|
+
options: {
|
|
233
|
+
zones,
|
|
234
|
+
...options,
|
|
200
235
|
},
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
236
|
+
},
|
|
237
|
+
]);
|
|
238
|
+
const xDomainSnapshot = draft.xDomain.slice();
|
|
239
|
+
resetSelectedTool(draft);
|
|
240
|
+
setDomain(draft);
|
|
241
|
+
draft.xDomain = xDomainSnapshot;
|
|
207
242
|
}
|
|
208
243
|
/**
|
|
209
244
|
* reset spectrum data for specific point of time (Filter)
|
|
210
245
|
* @param {object} draft
|
|
211
|
-
* @param {string} id Filter id
|
|
212
246
|
* @param {object} options
|
|
247
|
+
* @param {string} options.id Filter id
|
|
213
248
|
* @param {boolean=} options.resetTool
|
|
214
249
|
* @param {boolean=} options.updateDomain
|
|
215
250
|
* @param {boolean=} options.rollback
|
|
216
251
|
*/
|
|
217
|
-
function resetSpectrumByFilter(draft,
|
|
218
|
-
const { updateDomain = true, rollback = false, searchBy = 'id',
|
|
252
|
+
function resetSpectrumByFilter(draft, options) {
|
|
253
|
+
const { updateDomain = true, rollback = false, searchBy = 'id', applyFilter = false, // the filter that we rollback and return the affect data for the selected spectrum
|
|
254
|
+
filterId, } = options || {};
|
|
219
255
|
let currentDatum = null;
|
|
220
|
-
const currentActiveSpectrum =
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
if (
|
|
224
|
-
const
|
|
225
|
-
|
|
226
|
-
if (
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
if (
|
|
240
|
-
|
|
241
|
-
const newDatum = current(draft).data[index];
|
|
242
|
-
if (newDatum.info?.dimension === 1) {
|
|
243
|
-
FiltersManager.applyFilter(newDatum, [{ name, options }]);
|
|
244
|
-
}
|
|
245
|
-
currentDatum = { datum: newDatum, index };
|
|
256
|
+
const currentActiveSpectrum = getActiveSpectrumOrFail(draft);
|
|
257
|
+
const index = currentActiveSpectrum.index;
|
|
258
|
+
const datum = draft.data[index];
|
|
259
|
+
if (filterId && draft.toolOptions.data.activeFilterID !== filterId) {
|
|
260
|
+
const filterIndex = datum.filters.findIndex((f) => f[searchBy] === filterId);
|
|
261
|
+
let filters = [];
|
|
262
|
+
if (filterIndex !== -1) {
|
|
263
|
+
filters = datum.filters.slice(0, rollback ? filterIndex : filterIndex + 1);
|
|
264
|
+
if (filters.length >= 1) {
|
|
265
|
+
draft.toolOptions.data.activeFilterID =
|
|
266
|
+
datum.filters[rollback ? filterIndex - 1 : filterIndex]?.id;
|
|
267
|
+
}
|
|
268
|
+
else {
|
|
269
|
+
draft.toolOptions.data.activeFilterID = null;
|
|
270
|
+
}
|
|
271
|
+
FiltersManager.reapplyFilters(datum, filters);
|
|
272
|
+
if (applyFilter) {
|
|
273
|
+
const { name, value: options } = datum.filters[filterIndex];
|
|
274
|
+
const newDatum = current(draft).data[index];
|
|
275
|
+
if (newDatum.info?.dimension === 1) {
|
|
276
|
+
FiltersManager.applyFilter(newDatum, [{ name, options }]);
|
|
246
277
|
}
|
|
278
|
+
currentDatum = { datum: newDatum, index };
|
|
247
279
|
}
|
|
248
280
|
}
|
|
249
|
-
else {
|
|
250
|
-
//close filter snapshot mode and replay all enabled filters
|
|
251
|
-
draft.toolOptions.data.activeFilterID = null;
|
|
252
|
-
FiltersManager.reapplyFilters(datum);
|
|
253
|
-
}
|
|
254
|
-
if (datum.info?.dimension === 1) {
|
|
255
|
-
updateXShift(datum);
|
|
256
|
-
}
|
|
257
|
-
else if (datum.info?.dimension === 2) {
|
|
258
|
-
update2dShift(datum);
|
|
259
|
-
}
|
|
260
|
-
if (updateDomain) {
|
|
261
|
-
setDomain(draft);
|
|
262
|
-
setMode(draft);
|
|
263
|
-
}
|
|
264
281
|
}
|
|
265
|
-
|
|
282
|
+
else {
|
|
283
|
+
//close filter snapshot mode and replay all enabled filters
|
|
284
|
+
draft.toolOptions.data.activeFilterID = null;
|
|
285
|
+
FiltersManager.reapplyFilters(datum);
|
|
286
|
+
}
|
|
287
|
+
if (datum.info?.dimension === 1) {
|
|
288
|
+
updateXShift(datum);
|
|
289
|
+
}
|
|
290
|
+
else if (datum.info?.dimension === 2) {
|
|
291
|
+
update2dShift(datum);
|
|
292
|
+
}
|
|
293
|
+
if (updateDomain) {
|
|
294
|
+
setDomain(draft);
|
|
295
|
+
setMode(draft);
|
|
296
|
+
}
|
|
297
|
+
if (applyFilter) {
|
|
266
298
|
return currentDatum;
|
|
267
299
|
}
|
|
268
300
|
}
|
|
269
301
|
function filterSnapshotHandler(draft, action) {
|
|
270
|
-
|
|
302
|
+
const { filterId } = action.payload;
|
|
303
|
+
resetSpectrumByFilter(draft, { filterId });
|
|
271
304
|
}
|
|
272
305
|
function handleMultipleSpectraFilter(draft, action) {
|
|
273
|
-
const spectra = getSpectraByNucleus(draft.activeTab, draft.data);
|
|
306
|
+
const spectra = getSpectraByNucleus(draft.view.spectra.activeTab, draft.data);
|
|
274
307
|
if (spectra && spectra.length > 0 && Array.isArray(action.payload)) {
|
|
275
308
|
const exclusions = spectra[0].filters.find((f) => f.name === Filters.exclusionZones.id)
|
|
276
309
|
?.value || [];
|
|
@@ -293,12 +326,14 @@ function handleAddExclusionZone(draft, action) {
|
|
|
293
326
|
const { from: startX, to: endX } = action.payload;
|
|
294
327
|
const range = getRange(draft, { startX, endX });
|
|
295
328
|
let spectra;
|
|
296
|
-
|
|
297
|
-
|
|
329
|
+
// todo: refactor this
|
|
330
|
+
const activeSpectrum = draft.view.spectra.activeSpectra[draft.view.spectra.activeTab];
|
|
331
|
+
if (activeSpectrum?.id) {
|
|
332
|
+
const index = activeSpectrum?.index;
|
|
298
333
|
spectra = [draft.data[index]];
|
|
299
334
|
}
|
|
300
335
|
else {
|
|
301
|
-
spectra = getSpectraByNucleus(draft.activeTab, draft.data);
|
|
336
|
+
spectra = getSpectraByNucleus(draft.view.spectra.activeTab, draft.data);
|
|
302
337
|
}
|
|
303
338
|
for (const spectrum of spectra) {
|
|
304
339
|
FiltersManager.applyFilter(spectrum, [
|
|
@@ -306,7 +341,7 @@ function handleAddExclusionZone(draft, action) {
|
|
|
306
341
|
name: Filters.exclusionZones.id,
|
|
307
342
|
options: [
|
|
308
343
|
{
|
|
309
|
-
id:
|
|
344
|
+
id: v4(),
|
|
310
345
|
from: range[0],
|
|
311
346
|
to: range[1],
|
|
312
347
|
},
|
|
@@ -317,17 +352,104 @@ function handleAddExclusionZone(draft, action) {
|
|
|
317
352
|
setDomain(draft);
|
|
318
353
|
}
|
|
319
354
|
function handleDeleteExclusionZone(draft, action) {
|
|
320
|
-
const {
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
355
|
+
const { zone, spectrumID } = action.payload;
|
|
356
|
+
// if spectrum id exists, remove the selected exclusive zone in the spectrum
|
|
357
|
+
if (spectrumID) {
|
|
358
|
+
const spectrumIndex = draft.data.findIndex((spectrum) => spectrum.id === spectrumID);
|
|
359
|
+
const filter = draft.data[spectrumIndex].filters.find((_filter) => _filter.name === Filters.exclusionZones.id);
|
|
360
|
+
if (filter) {
|
|
361
|
+
if (filter.value.length === 1) {
|
|
362
|
+
FiltersManager.deleteFilter(draft.data[spectrumIndex], filter.id);
|
|
363
|
+
}
|
|
364
|
+
else {
|
|
365
|
+
filter.value = filter.value.filter((_zone) => _zone.id !== zone?.id);
|
|
366
|
+
FiltersManager.reapplyFilters(draft.data[spectrumIndex]);
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
else {
|
|
371
|
+
// remove all exclusive zone that have the same range in all spectra
|
|
372
|
+
const data = getSpectraByNucleus(draft.view.spectra.activeTab, draft.data);
|
|
373
|
+
for (const datum of data) {
|
|
374
|
+
for (const filter of datum.filters) {
|
|
375
|
+
if (filter.name === Filters.exclusionZones.id) {
|
|
376
|
+
filter.value = filter.value.filter((_zone) => zone.from !== _zone.from && zone.to !== _zone.to);
|
|
377
|
+
FiltersManager.reapplyFilters(datum);
|
|
378
|
+
}
|
|
379
|
+
}
|
|
326
380
|
}
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
function handleDisableFilterLivePreview(draft, action) {
|
|
384
|
+
const { selectedTool } = action.payload;
|
|
385
|
+
setFilterChanges(draft, selectedTool);
|
|
386
|
+
if (selectedTool === options.zeroFilling.id) {
|
|
387
|
+
setDomain(draft, { yDomain: { isChanged: false } });
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
function checkFilterHasTempData(selectedToolId) {
|
|
391
|
+
return [
|
|
392
|
+
options.phaseCorrection.id,
|
|
393
|
+
options.baselineCorrection.id,
|
|
394
|
+
options.apodization.id,
|
|
395
|
+
options.zeroFilling.id,
|
|
396
|
+
].includes(selectedToolId);
|
|
397
|
+
}
|
|
398
|
+
function setFilterChanges(draft, selectedFilterID) {
|
|
399
|
+
const activeSpectrum = getActiveSpectrumOrFail(draft);
|
|
400
|
+
const activeSpectrumId = activeSpectrum.id;
|
|
401
|
+
// If the user selects the filter from the filters list or selects its tool and has a record in the filter list for preview and edit
|
|
402
|
+
if (checkFilterHasTempData(selectedFilterID)) {
|
|
403
|
+
//return back the spectra data to point of time before applying a specific filter
|
|
404
|
+
const isPhaseCorrection = selectedFilterID === options.phaseCorrection.id;
|
|
405
|
+
const updateDomain = [
|
|
406
|
+
options.zeroFilling.id,
|
|
407
|
+
options.apodization.id,
|
|
408
|
+
].includes(selectedFilterID);
|
|
409
|
+
const rollbackSpectrumData = resetSpectrumByFilter(draft, {
|
|
410
|
+
updateDomain,
|
|
411
|
+
rollback: true,
|
|
412
|
+
searchBy: 'name',
|
|
413
|
+
filterId: selectedFilterID,
|
|
414
|
+
applyFilter: isPhaseCorrection,
|
|
415
|
+
});
|
|
416
|
+
// create a temporary clone of the data
|
|
417
|
+
draft.tempData = current(draft).data;
|
|
418
|
+
if (rollbackSpectrumData) {
|
|
419
|
+
draft.tempData[rollbackSpectrumData?.index] = rollbackSpectrumData?.datum;
|
|
330
420
|
}
|
|
421
|
+
switch (selectedFilterID) {
|
|
422
|
+
case options.phaseCorrection.id: {
|
|
423
|
+
// look for the strongest peak to set it as a pivot
|
|
424
|
+
const { xValue, index } = getStrongestPeak(draft) || {
|
|
425
|
+
xValue: 0,
|
|
426
|
+
index: 0,
|
|
427
|
+
};
|
|
428
|
+
draft.toolOptions.data.pivot = { value: xValue, index };
|
|
429
|
+
break;
|
|
430
|
+
}
|
|
431
|
+
case options.baselineCorrection.id: {
|
|
432
|
+
const baselineCorrectionFilter = current(draft).data[activeSpectrum.index].filters.find((filter) => filter.name === options.baselineCorrection.id);
|
|
433
|
+
if (baselineCorrectionFilter) {
|
|
434
|
+
draft.toolOptions.data.baselineCorrection.zones =
|
|
435
|
+
baselineCorrectionFilter
|
|
436
|
+
? baselineCorrectionFilter.value.zones
|
|
437
|
+
: [];
|
|
438
|
+
}
|
|
439
|
+
break;
|
|
440
|
+
}
|
|
441
|
+
case options.apodization.id: {
|
|
442
|
+
draft.toolOptions.data.apodizationOptions = defaultApodizationOptions;
|
|
443
|
+
break;
|
|
444
|
+
}
|
|
445
|
+
default:
|
|
446
|
+
break;
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
else if (checkFilterHasTempData(draft.toolOptions.selectedTool)) {
|
|
450
|
+
draft.toolOptions.data.activeFilterID = null;
|
|
451
|
+
const spectrumIndex = draft.data.findIndex((spectrum) => spectrum.id === activeSpectrumId);
|
|
452
|
+
draft.data[spectrumIndex].data = draft.tempData[spectrumIndex].data;
|
|
331
453
|
}
|
|
332
454
|
}
|
|
333
|
-
export { shiftSpectrumAlongXAxis, applyZeroFillingFilter, applyFFTFilter, applyManualPhaseCorrectionFilter, applyAutoPhaseCorrectionFilter, applyAbsoluteFilter, calculateManualPhaseCorrection, calculateBaseLineCorrection, handleMultipleSpectraFilter, enableFilter, deleteFilter, deleteSpectraFilter, handleBaseLineCorrectionFilter, filterSnapshotHandler, resetSpectrumByFilter, handleAddExclusionZone, handleDeleteExclusionZone, };
|
|
455
|
+
export { shiftSpectrumAlongXAxis, applyZeroFillingFilter, applyApodizationFilter, applyFFTFilter, applyManualPhaseCorrectionFilter, applyAutoPhaseCorrectionFilter, applyAbsoluteFilter, calculateManualPhaseCorrection, calculateBaseLineCorrection, calculateApodizationFilter, calculateZeroFillingFilter, handleMultipleSpectraFilter, enableFilter, deleteFilter, deleteSpectraFilter, handleBaseLineCorrectionFilter, filterSnapshotHandler, resetSpectrumByFilter, handleAddExclusionZone, handleDeleteExclusionZone, handleDisableFilterLivePreview, setFilterChanges, };
|