nmrium 0.29.0 → 0.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -2
- package/lib/component/1d/ApodizationLine.d.ts +3 -0
- package/lib/component/1d/ApodizationLine.js +49 -0
- package/lib/component/1d/Chart1D.js +4 -2
- package/lib/component/1d/ExclusionZoneAnnotation.d.ts +1 -1
- package/lib/component/1d/ExclusionZoneAnnotation.js +14 -7
- package/lib/component/1d/FooterBanner.js +3 -1
- package/lib/component/1d/IntegralResizable.js +5 -4
- package/lib/component/1d/IntegralsSeries.js +3 -1
- package/lib/component/1d/LinesSeries.js +7 -5
- package/lib/component/1d/SpectraTracker.js +1 -1
- package/lib/component/1d/Viewer1D.js +10 -13
- package/lib/component/1d/database/DatabaseElements.js +2 -2
- package/lib/component/1d/database/DatabaseSpectrum.js +3 -3
- package/lib/component/1d/database/ResurrectedDatabaseRanges.js +3 -3
- package/lib/component/1d/jCouplingGraph/JGraph.js +5 -1
- package/lib/component/1d/multiAnalysis/AnalysisRange.js +16 -14
- package/lib/component/1d/multiAnalysis/MultiAnalysisRanges.js +1 -1
- package/lib/component/1d/multiplicityTree/MultiplicityTree.js +6 -5
- package/lib/component/1d/{PeakAnnotation.d.ts → peaks/PeakAnnotation.d.ts} +1 -2
- package/lib/component/1d/{PeakAnnotation.js → peaks/PeakAnnotation.js} +8 -9
- package/lib/component/1d/{PeakAnnotations.d.ts → peaks/PeakAnnotations.d.ts} +0 -0
- package/lib/component/1d/peaks/PeakAnnotations.js +28 -0
- package/lib/component/1d/peaks/PeaksShapes.d.ts +3 -0
- package/lib/component/1d/peaks/PeaksShapes.js +37 -0
- package/lib/component/1d/peaks/usePeakShapesPath.d.ts +13 -0
- package/lib/component/1d/peaks/usePeakShapesPath.js +49 -0
- package/lib/component/1d/ranges/Range.js +4 -4
- package/lib/component/1d/ranges/Ranges.js +8 -2
- package/lib/component/1d/tool/PeakPointer.js +3 -1
- package/lib/component/1d/tool/XLabelPointer.js +3 -1
- package/lib/component/2d/Contours.js +3 -1
- package/lib/component/2d/FooterBanner.js +5 -3
- package/lib/component/2d/Viewer2D.js +6 -6
- package/lib/component/2d/XAxis.js +2 -2
- package/lib/component/2d/YAxis.js +2 -2
- package/lib/component/2d/tools/XYLabelPointer.js +3 -1
- package/lib/component/2d/tools/slicing/SlicingView.js +3 -1
- package/lib/component/2d/zones/IndicationLines.js +1 -1
- package/lib/component/2d/zones/Signal.d.ts +3 -2
- package/lib/component/2d/zones/Signal.js +3 -3
- package/lib/component/2d/zones/Zone.d.ts +1 -1
- package/lib/component/2d/zones/Zone.js +4 -4
- package/lib/component/2d/zones/Zones.js +14 -19
- package/lib/component/EventsTrackers/KeysListenerTracker.js +91 -52
- package/lib/component/NMRium.d.ts +2 -0
- package/lib/component/NMRium.js +14 -3
- package/lib/component/assignment/AssignmentsContext.d.ts +1 -1
- package/lib/component/context/GlobalContext.d.ts +1 -1
- package/lib/component/context/GlobalContext.js +3 -3
- package/lib/component/elements/ActiveButton.d.ts +17 -0
- package/lib/component/elements/ActiveButton.js +28 -0
- package/lib/component/elements/Button.d.ts +6 -6
- package/lib/component/elements/Button.js +5 -5
- package/lib/component/elements/ButtonToolTip.js +1 -1
- package/lib/component/elements/CheckBox.d.ts +2 -6
- package/lib/component/elements/CheckBox.js +4 -6
- package/lib/component/elements/Input.d.ts +5 -4
- package/lib/component/elements/Input.js +1 -1
- package/lib/component/elements/Label.d.ts +8 -6
- package/lib/component/elements/Label.js +3 -3
- package/lib/component/elements/MoleculeSelection.d.ts +2 -2
- package/lib/component/elements/MoleculeSelection.js +1 -1
- package/lib/component/elements/NextPrev.js +1 -1
- package/lib/component/elements/ReactTable/Elements/ReactTableRow.d.ts +2 -2
- package/lib/component/elements/ReactTable/Elements/ReactTableRow.js +2 -2
- package/lib/component/elements/ReactTable/ReactTable.d.ts +2 -2
- package/lib/component/elements/Select.d.ts +7 -11
- package/lib/component/elements/Select.js +6 -8
- package/lib/component/elements/Tab/Tab.js +1 -1
- package/lib/component/elements/Table/Table.d.ts +1 -2
- package/lib/component/elements/Table/Table.js +2 -2
- package/lib/component/elements/ToggleButton.d.ts +1 -2
- package/lib/component/elements/ToggleButton.js +3 -2
- package/lib/component/elements/accordion/AccordionItem.js +2 -2
- package/lib/component/elements/formik/FormikNumberInput.d.ts +1 -1
- package/lib/component/elements/formik/FormikOnChange.d.ts +3 -2
- package/lib/component/elements/formik/FormikOnChange.js +11 -5
- package/lib/component/elements/popup/Modal/ConfirmDialog.js +1 -1
- package/lib/component/elements/popup/Modal/Provider.d.ts +3 -3
- package/lib/component/elements/popup/Modal/Provider.js +8 -11
- package/lib/component/elements/resizer/DivResizer.js +3 -3
- package/lib/component/elements/resizer/Resizer.d.ts +1 -0
- package/lib/component/elements/resizer/SVGResizer.js +3 -3
- package/lib/component/header/ApodizationOptionsPanel.d.ts +2 -0
- package/lib/component/header/ApodizationOptionsPanel.js +81 -0
- package/lib/component/header/AutoPeakPickingOptionPanel.d.ts +2 -1
- package/lib/component/header/AutoPeakPickingOptionPanel.js +40 -36
- package/lib/component/header/BaseLineCorrectionPanel.d.ts +1 -2
- package/lib/component/header/BaseLineCorrectionPanel.js +84 -52
- package/lib/component/header/Header.js +5 -2
- package/lib/component/header/HeaderContainer.d.ts +7 -0
- package/lib/component/header/HeaderContainer.js +10 -0
- package/lib/component/header/ManualPhaseCorrectionPanel.js +27 -29
- package/lib/component/header/RangesPickingOptionPanel.js +19 -21
- package/lib/component/header/ZeroFillingOptionsPanel.js +52 -47
- package/lib/component/header/Zones2DOptionPanel.js +11 -13
- package/lib/component/highlight/index.d.ts +27 -10
- package/lib/component/highlight/index.js +19 -17
- package/lib/component/hooks/useActiveSpectrumStyleOptions.js +2 -2
- package/lib/component/hooks/useCheckToolsVisibility.d.ts +10 -1
- package/lib/component/hooks/useCheckToolsVisibility.js +31 -1
- package/lib/component/hooks/useDatumWithSpectraStatistics.js +3 -1
- package/lib/component/hooks/useExport.d.ts +0 -1
- package/lib/component/hooks/useExport.js +1 -17
- package/lib/component/hooks/useFilter.d.ts +1 -0
- package/lib/component/hooks/useFilter.js +7 -0
- package/lib/component/hooks/useIntegralPath.js +5 -2
- package/lib/component/hooks/useNucleus.js +4 -4
- package/lib/component/hooks/useSpectraPerNucleus.js +1 -1
- package/lib/component/hooks/useSpectrum.js +3 -1
- package/lib/component/hooks/useToolsFunctions.js +1 -1
- package/lib/component/loader/DropZone.js +8 -148
- package/lib/component/modal/AlignSpectraModal.js +1 -2
- package/lib/component/modal/EditPeakShapeModal.d.ts +9 -0
- package/lib/component/modal/EditPeakShapeModal.js +85 -0
- package/lib/component/modal/MoleculeStructureEditorModal.d.ts +3 -3
- package/lib/component/modal/MoleculeStructureEditorModal.js +2 -3
- package/lib/component/modal/MultipleSpectraFiltersModal/index.js +1 -2
- package/lib/component/modal/PredictSpectraModal.js +1 -1
- package/lib/component/modal/changeSum/ChangeSumModal.d.ts +1 -1
- package/lib/component/modal/changeSum/ChangeSumModal.js +9 -11
- package/lib/component/modal/changeSum/SelectMolecule.js +2 -2
- package/lib/component/modal/editRange/EditRangeModal.js +3 -3
- package/lib/component/modal/editRange/forms/components/CouplingsTable.js +4 -9
- package/lib/component/modal/setting/DatabasesTabContent.js +2 -2
- package/lib/component/modal/setting/DisplayTabContent.js +1 -1
- package/lib/component/modal/setting/FormattingTabContent.js +2 -2
- package/lib/component/modal/setting/GeneralSettings.js +1 -1
- package/lib/component/modal/setting/ToolsTabContent.js +17 -13
- package/lib/component/modal/setting/WorkspaceItem.d.ts +2 -2
- package/lib/component/modal/setting/WorkspaceItem.js +2 -2
- package/lib/component/panels/IntegralsPanel/IntegralPanel.js +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralTable.js +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculeHeader.d.ts +3 -3
- package/lib/component/panels/MoleculesPanel/MoleculeHeader.js +3 -3
- package/lib/component/panels/MoleculesPanel/MoleculePanel.d.ts +5 -4
- package/lib/component/panels/MoleculesPanel/MoleculePanel.js +13 -10
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.d.ts +4 -2
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +6 -6
- package/lib/component/panels/MoleculesPanel/Utilities.d.ts +1 -2
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.d.ts +5 -3
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +12 -4
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +1 -1
- package/lib/component/panels/Panels.js +3 -3
- package/lib/component/panels/PeaksPanel/PeaksPanel.js +47 -22
- package/lib/component/panels/PeaksPanel/PeaksPreferences.js +17 -0
- package/lib/component/panels/PeaksPanel/PeaksTable.js +44 -13
- package/lib/component/panels/RangesPanel/RangesHeader.d.ts +2 -1
- package/lib/component/panels/RangesPanel/RangesHeader.js +10 -9
- package/lib/component/panels/RangesPanel/RangesPanel.js +7 -3
- package/lib/component/panels/RangesPanel/RangesTableRow.js +4 -4
- package/lib/component/panels/RangesPanel/TableColumns/ActionsColumn.js +1 -1
- package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +3 -2
- package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.d.ts +3 -3
- package/lib/component/panels/RangesPanel/hooks/useMapRanges.js +3 -3
- package/lib/component/panels/SpectrumsPanel/SpectraPanelHeader.js +3 -1
- package/lib/component/panels/SpectrumsPanel/SpectrumListItem.js +1 -1
- package/lib/component/panels/SpectrumsPanel/SpectrumsTabs.js +3 -1
- package/lib/component/panels/SpectrumsPanel/base/ColorIndicator.js +2 -2
- package/lib/component/panels/SpectrumsPanel/base/ShowHideMarkersButton.d.ts +1 -1
- package/lib/component/panels/SpectrumsPanel/base/ShowHideMarkersButton.js +4 -1
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +4 -4
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +1 -2
- package/lib/component/panels/SummaryPanel/SummaryPanel.js +2 -3
- package/lib/component/panels/SummaryPanel/utilities/useInView.js +3 -1
- package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +1 -1
- package/lib/component/panels/ZonesPanel/ZonesPanel.js +19 -10
- package/lib/component/panels/databasePanel/DatabasePanel.js +5 -13
- package/lib/component/panels/databasePanel/DatabaseTable.js +3 -3
- package/lib/component/panels/filtersPanel/FilterPanel.js +1 -1
- package/lib/component/panels/filtersPanel/FiltersTable.js +2 -2
- package/lib/component/panels/header/DefaultPanelHeader.js +3 -12
- package/lib/component/panels/header/SpectraAutomaticPickingButton.js +1 -1
- package/lib/component/panels/predictionPanel/PredictionOptions.d.ts +2 -1
- package/lib/component/panels/predictionPanel/PredictionOptions.js +2 -2
- package/lib/component/panels/predictionPanel/PredictionPanel.js +15 -3
- package/lib/component/reducer/IgnoreActions.js +5 -0
- package/lib/component/reducer/Reducer.d.ts +141 -51
- package/lib/component/reducer/Reducer.js +69 -45
- package/lib/component/reducer/actions/DomainActions.d.ts +1 -1
- package/lib/component/reducer/actions/DomainActions.js +11 -9
- package/lib/component/reducer/actions/FiltersActions.d.ts +13 -7
- package/lib/component/reducer/actions/FiltersActions.js +326 -204
- package/lib/component/reducer/actions/IntegralsActions.js +15 -10
- package/lib/component/reducer/actions/LoadActions.d.ts +2 -5
- package/lib/component/reducer/actions/LoadActions.js +19 -34
- package/lib/component/reducer/actions/MoleculeActions.d.ts +2 -1
- package/lib/component/reducer/actions/MoleculeActions.js +48 -19
- package/lib/component/reducer/actions/PeaksActions.d.ts +4 -1
- package/lib/component/reducer/actions/PeaksActions.js +52 -13
- package/lib/component/reducer/actions/PreferencesActions.js +8 -10
- package/lib/component/reducer/actions/RangesActions.d.ts +3 -3
- package/lib/component/reducer/actions/RangesActions.js +87 -29
- package/lib/component/reducer/actions/SpectraAnalysisAction.js +5 -5
- package/lib/component/reducer/actions/SpectrumsActions.js +14 -11
- package/lib/component/reducer/actions/ToolsActions.js +47 -95
- package/lib/component/reducer/actions/ZonesActions.d.ts +4 -1
- package/lib/component/reducer/actions/ZonesActions.js +68 -17
- package/lib/component/reducer/helper/Zoom1DManager.js +2 -1
- package/lib/component/reducer/helper/getActiveSpectrumOrFail.d.ts +3 -0
- package/lib/component/reducer/helper/getActiveSpectrumOrFail.js +6 -0
- package/lib/component/reducer/helper/getSpectrum.js +3 -2
- package/lib/component/reducer/helper/getStrongestPeak.d.ts +7 -0
- package/lib/component/reducer/helper/getStrongestPeak.js +15 -0
- package/lib/component/reducer/preferences/actions/addWorkspace.js +2 -2
- package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js +3 -0
- package/lib/component/reducer/preferences/preferencesReducer.d.ts +23 -15
- package/lib/component/reducer/preferences/preferencesReducer.js +1 -1
- package/lib/component/reducer/types/Types.d.ts +12 -0
- package/lib/component/reducer/types/Types.js +12 -0
- package/lib/component/tool/BrushX.js +1 -1
- package/lib/component/tool/BrushXY.js +4 -3
- package/lib/component/tool/CrossLinePointer.js +5 -4
- package/lib/component/tool/FloatMoleculeStructures/DraggableStructure.d.ts +8 -2
- package/lib/component/tool/FloatMoleculeStructures/DraggableStructure.js +22 -7
- package/lib/component/tool/FloatMoleculeStructures/index.d.ts +3 -2
- package/lib/component/tool/FloatMoleculeStructures/index.js +19 -6
- package/lib/component/toolbar/BasicToolBar.js +7 -14
- package/lib/component/toolbar/FunctionToolBar.js +13 -23
- package/lib/component/toolbar/ToolTypes.d.ts +7 -1
- package/lib/component/toolbar/ToolTypes.js +119 -9
- package/lib/component/utility/assert.d.ts +1 -0
- package/lib/component/utility/assert.js +5 -0
- package/lib/component/workspaces/Workspace.d.ts +4 -1
- package/lib/component/workspaces/basic.js +12 -11
- package/lib/component/workspaces/embedded.js +14 -13
- package/lib/component/workspaces/exercise.js +10 -6
- package/lib/component/workspaces/prediction.js +14 -13
- package/lib/component/workspaces/process1D.js +20 -19
- package/lib/component/workspaces/workspaceDefaultProperties.js +14 -15
- package/lib/constants.js +1 -1
- package/lib/data/Filters.d.ts +2 -2
- package/lib/data/Filters.js +2 -2
- package/lib/data/FiltersManager.js +3 -3
- package/lib/data/PredictionManager.d.ts +0 -1
- package/lib/data/PredictionManager.js +15 -15
- package/lib/data/SpectraManager.d.ts +2 -5
- package/lib/data/SpectraManager.js +4 -95
- package/lib/data/constants/SignalsKinds.d.ts +0 -1
- package/lib/data/constants/SignalsKinds.js +0 -8
- package/lib/data/data1d/Data1DManager.js +5 -5
- package/lib/data/data1d/Spectrum1D/SumManager.d.ts +5 -5
- package/lib/data/data1d/Spectrum1D/SumManager.js +18 -12
- package/lib/data/data1d/Spectrum1D/generateJGraphData.js +2 -2
- package/lib/data/data1d/Spectrum1D/index.d.ts +2 -1
- package/lib/data/data1d/Spectrum1D/index.js +2 -1
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +3 -3
- package/lib/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.js +1 -1
- package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +5 -2
- package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.js +15 -16
- package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.d.ts +8 -0
- package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.js +24 -0
- package/lib/data/data1d/Spectrum1D/ranges/addRange.js +3 -3
- package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.js +2 -0
- package/lib/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.js +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectRange.js +2 -2
- package/lib/data/data1d/Spectrum1D/ranges/mapRanges.js +3 -3
- package/lib/data/data1d/database.js +4 -6
- package/lib/data/data1d/filter1d/apodization.d.ts +25 -0
- package/lib/data/data1d/filter1d/apodization.js +63 -0
- package/lib/data/data1d/filter1d/baselineCorrection.d.ts +24 -7
- package/lib/data/data1d/filter1d/baselineCorrection.js +10 -17
- package/lib/data/data1d/filter1d/fft.js +11 -0
- package/lib/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.d.ts +2 -0
- package/lib/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +35 -0
- package/lib/data/data1d/filter1d/zeroFillingAndApodization.d.ts +9 -0
- package/lib/data/data1d/filter1d/zeroFillingAndApodization.js +24 -0
- package/lib/data/data2d/Processing2D.d.ts +3 -3
- package/lib/data/data2d/Processing2D.js +3 -2
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +3 -3
- package/lib/data/data2d/Spectrum2D/zones/detectZones.js +3 -3
- package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.js +3 -3
- package/lib/data/data2d/Spectrum2D/zones/getDetectionZones.d.ts +1 -1
- package/lib/data/molecules/Molecule.d.ts +20 -6
- package/lib/data/molecules/Molecule.js +5 -8
- package/lib/data/molecules/MoleculeManager.d.ts +4 -4
- package/lib/data/molecules/MoleculeManager.js +5 -5
- package/lib/data/types/data1d/SumOptions.d.ts +1 -1
- package/lib/data/utilities/generateNumbersPowerOfX.d.ts +0 -1
- package/lib/data/utilities/generateNumbersPowerOfX.js +0 -1
- package/lib/data/utilities/isInRange.d.ts +7 -0
- package/lib/data/utilities/isInRange.js +4 -0
- package/lib/types/NMRiumDataReturn.d.ts +2 -2
- package/lib/types/NMRiumGeneralPreferences.d.ts +0 -2
- package/lib/types/NMRiumToolBarPreferences.d.ts +14 -13
- package/lib/versionInfo.js +1 -1
- package/lib-cjs/component/1d/ApodizationLine.js +77 -0
- package/lib-cjs/component/1d/Chart1D.js +4 -2
- package/lib-cjs/component/1d/ExclusionZoneAnnotation.js +15 -8
- package/lib-cjs/component/1d/FooterBanner.js +3 -1
- package/lib-cjs/component/1d/IntegralResizable.js +4 -3
- package/lib-cjs/component/1d/IntegralsSeries.js +3 -1
- package/lib-cjs/component/1d/LinesSeries.js +6 -4
- package/lib-cjs/component/1d/SpectraTracker.js +1 -1
- package/lib-cjs/component/1d/Viewer1D.js +10 -13
- package/lib-cjs/component/1d/database/DatabaseElements.js +1 -1
- package/lib-cjs/component/1d/database/DatabaseSpectrum.js +2 -2
- package/lib-cjs/component/1d/database/ResurrectedDatabaseRanges.js +2 -2
- package/lib-cjs/component/1d/jCouplingGraph/JGraph.js +5 -1
- package/lib-cjs/component/1d/multiAnalysis/AnalysisRange.js +15 -13
- package/lib-cjs/component/1d/multiAnalysis/MultiAnalysisRanges.js +1 -1
- package/lib-cjs/component/1d/multiplicityTree/MultiplicityTree.js +4 -3
- package/lib-cjs/component/1d/{PeakAnnotation.js → peaks/PeakAnnotation.js} +8 -9
- package/lib-cjs/component/1d/peaks/PeakAnnotations.js +33 -0
- package/lib-cjs/component/1d/peaks/PeaksShapes.js +42 -0
- package/lib-cjs/component/1d/peaks/usePeakShapesPath.js +53 -0
- package/lib-cjs/component/1d/ranges/Range.js +3 -3
- package/lib-cjs/component/1d/ranges/Ranges.js +7 -1
- package/lib-cjs/component/1d/tool/PeakPointer.js +3 -1
- package/lib-cjs/component/1d/tool/XLabelPointer.js +3 -1
- package/lib-cjs/component/2d/Contours.js +3 -1
- package/lib-cjs/component/2d/FooterBanner.js +5 -3
- package/lib-cjs/component/2d/Viewer2D.js +6 -6
- package/lib-cjs/component/2d/XAxis.js +2 -2
- package/lib-cjs/component/2d/YAxis.js +2 -2
- package/lib-cjs/component/2d/tools/XYLabelPointer.js +3 -1
- package/lib-cjs/component/2d/tools/slicing/SlicingView.js +3 -1
- package/lib-cjs/component/2d/zones/IndicationLines.js +1 -1
- package/lib-cjs/component/2d/zones/Signal.js +3 -3
- package/lib-cjs/component/2d/zones/Zone.js +3 -3
- package/lib-cjs/component/2d/zones/Zones.js +13 -18
- package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +89 -50
- package/lib-cjs/component/NMRium.js +14 -3
- package/lib-cjs/component/context/GlobalContext.js +4 -4
- package/lib-cjs/component/elements/ActiveButton.js +33 -0
- package/lib-cjs/component/elements/Button.js +5 -5
- package/lib-cjs/component/elements/ButtonToolTip.js +1 -1
- package/lib-cjs/component/elements/CheckBox.js +3 -5
- package/lib-cjs/component/elements/Input.js +1 -1
- package/lib-cjs/component/elements/Label.js +3 -3
- package/lib-cjs/component/elements/MoleculeSelection.js +1 -1
- package/lib-cjs/component/elements/NextPrev.js +1 -1
- package/lib-cjs/component/elements/ReactTable/Elements/ReactTableRow.js +1 -1
- package/lib-cjs/component/elements/Select.js +6 -8
- package/lib-cjs/component/elements/Tab/Tab.js +1 -1
- package/lib-cjs/component/elements/Table/Table.js +2 -2
- package/lib-cjs/component/elements/ToggleButton.js +3 -2
- package/lib-cjs/component/elements/accordion/AccordionItem.js +2 -2
- package/lib-cjs/component/elements/formik/FormikOnChange.js +10 -4
- package/lib-cjs/component/elements/popup/Modal/ConfirmDialog.js +1 -1
- package/lib-cjs/component/elements/popup/Modal/Provider.js +8 -11
- package/lib-cjs/component/elements/resizer/DivResizer.js +3 -3
- package/lib-cjs/component/elements/resizer/SVGResizer.js +2 -2
- package/lib-cjs/component/header/ApodizationOptionsPanel.js +110 -0
- package/lib-cjs/component/header/AutoPeakPickingOptionPanel.js +39 -35
- package/lib-cjs/component/header/BaseLineCorrectionPanel.js +82 -49
- package/lib-cjs/component/header/Header.js +5 -2
- package/lib-cjs/component/header/HeaderContainer.js +14 -0
- package/lib-cjs/component/header/ManualPhaseCorrectionPanel.js +26 -28
- package/lib-cjs/component/header/RangesPickingOptionPanel.js +19 -21
- package/lib-cjs/component/header/ZeroFillingOptionsPanel.js +73 -45
- package/lib-cjs/component/header/Zones2DOptionPanel.js +11 -13
- package/lib-cjs/component/highlight/index.js +20 -18
- package/lib-cjs/component/hooks/useActiveSpectrumStyleOptions.js +2 -2
- package/lib-cjs/component/hooks/useCheckToolsVisibility.js +31 -1
- package/lib-cjs/component/hooks/useDatumWithSpectraStatistics.js +3 -1
- package/lib-cjs/component/hooks/useExport.js +0 -16
- package/lib-cjs/component/hooks/useFilter.js +14 -0
- package/lib-cjs/component/hooks/useIntegralPath.js +5 -2
- package/lib-cjs/component/hooks/useNucleus.js +4 -4
- package/lib-cjs/component/hooks/useSpectraPerNucleus.js +1 -1
- package/lib-cjs/component/hooks/useSpectrum.js +3 -1
- package/lib-cjs/component/hooks/useToolsFunctions.js +1 -1
- package/lib-cjs/component/loader/DropZone.js +7 -150
- package/lib-cjs/component/modal/AlignSpectraModal.js +1 -2
- package/lib-cjs/component/modal/EditPeakShapeModal.js +113 -0
- package/lib-cjs/component/modal/MoleculeStructureEditorModal.js +2 -3
- package/lib-cjs/component/modal/MultipleSpectraFiltersModal/index.js +1 -2
- package/lib-cjs/component/modal/PredictSpectraModal.js +1 -1
- package/lib-cjs/component/modal/changeSum/ChangeSumModal.js +9 -11
- package/lib-cjs/component/modal/changeSum/SelectMolecule.js +2 -2
- package/lib-cjs/component/modal/editRange/EditRangeModal.js +3 -3
- package/lib-cjs/component/modal/editRange/forms/components/CouplingsTable.js +3 -8
- package/lib-cjs/component/modal/setting/DatabasesTabContent.js +2 -2
- package/lib-cjs/component/modal/setting/DisplayTabContent.js +1 -1
- package/lib-cjs/component/modal/setting/FormattingTabContent.js +2 -2
- package/lib-cjs/component/modal/setting/GeneralSettings.js +1 -1
- package/lib-cjs/component/modal/setting/ToolsTabContent.js +17 -13
- package/lib-cjs/component/modal/setting/WorkspaceItem.js +2 -2
- package/lib-cjs/component/panels/IntegralsPanel/IntegralPanel.js +1 -1
- package/lib-cjs/component/panels/IntegralsPanel/IntegralTable.js +1 -1
- package/lib-cjs/component/panels/MoleculesPanel/MoleculeHeader.js +3 -3
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanel.js +12 -9
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +6 -6
- package/lib-cjs/component/panels/MoleculesPanel/useAtomAssignment.js +11 -3
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +1 -1
- package/lib-cjs/component/panels/Panels.js +3 -3
- package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +45 -20
- package/lib-cjs/component/panels/PeaksPanel/PeaksPreferences.js +17 -0
- package/lib-cjs/component/panels/PeaksPanel/PeaksTable.js +42 -11
- package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +10 -9
- package/lib-cjs/component/panels/RangesPanel/RangesPanel.js +7 -3
- package/lib-cjs/component/panels/RangesPanel/RangesTableRow.js +3 -3
- package/lib-cjs/component/panels/RangesPanel/TableColumns/ActionsColumn.js +1 -1
- package/lib-cjs/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +2 -1
- package/lib-cjs/component/panels/RangesPanel/hooks/useMapRanges.js +3 -6
- package/lib-cjs/component/panels/SpectrumsPanel/SpectraPanelHeader.js +3 -1
- package/lib-cjs/component/panels/SpectrumsPanel/SpectrumListItem.js +1 -1
- package/lib-cjs/component/panels/SpectrumsPanel/SpectrumsTabs.js +3 -1
- package/lib-cjs/component/panels/SpectrumsPanel/base/ColorIndicator.js +2 -2
- package/lib-cjs/component/panels/SpectrumsPanel/base/ShowHideMarkersButton.js +4 -1
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +4 -4
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +1 -2
- package/lib-cjs/component/panels/SummaryPanel/SummaryPanel.js +2 -3
- package/lib-cjs/component/panels/SummaryPanel/utilities/useInView.js +3 -1
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +1 -1
- package/lib-cjs/component/panels/ZonesPanel/ZonesPanel.js +18 -9
- package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +5 -13
- package/lib-cjs/component/panels/databasePanel/DatabaseTable.js +2 -2
- package/lib-cjs/component/panels/filtersPanel/FilterPanel.js +1 -1
- package/lib-cjs/component/panels/filtersPanel/FiltersTable.js +2 -2
- package/lib-cjs/component/panels/header/DefaultPanelHeader.js +3 -12
- package/lib-cjs/component/panels/header/SpectraAutomaticPickingButton.js +1 -1
- package/lib-cjs/component/panels/predictionPanel/PredictionOptions.js +2 -2
- package/lib-cjs/component/panels/predictionPanel/PredictionPanel.js +15 -3
- package/lib-cjs/component/reducer/IgnoreActions.js +5 -0
- package/lib-cjs/component/reducer/Reducer.js +72 -50
- package/lib-cjs/component/reducer/actions/DomainActions.js +11 -9
- package/lib-cjs/component/reducer/actions/FiltersActions.js +332 -205
- package/lib-cjs/component/reducer/actions/IntegralsActions.js +15 -10
- package/lib-cjs/component/reducer/actions/LoadActions.js +18 -36
- package/lib-cjs/component/reducer/actions/MoleculeActions.js +49 -19
- package/lib-cjs/component/reducer/actions/PeaksActions.js +54 -12
- package/lib-cjs/component/reducer/actions/PreferencesActions.js +8 -10
- package/lib-cjs/component/reducer/actions/RangesActions.js +87 -29
- package/lib-cjs/component/reducer/actions/SpectraAnalysisAction.js +5 -5
- package/lib-cjs/component/reducer/actions/SpectrumsActions.js +14 -11
- package/lib-cjs/component/reducer/actions/ToolsActions.js +46 -94
- package/lib-cjs/component/reducer/actions/ZonesActions.js +71 -17
- package/lib-cjs/component/reducer/helper/Zoom1DManager.js +2 -1
- package/lib-cjs/component/reducer/helper/getActiveSpectrumOrFail.js +10 -0
- package/lib-cjs/component/reducer/helper/getSpectrum.js +3 -2
- package/lib-cjs/component/reducer/helper/getStrongestPeak.js +19 -0
- package/lib-cjs/component/reducer/preferences/actions/addWorkspace.js +2 -5
- package/lib-cjs/component/reducer/preferences/panelsPreferencesDefaultValues.js +3 -0
- package/lib-cjs/component/reducer/preferences/preferencesReducer.js +1 -1
- package/lib-cjs/component/reducer/types/Types.js +15 -3
- package/lib-cjs/component/tool/BrushX.js +1 -1
- package/lib-cjs/component/tool/BrushXY.js +4 -3
- package/lib-cjs/component/tool/CrossLinePointer.js +5 -4
- package/lib-cjs/component/tool/FloatMoleculeStructures/DraggableStructure.js +21 -6
- package/lib-cjs/component/tool/FloatMoleculeStructures/index.js +19 -6
- package/lib-cjs/component/toolbar/BasicToolBar.js +7 -14
- package/lib-cjs/component/toolbar/FunctionToolBar.js +12 -22
- package/lib-cjs/component/toolbar/ToolTypes.js +119 -9
- package/lib-cjs/component/utility/assert.js +9 -0
- package/lib-cjs/component/workspaces/basic.js +12 -11
- package/lib-cjs/component/workspaces/embedded.js +14 -13
- package/lib-cjs/component/workspaces/exercise.js +10 -6
- package/lib-cjs/component/workspaces/prediction.js +14 -13
- package/lib-cjs/component/workspaces/process1D.js +20 -19
- package/lib-cjs/component/workspaces/workspaceDefaultProperties.js +14 -15
- package/lib-cjs/constants.js +1 -1
- package/lib-cjs/data/Filters.js +3 -3
- package/lib-cjs/data/FiltersManager.js +3 -6
- package/lib-cjs/data/PredictionManager.js +15 -15
- package/lib-cjs/data/SpectraManager.js +5 -100
- package/lib-cjs/data/constants/SignalsKinds.js +0 -8
- package/lib-cjs/data/data1d/Data1DManager.js +5 -5
- package/lib-cjs/data/data1d/Spectrum1D/SumManager.js +18 -12
- package/lib-cjs/data/data1d/Spectrum1D/generateJGraphData.js +2 -5
- package/lib-cjs/data/data1d/Spectrum1D/index.js +3 -1
- package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +3 -3
- package/lib-cjs/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +5 -2
- package/lib-cjs/data/data1d/Spectrum1D/peaks/mapPeaks.js +15 -19
- package/lib-cjs/data/data1d/Spectrum1D/peaks/optimizePeaks.js +28 -0
- package/lib-cjs/data/data1d/Spectrum1D/ranges/addRange.js +3 -3
- package/lib-cjs/data/data1d/Spectrum1D/ranges/autoRangesDetection.js +2 -0
- package/lib-cjs/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/ranges/detectRange.js +2 -5
- package/lib-cjs/data/data1d/Spectrum1D/ranges/mapRanges.js +3 -6
- package/lib-cjs/data/data1d/database.js +4 -6
- package/lib-cjs/data/data1d/filter1d/apodization.js +70 -0
- package/lib-cjs/data/data1d/filter1d/baselineCorrection.js +11 -18
- package/lib-cjs/data/data1d/filter1d/fft.js +11 -0
- package/lib-cjs/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +39 -0
- package/lib-cjs/data/data1d/filter1d/zeroFillingAndApodization.js +30 -0
- package/lib-cjs/data/data2d/Processing2D.js +3 -2
- package/lib-cjs/data/data2d/Spectrum2D/initiateDatum2D.js +3 -6
- package/lib-cjs/data/data2d/Spectrum2D/zones/detectZones.js +3 -6
- package/lib-cjs/data/data2d/Spectrum2D/zones/detectZonesManual.js +3 -6
- package/lib-cjs/data/molecules/Molecule.js +5 -8
- package/lib-cjs/data/molecules/MoleculeManager.js +5 -5
- package/lib-cjs/data/utilities/generateNumbersPowerOfX.js +0 -1
- package/lib-cjs/data/utilities/isInRange.js +7 -0
- package/lib-cjs/versionInfo.js +1 -1
- package/package.json +36 -35
- package/lib/component/1d/PeakAnnotations.js +0 -41
- package/lib/component/utility/nmredataToNmrium.d.ts +0 -4
- package/lib/component/utility/nmredataToNmrium.js +0 -66
- package/lib/component/utility/nmriumToNmredata.d.ts +0 -2
- package/lib/component/utility/nmriumToNmredata.js +0 -80
- package/lib/component/utility/util/nmredata/addRanges.d.ts +0 -1
- package/lib/component/utility/util/nmredata/addRanges.js +0 -52
- package/lib/component/utility/util/nmredata/addSource.d.ts +0 -6
- package/lib/component/utility/util/nmredata/addSource.js +0 -54
- package/lib/component/utility/util/nmredata/addZones.d.ts +0 -1
- package/lib/component/utility/util/nmredata/addZones.js +0 -41
- package/lib/component/utility/util/nmredata/flat2DSignals.d.ts +0 -1
- package/lib/component/utility/util/nmredata/flat2DSignals.js +0 -7
- package/lib/component/utility/util/nmredata/get1DSignals.d.ts +0 -10
- package/lib/component/utility/util/nmredata/get1DSignals.js +0 -96
- package/lib/component/utility/util/nmredata/get2DSignals.d.ts +0 -8
- package/lib/component/utility/util/nmredata/get2DSignals.js +0 -59
- package/lib/component/utility/util/nmredata/getCouplingObserved.d.ts +0 -1
- package/lib/component/utility/util/nmredata/getCouplingObserved.js +0 -11
- package/lib/component/utility/util/nmredata/getLabels.d.ts +0 -9
- package/lib/component/utility/util/nmredata/getLabels.js +0 -66
- package/lib/component/utility/util/nmredata/getToFix.d.ts +0 -1
- package/lib/component/utility/util/nmredata/getToFix.js +0 -19
- package/lib/data/data1d/filter1d/lineBroadening.d.ts +0 -14
- package/lib/data/data1d/filter1d/lineBroadening.js +0 -57
- package/lib/data/migration/MigrationManager.d.ts +0 -2
- package/lib/data/migration/MigrationManager.js +0 -17
- package/lib/data/migration/changeKeys.d.ts +0 -1
- package/lib/data/migration/changeKeys.js +0 -9
- package/lib/data/migration/migrateToVersion1.d.ts +0 -11
- package/lib/data/migration/migrateToVersion1.js +0 -32
- package/lib/data/migration/migrateToVersion2.d.ts +0 -1
- package/lib/data/migration/migrateToVersion2.js +0 -111
- package/lib/data/utilities/generateID.d.ts +0 -1
- package/lib/data/utilities/generateID.js +0 -9
- package/lib-cjs/component/1d/PeakAnnotations.js +0 -46
- package/lib-cjs/component/utility/nmredataToNmrium.js +0 -73
- package/lib-cjs/component/utility/nmriumToNmredata.js +0 -87
- package/lib-cjs/component/utility/util/nmredata/addRanges.js +0 -56
- package/lib-cjs/component/utility/util/nmredata/addSource.js +0 -61
- package/lib-cjs/component/utility/util/nmredata/addZones.js +0 -48
- package/lib-cjs/component/utility/util/nmredata/flat2DSignals.js +0 -11
- package/lib-cjs/component/utility/util/nmredata/get1DSignals.js +0 -100
- package/lib-cjs/component/utility/util/nmredata/get2DSignals.js +0 -63
- package/lib-cjs/component/utility/util/nmredata/getCouplingObserved.js +0 -15
- package/lib-cjs/component/utility/util/nmredata/getLabels.js +0 -70
- package/lib-cjs/component/utility/util/nmredata/getToFix.js +0 -23
- package/lib-cjs/data/data1d/filter1d/lineBroadening.js +0 -63
- package/lib-cjs/data/migration/MigrationManager.js +0 -24
- package/lib-cjs/data/migration/changeKeys.js +0 -13
- package/lib-cjs/data/migration/migrateToVersion1.js +0 -35
- package/lib-cjs/data/migration/migrateToVersion2.js +0 -114
- package/lib-cjs/data/utilities/generateID.js +0 -12
|
@@ -87,7 +87,7 @@ const predictionFormValidation = Yup.object().shape({
|
|
|
87
87
|
lineWidth: Yup.number().integer().min(1).required().label('Line Width'),
|
|
88
88
|
}),
|
|
89
89
|
});
|
|
90
|
-
function PredictionOptions({ onPredict = () => null }) {
|
|
90
|
+
function PredictionOptions({ onPredict = () => null, disabled = false, }) {
|
|
91
91
|
const refForm = (0, react_2.useRef)();
|
|
92
92
|
const handleSave = (0, react_2.useCallback)(() => {
|
|
93
93
|
refForm.current.submitForm();
|
|
@@ -97,6 +97,6 @@ function PredictionOptions({ onPredict = () => null }) {
|
|
|
97
97
|
onPredict(values);
|
|
98
98
|
})();
|
|
99
99
|
}, [onPredict]);
|
|
100
|
-
return ((0, jsx_runtime_1.jsxs)("div", { css: styles, children: [(0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsxs)(FormikForm_1.default, { ref: refForm, initialValues: PredictionManager_1.defaultPredictionOptions, validationSchema: predictionFormValidation, onSubmit: submitHandler, children: [(0, jsx_runtime_1.jsx)(FormikErrorsSummary_1.default, {}), (0, jsx_runtime_1.jsxs)("div", { className: "row margin-10", children: [(0, jsx_runtime_1.jsx)("span", { className: "custom-label", children: "Frequency : " }), (0, jsx_runtime_1.jsx)(FormikSelect_1.default, {
|
|
100
|
+
return ((0, jsx_runtime_1.jsxs)("div", { css: styles, children: [(0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsxs)(FormikForm_1.default, { ref: refForm, initialValues: PredictionManager_1.defaultPredictionOptions, validationSchema: predictionFormValidation, onSubmit: submitHandler, children: [(0, jsx_runtime_1.jsx)(FormikErrorsSummary_1.default, {}), (0, jsx_runtime_1.jsxs)("div", { className: "row margin-10", children: [(0, jsx_runtime_1.jsx)("span", { className: "custom-label", children: "Frequency : " }), (0, jsx_runtime_1.jsx)(FormikSelect_1.default, { items: PredictionManager_1.FREQUENCIES, style: { width: 290, height: 30, margin: 0 }, name: "frequency" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "row", children: [(0, jsx_runtime_1.jsx)(IsotopesViewer_1.default, { value: "1H", className: "custom-label" }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "From", children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "1d.1H.from", type: "number" }) }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "To", style: { label: { padding: '0 10px' } }, children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "1d.1H.to", type: "number" }) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "row", children: [(0, jsx_runtime_1.jsx)(IsotopesViewer_1.default, { value: "13C", className: "custom-label" }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "From", children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "1d.13C.from", type: "number" }) }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "To", style: { label: { padding: '0 10px' } }, children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "1d.13C.to", type: "number" }) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "row margin-10 padding-h-10", children: [(0, jsx_runtime_1.jsx)("span", { className: "custom-label", children: "Line Width : " }), (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "1d.lineWidth", type: "number", style: { input: { margin: 0 } } }), (0, jsx_runtime_1.jsx)("span", { style: { paddingLeft: '0.4rem' }, children: " Hz " })] })] }) }), (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(Button_1.default.Done, { onClick: handleSave, disabled: disabled, children: "Predict spectra" }) })] }));
|
|
101
101
|
}
|
|
102
102
|
exports.default = PredictionOptions;
|
|
@@ -4,7 +4,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const analysis_ui_components_1 = require("analysis-ui-components");
|
|
7
8
|
const react_1 = require("react");
|
|
9
|
+
const ChartContext_1 = require("../../context/ChartContext");
|
|
8
10
|
const DispatchContext_1 = require("../../context/DispatchContext");
|
|
9
11
|
const Alert_1 = require("../../elements/popup/Alert");
|
|
10
12
|
const Types_1 = require("../../reducer/types/Types");
|
|
@@ -12,12 +14,14 @@ const MoleculePanel_1 = __importDefault(require("../MoleculesPanel/MoleculePanel
|
|
|
12
14
|
const PredictionOptions_1 = __importDefault(require("./PredictionOptions"));
|
|
13
15
|
function PredictionPane() {
|
|
14
16
|
const [molecule, setMolecule] = (0, react_1.useState)();
|
|
17
|
+
const { molecules } = (0, ChartContext_1.useChartData)();
|
|
18
|
+
const { item: spectraPanelState, utils: { toggle: openSpectraPanel }, } = (0, analysis_ui_components_1.useAccordionContext)('Spectra');
|
|
15
19
|
const changeHandler = (0, react_1.useCallback)((molecule) => {
|
|
16
20
|
setMolecule(molecule);
|
|
17
21
|
}, []);
|
|
18
22
|
const dispatch = (0, DispatchContext_1.useDispatch)();
|
|
19
23
|
const alert = (0, Alert_1.useAlert)();
|
|
20
|
-
const predictHandler = (
|
|
24
|
+
const predictHandler = (values) => {
|
|
21
25
|
void (async () => {
|
|
22
26
|
if (molecule) {
|
|
23
27
|
dispatch({
|
|
@@ -29,13 +33,21 @@ function PredictionPane() {
|
|
|
29
33
|
type: Types_1.PREDICT_SPECTRA,
|
|
30
34
|
payload: { mol: molecule, options: values },
|
|
31
35
|
});
|
|
36
|
+
if (!spectraPanelState?.isOpen) {
|
|
37
|
+
openSpectraPanel();
|
|
38
|
+
}
|
|
32
39
|
hideLoading();
|
|
33
40
|
}
|
|
34
41
|
else {
|
|
35
42
|
alert.error('No Molecule selected');
|
|
36
43
|
}
|
|
37
44
|
})();
|
|
38
|
-
}
|
|
39
|
-
return ((0, jsx_runtime_1.jsx)(MoleculePanel_1.default, { onMoleculeChange: changeHandler, actionsOptions: { hidePredict: true, hideDelete: true, hideExport: true },
|
|
45
|
+
};
|
|
46
|
+
return ((0, jsx_runtime_1.jsx)(MoleculePanel_1.default, { onMoleculeChange: changeHandler, actionsOptions: { hidePredict: true, hideDelete: true, hideExport: true }, emptyTextStyle: {
|
|
47
|
+
padding: '0.25rem 0.5rem',
|
|
48
|
+
borderRadius: '0.2rem',
|
|
49
|
+
backgroundColor: '#2dd36f',
|
|
50
|
+
color: 'white',
|
|
51
|
+
}, children: (0, jsx_runtime_1.jsx)(PredictionOptions_1.default, { onPredict: predictHandler, disabled: !molecules || molecules.length === 0 }) }));
|
|
40
52
|
}
|
|
41
53
|
exports.default = PredictionPane;
|
|
@@ -54,6 +54,11 @@ const ignoreActions = [
|
|
|
54
54
|
types.CHANGE_ACTIVE_SPECTRUM,
|
|
55
55
|
types.CHANGE_SPECTRUM_COLOR,
|
|
56
56
|
types.SET_MOUSE_OVER_DISPLAYER,
|
|
57
|
+
types.TOGGLE_PEAKS_SHAPES,
|
|
58
|
+
types.SHOW_J_GRAPH,
|
|
59
|
+
types.SHOW_MULTIPLICTY_TREES,
|
|
60
|
+
types.SHOW_RANGES_INTEGRALS,
|
|
61
|
+
types.CHANGE_FLOAT_MOLECULE_POSITION,
|
|
57
62
|
];
|
|
58
63
|
function checkActionType(type) {
|
|
59
64
|
if (!ignoreActions.includes(type))
|
|
@@ -22,20 +22,17 @@ 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
|
-
exports.spectrumReducer = exports.dispatchMiddleware = exports.initState = exports.initialState = exports.getInitialState = void 0;
|
|
26
|
+
exports.spectrumReducer = exports.dispatchMiddleware = exports.initState = exports.useActiveSpectrum = exports.initialState = exports.getInitialState = exports.zoneStateInit = exports.rangeStateInit = void 0;
|
|
27
|
+
const uuid_1 = require("@lukeed/uuid");
|
|
30
28
|
const immer_1 = require("immer");
|
|
31
29
|
const nmr_correlation_1 = require("nmr-correlation");
|
|
30
|
+
const nmr_load_save_1 = require("nmr-load-save");
|
|
32
31
|
const PredictionManager_1 = require("../../data/PredictionManager");
|
|
33
32
|
const SpectraManager = __importStar(require("../../data/SpectraManager"));
|
|
34
|
-
const
|
|
35
|
-
const generateID_1 = __importDefault(require("../../data/utilities/generateID"));
|
|
33
|
+
const ChartContext_1 = require("../context/ChartContext");
|
|
36
34
|
const Constants_1 = require("../panels/SummaryPanel/CorrelationTable/Constants");
|
|
37
35
|
const ToolTypes_1 = require("../toolbar/ToolTypes");
|
|
38
|
-
const nmredataToNmrium_1 = require("../utility/nmredataToNmrium");
|
|
39
36
|
const AssignmentsActions = __importStar(require("./actions/AssignmentsActions"));
|
|
40
37
|
const CorrelationsActions = __importStar(require("./actions/CorrelationsActions"));
|
|
41
38
|
const DatabaseActions = __importStar(require("./actions/DatabaseActions"));
|
|
@@ -57,6 +54,16 @@ const ZonesActions = __importStar(require("./actions/ZonesActions"));
|
|
|
57
54
|
const Constants_2 = require("./core/Constants");
|
|
58
55
|
const HistoryTypes_1 = require("./types/HistoryTypes");
|
|
59
56
|
const types = __importStar(require("./types/Types"));
|
|
57
|
+
exports.rangeStateInit = {
|
|
58
|
+
showMultiplicityTrees: false,
|
|
59
|
+
showRangesIntegrals: true,
|
|
60
|
+
showJGraph: false,
|
|
61
|
+
};
|
|
62
|
+
exports.zoneStateInit = {
|
|
63
|
+
showZones: true,
|
|
64
|
+
showSignals: true,
|
|
65
|
+
showPeaks: true,
|
|
66
|
+
};
|
|
60
67
|
const getInitialState = () => ({
|
|
61
68
|
actionType: '',
|
|
62
69
|
data: [],
|
|
@@ -74,7 +81,6 @@ const getInitialState = () => ({
|
|
|
74
81
|
shareYDomain: false,
|
|
75
82
|
},
|
|
76
83
|
integralsYDomains: {},
|
|
77
|
-
activeTab: '',
|
|
78
84
|
width: 0,
|
|
79
85
|
height: 0,
|
|
80
86
|
margin: {
|
|
@@ -83,9 +89,14 @@ const getInitialState = () => ({
|
|
|
83
89
|
bottom: 70,
|
|
84
90
|
left: 0,
|
|
85
91
|
},
|
|
86
|
-
activeSpectrum: null,
|
|
87
92
|
mode: 'RTL',
|
|
88
93
|
molecules: [],
|
|
94
|
+
view: {
|
|
95
|
+
floatingMolecules: [],
|
|
96
|
+
ranges: [],
|
|
97
|
+
zones: [],
|
|
98
|
+
spectra: { activeSpectra: {}, activeTab: '' },
|
|
99
|
+
},
|
|
89
100
|
verticalAlign: {
|
|
90
101
|
align: 'bottom',
|
|
91
102
|
verticalShift: Constants_2.DEFAULT_YAXIS_SHIFT_VALUE,
|
|
@@ -100,7 +111,6 @@ const getInitialState = () => ({
|
|
|
100
111
|
isLoading: false,
|
|
101
112
|
keysPreferences: {},
|
|
102
113
|
displayerMode: Constants_2.DISPLAYER_MODE.DM_1D,
|
|
103
|
-
tabActiveSpectrum: {},
|
|
104
114
|
spectraAnalysis: {},
|
|
105
115
|
correlations: {},
|
|
106
116
|
displayerKey: '',
|
|
@@ -116,21 +126,28 @@ const getInitialState = () => ({
|
|
|
116
126
|
options: {},
|
|
117
127
|
zones: [],
|
|
118
128
|
},
|
|
129
|
+
apodizationOptions: {},
|
|
119
130
|
pivot: { value: 0, index: 0 },
|
|
120
131
|
zonesNoiseFactor: 1,
|
|
121
132
|
activeFilterID: null,
|
|
122
|
-
showMultiplicityTrees: false,
|
|
123
|
-
showRangesIntegrals: true,
|
|
124
|
-
showJGraph: false,
|
|
125
133
|
predictionIndex: 0,
|
|
134
|
+
peaksOptions: {
|
|
135
|
+
showPeaksShapes: false,
|
|
136
|
+
showPeaksSum: false,
|
|
137
|
+
},
|
|
126
138
|
},
|
|
127
139
|
},
|
|
128
140
|
usedColors: { '1d': [], '2d': [] },
|
|
129
141
|
});
|
|
130
142
|
exports.getInitialState = getInitialState;
|
|
131
143
|
exports.initialState = (0, exports.getInitialState)();
|
|
144
|
+
function useActiveSpectrum() {
|
|
145
|
+
const { view: { spectra: { activeSpectra, activeTab }, }, } = (0, ChartContext_1.useChartData)();
|
|
146
|
+
return activeSpectra[activeTab] || null;
|
|
147
|
+
}
|
|
148
|
+
exports.useActiveSpectrum = useActiveSpectrum;
|
|
132
149
|
function initState(state) {
|
|
133
|
-
const displayerKey = (0,
|
|
150
|
+
const displayerKey = (0, uuid_1.v4)();
|
|
134
151
|
const correlations = (0, nmr_correlation_1.buildCorrelationData)([], {
|
|
135
152
|
tolerance: Constants_1.DefaultTolerance,
|
|
136
153
|
});
|
|
@@ -148,7 +165,7 @@ function dispatchMiddleware(dispatch) {
|
|
|
148
165
|
switch (action.type) {
|
|
149
166
|
case types.INITIATE: {
|
|
150
167
|
if (action.payload) {
|
|
151
|
-
const { spectra, ...res } = (0,
|
|
168
|
+
const { spectra, ...res } = (0, nmr_load_save_1.migrate)(action.payload);
|
|
152
169
|
void SpectraManager.fromJSON(spectra, usedColors).then((data) => {
|
|
153
170
|
action.payload = { spectra: data, ...res, usedColors };
|
|
154
171
|
dispatch(action);
|
|
@@ -156,28 +173,17 @@ function dispatchMiddleware(dispatch) {
|
|
|
156
173
|
}
|
|
157
174
|
break;
|
|
158
175
|
}
|
|
159
|
-
case types.
|
|
160
|
-
const
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
});
|
|
166
|
-
break;
|
|
167
|
-
}
|
|
168
|
-
case types.LOAD_ZIP_FILE: {
|
|
169
|
-
for (let zipFile of action.files) {
|
|
170
|
-
void SpectraManager.addBruker({ display: { name: zipFile.name } }, zipFile.binary, usedColors).then((data) => {
|
|
171
|
-
action.payload = { data, usedColors };
|
|
172
|
-
dispatch(action);
|
|
173
|
-
});
|
|
174
|
-
}
|
|
175
|
-
break;
|
|
176
|
-
}
|
|
177
|
-
case types.LOAD_NMREDATA_FILE: {
|
|
178
|
-
void (0, nmredataToNmrium_1.nmredataToNmrium)(action.file, usedColors).then((data) => {
|
|
179
|
-
action.payload = Object.assign(data, { usedColors });
|
|
176
|
+
case types.LOAD_DROP_FILES: {
|
|
177
|
+
const { files } = action;
|
|
178
|
+
action.usedColors = usedColors;
|
|
179
|
+
(0, nmr_load_save_1.read)(files, usedColors)
|
|
180
|
+
.then((data) => {
|
|
181
|
+
action.data = data;
|
|
180
182
|
dispatch(action);
|
|
183
|
+
})
|
|
184
|
+
.catch((e) => {
|
|
185
|
+
dispatch({ type: types.SET_LOADING_FLAG, isLoading: false });
|
|
186
|
+
reportError(e);
|
|
181
187
|
});
|
|
182
188
|
break;
|
|
183
189
|
}
|
|
@@ -206,26 +212,28 @@ function innerSpectrumReducer(draft, action) {
|
|
|
206
212
|
switch (action.type) {
|
|
207
213
|
case types.INITIATE:
|
|
208
214
|
return LoadActions.initiate(draft, action);
|
|
215
|
+
case types.LOAD_DROP_FILES:
|
|
216
|
+
return LoadActions.loadDropFiles(draft, action);
|
|
209
217
|
case types.SET_LOADING_FLAG:
|
|
210
218
|
return LoadActions.setIsLoading(draft, action.isLoading);
|
|
211
219
|
case types.LOAD_JSON_FILE:
|
|
212
220
|
return LoadActions.handleLoadJsonFile(draft, action);
|
|
213
221
|
case types.LOAD_JCAMP_FILE:
|
|
214
222
|
return LoadActions.loadJcampFile(draft, action);
|
|
215
|
-
case types.LOAD_JDF_FILE:
|
|
216
|
-
return LoadActions.loadJDFFile(draft, action);
|
|
217
|
-
case types.LOAD_MOL_FILE:
|
|
218
|
-
return LoadActions.handleLoadMOLFile(draft, action);
|
|
219
|
-
case types.LOAD_ZIP_FILE:
|
|
220
|
-
return LoadActions.handleLoadZIPFile(draft, action);
|
|
221
|
-
case types.LOAD_NMREDATA_FILE:
|
|
222
|
-
return LoadActions.handleLoadNmredata(draft, action);
|
|
223
223
|
case types.ADD_PEAK:
|
|
224
224
|
return PeaksActions.addPeak(draft, action.mouseCoordinates);
|
|
225
225
|
case types.ADD_PEAKS:
|
|
226
226
|
return PeaksActions.addPeaks(draft, action);
|
|
227
227
|
case types.DELETE_PEAK_NOTATION:
|
|
228
228
|
return PeaksActions.deletePeak(draft, action.data);
|
|
229
|
+
case types.AUTO_PEAK_PICKING:
|
|
230
|
+
return PeaksActions.handleAutoPeakPicking(draft, action.options);
|
|
231
|
+
case types.OPTIMIZE_PEAKS:
|
|
232
|
+
return PeaksActions.handleOptimizePeaks(draft, action);
|
|
233
|
+
case types.CHANGE_PEAK_SHAPE:
|
|
234
|
+
return PeaksActions.changePeakShapeHandler(draft, action);
|
|
235
|
+
case types.TOGGLE_PEAKS_SHAPES:
|
|
236
|
+
return PeaksActions.handleShowPeaksShapes(draft, action);
|
|
229
237
|
case types.ADD_INTEGRAL:
|
|
230
238
|
return IntegralsActions.addIntegral(draft, action);
|
|
231
239
|
case types.DELETE_INTEGRAL:
|
|
@@ -258,10 +266,18 @@ function innerSpectrumReducer(draft, action) {
|
|
|
258
266
|
return ToolsActions.setSelectedOptionPanel(draft, action.selectedOptionPanel);
|
|
259
267
|
case types.FULL_ZOOM_OUT:
|
|
260
268
|
return ToolsActions.zoomOut(draft, action);
|
|
269
|
+
case types.DISABLE_FILTER_LIVE_PREVIEW:
|
|
270
|
+
return FiltersActions.handleDisableFilterLivePreview(draft, action);
|
|
261
271
|
case types.SHIFT_SPECTRUM:
|
|
262
272
|
return FiltersActions.shiftSpectrumAlongXAxis(draft, action.shiftValue);
|
|
273
|
+
case types.APPLY_APODIZATION_FILTER:
|
|
274
|
+
return FiltersActions.applyApodizationFilter(draft, action);
|
|
275
|
+
case types.CALCULATE_APODIZATION_FILTER:
|
|
276
|
+
return FiltersActions.calculateApodizationFilter(draft, action);
|
|
263
277
|
case types.APPLY_ZERO_FILLING_FILTER:
|
|
264
|
-
return FiltersActions.applyZeroFillingFilter(draft, action
|
|
278
|
+
return FiltersActions.applyZeroFillingFilter(draft, action);
|
|
279
|
+
case types.CALCULATE_ZERO_FILLING_FILTER:
|
|
280
|
+
return FiltersActions.calculateZeroFillingFilter(draft, action);
|
|
265
281
|
case types.APPLY_FFT_FILTER:
|
|
266
282
|
return FiltersActions.applyFFTFilter(draft);
|
|
267
283
|
case types.APPLY_MANUAL_PHASE_CORRECTION_FILTER:
|
|
@@ -330,6 +346,8 @@ function innerSpectrumReducer(draft, action) {
|
|
|
330
346
|
return MoleculeActions.predictSpectraFromMoleculeHandler(draft, action);
|
|
331
347
|
case types.FLOAT_MOLECULE_OVER_SPECTRUM:
|
|
332
348
|
return MoleculeActions.floatMoleculeOverSpectrum(draft, action);
|
|
349
|
+
case types.CHANGE_FLOAT_MOLECULE_POSITION:
|
|
350
|
+
return MoleculeActions.changeFloatMoleculePosition(draft, action);
|
|
333
351
|
case types.SET_CORRELATIONS_MF:
|
|
334
352
|
return CorrelationsActions.handleSetMF(draft, action.payload);
|
|
335
353
|
case types.SET_CORRELATIONS_TOLERANCE:
|
|
@@ -346,8 +364,6 @@ function innerSpectrumReducer(draft, action) {
|
|
|
346
364
|
return ToolsActions.setVerticalIndicatorXPosition(draft, action.position);
|
|
347
365
|
case types.SET_SPECTRUMS_VERTICAL_ALIGN:
|
|
348
366
|
return ToolsActions.setSpectrumsVerticalAlign(draft);
|
|
349
|
-
case types.AUTO_PEAK_PICKING:
|
|
350
|
-
return PeaksActions.handleAutoPeakPicking(draft, action.options);
|
|
351
367
|
case types.AUTO_ZONES_DETECTION:
|
|
352
368
|
return ZonesActions.handleAutoZonesDetection(draft, action.options);
|
|
353
369
|
case types.CHANGE_ZONES_NOISE_FACTOR:
|
|
@@ -381,13 +397,13 @@ function innerSpectrumReducer(draft, action) {
|
|
|
381
397
|
case types.UPDATE_RANGE:
|
|
382
398
|
return RangesActions.handleUpdateRange(draft, action);
|
|
383
399
|
case types.SHOW_MULTIPLICTY_TREES:
|
|
384
|
-
return RangesActions.handleShowMultiplicityTrees(draft);
|
|
400
|
+
return RangesActions.handleShowMultiplicityTrees(draft, action);
|
|
385
401
|
case types.SHOW_RANGES_INTEGRALS:
|
|
386
|
-
return RangesActions.handleShowRangesIntegrals(draft);
|
|
402
|
+
return RangesActions.handleShowRangesIntegrals(draft, action);
|
|
387
403
|
case types.AUTO_RANGES_SPECTRA_PICKING:
|
|
388
404
|
return RangesActions.handleAutoSpectraRangesDetection(draft);
|
|
389
405
|
case types.SHOW_J_GRAPH:
|
|
390
|
-
return RangesActions.handleShowJGraph(draft);
|
|
406
|
+
return RangesActions.handleShowJGraph(draft, action);
|
|
391
407
|
case types.SET_ACTIVE_TAB:
|
|
392
408
|
return ToolsActions.handelSetActiveTab(draft, action.tab);
|
|
393
409
|
case types.ADD_BASE_LINE_ZONE:
|
|
@@ -420,6 +436,12 @@ function innerSpectrumReducer(draft, action) {
|
|
|
420
436
|
return ZonesActions.handleSetDiaIDZone(draft, action);
|
|
421
437
|
case types.AUTO_ZONES_SPECTRA_PICKING:
|
|
422
438
|
return ZonesActions.handleAutoSpectraZonesDetection(draft);
|
|
439
|
+
case types.SHOW_ZONES:
|
|
440
|
+
return ZonesActions.handleShowZones(draft, action);
|
|
441
|
+
case types.SHOW_ZONES_SIGNALS:
|
|
442
|
+
return ZonesActions.handleShowSignals(draft, action);
|
|
443
|
+
case types.SHOW_ZONES_PEAKS:
|
|
444
|
+
return ZonesActions.handleShowPeaks(draft, action);
|
|
423
445
|
case types.SAVE_EDITED_ZONE:
|
|
424
446
|
return ZonesActions.handleSaveEditedZone(draft, action);
|
|
425
447
|
case types.ANALYZE_SPECTRA:
|
|
@@ -10,10 +10,12 @@ const Spectrum2D_1 = require("../../../data/data2d/Spectrum2D");
|
|
|
10
10
|
const nucleusToString_1 = __importDefault(require("../../utility/nucleusToString"));
|
|
11
11
|
const Constants_1 = require("../core/Constants");
|
|
12
12
|
function getActiveData(draft) {
|
|
13
|
-
let data = draft.data.filter((datum) => (0, nucleusToString_1.default)(datum.info.nucleus) === draft.activeTab &&
|
|
13
|
+
let data = draft.data.filter((datum) => (0, nucleusToString_1.default)(datum.info.nucleus) === draft.view.spectra.activeTab &&
|
|
14
14
|
datum.info.dimension === 1);
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
// todo: refactor this
|
|
16
|
+
const activeSpectrum = draft.view.spectra.activeSpectra[draft.view.spectra.activeTab];
|
|
17
|
+
if (activeSpectrum) {
|
|
18
|
+
const activeSpectrumIndex = data.findIndex((datum) => datum.id === activeSpectrum?.id);
|
|
17
19
|
if (activeSpectrumIndex !== -1) {
|
|
18
20
|
const isFid = data[activeSpectrumIndex].info.isFid || false;
|
|
19
21
|
data = data.filter((datum) => datum.info.isFid === isFid);
|
|
@@ -24,12 +26,12 @@ function getActiveData(draft) {
|
|
|
24
26
|
}
|
|
25
27
|
return data;
|
|
26
28
|
}
|
|
27
|
-
function getDomain(
|
|
29
|
+
function getDomain(draft) {
|
|
28
30
|
let xArray = [];
|
|
29
31
|
let yArray = [];
|
|
30
32
|
let yDomains = {};
|
|
31
33
|
let xDomains = {};
|
|
32
|
-
const data = getActiveData(
|
|
34
|
+
const data = getActiveData(draft);
|
|
33
35
|
try {
|
|
34
36
|
xArray = data.reduce((acc, d) => {
|
|
35
37
|
const { display, data } = d;
|
|
@@ -68,7 +70,7 @@ function get2DDomain(state) {
|
|
|
68
70
|
let yArray = [];
|
|
69
71
|
let yDomains = {};
|
|
70
72
|
let xDomains = {};
|
|
71
|
-
const { activeTab,
|
|
73
|
+
const { view: { spectra: { activeSpectra, activeTab }, }, data, } = state;
|
|
72
74
|
const nucleus = activeTab.split(',');
|
|
73
75
|
try {
|
|
74
76
|
xArray = data.reduce((acc, datum) => {
|
|
@@ -92,7 +94,7 @@ function get2DDomain(state) {
|
|
|
92
94
|
// eslint-disable-next-line no-console
|
|
93
95
|
console.log(e);
|
|
94
96
|
}
|
|
95
|
-
const spectrumsIDs = nucleus.map((n) =>
|
|
97
|
+
const spectrumsIDs = nucleus.map((n) => activeSpectra[n]?.id);
|
|
96
98
|
const filteredData = data.reduce((acc, datum) => {
|
|
97
99
|
return spectrumsIDs.includes(datum.id) && datum.info.dimension === 1
|
|
98
100
|
? acc.concat(datum)
|
|
@@ -125,7 +127,7 @@ function get2DDomain(state) {
|
|
|
125
127
|
function setDomain(draft, options) {
|
|
126
128
|
const { yDomain = { isChanged: true, isShared: true } } = options || {};
|
|
127
129
|
let domain;
|
|
128
|
-
if (draft.activeTab) {
|
|
130
|
+
if (draft.view.spectra.activeTab) {
|
|
129
131
|
if (draft.displayerMode === Constants_1.DISPLAYER_MODE.DM_1D) {
|
|
130
132
|
domain = getDomain(draft);
|
|
131
133
|
}
|
|
@@ -199,7 +201,7 @@ function handelResetDomain(draft) {
|
|
|
199
201
|
exports.handelResetDomain = handelResetDomain;
|
|
200
202
|
function setMode(draft) {
|
|
201
203
|
const data = draft.data.filter((datum) => draft.xDomains[datum.id] &&
|
|
202
|
-
(0, nucleusToString_1.default)(datum.info.nucleus) === draft.activeTab);
|
|
204
|
+
(0, nucleusToString_1.default)(datum.info.nucleus) === draft.view.spectra.activeTab);
|
|
203
205
|
draft.mode = data[0]?.info.isFid ? 'LTR' : 'RTL';
|
|
204
206
|
}
|
|
205
207
|
exports.setMode = setMode;
|