nmrium 1.6.1 → 1.7.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/lib/component/1d/FloatingRanges.js +4 -4
- package/lib/component/1d/FloatingRanges.js.map +1 -1
- package/lib/component/1d/database/DatabaseSpectrum.js +1 -1
- package/lib/component/1d/database/DatabaseSpectrum.js.map +1 -1
- package/lib/component/1d/multiAnalysis/MultiAnalysisRanges.js +1 -1
- package/lib/component/1d/multiAnalysis/MultiAnalysisRanges.js.map +1 -1
- package/lib/component/1d/multiplicityTree/MultiplicityTree.d.ts.map +1 -1
- package/lib/component/1d/multiplicityTree/MultiplicityTree.js +4 -2
- package/lib/component/1d/multiplicityTree/MultiplicityTree.js.map +1 -1
- package/lib/component/1d/peaks/PeakAnnotations.d.ts.map +1 -1
- package/lib/component/1d/peaks/PeakAnnotations.js +2 -2
- package/lib/component/1d/peaks/PeakAnnotations.js.map +1 -1
- package/lib/component/1d/peaks/PeakAnnotationsSpreadMode.d.ts.map +1 -1
- package/lib/component/1d/peaks/PeakAnnotationsSpreadMode.js +4 -4
- package/lib/component/1d/peaks/PeakAnnotationsSpreadMode.js.map +1 -1
- package/lib/component/1d/peaks/Peaks.d.ts +4 -1
- package/lib/component/1d/peaks/Peaks.d.ts.map +1 -1
- package/lib/component/1d/peaks/Peaks.js +5 -2
- package/lib/component/1d/peaks/Peaks.js.map +1 -1
- package/lib/component/1d/ranges/Range.d.ts.map +1 -1
- package/lib/component/1d/ranges/Range.js +3 -3
- package/lib/component/1d/ranges/Range.js.map +1 -1
- package/lib/component/1d/ranges/RangesIntegrals.d.ts.map +1 -1
- package/lib/component/1d/ranges/RangesIntegrals.js +5 -3
- package/lib/component/1d/ranges/RangesIntegrals.js.map +1 -1
- package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.js +1 -0
- package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.js.map +1 -1
- package/lib/component/2d/FooterBanner.js +2 -2
- package/lib/component/2d/FooterBanner.js.map +1 -1
- package/lib/component/2d/YAxis.d.ts +0 -1
- package/lib/component/2d/YAxis.d.ts.map +1 -1
- package/lib/component/2d/YAxis.js +11 -4
- package/lib/component/2d/YAxis.js.map +1 -1
- package/lib/component/2d/useTracesSpectra.d.ts.map +1 -1
- package/lib/component/2d/useTracesSpectra.js +2 -0
- package/lib/component/2d/useTracesSpectra.js.map +1 -1
- package/lib/component/2d/utilities/extractSpectrumSignals.d.ts +2 -9
- package/lib/component/2d/utilities/extractSpectrumSignals.d.ts.map +1 -1
- package/lib/component/2d/utilities/extractSpectrumSignals.js +4 -5
- package/lib/component/2d/utilities/extractSpectrumSignals.js.map +1 -1
- package/lib/component/2d/zones/SignalsGuideLines.d.ts.map +1 -1
- package/lib/component/2d/zones/SignalsGuideLines.js +7 -10
- package/lib/component/2d/zones/SignalsGuideLines.js.map +1 -1
- package/lib/component/2d/zones/ZonesAssignmentsLabels.d.ts.map +1 -1
- package/lib/component/2d/zones/ZonesAssignmentsLabels.js.map +1 -1
- package/lib/component/context/DispatchContext.d.ts +2 -2
- package/lib/component/context/DispatchContext.d.ts.map +1 -1
- package/lib/component/context/LoggerContext.d.ts.map +1 -1
- package/lib/component/context/LoggerContext.js +8 -9
- package/lib/component/context/LoggerContext.js.map +1 -1
- package/lib/component/context/PreferencesContext.d.ts +7 -3
- package/lib/component/context/PreferencesContext.d.ts.map +1 -1
- package/lib/component/context/PreferencesContext.js +1 -2
- package/lib/component/context/PreferencesContext.js.map +1 -1
- package/lib/component/elements/D3Axis.d.ts.map +1 -1
- package/lib/component/elements/D3Axis.js +1 -1
- package/lib/component/elements/D3Axis.js.map +1 -1
- package/lib/component/elements/Sections.js +1 -1
- package/lib/component/elements/Sections.js.map +1 -1
- package/lib/component/hooks/useActiveSpectrumRangesViewState.d.ts.map +1 -1
- package/lib/component/hooks/useActiveSpectrumRangesViewState.js +2 -2
- package/lib/component/hooks/useActiveSpectrumRangesViewState.js.map +1 -1
- package/lib/component/hooks/useExport.d.ts.map +1 -1
- package/lib/component/hooks/useExport.js +24 -6
- package/lib/component/hooks/useExport.js.map +1 -1
- package/lib/component/loader/Spinner.js +1 -1
- package/lib/component/loader/Spinner.js.map +1 -1
- package/lib/component/loader/useLoadFiles.d.ts.map +1 -1
- package/lib/component/loader/useLoadFiles.js +51 -26
- package/lib/component/loader/useLoadFiles.js.map +1 -1
- package/lib/component/main/InnerNMRium.d.ts.map +1 -1
- package/lib/component/main/InnerNMRium.js +4 -2
- package/lib/component/main/InnerNMRium.js.map +1 -1
- package/lib/component/main/NMRiumStateProvider.d.ts.map +1 -1
- package/lib/component/main/NMRiumStateProvider.js +18 -6
- package/lib/component/main/NMRiumStateProvider.js.map +1 -1
- package/lib/component/modal/LoadJCAMPModal.d.ts.map +1 -1
- package/lib/component/modal/LoadJCAMPModal.js +2 -3
- package/lib/component/modal/LoadJCAMPModal.js.map +1 -1
- package/lib/component/modal/MoleculeStructureEditorModal.d.ts.map +1 -1
- package/lib/component/modal/MoleculeStructureEditorModal.js.map +1 -1
- package/lib/component/modal/MultipletAnalysisModal.js +0 -2
- package/lib/component/modal/MultipletAnalysisModal.js.map +1 -1
- package/lib/component/modal/SaveAsModal.d.ts.map +1 -1
- package/lib/component/modal/SaveAsModal.js +6 -3
- package/lib/component/modal/SaveAsModal.js.map +1 -1
- package/lib/component/modal/changeSum/ChangeSumModalContents.d.ts.map +1 -1
- package/lib/component/modal/changeSum/ChangeSumModalContents.js +0 -2
- package/lib/component/modal/changeSum/ChangeSumModalContents.js.map +1 -1
- package/lib/component/modal/changeSum/SelectMolecule.d.ts.map +1 -1
- package/lib/component/modal/changeSum/SelectMolecule.js +0 -2
- package/lib/component/modal/changeSum/SelectMolecule.js.map +1 -1
- package/lib/component/modal/setting/settings-tabs/DatabasesTabContent.d.ts +2 -2
- package/lib/component/modal/setting/settings-tabs/DatabasesTabContent.d.ts.map +1 -1
- package/lib/component/modal/setting/settings-tabs/DatabasesTabContent.js +1 -2
- package/lib/component/modal/setting/settings-tabs/DatabasesTabContent.js.map +1 -1
- package/lib/component/modal/setting/settingsValidation.js +2 -2
- package/lib/component/modal/setting/settingsValidation.js.map +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralPanel.d.ts.map +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralPanel.js +2 -1
- package/lib/component/panels/IntegralsPanel/IntegralPanel.js.map +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralTable.d.ts +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralTable.d.ts.map +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralTable.js +4 -3
- package/lib/component/panels/IntegralsPanel/IntegralTable.js.map +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculePanel.d.ts.map +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculePanel.js +1 -3
- package/lib/component/panels/MoleculesPanel/MoleculePanel.js.map +1 -1
- package/lib/component/panels/MoleculesPanel/Utilities.d.ts +1 -1
- package/lib/component/panels/MoleculesPanel/Utilities.d.ts.map +1 -1
- package/lib/component/panels/MoleculesPanel/Utilities.js +6 -3
- package/lib/component/panels/MoleculesPanel/Utilities.js.map +1 -1
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.d.ts.map +1 -1
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +20 -5
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.js.map +1 -1
- package/lib/component/panels/PeaksPanel/PeaksPanel.d.ts.map +1 -1
- package/lib/component/panels/PeaksPanel/PeaksPanel.js +24 -26
- package/lib/component/panels/PeaksPanel/PeaksPanel.js.map +1 -1
- package/lib/component/panels/PeaksPanel/PeaksTable.d.ts +1 -1
- package/lib/component/panels/PeaksPanel/PeaksTable.d.ts.map +1 -1
- package/lib/component/panels/PeaksPanel/PeaksTable.js +3 -2
- package/lib/component/panels/PeaksPanel/PeaksTable.js.map +1 -1
- package/lib/component/panels/RangesPanel/RangesHeader.d.ts.map +1 -1
- package/lib/component/panels/RangesPanel/RangesHeader.js +3 -2
- package/lib/component/panels/RangesPanel/RangesHeader.js.map +1 -1
- package/lib/component/panels/RangesPanel/RangesTable.d.ts +1 -1
- package/lib/component/panels/RangesPanel/RangesTable.d.ts.map +1 -1
- package/lib/component/panels/RangesPanel/RangesTable.js +2 -1
- package/lib/component/panels/RangesPanel/RangesTable.js.map +1 -1
- package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +2 -2
- package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js.map +1 -1
- package/lib/component/panels/RangesPanel/TableColumns/RelativeColumn.js +2 -2
- package/lib/component/panels/RangesPanel/TableColumns/RelativeColumn.js.map +1 -1
- package/lib/component/panels/SpectraPanel/SpectraTable.d.ts.map +1 -1
- package/lib/component/panels/SpectraPanel/SpectraTable.js +3 -2
- package/lib/component/panels/SpectraPanel/SpectraTable.js.map +1 -1
- package/lib/component/panels/SummaryPanel/utilities/Utilities.js +2 -2
- package/lib/component/panels/SummaryPanel/utilities/Utilities.js.map +1 -1
- package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumns.js +1 -1
- package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumns.js.map +1 -1
- package/lib/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.d.ts.map +1 -1
- package/lib/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.js +0 -4
- package/lib/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.js.map +1 -1
- package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.js +8 -8
- package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.js.map +1 -1
- package/lib/component/panels/ZonesPanel/ZonesPanel.d.ts.map +1 -1
- package/lib/component/panels/ZonesPanel/ZonesPanel.js +6 -1
- package/lib/component/panels/ZonesPanel/ZonesPanel.js.map +1 -1
- package/lib/component/panels/ZonesPanel/ZonesTable.d.ts +8 -9
- package/lib/component/panels/ZonesPanel/ZonesTable.d.ts.map +1 -1
- package/lib/component/panels/ZonesPanel/ZonesTable.js +3 -2
- package/lib/component/panels/ZonesPanel/ZonesTable.js.map +1 -1
- package/lib/component/panels/ZonesPanel/ZonesTableRow.d.ts.map +1 -1
- package/lib/component/panels/ZonesPanel/ZonesTableRow.js +0 -2
- package/lib/component/panels/ZonesPanel/ZonesTableRow.js.map +1 -1
- package/lib/component/panels/ZonesPanel/hooks/useMapZones.d.ts +7 -7
- package/lib/component/panels/ZonesPanel/hooks/useMapZones.d.ts.map +1 -1
- package/lib/component/panels/ZonesPanel/hooks/useMapZones.js +3 -3
- package/lib/component/panels/ZonesPanel/hooks/useMapZones.js.map +1 -1
- package/lib/component/panels/databasePanel/DatabasePanel.d.ts.map +1 -1
- package/lib/component/panels/databasePanel/DatabasePanel.js +13 -10
- package/lib/component/panels/databasePanel/DatabasePanel.js.map +1 -1
- package/lib/component/panels/filtersPanel/Filters/hooks/usePhaseCorrectionTwoDimensions.d.ts.map +1 -1
- package/lib/component/panels/filtersPanel/Filters/hooks/usePhaseCorrectionTwoDimensions.js +0 -2
- package/lib/component/panels/filtersPanel/Filters/hooks/usePhaseCorrectionTwoDimensions.js.map +1 -1
- package/lib/component/panels/multipleAnalysisPanel/preferences/MultipleAnalysisCodeEditor.d.ts.map +1 -1
- package/lib/component/panels/multipleAnalysisPanel/preferences/MultipleAnalysisCodeEditor.js +0 -2
- package/lib/component/panels/multipleAnalysisPanel/preferences/MultipleAnalysisCodeEditor.js.map +1 -1
- package/lib/component/reducer/Reducer.d.ts +8 -2
- package/lib/component/reducer/Reducer.d.ts.map +1 -1
- package/lib/component/reducer/Reducer.js +3 -1
- package/lib/component/reducer/Reducer.js.map +1 -1
- package/lib/component/reducer/actions/DatabaseActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/DatabaseActions.js +2 -1
- package/lib/component/reducer/actions/DatabaseActions.js.map +1 -1
- package/lib/component/reducer/actions/IntegralsActions.js.map +1 -1
- package/lib/component/reducer/actions/{LoadActions.d.ts → LoadAction.d.ts} +11 -3
- package/lib/component/reducer/actions/LoadAction.d.ts.map +1 -0
- package/lib/component/reducer/actions/{LoadActions.js → LoadAction.js} +53 -18
- package/lib/component/reducer/actions/LoadAction.js.map +1 -0
- package/lib/component/reducer/actions/MoleculeActions.d.ts +3 -2
- package/lib/component/reducer/actions/MoleculeActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/MoleculeActions.js +1 -1
- package/lib/component/reducer/actions/MoleculeActions.js.map +1 -1
- package/lib/component/reducer/actions/RangesActions.d.ts +2 -2
- package/lib/component/reducer/actions/RangesActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/RangesActions.js +13 -13
- package/lib/component/reducer/actions/RangesActions.js.map +1 -1
- package/lib/component/reducer/actions/ZonesActions.d.ts +2 -2
- package/lib/component/reducer/actions/ZonesActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/ZonesActions.js +9 -4
- package/lib/component/reducer/actions/ZonesActions.js.map +1 -1
- package/lib/component/reducer/preferences/actions/initPreferences.d.ts.map +1 -1
- package/lib/component/reducer/preferences/actions/initPreferences.js +1 -2
- package/lib/component/reducer/preferences/actions/initPreferences.js.map +1 -1
- package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.d.ts.map +1 -1
- package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js +2 -1
- package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js.map +1 -1
- package/lib/component/reducer/preferences/preferencesReducer.d.ts +8 -8
- package/lib/component/reducer/preferences/preferencesReducer.d.ts.map +1 -1
- package/lib/component/reducer/preferences/preferencesReducer.js +0 -1
- package/lib/component/reducer/preferences/preferencesReducer.js.map +1 -1
- package/lib/component/utility/export.d.ts +3 -3
- package/lib/component/utility/export.d.ts.map +1 -1
- package/lib/component/utility/export.js +13 -21
- package/lib/component/utility/export.js.map +1 -1
- package/lib/component/utility/getClosePeak.js +1 -1
- package/lib/component/utility/getClosePeak.js.map +1 -1
- package/lib/component/utility/save_as.d.ts +9 -0
- package/lib/component/utility/save_as.d.ts.map +1 -0
- package/lib/component/utility/save_as.js +7 -0
- package/lib/component/utility/save_as.js.map +1 -0
- package/lib/data/PredictionManager.d.ts.map +1 -1
- package/lib/data/PredictionManager.js +13 -9
- package/lib/data/PredictionManager.js.map +1 -1
- package/lib/data/SpectraManager.d.ts +45 -4
- package/lib/data/SpectraManager.d.ts.map +1 -1
- package/lib/data/SpectraManager.js +69 -12
- package/lib/data/SpectraManager.js.map +1 -1
- package/lib/data/constants/signalsKinds.d.ts +1 -6
- package/lib/data/constants/signalsKinds.d.ts.map +1 -1
- package/lib/data/constants/signalsKinds.js +2 -17
- package/lib/data/constants/signalsKinds.js.map +1 -1
- package/lib/data/data1d/Spectrum1D/generateJGraphData.js +1 -1
- package/lib/data/data1d/Spectrum1D/generateJGraphData.js.map +1 -1
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.d.ts +1 -0
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.d.ts.map +1 -1
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +2 -1
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.js.map +1 -1
- package/lib/data/data1d/Spectrum1D/integrals/initiateIntegrals.d.ts +1 -10
- package/lib/data/data1d/Spectrum1D/integrals/initiateIntegrals.d.ts.map +1 -1
- package/lib/data/data1d/Spectrum1D/isRangeAssigned.d.ts.map +1 -1
- package/lib/data/data1d/Spectrum1D/isRangeAssigned.js.map +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.d.ts.map +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.js +6 -4
- package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.js.map +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectRanges.d.ts.map +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectRanges.js +5 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectRanges.js.map +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectSignals.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectSignals.js +1 -1
- package/lib/data/data2d/Spectrum2D/contours.d.ts.map +1 -1
- package/lib/data/data2d/Spectrum2D/contours.js +1 -1
- package/lib/data/data2d/Spectrum2D/contours.js.map +1 -1
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.d.ts +1 -0
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.d.ts.map +1 -1
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +2 -1
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.js.map +1 -1
- package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.d.ts +2 -2
- package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.d.ts.map +1 -1
- package/lib/data/data2d/Spectrum2D/zones/initiateZones.d.ts +2 -2
- package/lib/data/data2d/Spectrum2D/zones/initiateZones.d.ts.map +1 -1
- package/lib/data/molecules/Molecule.d.ts +2 -6
- package/lib/data/molecules/Molecule.d.ts.map +1 -1
- package/lib/data/molecules/Molecule.js +7 -1
- package/lib/data/molecules/Molecule.js.map +1 -1
- package/lib/data/molecules/MoleculeManager.d.ts +4 -3
- package/lib/data/molecules/MoleculeManager.d.ts.map +1 -1
- package/lib/data/molecules/MoleculeManager.js +8 -3
- package/lib/data/molecules/MoleculeManager.js.map +1 -1
- package/lib/data/utilities/RangeUtilities.d.ts +3 -2
- package/lib/data/utilities/RangeUtilities.d.ts.map +1 -1
- package/lib/data/utilities/RangeUtilities.js +9 -3
- package/lib/data/utilities/RangeUtilities.js.map +1 -1
- package/lib/data/utilities/ZoneUtilities.d.ts.map +1 -1
- package/lib/data/utilities/ZoneUtilities.js +1 -2
- package/lib/data/utilities/ZoneUtilities.js.map +1 -1
- package/lib/data/utilities/isProton.d.ts +2 -0
- package/lib/data/utilities/isProton.d.ts.map +1 -0
- package/lib/data/utilities/isProton.js +4 -0
- package/lib/data/utilities/isProton.js.map +1 -0
- package/lib/versionInfo.js +1 -1
- package/package.json +27 -27
- package/src/component/1d/FloatingRanges.tsx +5 -5
- package/src/component/1d/database/DatabaseSpectrum.tsx +1 -1
- package/src/component/1d/multiAnalysis/MultiAnalysisRanges.tsx +1 -1
- package/src/component/1d/multiplicityTree/MultiplicityTree.tsx +4 -2
- package/src/component/1d/peaks/PeakAnnotations.tsx +2 -1
- package/src/component/1d/peaks/PeakAnnotationsSpreadMode.tsx +11 -1
- package/src/component/1d/peaks/Peaks.tsx +9 -3
- package/src/component/1d/ranges/Range.tsx +4 -3
- package/src/component/1d/ranges/RangesIntegrals.tsx +6 -2
- package/src/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.tsx +1 -0
- package/src/component/2d/FooterBanner.tsx +2 -2
- package/src/component/2d/YAxis.tsx +31 -13
- package/src/component/2d/useTracesSpectra.ts +3 -0
- package/src/component/2d/utilities/extractSpectrumSignals.ts +6 -16
- package/src/component/2d/zones/SignalsGuideLines.tsx +11 -9
- package/src/component/2d/zones/ZonesAssignmentsLabels.tsx +2 -3
- package/src/component/context/DispatchContext.tsx +2 -2
- package/src/component/context/LoggerContext.tsx +8 -11
- package/src/component/context/PreferencesContext.tsx +8 -5
- package/src/component/elements/D3Axis.tsx +1 -2
- package/src/component/elements/Sections.tsx +1 -1
- package/src/component/hooks/useActiveSpectrumRangesViewState.ts +2 -2
- package/src/component/hooks/useExport.tsx +38 -6
- package/src/component/loader/Spinner.tsx +1 -1
- package/src/component/loader/useLoadFiles.ts +67 -30
- package/src/component/main/InnerNMRium.tsx +6 -2
- package/src/component/main/NMRiumStateProvider.tsx +19 -7
- package/src/component/modal/LoadJCAMPModal.tsx +2 -3
- package/src/component/modal/MoleculeStructureEditorModal.tsx +1 -0
- package/src/component/modal/MultipletAnalysisModal.tsx +0 -2
- package/src/component/modal/SaveAsModal.tsx +29 -6
- package/src/component/modal/changeSum/ChangeSumModalContents.tsx +0 -2
- package/src/component/modal/changeSum/SelectMolecule.tsx +0 -2
- package/src/component/modal/setting/settings-tabs/DatabasesTabContent.tsx +1 -3
- package/src/component/modal/setting/settingsValidation.ts +2 -2
- package/src/component/panels/IntegralsPanel/IntegralPanel.tsx +2 -6
- package/src/component/panels/IntegralsPanel/IntegralTable.tsx +4 -3
- package/src/component/panels/MoleculesPanel/MoleculePanel.tsx +1 -2
- package/src/component/panels/MoleculesPanel/Utilities.ts +8 -6
- package/src/component/panels/MoleculesPanel/useAtomAssignment.tsx +26 -7
- package/src/component/panels/PeaksPanel/PeaksPanel.tsx +25 -35
- package/src/component/panels/PeaksPanel/PeaksTable.tsx +3 -2
- package/src/component/panels/RangesPanel/RangesHeader.tsx +3 -2
- package/src/component/panels/RangesPanel/RangesTable.tsx +10 -8
- package/src/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.tsx +3 -3
- package/src/component/panels/RangesPanel/TableColumns/RelativeColumn.tsx +2 -2
- package/src/component/panels/SpectraPanel/SpectraTable.tsx +3 -2
- package/src/component/panels/SummaryPanel/utilities/Utilities.ts +2 -2
- package/src/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumns.tsx +1 -1
- package/src/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.tsx +0 -4
- package/src/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.tsx +9 -9
- package/src/component/panels/ZonesPanel/ZonesPanel.tsx +15 -5
- package/src/component/panels/ZonesPanel/ZonesTable.tsx +9 -10
- package/src/component/panels/ZonesPanel/ZonesTableRow.tsx +0 -2
- package/src/component/panels/ZonesPanel/hooks/useMapZones.ts +11 -11
- package/src/component/panels/databasePanel/DatabasePanel.tsx +18 -14
- package/src/component/panels/filtersPanel/Filters/hooks/usePhaseCorrectionTwoDimensions.tsx +0 -2
- package/src/component/panels/multipleAnalysisPanel/preferences/MultipleAnalysisCodeEditor.tsx +0 -2
- package/src/component/reducer/Reducer.ts +14 -3
- package/src/component/reducer/actions/DatabaseActions.ts +3 -0
- package/src/component/reducer/actions/IntegralsActions.ts +1 -1
- package/src/component/reducer/actions/{LoadActions.ts → LoadAction.ts} +74 -25
- package/src/component/reducer/actions/MoleculeActions.ts +7 -8
- package/src/component/reducer/actions/RangesActions.ts +16 -25
- package/src/component/reducer/actions/ZonesActions.ts +17 -9
- package/src/component/reducer/preferences/actions/initPreferences.ts +0 -3
- package/src/component/reducer/preferences/panelsPreferencesDefaultValues.ts +2 -1
- package/src/component/reducer/preferences/preferencesReducer.ts +9 -10
- package/src/component/utility/export.ts +15 -20
- package/src/component/utility/getClosePeak.ts +1 -1
- package/src/component/utility/save_as.ts +16 -0
- package/src/data/PredictionManager.ts +21 -14
- package/src/data/SpectraManager.ts +96 -19
- package/src/data/constants/signalsKinds.ts +5 -20
- package/src/data/data1d/Spectrum1D/generateJGraphData.ts +1 -1
- package/src/data/data1d/Spectrum1D/initiateDatum1D.ts +3 -1
- package/src/data/data1d/Spectrum1D/isRangeAssigned.ts +1 -0
- package/src/data/data1d/Spectrum1D/ranges/autoRangesDetection.ts +7 -4
- package/src/data/data1d/Spectrum1D/ranges/detectRanges.ts +8 -1
- package/src/data/data1d/Spectrum1D/ranges/detectSignals.ts +1 -1
- package/src/data/data2d/Spectrum2D/contours.ts +2 -3
- package/src/data/data2d/Spectrum2D/initiateDatum2D.ts +3 -1
- package/src/data/molecules/Molecule.ts +13 -7
- package/src/data/molecules/MoleculeManager.ts +14 -8
- package/src/data/utilities/RangeUtilities.ts +12 -4
- package/src/data/utilities/ZoneUtilities.ts +1 -3
- package/src/data/utilities/isProton.ts +3 -0
- package/src/versionInfo.ts +1 -1
- package/lib/component/reducer/actions/LoadActions.d.ts.map +0 -1
- package/lib/component/reducer/actions/LoadActions.js.map +0 -1
- package/lib/component/utility/isHomoNuclear.d.ts +0 -2
- package/lib/component/utility/isHomoNuclear.d.ts.map +0 -1
- package/lib/component/utility/isHomoNuclear.js +0 -11
- package/lib/component/utility/isHomoNuclear.js.map +0 -1
- package/lib/data/types/common/SignalKind.d.ts +0 -2
- package/lib/data/types/common/SignalKind.d.ts.map +0 -1
- package/lib/data/types/common/SignalKind.js +0 -2
- package/lib/data/types/common/SignalKind.js.map +0 -1
- package/lib/utils/stringCapitalize.d.ts +0 -2
- package/lib/utils/stringCapitalize.d.ts.map +0 -1
- package/lib/utils/stringCapitalize.js +0 -4
- package/lib/utils/stringCapitalize.js.map +0 -1
- package/src/component/utility/isHomoNuclear.ts +0 -11
- package/src/data/types/common/SignalKind.ts +0 -10
- package/src/utils/stringCapitalize.ts +0 -3
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type { Signal2D, Zone } from '@zakodium/nmr-types';
|
|
1
|
+
import type { Peak2D, Signal2D, Zone } from '@zakodium/nmr-types';
|
|
2
2
|
import type { Spectrum } from '@zakodium/nmrium-core';
|
|
3
3
|
import type { Logger } from 'cheminfo-types';
|
|
4
4
|
import { xMinMaxValues } from 'ml-spectra-processing';
|
|
5
5
|
import type {
|
|
6
|
+
NMRZone,
|
|
6
7
|
Predicted,
|
|
7
8
|
Prediction1D,
|
|
8
9
|
Prediction2D,
|
|
@@ -20,7 +21,6 @@ import {
|
|
|
20
21
|
} from 'nmr-processing';
|
|
21
22
|
import { Molecule } from 'openchemlib';
|
|
22
23
|
|
|
23
|
-
import { DATUM_KIND } from './constants/signalsKinds.js';
|
|
24
24
|
import {
|
|
25
25
|
initiateDatum1D,
|
|
26
26
|
mapRanges,
|
|
@@ -28,6 +28,7 @@ import {
|
|
|
28
28
|
} from './data1d/Spectrum1D/index.js';
|
|
29
29
|
import { initiateDatum2D } from './data2d/Spectrum2D/index.js';
|
|
30
30
|
import { adjustAlpha } from './utilities/generateColor.js';
|
|
31
|
+
import { isProton } from './utilities/isProton.ts';
|
|
31
32
|
|
|
32
33
|
export type Experiment = 'proton' | 'carbon' | 'cosy' | 'hsqc' | 'hmbc';
|
|
33
34
|
type SpectraPredictionOptions = Record<Experiment, boolean>;
|
|
@@ -143,7 +144,7 @@ export function generateSpectra(
|
|
|
143
144
|
case 'hsqc':
|
|
144
145
|
case 'hmbc': {
|
|
145
146
|
const datum = generated2DSpectrum({
|
|
146
|
-
spectrum,
|
|
147
|
+
spectrum: spectrum as PredictionBase2D,
|
|
147
148
|
options,
|
|
148
149
|
experiment,
|
|
149
150
|
color,
|
|
@@ -195,7 +196,7 @@ function checkFromTo(
|
|
|
195
196
|
} else {
|
|
196
197
|
const { signals, nuclei } = predictedSpectra[experiment] as Prediction2D;
|
|
197
198
|
for (const nucleus of nuclei) {
|
|
198
|
-
const axis = nucleus
|
|
199
|
+
const axis = isProton(nucleus) ? 'x' : 'y';
|
|
199
200
|
const { from, to } = (inputOptions['1d'] as any)[nucleus];
|
|
200
201
|
const fromTo = getNewFromTo({
|
|
201
202
|
deltas: signals.map((s) => s[axis].delta),
|
|
@@ -234,7 +235,7 @@ function getNewFromTo(params: {
|
|
|
234
235
|
const { min, max } = xMinMaxValues(deltas);
|
|
235
236
|
const signalsOutOfRange = from > min || to < max;
|
|
236
237
|
if (autoExtendRange && signalsOutOfRange) {
|
|
237
|
-
const spread = nucleus
|
|
238
|
+
const spread = isProton(nucleus) ? 0.2 : 2;
|
|
238
239
|
if (from > min) from = min - spread;
|
|
239
240
|
if (to < max) to = max + spread;
|
|
240
241
|
}
|
|
@@ -307,31 +308,37 @@ function generated1DSpectrum(params: {
|
|
|
307
308
|
return datum;
|
|
308
309
|
}
|
|
309
310
|
|
|
310
|
-
function mapZones(zones:
|
|
311
|
-
return zones.map((zone:
|
|
311
|
+
function mapZones(zones: NMRZone[]): Zone[] {
|
|
312
|
+
return zones.map((zone): Zone => {
|
|
312
313
|
const { signals, ...resZone } = zone;
|
|
313
|
-
const newSignals = signals.map((signal: Signal2D
|
|
314
|
-
const { x, y, id, ...resSignal } = signal;
|
|
314
|
+
const newSignals = signals.map((signal): Signal2D => {
|
|
315
|
+
const { x, y, id, peaks, kind, ...resSignal } = signal;
|
|
315
316
|
return {
|
|
317
|
+
...resSignal,
|
|
316
318
|
id: id || crypto.randomUUID(),
|
|
317
|
-
kind: 'signal',
|
|
319
|
+
kind: kind || 'signal',
|
|
318
320
|
x: { ...x, originalDelta: x.delta || 0 },
|
|
319
321
|
y: { ...y, originalDelta: y.delta || 0 },
|
|
320
|
-
|
|
322
|
+
peaks: peaks?.map(
|
|
323
|
+
(peak): Peak2D => ({
|
|
324
|
+
...peak,
|
|
325
|
+
id: peak.id || crypto.randomUUID(),
|
|
326
|
+
}),
|
|
327
|
+
),
|
|
321
328
|
};
|
|
322
329
|
});
|
|
323
330
|
return {
|
|
324
|
-
id: crypto.randomUUID(),
|
|
325
331
|
...resZone,
|
|
332
|
+
id: crypto.randomUUID(),
|
|
326
333
|
signals: newSignals,
|
|
327
|
-
kind:
|
|
334
|
+
kind: 'signal',
|
|
328
335
|
};
|
|
329
336
|
});
|
|
330
337
|
}
|
|
331
338
|
|
|
332
339
|
function generated2DSpectrum(params: {
|
|
333
340
|
options: PredictionOptions;
|
|
334
|
-
spectrum:
|
|
341
|
+
spectrum: PredictionBase2D;
|
|
335
342
|
experiment: string;
|
|
336
343
|
color: string;
|
|
337
344
|
}) {
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type {
|
|
2
|
+
IncludeData,
|
|
2
3
|
NMRiumCore,
|
|
4
|
+
NmriumState,
|
|
5
|
+
SerializedNmriumState,
|
|
3
6
|
Spectrum,
|
|
4
7
|
StateMolecule,
|
|
5
8
|
Workspace,
|
|
@@ -10,17 +13,61 @@ import {
|
|
|
10
13
|
spectrum1DToJCAMPDX,
|
|
11
14
|
} from '@zakodium/nmrium-core-plugins';
|
|
12
15
|
import { BlobWriter, TextReader, ZipWriter } from '@zip.js/zip.js';
|
|
13
|
-
import saveAs from 'file-saver';
|
|
14
16
|
import * as OCL from 'openchemlib';
|
|
15
17
|
import { assert } from 'react-science/ui';
|
|
16
18
|
|
|
17
19
|
import type { State } from '../component/reducer/Reducer.js';
|
|
20
|
+
import { saveAs } from '../component/utility/save_as.ts';
|
|
18
21
|
|
|
19
22
|
import { initiateDatum1D, isSpectrum1D } from './data1d/Spectrum1D/index.js';
|
|
20
23
|
import { initiateDatum2D } from './data2d/Spectrum2D/index.js';
|
|
21
24
|
import * as Molecule from './molecules/Molecule.js';
|
|
22
25
|
|
|
23
|
-
|
|
26
|
+
export const DataExportOptions = {
|
|
27
|
+
/**
|
|
28
|
+
* Export the data as it is in the state, including all the raw data arrays.
|
|
29
|
+
*/
|
|
30
|
+
RAW_DATA: 'RAW_DATA',
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Export the data as it is in the state, excluding all the raw data arrays.
|
|
34
|
+
* They are replaced by empty arrays.
|
|
35
|
+
* When the nmrium file will be imported, the data will be fetched from the original source.
|
|
36
|
+
*
|
|
37
|
+
* @see State.sources
|
|
38
|
+
*/
|
|
39
|
+
DATA_SOURCE: 'DATA_SOURCE',
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Export only metadata, without any data.
|
|
43
|
+
*/
|
|
44
|
+
NO_DATA: 'NO_DATA',
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Export the state with all the data included, and without any external references.
|
|
48
|
+
* The final file will be a zip, containing all the data, including the original files.
|
|
49
|
+
* External data source will also be embedded in the archive.
|
|
50
|
+
*
|
|
51
|
+
* @experimental
|
|
52
|
+
*/
|
|
53
|
+
SELF_CONTAINED: 'SELF_CONTAINED',
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Export the state with data included and with external references.
|
|
57
|
+
* Original files will be included in the final archive.
|
|
58
|
+
* External data source will not be embedded in the archive.
|
|
59
|
+
*
|
|
60
|
+
* When the nmrium file will be imported,
|
|
61
|
+
* the data will be fetched from the original source and merged with data embedded in the archive.
|
|
62
|
+
*
|
|
63
|
+
* @experimental
|
|
64
|
+
*/
|
|
65
|
+
SELF_CONTAINED_EXTERNAL_DATASOURCE: 'SELF_CONTAINED_EXTERNAL_DATASOURCE',
|
|
66
|
+
} as const;
|
|
67
|
+
|
|
68
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
69
|
+
export type DataExportOptions =
|
|
70
|
+
(typeof DataExportOptions)[keyof typeof DataExportOptions];
|
|
24
71
|
|
|
25
72
|
type ExportTarget = 'nmrium' | 'onChange';
|
|
26
73
|
|
|
@@ -28,6 +75,7 @@ export interface ExportOptions {
|
|
|
28
75
|
dataType?: DataExportOptions;
|
|
29
76
|
view?: boolean;
|
|
30
77
|
settings?: boolean;
|
|
78
|
+
/** @default true */
|
|
31
79
|
serialize?: boolean;
|
|
32
80
|
exportTarget?: ExportTarget;
|
|
33
81
|
}
|
|
@@ -73,17 +121,29 @@ export function addJcamp(
|
|
|
73
121
|
* @param {object} state
|
|
74
122
|
* @param preferencesState
|
|
75
123
|
* @param options
|
|
124
|
+
*
|
|
125
|
+
* @returns a state serialized or not depending on the options.
|
|
126
|
+
* If serialize options is true it returns SerializedNmriumState else NmriumState
|
|
76
127
|
*/
|
|
77
128
|
export function toJSON(
|
|
78
129
|
core: NMRiumCore,
|
|
79
|
-
state:
|
|
80
|
-
|
|
130
|
+
state: Pick<
|
|
131
|
+
State,
|
|
132
|
+
| 'data'
|
|
133
|
+
| 'sources'
|
|
134
|
+
| 'molecules'
|
|
135
|
+
| 'correlations'
|
|
136
|
+
| 'actionType'
|
|
137
|
+
| 'view'
|
|
138
|
+
| 'fileCollections'
|
|
139
|
+
>,
|
|
140
|
+
preferencesState: {
|
|
81
141
|
current: Workspace;
|
|
82
|
-
}
|
|
142
|
+
},
|
|
83
143
|
options: ExportOptions = {},
|
|
84
|
-
) {
|
|
144
|
+
): NmriumState | SerializedNmriumState {
|
|
85
145
|
const {
|
|
86
|
-
|
|
146
|
+
sources,
|
|
87
147
|
data = [],
|
|
88
148
|
molecules: mols = [],
|
|
89
149
|
correlations = {},
|
|
@@ -91,7 +151,7 @@ export function toJSON(
|
|
|
91
151
|
} = state;
|
|
92
152
|
|
|
93
153
|
const {
|
|
94
|
-
dataType = '
|
|
154
|
+
dataType = 'RAW_DATA',
|
|
95
155
|
view = false,
|
|
96
156
|
settings = false,
|
|
97
157
|
serialize = true,
|
|
@@ -102,28 +162,27 @@ export function toJSON(
|
|
|
102
162
|
Molecule.toJSON(mol),
|
|
103
163
|
);
|
|
104
164
|
|
|
105
|
-
const nmriumState:
|
|
165
|
+
const nmriumState: NmriumState = {
|
|
106
166
|
version: CURRENT_EXPORT_VERSION,
|
|
107
167
|
data: {
|
|
108
168
|
...(exportTarget === 'onChange' ? { actionType } : {}),
|
|
109
|
-
source
|
|
169
|
+
sources: Object.entries(sources ?? {}).map(([id, source]) => ({
|
|
170
|
+
...source,
|
|
171
|
+
id,
|
|
172
|
+
})),
|
|
110
173
|
spectra: data,
|
|
111
174
|
molecules,
|
|
112
175
|
correlations,
|
|
113
176
|
},
|
|
114
177
|
view: state.view,
|
|
115
178
|
settings: preferencesState.current,
|
|
179
|
+
plugins: core.serializePlugins(),
|
|
116
180
|
};
|
|
117
181
|
|
|
118
182
|
if (!serialize) {
|
|
119
183
|
return nmriumState;
|
|
120
184
|
} else {
|
|
121
|
-
const includeData =
|
|
122
|
-
dataType === 'ROW_DATA'
|
|
123
|
-
? 'rawData'
|
|
124
|
-
: dataType === 'NO_DATA'
|
|
125
|
-
? 'noData'
|
|
126
|
-
: 'dataSource';
|
|
185
|
+
const includeData = dataTypeToIncludeData(dataType);
|
|
127
186
|
|
|
128
187
|
return core.serializeNmriumState(nmriumState, {
|
|
129
188
|
includeData,
|
|
@@ -133,6 +192,23 @@ export function toJSON(
|
|
|
133
192
|
}
|
|
134
193
|
}
|
|
135
194
|
|
|
195
|
+
function dataTypeToIncludeData(dataType: DataExportOptions): IncludeData {
|
|
196
|
+
switch (dataType) {
|
|
197
|
+
case 'RAW_DATA':
|
|
198
|
+
return 'rawData';
|
|
199
|
+
case 'NO_DATA':
|
|
200
|
+
return 'noData';
|
|
201
|
+
case 'DATA_SOURCE':
|
|
202
|
+
return 'dataSource';
|
|
203
|
+
case 'SELF_CONTAINED':
|
|
204
|
+
return 'selfContained';
|
|
205
|
+
case 'SELF_CONTAINED_EXTERNAL_DATASOURCE':
|
|
206
|
+
return 'selfContainedExternalDatasource';
|
|
207
|
+
default:
|
|
208
|
+
throw new Error(`Unknown dataType ${dataType as string}`);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
136
212
|
export type DataExportStage =
|
|
137
213
|
| 'originalFid'
|
|
138
214
|
| 'originalFtReal'
|
|
@@ -174,7 +250,8 @@ export function exportAsJcamp(
|
|
|
174
250
|
}
|
|
175
251
|
|
|
176
252
|
const blob = new Blob([jcamp], { type: 'text/plain' });
|
|
177
|
-
|
|
253
|
+
const name = spectrum.info.name || 'experiment';
|
|
254
|
+
saveAs({ blob, name, extension: '.jdx' });
|
|
178
255
|
}
|
|
179
256
|
|
|
180
257
|
interface ExportForCTOptions {
|
|
@@ -202,7 +279,7 @@ export async function exportForCT(options: ExportForCTOptions) {
|
|
|
202
279
|
if (!jcamp) {
|
|
203
280
|
throw new Error('Failed to convert the 1D spectrum to JCAMP');
|
|
204
281
|
}
|
|
205
|
-
const name = spectrum.info.name;
|
|
282
|
+
const name = spectrum.info.name || 'experiment';
|
|
206
283
|
const zip = new ZipWriter(new BlobWriter());
|
|
207
284
|
|
|
208
285
|
//add jcamp file
|
|
@@ -219,5 +296,5 @@ export async function exportForCT(options: ExportForCTOptions) {
|
|
|
219
296
|
await zip.add(`${molFileName}.mol`, new TextReader(ctMolfile));
|
|
220
297
|
|
|
221
298
|
const blob = await zip.close();
|
|
222
|
-
saveAs(blob,
|
|
299
|
+
saveAs({ blob, name, extension: '.zip' });
|
|
223
300
|
}
|
|
@@ -1,26 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
const KINDS: SignalKind[] = [
|
|
5
|
-
'undefined',
|
|
6
|
-
'signal',
|
|
7
|
-
'reference',
|
|
8
|
-
'solvent',
|
|
9
|
-
'standard',
|
|
10
|
-
'p1',
|
|
11
|
-
'p2',
|
|
12
|
-
'p3',
|
|
13
|
-
];
|
|
1
|
+
import type { SignalKind } from '@zakodium/nmr-types';
|
|
2
|
+
import { signalKindLabelMapping } from 'nmr-processing';
|
|
14
3
|
|
|
15
4
|
interface SignalKindItem {
|
|
16
5
|
value: SignalKind;
|
|
17
6
|
label: string;
|
|
18
7
|
}
|
|
19
8
|
|
|
20
|
-
export const SIGNAL_KINDS: SignalKindItem[] =
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}));
|
|
24
|
-
|
|
25
|
-
export const SIGNAL_INCLUDED_KINDS: SignalKind[] = ['signal'];
|
|
26
|
-
export const DATUM_KIND = { signal: 'signal', mixed: 'mixed' } as const;
|
|
9
|
+
export const SIGNAL_KINDS: SignalKindItem[] = Object.entries(
|
|
10
|
+
signalKindLabelMapping,
|
|
11
|
+
).map(([kind, label]) => ({ value: kind as SignalKind, label }));
|
|
@@ -80,7 +80,7 @@ function createLinks(ranges: Range[], jGraphTolerance = 0) {
|
|
|
80
80
|
const couplings = getCouplings(ranges);
|
|
81
81
|
couplings.sort((a, b) => a.coupling - b.coupling);
|
|
82
82
|
|
|
83
|
-
if (
|
|
83
|
+
if (couplings.length === 0) return [];
|
|
84
84
|
|
|
85
85
|
const links: CouplingLink[] = [initLink(couplings[0])];
|
|
86
86
|
|
|
@@ -19,17 +19,19 @@ interface InitiateDatum1DOptions {
|
|
|
19
19
|
usedColors?: UsedColors;
|
|
20
20
|
molecules?: StateMoleculeExtended[];
|
|
21
21
|
colors?: SpectrumOneDimensionColor[];
|
|
22
|
+
fileCollectionId?: string | undefined;
|
|
22
23
|
}
|
|
23
24
|
|
|
24
25
|
export function initiateDatum1D(
|
|
25
26
|
spectrum: any,
|
|
26
27
|
options: InitiateDatum1DOptions = {},
|
|
27
28
|
): Spectrum1D {
|
|
28
|
-
const { usedColors, colors, molecules = [] } = options;
|
|
29
|
+
const { usedColors, colors, molecules = [], fileCollectionId } = options;
|
|
29
30
|
|
|
30
31
|
const { integrals, ranges, ...restSpectrum } = spectrum;
|
|
31
32
|
const spectrumObj: Spectrum1D = { ...restSpectrum };
|
|
32
33
|
spectrumObj.id = spectrum.id || crypto.randomUUID();
|
|
34
|
+
spectrumObj.fileCollectionId = spectrum.fileCollectionId || fileCollectionId;
|
|
33
35
|
|
|
34
36
|
spectrumObj.display = {
|
|
35
37
|
isVisible: true,
|
|
@@ -2,6 +2,8 @@ import type { Range } from '@zakodium/nmr-types';
|
|
|
2
2
|
import type { Spectrum1D } from '@zakodium/nmrium-core';
|
|
3
3
|
import { xyAutoRangesPicking } from 'nmr-processing';
|
|
4
4
|
|
|
5
|
+
import { isProton } from '../../../utilities/isProton.ts';
|
|
6
|
+
|
|
5
7
|
const defaultPeakPickingOptions = {
|
|
6
8
|
minMaxRatio: 1,
|
|
7
9
|
shape: { kind: 'lorentzian' },
|
|
@@ -34,14 +36,15 @@ export default function autoRangesDetection(
|
|
|
34
36
|
frequency: originFrequency,
|
|
35
37
|
};
|
|
36
38
|
|
|
39
|
+
const isProtonic = isProton(nucleus);
|
|
37
40
|
const rangesOptions = {
|
|
38
41
|
nucleus,
|
|
39
|
-
clean: 0.
|
|
42
|
+
clean: 0.5,
|
|
40
43
|
keepPeaks: true,
|
|
41
|
-
compile:
|
|
44
|
+
compile: isProtonic,
|
|
42
45
|
frequency: originFrequency,
|
|
43
|
-
joinOverlapRanges:
|
|
44
|
-
frequencyCluster:
|
|
46
|
+
joinOverlapRanges: isProtonic,
|
|
47
|
+
frequencyCluster: isProtonic ? 13 : 0,
|
|
45
48
|
...rangePicking,
|
|
46
49
|
};
|
|
47
50
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Spectrum1D } from '@zakodium/nmrium-core';
|
|
2
2
|
import { mapRanges, updateRangesRelativeValues } from 'nmr-processing';
|
|
3
3
|
|
|
4
|
+
import { isProton } from '../../../utilities/isProton.ts';
|
|
4
5
|
import type { SumParams } from '../SumManager.js';
|
|
5
6
|
import { initSumOptions } from '../SumManager.js';
|
|
6
7
|
|
|
@@ -32,11 +33,17 @@ export function detectRanges(
|
|
|
32
33
|
) {
|
|
33
34
|
const { molecules, nucleus, ...detectOptions } = options;
|
|
34
35
|
detectOptions.impurities = { solvent: spectrum.info.solvent || '' };
|
|
35
|
-
|
|
36
|
+
|
|
36
37
|
spectrum.ranges.options = initSumOptions(spectrum.ranges.options, {
|
|
37
38
|
molecules,
|
|
38
39
|
nucleus,
|
|
39
40
|
});
|
|
41
|
+
|
|
42
|
+
if (isProton(nucleus)) {
|
|
43
|
+
detectOptions.rangePicking.integrationSum = spectrum.ranges.options.sum;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const ranges = autoRangesDetection(spectrum, detectOptions);
|
|
40
47
|
spectrum.ranges.values = spectrum.ranges.values.concat(
|
|
41
48
|
mapRanges(ranges, spectrum),
|
|
42
49
|
);
|
|
@@ -56,8 +56,7 @@ function getDefaultContoursLevel(spectrum: Spectrum2D, quadrant = 'rr') {
|
|
|
56
56
|
//@ts-expect-error will be included in nexts versions
|
|
57
57
|
const { noise = calculateSanPlot('2D', quadrantData) } = info;
|
|
58
58
|
|
|
59
|
-
const { positive, negative } = noise;
|
|
60
|
-
|
|
59
|
+
const { positive = 0, negative = 0 } = noise;
|
|
61
60
|
const max = Math.max(
|
|
62
61
|
Math.abs(quadrantData.minZ),
|
|
63
62
|
Math.abs(quadrantData.maxZ),
|
|
@@ -220,9 +219,9 @@ function getContours(options: ContoursCalcOptions) {
|
|
|
220
219
|
const ys = getRange(data.minY, data.maxY, data.z.length);
|
|
221
220
|
const conrec = new Conrec(data.z, { xs, ys, swapAxes: false });
|
|
222
221
|
const max = Math.max(Math.abs(data.minZ), Math.abs(data.maxZ));
|
|
222
|
+
|
|
223
223
|
const minLevel = calculateValueOfLevel(boundary[0], max);
|
|
224
224
|
const maxLevel = calculateValueOfLevel(boundary[1], max);
|
|
225
|
-
|
|
226
225
|
const diffRange = boundary[1] - boundary[0];
|
|
227
226
|
|
|
228
227
|
let _range = getRange(minLevel, maxLevel, Math.min(nbLevels, diffRange), 2);
|
|
@@ -19,6 +19,7 @@ const defaultMinMax = { z: [], minX: 0, minY: 0, maxX: 0, maxY: 0 };
|
|
|
19
19
|
interface InitiateDatum2DOptions {
|
|
20
20
|
usedColors?: UsedColors;
|
|
21
21
|
colors?: SpectrumTwoDimensionsColor[];
|
|
22
|
+
fileCollectionId?: string;
|
|
22
23
|
}
|
|
23
24
|
|
|
24
25
|
function initiateDisplay(spectrum: any, options: InitiateDatum2DOptions) {
|
|
@@ -59,10 +60,11 @@ export function initiateDatum2D(
|
|
|
59
60
|
spectrum: any,
|
|
60
61
|
options: InitiateDatum2DOptions = {},
|
|
61
62
|
): Spectrum2D {
|
|
62
|
-
const { usedColors, colors } = options;
|
|
63
|
+
const { usedColors, colors, fileCollectionId } = options;
|
|
63
64
|
const datum: any = { ...spectrum };
|
|
64
65
|
|
|
65
66
|
datum.id = spectrum.id || crypto.randomUUID();
|
|
67
|
+
datum.fileCollectionId = spectrum.fileCollectionId || fileCollectionId;
|
|
66
68
|
|
|
67
69
|
datum.display = initiateDisplay(spectrum, { usedColors, colors });
|
|
68
70
|
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
+
import type { StateMolecule } from '@zakodium/nmrium-core';
|
|
1
2
|
import { Molecule } from 'openchemlib';
|
|
2
3
|
|
|
3
4
|
import getAtomsFromMF from '../utilities/getAtomsFromMF.js';
|
|
4
5
|
|
|
5
|
-
export interface
|
|
6
|
-
id
|
|
7
|
-
|
|
8
|
-
label?: string;
|
|
9
|
-
}
|
|
10
|
-
export interface StateMoleculeExtended extends Required<StateMolecule> {
|
|
6
|
+
export interface StateMoleculeExtended
|
|
7
|
+
extends Required<Pick<StateMolecule, 'id' | 'molfile' | 'label'>>,
|
|
8
|
+
Omit<StateMolecule, 'id' | 'molfile' | 'label'> {
|
|
11
9
|
mf: string;
|
|
12
10
|
em: number;
|
|
13
11
|
mw: number;
|
|
@@ -61,6 +59,9 @@ export function initMolecule(
|
|
|
61
59
|
id,
|
|
62
60
|
molfile,
|
|
63
61
|
label,
|
|
62
|
+
sourceSelector: options.sourceSelector,
|
|
63
|
+
sourceId: options.sourceId,
|
|
64
|
+
fileCollectionId: options.fileCollectionId,
|
|
64
65
|
mf: mfInfo.formula,
|
|
65
66
|
em: mfInfo.absoluteWeight,
|
|
66
67
|
mw: mfInfo.relativeWeight,
|
|
@@ -70,10 +71,15 @@ export function initMolecule(
|
|
|
70
71
|
}
|
|
71
72
|
|
|
72
73
|
export function toJSON(molecule: StateMoleculeExtended): StateMolecule {
|
|
73
|
-
const { molfile, label, id } =
|
|
74
|
+
const { molfile, label, id, fileCollectionId, sourceSelector, sourceId } =
|
|
75
|
+
molecule;
|
|
76
|
+
|
|
74
77
|
return {
|
|
75
78
|
molfile,
|
|
76
79
|
label,
|
|
77
80
|
id,
|
|
81
|
+
fileCollectionId,
|
|
82
|
+
sourceSelector,
|
|
83
|
+
sourceId,
|
|
78
84
|
};
|
|
79
85
|
}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
+
import type { StateMolecule } from '@zakodium/nmrium-core';
|
|
1
2
|
import { readSDF, readSMILES } from '@zakodium/nmrium-core-plugins';
|
|
2
3
|
import { Molecule } from 'openchemlib';
|
|
3
4
|
|
|
4
|
-
import type {
|
|
5
|
+
import type { StateMoleculeExtended } from './Molecule.js';
|
|
5
6
|
import { initMolecule } from './Molecule.js';
|
|
6
7
|
|
|
7
8
|
//TODO: Move molecule initialization to nmrium-core and log an error if the molecule cannot be parsed.
|
|
8
9
|
export function fromJSON(
|
|
9
10
|
mols: StateMolecule[],
|
|
11
|
+
fileCollectionId: string | undefined,
|
|
10
12
|
reservedMolecules: StateMolecule[] = [],
|
|
11
13
|
) {
|
|
12
14
|
const reservedNumbers = extractLabelsNumbers(reservedMolecules.concat(mols));
|
|
@@ -21,13 +23,17 @@ export function fromJSON(
|
|
|
21
23
|
continue;
|
|
22
24
|
}
|
|
23
25
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
)
|
|
26
|
+
const moleculeOverride = {
|
|
27
|
+
...mol,
|
|
28
|
+
molfile: molecule.toMolfileV3(),
|
|
29
|
+
label: mol.label || `P${getLabelNumber(reservedNumbers)}`,
|
|
30
|
+
id: mol.id,
|
|
31
|
+
};
|
|
32
|
+
if (fileCollectionId) {
|
|
33
|
+
moleculeOverride.fileCollectionId = fileCollectionId;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
molecules.push(initMolecule(moleculeOverride));
|
|
31
37
|
}
|
|
32
38
|
|
|
33
39
|
return molecules;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import type { Range, Signal1D } from '@zakodium/nmr-types';
|
|
2
2
|
import omit from 'lodash/omit.js';
|
|
3
3
|
|
|
4
|
-
import { DATUM_KIND } from '../constants/signalsKinds.js';
|
|
5
|
-
|
|
6
4
|
function resetDiaIDs(range: Range) {
|
|
7
5
|
const deletedKeys = ['diaIDs', 'nbAtoms'];
|
|
8
6
|
range = omit(range, deletedKeys) as Range;
|
|
@@ -50,6 +48,16 @@ export function unlink(range: Range, options: UnlinkOptions = {}): Range {
|
|
|
50
48
|
return range;
|
|
51
49
|
}
|
|
52
50
|
|
|
53
|
-
export function
|
|
54
|
-
|
|
51
|
+
export function getOpacityBasedOnSignalKind(input: Range | Signal1D) {
|
|
52
|
+
const isSignal =
|
|
53
|
+
'signals' in input ? isSignalRange(input) : isSignalKind(input);
|
|
54
|
+
return isSignal ? 1 : 0.3;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function isSignalKind(signal: Signal1D) {
|
|
58
|
+
return signal.kind === 'signal';
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export function isSignalRange(range: Range) {
|
|
62
|
+
return range.signals.every(isSignalKind);
|
|
55
63
|
}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import type { Zone } from '@zakodium/nmr-types';
|
|
2
2
|
|
|
3
|
-
import { DATUM_KIND } from '../constants/signalsKinds.js';
|
|
4
|
-
|
|
5
3
|
function getNbAtoms(zone: Zone, axis: 'x' | 'y') {
|
|
6
4
|
let sum = 0;
|
|
7
5
|
if (zone.signals) {
|
|
@@ -30,7 +28,7 @@ function resetDiaIDs(zone: Zone, axis: 'x' | 'y') {
|
|
|
30
28
|
}
|
|
31
29
|
|
|
32
30
|
export function checkZoneKind(zone: Zone): boolean {
|
|
33
|
-
return zone.kind ===
|
|
31
|
+
return zone.kind === 'signal';
|
|
34
32
|
}
|
|
35
33
|
|
|
36
34
|
export function unlink(
|
package/src/versionInfo.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default { version: 'v1.
|
|
1
|
+
export default { version: 'v1.7.0' };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LoadActions.d.ts","sourceRoot":"","sources":["../../../../src/component/reducer/actions/LoadActions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,aAAa,EAGd,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAMnC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAO7C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAE/D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAOzD,UAAU,aAAa;IACrB,WAAW,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;CACnC;AACD,UAAU,UAAW,SAAQ,aAAa;IACxC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,mBAAmB,CAAC,EAAE,WAAW,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;IAC9C,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,aAAa,CAAC,EAAE,aAAa,CAAC;CAC/B;AAED,KAAK,kBAAkB,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AC,CAAC;QACxB,YAAY,CAAC,KAAK,EAAE;YAClB,aAAa,EAAE,EAAE,kBAAkB,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE;SACrE,CAAC,CAAC;QACH,+BAA+B,CAAC,KAAK,EAAE,EAAE,aAAa,EAAE,YAAY,EAAE,CAAC,CAAC;QAExE,iHAAiH;QACjH,IAAI,iBAAiB,IAAI,OAAO,EAAE,MAAM,GAAG,CAAC,EAAE,CAAC;YAC7C,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC;QAC3B,CAAC;QAED,KAAK,CAAC,UAAU,GAAG,IAAI,CAAC;QACxB,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC;QACxB,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC;AAED,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"isHomoNuclear.d.ts","sourceRoot":"","sources":["../../../src/component/utility/isHomoNuclear.ts"],"names":[],"mappings":"AAAA,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,cAAc,SAAM,WAU5E"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export function isHomoNuclear(nuclei, splitSeparator = ',') {
|
|
2
|
-
let parts = [];
|
|
3
|
-
if (typeof nuclei === 'string') {
|
|
4
|
-
parts = nuclei.split(splitSeparator).map((s) => s.trim());
|
|
5
|
-
}
|
|
6
|
-
else {
|
|
7
|
-
parts = nuclei;
|
|
8
|
-
}
|
|
9
|
-
return parts.length === 1 || parts.every((p) => p === parts[0]);
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=isHomoNuclear.js.map
|