nmrium 0.31.0 → 0.33.0-pre.1667632695
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/Chart1D.js +1 -1
- package/lib/component/1d/FooterBanner.js +17 -10
- package/lib/component/1d/LinesSeries.js +1 -1
- package/lib/component/1d/SpectraTracker.js +1 -1
- package/lib/component/1d/Viewer1D.js +1 -1
- package/lib/component/1d/XAxis.js +1 -1
- package/lib/component/1d/database/DatabaseSpectrum.js +2 -1
- package/lib/component/1d/database/ResurrectedDatabaseRanges.js +2 -2
- package/lib/component/1d/{Integral.d.ts → integral/Integral.d.ts} +0 -0
- package/lib/component/1d/{Integral.js → integral/Integral.js} +2 -2
- package/lib/component/1d/integral/IntegralIndicator.d.ts +9 -0
- package/lib/component/1d/integral/IntegralIndicator.js +27 -0
- package/lib/component/1d/{IntegralResizable.d.ts → integral/IntegralResizable.d.ts} +0 -0
- package/lib/component/1d/integral/IntegralResizable.js +69 -0
- package/lib/component/1d/{IntegralsSeries.d.ts → integral/IntegralsSeries.d.ts} +0 -0
- package/lib/component/1d/{IntegralsSeries.js → integral/IntegralsSeries.js} +4 -4
- package/lib/component/1d/multiAnalysis/MultiAnalysisRanges.js +1 -1
- package/lib/component/1d/multiplicityTree/MultiplicityTree.js +4 -4
- package/lib/component/1d/multiplicityTree/buildTreeNode.js +3 -3
- package/lib/component/1d/peaks/PeakAnnotation.js +1 -1
- package/lib/component/1d/peaks/usePeakShapesPath.js +10 -6
- package/lib/component/1d/ranges/Range.js +27 -50
- package/lib/component/1d/tool/PeakPointer.js +1 -1
- package/lib/component/1d/utilities/scale.js +2 -2
- package/lib/component/2d/Contours.js +61 -42
- package/lib/component/2d/FooterBanner.js +2 -2
- package/lib/component/2d/Left1DChart.js +1 -1
- package/lib/component/2d/Top1DChart.js +1 -1
- package/lib/component/2d/Viewer2D.js +11 -14
- package/lib/component/2d/tools/XYLabelPointer.js +2 -2
- package/lib/component/2d/tools/slicing/VerticalSliceChart.js +1 -1
- package/lib/component/2d/zones/IndicationLines.js +5 -8
- package/lib/component/EventsTrackers/BrushTracker.js +30 -21
- package/lib/component/EventsTrackers/KeysListenerTracker.js +14 -15
- package/lib/component/NMRium.d.ts +1 -1
- package/lib/component/NMRium.js +6 -6
- package/lib/component/SplitPaneWrapper.js +1 -1
- package/lib/component/assignment/actions/initAssignment.js +17 -17
- package/lib/component/assignment/index.js +2 -2
- package/lib/component/context/PreferencesContext.js +3 -6
- package/lib/component/elements/Button.js +1 -1
- package/lib/component/elements/CheckBoxCell.js +1 -1
- package/lib/component/elements/ContextMenu.js +2 -2
- package/lib/component/elements/EditableColumn.d.ts +3 -1
- package/lib/component/elements/EditableColumn.js +21 -8
- package/lib/component/elements/GroupPane.d.ts +12 -0
- package/lib/component/elements/GroupPane.js +14 -0
- package/lib/component/elements/Input.js +7 -4
- package/lib/component/elements/IsotopesViewer.js +1 -1
- package/lib/component/elements/Label.js +1 -2
- package/lib/component/elements/MolecularFormulaInput.js +2 -0
- package/lib/component/elements/NumberInput.js +2 -2
- package/lib/component/elements/ReactTable/Elements/ReactTableRow.js +1 -1
- package/lib/component/elements/ReactTable/ReactTable.d.ts +2 -1
- package/lib/component/elements/ReactTable/ReactTable.js +72 -38
- package/lib/component/elements/ReactTable/ReactTableFlexLayout.d.ts +3 -2
- package/lib/component/elements/ReactTable/ReactTableFlexLayout.js +2 -2
- package/lib/component/elements/ReactTable/utility/addCustomColumn.js +3 -3
- package/lib/component/elements/ReactTable/utility/useRowSpan.js +3 -7
- package/lib/component/elements/accordion/Accordion.js +2 -2
- package/lib/component/elements/draggble/useDraggable.js +1 -3
- package/lib/component/elements/dropDownButton/DropDownList.js +1 -2
- package/lib/component/elements/formik/FormikCheckBox.js +1 -1
- package/lib/component/elements/formik/FormikColorPicker.d.ts +0 -1
- package/lib/component/elements/formik/FormikColorPicker.js +5 -8
- package/lib/component/elements/formik/FormikErrorsSummary.js +2 -2
- package/lib/component/elements/formik/FormikForm.js +2 -2
- package/lib/component/elements/formik/FormikInput.d.ts +0 -1
- package/lib/component/elements/formik/FormikInput.js +12 -20
- package/lib/component/elements/formik/FormikOnChange.d.ts +1 -1
- package/lib/component/elements/formik/FormikOnChange.js +13 -10
- package/lib/component/elements/formik/FormikSelect.js +1 -1
- package/lib/component/elements/formik/FormikSlider.d.ts +2 -4
- package/lib/component/elements/formik/FormikSlider.js +8 -11
- package/lib/component/elements/formik/FormikTextarea.js +1 -1
- package/lib/component/elements/linearAxis/LinearVerticalAxis.js +2 -2
- package/lib/component/elements/popup/Alert/Provider.js +7 -7
- package/lib/component/elements/popup/Alert/index.d.ts +3 -4
- package/lib/component/elements/popup/Alert/index.js +3 -4
- package/lib/component/elements/popup/Modal/ModalContent.js +3 -1
- package/lib/component/elements/popup/Modal/Provider.js +16 -31
- package/lib/component/elements/popup/Modal/index.d.ts +4 -5
- package/lib/component/elements/popup/Modal/index.js +4 -5
- package/lib/component/header/Header.js +1 -1
- package/lib/component/hooks/useActiveSpectrumStyleOptions.js +1 -1
- package/lib/component/hooks/useCombinedRefs.js +2 -2
- package/lib/component/hooks/useExport.d.ts +1 -1
- package/lib/component/hooks/useExport.js +9 -6
- package/lib/component/hooks/useFormatNumberByNucleus.js +1 -1
- package/lib/component/hooks/usePanelPreferences.js +9 -7
- package/lib/component/loader/DropZone.js +10 -2
- package/lib/component/modal/AlignSpectraModal.js +1 -1
- package/lib/component/modal/ExportAsMatrixModal.js +1 -1
- package/lib/component/modal/LoadJCAMPModal.js +2 -2
- package/lib/component/modal/MultipleSpectraFiltersModal/index.js +1 -1
- package/lib/component/modal/MultipletAnalysisModal.js +3 -3
- package/lib/component/modal/PredictSpectraModal.js +5 -5
- package/lib/component/modal/editRange/EditRangeModal.js +4 -4
- package/lib/component/modal/editRange/forms/components/SignalFormInfo.js +1 -1
- package/lib/component/modal/editRange/forms/validation/EditRangeValidation.js +2 -2
- package/lib/component/modal/setting/DatabasesTabContent.js +25 -20
- package/lib/component/modal/setting/DisplayTabContent.js +21 -27
- package/lib/component/modal/setting/FormattingTabContent.js +10 -10
- package/lib/component/modal/setting/GeneralSettings.js +11 -14
- package/lib/component/modal/setting/GeneralTabContent.js +3 -1
- package/lib/component/modal/setting/ToolsTabContent.js +18 -19
- package/lib/component/modal/setting/WorkspaceItem.d.ts +2 -1
- package/lib/component/modal/setting/WorkspaceItem.js +36 -48
- package/lib/component/modal/setting/settingsValidation.d.ts +58 -57
- package/lib/component/modal/setting/settingsValidation.js +14 -12
- package/lib/component/panels/AutomaticAssignment/useAutoAssignments.js +8 -7
- package/lib/component/panels/InformationPanel.js +52 -56
- package/lib/component/panels/IntegralsPanel/IntegralTable.js +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculeHeader.js +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +1 -1
- package/lib/component/panels/MoleculesPanel/Utilities.js +6 -6
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +16 -17
- package/lib/component/panels/MultipleSpectraAnalysisPanel/ColumnHeader.js +1 -1
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleAnalysisCodeEditor.js +1 -1
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +1 -1
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPreferences.js +18 -17
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +2 -2
- package/lib/component/panels/PeaksPanel/PeaksPanel.js +1 -1
- package/lib/component/panels/PeaksPanel/PeaksTable.js +2 -2
- package/lib/component/panels/RangesPanel/RangesHeader.js +1 -1
- package/lib/component/panels/RangesPanel/RangesPanel.js +1 -1
- package/lib/component/panels/RangesPanel/RangesTable.js +1 -1
- package/lib/component/panels/RangesPanel/RangesTableRow.js +1 -3
- package/lib/component/panels/RangesPanel/TableColumns/CouplingColumn.js +1 -1
- package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.js +2 -2
- package/lib/component/panels/RangesPanel/hooks/useMapRanges.js +8 -8
- package/lib/component/panels/SpectrumsPanel/SpectrumListItem.js +6 -6
- package/lib/component/panels/SpectrumsPanel/SpectrumListPanel.js +3 -3
- package/lib/component/panels/SpectrumsPanel/SpectrumsTabs.js +5 -5
- package/lib/component/panels/SpectrumsPanel/base/ColorIndicator.js +2 -2
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum1DSetting.d.ts +1 -1
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum1DSetting.js +2 -1
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum2DSetting.d.ts +1 -1
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum2DSetting.js +2 -1
- package/lib/component/panels/SpectrumsPanel/base/setting/processSnapPlot.js +3 -26
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +13 -17
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnHeader.js +16 -17
- package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +20 -21
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +12 -12
- package/lib/component/panels/SummaryPanel/SetShiftTolerancesModal.js +1 -5
- package/lib/component/panels/SummaryPanel/utilities/Utilities.js +105 -94
- package/lib/component/panels/ZonesPanel/ZonesTable.js +8 -8
- package/lib/component/panels/databasePanel/DatabasePanel.js +5 -4
- package/lib/component/panels/databasePanel/DatabaseTable.d.ts +2 -1
- package/lib/component/panels/databasePanel/DatabaseTable.js +20 -5
- package/lib/component/panels/extra/preferences/ColumnsHelper.js +5 -2
- package/lib/component/panels/extra/utilities/MultiplicityUtilities.d.ts +2 -2
- package/lib/component/panels/extra/utilities/MultiplicityUtilities.js +2 -2
- package/lib/component/panels/filtersPanel/FiltersTable.js +1 -1
- package/lib/component/reducer/IgnoreActions.js +3 -3
- package/lib/component/reducer/Reducer.d.ts +26 -45
- package/lib/component/reducer/Reducer.js +13 -12
- package/lib/component/reducer/actions/CorrelationsActions.js +4 -4
- package/lib/component/reducer/actions/DomainActions.d.ts +2 -2
- package/lib/component/reducer/actions/DomainActions.js +52 -69
- package/lib/component/reducer/actions/FiltersActions.js +15 -6
- package/lib/component/reducer/actions/HistoryActions.js +5 -5
- package/lib/component/reducer/actions/IntegralsActions.js +6 -5
- package/lib/component/reducer/actions/LoadActions.js +12 -0
- package/lib/component/reducer/actions/PeaksActions.js +7 -6
- package/lib/component/reducer/actions/PreferencesActions.js +20 -38
- package/lib/component/reducer/actions/RangesActions.d.ts +1 -1
- package/lib/component/reducer/actions/RangesActions.js +28 -24
- package/lib/component/reducer/actions/SpectrumsActions.js +13 -6
- package/lib/component/reducer/actions/ToolsActions.d.ts +1 -1
- package/lib/component/reducer/actions/ToolsActions.js +28 -41
- package/lib/component/reducer/actions/ZonesActions.js +11 -10
- package/lib/component/reducer/core/Constants.js +1 -1
- package/lib/component/reducer/helper/GetClosestNumber.js +2 -1
- package/lib/component/reducer/helper/Zoom1DManager.js +11 -10
- package/lib/component/reducer/helper/getActiveSpectrum.d.ts +3 -0
- package/lib/component/reducer/helper/getActiveSpectrum.js +4 -0
- package/lib/component/reducer/helper/getSpectrum.js +3 -5
- package/lib/component/reducer/helper/getStrongestPeak.d.ts +1 -1
- package/lib/component/reducer/helper/getStrongestPeak.js +2 -3
- package/lib/component/reducer/preferences/actions/removeWorkspace.js +3 -10
- package/lib/component/reducer/preferences/actions/setPreferences.js +5 -6
- package/lib/component/reducer/preferences/preferencesReducer.d.ts +2 -2
- package/lib/component/reducer/preferences/utilities/mapNucleiFormatting.d.ts +1 -4
- package/lib/component/reducer/preferences/utilities/mapNucleiFormatting.js +7 -5
- package/lib/component/tool/BrushX.js +3 -3
- package/lib/component/tool/BrushXY.js +5 -5
- package/lib/component/tool/CrossLinePointer.js +3 -3
- package/lib/component/toolbar/BasicToolBar.js +9 -8
- package/lib/component/utility/Evaluate.js +2 -2
- package/lib/component/utility/FileUtility.d.ts +2 -9
- package/lib/component/utility/FileUtility.js +11 -28
- package/lib/component/utility/GroupByInfoKey.d.ts +1 -1
- package/lib/component/utility/GroupByInfoKey.js +11 -13
- package/lib/component/utility/PathBuilder.js +1 -1
- package/lib/component/utility/PreferencesHelper.js +2 -3
- package/lib/component/utility/{Export.d.ts → export.d.ts} +0 -0
- package/lib/component/utility/{Export.js → export.js} +54 -73
- package/lib/component/utility/formatNumber.d.ts +6 -1
- package/lib/component/utility/formatNumber.js +5 -4
- package/lib/component/workspaces/Workspace.d.ts +1 -1
- package/lib/component/workspaces/exercise.js +4 -4
- package/lib/component/workspaces/workspaceDefaultProperties.js +1 -1
- package/lib/data/Filters.d.ts +16 -18
- package/lib/data/Filters.js +16 -18
- package/lib/data/FiltersManager.js +4 -3
- package/lib/data/PredictionManager.js +8 -10
- package/lib/data/SpectraManager.d.ts +1 -2
- package/lib/data/SpectraManager.js +25 -60
- package/lib/data/data1d/MultipleAnalysis.js +74 -70
- package/lib/data/data1d/Spectrum1D/SumManager.js +1 -1
- package/lib/data/data1d/Spectrum1D/generateJGraphData.js +1 -1
- package/lib/data/data1d/Spectrum1D/index.d.ts +24 -25
- package/lib/data/data1d/Spectrum1D/index.js +24 -25
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +1 -1
- package/lib/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.js +6 -5
- package/lib/data/data1d/Spectrum1D/integrals/updateRelatives.js +8 -10
- package/lib/data/data1d/Spectrum1D/peaks/lookupPeak.js +1 -1
- package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.js +2 -2
- package/lib/data/data1d/Spectrum1D/ranges/addRange.js +3 -2
- package/lib/data/data1d/Spectrum1D/ranges/changeRange.js +2 -2
- package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.d.ts +35 -1
- package/lib/data/data1d/Spectrum1D/ranges/mapRanges.d.ts +35 -1
- package/lib/data/data1d/Spectrum1D/ranges/mapRanges.js +6 -7
- package/lib/data/data1d/database.js +45 -28
- package/lib/data/data1d/filter1d/apodization.js +2 -1
- package/lib/data/data1d/filter1d/fft.js +24 -7
- package/lib/data/data1d/filter1d/phaseCorrection.js +11 -5
- package/lib/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +1 -1
- package/lib/data/data1d/filter1d/zeroFilling.js +1 -1
- package/lib/data/data2d/Processing2D.d.ts +3 -3
- package/lib/data/data2d/Processing2D.js +10 -20
- package/lib/data/data2d/Spectrum2D/contours.d.ts +40 -0
- package/lib/data/data2d/Spectrum2D/contours.js +132 -0
- package/lib/data/data2d/Spectrum2D/index.d.ts +10 -11
- package/lib/data/data2d/Spectrum2D/index.js +10 -11
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +3 -4
- package/lib/data/data2d/Spectrum2D/shift/getShift.js +4 -5
- package/lib/data/data2d/Spectrum2D/zones/detectZones.js +11 -8
- package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.js +1 -1
- package/lib/data/data2d/Spectrum2D/zones/getDetectionZones.js +1 -2
- package/lib/data/molecules/MoleculeManager.js +1 -1
- package/lib/data/types/common/Source.d.ts +1 -0
- package/lib/data/types/data1d/index.d.ts +12 -13
- package/lib/data/types/data2d/Data2D.d.ts +2 -0
- package/lib/data/types/data2d/Datum2D.d.ts +0 -1
- package/lib/data/types/data2d/index.d.ts +8 -9
- package/lib/data/utilities/RangeUtilities.js +13 -9
- package/lib/data/utilities/ZoneUtilities.js +17 -13
- package/lib/data/utilities/calculateSanPlot.d.ts +8 -0
- package/lib/data/utilities/calculateSanPlot.js +31 -0
- package/lib/data/utilities/checkModifierKeyActivated.js +1 -2
- package/lib/data/utilities/generateChar.js +8 -6
- package/lib/data/utilities/getAtom.js +1 -1
- package/lib/data/utilities/getAtomsFromMF.js +2 -2
- package/lib/data/utilities/getColor.js +3 -3
- package/lib/data/utilities/getSum.js +6 -3
- package/lib/types/NMRiumGeneralPreferences.d.ts +2 -2
- package/lib/versionInfo.js +1 -1
- package/lib-cjs/component/1d/Chart1D.js +1 -1
- package/lib-cjs/component/1d/FooterBanner.js +16 -9
- package/lib-cjs/component/1d/LinesSeries.js +1 -1
- package/lib-cjs/component/1d/SpectraTracker.js +1 -1
- package/lib-cjs/component/1d/Viewer1D.js +1 -1
- package/lib-cjs/component/1d/XAxis.js +1 -1
- package/lib-cjs/component/1d/database/DatabaseSpectrum.js +2 -1
- package/lib-cjs/component/1d/database/ResurrectedDatabaseRanges.js +2 -2
- package/lib-cjs/component/1d/{Integral.js → integral/Integral.js} +2 -2
- package/lib-cjs/component/1d/integral/IntegralIndicator.js +31 -0
- package/lib-cjs/component/1d/integral/IntegralResizable.js +74 -0
- package/lib-cjs/component/1d/{IntegralsSeries.js → integral/IntegralsSeries.js} +4 -4
- package/lib-cjs/component/1d/multiAnalysis/MultiAnalysisRanges.js +1 -1
- package/lib-cjs/component/1d/multiplicityTree/MultiplicityTree.js +4 -4
- package/lib-cjs/component/1d/multiplicityTree/buildTreeNode.js +3 -3
- package/lib-cjs/component/1d/peaks/PeakAnnotation.js +1 -1
- package/lib-cjs/component/1d/peaks/usePeakShapesPath.js +10 -6
- package/lib-cjs/component/1d/ranges/Range.js +27 -50
- package/lib-cjs/component/1d/tool/PeakPointer.js +1 -1
- package/lib-cjs/component/1d/utilities/scale.js +2 -2
- package/lib-cjs/component/2d/Contours.js +60 -41
- package/lib-cjs/component/2d/FooterBanner.js +2 -2
- package/lib-cjs/component/2d/Left1DChart.js +1 -1
- package/lib-cjs/component/2d/Top1DChart.js +1 -1
- package/lib-cjs/component/2d/Viewer2D.js +11 -14
- package/lib-cjs/component/2d/tools/XYLabelPointer.js +2 -2
- package/lib-cjs/component/2d/tools/slicing/VerticalSliceChart.js +1 -1
- package/lib-cjs/component/2d/zones/IndicationLines.js +5 -8
- package/lib-cjs/component/EventsTrackers/BrushTracker.js +30 -21
- package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +14 -15
- package/lib-cjs/component/NMRium.js +7 -7
- package/lib-cjs/component/SplitPaneWrapper.js +1 -1
- package/lib-cjs/component/assignment/actions/initAssignment.js +17 -17
- package/lib-cjs/component/assignment/index.js +2 -2
- package/lib-cjs/component/context/PreferencesContext.js +3 -6
- package/lib-cjs/component/elements/Button.js +1 -1
- package/lib-cjs/component/elements/CheckBoxCell.js +1 -1
- package/lib-cjs/component/elements/ContextMenu.js +2 -2
- package/lib-cjs/component/elements/EditableColumn.js +21 -8
- package/lib-cjs/component/elements/GroupPane.js +18 -0
- package/lib-cjs/component/elements/Input.js +7 -4
- package/lib-cjs/component/elements/IsotopesViewer.js +1 -1
- package/lib-cjs/component/elements/Label.js +1 -2
- package/lib-cjs/component/elements/MolecularFormulaInput.js +2 -0
- package/lib-cjs/component/elements/NumberInput.js +2 -2
- package/lib-cjs/component/elements/ReactTable/Elements/ReactTableRow.js +1 -1
- package/lib-cjs/component/elements/ReactTable/ReactTable.js +71 -37
- package/lib-cjs/component/elements/ReactTable/ReactTableFlexLayout.js +2 -2
- package/lib-cjs/component/elements/ReactTable/utility/addCustomColumn.js +3 -3
- package/lib-cjs/component/elements/ReactTable/utility/useRowSpan.js +3 -7
- package/lib-cjs/component/elements/accordion/Accordion.js +2 -2
- package/lib-cjs/component/elements/draggble/useDraggable.js +1 -3
- package/lib-cjs/component/elements/dropDownButton/DropDownList.js +1 -2
- package/lib-cjs/component/elements/formik/FormikCheckBox.js +1 -1
- package/lib-cjs/component/elements/formik/FormikColorPicker.js +4 -7
- package/lib-cjs/component/elements/formik/FormikErrorsSummary.js +2 -2
- package/lib-cjs/component/elements/formik/FormikForm.js +2 -2
- package/lib-cjs/component/elements/formik/FormikInput.js +12 -20
- package/lib-cjs/component/elements/formik/FormikOnChange.js +13 -10
- package/lib-cjs/component/elements/formik/FormikSelect.js +1 -1
- package/lib-cjs/component/elements/formik/FormikSlider.js +7 -10
- package/lib-cjs/component/elements/formik/FormikTextarea.js +1 -1
- package/lib-cjs/component/elements/linearAxis/LinearVerticalAxis.js +2 -2
- package/lib-cjs/component/elements/popup/Alert/Provider.js +8 -8
- package/lib-cjs/component/elements/popup/Alert/index.js +5 -5
- package/lib-cjs/component/elements/popup/Modal/ModalContent.js +3 -1
- package/lib-cjs/component/elements/popup/Modal/Provider.js +16 -31
- package/lib-cjs/component/elements/popup/Modal/index.js +7 -7
- package/lib-cjs/component/header/Header.js +1 -1
- package/lib-cjs/component/hooks/useActiveSpectrumStyleOptions.js +1 -1
- package/lib-cjs/component/hooks/useCombinedRefs.js +2 -2
- package/lib-cjs/component/hooks/useExport.js +14 -11
- package/lib-cjs/component/hooks/useFormatNumberByNucleus.js +1 -1
- package/lib-cjs/component/hooks/usePanelPreferences.js +9 -7
- package/lib-cjs/component/loader/DropZone.js +10 -2
- package/lib-cjs/component/modal/AlignSpectraModal.js +1 -1
- package/lib-cjs/component/modal/ExportAsMatrixModal.js +2 -2
- package/lib-cjs/component/modal/LoadJCAMPModal.js +2 -2
- package/lib-cjs/component/modal/MultipleSpectraFiltersModal/index.js +1 -1
- package/lib-cjs/component/modal/MultipletAnalysisModal.js +3 -3
- package/lib-cjs/component/modal/PredictSpectraModal.js +5 -5
- package/lib-cjs/component/modal/editRange/EditRangeModal.js +4 -4
- package/lib-cjs/component/modal/editRange/forms/components/SignalFormInfo.js +1 -1
- package/lib-cjs/component/modal/editRange/forms/validation/EditRangeValidation.js +2 -2
- package/lib-cjs/component/modal/setting/DatabasesTabContent.js +25 -20
- package/lib-cjs/component/modal/setting/DisplayTabContent.js +21 -27
- package/lib-cjs/component/modal/setting/FormattingTabContent.js +10 -10
- package/lib-cjs/component/modal/setting/GeneralSettings.js +11 -14
- package/lib-cjs/component/modal/setting/GeneralTabContent.js +3 -1
- package/lib-cjs/component/modal/setting/ToolsTabContent.js +18 -19
- package/lib-cjs/component/modal/setting/WorkspaceItem.js +37 -49
- package/lib-cjs/component/modal/setting/settingsValidation.js +14 -12
- package/lib-cjs/component/panels/AutomaticAssignment/useAutoAssignments.js +8 -7
- package/lib-cjs/component/panels/InformationPanel.js +51 -55
- package/lib-cjs/component/panels/IntegralsPanel/IntegralTable.js +1 -1
- package/lib-cjs/component/panels/MoleculesPanel/MoleculeHeader.js +1 -1
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +4 -4
- package/lib-cjs/component/panels/MoleculesPanel/Utilities.js +6 -6
- package/lib-cjs/component/panels/MoleculesPanel/useAtomAssignment.js +16 -17
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/ColumnHeader.js +1 -1
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleAnalysisCodeEditor.js +1 -1
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +2 -2
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPreferences.js +18 -17
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +2 -2
- package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +1 -1
- package/lib-cjs/component/panels/PeaksPanel/PeaksTable.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/RangesPanel.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/RangesTable.js +1 -1
- package/lib-cjs/component/panels/RangesPanel/RangesTableRow.js +1 -3
- package/lib-cjs/component/panels/RangesPanel/TableColumns/CouplingColumn.js +1 -1
- package/lib-cjs/component/panels/RangesPanel/hooks/useEditRangeModal.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/hooks/useMapRanges.js +8 -8
- package/lib-cjs/component/panels/SpectrumsPanel/SpectrumListItem.js +6 -6
- package/lib-cjs/component/panels/SpectrumsPanel/SpectrumListPanel.js +3 -3
- package/lib-cjs/component/panels/SpectrumsPanel/SpectrumsTabs.js +6 -6
- package/lib-cjs/component/panels/SpectrumsPanel/base/ColorIndicator.js +2 -2
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum1DSetting.js +2 -1
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum2DSetting.js +2 -1
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/processSnapPlot.js +2 -25
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +13 -17
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnHeader.js +16 -17
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +20 -21
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +12 -12
- package/lib-cjs/component/panels/SummaryPanel/SetShiftTolerancesModal.js +1 -5
- package/lib-cjs/component/panels/SummaryPanel/utilities/Utilities.js +105 -94
- package/lib-cjs/component/panels/ZonesPanel/ZonesTable.js +8 -8
- package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +5 -4
- package/lib-cjs/component/panels/databasePanel/DatabaseTable.js +20 -5
- package/lib-cjs/component/panels/extra/preferences/ColumnsHelper.js +5 -2
- package/lib-cjs/component/panels/extra/utilities/MultiplicityUtilities.js +2 -2
- package/lib-cjs/component/panels/filtersPanel/FiltersTable.js +1 -1
- package/lib-cjs/component/reducer/IgnoreActions.js +3 -3
- package/lib-cjs/component/reducer/Reducer.js +12 -11
- package/lib-cjs/component/reducer/actions/CorrelationsActions.js +4 -4
- package/lib-cjs/component/reducer/actions/DomainActions.js +52 -69
- package/lib-cjs/component/reducer/actions/FiltersActions.js +15 -6
- package/lib-cjs/component/reducer/actions/HistoryActions.js +5 -5
- package/lib-cjs/component/reducer/actions/IntegralsActions.js +6 -5
- package/lib-cjs/component/reducer/actions/LoadActions.js +12 -0
- package/lib-cjs/component/reducer/actions/PeaksActions.js +7 -6
- package/lib-cjs/component/reducer/actions/PreferencesActions.js +20 -38
- package/lib-cjs/component/reducer/actions/RangesActions.js +28 -24
- package/lib-cjs/component/reducer/actions/SpectrumsActions.js +12 -5
- package/lib-cjs/component/reducer/actions/ToolsActions.js +28 -41
- package/lib-cjs/component/reducer/actions/ZonesActions.js +11 -10
- package/lib-cjs/component/reducer/core/Constants.js +1 -1
- package/lib-cjs/component/reducer/helper/GetClosestNumber.js +2 -1
- package/lib-cjs/component/reducer/helper/Zoom1DManager.js +11 -10
- package/lib-cjs/component/reducer/helper/getActiveSpectrum.js +8 -0
- package/lib-cjs/component/reducer/helper/getSpectrum.js +3 -5
- package/lib-cjs/component/reducer/helper/getStrongestPeak.js +2 -3
- package/lib-cjs/component/reducer/preferences/actions/removeWorkspace.js +3 -10
- package/lib-cjs/component/reducer/preferences/actions/setPreferences.js +5 -9
- package/lib-cjs/component/reducer/preferences/utilities/mapNucleiFormatting.js +7 -5
- package/lib-cjs/component/tool/BrushX.js +3 -3
- package/lib-cjs/component/tool/BrushXY.js +5 -5
- package/lib-cjs/component/tool/CrossLinePointer.js +3 -3
- package/lib-cjs/component/toolbar/BasicToolBar.js +8 -7
- package/lib-cjs/component/utility/Evaluate.js +2 -2
- package/lib-cjs/component/utility/FileUtility.js +11 -29
- package/lib-cjs/component/utility/GroupByInfoKey.js +11 -13
- package/lib-cjs/component/utility/PathBuilder.js +1 -1
- package/lib-cjs/component/utility/PreferencesHelper.js +2 -3
- package/lib-cjs/component/utility/{Export.js → export.js} +78 -74
- package/lib-cjs/component/utility/formatNumber.js +5 -4
- package/lib-cjs/component/workspaces/exercise.js +4 -4
- package/lib-cjs/component/workspaces/workspaceDefaultProperties.js +1 -1
- package/lib-cjs/data/Filters.js +17 -35
- package/lib-cjs/data/FiltersManager.js +4 -3
- package/lib-cjs/data/PredictionManager.js +8 -10
- package/lib-cjs/data/SpectraManager.js +26 -62
- package/lib-cjs/data/data1d/MultipleAnalysis.js +74 -70
- package/lib-cjs/data/data1d/Spectrum1D/SumManager.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/generateJGraphData.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/index.js +25 -25
- package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.js +6 -5
- package/lib-cjs/data/data1d/Spectrum1D/integrals/updateRelatives.js +8 -10
- package/lib-cjs/data/data1d/Spectrum1D/peaks/lookupPeak.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/peaks/optimizePeaks.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/ranges/addRange.js +3 -2
- package/lib-cjs/data/data1d/Spectrum1D/ranges/changeRange.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/ranges/mapRanges.js +6 -7
- package/lib-cjs/data/data1d/database.js +45 -28
- package/lib-cjs/data/data1d/filter1d/apodization.js +2 -1
- package/lib-cjs/data/data1d/filter1d/fft.js +23 -6
- package/lib-cjs/data/data1d/filter1d/phaseCorrection.js +10 -4
- package/lib-cjs/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +1 -1
- package/lib-cjs/data/data1d/filter1d/zeroFilling.js +1 -1
- package/lib-cjs/data/data2d/Processing2D.js +10 -20
- package/lib-cjs/data/data2d/Spectrum2D/contours.js +138 -0
- package/lib-cjs/data/data2d/Spectrum2D/index.js +11 -11
- package/lib-cjs/data/data2d/Spectrum2D/initiateDatum2D.js +3 -4
- package/lib-cjs/data/data2d/Spectrum2D/shift/getShift.js +4 -5
- package/lib-cjs/data/data2d/Spectrum2D/zones/detectZones.js +11 -8
- package/lib-cjs/data/data2d/Spectrum2D/zones/detectZonesManual.js +1 -1
- package/lib-cjs/data/data2d/Spectrum2D/zones/getDetectionZones.js +1 -2
- package/lib-cjs/data/molecules/MoleculeManager.js +1 -1
- package/lib-cjs/data/utilities/RangeUtilities.js +13 -9
- package/lib-cjs/data/utilities/ZoneUtilities.js +17 -13
- package/lib-cjs/data/utilities/calculateSanPlot.js +35 -0
- package/lib-cjs/data/utilities/checkModifierKeyActivated.js +1 -2
- package/lib-cjs/data/utilities/generateChar.js +8 -6
- package/lib-cjs/data/utilities/getAtom.js +1 -1
- package/lib-cjs/data/utilities/getAtomsFromMF.js +2 -2
- package/lib-cjs/data/utilities/getColor.js +3 -3
- package/lib-cjs/data/utilities/getSum.js +6 -3
- package/lib-cjs/versionInfo.js +1 -1
- package/package.json +36 -31
- package/lib/component/1d/IntegralResizable.js +0 -72
- package/lib/component/elements/popup/helpers.d.ts +0 -1
- package/lib/component/elements/popup/helpers.js +0 -9
- package/lib/component/panels/RangesPanel/TableColumns/format.d.ts +0 -1
- package/lib/component/panels/RangesPanel/TableColumns/format.js +0 -8
- package/lib/data/data1d/Data1DManager.d.ts +0 -3
- package/lib/data/data1d/Data1DManager.js +0 -98
- package/lib/data/data1d/filter1d/absolute.d.ts +0 -13
- package/lib/data/data1d/filter1d/absolute.js +0 -26
- package/lib/data/data2d/Data2DManager.d.ts +0 -3
- package/lib/data/data2d/Data2DManager.js +0 -34
- package/lib/data/types/data2d/Contour.d.ts +0 -4
- package/lib/data/types/data2d/Contour.js +0 -1
- package/lib/data/types/data2d/Contours.d.ts +0 -2
- package/lib/data/types/data2d/Contours.js +0 -1
- package/lib-cjs/component/1d/IntegralResizable.js +0 -77
- package/lib-cjs/component/elements/popup/helpers.js +0 -13
- package/lib-cjs/component/panels/RangesPanel/TableColumns/format.js +0 -14
- package/lib-cjs/data/data1d/Data1DManager.js +0 -104
- package/lib-cjs/data/data1d/filter1d/absolute.js +0 -32
- package/lib-cjs/data/data2d/Data2DManager.js +0 -40
- package/lib-cjs/data/types/data2d/Contour.js +0 -2
- package/lib-cjs/data/types/data2d/Contours.js +0 -2
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import { CorrelationData } from 'nmr-correlation';
|
|
3
2
|
import { SpectraAnalysis } from '../../data/data1d/MultipleAnalysis';
|
|
4
3
|
import { ApodizationOptions } from '../../data/data1d/filter1d/apodization';
|
|
4
|
+
import { ContoursLevels } from '../../data/data2d/Spectrum2D/contours';
|
|
5
5
|
import { FloatingMolecules, StateMoleculeExtended } from '../../data/molecules/Molecule';
|
|
6
|
-
import { Contours } from '../../data/types/data2d/Contours';
|
|
7
6
|
import { UsedColors } from '../../types/UsedColors';
|
|
8
7
|
import { Spectra } from '../NMRium';
|
|
9
8
|
import { DISPLAYER_MODE } from './core/Constants';
|
|
@@ -69,6 +68,9 @@ export interface ViewState {
|
|
|
69
68
|
*/
|
|
70
69
|
activeTab: string;
|
|
71
70
|
};
|
|
71
|
+
zoom: {
|
|
72
|
+
levels: ContoursLevels;
|
|
73
|
+
};
|
|
72
74
|
}
|
|
73
75
|
export declare const rangeStateInit: {
|
|
74
76
|
showMultiplicityTrees: boolean;
|
|
@@ -103,10 +105,6 @@ export interface State {
|
|
|
103
105
|
* spectra list (1d and 2d)
|
|
104
106
|
*/
|
|
105
107
|
data: Spectra;
|
|
106
|
-
/**
|
|
107
|
-
* calculated contours for 2d spectra
|
|
108
|
-
*/
|
|
109
|
-
contours: Contours;
|
|
110
108
|
/**
|
|
111
109
|
* snapshot of the spectra data once phase correction activated
|
|
112
110
|
*
|
|
@@ -307,6 +305,7 @@ export declare const spectrumReducer: (base: {
|
|
|
307
305
|
readonly data: readonly ({
|
|
308
306
|
readonly id: string;
|
|
309
307
|
readonly source: {
|
|
308
|
+
readonly jcamp: string;
|
|
310
309
|
readonly jcampURL: string;
|
|
311
310
|
readonly jcampSpectrumIndex: number;
|
|
312
311
|
readonly file: {
|
|
@@ -315,22 +314,10 @@ export declare const spectrumReducer: (base: {
|
|
|
315
314
|
readonly webkitRelativePath: string;
|
|
316
315
|
readonly size: number;
|
|
317
316
|
readonly type: string;
|
|
318
|
-
readonly arrayBuffer:
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
readonly slice: {
|
|
323
|
-
(start?: number | undefined, end?: number | undefined, contentType?: string | undefined): Blob;
|
|
324
|
-
(start?: number | undefined, end?: number | undefined, contentType?: string | undefined): Blob;
|
|
325
|
-
};
|
|
326
|
-
readonly stream: {
|
|
327
|
-
(): ReadableStream<Uint8Array>;
|
|
328
|
-
(): NodeJS.ReadableStream;
|
|
329
|
-
};
|
|
330
|
-
readonly text: {
|
|
331
|
-
(): Promise<string>;
|
|
332
|
-
(): Promise<string>;
|
|
333
|
-
};
|
|
317
|
+
readonly arrayBuffer: () => Promise<ArrayBuffer>;
|
|
318
|
+
readonly slice: (start?: number | undefined, end?: number | undefined, contentType?: string | undefined) => Blob;
|
|
319
|
+
readonly stream: () => ReadableStream<Uint8Array>;
|
|
320
|
+
readonly text: () => Promise<string>;
|
|
334
321
|
};
|
|
335
322
|
};
|
|
336
323
|
readonly display: {
|
|
@@ -807,6 +794,7 @@ export declare const spectrumReducer: (base: {
|
|
|
807
794
|
} | {
|
|
808
795
|
readonly id: string;
|
|
809
796
|
readonly source: {
|
|
797
|
+
readonly jcamp: string;
|
|
810
798
|
readonly jcampURL: string;
|
|
811
799
|
readonly jcampSpectrumIndex: number;
|
|
812
800
|
readonly file: {
|
|
@@ -815,22 +803,10 @@ export declare const spectrumReducer: (base: {
|
|
|
815
803
|
readonly webkitRelativePath: string;
|
|
816
804
|
readonly size: number;
|
|
817
805
|
readonly type: string;
|
|
818
|
-
readonly arrayBuffer:
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
readonly slice: {
|
|
823
|
-
(start?: number | undefined, end?: number | undefined, contentType?: string | undefined): Blob;
|
|
824
|
-
(start?: number | undefined, end?: number | undefined, contentType?: string | undefined): Blob;
|
|
825
|
-
};
|
|
826
|
-
readonly stream: {
|
|
827
|
-
(): ReadableStream<Uint8Array>;
|
|
828
|
-
(): NodeJS.ReadableStream;
|
|
829
|
-
};
|
|
830
|
-
readonly text: {
|
|
831
|
-
(): Promise<string>;
|
|
832
|
-
(): Promise<string>;
|
|
833
|
-
};
|
|
806
|
+
readonly arrayBuffer: () => Promise<ArrayBuffer>;
|
|
807
|
+
readonly slice: (start?: number | undefined, end?: number | undefined, contentType?: string | undefined) => Blob;
|
|
808
|
+
readonly stream: () => ReadableStream<Uint8Array>;
|
|
809
|
+
readonly text: () => Promise<string>;
|
|
834
810
|
};
|
|
835
811
|
};
|
|
836
812
|
readonly display: {
|
|
@@ -872,15 +848,19 @@ export declare const spectrumReducer: (base: {
|
|
|
872
848
|
readonly z: readonly (readonly number[])[];
|
|
873
849
|
readonly minX: number;
|
|
874
850
|
readonly minY: number;
|
|
851
|
+
readonly minZ: number;
|
|
875
852
|
readonly maxX: number;
|
|
876
853
|
readonly maxY: number;
|
|
854
|
+
readonly maxZ: number;
|
|
877
855
|
};
|
|
878
856
|
readonly originalData?: {
|
|
879
857
|
readonly z: readonly (readonly number[])[];
|
|
880
858
|
readonly minX: number;
|
|
881
859
|
readonly minY: number;
|
|
860
|
+
readonly minZ: number;
|
|
882
861
|
readonly maxX: number;
|
|
883
862
|
readonly maxY: number;
|
|
863
|
+
readonly maxZ: number;
|
|
884
864
|
} | undefined;
|
|
885
865
|
readonly zones: {
|
|
886
866
|
readonly values: readonly {
|
|
@@ -947,14 +927,7 @@ export declare const spectrumReducer: (base: {
|
|
|
947
927
|
readonly flag: boolean;
|
|
948
928
|
readonly value: any;
|
|
949
929
|
}[];
|
|
950
|
-
readonly processingController: any;
|
|
951
930
|
})[];
|
|
952
|
-
readonly contours: {
|
|
953
|
-
readonly [x: string]: {
|
|
954
|
-
readonly negative: readonly (readonly number[])[];
|
|
955
|
-
readonly positive: readonly (readonly number[])[];
|
|
956
|
-
};
|
|
957
|
-
};
|
|
958
931
|
readonly tempData: any;
|
|
959
932
|
readonly xDomain: readonly number[];
|
|
960
933
|
readonly yDomain: readonly number[];
|
|
@@ -1029,6 +1002,14 @@ export declare const spectrumReducer: (base: {
|
|
|
1029
1002
|
};
|
|
1030
1003
|
readonly activeTab: string;
|
|
1031
1004
|
};
|
|
1005
|
+
readonly zoom: {
|
|
1006
|
+
readonly levels: {
|
|
1007
|
+
readonly [x: string]: {
|
|
1008
|
+
readonly positive: number;
|
|
1009
|
+
readonly negative: number;
|
|
1010
|
+
};
|
|
1011
|
+
};
|
|
1012
|
+
};
|
|
1032
1013
|
};
|
|
1033
1014
|
readonly verticalAlign: {
|
|
1034
1015
|
readonly align: VerticalAlignment;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { v4 } from '@lukeed/uuid';
|
|
2
2
|
import { produce } from 'immer';
|
|
3
3
|
import { buildCorrelationData } from 'nmr-correlation';
|
|
4
|
-
import { read as readDropFiles,
|
|
4
|
+
import { read as readDropFiles, readNMRiumObject } from 'nmr-load-save';
|
|
5
5
|
import { predictSpectra } from '../../data/PredictionManager';
|
|
6
|
-
import * as SpectraManager from '../../data/SpectraManager';
|
|
7
6
|
import { useChartData } from '../context/ChartContext';
|
|
8
7
|
import { DefaultTolerance } from '../panels/SummaryPanel/CorrelationTable/Constants';
|
|
9
8
|
import { options } from '../toolbar/ToolTypes';
|
|
@@ -41,7 +40,6 @@ export const zoneStateInit = {
|
|
|
41
40
|
export const getInitialState = () => ({
|
|
42
41
|
actionType: '',
|
|
43
42
|
data: [],
|
|
44
|
-
contours: {},
|
|
45
43
|
tempData: null,
|
|
46
44
|
xDomain: [],
|
|
47
45
|
yDomain: [],
|
|
@@ -60,7 +58,7 @@ export const getInitialState = () => ({
|
|
|
60
58
|
margin: {
|
|
61
59
|
top: 10,
|
|
62
60
|
right: 20,
|
|
63
|
-
bottom:
|
|
61
|
+
bottom: 50,
|
|
64
62
|
left: 0,
|
|
65
63
|
},
|
|
66
64
|
mode: 'RTL',
|
|
@@ -70,6 +68,9 @@ export const getInitialState = () => ({
|
|
|
70
68
|
ranges: [],
|
|
71
69
|
zones: [],
|
|
72
70
|
spectra: { activeSpectra: {}, activeTab: '' },
|
|
71
|
+
zoom: {
|
|
72
|
+
levels: {},
|
|
73
|
+
},
|
|
73
74
|
},
|
|
74
75
|
verticalAlign: {
|
|
75
76
|
align: 'bottom',
|
|
@@ -131,30 +132,30 @@ export function initState(state) {
|
|
|
131
132
|
};
|
|
132
133
|
}
|
|
133
134
|
export function dispatchMiddleware(dispatch) {
|
|
134
|
-
|
|
135
|
+
let usedColors = { '1d': [], '2d': [] };
|
|
135
136
|
return (action) => {
|
|
136
137
|
switch (action.type) {
|
|
137
138
|
case types.INITIATE: {
|
|
138
139
|
if (action.payload) {
|
|
139
|
-
|
|
140
|
-
void
|
|
141
|
-
action.payload = {
|
|
140
|
+
usedColors = { '1d': [], '2d': [] };
|
|
141
|
+
void readNMRiumObject(action.payload).then((data) => {
|
|
142
|
+
action.payload = { ...data, usedColors };
|
|
142
143
|
dispatch(action);
|
|
143
144
|
});
|
|
144
145
|
}
|
|
145
146
|
break;
|
|
146
147
|
}
|
|
147
148
|
case types.LOAD_DROP_FILES: {
|
|
148
|
-
const {
|
|
149
|
+
const { fileCollection } = action;
|
|
149
150
|
action.usedColors = usedColors;
|
|
150
|
-
readDropFiles(
|
|
151
|
+
readDropFiles(fileCollection)
|
|
151
152
|
.then((data) => {
|
|
152
153
|
action.data = data;
|
|
153
154
|
dispatch(action);
|
|
154
155
|
})
|
|
155
|
-
.catch((
|
|
156
|
+
.catch((error) => {
|
|
156
157
|
dispatch({ type: types.SET_LOADING_FLAG, isLoading: false });
|
|
157
|
-
reportError(
|
|
158
|
+
reportError(error);
|
|
158
159
|
});
|
|
159
160
|
break;
|
|
160
161
|
}
|
|
@@ -51,9 +51,9 @@ function handleSetCorrelations(draft, payload) {
|
|
|
51
51
|
const { correlations, options } = payload;
|
|
52
52
|
const state = original(draft);
|
|
53
53
|
let correlationsData = lodashCloneDeep(state.correlations);
|
|
54
|
-
|
|
54
|
+
for (const correlation of correlations) {
|
|
55
55
|
correlationsData = setCorrelation(correlationsData, correlation.id, correlation);
|
|
56
|
-
}
|
|
56
|
+
}
|
|
57
57
|
draft.correlations = correlationsData;
|
|
58
58
|
if (options) {
|
|
59
59
|
draft.correlations = {
|
|
@@ -66,7 +66,7 @@ function handleSetCorrelations(draft, payload) {
|
|
|
66
66
|
function handleDeleteCorrelation(draft, payload) {
|
|
67
67
|
const { correlation, assignmentData } = payload;
|
|
68
68
|
// delete all signals linked to the correlation
|
|
69
|
-
correlation.
|
|
69
|
+
for (const link of correlation.links) {
|
|
70
70
|
const spectrum = findSpectrum(draft.data, link.experimentID, false);
|
|
71
71
|
if (spectrum) {
|
|
72
72
|
if (spectrum.info.dimension === 1) {
|
|
@@ -94,6 +94,6 @@ function handleDeleteCorrelation(draft, payload) {
|
|
|
94
94
|
});
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
|
-
}
|
|
97
|
+
}
|
|
98
98
|
}
|
|
99
99
|
export { handleDeleteCorrelation, handleSetCorrelation, handleSetCorrelations, handleSetMF, handleSetTolerance, handleUpdateCorrelations, };
|
|
@@ -4,8 +4,8 @@ import { State } from '../Reducer';
|
|
|
4
4
|
declare function getDomain(draft: Draft<State>): {
|
|
5
5
|
xDomain: [number, number] | [undefined, undefined];
|
|
6
6
|
yDomain: [number, number] | [undefined, undefined];
|
|
7
|
-
yDomains:
|
|
8
|
-
xDomains:
|
|
7
|
+
yDomains: Record<string, number[]>;
|
|
8
|
+
xDomains: Record<string, number[]>;
|
|
9
9
|
};
|
|
10
10
|
export interface SetDomainOptions {
|
|
11
11
|
yDomain?: {
|
|
@@ -3,12 +3,13 @@ import { get1DDataXY } from '../../../data/data1d/Spectrum1D/get1DDataXY';
|
|
|
3
3
|
import { isSpectrum2D } from '../../../data/data2d/Spectrum2D';
|
|
4
4
|
import nucleusToString from '../../utility/nucleusToString';
|
|
5
5
|
import { DISPLAYER_MODE } from '../core/Constants';
|
|
6
|
+
import { getActiveSpectrum } from '../helper/getActiveSpectrum';
|
|
6
7
|
function getActiveData(draft) {
|
|
7
8
|
let data = draft.data.filter((datum) => nucleusToString(datum.info.nucleus) === draft.view.spectra.activeTab &&
|
|
8
9
|
datum.info.dimension === 1);
|
|
9
10
|
// todo: refactor this
|
|
10
|
-
const activeSpectrum = draft
|
|
11
|
-
if (activeSpectrum) {
|
|
11
|
+
const activeSpectrum = getActiveSpectrum(draft);
|
|
12
|
+
if (activeSpectrum?.id) {
|
|
12
13
|
const activeSpectrumIndex = data.findIndex((datum) => datum.id === activeSpectrum?.id);
|
|
13
14
|
if (activeSpectrumIndex !== -1) {
|
|
14
15
|
const isFid = data[activeSpectrumIndex].info.isFid || false;
|
|
@@ -23,33 +24,26 @@ function getActiveData(draft) {
|
|
|
23
24
|
function getDomain(draft) {
|
|
24
25
|
let xArray = [];
|
|
25
26
|
let yArray = [];
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
const yDomains = {};
|
|
28
|
+
const xDomains = {};
|
|
28
29
|
const data = getActiveData(draft);
|
|
29
30
|
try {
|
|
30
|
-
|
|
31
|
-
const { display, data } = d;
|
|
31
|
+
for (const d of data) {
|
|
32
|
+
const { display, data, id } = d;
|
|
33
|
+
const { y } = get1DDataXY(d);
|
|
34
|
+
const _extent = extent(y);
|
|
32
35
|
const domain = [data.x[0], data.x[data.x.length - 1]];
|
|
33
|
-
|
|
36
|
+
yDomains[id] = _extent;
|
|
37
|
+
xDomains[id] = domain;
|
|
34
38
|
if (display.isVisible) {
|
|
35
|
-
|
|
39
|
+
xArray = xArray.concat(domain);
|
|
40
|
+
yArray = yArray.concat(_extent);
|
|
36
41
|
}
|
|
37
|
-
|
|
38
|
-
}, []);
|
|
39
|
-
yArray = data.reduce((acc, d) => {
|
|
40
|
-
const { display } = d;
|
|
41
|
-
const data = get1DDataXY(d);
|
|
42
|
-
const _extent = extent(data.y);
|
|
43
|
-
yDomains[d.id] = _extent;
|
|
44
|
-
if (display.isVisible) {
|
|
45
|
-
acc = acc.concat(_extent);
|
|
46
|
-
}
|
|
47
|
-
return acc;
|
|
48
|
-
}, []);
|
|
42
|
+
}
|
|
49
43
|
}
|
|
50
|
-
catch (
|
|
51
|
-
//
|
|
52
|
-
|
|
44
|
+
catch (error) {
|
|
45
|
+
// TODO: handle error.
|
|
46
|
+
reportError(error);
|
|
53
47
|
}
|
|
54
48
|
return {
|
|
55
49
|
xDomain: extent(xArray),
|
|
@@ -61,54 +55,44 @@ function getDomain(draft) {
|
|
|
61
55
|
function get2DDomain(state) {
|
|
62
56
|
let xArray = [];
|
|
63
57
|
let yArray = [];
|
|
64
|
-
|
|
65
|
-
|
|
58
|
+
const yDomains = {};
|
|
59
|
+
const xDomains = {};
|
|
66
60
|
const { view: { spectra: { activeSpectra, activeTab }, }, data, } = state;
|
|
67
61
|
const nucleus = activeTab.split(',');
|
|
68
62
|
try {
|
|
69
|
-
xArray = data.
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
datum.info.nucleus?.join(',') === activeTab &&
|
|
80
|
-
datum.info.isFt) {
|
|
81
|
-
acc = acc.concat([datum.data.minY, datum.data.maxY]);
|
|
82
|
-
}
|
|
83
|
-
return acc;
|
|
84
|
-
}, []);
|
|
63
|
+
xArray = data.filter((datum) => isSpectrum2D(datum) &&
|
|
64
|
+
datum.info.nucleus?.join(',') === activeTab &&
|
|
65
|
+
datum.info.isFt).flatMap((datum) => {
|
|
66
|
+
return [datum.data.minX, datum.data.maxX];
|
|
67
|
+
});
|
|
68
|
+
yArray = data.filter((d) => isSpectrum2D(d) &&
|
|
69
|
+
d.info.nucleus?.join(',') === activeTab &&
|
|
70
|
+
d.info.isFt).flatMap((datum) => {
|
|
71
|
+
return [datum.data.minY, datum.data.maxY];
|
|
72
|
+
});
|
|
85
73
|
}
|
|
86
|
-
catch (
|
|
87
|
-
//
|
|
88
|
-
|
|
74
|
+
catch (error) {
|
|
75
|
+
// TODO: handle error
|
|
76
|
+
reportError(error);
|
|
89
77
|
}
|
|
90
|
-
const spectrumsIDs = nucleus.map((n) => activeSpectra[n]?.id);
|
|
91
|
-
const filteredData = data
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}
|
|
78
|
+
const spectrumsIDs = new Set(nucleus.map((n) => activeSpectra[n]?.id));
|
|
79
|
+
const filteredData = data
|
|
80
|
+
.filter((d) => spectrumsIDs.has(d.id) && d.info.dimension === 1)
|
|
81
|
+
.map((datum) => {
|
|
82
|
+
return datum;
|
|
83
|
+
});
|
|
96
84
|
try {
|
|
97
|
-
|
|
98
|
-
const { x } = d.data;
|
|
85
|
+
for (const d of filteredData) {
|
|
86
|
+
const { x, re } = d.data;
|
|
99
87
|
const domain = [x[0], x[x.length - 1]];
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
const _extent = extent(d.data.re);
|
|
105
|
-
acc[d.id] = _extent;
|
|
106
|
-
return acc;
|
|
107
|
-
}, {});
|
|
88
|
+
xDomains[d.id] = domain;
|
|
89
|
+
const _extent = extent(re);
|
|
90
|
+
yDomains[d.id] = _extent;
|
|
91
|
+
}
|
|
108
92
|
}
|
|
109
|
-
catch (
|
|
110
|
-
//
|
|
111
|
-
|
|
93
|
+
catch (error) {
|
|
94
|
+
// TODO: handle error.
|
|
95
|
+
reportError(error);
|
|
112
96
|
}
|
|
113
97
|
return {
|
|
114
98
|
xDomain: extent(xArray),
|
|
@@ -133,10 +117,9 @@ function setDomain(draft, options) {
|
|
|
133
117
|
if (yDomain.isChanged) {
|
|
134
118
|
draft.yDomain = domain.yDomain;
|
|
135
119
|
if (draft.displayerMode === DISPLAYER_MODE.DM_1D && yDomain.isShared) {
|
|
136
|
-
draft.yDomains = Object.keys(domain.yDomains).
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
}, {});
|
|
120
|
+
draft.yDomains = Object.fromEntries(Object.keys(domain.yDomains).map((key) => {
|
|
121
|
+
return [key, domain.yDomain];
|
|
122
|
+
}));
|
|
140
123
|
}
|
|
141
124
|
else {
|
|
142
125
|
draft.yDomains = domain.yDomains;
|
|
@@ -187,8 +170,8 @@ function handelResetDomain(draft) {
|
|
|
187
170
|
draft.yDomains = yDomains;
|
|
188
171
|
}
|
|
189
172
|
function setMode(draft) {
|
|
190
|
-
const
|
|
173
|
+
const datum_ = draft.data.find((datum) => draft.xDomains[datum.id] &&
|
|
191
174
|
nucleusToString(datum.info.nucleus) === draft.view.spectra.activeTab);
|
|
192
|
-
draft.mode =
|
|
175
|
+
draft.mode = datum_?.info.isFid ? 'LTR' : 'RTL';
|
|
193
176
|
}
|
|
194
177
|
export { getDomain, setOriginalDomain, setXDomain, setYDomain, handelResetDomain, setDomain, setMode, setIntegralsYDomain, };
|
|
@@ -102,7 +102,10 @@ function applyManualPhaseCorrectionFilter(draft, filterOptions) {
|
|
|
102
102
|
const { index } = activeSpectrum;
|
|
103
103
|
const { ph0, ph1 } = filterOptions;
|
|
104
104
|
FiltersManager.applyFilter(draft.data[index], [
|
|
105
|
-
{
|
|
105
|
+
{
|
|
106
|
+
name: Filters.phaseCorrection.id,
|
|
107
|
+
options: { ph0, ph1, absolute: false },
|
|
108
|
+
},
|
|
106
109
|
]);
|
|
107
110
|
resetSelectedTool(draft);
|
|
108
111
|
draft.tempData = null;
|
|
@@ -112,7 +115,10 @@ function applyAbsoluteFilter(draft) {
|
|
|
112
115
|
const activeSpectrum = getActiveSpectrumOrFail(draft);
|
|
113
116
|
const { index } = activeSpectrum;
|
|
114
117
|
FiltersManager.applyFilter(draft.data[index], [
|
|
115
|
-
{
|
|
118
|
+
{
|
|
119
|
+
name: Filters.phaseCorrection.id,
|
|
120
|
+
options: { absolute: true, ph0: 0, ph1: 0 },
|
|
121
|
+
},
|
|
116
122
|
]);
|
|
117
123
|
resetSelectedTool(draft);
|
|
118
124
|
draft.tempData = null;
|
|
@@ -123,7 +129,10 @@ function applyAutoPhaseCorrectionFilter(draft) {
|
|
|
123
129
|
const { index } = activeSpectrum;
|
|
124
130
|
const { ph0, ph1 } = autoPhaseCorrection(draft.data[index]);
|
|
125
131
|
FiltersManager.applyFilter(draft.data[index], [
|
|
126
|
-
{
|
|
132
|
+
{
|
|
133
|
+
name: Filters.phaseCorrection.id,
|
|
134
|
+
options: { ph0, ph1, absolute: false },
|
|
135
|
+
},
|
|
127
136
|
]);
|
|
128
137
|
resetSelectedTool(draft);
|
|
129
138
|
draft.tempData = null;
|
|
@@ -205,7 +214,7 @@ function deleteSpectraFilter(draft, actions) {
|
|
|
205
214
|
for (const datum of draft.data) {
|
|
206
215
|
if (nucleusToString(datum?.info?.nucleus) === draft.view.spectra.activeTab) {
|
|
207
216
|
const filtersResult = datum.filters?.filter((filter) => filter.name === filterType) || [];
|
|
208
|
-
|
|
217
|
+
for (const filter of filtersResult) {
|
|
209
218
|
FiltersManager.deleteFilter(datum, filter.id);
|
|
210
219
|
if (datum.info?.dimension === 1) {
|
|
211
220
|
updateXShift(datum);
|
|
@@ -213,7 +222,7 @@ function deleteSpectraFilter(draft, actions) {
|
|
|
213
222
|
else if (datum.info?.dimension === 2) {
|
|
214
223
|
update2dShift(datum);
|
|
215
224
|
}
|
|
216
|
-
}
|
|
225
|
+
}
|
|
217
226
|
}
|
|
218
227
|
}
|
|
219
228
|
resetSelectedTool(draft);
|
|
@@ -261,7 +270,7 @@ function resetSpectrumByFilter(draft, options) {
|
|
|
261
270
|
let filters = [];
|
|
262
271
|
if (filterIndex !== -1) {
|
|
263
272
|
filters = datum.filters.slice(0, rollback ? filterIndex : filterIndex + 1);
|
|
264
|
-
if (filters.length
|
|
273
|
+
if (filters.length > 0) {
|
|
265
274
|
draft.toolOptions.data.activeFilterID =
|
|
266
275
|
datum.filters[rollback ? filterIndex - 1 : filterIndex]?.id;
|
|
267
276
|
}
|
|
@@ -2,10 +2,10 @@ import { setDomain, getDomain } from './DomainActions';
|
|
|
2
2
|
function handleHistoryUndo(draft) {
|
|
3
3
|
const { past, present, future } = draft.history;
|
|
4
4
|
const previous = past[past.length - 1];
|
|
5
|
-
const newPast = past.slice(0,
|
|
5
|
+
const newPast = past.slice(0, -1);
|
|
6
6
|
const newfuture = [present, ...future];
|
|
7
|
-
const hasRedo = newfuture.length
|
|
8
|
-
const hasUndo = past.length
|
|
7
|
+
const hasRedo = newfuture.length > 0;
|
|
8
|
+
const hasUndo = past.length > 0;
|
|
9
9
|
const domain = getDomain(draft.data);
|
|
10
10
|
const history = {
|
|
11
11
|
past: newPast,
|
|
@@ -20,13 +20,13 @@ function handleHistoryUndo(draft) {
|
|
|
20
20
|
draft.history = history;
|
|
21
21
|
}
|
|
22
22
|
function handleHistoryRedo(draft) {
|
|
23
|
-
const { history } = draft;
|
|
23
|
+
const { history, data } = draft;
|
|
24
24
|
const newPresent = history.future.shift();
|
|
25
25
|
history.past.push(history.present);
|
|
26
26
|
history.present = newPresent;
|
|
27
27
|
history.hasUndo = true;
|
|
28
28
|
history.hasRedo = history.future.length > 0;
|
|
29
|
-
setDomain(
|
|
29
|
+
setDomain(data);
|
|
30
30
|
}
|
|
31
31
|
function handleHistoryReset(draft, action) {
|
|
32
32
|
draft.history = {
|
|
@@ -3,11 +3,12 @@ import { original } from 'immer';
|
|
|
3
3
|
import { xyIntegration } from 'ml-spectra-processing';
|
|
4
4
|
import { updateIntegralsRelativeValues, changeIntegralsRelative, getShiftX, } from '../../../data/data1d/Spectrum1D';
|
|
5
5
|
import { initSumOptions, setSumOptions, } from '../../../data/data1d/Spectrum1D/SumManager';
|
|
6
|
+
import { getActiveSpectrum } from '../helper/getActiveSpectrum';
|
|
6
7
|
import getRange from '../helper/getRange';
|
|
7
8
|
import { setIntegralsYDomain } from './DomainActions';
|
|
8
9
|
function handleChangeIntegralSum(draft, options) {
|
|
9
10
|
const { data, view: { spectra: { activeTab: nucleus }, }, } = draft;
|
|
10
|
-
const activeSpectrum = draft
|
|
11
|
+
const activeSpectrum = getActiveSpectrum(draft);
|
|
11
12
|
if (activeSpectrum?.id) {
|
|
12
13
|
const { index } = activeSpectrum;
|
|
13
14
|
const datum = data[index];
|
|
@@ -18,7 +19,7 @@ function handleChangeIntegralSum(draft, options) {
|
|
|
18
19
|
function addIntegral(draft, action) {
|
|
19
20
|
const { startX, endX } = action;
|
|
20
21
|
const { data, molecules, view: { spectra: { activeTab: nucleus }, }, } = draft;
|
|
21
|
-
const activeSpectrum = draft
|
|
22
|
+
const activeSpectrum = getActiveSpectrum(draft);
|
|
22
23
|
const [from, to] = getRange(draft, { startX, endX });
|
|
23
24
|
if (activeSpectrum?.id) {
|
|
24
25
|
const datum = data[activeSpectrum.index];
|
|
@@ -43,7 +44,7 @@ function addIntegral(draft, action) {
|
|
|
43
44
|
}
|
|
44
45
|
}
|
|
45
46
|
function deleteIntegral(draft, action) {
|
|
46
|
-
const activeSpectrum = draft
|
|
47
|
+
const activeSpectrum = getActiveSpectrum(draft);
|
|
47
48
|
if (activeSpectrum) {
|
|
48
49
|
const state = original(draft);
|
|
49
50
|
const { index } = activeSpectrum;
|
|
@@ -60,7 +61,7 @@ function deleteIntegral(draft, action) {
|
|
|
60
61
|
}
|
|
61
62
|
}
|
|
62
63
|
function changeIntegral(draft, action) {
|
|
63
|
-
const activeSpectrum = draft
|
|
64
|
+
const activeSpectrum = getActiveSpectrum(draft);
|
|
64
65
|
const state = original(draft);
|
|
65
66
|
const integral = action.payload.data;
|
|
66
67
|
if (activeSpectrum?.id) {
|
|
@@ -81,7 +82,7 @@ function changeIntegral(draft, action) {
|
|
|
81
82
|
}
|
|
82
83
|
}
|
|
83
84
|
function handleChangeIntegralsRelativeValue(draft, action) {
|
|
84
|
-
const activeSpectrum = draft
|
|
85
|
+
const activeSpectrum = getActiveSpectrum(draft);
|
|
85
86
|
const data = action.payload.data;
|
|
86
87
|
if (activeSpectrum?.id) {
|
|
87
88
|
const { index } = activeSpectrum;
|
|
@@ -72,6 +72,18 @@ function setPreferences(draft, data) {
|
|
|
72
72
|
}
|
|
73
73
|
function initiate(draft, action) {
|
|
74
74
|
const state = getInitialState();
|
|
75
|
+
const { spectra, usedColors } = action.payload;
|
|
76
|
+
const newSpectra = [];
|
|
77
|
+
for (let spectrum of spectra) {
|
|
78
|
+
const { info } = spectrum;
|
|
79
|
+
if (info.dimension === 1) {
|
|
80
|
+
newSpectra.push(initiateDatum1D(spectrum, usedColors));
|
|
81
|
+
}
|
|
82
|
+
else if (info.dimension === 2) {
|
|
83
|
+
newSpectra.push(initiateDatum2D(spectrum, usedColors));
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
action.payload.spectra = newSpectra;
|
|
75
87
|
setData(state, action.payload);
|
|
76
88
|
const preferences = action.payload?.preferences || {};
|
|
77
89
|
setActiveTab(state, { tab: preferences?.activeTab || '' });
|
|
@@ -3,9 +3,10 @@ import { original } from 'immer';
|
|
|
3
3
|
import { xFindClosestIndex } from 'ml-spectra-processing';
|
|
4
4
|
import { getShiftX, lookupPeak, autoPeakPicking, optimizePeaks, } from '../../../data/data1d/Spectrum1D';
|
|
5
5
|
import { options } from '../../toolbar/ToolTypes';
|
|
6
|
+
import { getActiveSpectrum } from '../helper/getActiveSpectrum';
|
|
6
7
|
import getRange from '../helper/getRange';
|
|
7
8
|
function addPeak(draft, mouseCoordinates) {
|
|
8
|
-
const activeSpectrum = draft
|
|
9
|
+
const activeSpectrum = getActiveSpectrum(draft);
|
|
9
10
|
const state = original(draft);
|
|
10
11
|
if (activeSpectrum?.id && state) {
|
|
11
12
|
const { index } = activeSpectrum;
|
|
@@ -32,7 +33,7 @@ function addPeak(draft, mouseCoordinates) {
|
|
|
32
33
|
}
|
|
33
34
|
function addPeaks(draft, action) {
|
|
34
35
|
const state = original(draft);
|
|
35
|
-
const activeSpectrum = draft
|
|
36
|
+
const activeSpectrum = getActiveSpectrum(draft);
|
|
36
37
|
if (activeSpectrum) {
|
|
37
38
|
const { index } = activeSpectrum;
|
|
38
39
|
const datumOriginal = state.data[index];
|
|
@@ -55,7 +56,7 @@ function addPeaks(draft, action) {
|
|
|
55
56
|
}
|
|
56
57
|
}
|
|
57
58
|
function deletePeak(draft, peakData) {
|
|
58
|
-
const activeSpectrum = draft
|
|
59
|
+
const activeSpectrum = getActiveSpectrum(draft);
|
|
59
60
|
if (activeSpectrum) {
|
|
60
61
|
const { index } = activeSpectrum;
|
|
61
62
|
const state = original(draft);
|
|
@@ -70,7 +71,7 @@ function deletePeak(draft, peakData) {
|
|
|
70
71
|
}
|
|
71
72
|
function handleOptimizePeaks(draft, action) {
|
|
72
73
|
const { peaks } = action.payload;
|
|
73
|
-
const activeSpectrum = draft
|
|
74
|
+
const activeSpectrum = getActiveSpectrum(draft);
|
|
74
75
|
if (activeSpectrum?.id) {
|
|
75
76
|
const { index } = activeSpectrum;
|
|
76
77
|
const datum = draft.data[index];
|
|
@@ -84,7 +85,7 @@ function handleOptimizePeaks(draft, action) {
|
|
|
84
85
|
}
|
|
85
86
|
}
|
|
86
87
|
function handleAutoPeakPicking(draft, autOptions) {
|
|
87
|
-
const activeSpectrum = draft
|
|
88
|
+
const activeSpectrum = getActiveSpectrum(draft);
|
|
88
89
|
if (activeSpectrum?.id) {
|
|
89
90
|
draft.toolOptions.selectedTool = options.zoom.id;
|
|
90
91
|
draft.toolOptions.selectedOptionPanel = null;
|
|
@@ -103,7 +104,7 @@ function handleAutoPeakPicking(draft, autOptions) {
|
|
|
103
104
|
}
|
|
104
105
|
function changePeakShapeHandler(draft, action) {
|
|
105
106
|
const { shape, id } = action.payload;
|
|
106
|
-
const activeSpectrum = draft
|
|
107
|
+
const activeSpectrum = getActiveSpectrum(draft);
|
|
107
108
|
if (activeSpectrum?.id) {
|
|
108
109
|
const { index } = activeSpectrum;
|
|
109
110
|
const datum = draft.data[index];
|