nmrium 0.34.0 → 0.35.0-pre.1683281080
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/component/1d/LinesSeries.js +4 -5
- package/lib/component/1d/jCouplingGraph/JsCouplings.d.ts +1 -1
- package/lib/component/1d/multiplicityTree/LevelNode.d.ts +1 -1
- package/lib/component/1d/multiplicityTree/MultiplicityTree.d.ts +5 -7
- package/lib/component/1d/multiplicityTree/MultiplicityTree.js +142 -160
- package/lib/component/1d/multiplicityTree/StringNode.d.ts +1 -1
- package/lib/component/1d/multiplicityTree/buildTreeNode.d.ts +1 -1
- package/lib/component/1d/peaks/usePeakShapesPath.d.ts +4 -4
- package/lib/component/1d/ranges/AssignmentActionsButtons.d.ts +11 -0
- package/lib/component/1d/ranges/AssignmentActionsButtons.js +11 -0
- package/lib/component/1d/ranges/Range.d.ts +3 -10
- package/lib/component/1d/ranges/Range.js +32 -45
- package/lib/component/1d/ranges/Ranges.js +1 -1
- package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.d.ts +1 -2
- package/lib/component/1d-2d/components/FloatMoleculeStructures/index.d.ts +1 -2
- package/lib/component/2d/1d-tracer/Left1DChart.d.ts +2 -2
- package/lib/component/2d/1d-tracer/Top1DChart.d.ts +2 -2
- package/lib/component/2d/Chart2D.d.ts +2 -2
- package/lib/component/2d/ft/Contours.js +13 -13
- package/lib/component/2d/ft/FTContainer.d.ts +2 -2
- package/lib/component/2d/zones/Signal.d.ts +1 -1
- package/lib/component/2d/zones/Signal.js +1 -2
- package/lib/component/2d/zones/SignalCrosshair.d.ts +1 -1
- package/lib/component/2d/zones/SignalCrosshair.js +0 -1
- package/lib/component/2d/zones/Zone.d.ts +2 -2
- package/lib/component/NMRium.d.ts +2 -5
- package/lib/component/NMRium.js +10 -2
- package/lib/component/assignment/AssignmentsReducer.d.ts +1 -2
- package/lib/component/assignment/actions/removeAssignment.js +2 -2
- package/lib/component/context/PreferencesContext.d.ts +10 -21
- package/lib/component/context/PreferencesContext.js +4 -7
- package/lib/component/elements/Button.d.ts +4 -2
- package/lib/component/elements/Button.js +26 -15
- package/lib/component/elements/Input.js +38 -46
- package/lib/component/elements/NumberInput.d.ts +4 -12
- package/lib/component/elements/NumberInput.js +10 -40
- package/lib/component/elements/ReactTable/Elements/ReactTableRow.d.ts +2 -4
- package/lib/component/elements/ReactTable/Elements/ReactTableRow.js +3 -2
- package/lib/component/elements/ReactTable/ReactTable.d.ts +7 -6
- package/lib/component/elements/ReactTable/ReactTable.js +3 -12
- package/lib/component/elements/ReactTable/Style.js +0 -8
- package/lib/component/elements/formik/FormikNumberInput.d.ts +1 -1
- package/lib/component/elements/formik/FormikNumberInput.js +13 -3
- package/lib/component/header/ApodizationOptionsPanel.js +2 -12
- package/lib/component/header/AutoPeakPickingOptionPanel.js +11 -15
- package/lib/component/header/BaseLineCorrectionPanel.js +2 -12
- package/lib/component/header/Header.js +2 -2
- package/lib/component/header/PhaseCorrectionPanel.d.ts +2 -0
- package/lib/component/header/{ManualPhaseCorrectionPanel.js → PhaseCorrectionPanel.js} +23 -22
- package/lib/component/header/RangesPickingOptionPanel.js +17 -28
- package/lib/component/header/ZeroFillingOptionsPanel.js +1 -2
- package/lib/component/header/Zones2DOptionPanel.js +16 -23
- package/lib/component/highlight/index.d.ts +2 -2
- package/lib/component/hooks/useCheckToolsVisibility.d.ts +1 -2
- package/lib/component/hooks/useDatumWithSpectraStatistics.d.ts +2 -3
- package/lib/component/hooks/useFilter.d.ts +1 -1
- package/lib/component/hooks/useSpectraPerNucleus.d.ts +2 -3
- package/lib/component/hooks/useSpectrum.d.ts +2 -3
- package/lib/component/modal/EditPeakShapeModal.d.ts +2 -2
- package/lib/component/modal/ExportAsJcampModal.d.ts +8 -0
- package/lib/component/modal/ExportAsJcampModal.js +62 -0
- package/lib/component/modal/MultipletAnalysisModal.d.ts +2 -2
- package/lib/component/modal/changeSum/ChangeSumModal.d.ts +1 -1
- package/lib/component/modal/editRange/EditRangeModal.js +1 -1
- package/lib/component/modal/editRange/forms/components/SignalsForm.d.ts +1 -1
- package/lib/component/modal/editZone/EditPathLengthFormik.js +11 -14
- package/lib/component/modal/editZone/EditZoneModal.js +1 -1
- package/lib/component/modal/setting/settings-tabs/ToolsTabContent.js +1 -1
- package/lib/component/panels/AutomaticAssignment/AutomaticAssignment.js +1 -1
- package/lib/component/panels/AutomaticAssignment/useAutoAssignments.d.ts +2 -2
- package/lib/component/panels/IntegralsPanel/IntegralPanel.d.ts +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralPanel.js +3 -3
- package/lib/component/panels/IntegralsPanel/IntegralTable.d.ts +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralsPreferences.js +8 -5
- package/lib/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +1 -1
- package/lib/component/panels/MoleculesPanel/Utilities.d.ts +2 -3
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +1 -1
- package/lib/component/panels/PanelNoData.d.ts +6 -0
- package/lib/component/panels/PanelNoData.js +24 -0
- package/lib/component/panels/PeaksPanel/PeaksPanel.d.ts +2 -2
- package/lib/component/panels/PeaksPanel/PeaksPanel.js +1 -1
- package/lib/component/panels/RangesPanel/RangesHeader.js +4 -4
- package/lib/component/panels/RangesPanel/RangesPanel.js +12 -7
- package/lib/component/panels/RangesPanel/RangesTable.d.ts +4 -5
- package/lib/component/panels/RangesPanel/RangesTable.js +4 -14
- package/lib/component/panels/RangesPanel/RangesTableRow.d.ts +5 -4
- package/lib/component/panels/RangesPanel/RangesTableRow.js +15 -11
- package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.d.ts +6 -5
- package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +37 -33
- package/lib/component/panels/RangesPanel/TableColumns/RemoveAssignmentsButton.d.ts +4 -0
- package/lib/component/panels/RangesPanel/TableColumns/RemoveAssignmentsButton.js +8 -0
- package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.d.ts +2 -3
- package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.js +6 -11
- package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaHzColumn.d.ts +1 -1
- package/lib/component/panels/RangesPanel/hooks/useMapRanges.d.ts +1 -1
- package/lib/component/panels/SpectrumsPanel/SpectraPanelHeader.js +1 -1
- package/lib/component/panels/SpectrumsPanel/SpectraTable.d.ts +3 -4
- package/lib/component/panels/SpectrumsPanel/SpectraTable.js +65 -17
- package/lib/component/panels/SpectrumsPanel/base/ColorIndicator.d.ts +1 -2
- package/lib/component/panels/SpectrumsPanel/base/ShowHideSpectrumButton.d.ts +3 -4
- package/lib/component/panels/SpectrumsPanel/base/SpectrumName.d.ts +2 -3
- package/lib/component/panels/SpectrumsPanel/base/setting/SpectrumSetting.js +0 -1
- package/lib/component/panels/SpectrumsPanel/base/setting/processSnapPlot.d.ts +2 -3
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +11 -8
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/EditPathLength.d.ts +1 -1
- package/lib/component/panels/SummaryPanel/utilities/Utilities.d.ts +4 -5
- package/lib/component/panels/ZonesPanel/ZonesPanel.js +1 -1
- package/lib/component/panels/ZonesPanel/ZonesTable.d.ts +1 -2
- package/lib/component/panels/ZonesPanel/ZonesTable.js +3 -13
- package/lib/component/panels/ZonesPanel/ZonesTableRow.d.ts +3 -3
- package/lib/component/panels/ZonesPanel/ZonesTableRow.js +3 -2
- package/lib/component/panels/databasePanel/DatabasePanel.js +77 -7
- package/lib/component/panels/databasePanel/DatabasePreferences.js +1 -1
- package/lib/component/panels/databasePanel/DatabaseTable.d.ts +2 -1
- package/lib/component/panels/databasePanel/DatabaseTable.js +17 -9
- package/lib/component/panels/filtersPanel/FiltersTable.js +16 -30
- package/lib/component/panels/header/DefaultPanelHeader.js +1 -1
- package/lib/component/panels/header/PreferencesHeader.js +1 -1
- package/lib/component/reducer/IgnoreActions.js +0 -1
- package/lib/component/reducer/Reducer.d.ts +4 -960
- package/lib/component/reducer/Reducer.js +3 -7
- package/lib/component/reducer/actions/AssignmentsActions.js +2 -4
- package/lib/component/reducer/actions/DatabaseActions.js +1 -1
- package/lib/component/reducer/actions/DomainActions.d.ts +5 -6
- package/lib/component/reducer/actions/DomainActions.js +17 -11
- package/lib/component/reducer/actions/FiltersActions.d.ts +14 -19
- package/lib/component/reducer/actions/FiltersActions.js +257 -152
- package/lib/component/reducer/actions/LoadActions.d.ts +2 -3
- package/lib/component/reducer/actions/LoadActions.js +1 -1
- package/lib/component/reducer/actions/PeaksActions.d.ts +1 -1
- package/lib/component/reducer/actions/PeaksActions.js +6 -2
- package/lib/component/reducer/actions/PreferencesActions.js +3 -0
- package/lib/component/reducer/actions/RangesActions.d.ts +1 -1
- package/lib/component/reducer/actions/RangesActions.js +19 -11
- package/lib/component/reducer/actions/SpectrumsActions.js +15 -13
- package/lib/component/reducer/actions/ToolsActions.d.ts +6 -2
- package/lib/component/reducer/actions/ToolsActions.js +41 -38
- package/lib/component/reducer/actions/ZonesActions.d.ts +1 -1
- package/lib/component/reducer/actions/ZonesActions.js +7 -3
- package/lib/component/reducer/helper/ZoomHistoryManager.d.ts +1 -1
- package/lib/component/reducer/helper/ZoomHistoryManager.js +6 -3
- package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js +1 -0
- package/lib/component/reducer/preferences/preferencesReducer.d.ts +3 -4843
- package/lib/component/reducer/preferences/preferencesReducer.js +1 -4
- package/lib/component/reducer/types/Types.d.ts +0 -2
- package/lib/component/reducer/types/Types.js +0 -2
- package/lib/component/toolbar/BasicToolBar.js +3 -3
- package/lib/component/toolbar/FunctionToolBar.js +2 -2
- package/lib/component/toolbar/ToolTypes.d.ts +1 -2
- package/lib/component/toolbar/ToolTypes.js +13 -13
- package/lib/component/utility/getSpectraByNucleus.d.ts +2 -3
- package/lib/component/utility/getSpectraObjectPaths.d.ts +2 -3
- package/lib/component/workspaces/Workspace.d.ts +1 -0
- package/lib/component/workspaces/assignment.js +1 -1
- package/lib/component/workspaces/basic.js +1 -1
- package/lib/component/workspaces/embedded.js +1 -1
- package/lib/component/workspaces/exercise.js +1 -1
- package/lib/component/workspaces/prediction.js +1 -1
- package/lib/component/workspaces/process1D.js +1 -1
- package/lib/component/workspaces/workspaceDefaultProperties.js +1 -1
- package/lib/data/Filters.d.ts +0 -4
- package/lib/data/Filters.js +0 -4
- package/lib/data/FiltersManager.d.ts +17 -5
- package/lib/data/FiltersManager.js +21 -14
- package/lib/data/PredictionManager.d.ts +2 -3
- package/lib/data/SpectraManager.d.ts +11 -0
- package/lib/data/SpectraManager.js +47 -5
- package/lib/data/data1d/Spectrum1D/SumManager.d.ts +1 -2
- package/lib/data/data1d/Spectrum1D/convertDataToFloat64Array.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/generateJGraphData.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/generateSpectrumFromPublicationString.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/get1DDataXY.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/getShiftX.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/getShiftX.js +3 -3
- package/lib/data/data1d/Spectrum1D/getSpectrumErrorValue.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/getSpectrumErrorValue.js +2 -2
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +16 -17
- package/lib/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.js +7 -7
- package/lib/data/data1d/Spectrum1D/integrals/checkIntegralKind.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/integrals/initiateIntegrals.d.ts +3 -3
- package/lib/data/data1d/Spectrum1D/integrals/initiateIntegrals.js +2 -2
- package/lib/data/data1d/Spectrum1D/integrals/mapIntegrals.d.ts +3 -4
- package/lib/data/data1d/Spectrum1D/integrals/mapIntegrals.js +3 -3
- package/lib/data/data1d/Spectrum1D/integrals/updateIntegrals.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/integrals/updateIntegrals.js +3 -3
- package/lib/data/data1d/Spectrum1D/integrals/updateIntegralsRelativeValues.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/integrals/updateIntegralsRelativeValues.js +2 -2
- package/lib/data/data1d/Spectrum1D/integrals/updateRelatives.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/isRangeAssigned.d.ts +2 -0
- package/lib/data/data1d/Spectrum1D/isRangeAssigned.js +10 -0
- package/lib/data/data1d/Spectrum1D/isSpectrum1D.d.ts +2 -3
- package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +5 -5
- package/lib/data/data1d/Spectrum1D/peaks/initiatePeaks.d.ts +3 -3
- package/lib/data/data1d/Spectrum1D/peaks/initiatePeaks.js +2 -2
- package/lib/data/data1d/Spectrum1D/peaks/lookupPeak.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.js +7 -7
- package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.d.ts +3 -3
- package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.js +5 -5
- package/lib/data/data1d/Spectrum1D/peaks/updatePeaks.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/peaks/updatePeaks.js +2 -2
- package/lib/data/data1d/Spectrum1D/ranges/addRange.d.ts +8 -9
- package/lib/data/data1d/Spectrum1D/ranges/addRange.js +13 -7
- package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.js +3 -3
- package/lib/data/data1d/Spectrum1D/ranges/changeRange.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/ranges/changeRange.js +13 -7
- package/lib/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.d.ts +3 -3
- package/lib/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.js +9 -9
- package/lib/data/data1d/Spectrum1D/ranges/changeRangeSignal.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/ranges/changeRangeSignal.js +6 -5
- package/lib/data/data1d/Spectrum1D/ranges/checkRangeKind.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectRange.d.ts +3 -2
- package/lib/data/data1d/Spectrum1D/ranges/detectRange.js +3 -3
- package/lib/data/data1d/Spectrum1D/ranges/detectRanges.d.ts +10 -9
- package/lib/data/data1d/Spectrum1D/ranges/detectRanges.js +6 -6
- package/lib/data/data1d/Spectrum1D/ranges/detectSignal.d.ts +1 -0
- package/lib/data/data1d/Spectrum1D/ranges/detectSignal.js +1 -0
- package/lib/data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.d.ts +7 -7
- package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.js +2 -2
- package/lib/data/data1d/Spectrum1D/ranges/mapRanges.d.ts +7 -7
- package/lib/data/data1d/Spectrum1D/ranges/mapRanges.js +7 -7
- package/lib/data/data1d/Spectrum1D/ranges/updateRanges.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/ranges/updateRanges.js +3 -3
- package/lib/data/data1d/Spectrum1D/ranges/updateRangesRelativeValues.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/ranges/updateRangesRelativeValues.js +2 -2
- package/lib/data/data1d/filter1d/apodization.d.ts +8 -6
- package/lib/data/data1d/filter1d/apodization.js +4 -0
- package/lib/data/data1d/filter1d/baselineCorrection.d.ts +6 -4
- package/lib/data/data1d/filter1d/baselineCorrection.js +4 -0
- package/lib/data/data1d/filter1d/digitalFilter.d.ts +7 -6
- package/lib/data/data1d/filter1d/digitalFilter.js +15 -11
- package/lib/data/data1d/filter1d/equallySpaced.d.ts +5 -5
- package/lib/data/data1d/filter1d/equallySpaced.js +10 -10
- package/lib/data/data1d/filter1d/exclusionZones.d.ts +7 -5
- package/lib/data/data1d/filter1d/exclusionZones.js +13 -9
- package/lib/data/data1d/filter1d/fft.d.ts +6 -4
- package/lib/data/data1d/filter1d/fft.js +27 -23
- package/lib/data/data1d/filter1d/phaseCorrection.d.ts +6 -5
- package/lib/data/data1d/filter1d/phaseCorrection.js +22 -17
- package/lib/data/data1d/filter1d/shiftX.d.ts +5 -3
- package/lib/data/data1d/filter1d/shiftX.js +7 -3
- package/lib/data/data1d/filter1d/signalProcessing.d.ts +7 -5
- package/lib/data/data1d/filter1d/signalProcessing.js +15 -11
- package/lib/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.d.ts +2 -2
- package/lib/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +6 -6
- package/lib/data/data1d/filter1d/zeroFilling.d.ts +7 -6
- package/lib/data/data1d/filter1d/zeroFilling.js +15 -11
- package/lib/data/data1d/multipleSpectraAnalysis.d.ts +4 -5
- package/lib/data/data2d/Spectrum2D/contours.d.ts +2 -2
- package/lib/data/data2d/Spectrum2D/contours.js +5 -4
- package/lib/data/data2d/Spectrum2D/get2DColor.d.ts +1 -1
- package/lib/data/data2d/Spectrum2D/get2DSpectrumErrorValue.d.ts +2 -2
- package/lib/data/data2d/Spectrum2D/get2DSpectrumErrorValue.js +2 -2
- package/lib/data/data2d/Spectrum2D/getMissingProjection.d.ts +2 -3
- package/lib/data/data2d/Spectrum2D/getShift.d.ts +2 -2
- package/lib/data/data2d/Spectrum2D/getShift.js +3 -3
- package/lib/data/data2d/Spectrum2D/getSlice.d.ts +4 -4
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.d.ts +2 -2
- package/lib/data/data2d/Spectrum2D/isSpectrum2D.d.ts +2 -3
- package/lib/data/data2d/Spectrum2D/zones/changeZoneSignal.d.ts +2 -2
- package/lib/data/data2d/Spectrum2D/zones/changeZoneSignal.js +4 -4
- package/lib/data/data2d/Spectrum2D/zones/detectZones.d.ts +1 -1
- package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.d.ts +4 -10
- package/lib/data/data2d/Spectrum2D/zones/getDetectionZones.d.ts +2 -2
- package/lib/data/data2d/Spectrum2D/zones/getDetectionZones.js +4 -4
- package/lib/data/data2d/Spectrum2D/zones/initiateZones.d.ts +6 -12
- package/lib/data/data2d/Spectrum2D/zones/initiateZones.js +2 -2
- package/lib/data/data2d/Spectrum2D/zones/isZoneExists.d.ts +2 -2
- package/lib/data/data2d/Spectrum2D/zones/isZoneExists.js +3 -3
- package/lib/data/data2d/Spectrum2D/zones/mapZones.d.ts +6 -12
- package/lib/data/data2d/Spectrum2D/zones/mapZones.js +1 -0
- package/lib/data/data2d/Spectrum2D/zones/updateZones.d.ts +2 -2
- package/lib/data/data2d/Spectrum2D/zones/updateZones.js +2 -2
- package/lib/data/data2d/filter2d/shiftX.d.ts +6 -4
- package/lib/data/data2d/filter2d/shiftX.js +10 -6
- package/lib/data/data2d/filter2d/shiftY.d.ts +5 -3
- package/lib/data/data2d/filter2d/shiftY.js +5 -1
- package/lib/data/getDefaultMatrixFilters.d.ts +1 -1
- package/lib/data/molecules/MoleculeManager.d.ts +1 -1
- package/lib/data/molecules/MoleculeManager.js +2 -2
- package/lib/data/parseMeta/linkMetaWithSpectra.d.ts +2 -3
- package/lib/data/types/common/Info.d.ts +1 -0
- package/lib/data/types/data1d/ComplexData1D.d.ts +1 -1
- package/lib/data/types/data1d/RangeDetectionResult.d.ts +1 -1
- package/lib/data/types/data1d/index.d.ts +0 -11
- package/lib/data/types/data2d/index.d.ts +0 -7
- package/lib/data/utilities/FindUtilities.d.ts +7 -9
- package/lib/data/utilities/RangeUtilities.d.ts +7 -2
- package/lib/data/utilities/RangeUtilities.js +9 -16
- package/lib/data/utilities/ZoneUtilities.d.ts +1 -1
- package/lib/data/utilities/ZoneUtilities.js +6 -6
- package/lib/data/utilities/calculateSanPlot.d.ts +2 -3
- package/lib/data/utilities/convertSpectraListToObject.d.ts +2 -3
- package/lib/data/utilities/generateColor.d.ts +1 -1
- package/lib/types/NMRiumDataReturn.d.ts +2 -3
- package/lib/types/NMRiumToolBarPreferences.d.ts +1 -1
- package/lib/versionInfo.js +1 -1
- package/lib-cjs/component/1d/LinesSeries.js +4 -5
- package/lib-cjs/component/1d/multiplicityTree/MultiplicityTree.js +144 -160
- package/lib-cjs/component/1d/ranges/AssignmentActionsButtons.js +18 -0
- package/lib-cjs/component/1d/ranges/Range.js +31 -44
- package/lib-cjs/component/1d/ranges/Ranges.js +1 -1
- package/lib-cjs/component/2d/ft/Contours.js +13 -13
- package/lib-cjs/component/2d/zones/Signal.js +1 -2
- package/lib-cjs/component/2d/zones/SignalCrosshair.js +0 -1
- package/lib-cjs/component/NMRium.js +10 -2
- package/lib-cjs/component/assignment/actions/removeAssignment.js +2 -2
- package/lib-cjs/component/context/PreferencesContext.js +4 -7
- package/lib-cjs/component/elements/Button.js +26 -15
- package/lib-cjs/component/elements/Input.js +37 -45
- package/lib-cjs/component/elements/NumberInput.js +8 -38
- package/lib-cjs/component/elements/ReactTable/Elements/ReactTableRow.js +3 -2
- package/lib-cjs/component/elements/ReactTable/ReactTable.js +3 -12
- package/lib-cjs/component/elements/ReactTable/Style.js +0 -8
- package/lib-cjs/component/elements/formik/FormikNumberInput.js +13 -3
- package/lib-cjs/component/header/ApodizationOptionsPanel.js +1 -11
- package/lib-cjs/component/header/AutoPeakPickingOptionPanel.js +33 -14
- package/lib-cjs/component/header/BaseLineCorrectionPanel.js +1 -11
- package/lib-cjs/component/header/Header.js +2 -2
- package/lib-cjs/component/header/{ManualPhaseCorrectionPanel.js → PhaseCorrectionPanel.js} +24 -23
- package/lib-cjs/component/header/RangesPickingOptionPanel.js +38 -26
- package/lib-cjs/component/header/ZeroFillingOptionsPanel.js +0 -1
- package/lib-cjs/component/header/Zones2DOptionPanel.js +37 -21
- package/lib-cjs/component/modal/ExportAsJcampModal.js +67 -0
- package/lib-cjs/component/modal/editRange/EditRangeModal.js +1 -1
- package/lib-cjs/component/modal/editZone/EditPathLengthFormik.js +11 -14
- package/lib-cjs/component/modal/editZone/EditZoneModal.js +1 -1
- package/lib-cjs/component/modal/setting/settings-tabs/ToolsTabContent.js +1 -1
- package/lib-cjs/component/panels/AutomaticAssignment/AutomaticAssignment.js +1 -1
- package/lib-cjs/component/panels/IntegralsPanel/IntegralPanel.js +3 -3
- package/lib-cjs/component/panels/IntegralsPanel/IntegralsPreferences.js +8 -5
- package/lib-cjs/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +1 -1
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +1 -1
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +1 -1
- package/lib-cjs/component/panels/PanelNoData.js +28 -0
- package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +1 -1
- package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +4 -4
- package/lib-cjs/component/panels/RangesPanel/RangesPanel.js +12 -7
- package/lib-cjs/component/panels/RangesPanel/RangesTable.js +4 -14
- package/lib-cjs/component/panels/RangesPanel/RangesTableRow.js +15 -10
- package/lib-cjs/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +36 -32
- package/lib-cjs/component/panels/RangesPanel/TableColumns/RemoveAssignmentsButton.js +12 -0
- package/lib-cjs/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.js +6 -11
- package/lib-cjs/component/panels/SpectrumsPanel/SpectraPanelHeader.js +1 -1
- package/lib-cjs/component/panels/SpectrumsPanel/SpectraTable.js +63 -15
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/SpectrumSetting.js +0 -1
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +11 -8
- package/lib-cjs/component/panels/ZonesPanel/ZonesPanel.js +1 -1
- package/lib-cjs/component/panels/ZonesPanel/ZonesTable.js +2 -12
- package/lib-cjs/component/panels/ZonesPanel/ZonesTableRow.js +3 -2
- package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +76 -6
- package/lib-cjs/component/panels/databasePanel/DatabasePreferences.js +1 -1
- package/lib-cjs/component/panels/databasePanel/DatabaseTable.js +15 -7
- package/lib-cjs/component/panels/filtersPanel/FiltersTable.js +16 -30
- package/lib-cjs/component/panels/header/DefaultPanelHeader.js +1 -1
- package/lib-cjs/component/panels/header/PreferencesHeader.js +1 -1
- package/lib-cjs/component/reducer/IgnoreActions.js +0 -1
- package/lib-cjs/component/reducer/Reducer.js +3 -7
- package/lib-cjs/component/reducer/actions/AssignmentsActions.js +2 -4
- package/lib-cjs/component/reducer/actions/DatabaseActions.js +1 -1
- package/lib-cjs/component/reducer/actions/DomainActions.js +17 -11
- package/lib-cjs/component/reducer/actions/FiltersActions.js +257 -153
- package/lib-cjs/component/reducer/actions/LoadActions.js +1 -1
- package/lib-cjs/component/reducer/actions/PeaksActions.js +6 -2
- package/lib-cjs/component/reducer/actions/PreferencesActions.js +3 -0
- package/lib-cjs/component/reducer/actions/RangesActions.js +19 -11
- package/lib-cjs/component/reducer/actions/SpectrumsActions.js +13 -11
- package/lib-cjs/component/reducer/actions/ToolsActions.js +38 -35
- package/lib-cjs/component/reducer/actions/ZonesActions.js +7 -3
- package/lib-cjs/component/reducer/helper/ZoomHistoryManager.js +6 -3
- package/lib-cjs/component/reducer/preferences/panelsPreferencesDefaultValues.js +1 -0
- package/lib-cjs/component/reducer/preferences/preferencesReducer.js +1 -4
- package/lib-cjs/component/reducer/types/Types.js +2 -4
- package/lib-cjs/component/toolbar/BasicToolBar.js +3 -3
- package/lib-cjs/component/toolbar/FunctionToolBar.js +2 -2
- package/lib-cjs/component/toolbar/ToolTypes.js +13 -13
- package/lib-cjs/component/workspaces/assignment.js +1 -1
- package/lib-cjs/component/workspaces/basic.js +1 -1
- package/lib-cjs/component/workspaces/embedded.js +1 -1
- package/lib-cjs/component/workspaces/exercise.js +1 -1
- package/lib-cjs/component/workspaces/prediction.js +1 -1
- package/lib-cjs/component/workspaces/process1D.js +1 -1
- package/lib-cjs/component/workspaces/workspaceDefaultProperties.js +1 -1
- package/lib-cjs/data/Filters.js +1 -5
- package/lib-cjs/data/FiltersManager.js +22 -14
- package/lib-cjs/data/SpectraManager.js +48 -5
- package/lib-cjs/data/data1d/Spectrum1D/get1DDataXY.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/getShiftX.js +3 -3
- package/lib-cjs/data/data1d/Spectrum1D/getSpectrumErrorValue.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +16 -17
- package/lib-cjs/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.js +7 -7
- package/lib-cjs/data/data1d/Spectrum1D/integrals/initiateIntegrals.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/integrals/mapIntegrals.js +3 -3
- package/lib-cjs/data/data1d/Spectrum1D/integrals/updateIntegrals.js +3 -3
- package/lib-cjs/data/data1d/Spectrum1D/integrals/updateIntegralsRelativeValues.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/isRangeAssigned.js +14 -0
- package/lib-cjs/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +5 -5
- package/lib-cjs/data/data1d/Spectrum1D/peaks/initiatePeaks.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/peaks/mapPeaks.js +7 -7
- package/lib-cjs/data/data1d/Spectrum1D/peaks/optimizePeaks.js +5 -5
- package/lib-cjs/data/data1d/Spectrum1D/peaks/updatePeaks.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/ranges/addRange.js +13 -7
- package/lib-cjs/data/data1d/Spectrum1D/ranges/autoRangesDetection.js +3 -3
- package/lib-cjs/data/data1d/Spectrum1D/ranges/changeRange.js +13 -7
- package/lib-cjs/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.js +9 -9
- package/lib-cjs/data/data1d/Spectrum1D/ranges/changeRangeSignal.js +6 -5
- package/lib-cjs/data/data1d/Spectrum1D/ranges/detectRange.js +3 -3
- package/lib-cjs/data/data1d/Spectrum1D/ranges/detectRanges.js +6 -6
- package/lib-cjs/data/data1d/Spectrum1D/ranges/detectSignal.js +1 -0
- package/lib-cjs/data/data1d/Spectrum1D/ranges/initiateRanges.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/ranges/mapRanges.js +7 -7
- package/lib-cjs/data/data1d/Spectrum1D/ranges/updateRanges.js +3 -3
- package/lib-cjs/data/data1d/Spectrum1D/ranges/updateRangesRelativeValues.js +2 -2
- package/lib-cjs/data/data1d/filter1d/apodization.js +5 -1
- package/lib-cjs/data/data1d/filter1d/baselineCorrection.js +5 -1
- package/lib-cjs/data/data1d/filter1d/digitalFilter.js +16 -12
- package/lib-cjs/data/data1d/filter1d/equallySpaced.js +10 -10
- package/lib-cjs/data/data1d/filter1d/exclusionZones.js +14 -10
- package/lib-cjs/data/data1d/filter1d/fft.js +27 -23
- package/lib-cjs/data/data1d/filter1d/phaseCorrection.js +23 -18
- package/lib-cjs/data/data1d/filter1d/shiftX.js +8 -4
- package/lib-cjs/data/data1d/filter1d/signalProcessing.js +16 -12
- package/lib-cjs/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +6 -6
- package/lib-cjs/data/data1d/filter1d/zeroFilling.js +16 -12
- package/lib-cjs/data/data2d/Spectrum2D/contours.js +5 -4
- package/lib-cjs/data/data2d/Spectrum2D/get2DSpectrumErrorValue.js +2 -2
- package/lib-cjs/data/data2d/Spectrum2D/getShift.js +3 -3
- package/lib-cjs/data/data2d/Spectrum2D/zones/changeZoneSignal.js +4 -4
- package/lib-cjs/data/data2d/Spectrum2D/zones/getDetectionZones.js +4 -4
- package/lib-cjs/data/data2d/Spectrum2D/zones/initiateZones.js +2 -2
- package/lib-cjs/data/data2d/Spectrum2D/zones/isZoneExists.js +3 -3
- package/lib-cjs/data/data2d/Spectrum2D/zones/mapZones.js +1 -0
- package/lib-cjs/data/data2d/Spectrum2D/zones/updateZones.js +2 -2
- package/lib-cjs/data/data2d/filter2d/shiftX.js +11 -7
- package/lib-cjs/data/data2d/filter2d/shiftY.js +6 -2
- package/lib-cjs/data/molecules/MoleculeManager.js +2 -2
- package/lib-cjs/data/utilities/RangeUtilities.js +9 -16
- package/lib-cjs/data/utilities/ZoneUtilities.js +6 -6
- package/lib-cjs/versionInfo.js +1 -1
- package/package.json +37 -36
- package/lib/component/header/ManualPhaseCorrectionPanel.d.ts +0 -2
- package/lib/data/data1d/filter1d/centerMean.d.ts +0 -13
- package/lib/data/data1d/filter1d/centerMean.js +0 -37
- package/lib/data/data1d/filter1d/fromTo.d.ts +0 -13
- package/lib/data/data1d/filter1d/fromTo.js +0 -31
- package/lib/data/data1d/filter1d/pareto.d.ts +0 -13
- package/lib/data/data1d/filter1d/pareto.js +0 -29
- package/lib/data/data1d/filter1d/standardDeviation.d.ts +0 -13
- package/lib/data/data1d/filter1d/standardDeviation.js +0 -37
- package/lib/data/types/data1d/Data1D.d.ts +0 -5
- package/lib/data/types/data1d/Data1D.js +0 -1
- package/lib/data/types/data1d/Datum1D.d.ts +0 -23
- package/lib/data/types/data1d/Datum1D.js +0 -1
- package/lib/data/types/data1d/Display1D.d.ts +0 -5
- package/lib/data/types/data1d/Display1D.js +0 -1
- package/lib/data/types/data1d/Info1D.d.ts +0 -8
- package/lib/data/types/data1d/Info1D.js +0 -1
- package/lib/data/types/data1d/Integral.d.ts +0 -10
- package/lib/data/types/data1d/Integral.js +0 -1
- package/lib/data/types/data1d/Integrals.d.ts +0 -6
- package/lib/data/types/data1d/Integrals.js +0 -1
- package/lib/data/types/data1d/Peak.d.ts +0 -5
- package/lib/data/types/data1d/Peak.js +0 -1
- package/lib/data/types/data1d/Peaks.d.ts +0 -5
- package/lib/data/types/data1d/Peaks.js +0 -1
- package/lib/data/types/data1d/Range.d.ts +0 -11
- package/lib/data/types/data1d/Range.js +0 -1
- package/lib/data/types/data1d/Ranges.d.ts +0 -6
- package/lib/data/types/data1d/Ranges.js +0 -1
- package/lib/data/types/data1d/Signal1D.d.ts +0 -5
- package/lib/data/types/data1d/Signal1D.js +0 -1
- package/lib/data/types/data1d/SumOptions.d.ts +0 -7
- package/lib/data/types/data1d/SumOptions.js +0 -1
- package/lib/data/types/data2d/Data2D.d.ts +0 -20
- package/lib/data/types/data2d/Data2D.js +0 -1
- package/lib/data/types/data2d/Datum2D.d.ts +0 -19
- package/lib/data/types/data2d/Datum2D.js +0 -1
- package/lib/data/types/data2d/Display2D.d.ts +0 -11
- package/lib/data/types/data2d/Display2D.js +0 -1
- package/lib/data/types/data2d/Info2D.d.ts +0 -5
- package/lib/data/types/data2d/Info2D.js +0 -1
- package/lib/data/types/data2d/Signal2D.d.ts +0 -7
- package/lib/data/types/data2d/Signal2D.js +0 -1
- package/lib/data/types/data2d/Signal2DAxisData.d.ts +0 -4
- package/lib/data/types/data2d/Signal2DAxisData.js +0 -1
- package/lib/data/types/data2d/Zone.d.ts +0 -9
- package/lib/data/types/data2d/Zone.js +0 -1
- package/lib/data/types/data2d/Zone2DAxisData.d.ts +0 -6
- package/lib/data/types/data2d/Zone2DAxisData.js +0 -1
- package/lib/data/types/data2d/Zones.d.ts +0 -7
- package/lib/data/types/data2d/Zones.js +0 -1
- package/lib-cjs/data/data1d/filter1d/centerMean.js +0 -43
- package/lib-cjs/data/data1d/filter1d/fromTo.js +0 -37
- package/lib-cjs/data/data1d/filter1d/pareto.js +0 -35
- package/lib-cjs/data/data1d/filter1d/standardDeviation.js +0 -43
- package/lib-cjs/data/types/data1d/Data1D.js +0 -2
- package/lib-cjs/data/types/data1d/Datum1D.js +0 -2
- package/lib-cjs/data/types/data1d/Display1D.js +0 -2
- package/lib-cjs/data/types/data1d/Info1D.js +0 -2
- package/lib-cjs/data/types/data1d/Integral.js +0 -2
- package/lib-cjs/data/types/data1d/Integrals.js +0 -2
- package/lib-cjs/data/types/data1d/Peak.js +0 -2
- package/lib-cjs/data/types/data1d/Peaks.js +0 -2
- package/lib-cjs/data/types/data1d/Range.js +0 -2
- package/lib-cjs/data/types/data1d/Ranges.js +0 -2
- package/lib-cjs/data/types/data1d/Signal1D.js +0 -2
- package/lib-cjs/data/types/data1d/SumOptions.js +0 -2
- package/lib-cjs/data/types/data2d/Data2D.js +0 -2
- package/lib-cjs/data/types/data2d/Datum2D.js +0 -2
- package/lib-cjs/data/types/data2d/Display2D.js +0 -2
- package/lib-cjs/data/types/data2d/Info2D.js +0 -2
- package/lib-cjs/data/types/data2d/Signal2D.js +0 -2
- package/lib-cjs/data/types/data2d/Signal2DAxisData.js +0 -2
- package/lib-cjs/data/types/data2d/Zone.js +0 -2
- package/lib-cjs/data/types/data2d/Zone2DAxisData.js +0 -2
- package/lib-cjs/data/types/data2d/Zones.js +0 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { Spectrum1D } from 'nmr-load-save';
|
|
1
2
|
import { UsedColors } from '../../../types/UsedColors';
|
|
2
|
-
import { Datum1D } from '../../types/data1d/Datum1D';
|
|
3
3
|
export interface InitiateDatum1DOptions {
|
|
4
4
|
usedColors?: UsedColors;
|
|
5
5
|
filters?: any[];
|
|
6
6
|
}
|
|
7
|
-
export declare function initiateDatum1D(spectrum: any, options?: InitiateDatum1DOptions):
|
|
7
|
+
export declare function initiateDatum1D(spectrum: any, options?: InitiateDatum1DOptions): Spectrum1D;
|
|
@@ -8,38 +8,37 @@ import { initiatePeaks } from './peaks/initiatePeaks';
|
|
|
8
8
|
import { initiateRanges } from './ranges/initiateRanges';
|
|
9
9
|
export function initiateDatum1D(spectrum, options = {}) {
|
|
10
10
|
const { usedColors = {}, filters = [] } = options;
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
datum.display = {
|
|
11
|
+
const spectrumObj = {};
|
|
12
|
+
spectrumObj.id = spectrum.id || v4();
|
|
13
|
+
spectrumObj.display = {
|
|
15
14
|
isVisible: true,
|
|
16
15
|
isRealSpectrumVisible: true,
|
|
17
16
|
...spectrum.display,
|
|
18
17
|
...get1DColor(spectrum, usedColors),
|
|
19
18
|
};
|
|
20
|
-
|
|
19
|
+
spectrumObj.info = {
|
|
21
20
|
nucleus: '1H',
|
|
22
21
|
isFid: false,
|
|
23
22
|
isComplex: false,
|
|
24
23
|
dimension: 1,
|
|
25
24
|
...spectrum.info,
|
|
26
25
|
};
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
26
|
+
spectrumObj.originalInfo = spectrumObj.info;
|
|
27
|
+
spectrumObj.meta = { ...spectrum.meta };
|
|
28
|
+
spectrumObj.metaInfo = { ...spectrum.metaInfo };
|
|
29
|
+
spectrumObj.data = convertDataToFloat64Array(spectrum.data);
|
|
30
|
+
spectrumObj.originalData = spectrumObj.data;
|
|
31
|
+
spectrumObj.filters = Object.assign([], spectrum.filters); //array of object {name: "FilterName", options: FilterOptions = {value | object} }
|
|
32
|
+
spectrumObj.peaks = initiatePeaks(spectrum, spectrumObj);
|
|
34
33
|
// array of object {index: xIndex, xShift}
|
|
35
34
|
// in case the peak does not exactly correspond to the point value
|
|
36
35
|
// we can think about a second attributed `xShift`
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
spectrumObj.integrals = initiateIntegrals(spectrum, spectrumObj); // array of object (from: xIndex, to: xIndex)
|
|
37
|
+
spectrumObj.ranges = initiateRanges(spectrum, spectrumObj);
|
|
39
38
|
//reapply filters after load the original data
|
|
40
|
-
FiltersManager.reapplyFilters(
|
|
41
|
-
preprocessing(
|
|
42
|
-
return
|
|
39
|
+
FiltersManager.reapplyFilters(spectrumObj);
|
|
40
|
+
preprocessing(spectrumObj, filters);
|
|
41
|
+
return spectrumObj;
|
|
43
42
|
}
|
|
44
43
|
function preprocessing(datum, onLoadFilters = []) {
|
|
45
44
|
if (datum.info.isFid) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function changeIntegralsRelative(
|
|
1
|
+
import { Spectrum1D } from 'nmr-load-save';
|
|
2
|
+
export declare function changeIntegralsRelative(spectrum: Spectrum1D, newIntegral: {
|
|
3
3
|
id: string;
|
|
4
4
|
value: number;
|
|
5
5
|
}): void;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export function changeIntegralsRelative(
|
|
2
|
-
const index =
|
|
1
|
+
export function changeIntegralsRelative(spectrum, newIntegral) {
|
|
2
|
+
const index = spectrum.integrals.values.findIndex((integral) => integral.id === newIntegral.id);
|
|
3
3
|
if (index !== -1) {
|
|
4
|
-
const ratio =
|
|
4
|
+
const ratio = spectrum.integrals.values[index].absolute / newIntegral.value;
|
|
5
5
|
const result = { values: [], sum: 0 };
|
|
6
|
-
for (const [index, integral] of
|
|
6
|
+
for (const [index, integral] of spectrum.integrals.values.entries()) {
|
|
7
7
|
const newIntegralValue = integral.absolute / ratio;
|
|
8
8
|
result.sum += newIntegralValue;
|
|
9
9
|
result.values[index] = {
|
|
@@ -12,9 +12,9 @@ export function changeIntegralsRelative(datum, newIntegral) {
|
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
14
|
const { values, sum } = result;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
...
|
|
15
|
+
spectrum.integrals.values = values;
|
|
16
|
+
spectrum.integrals.options = {
|
|
17
|
+
...spectrum.integrals.options,
|
|
18
18
|
mf: undefined,
|
|
19
19
|
moleculeId: undefined,
|
|
20
20
|
sumAuto: false,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Spectrum1D, Integrals } from 'nmr-load-save';
|
|
2
2
|
export declare function initiateIntegrals(options: Partial<{
|
|
3
3
|
integrals: Integrals;
|
|
4
|
-
}>,
|
|
4
|
+
}>, spectrum: Spectrum1D): {
|
|
5
5
|
values: never[];
|
|
6
6
|
options: {
|
|
7
7
|
sum: undefined;
|
|
@@ -15,7 +15,7 @@ export declare function initiateIntegrals(options: Partial<{
|
|
|
15
15
|
originTo: number;
|
|
16
16
|
from: number;
|
|
17
17
|
to: number;
|
|
18
|
-
id:
|
|
18
|
+
id: string;
|
|
19
19
|
integral?: number | undefined;
|
|
20
20
|
kind: string;
|
|
21
21
|
}[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import merge from 'lodash/merge';
|
|
2
2
|
import { mapIntegrals } from './mapIntegrals';
|
|
3
|
-
export function initiateIntegrals(options,
|
|
3
|
+
export function initiateIntegrals(options, spectrum) {
|
|
4
4
|
return merge({
|
|
5
5
|
values: [],
|
|
6
6
|
options: {
|
|
@@ -9,6 +9,6 @@ export function initiateIntegrals(options, datum) {
|
|
|
9
9
|
sumAuto: true,
|
|
10
10
|
},
|
|
11
11
|
}, options.integrals, {
|
|
12
|
-
values: mapIntegrals(options?.integrals?.values || [],
|
|
12
|
+
values: mapIntegrals(options?.integrals?.values || [], spectrum),
|
|
13
13
|
});
|
|
14
14
|
}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
+
import { Integral, Spectrum1D } from 'nmr-load-save';
|
|
1
2
|
import { ShiftTarget } from '../../../types/common/MapOptions';
|
|
2
|
-
|
|
3
|
-
import { Integral } from '../../../types/data1d/Integral';
|
|
4
|
-
export declare function mapIntegrals(integrals: Integral[], datum: Datum1D, shiftTarget?: ShiftTarget): {
|
|
3
|
+
export declare function mapIntegrals(integrals: Integral[], spectrum: Spectrum1D, shiftTarget?: ShiftTarget): {
|
|
5
4
|
absolute: number;
|
|
6
5
|
originFrom: number;
|
|
7
6
|
originTo: number;
|
|
8
7
|
from: number;
|
|
9
8
|
to: number;
|
|
10
|
-
id:
|
|
9
|
+
id: string;
|
|
11
10
|
integral?: number | undefined;
|
|
12
11
|
kind: string;
|
|
13
12
|
}[];
|
|
@@ -20,9 +20,9 @@ function getRange(integral, shiftTarget, shift) {
|
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
export function mapIntegrals(integrals,
|
|
24
|
-
const { x, re } =
|
|
25
|
-
const shiftX = getShiftX(
|
|
23
|
+
export function mapIntegrals(integrals, spectrum, shiftTarget = 'origin') {
|
|
24
|
+
const { x, re } = spectrum.data;
|
|
25
|
+
const shiftX = getShiftX(spectrum);
|
|
26
26
|
return integrals.map((integral) => {
|
|
27
27
|
const integralBoundary = getRange(integral, shiftTarget, shiftX);
|
|
28
28
|
const absolute = xyIntegration({ x, y: re }, { from: integralBoundary.from, to: integralBoundary.to, reverse: true });
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function updateIntegrals(
|
|
1
|
+
import { Spectrum1D } from 'nmr-load-save';
|
|
2
|
+
export declare function updateIntegrals(spectrum: Spectrum1D): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { mapIntegrals } from './mapIntegrals';
|
|
2
2
|
import { updateIntegralsRelativeValues } from './updateIntegralsRelativeValues';
|
|
3
|
-
export function updateIntegrals(
|
|
4
|
-
|
|
5
|
-
updateIntegralsRelativeValues(
|
|
3
|
+
export function updateIntegrals(spectrum) {
|
|
4
|
+
spectrum.integrals.values = mapIntegrals(spectrum.integrals.values, spectrum, 'current');
|
|
5
|
+
updateIntegralsRelativeValues(spectrum, true);
|
|
6
6
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function updateIntegralsRelativeValues(
|
|
1
|
+
import { Spectrum1D } from 'nmr-load-save';
|
|
2
|
+
export declare function updateIntegralsRelativeValues(spectrum: Spectrum1D, forceCalculateIntegral?: boolean): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { checkIntegralKind } from './checkIntegralKind';
|
|
2
2
|
import { updateRelatives } from './updateRelatives';
|
|
3
|
-
export function updateIntegralsRelativeValues(
|
|
4
|
-
updateRelatives(
|
|
3
|
+
export function updateIntegralsRelativeValues(spectrum, forceCalculateIntegral = false) {
|
|
4
|
+
updateRelatives(spectrum.integrals, 'integral', checkIntegralKind, forceCalculateIntegral);
|
|
5
5
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Integral, Range, Integrals, Ranges } from '
|
|
1
|
+
import { Integral, Range, Integrals, Ranges } from 'nmr-load-save';
|
|
2
2
|
export declare function updateRelatives<Type extends Integral | Range>(data: Type extends Integral ? Integrals : Ranges, key: keyof Type, check: (value: Type) => boolean, forceCalculateIntegral?: boolean): void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
function isAssigned(object) {
|
|
2
|
+
return ((object?.nbAtoms && object.nbAtoms > 0) ||
|
|
3
|
+
(object?.diaIDs && object.diaIDs.length > 0));
|
|
4
|
+
}
|
|
5
|
+
export function isRangeAssigned(range) {
|
|
6
|
+
if (isAssigned(range)) {
|
|
7
|
+
return true;
|
|
8
|
+
}
|
|
9
|
+
return range?.signals.some((signal) => isAssigned(signal));
|
|
10
|
+
}
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export declare function isSpectrum1D(spectrum: Datum1D | Datum2D): spectrum is Datum1D;
|
|
1
|
+
import { Spectrum, Spectrum1D } from 'nmr-load-save';
|
|
2
|
+
export declare function isSpectrum1D(spectrum: Spectrum): spectrum is Spectrum1D;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function autoPeakPicking(
|
|
1
|
+
import { Spectrum1D, Peak1D } from 'nmr-load-save';
|
|
2
|
+
export declare function autoPeakPicking(spectrum: Spectrum1D, options: any): Peak1D[];
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import median from 'ml-array-median';
|
|
2
2
|
import { xyAutoPeaksPicking } from 'nmr-processing';
|
|
3
3
|
import { mapPeaks } from './mapPeaks';
|
|
4
|
-
export function autoPeakPicking(
|
|
4
|
+
export function autoPeakPicking(spectrum, options) {
|
|
5
5
|
const { minMaxRatio, maxNumberOfPeaks, noiseFactor, direction, windowFromIndex, windowToIndex, } = options;
|
|
6
6
|
// we calculate the noise but this could be improved
|
|
7
|
-
const noise = median(
|
|
8
|
-
let { re, x } =
|
|
9
|
-
const { originFrequency: frequency } =
|
|
7
|
+
const noise = median(spectrum.data.re.map((y) => Math.abs(y)));
|
|
8
|
+
let { re, x } = spectrum.data;
|
|
9
|
+
const { originFrequency: frequency } = spectrum.info;
|
|
10
10
|
if (windowFromIndex !== undefined && windowToIndex !== undefined) {
|
|
11
11
|
x = x.slice(windowFromIndex, windowToIndex);
|
|
12
12
|
re = re.slice(windowFromIndex, windowToIndex);
|
|
@@ -23,5 +23,5 @@ export function autoPeakPicking(datum1D, options) {
|
|
|
23
23
|
peaks.sort((a, b) => b.y - a.y);
|
|
24
24
|
if (maxNumberOfPeaks < peaks.length)
|
|
25
25
|
peaks = peaks.slice(0, maxNumberOfPeaks);
|
|
26
|
-
return mapPeaks(peaks,
|
|
26
|
+
return mapPeaks(peaks, spectrum);
|
|
27
27
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Spectrum1D, Peaks } from 'nmr-load-save';
|
|
2
2
|
export declare function initiatePeaks(options: Partial<{
|
|
3
3
|
peaks: Peaks;
|
|
4
|
-
}>,
|
|
4
|
+
}>, spectrum: Spectrum1D): {
|
|
5
5
|
values: never[];
|
|
6
6
|
options: {};
|
|
7
7
|
} & Peaks & {
|
|
8
|
-
values: import("
|
|
8
|
+
values: import("nmr-load-save").Peak1D[];
|
|
9
9
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import merge from 'lodash/merge';
|
|
2
2
|
import { mapPeaks } from './mapPeaks';
|
|
3
|
-
export function initiatePeaks(options,
|
|
3
|
+
export function initiatePeaks(options, spectrum) {
|
|
4
4
|
return merge({ values: [], options: {} }, options.peaks, {
|
|
5
|
-
values: mapPeaks(options?.peaks?.values || [],
|
|
5
|
+
values: mapPeaks(options?.peaks?.values || [], spectrum),
|
|
6
6
|
});
|
|
7
7
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
+
import { Peak1D, Spectrum1D } from 'nmr-load-save';
|
|
1
2
|
import { MapOptions } from '../../../types/common/MapOptions';
|
|
2
|
-
|
|
3
|
-
export declare function mapPeaks(peaks: Peak[], datum: Datum1D, options?: MapOptions): Peak[];
|
|
3
|
+
export declare function mapPeaks(peaks: Peak1D[], spectrum: Spectrum1D, options?: MapOptions): Peak1D[];
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { v4 } from '@lukeed/uuid';
|
|
2
2
|
import { getShiftX } from '../getShiftX';
|
|
3
3
|
import { getSpectrumErrorValue } from '../getSpectrumErrorValue';
|
|
4
|
-
function isExists(peak,
|
|
4
|
+
function isExists(peak, spectrum, error) {
|
|
5
5
|
// check if the Peak is already exists
|
|
6
|
-
for (const { x } of
|
|
6
|
+
for (const { x } of spectrum.peaks?.values || []) {
|
|
7
7
|
if (Math.abs(peak.x - x) < error) {
|
|
8
8
|
return true;
|
|
9
9
|
}
|
|
@@ -11,7 +11,7 @@ function isExists(peak, datum, error) {
|
|
|
11
11
|
return false;
|
|
12
12
|
}
|
|
13
13
|
function getPeakDelta(peak, shiftTarget, shift) {
|
|
14
|
-
const { originalX, x } = peak;
|
|
14
|
+
const { originalX = 0, x } = peak;
|
|
15
15
|
if (shiftTarget === 'origin') {
|
|
16
16
|
return {
|
|
17
17
|
originalX: x - shift,
|
|
@@ -25,15 +25,15 @@ function getPeakDelta(peak, shiftTarget, shift) {
|
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
export function mapPeaks(peaks,
|
|
28
|
+
export function mapPeaks(peaks, spectrum, options = {}) {
|
|
29
29
|
const { checkIsExisting = true, shiftTarget = 'origin' } = options;
|
|
30
|
-
const shiftX = getShiftX(
|
|
31
|
-
const error = getSpectrumErrorValue(
|
|
30
|
+
const shiftX = getShiftX(spectrum);
|
|
31
|
+
const error = getSpectrumErrorValue(spectrum);
|
|
32
32
|
let newPeaks = [];
|
|
33
33
|
for (const peak of peaks) {
|
|
34
34
|
const peakDelta = getPeakDelta(peak, shiftTarget, shiftX);
|
|
35
35
|
if (!checkIsExisting ||
|
|
36
|
-
(checkIsExisting && !isExists(peak,
|
|
36
|
+
(checkIsExisting && !isExists(peak, spectrum, error))) {
|
|
37
37
|
newPeaks.push({
|
|
38
38
|
...peak,
|
|
39
39
|
id: peak?.id || v4(),
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Peak1D, Spectrum1D } from 'nmr-load-save';
|
|
2
2
|
interface OptimizePeaksOptions {
|
|
3
3
|
from: number;
|
|
4
4
|
to: number;
|
|
5
|
-
peaks:
|
|
5
|
+
peaks: Peak1D[];
|
|
6
6
|
}
|
|
7
|
-
export declare function optimizePeaks(
|
|
7
|
+
export declare function optimizePeaks(spectrum: Spectrum1D, options: OptimizePeaksOptions): Peak1D[];
|
|
8
8
|
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { xFindClosestIndex } from 'ml-spectra-processing';
|
|
2
2
|
import { xyPeaksOptimization } from 'nmr-processing';
|
|
3
3
|
import { mapPeaks } from './mapPeaks';
|
|
4
|
-
export function optimizePeaks(
|
|
4
|
+
export function optimizePeaks(spectrum, options) {
|
|
5
5
|
const { from, to, peaks } = options;
|
|
6
|
-
const { originFrequency: frequency } =
|
|
7
|
-
let { re, x } =
|
|
6
|
+
const { originFrequency: frequency } = spectrum.info;
|
|
7
|
+
let { re, x } = spectrum.data;
|
|
8
8
|
const fromIndex = xFindClosestIndex(x, from);
|
|
9
9
|
const ToIndex = xFindClosestIndex(x, to);
|
|
10
10
|
// create deleted peaks object where the key is the id of the peaks that we need to remove
|
|
@@ -13,14 +13,14 @@ export function optimizePeaks(datum1D, options) {
|
|
|
13
13
|
ids[peak.id] = peak;
|
|
14
14
|
}
|
|
15
15
|
//remove peaks before start the optimization from the original list
|
|
16
|
-
|
|
16
|
+
spectrum.peaks.values = spectrum.peaks.values.filter((peak) => !ids[peak.id]);
|
|
17
17
|
x = x.subarray(fromIndex, ToIndex);
|
|
18
18
|
re = re.subarray(fromIndex, ToIndex);
|
|
19
19
|
const newPeaks = xyPeaksOptimization({ x, y: re }, peaks, {
|
|
20
20
|
frequency,
|
|
21
21
|
groupingFactor: 3,
|
|
22
22
|
});
|
|
23
|
-
return mapPeaks(
|
|
23
|
+
return mapPeaks(spectrum.peaks.values.concat(newPeaks), spectrum, {
|
|
24
24
|
checkIsExisting: false,
|
|
25
25
|
});
|
|
26
26
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function updatePeaks(
|
|
1
|
+
import { Spectrum1D } from 'nmr-load-save';
|
|
2
|
+
export declare function updatePeaks(spectrum: Spectrum1D): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { mapPeaks } from './mapPeaks';
|
|
2
|
-
export function updatePeaks(
|
|
3
|
-
|
|
2
|
+
export function updatePeaks(spectrum) {
|
|
3
|
+
spectrum.peaks.values = mapPeaks(spectrum.peaks.values, spectrum, {
|
|
4
4
|
checkIsExisting: false,
|
|
5
5
|
shiftTarget: 'current',
|
|
6
6
|
});
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { Signal1D } from '
|
|
2
|
-
import { Datum1D } from '../../../types/data1d/Datum1D';
|
|
1
|
+
import { Signal1D, Spectrum1D } from 'nmr-load-save';
|
|
3
2
|
import { SumParams } from '../SumManager';
|
|
4
3
|
interface RangeOptions {
|
|
5
4
|
from: number;
|
|
@@ -10,21 +9,21 @@ export declare function createRangeObj({ from, to, absolute, id, signal, }: Rang
|
|
|
10
9
|
signal: Omit<Signal1D, 'id'>;
|
|
11
10
|
absolute: number;
|
|
12
11
|
}): {
|
|
13
|
-
id:
|
|
12
|
+
id: string;
|
|
14
13
|
from: number;
|
|
15
14
|
to: number;
|
|
16
15
|
absolute: number;
|
|
17
16
|
signals: {
|
|
18
|
-
peaks?: import("nmr-processing").NMRPeak1D[] | undefined;
|
|
19
|
-
kind?: string | undefined;
|
|
20
17
|
integration?: number | undefined;
|
|
21
18
|
diaIDs?: string[] | undefined;
|
|
22
|
-
|
|
19
|
+
kind?: string | undefined;
|
|
20
|
+
multiplicity: string;
|
|
23
21
|
nbAtoms?: number | undefined;
|
|
24
22
|
delta: number;
|
|
25
|
-
js
|
|
23
|
+
js: import("nmr-processing").Jcoupling[];
|
|
26
24
|
atoms?: number[] | undefined;
|
|
27
25
|
assignment?: string | undefined;
|
|
26
|
+
peaks?: import("nmr-processing").NMRPeak1D[] | undefined;
|
|
28
27
|
statistic?: {
|
|
29
28
|
mean: number;
|
|
30
29
|
sd: number;
|
|
@@ -33,10 +32,10 @@ export declare function createRangeObj({ from, to, absolute, id, signal, }: Rang
|
|
|
33
32
|
nb: number;
|
|
34
33
|
} | undefined;
|
|
35
34
|
originDelta?: number | undefined;
|
|
36
|
-
id:
|
|
35
|
+
id: string;
|
|
37
36
|
}[];
|
|
38
37
|
kind: string;
|
|
39
38
|
integration: number;
|
|
40
39
|
};
|
|
41
|
-
export declare function addRange(
|
|
40
|
+
export declare function addRange(spectrum: Spectrum1D, options: RangeOptions & SumParams): void;
|
|
42
41
|
export {};
|
|
@@ -16,15 +16,15 @@ export function createRangeObj({ from, to, absolute, id, signal, }) {
|
|
|
16
16
|
integration: 0,
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
|
-
export function addRange(
|
|
19
|
+
export function addRange(spectrum, options) {
|
|
20
20
|
const { from, to, id, molecules, nucleus } = options;
|
|
21
|
-
const { x, re } =
|
|
21
|
+
const { x, re } = spectrum.data;
|
|
22
22
|
const absolute = xyIntegration({ x, y: re }, { from, to, reverse: true });
|
|
23
23
|
// detectSignal use the advance multiplet-analysis that can crash if too many points
|
|
24
24
|
const signal = detectSignal({ x, re }, {
|
|
25
25
|
from,
|
|
26
26
|
to,
|
|
27
|
-
frequency:
|
|
27
|
+
frequency: spectrum.info.originFrequency,
|
|
28
28
|
});
|
|
29
29
|
let range;
|
|
30
30
|
if (!signal) {
|
|
@@ -34,7 +34,13 @@ export function addRange(datum, options) {
|
|
|
34
34
|
to,
|
|
35
35
|
id,
|
|
36
36
|
absolute,
|
|
37
|
-
signal: {
|
|
37
|
+
signal: {
|
|
38
|
+
multiplicity: '',
|
|
39
|
+
kind: 'signal',
|
|
40
|
+
delta: 0,
|
|
41
|
+
js: [],
|
|
42
|
+
diaIDs: [],
|
|
43
|
+
},
|
|
38
44
|
});
|
|
39
45
|
}
|
|
40
46
|
}
|
|
@@ -49,12 +55,12 @@ export function addRange(datum, options) {
|
|
|
49
55
|
}
|
|
50
56
|
try {
|
|
51
57
|
if (range) {
|
|
52
|
-
|
|
58
|
+
spectrum.ranges.options = initSumOptions(spectrum.ranges.options, {
|
|
53
59
|
molecules,
|
|
54
60
|
nucleus,
|
|
55
61
|
});
|
|
56
|
-
|
|
57
|
-
updateRangesRelativeValues(
|
|
62
|
+
spectrum.ranges.values = spectrum.ranges.values.concat(mapRanges([range], spectrum));
|
|
63
|
+
updateRangesRelativeValues(spectrum);
|
|
58
64
|
}
|
|
59
65
|
}
|
|
60
66
|
catch (error) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export default function autoRangesDetection(
|
|
1
|
+
import { Range, Spectrum1D } from 'nmr-load-save';
|
|
2
|
+
export default function autoRangesDetection(spectrum: Spectrum1D, options?: any): Range[];
|
|
@@ -10,10 +10,10 @@ const defaultPeakPickingOptions = {
|
|
|
10
10
|
clean: true,
|
|
11
11
|
sgOptions: { windowSize: 7, polynomial: 3 },
|
|
12
12
|
};
|
|
13
|
-
export default function autoRangesDetection(
|
|
13
|
+
export default function autoRangesDetection(spectrum, options = {}) {
|
|
14
14
|
// we calculate the noise but this could be improved
|
|
15
|
-
let { re, x } =
|
|
16
|
-
const { originFrequency, nucleus } =
|
|
15
|
+
let { re, x } = spectrum.data;
|
|
16
|
+
const { originFrequency, nucleus } = spectrum.info;
|
|
17
17
|
const { windowFromIndex, windowToIndex, peakPicking } = options;
|
|
18
18
|
const peakPickingOptions = {
|
|
19
19
|
...defaultPeakPickingOptions,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function changeRange(
|
|
1
|
+
import { Range, Spectrum1D } from 'nmr-load-save';
|
|
2
|
+
export declare function changeRange(spectrum: Spectrum1D, range: Range): void;
|
|
@@ -2,15 +2,20 @@ import { v4 } from '@lukeed/uuid';
|
|
|
2
2
|
import { xyIntegration } from 'ml-spectra-processing';
|
|
3
3
|
import detectSignal from './detectSignal';
|
|
4
4
|
import { updateRangesRelativeValues } from './updateRangesRelativeValues';
|
|
5
|
-
export function changeRange(
|
|
5
|
+
export function changeRange(spectrum, range) {
|
|
6
6
|
const { from, to, id } = range;
|
|
7
|
-
const { x, re } =
|
|
8
|
-
const index =
|
|
7
|
+
const { x, re } = spectrum.data;
|
|
8
|
+
const index = spectrum.ranges.values.findIndex((i) => i.id === id);
|
|
9
9
|
const absolute = xyIntegration({ x, y: re }, { from, to, reverse: true });
|
|
10
|
-
const signal = detectSignal({ x, re }, {
|
|
10
|
+
const signal = detectSignal({ x, re }, {
|
|
11
|
+
from,
|
|
12
|
+
to,
|
|
13
|
+
frequency: spectrum.info.originFrequency,
|
|
14
|
+
checkMaxLength: false,
|
|
15
|
+
});
|
|
11
16
|
if (index !== -1) {
|
|
12
|
-
|
|
13
|
-
...
|
|
17
|
+
spectrum.ranges.values[index] = {
|
|
18
|
+
...spectrum.ranges.values[index],
|
|
14
19
|
originFrom: from,
|
|
15
20
|
originTo: to,
|
|
16
21
|
...range,
|
|
@@ -23,10 +28,11 @@ export function changeRange(datum, range) {
|
|
|
23
28
|
kind: 'signal',
|
|
24
29
|
delta: 0,
|
|
25
30
|
js: [],
|
|
31
|
+
diaIDs: [],
|
|
26
32
|
}),
|
|
27
33
|
},
|
|
28
34
|
],
|
|
29
35
|
};
|
|
30
|
-
updateRangesRelativeValues(
|
|
36
|
+
updateRangesRelativeValues(spectrum);
|
|
31
37
|
}
|
|
32
38
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Spectrum1D } from 'nmr-load-save';
|
|
2
2
|
interface RangeProps {
|
|
3
3
|
id: string;
|
|
4
4
|
value: number;
|
|
5
5
|
}
|
|
6
6
|
/**
|
|
7
7
|
* Change Range relative value and re-calculate the relative values for the other ranges
|
|
8
|
-
* @param {
|
|
8
|
+
* @param {Spectrum1D} spectrum spectrum 1d
|
|
9
9
|
* @param {RangeProps} newRange
|
|
10
10
|
*/
|
|
11
|
-
export declare function changeRangeRelativeValue(
|
|
11
|
+
export declare function changeRangeRelativeValue(spectrum: Spectrum1D, newRange: RangeProps): void;
|
|
12
12
|
export {};
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Change Range relative value and re-calculate the relative values for the other ranges
|
|
3
|
-
* @param {
|
|
3
|
+
* @param {Spectrum1D} spectrum spectrum 1d
|
|
4
4
|
* @param {RangeProps} newRange
|
|
5
5
|
*/
|
|
6
|
-
export function changeRangeRelativeValue(
|
|
7
|
-
const index =
|
|
8
|
-
if (index !== -1 &&
|
|
9
|
-
const { absolute, integration } =
|
|
6
|
+
export function changeRangeRelativeValue(spectrum, newRange) {
|
|
7
|
+
const index = spectrum.ranges.values.findIndex((range) => range.id === newRange.id);
|
|
8
|
+
if (index !== -1 && spectrum.ranges.options.sum) {
|
|
9
|
+
const { absolute, integration } = spectrum.ranges.values[index];
|
|
10
10
|
const ratio = absolute / newRange.value;
|
|
11
|
-
const sum = (newRange.value / integration) *
|
|
12
|
-
|
|
13
|
-
...
|
|
11
|
+
const sum = (newRange.value / integration) * spectrum.ranges.options.sum;
|
|
12
|
+
spectrum.ranges.options = {
|
|
13
|
+
...spectrum.ranges.options,
|
|
14
14
|
mf: undefined,
|
|
15
15
|
moleculeId: undefined,
|
|
16
16
|
sumAuto: false,
|
|
17
17
|
sum,
|
|
18
18
|
};
|
|
19
|
-
|
|
19
|
+
spectrum.ranges.values = spectrum.ranges.values.map((range) => {
|
|
20
20
|
return {
|
|
21
21
|
...range,
|
|
22
22
|
integration: range.absolute / ratio,
|