nmrium 0.37.0 → 0.38.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/FooterBanner.js +1 -1
- package/lib/component/1d/Viewer1D.js +26 -21
- package/lib/component/1d/integral/Integral.d.ts +2 -6
- package/lib/component/1d/integral/IntegralResizable.d.ts +2 -6
- package/lib/component/1d/integral/IntegralResizable.js +2 -3
- package/lib/component/1d/multiAnalysis/MultiAnalysisRanges.js +1 -1
- package/lib/component/1d/multiplicityTree/MultiplicityTree.js +7 -9
- package/lib/component/1d/peaks/PeakAnnotation.js +1 -2
- package/lib/component/1d/ranges/Range.js +9 -8
- package/lib/component/1d/ranges/Ranges.js +5 -7
- package/lib/component/1d/tool/BaseLineZones.js +1 -2
- package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.js +4 -5
- package/lib/component/1d-2d/components/FloatMoleculeStructures/index.js +13 -17
- package/lib/component/2d/1d-tracer/Left1DChart.js +1 -1
- package/lib/component/2d/1d-tracer/VerticalSliceChart.js +1 -1
- package/lib/component/2d/Chart2D.js +1 -1
- package/lib/component/2d/Viewer2D.js +10 -9
- package/lib/component/2d/fid/FidCanvas.js +4 -6
- package/lib/component/2d/ft/Contours.js +1 -1
- package/lib/component/2d/utilities/DimensionLayout.d.ts +9 -24
- package/lib/component/2d/utilities/scale.d.ts +2 -1
- package/lib/component/2d/utilities/scale.js +1 -1
- package/lib/component/2d/zones/Zones.js +1 -1
- package/lib/component/EventsTrackers/KeysListenerTracker.js +28 -21
- package/lib/component/NMRium.js +15 -7
- package/lib/component/assignment/AssignmentsReducer.d.ts +1 -1
- package/lib/component/context/DispatchContext.d.ts +23 -3
- package/lib/component/context/DispatchContext.js +1 -1
- package/lib/component/context/LoggerContext.js +1 -1
- package/lib/component/elements/Button.js +7 -9
- package/lib/component/elements/IsotopesViewer.js +1 -1
- package/lib/component/elements/ReactTable/ReactTable.js +1 -2
- package/lib/component/elements/formik/FormikCheckBox.js +1 -1
- package/lib/component/elements/formik/FormikColorInput.js +1 -1
- package/lib/component/elements/formik/FormikColorPicker.js +1 -1
- package/lib/component/elements/formik/FormikColumnFormatField.js +1 -1
- package/lib/component/elements/formik/FormikInput.js +1 -1
- package/lib/component/elements/formik/FormikSelect.js +2 -2
- package/lib/component/elements/formik/FormikSlider.js +1 -1
- package/lib/component/elements/formik/FormikTextarea.js +2 -2
- package/lib/component/header/ApodizationOptionsPanel.js +4 -5
- package/lib/component/header/AutoPeakPickingOptionPanel.js +1 -2
- package/lib/component/header/BaseLineCorrectionPanel.js +4 -5
- package/lib/component/header/Header.js +4 -6
- package/lib/component/header/PhaseCorrectionPanel.js +7 -8
- package/lib/component/header/RangesPickingOptionPanel.js +1 -2
- package/lib/component/header/ZeroFillingOptionsPanel.js +3 -11
- package/lib/component/header/Zones2DOptionPanel.js +5 -6
- package/lib/component/hooks/useExport.js +1 -0
- package/lib/component/hooks/useToolsFunctions.js +8 -10
- package/lib/component/loader/DropZone.js +4 -5
- package/lib/component/loader/NoData.js +1 -1
- package/lib/component/modal/AlignSpectraModal.js +1 -2
- package/lib/component/modal/EditPeakShapeModal.js +1 -2
- package/lib/component/modal/ImportPublicationStringModal.js +1 -2
- package/lib/component/modal/LoadJCAMPModal.js +2 -3
- package/lib/component/modal/MoleculeStructureEditorModal.js +24 -19
- package/lib/component/modal/PredictSpectraModal.js +24 -21
- package/lib/component/modal/changeSum/SelectMolecule.js +1 -1
- package/lib/component/modal/editRange/EditRangeModal.js +3 -4
- package/lib/component/modal/editRange/forms/components/AddSignalFormTab.js +2 -2
- package/lib/component/modal/editRange/forms/components/CouplingsTable.js +1 -1
- package/lib/component/modal/metaImportation/MetaImportationModal.js +2 -3
- package/lib/component/modal/setting/settings-tabs/DatabasesTabContent.js +4 -4
- package/lib/component/modal/setting/settings-tabs/FormattingTabContent.js +2 -2
- package/lib/component/modal/setting/settings-tabs/InfoBlockTabContent.js +2 -2
- package/lib/component/panels/AutomaticAssignment/AutomaticAssignmentTable.js +1 -2
- package/lib/component/panels/AutomaticAssignment/useAutoAssignments.js +7 -6
- package/lib/component/panels/InformationPanel.js +6 -6
- package/lib/component/panels/IntegralsPanel/IntegralPanel.js +11 -20
- package/lib/component/panels/IntegralsPanel/IntegralTable.js +10 -10
- package/lib/component/panels/MatrixGenerationPanel/ExclusionsZonesTable.js +1 -1
- package/lib/component/panels/MatrixGenerationPanel/FiltersOptions.js +4 -4
- package/lib/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +1 -2
- package/lib/component/panels/MoleculesPanel/MoleculeHeader.js +1 -2
- package/lib/component/panels/MoleculesPanel/MoleculePanel.js +10 -13
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +4 -5
- package/lib/component/panels/MoleculesPanel/Utilities.d.ts +4 -1
- package/lib/component/panels/MoleculesPanel/Utilities.js +2 -2
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +8 -9
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +3 -4
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +1 -2
- package/lib/component/panels/MultipleSpectraAnalysisPanel/preferences/AnalysisTablePreferences.js +2 -2
- package/lib/component/panels/MultipleSpectraAnalysisPanel/preferences/LegendsPreferences.js +2 -2
- package/lib/component/panels/MultipleSpectraAnalysisPanel/preferences/MultipleAnalysisCodeEditor.js +1 -1
- package/lib/component/panels/Panels.js +1 -1
- package/lib/component/panels/PeaksPanel/PeaksPanel.js +4 -5
- package/lib/component/panels/PeaksPanel/PeaksTable.js +4 -5
- package/lib/component/panels/RangesPanel/RangesHeader.js +12 -15
- package/lib/component/panels/RangesPanel/RangesPanel.js +24 -29
- package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +1 -1
- package/lib/component/panels/RangesPanel/TableColumns/RelativeColumn.js +3 -3
- package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.js +1 -2
- package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.d.ts +1 -1
- package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.js +16 -14
- package/lib/component/panels/SpectrumsPanel/SpectraPanelHeader.js +16 -16
- package/lib/component/panels/SpectrumsPanel/SpectraTable.js +7 -5
- package/lib/component/panels/SpectrumsPanel/SpectrumsTabs.js +4 -5
- package/lib/component/panels/SpectrumsPanel/base/ShowHideSpectrumButton.js +3 -7
- package/lib/component/panels/SpectrumsPanel/base/setting/SpectrumSetting.js +4 -2
- package/lib/component/panels/SpectrumsPanel/base/setting/processSnapPlot.js +2 -2
- package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +4 -8
- package/lib/component/panels/SummaryPanel/SummaryPanel.js +39 -34
- package/lib/component/panels/SummaryPanel/utilities/Utilities.js +1 -1
- package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.d.ts +2 -13
- package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +22 -20
- package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumn.d.ts +2 -2
- package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumn.js +1 -1
- package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumns.d.ts +2 -2
- package/lib/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.d.ts +2 -2
- package/lib/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.js +6 -7
- package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.d.ts +2 -2
- package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.js +1 -1
- package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumns.d.ts +2 -2
- package/lib/component/panels/ZonesPanel/ZonesPanel.js +15 -18
- package/lib/component/panels/ZonesPanel/ZonesTable.js +2 -51
- package/lib/component/panels/ZonesPanel/ZonesTableRow.d.ts +3 -3
- package/lib/component/panels/ZonesPanel/hooks/useMapZones.d.ts +16 -0
- package/lib/component/panels/ZonesPanel/hooks/useMapZones.js +52 -0
- package/lib/component/panels/databasePanel/DatabasePanel.js +9 -7
- package/lib/component/panels/filtersPanel/FilterPanel.js +1 -2
- package/lib/component/panels/filtersPanel/FiltersTable.js +8 -9
- package/lib/component/panels/header/DefaultPanelHeader.js +1 -1
- package/lib/component/panels/header/SpectraAutomaticPickingButton.js +2 -3
- package/lib/component/panels/predictionPanel/PredictionPanel.js +4 -5
- package/lib/component/reducer/IgnoreActions.d.ts +2 -1
- package/lib/component/reducer/IgnoreActions.js +35 -32
- package/lib/component/reducer/Reducer.d.ts +8 -5
- package/lib/component/reducer/Reducer.js +199 -221
- package/lib/component/reducer/actions/AssignmentsActions.d.ts +7 -6
- package/lib/component/reducer/actions/AssignmentsActions.js +2 -2
- package/lib/component/reducer/actions/CorrelationsActions.d.ts +21 -13
- package/lib/component/reducer/actions/CorrelationsActions.js +25 -20
- package/lib/component/reducer/actions/DatabaseActions.d.ts +15 -2
- package/lib/component/reducer/actions/DatabaseActions.js +5 -2
- package/lib/component/reducer/actions/DimensionsActions.d.ts +8 -3
- package/lib/component/reducer/actions/DimensionsActions.js +3 -5
- package/lib/component/reducer/actions/DomainActions.d.ts +11 -5
- package/lib/component/reducer/actions/DomainActions.js +13 -19
- package/lib/component/reducer/actions/FiltersActions.d.ts +70 -23
- package/lib/component/reducer/actions/FiltersActions.js +250 -255
- package/lib/component/reducer/actions/GlobalActions.d.ts +7 -2
- package/lib/component/reducer/actions/GlobalActions.js +3 -3
- package/lib/component/reducer/actions/IntegralsActions.d.ts +28 -7
- package/lib/component/reducer/actions/IntegralsActions.js +16 -15
- package/lib/component/reducer/actions/LoadActions.d.ts +23 -5
- package/lib/component/reducer/actions/LoadActions.js +52 -52
- package/lib/component/reducer/actions/MoleculeActions.d.ts +38 -9
- package/lib/component/reducer/actions/MoleculeActions.js +27 -18
- package/lib/component/reducer/actions/PeaksActions.d.ts +39 -8
- package/lib/component/reducer/actions/PeaksActions.js +19 -11
- package/lib/component/reducer/actions/PreferencesActions.d.ts +8 -3
- package/lib/component/reducer/actions/PreferencesActions.js +5 -3
- package/lib/component/reducer/actions/RangesActions.d.ts +85 -18
- package/lib/component/reducer/actions/RangesActions.js +80 -65
- package/lib/component/reducer/actions/SpectraAnalysisAction.d.ts +7 -1
- package/lib/component/reducer/actions/SpectrumsActions.d.ts +57 -24
- package/lib/component/reducer/actions/SpectrumsActions.js +69 -60
- package/lib/component/reducer/actions/ToolsActions.d.ts +59 -21
- package/lib/component/reducer/actions/ToolsActions.js +54 -32
- package/lib/component/reducer/actions/ZonesActions.d.ts +79 -15
- package/lib/component/reducer/actions/ZonesActions.js +68 -49
- package/lib/component/reducer/helper/Zoom1DManager.d.ts +6 -5
- package/lib/component/reducer/helper/Zoom1DManager.js +1 -1
- package/lib/component/reducer/helper/ZoomHistoryManager.js +2 -2
- package/lib/component/reducer/helper/get2DRange.d.ts +7 -1
- package/lib/component/reducer/preferences/preferencesReducer.d.ts +1 -1
- package/lib/component/reducer/types/ActionType.d.ts +6 -0
- package/lib/component/reducer/types/ActionType.js +1 -0
- package/lib/component/toolbar/BasicToolBar.js +6 -9
- package/lib/component/toolbar/FunctionToolBar.js +4 -9
- package/lib/component/toolbar/ToolBar.js +1 -1
- package/lib/component/toolbar/ToolTypes.d.ts +2 -2
- package/lib/component/utility/Events.d.ts +4 -4
- package/lib/component/utility/Events.js +2 -2
- package/lib/component/utility/GroupByInfoKey.js +1 -1
- package/lib/component/utility/getSpectraObjectPaths.js +1 -1
- package/lib/data/PredictionManager.d.ts +5 -8
- package/lib/data/PredictionManager.js +3 -3
- package/lib/data/data1d/Spectrum1D/getSpectrumErrorValue.js +1 -1
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.d.ts +2 -3
- package/lib/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.js +5 -4
- package/lib/data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges.d.ts +5 -3
- package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.d.ts +1 -35
- package/lib/data/data1d/Spectrum1D/ranges/mapRanges.d.ts +2 -35
- package/lib/data/data1d/filter1d/baselineCorrection.d.ts +7 -10
- package/lib/data/data1d/multipleSpectraAnalysis.d.ts +1 -1
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +1 -1
- package/lib/data/data2d/Spectrum2D/zones/changeZoneSignal.d.ts +5 -1
- package/lib/data/data2d/Spectrum2D/zones/changeZoneSignal.js +6 -8
- package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.d.ts +2 -0
- package/lib/data/data2d/Spectrum2D/zones/initiateZones.d.ts +2 -0
- package/lib/data/data2d/Spectrum2D/zones/mapZones.d.ts +2 -0
- package/lib/data/matrixGeneration.js +4 -2
- package/lib/data/molecules/Molecule.d.ts +3 -3
- package/lib/data/molecules/MoleculeManager.d.ts +5 -5
- package/lib/data/molecules/MoleculeManager.js +1 -1
- package/lib/data/utilities/generateColor.js +1 -1
- package/lib/data/utilities/isNumber.d.ts +1 -0
- package/lib/data/utilities/isNumber.js +3 -0
- package/lib/versionInfo.js +1 -1
- package/lib-cjs/component/1d/FooterBanner.js +1 -1
- package/lib-cjs/component/1d/Viewer1D.js +25 -20
- package/lib-cjs/component/1d/integral/IntegralResizable.js +2 -3
- package/lib-cjs/component/1d/multiAnalysis/MultiAnalysisRanges.js +1 -1
- package/lib-cjs/component/1d/multiplicityTree/MultiplicityTree.js +7 -9
- package/lib-cjs/component/1d/peaks/PeakAnnotation.js +1 -2
- package/lib-cjs/component/1d/ranges/Range.js +9 -8
- package/lib-cjs/component/1d/ranges/Ranges.js +5 -7
- package/lib-cjs/component/1d/tool/BaseLineZones.js +1 -2
- package/lib-cjs/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.js +4 -5
- package/lib-cjs/component/1d-2d/components/FloatMoleculeStructures/index.js +13 -17
- package/lib-cjs/component/2d/1d-tracer/Left1DChart.js +1 -1
- package/lib-cjs/component/2d/1d-tracer/VerticalSliceChart.js +1 -1
- package/lib-cjs/component/2d/Chart2D.js +1 -1
- package/lib-cjs/component/2d/Viewer2D.js +10 -9
- package/lib-cjs/component/2d/fid/FidCanvas.js +4 -6
- package/lib-cjs/component/2d/ft/Contours.js +1 -1
- package/lib-cjs/component/2d/utilities/scale.js +1 -1
- package/lib-cjs/component/2d/zones/Zones.js +1 -1
- package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +28 -21
- package/lib-cjs/component/NMRium.js +15 -7
- package/lib-cjs/component/context/DispatchContext.js +1 -1
- package/lib-cjs/component/context/LoggerContext.js +1 -1
- package/lib-cjs/component/elements/Button.js +7 -9
- package/lib-cjs/component/elements/IsotopesViewer.js +1 -1
- package/lib-cjs/component/elements/ReactTable/ReactTable.js +1 -2
- package/lib-cjs/component/elements/Tab/Tabs.js +1 -1
- package/lib-cjs/component/elements/formik/FormikCheckBox.js +1 -1
- package/lib-cjs/component/elements/formik/FormikColorInput.js +1 -1
- package/lib-cjs/component/elements/formik/FormikColorPicker.js +1 -1
- package/lib-cjs/component/elements/formik/FormikColumnFormatField.js +1 -1
- package/lib-cjs/component/elements/formik/FormikInput.js +1 -1
- package/lib-cjs/component/elements/formik/FormikSelect.js +2 -2
- package/lib-cjs/component/elements/formik/FormikSlider.js +1 -1
- package/lib-cjs/component/elements/formik/FormikTextarea.js +2 -2
- package/lib-cjs/component/header/ApodizationOptionsPanel.js +3 -4
- package/lib-cjs/component/header/AutoPeakPickingOptionPanel.js +1 -2
- package/lib-cjs/component/header/BaseLineCorrectionPanel.js +4 -5
- package/lib-cjs/component/header/Header.js +4 -6
- package/lib-cjs/component/header/PhaseCorrectionPanel.js +7 -8
- package/lib-cjs/component/header/RangesPickingOptionPanel.js +1 -2
- package/lib-cjs/component/header/ZeroFillingOptionsPanel.js +3 -11
- package/lib-cjs/component/header/Zones2DOptionPanel.js +5 -6
- package/lib-cjs/component/highlight/index.js +1 -1
- package/lib-cjs/component/hooks/useExport.js +1 -0
- package/lib-cjs/component/hooks/useTableSortBy.js +1 -1
- package/lib-cjs/component/hooks/useToolsFunctions.js +8 -10
- package/lib-cjs/component/hooks/useXYReduce.js +1 -1
- package/lib-cjs/component/loader/DropZone.js +4 -5
- package/lib-cjs/component/loader/NoData.js +1 -1
- package/lib-cjs/component/modal/AlignSpectraModal.js +1 -2
- package/lib-cjs/component/modal/EditPeakShapeModal.js +1 -2
- package/lib-cjs/component/modal/ImportPublicationStringModal.js +1 -2
- package/lib-cjs/component/modal/LoadJCAMPModal.js +2 -3
- package/lib-cjs/component/modal/MoleculeStructureEditorModal.js +24 -19
- package/lib-cjs/component/modal/PredictSpectraModal.js +24 -21
- package/lib-cjs/component/modal/changeSum/SelectMolecule.js +1 -1
- package/lib-cjs/component/modal/editRange/EditRangeModal.js +3 -4
- package/lib-cjs/component/modal/editRange/forms/components/AddSignalFormTab.js +2 -2
- package/lib-cjs/component/modal/editRange/forms/components/CouplingsTable.js +1 -1
- package/lib-cjs/component/modal/metaImportation/MetaImportationModal.js +2 -3
- package/lib-cjs/component/modal/setting/settings-tabs/DatabasesTabContent.js +4 -4
- package/lib-cjs/component/modal/setting/settings-tabs/FormattingTabContent.js +2 -2
- package/lib-cjs/component/modal/setting/settings-tabs/InfoBlockTabContent.js +2 -2
- package/lib-cjs/component/panels/AutomaticAssignment/AutomaticAssignmentTable.js +1 -2
- package/lib-cjs/component/panels/AutomaticAssignment/useAutoAssignments.js +7 -6
- package/lib-cjs/component/panels/InformationPanel.js +6 -6
- package/lib-cjs/component/panels/IntegralsPanel/IntegralPanel.js +11 -20
- package/lib-cjs/component/panels/IntegralsPanel/IntegralTable.js +10 -10
- package/lib-cjs/component/panels/MatrixGenerationPanel/ExclusionsZonesTable.js +1 -1
- package/lib-cjs/component/panels/MatrixGenerationPanel/FiltersOptions.js +4 -4
- package/lib-cjs/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +1 -2
- package/lib-cjs/component/panels/MoleculesPanel/MoleculeHeader.js +1 -2
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanel.js +10 -13
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +4 -5
- package/lib-cjs/component/panels/MoleculesPanel/Utilities.js +2 -2
- package/lib-cjs/component/panels/MoleculesPanel/useAtomAssignment.js +8 -9
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +3 -4
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +1 -2
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/preferences/AnalysisTablePreferences.js +2 -2
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/preferences/LegendsPreferences.js +2 -2
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/preferences/MultipleAnalysisCodeEditor.js +1 -1
- package/lib-cjs/component/panels/Panels.js +1 -1
- package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +4 -5
- package/lib-cjs/component/panels/PeaksPanel/PeaksTable.js +4 -5
- package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +12 -15
- package/lib-cjs/component/panels/RangesPanel/RangesPanel.js +24 -29
- package/lib-cjs/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +1 -1
- package/lib-cjs/component/panels/RangesPanel/TableColumns/RelativeColumn.js +3 -3
- package/lib-cjs/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.js +1 -2
- package/lib-cjs/component/panels/RangesPanel/hooks/useEditRangeModal.js +16 -14
- package/lib-cjs/component/panels/SpectrumsPanel/SpectraPanelHeader.js +16 -16
- package/lib-cjs/component/panels/SpectrumsPanel/SpectraTable.js +7 -5
- package/lib-cjs/component/panels/SpectrumsPanel/SpectrumsTabs.js +4 -5
- package/lib-cjs/component/panels/SpectrumsPanel/base/ShowHideSpectrumButton.js +3 -7
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/SpectrumSetting.js +4 -2
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/processSnapPlot.js +2 -2
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +4 -8
- package/lib-cjs/component/panels/SummaryPanel/SummaryPanel.js +39 -34
- package/lib-cjs/component/panels/SummaryPanel/utilities/Utilities.js +1 -1
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +22 -20
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumn.js +1 -1
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.js +6 -7
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.js +1 -1
- package/lib-cjs/component/panels/ZonesPanel/ZonesPanel.js +15 -18
- package/lib-cjs/component/panels/ZonesPanel/ZonesTable.js +2 -51
- package/lib-cjs/component/panels/ZonesPanel/hooks/useMapZones.js +56 -0
- package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +8 -6
- package/lib-cjs/component/panels/filtersPanel/FilterPanel.js +1 -2
- package/lib-cjs/component/panels/filtersPanel/FiltersTable.js +8 -9
- package/lib-cjs/component/panels/header/DefaultPanelHeader.js +1 -1
- package/lib-cjs/component/panels/header/SpectraAutomaticPickingButton.js +2 -3
- package/lib-cjs/component/panels/predictionPanel/PredictionPanel.js +4 -5
- package/lib-cjs/component/reducer/IgnoreActions.js +35 -55
- package/lib-cjs/component/reducer/Reducer.js +199 -221
- package/lib-cjs/component/reducer/actions/AssignmentsActions.js +3 -3
- package/lib-cjs/component/reducer/actions/CorrelationsActions.js +23 -18
- package/lib-cjs/component/reducer/actions/DatabaseActions.js +4 -1
- package/lib-cjs/component/reducer/actions/DimensionsActions.js +3 -6
- package/lib-cjs/component/reducer/actions/DomainActions.js +15 -23
- package/lib-cjs/component/reducer/actions/FiltersActions.js +267 -272
- package/lib-cjs/component/reducer/actions/GlobalActions.js +4 -4
- package/lib-cjs/component/reducer/actions/IntegralsActions.js +19 -18
- package/lib-cjs/component/reducer/actions/LoadActions.js +55 -55
- package/lib-cjs/component/reducer/actions/MoleculeActions.js +31 -22
- package/lib-cjs/component/reducer/actions/PeaksActions.js +23 -15
- package/lib-cjs/component/reducer/actions/PreferencesActions.js +7 -5
- package/lib-cjs/component/reducer/actions/RangesActions.js +81 -64
- package/lib-cjs/component/reducer/actions/SpectrumsActions.js +77 -67
- package/lib-cjs/component/reducer/actions/ToolsActions.js +54 -31
- package/lib-cjs/component/reducer/actions/ZonesActions.js +73 -52
- package/lib-cjs/component/reducer/core/Constants.js +1 -1
- package/lib-cjs/component/reducer/helper/Zoom1DManager.js +2 -2
- package/lib-cjs/component/reducer/helper/ZoomHistoryManager.js +2 -2
- package/lib-cjs/component/reducer/types/ActionType.js +2 -0
- package/lib-cjs/component/toolbar/BasicToolBar.js +6 -9
- package/lib-cjs/component/toolbar/FunctionToolBar.js +4 -9
- package/lib-cjs/component/toolbar/ToolBar.js +1 -1
- package/lib-cjs/component/utility/GroupByInfoKey.js +1 -1
- package/lib-cjs/component/utility/getSpectraObjectPaths.js +1 -1
- package/lib-cjs/data/PredictionManager.js +3 -3
- package/lib-cjs/data/SpectraManager.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/getSpectrumErrorValue.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.js +5 -4
- package/lib-cjs/data/data1d/multipleSpectraAnalysis.js +2 -2
- package/lib-cjs/data/data2d/Spectrum2D/initiateDatum2D.js +1 -1
- package/lib-cjs/data/data2d/Spectrum2D/zones/changeZoneSignal.js +6 -8
- package/lib-cjs/data/matrixGeneration.js +4 -2
- package/lib-cjs/data/molecules/MoleculeManager.js +1 -1
- package/lib-cjs/data/utilities/generateColor.js +1 -1
- package/lib-cjs/data/utilities/isNumber.js +7 -0
- package/lib-cjs/versionInfo.js +1 -1
- package/package.json +24 -23
- package/lib/component/reducer/actions/HistoryActions.d.ts +0 -4
- package/lib/component/reducer/actions/HistoryActions.js +0 -40
- package/lib/component/reducer/types/HistoryTypes.d.ts +0 -4
- package/lib/component/reducer/types/HistoryTypes.js +0 -4
- package/lib/component/reducer/types/Types.d.ts +0 -132
- package/lib/component/reducer/types/Types.js +0 -126
- package/lib/component/toolbar/HistoryToolBar.d.ts +0 -8
- package/lib/component/toolbar/HistoryToolBar.js +0 -30
- package/lib/data/utilities/isMolFileEmpty.d.ts +0 -1
- package/lib/data/utilities/isMolFileEmpty.js +0 -6
- package/lib-cjs/component/reducer/actions/HistoryActions.js +0 -45
- package/lib-cjs/component/reducer/types/HistoryTypes.js +0 -7
- package/lib-cjs/component/reducer/types/Types.js +0 -131
- package/lib-cjs/component/toolbar/HistoryToolBar.js +0 -35
- package/lib-cjs/data/utilities/isMolFileEmpty.js +0 -10
|
@@ -6,19 +6,22 @@ import * as FiltersManager from '../../../data/FiltersManager';
|
|
|
6
6
|
import { DatumKind, SignalKindsToInclude, } from '../../../data/constants/SignalsKinds';
|
|
7
7
|
import { changeZoneSignal, detectZones, detectZonesManual, } from '../../../data/data2d/Spectrum2D';
|
|
8
8
|
import { unlink, unlinkInAssignmentData, } from '../../../data/utilities/ZoneUtilities';
|
|
9
|
+
import { isNumber } from '../../../data/utilities/isNumber';
|
|
9
10
|
import { zoneStateInit } from '../Reducer';
|
|
10
11
|
import get2DRange from '../helper/get2DRange';
|
|
11
12
|
import { getActiveSpectrum } from '../helper/getActiveSpectrum';
|
|
12
13
|
import { handleUpdateCorrelations } from './CorrelationsActions';
|
|
13
14
|
import { setDomain } from './DomainActions';
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
//action
|
|
16
|
+
function handleChangeZonesFactor(draft, action) {
|
|
17
|
+
draft.toolOptions.data.zonesNoiseFactor = action.payload.zonesNoiseFactor;
|
|
16
18
|
}
|
|
17
|
-
|
|
19
|
+
//action
|
|
20
|
+
function handleAdd2dZone(draft, action) {
|
|
18
21
|
const activeSpectrum = getActiveSpectrum(draft);
|
|
19
22
|
if (activeSpectrum?.id) {
|
|
20
23
|
const { index } = activeSpectrum;
|
|
21
|
-
const drawnZone = get2DRange(draft, action);
|
|
24
|
+
const drawnZone = get2DRange(draft, action.payload);
|
|
22
25
|
const datum = draft.data[index];
|
|
23
26
|
const zones = detectZonesManual(original(datum), {
|
|
24
27
|
selectedZone: drawnZone,
|
|
@@ -26,14 +29,15 @@ function add2dZoneHandler(draft, action) {
|
|
|
26
29
|
convolutionByFFT: false,
|
|
27
30
|
});
|
|
28
31
|
datum.zones.values = datum.zones.values.concat(zones);
|
|
29
|
-
|
|
32
|
+
handleUpdateCorrelations(draft);
|
|
30
33
|
}
|
|
31
34
|
}
|
|
35
|
+
//action
|
|
32
36
|
function handleAutoZonesDetection(draft, action) {
|
|
33
37
|
const activeSpectrum = getActiveSpectrum(draft);
|
|
34
38
|
if (activeSpectrum?.id) {
|
|
35
39
|
const { index } = activeSpectrum;
|
|
36
|
-
const { thresholdFactor } = action.payload;
|
|
40
|
+
const { zonesNoiseFactor: thresholdFactor } = action.payload;
|
|
37
41
|
const [fromX, toX] = draft.xDomain;
|
|
38
42
|
const [fromY, toY] = draft.yDomain;
|
|
39
43
|
const detectionOptions = {
|
|
@@ -43,9 +47,10 @@ function handleAutoZonesDetection(draft, action) {
|
|
|
43
47
|
const datum = draft.data[index];
|
|
44
48
|
const zones = detectZones(original(datum), detectionOptions);
|
|
45
49
|
datum.zones.values = datum.zones.values.concat(zones);
|
|
46
|
-
|
|
50
|
+
handleUpdateCorrelations(draft);
|
|
47
51
|
}
|
|
48
52
|
}
|
|
53
|
+
//action
|
|
49
54
|
function handleAutoSpectraZonesDetection(draft) {
|
|
50
55
|
for (const datum of draft.data) {
|
|
51
56
|
const { info, data } = datum;
|
|
@@ -59,16 +64,17 @@ function handleAutoSpectraZonesDetection(draft) {
|
|
|
59
64
|
};
|
|
60
65
|
const zones = detectZones(original(datum), detectionOptions);
|
|
61
66
|
datum.zones.values = datum.zones.values.concat(zones);
|
|
62
|
-
|
|
67
|
+
handleUpdateCorrelations(draft);
|
|
63
68
|
}
|
|
64
69
|
}
|
|
65
70
|
}
|
|
66
|
-
|
|
67
|
-
|
|
71
|
+
//action
|
|
72
|
+
function handleChangeZoneSignalDelta(draft, action) {
|
|
73
|
+
const { zoneId, signal } = action.payload;
|
|
68
74
|
const activeSpectrum = getActiveSpectrum(draft);
|
|
69
75
|
if (activeSpectrum?.id) {
|
|
70
76
|
const { index } = activeSpectrum;
|
|
71
|
-
const { xShift, yShift } = changeZoneSignal(draft.data[index],
|
|
77
|
+
const { xShift, yShift } = changeZoneSignal(draft.data[index], zoneId, signal);
|
|
72
78
|
let filters = [];
|
|
73
79
|
if (xShift !== 0) {
|
|
74
80
|
filters.push({ name: Filters.shift2DX.id, value: { shift: xShift } });
|
|
@@ -78,27 +84,29 @@ function changeZoneSignalDelta(draft, action) {
|
|
|
78
84
|
}
|
|
79
85
|
FiltersManager.applyFilter(draft.data[index], filters);
|
|
80
86
|
setDomain(draft);
|
|
81
|
-
|
|
87
|
+
handleUpdateCorrelations(draft);
|
|
82
88
|
}
|
|
83
89
|
}
|
|
84
|
-
function getZoneIndex(state, spectrumIndex,
|
|
85
|
-
return state.data[spectrumIndex].zones.values.findIndex((zone) => zone.id ===
|
|
90
|
+
function getZoneIndex(state, spectrumIndex, zoneId) {
|
|
91
|
+
return state.data[spectrumIndex].zones.values.findIndex((zone) => zone.id === zoneId);
|
|
86
92
|
}
|
|
93
|
+
//action
|
|
87
94
|
function handleChangeZoneSignalKind(draft, action) {
|
|
88
95
|
const state = original(draft);
|
|
89
96
|
const activeSpectrum = getActiveSpectrum(state);
|
|
90
97
|
if (activeSpectrum?.id) {
|
|
91
98
|
const { index } = activeSpectrum;
|
|
92
|
-
const {
|
|
93
|
-
const zoneIndex = getZoneIndex(state, index,
|
|
99
|
+
const { zoneData, kind } = action.payload;
|
|
100
|
+
const zoneIndex = getZoneIndex(state, index, zoneData.id);
|
|
94
101
|
const _zone = draft.data[index].zones.values[zoneIndex];
|
|
95
|
-
_zone.signals[
|
|
96
|
-
_zone.kind = SignalKindsToInclude.includes(
|
|
102
|
+
_zone.signals[zoneData.tableMetaInfo.signalIndex].kind = kind;
|
|
103
|
+
_zone.kind = SignalKindsToInclude.includes(kind)
|
|
97
104
|
? DatumKind.signal
|
|
98
105
|
: DatumKind.mixed;
|
|
99
|
-
|
|
106
|
+
handleUpdateCorrelations(draft);
|
|
100
107
|
}
|
|
101
108
|
}
|
|
109
|
+
//action
|
|
102
110
|
function handleDeleteZone(draft, action) {
|
|
103
111
|
const state = original(draft);
|
|
104
112
|
const activeSpectrum = getActiveSpectrum(state);
|
|
@@ -115,20 +123,18 @@ function handleDeleteZone(draft, action) {
|
|
|
115
123
|
unlinkInAssignmentData(assignmentData, draft.data[index].zones.values);
|
|
116
124
|
draft.data[index].zones.values = [];
|
|
117
125
|
}
|
|
118
|
-
|
|
126
|
+
handleUpdateCorrelations(draft);
|
|
119
127
|
}
|
|
120
128
|
}
|
|
121
|
-
function
|
|
122
|
-
const { spectrum, zone, signal, assignmentData
|
|
129
|
+
function deleteSignal2D(draft, options) {
|
|
130
|
+
const { spectrum, zone, signal, assignmentData } = options;
|
|
123
131
|
if (spectrum && zone) {
|
|
124
132
|
const datum2D = draft.data.find((datum) => datum.id === spectrum.id);
|
|
125
133
|
const zoneIndex = datum2D.zones.values.findIndex((_zone) => _zone.id === zone.id);
|
|
126
134
|
const signalIndex = zone.signals.findIndex((_signal) => _signal.id === signal.id);
|
|
127
135
|
// remove assignments for the signal in zone object and global state
|
|
128
136
|
const _zone = unlink(lodashCloneDeep(zone), false, signalIndex, undefined);
|
|
129
|
-
|
|
130
|
-
unlinkInAssignmentData(assignmentData, [{ signals: [signal] }], undefined);
|
|
131
|
-
}
|
|
137
|
+
unlinkInAssignmentData(assignmentData, [{ signals: [signal] }], undefined);
|
|
132
138
|
_zone.signals.splice(signalIndex, 1);
|
|
133
139
|
datum2D.zones.values[zoneIndex] = _zone;
|
|
134
140
|
// if no signals are existing in a zone anymore then delete this zone
|
|
@@ -136,12 +142,17 @@ function handleDeleteSignal(draft, action) {
|
|
|
136
142
|
unlinkInAssignmentData(assignmentData, [_zone]);
|
|
137
143
|
datum2D.zones.values.splice(zoneIndex, 1);
|
|
138
144
|
}
|
|
139
|
-
|
|
145
|
+
handleUpdateCorrelations(draft);
|
|
140
146
|
}
|
|
141
147
|
}
|
|
148
|
+
//action
|
|
149
|
+
function handleDeleteSignal(draft, action) {
|
|
150
|
+
deleteSignal2D(draft, action.payload);
|
|
151
|
+
}
|
|
152
|
+
//action
|
|
142
153
|
function handleSetSignalPathLength(draft, action) {
|
|
143
154
|
const { spectrum, zone, signal, pathLength } = action.payload;
|
|
144
|
-
if (spectrum && zone) {
|
|
155
|
+
if (spectrum && zone && signal) {
|
|
145
156
|
const datum2D = draft.data.find((datum) => datum.id === spectrum.id);
|
|
146
157
|
const zoneIndex = datum2D.zones.values.findIndex((_zone) => _zone.id === zone.id);
|
|
147
158
|
const signalIndex = zone.signals.findIndex((_signal) => _signal.id === signal.id);
|
|
@@ -151,15 +162,16 @@ function handleSetSignalPathLength(draft, action) {
|
|
|
151
162
|
pathLength,
|
|
152
163
|
};
|
|
153
164
|
datum2D.zones.values[zoneIndex] = _zone;
|
|
154
|
-
|
|
165
|
+
handleUpdateCorrelations(draft);
|
|
155
166
|
}
|
|
156
167
|
}
|
|
157
|
-
|
|
168
|
+
//action
|
|
169
|
+
function unlinkZone(draft, props) {
|
|
158
170
|
const state = original(draft);
|
|
159
171
|
const activeSpectrum = getActiveSpectrum(state);
|
|
160
172
|
if (activeSpectrum?.id) {
|
|
161
173
|
const { index } = activeSpectrum;
|
|
162
|
-
const { zoneData
|
|
174
|
+
const { zone: zoneData, assignmentData, isOnZoneLevel, signalIndex = -1, axis, } = props;
|
|
163
175
|
if (zoneData) {
|
|
164
176
|
// remove assignments in global state
|
|
165
177
|
const zoneIndex = getZoneIndex(state, index, zoneData.id);
|
|
@@ -177,42 +189,50 @@ function handleUnlinkZone(draft, action) {
|
|
|
177
189
|
}
|
|
178
190
|
}
|
|
179
191
|
}
|
|
192
|
+
//action
|
|
193
|
+
function handleUnlinkZone(draft, action) {
|
|
194
|
+
unlinkZone(draft, action.payload);
|
|
195
|
+
}
|
|
196
|
+
//action
|
|
180
197
|
function handleSetDiaIDZone(draft, action) {
|
|
181
198
|
const state = original(draft);
|
|
182
199
|
const activeSpectrum = getActiveSpectrum(state);
|
|
183
|
-
|
|
200
|
+
const { zone: zoneData, diaIDs, axis, signalIndex, nbAtoms } = action.payload;
|
|
201
|
+
if (activeSpectrum?.id && axis) {
|
|
184
202
|
const { index } = activeSpectrum;
|
|
185
|
-
const { zoneData, diaIDs, axis, signalIndex, nbAtoms } = action.payload;
|
|
186
203
|
const getNbAtoms = (input, current = 0) => input + current;
|
|
187
204
|
const zoneIndex = getZoneIndex(state, index, zoneData.id);
|
|
188
|
-
const
|
|
189
|
-
if (signalIndex
|
|
190
|
-
|
|
191
|
-
|
|
205
|
+
const zone = draft.data[index].zones.values[zoneIndex];
|
|
206
|
+
if (!isNumber(signalIndex)) {
|
|
207
|
+
const zoneByAxis = zone[axis];
|
|
208
|
+
zoneByAxis.diaIDs = diaIDs;
|
|
209
|
+
zoneByAxis.nbAtoms = getNbAtoms(nbAtoms, zoneByAxis.nbAtoms);
|
|
192
210
|
}
|
|
193
211
|
else {
|
|
194
|
-
|
|
195
|
-
|
|
212
|
+
const signalByAxis = zone.signals[signalIndex][axis];
|
|
213
|
+
signalByAxis.diaIDs = diaIDs;
|
|
214
|
+
signalByAxis.nbAtoms = getNbAtoms(nbAtoms, signalByAxis.nbAtoms);
|
|
196
215
|
}
|
|
197
216
|
}
|
|
198
217
|
}
|
|
218
|
+
//action
|
|
199
219
|
function handleSaveEditedZone(draft, action) {
|
|
200
220
|
const state = original(draft);
|
|
201
221
|
const activeSpectrum = getActiveSpectrum(state);
|
|
202
222
|
if (activeSpectrum?.id) {
|
|
203
223
|
const { index } = activeSpectrum;
|
|
204
|
-
const {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
for (const signal of editedRowData.signals) {
|
|
224
|
+
const { zone: { tableMetaInfo, ...editedZone }, } = action.payload;
|
|
225
|
+
const zoneIndex = getZoneIndex(state, index, editedZone.id);
|
|
226
|
+
draft.data[index].zones.values[zoneIndex] = editedZone;
|
|
227
|
+
if (editedZone.signals) {
|
|
228
|
+
for (const signal of editedZone.signals) {
|
|
210
229
|
setPathLength(draft.correlations.values, signal.id, signal.j?.pathLength);
|
|
211
230
|
}
|
|
212
231
|
}
|
|
213
|
-
|
|
232
|
+
handleUpdateCorrelations(draft);
|
|
214
233
|
}
|
|
215
234
|
}
|
|
235
|
+
//action
|
|
216
236
|
function handleShowZones(draft, action) {
|
|
217
237
|
const { id } = action.payload;
|
|
218
238
|
const zone = draft.view.zones.find((r) => r.spectrumID === id);
|
|
@@ -227,6 +247,7 @@ function handleShowZones(draft, action) {
|
|
|
227
247
|
});
|
|
228
248
|
}
|
|
229
249
|
}
|
|
250
|
+
//action
|
|
230
251
|
function handleShowSignals(draft, action) {
|
|
231
252
|
const { id } = action.payload;
|
|
232
253
|
const zone = draft.view.zones.find((r) => r.spectrumID === id);
|
|
@@ -241,6 +262,7 @@ function handleShowSignals(draft, action) {
|
|
|
241
262
|
});
|
|
242
263
|
}
|
|
243
264
|
}
|
|
265
|
+
//action
|
|
244
266
|
function handleShowPeaks(draft, action) {
|
|
245
267
|
const { id } = action.payload;
|
|
246
268
|
const zone = draft.view.zones.find((r) => r.spectrumID === id);
|
|
@@ -255,7 +277,4 @@ function handleShowPeaks(draft, action) {
|
|
|
255
277
|
});
|
|
256
278
|
}
|
|
257
279
|
}
|
|
258
|
-
|
|
259
|
-
handleUpdateCorrelations(draft);
|
|
260
|
-
}
|
|
261
|
-
export { add2dZoneHandler, handleAutoZonesDetection, handleDeleteSignal, handleDeleteZone, changeZoneSignalDelta, handleChangeZoneSignalKind, handleUnlinkZone, handleSaveEditedZone, handleSetDiaIDZone, handleSetSignalPathLength, changeZonesFactorHandler, handleAutoSpectraZonesDetection, handleShowZones, handleShowSignals, handleShowPeaks, };
|
|
280
|
+
export { handleAdd2dZone, handleAutoZonesDetection, handleDeleteSignal, deleteSignal2D, handleDeleteZone, handleChangeZoneSignalDelta, handleChangeZoneSignalKind, handleUnlinkZone, unlinkZone, handleSaveEditedZone, handleSetDiaIDZone, handleSetSignalPathLength, handleChangeZonesFactor, handleAutoSpectraZonesDetection, handleShowZones, handleShowSignals, handleShowPeaks, };
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { Draft } from 'immer';
|
|
2
2
|
import { State } from '../Reducer';
|
|
3
|
-
export declare const
|
|
4
|
-
HORIZONTAL:
|
|
5
|
-
VERTICAL:
|
|
6
|
-
STEP_HORIZONTAL:
|
|
7
|
-
FULL:
|
|
3
|
+
export declare const ZOOM_TYPES: {
|
|
4
|
+
readonly HORIZONTAL: "HORIZONTAL";
|
|
5
|
+
readonly VERTICAL: "VERTICAL";
|
|
6
|
+
readonly STEP_HORIZONTAL: "STEP_HORIZONTAL";
|
|
7
|
+
readonly FULL: "FULL";
|
|
8
8
|
};
|
|
9
|
+
export type ZoomType = keyof typeof ZOOM_TYPES;
|
|
9
10
|
interface ZoomOptions {
|
|
10
11
|
factor?: number;
|
|
11
12
|
invert?: boolean;
|
|
@@ -19,13 +19,13 @@ function preparePop(historyStack, baseZoom) {
|
|
|
19
19
|
if (val && historyStack.length === 0) {
|
|
20
20
|
return baseZoom || null;
|
|
21
21
|
}
|
|
22
|
-
return val ? historyStack
|
|
22
|
+
return val ? historyStack.at(-1) : null;
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
25
|
function prepareGetLast(historyStack) {
|
|
26
26
|
return () => {
|
|
27
27
|
if (historyStack.length === 0)
|
|
28
28
|
return null;
|
|
29
|
-
return historyStack
|
|
29
|
+
return historyStack.at(-1);
|
|
30
30
|
};
|
|
31
31
|
}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
export
|
|
1
|
+
export interface ZoneBoundary {
|
|
2
|
+
startX: number;
|
|
3
|
+
startY: number;
|
|
4
|
+
endX: number;
|
|
5
|
+
endY: number;
|
|
6
|
+
}
|
|
7
|
+
export default function get2DRange(draft: any, options: ZoneBoundary): {
|
|
2
8
|
fromX: number;
|
|
3
9
|
fromY: number;
|
|
4
10
|
toX: number;
|
|
@@ -3,7 +3,7 @@ import { SplitPaneSize } from 'react-science/ui';
|
|
|
3
3
|
import { MatrixOptions } from '../../../data/types/data1d/MatrixOptions';
|
|
4
4
|
import { NMRiumWorkspace, NMRiumPreferences } from '../../NMRium';
|
|
5
5
|
import { MultipleSpectraAnalysisPreferences, Workspace, WorkSpaceSource } from '../../workspaces/Workspace';
|
|
6
|
-
import { ActionType } from '../types/
|
|
6
|
+
import { ActionType } from '../types/ActionType';
|
|
7
7
|
export declare const WORKSPACES_KEYS: {
|
|
8
8
|
componentKey: string;
|
|
9
9
|
nmriumKey: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -17,7 +17,6 @@ import { useVerticalAlign } from '../hooks/useVerticalAlign';
|
|
|
17
17
|
import ImportPublicationStringModal from '../modal/ImportPublicationStringModal';
|
|
18
18
|
import LoadJCAMPModal from '../modal/LoadJCAMPModal';
|
|
19
19
|
import { useMetaInformationImportationModal } from '../modal/metaImportation/index';
|
|
20
|
-
import { SET_LOADING_FLAG } from '../reducer/types/Types';
|
|
21
20
|
const IMPORT_MENU = [
|
|
22
21
|
{
|
|
23
22
|
id: 'importFile',
|
|
@@ -89,7 +88,7 @@ function BasicToolBarInner({ verticalAlign, ftCounter, fidCounter, }) {
|
|
|
89
88
|
const { saveAsSVGHandler, saveAsPNGHandler, saveAsJSONHandler, saveToClipboardHandler, saveAsHandler, } = useExport();
|
|
90
89
|
const startLoadingHandler = useCallback(() => {
|
|
91
90
|
modal.close();
|
|
92
|
-
dispatch({ type: SET_LOADING_FLAG, isLoading: true });
|
|
91
|
+
dispatch({ type: 'SET_LOADING_FLAG', payload: { isLoading: true } });
|
|
93
92
|
}, [dispatch, modal]);
|
|
94
93
|
const importJCAMPFile = useCallback(() => {
|
|
95
94
|
modal.show(_jsx(LoadJCAMPModal, { onClose: () => modal.close(), startLoading: startLoadingHandler }), {});
|
|
@@ -162,11 +161,9 @@ export default function BasicToolBar() {
|
|
|
162
161
|
const { displayerMode, view: { spectra: { activeTab }, }, } = useChartData();
|
|
163
162
|
const verticalAlign = useVerticalAlign();
|
|
164
163
|
const { fidCounter, ftCounter } = useDatumWithSpectraStatistics();
|
|
165
|
-
return (_jsx(MemoizedBasicToolBar, {
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
activeTab,
|
|
171
|
-
} }));
|
|
164
|
+
return (_jsx(MemoizedBasicToolBar, { fidCounter,
|
|
165
|
+
ftCounter,
|
|
166
|
+
verticalAlign,
|
|
167
|
+
displayerMode,
|
|
168
|
+
activeTab }));
|
|
172
169
|
}
|
|
@@ -10,7 +10,6 @@ import ToggleButtonGroup from '../elements/toggle/ToggleButtonGroup';
|
|
|
10
10
|
import { useCheckToolsVisibility } from '../hooks/useCheckToolsVisibility';
|
|
11
11
|
import useDatumWithSpectraStatistics from '../hooks/useDatumWithSpectraStatistics';
|
|
12
12
|
import useToolsFunctions from '../hooks/useToolsFunctions';
|
|
13
|
-
import { APPLY_FFT_FILTER, SET_SELECTED_FILTER } from '../reducer/types/Types';
|
|
14
13
|
import { options } from './ToolTypes';
|
|
15
14
|
function FunctionToolBarInner({ defaultValue, ftCounter, }) {
|
|
16
15
|
const [option, setOption] = useState('');
|
|
@@ -26,10 +25,8 @@ function FunctionToolBarInner({ defaultValue, ftCounter, }) {
|
|
|
26
25
|
}, [defaultValue]);
|
|
27
26
|
const handleOnFFTFilter = useCallback(() => {
|
|
28
27
|
dispatch({
|
|
29
|
-
type: APPLY_FFT_FILTER,
|
|
30
|
-
value: '',
|
|
28
|
+
type: 'APPLY_FFT_FILTER',
|
|
31
29
|
});
|
|
32
|
-
dispatch({ type: SET_SELECTED_FILTER, selectedFilter: null });
|
|
33
30
|
}, [dispatch]);
|
|
34
31
|
return (_jsxs(_Fragment, { children: [_jsxs(ToggleButtonGroup, { value: option, onChange: handleChange, children: [isButtonVisible('zoom') && (_jsx(ToggleButton, { value: options.zoom.id, id: options.zoom.id, title: `${options.zoom.label} ( Press z )`, children: _jsx(FaSearchPlus, {}) }, options.zoom.id)), isButtonVisible('zoomOut') && (_jsx(Toolbar.Item, { id: "zoom-out", onClick: handleFullZoomOut, title: "Horizontal zoom out ( Press f ), Horizontal and Vertical zoom out, double click ( Press ff )", children: _jsx(FaExpand, {}) })), isButtonVisible('peakPicking') && (_jsx(ToggleButton, { value: options.peakPicking.id, title: `${options.peakPicking.label} ( Press p )`, id: options.peakPicking.id, children: _jsx(SvgNmrPeakPicking, {}) }, options.peakPicking.id)), isButtonVisible('integral') && (_jsx(ToggleButton, { value: options.integral.id, id: options.integral.id, title: `${options.integral.label} ( Press i )`, children: _jsx(SvgNmrIntegrate, {}) }, options.integral.id)), isButtonVisible('zonePicking') && (_jsx(ToggleButton, { value: options.zonePicking.id, id: options.zonePicking.id, title: `${options.zonePicking.label} ( Press r )`, children: _jsx(FaDiceFour, {}) }, options.zonePicking.id)), isButtonVisible('slicing') && (_jsx(ToggleButton, { value: options.slicing.id, id: options.slicing.id, title: `${options.slicing.label}`, children: _jsx("p", { children: "Slic" }) }, options.slicing.id)), isButtonVisible('rangePicking') && (_jsx(ToggleButton, { value: options.rangePicking.id, title: `${options.rangePicking.label} ( Press r )`, id: options.rangePicking.id, children: _jsx(SvgNmrRangePicking, {}) }, options.rangePicking.id)), isButtonVisible('multipleSpectraAnalysis', {
|
|
35
32
|
checkSpectrumType: false,
|
|
@@ -41,9 +38,7 @@ const MemoizedFunctionToolBar = memo(FunctionToolBarInner);
|
|
|
41
38
|
export default function FunctionToolBar({ defaultValue = options.zoom.id, }) {
|
|
42
39
|
const { displayerMode } = useChartData();
|
|
43
40
|
const data = useDatumWithSpectraStatistics();
|
|
44
|
-
return (_jsx(MemoizedFunctionToolBar, { ...
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
defaultValue,
|
|
48
|
-
} }));
|
|
41
|
+
return (_jsx(MemoizedFunctionToolBar, { ...data,
|
|
42
|
+
displayerMode,
|
|
43
|
+
defaultValue }));
|
|
49
44
|
}
|
|
@@ -10,5 +10,5 @@ function ToolBarInner({ selectedTool }) {
|
|
|
10
10
|
const MemoizedToolBar = memo(ToolBarInner);
|
|
11
11
|
export default function ToolBar() {
|
|
12
12
|
const { toolOptions: { selectedTool }, } = useChartData();
|
|
13
|
-
return _jsx(MemoizedToolBar, {
|
|
13
|
+
return _jsx(MemoizedToolBar, { selectedTool });
|
|
14
14
|
}
|
|
@@ -19,7 +19,7 @@ export interface ToolOptionItem {
|
|
|
19
19
|
hasOptionPanel: boolean;
|
|
20
20
|
isFilter: boolean;
|
|
21
21
|
}
|
|
22
|
-
type
|
|
23
|
-
type RecordOptions = Record<
|
|
22
|
+
export type Tool = keyof NMRiumToolBarPreferences | 'HMove' | 'equalizer' | 'generalSelector' | 'editRange' | 'databaseRangesSelection' | 'matrixGenerationExclusionZones';
|
|
23
|
+
type RecordOptions = Record<Tool, ToolOptionItem>;
|
|
24
24
|
export declare const options: RecordOptions;
|
|
25
25
|
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import EE from 'eventemitter3';
|
|
2
2
|
declare const Emitter: {
|
|
3
|
-
on: (event: any, fn: any) =>
|
|
4
|
-
once: (event: any, fn: any) =>
|
|
5
|
-
off: (event: any, fn: any) =>
|
|
3
|
+
on: (event: any, fn: any) => EE<string | symbol, any>;
|
|
4
|
+
once: (event: any, fn: any) => EE<string | symbol, any>;
|
|
5
|
+
off: (event: any, fn: any) => EE<string | symbol, any>;
|
|
6
6
|
emit: (event: any, payload: any) => boolean;
|
|
7
7
|
};
|
|
8
8
|
export default Emitter;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
const eventEmitter = new
|
|
1
|
+
import EE from 'eventemitter3';
|
|
2
|
+
const eventEmitter = new EE();
|
|
3
3
|
const Emitter = {
|
|
4
4
|
on: (event, fn) => eventEmitter.on(event, fn),
|
|
5
5
|
once: (event, fn) => eventEmitter.once(event, fn),
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { Spectrum } from 'nmr-load-save';
|
|
2
|
+
export type Experiment = 'proton' | 'carbon' | 'cosy' | 'hsqc' | 'hmbc';
|
|
3
|
+
export type SpectraPredictionOptions = Record<Experiment, boolean>;
|
|
4
|
+
export type PredictedSpectraResult = Partial<Record<Experiment, Spectrum>>;
|
|
2
5
|
export interface PredictionOptions {
|
|
3
6
|
name: string;
|
|
4
7
|
frequency: number;
|
|
@@ -20,13 +23,7 @@ export interface PredictionOptions {
|
|
|
20
23
|
y: number;
|
|
21
24
|
};
|
|
22
25
|
};
|
|
23
|
-
spectra:
|
|
24
|
-
proton: boolean;
|
|
25
|
-
carbon: boolean;
|
|
26
|
-
cosy: boolean;
|
|
27
|
-
hsqc: boolean;
|
|
28
|
-
hmbc: boolean;
|
|
29
|
-
};
|
|
26
|
+
spectra: SpectraPredictionOptions;
|
|
30
27
|
}
|
|
31
28
|
export declare const defaultPredictionOptions: PredictionOptions;
|
|
32
29
|
export declare const FREQUENCIES: Array<{
|
|
@@ -34,4 +31,4 @@ export declare const FREQUENCIES: Array<{
|
|
|
34
31
|
label: string;
|
|
35
32
|
}>;
|
|
36
33
|
export declare function predictSpectra(molfile: string): Promise<any>;
|
|
37
|
-
export declare function generateSpectra(
|
|
34
|
+
export declare function generateSpectra(predictedSpectra: PredictedSpectraResult, inputOptions: PredictionOptions, color: string): Spectrum[];
|
|
@@ -48,11 +48,11 @@ export async function predictSpectra(molfile) {
|
|
|
48
48
|
},
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
|
-
export function generateSpectra(
|
|
51
|
+
export function generateSpectra(predictedSpectra, inputOptions, color) {
|
|
52
52
|
const spectra = [];
|
|
53
|
-
for (const experiment in
|
|
53
|
+
for (const experiment in predictedSpectra) {
|
|
54
54
|
if (inputOptions.spectra[experiment]) {
|
|
55
|
-
const spectrum =
|
|
55
|
+
const spectrum = predictedSpectra[experiment];
|
|
56
56
|
switch (experiment) {
|
|
57
57
|
case 'proton':
|
|
58
58
|
case 'carbon': {
|
|
@@ -25,7 +25,7 @@ export function initiateDatum1D(spectrum, options = {}) {
|
|
|
25
25
|
};
|
|
26
26
|
spectrumObj.originalInfo = spectrumObj.info;
|
|
27
27
|
spectrumObj.meta = { ...spectrum.meta };
|
|
28
|
-
spectrumObj.
|
|
28
|
+
spectrumObj.customInfo = { ...spectrum.customInfo };
|
|
29
29
|
spectrumObj.data = convertDataToFloat64Array(spectrum.data);
|
|
30
30
|
spectrumObj.originalData = spectrumObj.data;
|
|
31
31
|
spectrumObj.filters = Object.assign([], spectrum.filters); //array of object {name: "FilterName", options: FilterOptions = {value | object} }
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Spectrum1D } from 'nmr-load-save';
|
|
2
|
-
interface
|
|
2
|
+
export interface ChangeRangeRelativeValueProps {
|
|
3
3
|
id: string;
|
|
4
4
|
value: number;
|
|
5
5
|
}
|
|
@@ -8,5 +8,4 @@ interface RangeProps {
|
|
|
8
8
|
* @param {Spectrum1D} spectrum spectrum 1d
|
|
9
9
|
* @param {RangeProps} newRange
|
|
10
10
|
*/
|
|
11
|
-
export declare function changeRangeRelativeValue(spectrum: Spectrum1D,
|
|
12
|
-
export {};
|
|
11
|
+
export declare function changeRangeRelativeValue(spectrum: Spectrum1D, data: ChangeRangeRelativeValueProps): void;
|
|
@@ -3,12 +3,13 @@
|
|
|
3
3
|
* @param {Spectrum1D} spectrum spectrum 1d
|
|
4
4
|
* @param {RangeProps} newRange
|
|
5
5
|
*/
|
|
6
|
-
export function changeRangeRelativeValue(spectrum,
|
|
7
|
-
const
|
|
6
|
+
export function changeRangeRelativeValue(spectrum, data) {
|
|
7
|
+
const { id, value } = data;
|
|
8
|
+
const index = spectrum.ranges.values.findIndex((range) => range.id === id);
|
|
8
9
|
if (index !== -1 && spectrum.ranges.options.sum) {
|
|
9
10
|
const { absolute, integration } = spectrum.ranges.values[index];
|
|
10
|
-
const ratio = absolute /
|
|
11
|
-
const sum = (
|
|
11
|
+
const ratio = absolute / value;
|
|
12
|
+
const sum = (value / integration) * spectrum.ranges.options.sum;
|
|
12
13
|
spectrum.ranges.options = {
|
|
13
14
|
...spectrum.ranges.options,
|
|
14
15
|
mf: undefined,
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Spectrum1D } from 'nmr-load-save';
|
|
2
|
+
import { NMRRange } from 'nmr-processing';
|
|
2
3
|
import { UsedColors } from '../../../../types/UsedColors';
|
|
3
|
-
export
|
|
4
|
+
export interface ResurrectSpectrumInfo {
|
|
4
5
|
nucleus: string;
|
|
5
6
|
solvent: string;
|
|
6
7
|
name?: string;
|
|
7
8
|
frequency?: number;
|
|
8
9
|
color?: string;
|
|
9
|
-
}
|
|
10
|
+
}
|
|
11
|
+
export declare function generateSpectrumFromRanges(ranges: NMRRange[], info: ResurrectSpectrumInfo, usedColors: UsedColors): Spectrum1D;
|
|
@@ -9,39 +9,5 @@ export declare function initiateRanges(options: Partial<{
|
|
|
9
9
|
sumAuto: boolean;
|
|
10
10
|
};
|
|
11
11
|
} & Ranges & {
|
|
12
|
-
values:
|
|
13
|
-
absolute: number;
|
|
14
|
-
signals: {
|
|
15
|
-
originDelta: number | undefined;
|
|
16
|
-
delta: number;
|
|
17
|
-
multiplicity: string;
|
|
18
|
-
js: import("nmr-processing").Jcoupling[];
|
|
19
|
-
integration?: number | undefined;
|
|
20
|
-
diaIDs?: string[] | undefined;
|
|
21
|
-
nbAtoms?: number | undefined;
|
|
22
|
-
atoms?: number[] | undefined;
|
|
23
|
-
assignment?: string | undefined;
|
|
24
|
-
peaks?: import("nmr-processing").NMRPeak1D[] | undefined;
|
|
25
|
-
statistic?: {
|
|
26
|
-
mean: number;
|
|
27
|
-
sd: number;
|
|
28
|
-
min: number;
|
|
29
|
-
max: number;
|
|
30
|
-
nb: number;
|
|
31
|
-
} | undefined;
|
|
32
|
-
kind: string;
|
|
33
|
-
id: string;
|
|
34
|
-
}[];
|
|
35
|
-
originFrom: number | undefined;
|
|
36
|
-
originTo: number | undefined;
|
|
37
|
-
from: number;
|
|
38
|
-
to: number;
|
|
39
|
-
id: string;
|
|
40
|
-
kind: string;
|
|
41
|
-
integration: number;
|
|
42
|
-
nbAtoms?: number | undefined;
|
|
43
|
-
diaIDs?: string[] | undefined;
|
|
44
|
-
pubIntegral?: number | undefined;
|
|
45
|
-
multiplicity?: string | undefined;
|
|
46
|
-
}[];
|
|
12
|
+
values: any[];
|
|
47
13
|
};
|