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
|
@@ -47,7 +47,7 @@ function DatabaseSpectrum() {
|
|
|
47
47
|
try {
|
|
48
48
|
setLoading(true);
|
|
49
49
|
const url = new URL(jcampRelativeURL, baseURL);
|
|
50
|
-
const { data } = await core.readFromWebSource({
|
|
50
|
+
const [{ data }] = await core.readFromWebSource({
|
|
51
51
|
entries: [{ relativePath: url.pathname, baseURL: url.origin }],
|
|
52
52
|
});
|
|
53
53
|
setLoading(false);
|
|
@@ -14,6 +14,7 @@ import { useScaleChecked } from '../../context/ScaleContext.js';
|
|
|
14
14
|
import type { ActionsButtonsPopoverProps } from '../../elements/ActionsButtonsPopover.js';
|
|
15
15
|
import { ActionsButtonsPopover } from '../../elements/ActionsButtonsPopover.js';
|
|
16
16
|
import { useHighlight } from '../../highlight/index.js';
|
|
17
|
+
import { useActiveSpectrum } from '../../hooks/useActiveSpectrum.ts';
|
|
17
18
|
import useSpectrum from '../../hooks/useSpectrum.js';
|
|
18
19
|
import { useIsInset } from '../inset/InsetProvider.js';
|
|
19
20
|
|
|
@@ -79,11 +80,11 @@ function Tree(props: TreeProps) {
|
|
|
79
80
|
} = props;
|
|
80
81
|
const { from, to } = range;
|
|
81
82
|
const { width } = useChartData();
|
|
82
|
-
const { scaleX } = useScaleChecked();
|
|
83
|
+
const { scaleX, shiftY } = useScaleChecked();
|
|
83
84
|
const dispatch = useDispatch();
|
|
84
85
|
const isInset = useIsInset();
|
|
85
86
|
const isAssignBtnTrigged = useRef(false);
|
|
86
|
-
|
|
87
|
+
const activeSpectrum = useActiveSpectrum();
|
|
87
88
|
const assignment = useAssignment(signalKey);
|
|
88
89
|
const highlight = useHighlight(extractID(signalKey, assignment), {
|
|
89
90
|
type: 'SIGNAL',
|
|
@@ -172,6 +173,7 @@ function Tree(props: TreeProps) {
|
|
|
172
173
|
}}
|
|
173
174
|
>
|
|
174
175
|
<Group
|
|
176
|
+
transform={`translate(0,-${(activeSpectrum?.index || 0) * shiftY})`}
|
|
175
177
|
isActive={isAssignmentActive}
|
|
176
178
|
isHighlighted={isHighlighted}
|
|
177
179
|
onMouseEnter={() => {
|
|
@@ -166,7 +166,7 @@ function PeakAnnotation({
|
|
|
166
166
|
format,
|
|
167
167
|
isOverlap = false,
|
|
168
168
|
}: PeakAnnotationProps) {
|
|
169
|
-
const { id, parentKeys, x, y } = peak;
|
|
169
|
+
const { id, parentKeys, x, y, opacity } = peak;
|
|
170
170
|
const sign = Math.sign(y);
|
|
171
171
|
const highlight = useHighlight([id], {
|
|
172
172
|
type: getHighlightSource(peaksSource),
|
|
@@ -188,6 +188,7 @@ function PeakAnnotation({
|
|
|
188
188
|
transform={`translate(${sx}, ${sy})`}
|
|
189
189
|
onMouseEnter={() => highlight.show()}
|
|
190
190
|
onMouseLeave={() => highlight.hide()}
|
|
191
|
+
opacity={opacity}
|
|
191
192
|
>
|
|
192
193
|
<line
|
|
193
194
|
x1="0"
|
|
@@ -144,7 +144,13 @@ function PeakAnnotationsSpreadMode(props: PeakAnnotationsSpreadModeProps) {
|
|
|
144
144
|
transform={`translate(${group.meta.groupStartX},0)`}
|
|
145
145
|
>
|
|
146
146
|
{group.group.map((item, index) => {
|
|
147
|
-
const {
|
|
147
|
+
const {
|
|
148
|
+
id,
|
|
149
|
+
x: value,
|
|
150
|
+
xInPixel,
|
|
151
|
+
parentKeys,
|
|
152
|
+
opacity,
|
|
153
|
+
} = item;
|
|
148
154
|
const startX = index * (notationWidth + notationMargin);
|
|
149
155
|
const x = xInPixel - group.meta.groupStartX;
|
|
150
156
|
return (
|
|
@@ -163,6 +169,7 @@ function PeakAnnotationsSpreadMode(props: PeakAnnotationsSpreadModeProps) {
|
|
|
163
169
|
}}
|
|
164
170
|
peaksSource={peaksSource}
|
|
165
171
|
spectrumKey={spectrumKey}
|
|
172
|
+
opacity={opacity}
|
|
166
173
|
/>
|
|
167
174
|
);
|
|
168
175
|
})}
|
|
@@ -181,6 +188,7 @@ interface PeakAnnotationProps {
|
|
|
181
188
|
x: number;
|
|
182
189
|
format: string;
|
|
183
190
|
color: string;
|
|
191
|
+
opacity: number;
|
|
184
192
|
id: string;
|
|
185
193
|
value: number;
|
|
186
194
|
peakEditionFieldPosition: { x: number; y: number };
|
|
@@ -200,6 +208,7 @@ function PeakAnnotation(props: PeakAnnotationProps) {
|
|
|
200
208
|
peaksSource,
|
|
201
209
|
parentKeys,
|
|
202
210
|
spectrumKey,
|
|
211
|
+
opacity,
|
|
203
212
|
} = props;
|
|
204
213
|
const highlight = useHighlight([id], {
|
|
205
214
|
type: getHighlightSource(peaksSource),
|
|
@@ -212,6 +221,7 @@ function PeakAnnotation(props: PeakAnnotationProps) {
|
|
|
212
221
|
<g
|
|
213
222
|
onMouseEnter={() => highlight.show()}
|
|
214
223
|
onMouseLeave={() => highlight.hide()}
|
|
224
|
+
opacity={opacity}
|
|
215
225
|
>
|
|
216
226
|
<PeakEditionListener {...{ ...peakEditionFieldPosition, id, value }}>
|
|
217
227
|
<text
|
|
@@ -2,6 +2,7 @@ import type { NMRPeak1D, Peak1D, Range } from '@zakodium/nmr-types';
|
|
|
2
2
|
import type { Spectrum1D } from '@zakodium/nmrium-core';
|
|
3
3
|
import { memo, useMemo } from 'react';
|
|
4
4
|
|
|
5
|
+
import { getOpacityBasedOnSignalKind } from '../../../data/utilities/RangeUtilities.ts';
|
|
5
6
|
import { useChartData } from '../../context/ChartContext.js';
|
|
6
7
|
import { useScaleChecked } from '../../context/ScaleContext.tsx';
|
|
7
8
|
import { useActiveSpectrumPeaksViewState } from '../../hooks/useActiveSpectrumPeaksViewState.js';
|
|
@@ -18,6 +19,7 @@ interface Peak1DWithParentKeys extends Peak1D {
|
|
|
18
19
|
}
|
|
19
20
|
interface NMRPeak1DWithParentKeys extends NMRPeak1D {
|
|
20
21
|
parentKeys?: string[];
|
|
22
|
+
opacity: number;
|
|
21
23
|
}
|
|
22
24
|
|
|
23
25
|
interface SpreadPeak1D extends Peak1DWithParentKeys {
|
|
@@ -29,7 +31,9 @@ interface SpreadNMRPeak1D extends NMRPeak1DWithParentKeys {
|
|
|
29
31
|
yInPixel: number;
|
|
30
32
|
}
|
|
31
33
|
|
|
32
|
-
export type Peak = Required<SpreadPeak1D | SpreadNMRPeak1D
|
|
34
|
+
export type Peak = Required<SpreadPeak1D | SpreadNMRPeak1D> & {
|
|
35
|
+
opacity: number;
|
|
36
|
+
};
|
|
33
37
|
type PeaksMode = 'spread' | 'single';
|
|
34
38
|
export type PeaksSource = 'peaks' | 'ranges';
|
|
35
39
|
|
|
@@ -61,9 +65,11 @@ export function getHighlightExtraId(
|
|
|
61
65
|
function flatRangesPeaks(ranges: Range[]) {
|
|
62
66
|
const results: NMRPeak1DWithParentKeys[] = [];
|
|
63
67
|
for (const { signals = [], id: rangeID } of ranges) {
|
|
64
|
-
for (const
|
|
68
|
+
for (const signal of signals) {
|
|
69
|
+
const { peaks = [], id: signalID } = signal;
|
|
70
|
+
const opacity = getOpacityBasedOnSignalKind(signal);
|
|
65
71
|
for (const peak of peaks) {
|
|
66
|
-
results.push({ ...peak, parentKeys: [rangeID, signalID] });
|
|
72
|
+
results.push({ ...peak, parentKeys: [rangeID, signalID], opacity });
|
|
67
73
|
}
|
|
68
74
|
}
|
|
69
75
|
}
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
resizeRange,
|
|
9
9
|
} from '../../../data/data1d/Spectrum1D/index.js';
|
|
10
10
|
import { isRangeAssigned } from '../../../data/data1d/Spectrum1D/isRangeAssigned.js';
|
|
11
|
-
import {
|
|
11
|
+
import { getOpacityBasedOnSignalKind } from '../../../data/utilities/RangeUtilities.js';
|
|
12
12
|
import {
|
|
13
13
|
useAssignment,
|
|
14
14
|
useAssignmentContext,
|
|
@@ -131,7 +131,8 @@ function Range(options: RangeProps) {
|
|
|
131
131
|
});
|
|
132
132
|
}
|
|
133
133
|
const isAssignmentActive = assignmentRange.isActive;
|
|
134
|
-
const
|
|
134
|
+
const opacity = getOpacityBasedOnSignalKind(range);
|
|
135
|
+
|
|
135
136
|
const isHighlighted =
|
|
136
137
|
isBlockedByEditing || highlightRange.isActive || isAssignmentActive;
|
|
137
138
|
|
|
@@ -248,7 +249,7 @@ function Range(options: RangeProps) {
|
|
|
248
249
|
value={integration}
|
|
249
250
|
format={relativeFormat}
|
|
250
251
|
width={rangeWidth}
|
|
251
|
-
opacity={
|
|
252
|
+
opacity={opacity}
|
|
252
253
|
/>
|
|
253
254
|
)}
|
|
254
255
|
</g>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Spectrum1D } from '@zakodium/nmrium-core';
|
|
2
2
|
import { xyIntegral, xyMaxY } from 'ml-spectra-processing';
|
|
3
3
|
|
|
4
|
+
import { getOpacityBasedOnSignalKind } from '../../../data/utilities/RangeUtilities.ts';
|
|
4
5
|
import { useChartData } from '../../context/ChartContext.js';
|
|
5
6
|
import { useActiveSpectrumRangesViewState } from '../../hooks/useActiveSpectrumRangesViewState.js';
|
|
6
7
|
import useIntegralPath from '../../hooks/useIntegralPath.js';
|
|
@@ -13,6 +14,7 @@ interface IntegralData {
|
|
|
13
14
|
id: string;
|
|
14
15
|
from: number;
|
|
15
16
|
to: number;
|
|
17
|
+
opacity: number;
|
|
16
18
|
}
|
|
17
19
|
|
|
18
20
|
interface IntegralProps extends IntegralData {
|
|
@@ -20,7 +22,7 @@ interface IntegralProps extends IntegralData {
|
|
|
20
22
|
}
|
|
21
23
|
|
|
22
24
|
function Integral(props: IntegralProps) {
|
|
23
|
-
const { x, y, max, from, to } = props;
|
|
25
|
+
const { x, y, max, from, to, opacity } = props;
|
|
24
26
|
const { integralsScaleRatio } = useActiveSpectrumRangesViewState();
|
|
25
27
|
const path = useIntegralPath({
|
|
26
28
|
x,
|
|
@@ -37,6 +39,7 @@ function Integral(props: IntegralProps) {
|
|
|
37
39
|
stroke="black"
|
|
38
40
|
strokeWidth="1"
|
|
39
41
|
fill="none"
|
|
42
|
+
opacity={opacity}
|
|
40
43
|
d={path}
|
|
41
44
|
/>
|
|
42
45
|
);
|
|
@@ -90,6 +93,7 @@ function useIntegrals() {
|
|
|
90
93
|
} = spectrum;
|
|
91
94
|
for (const range of ranges?.values || []) {
|
|
92
95
|
const { from, to, id } = range;
|
|
96
|
+
const opacity = getOpacityBasedOnSignalKind(range);
|
|
93
97
|
const integral = xyIntegral(
|
|
94
98
|
{ x, y: re },
|
|
95
99
|
{
|
|
@@ -98,7 +102,7 @@ function useIntegrals() {
|
|
|
98
102
|
reverse: true,
|
|
99
103
|
},
|
|
100
104
|
);
|
|
101
|
-
values.push({ ...integral, id } as IntegralData);
|
|
105
|
+
values.push({ ...integral, id, opacity } as IntegralData);
|
|
102
106
|
const value = xyMaxY(integral);
|
|
103
107
|
if (value > max) max = value;
|
|
104
108
|
}
|
|
@@ -56,7 +56,7 @@ export default function FooterBanner(props: FooterBannerProps) {
|
|
|
56
56
|
const [formatX, formatY] = useFormatNumberByNucleus(nuclei);
|
|
57
57
|
|
|
58
58
|
const scaleX = useMemo(() => {
|
|
59
|
-
if (
|
|
59
|
+
if (data1D.length === 0) {
|
|
60
60
|
return get2DXScale({ width, margin, xDomain, mode });
|
|
61
61
|
}
|
|
62
62
|
if (selectedTool !== options.slicing.id) {
|
|
@@ -86,7 +86,7 @@ export default function FooterBanner(props: FooterBannerProps) {
|
|
|
86
86
|
]);
|
|
87
87
|
|
|
88
88
|
const scaleY = useMemo(() => {
|
|
89
|
-
if (
|
|
89
|
+
if (data1D.length === 0) {
|
|
90
90
|
return get2DYScale({ height, margin, yDomain });
|
|
91
91
|
}
|
|
92
92
|
if (selectedTool !== options.slicing.id) {
|
|
@@ -3,13 +3,14 @@ import { useLinearPrimaryTicks } from 'react-d3-utils';
|
|
|
3
3
|
|
|
4
4
|
import { useChartData } from '../context/ChartContext.js';
|
|
5
5
|
import { D3Axis } from '../elements/D3Axis.js';
|
|
6
|
+
import { useActiveNucleusTab } from '../hooks/useActiveNucleusTab.ts';
|
|
7
|
+
import { useTextMetrics } from '../hooks/useTextMetrics.ts';
|
|
6
8
|
|
|
7
9
|
import { useScale2DY } from './utilities/scale.js';
|
|
8
10
|
|
|
9
11
|
const defaultMargin = { right: 50, top: 0, bottom: 0, left: 0 };
|
|
10
12
|
|
|
11
13
|
interface YAxisProps {
|
|
12
|
-
label?: string;
|
|
13
14
|
margin?: {
|
|
14
15
|
right: number;
|
|
15
16
|
top: number;
|
|
@@ -19,9 +20,13 @@ interface YAxisProps {
|
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
function YAxis(props: YAxisProps) {
|
|
22
|
-
const {
|
|
23
|
+
const { margin: marginProps = defaultMargin } = props;
|
|
24
|
+
|
|
25
|
+
const { width, height, margin } = useChartData();
|
|
26
|
+
const nucleusStr = useActiveNucleusTab();
|
|
27
|
+
const [, unit] = nucleusStr.split(',');
|
|
28
|
+
const { getTextWidth } = useTextMetrics(10);
|
|
23
29
|
|
|
24
|
-
const { width, height } = useChartData();
|
|
25
30
|
const scaleY = useScale2DY();
|
|
26
31
|
|
|
27
32
|
const refAxis = useRef<SVGGElement>(null);
|
|
@@ -36,6 +41,9 @@ function YAxis(props: YAxisProps) {
|
|
|
36
41
|
return null;
|
|
37
42
|
}
|
|
38
43
|
|
|
44
|
+
const label = /^[0-9]+[A-Z][a-z]?$/.test(unit) ? 'δ [ppm]' : unit;
|
|
45
|
+
const labelHeight = getTextWidth(label);
|
|
46
|
+
|
|
39
47
|
return (
|
|
40
48
|
<D3Axis
|
|
41
49
|
ref={refAxis}
|
|
@@ -44,16 +52,26 @@ function YAxis(props: YAxisProps) {
|
|
|
44
52
|
axisPosition="right"
|
|
45
53
|
ticks={ticks}
|
|
46
54
|
>
|
|
47
|
-
<
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
<g transform={`translate(${marginProps.right - 20}, ${margin.top})`}>
|
|
56
|
+
<rect
|
|
57
|
+
fill="white"
|
|
58
|
+
rx={5}
|
|
59
|
+
ry={5}
|
|
60
|
+
width={20}
|
|
61
|
+
height={labelHeight + 10}
|
|
62
|
+
x={-10}
|
|
63
|
+
y={-5}
|
|
64
|
+
opacity={0.8}
|
|
65
|
+
/>
|
|
66
|
+
<text
|
|
67
|
+
fill="#000"
|
|
68
|
+
transform="rotate(-90)"
|
|
69
|
+
dominantBaseline="middle"
|
|
70
|
+
textAnchor="end"
|
|
71
|
+
>
|
|
72
|
+
{label}
|
|
73
|
+
</text>
|
|
74
|
+
</g>
|
|
57
75
|
</D3Axis>
|
|
58
76
|
);
|
|
59
77
|
}
|
|
@@ -44,6 +44,9 @@ export function useTracesSpectra() {
|
|
|
44
44
|
|
|
45
45
|
return useMemo(() => {
|
|
46
46
|
const nuclei = activeTab.split(',');
|
|
47
|
+
|
|
48
|
+
if (nuclei.length !== 2) return [];
|
|
49
|
+
|
|
47
50
|
return getTracesSpectra({ nuclei, spectra, activeSpectra });
|
|
48
51
|
}, [activeTab, spectra, activeSpectra]);
|
|
49
52
|
}
|
|
@@ -1,17 +1,8 @@
|
|
|
1
|
-
import type { Range } from '@zakodium/nmr-types';
|
|
1
|
+
import type { Range, Signal1D } from '@zakodium/nmr-types';
|
|
2
2
|
import type { Spectrum1D } from '@zakodium/nmrium-core';
|
|
3
|
+
import { signalKindsToInclude } from 'nmr-processing';
|
|
3
4
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export interface BaseSignal {
|
|
7
|
-
nbAtoms?: number;
|
|
8
|
-
diaIDs?: string[];
|
|
9
|
-
assignment?: string;
|
|
10
|
-
delta: number;
|
|
11
|
-
id: string;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export type ExtractedSignal<T> = BaseSignal & T;
|
|
5
|
+
export type ExtractedSignal<T> = Signal1D & T;
|
|
15
6
|
|
|
16
7
|
interface ExtractSpectrumSignalsOptions<T> {
|
|
17
8
|
from?: number;
|
|
@@ -48,12 +39,11 @@ export function extractSpectrumSignals<T extends object = object>(
|
|
|
48
39
|
const { assignment, signals = [] } = range;
|
|
49
40
|
let index = 0;
|
|
50
41
|
for (const signal of signals) {
|
|
51
|
-
const {
|
|
52
|
-
if (
|
|
42
|
+
const { kind } = signal;
|
|
43
|
+
if (kind && signalKindsToInclude.has(kind)) {
|
|
53
44
|
result.push({
|
|
45
|
+
...signal,
|
|
54
46
|
assignment: index === 0 ? assignment : '',
|
|
55
|
-
delta,
|
|
56
|
-
id,
|
|
57
47
|
...include?.(range),
|
|
58
48
|
} as ExtractedSignal<T>);
|
|
59
49
|
index++;
|
|
@@ -21,11 +21,9 @@ import {
|
|
|
21
21
|
import type { ActionsButtonsPopoverProps } from '../../elements/ActionsButtonsPopover.js';
|
|
22
22
|
import { ActionsButtonsPopover } from '../../elements/ActionsButtonsPopover.js';
|
|
23
23
|
import { useHighlight } from '../../highlight/index.js';
|
|
24
|
-
import { useActiveNucleusTab } from '../../hooks/useActiveNucleusTab.ts';
|
|
25
24
|
import { useHighlightColor } from '../../hooks/useHighlightColor.ts';
|
|
26
25
|
import { useTextMetrics } from '../../hooks/useTextMetrics.ts';
|
|
27
26
|
import { useTriggerNewAssignmentLabel } from '../../hooks/useTriggerNewAssignmentLabel.js';
|
|
28
|
-
import { isHomoNuclear } from '../../utility/isHomoNuclear.ts';
|
|
29
27
|
import { stackOverlappingLabelsArray } from '../../utility/stackOverlappingLabels.js';
|
|
30
28
|
import { useTracesSpectra } from '../useTracesSpectra.js';
|
|
31
29
|
import type { ExtractedSignal } from '../utilities/extractSpectrumSignals.js';
|
|
@@ -138,6 +136,7 @@ interface IndicationLineProps extends ExtraExtractProperties {
|
|
|
138
136
|
axis: IndicationLinesAxis;
|
|
139
137
|
diaIDs?: string[];
|
|
140
138
|
nbAtoms?: number;
|
|
139
|
+
id: string;
|
|
141
140
|
}
|
|
142
141
|
|
|
143
142
|
interface GetAxisRangeIdOptions {
|
|
@@ -154,6 +153,7 @@ interface UseRangeAssignmentOptions {
|
|
|
154
153
|
rangeId: string;
|
|
155
154
|
signalsIds: string[];
|
|
156
155
|
spectrumId: string;
|
|
156
|
+
signalId: string;
|
|
157
157
|
}
|
|
158
158
|
|
|
159
159
|
function useRangeAssignment(options: UseRangeAssignmentOptions) {
|
|
@@ -169,10 +169,11 @@ function useRangeAssignment(options: UseRangeAssignmentOptions) {
|
|
|
169
169
|
type: 'RANGE',
|
|
170
170
|
extra: { id: rangeId, spectrumID: spectrumId },
|
|
171
171
|
});
|
|
172
|
+
|
|
172
173
|
return { highlightContext, assignmentContext };
|
|
173
174
|
}
|
|
174
175
|
|
|
175
|
-
function
|
|
176
|
+
function isRangeSignalAssigned(
|
|
176
177
|
options: Pick<IndicationLineProps, 'range' | 'nbAtoms' | 'diaIDs'>,
|
|
177
178
|
) {
|
|
178
179
|
const { range, ...otherProps } = options;
|
|
@@ -194,23 +195,24 @@ function IndicationLine(props: IndicationLineProps) {
|
|
|
194
195
|
range,
|
|
195
196
|
diaIDs,
|
|
196
197
|
nbAtoms,
|
|
198
|
+
id: signalId,
|
|
197
199
|
} = props;
|
|
198
200
|
const { id: rangeId, diaIDs: rangeDiaIDs = [], signals } = range;
|
|
199
201
|
const highlightColor = useHighlightColor();
|
|
200
|
-
const
|
|
202
|
+
const isSignalAssigned = isRangeSignalAssigned({ range, diaIDs, nbAtoms });
|
|
201
203
|
|
|
202
204
|
const signalsIds = signals.map(({ id }) => id);
|
|
203
205
|
const { margin, width, height } = useChartData();
|
|
204
206
|
const { setData: addNewAssignmentLabel } = useShareData();
|
|
205
|
-
const nuclei = useActiveNucleusTab();
|
|
206
|
-
const isHomoNuclei = isHomoNuclear(nuclei);
|
|
207
207
|
|
|
208
208
|
const dispatch = useDispatch();
|
|
209
209
|
const { assignmentContext, highlightContext } = useRangeAssignment({
|
|
210
210
|
rangeId,
|
|
211
211
|
spectrumId,
|
|
212
212
|
signalsIds,
|
|
213
|
+
signalId,
|
|
213
214
|
});
|
|
215
|
+
|
|
214
216
|
const hasDiaIDs = rangeDiaIDs.length > 0;
|
|
215
217
|
const isAssignmentActive = assignmentContext.isActive;
|
|
216
218
|
const isHighlighted = highlightContext.isActive || isAssignmentActive;
|
|
@@ -245,7 +247,7 @@ function IndicationLine(props: IndicationLineProps) {
|
|
|
245
247
|
}
|
|
246
248
|
|
|
247
249
|
function mouseEnterHandler() {
|
|
248
|
-
assignmentContext.highlight(
|
|
250
|
+
assignmentContext.highlight('x');
|
|
249
251
|
highlightContext.show();
|
|
250
252
|
}
|
|
251
253
|
|
|
@@ -256,7 +258,7 @@ function IndicationLine(props: IndicationLineProps) {
|
|
|
256
258
|
|
|
257
259
|
function assignHandler() {
|
|
258
260
|
isAssignBtnTrigged.current = true;
|
|
259
|
-
assignmentContext.activate(
|
|
261
|
+
assignmentContext.activate('x');
|
|
260
262
|
}
|
|
261
263
|
|
|
262
264
|
function unAssignHandler() {
|
|
@@ -318,7 +320,7 @@ function IndicationLine(props: IndicationLineProps) {
|
|
|
318
320
|
onMouseLeave={mouseLeaveHandler}
|
|
319
321
|
>
|
|
320
322
|
<line
|
|
321
|
-
stroke={
|
|
323
|
+
stroke={isSignalAssigned ? highlightColor : 'lightgrey'}
|
|
322
324
|
x1={0}
|
|
323
325
|
x2={x2}
|
|
324
326
|
y1={0}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import styled from '@emotion/styled';
|
|
2
|
-
import type { Zone, Zones as ZonesType } from '@zakodium/nmr-types';
|
|
2
|
+
import type { Signal1D, Zone, Zones as ZonesType } from '@zakodium/nmr-types';
|
|
3
3
|
import type { Spectrum2D } from '@zakodium/nmrium-core';
|
|
4
4
|
import { useEffect, useLayoutEffect, useRef, useState } from 'react';
|
|
5
5
|
import { PiTextTSlash } from 'react-icons/pi';
|
|
@@ -18,7 +18,6 @@ import { useActiveSpectrumZonesViewState } from '../../hooks/useActiveSpectrumZo
|
|
|
18
18
|
import useSpectrum from '../../hooks/useSpectrum.js';
|
|
19
19
|
import type { GetTracesSpectraOptions } from '../useTracesSpectra.js';
|
|
20
20
|
import { getTracesSpectra } from '../useTracesSpectra.js';
|
|
21
|
-
import type { BaseSignal } from '../utilities/extractSpectrumSignals.js';
|
|
22
21
|
import { extractSpectrumSignals } from '../utilities/extractSpectrumSignals.js';
|
|
23
22
|
import { useScale2DX, useScale2DY } from '../utilities/scale.js';
|
|
24
23
|
|
|
@@ -232,7 +231,7 @@ interface GetDefaultAssignmentOptions extends GetTracesSpectraOptions {
|
|
|
232
231
|
zone: Zone;
|
|
233
232
|
}
|
|
234
233
|
|
|
235
|
-
function findClosestAssignment(signals:
|
|
234
|
+
function findClosestAssignment(signals: Signal1D[], target: number) {
|
|
236
235
|
if (signals.length === 0) return '';
|
|
237
236
|
let closest = signals[0];
|
|
238
237
|
let minDiff = Math.abs(closest.delta - target);
|
|
@@ -8,7 +8,7 @@ import type { DomainActions } from '../reducer/actions/DomainActions.js';
|
|
|
8
8
|
import type { FiltersActions } from '../reducer/actions/FiltersActions.js';
|
|
9
9
|
import type { InsetsActions } from '../reducer/actions/InsetActions.js';
|
|
10
10
|
import type { IntegralsActions } from '../reducer/actions/IntegralsActions.js';
|
|
11
|
-
import type {
|
|
11
|
+
import type { LoadAction } from '../reducer/actions/LoadAction.js';
|
|
12
12
|
import type { MoleculeActions } from '../reducer/actions/MoleculeActions.js';
|
|
13
13
|
import type { PeaksActions } from '../reducer/actions/PeaksActions.js';
|
|
14
14
|
import type { PreferencesActions } from '../reducer/actions/PreferencesActions.js';
|
|
@@ -21,7 +21,7 @@ import type { ActionType } from '../reducer/types/ActionType.js';
|
|
|
21
21
|
export type Action =
|
|
22
22
|
| ToolsActions
|
|
23
23
|
| SpectrumActions
|
|
24
|
-
|
|
|
24
|
+
| LoadAction
|
|
25
25
|
| IntegralsActions
|
|
26
26
|
| RangesActions
|
|
27
27
|
| DatabaseActions
|
|
@@ -55,8 +55,7 @@ export function LoggerProvider({ children }: LoggerProviderProps) {
|
|
|
55
55
|
const [logsHistory, setLogsHistory] = useState<LogEntry[]>([]);
|
|
56
56
|
const [isLogHistoryOpened, openLogHistory] = useState(false);
|
|
57
57
|
const popupLoggingLevelRef = useRef<LogEntry['levelLabel']>();
|
|
58
|
-
|
|
59
|
-
const loggerRef = useRef<FifoLogger>(new FifoLogger());
|
|
58
|
+
const [logger] = useState(() => new FifoLogger());
|
|
60
59
|
|
|
61
60
|
useEffect(() => {
|
|
62
61
|
function handleLogger({ detail: { logs } }: ChangeEvent) {
|
|
@@ -74,20 +73,18 @@ export function LoggerProvider({ children }: LoggerProviderProps) {
|
|
|
74
73
|
}
|
|
75
74
|
setLogsHistory(logs.slice());
|
|
76
75
|
}
|
|
77
|
-
const loggerInstance = loggerRef.current;
|
|
78
|
-
|
|
79
|
-
loggerInstance.addEventListener('change', handleLogger);
|
|
80
76
|
|
|
77
|
+
logger.addEventListener('change', handleLogger);
|
|
81
78
|
return () => {
|
|
82
|
-
|
|
79
|
+
logger.removeEventListener('change', handleLogger);
|
|
83
80
|
};
|
|
84
|
-
}, []);
|
|
81
|
+
}, [logger]);
|
|
85
82
|
|
|
86
83
|
useEffect(() => {
|
|
87
84
|
if (loggingLevel) {
|
|
88
|
-
|
|
85
|
+
logger.setLevel(loggingLevel);
|
|
89
86
|
}
|
|
90
|
-
}, [loggingLevel]);
|
|
87
|
+
}, [logger, loggingLevel]);
|
|
91
88
|
|
|
92
89
|
const markAsRead = useCallback(() => {
|
|
93
90
|
if (logsHistory.length > 0) {
|
|
@@ -98,12 +95,12 @@ export function LoggerProvider({ children }: LoggerProviderProps) {
|
|
|
98
95
|
|
|
99
96
|
const loggerState = useMemo(() => {
|
|
100
97
|
return {
|
|
101
|
-
logger
|
|
98
|
+
logger,
|
|
102
99
|
logsHistory,
|
|
103
100
|
markAsRead,
|
|
104
101
|
lastReadLogId,
|
|
105
102
|
};
|
|
106
|
-
}, [lastReadLogId, logsHistory, markAsRead]);
|
|
103
|
+
}, [logger, lastReadLogId, logsHistory, markAsRead]);
|
|
107
104
|
|
|
108
105
|
useEffect(() => {
|
|
109
106
|
popupLoggingLevelRef.current = popupLoggingLevel;
|
|
@@ -1,20 +1,23 @@
|
|
|
1
|
+
import type { Dispatch } from 'react';
|
|
1
2
|
import { createContext, useContext, useMemo } from 'react';
|
|
2
3
|
|
|
3
4
|
import type {
|
|
5
|
+
PreferencesActions,
|
|
4
6
|
PreferencesState,
|
|
5
7
|
WorkspaceWithSource,
|
|
6
8
|
} from '../reducer/preferences/preferencesReducer.js';
|
|
7
|
-
import { preferencesInitialState } from '../reducer/preferences/preferencesReducer.js';
|
|
8
9
|
import { isReadOnlyWorkspace } from '../reducer/preferences/utilities/isReadOnlyWorkspace.js';
|
|
9
10
|
|
|
10
|
-
interface
|
|
11
|
+
export interface PreferencesStateContext extends PreferencesState {
|
|
12
|
+
dispatch: Dispatch<PreferencesActions>;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
interface PreferencesContextData extends PreferencesStateContext {
|
|
11
16
|
isCurrentWorkspaceReadOnly: boolean;
|
|
12
17
|
current: WorkspaceWithSource;
|
|
13
18
|
}
|
|
14
19
|
|
|
15
|
-
const PreferencesContext = createContext<
|
|
16
|
-
preferencesInitialState,
|
|
17
|
-
);
|
|
20
|
+
const PreferencesContext = createContext<PreferencesStateContext | null>(null);
|
|
18
21
|
export const PreferencesProvider = PreferencesContext.Provider;
|
|
19
22
|
|
|
20
23
|
export function usePreferences(): PreferencesContextData {
|
|
@@ -181,8 +181,6 @@ export const D3Axis = forwardRef<SVGGElement | null, D3AxisProps>(
|
|
|
181
181
|
{...otherProps}
|
|
182
182
|
>
|
|
183
183
|
<g className="axis">
|
|
184
|
-
{children}
|
|
185
|
-
|
|
186
184
|
<BaseLine
|
|
187
185
|
axisPosition={axisPosition}
|
|
188
186
|
scale={scale}
|
|
@@ -194,6 +192,7 @@ export const D3Axis = forwardRef<SVGGElement | null, D3AxisProps>(
|
|
|
194
192
|
scale={scale}
|
|
195
193
|
tickLength={tickLength}
|
|
196
194
|
/>
|
|
195
|
+
{children}
|
|
197
196
|
</g>
|
|
198
197
|
{showGrid && (
|
|
199
198
|
<g className="grid">
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import type { RangesViewState } from '@zakodium/nmrium-core';
|
|
2
2
|
|
|
3
|
+
import { isProton } from '../../data/utilities/isProton.ts';
|
|
3
4
|
import { useInsetOptions } from '../1d/inset/InsetProvider.js';
|
|
4
5
|
import { useChartData } from '../context/ChartContext.js';
|
|
5
6
|
|
|
6
7
|
import { useActiveSpectrum } from './useActiveSpectrum.js';
|
|
7
8
|
|
|
8
9
|
export function getDefaultRangesViewState(nucleus: string): RangesViewState {
|
|
9
|
-
const isProton = nucleus === '1H';
|
|
10
10
|
const isCarbon = nucleus === '13C';
|
|
11
11
|
|
|
12
12
|
return {
|
|
13
13
|
showPeaks: isCarbon,
|
|
14
14
|
showMultiplicityTrees: false,
|
|
15
15
|
showIntegrals: false,
|
|
16
|
-
showIntegralsValues: isProton,
|
|
16
|
+
showIntegralsValues: isProton(nucleus),
|
|
17
17
|
showJGraph: false,
|
|
18
18
|
displayingMode: 'spread',
|
|
19
19
|
integralsScaleRatio: 1,
|