nmrium 0.38.1 → 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/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 +5 -24
- package/lib/component/panels/databasePanel/DatabasePreferences.js +2 -2
- package/lib/component/panels/header/DefaultPanelHeader.d.ts +2 -3
- package/lib/component/panels/header/DefaultPanelHeader.js +18 -26
- package/lib/component/panels/header/PanelHeader.d.ts +7 -0
- package/lib/component/panels/header/PanelHeader.js +12 -0
- package/lib/component/panels/predictionPanel/PredictionOptionsPanel.d.ts +9 -0
- package/lib/component/panels/predictionPanel/PredictionOptionsPanel.js +94 -0
- package/lib/component/panels/predictionPanel/PredictionPanel.d.ts +1 -1
- package/lib/component/panels/predictionPanel/PredictionPanel.js +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 -29
- 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.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/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 +5 -24
- package/lib-cjs/component/panels/databasePanel/DatabasePreferences.js +25 -2
- package/lib-cjs/component/panels/header/DefaultPanelHeader.js +18 -26
- package/lib-cjs/component/panels/header/PanelHeader.js +15 -0
- package/lib-cjs/component/panels/predictionPanel/PredictionOptionsPanel.js +122 -0
- package/lib-cjs/component/panels/predictionPanel/PredictionPanel.js +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 -31
- 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
|
@@ -1,51 +1,121 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef, useState } from 'react';
|
|
3
|
+
import { ResponsiveChart } from 'react-d3-utils';
|
|
4
|
+
import { StructureEditor } from 'react-ocl/full';
|
|
3
5
|
import { useAccordionContext } from 'react-science/ui';
|
|
6
|
+
import { predictSpectra } from '../../../data/PredictionManager';
|
|
4
7
|
import { useChartData } from '../../context/ChartContext';
|
|
5
8
|
import { useDispatch } from '../../context/DispatchContext';
|
|
9
|
+
import Button from '../../elements/Button';
|
|
10
|
+
import NextPrev from '../../elements/NextPrev';
|
|
6
11
|
import { useAlert } from '../../elements/popup/Alert';
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
import { usePanelPreferences } from '../../hooks/usePanelPreferences';
|
|
13
|
+
import { useMoleculeEditor } from '../../modal/MoleculeStructureEditorModal';
|
|
14
|
+
import MoleculeHeader from '../MoleculesPanel/MoleculeHeader';
|
|
15
|
+
import MoleculePanelHeader from '../MoleculesPanel/MoleculePanelHeader';
|
|
16
|
+
import { tablePanelStyle } from '../extra/BasicPanelStyle';
|
|
17
|
+
import PreferencesHeader from '../header/PreferencesHeader';
|
|
18
|
+
import PredictionPreferences from './PredictionPreferences';
|
|
19
|
+
import PredictionSimpleOptions from './PredictionSimpleOptions';
|
|
20
|
+
const styles = {
|
|
21
|
+
flexColumnContainer: {
|
|
22
|
+
display: 'flex',
|
|
23
|
+
flexDirection: 'column',
|
|
24
|
+
flex: 1,
|
|
25
|
+
},
|
|
26
|
+
slider: {
|
|
27
|
+
overflow: 'hidden auto',
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
export default function PredictionPanel() {
|
|
31
|
+
const { molecules, view: { molecules: moleculesView, predictions }, } = useChartData();
|
|
16
32
|
const dispatch = useDispatch();
|
|
17
33
|
const alert = useAlert();
|
|
18
|
-
const
|
|
34
|
+
const [currentIndex, setCurrentIndex] = useState(0);
|
|
35
|
+
const [molfile, setMolfile] = useState(null);
|
|
36
|
+
const [isFlipped, setFlipStatus] = useState(false);
|
|
37
|
+
const settingRef = useRef();
|
|
38
|
+
const { item: spectraPanelState, utils: { toggle: openSpectraPanel }, } = useAccordionContext('Spectra');
|
|
39
|
+
const predictionPreferences = usePanelPreferences('prediction');
|
|
40
|
+
const openMoleculeEditor = useMoleculeEditor(true);
|
|
41
|
+
const refreshSlider = useRef(false);
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
if (Array.isArray(molecules) &&
|
|
44
|
+
molecules.length > 0 &&
|
|
45
|
+
refreshSlider.current) {
|
|
46
|
+
const newIndex = molecules.length - 1;
|
|
47
|
+
setCurrentIndex(newIndex);
|
|
48
|
+
setMolfile(molecules[newIndex].molfile);
|
|
49
|
+
refreshSlider.current = false;
|
|
50
|
+
}
|
|
51
|
+
}, [molecules]);
|
|
52
|
+
function changeHandler(molfile, molecule) {
|
|
53
|
+
const atoms = molecule.getAllAtoms();
|
|
54
|
+
if (atoms === 0) {
|
|
55
|
+
setMolfile(null);
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
setMolfile(molfile);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
function predictHandler(action) {
|
|
62
|
+
refreshSlider.current = action === 'add';
|
|
19
63
|
void (async () => {
|
|
20
|
-
if (
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
64
|
+
if (molfile) {
|
|
65
|
+
const predictedSpectra = [];
|
|
66
|
+
for (const [key, value] of Object.entries(predictionPreferences.spectra)) {
|
|
67
|
+
if (value) {
|
|
68
|
+
predictedSpectra.push(key);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
const hideLoading = await alert.showLoading(`Predict ${predictedSpectra.join(',')} in progress`);
|
|
72
|
+
try {
|
|
73
|
+
const data = await predictSpectra(molfile);
|
|
74
|
+
dispatch({
|
|
75
|
+
type: 'PREDICT_SPECTRA',
|
|
76
|
+
payload: {
|
|
77
|
+
predictedSpectra: data.spectra,
|
|
78
|
+
options: predictionPreferences,
|
|
79
|
+
molecule: { ...molecules[currentIndex], molfile },
|
|
80
|
+
action,
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
if (!spectraPanelState?.isOpen) {
|
|
84
|
+
openSpectraPanel();
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
catch (error) {
|
|
88
|
+
alert.error(error.message);
|
|
89
|
+
}
|
|
90
|
+
finally {
|
|
91
|
+
hideLoading();
|
|
32
92
|
}
|
|
33
|
-
hideLoading();
|
|
34
93
|
}
|
|
35
94
|
else {
|
|
36
95
|
alert.error('No Molecule selected');
|
|
37
96
|
}
|
|
38
97
|
})();
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
98
|
+
}
|
|
99
|
+
function settingsPanelHandler() {
|
|
100
|
+
setFlipStatus(!isFlipped);
|
|
101
|
+
}
|
|
102
|
+
function saveSettingHandler() {
|
|
103
|
+
settingRef.current.saveSetting();
|
|
104
|
+
setFlipStatus(false);
|
|
105
|
+
}
|
|
106
|
+
const isPredictedBefore = !!(molecules[currentIndex]?.id && predictions[molecules[currentIndex].id]);
|
|
107
|
+
return (_jsxs("div", { css: tablePanelStyle, children: [isFlipped && (_jsxs(_Fragment, { children: [_jsx(PreferencesHeader, { onSave: saveSettingHandler, onClose: settingsPanelHandler }), _jsx("div", { className: "inner-container", children: _jsx(PredictionPreferences, { ref: settingRef }) })] })), !isFlipped && (_jsxs(_Fragment, { children: [_jsx(MoleculePanelHeader, { currentIndex: currentIndex, moleculesView: moleculesView, molecules: molecules, renderSource: "predictionPanel", onClickPreferences: settingsPanelHandler, onOpenMoleculeEditor: () => openMoleculeEditor(), children: _jsx(PredictionSimpleOptions, {}) }), _jsxs("div", { style: styles.flexColumnContainer, children: [_jsx("div", { style: { flex: 1 }, children: _jsx(ResponsiveChart, { children: ({ height, width }) => {
|
|
108
|
+
return (_jsx(NextPrev, { onChange: (slideIndex) => {
|
|
109
|
+
setCurrentIndex(slideIndex);
|
|
110
|
+
setMolfile(molecules[slideIndex].molfile);
|
|
111
|
+
}, defaultIndex: currentIndex, style: {
|
|
112
|
+
arrowContainer: {
|
|
113
|
+
top: '40px',
|
|
114
|
+
padding: '0 10px 0 55px',
|
|
115
|
+
},
|
|
116
|
+
}, children: molecules && molecules.length > 0 ? (molecules.map((mol, molIndex) => (_jsxs("div", { style: styles.flexColumnContainer, children: [_jsx(MoleculeHeader, { currentMolecule: mol, molecules: molecules }), _jsx("div", { style: {
|
|
117
|
+
...styles.slider,
|
|
118
|
+
height: height - 31,
|
|
119
|
+
}, children: molIndex === currentIndex && (_jsx(StructureEditor, { width: width, initialMolfile: mol.molfile, svgMenu: true, fragment: false, onChange: changeHandler })) })] }, mol.id)))) : (_jsx(StructureEditor, { width: width, height: height, svgMenu: true, fragment: false, onChange: changeHandler })) }));
|
|
120
|
+
} }) }), _jsxs("div", { style: { display: 'flex', padding: '5px' }, children: [_jsx(Button.Done, { onClick: () => predictHandler('save'), disabled: !molfile, children: isPredictedBefore ? 'Replace prediction' : 'Predict spectra' }), isPredictedBefore && (_jsx(Button.Action, { style: { marginLeft: '5px' }, onClick: () => predictHandler('add'), children: "Add prediction" }))] })] })] }))] }));
|
|
51
121
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useImperativeHandle, useRef, forwardRef } from 'react';
|
|
3
|
+
import { usePreferences } from '../../context/PreferencesContext';
|
|
4
|
+
import { usePanelPreferences } from '../../hooks/usePanelPreferences';
|
|
5
|
+
import { PreferencesContainer } from '../extra/preferences/PreferencesContainer';
|
|
6
|
+
import PredictionOptionsPanel from './PredictionOptionsPanel';
|
|
7
|
+
function PredictionPreferences(props, ref) {
|
|
8
|
+
const formRef = useRef(null);
|
|
9
|
+
const preferences = usePreferences();
|
|
10
|
+
const predictionPreferences = usePanelPreferences('prediction');
|
|
11
|
+
const saveHandler = useCallback((values) => {
|
|
12
|
+
preferences.dispatch({
|
|
13
|
+
type: 'SET_PANELS_PREFERENCES',
|
|
14
|
+
payload: { key: 'prediction', value: values },
|
|
15
|
+
});
|
|
16
|
+
}, [preferences]);
|
|
17
|
+
useImperativeHandle(ref, () => ({
|
|
18
|
+
saveSetting: () => {
|
|
19
|
+
formRef.current.submitForm();
|
|
20
|
+
},
|
|
21
|
+
}), []);
|
|
22
|
+
return (_jsx(PreferencesContainer, { style: { backgroundColor: 'white' }, children: _jsx(PredictionOptionsPanel, { onSubmit: saveHandler, options: predictionPreferences, ref: formRef, hideName: true }) }));
|
|
23
|
+
}
|
|
24
|
+
export default forwardRef(PredictionPreferences);
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Formik } from 'formik';
|
|
3
|
+
import lodashMerge from 'lodash/merge';
|
|
4
|
+
import { useCallback } from 'react';
|
|
5
|
+
import * as Yup from 'yup';
|
|
6
|
+
import { defaultPredictionOptions, FREQUENCIES, } from '../../../data/PredictionManager';
|
|
7
|
+
import { usePreferences } from '../../context/PreferencesContext';
|
|
8
|
+
import Label from '../../elements/Label';
|
|
9
|
+
import FormikNumberInput from '../../elements/formik/FormikNumberInput';
|
|
10
|
+
import FormikOnChange from '../../elements/formik/FormikOnChange';
|
|
11
|
+
import FormikSelect from '../../elements/formik/FormikSelect';
|
|
12
|
+
import { usePanelPreferences } from '../../hooks/usePanelPreferences';
|
|
13
|
+
const predictionFormValidation = Yup.object().shape({
|
|
14
|
+
'1d': Yup.object({
|
|
15
|
+
lineWidth: Yup.number().integer().min(1).required(),
|
|
16
|
+
}),
|
|
17
|
+
});
|
|
18
|
+
const labelStyle = {
|
|
19
|
+
label: { fontSize: '10px' },
|
|
20
|
+
wrapper: { display: 'flex', alignItems: 'center', height: '100%' },
|
|
21
|
+
container: { padding: '0 5px', height: '100%' },
|
|
22
|
+
};
|
|
23
|
+
const selectStyles = { width: '100%', minWidth: '75px', fontSize: '10px' };
|
|
24
|
+
function PredictionSimpleOptions() {
|
|
25
|
+
const { dispatch } = usePreferences();
|
|
26
|
+
const predictionPreferences = usePanelPreferences('prediction');
|
|
27
|
+
const optionsChangeHandler = useCallback((values) => {
|
|
28
|
+
const value = lodashMerge({}, defaultPredictionOptions, values);
|
|
29
|
+
dispatch({
|
|
30
|
+
type: 'SET_PANELS_PREFERENCES',
|
|
31
|
+
payload: { key: 'prediction', value },
|
|
32
|
+
});
|
|
33
|
+
}, [dispatch]);
|
|
34
|
+
return (_jsx(Formik, { initialValues: predictionPreferences, validationSchema: predictionFormValidation, enableReinitialize: true,
|
|
35
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
36
|
+
onSubmit: () => { }, children: _jsxs("div", { style: {
|
|
37
|
+
display: 'flex',
|
|
38
|
+
justifyContent: 'flex-end',
|
|
39
|
+
flex: '1',
|
|
40
|
+
padding: '0 10px',
|
|
41
|
+
height: '100%',
|
|
42
|
+
}, children: [_jsx(Label, { title: "Frequency", style: labelStyle, children: _jsx(FormikSelect, { items: FREQUENCIES, style: selectStyles, name: "frequency" }) }), _jsxs(Label, { title: "Line Width", style: labelStyle, children: [_jsx(FormikNumberInput, { name: "1d.lineWidth", type: "number", style: { margin: 0, width: '40px' } }), _jsx("span", { style: { padding: '0 5px' }, children: "Hz" })] }), _jsx(FormikOnChange, { enableValidation: true, onChange: optionsChangeHandler })] }) }));
|
|
43
|
+
}
|
|
44
|
+
export default PredictionSimpleOptions;
|
|
@@ -1,14 +1,11 @@
|
|
|
1
|
+
import { WebSource as Source } from 'filelist-utils';
|
|
1
2
|
import { CorrelationData } from 'nmr-correlation';
|
|
2
|
-
import {
|
|
3
|
+
import { Spectrum, ViewState } from 'nmr-load-save';
|
|
4
|
+
import { ApodizationOptions, BaselineCorrectionZone } from 'nmr-processing';
|
|
3
5
|
import { Reducer } from 'react';
|
|
4
|
-
import {
|
|
5
|
-
import { BaselineCorrectionZone } from '../../data/data1d/filter1d/baselineCorrection';
|
|
6
|
-
import { ContoursLevels } from '../../data/data2d/Spectrum2D/contours';
|
|
7
|
-
import { MoleculesView, StateMoleculeExtended } from '../../data/molecules/Molecule';
|
|
8
|
-
import { Nuclei } from '../../data/types/common/Nucleus';
|
|
9
|
-
import { PeaksViewState } from '../../data/types/view-state/PeaksViewState';
|
|
6
|
+
import { StateMoleculeExtended } from '../../data/molecules/Molecule';
|
|
10
7
|
import { UsedColors } from '../../types/UsedColors';
|
|
11
|
-
import { Action
|
|
8
|
+
import { Action } from '../context/DispatchContext';
|
|
12
9
|
import { Tool } from '../toolbar/ToolTypes';
|
|
13
10
|
import { DISPLAYER_MODE } from './core/Constants';
|
|
14
11
|
import { ZoomHistory } from './helper/ZoomHistoryManager';
|
|
@@ -16,83 +13,6 @@ export interface ActiveSpectrum {
|
|
|
16
13
|
id: string;
|
|
17
14
|
index: number;
|
|
18
15
|
}
|
|
19
|
-
interface ToolStateBase {
|
|
20
|
-
spectrumID: string;
|
|
21
|
-
}
|
|
22
|
-
interface RangeToolState extends ToolStateBase {
|
|
23
|
-
/**
|
|
24
|
-
* boolean indicator to hide/show multiplicity tree
|
|
25
|
-
* @default false
|
|
26
|
-
*/
|
|
27
|
-
showMultiplicityTrees: boolean;
|
|
28
|
-
/**
|
|
29
|
-
* boolean indicator to hide/show J graph for spectrum signals
|
|
30
|
-
* @default false
|
|
31
|
-
*/
|
|
32
|
-
showJGraph: boolean;
|
|
33
|
-
/**
|
|
34
|
-
* boolean indicator to hide/show integrals for the spectrum ranges
|
|
35
|
-
* @default true
|
|
36
|
-
*/
|
|
37
|
-
showRangesIntegrals: boolean;
|
|
38
|
-
}
|
|
39
|
-
interface ZoneToolState extends ToolStateBase {
|
|
40
|
-
/**
|
|
41
|
-
* boolean indicator to hide/show zones
|
|
42
|
-
* @default false
|
|
43
|
-
*/
|
|
44
|
-
showZones: boolean;
|
|
45
|
-
/**
|
|
46
|
-
* boolean indicator to hide/show signals for spectrum zones
|
|
47
|
-
* @default false
|
|
48
|
-
*/
|
|
49
|
-
showSignals: boolean;
|
|
50
|
-
/**
|
|
51
|
-
* boolean indicator to hide/show peaks for spectrum zones
|
|
52
|
-
* @default true
|
|
53
|
-
*/
|
|
54
|
-
showPeaks: boolean;
|
|
55
|
-
}
|
|
56
|
-
export interface ViewState {
|
|
57
|
-
/**
|
|
58
|
-
* Molecules view properties
|
|
59
|
-
* @default []
|
|
60
|
-
*/
|
|
61
|
-
molecules: MoleculesView;
|
|
62
|
-
ranges: Array<RangeToolState>;
|
|
63
|
-
zones: Array<ZoneToolState>;
|
|
64
|
-
/**
|
|
65
|
-
* peaks view property
|
|
66
|
-
* where the key is the id of the spectrum
|
|
67
|
-
*/
|
|
68
|
-
peaks: Record<string, PeaksViewState>;
|
|
69
|
-
spectra: {
|
|
70
|
-
/**
|
|
71
|
-
* active spectrum id per nucleus
|
|
72
|
-
* @default {}
|
|
73
|
-
*/
|
|
74
|
-
activeSpectra: Record<string, ActiveSpectrum[] | null>;
|
|
75
|
-
selectReferences: Record<string, string>;
|
|
76
|
-
/**
|
|
77
|
-
* current select tab (nucleus)
|
|
78
|
-
* @default null
|
|
79
|
-
*/
|
|
80
|
-
activeTab: string;
|
|
81
|
-
/**
|
|
82
|
-
* show the spectra legend and the intensity
|
|
83
|
-
* @default false
|
|
84
|
-
*/
|
|
85
|
-
showLegend: boolean;
|
|
86
|
-
};
|
|
87
|
-
zoom: {
|
|
88
|
-
levels: ContoursLevels;
|
|
89
|
-
};
|
|
90
|
-
/**
|
|
91
|
-
* options to control spectra vertical alignment
|
|
92
|
-
* @default 'bottom'
|
|
93
|
-
*/
|
|
94
|
-
verticalAlign: Partial<Record<Nuclei, VerticalAlignment>>;
|
|
95
|
-
}
|
|
96
16
|
export declare const rangeStateInit: {
|
|
97
17
|
showMultiplicityTrees: boolean;
|
|
98
18
|
showRangesIntegrals: boolean;
|
|
@@ -303,6 +223,4 @@ export interface State {
|
|
|
303
223
|
usedColors: UsedColors;
|
|
304
224
|
}
|
|
305
225
|
export declare function initState(state: State): State;
|
|
306
|
-
export declare function dispatchMiddleware(dispatch: Dispatch): (action: Action) => void;
|
|
307
226
|
export declare const spectrumReducer: Reducer<State, Action>;
|
|
308
|
-
export {};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { v4 } from '@lukeed/uuid';
|
|
2
2
|
import { produce } from 'immer';
|
|
3
3
|
import { buildCorrelationData } from 'nmr-correlation';
|
|
4
|
-
import { predictSpectra } from '../../data/PredictionManager';
|
|
5
4
|
import { DefaultTolerance } from '../panels/SummaryPanel/CorrelationTable/Constants';
|
|
6
5
|
import * as AssignmentsActions from './actions/AssignmentsActions';
|
|
7
6
|
import * as CorrelationsActions from './actions/CorrelationsActions';
|
|
@@ -47,6 +46,7 @@ export function getDefaultViewState() {
|
|
|
47
46
|
levels: {},
|
|
48
47
|
},
|
|
49
48
|
verticalAlign: {},
|
|
49
|
+
predictions: {},
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
52
|
export const getInitialState = () => ({
|
|
@@ -122,34 +122,6 @@ export function initState(state) {
|
|
|
122
122
|
history: {},
|
|
123
123
|
};
|
|
124
124
|
}
|
|
125
|
-
export function dispatchMiddleware(dispatch) {
|
|
126
|
-
return (action) => {
|
|
127
|
-
switch (action.type) {
|
|
128
|
-
case 'INITIATE':
|
|
129
|
-
case 'LOAD_DROP_FILES': {
|
|
130
|
-
dispatch(action);
|
|
131
|
-
break;
|
|
132
|
-
}
|
|
133
|
-
case 'PREDICT_SPECTRA': {
|
|
134
|
-
const { molfile, options } = action.payload;
|
|
135
|
-
void predictSpectra(molfile).then((data) => {
|
|
136
|
-
action.payload = {
|
|
137
|
-
predictedSpectra: data.spectra,
|
|
138
|
-
options,
|
|
139
|
-
molfile,
|
|
140
|
-
};
|
|
141
|
-
dispatch(action);
|
|
142
|
-
}, () => {
|
|
143
|
-
dispatch(action);
|
|
144
|
-
});
|
|
145
|
-
break;
|
|
146
|
-
}
|
|
147
|
-
default:
|
|
148
|
-
dispatch(action);
|
|
149
|
-
break;
|
|
150
|
-
}
|
|
151
|
-
};
|
|
152
|
-
}
|
|
153
125
|
function innerSpectrumReducer(draft, action) {
|
|
154
126
|
if (!['LOAD_DROP_FILES', 'INITIATE'].includes(action.type)) {
|
|
155
127
|
draft.actionType = action.type;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Draft } from 'immer';
|
|
2
|
-
import { ApodizationOptions } from '
|
|
3
|
-
import { BaselineCorrectionOptions } from '../../../data/data1d/filter1d/baselineCorrection';
|
|
2
|
+
import { BaselineCorrectionOptions, ApodizationOptions } from 'nmr-processing';
|
|
4
3
|
import { ExclusionZone } from '../../../data/types/data1d/ExclusionZone';
|
|
5
4
|
import { MatrixOptions } from '../../../data/types/data1d/MatrixOptions';
|
|
6
5
|
import { ActiveSpectrum, State } from '../Reducer';
|