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
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.get1DSignals = void 0;
|
|
4
|
-
const addSource_1 = require("./addSource");
|
|
5
|
-
const getToFix_1 = require("./getToFix");
|
|
6
|
-
async function get1DSignals(data, nmrRecord, options = { labels: { byDiaID: [] } }) {
|
|
7
|
-
let { prefix = '', labels } = options;
|
|
8
|
-
let str = '';
|
|
9
|
-
let nucleusArray = [];
|
|
10
|
-
for (let spectrum of data) {
|
|
11
|
-
const { info } = spectrum;
|
|
12
|
-
if (info.isFid || info.dimension > 1)
|
|
13
|
-
continue;
|
|
14
|
-
let partTag = '';
|
|
15
|
-
let ranges = spectrum.ranges.values || [];
|
|
16
|
-
let nucleus = spectrum.info.nucleus;
|
|
17
|
-
let counter = 1;
|
|
18
|
-
let subfix = '';
|
|
19
|
-
nucleusArray.forEach((e) => {
|
|
20
|
-
if (e === nucleus)
|
|
21
|
-
counter++;
|
|
22
|
-
});
|
|
23
|
-
nucleusArray.push(nucleus);
|
|
24
|
-
if (counter > 1)
|
|
25
|
-
subfix = `#${counter}`;
|
|
26
|
-
partTag += `${prefix}1D_${nucleus.toUpperCase()}${subfix}>`;
|
|
27
|
-
if (spectrum.info.baseFrequency) {
|
|
28
|
-
partTag += `\nLarmor=${Number(spectrum.info.baseFrequency).toFixed(2)}\\`;
|
|
29
|
-
}
|
|
30
|
-
const { source = {} } = spectrum;
|
|
31
|
-
partTag += await (0, addSource_1.addSource)(nmrRecord, {
|
|
32
|
-
spectrum,
|
|
33
|
-
source,
|
|
34
|
-
});
|
|
35
|
-
let toFix = (0, getToFix_1.getToFix)(nucleus)[0];
|
|
36
|
-
for (let range of ranges) {
|
|
37
|
-
let signals = range.signals;
|
|
38
|
-
for (let signal of signals) {
|
|
39
|
-
let { multiplicity } = signal;
|
|
40
|
-
if ((!multiplicity || multiplicity === 'm') && nucleus === '1H') {
|
|
41
|
-
partTag += `\n${Number(range.from).toFixed(toFix)}-${Number(range.to).toFixed(toFix)}`;
|
|
42
|
-
}
|
|
43
|
-
else if (signal.delta) {
|
|
44
|
-
partTag += `\n${Number(signal.delta).toFixed(toFix)}`;
|
|
45
|
-
}
|
|
46
|
-
else {
|
|
47
|
-
continue;
|
|
48
|
-
}
|
|
49
|
-
let signalLabel = '';
|
|
50
|
-
if (signal.diaIDs && signal.diaIDs.length > 0) {
|
|
51
|
-
signal.diaIDs.forEach((diaID, i, arr) => {
|
|
52
|
-
let separator = ', ';
|
|
53
|
-
if (i === arr.length - 1)
|
|
54
|
-
separator = '';
|
|
55
|
-
let label = labels.byDiaID[diaID].label || diaID;
|
|
56
|
-
signalLabel += `${label}${separator}`;
|
|
57
|
-
});
|
|
58
|
-
partTag += `, L=${signalLabel}`;
|
|
59
|
-
}
|
|
60
|
-
if (nucleus === '1H') {
|
|
61
|
-
if (signal.multiplicity)
|
|
62
|
-
partTag += `, S=${signal.multiplicity}`;
|
|
63
|
-
let jCoupling = signal.js;
|
|
64
|
-
if (Array.isArray(jCoupling) && jCoupling.length) {
|
|
65
|
-
let separator = ', J=';
|
|
66
|
-
for (const jCouplingElement of jCoupling) {
|
|
67
|
-
partTag += `${separator}${Number(jCouplingElement.coupling).toFixed(3)}`;
|
|
68
|
-
if (jCouplingElement.diaIDs) {
|
|
69
|
-
let { diaIDs } = jCouplingElement;
|
|
70
|
-
if (!Array.isArray(diaIDs))
|
|
71
|
-
diaIDs = [diaIDs];
|
|
72
|
-
if (!diaIDs.length)
|
|
73
|
-
continue;
|
|
74
|
-
let jCouple = labels.byDiaID[diaIDs[0]].label || String(diaIDs[0]);
|
|
75
|
-
partTag += `(${jCouple})`;
|
|
76
|
-
}
|
|
77
|
-
separator = ', ';
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
if (range.integration) {
|
|
81
|
-
partTag += `, E=${Number(range.integration).toFixed(toFix)}`;
|
|
82
|
-
}
|
|
83
|
-
else if (range.nbAtoms) {
|
|
84
|
-
partTag += `, E=${range.nbAtoms.toFixed(toFix)}`;
|
|
85
|
-
}
|
|
86
|
-
else if (range.signals[0].nbAtoms !== undefined) {
|
|
87
|
-
partTag += `, E=${range.signals[0].nbAtoms}`;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
if (signals.length)
|
|
92
|
-
partTag += '\\';
|
|
93
|
-
}
|
|
94
|
-
partTag += '\n';
|
|
95
|
-
if (/\n/.exec(partTag))
|
|
96
|
-
str += partTag;
|
|
97
|
-
}
|
|
98
|
-
return str;
|
|
99
|
-
}
|
|
100
|
-
exports.get1DSignals = get1DSignals;
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.get2DSignals = void 0;
|
|
4
|
-
const addSource_1 = require("./addSource");
|
|
5
|
-
const getCouplingObserved_1 = require("./getCouplingObserved");
|
|
6
|
-
const getToFix_1 = require("./getToFix");
|
|
7
|
-
const isArray = Array.isArray;
|
|
8
|
-
async function get2DSignals(data, nmrRecord, options = { labels: {} }) {
|
|
9
|
-
const { byDiaID } = options.labels;
|
|
10
|
-
let str = '';
|
|
11
|
-
let nucleusRecorded = [];
|
|
12
|
-
const prefix = `\n> <NMREDATA_2D_`;
|
|
13
|
-
for (let spectrum of data) {
|
|
14
|
-
if (spectrum.info.dimension < 2)
|
|
15
|
-
continue;
|
|
16
|
-
let partTag = '';
|
|
17
|
-
const { info, source } = spectrum;
|
|
18
|
-
let { nucleus, experiment, pulseSequence } = info;
|
|
19
|
-
nucleusRecorded.push(nucleus);
|
|
20
|
-
let couplingObserved = (0, getCouplingObserved_1.getCouplingObserved)(experiment);
|
|
21
|
-
if (nucleus) {
|
|
22
|
-
partTag += `${prefix}${nucleus[1]}_${couplingObserved}_${nucleus[0]}>`;
|
|
23
|
-
}
|
|
24
|
-
let toFix = (0, getToFix_1.getToFix)(nucleus);
|
|
25
|
-
partTag += await (0, addSource_1.addSource)(nmrRecord, {
|
|
26
|
-
spectrum,
|
|
27
|
-
source,
|
|
28
|
-
});
|
|
29
|
-
if (experiment)
|
|
30
|
-
partTag += `\nCorType=${experiment} \\`;
|
|
31
|
-
if (pulseSequence)
|
|
32
|
-
partTag += `\nPulseProgram=${pulseSequence} \\`;
|
|
33
|
-
if (spectrum.info.baseFrequency) {
|
|
34
|
-
partTag += `\nLarmor=${Number(spectrum.info.baseFrequency[0]).toFixed(2)}\\`;
|
|
35
|
-
}
|
|
36
|
-
let zones = spectrum.zones.values || [];
|
|
37
|
-
for (let zone of zones) {
|
|
38
|
-
let signals = zone.signals;
|
|
39
|
-
for (let signal of signals) {
|
|
40
|
-
let { x, y, peaks } = signal;
|
|
41
|
-
let xLabel = getAssignment(x, byDiaID, toFix[0]);
|
|
42
|
-
let yLabel = getAssignment(y, byDiaID, toFix[1]);
|
|
43
|
-
let intensity = Math.max(...peaks.map((e) => e.z));
|
|
44
|
-
partTag += `\n${xLabel}/${yLabel}, I=${intensity.toFixed(2)}\\`;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
str += partTag;
|
|
48
|
-
}
|
|
49
|
-
return str.length > 0 ? `${str}\n` : '';
|
|
50
|
-
}
|
|
51
|
-
exports.get2DSignals = get2DSignals;
|
|
52
|
-
function getAssignment(axis, labels, toFix) {
|
|
53
|
-
let { diaIDs, delta } = axis;
|
|
54
|
-
if (diaIDs) {
|
|
55
|
-
if (!isArray(diaIDs))
|
|
56
|
-
diaIDs = [diaIDs];
|
|
57
|
-
if (diaIDs.length < 1)
|
|
58
|
-
return Number(delta).toFixed(toFix);
|
|
59
|
-
let label = diaIDs.map((diaID) => labels[diaID].label).join(',');
|
|
60
|
-
return diaIDs.length > 1 ? `(${label})` : label;
|
|
61
|
-
}
|
|
62
|
-
return Number(delta).toFixed(toFix);
|
|
63
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getCouplingObserved = void 0;
|
|
4
|
-
function getCouplingObserved(experiment) {
|
|
5
|
-
switch (experiment.toLowerCase()) {
|
|
6
|
-
case 'hsqc':
|
|
7
|
-
case 'cosy':
|
|
8
|
-
return '1J';
|
|
9
|
-
case 'hmbc':
|
|
10
|
-
return 'NJ';
|
|
11
|
-
default:
|
|
12
|
-
return 'NJ';
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
exports.getCouplingObserved = getCouplingObserved;
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getLabels = void 0;
|
|
4
|
-
const openchemlib_utils_1 = require("openchemlib-utils");
|
|
5
|
-
const flat2DSignals_1 = require("./flat2DSignals");
|
|
6
|
-
const getToFix_1 = require("./getToFix");
|
|
7
|
-
function getLabels(data, options = { groupedDiaIDs: [] }) {
|
|
8
|
-
const { groupedDiaIDs, molecule } = options;
|
|
9
|
-
let connections = (0, openchemlib_utils_1.getShortestPaths)(molecule, { toLabel: 'H', maxLength: 1 });
|
|
10
|
-
let byDiaID = {};
|
|
11
|
-
let byAssignNumber = {};
|
|
12
|
-
for (let spectrum of data) {
|
|
13
|
-
let { dimension, nucleus } = spectrum.info;
|
|
14
|
-
let toFix = (0, getToFix_1.getToFix)(nucleus);
|
|
15
|
-
let [roiKey, flatSignals] = dimension > 1 ? ['zones', flat2DSignals_1.flat2DSignals] : ['ranges', (s) => s || []];
|
|
16
|
-
let rois = spectrum[roiKey].values || [];
|
|
17
|
-
for (let roi of rois) {
|
|
18
|
-
let signals = flatSignals(roi.signals);
|
|
19
|
-
for (let i = 0; i < signals.length; i++) {
|
|
20
|
-
let diaIDs = signals[i].diaIDs || [];
|
|
21
|
-
for (let diaID of diaIDs) {
|
|
22
|
-
let delta = Number(signals[i].delta).toFixed(toFix[i % dimension]);
|
|
23
|
-
// get atomLabel
|
|
24
|
-
let groupedOclID = groupedDiaIDs.find((dia) => {
|
|
25
|
-
if (dia.oclID === diaID)
|
|
26
|
-
return true;
|
|
27
|
-
return false;
|
|
28
|
-
});
|
|
29
|
-
// the addition of one in atom number it is because the atoms enumeration starts from zero
|
|
30
|
-
let labelOptions = {
|
|
31
|
-
atom: groupedOclID.atoms[0],
|
|
32
|
-
molecule,
|
|
33
|
-
connections,
|
|
34
|
-
atomLabel: groupedOclID.atomLabel,
|
|
35
|
-
};
|
|
36
|
-
byDiaID[diaID] = {
|
|
37
|
-
atoms: groupedOclID.atoms.map((e) => e + 1),
|
|
38
|
-
shift: delta,
|
|
39
|
-
label: createLabel(labelOptions),
|
|
40
|
-
};
|
|
41
|
-
for (let atom of groupedOclID.atoms) {
|
|
42
|
-
labelOptions.atom = atom;
|
|
43
|
-
byAssignNumber[atom] = {
|
|
44
|
-
shift: delta,
|
|
45
|
-
diaID,
|
|
46
|
-
label: createLabel(labelOptions),
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
return { byAssignNumber, byDiaID };
|
|
54
|
-
}
|
|
55
|
-
exports.getLabels = getLabels;
|
|
56
|
-
function createLabel(options) {
|
|
57
|
-
const { atom, molecule, atomLabel, connections } = options;
|
|
58
|
-
let label = '';
|
|
59
|
-
if (atomLabel !== 'C') {
|
|
60
|
-
let connectedTo = connections[atom];
|
|
61
|
-
let path = connectedTo.find((e) => e && e.length > 1);
|
|
62
|
-
let pLabel = `${atomLabel}${path[0] + 1}`;
|
|
63
|
-
let hLabel = `${molecule.getAtomLabel(path[1])}${path[1] + 1}`;
|
|
64
|
-
label = `${pLabel}${hLabel}`;
|
|
65
|
-
}
|
|
66
|
-
else {
|
|
67
|
-
label = `${atomLabel}${atom + 1}`;
|
|
68
|
-
}
|
|
69
|
-
return label;
|
|
70
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getToFix = void 0;
|
|
4
|
-
function getToFix(nucleusArray) {
|
|
5
|
-
if (!Array.isArray(nucleusArray))
|
|
6
|
-
nucleusArray = [nucleusArray];
|
|
7
|
-
let toFix = [];
|
|
8
|
-
for (let nucleus of nucleusArray) {
|
|
9
|
-
toFix.push(chooseDecimal(nucleus));
|
|
10
|
-
}
|
|
11
|
-
return toFix;
|
|
12
|
-
}
|
|
13
|
-
exports.getToFix = getToFix;
|
|
14
|
-
function chooseDecimal(nucleus) {
|
|
15
|
-
switch (nucleus.toUpperCase()) {
|
|
16
|
-
case '1H':
|
|
17
|
-
return 2;
|
|
18
|
-
case '13C':
|
|
19
|
-
return 1;
|
|
20
|
-
default:
|
|
21
|
-
return 1;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.reduce = exports.isApplicable = exports.apply = exports.name = exports.id = void 0;
|
|
4
|
-
exports.id = 'lineBroadening';
|
|
5
|
-
exports.name = 'Line broadening';
|
|
6
|
-
/**
|
|
7
|
-
*
|
|
8
|
-
* @param {Datum1d} datum1d
|
|
9
|
-
* @param {Object} [value]
|
|
10
|
-
*/
|
|
11
|
-
function apply(datum1D, value) {
|
|
12
|
-
if (!isApplicable(datum1D)) {
|
|
13
|
-
throw new Error('lineBroadening not applicable on this data');
|
|
14
|
-
}
|
|
15
|
-
let grpdly = datum1D.info?.digitalFilter || 0;
|
|
16
|
-
let pointsToShift;
|
|
17
|
-
if (grpdly > 0) {
|
|
18
|
-
pointsToShift = Math.floor(grpdly);
|
|
19
|
-
}
|
|
20
|
-
else {
|
|
21
|
-
pointsToShift = 0;
|
|
22
|
-
}
|
|
23
|
-
const re = datum1D.data.re;
|
|
24
|
-
const im = datum1D.data.im;
|
|
25
|
-
const t = datum1D.data.x;
|
|
26
|
-
const length = re.length;
|
|
27
|
-
const newRE = new Float64Array(length); // I don't think we need a new array... here
|
|
28
|
-
const newIM = new Float64Array(length);
|
|
29
|
-
//if (value !== 0) {// is it OK to skip this line if "value" is zero?
|
|
30
|
-
//please check this test of zero is correct !== or != ...
|
|
31
|
-
const dw = (t[length - 1] - t[0]) / (length - 1); //REPLACE CONSTANT with calculated value... : for this we need AQ or DW to set it right...
|
|
32
|
-
// convert line broadening in Hz into exponential coefficient:
|
|
33
|
-
const em = -value * Math.exp(1);
|
|
34
|
-
const coefExp = Math.exp(em * dw);
|
|
35
|
-
let curFactor = Math.exp(em * t[0]); // in case does not start at zero
|
|
36
|
-
for (let i = 0; i < length - pointsToShift; i++) {
|
|
37
|
-
newRE[i] = re[i] * curFactor;
|
|
38
|
-
newIM[i] = im[i] * curFactor;
|
|
39
|
-
curFactor = curFactor * coefExp;
|
|
40
|
-
}
|
|
41
|
-
curFactor = Math.exp(em * t[0]);
|
|
42
|
-
for (let i = length; i > length - pointsToShift; i--) {
|
|
43
|
-
newRE[i] = re[i] * curFactor;
|
|
44
|
-
newIM[i] = im[i] * curFactor;
|
|
45
|
-
curFactor = curFactor * coefExp;
|
|
46
|
-
}
|
|
47
|
-
datum1D.data = { ...datum1D.data, ...{ re: newRE, im: newIM } };
|
|
48
|
-
//}
|
|
49
|
-
}
|
|
50
|
-
exports.apply = apply;
|
|
51
|
-
function isApplicable(datum1D) {
|
|
52
|
-
if (datum1D.info.isComplex && datum1D.info.isFid)
|
|
53
|
-
return true;
|
|
54
|
-
return false;
|
|
55
|
-
}
|
|
56
|
-
exports.isApplicable = isApplicable;
|
|
57
|
-
function reduce(previousValue, newValue) {
|
|
58
|
-
return {
|
|
59
|
-
once: true,
|
|
60
|
-
reduce: newValue,
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
exports.reduce = reduce;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.migrate = exports.CURRENT_EXPORT_VERSION = void 0;
|
|
7
|
-
const migrateToVersion1_1 = __importDefault(require("./migrateToVersion1"));
|
|
8
|
-
const migrateToVersion2_1 = __importDefault(require("./migrateToVersion2"));
|
|
9
|
-
exports.CURRENT_EXPORT_VERSION = 2;
|
|
10
|
-
function migrationPipe(functions) {
|
|
11
|
-
return (input) => functions.reduce((input, func) => func(input), input);
|
|
12
|
-
}
|
|
13
|
-
function migrate(data) {
|
|
14
|
-
let migrationsFuncs = [
|
|
15
|
-
migrateToVersion1_1.default,
|
|
16
|
-
migrateToVersion2_1.default,
|
|
17
|
-
];
|
|
18
|
-
let index = data?.version || 0;
|
|
19
|
-
if (index > exports.CURRENT_EXPORT_VERSION) {
|
|
20
|
-
throw new Error('This file can not be imported using the current NMRium version, Please move to the new one !!! ');
|
|
21
|
-
}
|
|
22
|
-
return migrationPipe(migrationsFuncs.slice(index))(data);
|
|
23
|
-
}
|
|
24
|
-
exports.migrate = migrate;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.changeKeys = void 0;
|
|
4
|
-
function changeKeys(data, changedKeys) {
|
|
5
|
-
return JSON.parse(JSON.stringify(data), function reviver(key, value) {
|
|
6
|
-
if (key in changedKeys) {
|
|
7
|
-
this[changedKeys[key]] = value;
|
|
8
|
-
return;
|
|
9
|
-
}
|
|
10
|
-
return value;
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
exports.changeKeys = changeKeys;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const changeKeys_1 = require("./changeKeys");
|
|
4
|
-
/**
|
|
5
|
-
* changes from version 0 to version 1:
|
|
6
|
-
* all change done on objects keys naming
|
|
7
|
-
* j => js
|
|
8
|
-
* signal => signals
|
|
9
|
-
* integral => integration
|
|
10
|
-
* peak => peaks
|
|
11
|
-
* diaID => diaIDs
|
|
12
|
-
*
|
|
13
|
-
*/
|
|
14
|
-
function migrateToVersion1(data) {
|
|
15
|
-
if (data?.version === 1)
|
|
16
|
-
return data;
|
|
17
|
-
const newData = { ...data, version: 1 };
|
|
18
|
-
const changedKeys = {
|
|
19
|
-
j: 'js',
|
|
20
|
-
signal: 'signals',
|
|
21
|
-
integral: 'integration',
|
|
22
|
-
peak: 'peaks',
|
|
23
|
-
diaID: 'diaIDs',
|
|
24
|
-
};
|
|
25
|
-
for (const spectrum of newData.spectra) {
|
|
26
|
-
if (spectrum.ranges) {
|
|
27
|
-
spectrum.ranges = (0, changeKeys_1.changeKeys)(spectrum.ranges, changedKeys);
|
|
28
|
-
}
|
|
29
|
-
else if (spectrum.zones) {
|
|
30
|
-
spectrum.zones = (0, changeKeys_1.changeKeys)(spectrum.zones, changedKeys);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
return newData;
|
|
34
|
-
}
|
|
35
|
-
exports.default = migrateToVersion1;
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const changeKeys_1 = require("./changeKeys");
|
|
4
|
-
/*
|
|
5
|
-
* changes from version 1 to version 2:
|
|
6
|
-
1- peaks :
|
|
7
|
-
delta => x , originDelta => originalX, intensity => y,
|
|
8
|
-
paths:
|
|
9
|
-
- peak
|
|
10
|
-
|
|
11
|
-
2- range/signals :
|
|
12
|
-
atomIDs => atoms , intensity => y,
|
|
13
|
-
|
|
14
|
-
paths:
|
|
15
|
-
- range > signals
|
|
16
|
-
- range > signals > js
|
|
17
|
-
- range > signals > peaks
|
|
18
|
-
|
|
19
|
-
3- zone/signals :
|
|
20
|
-
we have two cases the
|
|
21
|
-
a)
|
|
22
|
-
get out the inner object fromTo:{from,to} => {from,to}
|
|
23
|
-
paths:
|
|
24
|
-
- zone > signals > x
|
|
25
|
-
- zone > signals > y
|
|
26
|
-
b)
|
|
27
|
-
{ fromTo,deltaX,resolutionX,nucleusX,deltaY,resolutionY,nucleusY,shiftX,shiftY} =>
|
|
28
|
-
{
|
|
29
|
-
x: {
|
|
30
|
-
from: fromTo[0].from,
|
|
31
|
-
to: fromTo[0].to,
|
|
32
|
-
delta: deltaX,
|
|
33
|
-
resolution: resolutionX,
|
|
34
|
-
nucleus: nucleusX,
|
|
35
|
-
},
|
|
36
|
-
y: {
|
|
37
|
-
from: fromTo[1].from,
|
|
38
|
-
to: fromTo[1].to,
|
|
39
|
-
delta: deltaY,
|
|
40
|
-
resolution: resolutionY,
|
|
41
|
-
nucleus: nucleusY,
|
|
42
|
-
},
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
paths:
|
|
46
|
-
-zone>signals
|
|
47
|
-
*/
|
|
48
|
-
function migrateToVersion2(data) {
|
|
49
|
-
if (data?.version === 2)
|
|
50
|
-
return data;
|
|
51
|
-
const newData = { ...data, version: 2 };
|
|
52
|
-
const changedKeys = {
|
|
53
|
-
peaks: {
|
|
54
|
-
delta: 'x',
|
|
55
|
-
originDelta: 'originalX',
|
|
56
|
-
intensity: 'y',
|
|
57
|
-
},
|
|
58
|
-
ranges: {
|
|
59
|
-
atomIDs: 'atoms',
|
|
60
|
-
intensity: 'y', // signal > peaks
|
|
61
|
-
},
|
|
62
|
-
};
|
|
63
|
-
for (const spectrum of newData.spectra) {
|
|
64
|
-
if (spectrum.peaks) {
|
|
65
|
-
spectrum.peaks = (0, changeKeys_1.changeKeys)(spectrum.peaks, changedKeys.peaks);
|
|
66
|
-
}
|
|
67
|
-
else if (spectrum.ranges) {
|
|
68
|
-
spectrum.ranges = (0, changeKeys_1.changeKeys)(spectrum.ranges, changedKeys.ranges);
|
|
69
|
-
}
|
|
70
|
-
else if (spectrum.zones) {
|
|
71
|
-
spectrum.zones.values = mapZones(spectrum.zones.values);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
return newData;
|
|
75
|
-
}
|
|
76
|
-
exports.default = migrateToVersion2;
|
|
77
|
-
function mapZones(zones) {
|
|
78
|
-
return zones.map((zone) => {
|
|
79
|
-
if (zone.signals) {
|
|
80
|
-
zone.signals = zone.signals.map((signal) => {
|
|
81
|
-
if (signal.x && signal.y) {
|
|
82
|
-
const { x: { fromTo: fromToX, ...resX }, y: { fromTo: fromToY, ...resY }, } = signal;
|
|
83
|
-
signal = {
|
|
84
|
-
...signal,
|
|
85
|
-
x: { ...resX, ...fromToX },
|
|
86
|
-
y: { ...resY, ...fromToY },
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
else {
|
|
90
|
-
const { fromTo, deltaX, resolutionX, nucleusX, deltaY, resolutionY, nucleusY, shiftX, shiftY, ...resSignal } = signal;
|
|
91
|
-
signal = {
|
|
92
|
-
...resSignal,
|
|
93
|
-
x: {
|
|
94
|
-
from: fromTo[0].from,
|
|
95
|
-
to: fromTo[0].to,
|
|
96
|
-
delta: deltaX,
|
|
97
|
-
resolution: resolutionX,
|
|
98
|
-
nucleus: nucleusX,
|
|
99
|
-
},
|
|
100
|
-
y: {
|
|
101
|
-
from: fromTo[1].from,
|
|
102
|
-
to: fromTo[1].to,
|
|
103
|
-
delta: deltaY,
|
|
104
|
-
resolution: resolutionY,
|
|
105
|
-
nucleus: nucleusY,
|
|
106
|
-
},
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
return signal;
|
|
110
|
-
}, []);
|
|
111
|
-
}
|
|
112
|
-
return zone;
|
|
113
|
-
}, []);
|
|
114
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const BASE62 = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
|
4
|
-
const LENGTH = 8;
|
|
5
|
-
function generateID() {
|
|
6
|
-
let id = '';
|
|
7
|
-
for (let i = 0; i < LENGTH; i++) {
|
|
8
|
-
id += BASE62.charAt(Math.floor(Math.random() * 62));
|
|
9
|
-
}
|
|
10
|
-
return id;
|
|
11
|
-
}
|
|
12
|
-
exports.default = generateID;
|