nmrium 0.29.0 → 0.30.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 +47 -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/IntegralResizable.js +5 -4
- package/lib/component/1d/LinesSeries.js +6 -6
- package/lib/component/1d/Viewer1D.js +7 -12
- 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/multiAnalysis/AnalysisRange.js +16 -14
- package/lib/component/1d/multiplicityTree/MultiplicityTree.js +3 -4
- 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 +26 -0
- package/lib/component/1d/peaks/PeaksShapes.d.ts +3 -0
- package/lib/component/1d/peaks/PeaksShapes.js +35 -0
- package/lib/component/1d/peaks/usePeakShapesPath.d.ts +13 -0
- package/lib/component/1d/peaks/usePeakShapesPath.js +45 -0
- package/lib/component/1d/ranges/Range.js +4 -4
- package/lib/component/2d/FooterBanner.js +2 -2
- package/lib/component/2d/Viewer2D.js +2 -2
- 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/EventsTrackers/KeysListenerTracker.js +91 -52
- 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/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 +49 -46
- 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/useCheckToolsVisibility.d.ts +10 -1
- package/lib/component/hooks/useCheckToolsVisibility.js +31 -1
- package/lib/component/hooks/useFilter.d.ts +1 -0
- package/lib/component/hooks/useFilter.js +7 -0
- package/lib/component/hooks/useToolsFunctions.js +1 -1
- package/lib/component/loader/DropZone.js +1 -1
- 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 +1 -1
- package/lib/component/modal/editRange/EditRangeModal.js +2 -2
- 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 +13 -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/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/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.js +1 -1
- 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/SpectrumListItem.js +1 -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 +1 -2
- package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +1 -1
- package/lib/component/panels/databasePanel/DatabasePanel.js +4 -12
- 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 +4 -0
- package/lib/component/reducer/Reducer.d.ts +37 -6
- package/lib/component/reducer/Reducer.js +25 -5
- package/lib/component/reducer/actions/FiltersActions.d.ts +13 -7
- package/lib/component/reducer/actions/FiltersActions.js +165 -29
- package/lib/component/reducer/actions/IntegralsActions.js +2 -2
- package/lib/component/reducer/actions/MoleculeActions.js +27 -14
- package/lib/component/reducer/actions/PeaksActions.d.ts +4 -1
- package/lib/component/reducer/actions/PeaksActions.js +38 -5
- package/lib/component/reducer/actions/RangesActions.js +2 -2
- package/lib/component/reducer/actions/SpectrumsActions.js +1 -1
- package/lib/component/reducer/actions/ToolsActions.js +9 -72
- package/lib/component/reducer/helper/getStrongestPeak.d.ts +7 -0
- package/lib/component/reducer/helper/getStrongestPeak.js +14 -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 +7 -0
- package/lib/component/reducer/types/Types.js +7 -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 +2 -2
- package/lib/component/tool/FloatMoleculeStructures/DraggableStructure.js +14 -6
- package/lib/component/tool/FloatMoleculeStructures/index.d.ts +3 -2
- package/lib/component/tool/FloatMoleculeStructures/index.js +13 -6
- package/lib/component/toolbar/BasicToolBar.js +3 -8
- package/lib/component/toolbar/FunctionToolBar.js +11 -23
- package/lib/component/toolbar/ToolTypes.d.ts +7 -1
- package/lib/component/toolbar/ToolTypes.js +119 -9
- package/lib/component/utility/util/nmredata/addZones.js +3 -3
- 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 +4 -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 -1
- package/lib/data/SpectraManager.js +2 -8
- 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 +4 -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 +1 -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/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/migration/MigrationManager.d.ts +1 -1
- package/lib/data/migration/MigrationManager.js +3 -1
- package/lib/data/migration/migrateToVersion3.d.ts +1 -0
- package/lib/data/migration/migrateToVersion3.js +55 -0
- package/lib/data/molecules/Molecule.d.ts +15 -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 +75 -0
- package/lib-cjs/component/1d/Chart1D.js +4 -2
- package/lib-cjs/component/1d/ExclusionZoneAnnotation.js +15 -8
- package/lib-cjs/component/1d/IntegralResizable.js +4 -3
- package/lib-cjs/component/1d/LinesSeries.js +5 -5
- package/lib-cjs/component/1d/Viewer1D.js +7 -12
- 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/multiAnalysis/AnalysisRange.js +15 -13
- package/lib-cjs/component/1d/multiplicityTree/MultiplicityTree.js +1 -2
- package/lib-cjs/component/1d/{PeakAnnotation.js → peaks/PeakAnnotation.js} +8 -9
- package/lib-cjs/component/1d/peaks/PeakAnnotations.js +31 -0
- package/lib-cjs/component/1d/peaks/PeaksShapes.js +40 -0
- package/lib-cjs/component/1d/peaks/usePeakShapesPath.js +49 -0
- package/lib-cjs/component/1d/ranges/Range.js +3 -3
- package/lib-cjs/component/2d/FooterBanner.js +2 -2
- package/lib-cjs/component/2d/Viewer2D.js +2 -2
- package/lib-cjs/component/2d/zones/Signal.js +3 -3
- package/lib-cjs/component/2d/zones/Zone.js +3 -3
- package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +89 -50
- 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/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 +70 -44
- package/lib-cjs/component/header/Zones2DOptionPanel.js +11 -13
- package/lib-cjs/component/highlight/index.js +20 -18
- package/lib-cjs/component/hooks/useCheckToolsVisibility.js +31 -1
- package/lib-cjs/component/hooks/useFilter.js +14 -0
- package/lib-cjs/component/hooks/useToolsFunctions.js +1 -1
- package/lib-cjs/component/loader/DropZone.js +1 -1
- 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 +1 -1
- package/lib-cjs/component/modal/editRange/EditRangeModal.js +2 -2
- 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 +13 -13
- package/lib-cjs/component/modal/setting/WorkspaceItem.js +2 -2
- 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/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 +1 -1
- 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/SpectrumListItem.js +1 -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 +1 -2
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +1 -1
- package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +4 -12
- 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 +4 -0
- package/lib-cjs/component/reducer/Reducer.js +25 -8
- package/lib-cjs/component/reducer/actions/FiltersActions.js +170 -29
- package/lib-cjs/component/reducer/actions/IntegralsActions.js +2 -2
- package/lib-cjs/component/reducer/actions/MoleculeActions.js +27 -14
- package/lib-cjs/component/reducer/actions/PeaksActions.js +40 -4
- package/lib-cjs/component/reducer/actions/RangesActions.js +2 -2
- package/lib-cjs/component/reducer/actions/SpectrumsActions.js +1 -1
- package/lib-cjs/component/reducer/actions/ToolsActions.js +8 -71
- package/lib-cjs/component/reducer/helper/getStrongestPeak.js +18 -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 +10 -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 +12 -4
- package/lib-cjs/component/tool/FloatMoleculeStructures/index.js +13 -6
- package/lib-cjs/component/toolbar/BasicToolBar.js +3 -8
- package/lib-cjs/component/toolbar/FunctionToolBar.js +10 -22
- package/lib-cjs/component/toolbar/ToolTypes.js +119 -9
- package/lib-cjs/component/utility/util/nmredata/addZones.js +3 -6
- 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 +4 -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 +2 -8
- 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 +4 -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 +1 -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/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/migration/MigrationManager.js +3 -1
- package/lib-cjs/data/migration/migrateToVersion3.js +58 -0
- 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 +32 -31
- package/lib/component/1d/PeakAnnotations.js +0 -41
- package/lib/data/data1d/filter1d/lineBroadening.d.ts +0 -14
- package/lib/data/data1d/filter1d/lineBroadening.js +0 -57
- 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/data/data1d/filter1d/lineBroadening.js +0 -63
- package/lib-cjs/data/utilities/generateID.js +0 -12
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { CorrelationData } from 'nmr-correlation';
|
|
3
3
|
import { SpectraAnalysis } from '../../data/data1d/MultipleAnalysis';
|
|
4
|
-
import {
|
|
4
|
+
import { ApodizationOptions } from '../../data/data1d/filter1d/apodization';
|
|
5
|
+
import { FloatingMolecules, StateMoleculeExtended } from '../../data/molecules/Molecule';
|
|
5
6
|
import { Contours } from '../../data/types/data2d/Contours';
|
|
6
7
|
import { UsedColors } from '../../types/UsedColors';
|
|
7
8
|
import { Spectra } from '../NMRium';
|
|
@@ -118,7 +119,14 @@ export interface State {
|
|
|
118
119
|
* molecules
|
|
119
120
|
* @default []
|
|
120
121
|
*/
|
|
121
|
-
molecules: Array<
|
|
122
|
+
molecules: Array<StateMoleculeExtended>;
|
|
123
|
+
/**
|
|
124
|
+
* View related information
|
|
125
|
+
* @default { floatingMolecules: [] };
|
|
126
|
+
*/
|
|
127
|
+
view: {
|
|
128
|
+
floatingMolecules: Array<FloatingMolecules>;
|
|
129
|
+
};
|
|
122
130
|
/**
|
|
123
131
|
* options to control spectra vertical alignment
|
|
124
132
|
* @default {align: 'bottom',value: DEFAULT_YAXIS_SHIFT_VALUE}
|
|
@@ -204,6 +212,7 @@ export interface State {
|
|
|
204
212
|
zones: any[];
|
|
205
213
|
options: any;
|
|
206
214
|
};
|
|
215
|
+
apodizationOptions: ApodizationOptions;
|
|
207
216
|
/**
|
|
208
217
|
* pivot point for manual phase correction
|
|
209
218
|
* @default {value:0,index:0}
|
|
@@ -242,6 +251,14 @@ export interface State {
|
|
|
242
251
|
* @default 0
|
|
243
252
|
*/
|
|
244
253
|
predictionIndex: number;
|
|
254
|
+
/**
|
|
255
|
+
* boolean indicator to hide/show peaks shapes
|
|
256
|
+
* @default false
|
|
257
|
+
*/
|
|
258
|
+
peaksOptions: {
|
|
259
|
+
showPeaksShapes: boolean;
|
|
260
|
+
showPeaksSum: boolean;
|
|
261
|
+
};
|
|
245
262
|
};
|
|
246
263
|
};
|
|
247
264
|
usedColors: UsedColors;
|
|
@@ -670,7 +687,7 @@ export declare const spectrumReducer: (base: {
|
|
|
670
687
|
readonly sum: number | undefined;
|
|
671
688
|
readonly sumAuto: boolean;
|
|
672
689
|
readonly mf?: string | undefined;
|
|
673
|
-
readonly
|
|
690
|
+
readonly moleculeId?: string | undefined;
|
|
674
691
|
};
|
|
675
692
|
};
|
|
676
693
|
readonly ranges: {
|
|
@@ -738,7 +755,7 @@ export declare const spectrumReducer: (base: {
|
|
|
738
755
|
readonly sum: number | undefined;
|
|
739
756
|
readonly sumAuto: boolean;
|
|
740
757
|
readonly mf?: string | undefined;
|
|
741
|
-
readonly
|
|
758
|
+
readonly moleculeId?: string | undefined;
|
|
742
759
|
};
|
|
743
760
|
};
|
|
744
761
|
readonly filters: readonly {
|
|
@@ -936,11 +953,16 @@ export declare const spectrumReducer: (base: {
|
|
|
936
953
|
readonly atoms: {
|
|
937
954
|
readonly [x: string]: number;
|
|
938
955
|
};
|
|
939
|
-
readonly
|
|
956
|
+
readonly id: string;
|
|
940
957
|
readonly molfile: string;
|
|
941
|
-
readonly isFloat: boolean;
|
|
942
958
|
readonly label: string;
|
|
943
959
|
}[];
|
|
960
|
+
readonly view: {
|
|
961
|
+
readonly floatingMolecules: readonly {
|
|
962
|
+
readonly id: string;
|
|
963
|
+
readonly visible: boolean;
|
|
964
|
+
}[];
|
|
965
|
+
};
|
|
944
966
|
readonly verticalAlign: {
|
|
945
967
|
readonly align: VerticalAlignment;
|
|
946
968
|
readonly verticalShift: number;
|
|
@@ -1018,6 +1040,11 @@ export declare const spectrumReducer: (base: {
|
|
|
1018
1040
|
readonly zones: readonly any[];
|
|
1019
1041
|
readonly options: any;
|
|
1020
1042
|
};
|
|
1043
|
+
readonly apodizationOptions: {
|
|
1044
|
+
readonly lineBroadening: number;
|
|
1045
|
+
readonly gaussBroadening: number;
|
|
1046
|
+
readonly lineBroadeningCenter: number;
|
|
1047
|
+
};
|
|
1021
1048
|
readonly pivot: {
|
|
1022
1049
|
readonly value: number;
|
|
1023
1050
|
readonly index: number;
|
|
@@ -1028,6 +1055,10 @@ export declare const spectrumReducer: (base: {
|
|
|
1028
1055
|
readonly showRangesIntegrals: boolean;
|
|
1029
1056
|
readonly showJGraph: boolean;
|
|
1030
1057
|
readonly predictionIndex: number;
|
|
1058
|
+
readonly peaksOptions: {
|
|
1059
|
+
readonly showPeaksShapes: boolean;
|
|
1060
|
+
readonly showPeaksSum: boolean;
|
|
1061
|
+
};
|
|
1031
1062
|
};
|
|
1032
1063
|
};
|
|
1033
1064
|
readonly usedColors: {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { v4 } from '@lukeed/uuid';
|
|
1
2
|
import { produce } from 'immer';
|
|
2
3
|
import { buildCorrelationData } from 'nmr-correlation';
|
|
3
4
|
import { predictSpectra } from '../../data/PredictionManager';
|
|
4
5
|
import * as SpectraManager from '../../data/SpectraManager';
|
|
5
6
|
import { migrate } from '../../data/migration/MigrationManager';
|
|
6
|
-
import generateID from '../../data/utilities/generateID';
|
|
7
7
|
import { DefaultTolerance } from '../panels/SummaryPanel/CorrelationTable/Constants';
|
|
8
8
|
import { options } from '../toolbar/ToolTypes';
|
|
9
9
|
import { nmredataToNmrium } from '../utility/nmredataToNmrium';
|
|
@@ -57,6 +57,7 @@ export const getInitialState = () => ({
|
|
|
57
57
|
activeSpectrum: null,
|
|
58
58
|
mode: 'RTL',
|
|
59
59
|
molecules: [],
|
|
60
|
+
view: { floatingMolecules: [] },
|
|
60
61
|
verticalAlign: {
|
|
61
62
|
align: 'bottom',
|
|
62
63
|
verticalShift: DEFAULT_YAXIS_SHIFT_VALUE,
|
|
@@ -87,6 +88,7 @@ export const getInitialState = () => ({
|
|
|
87
88
|
options: {},
|
|
88
89
|
zones: [],
|
|
89
90
|
},
|
|
91
|
+
apodizationOptions: {},
|
|
90
92
|
pivot: { value: 0, index: 0 },
|
|
91
93
|
zonesNoiseFactor: 1,
|
|
92
94
|
activeFilterID: null,
|
|
@@ -94,13 +96,17 @@ export const getInitialState = () => ({
|
|
|
94
96
|
showRangesIntegrals: true,
|
|
95
97
|
showJGraph: false,
|
|
96
98
|
predictionIndex: 0,
|
|
99
|
+
peaksOptions: {
|
|
100
|
+
showPeaksShapes: false,
|
|
101
|
+
showPeaksSum: false,
|
|
102
|
+
},
|
|
97
103
|
},
|
|
98
104
|
},
|
|
99
105
|
usedColors: { '1d': [], '2d': [] },
|
|
100
106
|
});
|
|
101
107
|
export const initialState = getInitialState();
|
|
102
108
|
export function initState(state) {
|
|
103
|
-
const displayerKey =
|
|
109
|
+
const displayerKey = v4();
|
|
104
110
|
const correlations = buildCorrelationData([], {
|
|
105
111
|
tolerance: DefaultTolerance,
|
|
106
112
|
});
|
|
@@ -194,6 +200,14 @@ function innerSpectrumReducer(draft, action) {
|
|
|
194
200
|
return PeaksActions.addPeaks(draft, action);
|
|
195
201
|
case types.DELETE_PEAK_NOTATION:
|
|
196
202
|
return PeaksActions.deletePeak(draft, action.data);
|
|
203
|
+
case types.AUTO_PEAK_PICKING:
|
|
204
|
+
return PeaksActions.handleAutoPeakPicking(draft, action.options);
|
|
205
|
+
case types.OPTIMIZE_PEAKS:
|
|
206
|
+
return PeaksActions.handleOptimizePeaks(draft, action);
|
|
207
|
+
case types.CHANGE_PEAK_SHAPE:
|
|
208
|
+
return PeaksActions.changePeakShapeHandler(draft, action);
|
|
209
|
+
case types.TOGGLE_PEAKS_SHAPES:
|
|
210
|
+
return PeaksActions.handleShowPeaksShapes(draft, action);
|
|
197
211
|
case types.ADD_INTEGRAL:
|
|
198
212
|
return IntegralsActions.addIntegral(draft, action);
|
|
199
213
|
case types.DELETE_INTEGRAL:
|
|
@@ -226,10 +240,18 @@ function innerSpectrumReducer(draft, action) {
|
|
|
226
240
|
return ToolsActions.setSelectedOptionPanel(draft, action.selectedOptionPanel);
|
|
227
241
|
case types.FULL_ZOOM_OUT:
|
|
228
242
|
return ToolsActions.zoomOut(draft, action);
|
|
243
|
+
case types.DISABLE_FILTER_LIVE_PREVIEW:
|
|
244
|
+
return FiltersActions.handleDisableFilterLivePreview(draft, action);
|
|
229
245
|
case types.SHIFT_SPECTRUM:
|
|
230
246
|
return FiltersActions.shiftSpectrumAlongXAxis(draft, action.shiftValue);
|
|
247
|
+
case types.APPLY_APODIZATION_FILTER:
|
|
248
|
+
return FiltersActions.applyApodizationFilter(draft, action);
|
|
249
|
+
case types.CALCULATE_APODIZATION_FILTER:
|
|
250
|
+
return FiltersActions.calculateApodizationFilter(draft, action);
|
|
231
251
|
case types.APPLY_ZERO_FILLING_FILTER:
|
|
232
|
-
return FiltersActions.applyZeroFillingFilter(draft, action
|
|
252
|
+
return FiltersActions.applyZeroFillingFilter(draft, action);
|
|
253
|
+
case types.CALCULATE_ZERO_FILLING_FILTER:
|
|
254
|
+
return FiltersActions.calculateZeroFillingFilter(draft, action);
|
|
233
255
|
case types.APPLY_FFT_FILTER:
|
|
234
256
|
return FiltersActions.applyFFTFilter(draft);
|
|
235
257
|
case types.APPLY_MANUAL_PHASE_CORRECTION_FILTER:
|
|
@@ -314,8 +336,6 @@ function innerSpectrumReducer(draft, action) {
|
|
|
314
336
|
return ToolsActions.setVerticalIndicatorXPosition(draft, action.position);
|
|
315
337
|
case types.SET_SPECTRUMS_VERTICAL_ALIGN:
|
|
316
338
|
return ToolsActions.setSpectrumsVerticalAlign(draft);
|
|
317
|
-
case types.AUTO_PEAK_PICKING:
|
|
318
|
-
return PeaksActions.handleAutoPeakPicking(draft, action.options);
|
|
319
339
|
case types.AUTO_ZONES_DETECTION:
|
|
320
340
|
return ZonesActions.handleAutoZonesDetection(draft, action.options);
|
|
321
341
|
case types.CHANGE_ZONES_NOISE_FACTOR:
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { Draft } from 'immer';
|
|
2
|
-
import {
|
|
2
|
+
import { State } from '../Reducer';
|
|
3
3
|
declare function shiftSpectrumAlongXAxis(draft: Draft<State>, shiftValue: any): void;
|
|
4
|
-
declare function applyZeroFillingFilter(draft: Draft<State>,
|
|
4
|
+
declare function applyZeroFillingFilter(draft: Draft<State>, action: any): void;
|
|
5
|
+
declare function calculateApodizationFilter(draft: Draft<State>, action: any): void;
|
|
6
|
+
declare function applyApodizationFilter(draft: Draft<State>, action: any): void;
|
|
7
|
+
declare function calculateZeroFillingFilter(draft: Draft<State>, action: any): void;
|
|
5
8
|
declare function applyFFTFilter(draft: Draft<State>): void;
|
|
6
9
|
declare function applyManualPhaseCorrectionFilter(draft: Draft<State>, filterOptions: any): void;
|
|
7
10
|
declare function applyAbsoluteFilter(draft: Draft<State>): void;
|
|
@@ -15,21 +18,24 @@ declare function handleBaseLineCorrectionFilter(draft: Draft<State>, action: any
|
|
|
15
18
|
/**
|
|
16
19
|
* reset spectrum data for specific point of time (Filter)
|
|
17
20
|
* @param {object} draft
|
|
18
|
-
* @param {string} id Filter id
|
|
19
21
|
* @param {object} options
|
|
22
|
+
* @param {string} options.id Filter id
|
|
20
23
|
* @param {boolean=} options.resetTool
|
|
21
24
|
* @param {boolean=} options.updateDomain
|
|
22
25
|
* @param {boolean=} options.rollback
|
|
23
26
|
*/
|
|
24
|
-
declare function resetSpectrumByFilter(draft: any,
|
|
27
|
+
declare function resetSpectrumByFilter(draft: any, options?: {
|
|
25
28
|
rollback?: boolean;
|
|
26
29
|
resetTool?: boolean;
|
|
27
30
|
updateDomain?: boolean;
|
|
28
|
-
|
|
31
|
+
applyFilter?: boolean;
|
|
29
32
|
searchBy?: 'id' | 'name';
|
|
30
|
-
|
|
33
|
+
filterId?: string | null;
|
|
34
|
+
}): any;
|
|
31
35
|
declare function filterSnapshotHandler(draft: Draft<State>, action: any): void;
|
|
32
36
|
declare function handleMultipleSpectraFilter(draft: Draft<State>, action: any): void;
|
|
33
37
|
declare function handleAddExclusionZone(draft: Draft<State>, action: any): void;
|
|
34
38
|
declare function handleDeleteExclusionZone(draft: Draft<State>, action: any): void;
|
|
35
|
-
|
|
39
|
+
declare function handleDisableFilterLivePreview(draft: Draft<State>, action: any): void;
|
|
40
|
+
declare function setFilterChanges(draft: Draft<State>, selectedFilterID: any): void;
|
|
41
|
+
export { shiftSpectrumAlongXAxis, applyZeroFillingFilter, applyApodizationFilter, applyFFTFilter, applyManualPhaseCorrectionFilter, applyAutoPhaseCorrectionFilter, applyAbsoluteFilter, calculateManualPhaseCorrection, calculateBaseLineCorrection, calculateApodizationFilter, calculateZeroFillingFilter, handleMultipleSpectraFilter, enableFilter, deleteFilter, deleteSpectraFilter, handleBaseLineCorrectionFilter, filterSnapshotHandler, resetSpectrumByFilter, handleAddExclusionZone, handleDeleteExclusionZone, handleDisableFilterLivePreview, setFilterChanges, };
|
|
@@ -1,16 +1,20 @@
|
|
|
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';
|
|
13
16
|
import getRange from '../helper/getRange';
|
|
17
|
+
import { getStrongestPeak } from '../helper/getStrongestPeak';
|
|
14
18
|
import { setDomain, setMode } from './DomainActions';
|
|
15
19
|
import { changeSpectrumVerticalAlignment } from './PreferencesActions';
|
|
16
20
|
import { resetSelectedTool } from './ToolsActions';
|
|
@@ -26,14 +30,14 @@ function shiftSpectrumAlongXAxis(draft, shiftValue) {
|
|
|
26
30
|
setDomain(draft);
|
|
27
31
|
}
|
|
28
32
|
}
|
|
29
|
-
function applyZeroFillingFilter(draft,
|
|
33
|
+
function applyZeroFillingFilter(draft, action) {
|
|
30
34
|
if (draft.activeSpectrum?.id) {
|
|
31
35
|
const index = draft.activeSpectrum.index;
|
|
36
|
+
const { size } = action.payload;
|
|
32
37
|
const filters = [
|
|
33
|
-
{ name: Filters.zeroFilling.id, options: filterOptions.zeroFillingSize },
|
|
34
38
|
{
|
|
35
|
-
name: Filters.
|
|
36
|
-
options:
|
|
39
|
+
name: Filters.zeroFilling.id,
|
|
40
|
+
options: size,
|
|
37
41
|
},
|
|
38
42
|
];
|
|
39
43
|
FiltersManager.applyFilter(draft.data[index], filters);
|
|
@@ -42,6 +46,49 @@ function applyZeroFillingFilter(draft, filterOptions) {
|
|
|
42
46
|
setMode(draft);
|
|
43
47
|
}
|
|
44
48
|
}
|
|
49
|
+
function calculateApodizationFilter(draft, action) {
|
|
50
|
+
if (draft.activeSpectrum) {
|
|
51
|
+
const index = draft.activeSpectrum.index;
|
|
52
|
+
const options = action.payload;
|
|
53
|
+
const { data: { x, re, im }, info, } = draft.data[index];
|
|
54
|
+
let _data = { data: { x, re, im }, info };
|
|
55
|
+
draft.toolOptions.data.apodizationOptions = options;
|
|
56
|
+
apodization(_data, options);
|
|
57
|
+
const { im: newIm, re: newRe } = _data.data;
|
|
58
|
+
draft.tempData[index].data.im = newIm;
|
|
59
|
+
draft.tempData[index].data.re = newRe;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
function applyApodizationFilter(draft, action) {
|
|
63
|
+
if (draft.activeSpectrum?.id) {
|
|
64
|
+
const index = draft.activeSpectrum.index;
|
|
65
|
+
const options = action.payload;
|
|
66
|
+
const filters = [
|
|
67
|
+
{
|
|
68
|
+
name: Filters.apodization.id,
|
|
69
|
+
options,
|
|
70
|
+
},
|
|
71
|
+
];
|
|
72
|
+
FiltersManager.applyFilter(draft.data[index], filters);
|
|
73
|
+
resetSelectedTool(draft);
|
|
74
|
+
setDomain(draft);
|
|
75
|
+
setMode(draft);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
function calculateZeroFillingFilter(draft, action) {
|
|
79
|
+
if (draft.activeSpectrum) {
|
|
80
|
+
const index = draft.activeSpectrum.index;
|
|
81
|
+
const { size } = action.payload;
|
|
82
|
+
const { data: { x, re, im }, filters, info, } = draft.data[index];
|
|
83
|
+
let _data = { data: { x, re, im }, filters, info };
|
|
84
|
+
zeroFilling(_data, size);
|
|
85
|
+
const { im: newIm, re: newRe, x: newX } = _data.data;
|
|
86
|
+
draft.tempData[index].data.x = newX;
|
|
87
|
+
draft.tempData[index].data.im = newIm;
|
|
88
|
+
draft.tempData[index].data.re = newRe;
|
|
89
|
+
draft.xDomain = [newX[0], newX[newX.length - 1]];
|
|
90
|
+
}
|
|
91
|
+
}
|
|
45
92
|
function applyFFTFilter(draft) {
|
|
46
93
|
if (draft.activeSpectrum?.id) {
|
|
47
94
|
const { index } = draft.activeSpectrum;
|
|
@@ -190,12 +237,13 @@ function handleBaseLineCorrectionFilter(draft, action) {
|
|
|
190
237
|
if (draft.activeSpectrum?.id) {
|
|
191
238
|
const { index } = draft.activeSpectrum;
|
|
192
239
|
const { zones } = draft.toolOptions.data.baselineCorrection;
|
|
240
|
+
const { livePreview, ...options } = action.options;
|
|
193
241
|
FiltersManager.applyFilter(draft.data[index], [
|
|
194
242
|
{
|
|
195
243
|
name: Filters.baselineCorrection.id,
|
|
196
244
|
options: {
|
|
197
245
|
zones,
|
|
198
|
-
...
|
|
246
|
+
...options,
|
|
199
247
|
},
|
|
200
248
|
},
|
|
201
249
|
]);
|
|
@@ -208,27 +256,26 @@ function handleBaseLineCorrectionFilter(draft, action) {
|
|
|
208
256
|
/**
|
|
209
257
|
* reset spectrum data for specific point of time (Filter)
|
|
210
258
|
* @param {object} draft
|
|
211
|
-
* @param {string} id Filter id
|
|
212
259
|
* @param {object} options
|
|
260
|
+
* @param {string} options.id Filter id
|
|
213
261
|
* @param {boolean=} options.resetTool
|
|
214
262
|
* @param {boolean=} options.updateDomain
|
|
215
263
|
* @param {boolean=} options.rollback
|
|
216
264
|
*/
|
|
217
|
-
function resetSpectrumByFilter(draft,
|
|
218
|
-
const { updateDomain = true, rollback = false, searchBy = 'id',
|
|
265
|
+
function resetSpectrumByFilter(draft, options) {
|
|
266
|
+
const { updateDomain = true, rollback = false, searchBy = 'id', applyFilter = false, // the filter that we rollback and return the affect data for the selected spectrum
|
|
267
|
+
filterId, } = options || {};
|
|
219
268
|
let currentDatum = null;
|
|
220
|
-
const currentActiveSpectrum = activeSpectrum
|
|
221
|
-
? activeSpectrum
|
|
222
|
-
: draft.activeSpectrum;
|
|
269
|
+
const currentActiveSpectrum = draft.activeSpectrum;
|
|
223
270
|
if (currentActiveSpectrum?.id) {
|
|
224
271
|
const index = currentActiveSpectrum.index;
|
|
225
272
|
const datum = draft.data[index];
|
|
226
|
-
if (
|
|
227
|
-
const filterIndex = datum.filters.findIndex((f) => f[searchBy] ===
|
|
273
|
+
if (filterId && draft.toolOptions.data.activeFilterID !== filterId) {
|
|
274
|
+
const filterIndex = datum.filters.findIndex((f) => f[searchBy] === filterId);
|
|
228
275
|
let filters = [];
|
|
229
276
|
if (filterIndex !== -1) {
|
|
230
277
|
filters = datum.filters.slice(0, rollback ? filterIndex : filterIndex + 1);
|
|
231
|
-
if (filters.length
|
|
278
|
+
if (filters.length >= 1) {
|
|
232
279
|
draft.toolOptions.data.activeFilterID =
|
|
233
280
|
datum.filters[rollback ? filterIndex - 1 : filterIndex]?.id;
|
|
234
281
|
}
|
|
@@ -236,7 +283,7 @@ function resetSpectrumByFilter(draft, id = null, options = {}, activeSpectrum =
|
|
|
236
283
|
draft.toolOptions.data.activeFilterID = null;
|
|
237
284
|
}
|
|
238
285
|
FiltersManager.reapplyFilters(datum, filters);
|
|
239
|
-
if (
|
|
286
|
+
if (applyFilter) {
|
|
240
287
|
const { name, value: options } = datum.filters[filterIndex];
|
|
241
288
|
const newDatum = current(draft).data[index];
|
|
242
289
|
if (newDatum.info?.dimension === 1) {
|
|
@@ -262,12 +309,13 @@ function resetSpectrumByFilter(draft, id = null, options = {}, activeSpectrum =
|
|
|
262
309
|
setMode(draft);
|
|
263
310
|
}
|
|
264
311
|
}
|
|
265
|
-
if (
|
|
312
|
+
if (applyFilter) {
|
|
266
313
|
return currentDatum;
|
|
267
314
|
}
|
|
268
315
|
}
|
|
269
316
|
function filterSnapshotHandler(draft, action) {
|
|
270
|
-
|
|
317
|
+
const { filterId } = action.payload;
|
|
318
|
+
resetSpectrumByFilter(draft, { filterId });
|
|
271
319
|
}
|
|
272
320
|
function handleMultipleSpectraFilter(draft, action) {
|
|
273
321
|
const spectra = getSpectraByNucleus(draft.activeTab, draft.data);
|
|
@@ -306,7 +354,7 @@ function handleAddExclusionZone(draft, action) {
|
|
|
306
354
|
name: Filters.exclusionZones.id,
|
|
307
355
|
options: [
|
|
308
356
|
{
|
|
309
|
-
id:
|
|
357
|
+
id: v4(),
|
|
310
358
|
from: range[0],
|
|
311
359
|
to: range[1],
|
|
312
360
|
},
|
|
@@ -317,17 +365,105 @@ function handleAddExclusionZone(draft, action) {
|
|
|
317
365
|
setDomain(draft);
|
|
318
366
|
}
|
|
319
367
|
function handleDeleteExclusionZone(draft, action) {
|
|
320
|
-
const {
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
368
|
+
const { zone, spectrumID } = action.payload;
|
|
369
|
+
// if spectrum id exists, remove the selected exclusive zone in the spectrum
|
|
370
|
+
if (spectrumID) {
|
|
371
|
+
const spectrumIndex = draft.data.findIndex((spectrum) => spectrum.id === spectrumID);
|
|
372
|
+
const filter = draft.data[spectrumIndex].filters.find((_filter) => _filter.name === Filters.exclusionZones.id);
|
|
373
|
+
if (filter) {
|
|
374
|
+
if (filter.value.length === 1) {
|
|
375
|
+
FiltersManager.deleteFilter(draft.data[spectrumIndex], filter.id);
|
|
376
|
+
}
|
|
377
|
+
else {
|
|
378
|
+
filter.value = filter.value.filter((_zone) => _zone.id !== zone?.id);
|
|
379
|
+
FiltersManager.reapplyFilters(draft.data[spectrumIndex]);
|
|
380
|
+
}
|
|
326
381
|
}
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
382
|
+
}
|
|
383
|
+
else {
|
|
384
|
+
// remove all exclusive zone that have the same range in all spectra
|
|
385
|
+
const data = getSpectraByNucleus(draft.activeTab, draft.data);
|
|
386
|
+
for (const datum of data) {
|
|
387
|
+
for (const filter of datum.filters) {
|
|
388
|
+
if (filter.name === Filters.exclusionZones.id) {
|
|
389
|
+
filter.value = filter.value.filter((_zone) => zone.from !== _zone.from && zone.to !== _zone.to);
|
|
390
|
+
FiltersManager.reapplyFilters(datum);
|
|
391
|
+
}
|
|
392
|
+
}
|
|
330
393
|
}
|
|
331
394
|
}
|
|
332
395
|
}
|
|
333
|
-
|
|
396
|
+
function handleDisableFilterLivePreview(draft, action) {
|
|
397
|
+
const { selectedTool } = action.payload;
|
|
398
|
+
setFilterChanges(draft, selectedTool);
|
|
399
|
+
if (selectedTool === options.zeroFilling.id) {
|
|
400
|
+
setDomain(draft, { yDomain: { isChanged: false } });
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
function checkFilterHasTempData(selectedToolId) {
|
|
404
|
+
return [
|
|
405
|
+
options.phaseCorrection.id,
|
|
406
|
+
options.baselineCorrection.id,
|
|
407
|
+
options.apodization.id,
|
|
408
|
+
options.zeroFilling.id,
|
|
409
|
+
].includes(selectedToolId);
|
|
410
|
+
}
|
|
411
|
+
function setFilterChanges(draft, selectedFilterID) {
|
|
412
|
+
const activeSpectrumId = draft.activeSpectrum?.id;
|
|
413
|
+
// 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
|
|
414
|
+
if (checkFilterHasTempData(selectedFilterID)) {
|
|
415
|
+
//return back the spectra data to point of time before applying a specific filter
|
|
416
|
+
const isPhaseCorrection = selectedFilterID === options.phaseCorrection.id;
|
|
417
|
+
const updateDomain = [
|
|
418
|
+
options.zeroFilling.id,
|
|
419
|
+
options.apodization.id,
|
|
420
|
+
].includes(selectedFilterID);
|
|
421
|
+
const rollbackSpectrumData = resetSpectrumByFilter(draft, {
|
|
422
|
+
updateDomain,
|
|
423
|
+
rollback: true,
|
|
424
|
+
searchBy: 'name',
|
|
425
|
+
filterId: selectedFilterID,
|
|
426
|
+
applyFilter: isPhaseCorrection,
|
|
427
|
+
});
|
|
428
|
+
// create a temporary clone of the data
|
|
429
|
+
draft.tempData = current(draft).data;
|
|
430
|
+
if (rollbackSpectrumData) {
|
|
431
|
+
draft.tempData[rollbackSpectrumData?.index] = rollbackSpectrumData?.datum;
|
|
432
|
+
}
|
|
433
|
+
switch (selectedFilterID) {
|
|
434
|
+
case options.phaseCorrection.id: {
|
|
435
|
+
// look for the strongest peak to set it as a pivot
|
|
436
|
+
const { xValue, index } = getStrongestPeak(draft) || {
|
|
437
|
+
xValue: 0,
|
|
438
|
+
index: 0,
|
|
439
|
+
};
|
|
440
|
+
draft.toolOptions.data.pivot = { value: xValue, index };
|
|
441
|
+
break;
|
|
442
|
+
}
|
|
443
|
+
case options.baselineCorrection.id: {
|
|
444
|
+
if (draft.activeSpectrum?.id) {
|
|
445
|
+
const baselineCorrectionFilter = current(draft).data[draft.activeSpectrum.index].filters.find((filter) => filter.name === options.baselineCorrection.id);
|
|
446
|
+
if (baselineCorrectionFilter) {
|
|
447
|
+
draft.toolOptions.data.baselineCorrection.zones =
|
|
448
|
+
baselineCorrectionFilter
|
|
449
|
+
? baselineCorrectionFilter.value.zones
|
|
450
|
+
: [];
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
break;
|
|
454
|
+
}
|
|
455
|
+
case options.apodization.id: {
|
|
456
|
+
draft.toolOptions.data.apodizationOptions = defaultApodizationOptions;
|
|
457
|
+
break;
|
|
458
|
+
}
|
|
459
|
+
default:
|
|
460
|
+
break;
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
else if (checkFilterHasTempData(draft.toolOptions.selectedTool)) {
|
|
464
|
+
draft.toolOptions.data.activeFilterID = null;
|
|
465
|
+
const spectrumIndex = draft.data.findIndex((spectrum) => spectrum.id === activeSpectrumId);
|
|
466
|
+
draft.data[spectrumIndex].data = draft.tempData[spectrumIndex].data;
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
export { shiftSpectrumAlongXAxis, applyZeroFillingFilter, applyApodizationFilter, applyFFTFilter, applyManualPhaseCorrectionFilter, applyAutoPhaseCorrectionFilter, applyAbsoluteFilter, calculateManualPhaseCorrection, calculateBaseLineCorrection, calculateApodizationFilter, calculateZeroFillingFilter, handleMultipleSpectraFilter, enableFilter, deleteFilter, deleteSpectraFilter, handleBaseLineCorrectionFilter, filterSnapshotHandler, resetSpectrumByFilter, handleAddExclusionZone, handleDeleteExclusionZone, handleDisableFilterLivePreview, setFilterChanges, };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { v4 } from '@lukeed/uuid';
|
|
1
2
|
import { original } from 'immer';
|
|
2
3
|
import { xyIntegration } from 'ml-spectra-processing';
|
|
3
4
|
import { updateIntegralsRelativeValues, changeIntegralsRelative, getShiftX, } from '../../../data/data1d/Spectrum1D';
|
|
4
5
|
import { initSumOptions, setSumOptions, } from '../../../data/data1d/Spectrum1D/SumManager';
|
|
5
|
-
import generateID from '../../../data/utilities/generateID';
|
|
6
6
|
import getRange from '../helper/getRange';
|
|
7
7
|
import { setIntegralsYDomain } from './DomainActions';
|
|
8
8
|
function handleChangeIntegralSum(draft, options) {
|
|
@@ -23,7 +23,7 @@ function addIntegral(draft, action) {
|
|
|
23
23
|
const { x, re } = datum.data;
|
|
24
24
|
const shiftX = getShiftX(datum);
|
|
25
25
|
const integral = {
|
|
26
|
-
id:
|
|
26
|
+
id: v4(),
|
|
27
27
|
originFrom: from - shiftX,
|
|
28
28
|
originTo: to - shiftX,
|
|
29
29
|
from,
|
|
@@ -16,17 +16,21 @@ function addMoleculeHandler(draft, molfile) {
|
|
|
16
16
|
*/
|
|
17
17
|
const molecule = draft.molecules[0] || null;
|
|
18
18
|
if (isEmpty && molecule) {
|
|
19
|
-
changeSpectraRelativeSum(draft, molecule.
|
|
19
|
+
changeSpectraRelativeSum(draft, molecule.id, molecule);
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
function setMoleculeHandler(draft, action) {
|
|
23
|
-
const {
|
|
24
|
-
MoleculeManager.setMolfile(draft.molecules, {
|
|
23
|
+
const { id, label, molfile } = action.payload;
|
|
24
|
+
MoleculeManager.setMolfile(draft.molecules, {
|
|
25
|
+
id,
|
|
26
|
+
label,
|
|
27
|
+
molfile,
|
|
28
|
+
});
|
|
25
29
|
/**
|
|
26
30
|
* update all spectra that its sum was based on this molecule with the new molecule
|
|
27
31
|
*/
|
|
28
|
-
const index = draft.molecules.findIndex((molecule) => molecule.
|
|
29
|
-
changeSpectraRelativeSum(draft,
|
|
32
|
+
const index = draft.molecules.findIndex((molecule) => molecule.id === id);
|
|
33
|
+
changeSpectraRelativeSum(draft, id, index !== -1 ? draft.molecules[index] : draft.molecules[0] || null);
|
|
30
34
|
}
|
|
31
35
|
function removeAssignments(draft, assignmentData) {
|
|
32
36
|
if (draft.displayerMode === DISPLAYER_MODE.DM_1D) {
|
|
@@ -37,16 +41,20 @@ function removeAssignments(draft, assignmentData) {
|
|
|
37
41
|
}
|
|
38
42
|
}
|
|
39
43
|
function deleteMoleculeHandler(draft, action) {
|
|
40
|
-
const {
|
|
44
|
+
const { id, assignmentData } = action.payload;
|
|
41
45
|
// remove Assignments links of the active spectrum
|
|
42
46
|
removeAssignments(draft, assignmentData);
|
|
43
|
-
const moleculeIndex = draft.molecules.findIndex((molecule) => molecule.
|
|
47
|
+
const moleculeIndex = draft.molecules.findIndex((molecule) => molecule.id === id);
|
|
44
48
|
draft.molecules.splice(moleculeIndex, 1);
|
|
49
|
+
const floatingMoleculesIndex = draft.view.floatingMolecules.findIndex((m) => m.id === id);
|
|
50
|
+
if (floatingMoleculesIndex !== -1) {
|
|
51
|
+
draft.view.floatingMolecules.splice(floatingMoleculesIndex, 1);
|
|
52
|
+
}
|
|
45
53
|
/**
|
|
46
54
|
* update all spectra that its sum was based on this molecule with the first molecule
|
|
47
55
|
* from molecules list and if no remains molecules it sum will be 100
|
|
48
56
|
*/
|
|
49
|
-
changeSpectraRelativeSum(draft,
|
|
57
|
+
changeSpectraRelativeSum(draft, id, draft.molecules[0] || null);
|
|
50
58
|
}
|
|
51
59
|
function predictSpectraFromMoleculeHandler(draft, action) {
|
|
52
60
|
const { data, options } = action.payload;
|
|
@@ -69,14 +77,19 @@ function predictSpectraFromMoleculeHandler(draft, action) {
|
|
|
69
77
|
draft.isLoading = false;
|
|
70
78
|
}
|
|
71
79
|
function floatMoleculeOverSpectrum(draft, action) {
|
|
72
|
-
const {
|
|
73
|
-
const moleculeIndex = draft.
|
|
74
|
-
|
|
75
|
-
|
|
80
|
+
const { id } = action.payload;
|
|
81
|
+
const moleculeIndex = draft.view.floatingMolecules.findIndex((m) => m.id === id);
|
|
82
|
+
if (moleculeIndex !== -1) {
|
|
83
|
+
draft.view.floatingMolecules[moleculeIndex].visible =
|
|
84
|
+
!draft.view.floatingMolecules[moleculeIndex].visible;
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
draft.view.floatingMolecules.push({ id, visible: true });
|
|
88
|
+
}
|
|
76
89
|
}
|
|
77
90
|
function changeMoleculeLabel(draft, action) {
|
|
78
|
-
const {
|
|
79
|
-
const moleculeIndex = draft.molecules.findIndex((molecule) => molecule.
|
|
91
|
+
const { id, label } = action.payload;
|
|
92
|
+
const moleculeIndex = draft.molecules.findIndex((molecule) => molecule.id === id);
|
|
80
93
|
draft.molecules[moleculeIndex].label = label;
|
|
81
94
|
}
|
|
82
95
|
export { addMoleculeHandler, setMoleculeHandler, deleteMoleculeHandler, predictSpectraFromMoleculeHandler, floatMoleculeOverSpectrum, changeMoleculeLabel, };
|
|
@@ -3,5 +3,8 @@ import { State } from '../Reducer';
|
|
|
3
3
|
declare function addPeak(draft: Draft<State>, mouseCoordinates: any): void;
|
|
4
4
|
declare function addPeaks(draft: Draft<State>, action: any): void;
|
|
5
5
|
declare function deletePeak(draft: Draft<State>, peakData: any): void;
|
|
6
|
+
declare function handleOptimizePeaks(draft: Draft<State>, action: any): void;
|
|
6
7
|
declare function handleAutoPeakPicking(draft: Draft<State>, autOptions: any): void;
|
|
7
|
-
|
|
8
|
+
declare function changePeakShapeHandler(draft: Draft<State>, action: any): void;
|
|
9
|
+
declare function handleShowPeaksShapes(draft: Draft<State>, action: any): void;
|
|
10
|
+
export { addPeak, addPeaks, deletePeak, handleAutoPeakPicking, handleOptimizePeaks, changePeakShapeHandler, handleShowPeaksShapes, };
|