nmrium 0.38.1 → 0.39.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/component/1d/ApodizationLine.js +27 -4
- package/lib/component/1d/ExclusionZoneAnnotation.js +1 -1
- package/lib/component/1d/ExclusionZonesAnnotations.js +1 -1
- package/lib/component/1d/FooterBanner.js +5 -5
- package/lib/component/1d/SpectraLegends.js +2 -3
- package/lib/component/1d/Viewer1D.js +1 -1
- package/lib/component/1d/integral/Integral.d.ts +1 -1
- package/lib/component/1d/integral/IntegralResizable.d.ts +1 -1
- package/lib/component/1d/jCouplingGraph/JsCouplings.d.ts +1 -1
- package/lib/component/1d/multiAnalysis/MultiAnalysisRanges.js +2 -2
- package/lib/component/1d/multiplicityTree/LevelNode.d.ts +1 -1
- package/lib/component/1d/multiplicityTree/MultiplicityTree.d.ts +1 -1
- package/lib/component/1d/multiplicityTree/StringNode.d.ts +1 -1
- package/lib/component/1d/multiplicityTree/buildTreeNode.d.ts +1 -1
- package/lib/component/1d/peaks/usePeakShapesPath.d.ts +2 -1
- package/lib/component/1d/ranges/Range.d.ts +1 -1
- package/lib/component/1d/tool/PeakPointer.js +6 -6
- package/lib/component/1d/tool/XLabelPointer.js +5 -5
- package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.d.ts +1 -1
- package/lib/component/1d-2d/components/FloatMoleculeStructures/index.d.ts +1 -1
- package/lib/component/1d-2d/tools/BrushX.js +2 -3
- package/lib/component/1d-2d/tools/BrushXY.js +2 -3
- package/lib/component/1d-2d/tools/CrossLinePointer.js +4 -5
- package/lib/component/2d/Chart2D.js +4 -4
- package/lib/component/2d/FooterBanner.js +5 -5
- package/lib/component/2d/Viewer2D.js +1 -1
- package/lib/component/2d/tools/XYLabelPointer.js +5 -5
- package/lib/component/2d/zones/Signal.d.ts +1 -1
- package/lib/component/2d/zones/SignalCrosshair.d.ts +1 -1
- package/lib/component/2d/zones/Zone.d.ts +1 -1
- package/lib/component/EventsTrackers/BrushTracker.d.ts +20 -12
- package/lib/component/EventsTrackers/BrushTracker.js +35 -22
- package/lib/component/EventsTrackers/KeysListenerTracker.js +90 -67
- package/lib/component/EventsTrackers/MouseTracker.d.ts +6 -2
- package/lib/component/EventsTrackers/MouseTracker.js +4 -1
- package/lib/component/NMRium.d.ts +5 -5
- package/lib/component/NMRium.js +15 -16
- package/lib/component/assignment/AssignmentsReducer.d.ts +2 -2
- package/lib/component/context/LoggerContext.js +5 -0
- package/lib/component/context/PreferencesContext.d.ts +10 -8
- package/lib/component/elements/Button.d.ts +13 -11
- package/lib/component/elements/Button.js +16 -25
- package/lib/component/elements/ColorInput.d.ts +0 -1
- package/lib/component/elements/ColorInput.js +2 -2
- package/lib/component/elements/EditableColumn.js +5 -2
- package/lib/component/elements/Input.js +2 -4
- package/lib/component/elements/Label.d.ts +1 -0
- package/lib/component/elements/Label.js +2 -2
- package/lib/component/elements/MolecularFormulaInput.d.ts +2 -2
- package/lib/component/elements/MolecularFormulaInput.js +15 -18
- package/lib/component/elements/NextPrev.d.ts +5 -3
- package/lib/component/elements/NextPrev.js +26 -8
- package/lib/component/elements/NumberInput.js +2 -2
- package/lib/component/elements/ReactTable/ReactTable.js +4 -4
- package/lib/component/elements/formik/FormikCheckBox.d.ts +2 -1
- package/lib/component/elements/formik/FormikCheckBox.js +2 -2
- package/lib/component/elements/formik/FormikColumnFormatField.d.ts +4 -0
- package/lib/component/elements/formik/FormikColumnFormatField.js +19 -16
- package/lib/component/elements/formik/FormikError.d.ts +8 -0
- package/lib/component/elements/formik/FormikError.js +22 -0
- package/lib/component/elements/formik/FormikInput.js +10 -6
- package/lib/component/elements/formik/FormikSelect.js +1 -1
- package/lib/component/header/ApodizationOptionsPanel.js +4 -3
- package/lib/component/header/AutoPeakPickingOptionPanel.js +16 -7
- package/lib/component/header/BaseLineCorrectionPanel.js +5 -2
- package/lib/component/header/PhaseCorrectionPanel.js +5 -2
- package/lib/component/header/RangesPickingOptionPanel.js +15 -7
- package/lib/component/header/ZeroFillingOptionsPanel.js +1 -1
- package/lib/component/highlight/index.d.ts +1 -1
- package/lib/component/hooks/useActiveSpectra.d.ts +1 -1
- package/lib/component/hooks/useActiveSpectrum.d.ts +1 -1
- package/lib/component/hooks/useActiveSpectrumPeaksViewState.d.ts +1 -1
- package/lib/component/hooks/useCheckPointsNumberInWindowArea.d.ts +2 -0
- package/lib/component/hooks/useCheckPointsNumberInWindowArea.js +17 -0
- package/lib/component/hooks/useCheckToolsVisibility.d.ts +2 -2
- package/lib/component/hooks/useDatumWithSpectraStatistics.d.ts +3 -2
- package/lib/component/hooks/useExport.js +1 -1
- package/lib/component/hooks/useFilter.d.ts +2 -1
- package/lib/component/hooks/usePanelPreferences.d.ts +3 -3
- package/lib/component/hooks/usePanelPreferences.js +4 -0
- package/lib/component/hooks/useSaveSettings.d.ts +1 -1
- package/lib/component/hooks/useSaveSettings.js +17 -15
- package/lib/component/hooks/useVerticalAlign.d.ts +1 -1
- package/lib/component/loader/DropZone.js +1 -2
- package/lib/component/modal/EditPeakShapeModal.d.ts +2 -2
- package/lib/component/modal/LoadJCAMPModal.d.ts +3 -3
- package/lib/component/modal/LoadJCAMPModal.js +56 -74
- package/lib/component/modal/ModalStyle.js +0 -10
- package/lib/component/modal/MoleculeStructureEditorModal.d.ts +2 -1
- package/lib/component/modal/MoleculeStructureEditorModal.js +12 -6
- package/lib/component/modal/MultipletAnalysisModal.d.ts +2 -2
- package/lib/component/modal/PredictSpectraModal.d.ts +4 -2
- package/lib/component/modal/PredictSpectraModal.js +53 -105
- package/lib/component/modal/SaveAsModal.d.ts +2 -0
- package/lib/component/modal/SaveAsModal.js +21 -14
- package/lib/component/modal/changeSum/ChangeSumModal.js +25 -38
- package/lib/component/modal/editRange/EditRangeModal.d.ts +7 -6
- package/lib/component/modal/editRange/EditRangeModal.js +33 -13
- package/lib/component/modal/editRange/forms/components/AddSignalFormTab.d.ts +1 -1
- package/lib/component/modal/editRange/forms/components/DeltaInput.js +2 -0
- package/lib/component/modal/editRange/forms/components/SignalsForm.d.ts +2 -2
- package/lib/component/modal/metaImportation/MetaImportationModal.js +15 -5
- package/lib/component/modal/setting/GeneralSettings.js +2 -7
- package/lib/component/modal/setting/settings-tabs/DatabasesTabContent.d.ts +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralPanel.d.ts +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralTable.d.ts +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralsPreferences.js +7 -15
- package/lib/component/panels/MoleculesPanel/MoleculeHeader.js +2 -2
- package/lib/component/panels/MoleculesPanel/MoleculePanel.d.ts +1 -11
- package/lib/component/panels/MoleculesPanel/MoleculePanel.js +20 -25
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.d.ts +6 -11
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +71 -81
- package/lib/component/panels/MoleculesPanel/Utilities.d.ts +1 -1
- package/lib/component/panels/MoleculesPanel/Utilities.js +3 -1
- package/lib/component/panels/MultipleSpectraAnalysisPanel/base/AnalysisColumnHeader.js +6 -6
- package/lib/component/panels/MultipleSpectraAnalysisPanel/preferences/AnalysisTablePreferences.js +2 -2
- package/lib/component/panels/MultipleSpectraAnalysisPanel/preferences/index.js +2 -2
- package/lib/component/panels/Panels.js +2 -2
- package/lib/component/panels/PeaksPanel/PeaksPanel.d.ts +1 -1
- package/lib/component/panels/RangesPanel/RangesHeader.js +39 -53
- package/lib/component/panels/RangesPanel/RangesPreferences.d.ts +1 -1
- package/lib/component/panels/RangesPanel/RangesPreferences.js +7 -22
- package/lib/component/panels/RangesPanel/RangesTable.d.ts +2 -2
- package/lib/component/panels/RangesPanel/RangesTableRow.d.ts +2 -2
- package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaHzColumn.d.ts +1 -1
- package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.d.ts +1 -1
- package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.js +9 -12
- package/lib/component/panels/RangesPanel/hooks/useMapRanges.d.ts +1 -1
- package/lib/component/panels/SpectrumsPanel/SpectraTable.js +5 -1
- package/lib/component/panels/SpectrumsPanel/base/SpectraColumnsManager.js +10 -4
- package/lib/component/panels/SpectrumsPanel/base/setting/processSnapPlot.d.ts +2 -2
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +1 -1
- package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +1 -1
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/EditPathLength.d.ts +1 -1
- package/lib/component/panels/ZonesPanel/hooks/useMapZones.d.ts +1 -1
- package/lib/component/panels/databasePanel/DatabasePanel.d.ts +1 -1
- package/lib/component/panels/databasePanel/DatabasePanel.js +5 -24
- package/lib/component/panels/databasePanel/DatabasePreferences.js +2 -2
- package/lib/component/panels/header/DefaultPanelHeader.d.ts +2 -3
- package/lib/component/panels/header/DefaultPanelHeader.js +18 -26
- package/lib/component/panels/header/PanelHeader.d.ts +7 -0
- package/lib/component/panels/header/PanelHeader.js +12 -0
- package/lib/component/panels/predictionPanel/PredictionOptionsPanel.d.ts +9 -0
- package/lib/component/panels/predictionPanel/PredictionOptionsPanel.js +94 -0
- package/lib/component/panels/predictionPanel/PredictionPanel.d.ts +1 -1
- package/lib/component/panels/predictionPanel/PredictionPanel.js +109 -37
- package/lib/component/panels/predictionPanel/PredictionPreferences.d.ts +3 -0
- package/lib/component/panels/predictionPanel/PredictionPreferences.js +24 -0
- package/lib/component/panels/predictionPanel/PredictionSimpleOptions.d.ts +2 -0
- package/lib/component/panels/predictionPanel/PredictionSimpleOptions.js +44 -0
- package/lib/component/reducer/Reducer.d.ts +5 -87
- package/lib/component/reducer/Reducer.js +1 -29
- package/lib/component/reducer/actions/DatabaseActions.js +6 -4
- package/lib/component/reducer/actions/DomainActions.js +3 -0
- package/lib/component/reducer/actions/FiltersActions.d.ts +1 -2
- package/lib/component/reducer/actions/FiltersActions.js +47 -52
- package/lib/component/reducer/actions/HistoryActions.d.ts +4 -0
- package/lib/component/reducer/actions/HistoryActions.js +40 -0
- package/lib/component/reducer/actions/IntegralsActions.d.ts +1 -1
- package/lib/component/reducer/actions/IntegralsActions.js +3 -1
- package/lib/component/reducer/actions/LoadActions.d.ts +1 -2
- package/lib/component/reducer/actions/LoadActions.js +1 -1
- package/lib/component/reducer/actions/MoleculeActions.d.ts +7 -4
- package/lib/component/reducer/actions/MoleculeActions.js +57 -28
- package/lib/component/reducer/actions/PeaksActions.d.ts +1 -2
- package/lib/component/reducer/actions/PeaksActions.js +3 -3
- package/lib/component/reducer/actions/RangesActions.d.ts +4 -5
- package/lib/component/reducer/actions/RangesActions.js +5 -27
- package/lib/component/reducer/actions/SpectrumsActions.js +8 -8
- package/lib/component/reducer/actions/ToolsActions.d.ts +2 -2
- package/lib/component/reducer/actions/ToolsActions.js +3 -32
- package/lib/component/reducer/actions/ZonesActions.d.ts +2 -1
- package/lib/component/reducer/actions/ZonesActions.js +3 -6
- package/lib/component/reducer/helper/ZoomHistoryManager.d.ts +8 -0
- package/lib/component/reducer/helper/ZoomHistoryManager.js +35 -0
- package/lib/component/reducer/helper/getActiveSpectra.d.ts +1 -1
- package/lib/component/reducer/helper/getActiveSpectrum.d.ts +1 -1
- package/lib/component/reducer/helper/getVerticalAlign.d.ts +1 -1
- package/lib/component/reducer/preferences/actions/addWorkspace.js +2 -2
- package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.d.ts +1 -1
- package/lib/component/reducer/preferences/preferencesReducer.d.ts +3 -3
- package/lib/component/reducer/preferences/utilities/getActiveWorkspace.d.ts +1 -1
- package/lib/component/reducer/preferences/utilities/getPreferencesByWorkspace.d.ts +2 -3
- package/lib/component/reducer/preferences/utilities/initWorkspace.d.ts +1 -1
- package/lib/component/reducer/preferences/utilities/mapNucleiFormatting.d.ts +1 -1
- package/lib/component/reducer/preferences/utilities/mapWorkspaces.d.ts +1 -1
- package/lib/component/toolbar/BasicToolBar.js +6 -11
- package/lib/component/toolbar/ToolTypes.d.ts +2 -2
- package/lib/component/toolbar/ToolTypes.js +1 -1
- package/lib/component/workspaces/assignment.d.ts +1 -1
- package/lib/component/workspaces/basic.d.ts +1 -1
- package/lib/component/workspaces/embedded.d.ts +1 -1
- package/lib/component/workspaces/exercise.d.ts +1 -1
- package/lib/component/workspaces/index.d.ts +6 -6
- package/lib/component/workspaces/prediction.d.ts +1 -1
- package/lib/component/workspaces/prediction.js +193 -0
- package/lib/component/workspaces/process1D.d.ts +1 -1
- package/lib/component/workspaces/workspaceDefaultProperties.d.ts +1 -1
- package/lib/component/workspaces/workspaceDefaultProperties.js +1 -1
- package/lib/data/PredictionManager.d.ts +3 -1
- package/lib/data/PredictionManager.js +43 -3
- package/lib/data/SpectraManager.d.ts +1 -2
- package/lib/data/constants/DefaultApodizationOptions.d.ts +2 -0
- package/lib/data/constants/DefaultApodizationOptions.js +5 -0
- package/lib/data/data1d/Spectrum1D/SumManager.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/convertDataToFloat64Array.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/generateJGraphData.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/generateSpectrumFromPublicationString.d.ts +1 -2
- package/lib/data/data1d/Spectrum1D/index.d.ts +1 -5
- package/lib/data/data1d/Spectrum1D/index.js +1 -5
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +3 -3
- package/lib/data/data1d/Spectrum1D/integrals/initiateIntegrals.d.ts +3 -2
- package/lib/data/data1d/Spectrum1D/integrals/initiateIntegrals.js +1 -1
- package/lib/data/data1d/Spectrum1D/isRangeAssigned.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.d.ts +2 -1
- package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +1 -2
- package/lib/data/data1d/Spectrum1D/peaks/initiatePeaks.d.ts +3 -2
- package/lib/data/data1d/Spectrum1D/peaks/initiatePeaks.js +1 -1
- package/lib/data/data1d/Spectrum1D/peaks/lookupPeak.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.d.ts +2 -1
- package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.js +1 -2
- package/lib/data/data1d/Spectrum1D/ranges/addRange.d.ts +7 -7
- package/lib/data/data1d/Spectrum1D/ranges/addRange.js +5 -24
- package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.d.ts +2 -1
- package/lib/data/data1d/Spectrum1D/ranges/changeRange.d.ts +2 -1
- package/lib/data/data1d/Spectrum1D/ranges/changeRange.js +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/checkRangeKind.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectRange.js +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectRanges.js +1 -2
- package/lib/data/data1d/Spectrum1D/ranges/detectSignal.js +13 -6
- package/lib/data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges.js +23 -18
- package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.d.ts +37 -2
- package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.js +1 -1
- package/lib/data/data1d/database.js +2 -4
- package/lib/data/data1d/multipleSpectraAnalysis.d.ts +3 -30
- package/lib/data/data1d/multipleSpectraAnalysis.js +4 -15
- package/lib/data/data2d/Spectrum2D/getMissingProjection.d.ts +3 -2
- package/lib/data/data2d/Spectrum2D/getShift.js +1 -1
- package/lib/data/data2d/Spectrum2D/getSlice.d.ts +1 -1
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +1 -1
- package/lib/data/data2d/Spectrum2D/zones/detectZones.d.ts +1 -1
- package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.d.ts +1 -1
- package/lib/data/data2d/Spectrum2D/zones/initiateZones.d.ts +3 -2
- package/lib/data/data2d/Spectrum2D/zones/isZoneExists.d.ts +2 -1
- package/lib/data/data2d/Spectrum2D/zones/mapZones.d.ts +3 -2
- package/lib/data/getDefaultMatrixFilters.d.ts +1 -1
- package/lib/data/types/data1d/ComplexData1D.d.ts +2 -2
- package/lib/data/types/data1d/RangeDetectionResult.d.ts +1 -1
- package/lib/data/utilities/FindUtilities.d.ts +2 -1
- package/lib/data/utilities/RangeUtilities.d.ts +1 -1
- package/lib/data/utilities/ZoneUtilities.d.ts +1 -1
- package/lib/data/utilities/calculateSanPlot.d.ts +2 -2
- package/lib/types/NMRiumDataReturn.d.ts +1 -3
- package/lib/versionInfo.js +1 -1
- package/lib-cjs/component/1d/ApodizationLine.js +28 -5
- package/lib-cjs/component/1d/ExclusionZoneAnnotation.js +3 -26
- package/lib-cjs/component/1d/ExclusionZonesAnnotations.js +5 -28
- package/lib-cjs/component/1d/FooterBanner.js +2 -2
- package/lib-cjs/component/1d/SpectraLegends.js +1 -2
- package/lib-cjs/component/1d/multiAnalysis/MultiAnalysisRanges.js +2 -2
- package/lib-cjs/component/1d/tool/PeakPointer.js +3 -3
- package/lib-cjs/component/1d/tool/XLabelPointer.js +2 -2
- package/lib-cjs/component/1d-2d/tools/BrushX.js +1 -2
- package/lib-cjs/component/1d-2d/tools/BrushXY.js +1 -2
- package/lib-cjs/component/1d-2d/tools/CrossLinePointer.js +2 -3
- package/lib-cjs/component/2d/Chart2D.js +4 -4
- package/lib-cjs/component/2d/FooterBanner.js +2 -2
- package/lib-cjs/component/2d/tools/XYLabelPointer.js +2 -2
- package/lib-cjs/component/EventsTrackers/BrushTracker.js +36 -22
- package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +90 -67
- package/lib-cjs/component/EventsTrackers/MouseTracker.js +4 -1
- package/lib-cjs/component/NMRium.js +12 -13
- package/lib-cjs/component/context/LoggerContext.js +5 -0
- package/lib-cjs/component/elements/Button.js +16 -25
- package/lib-cjs/component/elements/ColorInput.js +2 -2
- package/lib-cjs/component/elements/EditableColumn.js +5 -2
- package/lib-cjs/component/elements/Input.js +2 -4
- package/lib-cjs/component/elements/Label.js +2 -2
- package/lib-cjs/component/elements/MolecularFormulaInput.js +14 -16
- package/lib-cjs/component/elements/NextPrev.js +26 -8
- package/lib-cjs/component/elements/NumberInput.js +2 -2
- package/lib-cjs/component/elements/ReactTable/ReactTable.js +4 -4
- package/lib-cjs/component/elements/formik/FormikCheckBox.js +2 -2
- package/lib-cjs/component/elements/formik/FormikColumnFormatField.js +20 -16
- package/lib-cjs/component/elements/formik/FormikError.js +27 -0
- package/lib-cjs/component/elements/formik/FormikInput.js +10 -6
- package/lib-cjs/component/elements/formik/FormikSelect.js +1 -1
- package/lib-cjs/component/header/ApodizationOptionsPanel.js +6 -5
- package/lib-cjs/component/header/AutoPeakPickingOptionPanel.js +15 -6
- package/lib-cjs/component/header/BaseLineCorrectionPanel.js +6 -3
- package/lib-cjs/component/header/PhaseCorrectionPanel.js +6 -26
- package/lib-cjs/component/header/RangesPickingOptionPanel.js +15 -7
- package/lib-cjs/component/header/ZeroFillingOptionsPanel.js +2 -25
- package/lib-cjs/component/hooks/useCheckPointsNumberInWindowArea.js +24 -0
- package/lib-cjs/component/hooks/useExport.js +1 -1
- package/lib-cjs/component/hooks/usePanelPreferences.js +4 -0
- package/lib-cjs/component/hooks/useSaveSettings.js +16 -14
- package/lib-cjs/component/loader/DropZone.js +1 -2
- package/lib-cjs/component/modal/LoadJCAMPModal.js +81 -75
- package/lib-cjs/component/modal/ModalStyle.js +0 -10
- package/lib-cjs/component/modal/MoleculeStructureEditorModal.js +12 -6
- package/lib-cjs/component/modal/PredictSpectraModal.js +53 -126
- package/lib-cjs/component/modal/SaveAsModal.js +22 -14
- package/lib-cjs/component/modal/changeSum/ChangeSumModal.js +24 -37
- package/lib-cjs/component/modal/editRange/EditRangeModal.js +32 -12
- package/lib-cjs/component/modal/editRange/forms/components/DeltaInput.js +2 -0
- package/lib-cjs/component/modal/metaImportation/MetaImportationModal.js +15 -5
- package/lib-cjs/component/modal/setting/GeneralSettings.js +2 -7
- package/lib-cjs/component/panels/IntegralsPanel/IntegralsPreferences.js +6 -14
- package/lib-cjs/component/panels/MoleculesPanel/MoleculeHeader.js +2 -2
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanel.js +19 -24
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +76 -86
- package/lib-cjs/component/panels/MoleculesPanel/Utilities.js +3 -1
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/base/AnalysisColumnHeader.js +6 -6
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/preferences/AnalysisTablePreferences.js +2 -2
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/preferences/index.js +2 -2
- package/lib-cjs/component/panels/Panels.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +38 -52
- package/lib-cjs/component/panels/RangesPanel/RangesPreferences.js +5 -20
- package/lib-cjs/component/panels/RangesPanel/hooks/useEditRangeModal.js +9 -12
- package/lib-cjs/component/panels/SpectrumsPanel/SpectraTable.js +5 -1
- package/lib-cjs/component/panels/SpectrumsPanel/base/SpectraColumnsManager.js +10 -4
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +1 -1
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +1 -1
- package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +5 -24
- package/lib-cjs/component/panels/databasePanel/DatabasePreferences.js +25 -2
- package/lib-cjs/component/panels/header/DefaultPanelHeader.js +18 -26
- package/lib-cjs/component/panels/header/PanelHeader.js +15 -0
- package/lib-cjs/component/panels/predictionPanel/PredictionOptionsPanel.js +122 -0
- package/lib-cjs/component/panels/predictionPanel/PredictionPanel.js +109 -37
- package/lib-cjs/component/panels/predictionPanel/PredictionPreferences.js +29 -0
- package/lib-cjs/component/panels/predictionPanel/PredictionSimpleOptions.js +72 -0
- package/lib-cjs/component/reducer/Reducer.js +2 -31
- package/lib-cjs/component/reducer/actions/DatabaseActions.js +6 -4
- package/lib-cjs/component/reducer/actions/DomainActions.js +3 -0
- package/lib-cjs/component/reducer/actions/FiltersActions.js +66 -94
- package/lib-cjs/component/reducer/actions/HistoryActions.js +45 -0
- package/lib-cjs/component/reducer/actions/IntegralsActions.js +3 -1
- package/lib-cjs/component/reducer/actions/MoleculeActions.js +58 -32
- package/lib-cjs/component/reducer/actions/PeaksActions.js +3 -3
- package/lib-cjs/component/reducer/actions/RangesActions.js +7 -52
- package/lib-cjs/component/reducer/actions/SpectrumsActions.js +10 -33
- package/lib-cjs/component/reducer/actions/ToolsActions.js +26 -32
- package/lib-cjs/component/reducer/actions/ZonesActions.js +6 -32
- package/lib-cjs/component/reducer/helper/ZoomHistoryManager.js +37 -0
- package/lib-cjs/component/reducer/preferences/actions/addWorkspace.js +2 -2
- package/lib-cjs/component/toolbar/BasicToolBar.js +5 -10
- package/lib-cjs/component/toolbar/ToolTypes.js +9 -32
- package/lib-cjs/component/workspaces/prediction.js +193 -0
- package/lib-cjs/component/workspaces/workspaceDefaultProperties.js +21 -44
- package/lib-cjs/data/PredictionManager.js +43 -3
- package/lib-cjs/data/constants/DefaultApodizationOptions.js +8 -0
- package/lib-cjs/data/data1d/Spectrum1D/index.js +7 -11
- package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +9 -32
- package/lib-cjs/data/data1d/Spectrum1D/integrals/initiateIntegrals.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +1 -2
- package/lib-cjs/data/data1d/Spectrum1D/peaks/initiatePeaks.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/peaks/optimizePeaks.js +1 -2
- package/lib-cjs/data/data1d/Spectrum1D/ranges/addRange.js +7 -26
- package/lib-cjs/data/data1d/Spectrum1D/ranges/changeRange.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/ranges/detectRange.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/ranges/detectRanges.js +3 -4
- package/lib-cjs/data/data1d/Spectrum1D/ranges/detectSignal.js +13 -6
- package/lib-cjs/data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges.js +23 -18
- package/lib-cjs/data/data1d/Spectrum1D/ranges/initiateRanges.js +2 -2
- package/lib-cjs/data/data1d/database.js +2 -4
- package/lib-cjs/data/data1d/multipleSpectraAnalysis.js +5 -16
- package/lib-cjs/data/data2d/Spectrum2D/getShift.js +3 -26
- package/lib-cjs/data/data2d/Spectrum2D/initiateDatum2D.js +2 -25
- package/lib-cjs/versionInfo.js +1 -1
- package/package.json +29 -29
- package/lib/component/panels/predictionPanel/PredictionOptions.d.ts +0 -7
- package/lib/component/panels/predictionPanel/PredictionOptions.js +0 -74
- package/lib/component/workspaces/Workspace.d.ts +0 -188
- package/lib/component/workspaces/Workspace.js +0 -1
- package/lib/data/Filters.d.ts +0 -12
- package/lib/data/Filters.js +0 -12
- package/lib/data/FiltersManager.d.ts +0 -30
- package/lib/data/FiltersManager.js +0 -175
- package/lib/data/data1d/Spectrum1D/getShiftX.d.ts +0 -2
- package/lib/data/data1d/Spectrum1D/getShiftX.js +0 -6
- package/lib/data/data1d/Spectrum1D/getSpectrumErrorValue.d.ts +0 -2
- package/lib/data/data1d/Spectrum1D/getSpectrumErrorValue.js +0 -4
- package/lib/data/data1d/Spectrum1D/integrals/checkIntegralKind.d.ts +0 -7
- package/lib/data/data1d/Spectrum1D/integrals/checkIntegralKind.js +0 -9
- package/lib/data/data1d/Spectrum1D/integrals/mapIntegrals.d.ts +0 -12
- package/lib/data/data1d/Spectrum1D/integrals/mapIntegrals.js +0 -36
- package/lib/data/data1d/Spectrum1D/integrals/updateIntegrals.d.ts +0 -2
- package/lib/data/data1d/Spectrum1D/integrals/updateIntegrals.js +0 -6
- package/lib/data/data1d/Spectrum1D/integrals/updateIntegralsRelativeValues.d.ts +0 -2
- package/lib/data/data1d/Spectrum1D/integrals/updateIntegralsRelativeValues.js +0 -5
- package/lib/data/data1d/Spectrum1D/integrals/updateRelatives.d.ts +0 -2
- package/lib/data/data1d/Spectrum1D/integrals/updateRelatives.js +0 -26
- package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.d.ts +0 -3
- package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.js +0 -45
- package/lib/data/data1d/Spectrum1D/peaks/updatePeaks.d.ts +0 -2
- package/lib/data/data1d/Spectrum1D/peaks/updatePeaks.js +0 -7
- package/lib/data/data1d/Spectrum1D/ranges/mapRanges.d.ts +0 -4
- package/lib/data/data1d/Spectrum1D/ranges/mapRanges.js +0 -78
- package/lib/data/data1d/Spectrum1D/ranges/updateRanges.d.ts +0 -2
- package/lib/data/data1d/Spectrum1D/ranges/updateRanges.js +0 -9
- package/lib/data/data1d/Spectrum1D/ranges/updateRangesRelativeValues.d.ts +0 -2
- package/lib/data/data1d/Spectrum1D/ranges/updateRangesRelativeValues.js +0 -5
- package/lib/data/data1d/filter1d/apodization.d.ts +0 -27
- package/lib/data/data1d/filter1d/apodization.js +0 -81
- package/lib/data/data1d/filter1d/baselineCorrection.d.ts +0 -33
- package/lib/data/data1d/filter1d/baselineCorrection.js +0 -51
- package/lib/data/data1d/filter1d/digitalFilter.d.ts +0 -20
- package/lib/data/data1d/filter1d/digitalFilter.js +0 -44
- package/lib/data/data1d/filter1d/equallySpaced.d.ts +0 -33
- package/lib/data/data1d/filter1d/equallySpaced.js +0 -52
- package/lib/data/data1d/filter1d/exclusionZones.d.ts +0 -15
- package/lib/data/data1d/filter1d/exclusionZones.js +0 -32
- package/lib/data/data1d/filter1d/fft.d.ts +0 -18
- package/lib/data/data1d/filter1d/fft.js +0 -90
- package/lib/data/data1d/filter1d/phaseCorrection.d.ts +0 -26
- package/lib/data/data1d/filter1d/phaseCorrection.js +0 -64
- package/lib/data/data1d/filter1d/shiftX.d.ts +0 -20
- package/lib/data/data1d/filter1d/shiftX.js +0 -26
- package/lib/data/data1d/filter1d/signalProcessing.d.ts +0 -26
- package/lib/data/data1d/filter1d/signalProcessing.js +0 -65
- package/lib/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.d.ts +0 -2
- package/lib/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +0 -35
- package/lib/data/data1d/filter1d/zeroFilling.d.ts +0 -22
- package/lib/data/data1d/filter1d/zeroFilling.js +0 -60
- package/lib/data/data2d/filter2d/shiftX.d.ts +0 -18
- package/lib/data/data2d/filter2d/shiftX.js +0 -27
- package/lib/data/data2d/filter2d/shiftY.d.ts +0 -18
- package/lib/data/data2d/filter2d/shiftY.js +0 -27
- package/lib/data/types/view-state/PeaksViewState.d.ts +0 -17
- package/lib/data/types/view-state/PeaksViewState.js +0 -1
- package/lib/types/NMRiumGeneralPreferences.d.ts +0 -7
- package/lib/types/NMRiumGeneralPreferences.js +0 -1
- package/lib/types/NMRiumPanelPreferences.d.ts +0 -17
- package/lib/types/NMRiumPanelPreferences.js +0 -1
- package/lib/types/NMRiumToolBarPreferences.d.ts +0 -22
- package/lib/types/NMRiumToolBarPreferences.js +0 -1
- package/lib/types/PanelPreferencesType.d.ts +0 -4
- package/lib/types/PanelPreferencesType.js +0 -1
- package/lib-cjs/component/panels/predictionPanel/PredictionOptions.js +0 -102
- package/lib-cjs/component/workspaces/Workspace.js +0 -2
- package/lib-cjs/data/Filters.js +0 -38
- package/lib-cjs/data/FiltersManager.js +0 -206
- package/lib-cjs/data/data1d/Spectrum1D/getShiftX.js +0 -33
- package/lib-cjs/data/data1d/Spectrum1D/getSpectrumErrorValue.js +0 -8
- package/lib-cjs/data/data1d/Spectrum1D/integrals/checkIntegralKind.js +0 -13
- package/lib-cjs/data/data1d/Spectrum1D/integrals/mapIntegrals.js +0 -40
- package/lib-cjs/data/data1d/Spectrum1D/integrals/updateIntegrals.js +0 -10
- package/lib-cjs/data/data1d/Spectrum1D/integrals/updateIntegralsRelativeValues.js +0 -9
- package/lib-cjs/data/data1d/Spectrum1D/integrals/updateRelatives.js +0 -30
- package/lib-cjs/data/data1d/Spectrum1D/peaks/mapPeaks.js +0 -49
- package/lib-cjs/data/data1d/Spectrum1D/peaks/updatePeaks.js +0 -11
- package/lib-cjs/data/data1d/Spectrum1D/ranges/mapRanges.js +0 -82
- package/lib-cjs/data/data1d/Spectrum1D/ranges/updateRanges.js +0 -13
- package/lib-cjs/data/data1d/Spectrum1D/ranges/updateRangesRelativeValues.js +0 -9
- package/lib-cjs/data/data1d/filter1d/apodization.js +0 -88
- package/lib-cjs/data/data1d/filter1d/baselineCorrection.js +0 -60
- package/lib-cjs/data/data1d/filter1d/digitalFilter.js +0 -50
- package/lib-cjs/data/data1d/filter1d/equallySpaced.js +0 -61
- package/lib-cjs/data/data1d/filter1d/exclusionZones.js +0 -38
- package/lib-cjs/data/data1d/filter1d/fft.js +0 -96
- package/lib-cjs/data/data1d/filter1d/phaseCorrection.js +0 -70
- package/lib-cjs/data/data1d/filter1d/shiftX.js +0 -32
- package/lib-cjs/data/data1d/filter1d/signalProcessing.js +0 -95
- package/lib-cjs/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +0 -39
- package/lib-cjs/data/data1d/filter1d/zeroFilling.js +0 -66
- package/lib-cjs/data/data2d/filter2d/shiftX.js +0 -33
- package/lib-cjs/data/data2d/filter2d/shiftY.js +0 -33
- package/lib-cjs/data/types/view-state/PeaksViewState.js +0 -2
- package/lib-cjs/types/NMRiumGeneralPreferences.js +0 -2
- package/lib-cjs/types/NMRiumPanelPreferences.js +0 -2
- package/lib-cjs/types/NMRiumToolBarPreferences.js +0 -2
- package/lib-cjs/types/PanelPreferencesType.js +0 -2
|
@@ -1,206 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.lookupForFilter = exports.deleteFilter = exports.addFilter = exports.enableFilter = exports.reapplyFilters = exports.applyFilter = void 0;
|
|
27
|
-
/* eslint-disable import/namespace */
|
|
28
|
-
const uuid_1 = require("@lukeed/uuid");
|
|
29
|
-
const Filters = __importStar(require("./Filters"));
|
|
30
|
-
const cloneDatum1D_1 = require("./data1d/Spectrum1D/cloneDatum1D");
|
|
31
|
-
const updateIntegrals_1 = require("./data1d/Spectrum1D/integrals/updateIntegrals");
|
|
32
|
-
const updatePeaks_1 = require("./data1d/Spectrum1D/peaks/updatePeaks");
|
|
33
|
-
const updateRanges_1 = require("./data1d/Spectrum1D/ranges/updateRanges");
|
|
34
|
-
const cloneDatum2D_1 = require("./data2d/Spectrum2D/cloneDatum2D");
|
|
35
|
-
const updateZones_1 = require("./data2d/Spectrum2D/zones/updateZones");
|
|
36
|
-
function resetDataToOrigin(datum) {
|
|
37
|
-
datum.data =
|
|
38
|
-
datum.info.dimension === 1
|
|
39
|
-
? (0, cloneDatum1D_1.cloneDatum1D)(datum.originalData)
|
|
40
|
-
: (0, cloneDatum2D_1.cloneDatum2D)(datum.originalData);
|
|
41
|
-
datum.info = { ...datum.originalInfo };
|
|
42
|
-
}
|
|
43
|
-
// update the the part of the data that affected by applying the filters
|
|
44
|
-
function updateData(datum) {
|
|
45
|
-
if (datum.info.dimension === 1) {
|
|
46
|
-
(0, updatePeaks_1.updatePeaks)(datum);
|
|
47
|
-
(0, updateRanges_1.updateRanges)(datum);
|
|
48
|
-
(0, updateIntegrals_1.updateIntegrals)(datum);
|
|
49
|
-
}
|
|
50
|
-
else if (datum.info.dimension === 2) {
|
|
51
|
-
(0, updateZones_1.updateZones)(datum);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
function applyFilter(datum, filters = [], options = {}) {
|
|
55
|
-
const { forceReapply = false, filterIndex } = options;
|
|
56
|
-
let isReduced = false;
|
|
57
|
-
for (let filter of filters) {
|
|
58
|
-
const filterOption = {
|
|
59
|
-
name: filter.name,
|
|
60
|
-
label: Filters[filter.name].name,
|
|
61
|
-
value: filter.value,
|
|
62
|
-
};
|
|
63
|
-
const previousFilter = lookupForFilter(datum, filter.name);
|
|
64
|
-
const isDeleteAllow = 'isDeleteAllow' in filter ? filter.isDeleteAllow : true;
|
|
65
|
-
if (previousFilter) {
|
|
66
|
-
// eslint-disable-next-line unicorn/no-array-reduce
|
|
67
|
-
const reduceResult = Filters[filter.name].reduce(previousFilter.value, filterOption.value);
|
|
68
|
-
if (reduceResult.once) {
|
|
69
|
-
if (!isReduced) {
|
|
70
|
-
isReduced = true;
|
|
71
|
-
}
|
|
72
|
-
if (reduceResult.reduce != null && reduceResult.reduce !== undefined) {
|
|
73
|
-
replaceFilter(datum, previousFilter.id, reduceResult.reduce);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
else {
|
|
77
|
-
addFilter(datum, filterOption, { isDeleteAllow, filterIndex });
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
else {
|
|
81
|
-
addFilter(datum, filterOption, { isDeleteAllow, filterIndex });
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
if (forceReapply) {
|
|
85
|
-
reapplyFilters(datum);
|
|
86
|
-
}
|
|
87
|
-
else if (isReduced) {
|
|
88
|
-
if (filters.length === 1 && isLastFilter(datum, filters[0].name)) {
|
|
89
|
-
Filters[filters[0].name].apply(datum, filters[0].value);
|
|
90
|
-
}
|
|
91
|
-
else {
|
|
92
|
-
reapplyFilters(datum);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
else {
|
|
96
|
-
for (let filter of filters) {
|
|
97
|
-
Filters[filter.name].apply(datum, filter.value);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
updateData(datum);
|
|
101
|
-
}
|
|
102
|
-
exports.applyFilter = applyFilter;
|
|
103
|
-
function isLastFilter(datum, id) {
|
|
104
|
-
const index = datum.filters.findIndex((f) => f.name === id);
|
|
105
|
-
if (datum.filters.length === index + 1) {
|
|
106
|
-
return true;
|
|
107
|
-
}
|
|
108
|
-
return false;
|
|
109
|
-
}
|
|
110
|
-
function lookupForFilter(datum, filterName) {
|
|
111
|
-
return datum.filters.find((f) => f.name === filterName);
|
|
112
|
-
}
|
|
113
|
-
exports.lookupForFilter = lookupForFilter;
|
|
114
|
-
function reapplyFilters(datum, filters = null) {
|
|
115
|
-
const _filters = filters || datum.filters;
|
|
116
|
-
enableFilter(datum, null, null, _filters);
|
|
117
|
-
}
|
|
118
|
-
exports.reapplyFilters = reapplyFilters;
|
|
119
|
-
// id filter id
|
|
120
|
-
function enableFilter(datum, id, checked, filters = null) {
|
|
121
|
-
datum.filters = datum.filters.slice(0);
|
|
122
|
-
if (id) {
|
|
123
|
-
datum.filters = datum.filters.map((filter) => {
|
|
124
|
-
return { ...filter, flag: filter.id === id ? checked : filter.flag };
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
resetDataToOrigin(datum);
|
|
128
|
-
const _filters = filters || datum.filters;
|
|
129
|
-
for (let filterIndex in _filters) {
|
|
130
|
-
const filter = datum.filters[filterIndex];
|
|
131
|
-
datum.filters[filterIndex] = {
|
|
132
|
-
...datum.filters[filterIndex],
|
|
133
|
-
error: null,
|
|
134
|
-
};
|
|
135
|
-
if (filter.flag) {
|
|
136
|
-
try {
|
|
137
|
-
Filters[filter.name].apply(datum, filter.value);
|
|
138
|
-
}
|
|
139
|
-
catch (error) {
|
|
140
|
-
datum.filters[filterIndex] = {
|
|
141
|
-
...datum.filters[filterIndex],
|
|
142
|
-
error: error.message,
|
|
143
|
-
};
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
updateData(datum);
|
|
148
|
-
}
|
|
149
|
-
exports.enableFilter = enableFilter;
|
|
150
|
-
function deleteFilter(datum, id) {
|
|
151
|
-
// delete the specified filter otherwise delete all filters where isDeleteAllow is true
|
|
152
|
-
datum.filters = datum.filters
|
|
153
|
-
.slice(0)
|
|
154
|
-
.filter((filter) => (id ? filter.id !== id : !filter.isDeleteAllow));
|
|
155
|
-
resetDataToOrigin(datum);
|
|
156
|
-
for (let filterIndex in datum.filters) {
|
|
157
|
-
const filter = datum.filters[filterIndex];
|
|
158
|
-
datum.filters[filterIndex] = {
|
|
159
|
-
...datum.filters[filterIndex],
|
|
160
|
-
error: null,
|
|
161
|
-
};
|
|
162
|
-
if (filter.flag) {
|
|
163
|
-
try {
|
|
164
|
-
Filters[filter.name].apply(datum, filter.value);
|
|
165
|
-
}
|
|
166
|
-
catch (error) {
|
|
167
|
-
datum.filters[filterIndex] = {
|
|
168
|
-
...datum.filters[filterIndex],
|
|
169
|
-
error: error.message,
|
|
170
|
-
};
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
updateData(datum);
|
|
175
|
-
}
|
|
176
|
-
exports.deleteFilter = deleteFilter;
|
|
177
|
-
function addFilter(datum, filterOptions, options = {}) {
|
|
178
|
-
const { filterIndex, isDeleteAllow = true } = options;
|
|
179
|
-
const id = (0, uuid_1.v4)();
|
|
180
|
-
const filter = {
|
|
181
|
-
...filterOptions,
|
|
182
|
-
id,
|
|
183
|
-
flag: true,
|
|
184
|
-
isDeleteAllow,
|
|
185
|
-
};
|
|
186
|
-
if (typeof filterIndex === 'number' && filterIndex !== -1) {
|
|
187
|
-
datum.filters = [
|
|
188
|
-
...datum.filters.slice(0, filterIndex + 1),
|
|
189
|
-
filter,
|
|
190
|
-
...datum.filters.slice(filterIndex + 1),
|
|
191
|
-
];
|
|
192
|
-
}
|
|
193
|
-
else {
|
|
194
|
-
datum.filters.push(filter);
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
exports.addFilter = addFilter;
|
|
198
|
-
function replaceFilter(datum, filterID, value) {
|
|
199
|
-
// datum.filters = datum.filters.slice(0);
|
|
200
|
-
const index = datum.filters.findIndex((f) => f.id === filterID);
|
|
201
|
-
delete datum.filters[index].isSnapshot;
|
|
202
|
-
datum.filters[index] = {
|
|
203
|
-
...datum.filters[index],
|
|
204
|
-
value,
|
|
205
|
-
};
|
|
206
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.getShiftX = void 0;
|
|
27
|
-
const FiltersTypes = __importStar(require("../../Filters"));
|
|
28
|
-
function getShiftX(spectrum) {
|
|
29
|
-
const filter = spectrum?.filters &&
|
|
30
|
-
spectrum?.filters.find((filter) => filter.name === FiltersTypes.shiftX.id);
|
|
31
|
-
return filter?.flag ? filter.value.shift : 0;
|
|
32
|
-
}
|
|
33
|
-
exports.getShiftX = getShiftX;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getSpectrumErrorValue = void 0;
|
|
4
|
-
function getSpectrumErrorValue(spectrum) {
|
|
5
|
-
const { x } = spectrum.data;
|
|
6
|
-
return (x.at(-1) - x[0]) / 10000;
|
|
7
|
-
}
|
|
8
|
-
exports.getSpectrumErrorValue = getSpectrumErrorValue;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.checkIntegralKind = void 0;
|
|
4
|
-
const SignalsKinds_1 = require("../../../constants/SignalsKinds");
|
|
5
|
-
/**
|
|
6
|
-
* check whether integral based on its kind can be included in another operation or not
|
|
7
|
-
* @param integral integral
|
|
8
|
-
* @returns {boolean}
|
|
9
|
-
*/
|
|
10
|
-
function checkIntegralKind(integral) {
|
|
11
|
-
return SignalsKinds_1.SignalKindsToInclude.includes(integral.kind);
|
|
12
|
-
}
|
|
13
|
-
exports.checkIntegralKind = checkIntegralKind;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.mapIntegrals = void 0;
|
|
4
|
-
const uuid_1 = require("@lukeed/uuid");
|
|
5
|
-
const ml_spectra_processing_1 = require("ml-spectra-processing");
|
|
6
|
-
const getShiftX_1 = require("../getShiftX");
|
|
7
|
-
function getRange(integral, shiftTarget, shift) {
|
|
8
|
-
const { originFrom, originTo, from, to } = integral;
|
|
9
|
-
if (shiftTarget === 'origin') {
|
|
10
|
-
return {
|
|
11
|
-
originFrom: from - shift,
|
|
12
|
-
originTo: to - shift,
|
|
13
|
-
from,
|
|
14
|
-
to,
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
else {
|
|
18
|
-
return {
|
|
19
|
-
originFrom,
|
|
20
|
-
originTo,
|
|
21
|
-
from: originFrom + shift,
|
|
22
|
-
to: originTo + shift,
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
function mapIntegrals(integrals, spectrum, shiftTarget = 'origin') {
|
|
27
|
-
const { x, re } = spectrum.data;
|
|
28
|
-
const shiftX = (0, getShiftX_1.getShiftX)(spectrum);
|
|
29
|
-
return integrals.map((integral) => {
|
|
30
|
-
const integralBoundary = getRange(integral, shiftTarget, shiftX);
|
|
31
|
-
const absolute = (0, ml_spectra_processing_1.xyIntegration)({ x, y: re }, { from: integralBoundary.from, to: integralBoundary.to, reverse: true });
|
|
32
|
-
return {
|
|
33
|
-
...integral,
|
|
34
|
-
id: integral.id || (0, uuid_1.v4)(),
|
|
35
|
-
...integralBoundary,
|
|
36
|
-
absolute,
|
|
37
|
-
};
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
exports.mapIntegrals = mapIntegrals;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updateIntegrals = void 0;
|
|
4
|
-
const mapIntegrals_1 = require("./mapIntegrals");
|
|
5
|
-
const updateIntegralsRelativeValues_1 = require("./updateIntegralsRelativeValues");
|
|
6
|
-
function updateIntegrals(spectrum) {
|
|
7
|
-
spectrum.integrals.values = (0, mapIntegrals_1.mapIntegrals)(spectrum.integrals.values, spectrum, 'current');
|
|
8
|
-
(0, updateIntegralsRelativeValues_1.updateIntegralsRelativeValues)(spectrum, true);
|
|
9
|
-
}
|
|
10
|
-
exports.updateIntegrals = updateIntegrals;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updateIntegralsRelativeValues = void 0;
|
|
4
|
-
const checkIntegralKind_1 = require("./checkIntegralKind");
|
|
5
|
-
const updateRelatives_1 = require("./updateRelatives");
|
|
6
|
-
function updateIntegralsRelativeValues(spectrum, forceCalculateIntegral = false) {
|
|
7
|
-
(0, updateRelatives_1.updateRelatives)(spectrum.integrals, 'integral', checkIntegralKind_1.checkIntegralKind, forceCalculateIntegral);
|
|
8
|
-
}
|
|
9
|
-
exports.updateIntegralsRelativeValues = updateIntegralsRelativeValues;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updateRelatives = void 0;
|
|
4
|
-
const getSum_1 = require("../../../utilities/getSum");
|
|
5
|
-
function updateRelatives(data, key, check, forceCalculateIntegral = false) {
|
|
6
|
-
const { values, options } = data;
|
|
7
|
-
const currentSum = (0, getSum_1.getSum)(values, 'absolute', check);
|
|
8
|
-
let factor = 0;
|
|
9
|
-
if (options?.sum) {
|
|
10
|
-
if (options.isSumConstant || forceCalculateIntegral) {
|
|
11
|
-
factor = currentSum > 0 ? options.sum / currentSum : 0;
|
|
12
|
-
}
|
|
13
|
-
else if (values?.[0]) {
|
|
14
|
-
const item = values[0];
|
|
15
|
-
factor = (item[key] || options.sum) / item.absolute;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
data.values = values.map((value) => {
|
|
19
|
-
return {
|
|
20
|
-
...value,
|
|
21
|
-
...(check(value) && {
|
|
22
|
-
[key]: value.absolute * factor,
|
|
23
|
-
}),
|
|
24
|
-
};
|
|
25
|
-
});
|
|
26
|
-
if (!options.isSumConstant && !forceCalculateIntegral) {
|
|
27
|
-
options.sum = (0, getSum_1.getSum)(values, key, check);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
exports.updateRelatives = updateRelatives;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.mapPeaks = void 0;
|
|
4
|
-
const uuid_1 = require("@lukeed/uuid");
|
|
5
|
-
const getShiftX_1 = require("../getShiftX");
|
|
6
|
-
const getSpectrumErrorValue_1 = require("../getSpectrumErrorValue");
|
|
7
|
-
function isExists(peak, spectrum, error) {
|
|
8
|
-
// check if the Peak is already exists
|
|
9
|
-
for (const { x } of spectrum.peaks?.values || []) {
|
|
10
|
-
if (Math.abs(peak.x - x) < error) {
|
|
11
|
-
return true;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
return false;
|
|
15
|
-
}
|
|
16
|
-
function getPeakDelta(peak, shiftTarget, shift) {
|
|
17
|
-
const { originalX = 0, x } = peak;
|
|
18
|
-
if (shiftTarget === 'origin') {
|
|
19
|
-
return {
|
|
20
|
-
originalX: x - shift,
|
|
21
|
-
x,
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
return {
|
|
26
|
-
originalX,
|
|
27
|
-
x: originalX + shift,
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
function mapPeaks(peaks, spectrum, options = {}) {
|
|
32
|
-
const { checkIsExisting = true, shiftTarget = 'origin' } = options;
|
|
33
|
-
const shiftX = (0, getShiftX_1.getShiftX)(spectrum);
|
|
34
|
-
const error = (0, getSpectrumErrorValue_1.getSpectrumErrorValue)(spectrum);
|
|
35
|
-
let newPeaks = [];
|
|
36
|
-
for (const peak of peaks) {
|
|
37
|
-
const peakDelta = getPeakDelta(peak, shiftTarget, shiftX);
|
|
38
|
-
if (!checkIsExisting ||
|
|
39
|
-
(checkIsExisting && !isExists(peak, spectrum, error))) {
|
|
40
|
-
newPeaks.push({
|
|
41
|
-
...peak,
|
|
42
|
-
id: peak?.id || (0, uuid_1.v4)(),
|
|
43
|
-
...peakDelta,
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
return newPeaks;
|
|
48
|
-
}
|
|
49
|
-
exports.mapPeaks = mapPeaks;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updatePeaks = void 0;
|
|
4
|
-
const mapPeaks_1 = require("./mapPeaks");
|
|
5
|
-
function updatePeaks(spectrum) {
|
|
6
|
-
spectrum.peaks.values = (0, mapPeaks_1.mapPeaks)(spectrum.peaks.values, spectrum, {
|
|
7
|
-
checkIsExisting: false,
|
|
8
|
-
shiftTarget: 'current',
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
exports.updatePeaks = updatePeaks;
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.mapRanges = void 0;
|
|
4
|
-
const uuid_1 = require("@lukeed/uuid");
|
|
5
|
-
const ml_spectra_processing_1 = require("ml-spectra-processing");
|
|
6
|
-
const SignalsKinds_1 = require("../../../constants/SignalsKinds");
|
|
7
|
-
const getShiftX_1 = require("../getShiftX");
|
|
8
|
-
const getSpectrumErrorValue_1 = require("../getSpectrumErrorValue");
|
|
9
|
-
function checkRange(range, spectrum, error) {
|
|
10
|
-
// check if the range is already exists
|
|
11
|
-
for (const { from, to } of spectrum.ranges?.values || []) {
|
|
12
|
-
if (Math.abs(range.from - from) < error &&
|
|
13
|
-
Math.abs(range.to - to) < error) {
|
|
14
|
-
return true;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
function getRange(range, shiftTarget, shift) {
|
|
19
|
-
const { originFrom, originTo, from, to } = range;
|
|
20
|
-
if (shiftTarget === 'origin') {
|
|
21
|
-
return {
|
|
22
|
-
originFrom: from - shift,
|
|
23
|
-
originTo: to - shift,
|
|
24
|
-
from,
|
|
25
|
-
to,
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
return {
|
|
30
|
-
originFrom,
|
|
31
|
-
originTo,
|
|
32
|
-
from: (originFrom || 0) + shift,
|
|
33
|
-
to: (originTo || 0) + shift,
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
function getSignalDelta(signal, shiftTarget, shift) {
|
|
38
|
-
const { delta, originDelta } = signal;
|
|
39
|
-
if (shiftTarget === 'origin') {
|
|
40
|
-
return {
|
|
41
|
-
originDelta: delta - shift,
|
|
42
|
-
delta,
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
else {
|
|
46
|
-
return {
|
|
47
|
-
originDelta,
|
|
48
|
-
delta: (originDelta || 0) + shift,
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
function mapRanges(ranges, spectrum, options = {}) {
|
|
53
|
-
const { checkIsExisting = true, shiftTarget = 'origin' } = options;
|
|
54
|
-
const { x, re } = spectrum.data;
|
|
55
|
-
const shiftX = (0, getShiftX_1.getShiftX)(spectrum);
|
|
56
|
-
const error = (0, getSpectrumErrorValue_1.getSpectrumErrorValue)(spectrum);
|
|
57
|
-
if (checkIsExisting) {
|
|
58
|
-
ranges = ranges.filter((r) => (checkIsExisting && !checkRange(r, spectrum, error)) || r.id === 'new');
|
|
59
|
-
}
|
|
60
|
-
return ranges.map((range) => {
|
|
61
|
-
const rangeBoundary = getRange(range, shiftTarget, shiftX);
|
|
62
|
-
const absolute = (0, ml_spectra_processing_1.xyIntegration)({ x, y: re }, { from: rangeBoundary.from, to: rangeBoundary.to, reverse: true });
|
|
63
|
-
const signals = range.signals.map((signal) => {
|
|
64
|
-
const { kind = null, id, ...resSignal } = signal;
|
|
65
|
-
return {
|
|
66
|
-
kind: kind || 'signal',
|
|
67
|
-
id: id || (0, uuid_1.v4)(),
|
|
68
|
-
...resSignal,
|
|
69
|
-
...getSignalDelta(signal, shiftTarget, shiftX),
|
|
70
|
-
};
|
|
71
|
-
});
|
|
72
|
-
return {
|
|
73
|
-
...range,
|
|
74
|
-
id: range.id || (0, uuid_1.v4)(),
|
|
75
|
-
kind: signals?.[0].kind || SignalsKinds_1.DatumKind.signal,
|
|
76
|
-
...rangeBoundary,
|
|
77
|
-
absolute,
|
|
78
|
-
signals,
|
|
79
|
-
};
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
exports.mapRanges = mapRanges;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updateRanges = void 0;
|
|
4
|
-
const mapRanges_1 = require("./mapRanges");
|
|
5
|
-
const updateRangesRelativeValues_1 = require("./updateRangesRelativeValues");
|
|
6
|
-
function updateRanges(spectrum) {
|
|
7
|
-
spectrum.ranges.values = (0, mapRanges_1.mapRanges)(spectrum.ranges.values, spectrum, {
|
|
8
|
-
checkIsExisting: false,
|
|
9
|
-
shiftTarget: 'current',
|
|
10
|
-
});
|
|
11
|
-
(0, updateRangesRelativeValues_1.updateRangesRelativeValues)(spectrum, true);
|
|
12
|
-
}
|
|
13
|
-
exports.updateRanges = updateRanges;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updateRangesRelativeValues = void 0;
|
|
4
|
-
const updateRelatives_1 = require("../integrals/updateRelatives");
|
|
5
|
-
const checkRangeKind_1 = require("./checkRangeKind");
|
|
6
|
-
function updateRangesRelativeValues(spectrum, forceCalculateIntegral = false) {
|
|
7
|
-
(0, updateRelatives_1.updateRelatives)(spectrum.ranges, 'integration', checkRangeKind_1.checkRangeKind, forceCalculateIntegral);
|
|
8
|
-
}
|
|
9
|
-
exports.updateRangesRelativeValues = updateRangesRelativeValues;
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.apodizationFilter = exports.reduce = exports.isApplicable = exports.apply = exports.defaultApodizationOptions = exports.DOMAIN_UPDATE_RULES = exports.name = exports.id = void 0;
|
|
4
|
-
const nmr_processing_1 = require("nmr-processing");
|
|
5
|
-
exports.id = 'apodization';
|
|
6
|
-
exports.name = 'Apodization';
|
|
7
|
-
exports.DOMAIN_UPDATE_RULES = {
|
|
8
|
-
updateXDomain: true,
|
|
9
|
-
updateYDomain: false,
|
|
10
|
-
};
|
|
11
|
-
exports.defaultApodizationOptions = {
|
|
12
|
-
lineBroadening: 1,
|
|
13
|
-
gaussBroadening: 0,
|
|
14
|
-
lineBroadeningCenter: 0,
|
|
15
|
-
};
|
|
16
|
-
function apply(datum1D, options = {}) {
|
|
17
|
-
const { lineBroadening = 1, gaussBroadening = 0, lineBroadeningCenter = 0, } = options;
|
|
18
|
-
// if no options is set, we add the default value to filter
|
|
19
|
-
if (Object.keys(options).length === 0) {
|
|
20
|
-
const filter = datum1D.filters.find((filter) => filter.name === exports.id);
|
|
21
|
-
if (filter) {
|
|
22
|
-
filter.value = { lineBroadening, gaussBroadening, lineBroadeningCenter };
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
const newData = apodizationFilter(datum1D, {
|
|
26
|
-
lineBroadening,
|
|
27
|
-
gaussBroadening,
|
|
28
|
-
lineBroadeningCenter,
|
|
29
|
-
});
|
|
30
|
-
datum1D.data = {
|
|
31
|
-
...datum1D.data,
|
|
32
|
-
re: newData.re,
|
|
33
|
-
im: newData.im,
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
exports.apply = apply;
|
|
37
|
-
function isApplicable(datum1D) {
|
|
38
|
-
if (datum1D.info.isComplex && datum1D.info.isFid)
|
|
39
|
-
return true;
|
|
40
|
-
return false;
|
|
41
|
-
}
|
|
42
|
-
exports.isApplicable = isApplicable;
|
|
43
|
-
function reduce(previousValue, newValue) {
|
|
44
|
-
return {
|
|
45
|
-
once: true,
|
|
46
|
-
reduce: newValue,
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
exports.reduce = reduce;
|
|
50
|
-
function apodizationFilter(datum1D, options = {}) {
|
|
51
|
-
const { lineBroadening = 1, gaussBroadening = 0, lineBroadeningCenter = 0, } = options;
|
|
52
|
-
let grpdly = datum1D.info?.digitalFilter || 0;
|
|
53
|
-
let pointsToShift;
|
|
54
|
-
if (grpdly > 0) {
|
|
55
|
-
pointsToShift = Math.floor(grpdly);
|
|
56
|
-
}
|
|
57
|
-
else {
|
|
58
|
-
pointsToShift = 0;
|
|
59
|
-
}
|
|
60
|
-
const data = datum1D.data;
|
|
61
|
-
const re = data.re;
|
|
62
|
-
const im = data.im;
|
|
63
|
-
const t = data.x;
|
|
64
|
-
const length = re.length;
|
|
65
|
-
const dw = (t[length - 1] - t[0]) / (length - 1); //REPLACE CONSTANT with calculated value... : for this we need AQ or DW to set it right...
|
|
66
|
-
return (0, nmr_processing_1.apodization)({ re, im }, {
|
|
67
|
-
pointsToShift,
|
|
68
|
-
compose: {
|
|
69
|
-
length,
|
|
70
|
-
shapes: [
|
|
71
|
-
{
|
|
72
|
-
start: 0,
|
|
73
|
-
shape: {
|
|
74
|
-
kind: 'lorentzToGauss',
|
|
75
|
-
options: {
|
|
76
|
-
length,
|
|
77
|
-
dw,
|
|
78
|
-
exponentialHz: gaussBroadening > 0 ? lineBroadening : -lineBroadening,
|
|
79
|
-
gaussianHz: gaussBroadening,
|
|
80
|
-
center: lineBroadeningCenter,
|
|
81
|
-
},
|
|
82
|
-
},
|
|
83
|
-
},
|
|
84
|
-
],
|
|
85
|
-
},
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
exports.apodizationFilter = apodizationFilter;
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.reduce = exports.isApplicable = exports.apply = exports.DOMAIN_UPDATE_RULES = exports.name = exports.id = void 0;
|
|
7
|
-
const ml_airpls_1 = __importDefault(require("ml-airpls"));
|
|
8
|
-
const ml_array_xy_equally_spaced_1 = __importDefault(require("ml-array-xy-equally-spaced"));
|
|
9
|
-
const ml_baseline_correction_regression_1 = __importDefault(require("ml-baseline-correction-regression"));
|
|
10
|
-
exports.id = 'baselineCorrection';
|
|
11
|
-
exports.name = 'Baseline correction';
|
|
12
|
-
exports.DOMAIN_UPDATE_RULES = {
|
|
13
|
-
updateXDomain: false,
|
|
14
|
-
updateYDomain: true,
|
|
15
|
-
};
|
|
16
|
-
function apply(datum1D, options) {
|
|
17
|
-
if (!isApplicable(datum1D)) {
|
|
18
|
-
throw new Error('baselineCorrection not applicable on this data');
|
|
19
|
-
}
|
|
20
|
-
const { algorithm } = options;
|
|
21
|
-
let { x, re } = datum1D.data;
|
|
22
|
-
let corrected;
|
|
23
|
-
switch (algorithm) {
|
|
24
|
-
case 'airpls':
|
|
25
|
-
corrected = (0, ml_airpls_1.default)(x, re, options).corrected;
|
|
26
|
-
break;
|
|
27
|
-
case 'polynomial':
|
|
28
|
-
{
|
|
29
|
-
const { degree, zones } = options;
|
|
30
|
-
let reduced = (0, ml_array_xy_equally_spaced_1.default)({ x, y: re }, { numberOfPoints: 4096, zones });
|
|
31
|
-
let result = (0, ml_baseline_correction_regression_1.default)(reduced.x, reduced.y, {
|
|
32
|
-
regressionOptions: degree,
|
|
33
|
-
});
|
|
34
|
-
let { regression } = result;
|
|
35
|
-
corrected = new Float64Array(x.length);
|
|
36
|
-
for (let i = 0; i < re.length; i++) {
|
|
37
|
-
corrected[i] = re[i] - regression.predict(x[i]);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
break;
|
|
41
|
-
default:
|
|
42
|
-
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
|
43
|
-
throw new Error(`baselineCorrection: algorithm unknown: ${algorithm}`);
|
|
44
|
-
}
|
|
45
|
-
Object.assign(datum1D.data, { re: corrected });
|
|
46
|
-
}
|
|
47
|
-
exports.apply = apply;
|
|
48
|
-
function isApplicable(datum1D) {
|
|
49
|
-
if (!datum1D.info.isFid)
|
|
50
|
-
return true;
|
|
51
|
-
return false;
|
|
52
|
-
}
|
|
53
|
-
exports.isApplicable = isApplicable;
|
|
54
|
-
function reduce(previousValue, newValue) {
|
|
55
|
-
return {
|
|
56
|
-
once: true,
|
|
57
|
-
reduce: newValue,
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
exports.reduce = reduce;
|