nmrium 0.36.0 → 0.38.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/FooterBanner.js +1 -1
- package/lib/component/1d/Viewer1D.js +26 -21
- package/lib/component/1d/integral/Integral.d.ts +2 -6
- package/lib/component/1d/integral/IntegralResizable.d.ts +2 -6
- package/lib/component/1d/integral/IntegralResizable.js +2 -3
- package/lib/component/1d/multiAnalysis/MultiAnalysisRanges.js +1 -1
- package/lib/component/1d/multiplicityTree/MultiplicityTree.js +7 -9
- package/lib/component/1d/peaks/PeakAnnotation.js +1 -2
- package/lib/component/1d/ranges/Range.js +9 -8
- package/lib/component/1d/ranges/Ranges.js +5 -7
- package/lib/component/1d/tool/BaseLineZones.js +1 -2
- package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.js +4 -5
- package/lib/component/1d-2d/components/FloatMoleculeStructures/index.js +13 -17
- package/lib/component/2d/1d-tracer/Left1DChart.js +1 -1
- package/lib/component/2d/1d-tracer/VerticalSliceChart.js +1 -1
- package/lib/component/2d/Chart2D.js +1 -1
- package/lib/component/2d/Viewer2D.js +10 -9
- package/lib/component/2d/fid/FidCanvas.js +4 -6
- package/lib/component/2d/ft/Contours.js +1 -7
- package/lib/component/2d/utilities/DimensionLayout.d.ts +9 -24
- package/lib/component/2d/utilities/scale.d.ts +2 -1
- package/lib/component/2d/utilities/scale.js +1 -1
- package/lib/component/2d/zones/Zones.js +1 -1
- package/lib/component/EventsTrackers/KeysListenerTracker.js +28 -21
- package/lib/component/NMRium.d.ts +2 -0
- package/lib/component/NMRium.js +22 -15
- package/lib/component/assignment/AssignmentsReducer.d.ts +1 -1
- package/lib/component/context/DispatchContext.d.ts +23 -3
- package/lib/component/context/DispatchContext.js +1 -1
- package/lib/component/context/LoggerContext.js +1 -1
- package/lib/component/elements/Button.js +7 -9
- package/lib/component/elements/IsotopesViewer.js +1 -1
- package/lib/component/elements/ReactTable/ReactTable.js +1 -2
- package/lib/component/elements/RemoveAssignmentsButton.d.ts +4 -0
- package/lib/component/{panels/RangesPanel/TableColumns → elements}/RemoveAssignmentsButton.js +14 -1
- package/lib/component/elements/formik/FormikCheckBox.js +1 -1
- package/lib/component/elements/formik/FormikColorInput.js +1 -1
- package/lib/component/elements/formik/FormikColorPicker.js +1 -1
- package/lib/component/elements/formik/FormikColumnFormatField.js +1 -1
- package/lib/component/elements/formik/FormikInput.js +1 -1
- package/lib/component/elements/formik/FormikSelect.js +2 -2
- package/lib/component/elements/formik/FormikSlider.js +1 -1
- package/lib/component/elements/formik/FormikTextarea.js +2 -2
- package/lib/component/header/ApodizationOptionsPanel.js +4 -5
- package/lib/component/header/AutoPeakPickingOptionPanel.js +1 -2
- package/lib/component/header/BaseLineCorrectionPanel.js +4 -5
- package/lib/component/header/Header.js +5 -7
- package/lib/component/header/PhaseCorrectionPanel.js +7 -8
- package/lib/component/header/RangesPickingOptionPanel.js +1 -2
- package/lib/component/header/ZeroFillingOptionsPanel.js +3 -11
- package/lib/component/header/Zones2DOptionPanel.js +5 -6
- package/lib/component/hooks/useExport.js +1 -0
- package/lib/component/hooks/useToolsFunctions.js +8 -10
- package/lib/component/loader/DropZone.js +4 -5
- package/lib/component/loader/NoData.js +1 -1
- package/lib/component/modal/AboutPredictionModal.d.ts +2 -0
- package/lib/component/modal/AboutPredictionModal.js +49 -0
- package/lib/component/modal/AlignSpectraModal.js +1 -2
- package/lib/component/modal/EditPeakShapeModal.js +1 -2
- package/lib/component/modal/ImportPublicationStringModal.js +1 -2
- package/lib/component/modal/LoadJCAMPModal.js +2 -3
- package/lib/component/modal/MoleculeStructureEditorModal.js +24 -19
- package/lib/component/modal/PredictSpectraModal.js +24 -21
- package/lib/component/modal/changeSum/SelectMolecule.js +1 -1
- package/lib/component/modal/editRange/EditRangeModal.js +3 -4
- package/lib/component/modal/editRange/forms/components/AddSignalFormTab.js +2 -2
- package/lib/component/modal/editRange/forms/components/CouplingsTable.js +1 -1
- package/lib/component/modal/metaImportation/MetaImportationModal.js +2 -3
- package/lib/component/modal/setting/settings-tabs/DatabasesTabContent.js +4 -4
- package/lib/component/modal/setting/settings-tabs/FormattingTabContent.js +2 -2
- package/lib/component/modal/setting/settings-tabs/InfoBlockTabContent.js +2 -2
- package/lib/component/panels/AutomaticAssignment/AutomaticAssignmentTable.js +1 -2
- package/lib/component/panels/AutomaticAssignment/useAutoAssignments.js +7 -6
- package/lib/component/panels/InformationPanel.js +6 -6
- package/lib/component/panels/IntegralsPanel/IntegralPanel.js +11 -20
- package/lib/component/panels/IntegralsPanel/IntegralTable.js +27 -23
- package/lib/component/panels/IntegralsPanel/IntegralsPreferences.js +8 -5
- package/lib/component/panels/MatrixGenerationPanel/ExclusionsZonesTable.js +1 -1
- package/lib/component/panels/MatrixGenerationPanel/FiltersOptions.js +4 -4
- package/lib/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +1 -2
- package/lib/component/panels/MoleculesPanel/MoleculeHeader.js +1 -2
- package/lib/component/panels/MoleculesPanel/MoleculePanel.js +10 -13
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.d.ts +1 -0
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +7 -7
- package/lib/component/panels/MoleculesPanel/Utilities.d.ts +4 -1
- package/lib/component/panels/MoleculesPanel/Utilities.js +2 -2
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +8 -9
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +3 -4
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +1 -2
- package/lib/component/panels/MultipleSpectraAnalysisPanel/preferences/AnalysisTablePreferences.js +2 -2
- package/lib/component/panels/MultipleSpectraAnalysisPanel/preferences/LegendsPreferences.js +2 -2
- package/lib/component/panels/MultipleSpectraAnalysisPanel/preferences/MultipleAnalysisCodeEditor.js +1 -1
- package/lib/component/panels/Panels.js +1 -1
- package/lib/component/panels/PeaksPanel/PeaksPanel.js +4 -5
- package/lib/component/panels/PeaksPanel/PeaksTable.js +4 -5
- package/lib/component/panels/RangesPanel/RangesHeader.js +12 -15
- package/lib/component/panels/RangesPanel/RangesPanel.js +24 -29
- package/lib/component/panels/RangesPanel/RangesTableRow.d.ts +0 -1
- package/lib/component/panels/RangesPanel/RangesTableRow.js +0 -11
- package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +2 -3
- package/lib/component/panels/RangesPanel/TableColumns/RelativeColumn.js +3 -3
- package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.js +2 -3
- package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.js +1 -2
- package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.d.ts +1 -1
- package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.js +16 -14
- package/lib/component/panels/SpectrumsPanel/SpectraPanelHeader.js +16 -16
- package/lib/component/panels/SpectrumsPanel/SpectraPreferences.js +2 -2
- package/lib/component/panels/SpectrumsPanel/SpectraTable.js +7 -5
- package/lib/component/panels/SpectrumsPanel/SpectrumsTabs.js +4 -5
- package/lib/component/panels/SpectrumsPanel/base/ShowHideSpectrumButton.js +3 -7
- package/lib/component/panels/SpectrumsPanel/base/SpectraColumnsManager.js +1 -1
- package/lib/component/panels/SpectrumsPanel/base/setting/SpectrumSetting.js +4 -2
- package/lib/component/panels/SpectrumsPanel/base/setting/processSnapPlot.js +2 -2
- package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +4 -8
- package/lib/component/panels/SummaryPanel/SummaryPanel.js +39 -34
- package/lib/component/panels/SummaryPanel/utilities/Utilities.js +1 -1
- package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.d.ts +2 -21
- package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +22 -20
- package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumn.d.ts +4 -5
- package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumn.js +12 -16
- package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumns.d.ts +3 -7
- package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumns.js +2 -2
- package/lib/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.d.ts +2 -2
- package/lib/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.js +6 -7
- package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.d.ts +4 -5
- package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.js +27 -19
- package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumns.d.ts +3 -7
- package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumns.js +2 -2
- package/lib/component/panels/ZonesPanel/ZonesPanel.js +15 -18
- package/lib/component/panels/ZonesPanel/ZonesTable.js +2 -51
- package/lib/component/panels/ZonesPanel/ZonesTableRow.d.ts +3 -3
- package/lib/component/panels/ZonesPanel/ZonesTableRow.js +2 -22
- package/lib/component/panels/ZonesPanel/hooks/useMapZones.d.ts +16 -0
- package/lib/component/panels/ZonesPanel/hooks/useMapZones.js +52 -0
- package/lib/component/panels/databasePanel/DatabasePanel.js +9 -7
- package/lib/component/panels/filtersPanel/FilterPanel.js +1 -2
- package/lib/component/panels/filtersPanel/FiltersTable.js +8 -9
- package/lib/component/panels/header/DefaultPanelHeader.js +1 -1
- package/lib/component/panels/header/SpectraAutomaticPickingButton.js +2 -3
- package/lib/component/panels/predictionPanel/PredictionPanel.js +10 -6
- package/lib/component/reducer/IgnoreActions.d.ts +2 -1
- package/lib/component/reducer/IgnoreActions.js +35 -32
- package/lib/component/reducer/Reducer.d.ts +8 -5
- package/lib/component/reducer/Reducer.js +199 -221
- package/lib/component/reducer/actions/AssignmentsActions.d.ts +7 -6
- package/lib/component/reducer/actions/AssignmentsActions.js +2 -2
- package/lib/component/reducer/actions/CorrelationsActions.d.ts +21 -13
- package/lib/component/reducer/actions/CorrelationsActions.js +25 -20
- package/lib/component/reducer/actions/DatabaseActions.d.ts +15 -2
- package/lib/component/reducer/actions/DatabaseActions.js +5 -2
- package/lib/component/reducer/actions/DimensionsActions.d.ts +8 -3
- package/lib/component/reducer/actions/DimensionsActions.js +3 -5
- package/lib/component/reducer/actions/DomainActions.d.ts +11 -5
- package/lib/component/reducer/actions/DomainActions.js +13 -19
- package/lib/component/reducer/actions/FiltersActions.d.ts +70 -23
- package/lib/component/reducer/actions/FiltersActions.js +250 -255
- package/lib/component/reducer/actions/GlobalActions.d.ts +7 -2
- package/lib/component/reducer/actions/GlobalActions.js +3 -3
- package/lib/component/reducer/actions/IntegralsActions.d.ts +28 -7
- package/lib/component/reducer/actions/IntegralsActions.js +16 -15
- package/lib/component/reducer/actions/LoadActions.d.ts +23 -5
- package/lib/component/reducer/actions/LoadActions.js +65 -57
- package/lib/component/reducer/actions/MoleculeActions.d.ts +38 -9
- package/lib/component/reducer/actions/MoleculeActions.js +53 -20
- package/lib/component/reducer/actions/PeaksActions.d.ts +39 -8
- package/lib/component/reducer/actions/PeaksActions.js +19 -11
- package/lib/component/reducer/actions/PreferencesActions.d.ts +8 -3
- package/lib/component/reducer/actions/PreferencesActions.js +22 -7
- package/lib/component/reducer/actions/RangesActions.d.ts +85 -18
- package/lib/component/reducer/actions/RangesActions.js +80 -65
- package/lib/component/reducer/actions/SpectraAnalysisAction.d.ts +7 -1
- package/lib/component/reducer/actions/SpectrumsActions.d.ts +57 -24
- package/lib/component/reducer/actions/SpectrumsActions.js +69 -60
- package/lib/component/reducer/actions/ToolsActions.d.ts +59 -21
- package/lib/component/reducer/actions/ToolsActions.js +54 -32
- package/lib/component/reducer/actions/ZonesActions.d.ts +79 -15
- package/lib/component/reducer/actions/ZonesActions.js +68 -49
- package/lib/component/reducer/helper/Zoom1DManager.d.ts +6 -5
- package/lib/component/reducer/helper/Zoom1DManager.js +1 -1
- package/lib/component/reducer/helper/ZoomHistoryManager.js +2 -2
- package/lib/component/reducer/helper/get2DRange.d.ts +7 -1
- package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js +1 -0
- package/lib/component/reducer/preferences/preferencesReducer.d.ts +1 -1
- package/lib/component/reducer/types/ActionType.d.ts +6 -0
- package/lib/component/reducer/types/ActionType.js +1 -0
- package/lib/component/toolbar/BasicToolBar.js +6 -9
- package/lib/component/toolbar/FunctionToolBar.js +4 -9
- package/lib/component/toolbar/ToolBar.js +1 -1
- package/lib/component/toolbar/ToolTypes.d.ts +2 -2
- package/lib/component/utility/Events.d.ts +4 -4
- package/lib/component/utility/Events.js +2 -2
- package/lib/component/utility/GroupByInfoKey.js +1 -1
- package/lib/component/utility/getSpectraObjectPaths.js +1 -1
- package/lib/component/workspaces/Workspace.d.ts +2 -1
- package/lib/component/workspaces/exercise.js +31 -0
- package/lib/component/workspaces/workspaceDefaultProperties.js +1 -0
- package/lib/data/PredictionManager.d.ts +5 -8
- package/lib/data/PredictionManager.js +3 -3
- package/lib/data/data1d/Spectrum1D/getSpectrumErrorValue.js +1 -1
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.d.ts +2 -3
- package/lib/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.js +5 -4
- package/lib/data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges.d.ts +5 -3
- package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.d.ts +1 -35
- package/lib/data/data1d/Spectrum1D/ranges/mapRanges.d.ts +2 -35
- package/lib/data/data1d/filter1d/baselineCorrection.d.ts +7 -10
- package/lib/data/data1d/multipleSpectraAnalysis.d.ts +1 -1
- package/lib/data/data2d/Processing2D.d.ts +3 -3
- package/lib/data/data2d/Spectrum2D/contours.d.ts +1 -4
- package/lib/data/data2d/Spectrum2D/contours.js +0 -1
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +1 -1
- package/lib/data/data2d/Spectrum2D/zones/changeZoneSignal.d.ts +5 -1
- package/lib/data/data2d/Spectrum2D/zones/changeZoneSignal.js +6 -8
- package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.d.ts +2 -0
- package/lib/data/data2d/Spectrum2D/zones/initiateZones.d.ts +2 -0
- package/lib/data/data2d/Spectrum2D/zones/mapZones.d.ts +2 -0
- package/lib/data/matrixGeneration.js +4 -2
- package/lib/data/molecules/Molecule.d.ts +3 -3
- package/lib/data/molecules/MoleculeManager.d.ts +5 -5
- package/lib/data/molecules/MoleculeManager.js +1 -1
- package/lib/data/utilities/ZoneUtilities.js +0 -1
- package/lib/data/utilities/generateColor.js +1 -1
- package/lib/data/utilities/isNumber.d.ts +1 -0
- package/lib/data/utilities/isNumber.js +3 -0
- package/lib/types/NMRiumGeneralPreferences.d.ts +1 -0
- package/lib/versionInfo.js +1 -1
- package/lib-cjs/component/1d/FooterBanner.js +1 -1
- package/lib-cjs/component/1d/Viewer1D.js +25 -20
- package/lib-cjs/component/1d/integral/IntegralResizable.js +2 -3
- package/lib-cjs/component/1d/multiAnalysis/MultiAnalysisRanges.js +1 -1
- package/lib-cjs/component/1d/multiplicityTree/MultiplicityTree.js +7 -9
- package/lib-cjs/component/1d/peaks/PeakAnnotation.js +1 -2
- package/lib-cjs/component/1d/ranges/Range.js +9 -8
- package/lib-cjs/component/1d/ranges/Ranges.js +5 -7
- package/lib-cjs/component/1d/tool/BaseLineZones.js +1 -2
- package/lib-cjs/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.js +4 -5
- package/lib-cjs/component/1d-2d/components/FloatMoleculeStructures/index.js +13 -17
- package/lib-cjs/component/2d/1d-tracer/Left1DChart.js +1 -1
- package/lib-cjs/component/2d/1d-tracer/VerticalSliceChart.js +1 -1
- package/lib-cjs/component/2d/Chart2D.js +1 -1
- package/lib-cjs/component/2d/Viewer2D.js +10 -9
- package/lib-cjs/component/2d/fid/FidCanvas.js +4 -6
- package/lib-cjs/component/2d/ft/Contours.js +1 -7
- package/lib-cjs/component/2d/utilities/scale.js +1 -1
- package/lib-cjs/component/2d/zones/Zones.js +1 -1
- package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +28 -21
- package/lib-cjs/component/NMRium.js +19 -12
- package/lib-cjs/component/context/DispatchContext.js +1 -1
- package/lib-cjs/component/context/LoggerContext.js +1 -1
- package/lib-cjs/component/elements/Button.js +7 -9
- package/lib-cjs/component/elements/IsotopesViewer.js +1 -1
- package/lib-cjs/component/elements/ReactTable/ReactTable.js +1 -2
- package/lib-cjs/component/{panels/RangesPanel/TableColumns → elements}/RemoveAssignmentsButton.js +15 -2
- package/lib-cjs/component/elements/Tab/Tabs.js +1 -1
- package/lib-cjs/component/elements/formik/FormikCheckBox.js +1 -1
- package/lib-cjs/component/elements/formik/FormikColorInput.js +1 -1
- package/lib-cjs/component/elements/formik/FormikColorPicker.js +1 -1
- package/lib-cjs/component/elements/formik/FormikColumnFormatField.js +1 -1
- package/lib-cjs/component/elements/formik/FormikInput.js +1 -1
- package/lib-cjs/component/elements/formik/FormikSelect.js +2 -2
- package/lib-cjs/component/elements/formik/FormikSlider.js +1 -1
- package/lib-cjs/component/elements/formik/FormikTextarea.js +2 -2
- package/lib-cjs/component/header/ApodizationOptionsPanel.js +3 -4
- package/lib-cjs/component/header/AutoPeakPickingOptionPanel.js +1 -2
- package/lib-cjs/component/header/BaseLineCorrectionPanel.js +4 -5
- package/lib-cjs/component/header/Header.js +5 -7
- package/lib-cjs/component/header/PhaseCorrectionPanel.js +7 -8
- package/lib-cjs/component/header/RangesPickingOptionPanel.js +1 -2
- package/lib-cjs/component/header/ZeroFillingOptionsPanel.js +3 -11
- package/lib-cjs/component/header/Zones2DOptionPanel.js +5 -6
- package/lib-cjs/component/highlight/index.js +1 -1
- package/lib-cjs/component/hooks/useExport.js +1 -0
- package/lib-cjs/component/hooks/useTableSortBy.js +1 -1
- package/lib-cjs/component/hooks/useToolsFunctions.js +8 -10
- package/lib-cjs/component/hooks/useXYReduce.js +1 -1
- package/lib-cjs/component/loader/DropZone.js +4 -5
- package/lib-cjs/component/loader/NoData.js +1 -1
- package/lib-cjs/component/modal/AboutPredictionModal.js +54 -0
- package/lib-cjs/component/modal/AlignSpectraModal.js +1 -2
- package/lib-cjs/component/modal/EditPeakShapeModal.js +1 -2
- package/lib-cjs/component/modal/ImportPublicationStringModal.js +1 -2
- package/lib-cjs/component/modal/LoadJCAMPModal.js +2 -3
- package/lib-cjs/component/modal/MoleculeStructureEditorModal.js +24 -19
- package/lib-cjs/component/modal/PredictSpectraModal.js +24 -21
- package/lib-cjs/component/modal/changeSum/SelectMolecule.js +1 -1
- package/lib-cjs/component/modal/editRange/EditRangeModal.js +3 -4
- package/lib-cjs/component/modal/editRange/forms/components/AddSignalFormTab.js +2 -2
- package/lib-cjs/component/modal/editRange/forms/components/CouplingsTable.js +1 -1
- package/lib-cjs/component/modal/metaImportation/MetaImportationModal.js +2 -3
- package/lib-cjs/component/modal/setting/settings-tabs/DatabasesTabContent.js +4 -4
- package/lib-cjs/component/modal/setting/settings-tabs/FormattingTabContent.js +2 -2
- package/lib-cjs/component/modal/setting/settings-tabs/InfoBlockTabContent.js +2 -2
- package/lib-cjs/component/panels/AutomaticAssignment/AutomaticAssignmentTable.js +1 -2
- package/lib-cjs/component/panels/AutomaticAssignment/useAutoAssignments.js +7 -6
- package/lib-cjs/component/panels/InformationPanel.js +6 -6
- package/lib-cjs/component/panels/IntegralsPanel/IntegralPanel.js +11 -20
- package/lib-cjs/component/panels/IntegralsPanel/IntegralTable.js +27 -23
- package/lib-cjs/component/panels/IntegralsPanel/IntegralsPreferences.js +7 -4
- package/lib-cjs/component/panels/MatrixGenerationPanel/ExclusionsZonesTable.js +1 -1
- package/lib-cjs/component/panels/MatrixGenerationPanel/FiltersOptions.js +4 -4
- package/lib-cjs/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +1 -2
- package/lib-cjs/component/panels/MoleculesPanel/MoleculeHeader.js +1 -2
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanel.js +10 -13
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +7 -7
- package/lib-cjs/component/panels/MoleculesPanel/Utilities.js +2 -2
- package/lib-cjs/component/panels/MoleculesPanel/useAtomAssignment.js +8 -9
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +3 -4
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +1 -2
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/preferences/AnalysisTablePreferences.js +2 -2
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/preferences/LegendsPreferences.js +2 -2
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/preferences/MultipleAnalysisCodeEditor.js +1 -1
- package/lib-cjs/component/panels/Panels.js +1 -1
- package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +4 -5
- package/lib-cjs/component/panels/PeaksPanel/PeaksTable.js +4 -5
- package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +12 -15
- package/lib-cjs/component/panels/RangesPanel/RangesPanel.js +24 -29
- package/lib-cjs/component/panels/RangesPanel/RangesTableRow.js +0 -12
- package/lib-cjs/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +2 -3
- package/lib-cjs/component/panels/RangesPanel/TableColumns/RelativeColumn.js +3 -3
- package/lib-cjs/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.js +2 -3
- package/lib-cjs/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.js +1 -2
- package/lib-cjs/component/panels/RangesPanel/hooks/useEditRangeModal.js +16 -14
- package/lib-cjs/component/panels/SpectrumsPanel/SpectraPanelHeader.js +16 -16
- package/lib-cjs/component/panels/SpectrumsPanel/SpectraPreferences.js +2 -2
- package/lib-cjs/component/panels/SpectrumsPanel/SpectraTable.js +7 -5
- package/lib-cjs/component/panels/SpectrumsPanel/SpectrumsTabs.js +4 -5
- package/lib-cjs/component/panels/SpectrumsPanel/base/ShowHideSpectrumButton.js +3 -7
- package/lib-cjs/component/panels/SpectrumsPanel/base/SpectraColumnsManager.js +1 -1
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/SpectrumSetting.js +4 -2
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/processSnapPlot.js +2 -2
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +4 -8
- package/lib-cjs/component/panels/SummaryPanel/SummaryPanel.js +39 -34
- package/lib-cjs/component/panels/SummaryPanel/utilities/Utilities.js +1 -1
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +22 -20
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumn.js +12 -19
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumns.js +2 -2
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.js +6 -7
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.js +27 -22
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumns.js +2 -2
- package/lib-cjs/component/panels/ZonesPanel/ZonesPanel.js +15 -18
- package/lib-cjs/component/panels/ZonesPanel/ZonesTable.js +2 -51
- package/lib-cjs/component/panels/ZonesPanel/ZonesTableRow.js +1 -21
- package/lib-cjs/component/panels/ZonesPanel/hooks/useMapZones.js +56 -0
- package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +8 -6
- package/lib-cjs/component/panels/filtersPanel/FilterPanel.js +1 -2
- package/lib-cjs/component/panels/filtersPanel/FiltersTable.js +8 -9
- package/lib-cjs/component/panels/header/DefaultPanelHeader.js +1 -1
- package/lib-cjs/component/panels/header/SpectraAutomaticPickingButton.js +2 -3
- package/lib-cjs/component/panels/predictionPanel/PredictionPanel.js +10 -6
- package/lib-cjs/component/reducer/IgnoreActions.js +35 -55
- package/lib-cjs/component/reducer/Reducer.js +199 -221
- package/lib-cjs/component/reducer/actions/AssignmentsActions.js +3 -3
- package/lib-cjs/component/reducer/actions/CorrelationsActions.js +23 -18
- package/lib-cjs/component/reducer/actions/DatabaseActions.js +4 -1
- package/lib-cjs/component/reducer/actions/DimensionsActions.js +3 -6
- package/lib-cjs/component/reducer/actions/DomainActions.js +15 -23
- package/lib-cjs/component/reducer/actions/FiltersActions.js +267 -272
- package/lib-cjs/component/reducer/actions/GlobalActions.js +4 -4
- package/lib-cjs/component/reducer/actions/IntegralsActions.js +19 -18
- package/lib-cjs/component/reducer/actions/LoadActions.js +68 -60
- package/lib-cjs/component/reducer/actions/MoleculeActions.js +56 -23
- package/lib-cjs/component/reducer/actions/PeaksActions.js +23 -15
- package/lib-cjs/component/reducer/actions/PreferencesActions.js +24 -9
- package/lib-cjs/component/reducer/actions/RangesActions.js +81 -64
- package/lib-cjs/component/reducer/actions/SpectrumsActions.js +77 -67
- package/lib-cjs/component/reducer/actions/ToolsActions.js +54 -31
- package/lib-cjs/component/reducer/actions/ZonesActions.js +73 -52
- package/lib-cjs/component/reducer/core/Constants.js +1 -1
- package/lib-cjs/component/reducer/helper/Zoom1DManager.js +2 -2
- package/lib-cjs/component/reducer/helper/ZoomHistoryManager.js +2 -2
- package/lib-cjs/component/reducer/preferences/panelsPreferencesDefaultValues.js +1 -0
- package/lib-cjs/component/reducer/types/ActionType.js +2 -0
- package/lib-cjs/component/toolbar/BasicToolBar.js +6 -9
- package/lib-cjs/component/toolbar/FunctionToolBar.js +4 -9
- package/lib-cjs/component/toolbar/ToolBar.js +1 -1
- package/lib-cjs/component/utility/GroupByInfoKey.js +1 -1
- package/lib-cjs/component/utility/getSpectraObjectPaths.js +1 -1
- package/lib-cjs/component/workspaces/exercise.js +31 -0
- package/lib-cjs/component/workspaces/workspaceDefaultProperties.js +1 -0
- package/lib-cjs/data/PredictionManager.js +3 -3
- package/lib-cjs/data/SpectraManager.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/getSpectrumErrorValue.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.js +5 -4
- package/lib-cjs/data/data1d/multipleSpectraAnalysis.js +2 -2
- package/lib-cjs/data/data2d/Spectrum2D/contours.js +0 -1
- package/lib-cjs/data/data2d/Spectrum2D/initiateDatum2D.js +1 -1
- package/lib-cjs/data/data2d/Spectrum2D/zones/changeZoneSignal.js +6 -8
- package/lib-cjs/data/matrixGeneration.js +4 -2
- package/lib-cjs/data/molecules/MoleculeManager.js +1 -1
- package/lib-cjs/data/utilities/ZoneUtilities.js +0 -1
- package/lib-cjs/data/utilities/generateColor.js +1 -1
- package/lib-cjs/data/utilities/isNumber.js +7 -0
- package/lib-cjs/versionInfo.js +1 -1
- package/package.json +35 -34
- package/lib/component/panels/RangesPanel/TableColumns/RemoveAssignmentsButton.d.ts +0 -3
- package/lib/component/reducer/actions/HistoryActions.d.ts +0 -4
- package/lib/component/reducer/actions/HistoryActions.js +0 -40
- package/lib/component/reducer/types/HistoryTypes.d.ts +0 -4
- package/lib/component/reducer/types/HistoryTypes.js +0 -4
- package/lib/component/reducer/types/Types.d.ts +0 -132
- package/lib/component/reducer/types/Types.js +0 -126
- package/lib/component/toolbar/HistoryToolBar.d.ts +0 -8
- package/lib/component/toolbar/HistoryToolBar.js +0 -30
- package/lib/data/utilities/isMolFileEmpty.d.ts +0 -1
- package/lib/data/utilities/isMolFileEmpty.js +0 -6
- package/lib-cjs/component/reducer/actions/HistoryActions.js +0 -45
- package/lib-cjs/component/reducer/types/HistoryTypes.js +0 -7
- package/lib-cjs/component/reducer/types/Types.js +0 -131
- package/lib-cjs/component/toolbar/HistoryToolBar.js +0 -35
- package/lib-cjs/data/utilities/isMolFileEmpty.js +0 -10
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
function
|
|
5
|
-
draft.overDisplayer =
|
|
3
|
+
exports.handleSetIsOverDisplayer = void 0;
|
|
4
|
+
function handleSetIsOverDisplayer(draft, action) {
|
|
5
|
+
draft.overDisplayer = action.payload.isMouseOverDisplayer;
|
|
6
6
|
}
|
|
7
|
-
exports.
|
|
7
|
+
exports.handleSetIsOverDisplayer = handleSetIsOverDisplayer;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.handleChangeIntegralsSumFlag = exports.handleChangeIntegralsRelativeValue = exports.
|
|
6
|
+
exports.handleChangeIntegralsSumFlag = exports.handleChangeIntegralsRelativeValue = exports.handleChangeIntegral = exports.handleDeleteIntegral = exports.handleAddIntegral = exports.handleChangeIntegralSum = void 0;
|
|
7
7
|
const uuid_1 = require("@lukeed/uuid");
|
|
8
8
|
const immer_1 = require("immer");
|
|
9
9
|
const ml_spectra_processing_1 = require("ml-spectra-processing");
|
|
@@ -12,7 +12,8 @@ const SumManager_1 = require("../../../data/data1d/Spectrum1D/SumManager");
|
|
|
12
12
|
const getActiveSpectrum_1 = require("../helper/getActiveSpectrum");
|
|
13
13
|
const getRange_1 = __importDefault(require("../helper/getRange"));
|
|
14
14
|
const DomainActions_1 = require("./DomainActions");
|
|
15
|
-
function handleChangeIntegralSum(draft,
|
|
15
|
+
function handleChangeIntegralSum(draft, action) {
|
|
16
|
+
const { options } = action.payload;
|
|
16
17
|
const { data, view: { spectra: { activeTab: nucleus }, }, } = draft;
|
|
17
18
|
const activeSpectrum = (0, getActiveSpectrum_1.getActiveSpectrum)(draft);
|
|
18
19
|
if (activeSpectrum?.id) {
|
|
@@ -23,8 +24,8 @@ function handleChangeIntegralSum(draft, options) {
|
|
|
23
24
|
}
|
|
24
25
|
}
|
|
25
26
|
exports.handleChangeIntegralSum = handleChangeIntegralSum;
|
|
26
|
-
function
|
|
27
|
-
const { startX, endX } = action;
|
|
27
|
+
function handleAddIntegral(draft, action) {
|
|
28
|
+
const { startX, endX } = action.payload;
|
|
28
29
|
const { data, molecules, view: { spectra: { activeTab: nucleus }, }, } = draft;
|
|
29
30
|
const activeSpectrum = (0, getActiveSpectrum_1.getActiveSpectrum)(draft);
|
|
30
31
|
const [from, to] = (0, getRange_1.default)(draft, { startX, endX });
|
|
@@ -50,15 +51,15 @@ function addIntegral(draft, action) {
|
|
|
50
51
|
(0, DomainActions_1.setIntegralsYDomain)(draft, datum);
|
|
51
52
|
}
|
|
52
53
|
}
|
|
53
|
-
exports.
|
|
54
|
-
function
|
|
54
|
+
exports.handleAddIntegral = handleAddIntegral;
|
|
55
|
+
function handleDeleteIntegral(draft, action) {
|
|
55
56
|
const activeSpectrum = (0, getActiveSpectrum_1.getActiveSpectrum)(draft);
|
|
56
57
|
if (activeSpectrum) {
|
|
57
58
|
const state = (0, immer_1.original)(draft);
|
|
58
59
|
const { index } = activeSpectrum;
|
|
59
|
-
const { integralID } = action;
|
|
60
|
+
const { id: integralID } = action?.payload || {};
|
|
60
61
|
const datum = draft.data[index];
|
|
61
|
-
if (integralID
|
|
62
|
+
if (!integralID) {
|
|
62
63
|
datum.integrals.values = [];
|
|
63
64
|
}
|
|
64
65
|
else {
|
|
@@ -68,11 +69,11 @@ function deleteIntegral(draft, action) {
|
|
|
68
69
|
}
|
|
69
70
|
}
|
|
70
71
|
}
|
|
71
|
-
exports.
|
|
72
|
-
function
|
|
72
|
+
exports.handleDeleteIntegral = handleDeleteIntegral;
|
|
73
|
+
function handleChangeIntegral(draft, action) {
|
|
73
74
|
const activeSpectrum = (0, getActiveSpectrum_1.getActiveSpectrum)(draft);
|
|
74
75
|
const state = (0, immer_1.original)(draft);
|
|
75
|
-
const integral = action.payload
|
|
76
|
+
const { integral } = action.payload;
|
|
76
77
|
if (activeSpectrum?.id) {
|
|
77
78
|
const { index } = activeSpectrum;
|
|
78
79
|
const originalDatum = state.data[index];
|
|
@@ -81,31 +82,31 @@ function changeIntegral(draft, action) {
|
|
|
81
82
|
const integralIndex = originalDatum.integrals.values.findIndex((i) => i.id === integral.id);
|
|
82
83
|
if (integralIndex !== -1) {
|
|
83
84
|
datum.integrals.values[integralIndex] = {
|
|
85
|
+
...integral,
|
|
84
86
|
originFrom: integral.from,
|
|
85
87
|
originTo: integral.to,
|
|
86
|
-
...integral,
|
|
87
88
|
absolute: (0, ml_spectra_processing_1.xyIntegration)({ x, y: re }, { from: integral.from, to: integral.to, reverse: true }),
|
|
88
89
|
};
|
|
89
90
|
(0, Spectrum1D_1.updateIntegralsRelativeValues)(datum);
|
|
90
91
|
}
|
|
91
92
|
}
|
|
92
93
|
}
|
|
93
|
-
exports.
|
|
94
|
+
exports.handleChangeIntegral = handleChangeIntegral;
|
|
94
95
|
function handleChangeIntegralsRelativeValue(draft, action) {
|
|
95
96
|
const activeSpectrum = (0, getActiveSpectrum_1.getActiveSpectrum)(draft);
|
|
96
|
-
const
|
|
97
|
+
const { id, value } = action.payload;
|
|
97
98
|
if (activeSpectrum?.id) {
|
|
98
99
|
const { index } = activeSpectrum;
|
|
99
|
-
(0, Spectrum1D_1.changeIntegralsRelative)(draft.data[index],
|
|
100
|
+
(0, Spectrum1D_1.changeIntegralsRelative)(draft.data[index], { id, value });
|
|
100
101
|
}
|
|
101
102
|
}
|
|
102
103
|
exports.handleChangeIntegralsRelativeValue = handleChangeIntegralsRelativeValue;
|
|
103
|
-
function handleChangeIntegralsSumFlag(draft
|
|
104
|
-
const flag = action.payload;
|
|
104
|
+
function handleChangeIntegralsSumFlag(draft) {
|
|
105
105
|
const activeSpectrum = (0, getActiveSpectrum_1.getActiveSpectrum)(draft);
|
|
106
106
|
if (activeSpectrum) {
|
|
107
107
|
const { index } = activeSpectrum;
|
|
108
|
-
draft.data[index].integrals.options
|
|
108
|
+
const integralOptions = draft.data[index].integrals.options;
|
|
109
|
+
integralOptions.isSumConstant = !integralOptions.isSumConstant;
|
|
109
110
|
}
|
|
110
111
|
}
|
|
111
112
|
exports.handleChangeIntegralsSumFlag = handleChangeIntegralsSumFlag;
|
|
@@ -26,7 +26,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.
|
|
29
|
+
exports.handleLoadDropFiles = exports.handleInitiate = exports.initSpectra = exports.handleSetIsLoading = void 0;
|
|
30
30
|
const merge_1 = __importDefault(require("lodash/merge"));
|
|
31
31
|
const mergeWith_1 = __importDefault(require("lodash/mergeWith"));
|
|
32
32
|
const nmr_correlation_1 = require("nmr-correlation");
|
|
@@ -40,13 +40,22 @@ const Reducer_1 = require("../Reducer");
|
|
|
40
40
|
const PreferencesActions_1 = require("./PreferencesActions");
|
|
41
41
|
const SpectrumsActions_1 = require("./SpectrumsActions");
|
|
42
42
|
const ToolsActions_1 = require("./ToolsActions");
|
|
43
|
-
function
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
43
|
+
function convertHybridizationStringValuesInCorrelations(correlations) {
|
|
44
|
+
return {
|
|
45
|
+
...correlations,
|
|
46
|
+
values: correlations.values.map((correlation) => {
|
|
47
|
+
if (typeof correlation.hybridization === 'string') {
|
|
48
|
+
let values = [];
|
|
49
|
+
if (correlation.hybridization.length > 0) {
|
|
50
|
+
const hybridizationString = correlation.hybridization.replaceAll('SP', '');
|
|
51
|
+
const value = Number(hybridizationString);
|
|
52
|
+
values.push(value);
|
|
53
|
+
}
|
|
54
|
+
correlation.hybridization = values;
|
|
55
|
+
}
|
|
56
|
+
return correlation;
|
|
57
|
+
}),
|
|
58
|
+
};
|
|
50
59
|
}
|
|
51
60
|
function setCorrelation(draft, correlations) {
|
|
52
61
|
if (!correlations || Object.keys(correlations).length === 0) {
|
|
@@ -62,33 +71,17 @@ function setCorrelation(draft, correlations) {
|
|
|
62
71
|
// draft.correlations = correlations // original command without overwriting
|
|
63
72
|
}
|
|
64
73
|
}
|
|
65
|
-
function
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
for (const spectrum of inputSpectra) {
|
|
69
|
-
const { info } = spectrum;
|
|
70
|
-
if (info.dimension === 1) {
|
|
71
|
-
const filters = onLoadProcessing?.[(0, nucleusToString_1.default)(info.nucleus)] || [];
|
|
72
|
-
spectra.push((0, Spectrum1D_1.initiateDatum1D)(spectrum, { usedColors, filters }));
|
|
73
|
-
}
|
|
74
|
-
else if (info.dimension === 2) {
|
|
75
|
-
spectra.push((0, Spectrum2D_1.initiateDatum2D)({ ...spectrum }, { usedColors }));
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
return spectra;
|
|
79
|
-
}
|
|
80
|
-
exports.initSpectra = initSpectra;
|
|
81
|
-
function setData(draft, input) {
|
|
82
|
-
const { data, usedColors, view, onLoadProcessing = {}, parseMetaFileResult = null, } = input || {
|
|
83
|
-
data: { spectra: [], molecules: [], correlations: {} },
|
|
74
|
+
function setData(draft, input, options = {}) {
|
|
75
|
+
const { nmriumState: { data, view }, onLoadProcessing = {}, parseMetaFileResult = null, } = input || {
|
|
76
|
+
nmriumState: { data: { spectra: [], molecules: [], correlations: {} } },
|
|
84
77
|
multipleAnalysis: {},
|
|
85
78
|
};
|
|
79
|
+
const { autoOnLoadProcessing = true } = options;
|
|
86
80
|
const { source, spectra = [], molecules = [], correlations = {}, } = data || {};
|
|
87
81
|
if (view) {
|
|
88
82
|
const defaultViewState = (0, Reducer_1.getDefaultViewState)();
|
|
89
83
|
draft.view = (0, merge_1.default)(defaultViewState, view);
|
|
90
84
|
}
|
|
91
|
-
setColors(draft, usedColors);
|
|
92
85
|
if (source) {
|
|
93
86
|
draft.source = (0, mergeWith_1.default)(draft.source, source, (objValue, srcValue) => {
|
|
94
87
|
if (Array.isArray(objValue)) {
|
|
@@ -97,7 +90,10 @@ function setData(draft, input) {
|
|
|
97
90
|
});
|
|
98
91
|
}
|
|
99
92
|
draft.molecules = draft.molecules.concat(MoleculeManager.fromJSON(molecules, draft.molecules));
|
|
100
|
-
draft.data = draft.data.concat(initSpectra(spectra, {
|
|
93
|
+
draft.data = draft.data.concat(initSpectra(spectra, {
|
|
94
|
+
usedColors: draft.usedColors,
|
|
95
|
+
onLoadProcessing: autoOnLoadProcessing ? onLoadProcessing : {},
|
|
96
|
+
}));
|
|
101
97
|
setCorrelation(draft, correlations);
|
|
102
98
|
if (parseMetaFileResult) {
|
|
103
99
|
const { matches } = (0, linkMetaWithSpectra_1.linkMetaWithSpectra)({
|
|
@@ -105,49 +101,51 @@ function setData(draft, input) {
|
|
|
105
101
|
spectra: draft.data,
|
|
106
102
|
parseMetaFileResult,
|
|
107
103
|
});
|
|
108
|
-
(0, SpectrumsActions_1.
|
|
104
|
+
(0, SpectrumsActions_1.setSpectraMetaInfo)(draft, matches);
|
|
109
105
|
}
|
|
110
106
|
}
|
|
111
|
-
function
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
}),
|
|
126
|
-
};
|
|
107
|
+
function initSpectra(inputSpectra, options) {
|
|
108
|
+
const spectra = [];
|
|
109
|
+
const { usedColors, onLoadProcessing } = options;
|
|
110
|
+
for (const spectrum of inputSpectra) {
|
|
111
|
+
const { info } = spectrum;
|
|
112
|
+
if (info.dimension === 1) {
|
|
113
|
+
const filters = onLoadProcessing?.[(0, nucleusToString_1.default)(info.nucleus)] || [];
|
|
114
|
+
spectra.push((0, Spectrum1D_1.initiateDatum1D)(spectrum, { usedColors, filters }));
|
|
115
|
+
}
|
|
116
|
+
else if (info.dimension === 2) {
|
|
117
|
+
spectra.push((0, Spectrum2D_1.initiateDatum2D)({ ...spectrum }, { usedColors }));
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
return spectra;
|
|
127
121
|
}
|
|
122
|
+
exports.initSpectra = initSpectra;
|
|
128
123
|
function setPreferences(draft, data) {
|
|
129
124
|
const emptyPreferences = {
|
|
130
125
|
verticalAlign: null,
|
|
131
126
|
};
|
|
132
127
|
const { verticalAlign = null } = data || emptyPreferences;
|
|
133
|
-
|
|
128
|
+
const vAlign = verticalAlign?.[draft.view.spectra.activeTab];
|
|
129
|
+
if (vAlign) {
|
|
134
130
|
(0, PreferencesActions_1.changeSpectrumVerticalAlignment)(draft, {
|
|
135
|
-
verticalAlign,
|
|
131
|
+
verticalAlign: vAlign,
|
|
136
132
|
});
|
|
137
133
|
}
|
|
138
134
|
else {
|
|
139
135
|
(0, PreferencesActions_1.changeSpectrumVerticalAlignment)(draft, { verticalAlign: 'auto-check' });
|
|
140
136
|
}
|
|
141
137
|
}
|
|
142
|
-
function initData(draft, action,
|
|
143
|
-
const {
|
|
138
|
+
function initData(draft, action, options = {}) {
|
|
139
|
+
const { forceInitialize = false, autoOnLoadProcessing = true } = options;
|
|
140
|
+
const { nmriumState: { data, view }, } = action.payload;
|
|
141
|
+
const viewState = view;
|
|
144
142
|
if (data?.spectra?.length || forceInitialize) {
|
|
145
143
|
const state = (0, Reducer_1.getInitialState)();
|
|
146
|
-
setData(state, action.payload);
|
|
147
|
-
(0, ToolsActions_1.setActiveTab)(state, { tab:
|
|
144
|
+
setData(state, action.payload, { autoOnLoadProcessing });
|
|
145
|
+
(0, ToolsActions_1.setActiveTab)(state, { tab: viewState?.spectra?.activeTab || '' });
|
|
148
146
|
state.width = draft.width;
|
|
149
147
|
state.height = draft.height;
|
|
150
|
-
setPreferences(state,
|
|
148
|
+
setPreferences(state, viewState);
|
|
151
149
|
state.isLoading = false;
|
|
152
150
|
state.actionType = action.type;
|
|
153
151
|
return state;
|
|
@@ -161,15 +159,25 @@ function initData(draft, action, forceInitialize = false) {
|
|
|
161
159
|
draft.isLoading = false;
|
|
162
160
|
}
|
|
163
161
|
}
|
|
164
|
-
|
|
165
|
-
|
|
162
|
+
//action
|
|
163
|
+
function handleSetIsLoading(draft, action) {
|
|
164
|
+
draft.isLoading = action.payload.isLoading;
|
|
165
|
+
}
|
|
166
|
+
exports.handleSetIsLoading = handleSetIsLoading;
|
|
167
|
+
//action
|
|
168
|
+
function handleInitiate(draft, action) {
|
|
169
|
+
return initData(draft, action, {
|
|
170
|
+
forceInitialize: true,
|
|
171
|
+
autoOnLoadProcessing: false,
|
|
172
|
+
});
|
|
166
173
|
}
|
|
167
|
-
exports.
|
|
168
|
-
|
|
174
|
+
exports.handleInitiate = handleInitiate;
|
|
175
|
+
//action
|
|
176
|
+
function handleLoadDropFiles(draft, action) {
|
|
169
177
|
const { payload, type } = action;
|
|
170
|
-
const { data: { spectra = [] }, containsNmrium = false, resetSourceObject = true, } = payload;
|
|
178
|
+
const { nmriumState: { data: { spectra = [] } = {} }, containsNmrium = false, resetSourceObject = true, } = payload;
|
|
171
179
|
if (containsNmrium) {
|
|
172
|
-
return initData(draft, action);
|
|
180
|
+
return initData(draft, action, { autoOnLoadProcessing: false });
|
|
173
181
|
}
|
|
174
182
|
else {
|
|
175
183
|
setData(draft, payload);
|
|
@@ -183,4 +191,4 @@ function loadDropFiles(draft, action) {
|
|
|
183
191
|
draft.isLoading = false;
|
|
184
192
|
}
|
|
185
193
|
}
|
|
186
|
-
exports.
|
|
194
|
+
exports.handleLoadDropFiles = handleLoadDropFiles;
|
|
@@ -26,7 +26,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.
|
|
29
|
+
exports.handleChangeMoleculeLabel = exports.handleChangeFloatMoleculePosition = exports.handleToggleMoleculeAtomsNumbers = exports.handleFloatMoleculeOverSpectrum = exports.handlePredictSpectraFromMolecule = exports.handleDeleteMolecule = exports.handleSetMolecule = exports.handleAddMolecule = void 0;
|
|
30
30
|
const PredictionManager_1 = require("../../../data/PredictionManager");
|
|
31
31
|
const SumManager_1 = require("../../../data/data1d/Spectrum1D/SumManager");
|
|
32
32
|
const Molecule_1 = require("../../../data/molecules/Molecule");
|
|
@@ -37,7 +37,9 @@ const Constants_1 = require("../core/Constants");
|
|
|
37
37
|
const RangesActions_1 = require("./RangesActions");
|
|
38
38
|
const ToolsActions_1 = require("./ToolsActions");
|
|
39
39
|
const ZonesActions_1 = require("./ZonesActions");
|
|
40
|
-
|
|
40
|
+
//action
|
|
41
|
+
function handleAddMolecule(draft, action) {
|
|
42
|
+
const { molfile } = action.payload;
|
|
41
43
|
const isEmpty = draft.molecules.length === 0;
|
|
42
44
|
MoleculeManager.addMolfile(draft.molecules, molfile);
|
|
43
45
|
/**
|
|
@@ -49,8 +51,9 @@ function addMoleculeHandler(draft, molfile) {
|
|
|
49
51
|
(0, SumManager_1.changeSpectraRelativeSum)(draft, molecule.id, molecule);
|
|
50
52
|
}
|
|
51
53
|
}
|
|
52
|
-
exports.
|
|
53
|
-
|
|
54
|
+
exports.handleAddMolecule = handleAddMolecule;
|
|
55
|
+
//action
|
|
56
|
+
function handleSetMolecule(draft, action) {
|
|
54
57
|
const { id, label, molfile } = action.payload;
|
|
55
58
|
MoleculeManager.setMolfile(draft.molecules, {
|
|
56
59
|
id,
|
|
@@ -63,16 +66,17 @@ function setMoleculeHandler(draft, action) {
|
|
|
63
66
|
const index = draft.molecules.findIndex((molecule) => molecule.id === id);
|
|
64
67
|
(0, SumManager_1.changeSpectraRelativeSum)(draft, id, index !== -1 ? draft.molecules[index] : draft.molecules[0] || null);
|
|
65
68
|
}
|
|
66
|
-
exports.
|
|
69
|
+
exports.handleSetMolecule = handleSetMolecule;
|
|
67
70
|
function removeAssignments(draft, assignmentData) {
|
|
68
71
|
if (draft.displayerMode === Constants_1.DISPLAYER_MODE.DM_1D) {
|
|
69
|
-
(0, RangesActions_1.
|
|
72
|
+
(0, RangesActions_1.unlinkRange)(draft, { assignmentData });
|
|
70
73
|
}
|
|
71
74
|
if (draft.displayerMode === Constants_1.DISPLAYER_MODE.DM_2D) {
|
|
72
|
-
(0, ZonesActions_1.
|
|
75
|
+
(0, ZonesActions_1.unlinkZone)(draft, { assignmentData });
|
|
73
76
|
}
|
|
74
77
|
}
|
|
75
|
-
|
|
78
|
+
//action
|
|
79
|
+
function handleDeleteMolecule(draft, action) {
|
|
76
80
|
const { id, assignmentData } = action.payload;
|
|
77
81
|
// remove Assignments links of the active spectrum
|
|
78
82
|
removeAssignments(draft, assignmentData);
|
|
@@ -87,15 +91,16 @@ function deleteMoleculeHandler(draft, action) {
|
|
|
87
91
|
*/
|
|
88
92
|
(0, SumManager_1.changeSpectraRelativeSum)(draft, id, draft.molecules[0] || null);
|
|
89
93
|
}
|
|
90
|
-
exports.
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
+
exports.handleDeleteMolecule = handleDeleteMolecule;
|
|
95
|
+
//action
|
|
96
|
+
function handlePredictSpectraFromMolecule(draft, action) {
|
|
97
|
+
const { predictedSpectra, options } = action.payload;
|
|
98
|
+
if (!predictedSpectra) {
|
|
94
99
|
draft.isLoading = false;
|
|
95
100
|
}
|
|
96
101
|
else {
|
|
97
102
|
const color = (0, generateColor_1.generateColor)(false, draft.usedColors['1d']);
|
|
98
|
-
for (const spectrum of (0, PredictionManager_1.generateSpectra)(
|
|
103
|
+
for (const spectrum of (0, PredictionManager_1.generateSpectra)(predictedSpectra, options, color)) {
|
|
99
104
|
draft.data.push(spectrum);
|
|
100
105
|
draft.view.spectra.activeSpectra[(0, nucleusToString_1.default)(spectrum.info.nucleus)] =
|
|
101
106
|
[
|
|
@@ -111,14 +116,18 @@ function predictSpectraFromMoleculeHandler(draft, action) {
|
|
|
111
116
|
(0, ToolsActions_1.setActiveTab)(draft);
|
|
112
117
|
draft.isLoading = false;
|
|
113
118
|
}
|
|
114
|
-
exports.
|
|
119
|
+
exports.handlePredictSpectraFromMolecule = handlePredictSpectraFromMolecule;
|
|
115
120
|
function initMoleculeViewProperties(id, draft) {
|
|
116
121
|
// check if the molecule is exists in the view object otherwise add it with the default value
|
|
117
122
|
if (!draft.view.molecules[id]) {
|
|
123
|
+
const position = getFloatingMoleculeInitialPosition(id, draft);
|
|
118
124
|
draft.view.molecules[id] = {
|
|
119
125
|
floating: {
|
|
120
126
|
visible: false,
|
|
121
|
-
bounding:
|
|
127
|
+
bounding: {
|
|
128
|
+
...Molecule_1.DRAGGABLE_STRUCTURE_INITIAL_BOUNDING_REACT,
|
|
129
|
+
...position,
|
|
130
|
+
},
|
|
122
131
|
},
|
|
123
132
|
showAtomNumber: false,
|
|
124
133
|
};
|
|
@@ -127,7 +136,28 @@ function initMoleculeViewProperties(id, draft) {
|
|
|
127
136
|
function getMoleculeViewObject(id, draft) {
|
|
128
137
|
return draft.view.molecules[id] || null;
|
|
129
138
|
}
|
|
130
|
-
function
|
|
139
|
+
function getFloatingMoleculeInitialPosition(id, draft) {
|
|
140
|
+
const { view: { molecules }, width: displayerWidth, height: displayerHeight, } = draft;
|
|
141
|
+
const { top, left } = Constants_1.MARGIN['2D'];
|
|
142
|
+
const { width: baseWidth, height: baseHeight } = Molecule_1.DRAGGABLE_STRUCTURE_INITIAL_BOUNDING_REACT;
|
|
143
|
+
const width = displayerWidth - left;
|
|
144
|
+
const height = displayerHeight - top;
|
|
145
|
+
const columns = Math.floor(width / baseWidth);
|
|
146
|
+
const rows = Math.floor(height / baseHeight);
|
|
147
|
+
const moleculeKeys = Object.keys(molecules);
|
|
148
|
+
let index = 0;
|
|
149
|
+
if (!molecules[id]) {
|
|
150
|
+
index = moleculeKeys.length - 1;
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
index = moleculeKeys.indexOf(id);
|
|
154
|
+
}
|
|
155
|
+
const x = ((index + 1) % columns) * (width / columns) + left;
|
|
156
|
+
const y = Math.floor(moleculeKeys.length / columns) * (height / rows) + top;
|
|
157
|
+
return { x, y };
|
|
158
|
+
}
|
|
159
|
+
//action
|
|
160
|
+
function handleFloatMoleculeOverSpectrum(draft, action) {
|
|
131
161
|
const { id } = action.payload;
|
|
132
162
|
initMoleculeViewProperties(id, draft);
|
|
133
163
|
const molecule = getMoleculeViewObject(id, draft);
|
|
@@ -135,8 +165,9 @@ function floatMoleculeOverSpectrum(draft, action) {
|
|
|
135
165
|
molecule.floating.visible = !molecule.floating.visible;
|
|
136
166
|
}
|
|
137
167
|
}
|
|
138
|
-
exports.
|
|
139
|
-
|
|
168
|
+
exports.handleFloatMoleculeOverSpectrum = handleFloatMoleculeOverSpectrum;
|
|
169
|
+
//action
|
|
170
|
+
function handleToggleMoleculeAtomsNumbers(draft, action) {
|
|
140
171
|
const { id } = action.payload;
|
|
141
172
|
initMoleculeViewProperties(id, draft);
|
|
142
173
|
const molecule = getMoleculeViewObject(id, draft);
|
|
@@ -144,8 +175,9 @@ function toggleMoleculeAtomsNumbers(draft, action) {
|
|
|
144
175
|
molecule.showAtomNumber = !molecule.showAtomNumber;
|
|
145
176
|
}
|
|
146
177
|
}
|
|
147
|
-
exports.
|
|
148
|
-
|
|
178
|
+
exports.handleToggleMoleculeAtomsNumbers = handleToggleMoleculeAtomsNumbers;
|
|
179
|
+
//action
|
|
180
|
+
function handleChangeFloatMoleculePosition(draft, action) {
|
|
149
181
|
const { id, bounding } = action.payload;
|
|
150
182
|
const molecule = getMoleculeViewObject(id, draft);
|
|
151
183
|
if (molecule) {
|
|
@@ -155,10 +187,11 @@ function changeFloatMoleculePosition(draft, action) {
|
|
|
155
187
|
throw new Error(`Molecule ${id} does not exist`);
|
|
156
188
|
}
|
|
157
189
|
}
|
|
158
|
-
exports.
|
|
159
|
-
|
|
190
|
+
exports.handleChangeFloatMoleculePosition = handleChangeFloatMoleculePosition;
|
|
191
|
+
//action
|
|
192
|
+
function handleChangeMoleculeLabel(draft, action) {
|
|
160
193
|
const { id, label } = action.payload;
|
|
161
194
|
const moleculeIndex = draft.molecules.findIndex((molecule) => molecule.id === id);
|
|
162
195
|
draft.molecules[moleculeIndex].label = label;
|
|
163
196
|
}
|
|
164
|
-
exports.
|
|
197
|
+
exports.handleChangeMoleculeLabel = handleChangeMoleculeLabel;
|
|
@@ -3,23 +3,24 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.handleTogglePeaksViewProperty = exports.
|
|
6
|
+
exports.handleTogglePeaksViewProperty = exports.handleChangePeakShape = exports.handleOptimizePeaks = exports.handleAutoPeakPicking = exports.handleDeletePeak = exports.handleAddPeaks = exports.handleAddPeak = void 0;
|
|
7
7
|
const uuid_1 = require("@lukeed/uuid");
|
|
8
8
|
const immer_1 = require("immer");
|
|
9
9
|
const ml_spectra_processing_1 = require("ml-spectra-processing");
|
|
10
10
|
const Spectrum1D_1 = require("../../../data/data1d/Spectrum1D");
|
|
11
11
|
const useActiveSpectrumPeaksViewState_1 = require("../../hooks/useActiveSpectrumPeaksViewState");
|
|
12
|
-
const ToolTypes_1 = require("../../toolbar/ToolTypes");
|
|
13
12
|
const getActiveSpectrum_1 = require("../helper/getActiveSpectrum");
|
|
14
13
|
const getRange_1 = __importDefault(require("../helper/getRange"));
|
|
15
|
-
|
|
14
|
+
//action
|
|
15
|
+
function handleAddPeak(draft, action) {
|
|
16
|
+
const { x: mouseXPosition } = action.payload;
|
|
16
17
|
const activeSpectrum = (0, getActiveSpectrum_1.getActiveSpectrum)(draft);
|
|
17
18
|
const state = (0, immer_1.original)(draft);
|
|
18
19
|
if (activeSpectrum?.id && state) {
|
|
19
20
|
const { index } = activeSpectrum;
|
|
20
21
|
const xShift = 10;
|
|
21
|
-
const startX =
|
|
22
|
-
const endX =
|
|
22
|
+
const startX = mouseXPosition - xShift;
|
|
23
|
+
const endX = mouseXPosition + xShift;
|
|
23
24
|
const [from, to] = (0, getRange_1.default)(draft, { startX, endX });
|
|
24
25
|
const candidatePeak = (0, Spectrum1D_1.lookupPeak)(state.data[index].data, {
|
|
25
26
|
from,
|
|
@@ -38,14 +39,15 @@ function addPeak(draft, mouseCoordinates) {
|
|
|
38
39
|
}
|
|
39
40
|
}
|
|
40
41
|
}
|
|
41
|
-
exports.
|
|
42
|
-
|
|
42
|
+
exports.handleAddPeak = handleAddPeak;
|
|
43
|
+
//action
|
|
44
|
+
function handleAddPeaks(draft, action) {
|
|
43
45
|
const state = (0, immer_1.original)(draft);
|
|
44
46
|
const activeSpectrum = (0, getActiveSpectrum_1.getActiveSpectrum)(draft);
|
|
45
47
|
if (activeSpectrum) {
|
|
46
48
|
const { index } = activeSpectrum;
|
|
47
49
|
const datumOriginal = state.data[index];
|
|
48
|
-
const { startX, endX } = action;
|
|
50
|
+
const { startX, endX } = action.payload;
|
|
49
51
|
const [from, to] = (0, getRange_1.default)(draft, { startX, endX });
|
|
50
52
|
if (from !== to) {
|
|
51
53
|
const peak = (0, Spectrum1D_1.lookupPeak)(datumOriginal.data, { from, to });
|
|
@@ -63,13 +65,15 @@ function addPeaks(draft, action) {
|
|
|
63
65
|
}
|
|
64
66
|
}
|
|
65
67
|
}
|
|
66
|
-
exports.
|
|
67
|
-
|
|
68
|
+
exports.handleAddPeaks = handleAddPeaks;
|
|
69
|
+
//action
|
|
70
|
+
function handleDeletePeak(draft, action) {
|
|
68
71
|
const activeSpectrum = (0, getActiveSpectrum_1.getActiveSpectrum)(draft);
|
|
72
|
+
const peakData = action?.payload || {};
|
|
69
73
|
if (activeSpectrum) {
|
|
70
74
|
const { index } = activeSpectrum;
|
|
71
75
|
const state = (0, immer_1.original)(draft);
|
|
72
|
-
if (peakData
|
|
76
|
+
if (!peakData) {
|
|
73
77
|
draft.data[index].peaks.values = [];
|
|
74
78
|
}
|
|
75
79
|
else {
|
|
@@ -78,7 +82,8 @@ function deletePeak(draft, peakData) {
|
|
|
78
82
|
}
|
|
79
83
|
}
|
|
80
84
|
}
|
|
81
|
-
exports.
|
|
85
|
+
exports.handleDeletePeak = handleDeletePeak;
|
|
86
|
+
//action
|
|
82
87
|
function handleOptimizePeaks(draft, action) {
|
|
83
88
|
const { peaks } = action.payload;
|
|
84
89
|
const activeSpectrum = (0, getActiveSpectrum_1.getActiveSpectrum)(draft);
|
|
@@ -95,11 +100,12 @@ function handleOptimizePeaks(draft, action) {
|
|
|
95
100
|
}
|
|
96
101
|
}
|
|
97
102
|
exports.handleOptimizePeaks = handleOptimizePeaks;
|
|
103
|
+
//action
|
|
98
104
|
function handleAutoPeakPicking(draft, action) {
|
|
99
105
|
const { maxNumberOfPeaks, minMaxRatio, noiseFactor, direction } = action.payload;
|
|
100
106
|
const activeSpectrum = (0, getActiveSpectrum_1.getActiveSpectrum)(draft);
|
|
101
107
|
if (activeSpectrum?.id) {
|
|
102
|
-
draft.toolOptions.selectedTool =
|
|
108
|
+
draft.toolOptions.selectedTool = 'zoom';
|
|
103
109
|
draft.toolOptions.selectedOptionPanel = null;
|
|
104
110
|
const { index } = activeSpectrum;
|
|
105
111
|
const datum = draft.data[index];
|
|
@@ -118,7 +124,8 @@ function handleAutoPeakPicking(draft, action) {
|
|
|
118
124
|
}
|
|
119
125
|
}
|
|
120
126
|
exports.handleAutoPeakPicking = handleAutoPeakPicking;
|
|
121
|
-
|
|
127
|
+
//action
|
|
128
|
+
function handleChangePeakShape(draft, action) {
|
|
122
129
|
const { shape, id } = action.payload;
|
|
123
130
|
const activeSpectrum = (0, getActiveSpectrum_1.getActiveSpectrum)(draft);
|
|
124
131
|
if (activeSpectrum?.id) {
|
|
@@ -130,7 +137,8 @@ function changePeakShapeHandler(draft, action) {
|
|
|
130
137
|
}
|
|
131
138
|
}
|
|
132
139
|
}
|
|
133
|
-
exports.
|
|
140
|
+
exports.handleChangePeakShape = handleChangePeakShape;
|
|
141
|
+
//action
|
|
134
142
|
function handleTogglePeaksViewProperty(draft, action) {
|
|
135
143
|
const { key } = action.payload;
|
|
136
144
|
togglePeaksViewProperty(draft, key);
|