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
|
@@ -9,9 +9,10 @@ const immer_1 = require("immer");
|
|
|
9
9
|
const ml_spectra_processing_1 = require("ml-spectra-processing");
|
|
10
10
|
const Spectrum1D_1 = require("../../../data/data1d/Spectrum1D");
|
|
11
11
|
const ToolTypes_1 = require("../../toolbar/ToolTypes");
|
|
12
|
+
const getActiveSpectrum_1 = require("../helper/getActiveSpectrum");
|
|
12
13
|
const getRange_1 = __importDefault(require("../helper/getRange"));
|
|
13
14
|
function addPeak(draft, mouseCoordinates) {
|
|
14
|
-
const activeSpectrum =
|
|
15
|
+
const activeSpectrum = (0, getActiveSpectrum_1.getActiveSpectrum)(draft);
|
|
15
16
|
const state = (0, immer_1.original)(draft);
|
|
16
17
|
if (activeSpectrum?.id && state) {
|
|
17
18
|
const { index } = activeSpectrum;
|
|
@@ -39,7 +40,7 @@ function addPeak(draft, mouseCoordinates) {
|
|
|
39
40
|
exports.addPeak = addPeak;
|
|
40
41
|
function addPeaks(draft, action) {
|
|
41
42
|
const state = (0, immer_1.original)(draft);
|
|
42
|
-
const activeSpectrum =
|
|
43
|
+
const activeSpectrum = (0, getActiveSpectrum_1.getActiveSpectrum)(draft);
|
|
43
44
|
if (activeSpectrum) {
|
|
44
45
|
const { index } = activeSpectrum;
|
|
45
46
|
const datumOriginal = state.data[index];
|
|
@@ -63,7 +64,7 @@ function addPeaks(draft, action) {
|
|
|
63
64
|
}
|
|
64
65
|
exports.addPeaks = addPeaks;
|
|
65
66
|
function deletePeak(draft, peakData) {
|
|
66
|
-
const activeSpectrum =
|
|
67
|
+
const activeSpectrum = (0, getActiveSpectrum_1.getActiveSpectrum)(draft);
|
|
67
68
|
if (activeSpectrum) {
|
|
68
69
|
const { index } = activeSpectrum;
|
|
69
70
|
const state = (0, immer_1.original)(draft);
|
|
@@ -79,7 +80,7 @@ function deletePeak(draft, peakData) {
|
|
|
79
80
|
exports.deletePeak = deletePeak;
|
|
80
81
|
function handleOptimizePeaks(draft, action) {
|
|
81
82
|
const { peaks } = action.payload;
|
|
82
|
-
const activeSpectrum =
|
|
83
|
+
const activeSpectrum = (0, getActiveSpectrum_1.getActiveSpectrum)(draft);
|
|
83
84
|
if (activeSpectrum?.id) {
|
|
84
85
|
const { index } = activeSpectrum;
|
|
85
86
|
const datum = draft.data[index];
|
|
@@ -94,7 +95,7 @@ function handleOptimizePeaks(draft, action) {
|
|
|
94
95
|
}
|
|
95
96
|
exports.handleOptimizePeaks = handleOptimizePeaks;
|
|
96
97
|
function handleAutoPeakPicking(draft, autOptions) {
|
|
97
|
-
const activeSpectrum =
|
|
98
|
+
const activeSpectrum = (0, getActiveSpectrum_1.getActiveSpectrum)(draft);
|
|
98
99
|
if (activeSpectrum?.id) {
|
|
99
100
|
draft.toolOptions.selectedTool = ToolTypes_1.options.zoom.id;
|
|
100
101
|
draft.toolOptions.selectedOptionPanel = null;
|
|
@@ -114,7 +115,7 @@ function handleAutoPeakPicking(draft, autOptions) {
|
|
|
114
115
|
exports.handleAutoPeakPicking = handleAutoPeakPicking;
|
|
115
116
|
function changePeakShapeHandler(draft, action) {
|
|
116
117
|
const { shape, id } = action.payload;
|
|
117
|
-
const activeSpectrum =
|
|
118
|
+
const activeSpectrum = (0, getActiveSpectrum_1.getActiveSpectrum)(draft);
|
|
118
119
|
if (activeSpectrum?.id) {
|
|
119
120
|
const { index } = activeSpectrum;
|
|
120
121
|
const datum = draft.data[index];
|
|
@@ -4,10 +4,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.applyKeyPreferencesHandler = exports.setKeyPreferencesHandler = exports.changeSpectrumVerticalAlignment = void 0;
|
|
7
|
-
const cloneDeep_1 = __importDefault(require("lodash/cloneDeep"));
|
|
8
7
|
const GroupByInfoKey_1 = __importDefault(require("../../utility/GroupByInfoKey"));
|
|
9
8
|
const nucleusToString_1 = __importDefault(require("../../utility/nucleusToString"));
|
|
10
9
|
const Constants_1 = require("../core/Constants");
|
|
10
|
+
const getActiveSpectrum_1 = require("../helper/getActiveSpectrum");
|
|
11
11
|
const DomainActions_1 = require("./DomainActions");
|
|
12
12
|
function changeSpectrumVerticalAlignment(draft, options) {
|
|
13
13
|
function stack(spectra = []) {
|
|
@@ -60,18 +60,14 @@ function changeSpectrumVerticalAlignment(draft, options) {
|
|
|
60
60
|
}
|
|
61
61
|
exports.changeSpectrumVerticalAlignment = changeSpectrumVerticalAlignment;
|
|
62
62
|
function setKeyPreferencesHandler(draft, keyCode) {
|
|
63
|
-
const { data, zoom, xDomain, xDomains, yDomain, yDomains, originDomain, margin, displayerMode, view, } = draft;
|
|
64
|
-
const
|
|
65
|
-
|
|
63
|
+
const { data, zoom, xDomain, xDomains, yDomain, yDomains, originDomain, margin, displayerMode, view, keysPreferences, } = draft;
|
|
64
|
+
const { spectra: { activeTab }, } = view;
|
|
65
|
+
const activeSpectrum = (0, getActiveSpectrum_1.getActiveSpectrum)(draft);
|
|
66
|
+
if (activeTab) {
|
|
66
67
|
const groupByNucleus = (0, GroupByInfoKey_1.default)('nucleus');
|
|
67
68
|
const spectrumsGroupsList = groupByNucleus(data);
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
acc[datum.id] = datum.processingController.getLevel();
|
|
71
|
-
return acc;
|
|
72
|
-
}, {})
|
|
73
|
-
: null;
|
|
74
|
-
draft.keysPreferences[keyCode] = {
|
|
69
|
+
const spectra = spectrumsGroupsList[activeTab];
|
|
70
|
+
keysPreferences[keyCode] = {
|
|
75
71
|
activeSpectrum,
|
|
76
72
|
displayerMode,
|
|
77
73
|
view,
|
|
@@ -81,30 +77,26 @@ function setKeyPreferencesHandler(draft, keyCode) {
|
|
|
81
77
|
yDomain,
|
|
82
78
|
yDomains,
|
|
83
79
|
originDomain,
|
|
84
|
-
level,
|
|
85
80
|
margin,
|
|
86
|
-
data:
|
|
87
|
-
acc[datum.id] = {
|
|
88
|
-
display: {
|
|
89
|
-
color: datum.display.color,
|
|
90
|
-
isVisible: datum.display.isVisible,
|
|
91
|
-
isPeaksMarkersVisible: datum.display.isPeaksMarkersVisible,
|
|
92
|
-
},
|
|
93
|
-
};
|
|
94
|
-
return acc;
|
|
95
|
-
}, {}),
|
|
81
|
+
data: spectra,
|
|
96
82
|
};
|
|
97
83
|
}
|
|
98
84
|
}
|
|
99
85
|
exports.setKeyPreferencesHandler = setKeyPreferencesHandler;
|
|
86
|
+
function setSpectraDisplayPreferences(draft, preferences) {
|
|
87
|
+
for (const [index, datum] of draft.data.entries()) {
|
|
88
|
+
if ((0, nucleusToString_1.default)(datum.info.nucleus) === preferences.activeTab) {
|
|
89
|
+
draft.data[index].display = {
|
|
90
|
+
...datum.display,
|
|
91
|
+
...preferences.data[datum.id].display,
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
100
96
|
function applyKeyPreferencesHandler(draft, keyCode) {
|
|
101
97
|
const preferences = draft.keysPreferences[keyCode];
|
|
102
98
|
if (preferences) {
|
|
103
|
-
draft
|
|
104
|
-
if ((0, nucleusToString_1.default)(datum.info.nucleus) === preferences.activeTab) {
|
|
105
|
-
draft.data[index].display = Object.assign((0, cloneDeep_1.default)(datum.display), preferences.data[datum.id].display);
|
|
106
|
-
}
|
|
107
|
-
});
|
|
99
|
+
setSpectraDisplayPreferences(draft, preferences);
|
|
108
100
|
draft.view = preferences.view;
|
|
109
101
|
draft.displayerMode = preferences.displayerMode;
|
|
110
102
|
draft.margin = preferences.margin;
|
|
@@ -114,17 +106,7 @@ function applyKeyPreferencesHandler(draft, keyCode) {
|
|
|
114
106
|
draft.yDomain = preferences.yDomain;
|
|
115
107
|
draft.originDomain = preferences.originDomain;
|
|
116
108
|
draft.yDomains = preferences.yDomains;
|
|
117
|
-
if (draft.displayerMode
|
|
118
|
-
for (const datumID of Object.keys(preferences.level)) {
|
|
119
|
-
const { levelPositive, levelNegative } = preferences.level[datumID];
|
|
120
|
-
const index = draft.data.findIndex((datum) => datum.id === datumID);
|
|
121
|
-
const processController = draft.data[index]
|
|
122
|
-
.processingController;
|
|
123
|
-
processController.setLevel(levelPositive, levelNegative);
|
|
124
|
-
draft.contours[datumID] = processController.drawContours();
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
else {
|
|
109
|
+
if (draft.displayerMode !== Constants_1.DISPLAYER_MODE.DM_2D) {
|
|
128
110
|
draft.zoom = preferences.zoom;
|
|
129
111
|
}
|
|
130
112
|
}
|
|
@@ -38,20 +38,21 @@ const Spectrum1D_1 = require("../../../data/data1d/Spectrum1D");
|
|
|
38
38
|
const SumManager_1 = require("../../../data/data1d/Spectrum1D/SumManager");
|
|
39
39
|
const RangeUtilities_1 = require("../../../data/utilities/RangeUtilities");
|
|
40
40
|
const Reducer_1 = require("../Reducer");
|
|
41
|
+
const getActiveSpectrum_1 = require("../helper/getActiveSpectrum");
|
|
41
42
|
const getRange_1 = __importDefault(require("../helper/getRange"));
|
|
42
43
|
const CorrelationsActions_1 = require("./CorrelationsActions");
|
|
43
44
|
const DomainActions_1 = require("./DomainActions");
|
|
44
45
|
const ToolsActions_1 = require("./ToolsActions");
|
|
45
46
|
function handleAutoRangesDetection(draft, options) {
|
|
46
|
-
const { data, xDomain, molecules, view: { spectra: { activeTab: nucleus }, }, } = draft;
|
|
47
|
-
const activeSpectrum =
|
|
47
|
+
const { data, xDomain, molecules, view: { spectra: { activeTab: nucleus }, ranges, }, } = draft;
|
|
48
|
+
const activeSpectrum = (0, getActiveSpectrum_1.getActiveSpectrum)(draft);
|
|
48
49
|
if (activeSpectrum?.id) {
|
|
49
50
|
const { index, id } = activeSpectrum;
|
|
50
51
|
const datum = data[index];
|
|
51
52
|
// add range intial state
|
|
52
|
-
const range =
|
|
53
|
+
const range = ranges.find((r) => r.spectrumID === id);
|
|
53
54
|
if (!range) {
|
|
54
|
-
|
|
55
|
+
ranges.push({
|
|
55
56
|
spectrumID: id,
|
|
56
57
|
...Reducer_1.rangeStateInit,
|
|
57
58
|
});
|
|
@@ -103,7 +104,7 @@ function getRangeIndex(draft, spectrumIndex, rangeID) {
|
|
|
103
104
|
return draft.data[spectrumIndex].ranges.values.findIndex((range) => range.id === rangeID);
|
|
104
105
|
}
|
|
105
106
|
function handleDeleteRange(draft, action) {
|
|
106
|
-
const activeSpectrum =
|
|
107
|
+
const activeSpectrum = (0, getActiveSpectrum_1.getActiveSpectrum)(draft);
|
|
107
108
|
if (activeSpectrum?.id) {
|
|
108
109
|
const { index } = activeSpectrum;
|
|
109
110
|
const { data, resetSelectTool = false } = action.payload;
|
|
@@ -128,7 +129,7 @@ function handleDeleteRange(draft, action) {
|
|
|
128
129
|
exports.handleDeleteRange = handleDeleteRange;
|
|
129
130
|
function handleChangeRangeSignalKind(draft, action) {
|
|
130
131
|
const state = (0, immer_1.original)(draft);
|
|
131
|
-
const activeSpectrum =
|
|
132
|
+
const activeSpectrum = (0, getActiveSpectrum_1.getActiveSpectrum)(state);
|
|
132
133
|
if (activeSpectrum?.id) {
|
|
133
134
|
const { index } = activeSpectrum;
|
|
134
135
|
const { rowData, value } = action.payload.data;
|
|
@@ -147,7 +148,7 @@ function handleChangeRangeSignalKind(draft, action) {
|
|
|
147
148
|
exports.handleChangeRangeSignalKind = handleChangeRangeSignalKind;
|
|
148
149
|
function handleSaveEditedRange(draft, action) {
|
|
149
150
|
const state = (0, immer_1.original)(draft);
|
|
150
|
-
const activeSpectrum =
|
|
151
|
+
const activeSpectrum = (0, getActiveSpectrum_1.getActiveSpectrum)(state);
|
|
151
152
|
if (activeSpectrum?.id) {
|
|
152
153
|
const { index } = activeSpectrum;
|
|
153
154
|
const { editedRowData, assignmentData } = action.payload;
|
|
@@ -192,7 +193,7 @@ function handleDeleteSignal(draft, action) {
|
|
|
192
193
|
}
|
|
193
194
|
exports.handleDeleteSignal = handleDeleteSignal;
|
|
194
195
|
function handleUnlinkRange(draft, action) {
|
|
195
|
-
const activeSpectrum =
|
|
196
|
+
const activeSpectrum = (0, getActiveSpectrum_1.getActiveSpectrum)(draft);
|
|
196
197
|
if (activeSpectrum?.id) {
|
|
197
198
|
const { index } = activeSpectrum;
|
|
198
199
|
const { assignmentData, rangeData = null, signalIndex = -1, } = action.payload;
|
|
@@ -228,7 +229,7 @@ function handleUnlinkRange(draft, action) {
|
|
|
228
229
|
}
|
|
229
230
|
exports.handleUnlinkRange = handleUnlinkRange;
|
|
230
231
|
function handleSetDiaIDRange(draft, action) {
|
|
231
|
-
const activeSpectrum =
|
|
232
|
+
const activeSpectrum = (0, getActiveSpectrum_1.getActiveSpectrum)(draft);
|
|
232
233
|
if (activeSpectrum?.id) {
|
|
233
234
|
const { index } = activeSpectrum;
|
|
234
235
|
const { rangeData, diaIDs, signalIndex, nbAtoms } = action.payload;
|
|
@@ -248,7 +249,7 @@ function handleSetDiaIDRange(draft, action) {
|
|
|
248
249
|
}
|
|
249
250
|
exports.handleSetDiaIDRange = handleSetDiaIDRange;
|
|
250
251
|
function handleResizeRange(draft, action) {
|
|
251
|
-
const activeSpectrum =
|
|
252
|
+
const activeSpectrum = (0, getActiveSpectrum_1.getActiveSpectrum)(draft);
|
|
252
253
|
if (activeSpectrum?.id) {
|
|
253
254
|
const { index } = activeSpectrum;
|
|
254
255
|
(0, Spectrum1D_1.changeRange)(draft.data[index], action.data);
|
|
@@ -257,7 +258,7 @@ function handleResizeRange(draft, action) {
|
|
|
257
258
|
exports.handleResizeRange = handleResizeRange;
|
|
258
259
|
function handleChangeRangeSum(draft, options) {
|
|
259
260
|
const { data, view: { spectra: { activeTab: nucleus }, }, } = draft;
|
|
260
|
-
const activeSpectrum =
|
|
261
|
+
const activeSpectrum = (0, getActiveSpectrum_1.getActiveSpectrum)(draft);
|
|
261
262
|
if (activeSpectrum?.id) {
|
|
262
263
|
const { index } = activeSpectrum;
|
|
263
264
|
const datum = data[index];
|
|
@@ -269,20 +270,20 @@ exports.handleChangeRangeSum = handleChangeRangeSum;
|
|
|
269
270
|
function addNewRange(draft, props) {
|
|
270
271
|
const { startX, endX, id } = props;
|
|
271
272
|
const range = (0, getRange_1.default)(draft, { startX, endX });
|
|
272
|
-
const { view: { spectra: { activeTab: nucleus }, }, molecules, } = draft;
|
|
273
|
-
const activeSpectrum =
|
|
273
|
+
const { data, view: { spectra: { activeTab: nucleus }, ranges, }, molecules, } = draft;
|
|
274
|
+
const activeSpectrum = (0, getActiveSpectrum_1.getActiveSpectrum)(draft);
|
|
274
275
|
if (activeSpectrum?.id) {
|
|
275
276
|
const { index } = activeSpectrum;
|
|
276
277
|
const [from, to] = range;
|
|
277
278
|
// add range intial state
|
|
278
|
-
const rangeState =
|
|
279
|
+
const rangeState = ranges.find((r) => r.spectrumID === activeSpectrum.id);
|
|
279
280
|
if (!rangeState) {
|
|
280
|
-
|
|
281
|
+
ranges.push({
|
|
281
282
|
spectrumID: activeSpectrum.id,
|
|
282
283
|
...Reducer_1.rangeStateInit,
|
|
283
284
|
});
|
|
284
285
|
}
|
|
285
|
-
(0, Spectrum1D_1.addRange)(
|
|
286
|
+
(0, Spectrum1D_1.addRange)(data[index], {
|
|
286
287
|
from,
|
|
287
288
|
to,
|
|
288
289
|
id,
|
|
@@ -290,7 +291,7 @@ function addNewRange(draft, props) {
|
|
|
290
291
|
molecules,
|
|
291
292
|
});
|
|
292
293
|
handleOnChangeRangesData(draft);
|
|
293
|
-
(0, DomainActions_1.setIntegralsYDomain)(draft,
|
|
294
|
+
(0, DomainActions_1.setIntegralsYDomain)(draft, data[index]);
|
|
294
295
|
}
|
|
295
296
|
}
|
|
296
297
|
function handleAddRange(draft, action) {
|
|
@@ -308,16 +309,18 @@ function handleAddRange(draft, action) {
|
|
|
308
309
|
exports.handleAddRange = handleAddRange;
|
|
309
310
|
function handleChangeRangeRelativeValue(draft, action) {
|
|
310
311
|
const data = action.payload.data;
|
|
311
|
-
|
|
312
|
-
|
|
312
|
+
const activeSpectrum = (0, getActiveSpectrum_1.getActiveSpectrum)(draft);
|
|
313
|
+
if (activeSpectrum?.id) {
|
|
314
|
+
const { index } = activeSpectrum;
|
|
313
315
|
(0, Spectrum1D_1.changeRangeRelativeValue)(draft.data[index], data);
|
|
314
316
|
}
|
|
315
317
|
}
|
|
316
318
|
exports.handleChangeRangeRelativeValue = handleChangeRangeRelativeValue;
|
|
317
319
|
function handleChangeRangeSignalValue(draft, action) {
|
|
318
320
|
const { rangeID, signalID, value } = action.payload;
|
|
319
|
-
|
|
320
|
-
|
|
321
|
+
const activeSpectrum = (0, getActiveSpectrum_1.getActiveSpectrum)(draft);
|
|
322
|
+
if (activeSpectrum?.id) {
|
|
323
|
+
const { index } = activeSpectrum;
|
|
321
324
|
const shift = (0, Spectrum1D_1.changeRangeSignal)(draft.data[index], {
|
|
322
325
|
rangeID,
|
|
323
326
|
signalID,
|
|
@@ -337,15 +340,16 @@ function handleOnChangeRangesData(draft) {
|
|
|
337
340
|
}
|
|
338
341
|
function handleChangeRangesSumFlag(draft, action) {
|
|
339
342
|
const flag = action.payload;
|
|
340
|
-
|
|
341
|
-
|
|
343
|
+
const activeSpectrum = (0, getActiveSpectrum_1.getActiveSpectrum)(draft);
|
|
344
|
+
if (activeSpectrum?.id) {
|
|
345
|
+
const { index } = activeSpectrum;
|
|
342
346
|
draft.data[index].ranges.options.isSumConstant = !flag;
|
|
343
347
|
}
|
|
344
348
|
}
|
|
345
349
|
exports.handleChangeRangesSumFlag = handleChangeRangesSumFlag;
|
|
346
350
|
function handleUpdateRange(draft, action) {
|
|
347
351
|
const { range, resetSelectTool = false } = action.payload;
|
|
348
|
-
const activeSpectrum =
|
|
352
|
+
const activeSpectrum = (0, getActiveSpectrum_1.getActiveSpectrum)(draft);
|
|
349
353
|
if (activeSpectrum?.id && range.id) {
|
|
350
354
|
const datum = draft.data[activeSpectrum?.index];
|
|
351
355
|
const index = datum.ranges.values.findIndex((_range) => _range.id === range.id);
|
|
@@ -32,9 +32,11 @@ const Filters = __importStar(require("../../../data/Filters"));
|
|
|
32
32
|
const FiltersManager_1 = require("../../../data/FiltersManager");
|
|
33
33
|
const Spectrum1D_1 = require("../../../data/data1d/Spectrum1D");
|
|
34
34
|
const Spectrum2D_1 = require("../../../data/data2d/Spectrum2D");
|
|
35
|
+
const contours_1 = require("../../../data/data2d/Spectrum2D/contours");
|
|
35
36
|
const ToolTypes_1 = require("../../toolbar/ToolTypes");
|
|
36
37
|
const GroupByInfoKey_1 = __importDefault(require("../../utility/GroupByInfoKey"));
|
|
37
38
|
const Zoom1DManager_1 = require("../helper/Zoom1DManager");
|
|
39
|
+
const getActiveSpectrum_1 = require("../helper/getActiveSpectrum");
|
|
38
40
|
const DomainActions_1 = require("./DomainActions");
|
|
39
41
|
const FiltersActions_1 = require("./FiltersActions");
|
|
40
42
|
const ToolsActions_1 = require("./ToolsActions");
|
|
@@ -96,7 +98,7 @@ function handleChangePeaksMarkersVisibility(draft, data) {
|
|
|
96
98
|
exports.handleChangePeaksMarkersVisibility = handleChangePeaksMarkersVisibility;
|
|
97
99
|
function handleChangeActiveSpectrum(draft, activeSpectrum) {
|
|
98
100
|
let refreshDomain = false;
|
|
99
|
-
const currentActiveSpectrum =
|
|
101
|
+
const currentActiveSpectrum = (0, getActiveSpectrum_1.getActiveSpectrum)(draft);
|
|
100
102
|
if (activeSpectrum) {
|
|
101
103
|
const newIndex = draft.data.findIndex((d) => d.id === activeSpectrum.id);
|
|
102
104
|
const oldIndex = draft.data.findIndex((d) => d.id === currentActiveSpectrum?.id);
|
|
@@ -146,10 +148,15 @@ function handleChangeActiveSpectrum(draft, activeSpectrum) {
|
|
|
146
148
|
}
|
|
147
149
|
exports.handleChangeActiveSpectrum = handleChangeActiveSpectrum;
|
|
148
150
|
function changeSpectrumSetting(draft, { id, display }) {
|
|
149
|
-
const
|
|
150
|
-
const index = state.data.findIndex((d) => d.id === id);
|
|
151
|
+
const index = draft.data.findIndex((d) => d.id === id);
|
|
151
152
|
if (index !== -1) {
|
|
152
|
-
draft.data[index]
|
|
153
|
+
const spectrum = draft.data[index];
|
|
154
|
+
spectrum.display = display;
|
|
155
|
+
if ((0, Spectrum2D_1.isSpectrum2D)(spectrum)) {
|
|
156
|
+
const contoursLevels = draft.view.zoom.levels;
|
|
157
|
+
const { checkLevel } = (0, contours_1.contoursManager)(spectrum.id, contoursLevels, spectrum.display.contourOptions);
|
|
158
|
+
contoursLevels[spectrum.id] = checkLevel();
|
|
159
|
+
}
|
|
153
160
|
}
|
|
154
161
|
}
|
|
155
162
|
exports.changeSpectrumSetting = changeSpectrumSetting;
|
|
@@ -179,7 +186,7 @@ exports.handleDeleteSpectra = handleDeleteSpectra;
|
|
|
179
186
|
function addMissingProjectionHandler(draft, action) {
|
|
180
187
|
const state = (0, immer_1.original)(draft);
|
|
181
188
|
const { nucleus } = action;
|
|
182
|
-
const activeSpectrum =
|
|
189
|
+
const activeSpectrum = (0, getActiveSpectrum_1.getActiveSpectrum)(draft);
|
|
183
190
|
if (activeSpectrum?.id) {
|
|
184
191
|
const { index } = activeSpectrum;
|
|
185
192
|
for (let n of nucleus) {
|
|
@@ -7,6 +7,7 @@ exports.resetSpectraScale = exports.setSpectraSameTopHandler = exports.setTab =
|
|
|
7
7
|
const uuid_1 = require("@lukeed/uuid");
|
|
8
8
|
const immer_1 = require("immer");
|
|
9
9
|
const ml_spectra_processing_1 = require("ml-spectra-processing");
|
|
10
|
+
const contours_1 = require("../../../data/data2d/Spectrum2D/contours");
|
|
10
11
|
const scale_1 = require("../../1d/utilities/scale");
|
|
11
12
|
const DimensionLayout_1 = require("../../2d/utilities/DimensionLayout");
|
|
12
13
|
const scale_2 = require("../../2d/utilities/scale");
|
|
@@ -16,7 +17,9 @@ const Reducer_1 = require("../Reducer");
|
|
|
16
17
|
const Constants_1 = require("../core/Constants");
|
|
17
18
|
const Zoom1DManager_1 = require("../helper/Zoom1DManager");
|
|
18
19
|
const ZoomHistoryManager_1 = __importDefault(require("../helper/ZoomHistoryManager"));
|
|
20
|
+
const getActiveSpectrum_1 = require("../helper/getActiveSpectrum");
|
|
19
21
|
const getActiveSpectrumOrFail_1 = require("../helper/getActiveSpectrumOrFail");
|
|
22
|
+
const getSpectrum_1 = require("../helper/getSpectrum");
|
|
20
23
|
const DomainActions_1 = require("./DomainActions");
|
|
21
24
|
const FiltersActions_1 = require("./FiltersActions");
|
|
22
25
|
const PreferencesActions_1 = require("./PreferencesActions");
|
|
@@ -125,10 +128,11 @@ function handleDeleteBaseLineZone(draft, id) {
|
|
|
125
128
|
}
|
|
126
129
|
exports.handleDeleteBaseLineZone = handleDeleteBaseLineZone;
|
|
127
130
|
function handleToggleRealImaginaryVisibility(draft) {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
131
|
+
const activeSpectrum = (0, getActiveSpectrum_1.getActiveSpectrum)(draft);
|
|
132
|
+
if (activeSpectrum != null) {
|
|
133
|
+
const { index } = activeSpectrum;
|
|
134
|
+
const datum = draft.data[index];
|
|
135
|
+
datum.display.isRealSpectrumVisible = !datum.display.isRealSpectrumVisible;
|
|
132
136
|
(0, DomainActions_1.setDomain)(draft);
|
|
133
137
|
}
|
|
134
138
|
}
|
|
@@ -172,7 +176,7 @@ function handleBrushEnd(draft, action) {
|
|
|
172
176
|
}
|
|
173
177
|
exports.handleBrushEnd = handleBrushEnd;
|
|
174
178
|
function setVerticalIndicatorXPosition(draft, position) {
|
|
175
|
-
const activeSpectrum =
|
|
179
|
+
const activeSpectrum = (0, getActiveSpectrum_1.getActiveSpectrum)(draft);
|
|
176
180
|
if (activeSpectrum?.id) {
|
|
177
181
|
const scaleX = (0, scale_1.getXScale)(draft);
|
|
178
182
|
const value = scaleX.invert(position);
|
|
@@ -188,8 +192,8 @@ function getSpectrumID(draft, index) {
|
|
|
188
192
|
}
|
|
189
193
|
function handleZoom(draft, action) {
|
|
190
194
|
const { event, trackID, selectedTool } = action;
|
|
191
|
-
const { view: { ranges: rangeState }, displayerMode, } = draft;
|
|
192
|
-
const activeSpectrum =
|
|
195
|
+
const { view: { ranges: rangeState }, displayerMode, yDomains, integralsYDomains, } = draft;
|
|
196
|
+
const activeSpectrum = (0, getActiveSpectrum_1.getActiveSpectrum)(draft);
|
|
193
197
|
const { showRangesIntegrals } = rangeState.find((r) => r.spectrumID === activeSpectrum?.id) ||
|
|
194
198
|
Reducer_1.rangeStateInit;
|
|
195
199
|
if (displayerMode === Constants_1.DISPLAYER_MODE.DM_2D) {
|
|
@@ -197,26 +201,26 @@ function handleZoom(draft, action) {
|
|
|
197
201
|
if (index !== null) {
|
|
198
202
|
const id = getSpectrumID(draft, index);
|
|
199
203
|
if (id) {
|
|
200
|
-
const domain =
|
|
201
|
-
|
|
204
|
+
const domain = yDomains[id];
|
|
205
|
+
yDomains[id] = (0, Zoom1DManager_1.wheelZoom)(event, domain);
|
|
202
206
|
}
|
|
203
207
|
}
|
|
204
208
|
}
|
|
205
209
|
else if (activeSpectrum?.id) {
|
|
206
210
|
if ((showRangesIntegrals || selectedTool === ToolTypes_1.options.integral.id) &&
|
|
207
211
|
event.shiftKey) {
|
|
208
|
-
const domain =
|
|
209
|
-
|
|
212
|
+
const domain = integralsYDomains[activeSpectrum?.id];
|
|
213
|
+
integralsYDomains[activeSpectrum?.id] = (0, Zoom1DManager_1.wheelZoom)(event, domain);
|
|
210
214
|
}
|
|
211
215
|
else {
|
|
212
|
-
const domain =
|
|
213
|
-
|
|
216
|
+
const domain = yDomains[activeSpectrum?.id];
|
|
217
|
+
yDomains[activeSpectrum?.id] = (0, Zoom1DManager_1.wheelZoom)(event, domain);
|
|
214
218
|
}
|
|
215
219
|
}
|
|
216
220
|
else {
|
|
217
|
-
for (const key of Object.keys(
|
|
218
|
-
const domain =
|
|
219
|
-
|
|
221
|
+
for (const key of Object.keys(yDomains)) {
|
|
222
|
+
const domain = yDomains[key];
|
|
223
|
+
yDomains[key] = (0, Zoom1DManager_1.wheelZoom)(event, domain);
|
|
220
224
|
}
|
|
221
225
|
}
|
|
222
226
|
}
|
|
@@ -291,15 +295,6 @@ function setMargin(draft) {
|
|
|
291
295
|
draft.margin = Constants_1.MARGIN['1D'];
|
|
292
296
|
}
|
|
293
297
|
}
|
|
294
|
-
function processing2DData(draft, data) {
|
|
295
|
-
if (draft.displayerMode === Constants_1.DISPLAYER_MODE.DM_2D) {
|
|
296
|
-
let _data = {};
|
|
297
|
-
for (const datum of data[draft.view.spectra.activeTab]) {
|
|
298
|
-
_data[datum.id] = datum.processingController.drawContours();
|
|
299
|
-
}
|
|
300
|
-
draft.contours = _data;
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
298
|
function setDisplayerMode(draft, data) {
|
|
304
299
|
draft.displayerMode =
|
|
305
300
|
data && data.some((d) => d.info.dimension === 2)
|
|
@@ -371,7 +366,6 @@ function setActiveTab(draft, options) {
|
|
|
371
366
|
const currentTab = !tab || !tabs.includes(tab || '') ? tabs[0] : tab;
|
|
372
367
|
setTab(draft, dataGroupByNucleus, currentTab, refreshActiveTab);
|
|
373
368
|
resetTool(draft);
|
|
374
|
-
processing2DData(draft, dataGroupByNucleus);
|
|
375
369
|
(0, DomainActions_1.setDomain)(draft, domainOptions);
|
|
376
370
|
(0, DomainActions_1.setIntegralsYDomain)(draft, dataGroupByNucleus[currentTab]);
|
|
377
371
|
const zoomHistory = (0, ZoomHistoryManager_1.default)(draft.zoom.history, draft.view.spectra.activeTab);
|
|
@@ -390,25 +384,18 @@ function handelSetActiveTab(draft, tab) {
|
|
|
390
384
|
}
|
|
391
385
|
exports.handelSetActiveTab = handelSetActiveTab;
|
|
392
386
|
function levelChangeHandler(draft, { deltaY, shiftKey }) {
|
|
393
|
-
const activeSpectrum =
|
|
387
|
+
const activeSpectrum = (0, getSpectrum_1.getSpectrum)(draft);
|
|
394
388
|
try {
|
|
395
389
|
if (activeSpectrum?.id) {
|
|
396
|
-
const {
|
|
397
|
-
const
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
processingController.shiftWheel(deltaY);
|
|
401
|
-
}
|
|
402
|
-
else {
|
|
403
|
-
processingController.wheel(deltaY);
|
|
404
|
-
}
|
|
405
|
-
const contours = Object.freeze(processingController.drawContours());
|
|
406
|
-
draft.contours[id] = contours;
|
|
390
|
+
const { levels } = draft.view.zoom;
|
|
391
|
+
const contourOptions = activeSpectrum.display.contourOptions;
|
|
392
|
+
const zoom = (0, contours_1.contoursManager)(activeSpectrum.id, levels, contourOptions);
|
|
393
|
+
levels[activeSpectrum.id] = zoom.wheel(deltaY, shiftKey);
|
|
407
394
|
}
|
|
408
395
|
}
|
|
409
|
-
catch (
|
|
410
|
-
//
|
|
411
|
-
|
|
396
|
+
catch (error) {
|
|
397
|
+
// TODO: handle error.
|
|
398
|
+
reportError(error);
|
|
412
399
|
}
|
|
413
400
|
}
|
|
414
401
|
exports.levelChangeHandler = levelChangeHandler;
|
|
@@ -37,6 +37,7 @@ const Spectrum2D_1 = require("../../../data/data2d/Spectrum2D");
|
|
|
37
37
|
const ZoneUtilities_1 = require("../../../data/utilities/ZoneUtilities");
|
|
38
38
|
const Reducer_1 = require("../Reducer");
|
|
39
39
|
const get2DRange_1 = __importDefault(require("../helper/get2DRange"));
|
|
40
|
+
const getActiveSpectrum_1 = require("../helper/getActiveSpectrum");
|
|
40
41
|
const CorrelationsActions_1 = require("./CorrelationsActions");
|
|
41
42
|
const DomainActions_1 = require("./DomainActions");
|
|
42
43
|
function changeZonesFactorHandler(draft, action) {
|
|
@@ -44,7 +45,7 @@ function changeZonesFactorHandler(draft, action) {
|
|
|
44
45
|
}
|
|
45
46
|
exports.changeZonesFactorHandler = changeZonesFactorHandler;
|
|
46
47
|
function add2dZoneHandler(draft, action) {
|
|
47
|
-
const activeSpectrum =
|
|
48
|
+
const activeSpectrum = (0, getActiveSpectrum_1.getActiveSpectrum)(draft);
|
|
48
49
|
if (activeSpectrum?.id) {
|
|
49
50
|
const { index } = activeSpectrum;
|
|
50
51
|
const drawnZone = (0, get2DRange_1.default)(draft, action);
|
|
@@ -60,7 +61,7 @@ function add2dZoneHandler(draft, action) {
|
|
|
60
61
|
}
|
|
61
62
|
exports.add2dZoneHandler = add2dZoneHandler;
|
|
62
63
|
function handleAutoZonesDetection(draft, detectionOptions) {
|
|
63
|
-
const activeSpectrum =
|
|
64
|
+
const activeSpectrum = (0, getActiveSpectrum_1.getActiveSpectrum)(draft);
|
|
64
65
|
if (activeSpectrum?.id) {
|
|
65
66
|
const { index } = activeSpectrum;
|
|
66
67
|
const [fromX, toX] = draft.xDomain;
|
|
@@ -90,7 +91,7 @@ function handleAutoSpectraZonesDetection(draft) {
|
|
|
90
91
|
exports.handleAutoSpectraZonesDetection = handleAutoSpectraZonesDetection;
|
|
91
92
|
function changeZoneSignalDelta(draft, action) {
|
|
92
93
|
const { zoneID, signal } = action.payload;
|
|
93
|
-
const activeSpectrum =
|
|
94
|
+
const activeSpectrum = (0, getActiveSpectrum_1.getActiveSpectrum)(draft);
|
|
94
95
|
if (activeSpectrum?.id) {
|
|
95
96
|
const { index } = activeSpectrum;
|
|
96
97
|
const { xShift, yShift } = (0, Spectrum2D_1.changeZoneSignal)(draft.data[index], zoneID, signal);
|
|
@@ -113,7 +114,7 @@ function getZoneIndex(state, spectrumIndex, zoneID) {
|
|
|
113
114
|
}
|
|
114
115
|
function handleChangeZoneSignalKind(draft, action) {
|
|
115
116
|
const state = (0, immer_1.original)(draft);
|
|
116
|
-
const activeSpectrum =
|
|
117
|
+
const activeSpectrum = (0, getActiveSpectrum_1.getActiveSpectrum)(state);
|
|
117
118
|
if (activeSpectrum?.id) {
|
|
118
119
|
const { index } = activeSpectrum;
|
|
119
120
|
const { rowData, value } = action.payload;
|
|
@@ -129,7 +130,7 @@ function handleChangeZoneSignalKind(draft, action) {
|
|
|
129
130
|
exports.handleChangeZoneSignalKind = handleChangeZoneSignalKind;
|
|
130
131
|
function handleDeleteZone(draft, action) {
|
|
131
132
|
const state = (0, immer_1.original)(draft);
|
|
132
|
-
const activeSpectrum =
|
|
133
|
+
const activeSpectrum = (0, getActiveSpectrum_1.getActiveSpectrum)(state);
|
|
133
134
|
if (activeSpectrum?.id) {
|
|
134
135
|
const { index } = activeSpectrum;
|
|
135
136
|
const { id, assignmentData } = action.payload;
|
|
@@ -187,7 +188,7 @@ function handleSetSignalPathLength(draft, action) {
|
|
|
187
188
|
exports.handleSetSignalPathLength = handleSetSignalPathLength;
|
|
188
189
|
function handleUnlinkZone(draft, action) {
|
|
189
190
|
const state = (0, immer_1.original)(draft);
|
|
190
|
-
const activeSpectrum =
|
|
191
|
+
const activeSpectrum = (0, getActiveSpectrum_1.getActiveSpectrum)(state);
|
|
191
192
|
if (activeSpectrum?.id) {
|
|
192
193
|
const { index } = activeSpectrum;
|
|
193
194
|
const { zoneData = null, assignmentData, isOnZoneLevel = undefined, signalIndex = -1, axis = undefined, } = action.payload;
|
|
@@ -211,7 +212,7 @@ function handleUnlinkZone(draft, action) {
|
|
|
211
212
|
exports.handleUnlinkZone = handleUnlinkZone;
|
|
212
213
|
function handleSetDiaIDZone(draft, action) {
|
|
213
214
|
const state = (0, immer_1.original)(draft);
|
|
214
|
-
const activeSpectrum =
|
|
215
|
+
const activeSpectrum = (0, getActiveSpectrum_1.getActiveSpectrum)(state);
|
|
215
216
|
if (activeSpectrum?.id) {
|
|
216
217
|
const { index } = activeSpectrum;
|
|
217
218
|
const { zoneData, diaIDs, axis, signalIndex, nbAtoms } = action.payload;
|
|
@@ -231,7 +232,7 @@ function handleSetDiaIDZone(draft, action) {
|
|
|
231
232
|
exports.handleSetDiaIDZone = handleSetDiaIDZone;
|
|
232
233
|
function handleSaveEditedZone(draft, action) {
|
|
233
234
|
const state = (0, immer_1.original)(draft);
|
|
234
|
-
const activeSpectrum =
|
|
235
|
+
const activeSpectrum = (0, getActiveSpectrum_1.getActiveSpectrum)(state);
|
|
235
236
|
if (activeSpectrum?.id) {
|
|
236
237
|
const { index } = activeSpectrum;
|
|
237
238
|
const { editedRowData } = action.payload;
|
|
@@ -239,9 +240,9 @@ function handleSaveEditedZone(draft, action) {
|
|
|
239
240
|
const zoneIndex = getZoneIndex(state, index, editedRowData.id);
|
|
240
241
|
draft.data[index].zones.values[zoneIndex] = editedRowData;
|
|
241
242
|
if (editedRowData.signals) {
|
|
242
|
-
editedRowData.signals
|
|
243
|
+
for (const signal of editedRowData.signals) {
|
|
243
244
|
(0, nmr_correlation_1.setPathLength)(draft.correlations.values, signal.id, signal.j?.pathLength);
|
|
244
|
-
}
|
|
245
|
+
}
|
|
245
246
|
}
|
|
246
247
|
handleOnChangeZonesData(draft);
|
|
247
248
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
function getClosestNumber(array = [], goal = 0) {
|
|
4
|
+
// eslint-disable-next-line unicorn/no-array-reduce
|
|
4
5
|
const closest = array.reduce((prev, curr) => {
|
|
5
6
|
return Math.abs(curr - goal) < Math.abs(prev - goal) ? curr : prev;
|
|
6
|
-
});
|
|
7
|
+
}, Number.POSITIVE_INFINITY);
|
|
7
8
|
return closest;
|
|
8
9
|
}
|
|
9
10
|
exports.default = getClosestNumber;
|