nmrium 0.38.0 → 0.38.2
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/database/DatabaseSpectrum.js +2 -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/MouseTracker.d.ts +6 -2
- package/lib/component/EventsTrackers/MouseTracker.js +4 -1
- package/lib/component/NMRium.d.ts +4 -5
- package/lib/component/NMRium.js +11 -14
- package/lib/component/assignment/AssignmentsReducer.d.ts +2 -2
- package/lib/component/context/PreferencesContext.d.ts +6 -6
- 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/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 +1 -1
- 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 +35 -66
- 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 +43 -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/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 +1 -6
- 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/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/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 +11 -28
- 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 +107 -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 -25
- 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/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 +2 -2
- package/lib/component/reducer/actions/ToolsActions.d.ts +2 -2
- package/lib/component/reducer/actions/ZonesActions.d.ts +2 -1
- package/lib/component/reducer/actions/ZonesActions.js +1 -2
- 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/panelsPreferencesDefaultValues.d.ts +1 -1
- package/lib/component/reducer/preferences/preferencesReducer.d.ts +1 -1
- 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 +2 -1
- package/lib/data/PredictionManager.js +16 -2
- 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/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 +2 -1
- 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/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/database/DatabaseSpectrum.js +2 -1
- 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/MouseTracker.js +4 -1
- package/lib-cjs/component/NMRium.js +8 -11
- 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/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 +1 -1
- package/lib-cjs/component/loader/DropZone.js +1 -2
- package/lib-cjs/component/modal/LoadJCAMPModal.js +60 -67
- 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 +43 -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/forms/components/DeltaInput.js +2 -0
- package/lib-cjs/component/modal/metaImportation/MetaImportationModal.js +15 -5
- package/lib-cjs/component/modal/setting/GeneralSettings.js +1 -6
- 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/RangesPanel/RangesHeader.js +38 -52
- package/lib-cjs/component/panels/RangesPanel/RangesPreferences.js +5 -20
- 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 +11 -28
- 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 +107 -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 -27
- 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/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 +4 -27
- package/lib-cjs/component/reducer/actions/ZonesActions.js +4 -28
- 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 +16 -2
- 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/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 +25 -25
- 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
|
@@ -22,9 +22,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
22
22
|
__setModuleDefault(result, mod);
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
26
|
exports.handleChangeMoleculeLabel = exports.handleChangeFloatMoleculePosition = exports.handleToggleMoleculeAtomsNumbers = exports.handleFloatMoleculeOverSpectrum = exports.handlePredictSpectraFromMolecule = exports.handleDeleteMolecule = exports.handleSetMolecule = exports.handleAddMolecule = void 0;
|
|
30
27
|
const PredictionManager_1 = require("../../../data/PredictionManager");
|
|
@@ -32,14 +29,12 @@ const SumManager_1 = require("../../../data/data1d/Spectrum1D/SumManager");
|
|
|
32
29
|
const Molecule_1 = require("../../../data/molecules/Molecule");
|
|
33
30
|
const MoleculeManager = __importStar(require("../../../data/molecules/MoleculeManager"));
|
|
34
31
|
const generateColor_1 = require("../../../data/utilities/generateColor");
|
|
35
|
-
const nucleusToString_1 = __importDefault(require("../../utility/nucleusToString"));
|
|
36
32
|
const Constants_1 = require("../core/Constants");
|
|
37
33
|
const RangesActions_1 = require("./RangesActions");
|
|
38
34
|
const ToolsActions_1 = require("./ToolsActions");
|
|
39
35
|
const ZonesActions_1 = require("./ZonesActions");
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
const { molfile } = action.payload;
|
|
36
|
+
function addMolecule(draft, props) {
|
|
37
|
+
const { molfile, floatMoleculeOnSave } = props;
|
|
43
38
|
const isEmpty = draft.molecules.length === 0;
|
|
44
39
|
MoleculeManager.addMolfile(draft.molecules, molfile);
|
|
45
40
|
/**
|
|
@@ -50,11 +45,19 @@ function handleAddMolecule(draft, action) {
|
|
|
50
45
|
if (isEmpty && molecule) {
|
|
51
46
|
(0, SumManager_1.changeSpectraRelativeSum)(draft, molecule.id, molecule);
|
|
52
47
|
}
|
|
48
|
+
const lastAddedMolecule = draft.molecules.at(-1);
|
|
49
|
+
if (floatMoleculeOnSave && lastAddedMolecule) {
|
|
50
|
+
floatMoleculeOverSpectrum(draft, lastAddedMolecule.id, true);
|
|
51
|
+
}
|
|
52
|
+
return lastAddedMolecule;
|
|
53
53
|
}
|
|
54
|
-
exports.handleAddMolecule = handleAddMolecule;
|
|
55
54
|
//action
|
|
56
|
-
function
|
|
57
|
-
|
|
55
|
+
function handleAddMolecule(draft, action) {
|
|
56
|
+
addMolecule(draft, action.payload);
|
|
57
|
+
}
|
|
58
|
+
exports.handleAddMolecule = handleAddMolecule;
|
|
59
|
+
function setMolecule(draft, props) {
|
|
60
|
+
const { id, label, molfile } = props;
|
|
58
61
|
MoleculeManager.setMolfile(draft.molecules, {
|
|
59
62
|
id,
|
|
60
63
|
label,
|
|
@@ -66,6 +69,10 @@ function handleSetMolecule(draft, action) {
|
|
|
66
69
|
const index = draft.molecules.findIndex((molecule) => molecule.id === id);
|
|
67
70
|
(0, SumManager_1.changeSpectraRelativeSum)(draft, id, index !== -1 ? draft.molecules[index] : draft.molecules[0] || null);
|
|
68
71
|
}
|
|
72
|
+
//action
|
|
73
|
+
function handleSetMolecule(draft, action) {
|
|
74
|
+
setMolecule(draft, action.payload);
|
|
75
|
+
}
|
|
69
76
|
exports.handleSetMolecule = handleSetMolecule;
|
|
70
77
|
function removeAssignments(draft, assignmentData) {
|
|
71
78
|
if (draft.displayerMode === Constants_1.DISPLAYER_MODE.DM_1D) {
|
|
@@ -94,29 +101,45 @@ function handleDeleteMolecule(draft, action) {
|
|
|
94
101
|
exports.handleDeleteMolecule = handleDeleteMolecule;
|
|
95
102
|
//action
|
|
96
103
|
function handlePredictSpectraFromMolecule(draft, action) {
|
|
97
|
-
const { predictedSpectra, options } = action.payload;
|
|
98
|
-
|
|
99
|
-
|
|
104
|
+
const { predictedSpectra, options, molecule, action: predictionAction = 'save', } = action.payload;
|
|
105
|
+
const color = (0, generateColor_1.generateColor)(false, draft.usedColors['1d']);
|
|
106
|
+
const spectraIds = [];
|
|
107
|
+
for (const spectrum of (0, PredictionManager_1.generateSpectra)(predictedSpectra, options, color)) {
|
|
108
|
+
draft.data.push(spectrum);
|
|
109
|
+
spectraIds.push(spectrum.id);
|
|
110
|
+
}
|
|
111
|
+
let id = molecule?.id;
|
|
112
|
+
//if the id object is not exits add a new molecule
|
|
113
|
+
if (!id || predictionAction === 'add') {
|
|
114
|
+
const moleculeObj = addMolecule(draft, {
|
|
115
|
+
molfile: molecule.molfile,
|
|
116
|
+
floatMoleculeOnSave: true,
|
|
117
|
+
});
|
|
118
|
+
id = moleculeObj?.id;
|
|
100
119
|
}
|
|
101
120
|
else {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
{
|
|
108
|
-
id: spectrum.id,
|
|
109
|
-
index: draft.data.length - 1,
|
|
110
|
-
},
|
|
111
|
-
];
|
|
112
|
-
}
|
|
113
|
-
draft.usedColors['1d'].push(color);
|
|
121
|
+
setMolecule(draft, molecule);
|
|
122
|
+
}
|
|
123
|
+
if (id) {
|
|
124
|
+
//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
|
|
125
|
+
setPredictedSpectraReference(draft, id, spectraIds);
|
|
114
126
|
}
|
|
127
|
+
draft.usedColors['1d'] = draft.usedColors['1d'].filter((previousColor) => previousColor !== color);
|
|
128
|
+
draft.usedColors['1d'].push(color);
|
|
115
129
|
draft.toolOptions.data.predictionIndex++;
|
|
116
|
-
(0, ToolsActions_1.setActiveTab)(draft);
|
|
117
|
-
draft.isLoading = false;
|
|
130
|
+
(0, ToolsActions_1.setActiveTab)(draft, { refreshActiveTab: true, tab: '1H' });
|
|
118
131
|
}
|
|
119
132
|
exports.handlePredictSpectraFromMolecule = handlePredictSpectraFromMolecule;
|
|
133
|
+
function setPredictedSpectraReference(draft, moleculeId, spectraIds) {
|
|
134
|
+
const predictedSpectraIds = draft.view.predictions?.[moleculeId];
|
|
135
|
+
// check if the molecule predicted and return and the spectra Ids
|
|
136
|
+
if (predictedSpectraIds) {
|
|
137
|
+
//remove the old predicted spectra for the current molecule
|
|
138
|
+
draft.data = draft.data.filter((spectrum) => !predictedSpectraIds.includes(spectrum.id));
|
|
139
|
+
}
|
|
140
|
+
// set the predicted spectra ids
|
|
141
|
+
draft.view.predictions[moleculeId] = spectraIds;
|
|
142
|
+
}
|
|
120
143
|
function initMoleculeViewProperties(id, draft) {
|
|
121
144
|
// check if the molecule is exists in the view object otherwise add it with the default value
|
|
122
145
|
if (!draft.view.molecules[id]) {
|
|
@@ -156,14 +179,17 @@ function getFloatingMoleculeInitialPosition(id, draft) {
|
|
|
156
179
|
const y = Math.floor(moleculeKeys.length / columns) * (height / rows) + top;
|
|
157
180
|
return { x, y };
|
|
158
181
|
}
|
|
182
|
+
function floatMoleculeOverSpectrum(draft, moleculeId, value) {
|
|
183
|
+
initMoleculeViewProperties(moleculeId, draft);
|
|
184
|
+
const molecule = getMoleculeViewObject(moleculeId, draft);
|
|
185
|
+
if (molecule) {
|
|
186
|
+
molecule.floating.visible = value ?? !molecule.floating.visible;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
159
189
|
//action
|
|
160
190
|
function handleFloatMoleculeOverSpectrum(draft, action) {
|
|
161
191
|
const { id } = action.payload;
|
|
162
|
-
|
|
163
|
-
const molecule = getMoleculeViewObject(id, draft);
|
|
164
|
-
if (molecule) {
|
|
165
|
-
molecule.floating.visible = !molecule.floating.visible;
|
|
166
|
-
}
|
|
192
|
+
floatMoleculeOverSpectrum(draft, id);
|
|
167
193
|
}
|
|
168
194
|
exports.handleFloatMoleculeOverSpectrum = handleFloatMoleculeOverSpectrum;
|
|
169
195
|
//action
|
|
@@ -69,15 +69,15 @@ exports.handleAddPeaks = handleAddPeaks;
|
|
|
69
69
|
//action
|
|
70
70
|
function handleDeletePeak(draft, action) {
|
|
71
71
|
const activeSpectrum = (0, getActiveSpectrum_1.getActiveSpectrum)(draft);
|
|
72
|
-
const
|
|
72
|
+
const peakId = action?.payload?.id;
|
|
73
73
|
if (activeSpectrum) {
|
|
74
74
|
const { index } = activeSpectrum;
|
|
75
75
|
const state = (0, immer_1.original)(draft);
|
|
76
|
-
if (!
|
|
76
|
+
if (!peakId) {
|
|
77
77
|
draft.data[index].peaks.values = [];
|
|
78
78
|
}
|
|
79
79
|
else {
|
|
80
|
-
const peakIndex = state.data[index].peaks.values.findIndex((p) => p.id ===
|
|
80
|
+
const peakIndex = state.data[index].peaks.values.findIndex((p) => p.id === peakId);
|
|
81
81
|
draft.data[index].peaks.values.splice(peakIndex, 1);
|
|
82
82
|
}
|
|
83
83
|
}
|
|
@@ -1,27 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
4
|
};
|
|
@@ -31,8 +8,7 @@ const uuid_1 = require("@lukeed/uuid");
|
|
|
31
8
|
const immer_1 = require("immer");
|
|
32
9
|
const cloneDeep_1 = __importDefault(require("lodash/cloneDeep"));
|
|
33
10
|
const ml_spectra_processing_1 = require("ml-spectra-processing");
|
|
34
|
-
const
|
|
35
|
-
const FiltersManager = __importStar(require("../../../data/FiltersManager"));
|
|
11
|
+
const nmr_processing_1 = require("nmr-processing");
|
|
36
12
|
const SignalsKinds_1 = require("../../../data/constants/SignalsKinds");
|
|
37
13
|
const Spectrum1D_1 = require("../../../data/data1d/Spectrum1D");
|
|
38
14
|
const SumManager_1 = require("../../../data/data1d/Spectrum1D/SumManager");
|
|
@@ -290,26 +266,18 @@ function handleChangeRangeSum(draft, action) {
|
|
|
290
266
|
}
|
|
291
267
|
}
|
|
292
268
|
exports.handleChangeRangeSum = handleChangeRangeSum;
|
|
293
|
-
|
|
294
|
-
|
|
269
|
+
//action
|
|
270
|
+
function handleAddRange(draft, action) {
|
|
271
|
+
const { startX, endX } = action.payload;
|
|
295
272
|
const range = (0, getRange_1.default)(draft, { startX, endX });
|
|
296
|
-
const { data, view: { spectra: { activeTab: nucleus },
|
|
273
|
+
const { data, view: { spectra: { activeTab: nucleus }, }, molecules, } = draft;
|
|
297
274
|
const activeSpectrum = (0, getActiveSpectrum_1.getActiveSpectrum)(draft);
|
|
298
275
|
if (activeSpectrum?.id) {
|
|
299
276
|
const { index } = activeSpectrum;
|
|
300
277
|
const [from, to] = range;
|
|
301
|
-
// add range intial state
|
|
302
|
-
const rangeState = ranges.find((r) => r.spectrumID === activeSpectrum.id);
|
|
303
|
-
if (!rangeState) {
|
|
304
|
-
ranges.push({
|
|
305
|
-
spectrumID: activeSpectrum.id,
|
|
306
|
-
...Reducer_1.rangeStateInit,
|
|
307
|
-
});
|
|
308
|
-
}
|
|
309
278
|
(0, Spectrum1D_1.addRange)(data[index], {
|
|
310
279
|
from,
|
|
311
280
|
to,
|
|
312
|
-
id,
|
|
313
281
|
nucleus,
|
|
314
282
|
molecules,
|
|
315
283
|
});
|
|
@@ -317,19 +285,6 @@ function addNewRange(draft, props) {
|
|
|
317
285
|
(0, DomainActions_1.setIntegralsYDomain)(draft, data[index]);
|
|
318
286
|
}
|
|
319
287
|
}
|
|
320
|
-
//action
|
|
321
|
-
function handleAddRange(draft, action) {
|
|
322
|
-
let { startX, endX } = action?.payload || {};
|
|
323
|
-
if (startX && endX) {
|
|
324
|
-
addNewRange(draft, { startX, endX });
|
|
325
|
-
}
|
|
326
|
-
else {
|
|
327
|
-
const { width } = draft;
|
|
328
|
-
startX = width / 3;
|
|
329
|
-
endX = startX + 10;
|
|
330
|
-
addNewRange(draft, { startX, endX, id: 'new' });
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
288
|
exports.handleAddRange = handleAddRange;
|
|
334
289
|
//action
|
|
335
290
|
function handleChangeRangeRelativeValue(draft, action) {
|
|
@@ -352,8 +307,8 @@ function handleChangeRangeSignalValue(draft, action) {
|
|
|
352
307
|
signalID,
|
|
353
308
|
newSignalValue: value,
|
|
354
309
|
});
|
|
355
|
-
FiltersManager.applyFilter(draft.data[index], [
|
|
356
|
-
{ name: Filters.shiftX.id, value: { shift } },
|
|
310
|
+
nmr_processing_1.FiltersManager.applyFilter(draft.data[index], [
|
|
311
|
+
{ name: nmr_processing_1.Filters.shiftX.id, value: { shift } },
|
|
357
312
|
]);
|
|
358
313
|
(0, CorrelationsActions_1.handleUpdateCorrelations)(draft);
|
|
359
314
|
(0, DomainActions_1.setDomain)(draft);
|
|
@@ -1,27 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
4
|
};
|
|
@@ -31,8 +8,7 @@ const immer_1 = require("immer");
|
|
|
31
8
|
const get_1 = __importDefault(require("lodash/get"));
|
|
32
9
|
const omitBy_1 = __importDefault(require("lodash/omitBy"));
|
|
33
10
|
const set_1 = __importDefault(require("lodash/set"));
|
|
34
|
-
const
|
|
35
|
-
const FiltersManager_1 = require("../../../data/FiltersManager");
|
|
11
|
+
const nmr_processing_1 = require("nmr-processing");
|
|
36
12
|
const Spectrum1D_1 = require("../../../data/data1d/Spectrum1D");
|
|
37
13
|
const Spectrum2D_1 = require("../../../data/data2d/Spectrum2D");
|
|
38
14
|
const contours_1 = require("../../../data/data2d/Spectrum2D/contours");
|
|
@@ -46,6 +22,7 @@ const getActiveSpectrum_1 = require("../helper/getActiveSpectrum");
|
|
|
46
22
|
const DomainActions_1 = require("./DomainActions");
|
|
47
23
|
const FiltersActions_1 = require("./FiltersActions");
|
|
48
24
|
const ToolsActions_1 = require("./ToolsActions");
|
|
25
|
+
const { applyFilter } = nmr_processing_1.FiltersManager;
|
|
49
26
|
function checkIsVisible2D(datum) {
|
|
50
27
|
if (!datum.display.isPositiveVisible && !datum.display.isNegativeVisible) {
|
|
51
28
|
return false;
|
|
@@ -312,9 +289,9 @@ function handleAlignSpectraHandler(draft, action) {
|
|
|
312
289
|
datum.info.nucleus === draft.view.spectra.activeTab &&
|
|
313
290
|
!datum.info?.isFid) {
|
|
314
291
|
const shift = (0, Spectrum1D_1.getReferenceShift)(datum, { ...action.payload });
|
|
315
|
-
|
|
292
|
+
applyFilter(datum, [
|
|
316
293
|
{
|
|
317
|
-
name: Filters.shiftX.id,
|
|
294
|
+
name: nmr_processing_1.Filters.shiftX.id,
|
|
318
295
|
value: { shift },
|
|
319
296
|
},
|
|
320
297
|
]);
|
|
@@ -1,27 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
4
|
};
|
|
@@ -30,8 +7,7 @@ exports.handleShowPeaks = exports.handleShowSignals = exports.handleShowZones =
|
|
|
30
7
|
const immer_1 = require("immer");
|
|
31
8
|
const cloneDeep_1 = __importDefault(require("lodash/cloneDeep"));
|
|
32
9
|
const nmr_correlation_1 = require("nmr-correlation");
|
|
33
|
-
const
|
|
34
|
-
const FiltersManager = __importStar(require("../../../data/FiltersManager"));
|
|
10
|
+
const nmr_processing_1 = require("nmr-processing");
|
|
35
11
|
const SignalsKinds_1 = require("../../../data/constants/SignalsKinds");
|
|
36
12
|
const Spectrum2D_1 = require("../../../data/data2d/Spectrum2D");
|
|
37
13
|
const ZoneUtilities_1 = require("../../../data/utilities/ZoneUtilities");
|
|
@@ -110,12 +86,12 @@ function handleChangeZoneSignalDelta(draft, action) {
|
|
|
110
86
|
const { xShift, yShift } = (0, Spectrum2D_1.changeZoneSignal)(draft.data[index], zoneId, signal);
|
|
111
87
|
let filters = [];
|
|
112
88
|
if (xShift !== 0) {
|
|
113
|
-
filters.push({ name: Filters.shift2DX.id, value: { shift: xShift } });
|
|
89
|
+
filters.push({ name: nmr_processing_1.Filters.shift2DX.id, value: { shift: xShift } });
|
|
114
90
|
}
|
|
115
91
|
if (yShift !== 0) {
|
|
116
|
-
filters.push({ name: Filters.shift2DY.id, value: { shift: yShift } });
|
|
92
|
+
filters.push({ name: nmr_processing_1.Filters.shift2DY.id, value: { shift: yShift } });
|
|
117
93
|
}
|
|
118
|
-
FiltersManager.applyFilter(draft.data[index], filters);
|
|
94
|
+
nmr_processing_1.FiltersManager.applyFilter(draft.data[index], filters);
|
|
119
95
|
(0, DomainActions_1.setDomain)(draft);
|
|
120
96
|
(0, CorrelationsActions_1.handleUpdateCorrelations)(draft);
|
|
121
97
|
}
|
|
@@ -9,7 +9,6 @@ const react_1 = require("react");
|
|
|
9
9
|
const fa_1 = require("react-icons/fa");
|
|
10
10
|
const ui_1 = require("react-science/ui");
|
|
11
11
|
const ChartContext_1 = require("../context/ChartContext");
|
|
12
|
-
const DispatchContext_1 = require("../context/DispatchContext");
|
|
13
12
|
const LoaderContext_1 = require("../context/LoaderContext");
|
|
14
13
|
const ToolbarMenu_1 = __importDefault(require("../elements/ToolbarMenu"));
|
|
15
14
|
const Modal_1 = require("../elements/popup/Modal");
|
|
@@ -20,7 +19,7 @@ const useExport_1 = __importDefault(require("../hooks/useExport"));
|
|
|
20
19
|
const useToolsFunctions_1 = __importDefault(require("../hooks/useToolsFunctions"));
|
|
21
20
|
const useVerticalAlign_1 = require("../hooks/useVerticalAlign");
|
|
22
21
|
const ImportPublicationStringModal_1 = __importDefault(require("../modal/ImportPublicationStringModal"));
|
|
23
|
-
const LoadJCAMPModal_1 =
|
|
22
|
+
const LoadJCAMPModal_1 = require("../modal/LoadJCAMPModal");
|
|
24
23
|
const index_1 = require("../modal/metaImportation/index");
|
|
25
24
|
const IMPORT_MENU = [
|
|
26
25
|
{
|
|
@@ -77,12 +76,12 @@ const EXPORT_MENU = [
|
|
|
77
76
|
},
|
|
78
77
|
];
|
|
79
78
|
function BasicToolBarInner({ verticalAlign, ftCounter, fidCounter, }) {
|
|
80
|
-
const dispatch = (0, DispatchContext_1.useDispatch)();
|
|
81
79
|
const modal = (0, Modal_1.useModal)();
|
|
82
80
|
const openLoader = (0, LoaderContext_1.useLoader)();
|
|
83
81
|
const openMetaInformationModal = (0, index_1.useMetaInformationImportationModal)();
|
|
84
82
|
const isExperimentalFeature = (0, useCheckExperimentalFeature_1.default)();
|
|
85
83
|
const isButtonVisible = (0, useCheckToolsVisibility_1.useCheckToolsVisibility)();
|
|
84
|
+
const [isLoadModalOpened, openLoadModal, closeLoadModal] = (0, ui_1.useOnOff)(false);
|
|
86
85
|
const importMenu = isExperimentalFeature
|
|
87
86
|
? IMPORT_MENU
|
|
88
87
|
: IMPORT_MENU.filter((item) => item.id !== 'importPublicationString');
|
|
@@ -91,13 +90,9 @@ function BasicToolBarInner({ verticalAlign, ftCounter, fidCounter, }) {
|
|
|
91
90
|
: EXPORT_MENU.filter((item) => item.id !== 'nmre');
|
|
92
91
|
const { isRealSpectrumShown, changeSpectrumViewHandler, changeDisplayViewModeHandler, alignSpectrumsVerticallyHandler, } = (0, useToolsFunctions_1.default)();
|
|
93
92
|
const { saveAsSVGHandler, saveAsPNGHandler, saveAsJSONHandler, saveToClipboardHandler, saveAsHandler, } = (0, useExport_1.default)();
|
|
94
|
-
const startLoadingHandler = (0, react_1.useCallback)(() => {
|
|
95
|
-
modal.close();
|
|
96
|
-
dispatch({ type: 'SET_LOADING_FLAG', payload: { isLoading: true } });
|
|
97
|
-
}, [dispatch, modal]);
|
|
98
93
|
const importJCAMPFile = (0, react_1.useCallback)(() => {
|
|
99
|
-
|
|
100
|
-
}, [
|
|
94
|
+
openLoadModal();
|
|
95
|
+
}, [openLoadModal]);
|
|
101
96
|
const openImportPublicationStringModal = (0, react_1.useCallback)(() => {
|
|
102
97
|
modal.show((0, jsx_runtime_1.jsx)(ImportPublicationStringModal_1.default, { onClose: () => modal.close() }), {});
|
|
103
98
|
}, [modal]);
|
|
@@ -150,7 +145,7 @@ function BasicToolBarInner({ verticalAlign, ftCounter, fidCounter, }) {
|
|
|
150
145
|
saveAsHandler,
|
|
151
146
|
saveToClipboardHandler,
|
|
152
147
|
]);
|
|
153
|
-
return ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [isButtonVisible('import') && ((0, jsx_runtime_1.jsx)(ToolbarMenu_1.default, { component: (0, jsx_runtime_1.jsx)(fa_1.FaFileImport, {}), toolTip: "Import", onClick: (element) => {
|
|
148
|
+
return ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(LoadJCAMPModal_1.LoadJCAMPModal, { isOpen: isLoadModalOpened, onCloseDialog: closeLoadModal }), isButtonVisible('import') && ((0, jsx_runtime_1.jsx)(ToolbarMenu_1.default, { component: (0, jsx_runtime_1.jsx)(fa_1.FaFileImport, {}), toolTip: "Import", onClick: (element) => {
|
|
154
149
|
importHandler(element);
|
|
155
150
|
return null;
|
|
156
151
|
}, items: importMenu })), isButtonVisible('exportAs') && ((0, jsx_runtime_1.jsx)(ToolbarMenu_1.default, { component: (0, jsx_runtime_1.jsx)(fa_1.FaFileExport, {}), toolTip: "Export As", onClick: (element) => {
|
|
@@ -1,30 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
3
|
exports.options = void 0;
|
|
27
|
-
const
|
|
4
|
+
const nmr_processing_1 = require("nmr-processing");
|
|
28
5
|
const Constants_1 = require("../reducer/core/Constants");
|
|
29
6
|
exports.options = {
|
|
30
7
|
zoom: {
|
|
@@ -133,8 +110,8 @@ exports.options = {
|
|
|
133
110
|
isToggle: true,
|
|
134
111
|
},
|
|
135
112
|
apodization: {
|
|
136
|
-
id: Filters.apodization.id,
|
|
137
|
-
label: Filters.apodization.name,
|
|
113
|
+
id: nmr_processing_1.Filters.apodization.id,
|
|
114
|
+
label: nmr_processing_1.Filters.apodization.name,
|
|
138
115
|
hasOptionPanel: true,
|
|
139
116
|
isFilter: true,
|
|
140
117
|
mode: Constants_1.DISPLAYER_MODE.DM_1D,
|
|
@@ -150,8 +127,8 @@ exports.options = {
|
|
|
150
127
|
isToggle: true,
|
|
151
128
|
},
|
|
152
129
|
zeroFilling: {
|
|
153
|
-
id: Filters.zeroFilling.id,
|
|
154
|
-
label: Filters.zeroFilling.name,
|
|
130
|
+
id: nmr_processing_1.Filters.zeroFilling.id,
|
|
131
|
+
label: nmr_processing_1.Filters.zeroFilling.name,
|
|
155
132
|
hasOptionPanel: true,
|
|
156
133
|
isFilter: true,
|
|
157
134
|
mode: Constants_1.DISPLAYER_MODE.DM_1D,
|
|
@@ -167,8 +144,8 @@ exports.options = {
|
|
|
167
144
|
isToggle: true,
|
|
168
145
|
},
|
|
169
146
|
phaseCorrection: {
|
|
170
|
-
id: Filters.phaseCorrection.id,
|
|
171
|
-
label: Filters.phaseCorrection.name,
|
|
147
|
+
id: nmr_processing_1.Filters.phaseCorrection.id,
|
|
148
|
+
label: nmr_processing_1.Filters.phaseCorrection.name,
|
|
172
149
|
hasOptionPanel: true,
|
|
173
150
|
isFilter: true,
|
|
174
151
|
mode: Constants_1.DISPLAYER_MODE.DM_1D,
|
|
@@ -184,8 +161,8 @@ exports.options = {
|
|
|
184
161
|
isToggle: true,
|
|
185
162
|
},
|
|
186
163
|
baselineCorrection: {
|
|
187
|
-
id: Filters.baselineCorrection.id,
|
|
188
|
-
label: Filters.baselineCorrection.name,
|
|
164
|
+
id: nmr_processing_1.Filters.baselineCorrection.id,
|
|
165
|
+
label: nmr_processing_1.Filters.baselineCorrection.name,
|
|
189
166
|
hasOptionPanel: true,
|
|
190
167
|
isFilter: true,
|
|
191
168
|
mode: Constants_1.DISPLAYER_MODE.DM_1D,
|