nmrium 1.6.0 → 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 +7 -5
- 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 +8 -5
- 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
|
@@ -59,6 +59,7 @@ function handleResurrectSpectrum(
|
|
|
59
59
|
ranges,
|
|
60
60
|
signals,
|
|
61
61
|
solvent,
|
|
62
|
+
meta = {},
|
|
62
63
|
names = [],
|
|
63
64
|
id: spectrumID,
|
|
64
65
|
} = databaseEntry;
|
|
@@ -114,6 +115,8 @@ function handleResurrectSpectrum(
|
|
|
114
115
|
|
|
115
116
|
if (!resurrectedSpectrum) return;
|
|
116
117
|
|
|
118
|
+
resurrectedSpectrum.customInfo = meta;
|
|
119
|
+
|
|
117
120
|
draft.data.push(resurrectedSpectrum);
|
|
118
121
|
|
|
119
122
|
setDomain(draft, { isYDomainShared: false });
|
|
@@ -106,7 +106,7 @@ function addIntegral(datum: Spectrum1D, options: AddIntegralOptions) {
|
|
|
106
106
|
|
|
107
107
|
const shiftX = getShiftX(datum);
|
|
108
108
|
const integration = xyIntegration({ x, y: re }, { from, to });
|
|
109
|
-
const integral = {
|
|
109
|
+
const integral: Integral = {
|
|
110
110
|
id: crypto.randomUUID(),
|
|
111
111
|
originalFrom: from - shiftX,
|
|
112
112
|
originalTo: to - shiftX,
|
|
@@ -4,6 +4,7 @@ import type {
|
|
|
4
4
|
Spectrum,
|
|
5
5
|
ViewState,
|
|
6
6
|
} from '@zakodium/nmrium-core';
|
|
7
|
+
import type { FileCollection } from 'file-collection';
|
|
7
8
|
import type { Draft } from 'immer';
|
|
8
9
|
import { produce } from 'immer';
|
|
9
10
|
import lodashMerge from 'lodash/merge.js';
|
|
@@ -30,6 +31,7 @@ import { setActiveTab } from './ToolsActions.js';
|
|
|
30
31
|
//TODO use viewState type instead of any { view?: ViewState }
|
|
31
32
|
interface InitiateProps {
|
|
32
33
|
nmriumState: Partial<NmriumState>;
|
|
34
|
+
fileCollections?: Map<string, FileCollection>;
|
|
33
35
|
}
|
|
34
36
|
interface InputProps extends InitiateProps {
|
|
35
37
|
containsNmrium?: boolean;
|
|
@@ -37,6 +39,7 @@ interface InputProps extends InitiateProps {
|
|
|
37
39
|
parseMetaFileResult?: ParseResult<any> | null;
|
|
38
40
|
resetSourceObject?: boolean;
|
|
39
41
|
spectraColors?: SpectraColors;
|
|
42
|
+
fileCollection?: FileCollection;
|
|
40
43
|
}
|
|
41
44
|
|
|
42
45
|
type SetIsLoadingAction = ActionType<
|
|
@@ -48,7 +51,7 @@ type SetIsLoadingAction = ActionType<
|
|
|
48
51
|
type LoadDropFilesAction = ActionType<'LOAD_DROP_FILES', InputProps>;
|
|
49
52
|
type InitiateAction = ActionType<'INITIATE', InitiateProps>;
|
|
50
53
|
|
|
51
|
-
export type
|
|
54
|
+
export type LoadAction =
|
|
52
55
|
| SetIsLoadingAction
|
|
53
56
|
| LoadDropFilesAction
|
|
54
57
|
| InitiateAction;
|
|
@@ -89,23 +92,25 @@ function setCorrelation(draft: Draft<State>, correlations: CorrelationData) {
|
|
|
89
92
|
}
|
|
90
93
|
}
|
|
91
94
|
|
|
92
|
-
function setData(draft: Draft<State>, input: InputProps) {
|
|
95
|
+
function setData(draft: Draft<State>, input: InputProps | InitiateProps) {
|
|
96
|
+
const { data, view } = input.nmriumState || {
|
|
97
|
+
data: { spectra: [], molecules: [], correlations: {} },
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
const parseMetaFileResult =
|
|
101
|
+
'parseMetaFileResult' in input ? input.parseMetaFileResult || null : null;
|
|
102
|
+
|
|
93
103
|
const {
|
|
94
|
-
nmriumState: { data, view },
|
|
95
|
-
parseMetaFileResult = null,
|
|
96
104
|
spectraColors = {
|
|
97
105
|
oneDimension: [],
|
|
98
106
|
twoDimensions: [],
|
|
99
107
|
highlightColor: '#ffd70080',
|
|
100
108
|
indicatorLineColor: '#2FFF0085',
|
|
101
109
|
},
|
|
102
|
-
} = input
|
|
103
|
-
nmriumState: { data: { spectra: [], molecules: [], correlations: {} } },
|
|
104
|
-
multipleAnalysis: {},
|
|
105
|
-
};
|
|
110
|
+
} = 'spectraColors' in input ? input : { spectraColors: undefined };
|
|
106
111
|
|
|
107
112
|
const {
|
|
108
|
-
|
|
113
|
+
sources,
|
|
109
114
|
spectra = [],
|
|
110
115
|
molecules = [],
|
|
111
116
|
correlations = {},
|
|
@@ -116,28 +121,50 @@ function setData(draft: Draft<State>, input: InputProps) {
|
|
|
116
121
|
draft.view = lodashMerge(defaultViewState, view);
|
|
117
122
|
}
|
|
118
123
|
|
|
119
|
-
if (
|
|
120
|
-
|
|
121
|
-
draft.source
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
124
|
+
if (sources && sources.length > 0) {
|
|
125
|
+
for (const source of sources) {
|
|
126
|
+
if (draft.sources[source.id]) {
|
|
127
|
+
draft.sources[source.id] = lodashMergeWith(
|
|
128
|
+
draft.sources[source.id],
|
|
129
|
+
source,
|
|
130
|
+
(objValue: any, srcValue: any) => {
|
|
131
|
+
if (Array.isArray(objValue)) {
|
|
132
|
+
return objValue.concat(srcValue);
|
|
133
|
+
}
|
|
134
|
+
return undefined;
|
|
135
|
+
},
|
|
136
|
+
);
|
|
137
|
+
} else {
|
|
138
|
+
draft.sources[source.id] = source;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
130
141
|
}
|
|
142
|
+
|
|
143
|
+
updateFileCollections(draft, input);
|
|
144
|
+
|
|
145
|
+
const fileCollectionId =
|
|
146
|
+
'fileCollection' in input
|
|
147
|
+
? sources?.at(-1)?.id || crypto.randomUUID()
|
|
148
|
+
: undefined;
|
|
149
|
+
const fileCollection =
|
|
150
|
+
'fileCollection' in input ? input.fileCollection : undefined;
|
|
151
|
+
|
|
131
152
|
draft.molecules = draft.molecules.concat(
|
|
132
|
-
MoleculeManager.fromJSON(molecules, draft.molecules),
|
|
153
|
+
MoleculeManager.fromJSON(molecules, fileCollectionId, draft.molecules),
|
|
133
154
|
);
|
|
155
|
+
|
|
134
156
|
draft.data = draft.data.concat(
|
|
135
157
|
initSpectra(spectra, {
|
|
136
158
|
usedColors: draft.usedColors,
|
|
137
159
|
molecules: draft.molecules,
|
|
138
160
|
spectraColors,
|
|
161
|
+
fileCollectionId,
|
|
139
162
|
}),
|
|
140
163
|
);
|
|
164
|
+
if (fileCollection && fileCollectionId) {
|
|
165
|
+
draft.fileCollections ??= {};
|
|
166
|
+
draft.fileCollections[fileCollectionId] = fileCollection;
|
|
167
|
+
}
|
|
141
168
|
setCorrelation(draft, correlations);
|
|
142
169
|
|
|
143
170
|
if (parseMetaFileResult) {
|
|
@@ -156,10 +183,11 @@ function initSpectra(
|
|
|
156
183
|
usedColors: UsedColors;
|
|
157
184
|
molecules: StateMoleculeExtended[];
|
|
158
185
|
spectraColors: SpectraColors;
|
|
186
|
+
fileCollectionId: string | undefined;
|
|
159
187
|
},
|
|
160
188
|
) {
|
|
161
189
|
const spectra: any = [];
|
|
162
|
-
const { usedColors, molecules, spectraColors } = options;
|
|
190
|
+
const { usedColors, molecules, spectraColors, fileCollectionId } = options;
|
|
163
191
|
for (const spectrum of inputSpectra) {
|
|
164
192
|
const { info } = spectrum;
|
|
165
193
|
if (info.dimension === 1) {
|
|
@@ -168,13 +196,14 @@ function initSpectra(
|
|
|
168
196
|
usedColors,
|
|
169
197
|
molecules,
|
|
170
198
|
colors: spectraColors.oneDimension,
|
|
199
|
+
fileCollectionId,
|
|
171
200
|
}),
|
|
172
201
|
);
|
|
173
202
|
} else if (info.dimension === 2) {
|
|
174
203
|
spectra.push(
|
|
175
204
|
initiateDatum2D(
|
|
176
205
|
{ ...spectrum },
|
|
177
|
-
{ usedColors, colors: spectraColors.twoDimensions },
|
|
206
|
+
{ usedColors, colors: spectraColors.twoDimensions, fileCollectionId },
|
|
178
207
|
),
|
|
179
208
|
);
|
|
180
209
|
}
|
|
@@ -199,6 +228,21 @@ function setPreferences(draft: Draft<State>, data: ViewState) {
|
|
|
199
228
|
}
|
|
200
229
|
}
|
|
201
230
|
|
|
231
|
+
function updateFileCollections(
|
|
232
|
+
draft: Draft<State>,
|
|
233
|
+
payload: Pick<InitiateProps, 'fileCollections'>,
|
|
234
|
+
) {
|
|
235
|
+
const fileCollections = payload.fileCollections;
|
|
236
|
+
if (!fileCollections) return;
|
|
237
|
+
|
|
238
|
+
if (fileCollections.size > 0) {
|
|
239
|
+
draft.fileCollections ??= {};
|
|
240
|
+
}
|
|
241
|
+
for (const [id, fc] of fileCollections) {
|
|
242
|
+
draft.fileCollections[id] = fc;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
202
246
|
function initData(
|
|
203
247
|
draft: Draft<State>,
|
|
204
248
|
action: LoadDropFilesAction | InitiateAction,
|
|
@@ -228,6 +272,7 @@ function initData(
|
|
|
228
272
|
initialDraft.actionType = action.type;
|
|
229
273
|
});
|
|
230
274
|
} else {
|
|
275
|
+
updateFileCollections(draft, action.payload);
|
|
231
276
|
if (view) {
|
|
232
277
|
const defaultViewState = getDefaultViewState();
|
|
233
278
|
draft.view = lodashMerge(defaultViewState, view);
|
|
@@ -271,7 +316,7 @@ function handleLoadDropFiles(draft: Draft<State>, action: LoadDropFilesAction) {
|
|
|
271
316
|
|
|
272
317
|
// set source undefined when dragging and dropping a spectra file to prevent export spectra with the data source.
|
|
273
318
|
if (resetSourceObject && spectra?.length > 0) {
|
|
274
|
-
draft.
|
|
319
|
+
draft.sources = {};
|
|
275
320
|
}
|
|
276
321
|
|
|
277
322
|
draft.actionType = type;
|
|
@@ -280,4 +325,8 @@ function handleLoadDropFiles(draft: Draft<State>, action: LoadDropFilesAction) {
|
|
|
280
325
|
}
|
|
281
326
|
}
|
|
282
327
|
|
|
283
|
-
export
|
|
328
|
+
export const LoadActions = {
|
|
329
|
+
handleInitiate,
|
|
330
|
+
handleLoadDropFiles,
|
|
331
|
+
handleSetIsLoading,
|
|
332
|
+
} as const;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { StateMolecule } from '@zakodium/nmrium-core';
|
|
1
2
|
import type { Logger } from 'cheminfo-types';
|
|
2
3
|
import type { FifoLogger } from 'fifo-logger';
|
|
3
4
|
import type { Draft } from 'immer';
|
|
@@ -12,10 +13,7 @@ import type {
|
|
|
12
13
|
} from '../../../data/PredictionManager.js';
|
|
13
14
|
import { generateSpectra } from '../../../data/PredictionManager.js';
|
|
14
15
|
import { changeSpectraRelativeSum } from '../../../data/data1d/Spectrum1D/SumManager.js';
|
|
15
|
-
import type {
|
|
16
|
-
MoleculeBoundingRect,
|
|
17
|
-
StateMolecule,
|
|
18
|
-
} from '../../../data/molecules/Molecule.js';
|
|
16
|
+
import type { MoleculeBoundingRect } from '../../../data/molecules/Molecule.js';
|
|
19
17
|
import { DRAGGABLE_STRUCTURE_INITIAL_BOUNDING_REACT } from '../../../data/molecules/Molecule.js';
|
|
20
18
|
import * as MoleculeManager from '../../../data/molecules/MoleculeManager.js';
|
|
21
19
|
import { generateColor } from '../../../data/utilities/generateColor.js';
|
|
@@ -41,9 +39,10 @@ type AddMoleculesAction = ActionType<
|
|
|
41
39
|
>;
|
|
42
40
|
type SetMoleculeAction = ActionType<
|
|
43
41
|
'SET_MOLECULE',
|
|
44
|
-
Required<StateMolecule
|
|
45
|
-
|
|
46
|
-
|
|
42
|
+
Required<Pick<StateMolecule, 'id' | 'molfile' | 'label'>> &
|
|
43
|
+
Omit<StateMolecule, 'id' | 'molfile' | 'label'> & {
|
|
44
|
+
mappings?: ReturnType<TopicMolecule['getDiaIDsMapping']>;
|
|
45
|
+
}
|
|
47
46
|
>;
|
|
48
47
|
type DeleteMoleculeAction = ActionType<'DELETE_MOLECULE', { id: string }>;
|
|
49
48
|
type PredictSpectraFromMoleculeAction = ActionType<
|
|
@@ -209,7 +208,7 @@ function handlePredictSpectraFromMolecule(
|
|
|
209
208
|
});
|
|
210
209
|
id = moleculeObj?.id;
|
|
211
210
|
} else {
|
|
212
|
-
setMolecule(draft,
|
|
211
|
+
setMolecule(draft, { id: crypto.randomUUID(), label: '', ...molecule });
|
|
213
212
|
}
|
|
214
213
|
|
|
215
214
|
if (id) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Range, Signal1D } from '@zakodium/nmr-types';
|
|
1
|
+
import type { Range, Signal1D, SignalKind } from '@zakodium/nmr-types';
|
|
2
2
|
import type {
|
|
3
3
|
BoundingBox,
|
|
4
4
|
RangesViewState,
|
|
@@ -11,10 +11,6 @@ import cloneDeep from 'lodash/cloneDeep.js';
|
|
|
11
11
|
import { xFindClosestIndex } from 'ml-spectra-processing';
|
|
12
12
|
import { Filters1DManager } from 'nmr-processing';
|
|
13
13
|
|
|
14
|
-
import {
|
|
15
|
-
DATUM_KIND,
|
|
16
|
-
SIGNAL_INCLUDED_KINDS,
|
|
17
|
-
} from '../../../data/constants/signalsKinds.js';
|
|
18
14
|
import type {
|
|
19
15
|
SetSumOptions,
|
|
20
16
|
SumParams,
|
|
@@ -32,6 +28,7 @@ import {
|
|
|
32
28
|
} from '../../../data/data1d/Spectrum1D/index.js';
|
|
33
29
|
import type { ChangeRangeRelativeValueProps } from '../../../data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.js';
|
|
34
30
|
import { unlink } from '../../../data/utilities/RangeUtilities.js';
|
|
31
|
+
import { isProton } from '../../../data/utilities/isProton.ts';
|
|
35
32
|
import type { TargetAssignKeys } from '../../panels/MoleculesPanel/Utilities.js';
|
|
36
33
|
import type { RangeData } from '../../panels/RangesPanel/hooks/useMapRanges.js';
|
|
37
34
|
import type { FilterType } from '../../utility/filterType.js';
|
|
@@ -67,7 +64,7 @@ type DeleteRangeAction = ActionType<
|
|
|
67
64
|
type ChangeRangeSignalKindAction = ActionType<
|
|
68
65
|
'CHANGE_RANGE_SIGNAL_KIND',
|
|
69
66
|
{
|
|
70
|
-
kind:
|
|
67
|
+
kind: SignalKind;
|
|
71
68
|
range: RangeData;
|
|
72
69
|
}
|
|
73
70
|
>;
|
|
@@ -206,14 +203,7 @@ function handleAutoRangesDetection(
|
|
|
206
203
|
draft: Draft<State>,
|
|
207
204
|
action: AutoRangesDetectionAction,
|
|
208
205
|
) {
|
|
209
|
-
const {
|
|
210
|
-
data,
|
|
211
|
-
xDomain,
|
|
212
|
-
molecules,
|
|
213
|
-
view: {
|
|
214
|
-
spectra: { activeTab: nucleus },
|
|
215
|
-
},
|
|
216
|
-
} = draft;
|
|
206
|
+
const { data, xDomain, molecules } = draft;
|
|
217
207
|
|
|
218
208
|
const activeSpectrum = getActiveSpectrum(draft);
|
|
219
209
|
|
|
@@ -228,14 +218,17 @@ function handleAutoRangesDetection(
|
|
|
228
218
|
// minMaxRatio default 0.05, lookNegative default false,
|
|
229
219
|
const { minMaxRatio, lookNegative } = action.payload;
|
|
230
220
|
|
|
221
|
+
const nucleus = datum.info.nucleus;
|
|
222
|
+
const isProtonic = isProton(nucleus);
|
|
223
|
+
|
|
231
224
|
const detectionOptions: any = {
|
|
232
225
|
rangePicking: {
|
|
233
226
|
integrationSum: 100,
|
|
234
|
-
compile:
|
|
235
|
-
frequencyCluster:
|
|
236
|
-
clean: 0.
|
|
227
|
+
compile: isProtonic,
|
|
228
|
+
frequencyCluster: isProtonic ? 16 : 0,
|
|
229
|
+
clean: 0.5,
|
|
237
230
|
keepPeaks: true,
|
|
238
|
-
joinOverlapRanges:
|
|
231
|
+
joinOverlapRanges: isProtonic,
|
|
239
232
|
},
|
|
240
233
|
peakPicking: {
|
|
241
234
|
smoothY: false,
|
|
@@ -269,13 +262,14 @@ function handleAutoSpectraRangesDetection(draft: Draft<State>) {
|
|
|
269
262
|
for (const datum of data) {
|
|
270
263
|
if (datum.info.dimension === 1) {
|
|
271
264
|
const nucleus = datum.info.nucleus as string;
|
|
265
|
+
const isProtonic = isProton(nucleus);
|
|
272
266
|
const rangePicking = {
|
|
273
267
|
integrationSum: 100,
|
|
274
|
-
compile:
|
|
275
|
-
frequencyCluster:
|
|
276
|
-
clean: 0.
|
|
268
|
+
compile: isProtonic,
|
|
269
|
+
frequencyCluster: isProtonic ? 16 : 0,
|
|
270
|
+
clean: 0.5,
|
|
277
271
|
keepPeaks: true,
|
|
278
|
-
joinOverlapRanges:
|
|
272
|
+
joinOverlapRanges: isProtonic,
|
|
279
273
|
};
|
|
280
274
|
detectRanges(datum as Spectrum1D, {
|
|
281
275
|
peakPicking,
|
|
@@ -327,9 +321,6 @@ function handleChangeRangeSignalKind(
|
|
|
327
321
|
const _range = (draft.data[index] as Spectrum1D).ranges.values[rangeIndex];
|
|
328
322
|
if (_range?.signals) {
|
|
329
323
|
_range.signals[range.tableMetaInfo.signalIndex].kind = kind;
|
|
330
|
-
_range.kind = SIGNAL_INCLUDED_KINDS.includes(kind)
|
|
331
|
-
? DATUM_KIND.signal
|
|
332
|
-
: DATUM_KIND.mixed;
|
|
333
324
|
updateRangesRelativeValues(draft.data[index] as Spectrum1D);
|
|
334
325
|
handleUpdateCorrelations(draft);
|
|
335
326
|
}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {
|
|
2
|
+
Filter2DEntry,
|
|
3
|
+
Signal2D,
|
|
4
|
+
SignalKind,
|
|
5
|
+
Zone,
|
|
6
|
+
} from '@zakodium/nmr-types';
|
|
2
7
|
import type {
|
|
3
8
|
Spectrum2D,
|
|
4
9
|
Spectrum,
|
|
@@ -11,10 +16,6 @@ import lodashCloneDeep from 'lodash/cloneDeep.js';
|
|
|
11
16
|
import { setPathLength } from 'nmr-correlation';
|
|
12
17
|
import { Filters2DManager } from 'nmr-processing';
|
|
13
18
|
|
|
14
|
-
import {
|
|
15
|
-
DATUM_KIND,
|
|
16
|
-
SIGNAL_INCLUDED_KINDS,
|
|
17
|
-
} from '../../../data/constants/signalsKinds.js';
|
|
18
19
|
import {
|
|
19
20
|
changeZoneSignal,
|
|
20
21
|
detectZones,
|
|
@@ -36,6 +37,7 @@ import type { ActionType } from '../types/ActionType.js';
|
|
|
36
37
|
|
|
37
38
|
import { handleUpdateCorrelations } from './CorrelationsActions.js';
|
|
38
39
|
import { setDomain } from './DomainActions.js';
|
|
40
|
+
import { rollbackSpectrumByFilter } from './FiltersActions.ts';
|
|
39
41
|
|
|
40
42
|
interface DeleteSignal2DProps {
|
|
41
43
|
spectrum: Spectrum;
|
|
@@ -60,7 +62,7 @@ type ChangeZoneSignalDeltaAction = ActionType<
|
|
|
60
62
|
>;
|
|
61
63
|
type ChangeZoneSignalKindAction = ActionType<
|
|
62
64
|
'CHANGE_ZONE_SIGNAL_KIND',
|
|
63
|
-
{ zoneData: ZoneData; kind:
|
|
65
|
+
{ zoneData: ZoneData; kind: SignalKind }
|
|
64
66
|
>;
|
|
65
67
|
type DeleteZoneAction = ActionType<'DELETE_2D_ZONE', { id?: string }>;
|
|
66
68
|
type DeleteSignal2DAction = ActionType<'DELETE_2D_SIGNAL', DeleteSignal2DProps>;
|
|
@@ -242,6 +244,14 @@ function handleChangeZoneSignalDelta(
|
|
|
242
244
|
});
|
|
243
245
|
}
|
|
244
246
|
|
|
247
|
+
for (const filter of filters) {
|
|
248
|
+
rollbackSpectrumByFilter(draft, {
|
|
249
|
+
key: filter.name,
|
|
250
|
+
searchBy: 'name',
|
|
251
|
+
applyFilter: false,
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
|
|
245
255
|
Filters2DManager.applyFilters(draft.data[index] as Spectrum2D, filters);
|
|
246
256
|
|
|
247
257
|
setDomain(draft);
|
|
@@ -270,9 +280,7 @@ function handleChangeZoneSignalKind(
|
|
|
270
280
|
const zoneIndex = getZoneIndex(state, index, zoneData.id);
|
|
271
281
|
const _zone = (draft.data[index] as Spectrum2D).zones.values[zoneIndex];
|
|
272
282
|
_zone.signals[zoneData.tableMetaInfo.signalIndex].kind = kind;
|
|
273
|
-
_zone.kind =
|
|
274
|
-
? DATUM_KIND.signal
|
|
275
|
-
: DATUM_KIND.mixed;
|
|
283
|
+
_zone.kind = kind;
|
|
276
284
|
handleUpdateCorrelations(draft);
|
|
277
285
|
}
|
|
278
286
|
}
|
|
@@ -16,7 +16,6 @@ function getWorkspace(
|
|
|
16
16
|
export function initPreferences(draft: Draft<PreferencesState>, action: any) {
|
|
17
17
|
if (action.payload) {
|
|
18
18
|
const {
|
|
19
|
-
dispatch,
|
|
20
19
|
workspace,
|
|
21
20
|
customWorkspaces: cw,
|
|
22
21
|
preferences,
|
|
@@ -77,7 +76,5 @@ export function initPreferences(draft: Draft<PreferencesState>, action: any) {
|
|
|
77
76
|
),
|
|
78
77
|
};
|
|
79
78
|
}
|
|
80
|
-
|
|
81
|
-
draft.dispatch = dispatch;
|
|
82
79
|
}
|
|
83
80
|
}
|
|
@@ -9,6 +9,7 @@ import type {
|
|
|
9
9
|
Zones2DNucleusPreferences,
|
|
10
10
|
} from '@zakodium/nmrium-core';
|
|
11
11
|
|
|
12
|
+
import { isProton } from '../../../data/utilities/isProton.ts';
|
|
12
13
|
import { is2DNucleus } from '../../utility/nucleusToString.js';
|
|
13
14
|
|
|
14
15
|
function getPreferences<T>(data: T, nucleus?: string) {
|
|
@@ -130,7 +131,7 @@ const getRangeDefaultValues = (
|
|
|
130
131
|
deltaPPM: { show: true, format: '0.00' },
|
|
131
132
|
deltaHz: { show: false, format: '0.00' },
|
|
132
133
|
coupling: { show: true, format: '0.00' },
|
|
133
|
-
jGraphTolerance: nucleus
|
|
134
|
+
jGraphTolerance: isProton(nucleus || '') ? 0.2 : nucleus === '13C' ? 2 : 0, //J Graph tolerance for: 1H: 0.2Hz 13C: 2Hz
|
|
134
135
|
showKind: true,
|
|
135
136
|
showMultiplicity: true,
|
|
136
137
|
showAssignment: true,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type {
|
|
2
2
|
ACSExportOptions,
|
|
3
|
+
CustomWorkspaces,
|
|
3
4
|
ExportPreferences,
|
|
4
5
|
ExportSettings,
|
|
5
6
|
MultipleSpectraAnalysisPreferences,
|
|
@@ -70,10 +71,11 @@ export interface Settings {
|
|
|
70
71
|
type InitPreferencesAction = ActionType<
|
|
71
72
|
'INIT_PREFERENCES',
|
|
72
73
|
{
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
preferences: NMRiumPreferences | undefined;
|
|
75
|
+
display?: NMRiumPreferences;
|
|
76
|
+
workspace: NMRiumWorkspace | undefined;
|
|
77
|
+
customWorkspaces: CustomWorkspaces | undefined;
|
|
78
|
+
currentWorkspace: Settings['currentWorkspace'] | undefined;
|
|
77
79
|
}
|
|
78
80
|
>;
|
|
79
81
|
|
|
@@ -168,7 +170,7 @@ export type TogglePanelAction = ActionType<
|
|
|
168
170
|
}
|
|
169
171
|
>;
|
|
170
172
|
|
|
171
|
-
type PreferencesActions =
|
|
173
|
+
export type PreferencesActions =
|
|
172
174
|
| InitPreferencesAction
|
|
173
175
|
| SetPreferencesAction
|
|
174
176
|
| SetPanelsPreferencesAction
|
|
@@ -198,7 +200,6 @@ export interface PreferencesState {
|
|
|
198
200
|
// TODO: A lot of places set this to Required<WorkspacePreferences>, which is a subset of this type
|
|
199
201
|
workspaces: WorkspacesWithSource;
|
|
200
202
|
originalWorkspaces: WorkspacesWithSource;
|
|
201
|
-
dispatch: (action?: PreferencesActions) => void;
|
|
202
203
|
workspace: {
|
|
203
204
|
current: NMRiumWorkspace;
|
|
204
205
|
base: NMRiumWorkspace | null;
|
|
@@ -209,7 +210,6 @@ export const preferencesInitialState: PreferencesState = {
|
|
|
209
210
|
version: CURRENT_EXPORT_VERSION,
|
|
210
211
|
workspaces: {},
|
|
211
212
|
originalWorkspaces: {},
|
|
212
|
-
dispatch: () => null,
|
|
213
213
|
workspace: {
|
|
214
214
|
current: 'default',
|
|
215
215
|
base: null,
|
|
@@ -319,8 +319,7 @@ function innerPreferencesReducer(
|
|
|
319
319
|
return draft;
|
|
320
320
|
}
|
|
321
321
|
}
|
|
322
|
-
const preferencesReducer: Reducer<PreferencesState,
|
|
323
|
-
innerPreferencesReducer
|
|
324
|
-
);
|
|
322
|
+
const preferencesReducer: Reducer<PreferencesState, PreferencesActions> =
|
|
323
|
+
produce(innerPreferencesReducer);
|
|
325
324
|
|
|
326
325
|
export default preferencesReducer;
|
|
@@ -6,7 +6,8 @@ import type {
|
|
|
6
6
|
} from '@zakodium/nmrium-core';
|
|
7
7
|
import { BlobWriter, TextReader, ZipWriter } from '@zip.js/zip.js';
|
|
8
8
|
import dlv from 'dlv';
|
|
9
|
-
|
|
9
|
+
|
|
10
|
+
import { saveAs } from './save_as.ts';
|
|
10
11
|
|
|
11
12
|
export const browserNotSupportedErrorToast: ToastProps = {
|
|
12
13
|
message:
|
|
@@ -21,7 +22,7 @@ export const browserNotSupportedErrorToast: ToastProps = {
|
|
|
21
22
|
* @param spaceIndent
|
|
22
23
|
* @param isCompressed
|
|
23
24
|
*/
|
|
24
|
-
async function
|
|
25
|
+
async function exportAsJsonBlob(
|
|
25
26
|
data: any,
|
|
26
27
|
fileName = 'experiment',
|
|
27
28
|
spaceIndent = 0,
|
|
@@ -34,25 +35,18 @@ async function exportAsJSON(
|
|
|
34
35
|
spaceIndent,
|
|
35
36
|
);
|
|
36
37
|
if (!isCompressed) {
|
|
37
|
-
|
|
38
|
-
saveAs(blob, `${fileName}.nmrium`);
|
|
38
|
+
return new Blob([fileData], { type: 'text/plain' });
|
|
39
39
|
} else {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
const blob = await zip.close();
|
|
44
|
-
saveAs(blob, `${fileName}.nmrium`);
|
|
45
|
-
} catch (error) {
|
|
46
|
-
// TODO: handle error.
|
|
47
|
-
reportError(error);
|
|
48
|
-
}
|
|
40
|
+
const zip = new ZipWriter(new BlobWriter());
|
|
41
|
+
await zip.add(`${fileName}.nmrium`, new TextReader(fileData));
|
|
42
|
+
return await zip.close();
|
|
49
43
|
}
|
|
50
44
|
}
|
|
51
45
|
|
|
52
46
|
function exportAsMatrix(
|
|
53
47
|
data: any,
|
|
54
48
|
spectraColumns: SpectraTableColumn[],
|
|
55
|
-
|
|
49
|
+
name: string,
|
|
56
50
|
) {
|
|
57
51
|
//columns labels
|
|
58
52
|
const columnsLabels: string[] = [];
|
|
@@ -88,7 +82,7 @@ function exportAsMatrix(
|
|
|
88
82
|
}
|
|
89
83
|
|
|
90
84
|
const blob = new Blob([matrix], { type: 'text/tab-separated-values' });
|
|
91
|
-
saveAs(blob,
|
|
85
|
+
saveAs({ blob, name, extension: '.tsv' });
|
|
92
86
|
}
|
|
93
87
|
|
|
94
88
|
interface ExportDimensions {
|
|
@@ -103,9 +97,10 @@ interface ExportAsSVGOptions extends ExportDimensions {
|
|
|
103
97
|
}
|
|
104
98
|
|
|
105
99
|
function exportAsSVG(targetElementID: string, options: ExportAsSVGOptions) {
|
|
106
|
-
const { fileName, rootElement } = options;
|
|
100
|
+
const { fileName: name = 'experiment', rootElement } = options;
|
|
107
101
|
const { blob } = getBlob(targetElementID, { rootElement });
|
|
108
|
-
|
|
102
|
+
|
|
103
|
+
saveAs({ blob, name, extension: '.svg' });
|
|
109
104
|
}
|
|
110
105
|
|
|
111
106
|
interface ExportAsPNGOptions {
|
|
@@ -249,7 +244,7 @@ async function exportAsPng(
|
|
|
249
244
|
targetElementID: string,
|
|
250
245
|
options: ExportAsPNGOptions,
|
|
251
246
|
) {
|
|
252
|
-
const { rootElement, fileName = 'experiment' } = options;
|
|
247
|
+
const { rootElement, fileName: name = 'experiment' } = options;
|
|
253
248
|
const { blob, width, height } = getBlob(targetElementID, { rootElement });
|
|
254
249
|
|
|
255
250
|
const { canvas } = await createCanvas(blob, {
|
|
@@ -259,7 +254,7 @@ async function exportAsPng(
|
|
|
259
254
|
});
|
|
260
255
|
|
|
261
256
|
const pngBlob = await canvas.convertToBlob({ type: 'image/png' });
|
|
262
|
-
saveAs(pngBlob,
|
|
257
|
+
saveAs({ blob: pngBlob, name, extension: '.png' });
|
|
263
258
|
}
|
|
264
259
|
|
|
265
260
|
function createImageFromBlob(blob: Blob): Promise<HTMLImageElement> {
|
|
@@ -427,7 +422,7 @@ function getBlob(targetElementID: string, options: GetBlobOptions): BlobObject {
|
|
|
427
422
|
|
|
428
423
|
export {
|
|
429
424
|
copyPNGToClipboard,
|
|
430
|
-
|
|
425
|
+
exportAsJsonBlob,
|
|
431
426
|
exportAsMatrix,
|
|
432
427
|
exportAsPng,
|
|
433
428
|
exportAsSVG,
|
|
@@ -22,7 +22,7 @@ export function getClosePeak(
|
|
|
22
22
|
const minIndex = datum.x.findIndex((number) => number >= from);
|
|
23
23
|
|
|
24
24
|
const yDataRange = datum.y.slice(minIndex, maxIndex);
|
|
25
|
-
if (
|
|
25
|
+
if (yDataRange.length === 0) return null;
|
|
26
26
|
|
|
27
27
|
const y = maxAbsoluteValue(yDataRange);
|
|
28
28
|
const xIndex = minIndex + yDataRange.indexOf(y);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// eslint-disable-next-line no-restricted-imports
|
|
2
|
+
import fileSaver from 'file-saver';
|
|
3
|
+
|
|
4
|
+
type Extension = `.${string}`;
|
|
5
|
+
|
|
6
|
+
interface SaveAsOptions {
|
|
7
|
+
blob: Blob;
|
|
8
|
+
name: string;
|
|
9
|
+
extension: Extension;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function saveAs(options: SaveAsOptions) {
|
|
13
|
+
const { blob, name, extension } = options;
|
|
14
|
+
|
|
15
|
+
fileSaver(blob, `${name}${extension}`);
|
|
16
|
+
}
|