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
|
@@ -9,10 +9,11 @@ import { useToaster } from '../context/ToasterContext.js';
|
|
|
9
9
|
import {
|
|
10
10
|
browserNotSupportedErrorToast,
|
|
11
11
|
copyPNGToClipboard,
|
|
12
|
-
|
|
12
|
+
exportAsJsonBlob,
|
|
13
13
|
exportAsPng,
|
|
14
14
|
exportAsSVG,
|
|
15
15
|
} from '../utility/export.js';
|
|
16
|
+
import { saveAs } from '../utility/save_as.ts';
|
|
16
17
|
|
|
17
18
|
interface SaveOptions {
|
|
18
19
|
include: ExportOptions;
|
|
@@ -34,13 +35,19 @@ export function useExport() {
|
|
|
34
35
|
});
|
|
35
36
|
setTimeout(async () => {
|
|
36
37
|
try {
|
|
37
|
-
const
|
|
38
|
+
const name = state.data[0]?.info?.name || 'experiment';
|
|
38
39
|
const exportedData = toJSON(core, state, preferencesState, {
|
|
39
40
|
exportTarget: 'nmrium',
|
|
40
41
|
view: true,
|
|
41
42
|
});
|
|
42
43
|
|
|
43
|
-
|
|
44
|
+
const blob = await exportAsJsonBlob(
|
|
45
|
+
exportedData,
|
|
46
|
+
name,
|
|
47
|
+
spaceIndent,
|
|
48
|
+
isCompressed,
|
|
49
|
+
);
|
|
50
|
+
saveAs({ blob, name, extension: '.nmrium' });
|
|
44
51
|
} catch (error) {
|
|
45
52
|
toaster.show({
|
|
46
53
|
intent: 'danger',
|
|
@@ -58,7 +65,11 @@ export function useExport() {
|
|
|
58
65
|
const saveHandler = useCallback(
|
|
59
66
|
(options: SaveOptions) => {
|
|
60
67
|
async function handler() {
|
|
61
|
-
const {
|
|
68
|
+
const { pretty, compressed, include } = options;
|
|
69
|
+
const name = options.name || 'experiment';
|
|
70
|
+
const exportArchive =
|
|
71
|
+
include.dataType?.startsWith('SELF_CONTAINED') ?? false;
|
|
72
|
+
|
|
62
73
|
const hideLoading = toaster.showLoading({
|
|
63
74
|
message: `Exporting as ${name}.nmrium process in progress`,
|
|
64
75
|
});
|
|
@@ -68,8 +79,29 @@ export function useExport() {
|
|
|
68
79
|
...include,
|
|
69
80
|
exportTarget: 'nmrium',
|
|
70
81
|
});
|
|
71
|
-
const spaceIndent = pretty ? 2 : 0;
|
|
72
|
-
|
|
82
|
+
const spaceIndent = pretty || exportArchive ? 2 : 0;
|
|
83
|
+
const blob = await exportAsJsonBlob(
|
|
84
|
+
exportedData,
|
|
85
|
+
name,
|
|
86
|
+
spaceIndent,
|
|
87
|
+
compressed && !exportArchive,
|
|
88
|
+
);
|
|
89
|
+
|
|
90
|
+
if (!exportArchive) {
|
|
91
|
+
return saveAs({ blob, name, extension: '.nmrium' });
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const archive = await core.serializeNmriumArchive({
|
|
95
|
+
molecules: state.molecules,
|
|
96
|
+
spectra: state.data,
|
|
97
|
+
fileCollections: state.fileCollections,
|
|
98
|
+
includeData: options.include.dataType === 'SELF_CONTAINED',
|
|
99
|
+
serializedState: blob,
|
|
100
|
+
});
|
|
101
|
+
const zipBlob = new Blob([archive], {
|
|
102
|
+
type: 'application/nmrium+zip',
|
|
103
|
+
});
|
|
104
|
+
saveAs({ blob: zipBlob, name, extension: '.nmrium.zip' });
|
|
73
105
|
} catch (error) {
|
|
74
106
|
toaster.show({
|
|
75
107
|
intent: 'danger',
|
|
@@ -33,7 +33,7 @@ function Spinner({ isLoading = true, emptyText = undefined }: SpinnerProps) {
|
|
|
33
33
|
<Fragment>
|
|
34
34
|
{isLoading && getSpinner()}
|
|
35
35
|
{checkEmpty && !isLoading && (
|
|
36
|
-
<NoData isEmpty={data
|
|
36
|
+
<NoData isEmpty={data.length === 0} emptyText={emptyText} />
|
|
37
37
|
)}
|
|
38
38
|
</Fragment>
|
|
39
39
|
);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { NmriumState, ParsingOptions } from '@zakodium/nmrium-core';
|
|
1
2
|
import { FileCollection } from 'file-collection';
|
|
2
3
|
import type { ParseResult } from 'papaparse';
|
|
3
4
|
import { useCallback } from 'react';
|
|
@@ -12,9 +13,9 @@ import useCheckExperimentalFeature from '../hooks/useCheckExperimentalFeature.js
|
|
|
12
13
|
|
|
13
14
|
export function useLoadFiles(onOpenMetaInformation?: (file: File) => void) {
|
|
14
15
|
const dispatch = useDispatch();
|
|
15
|
-
const { dispatch: dispatchPreferences, current: workspacePreferences } =
|
|
16
|
-
usePreferences();
|
|
17
16
|
const preferences = usePreferences();
|
|
17
|
+
const { dispatch: dispatchPreferences, current: workspacePreferences } =
|
|
18
|
+
preferences;
|
|
18
19
|
const toaster = useToaster();
|
|
19
20
|
const { logger } = useLogger();
|
|
20
21
|
const experimentalFeatures = useCheckExperimentalFeature();
|
|
@@ -31,48 +32,84 @@ export function useLoadFiles(onOpenMetaInformation?: (file: File) => void) {
|
|
|
31
32
|
isMetaFile(files[0])
|
|
32
33
|
) {
|
|
33
34
|
onOpenMetaInformation(files[0]);
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const nmriumArchiveFiles: File[] = [];
|
|
39
|
+
const otherFiles: File[] = [];
|
|
40
|
+
let nmriumState: Partial<NmriumState>;
|
|
41
|
+
let containsNmrium: boolean;
|
|
42
|
+
let parseMetaFileResult: ParseResult<any> | null = null;
|
|
43
|
+
const { onLoadProcessing, spectraColors } = workspacePreferences;
|
|
44
|
+
const { nmrLoaders: sourceSelector } = preferences.current;
|
|
45
|
+
|
|
46
|
+
const parsingOptions: Partial<ParsingOptions> = {
|
|
47
|
+
sourceSelector,
|
|
48
|
+
logger: logger.child({ context: 'nmr-processing' }),
|
|
49
|
+
onLoadProcessing,
|
|
50
|
+
experimentalFeatures,
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
let fileCollection: FileCollection | undefined;
|
|
54
|
+
let fileCollections: Map<string, FileCollection> | undefined;
|
|
55
|
+
if (files.length === 1 && files[0].name.endsWith('.nmrium.zip')) {
|
|
56
|
+
[nmriumState, fileCollections] = await core.readNMRiumArchive(
|
|
57
|
+
files[0].stream(),
|
|
58
|
+
parsingOptions,
|
|
59
|
+
);
|
|
60
|
+
containsNmrium = true;
|
|
34
61
|
} else {
|
|
35
|
-
const
|
|
36
|
-
|
|
62
|
+
for (const file of files) {
|
|
63
|
+
if (file.name.endsWith('.nmrium.zip')) {
|
|
64
|
+
nmriumArchiveFiles.push(file);
|
|
65
|
+
} else {
|
|
66
|
+
otherFiles.push(file);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if (nmriumArchiveFiles.length > 0) {
|
|
71
|
+
await Promise.all(
|
|
72
|
+
nmriumArchiveFiles.map((file) => loadFiles([file])),
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
fileCollection = await new FileCollection().appendFileList(
|
|
77
|
+
otherFiles,
|
|
37
78
|
);
|
|
79
|
+
|
|
38
80
|
const metaFile = Object.values(fileCollection.files).find((file) =>
|
|
39
81
|
isMetaFile(file),
|
|
40
82
|
);
|
|
41
|
-
|
|
83
|
+
|
|
42
84
|
if (metaFile) {
|
|
43
85
|
parseMetaFileResult = await parseMetaFile(metaFile);
|
|
44
86
|
}
|
|
45
|
-
|
|
46
|
-
const { onLoadProcessing, spectraColors } = workspacePreferences;
|
|
47
|
-
const { nmriumState, containsNmrium } = await core.read(
|
|
87
|
+
({ nmriumState, containsNmrium } = await core.read(
|
|
48
88
|
fileCollection,
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
onLoadProcessing,
|
|
53
|
-
experimentalFeatures,
|
|
54
|
-
},
|
|
55
|
-
);
|
|
89
|
+
parsingOptions,
|
|
90
|
+
));
|
|
91
|
+
}
|
|
56
92
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
payload: {
|
|
61
|
-
data: nmriumState.settings,
|
|
62
|
-
workspaceSource: 'nmriumFile',
|
|
63
|
-
},
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
dispatch({
|
|
67
|
-
type: 'LOAD_DROP_FILES',
|
|
93
|
+
if (nmriumState.settings) {
|
|
94
|
+
dispatchPreferences({
|
|
95
|
+
type: 'SET_WORKSPACE',
|
|
68
96
|
payload: {
|
|
69
|
-
nmriumState,
|
|
70
|
-
|
|
71
|
-
parseMetaFileResult,
|
|
72
|
-
spectraColors,
|
|
97
|
+
data: nmriumState.settings,
|
|
98
|
+
workspaceSource: 'nmriumFile',
|
|
73
99
|
},
|
|
74
100
|
});
|
|
75
101
|
}
|
|
102
|
+
dispatch({
|
|
103
|
+
type: 'LOAD_DROP_FILES',
|
|
104
|
+
payload: {
|
|
105
|
+
nmriumState,
|
|
106
|
+
containsNmrium,
|
|
107
|
+
parseMetaFileResult,
|
|
108
|
+
spectraColors,
|
|
109
|
+
fileCollection,
|
|
110
|
+
fileCollections,
|
|
111
|
+
},
|
|
112
|
+
});
|
|
76
113
|
}
|
|
77
114
|
|
|
78
115
|
loadFiles(files)
|
|
@@ -8,6 +8,7 @@ import { CoreProvider } from '../context/CoreContext.js';
|
|
|
8
8
|
import { GlobalProvider } from '../context/GlobalContext.js';
|
|
9
9
|
import { KeyModifiersProvider } from '../context/KeyModifierContext.js';
|
|
10
10
|
import { LoggerProvider } from '../context/LoggerContext.js';
|
|
11
|
+
import type { PreferencesStateContext } from '../context/PreferencesContext.js';
|
|
11
12
|
import { PreferencesProvider } from '../context/PreferencesContext.js';
|
|
12
13
|
import { SortSpectraProvider } from '../context/SortSpectraContext.js';
|
|
13
14
|
import { ToasterProvider } from '../context/ToasterContext.js';
|
|
@@ -66,6 +67,10 @@ export function InnerNMRium(props: InnerNMRiumProps) {
|
|
|
66
67
|
initPreferencesState,
|
|
67
68
|
);
|
|
68
69
|
|
|
70
|
+
const preferencesProviderValue = useMemo<PreferencesStateContext>(() => {
|
|
71
|
+
return { ...preferencesState, dispatch: dispatchPreferences };
|
|
72
|
+
}, [preferencesState]);
|
|
73
|
+
|
|
69
74
|
useEffect(() => {
|
|
70
75
|
rootRef.current?.focus();
|
|
71
76
|
}, [isFullScreen]);
|
|
@@ -79,7 +84,6 @@ export function InnerNMRium(props: InnerNMRiumProps) {
|
|
|
79
84
|
workspace,
|
|
80
85
|
customWorkspaces,
|
|
81
86
|
currentWorkspace: settings?.currentWorkspace,
|
|
82
|
-
dispatch: dispatchPreferences,
|
|
83
87
|
},
|
|
84
88
|
});
|
|
85
89
|
}, [customWorkspaces, preferences, workspace]);
|
|
@@ -99,7 +103,7 @@ export function InnerNMRium(props: InnerNMRiumProps) {
|
|
|
99
103
|
viewerRef: viewerRef.current,
|
|
100
104
|
}}
|
|
101
105
|
>
|
|
102
|
-
<PreferencesProvider value={
|
|
106
|
+
<PreferencesProvider value={preferencesProviderValue}>
|
|
103
107
|
<LoggerProvider>
|
|
104
108
|
<KeyModifiersProvider>
|
|
105
109
|
<ToasterProvider>
|
|
@@ -52,7 +52,7 @@ export default function NMRiumStateProvider(props: NMRiumStateProviderProps) {
|
|
|
52
52
|
);
|
|
53
53
|
|
|
54
54
|
const {
|
|
55
|
-
|
|
55
|
+
sources,
|
|
56
56
|
data: spectraData,
|
|
57
57
|
molecules,
|
|
58
58
|
correlations,
|
|
@@ -71,17 +71,25 @@ export default function NMRiumStateProvider(props: NMRiumStateProviderProps) {
|
|
|
71
71
|
const { workspace, workspaces = {} } = preferencesState;
|
|
72
72
|
stateRef.current = toJSON(
|
|
73
73
|
core,
|
|
74
|
-
{
|
|
74
|
+
{
|
|
75
|
+
data: spectraData,
|
|
76
|
+
molecules,
|
|
77
|
+
correlations,
|
|
78
|
+
sources,
|
|
79
|
+
view,
|
|
80
|
+
actionType,
|
|
81
|
+
fileCollections: {},
|
|
82
|
+
},
|
|
75
83
|
{ current: workspaces[workspace.current] },
|
|
76
84
|
{ serialize: false, exportTarget: 'onChange' },
|
|
77
|
-
);
|
|
85
|
+
) as NmriumState;
|
|
78
86
|
}, [
|
|
79
87
|
actionType,
|
|
80
88
|
core,
|
|
81
89
|
correlations,
|
|
82
90
|
molecules,
|
|
83
91
|
preferencesState,
|
|
84
|
-
|
|
92
|
+
sources,
|
|
85
93
|
spectraData,
|
|
86
94
|
view,
|
|
87
95
|
]);
|
|
@@ -91,7 +99,7 @@ export default function NMRiumStateProvider(props: NMRiumStateProviderProps) {
|
|
|
91
99
|
if (checkActionType(actionType)) {
|
|
92
100
|
handleChange.current?.(stateRef.current as NmriumState, 'data');
|
|
93
101
|
}
|
|
94
|
-
}, [actionType, correlations, molecules,
|
|
102
|
+
}, [actionType, correlations, molecules, sources, spectraData]);
|
|
95
103
|
|
|
96
104
|
useEffect(() => {
|
|
97
105
|
// trigger onChange callback if view object changed
|
|
@@ -111,7 +119,8 @@ export default function NMRiumStateProvider(props: NMRiumStateProviderProps) {
|
|
|
111
119
|
if (nmriumData) {
|
|
112
120
|
void core
|
|
113
121
|
.readNMRiumObject(nmriumData)
|
|
114
|
-
.then((
|
|
122
|
+
.then((result) => {
|
|
123
|
+
const [nmriumState, fileCollections] = result;
|
|
115
124
|
if (nmriumState?.settings) {
|
|
116
125
|
dispatchPreferences({
|
|
117
126
|
type: 'SET_WORKSPACE',
|
|
@@ -121,7 +130,10 @@ export default function NMRiumStateProvider(props: NMRiumStateProviderProps) {
|
|
|
121
130
|
},
|
|
122
131
|
});
|
|
123
132
|
}
|
|
124
|
-
dispatch({
|
|
133
|
+
dispatch({
|
|
134
|
+
type: 'INITIATE',
|
|
135
|
+
payload: { nmriumState, fileCollections },
|
|
136
|
+
});
|
|
125
137
|
})
|
|
126
138
|
.catch((error: unknown) => {
|
|
127
139
|
dispatch({ type: 'SET_LOADING_FLAG', payload: { isLoading: false } });
|
|
@@ -15,7 +15,6 @@ const allowedExtensions = new Set(['dx', 'jdx', 'jcamp']);
|
|
|
15
15
|
|
|
16
16
|
const loadFormValidation = Yup.object({
|
|
17
17
|
url: Yup.string()
|
|
18
|
-
.url()
|
|
19
18
|
.required()
|
|
20
19
|
.test(
|
|
21
20
|
'file type',
|
|
@@ -67,13 +66,13 @@ function InnerLoadJCAMPModal({ onCloseDialog }: InnerLoadJCAMPModalProps) {
|
|
|
67
66
|
});
|
|
68
67
|
const { pathname, origin } = new URL(url);
|
|
69
68
|
try {
|
|
70
|
-
const nmriumState = await core.readFromWebSource({
|
|
69
|
+
const [nmriumState, fileCollection] = await core.readFromWebSource({
|
|
71
70
|
entries: [{ relativePath: pathname, baseURL: origin }],
|
|
72
71
|
});
|
|
73
72
|
|
|
74
73
|
dispatch({
|
|
75
74
|
type: 'LOAD_DROP_FILES',
|
|
76
|
-
payload: { nmriumState, resetSourceObject: false },
|
|
75
|
+
payload: { nmriumState, resetSourceObject: false, fileCollection },
|
|
77
76
|
});
|
|
78
77
|
} catch {
|
|
79
78
|
toaster.show({ message: `Failed to load ${url}`, intent: 'danger' });
|
|
@@ -162,8 +162,6 @@ function InnerMultipleAnalysis(props: InnerMultipleAnalysisProps) {
|
|
|
162
162
|
debug: true,
|
|
163
163
|
},
|
|
164
164
|
});
|
|
165
|
-
// TODO: refactor to not use an effect
|
|
166
|
-
// eslint-disable-next-line react-hooks/set-state-in-effect
|
|
167
165
|
setCalcFinished(true);
|
|
168
166
|
setAnalysisData(result);
|
|
169
167
|
} catch (error) {
|
|
@@ -8,12 +8,14 @@ import {
|
|
|
8
8
|
import { Controller, useForm } from 'react-hook-form';
|
|
9
9
|
|
|
10
10
|
import type { ExportOptions } from '../../data/SpectraManager.js';
|
|
11
|
+
import { DataExportOptions } from '../../data/SpectraManager.js';
|
|
11
12
|
import { useChartData } from '../context/ChartContext.js';
|
|
12
13
|
import ActionButtons from '../elements/ActionButtons.js';
|
|
13
14
|
import { Input2Controller } from '../elements/Input2Controller.js';
|
|
14
15
|
import type { LabelStyle } from '../elements/Label.js';
|
|
15
16
|
import Label from '../elements/Label.js';
|
|
16
17
|
import { StyledDialogBody } from '../elements/StyledDialogBody.js';
|
|
18
|
+
import useCheckExperimentalFeature from '../hooks/useCheckExperimentalFeature.js';
|
|
17
19
|
import { useExport } from '../hooks/useExport.js';
|
|
18
20
|
|
|
19
21
|
const INITIAL_VALUE = {
|
|
@@ -21,7 +23,7 @@ const INITIAL_VALUE = {
|
|
|
21
23
|
compressed: false,
|
|
22
24
|
pretty: false,
|
|
23
25
|
include: {
|
|
24
|
-
dataType:
|
|
26
|
+
dataType: DataExportOptions.RAW_DATA,
|
|
25
27
|
view: false,
|
|
26
28
|
settings: false,
|
|
27
29
|
} satisfies ExportOptions,
|
|
@@ -56,8 +58,9 @@ function SaveAsModal(props: SaveAsModalProps) {
|
|
|
56
58
|
}
|
|
57
59
|
function InnerSaveAsModal(props: InnerSaveAsModalProps) {
|
|
58
60
|
const { onCloseDialog } = props;
|
|
59
|
-
const {
|
|
61
|
+
const { sources, data } = useChartData();
|
|
60
62
|
const { saveHandler } = useExport();
|
|
63
|
+
const experimentalFlagEnabled = useCheckExperimentalFeature();
|
|
61
64
|
|
|
62
65
|
const fileName = data[0]?.info?.name;
|
|
63
66
|
|
|
@@ -105,13 +108,33 @@ function InnerSaveAsModal(props: InnerSaveAsModalProps) {
|
|
|
105
108
|
const { value, ref, ...otherFieldProps } = field;
|
|
106
109
|
return (
|
|
107
110
|
<RadioGroup inline selectedValue={value} {...otherFieldProps}>
|
|
108
|
-
<Radio label="Raw data" value=
|
|
111
|
+
<Radio label="Raw data" value={DataExportOptions.RAW_DATA} />
|
|
109
112
|
<Radio
|
|
110
113
|
label="Data source"
|
|
111
|
-
value=
|
|
112
|
-
disabled={
|
|
114
|
+
value={DataExportOptions.DATA_SOURCE}
|
|
115
|
+
disabled={Object.keys(sources).length === 0}
|
|
113
116
|
/>
|
|
114
|
-
<Radio label="No data" value=
|
|
117
|
+
<Radio label="No data" value={DataExportOptions.NO_DATA} />
|
|
118
|
+
|
|
119
|
+
{/*
|
|
120
|
+
* Radio group works with Children.map.
|
|
121
|
+
* So Radio must be direct children of RadioGroup.
|
|
122
|
+
*/}
|
|
123
|
+
{experimentalFlagEnabled && (
|
|
124
|
+
<Radio
|
|
125
|
+
label="Full data (external data embed, experimental)"
|
|
126
|
+
value={DataExportOptions.SELF_CONTAINED}
|
|
127
|
+
/>
|
|
128
|
+
)}
|
|
129
|
+
{experimentalFlagEnabled && (
|
|
130
|
+
<Radio
|
|
131
|
+
label="Full data (external data linked, experimental)"
|
|
132
|
+
disabled={Object.keys(sources).length === 0}
|
|
133
|
+
value={
|
|
134
|
+
DataExportOptions.SELF_CONTAINED_EXTERNAL_DATASOURCE
|
|
135
|
+
}
|
|
136
|
+
/>
|
|
137
|
+
)}
|
|
115
138
|
</RadioGroup>
|
|
116
139
|
);
|
|
117
140
|
}}
|
|
@@ -80,8 +80,6 @@ export function ChangeSumModalContents(props: ChangeSumModalContentsProps) {
|
|
|
80
80
|
|
|
81
81
|
useEffect(() => {
|
|
82
82
|
if (sumOptions?.sumAuto && panels?.structuresPanel?.display) {
|
|
83
|
-
// TODO: refactor to not use an effect
|
|
84
|
-
// eslint-disable-next-line react-hooks/set-state-in-effect
|
|
85
83
|
setActiveOption('auto');
|
|
86
84
|
const { mf, moleculeId: id } = sumOptions;
|
|
87
85
|
reset({
|
|
@@ -76,8 +76,6 @@ export default function SelectMolecule<
|
|
|
76
76
|
const index = value
|
|
77
77
|
? molecules.findIndex((molecule) => molecule.id === value.id)
|
|
78
78
|
: -1;
|
|
79
|
-
// TODO: refactor to not use an effect
|
|
80
|
-
// eslint-disable-next-line react-hooks/set-state-in-effect
|
|
81
79
|
setValue(index !== -1 ? index : 0);
|
|
82
80
|
}
|
|
83
81
|
}, [molecules, setValue, value]);
|
|
@@ -37,7 +37,7 @@ interface DatabasesTabContentProps {
|
|
|
37
37
|
originalWorkspaces: CustomWorkspaces;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
function DatabasesTabContent({
|
|
40
|
+
export default function DatabasesTabContent({
|
|
41
41
|
currentWorkspace,
|
|
42
42
|
originalWorkspaces,
|
|
43
43
|
}: DatabasesTabContentProps) {
|
|
@@ -276,5 +276,3 @@ function DataBaseHeader(props: DataBaseHeaderProps) {
|
|
|
276
276
|
</Section>
|
|
277
277
|
);
|
|
278
278
|
}
|
|
279
|
-
|
|
280
|
-
export default DatabasesTabContent;
|
|
@@ -22,7 +22,7 @@ const databasesValidation = object().shape({
|
|
|
22
22
|
data: array().of(
|
|
23
23
|
object().shape({
|
|
24
24
|
label: string().trim().required('Label is a required field'),
|
|
25
|
-
url: string().trim().
|
|
25
|
+
url: string().trim().required('URL is a required field'),
|
|
26
26
|
}),
|
|
27
27
|
),
|
|
28
28
|
});
|
|
@@ -58,7 +58,7 @@ const externalAPIsValidation = array()
|
|
|
58
58
|
key: mixed<ExternalAPIKeyType>()
|
|
59
59
|
.oneOf(EXTERNAL_API_KEYS.map(({ key }) => key))
|
|
60
60
|
.required(),
|
|
61
|
-
serverLink: string().
|
|
61
|
+
serverLink: string().required(),
|
|
62
62
|
APIKey: string().required(),
|
|
63
63
|
}),
|
|
64
64
|
)
|
|
@@ -26,12 +26,8 @@ export interface IntegralPanelInnerProps {
|
|
|
26
26
|
xDomain: number[];
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
function IntegralPanelInner({
|
|
30
|
-
integrals,
|
|
31
|
-
info,
|
|
32
|
-
activeTab,
|
|
33
|
-
xDomain,
|
|
34
|
-
}: IntegralPanelInnerProps) {
|
|
29
|
+
function IntegralPanelInner(props: IntegralPanelInnerProps) {
|
|
30
|
+
const { integrals, info, activeTab, xDomain } = props;
|
|
35
31
|
const [filterIsActive, setFilterIsActive] = useState(false);
|
|
36
32
|
|
|
37
33
|
const dispatch = useDispatch();
|
|
@@ -29,7 +29,8 @@ interface IntegralTableProps
|
|
|
29
29
|
info: Info1D;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
function IntegralTable(
|
|
32
|
+
function IntegralTable(props: IntegralTableProps) {
|
|
33
|
+
const { activeTab, data, info } = props;
|
|
33
34
|
const dispatch = useDispatch();
|
|
34
35
|
|
|
35
36
|
const deleteIntegralHandler = useCallback(
|
|
@@ -179,11 +180,11 @@ function IntegralTable({ activeTab, data, info }: IntegralTableProps) {
|
|
|
179
180
|
return columns;
|
|
180
181
|
}, [COLUMNS, integralsPreferences]);
|
|
181
182
|
|
|
182
|
-
if (info
|
|
183
|
+
if (info.isFid) {
|
|
183
184
|
return <NoDataForFid />;
|
|
184
185
|
}
|
|
185
186
|
|
|
186
|
-
if (
|
|
187
|
+
if (data.length === 0) {
|
|
187
188
|
return <EmptyText text="No data" />;
|
|
188
189
|
}
|
|
189
190
|
|
|
@@ -75,8 +75,6 @@ function MoleculePanelInner(props: MoleculePanelInnerProps) {
|
|
|
75
75
|
|
|
76
76
|
useEffect(() => {
|
|
77
77
|
if (moleculesProp) {
|
|
78
|
-
// TODO: refactor to not use an effect
|
|
79
|
-
// eslint-disable-next-line react-hooks/set-state-in-effect
|
|
80
78
|
setMolecules((prevMolecules) => {
|
|
81
79
|
if (moleculesProp.length > prevMolecules.length) {
|
|
82
80
|
setCurrentIndex(molecules.length);
|
|
@@ -164,6 +162,7 @@ function MoleculePanelInner(props: MoleculePanelInnerProps) {
|
|
|
164
162
|
showAtomNumber={
|
|
165
163
|
moleculesView?.[mol.id]?.showAtomNumber || false
|
|
166
164
|
}
|
|
165
|
+
noCarbonLabelWithCustomLabel
|
|
167
166
|
/>
|
|
168
167
|
</div>
|
|
169
168
|
</div>
|
|
@@ -129,8 +129,8 @@ export function getAssignIds(
|
|
|
129
129
|
|
|
130
130
|
export function getHighlightsOnHover(
|
|
131
131
|
assignments: AssignmentContext,
|
|
132
|
-
oclIDs:
|
|
133
|
-
|
|
132
|
+
oclIDs: string[],
|
|
133
|
+
spectra: Spectrum[],
|
|
134
134
|
) {
|
|
135
135
|
// set all IDs to highlight when hovering over an atom from AssignKey data
|
|
136
136
|
let highlights: string[] = [];
|
|
@@ -138,12 +138,15 @@ export function getHighlightsOnHover(
|
|
|
138
138
|
|
|
139
139
|
for (const key in assignmentsByKey) {
|
|
140
140
|
const assignments = assignmentsByKey[key];
|
|
141
|
-
|
|
142
141
|
for (const axis of assignmentAxes) {
|
|
143
142
|
if (assignments[axis]?.some((oclKey: any) => oclIDs.includes(oclKey))) {
|
|
144
143
|
highlights = highlights.concat(assignments[axis]);
|
|
145
|
-
const
|
|
146
|
-
|
|
144
|
+
for (const spectrum of spectra) {
|
|
145
|
+
const assignIds = getAssignIds(spectrum, key);
|
|
146
|
+
if (!assignIds) {
|
|
147
|
+
continue;
|
|
148
|
+
}
|
|
149
|
+
|
|
147
150
|
const ids = assignIds.map<string>((item) => item.key);
|
|
148
151
|
highlights.push(...ids);
|
|
149
152
|
}
|
|
@@ -158,7 +161,6 @@ export function getCurrentDiaIDsToHighlight(assignmentData: AssignmentContext) {
|
|
|
158
161
|
const { highlighted, data } = assignmentData;
|
|
159
162
|
const assignment = highlighted ? data[highlighted.id] : null;
|
|
160
163
|
const axisHover = highlighted ? highlighted.axis : null;
|
|
161
|
-
|
|
162
164
|
if (axisHover && assignment?.[axisHover]) {
|
|
163
165
|
return assignment[axisHover];
|
|
164
166
|
} else {
|
|
@@ -4,8 +4,10 @@ import type { MouseEvent } from 'react';
|
|
|
4
4
|
import { useMemo, useRef } from 'react';
|
|
5
5
|
|
|
6
6
|
import { isSpectrum1D } from '../../../data/data1d/Spectrum1D/isSpectrum1D.js';
|
|
7
|
+
import { isSpectrum2D } from '../../../data/data2d/Spectrum2D/isSpectrum2D.ts';
|
|
7
8
|
import { ConcatenationString } from '../../../data/utilities/Concatenation.js';
|
|
8
9
|
import checkModifierKeyActivated from '../../../data/utilities/checkModifierKeyActivated.js';
|
|
10
|
+
import { useTracesSpectra } from '../../2d/useTracesSpectra.ts';
|
|
9
11
|
import type { Assignments, Axis } from '../../assignment/AssignmentsContext.js';
|
|
10
12
|
import { useAssignmentContext } from '../../assignment/AssignmentsContext.js';
|
|
11
13
|
import { useChartData } from '../../context/ChartContext.js';
|
|
@@ -75,6 +77,8 @@ export default function useAtomAssignment() {
|
|
|
75
77
|
},
|
|
76
78
|
} = useChartData();
|
|
77
79
|
const spectrum = useSpectrum();
|
|
80
|
+
const tracesSpectra = useTracesSpectra();
|
|
81
|
+
|
|
78
82
|
const toaster = useToaster();
|
|
79
83
|
const dispatch = useDispatch();
|
|
80
84
|
const highlightData = useHighlightData();
|
|
@@ -94,20 +98,33 @@ export default function useAtomAssignment() {
|
|
|
94
98
|
|
|
95
99
|
const currentDiaIDsToHighlight = useMemo(() => {
|
|
96
100
|
const { highlighted, sourceData } = highlightData.highlight;
|
|
97
|
-
const type = sourceData
|
|
101
|
+
const { type, extra } = sourceData || {};
|
|
102
|
+
const { spectrumID } = extra || {};
|
|
103
|
+
|
|
104
|
+
let currentSpectrum = spectrum;
|
|
105
|
+
|
|
106
|
+
if (isSpectrum2D(spectrum) && spectrumID) {
|
|
107
|
+
const traceSpectrum = tracesSpectra.find(
|
|
108
|
+
(traceSpectrum) => traceSpectrum.id === spectrumID,
|
|
109
|
+
);
|
|
110
|
+
if (traceSpectrum) {
|
|
111
|
+
currentSpectrum = traceSpectrum;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
98
114
|
|
|
99
|
-
if (!type || !isValidHighlightEventSource(type))
|
|
115
|
+
if (!type || !isValidHighlightEventSource(type) || !currentSpectrum) {
|
|
116
|
+
return [];
|
|
117
|
+
}
|
|
100
118
|
|
|
101
119
|
const highlightedAssignmentsIDs = highlighted.filter((highlightID) => {
|
|
102
120
|
return assignments.data[highlightID];
|
|
103
121
|
});
|
|
104
122
|
|
|
105
123
|
const highlights = highlightedAssignmentsIDs.flatMap((highlightID) =>
|
|
106
|
-
getSignalsDiaIDs(
|
|
124
|
+
getSignalsDiaIDs(currentSpectrum, assignments.data, highlightID),
|
|
107
125
|
);
|
|
108
|
-
|
|
109
126
|
return getCurrentDiaIDsToHighlight(assignments).concat(highlights);
|
|
110
|
-
}, [assignments, highlightData.highlight, spectrum]);
|
|
127
|
+
}, [assignments, highlightData.highlight, spectrum, tracesSpectra]);
|
|
111
128
|
|
|
112
129
|
function assign1DAtom(spectrum: Spectrum1D, key: string, atom: AtomData) {
|
|
113
130
|
const assignKeys = getAssignIds(spectrum, key);
|
|
@@ -223,11 +240,13 @@ export default function useAtomAssignment() {
|
|
|
223
240
|
|
|
224
241
|
function handleOnAtomHover(diaIDAndInfo: DiaIDAndInfo | undefined) {
|
|
225
242
|
const { oclIDs } = extractFromAtom(diaIDAndInfo, nucleus);
|
|
226
|
-
|
|
227
243
|
// on enter the atom
|
|
228
244
|
if (oclIDs.length > 0) {
|
|
229
245
|
// set all IDs to highlight when hovering over an atom from assignment data
|
|
230
|
-
const highlights = getHighlightsOnHover(assignments, oclIDs,
|
|
246
|
+
const highlights = getHighlightsOnHover(assignments, oclIDs, [
|
|
247
|
+
spectrum,
|
|
248
|
+
...tracesSpectra,
|
|
249
|
+
]);
|
|
231
250
|
highlightedIdDsRef.current = highlights;
|
|
232
251
|
highlightData.dispatch({
|
|
233
252
|
type: 'SHOW',
|