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,5 +1,5 @@
|
|
|
1
1
|
import { Draft } from 'immer';
|
|
2
|
-
import { Integral } from 'nmr-
|
|
2
|
+
import { Integral } from 'nmr-processing';
|
|
3
3
|
import { SetSumOptions } from '../../../data/data1d/Spectrum1D/SumManager';
|
|
4
4
|
import { State } from '../Reducer';
|
|
5
5
|
import { ActionType } from '../types/ActionType';
|
|
@@ -26,13 +26,15 @@ function handleAddIntegral(draft, action) {
|
|
|
26
26
|
const datum = data[activeSpectrum.index];
|
|
27
27
|
const { x, re } = datum.data;
|
|
28
28
|
const shiftX = getShiftX(datum);
|
|
29
|
+
const integration = xyIntegration({ x, y: re }, { from, to, reverse: true });
|
|
29
30
|
const integral = {
|
|
30
31
|
id: v4(),
|
|
31
32
|
originFrom: from - shiftX,
|
|
32
33
|
originTo: to - shiftX,
|
|
33
34
|
from,
|
|
34
35
|
to,
|
|
35
|
-
|
|
36
|
+
integral: integration,
|
|
37
|
+
absolute: integration,
|
|
36
38
|
kind: 'signal',
|
|
37
39
|
};
|
|
38
40
|
datum.integrals.values.push(integral);
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Draft } from 'immer';
|
|
2
|
-
import {
|
|
2
|
+
import { Spectrum, OnLoadProcessing, NmriumState } from 'nmr-load-save';
|
|
3
3
|
import { ParseResult } from 'papaparse';
|
|
4
4
|
import { UsedColors } from '../../../types/UsedColors';
|
|
5
|
-
import { OnLoadProcessing } from '../../workspaces/Workspace';
|
|
6
5
|
import { State } from '../Reducer';
|
|
7
6
|
import { ActionType } from '../types/ActionType';
|
|
8
7
|
interface InitiateProps {
|
|
@@ -7,7 +7,7 @@ import * as MoleculeManager from '../../../data/molecules/MoleculeManager';
|
|
|
7
7
|
import { linkMetaWithSpectra } from '../../../data/parseMeta/linkMetaWithSpectra';
|
|
8
8
|
import { DefaultTolerance } from '../../panels/SummaryPanel/CorrelationTable/Constants';
|
|
9
9
|
import nucleusToString from '../../utility/nucleusToString';
|
|
10
|
-
import { getDefaultViewState, getInitialState
|
|
10
|
+
import { getDefaultViewState, getInitialState } from '../Reducer';
|
|
11
11
|
import { changeSpectrumVerticalAlignment } from './PreferencesActions';
|
|
12
12
|
import { setSpectraMetaInfo } from './SpectrumsActions';
|
|
13
13
|
import { setActiveTab } from './ToolsActions';
|
|
@@ -4,18 +4,21 @@ import { MoleculeBoundingRect, StateMolecule } from '../../../data/molecules/Mol
|
|
|
4
4
|
import { AssignmentContext } from '../../assignment/AssignmentsContext';
|
|
5
5
|
import { State } from '../Reducer';
|
|
6
6
|
import { ActionType } from '../types/ActionType';
|
|
7
|
-
|
|
7
|
+
interface AddMoleculeProps {
|
|
8
8
|
molfile: string;
|
|
9
|
-
|
|
9
|
+
floatMoleculeOnSave?: boolean;
|
|
10
|
+
}
|
|
11
|
+
type AddMoleculeAction = ActionType<'ADD_MOLECULE', AddMoleculeProps>;
|
|
10
12
|
type SetMoleculeAction = ActionType<'SET_MOLECULE', Required<StateMolecule>>;
|
|
11
13
|
type DeleteMoleculeAction = ActionType<'DELETE_MOLECULE', {
|
|
12
14
|
id: string;
|
|
13
15
|
assignmentData: AssignmentContext;
|
|
14
16
|
}>;
|
|
15
17
|
type PredictSpectraFromMoleculeAction = ActionType<'PREDICT_SPECTRA', {
|
|
16
|
-
molfile: string;
|
|
17
18
|
options: PredictionOptions;
|
|
18
|
-
predictedSpectra
|
|
19
|
+
predictedSpectra: PredictedSpectraResult;
|
|
20
|
+
molecule: StateMolecule;
|
|
21
|
+
action?: 'save' | 'add';
|
|
19
22
|
}>;
|
|
20
23
|
type ToggleMoleculeViewObjectAction = ActionType<'FLOAT_MOLECULE_OVER_SPECTRUM' | 'TOGGLE_MOLECULE_ATOM_NUMBER', {
|
|
21
24
|
id: string;
|
|
@@ -3,14 +3,12 @@ import { changeSpectraRelativeSum } from '../../../data/data1d/Spectrum1D/SumMan
|
|
|
3
3
|
import { DRAGGABLE_STRUCTURE_INITIAL_BOUNDING_REACT, } from '../../../data/molecules/Molecule';
|
|
4
4
|
import * as MoleculeManager from '../../../data/molecules/MoleculeManager';
|
|
5
5
|
import { generateColor } from '../../../data/utilities/generateColor';
|
|
6
|
-
import nucleusToString from '../../utility/nucleusToString';
|
|
7
6
|
import { DISPLAYER_MODE, MARGIN } from '../core/Constants';
|
|
8
7
|
import { unlinkRange } from './RangesActions';
|
|
9
8
|
import { setActiveTab } from './ToolsActions';
|
|
10
9
|
import { unlinkZone } from './ZonesActions';
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const { molfile } = action.payload;
|
|
10
|
+
function addMolecule(draft, props) {
|
|
11
|
+
const { molfile, floatMoleculeOnSave } = props;
|
|
14
12
|
const isEmpty = draft.molecules.length === 0;
|
|
15
13
|
MoleculeManager.addMolfile(draft.molecules, molfile);
|
|
16
14
|
/**
|
|
@@ -21,10 +19,18 @@ function handleAddMolecule(draft, action) {
|
|
|
21
19
|
if (isEmpty && molecule) {
|
|
22
20
|
changeSpectraRelativeSum(draft, molecule.id, molecule);
|
|
23
21
|
}
|
|
22
|
+
const lastAddedMolecule = draft.molecules.at(-1);
|
|
23
|
+
if (floatMoleculeOnSave && lastAddedMolecule) {
|
|
24
|
+
floatMoleculeOverSpectrum(draft, lastAddedMolecule.id, true);
|
|
25
|
+
}
|
|
26
|
+
return lastAddedMolecule;
|
|
24
27
|
}
|
|
25
28
|
//action
|
|
26
|
-
function
|
|
27
|
-
|
|
29
|
+
function handleAddMolecule(draft, action) {
|
|
30
|
+
addMolecule(draft, action.payload);
|
|
31
|
+
}
|
|
32
|
+
function setMolecule(draft, props) {
|
|
33
|
+
const { id, label, molfile } = props;
|
|
28
34
|
MoleculeManager.setMolfile(draft.molecules, {
|
|
29
35
|
id,
|
|
30
36
|
label,
|
|
@@ -36,6 +42,10 @@ function handleSetMolecule(draft, action) {
|
|
|
36
42
|
const index = draft.molecules.findIndex((molecule) => molecule.id === id);
|
|
37
43
|
changeSpectraRelativeSum(draft, id, index !== -1 ? draft.molecules[index] : draft.molecules[0] || null);
|
|
38
44
|
}
|
|
45
|
+
//action
|
|
46
|
+
function handleSetMolecule(draft, action) {
|
|
47
|
+
setMolecule(draft, action.payload);
|
|
48
|
+
}
|
|
39
49
|
function removeAssignments(draft, assignmentData) {
|
|
40
50
|
if (draft.displayerMode === DISPLAYER_MODE.DM_1D) {
|
|
41
51
|
unlinkRange(draft, { assignmentData });
|
|
@@ -62,27 +72,43 @@ function handleDeleteMolecule(draft, action) {
|
|
|
62
72
|
}
|
|
63
73
|
//action
|
|
64
74
|
function handlePredictSpectraFromMolecule(draft, action) {
|
|
65
|
-
const { predictedSpectra, options } = action.payload;
|
|
66
|
-
|
|
67
|
-
|
|
75
|
+
const { predictedSpectra, options, molecule, action: predictionAction = 'save', } = action.payload;
|
|
76
|
+
const color = generateColor(false, draft.usedColors['1d']);
|
|
77
|
+
const spectraIds = [];
|
|
78
|
+
for (const spectrum of generateSpectra(predictedSpectra, options, color)) {
|
|
79
|
+
draft.data.push(spectrum);
|
|
80
|
+
spectraIds.push(spectrum.id);
|
|
81
|
+
}
|
|
82
|
+
let id = molecule?.id;
|
|
83
|
+
//if the id object is not exits add a new molecule
|
|
84
|
+
if (!id || predictionAction === 'add') {
|
|
85
|
+
const moleculeObj = addMolecule(draft, {
|
|
86
|
+
molfile: molecule.molfile,
|
|
87
|
+
floatMoleculeOnSave: true,
|
|
88
|
+
});
|
|
89
|
+
id = moleculeObj?.id;
|
|
68
90
|
}
|
|
69
91
|
else {
|
|
70
|
-
|
|
71
|
-
for (const spectrum of generateSpectra(predictedSpectra, options, color)) {
|
|
72
|
-
draft.data.push(spectrum);
|
|
73
|
-
draft.view.spectra.activeSpectra[nucleusToString(spectrum.info.nucleus)] =
|
|
74
|
-
[
|
|
75
|
-
{
|
|
76
|
-
id: spectrum.id,
|
|
77
|
-
index: draft.data.length - 1,
|
|
78
|
-
},
|
|
79
|
-
];
|
|
80
|
-
}
|
|
81
|
-
draft.usedColors['1d'].push(color);
|
|
92
|
+
setMolecule(draft, molecule);
|
|
82
93
|
}
|
|
94
|
+
if (id) {
|
|
95
|
+
//save a set of the predicted spectra Ids by molecule ID in the view object in case we predict the spectra again we remove the old ones
|
|
96
|
+
setPredictedSpectraReference(draft, id, spectraIds);
|
|
97
|
+
}
|
|
98
|
+
draft.usedColors['1d'] = draft.usedColors['1d'].filter((previousColor) => previousColor !== color);
|
|
99
|
+
draft.usedColors['1d'].push(color);
|
|
83
100
|
draft.toolOptions.data.predictionIndex++;
|
|
84
|
-
setActiveTab(draft);
|
|
85
|
-
|
|
101
|
+
setActiveTab(draft, { refreshActiveTab: true, tab: '1H' });
|
|
102
|
+
}
|
|
103
|
+
function setPredictedSpectraReference(draft, moleculeId, spectraIds) {
|
|
104
|
+
const predictedSpectraIds = draft.view.predictions?.[moleculeId];
|
|
105
|
+
// check if the molecule predicted and return and the spectra Ids
|
|
106
|
+
if (predictedSpectraIds) {
|
|
107
|
+
//remove the old predicted spectra for the current molecule
|
|
108
|
+
draft.data = draft.data.filter((spectrum) => !predictedSpectraIds.includes(spectrum.id));
|
|
109
|
+
}
|
|
110
|
+
// set the predicted spectra ids
|
|
111
|
+
draft.view.predictions[moleculeId] = spectraIds;
|
|
86
112
|
}
|
|
87
113
|
function initMoleculeViewProperties(id, draft) {
|
|
88
114
|
// check if the molecule is exists in the view object otherwise add it with the default value
|
|
@@ -123,14 +149,17 @@ function getFloatingMoleculeInitialPosition(id, draft) {
|
|
|
123
149
|
const y = Math.floor(moleculeKeys.length / columns) * (height / rows) + top;
|
|
124
150
|
return { x, y };
|
|
125
151
|
}
|
|
152
|
+
function floatMoleculeOverSpectrum(draft, moleculeId, value) {
|
|
153
|
+
initMoleculeViewProperties(moleculeId, draft);
|
|
154
|
+
const molecule = getMoleculeViewObject(moleculeId, draft);
|
|
155
|
+
if (molecule) {
|
|
156
|
+
molecule.floating.visible = value ?? !molecule.floating.visible;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
126
159
|
//action
|
|
127
160
|
function handleFloatMoleculeOverSpectrum(draft, action) {
|
|
128
161
|
const { id } = action.payload;
|
|
129
|
-
|
|
130
|
-
const molecule = getMoleculeViewObject(id, draft);
|
|
131
|
-
if (molecule) {
|
|
132
|
-
molecule.floating.visible = !molecule.floating.visible;
|
|
133
|
-
}
|
|
162
|
+
floatMoleculeOverSpectrum(draft, id);
|
|
134
163
|
}
|
|
135
164
|
//action
|
|
136
165
|
function handleToggleMoleculeAtomsNumbers(draft, action) {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Draft } from 'immer';
|
|
2
|
-
import { Peak1D } from 'nmr-
|
|
3
|
-
import { OptionsXYAutoPeaksPicking } from 'nmr-processing';
|
|
2
|
+
import { Peak1D, OptionsXYAutoPeaksPicking } from 'nmr-processing';
|
|
4
3
|
import { defaultPeaksViewState } from '../../hooks/useActiveSpectrumPeaksViewState';
|
|
5
4
|
import { State } from '../Reducer';
|
|
6
5
|
import { ActionType } from '../types/ActionType';
|
|
@@ -61,15 +61,15 @@ function handleAddPeaks(draft, action) {
|
|
|
61
61
|
//action
|
|
62
62
|
function handleDeletePeak(draft, action) {
|
|
63
63
|
const activeSpectrum = getActiveSpectrum(draft);
|
|
64
|
-
const
|
|
64
|
+
const peakId = action?.payload?.id;
|
|
65
65
|
if (activeSpectrum) {
|
|
66
66
|
const { index } = activeSpectrum;
|
|
67
67
|
const state = original(draft);
|
|
68
|
-
if (!
|
|
68
|
+
if (!peakId) {
|
|
69
69
|
draft.data[index].peaks.values = [];
|
|
70
70
|
}
|
|
71
71
|
else {
|
|
72
|
-
const peakIndex = state.data[index].peaks.values.findIndex((p) => p.id ===
|
|
72
|
+
const peakIndex = state.data[index].peaks.values.findIndex((p) => p.id === peakId);
|
|
73
73
|
draft.data[index].peaks.values.splice(peakIndex, 1);
|
|
74
74
|
}
|
|
75
75
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Draft } from 'immer';
|
|
2
|
-
import {
|
|
2
|
+
import { Spectrum } from 'nmr-load-save';
|
|
3
|
+
import { Signal1D, Range } from 'nmr-processing';
|
|
3
4
|
import { SetSumOptions } from '../../../data/data1d/Spectrum1D/SumManager';
|
|
4
5
|
import { ChangeRangeRelativeValueProps } from '../../../data/data1d/Spectrum1D/ranges/changeRangeRelativeValue';
|
|
5
6
|
import { AssignmentContext } from '../../assignment/AssignmentsContext';
|
|
@@ -46,12 +47,10 @@ type ResizeRangeAction = ActionType<'RESIZE_RANGE', {
|
|
|
46
47
|
type ChangeRangeSumAction = ActionType<'CHANGE_RANGE_SUM', {
|
|
47
48
|
options: SetSumOptions;
|
|
48
49
|
}>;
|
|
49
|
-
|
|
50
|
+
type AddRangeAction = ActionType<'ADD_RANGE', {
|
|
50
51
|
startX: number;
|
|
51
52
|
endX: number;
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
type AddRangeAction = ActionType<'ADD_RANGE', Partial<Omit<AddRangeProps, 'id'>>>;
|
|
53
|
+
}>;
|
|
55
54
|
type ChangeRangeRelativeValueAction = ActionType<'CHANGE_RANGE_RELATIVE', ChangeRangeRelativeValueProps>;
|
|
56
55
|
type ChangeRangeSignalValueAction = ActionType<'CHANGE_RANGE_SIGNAL_VALUE', {
|
|
57
56
|
rangeID: string;
|
|
@@ -2,8 +2,7 @@ import { v4 } from '@lukeed/uuid';
|
|
|
2
2
|
import { original } from 'immer';
|
|
3
3
|
import cloneDeep from 'lodash/cloneDeep';
|
|
4
4
|
import { xFindClosestIndex } from 'ml-spectra-processing';
|
|
5
|
-
import
|
|
6
|
-
import * as FiltersManager from '../../../data/FiltersManager';
|
|
5
|
+
import { Filters, FiltersManager } from 'nmr-processing';
|
|
7
6
|
import { DatumKind, SignalKindsToInclude, } from '../../../data/constants/SignalsKinds';
|
|
8
7
|
import { addRange, changeRangeSignal, detectRanges, updateRangesRelativeValues, changeRange, changeRangeRelativeValue, } from '../../../data/data1d/Spectrum1D';
|
|
9
8
|
import { setSumOptions, } from '../../../data/data1d/Spectrum1D/SumManager';
|
|
@@ -249,26 +248,18 @@ function handleChangeRangeSum(draft, action) {
|
|
|
249
248
|
updateRangesRelativeValues(datum, true);
|
|
250
249
|
}
|
|
251
250
|
}
|
|
252
|
-
|
|
253
|
-
|
|
251
|
+
//action
|
|
252
|
+
function handleAddRange(draft, action) {
|
|
253
|
+
const { startX, endX } = action.payload;
|
|
254
254
|
const range = getRange(draft, { startX, endX });
|
|
255
|
-
const { data, view: { spectra: { activeTab: nucleus },
|
|
255
|
+
const { data, view: { spectra: { activeTab: nucleus }, }, molecules, } = draft;
|
|
256
256
|
const activeSpectrum = getActiveSpectrum(draft);
|
|
257
257
|
if (activeSpectrum?.id) {
|
|
258
258
|
const { index } = activeSpectrum;
|
|
259
259
|
const [from, to] = range;
|
|
260
|
-
// add range intial state
|
|
261
|
-
const rangeState = ranges.find((r) => r.spectrumID === activeSpectrum.id);
|
|
262
|
-
if (!rangeState) {
|
|
263
|
-
ranges.push({
|
|
264
|
-
spectrumID: activeSpectrum.id,
|
|
265
|
-
...rangeStateInit,
|
|
266
|
-
});
|
|
267
|
-
}
|
|
268
260
|
addRange(data[index], {
|
|
269
261
|
from,
|
|
270
262
|
to,
|
|
271
|
-
id,
|
|
272
263
|
nucleus,
|
|
273
264
|
molecules,
|
|
274
265
|
});
|
|
@@ -277,19 +268,6 @@ function addNewRange(draft, props) {
|
|
|
277
268
|
}
|
|
278
269
|
}
|
|
279
270
|
//action
|
|
280
|
-
function handleAddRange(draft, action) {
|
|
281
|
-
let { startX, endX } = action?.payload || {};
|
|
282
|
-
if (startX && endX) {
|
|
283
|
-
addNewRange(draft, { startX, endX });
|
|
284
|
-
}
|
|
285
|
-
else {
|
|
286
|
-
const { width } = draft;
|
|
287
|
-
startX = width / 3;
|
|
288
|
-
endX = startX + 10;
|
|
289
|
-
addNewRange(draft, { startX, endX, id: 'new' });
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
//action
|
|
293
271
|
function handleChangeRangeRelativeValue(draft, action) {
|
|
294
272
|
const data = action.payload;
|
|
295
273
|
const activeSpectrum = getActiveSpectrum(draft);
|
|
@@ -2,12 +2,10 @@ import { original } from 'immer';
|
|
|
2
2
|
import lodashGet from 'lodash/get';
|
|
3
3
|
import omitBy from 'lodash/omitBy';
|
|
4
4
|
import lodashSet from 'lodash/set';
|
|
5
|
-
import
|
|
6
|
-
import { applyFilter } from '../../../data/FiltersManager';
|
|
5
|
+
import { Filters, FiltersManager } from 'nmr-processing';
|
|
7
6
|
import { generateSpectrumFromPublicationString, getReferenceShift, isSpectrum1D, get1DColor, } from '../../../data/data1d/Spectrum1D';
|
|
8
7
|
import { getMissingProjection, isSpectrum2D, get2DColor, } from '../../../data/data2d/Spectrum2D';
|
|
9
8
|
import { contoursManager } from '../../../data/data2d/Spectrum2D/contours';
|
|
10
|
-
import { options } from '../../toolbar/ToolTypes';
|
|
11
9
|
import groupByInfoKey from '../../utility/GroupByInfoKey';
|
|
12
10
|
import { getSpectraByNucleus } from '../../utility/getSpectraByNucleus';
|
|
13
11
|
import { setZoom } from '../helper/Zoom1DManager';
|
|
@@ -17,6 +15,7 @@ import { getActiveSpectrum } from '../helper/getActiveSpectrum';
|
|
|
17
15
|
import { setDomain, setMode } from './DomainActions';
|
|
18
16
|
import { rollbackSpectrumByFilter } from './FiltersActions';
|
|
19
17
|
import { setTab, setActiveTab, setMargin, resetSelectedTool, } from './ToolsActions';
|
|
18
|
+
const { applyFilter } = FiltersManager;
|
|
20
19
|
function checkIsVisible2D(datum) {
|
|
21
20
|
if (!datum.display.isPositiveVisible && !datum.display.isNegativeVisible) {
|
|
22
21
|
return false;
|
|
@@ -204,8 +203,7 @@ function handleChangeActiveSpectrum(draft, action) {
|
|
|
204
203
|
setMargin(draft);
|
|
205
204
|
setMode(draft);
|
|
206
205
|
}
|
|
207
|
-
if (
|
|
208
|
-
!toolOptions.data.activeFilterID) {
|
|
206
|
+
if (!toolOptions.data.activeFilterID) {
|
|
209
207
|
resetSelectedTool(draft);
|
|
210
208
|
}
|
|
211
209
|
}
|
|
@@ -292,9 +290,11 @@ function handleAlignSpectraHandler(draft, action) {
|
|
|
292
290
|
function handleGenerateSpectrumFromPublicationStringHandler(draft, action) {
|
|
293
291
|
const publicationString = action.payload.publicationText;
|
|
294
292
|
const spectrum = generateSpectrumFromPublicationString(publicationString, draft.usedColors);
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
293
|
+
if (spectrum) {
|
|
294
|
+
draft.data.push(spectrum);
|
|
295
|
+
setActiveTab(draft);
|
|
296
|
+
setZoom(draft, { scale: 0.8, spectrumID: spectrum.id });
|
|
297
|
+
}
|
|
298
298
|
}
|
|
299
299
|
//action
|
|
300
300
|
function handleImportSpectraMetaInfo(draft, action) {
|
|
@@ -11,10 +11,10 @@ interface BrushBoundary {
|
|
|
11
11
|
startY: number;
|
|
12
12
|
endX: number;
|
|
13
13
|
endY: number;
|
|
14
|
-
trackID?: Layout;
|
|
14
|
+
trackID?: Layout | null;
|
|
15
15
|
}
|
|
16
16
|
interface SetActiveTabOptions {
|
|
17
|
-
tab?:
|
|
17
|
+
tab?: Nucleus | null;
|
|
18
18
|
refreshActiveTab?: boolean;
|
|
19
19
|
domainOptions?: SetDomainOptions;
|
|
20
20
|
}
|
|
@@ -11,7 +11,7 @@ import { getSpectraByNucleus } from '../../utility/getSpectraByNucleus';
|
|
|
11
11
|
import { rangeStateInit } from '../Reducer';
|
|
12
12
|
import { DISPLAYER_MODE, MARGIN } from '../core/Constants';
|
|
13
13
|
import { setZoom, wheelZoom, ZOOM_TYPES, } from '../helper/Zoom1DManager';
|
|
14
|
-
import zoomHistoryManager from '../helper/ZoomHistoryManager';
|
|
14
|
+
import zoomHistoryManager, { addToBrushHistory, } from '../helper/ZoomHistoryManager';
|
|
15
15
|
import { getActiveSpectra } from '../helper/getActiveSpectra';
|
|
16
16
|
import { getActiveSpectrum } from '../helper/getActiveSpectrum';
|
|
17
17
|
import { getVerticalAlign } from '../helper/getVerticalAlign';
|
|
@@ -145,7 +145,7 @@ function handleToggleRealImaginaryVisibility(draft) {
|
|
|
145
145
|
}
|
|
146
146
|
function handleBrushEnd(draft, action) {
|
|
147
147
|
const is2D = draft.displayerMode === DISPLAYER_MODE.DM_2D;
|
|
148
|
-
const { height, margin, yDomain, yDomains, width, xDomains, xDomain, mode
|
|
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);
|
|
151
151
|
const yScale = is2D
|
|
@@ -158,36 +158,7 @@ function handleBrushEnd(draft, action) {
|
|
|
158
158
|
const endY = yScale.invert(_endY);
|
|
159
159
|
const domainX = startX > endX ? [endX, startX] : [startX, endX];
|
|
160
160
|
const domainY = startY > endY ? [endY, startY] : [startY, endY];
|
|
161
|
-
|
|
162
|
-
// eslint-disable-next-line unicorn/consistent-destructuring
|
|
163
|
-
draft.zoom.history,
|
|
164
|
-
// eslint-disable-next-line unicorn/consistent-destructuring
|
|
165
|
-
draft.view.spectra.activeTab);
|
|
166
|
-
if (displayerMode === DISPLAYER_MODE.DM_2D) {
|
|
167
|
-
switch (trackID) {
|
|
168
|
-
case 'CENTER_2D':
|
|
169
|
-
draft.xDomain = domainX;
|
|
170
|
-
draft.yDomain = domainY;
|
|
171
|
-
break;
|
|
172
|
-
case 'TOP_1D':
|
|
173
|
-
draft.xDomain = domainX;
|
|
174
|
-
break;
|
|
175
|
-
case 'LEFT_1D':
|
|
176
|
-
draft.yDomain = domainY;
|
|
177
|
-
break;
|
|
178
|
-
default:
|
|
179
|
-
break;
|
|
180
|
-
}
|
|
181
|
-
if (brushHistory) {
|
|
182
|
-
brushHistory.push({ xDomain, yDomain });
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
else {
|
|
186
|
-
draft.xDomain = domainX;
|
|
187
|
-
if (brushHistory) {
|
|
188
|
-
brushHistory.push({ xDomain: domainX, yDomain: domainY });
|
|
189
|
-
}
|
|
190
|
-
}
|
|
161
|
+
addToBrushHistory(draft, { trackID, xDomain: domainX, yDomain: domainY });
|
|
191
162
|
}
|
|
192
163
|
function setVerticalIndicatorXPosition(draft, action) {
|
|
193
164
|
const { position } = action.payload;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { FromTo } from 'cheminfo-types';
|
|
2
2
|
import { Draft } from 'immer';
|
|
3
|
-
import {
|
|
3
|
+
import type { Spectrum, Spectrum2D } from 'nmr-load-save';
|
|
4
|
+
import type { Signal2D, Zone } from 'nmr-processing';
|
|
4
5
|
import { AssignmentContext, Axis } from '../../assignment/AssignmentsContext';
|
|
5
6
|
import { ZoneData } from '../../panels/ZonesPanel/hooks/useMapZones';
|
|
6
7
|
import { State } from '../Reducer';
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { original } from 'immer';
|
|
2
2
|
import lodashCloneDeep from 'lodash/cloneDeep';
|
|
3
3
|
import { setPathLength } from 'nmr-correlation';
|
|
4
|
-
import
|
|
5
|
-
import * as FiltersManager from '../../../data/FiltersManager';
|
|
4
|
+
import { Filters, FiltersManager } from 'nmr-processing';
|
|
6
5
|
import { DatumKind, SignalKindsToInclude, } from '../../../data/constants/SignalsKinds';
|
|
7
6
|
import { changeZoneSignal, detectZones, detectZonesManual, } from '../../../data/data2d/Spectrum2D';
|
|
8
7
|
import { unlink, unlinkInAssignmentData, } from '../../../data/utilities/ZoneUtilities';
|
|
@@ -54,10 +53,8 @@ function handleAutoZonesDetection(draft, action) {
|
|
|
54
53
|
function handleAutoSpectraZonesDetection(draft) {
|
|
55
54
|
for (const datum of draft.data) {
|
|
56
55
|
const { info, data } = datum;
|
|
57
|
-
if (info.dimension === 2) {
|
|
58
|
-
const { minX, maxX, minY, maxY } =
|
|
59
|
-
? data.re
|
|
60
|
-
: data.rr;
|
|
56
|
+
if (info.dimension === 2 && info.isFt) {
|
|
57
|
+
const { minX, maxX, minY, maxY } = data.rr;
|
|
61
58
|
const detectionOptions = {
|
|
62
59
|
selectedZone: { fromX: minX, toX: maxX, fromY: minY, toY: maxY },
|
|
63
60
|
thresholdFactor: 1,
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { Draft } from 'immer';
|
|
2
|
+
import { Layout } from '../../2d/utilities/DimensionLayout';
|
|
3
|
+
import { State } from '../Reducer';
|
|
1
4
|
interface HistoryItem {
|
|
2
5
|
xDomain: Array<number>;
|
|
3
6
|
yDomain: Array<number>;
|
|
@@ -13,4 +16,9 @@ interface ZoomHistoryManager {
|
|
|
13
16
|
clear: () => void;
|
|
14
17
|
}
|
|
15
18
|
export default function zoomHistoryManager(zoomHistory: ZoomHistory, nucleus: string, baseZoom?: HistoryItem): ZoomHistoryManager;
|
|
19
|
+
export declare function addToBrushHistory(draft: Draft<State>, options: {
|
|
20
|
+
trackID?: Layout | null;
|
|
21
|
+
xDomain: number[];
|
|
22
|
+
yDomain: number[];
|
|
23
|
+
}): void;
|
|
16
24
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DISPLAYER_MODE } from '../core/Constants';
|
|
1
2
|
export default function zoomHistoryManager(zoomHistory, nucleus, baseZoom) {
|
|
2
3
|
if (!zoomHistory[nucleus] && !Array.isArray(zoomHistory[nucleus])) {
|
|
3
4
|
zoomHistory[nucleus] = [];
|
|
@@ -29,3 +30,37 @@ function prepareGetLast(historyStack) {
|
|
|
29
30
|
return historyStack.at(-1);
|
|
30
31
|
};
|
|
31
32
|
}
|
|
33
|
+
export function addToBrushHistory(draft, options) {
|
|
34
|
+
const { displayerMode } = draft;
|
|
35
|
+
const { trackID, xDomain, yDomain } = options;
|
|
36
|
+
const brushHistory = zoomHistoryManager(
|
|
37
|
+
// eslint-disable-next-line unicorn/consistent-destructuring
|
|
38
|
+
draft.zoom.history,
|
|
39
|
+
// eslint-disable-next-line unicorn/consistent-destructuring
|
|
40
|
+
draft.view.spectra.activeTab);
|
|
41
|
+
if (displayerMode === DISPLAYER_MODE.DM_2D) {
|
|
42
|
+
switch (trackID) {
|
|
43
|
+
case 'CENTER_2D':
|
|
44
|
+
draft.xDomain = xDomain;
|
|
45
|
+
draft.yDomain = yDomain;
|
|
46
|
+
break;
|
|
47
|
+
case 'TOP_1D':
|
|
48
|
+
draft.xDomain = xDomain;
|
|
49
|
+
break;
|
|
50
|
+
case 'LEFT_1D':
|
|
51
|
+
draft.yDomain = yDomain;
|
|
52
|
+
break;
|
|
53
|
+
default:
|
|
54
|
+
break;
|
|
55
|
+
}
|
|
56
|
+
if (brushHistory) {
|
|
57
|
+
brushHistory.push({ xDomain, yDomain });
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
draft.xDomain = xDomain;
|
|
62
|
+
if (brushHistory) {
|
|
63
|
+
brushHistory.push({ xDomain, yDomain });
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Draft } from 'immer';
|
|
2
2
|
import { State } from '../Reducer';
|
|
3
|
-
export declare function getActiveSpectra(state: Draft<State> | State): import("
|
|
3
|
+
export declare function getActiveSpectra(state: Draft<State> | State): import("nmr-load-save").ActiveSpectrum[] | null;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Draft } from 'immer';
|
|
2
2
|
import { State } from '../Reducer';
|
|
3
|
-
export declare function getActiveSpectrum(state: Draft<State> | State): import("
|
|
3
|
+
export declare function getActiveSpectrum(state: Draft<State> | State): import("nmr-load-save").ActiveSpectrum | null;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Draft } from 'immer';
|
|
2
2
|
import { State, VerticalAlignment } from '../Reducer';
|
|
3
|
-
export declare function getVerticalAlign(state: State | Draft<State>, defaultAlign?: VerticalAlignment):
|
|
3
|
+
export declare function getVerticalAlign(state: State | Draft<State>, defaultAlign?: VerticalAlignment): any;
|
|
@@ -3,12 +3,12 @@ import lodashMerge from 'lodash/merge';
|
|
|
3
3
|
import { getLocalStorage, storeData } from '../../../utility/LocalStorage';
|
|
4
4
|
import { workspaceDefaultProperties } from '../../../workspaces/workspaceDefaultProperties';
|
|
5
5
|
export function addWorkspace(draft, action) {
|
|
6
|
-
const {
|
|
6
|
+
const { workspaceKey, data } = action.payload;
|
|
7
7
|
const newWorkSpace = lodashMerge({}, workspaceDefaultProperties,
|
|
8
8
|
// eslint-disable-next-line unicorn/prefer-logical-operator-over-ternary
|
|
9
9
|
data ? data : draft.workspaces[draft.workspace.current], {
|
|
10
10
|
version: 1,
|
|
11
|
-
label:
|
|
11
|
+
label: workspaceKey,
|
|
12
12
|
source: 'user',
|
|
13
13
|
});
|
|
14
14
|
const newWorkspaceKey = v4();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PanelsPreferences } from '
|
|
1
|
+
import { PanelsPreferences } from 'nmr-load-save';
|
|
2
2
|
declare const getSpectraDefaultValues: (nucleus?: string) => PanelsPreferences['spectra'];
|
|
3
3
|
declare const getIntegralDefaultValues: (nucleus?: string) => PanelsPreferences['integrals'];
|
|
4
4
|
declare const getZoneDefaultValues: (nucleus?: string) => PanelsPreferences['zones'];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { MultipleSpectraAnalysisPreferences, Workspace, WorkSpaceSource } from 'nmr-load-save';
|
|
1
2
|
import { Reducer } from 'react';
|
|
2
3
|
import { SplitPaneSize } from 'react-science/ui';
|
|
3
4
|
import { MatrixOptions } from '../../../data/types/data1d/MatrixOptions';
|
|
4
5
|
import { NMRiumWorkspace, NMRiumPreferences } from '../../NMRium';
|
|
5
|
-
import { MultipleSpectraAnalysisPreferences, Workspace, WorkSpaceSource } from '../../workspaces/Workspace';
|
|
6
6
|
import { ActionType } from '../types/ActionType';
|
|
7
7
|
export declare const WORKSPACES_KEYS: {
|
|
8
8
|
componentKey: string;
|
|
@@ -14,7 +14,7 @@ type InitPreferencesAction = ActionType<'INIT_PREFERENCES', {
|
|
|
14
14
|
customWorkspaces: Record<string, Workspace>;
|
|
15
15
|
dispatch: any;
|
|
16
16
|
}>;
|
|
17
|
-
type SetPreferencesAction = ActionType<'SET_PREFERENCES', Partial<Workspace
|
|
17
|
+
type SetPreferencesAction = ActionType<'SET_PREFERENCES', Partial<Workspace>> | ActionType<'SET_PREFERENCES', void>;
|
|
18
18
|
type SetPanelsPreferencesAction = ActionType<'SET_PANELS_PREFERENCES', {
|
|
19
19
|
key: string;
|
|
20
20
|
value: string;
|
|
@@ -30,7 +30,7 @@ export type WorkspaceAction = ActionType<'REMOVE_WORKSPACE' | 'SET_ACTIVE_WORKSP
|
|
|
30
30
|
workspace: string;
|
|
31
31
|
}>;
|
|
32
32
|
export type AddWorkspaceAction = ActionType<'ADD_WORKSPACE', {
|
|
33
|
-
|
|
33
|
+
workspaceKey: string;
|
|
34
34
|
data?: Omit<Workspace, 'version' | 'label'>;
|
|
35
35
|
}>;
|
|
36
36
|
export type ApplyGeneralPreferences = ActionType<'APPLY_General_PREFERENCES', {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Draft } from 'immer';
|
|
2
|
-
import { Workspace } from '
|
|
2
|
+
import { Workspace } from 'nmr-load-save';
|
|
3
3
|
import { PreferencesState } from '../preferencesReducer';
|
|
4
4
|
export declare function getActiveWorkspace(draft: Draft<PreferencesState>): Required<Workspace>;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
+
import { CustomWorkspaces } from 'nmr-load-save';
|
|
1
2
|
import { NMRiumWorkspace } from '../../../NMRium';
|
|
2
|
-
|
|
3
|
-
import { WorkspaceWithSource } from '../preferencesReducer';
|
|
4
|
-
export declare function getPreferencesByWorkspace(workspace: NMRiumWorkspace, originalWorkspaces: CustomWorkspaces): WorkspaceWithSource;
|
|
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;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Formatting } from '
|
|
1
|
+
import { Formatting } from 'nmr-load-save';
|
|
2
2
|
export declare function mapNucleiFormatting(formatting: Formatting): Formatting;
|