nmrium 0.42.0 → 0.43.1-pre.1692874523
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 +1 -1
- package/lib/component/1d/Chart1D.js +3 -2
- package/lib/component/1d/ExclusionZonesAnnotations.js +1 -2
- package/lib/component/1d/Line.js +1 -1
- package/lib/component/1d/Viewer1D.js +15 -3
- package/lib/component/1d/integral/IntegralResizable.js +4 -3
- package/lib/component/1d/multiAnalysis/AnalysisRange.js +3 -1
- package/lib/component/1d/peaks/PeakAnnotations.js +20 -25
- package/lib/component/1d/peaks/PeakAnnotationsSpreadMode.d.ts +2 -0
- package/lib/component/1d/peaks/PeakAnnotationsSpreadMode.js +59 -0
- package/lib/component/1d/peaks/PeakEditionManager.d.ts +18 -0
- package/lib/component/1d/peaks/PeakEditionManager.js +98 -0
- package/lib/component/1d/peaks/Peaks.d.ts +1 -0
- package/lib/component/1d/peaks/Peaks.js +22 -0
- package/lib/component/1d/ranges/Range.js +3 -1
- package/lib/component/1d/tool/BaseLineZones.d.ts +1 -1
- package/lib/component/1d/tool/BaseLineZones.js +11 -31
- package/lib/component/1d/utilities/intersectionResolver.d.ts +25 -0
- package/lib/component/1d/utilities/intersectionResolver.js +71 -0
- package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.d.ts +2 -2
- package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.js +17 -16
- package/lib/component/1d-2d/components/FloatMoleculeStructures/index.d.ts +2 -2
- package/lib/component/2d/SlicingView.js +1 -1
- package/lib/component/2d/Viewer2D.js +1 -3
- package/lib/component/2d/ft/Contours.js +1 -1
- package/lib/component/EventsTrackers/KeysListenerTracker.d.ts +5 -1
- package/lib/component/EventsTrackers/KeysListenerTracker.js +48 -8
- package/lib/component/assignment/index.d.ts +6 -1
- package/lib/component/assignment/index.js +5 -1
- package/lib/component/context/DispatchContext.d.ts +3 -2
- package/lib/component/context/KeyModifierContext.d.ts +13 -0
- package/lib/component/context/KeyModifierContext.js +39 -0
- package/lib/component/context/PreferencesContext.d.ts +39 -39
- package/lib/component/elements/Button.js +2 -0
- package/lib/component/elements/CounterLabel.d.ts +7 -0
- package/lib/component/elements/CounterLabel.js +12 -0
- package/lib/component/elements/EditableColumn.js +12 -6
- package/lib/component/elements/Input.d.ts +3 -12
- package/lib/component/elements/Input.js +24 -76
- package/lib/component/elements/Message.js +0 -1
- package/lib/component/elements/NumberInput.d.ts +1 -0
- package/lib/component/elements/NumberInput.js +10 -3
- package/lib/component/elements/PreferencesButton.d.ts +4 -0
- package/lib/component/elements/PreferencesButton.js +6 -0
- package/lib/component/elements/formik/FormikInput.d.ts +2 -2
- package/lib/component/elements/formik/FormikInput.js +3 -6
- package/lib/component/elements/formik/FormikOnChange.js +1 -1
- package/lib/component/elements/popup/Modal/ConfirmDialog.js +1 -1
- package/lib/component/header/ApodizationOptionsPanel.js +23 -14
- package/lib/component/header/BaseLineCorrectionPanel.js +31 -10
- package/lib/component/header/Header.d.ts +10 -3
- package/lib/component/header/Header.js +6 -6
- package/lib/component/header/ZeroFillingOptionsPanel.js +37 -31
- package/lib/component/highlight/index.d.ts +1 -0
- package/lib/component/highlight/index.js +1 -0
- package/lib/component/hooks/useActiveSpectrumPeaksViewState.js +1 -0
- package/lib/component/hooks/useCheckToolsVisibility.js +7 -3
- package/lib/component/hooks/useResizerStatus.d.ts +2 -0
- package/lib/component/hooks/useResizerStatus.js +7 -0
- package/lib/component/hooks/useSpectrum.js +1 -1
- package/lib/component/main/ErrorOverlay.js +20 -0
- package/lib/component/main/InnerNMRium.d.ts +7 -0
- package/lib/component/main/InnerNMRium.js +52 -0
- package/lib/component/main/InnerNMRiumContents.d.ts +14 -0
- package/lib/component/main/InnerNMRiumContents.js +88 -0
- package/lib/component/main/NMRium.d.ts +23 -0
- package/lib/component/main/NMRium.js +13 -0
- package/lib/component/main/NMRiumStateProvider.d.ts +9 -0
- package/lib/component/main/NMRiumStateProvider.js +74 -0
- package/lib/component/{SplitPaneWrapper.js → main/SplitPaneWrapper.js} +1 -1
- package/lib/component/main/StateError.d.ts +4 -0
- package/lib/component/main/StateError.js +16 -0
- package/lib/component/main/index.d.ts +3 -0
- package/lib/component/main/index.js +3 -0
- package/lib/component/main/types.d.ts +18 -0
- package/lib/component/main/types.js +2 -0
- package/lib/component/modal/AlignSpectraModal.js +78 -29
- package/lib/component/modal/MoleculeStructureEditorModal.d.ts +5 -1
- package/lib/component/modal/MoleculeStructureEditorModal.js +12 -15
- package/lib/component/modal/MultipletAnalysisModal.js +1 -1
- package/lib/component/modal/PredictSpectraModal.js +1 -1
- package/lib/component/modal/{AboutUsModal.js → aboutUs/AboutUsModal.js} +4 -3
- package/lib/component/modal/aboutUs/AboutUsZakodium.d.ts +1 -0
- package/lib/component/modal/aboutUs/AboutUsZakodium.js +33 -0
- package/lib/component/modal/changeSum/ChangeSumModal.d.ts +5 -16
- package/lib/component/modal/changeSum/ChangeSumModal.js +6 -115
- package/lib/component/modal/changeSum/ChangeSumModalContents.d.ts +18 -0
- package/lib/component/modal/changeSum/ChangeSumModalContents.js +94 -0
- package/lib/component/modal/metaImportation/MetaImportationModal.js +1 -1
- package/lib/component/modal/setting/GeneralSettings.js +2 -2
- package/lib/component/modal/setting/settings-tabs/DatabasesTabContent.d.ts +1 -1
- package/lib/component/modal/setting/settings-tabs/GeneralTabContent.js +1 -1
- package/lib/component/modal/setting/settings-tabs/ImportationFiltersTabContent.js +1 -1
- package/lib/component/modal/setting/settingsValidation.js +5 -1
- package/lib/component/panels/InformationPanel.js +9 -100
- package/lib/component/panels/IntegralsPanel/IntegralPanel.js +6 -11
- package/lib/component/panels/IntegralsPanel/IntegralTable.js +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculePanel.js +2 -2
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +2 -4
- package/lib/component/panels/MoleculesPanel/Utilities.d.ts +3 -9
- package/lib/component/panels/MoleculesPanel/Utilities.js +14 -10
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.d.ts +13 -9
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +8 -9
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +5 -5
- package/lib/component/panels/Panels.js +6 -7
- package/lib/component/panels/PeaksPanel/PeaksPanel.js +11 -5
- package/lib/component/panels/PeaksPanel/PeaksTable.js +1 -1
- package/lib/component/panels/RangesPanel/RangesHeader.js +6 -10
- package/lib/component/panels/RangesPanel/TableColumns/RelativeColumn.js +1 -1
- package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.js +1 -1
- package/lib/component/panels/SpectrumsPanel/SpectraPanelHeader.js +1 -2
- package/lib/component/panels/SpectrumsPanel/base/ShowHideSpectrumButton.js +1 -1
- package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +2 -2
- package/lib/component/panels/SummaryPanel/SummaryPanel.js +6 -6
- package/lib/component/panels/SummaryPanel/utilities/Utilities.d.ts +2 -3
- package/lib/component/panels/SummaryPanel/utilities/Utilities.js +2 -3
- package/lib/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.js +8 -9
- package/lib/component/panels/ZonesPanel/ZonesPanel.js +3 -2
- package/lib/component/panels/ZonesPanel/ZonesPreferences.js +1 -1
- package/lib/component/panels/databasePanel/DatabasePanel.d.ts +18 -1
- package/lib/component/panels/databasePanel/DatabasePanel.js +3 -40
- package/lib/component/panels/databasePanel/DatabaseSearchOptions.d.ts +18 -0
- package/lib/component/panels/databasePanel/DatabaseSearchOptions.js +53 -0
- package/lib/component/panels/header/DefaultPanelHeader.d.ts +3 -4
- package/lib/component/panels/header/DefaultPanelHeader.js +11 -13
- package/lib/component/panels/predictionPanel/PredictionPanel.js +3 -3
- package/lib/component/panels/predictionPanel/PredictionSimpleOptions.js +0 -1
- package/lib/component/panels/spectrumSimulation/SpectrumSimulation.js +1 -1
- package/lib/component/panels/spectrumSimulation/SpectrumSimulationSimpleOptions.js +1 -2
- package/lib/component/reducer/IgnoreActions.js +1 -1
- package/lib/component/reducer/Reducer.d.ts +3 -8
- package/lib/component/reducer/Reducer.js +34 -8
- package/lib/component/reducer/actions/DomainActions.js +2 -3
- package/lib/component/reducer/actions/FiltersActions.d.ts +32 -11
- package/lib/component/reducer/actions/FiltersActions.js +96 -28
- package/lib/component/reducer/actions/IntegralsActions.d.ts +6 -2
- package/lib/component/reducer/actions/IntegralsActions.js +44 -20
- package/lib/component/reducer/actions/MoleculeActions.js +4 -4
- package/lib/component/reducer/actions/PeaksActions.d.ts +6 -4
- package/lib/component/reducer/actions/PeaksActions.js +19 -1
- package/lib/component/reducer/actions/PreferencesActions.js +1 -2
- package/lib/component/reducer/actions/RangesActions.d.ts +6 -2
- package/lib/component/reducer/actions/RangesActions.js +31 -3
- package/lib/component/reducer/actions/ToolsActions.js +10 -10
- package/lib/component/reducer/core/Constants.d.ts +0 -4
- package/lib/component/reducer/core/Constants.js +0 -5
- package/lib/component/reducer/helper/ZoomHistoryManager.js +1 -2
- package/lib/component/reducer/preferences/preferencesReducer.d.ts +1 -1
- package/lib/component/reducer/preferences/utilities/getPreferencesByWorkspace.d.ts +1 -1
- package/lib/component/toolbar/FunctionToolBar.js +13 -3
- package/lib/component/toolbar/ToolTypes.d.ts +3 -2
- package/lib/component/toolbar/ToolTypes.js +57 -22
- package/lib/component/utility/export.js +7 -4
- package/lib/component/utility/filterType.d.ts +3 -0
- package/lib/component/utility/filterType.js +1 -0
- package/lib/component/workspaces/basic.js +2 -0
- package/lib/component/workspaces/embedded.js +2 -0
- package/lib/component/workspaces/exercise.js +2 -0
- package/lib/component/workspaces/prediction.js +9 -0
- package/lib/component/workspaces/process1D.js +2 -0
- package/lib/component/workspaces/workspaceDefaultProperties.js +2 -0
- package/lib/data/PredictionManager.d.ts +3 -3
- package/lib/data/PredictionManager.js +10 -10
- package/lib/data/constants/References.d.ts +5 -3
- package/lib/data/data1d/Spectrum1D/getReferenceShift.d.ts +10 -1
- package/lib/data/data1d/Spectrum1D/ranges/addRange.d.ts +1 -2
- package/lib/data/data1d/Spectrum1D/ranges/addRange.js +2 -8
- package/lib/data/data1d/Spectrum1D/ranges/detectSignal.js +1 -1
- package/lib/data/molecules/Molecule.js +2 -2
- package/lib/data/utilities/checkModifierKeyActivated.d.ts +1 -1
- package/lib/data/utilities/checkModifierKeyActivated.js +8 -13
- package/lib/versionInfo.js +1 -1
- package/lib-cjs/component/1d/ApodizationLine.js +1 -1
- package/lib-cjs/component/1d/Chart1D.js +3 -2
- package/lib-cjs/component/1d/ExclusionZonesAnnotations.js +1 -2
- package/lib-cjs/component/1d/Line.js +1 -1
- package/lib-cjs/component/1d/Viewer1D.js +15 -3
- package/lib-cjs/component/1d/integral/IntegralResizable.js +4 -3
- package/lib-cjs/component/1d/multiAnalysis/AnalysisRange.js +3 -1
- package/lib-cjs/component/1d/peaks/PeakAnnotations.js +19 -24
- package/lib-cjs/component/1d/peaks/PeakAnnotationsSpreadMode.js +64 -0
- package/lib-cjs/component/1d/peaks/PeakEditionManager.js +129 -0
- package/lib-cjs/component/1d/peaks/Peaks.js +29 -0
- package/lib-cjs/component/1d/ranges/Range.js +3 -1
- package/lib-cjs/component/1d/tool/BaseLineZones.js +11 -34
- package/lib-cjs/component/1d/utilities/intersectionResolver.js +75 -0
- package/lib-cjs/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.js +17 -16
- package/lib-cjs/component/2d/SlicingView.js +1 -1
- package/lib-cjs/component/2d/Viewer2D.js +1 -3
- package/lib-cjs/component/2d/ft/Contours.js +1 -1
- package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +47 -7
- package/lib-cjs/component/assignment/index.js +5 -1
- package/lib-cjs/component/context/KeyModifierContext.js +44 -0
- package/lib-cjs/component/elements/Button.js +2 -0
- package/lib-cjs/component/elements/CounterLabel.js +16 -0
- package/lib-cjs/component/elements/EditableColumn.js +12 -6
- package/lib-cjs/component/elements/Input.js +23 -75
- package/lib-cjs/component/elements/Message.js +0 -1
- package/lib-cjs/component/elements/NumberInput.js +12 -2
- package/lib-cjs/component/elements/PreferencesButton.js +13 -0
- package/lib-cjs/component/elements/formik/FormikInput.js +3 -6
- package/lib-cjs/component/elements/formik/FormikOnChange.js +1 -1
- package/lib-cjs/component/elements/popup/Modal/ConfirmDialog.js +1 -1
- package/lib-cjs/component/header/ApodizationOptionsPanel.js +23 -14
- package/lib-cjs/component/header/BaseLineCorrectionPanel.js +30 -9
- package/lib-cjs/component/header/Header.js +6 -6
- package/lib-cjs/component/header/ZeroFillingOptionsPanel.js +35 -29
- package/lib-cjs/component/highlight/index.js +1 -0
- package/lib-cjs/component/hooks/useActiveSpectrumPeaksViewState.js +1 -0
- package/lib-cjs/component/hooks/useCheckToolsVisibility.js +7 -3
- package/lib-cjs/component/hooks/useResizerStatus.js +11 -0
- package/lib-cjs/component/hooks/useSpectrum.js +1 -1
- package/lib-cjs/component/main/ErrorOverlay.js +26 -0
- package/lib-cjs/component/main/InnerNMRium.js +82 -0
- package/lib-cjs/component/main/InnerNMRiumContents.js +95 -0
- package/lib-cjs/component/main/NMRium.js +19 -0
- package/lib-cjs/component/main/NMRiumStateProvider.js +80 -0
- package/lib-cjs/component/{SplitPaneWrapper.js → main/SplitPaneWrapper.js} +1 -1
- package/lib-cjs/component/main/StateError.js +20 -0
- package/lib-cjs/component/main/index.js +21 -0
- package/lib-cjs/component/main/types.js +3 -0
- package/lib-cjs/component/modal/AlignSpectraModal.js +100 -28
- package/lib-cjs/component/modal/MoleculeStructureEditorModal.js +11 -17
- package/lib-cjs/component/modal/MultipletAnalysisModal.js +1 -1
- package/lib-cjs/component/modal/PredictSpectraModal.js +1 -1
- package/lib-cjs/component/modal/{AboutUsModal.js → aboutUs/AboutUsModal.js} +4 -3
- package/lib-cjs/component/modal/aboutUs/AboutUsZakodium.js +39 -0
- package/lib-cjs/component/modal/changeSum/ChangeSumModal.js +6 -141
- package/lib-cjs/component/modal/changeSum/ChangeSumModalContents.js +124 -0
- package/lib-cjs/component/modal/metaImportation/MetaImportationModal.js +1 -1
- package/lib-cjs/component/modal/setting/GeneralSettings.js +2 -2
- package/lib-cjs/component/modal/setting/settings-tabs/GeneralTabContent.js +1 -1
- package/lib-cjs/component/modal/setting/settings-tabs/ImportationFiltersTabContent.js +1 -1
- package/lib-cjs/component/modal/setting/settingsValidation.js +4 -0
- package/lib-cjs/component/panels/InformationPanel.js +7 -98
- package/lib-cjs/component/panels/IntegralsPanel/IntegralPanel.js +29 -11
- package/lib-cjs/component/panels/IntegralsPanel/IntegralTable.js +1 -1
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanel.js +2 -2
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +2 -4
- package/lib-cjs/component/panels/MoleculesPanel/Utilities.js +14 -10
- package/lib-cjs/component/panels/MoleculesPanel/useAtomAssignment.js +8 -9
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +4 -4
- package/lib-cjs/component/panels/Panels.js +6 -7
- package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +32 -3
- package/lib-cjs/component/panels/PeaksPanel/PeaksTable.js +1 -1
- package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +29 -10
- package/lib-cjs/component/panels/RangesPanel/TableColumns/RelativeColumn.js +1 -1
- package/lib-cjs/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.js +1 -1
- package/lib-cjs/component/panels/SpectrumsPanel/SpectraPanelHeader.js +1 -2
- package/lib-cjs/component/panels/SpectrumsPanel/base/ShowHideSpectrumButton.js +1 -1
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +2 -2
- package/lib-cjs/component/panels/SummaryPanel/SummaryPanel.js +29 -6
- package/lib-cjs/component/panels/SummaryPanel/utilities/Utilities.js +4 -5
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.js +7 -8
- package/lib-cjs/component/panels/ZonesPanel/ZonesPanel.js +26 -2
- package/lib-cjs/component/panels/ZonesPanel/ZonesPreferences.js +1 -1
- package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +3 -40
- package/lib-cjs/component/panels/databasePanel/DatabaseSearchOptions.js +60 -0
- package/lib-cjs/component/panels/header/DefaultPanelHeader.js +12 -12
- package/lib-cjs/component/panels/predictionPanel/PredictionPanel.js +3 -3
- package/lib-cjs/component/panels/predictionPanel/PredictionSimpleOptions.js +0 -1
- package/lib-cjs/component/panels/spectrumSimulation/SpectrumSimulation.js +1 -1
- package/lib-cjs/component/panels/spectrumSimulation/SpectrumSimulationSimpleOptions.js +1 -2
- package/lib-cjs/component/reducer/IgnoreActions.js +1 -1
- package/lib-cjs/component/reducer/Reducer.js +33 -7
- package/lib-cjs/component/reducer/actions/DomainActions.js +2 -3
- package/lib-cjs/component/reducer/actions/FiltersActions.js +98 -28
- package/lib-cjs/component/reducer/actions/IntegralsActions.js +45 -20
- package/lib-cjs/component/reducer/actions/MoleculeActions.js +3 -3
- package/lib-cjs/component/reducer/actions/PeaksActions.js +20 -1
- package/lib-cjs/component/reducer/actions/PreferencesActions.js +1 -2
- package/lib-cjs/component/reducer/actions/RangesActions.js +31 -2
- package/lib-cjs/component/reducer/actions/ToolsActions.js +9 -9
- package/lib-cjs/component/reducer/core/Constants.js +1 -6
- package/lib-cjs/component/reducer/helper/ZoomHistoryManager.js +1 -2
- package/lib-cjs/component/toolbar/FunctionToolBar.js +13 -3
- package/lib-cjs/component/toolbar/ToolTypes.js +57 -22
- package/lib-cjs/component/utility/export.js +7 -4
- package/lib-cjs/component/utility/filterType.js +2 -0
- package/lib-cjs/component/workspaces/basic.js +2 -0
- package/lib-cjs/component/workspaces/embedded.js +2 -0
- package/lib-cjs/component/workspaces/exercise.js +2 -0
- package/lib-cjs/component/workspaces/prediction.js +9 -0
- package/lib-cjs/component/workspaces/process1D.js +2 -0
- package/lib-cjs/component/workspaces/workspaceDefaultProperties.js +2 -0
- package/lib-cjs/data/PredictionManager.js +9 -9
- package/lib-cjs/data/data1d/Spectrum1D/ranges/addRange.js +1 -7
- package/lib-cjs/data/data1d/Spectrum1D/ranges/detectSignal.js +1 -1
- package/lib-cjs/data/molecules/Molecule.js +2 -2
- package/lib-cjs/data/utilities/checkModifierKeyActivated.js +8 -13
- package/lib-cjs/versionInfo.js +1 -1
- package/package.json +26 -25
- package/lib/component/1d/peaks/PeakAnnotation.d.ts +0 -12
- package/lib/component/1d/peaks/PeakAnnotation.js +0 -116
- package/lib/component/ErrorOverlay.js +0 -27
- package/lib/component/NMRium.d.ts +0 -42
- package/lib/component/NMRium.js +0 -237
- package/lib/component/reducer/actions/GlobalActions.d.ts +0 -9
- package/lib/component/reducer/actions/GlobalActions.js +0 -4
- package/lib-cjs/component/1d/peaks/PeakAnnotation.js +0 -118
- package/lib-cjs/component/ErrorOverlay.js +0 -30
- package/lib-cjs/component/NMRium.js +0 -267
- package/lib-cjs/component/reducer/actions/GlobalActions.js +0 -7
- /package/lib/component/{ErrorOverlay.d.ts → main/ErrorOverlay.d.ts} +0 -0
- /package/lib/component/{SplitPaneWrapper.d.ts → main/SplitPaneWrapper.d.ts} +0 -0
- /package/lib/component/modal/{AboutUsModal.d.ts → aboutUs/AboutUsModal.d.ts} +0 -0
|
@@ -13,7 +13,7 @@ import { getStrongestPeak } from '../helper/getStrongestPeak';
|
|
|
13
13
|
import { setDomain, setMode } from './DomainActions';
|
|
14
14
|
import { changeSpectrumVerticalAlignment } from './PreferencesActions';
|
|
15
15
|
import { activateTool, resetSelectedTool } from './ToolsActions';
|
|
16
|
-
const { fft, apodization, baselineCorrection, phaseCorrection, zeroFilling, shiftX, shift2DX, shift2DY, exclusionZones, signalProcessing, } = Filters;
|
|
16
|
+
const { fft, fftDimension1, fftDimension2, apodization, baselineCorrection, phaseCorrection, zeroFilling, shiftX, shift2DX, shift2DY, exclusionZones, signalProcessing, } = Filters;
|
|
17
17
|
function getFilterUpdateDomainRules(filterName) {
|
|
18
18
|
return (Filters[filterName]?.DOMAIN_UPDATE_RULES || {
|
|
19
19
|
updateXDomain: false,
|
|
@@ -158,6 +158,25 @@ function updateView(draft, filterUpdateDomainRules) {
|
|
|
158
158
|
setMode(draft);
|
|
159
159
|
changeSpectrumVerticalAlignment(draft, { verticalAlign: 'auto-check' });
|
|
160
160
|
}
|
|
161
|
+
function disableLivePreview(draft, id) {
|
|
162
|
+
const activeSpectrum = getActiveSpectrum(draft);
|
|
163
|
+
if (activeSpectrum) {
|
|
164
|
+
const index = activeSpectrum.index;
|
|
165
|
+
const { data } = draft.tempData[index];
|
|
166
|
+
draft.data[index].data = data;
|
|
167
|
+
setDomain(draft);
|
|
168
|
+
// reset default options
|
|
169
|
+
switch (id) {
|
|
170
|
+
case apodization.name: {
|
|
171
|
+
draft.toolOptions.data.apodizationOptions = defaultApodizationOptions;
|
|
172
|
+
break;
|
|
173
|
+
}
|
|
174
|
+
default: {
|
|
175
|
+
return null;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
161
180
|
//action
|
|
162
181
|
function handleShiftSpectrumAlongXAxis(draft, action) {
|
|
163
182
|
//apply filter into the spectrum
|
|
@@ -190,7 +209,7 @@ function handleApplyZeroFillingFilter(draft, action) {
|
|
|
190
209
|
const filters = [
|
|
191
210
|
{
|
|
192
211
|
name: zeroFilling.id,
|
|
193
|
-
value: action.payload,
|
|
212
|
+
value: action.payload.options,
|
|
194
213
|
},
|
|
195
214
|
];
|
|
196
215
|
FiltersManager.applyFilter(draft.data[index], filters, {
|
|
@@ -212,16 +231,22 @@ function handleApplyZeroFillingFilter(draft, action) {
|
|
|
212
231
|
function handleCalculateZeroFillingFilter(draft, action) {
|
|
213
232
|
const activeSpectrum = getActiveSpectrum(draft);
|
|
214
233
|
if (activeSpectrum) {
|
|
215
|
-
const
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
234
|
+
const { options, livePreview } = action.payload;
|
|
235
|
+
if (livePreview) {
|
|
236
|
+
const index = activeSpectrum.index;
|
|
237
|
+
const { data: { x, re, im }, filters, info, } = draft.tempData[index];
|
|
238
|
+
const _data = { data: { x, re, im }, filters, info };
|
|
239
|
+
zeroFilling.apply(_data, options);
|
|
240
|
+
const { im: newIm, re: newRe, x: newX } = _data.data;
|
|
241
|
+
const datum = draft.data[index];
|
|
242
|
+
datum.data.x = newX;
|
|
243
|
+
datum.data.im = newIm;
|
|
244
|
+
datum.data.re = newRe;
|
|
245
|
+
draft.xDomain = [newX[0], newX.at(-1)];
|
|
246
|
+
}
|
|
247
|
+
else {
|
|
248
|
+
disableLivePreview(draft, zeroFilling.name);
|
|
249
|
+
}
|
|
225
250
|
}
|
|
226
251
|
}
|
|
227
252
|
//action
|
|
@@ -229,15 +254,20 @@ function handleCalculateApodizationFilter(draft, action) {
|
|
|
229
254
|
const activeSpectrum = getActiveSpectrum(draft);
|
|
230
255
|
if (activeSpectrum) {
|
|
231
256
|
const index = activeSpectrum.index;
|
|
232
|
-
const options = action.payload;
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
257
|
+
const { livePreview, options } = action.payload;
|
|
258
|
+
if (livePreview) {
|
|
259
|
+
const { data: { x, re, im }, info, } = draft.tempData[index];
|
|
260
|
+
const _data = { data: { x, re, im }, info };
|
|
261
|
+
draft.toolOptions.data.apodizationOptions = options;
|
|
262
|
+
apodization.apply(_data, options);
|
|
263
|
+
const { im: newIm, re: newRe } = _data.data;
|
|
264
|
+
const datum = draft.data[index];
|
|
265
|
+
datum.data.im = newIm;
|
|
266
|
+
datum.data.re = newRe;
|
|
267
|
+
}
|
|
268
|
+
else {
|
|
269
|
+
disableLivePreview(draft, apodization.name);
|
|
270
|
+
}
|
|
241
271
|
}
|
|
242
272
|
}
|
|
243
273
|
//action
|
|
@@ -249,7 +279,7 @@ function handleApplyApodizationFilter(draft, action) {
|
|
|
249
279
|
FiltersManager.applyFilter(draft.data[index], [
|
|
250
280
|
{
|
|
251
281
|
name: apodization.id,
|
|
252
|
-
value: action.payload,
|
|
282
|
+
value: action.payload.options,
|
|
253
283
|
},
|
|
254
284
|
], { filterIndex: activeFilterIndex });
|
|
255
285
|
if (activeFilterIndex !== -1) {
|
|
@@ -283,6 +313,42 @@ function handleApplyFFTFilter(draft) {
|
|
|
283
313
|
}
|
|
284
314
|
}
|
|
285
315
|
}
|
|
316
|
+
function handleApplyFFtDimension1Filter(draft) {
|
|
317
|
+
const activeSpectrum = getActiveSpectrum(draft);
|
|
318
|
+
if (activeSpectrum) {
|
|
319
|
+
const { index } = activeSpectrum;
|
|
320
|
+
const activeFilterIndex = getActiveFilterIndex(draft);
|
|
321
|
+
//apply filter into the spectrum
|
|
322
|
+
FiltersManager.applyFilter(draft.data[index], [{ name: fftDimension1.id, value: {} }], { filterIndex: activeFilterIndex });
|
|
323
|
+
if (activeFilterIndex !== -1) {
|
|
324
|
+
rollbackSpectrumByFilter(draft, {
|
|
325
|
+
searchBy: 'name',
|
|
326
|
+
key: fftDimension1.id,
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
else {
|
|
330
|
+
updateView(draft, fftDimension1.DOMAIN_UPDATE_RULES);
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
function handleApplyFFtDimension2Filter(draft) {
|
|
335
|
+
const activeSpectrum = getActiveSpectrum(draft);
|
|
336
|
+
if (activeSpectrum) {
|
|
337
|
+
const { index } = activeSpectrum;
|
|
338
|
+
const activeFilterIndex = getActiveFilterIndex(draft);
|
|
339
|
+
//apply filter into the spectrum
|
|
340
|
+
FiltersManager.applyFilter(draft.data[index], [{ name: fftDimension2.id, value: {} }], { filterIndex: activeFilterIndex });
|
|
341
|
+
if (activeFilterIndex !== -1) {
|
|
342
|
+
rollbackSpectrumByFilter(draft, {
|
|
343
|
+
searchBy: 'name',
|
|
344
|
+
key: fftDimension2.id,
|
|
345
|
+
});
|
|
346
|
+
}
|
|
347
|
+
else {
|
|
348
|
+
updateView(draft, fftDimension2.DOMAIN_UPDATE_RULES);
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
}
|
|
286
352
|
//action
|
|
287
353
|
function handleApplyManualPhaseCorrectionFilter(draft, action) {
|
|
288
354
|
const activeSpectrum = getActiveSpectrum(draft);
|
|
@@ -377,7 +443,7 @@ function handleBaseLineCorrectionFilter(draft, action) {
|
|
|
377
443
|
const activeSpectrum = getActiveSpectrum(draft);
|
|
378
444
|
if (activeSpectrum) {
|
|
379
445
|
const { zones } = draft.toolOptions.data.baselineCorrection;
|
|
380
|
-
const {
|
|
446
|
+
const { options } = action.payload;
|
|
381
447
|
const activeFilterIndex = getActiveFilterIndex(draft);
|
|
382
448
|
FiltersManager.applyFilter(draft.data[activeSpectrum.index], [
|
|
383
449
|
{
|
|
@@ -408,21 +474,23 @@ function calculateBaseLineCorrection(draft, baseLineOptions) {
|
|
|
408
474
|
// save the baseline options temporary
|
|
409
475
|
draft.toolOptions.data.baselineCorrection = {
|
|
410
476
|
...draft.toolOptions.data.baselineCorrection,
|
|
411
|
-
...(baseLineOptions
|
|
477
|
+
...(baseLineOptions && baseLineOptions),
|
|
412
478
|
};
|
|
413
|
-
const { zones, options } = draft.toolOptions.data.baselineCorrection;
|
|
414
|
-
const { livePreview, ...filterOptions } = options;
|
|
479
|
+
const { zones, options, livePreview } = draft.toolOptions.data.baselineCorrection;
|
|
415
480
|
if (livePreview) {
|
|
416
481
|
const _data = { data: { x, re, im }, info };
|
|
417
482
|
baselineCorrection.apply(_data, {
|
|
418
483
|
zones,
|
|
419
|
-
...
|
|
484
|
+
...options,
|
|
420
485
|
});
|
|
421
486
|
const { im: newIm, re: newRe } = _data.data;
|
|
422
487
|
const datum = draft.data[index];
|
|
423
488
|
datum.data.im = newIm;
|
|
424
489
|
datum.data.re = newRe;
|
|
425
490
|
}
|
|
491
|
+
else {
|
|
492
|
+
disableLivePreview(draft, baselineCorrection.id);
|
|
493
|
+
}
|
|
426
494
|
}
|
|
427
495
|
}
|
|
428
496
|
//action
|
|
@@ -567,4 +635,4 @@ function handleDeleteExclusionZone(draft, action) {
|
|
|
567
635
|
}
|
|
568
636
|
}
|
|
569
637
|
}
|
|
570
|
-
export { handleShiftSpectrumAlongXAxis, handleApplyZeroFillingFilter, handleApplyApodizationFilter, handleApplyFFTFilter, handleApplyManualPhaseCorrectionFilter, handleApplyAutoPhaseCorrectionFilter, handleApplyAbsoluteFilter, handleCalculateManualPhaseCorrection, calculateBaseLineCorrection, handleCalculateBaseLineCorrection, handleCalculateApodizationFilter, handleCalculateZeroFillingFilter, handleEnableFilter, handleDeleteFilter, handleDeleteSpectraFilter, handleBaseLineCorrectionFilter, handleSetFilterSnapshotHandler, handleAddExclusionZone, handleDeleteExclusionZone, handleSignalProcessingFilter, rollbackSpectrum, rollbackSpectrumByFilter, };
|
|
638
|
+
export { handleShiftSpectrumAlongXAxis, handleApplyZeroFillingFilter, handleApplyApodizationFilter, handleApplyFFTFilter, handleApplyFFtDimension1Filter, handleApplyFFtDimension2Filter, handleApplyManualPhaseCorrectionFilter, handleApplyAutoPhaseCorrectionFilter, handleApplyAbsoluteFilter, handleCalculateManualPhaseCorrection, calculateBaseLineCorrection, handleCalculateBaseLineCorrection, handleCalculateApodizationFilter, handleCalculateZeroFillingFilter, handleEnableFilter, handleDeleteFilter, handleDeleteSpectraFilter, handleBaseLineCorrectionFilter, handleSetFilterSnapshotHandler, handleAddExclusionZone, handleDeleteExclusionZone, handleSignalProcessingFilter, rollbackSpectrum, rollbackSpectrumByFilter, };
|
|
@@ -20,11 +20,15 @@ type ChangeIntegralRelativeValueAction = ActionType<'CHANGE_INTEGRAL_RELATIVE',
|
|
|
20
20
|
id: string;
|
|
21
21
|
value: number;
|
|
22
22
|
}>;
|
|
23
|
-
|
|
23
|
+
type CutIntegralAction = ActionType<'CUT_INTEGRAL', {
|
|
24
|
+
cutValue: number;
|
|
25
|
+
}>;
|
|
26
|
+
export type IntegralsActions = ChangeIntegralSumAction | AddIntegralAction | DeleteIntegralAction | ChangeIntegralAction | ChangeIntegralRelativeValueAction | CutIntegralAction | ActionType<'CHANGE_INTEGRALS_SUM_FLAG'>;
|
|
24
27
|
declare function handleChangeIntegralSum(draft: Draft<State>, action: ChangeIntegralSumAction): void;
|
|
25
28
|
declare function handleAddIntegral(draft: Draft<State>, action: AddIntegralAction): void;
|
|
26
29
|
declare function handleDeleteIntegral(draft: Draft<State>, action: DeleteIntegralAction): void;
|
|
27
30
|
declare function handleChangeIntegral(draft: Draft<State>, action: ChangeIntegralAction): void;
|
|
28
31
|
declare function handleChangeIntegralsRelativeValue(draft: Draft<State>, action: ChangeIntegralRelativeValueAction): void;
|
|
29
32
|
declare function handleChangeIntegralsSumFlag(draft: any): void;
|
|
30
|
-
|
|
33
|
+
declare function handleCutIntegral(draft: Draft<State>, action: CutIntegralAction): void;
|
|
34
|
+
export { handleCutIntegral, handleChangeIntegralSum, handleAddIntegral, handleDeleteIntegral, handleChangeIntegral, handleChangeIntegralsRelativeValue, handleChangeIntegralsSumFlag, };
|
|
@@ -5,6 +5,7 @@ import { updateIntegralsRelativeValues, changeIntegralsRelative, getShiftX, } fr
|
|
|
5
5
|
import { initSumOptions, setSumOptions, } from '../../../data/data1d/Spectrum1D/SumManager';
|
|
6
6
|
import { getActiveSpectrum } from '../helper/getActiveSpectrum';
|
|
7
7
|
import getRange from '../helper/getRange';
|
|
8
|
+
import { getSpectrum } from '../helper/getSpectrum';
|
|
8
9
|
import { setIntegralsYDomain } from './DomainActions';
|
|
9
10
|
function handleChangeIntegralSum(draft, action) {
|
|
10
11
|
const { options } = action.payload;
|
|
@@ -17,31 +18,39 @@ function handleChangeIntegralSum(draft, action) {
|
|
|
17
18
|
updateIntegralsRelativeValues(datum, true);
|
|
18
19
|
}
|
|
19
20
|
}
|
|
21
|
+
function initiateIntergalSumOptions(datum, options) {
|
|
22
|
+
const { molecules, nucleus } = options;
|
|
23
|
+
datum.integrals.options = initSumOptions(datum.integrals.options, {
|
|
24
|
+
molecules,
|
|
25
|
+
nucleus,
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
function addIntegral(datum, options) {
|
|
29
|
+
const { from, to } = options;
|
|
30
|
+
const { x, re } = datum.data;
|
|
31
|
+
const shiftX = getShiftX(datum);
|
|
32
|
+
const integration = xyIntegration({ x, y: re }, { from, to, reverse: true });
|
|
33
|
+
const integral = {
|
|
34
|
+
id: v4(),
|
|
35
|
+
originFrom: from - shiftX,
|
|
36
|
+
originTo: to - shiftX,
|
|
37
|
+
from,
|
|
38
|
+
to,
|
|
39
|
+
integral: integration,
|
|
40
|
+
absolute: integration,
|
|
41
|
+
kind: 'signal',
|
|
42
|
+
};
|
|
43
|
+
datum.integrals.values.push(integral);
|
|
44
|
+
}
|
|
20
45
|
function handleAddIntegral(draft, action) {
|
|
21
46
|
const { startX, endX } = action.payload;
|
|
22
47
|
const { data, molecules, view: { spectra: { activeTab: nucleus }, }, } = draft;
|
|
23
48
|
const activeSpectrum = getActiveSpectrum(draft);
|
|
24
|
-
const [from, to] = getRange(draft, { startX, endX });
|
|
25
49
|
if (activeSpectrum?.id) {
|
|
50
|
+
const [from, to] = getRange(draft, { startX, endX });
|
|
26
51
|
const datum = data[activeSpectrum.index];
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const integration = xyIntegration({ x, y: re }, { from, to, reverse: true });
|
|
30
|
-
const integral = {
|
|
31
|
-
id: v4(),
|
|
32
|
-
originFrom: from - shiftX,
|
|
33
|
-
originTo: to - shiftX,
|
|
34
|
-
from,
|
|
35
|
-
to,
|
|
36
|
-
integral: integration,
|
|
37
|
-
absolute: integration,
|
|
38
|
-
kind: 'signal',
|
|
39
|
-
};
|
|
40
|
-
datum.integrals.values.push(integral);
|
|
41
|
-
datum.integrals.options = initSumOptions(datum.integrals.options, {
|
|
42
|
-
molecules,
|
|
43
|
-
nucleus,
|
|
44
|
-
});
|
|
52
|
+
addIntegral(datum, { from, to });
|
|
53
|
+
initiateIntergalSumOptions(datum, { molecules, nucleus });
|
|
45
54
|
updateIntegralsRelativeValues(datum);
|
|
46
55
|
setIntegralsYDomain(draft, datum);
|
|
47
56
|
}
|
|
@@ -100,4 +109,19 @@ function handleChangeIntegralsSumFlag(draft) {
|
|
|
100
109
|
integralOptions.isSumConstant = !integralOptions.isSumConstant;
|
|
101
110
|
}
|
|
102
111
|
}
|
|
103
|
-
|
|
112
|
+
function handleCutIntegral(draft, action) {
|
|
113
|
+
const { cutValue } = action.payload;
|
|
114
|
+
const spectrum = getSpectrum(draft);
|
|
115
|
+
const integrals = spectrum.integrals.values;
|
|
116
|
+
for (let i = 0; i < integrals.length; i++) {
|
|
117
|
+
const { to, from } = integrals[i];
|
|
118
|
+
if (cutValue > from && cutValue < to) {
|
|
119
|
+
integrals.splice(i, 1);
|
|
120
|
+
addIntegral(spectrum, { from, to: cutValue });
|
|
121
|
+
addIntegral(spectrum, { from: cutValue, to });
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
updateIntegralsRelativeValues(spectrum);
|
|
125
|
+
setIntegralsYDomain(draft, spectrum);
|
|
126
|
+
}
|
|
127
|
+
export { handleCutIntegral, handleChangeIntegralSum, handleAddIntegral, handleDeleteIntegral, handleChangeIntegral, handleChangeIntegralsRelativeValue, handleChangeIntegralsSumFlag, };
|
|
@@ -5,7 +5,7 @@ import { changeSpectraRelativeSum } from '../../../data/data1d/Spectrum1D/SumMan
|
|
|
5
5
|
import { DRAGGABLE_STRUCTURE_INITIAL_BOUNDING_REACT, } from '../../../data/molecules/Molecule';
|
|
6
6
|
import * as MoleculeManager from '../../../data/molecules/MoleculeManager';
|
|
7
7
|
import { generateColor } from '../../../data/utilities/generateColor';
|
|
8
|
-
import {
|
|
8
|
+
import { MARGIN } from '../core/Constants';
|
|
9
9
|
import { unlinkRange } from './RangesActions';
|
|
10
10
|
import { setActiveTab } from './ToolsActions';
|
|
11
11
|
import { unlinkZone } from './ZonesActions';
|
|
@@ -55,10 +55,10 @@ function handleSetMolecule(draft, action) {
|
|
|
55
55
|
setMolecule(draft, action.payload);
|
|
56
56
|
}
|
|
57
57
|
function removeAssignments(draft, assignmentData) {
|
|
58
|
-
if (draft.displayerMode ===
|
|
58
|
+
if (draft.displayerMode === '1D') {
|
|
59
59
|
unlinkRange(draft, { assignmentData });
|
|
60
60
|
}
|
|
61
|
-
if (draft.displayerMode ===
|
|
61
|
+
if (draft.displayerMode === '2D') {
|
|
62
62
|
unlinkZone(draft, { assignmentData });
|
|
63
63
|
}
|
|
64
64
|
}
|
|
@@ -113,7 +113,7 @@ function checkPredictions(predictedSpectra, inputOptions, molfile, logger) {
|
|
|
113
113
|
const { spectra } = inputOptions;
|
|
114
114
|
const missing2DPrediction = [];
|
|
115
115
|
const molecule = OCL.Molecule.fromMolfile(molfile);
|
|
116
|
-
|
|
116
|
+
//@ts-expect-error Will be fixed once OCL-utils is typed correctly
|
|
117
117
|
const { atoms } = getAtoms(molecule);
|
|
118
118
|
for (const [experiment, required] of Object.entries(spectra)) {
|
|
119
119
|
if (!required || predictedSpectra[experiment])
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Draft } from 'immer';
|
|
2
|
+
import { PeaksViewState } from 'nmr-load-save';
|
|
2
3
|
import { Peak1D, OptionsXYAutoPeaksPicking } from 'nmr-processing';
|
|
3
|
-
import {
|
|
4
|
+
import { FilterType } from '../../utility/filterType';
|
|
4
5
|
import { State } from '../Reducer';
|
|
5
6
|
import { ActionType } from '../types/ActionType';
|
|
6
7
|
type AddPeakAction = ActionType<'ADD_PEAK', {
|
|
@@ -27,9 +28,9 @@ type ChangePeaksShapeAction = ActionType<'CHANGE_PEAK_SHAPE', {
|
|
|
27
28
|
shape: Peak1D['shape'];
|
|
28
29
|
}>;
|
|
29
30
|
type TogglePeaksViewAction = ActionType<'TOGGLE_PEAKS_VIEW_PROPERTY', {
|
|
30
|
-
key: keyof
|
|
31
|
+
key: keyof FilterType<PeaksViewState, boolean>;
|
|
31
32
|
}>;
|
|
32
|
-
export type PeaksActions = AddPeakAction | AddPeaksAction | DeletePeakAction | OptimizePeaksAction | AutoPeaksPickingAction | ChangePeaksShapeAction | TogglePeaksViewAction
|
|
33
|
+
export type PeaksActions = AddPeakAction | AddPeaksAction | DeletePeakAction | OptimizePeaksAction | AutoPeaksPickingAction | ChangePeaksShapeAction | TogglePeaksViewAction | ActionType<'TOGGLE_PEAKS_DISPLAYING_MODE'>;
|
|
33
34
|
declare function handleAddPeak(draft: Draft<State>, action: AddPeakAction): void;
|
|
34
35
|
declare function handleAddPeaks(draft: Draft<State>, action: AddPeaksAction): void;
|
|
35
36
|
declare function handleDeletePeak(draft: Draft<State>, action: DeletePeakAction): void;
|
|
@@ -37,4 +38,5 @@ declare function handleOptimizePeaks(draft: Draft<State>, action: OptimizePeaksA
|
|
|
37
38
|
declare function handleAutoPeakPicking(draft: Draft<State>, action: AutoPeaksPickingAction): void;
|
|
38
39
|
declare function handleChangePeakShape(draft: Draft<State>, action: ChangePeaksShapeAction): void;
|
|
39
40
|
declare function handleTogglePeaksViewProperty(draft: Draft<State>, action: TogglePeaksViewAction): void;
|
|
40
|
-
|
|
41
|
+
declare function handleChangePeaksDisplayingMode(draft: Draft<State>): void;
|
|
42
|
+
export { handleAddPeak, handleAddPeaks, handleDeletePeak, handleAutoPeakPicking, handleOptimizePeaks, handleChangePeakShape, handleTogglePeaksViewProperty, handleChangePeaksDisplayingMode, };
|
|
@@ -145,4 +145,22 @@ function togglePeaksViewProperty(draft, key) {
|
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
|
-
|
|
148
|
+
function handleChangePeaksDisplayingMode(draft) {
|
|
149
|
+
const activeSpectrum = getActiveSpectrum(draft);
|
|
150
|
+
if (activeSpectrum?.id) {
|
|
151
|
+
const peaksView = draft.view.peaks;
|
|
152
|
+
if (peaksView[activeSpectrum.id]) {
|
|
153
|
+
peaksView[activeSpectrum.id].displayingMode =
|
|
154
|
+
peaksView[activeSpectrum.id].displayingMode === 'single'
|
|
155
|
+
? 'spread'
|
|
156
|
+
: 'single';
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
const defaultPeaksView = { ...defaultPeaksViewState };
|
|
160
|
+
defaultPeaksView.displayingMode =
|
|
161
|
+
defaultPeaksView.displayingMode === 'single' ? 'spread' : 'single';
|
|
162
|
+
peaksView[activeSpectrum.id] = defaultPeaksView;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
export { handleAddPeak, handleAddPeaks, handleDeletePeak, handleAutoPeakPicking, handleOptimizePeaks, handleChangePeakShape, handleTogglePeaksViewProperty, handleChangePeaksDisplayingMode, };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import groupByInfoKey from '../../utility/GroupByInfoKey';
|
|
2
2
|
import nucleusToString from '../../utility/nucleusToString';
|
|
3
|
-
import { DISPLAYER_MODE } from '../core/Constants';
|
|
4
3
|
import { getActiveSpectrum } from '../helper/getActiveSpectrum';
|
|
5
4
|
import { setDomain } from './DomainActions';
|
|
6
5
|
function changeSpectrumVerticalAlignment(draft, options) {
|
|
@@ -92,7 +91,7 @@ function handleApplyKeyPreferences(draft, action) {
|
|
|
92
91
|
draft.yDomain = preferences.yDomain;
|
|
93
92
|
draft.originDomain = preferences.originDomain;
|
|
94
93
|
draft.yDomains = preferences.yDomains;
|
|
95
|
-
if (draft.displayerMode !==
|
|
94
|
+
if (draft.displayerMode !== '2D') {
|
|
96
95
|
draft.zoom = preferences.zoom;
|
|
97
96
|
}
|
|
98
97
|
}
|
|
@@ -63,7 +63,10 @@ type UpdateRangAction = ActionType<'UPDATE_RANGE', {
|
|
|
63
63
|
type ToggleAction = ActionType<'SHOW_MULTIPLICITY_TREES' | 'SHOW_RANGES_INTEGRALS' | 'SHOW_J_GRAPH', {
|
|
64
64
|
id: string;
|
|
65
65
|
}>;
|
|
66
|
-
|
|
66
|
+
type CutRangAction = ActionType<'CUT_RANGE', {
|
|
67
|
+
cutValue: number;
|
|
68
|
+
}>;
|
|
69
|
+
export type RangesActions = AutoRangesDetectionAction | DeleteRangeAction | ChangeRangeSignalKindAction | SaveEditedRangeAction | DeleteSignalAction | UnlinkRangeAction | SetDiaIDRangeAction | ResizeRangeAction | ChangeRangeSumAction | AddRangeAction | ChangeRangeRelativeValueAction | ChangeRangeSignalValueAction | UpdateRangAction | ToggleAction | CutRangAction | ActionType<'AUTO_RANGES_SPECTRA_PICKING' | 'CHANGE_RANGES_SUM_FLAG'>;
|
|
67
70
|
declare function handleAutoRangesDetection(draft: Draft<State>, action: AutoRangesDetectionAction): void;
|
|
68
71
|
declare function handleAutoSpectraRangesDetection(draft: Draft<State>): void;
|
|
69
72
|
declare function handleDeleteRange(draft: Draft<State>, action: DeleteRangeAction): void;
|
|
@@ -84,4 +87,5 @@ declare function handleUpdateRange(draft: Draft<State>, action: UpdateRangAction
|
|
|
84
87
|
declare function handleShowMultiplicityTrees(draft: Draft<State>, action: ToggleAction): void;
|
|
85
88
|
declare function handleShowRangesIntegrals(draft: Draft<State>, action: ToggleAction): void;
|
|
86
89
|
declare function handleShowJGraph(draft: Draft<State>, action: ToggleAction): void;
|
|
87
|
-
|
|
90
|
+
declare function handleCutRange(draft: Draft<State>, action: CutRangAction): void;
|
|
91
|
+
export { handleCutRange, handleAutoRangesDetection, handleDeleteRange, deleteSignal1D, handleDeleteSignal, handleChangeRangeSum, handleAddRange, handleResizeRange, handleChangeRangeRelativeValue, handleChangeRangeSignalValue, handleChangeRangeSignalKind, handleSaveEditedRange, handleUnlinkRange, unlinkRange, handleSetDiaIDRange, handleChangeRangesSumFlag, handleUpdateRange, handleShowMultiplicityTrees, handleShowRangesIntegrals, handleAutoSpectraRangesDetection, handleShowJGraph, };
|
|
@@ -5,11 +5,12 @@ import { xFindClosestIndex } from 'ml-spectra-processing';
|
|
|
5
5
|
import { Filters, FiltersManager } from 'nmr-processing';
|
|
6
6
|
import { DatumKind, SignalKindsToInclude, } from '../../../data/constants/SignalsKinds';
|
|
7
7
|
import { addRange, changeRangeSignal, detectRanges, updateRangesRelativeValues, changeRange, changeRangeRelativeValue, } from '../../../data/data1d/Spectrum1D';
|
|
8
|
-
import { setSumOptions, } from '../../../data/data1d/Spectrum1D/SumManager';
|
|
8
|
+
import { initSumOptions, setSumOptions, } from '../../../data/data1d/Spectrum1D/SumManager';
|
|
9
9
|
import { unlink, unlinkInAssignmentData, } from '../../../data/utilities/RangeUtilities';
|
|
10
10
|
import { rangeStateInit } from '../Reducer';
|
|
11
11
|
import { getActiveSpectrum } from '../helper/getActiveSpectrum';
|
|
12
12
|
import getRange from '../helper/getRange';
|
|
13
|
+
import { getSpectrum } from '../helper/getSpectrum';
|
|
13
14
|
import { handleUpdateCorrelations } from './CorrelationsActions';
|
|
14
15
|
import { setDomain, setIntegralsYDomain } from './DomainActions';
|
|
15
16
|
import { resetSelectedTool } from './ToolsActions';
|
|
@@ -248,6 +249,13 @@ function handleChangeRangeSum(draft, action) {
|
|
|
248
249
|
updateRangesRelativeValues(datum, true);
|
|
249
250
|
}
|
|
250
251
|
}
|
|
252
|
+
function initiateRangeSumOptions(datum, options) {
|
|
253
|
+
const { nucleus, molecules } = options;
|
|
254
|
+
datum.ranges.options = initSumOptions(datum.ranges.options, {
|
|
255
|
+
molecules,
|
|
256
|
+
nucleus,
|
|
257
|
+
});
|
|
258
|
+
}
|
|
251
259
|
//action
|
|
252
260
|
function handleAddRange(draft, action) {
|
|
253
261
|
const { startX, endX } = action.payload;
|
|
@@ -257,12 +265,16 @@ function handleAddRange(draft, action) {
|
|
|
257
265
|
if (activeSpectrum?.id) {
|
|
258
266
|
const { index } = activeSpectrum;
|
|
259
267
|
const [from, to] = range;
|
|
260
|
-
|
|
268
|
+
const datum = data[index];
|
|
269
|
+
addRange(datum, {
|
|
261
270
|
from,
|
|
262
271
|
to,
|
|
272
|
+
});
|
|
273
|
+
initiateRangeSumOptions(datum, {
|
|
263
274
|
nucleus,
|
|
264
275
|
molecules,
|
|
265
276
|
});
|
|
277
|
+
updateRangesRelativeValues(datum);
|
|
266
278
|
handleUpdateCorrelations(draft);
|
|
267
279
|
setIntegralsYDomain(draft, data[index]);
|
|
268
280
|
}
|
|
@@ -358,4 +370,20 @@ function handleShowJGraph(draft, action) {
|
|
|
358
370
|
});
|
|
359
371
|
}
|
|
360
372
|
}
|
|
361
|
-
|
|
373
|
+
function handleCutRange(draft, action) {
|
|
374
|
+
const { cutValue } = action.payload;
|
|
375
|
+
const spectrum = getSpectrum(draft);
|
|
376
|
+
const ranges = spectrum.ranges.values;
|
|
377
|
+
for (let i = 0; i < ranges.length; i++) {
|
|
378
|
+
const { to, from } = ranges[i];
|
|
379
|
+
if (cutValue > from && cutValue < to) {
|
|
380
|
+
ranges.splice(i, 1);
|
|
381
|
+
addRange(spectrum, { from, to: cutValue });
|
|
382
|
+
addRange(spectrum, { from: cutValue, to });
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
updateRangesRelativeValues(spectrum);
|
|
386
|
+
setIntegralsYDomain(draft, spectrum);
|
|
387
|
+
handleUpdateCorrelations(draft);
|
|
388
|
+
}
|
|
389
|
+
export { handleCutRange, handleAutoRangesDetection, handleDeleteRange, deleteSignal1D, handleDeleteSignal, handleChangeRangeSum, handleAddRange, handleResizeRange, handleChangeRangeRelativeValue, handleChangeRangeSignalValue, handleChangeRangeSignalKind, handleSaveEditedRange, handleUnlinkRange, unlinkRange, handleSetDiaIDRange, handleChangeRangesSumFlag, handleUpdateRange, handleShowMultiplicityTrees, handleShowRangesIntegrals, handleAutoSpectraRangesDetection, handleShowJGraph, };
|
|
@@ -9,7 +9,7 @@ import { options as Tools } from '../../toolbar/ToolTypes';
|
|
|
9
9
|
import groupByInfoKey from '../../utility/GroupByInfoKey';
|
|
10
10
|
import { getSpectraByNucleus } from '../../utility/getSpectraByNucleus';
|
|
11
11
|
import { rangeStateInit } from '../Reducer';
|
|
12
|
-
import {
|
|
12
|
+
import { MARGIN } from '../core/Constants';
|
|
13
13
|
import { setZoom, wheelZoom, ZOOM_TYPES, } from '../helper/Zoom1DManager';
|
|
14
14
|
import zoomHistoryManager, { addToBrushHistory, } from '../helper/ZoomHistoryManager';
|
|
15
15
|
import { getActiveSpectra } from '../helper/getActiveSpectra';
|
|
@@ -144,7 +144,7 @@ function handleToggleRealImaginaryVisibility(draft) {
|
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
146
|
function handleBrushEnd(draft, action) {
|
|
147
|
-
const is2D = draft.displayerMode ===
|
|
147
|
+
const is2D = draft.displayerMode === '2D';
|
|
148
148
|
const { height, margin, yDomain, yDomains, width, xDomains, xDomain, mode } = draft;
|
|
149
149
|
const xScale = getXScale({ width, xDomains, xDomain, mode, margin });
|
|
150
150
|
const verticalAlign = getVerticalAlign(draft);
|
|
@@ -175,7 +175,7 @@ function handleZoom(draft, action) {
|
|
|
175
175
|
const { event, trackID, selectedTool } = action.payload;
|
|
176
176
|
const { view: { ranges: rangeState }, displayerMode, yDomains, integralsYDomains, } = draft;
|
|
177
177
|
const activeSpectra = getActiveSpectra(draft);
|
|
178
|
-
if (displayerMode ===
|
|
178
|
+
if (displayerMode === '2D') {
|
|
179
179
|
const index = trackID === LAYOUT.TOP_1D ? 0 : trackID === LAYOUT.LEFT_1D ? 1 : null;
|
|
180
180
|
if (index !== null) {
|
|
181
181
|
const id = getSpectrumID(draft, index);
|
|
@@ -221,7 +221,7 @@ function zoomOut(draft, action) {
|
|
|
221
221
|
const { zoomType, trackID } = action?.payload || {};
|
|
222
222
|
const { xDomain, yDomain } = draft.originDomain;
|
|
223
223
|
const zoomHistory = zoomHistoryManager(draft.zoom.history, draft.view.spectra.activeTab, { xDomain, yDomain });
|
|
224
|
-
if (draft.displayerMode ===
|
|
224
|
+
if (draft.displayerMode === '1D') {
|
|
225
225
|
switch (zoomType) {
|
|
226
226
|
case ZOOM_TYPES.HORIZONTAL: {
|
|
227
227
|
draft.xDomain = xDomain;
|
|
@@ -280,12 +280,12 @@ function hasAcceptedSpectrum(draft, index) {
|
|
|
280
280
|
function setMargin(draft) {
|
|
281
281
|
const activeSpectrum = getActiveSpectrum(draft);
|
|
282
282
|
const spectrum = (activeSpectrum?.id && draft.data[activeSpectrum.index]) || null;
|
|
283
|
-
if (draft.displayerMode ===
|
|
283
|
+
if (draft.displayerMode === '2D' &&
|
|
284
284
|
(draft.toolOptions.selectedTool === Tools.slicing.id ||
|
|
285
285
|
spectrum?.info.isFid)) {
|
|
286
286
|
draft.margin = MARGIN['2D'];
|
|
287
287
|
}
|
|
288
|
-
else if (draft.displayerMode ===
|
|
288
|
+
else if (draft.displayerMode === '2D') {
|
|
289
289
|
const top = hasAcceptedSpectrum(draft, 0)
|
|
290
290
|
? MARGIN['2D'].top
|
|
291
291
|
: MARGIN['1D'].top;
|
|
@@ -294,7 +294,7 @@ function setMargin(draft) {
|
|
|
294
294
|
: MARGIN['1D'].left;
|
|
295
295
|
draft.margin = { ...MARGIN['2D'], top, left };
|
|
296
296
|
}
|
|
297
|
-
else if (draft.displayerMode ===
|
|
297
|
+
else if (draft.displayerMode === '1D') {
|
|
298
298
|
draft.margin = MARGIN['1D'];
|
|
299
299
|
}
|
|
300
300
|
}
|
|
@@ -302,8 +302,8 @@ function setMargin(draft) {
|
|
|
302
302
|
function setDisplayerMode(draft, data) {
|
|
303
303
|
draft.displayerMode =
|
|
304
304
|
data && data.some((d) => d.info.dimension === 2)
|
|
305
|
-
?
|
|
306
|
-
:
|
|
305
|
+
? '2D'
|
|
306
|
+
: '1D';
|
|
307
307
|
}
|
|
308
308
|
//utility
|
|
309
309
|
function setTabActiveSpectrum(draft, dataGroupByTab) {
|
|
@@ -416,7 +416,7 @@ function levelChangeHandler(draft, action) {
|
|
|
416
416
|
}
|
|
417
417
|
}
|
|
418
418
|
function setSpectraSameTopHandler(draft) {
|
|
419
|
-
if (draft.displayerMode ===
|
|
419
|
+
if (draft.displayerMode === '1D') {
|
|
420
420
|
draft.originDomain.shareYDomain = false;
|
|
421
421
|
setZoom(draft, { scale: 0.8 });
|
|
422
422
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { DISPLAYER_MODE } from '../core/Constants';
|
|
2
1
|
export default function zoomHistoryManager(zoomHistory, nucleus, baseZoom) {
|
|
3
2
|
if (!zoomHistory[nucleus] && !Array.isArray(zoomHistory[nucleus])) {
|
|
4
3
|
zoomHistory[nucleus] = [];
|
|
@@ -38,7 +37,7 @@ export function addToBrushHistory(draft, options) {
|
|
|
38
37
|
draft.zoom.history,
|
|
39
38
|
// eslint-disable-next-line unicorn/consistent-destructuring
|
|
40
39
|
draft.view.spectra.activeTab);
|
|
41
|
-
if (displayerMode ===
|
|
40
|
+
if (displayerMode === '2D') {
|
|
42
41
|
switch (trackID) {
|
|
43
42
|
case 'CENTER_2D':
|
|
44
43
|
draft.xDomain = xDomain;
|
|
@@ -2,7 +2,7 @@ import { MultipleSpectraAnalysisPreferences, Workspace, WorkSpaceSource } from '
|
|
|
2
2
|
import { Reducer } from 'react';
|
|
3
3
|
import { SplitPaneSize } from 'react-science/ui';
|
|
4
4
|
import { MatrixOptions } from '../../../data/types/data1d/MatrixOptions';
|
|
5
|
-
import { NMRiumWorkspace, NMRiumPreferences } from '../../
|
|
5
|
+
import type { NMRiumWorkspace, NMRiumPreferences } from '../../main';
|
|
6
6
|
import { ActionType } from '../types/ActionType';
|
|
7
7
|
export declare const WORKSPACES_KEYS: {
|
|
8
8
|
componentKey: string;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { CustomWorkspaces } from 'nmr-load-save';
|
|
2
|
-
import { NMRiumWorkspace } from '../../../
|
|
2
|
+
import type { NMRiumWorkspace } from '../../../main';
|
|
3
3
|
export declare function getPreferencesByWorkspace(workspace: NMRiumWorkspace, originalWorkspaces: CustomWorkspaces): Required<import("nmr-load-save").WorkspacePreferences> & import("nmr-load-save/lib/types/WorkSpace").WorkspaceMeta & import("nmr-load-save").WorkspacePreferences;
|