nmrium 0.29.0 → 0.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -2
- package/lib/component/1d/ApodizationLine.d.ts +3 -0
- package/lib/component/1d/ApodizationLine.js +49 -0
- package/lib/component/1d/Chart1D.js +4 -2
- package/lib/component/1d/ExclusionZoneAnnotation.d.ts +1 -1
- package/lib/component/1d/ExclusionZoneAnnotation.js +14 -7
- package/lib/component/1d/FooterBanner.js +3 -1
- package/lib/component/1d/IntegralResizable.js +5 -4
- package/lib/component/1d/IntegralsSeries.js +3 -1
- package/lib/component/1d/LinesSeries.js +7 -5
- package/lib/component/1d/SpectraTracker.js +1 -1
- package/lib/component/1d/Viewer1D.js +10 -13
- package/lib/component/1d/database/DatabaseElements.js +2 -2
- package/lib/component/1d/database/DatabaseSpectrum.js +3 -3
- package/lib/component/1d/database/ResurrectedDatabaseRanges.js +3 -3
- package/lib/component/1d/jCouplingGraph/JGraph.js +5 -1
- package/lib/component/1d/multiAnalysis/AnalysisRange.js +16 -14
- package/lib/component/1d/multiAnalysis/MultiAnalysisRanges.js +1 -1
- package/lib/component/1d/multiplicityTree/MultiplicityTree.js +6 -5
- package/lib/component/1d/{PeakAnnotation.d.ts → peaks/PeakAnnotation.d.ts} +1 -2
- package/lib/component/1d/{PeakAnnotation.js → peaks/PeakAnnotation.js} +8 -9
- package/lib/component/1d/{PeakAnnotations.d.ts → peaks/PeakAnnotations.d.ts} +0 -0
- package/lib/component/1d/peaks/PeakAnnotations.js +28 -0
- package/lib/component/1d/peaks/PeaksShapes.d.ts +3 -0
- package/lib/component/1d/peaks/PeaksShapes.js +37 -0
- package/lib/component/1d/peaks/usePeakShapesPath.d.ts +13 -0
- package/lib/component/1d/peaks/usePeakShapesPath.js +49 -0
- package/lib/component/1d/ranges/Range.js +4 -4
- package/lib/component/1d/ranges/Ranges.js +8 -2
- package/lib/component/1d/tool/PeakPointer.js +3 -1
- package/lib/component/1d/tool/XLabelPointer.js +3 -1
- package/lib/component/2d/Contours.js +3 -1
- package/lib/component/2d/FooterBanner.js +5 -3
- package/lib/component/2d/Viewer2D.js +6 -6
- package/lib/component/2d/XAxis.js +2 -2
- package/lib/component/2d/YAxis.js +2 -2
- package/lib/component/2d/tools/XYLabelPointer.js +3 -1
- package/lib/component/2d/tools/slicing/SlicingView.js +3 -1
- package/lib/component/2d/zones/IndicationLines.js +1 -1
- package/lib/component/2d/zones/Signal.d.ts +3 -2
- package/lib/component/2d/zones/Signal.js +3 -3
- package/lib/component/2d/zones/Zone.d.ts +1 -1
- package/lib/component/2d/zones/Zone.js +4 -4
- package/lib/component/2d/zones/Zones.js +14 -19
- package/lib/component/EventsTrackers/KeysListenerTracker.js +91 -52
- package/lib/component/NMRium.d.ts +2 -0
- package/lib/component/NMRium.js +14 -3
- package/lib/component/assignment/AssignmentsContext.d.ts +1 -1
- package/lib/component/context/GlobalContext.d.ts +1 -1
- package/lib/component/context/GlobalContext.js +3 -3
- package/lib/component/elements/ActiveButton.d.ts +17 -0
- package/lib/component/elements/ActiveButton.js +28 -0
- package/lib/component/elements/Button.d.ts +6 -6
- package/lib/component/elements/Button.js +5 -5
- package/lib/component/elements/ButtonToolTip.js +1 -1
- package/lib/component/elements/CheckBox.d.ts +2 -6
- package/lib/component/elements/CheckBox.js +4 -6
- package/lib/component/elements/Input.d.ts +5 -4
- package/lib/component/elements/Input.js +1 -1
- package/lib/component/elements/Label.d.ts +8 -6
- package/lib/component/elements/Label.js +3 -3
- package/lib/component/elements/MoleculeSelection.d.ts +2 -2
- package/lib/component/elements/MoleculeSelection.js +1 -1
- package/lib/component/elements/NextPrev.js +1 -1
- package/lib/component/elements/ReactTable/Elements/ReactTableRow.d.ts +2 -2
- package/lib/component/elements/ReactTable/Elements/ReactTableRow.js +2 -2
- package/lib/component/elements/ReactTable/ReactTable.d.ts +2 -2
- package/lib/component/elements/Select.d.ts +7 -11
- package/lib/component/elements/Select.js +6 -8
- package/lib/component/elements/Tab/Tab.js +1 -1
- package/lib/component/elements/Table/Table.d.ts +1 -2
- package/lib/component/elements/Table/Table.js +2 -2
- package/lib/component/elements/ToggleButton.d.ts +1 -2
- package/lib/component/elements/ToggleButton.js +3 -2
- package/lib/component/elements/accordion/AccordionItem.js +2 -2
- package/lib/component/elements/formik/FormikNumberInput.d.ts +1 -1
- package/lib/component/elements/formik/FormikOnChange.d.ts +3 -2
- package/lib/component/elements/formik/FormikOnChange.js +11 -5
- package/lib/component/elements/popup/Modal/ConfirmDialog.js +1 -1
- package/lib/component/elements/popup/Modal/Provider.d.ts +3 -3
- package/lib/component/elements/popup/Modal/Provider.js +8 -11
- package/lib/component/elements/resizer/DivResizer.js +3 -3
- package/lib/component/elements/resizer/Resizer.d.ts +1 -0
- package/lib/component/elements/resizer/SVGResizer.js +3 -3
- package/lib/component/header/ApodizationOptionsPanel.d.ts +2 -0
- package/lib/component/header/ApodizationOptionsPanel.js +81 -0
- package/lib/component/header/AutoPeakPickingOptionPanel.d.ts +2 -1
- package/lib/component/header/AutoPeakPickingOptionPanel.js +40 -36
- package/lib/component/header/BaseLineCorrectionPanel.d.ts +1 -2
- package/lib/component/header/BaseLineCorrectionPanel.js +84 -52
- package/lib/component/header/Header.js +5 -2
- package/lib/component/header/HeaderContainer.d.ts +7 -0
- package/lib/component/header/HeaderContainer.js +10 -0
- package/lib/component/header/ManualPhaseCorrectionPanel.js +27 -29
- package/lib/component/header/RangesPickingOptionPanel.js +19 -21
- package/lib/component/header/ZeroFillingOptionsPanel.js +52 -47
- package/lib/component/header/Zones2DOptionPanel.js +11 -13
- package/lib/component/highlight/index.d.ts +27 -10
- package/lib/component/highlight/index.js +19 -17
- package/lib/component/hooks/useActiveSpectrumStyleOptions.js +2 -2
- package/lib/component/hooks/useCheckToolsVisibility.d.ts +10 -1
- package/lib/component/hooks/useCheckToolsVisibility.js +31 -1
- package/lib/component/hooks/useDatumWithSpectraStatistics.js +3 -1
- package/lib/component/hooks/useExport.d.ts +0 -1
- package/lib/component/hooks/useExport.js +1 -17
- package/lib/component/hooks/useFilter.d.ts +1 -0
- package/lib/component/hooks/useFilter.js +7 -0
- package/lib/component/hooks/useIntegralPath.js +5 -2
- package/lib/component/hooks/useNucleus.js +4 -4
- package/lib/component/hooks/useSpectraPerNucleus.js +1 -1
- package/lib/component/hooks/useSpectrum.js +3 -1
- package/lib/component/hooks/useToolsFunctions.js +1 -1
- package/lib/component/loader/DropZone.js +8 -148
- package/lib/component/modal/AlignSpectraModal.js +1 -2
- package/lib/component/modal/EditPeakShapeModal.d.ts +9 -0
- package/lib/component/modal/EditPeakShapeModal.js +85 -0
- package/lib/component/modal/MoleculeStructureEditorModal.d.ts +3 -3
- package/lib/component/modal/MoleculeStructureEditorModal.js +2 -3
- package/lib/component/modal/MultipleSpectraFiltersModal/index.js +1 -2
- package/lib/component/modal/PredictSpectraModal.js +1 -1
- package/lib/component/modal/changeSum/ChangeSumModal.d.ts +1 -1
- package/lib/component/modal/changeSum/ChangeSumModal.js +9 -11
- package/lib/component/modal/changeSum/SelectMolecule.js +2 -2
- package/lib/component/modal/editRange/EditRangeModal.js +3 -3
- package/lib/component/modal/editRange/forms/components/CouplingsTable.js +4 -9
- package/lib/component/modal/setting/DatabasesTabContent.js +2 -2
- package/lib/component/modal/setting/DisplayTabContent.js +1 -1
- package/lib/component/modal/setting/FormattingTabContent.js +2 -2
- package/lib/component/modal/setting/GeneralSettings.js +1 -1
- package/lib/component/modal/setting/ToolsTabContent.js +17 -13
- package/lib/component/modal/setting/WorkspaceItem.d.ts +2 -2
- package/lib/component/modal/setting/WorkspaceItem.js +2 -2
- package/lib/component/panels/IntegralsPanel/IntegralPanel.js +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralTable.js +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculeHeader.d.ts +3 -3
- package/lib/component/panels/MoleculesPanel/MoleculeHeader.js +3 -3
- package/lib/component/panels/MoleculesPanel/MoleculePanel.d.ts +5 -4
- package/lib/component/panels/MoleculesPanel/MoleculePanel.js +13 -10
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.d.ts +4 -2
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +6 -6
- package/lib/component/panels/MoleculesPanel/Utilities.d.ts +1 -2
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.d.ts +5 -3
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +12 -4
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +1 -1
- package/lib/component/panels/Panels.js +3 -3
- package/lib/component/panels/PeaksPanel/PeaksPanel.js +47 -22
- package/lib/component/panels/PeaksPanel/PeaksPreferences.js +17 -0
- package/lib/component/panels/PeaksPanel/PeaksTable.js +44 -13
- package/lib/component/panels/RangesPanel/RangesHeader.d.ts +2 -1
- package/lib/component/panels/RangesPanel/RangesHeader.js +10 -9
- package/lib/component/panels/RangesPanel/RangesPanel.js +7 -3
- package/lib/component/panels/RangesPanel/RangesTableRow.js +4 -4
- package/lib/component/panels/RangesPanel/TableColumns/ActionsColumn.js +1 -1
- package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +3 -2
- package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.d.ts +3 -3
- package/lib/component/panels/RangesPanel/hooks/useMapRanges.js +3 -3
- package/lib/component/panels/SpectrumsPanel/SpectraPanelHeader.js +3 -1
- package/lib/component/panels/SpectrumsPanel/SpectrumListItem.js +1 -1
- package/lib/component/panels/SpectrumsPanel/SpectrumsTabs.js +3 -1
- package/lib/component/panels/SpectrumsPanel/base/ColorIndicator.js +2 -2
- package/lib/component/panels/SpectrumsPanel/base/ShowHideMarkersButton.d.ts +1 -1
- package/lib/component/panels/SpectrumsPanel/base/ShowHideMarkersButton.js +4 -1
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +4 -4
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +1 -2
- package/lib/component/panels/SummaryPanel/SummaryPanel.js +2 -3
- package/lib/component/panels/SummaryPanel/utilities/useInView.js +3 -1
- package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +1 -1
- package/lib/component/panels/ZonesPanel/ZonesPanel.js +19 -10
- package/lib/component/panels/databasePanel/DatabasePanel.js +5 -13
- package/lib/component/panels/databasePanel/DatabaseTable.js +3 -3
- package/lib/component/panels/filtersPanel/FilterPanel.js +1 -1
- package/lib/component/panels/filtersPanel/FiltersTable.js +2 -2
- package/lib/component/panels/header/DefaultPanelHeader.js +3 -12
- package/lib/component/panels/header/SpectraAutomaticPickingButton.js +1 -1
- package/lib/component/panels/predictionPanel/PredictionOptions.d.ts +2 -1
- package/lib/component/panels/predictionPanel/PredictionOptions.js +2 -2
- package/lib/component/panels/predictionPanel/PredictionPanel.js +15 -3
- package/lib/component/reducer/IgnoreActions.js +5 -0
- package/lib/component/reducer/Reducer.d.ts +141 -51
- package/lib/component/reducer/Reducer.js +69 -45
- package/lib/component/reducer/actions/DomainActions.d.ts +1 -1
- package/lib/component/reducer/actions/DomainActions.js +11 -9
- package/lib/component/reducer/actions/FiltersActions.d.ts +13 -7
- package/lib/component/reducer/actions/FiltersActions.js +326 -204
- package/lib/component/reducer/actions/IntegralsActions.js +15 -10
- package/lib/component/reducer/actions/LoadActions.d.ts +2 -5
- package/lib/component/reducer/actions/LoadActions.js +19 -34
- package/lib/component/reducer/actions/MoleculeActions.d.ts +2 -1
- package/lib/component/reducer/actions/MoleculeActions.js +48 -19
- package/lib/component/reducer/actions/PeaksActions.d.ts +4 -1
- package/lib/component/reducer/actions/PeaksActions.js +52 -13
- package/lib/component/reducer/actions/PreferencesActions.js +8 -10
- package/lib/component/reducer/actions/RangesActions.d.ts +3 -3
- package/lib/component/reducer/actions/RangesActions.js +87 -29
- package/lib/component/reducer/actions/SpectraAnalysisAction.js +5 -5
- package/lib/component/reducer/actions/SpectrumsActions.js +14 -11
- package/lib/component/reducer/actions/ToolsActions.js +47 -95
- package/lib/component/reducer/actions/ZonesActions.d.ts +4 -1
- package/lib/component/reducer/actions/ZonesActions.js +68 -17
- package/lib/component/reducer/helper/Zoom1DManager.js +2 -1
- package/lib/component/reducer/helper/getActiveSpectrumOrFail.d.ts +3 -0
- package/lib/component/reducer/helper/getActiveSpectrumOrFail.js +6 -0
- package/lib/component/reducer/helper/getSpectrum.js +3 -2
- package/lib/component/reducer/helper/getStrongestPeak.d.ts +7 -0
- package/lib/component/reducer/helper/getStrongestPeak.js +15 -0
- package/lib/component/reducer/preferences/actions/addWorkspace.js +2 -2
- package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js +3 -0
- package/lib/component/reducer/preferences/preferencesReducer.d.ts +23 -15
- package/lib/component/reducer/preferences/preferencesReducer.js +1 -1
- package/lib/component/reducer/types/Types.d.ts +12 -0
- package/lib/component/reducer/types/Types.js +12 -0
- package/lib/component/tool/BrushX.js +1 -1
- package/lib/component/tool/BrushXY.js +4 -3
- package/lib/component/tool/CrossLinePointer.js +5 -4
- package/lib/component/tool/FloatMoleculeStructures/DraggableStructure.d.ts +8 -2
- package/lib/component/tool/FloatMoleculeStructures/DraggableStructure.js +22 -7
- package/lib/component/tool/FloatMoleculeStructures/index.d.ts +3 -2
- package/lib/component/tool/FloatMoleculeStructures/index.js +19 -6
- package/lib/component/toolbar/BasicToolBar.js +7 -14
- package/lib/component/toolbar/FunctionToolBar.js +13 -23
- package/lib/component/toolbar/ToolTypes.d.ts +7 -1
- package/lib/component/toolbar/ToolTypes.js +119 -9
- package/lib/component/utility/assert.d.ts +1 -0
- package/lib/component/utility/assert.js +5 -0
- package/lib/component/workspaces/Workspace.d.ts +4 -1
- package/lib/component/workspaces/basic.js +12 -11
- package/lib/component/workspaces/embedded.js +14 -13
- package/lib/component/workspaces/exercise.js +10 -6
- package/lib/component/workspaces/prediction.js +14 -13
- package/lib/component/workspaces/process1D.js +20 -19
- package/lib/component/workspaces/workspaceDefaultProperties.js +14 -15
- package/lib/constants.js +1 -1
- package/lib/data/Filters.d.ts +2 -2
- package/lib/data/Filters.js +2 -2
- package/lib/data/FiltersManager.js +3 -3
- package/lib/data/PredictionManager.d.ts +0 -1
- package/lib/data/PredictionManager.js +15 -15
- package/lib/data/SpectraManager.d.ts +2 -5
- package/lib/data/SpectraManager.js +4 -95
- package/lib/data/constants/SignalsKinds.d.ts +0 -1
- package/lib/data/constants/SignalsKinds.js +0 -8
- package/lib/data/data1d/Data1DManager.js +5 -5
- package/lib/data/data1d/Spectrum1D/SumManager.d.ts +5 -5
- package/lib/data/data1d/Spectrum1D/SumManager.js +18 -12
- package/lib/data/data1d/Spectrum1D/generateJGraphData.js +2 -2
- package/lib/data/data1d/Spectrum1D/index.d.ts +2 -1
- package/lib/data/data1d/Spectrum1D/index.js +2 -1
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +3 -3
- package/lib/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.js +1 -1
- package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +5 -2
- package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.js +15 -16
- package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.d.ts +8 -0
- package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.js +24 -0
- package/lib/data/data1d/Spectrum1D/ranges/addRange.js +3 -3
- package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.js +2 -0
- package/lib/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.js +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectRange.js +2 -2
- package/lib/data/data1d/Spectrum1D/ranges/mapRanges.js +3 -3
- package/lib/data/data1d/database.js +4 -6
- package/lib/data/data1d/filter1d/apodization.d.ts +25 -0
- package/lib/data/data1d/filter1d/apodization.js +63 -0
- package/lib/data/data1d/filter1d/baselineCorrection.d.ts +24 -7
- package/lib/data/data1d/filter1d/baselineCorrection.js +10 -17
- package/lib/data/data1d/filter1d/fft.js +11 -0
- package/lib/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.d.ts +2 -0
- package/lib/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +35 -0
- package/lib/data/data1d/filter1d/zeroFillingAndApodization.d.ts +9 -0
- package/lib/data/data1d/filter1d/zeroFillingAndApodization.js +24 -0
- package/lib/data/data2d/Processing2D.d.ts +3 -3
- package/lib/data/data2d/Processing2D.js +3 -2
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +3 -3
- package/lib/data/data2d/Spectrum2D/zones/detectZones.js +3 -3
- package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.js +3 -3
- package/lib/data/data2d/Spectrum2D/zones/getDetectionZones.d.ts +1 -1
- package/lib/data/molecules/Molecule.d.ts +20 -6
- package/lib/data/molecules/Molecule.js +5 -8
- package/lib/data/molecules/MoleculeManager.d.ts +4 -4
- package/lib/data/molecules/MoleculeManager.js +5 -5
- package/lib/data/types/data1d/SumOptions.d.ts +1 -1
- package/lib/data/utilities/generateNumbersPowerOfX.d.ts +0 -1
- package/lib/data/utilities/generateNumbersPowerOfX.js +0 -1
- package/lib/data/utilities/isInRange.d.ts +7 -0
- package/lib/data/utilities/isInRange.js +4 -0
- package/lib/types/NMRiumDataReturn.d.ts +2 -2
- package/lib/types/NMRiumGeneralPreferences.d.ts +0 -2
- package/lib/types/NMRiumToolBarPreferences.d.ts +14 -13
- package/lib/versionInfo.js +1 -1
- package/lib-cjs/component/1d/ApodizationLine.js +77 -0
- package/lib-cjs/component/1d/Chart1D.js +4 -2
- package/lib-cjs/component/1d/ExclusionZoneAnnotation.js +15 -8
- package/lib-cjs/component/1d/FooterBanner.js +3 -1
- package/lib-cjs/component/1d/IntegralResizable.js +4 -3
- package/lib-cjs/component/1d/IntegralsSeries.js +3 -1
- package/lib-cjs/component/1d/LinesSeries.js +6 -4
- package/lib-cjs/component/1d/SpectraTracker.js +1 -1
- package/lib-cjs/component/1d/Viewer1D.js +10 -13
- package/lib-cjs/component/1d/database/DatabaseElements.js +1 -1
- package/lib-cjs/component/1d/database/DatabaseSpectrum.js +2 -2
- package/lib-cjs/component/1d/database/ResurrectedDatabaseRanges.js +2 -2
- package/lib-cjs/component/1d/jCouplingGraph/JGraph.js +5 -1
- package/lib-cjs/component/1d/multiAnalysis/AnalysisRange.js +15 -13
- package/lib-cjs/component/1d/multiAnalysis/MultiAnalysisRanges.js +1 -1
- package/lib-cjs/component/1d/multiplicityTree/MultiplicityTree.js +4 -3
- package/lib-cjs/component/1d/{PeakAnnotation.js → peaks/PeakAnnotation.js} +8 -9
- package/lib-cjs/component/1d/peaks/PeakAnnotations.js +33 -0
- package/lib-cjs/component/1d/peaks/PeaksShapes.js +42 -0
- package/lib-cjs/component/1d/peaks/usePeakShapesPath.js +53 -0
- package/lib-cjs/component/1d/ranges/Range.js +3 -3
- package/lib-cjs/component/1d/ranges/Ranges.js +7 -1
- package/lib-cjs/component/1d/tool/PeakPointer.js +3 -1
- package/lib-cjs/component/1d/tool/XLabelPointer.js +3 -1
- package/lib-cjs/component/2d/Contours.js +3 -1
- package/lib-cjs/component/2d/FooterBanner.js +5 -3
- package/lib-cjs/component/2d/Viewer2D.js +6 -6
- package/lib-cjs/component/2d/XAxis.js +2 -2
- package/lib-cjs/component/2d/YAxis.js +2 -2
- package/lib-cjs/component/2d/tools/XYLabelPointer.js +3 -1
- package/lib-cjs/component/2d/tools/slicing/SlicingView.js +3 -1
- package/lib-cjs/component/2d/zones/IndicationLines.js +1 -1
- package/lib-cjs/component/2d/zones/Signal.js +3 -3
- package/lib-cjs/component/2d/zones/Zone.js +3 -3
- package/lib-cjs/component/2d/zones/Zones.js +13 -18
- package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +89 -50
- package/lib-cjs/component/NMRium.js +14 -3
- package/lib-cjs/component/context/GlobalContext.js +4 -4
- package/lib-cjs/component/elements/ActiveButton.js +33 -0
- package/lib-cjs/component/elements/Button.js +5 -5
- package/lib-cjs/component/elements/ButtonToolTip.js +1 -1
- package/lib-cjs/component/elements/CheckBox.js +3 -5
- package/lib-cjs/component/elements/Input.js +1 -1
- package/lib-cjs/component/elements/Label.js +3 -3
- package/lib-cjs/component/elements/MoleculeSelection.js +1 -1
- package/lib-cjs/component/elements/NextPrev.js +1 -1
- package/lib-cjs/component/elements/ReactTable/Elements/ReactTableRow.js +1 -1
- package/lib-cjs/component/elements/Select.js +6 -8
- package/lib-cjs/component/elements/Tab/Tab.js +1 -1
- package/lib-cjs/component/elements/Table/Table.js +2 -2
- package/lib-cjs/component/elements/ToggleButton.js +3 -2
- package/lib-cjs/component/elements/accordion/AccordionItem.js +2 -2
- package/lib-cjs/component/elements/formik/FormikOnChange.js +10 -4
- package/lib-cjs/component/elements/popup/Modal/ConfirmDialog.js +1 -1
- package/lib-cjs/component/elements/popup/Modal/Provider.js +8 -11
- package/lib-cjs/component/elements/resizer/DivResizer.js +3 -3
- package/lib-cjs/component/elements/resizer/SVGResizer.js +2 -2
- package/lib-cjs/component/header/ApodizationOptionsPanel.js +110 -0
- package/lib-cjs/component/header/AutoPeakPickingOptionPanel.js +39 -35
- package/lib-cjs/component/header/BaseLineCorrectionPanel.js +82 -49
- package/lib-cjs/component/header/Header.js +5 -2
- package/lib-cjs/component/header/HeaderContainer.js +14 -0
- package/lib-cjs/component/header/ManualPhaseCorrectionPanel.js +26 -28
- package/lib-cjs/component/header/RangesPickingOptionPanel.js +19 -21
- package/lib-cjs/component/header/ZeroFillingOptionsPanel.js +73 -45
- package/lib-cjs/component/header/Zones2DOptionPanel.js +11 -13
- package/lib-cjs/component/highlight/index.js +20 -18
- package/lib-cjs/component/hooks/useActiveSpectrumStyleOptions.js +2 -2
- package/lib-cjs/component/hooks/useCheckToolsVisibility.js +31 -1
- package/lib-cjs/component/hooks/useDatumWithSpectraStatistics.js +3 -1
- package/lib-cjs/component/hooks/useExport.js +0 -16
- package/lib-cjs/component/hooks/useFilter.js +14 -0
- package/lib-cjs/component/hooks/useIntegralPath.js +5 -2
- package/lib-cjs/component/hooks/useNucleus.js +4 -4
- package/lib-cjs/component/hooks/useSpectraPerNucleus.js +1 -1
- package/lib-cjs/component/hooks/useSpectrum.js +3 -1
- package/lib-cjs/component/hooks/useToolsFunctions.js +1 -1
- package/lib-cjs/component/loader/DropZone.js +7 -150
- package/lib-cjs/component/modal/AlignSpectraModal.js +1 -2
- package/lib-cjs/component/modal/EditPeakShapeModal.js +113 -0
- package/lib-cjs/component/modal/MoleculeStructureEditorModal.js +2 -3
- package/lib-cjs/component/modal/MultipleSpectraFiltersModal/index.js +1 -2
- package/lib-cjs/component/modal/PredictSpectraModal.js +1 -1
- package/lib-cjs/component/modal/changeSum/ChangeSumModal.js +9 -11
- package/lib-cjs/component/modal/changeSum/SelectMolecule.js +2 -2
- package/lib-cjs/component/modal/editRange/EditRangeModal.js +3 -3
- package/lib-cjs/component/modal/editRange/forms/components/CouplingsTable.js +3 -8
- package/lib-cjs/component/modal/setting/DatabasesTabContent.js +2 -2
- package/lib-cjs/component/modal/setting/DisplayTabContent.js +1 -1
- package/lib-cjs/component/modal/setting/FormattingTabContent.js +2 -2
- package/lib-cjs/component/modal/setting/GeneralSettings.js +1 -1
- package/lib-cjs/component/modal/setting/ToolsTabContent.js +17 -13
- package/lib-cjs/component/modal/setting/WorkspaceItem.js +2 -2
- package/lib-cjs/component/panels/IntegralsPanel/IntegralPanel.js +1 -1
- package/lib-cjs/component/panels/IntegralsPanel/IntegralTable.js +1 -1
- package/lib-cjs/component/panels/MoleculesPanel/MoleculeHeader.js +3 -3
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanel.js +12 -9
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +6 -6
- package/lib-cjs/component/panels/MoleculesPanel/useAtomAssignment.js +11 -3
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +1 -1
- package/lib-cjs/component/panels/Panels.js +3 -3
- package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +45 -20
- package/lib-cjs/component/panels/PeaksPanel/PeaksPreferences.js +17 -0
- package/lib-cjs/component/panels/PeaksPanel/PeaksTable.js +42 -11
- package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +10 -9
- package/lib-cjs/component/panels/RangesPanel/RangesPanel.js +7 -3
- package/lib-cjs/component/panels/RangesPanel/RangesTableRow.js +3 -3
- package/lib-cjs/component/panels/RangesPanel/TableColumns/ActionsColumn.js +1 -1
- package/lib-cjs/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +2 -1
- package/lib-cjs/component/panels/RangesPanel/hooks/useMapRanges.js +3 -6
- package/lib-cjs/component/panels/SpectrumsPanel/SpectraPanelHeader.js +3 -1
- package/lib-cjs/component/panels/SpectrumsPanel/SpectrumListItem.js +1 -1
- package/lib-cjs/component/panels/SpectrumsPanel/SpectrumsTabs.js +3 -1
- package/lib-cjs/component/panels/SpectrumsPanel/base/ColorIndicator.js +2 -2
- package/lib-cjs/component/panels/SpectrumsPanel/base/ShowHideMarkersButton.js +4 -1
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +4 -4
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +1 -2
- package/lib-cjs/component/panels/SummaryPanel/SummaryPanel.js +2 -3
- package/lib-cjs/component/panels/SummaryPanel/utilities/useInView.js +3 -1
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +1 -1
- package/lib-cjs/component/panels/ZonesPanel/ZonesPanel.js +18 -9
- package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +5 -13
- package/lib-cjs/component/panels/databasePanel/DatabaseTable.js +2 -2
- package/lib-cjs/component/panels/filtersPanel/FilterPanel.js +1 -1
- package/lib-cjs/component/panels/filtersPanel/FiltersTable.js +2 -2
- package/lib-cjs/component/panels/header/DefaultPanelHeader.js +3 -12
- package/lib-cjs/component/panels/header/SpectraAutomaticPickingButton.js +1 -1
- package/lib-cjs/component/panels/predictionPanel/PredictionOptions.js +2 -2
- package/lib-cjs/component/panels/predictionPanel/PredictionPanel.js +15 -3
- package/lib-cjs/component/reducer/IgnoreActions.js +5 -0
- package/lib-cjs/component/reducer/Reducer.js +72 -50
- package/lib-cjs/component/reducer/actions/DomainActions.js +11 -9
- package/lib-cjs/component/reducer/actions/FiltersActions.js +332 -205
- package/lib-cjs/component/reducer/actions/IntegralsActions.js +15 -10
- package/lib-cjs/component/reducer/actions/LoadActions.js +18 -36
- package/lib-cjs/component/reducer/actions/MoleculeActions.js +49 -19
- package/lib-cjs/component/reducer/actions/PeaksActions.js +54 -12
- package/lib-cjs/component/reducer/actions/PreferencesActions.js +8 -10
- package/lib-cjs/component/reducer/actions/RangesActions.js +87 -29
- package/lib-cjs/component/reducer/actions/SpectraAnalysisAction.js +5 -5
- package/lib-cjs/component/reducer/actions/SpectrumsActions.js +14 -11
- package/lib-cjs/component/reducer/actions/ToolsActions.js +46 -94
- package/lib-cjs/component/reducer/actions/ZonesActions.js +71 -17
- package/lib-cjs/component/reducer/helper/Zoom1DManager.js +2 -1
- package/lib-cjs/component/reducer/helper/getActiveSpectrumOrFail.js +10 -0
- package/lib-cjs/component/reducer/helper/getSpectrum.js +3 -2
- package/lib-cjs/component/reducer/helper/getStrongestPeak.js +19 -0
- package/lib-cjs/component/reducer/preferences/actions/addWorkspace.js +2 -5
- package/lib-cjs/component/reducer/preferences/panelsPreferencesDefaultValues.js +3 -0
- package/lib-cjs/component/reducer/preferences/preferencesReducer.js +1 -1
- package/lib-cjs/component/reducer/types/Types.js +15 -3
- package/lib-cjs/component/tool/BrushX.js +1 -1
- package/lib-cjs/component/tool/BrushXY.js +4 -3
- package/lib-cjs/component/tool/CrossLinePointer.js +5 -4
- package/lib-cjs/component/tool/FloatMoleculeStructures/DraggableStructure.js +21 -6
- package/lib-cjs/component/tool/FloatMoleculeStructures/index.js +19 -6
- package/lib-cjs/component/toolbar/BasicToolBar.js +7 -14
- package/lib-cjs/component/toolbar/FunctionToolBar.js +12 -22
- package/lib-cjs/component/toolbar/ToolTypes.js +119 -9
- package/lib-cjs/component/utility/assert.js +9 -0
- package/lib-cjs/component/workspaces/basic.js +12 -11
- package/lib-cjs/component/workspaces/embedded.js +14 -13
- package/lib-cjs/component/workspaces/exercise.js +10 -6
- package/lib-cjs/component/workspaces/prediction.js +14 -13
- package/lib-cjs/component/workspaces/process1D.js +20 -19
- package/lib-cjs/component/workspaces/workspaceDefaultProperties.js +14 -15
- package/lib-cjs/constants.js +1 -1
- package/lib-cjs/data/Filters.js +3 -3
- package/lib-cjs/data/FiltersManager.js +3 -6
- package/lib-cjs/data/PredictionManager.js +15 -15
- package/lib-cjs/data/SpectraManager.js +5 -100
- package/lib-cjs/data/constants/SignalsKinds.js +0 -8
- package/lib-cjs/data/data1d/Data1DManager.js +5 -5
- package/lib-cjs/data/data1d/Spectrum1D/SumManager.js +18 -12
- package/lib-cjs/data/data1d/Spectrum1D/generateJGraphData.js +2 -5
- package/lib-cjs/data/data1d/Spectrum1D/index.js +3 -1
- package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +3 -3
- package/lib-cjs/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +5 -2
- package/lib-cjs/data/data1d/Spectrum1D/peaks/mapPeaks.js +15 -19
- package/lib-cjs/data/data1d/Spectrum1D/peaks/optimizePeaks.js +28 -0
- package/lib-cjs/data/data1d/Spectrum1D/ranges/addRange.js +3 -3
- package/lib-cjs/data/data1d/Spectrum1D/ranges/autoRangesDetection.js +2 -0
- package/lib-cjs/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/ranges/detectRange.js +2 -5
- package/lib-cjs/data/data1d/Spectrum1D/ranges/mapRanges.js +3 -6
- package/lib-cjs/data/data1d/database.js +4 -6
- package/lib-cjs/data/data1d/filter1d/apodization.js +70 -0
- package/lib-cjs/data/data1d/filter1d/baselineCorrection.js +11 -18
- package/lib-cjs/data/data1d/filter1d/fft.js +11 -0
- package/lib-cjs/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +39 -0
- package/lib-cjs/data/data1d/filter1d/zeroFillingAndApodization.js +30 -0
- package/lib-cjs/data/data2d/Processing2D.js +3 -2
- package/lib-cjs/data/data2d/Spectrum2D/initiateDatum2D.js +3 -6
- package/lib-cjs/data/data2d/Spectrum2D/zones/detectZones.js +3 -6
- package/lib-cjs/data/data2d/Spectrum2D/zones/detectZonesManual.js +3 -6
- package/lib-cjs/data/molecules/Molecule.js +5 -8
- package/lib-cjs/data/molecules/MoleculeManager.js +5 -5
- package/lib-cjs/data/utilities/generateNumbersPowerOfX.js +0 -1
- package/lib-cjs/data/utilities/isInRange.js +7 -0
- package/lib-cjs/versionInfo.js +1 -1
- package/package.json +36 -35
- package/lib/component/1d/PeakAnnotations.js +0 -41
- package/lib/component/utility/nmredataToNmrium.d.ts +0 -4
- package/lib/component/utility/nmredataToNmrium.js +0 -66
- package/lib/component/utility/nmriumToNmredata.d.ts +0 -2
- package/lib/component/utility/nmriumToNmredata.js +0 -80
- package/lib/component/utility/util/nmredata/addRanges.d.ts +0 -1
- package/lib/component/utility/util/nmredata/addRanges.js +0 -52
- package/lib/component/utility/util/nmredata/addSource.d.ts +0 -6
- package/lib/component/utility/util/nmredata/addSource.js +0 -54
- package/lib/component/utility/util/nmredata/addZones.d.ts +0 -1
- package/lib/component/utility/util/nmredata/addZones.js +0 -41
- package/lib/component/utility/util/nmredata/flat2DSignals.d.ts +0 -1
- package/lib/component/utility/util/nmredata/flat2DSignals.js +0 -7
- package/lib/component/utility/util/nmredata/get1DSignals.d.ts +0 -10
- package/lib/component/utility/util/nmredata/get1DSignals.js +0 -96
- package/lib/component/utility/util/nmredata/get2DSignals.d.ts +0 -8
- package/lib/component/utility/util/nmredata/get2DSignals.js +0 -59
- package/lib/component/utility/util/nmredata/getCouplingObserved.d.ts +0 -1
- package/lib/component/utility/util/nmredata/getCouplingObserved.js +0 -11
- package/lib/component/utility/util/nmredata/getLabels.d.ts +0 -9
- package/lib/component/utility/util/nmredata/getLabels.js +0 -66
- package/lib/component/utility/util/nmredata/getToFix.d.ts +0 -1
- package/lib/component/utility/util/nmredata/getToFix.js +0 -19
- package/lib/data/data1d/filter1d/lineBroadening.d.ts +0 -14
- package/lib/data/data1d/filter1d/lineBroadening.js +0 -57
- package/lib/data/migration/MigrationManager.d.ts +0 -2
- package/lib/data/migration/MigrationManager.js +0 -17
- package/lib/data/migration/changeKeys.d.ts +0 -1
- package/lib/data/migration/changeKeys.js +0 -9
- package/lib/data/migration/migrateToVersion1.d.ts +0 -11
- package/lib/data/migration/migrateToVersion1.js +0 -32
- package/lib/data/migration/migrateToVersion2.d.ts +0 -1
- package/lib/data/migration/migrateToVersion2.js +0 -111
- package/lib/data/utilities/generateID.d.ts +0 -1
- package/lib/data/utilities/generateID.js +0 -9
- package/lib-cjs/component/1d/PeakAnnotations.js +0 -46
- package/lib-cjs/component/utility/nmredataToNmrium.js +0 -73
- package/lib-cjs/component/utility/nmriumToNmredata.js +0 -87
- package/lib-cjs/component/utility/util/nmredata/addRanges.js +0 -56
- package/lib-cjs/component/utility/util/nmredata/addSource.js +0 -61
- package/lib-cjs/component/utility/util/nmredata/addZones.js +0 -48
- package/lib-cjs/component/utility/util/nmredata/flat2DSignals.js +0 -11
- package/lib-cjs/component/utility/util/nmredata/get1DSignals.js +0 -100
- package/lib-cjs/component/utility/util/nmredata/get2DSignals.js +0 -63
- package/lib-cjs/component/utility/util/nmredata/getCouplingObserved.js +0 -15
- package/lib-cjs/component/utility/util/nmredata/getLabels.js +0 -70
- package/lib-cjs/component/utility/util/nmredata/getToFix.js +0 -23
- package/lib-cjs/data/data1d/filter1d/lineBroadening.js +0 -63
- package/lib-cjs/data/migration/MigrationManager.js +0 -24
- package/lib-cjs/data/migration/changeKeys.js +0 -13
- package/lib-cjs/data/migration/migrateToVersion1.js +0 -35
- package/lib-cjs/data/migration/migrateToVersion2.js +0 -114
- package/lib-cjs/data/utilities/generateID.js +0 -12
|
@@ -27,6 +27,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
exports.handleShowJGraph = exports.handleAutoSpectraRangesDetection = exports.handleShowRangesIntegrals = exports.handleShowMultiplicityTrees = exports.handleUpdateRange = exports.handleChangeRangesSumFlag = exports.handleSetDiaIDRange = exports.handleUnlinkRange = exports.handleSaveEditedRange = exports.handleChangeRangeSignalKind = exports.handleChangeRangeSignalValue = exports.handleChangeRangeRelativeValue = exports.handleResizeRange = exports.handleAddRange = exports.handleChangeRangeSum = exports.handleDeleteSignal = exports.handleDeleteRange = exports.handleAutoRangesDetection = void 0;
|
|
30
|
+
const uuid_1 = require("@lukeed/uuid");
|
|
30
31
|
const immer_1 = require("immer");
|
|
31
32
|
const cloneDeep_1 = __importDefault(require("lodash/cloneDeep"));
|
|
32
33
|
const ml_spectra_processing_1 = require("ml-spectra-processing");
|
|
@@ -36,16 +37,25 @@ const SignalsKinds_1 = require("../../../data/constants/SignalsKinds");
|
|
|
36
37
|
const Spectrum1D_1 = require("../../../data/data1d/Spectrum1D");
|
|
37
38
|
const SumManager_1 = require("../../../data/data1d/Spectrum1D/SumManager");
|
|
38
39
|
const RangeUtilities_1 = require("../../../data/utilities/RangeUtilities");
|
|
39
|
-
const
|
|
40
|
+
const Reducer_1 = require("../Reducer");
|
|
40
41
|
const getRange_1 = __importDefault(require("../helper/getRange"));
|
|
41
42
|
const CorrelationsActions_1 = require("./CorrelationsActions");
|
|
42
43
|
const DomainActions_1 = require("./DomainActions");
|
|
43
44
|
const ToolsActions_1 = require("./ToolsActions");
|
|
44
45
|
function handleAutoRangesDetection(draft, options) {
|
|
45
|
-
const {
|
|
46
|
+
const { data, xDomain, molecules, view: { spectra: { activeTab: nucleus }, }, } = draft;
|
|
47
|
+
const activeSpectrum = draft.view.spectra.activeSpectra[draft.view.spectra.activeTab];
|
|
46
48
|
if (activeSpectrum?.id) {
|
|
47
|
-
const { index } = activeSpectrum;
|
|
49
|
+
const { index, id } = activeSpectrum;
|
|
48
50
|
const datum = data[index];
|
|
51
|
+
// add range intial state
|
|
52
|
+
const range = draft.view.ranges.find((r) => r.spectrumID === id);
|
|
53
|
+
if (!range) {
|
|
54
|
+
draft.view.ranges.push({
|
|
55
|
+
spectrumID: id,
|
|
56
|
+
...Reducer_1.rangeStateInit,
|
|
57
|
+
});
|
|
58
|
+
}
|
|
49
59
|
const [from, to] = xDomain;
|
|
50
60
|
const windowFromIndex = (0, ml_spectra_processing_1.xFindClosestIndex)(datum.data.x, from);
|
|
51
61
|
const windowToIndex = (0, ml_spectra_processing_1.xFindClosestIndex)(datum.data.x, to);
|
|
@@ -80,7 +90,7 @@ function handleAutoSpectraRangesDetection(draft) {
|
|
|
80
90
|
clean: true,
|
|
81
91
|
keepPeaks: true,
|
|
82
92
|
};
|
|
83
|
-
const { data, activeTab: nucleus, molecules } = draft;
|
|
93
|
+
const { data, view: { spectra: { activeTab: nucleus }, }, molecules, } = draft;
|
|
84
94
|
for (const datum of data) {
|
|
85
95
|
if (datum.info.dimension === 1) {
|
|
86
96
|
(0, Spectrum1D_1.detectRanges)(datum, { peakPicking, molecules, nucleus });
|
|
@@ -93,8 +103,9 @@ function getRangeIndex(draft, spectrumIndex, rangeID) {
|
|
|
93
103
|
return draft.data[spectrumIndex].ranges.values.findIndex((range) => range.id === rangeID);
|
|
94
104
|
}
|
|
95
105
|
function handleDeleteRange(draft, action) {
|
|
96
|
-
|
|
97
|
-
|
|
106
|
+
const activeSpectrum = draft.view.spectra.activeSpectra[draft.view.spectra.activeTab];
|
|
107
|
+
if (activeSpectrum?.id) {
|
|
108
|
+
const { index } = activeSpectrum;
|
|
98
109
|
const { data, resetSelectTool = false } = action.payload;
|
|
99
110
|
const { id = null, assignmentData } = data;
|
|
100
111
|
const datum = draft.data[index];
|
|
@@ -117,8 +128,9 @@ function handleDeleteRange(draft, action) {
|
|
|
117
128
|
exports.handleDeleteRange = handleDeleteRange;
|
|
118
129
|
function handleChangeRangeSignalKind(draft, action) {
|
|
119
130
|
const state = (0, immer_1.original)(draft);
|
|
120
|
-
|
|
121
|
-
|
|
131
|
+
const activeSpectrum = state.view.spectra.activeSpectra[state.view.spectra.activeTab];
|
|
132
|
+
if (activeSpectrum?.id) {
|
|
133
|
+
const { index } = activeSpectrum;
|
|
122
134
|
const { rowData, value } = action.payload.data;
|
|
123
135
|
const rangeIndex = getRangeIndex(state, index, rowData.id);
|
|
124
136
|
const _range = draft.data[index].ranges.values[rangeIndex];
|
|
@@ -135,8 +147,9 @@ function handleChangeRangeSignalKind(draft, action) {
|
|
|
135
147
|
exports.handleChangeRangeSignalKind = handleChangeRangeSignalKind;
|
|
136
148
|
function handleSaveEditedRange(draft, action) {
|
|
137
149
|
const state = (0, immer_1.original)(draft);
|
|
138
|
-
|
|
139
|
-
|
|
150
|
+
const activeSpectrum = state.view.spectra.activeSpectra[state.view.spectra.activeTab];
|
|
151
|
+
if (activeSpectrum?.id) {
|
|
152
|
+
const { index } = activeSpectrum;
|
|
140
153
|
const { editedRowData, assignmentData } = action.payload;
|
|
141
154
|
// remove assignments in global state
|
|
142
155
|
const _editedRowData = (0, RangeUtilities_1.unlink)(editedRowData);
|
|
@@ -147,7 +160,7 @@ function handleSaveEditedRange(draft, action) {
|
|
|
147
160
|
(0, RangeUtilities_1.unlinkInAssignmentData)(assignmentData, [_editedRowData]);
|
|
148
161
|
const rangeIndex = getRangeIndex(state, index, _editedRowData.id);
|
|
149
162
|
if (_editedRowData.id === 'new') {
|
|
150
|
-
_editedRowData.id = (0,
|
|
163
|
+
_editedRowData.id = (0, uuid_1.v4)();
|
|
151
164
|
}
|
|
152
165
|
draft.data[index].ranges.values.splice(rangeIndex, 1, _editedRowData);
|
|
153
166
|
(0, Spectrum1D_1.updateRangesRelativeValues)(draft.data[index]);
|
|
@@ -179,8 +192,9 @@ function handleDeleteSignal(draft, action) {
|
|
|
179
192
|
}
|
|
180
193
|
exports.handleDeleteSignal = handleDeleteSignal;
|
|
181
194
|
function handleUnlinkRange(draft, action) {
|
|
182
|
-
|
|
183
|
-
|
|
195
|
+
const activeSpectrum = draft.view.spectra.activeSpectra[draft.view.spectra.activeTab];
|
|
196
|
+
if (activeSpectrum?.id) {
|
|
197
|
+
const { index } = activeSpectrum;
|
|
184
198
|
const { assignmentData, rangeData = null, signalIndex = -1, } = action.payload;
|
|
185
199
|
// remove assignments in global state
|
|
186
200
|
if (rangeData) {
|
|
@@ -214,8 +228,9 @@ function handleUnlinkRange(draft, action) {
|
|
|
214
228
|
}
|
|
215
229
|
exports.handleUnlinkRange = handleUnlinkRange;
|
|
216
230
|
function handleSetDiaIDRange(draft, action) {
|
|
217
|
-
|
|
218
|
-
|
|
231
|
+
const activeSpectrum = draft.view.spectra.activeSpectra[draft.view.spectra.activeTab];
|
|
232
|
+
if (activeSpectrum?.id) {
|
|
233
|
+
const { index } = activeSpectrum;
|
|
219
234
|
const { rangeData, diaIDs, signalIndex, nbAtoms } = action.payload;
|
|
220
235
|
const getNbAtoms = (input, current = 0) => input + current;
|
|
221
236
|
const rangeIndex = getRangeIndex(draft, index, rangeData.id);
|
|
@@ -233,14 +248,16 @@ function handleSetDiaIDRange(draft, action) {
|
|
|
233
248
|
}
|
|
234
249
|
exports.handleSetDiaIDRange = handleSetDiaIDRange;
|
|
235
250
|
function handleResizeRange(draft, action) {
|
|
236
|
-
|
|
237
|
-
|
|
251
|
+
const activeSpectrum = draft.view.spectra.activeSpectra[draft.view.spectra.activeTab];
|
|
252
|
+
if (activeSpectrum?.id) {
|
|
253
|
+
const { index } = activeSpectrum;
|
|
238
254
|
(0, Spectrum1D_1.changeRange)(draft.data[index], action.data);
|
|
239
255
|
}
|
|
240
256
|
}
|
|
241
257
|
exports.handleResizeRange = handleResizeRange;
|
|
242
258
|
function handleChangeRangeSum(draft, options) {
|
|
243
|
-
const { data,
|
|
259
|
+
const { data, view: { spectra: { activeTab: nucleus }, }, } = draft;
|
|
260
|
+
const activeSpectrum = draft.view.spectra.activeSpectra[draft.view.spectra.activeTab];
|
|
244
261
|
if (activeSpectrum?.id) {
|
|
245
262
|
const { index } = activeSpectrum;
|
|
246
263
|
const datum = data[index];
|
|
@@ -252,10 +269,19 @@ exports.handleChangeRangeSum = handleChangeRangeSum;
|
|
|
252
269
|
function addNewRange(draft, props) {
|
|
253
270
|
const { startX, endX, id } = props;
|
|
254
271
|
const range = (0, getRange_1.default)(draft, { startX, endX });
|
|
255
|
-
const {
|
|
272
|
+
const { view: { spectra: { activeTab: nucleus }, }, molecules, } = draft;
|
|
273
|
+
const activeSpectrum = draft.view.spectra.activeSpectra[draft.view.spectra.activeTab];
|
|
256
274
|
if (activeSpectrum?.id) {
|
|
257
275
|
const { index } = activeSpectrum;
|
|
258
276
|
const [from, to] = range;
|
|
277
|
+
// add range intial state
|
|
278
|
+
const rangeState = draft.view.ranges.find((r) => r.spectrumID === activeSpectrum.id);
|
|
279
|
+
if (!rangeState) {
|
|
280
|
+
draft.view.ranges.push({
|
|
281
|
+
spectrumID: activeSpectrum.id,
|
|
282
|
+
...Reducer_1.rangeStateInit,
|
|
283
|
+
});
|
|
284
|
+
}
|
|
259
285
|
(0, Spectrum1D_1.addRange)(draft.data[index], {
|
|
260
286
|
from,
|
|
261
287
|
to,
|
|
@@ -319,8 +345,9 @@ function handleChangeRangesSumFlag(draft, action) {
|
|
|
319
345
|
exports.handleChangeRangesSumFlag = handleChangeRangesSumFlag;
|
|
320
346
|
function handleUpdateRange(draft, action) {
|
|
321
347
|
const { range, resetSelectTool = false } = action.payload;
|
|
322
|
-
|
|
323
|
-
|
|
348
|
+
const activeSpectrum = draft.view.spectra.activeSpectra[draft.view.spectra.activeTab];
|
|
349
|
+
if (activeSpectrum?.id && range.id) {
|
|
350
|
+
const datum = draft.data[activeSpectrum?.index];
|
|
324
351
|
const index = datum.ranges.values.findIndex((_range) => _range.id === range.id);
|
|
325
352
|
datum.ranges.values[index] = range;
|
|
326
353
|
}
|
|
@@ -329,17 +356,48 @@ function handleUpdateRange(draft, action) {
|
|
|
329
356
|
}
|
|
330
357
|
}
|
|
331
358
|
exports.handleUpdateRange = handleUpdateRange;
|
|
332
|
-
function handleShowMultiplicityTrees(draft) {
|
|
333
|
-
|
|
334
|
-
|
|
359
|
+
function handleShowMultiplicityTrees(draft, action) {
|
|
360
|
+
const { id } = action.payload;
|
|
361
|
+
const range = draft.view.ranges.find((r) => r.spectrumID === id);
|
|
362
|
+
if (range) {
|
|
363
|
+
range.showMultiplicityTrees = !range.showMultiplicityTrees;
|
|
364
|
+
}
|
|
365
|
+
else {
|
|
366
|
+
draft.view.ranges.push({
|
|
367
|
+
spectrumID: id,
|
|
368
|
+
...Reducer_1.rangeStateInit,
|
|
369
|
+
showMultiplicityTrees: !Reducer_1.rangeStateInit.showMultiplicityTrees,
|
|
370
|
+
});
|
|
371
|
+
}
|
|
335
372
|
}
|
|
336
373
|
exports.handleShowMultiplicityTrees = handleShowMultiplicityTrees;
|
|
337
|
-
function handleShowRangesIntegrals(draft) {
|
|
338
|
-
|
|
339
|
-
|
|
374
|
+
function handleShowRangesIntegrals(draft, action) {
|
|
375
|
+
const { id } = action.payload;
|
|
376
|
+
const range = draft.view.ranges.find((r) => r.spectrumID === id);
|
|
377
|
+
if (range) {
|
|
378
|
+
range.showRangesIntegrals = !range.showRangesIntegrals;
|
|
379
|
+
}
|
|
380
|
+
else {
|
|
381
|
+
draft.view.ranges.push({
|
|
382
|
+
spectrumID: id,
|
|
383
|
+
...Reducer_1.rangeStateInit,
|
|
384
|
+
showRangesIntegrals: !Reducer_1.rangeStateInit.showRangesIntegrals,
|
|
385
|
+
});
|
|
386
|
+
}
|
|
340
387
|
}
|
|
341
388
|
exports.handleShowRangesIntegrals = handleShowRangesIntegrals;
|
|
342
|
-
function handleShowJGraph(draft) {
|
|
343
|
-
|
|
389
|
+
function handleShowJGraph(draft, action) {
|
|
390
|
+
const { id } = action.payload;
|
|
391
|
+
const range = draft.view.ranges.find((r) => r.spectrumID === id);
|
|
392
|
+
if (range) {
|
|
393
|
+
range.showJGraph = !range.showJGraph;
|
|
394
|
+
}
|
|
395
|
+
else {
|
|
396
|
+
draft.view.ranges.push({
|
|
397
|
+
spectrumID: id,
|
|
398
|
+
...Reducer_1.rangeStateInit,
|
|
399
|
+
showJGraph: !Reducer_1.rangeStateInit.showJGraph,
|
|
400
|
+
});
|
|
401
|
+
}
|
|
344
402
|
}
|
|
345
403
|
exports.handleShowJGraph = handleShowJGraph;
|
|
@@ -34,13 +34,13 @@ function analyzeSpectra(draft, action) {
|
|
|
34
34
|
MultipleAnalysis.analyzeSpectra(draft.data, draft.spectraAnalysis, {
|
|
35
35
|
from,
|
|
36
36
|
to,
|
|
37
|
-
nucleus: draft.activeTab,
|
|
37
|
+
nucleus: draft.view.spectra.activeTab,
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
40
|
exports.analyzeSpectra = analyzeSpectra;
|
|
41
41
|
function handleDeleteSpectraRanges(draft, action) {
|
|
42
42
|
const { colKey } = action;
|
|
43
|
-
MultipleAnalysis.deleteSpectraAnalysis(draft.spectraAnalysis, colKey, draft.activeTab);
|
|
43
|
+
MultipleAnalysis.deleteSpectraAnalysis(draft.spectraAnalysis, colKey, draft.view.spectra.activeTab);
|
|
44
44
|
}
|
|
45
45
|
exports.handleDeleteSpectraRanges = handleDeleteSpectraRanges;
|
|
46
46
|
function handleResizeSpectraRange(draft, action) {
|
|
@@ -48,18 +48,18 @@ function handleResizeSpectraRange(draft, action) {
|
|
|
48
48
|
MultipleAnalysis.analyzeSpectra(draft.data, draft.spectraAnalysis, {
|
|
49
49
|
from,
|
|
50
50
|
to,
|
|
51
|
-
nucleus: draft.activeTab,
|
|
51
|
+
nucleus: draft.view.spectra.activeTab,
|
|
52
52
|
columnKey,
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
55
|
exports.handleResizeSpectraRange = handleResizeSpectraRange;
|
|
56
56
|
function handleSetColumns(draft, action) {
|
|
57
57
|
const data = action.payload;
|
|
58
|
-
MultipleAnalysis.setColumn(draft.spectraAnalysis, draft.activeTab, data);
|
|
58
|
+
MultipleAnalysis.setColumn(draft.spectraAnalysis, draft.view.spectra.activeTab, data);
|
|
59
59
|
}
|
|
60
60
|
exports.handleSetColumns = handleSetColumns;
|
|
61
61
|
function handleFilterColumn(draft, action) {
|
|
62
62
|
const { columnKey, valueKey } = action.payload;
|
|
63
|
-
MultipleAnalysis.changeColumnValueKey(draft.spectraAnalysis, draft.activeTab, columnKey, valueKey);
|
|
63
|
+
MultipleAnalysis.changeColumnValueKey(draft.spectraAnalysis, draft.view.spectra.activeTab, columnKey, valueKey);
|
|
64
64
|
}
|
|
65
65
|
exports.handleFilterColumn = handleFilterColumn;
|
|
@@ -96,10 +96,10 @@ function handleChangePeaksMarkersVisibility(draft, data) {
|
|
|
96
96
|
exports.handleChangePeaksMarkersVisibility = handleChangePeaksMarkersVisibility;
|
|
97
97
|
function handleChangeActiveSpectrum(draft, activeSpectrum) {
|
|
98
98
|
let refreshDomain = false;
|
|
99
|
-
const currentActiveSpectrum = draft.
|
|
99
|
+
const currentActiveSpectrum = draft.view.spectra.activeSpectra[draft.view.spectra.activeTab];
|
|
100
100
|
if (activeSpectrum) {
|
|
101
101
|
const newIndex = draft.data.findIndex((d) => d.id === activeSpectrum.id);
|
|
102
|
-
const oldIndex = draft.data.findIndex((d) => d.id ===
|
|
102
|
+
const oldIndex = draft.data.findIndex((d) => d.id === currentActiveSpectrum?.id);
|
|
103
103
|
if (newIndex !== -1) {
|
|
104
104
|
const newActiveSpectrum = draft.data[newIndex];
|
|
105
105
|
newActiveSpectrum.display.isVisible = true;
|
|
@@ -113,8 +113,8 @@ function handleChangeActiveSpectrum(draft, activeSpectrum) {
|
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
115
|
activeSpectrum = { ...activeSpectrum, index: newIndex };
|
|
116
|
-
draft.
|
|
117
|
-
|
|
116
|
+
draft.view.spectra.activeSpectra[draft.view.spectra.activeTab] =
|
|
117
|
+
activeSpectrum;
|
|
118
118
|
}
|
|
119
119
|
else {
|
|
120
120
|
if (currentActiveSpectrum) {
|
|
@@ -124,8 +124,7 @@ function handleChangeActiveSpectrum(draft, activeSpectrum) {
|
|
|
124
124
|
else {
|
|
125
125
|
refreshDomain = false;
|
|
126
126
|
}
|
|
127
|
-
draft.
|
|
128
|
-
draft.tabActiveSpectrum[draft.activeTab] = null;
|
|
127
|
+
draft.view.spectra.activeSpectra[draft.view.spectra.activeTab] = null;
|
|
129
128
|
}
|
|
130
129
|
if (ToolTypes_1.options[draft.toolOptions.selectedTool].isFilter) {
|
|
131
130
|
draft.toolOptions.selectedTool = ToolTypes_1.options.zoom.id;
|
|
@@ -138,7 +137,7 @@ function handleChangeActiveSpectrum(draft, activeSpectrum) {
|
|
|
138
137
|
* if the new active spectrum different than the previous active spectrum fid then refresh the domain andf the mode.
|
|
139
138
|
*/
|
|
140
139
|
if (draft.toolOptions.data.activeFilterID) {
|
|
141
|
-
(0, FiltersActions_1.resetSpectrumByFilter)(draft
|
|
140
|
+
(0, FiltersActions_1.resetSpectrumByFilter)(draft);
|
|
142
141
|
}
|
|
143
142
|
else if (refreshDomain) {
|
|
144
143
|
(0, DomainActions_1.setDomain)(draft);
|
|
@@ -171,14 +170,18 @@ function handleDeleteSpectra(draft, action) {
|
|
|
171
170
|
else {
|
|
172
171
|
draft.data = [];
|
|
173
172
|
}
|
|
174
|
-
(0, ToolsActions_1.setActiveTab)(draft, {
|
|
173
|
+
(0, ToolsActions_1.setActiveTab)(draft, {
|
|
174
|
+
tab: draft.view.spectra.activeTab,
|
|
175
|
+
refreshActiveTab: true,
|
|
176
|
+
});
|
|
175
177
|
}
|
|
176
178
|
exports.handleDeleteSpectra = handleDeleteSpectra;
|
|
177
179
|
function addMissingProjectionHandler(draft, action) {
|
|
178
180
|
const state = (0, immer_1.original)(draft);
|
|
179
181
|
const { nucleus } = action;
|
|
180
|
-
|
|
181
|
-
|
|
182
|
+
const activeSpectrum = draft.view.spectra.activeSpectra[draft.view.spectra.activeTab];
|
|
183
|
+
if (activeSpectrum?.id) {
|
|
184
|
+
const { index } = activeSpectrum;
|
|
182
185
|
for (let n of nucleus) {
|
|
183
186
|
const datum1D = (0, Spectrum2D_1.getMissingProjection)(state.data[index], n, draft.usedColors);
|
|
184
187
|
draft.data.push(datum1D);
|
|
@@ -195,7 +198,7 @@ function alignSpectraHandler(draft, action) {
|
|
|
195
198
|
if (draft.data && draft.data.length > 0) {
|
|
196
199
|
for (let datum of draft.data) {
|
|
197
200
|
if (datum.info?.dimension === 1 &&
|
|
198
|
-
datum.info.nucleus === draft.activeTab &&
|
|
201
|
+
datum.info.nucleus === draft.view.spectra.activeTab &&
|
|
199
202
|
!datum.info?.isFid) {
|
|
200
203
|
const shift = (0, Spectrum1D_1.getReferenceShift)(datum, { ...action.payload });
|
|
201
204
|
(0, FiltersManager_1.applyFilter)(datum, [
|
|
@@ -4,83 +4,22 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.resetSpectraScale = exports.setSpectraSameTopHandler = exports.setTab = exports.setActiveTab = exports.levelChangeHandler = exports.handelSetActiveTab = exports.zoomOut = exports.handleZoom = exports.setVerticalIndicatorXPosition = exports.handleBrushEnd = exports.handleToggleRealImaginaryVisibility = exports.handleDeleteBaseLineZone = exports.handleAddBaseLineZone = exports.handleChangeSpectrumDisplayMode = exports.setSpectrumsVerticalAlign = exports.setSelectedOptionPanel = exports.setSelectedTool = exports.resetSelectedTool = void 0;
|
|
7
|
-
const
|
|
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 generateID_1 = __importDefault(require("../../../data/utilities/generateID"));
|
|
11
10
|
const scale_1 = require("../../1d/utilities/scale");
|
|
12
11
|
const DimensionLayout_1 = require("../../2d/utilities/DimensionLayout");
|
|
13
12
|
const scale_2 = require("../../2d/utilities/scale");
|
|
14
13
|
const ToolTypes_1 = require("../../toolbar/ToolTypes");
|
|
15
14
|
const GroupByInfoKey_1 = __importDefault(require("../../utility/GroupByInfoKey"));
|
|
15
|
+
const Reducer_1 = require("../Reducer");
|
|
16
16
|
const Constants_1 = require("../core/Constants");
|
|
17
17
|
const Zoom1DManager_1 = require("../helper/Zoom1DManager");
|
|
18
18
|
const ZoomHistoryManager_1 = __importDefault(require("../helper/ZoomHistoryManager"));
|
|
19
|
+
const getActiveSpectrumOrFail_1 = require("../helper/getActiveSpectrumOrFail");
|
|
19
20
|
const DomainActions_1 = require("./DomainActions");
|
|
20
21
|
const FiltersActions_1 = require("./FiltersActions");
|
|
21
22
|
const PreferencesActions_1 = require("./PreferencesActions");
|
|
22
|
-
function getStrongestPeak(draft) {
|
|
23
|
-
const { activeSpectrum, data } = draft;
|
|
24
|
-
if (activeSpectrum) {
|
|
25
|
-
const activeData = data[activeSpectrum?.index].data;
|
|
26
|
-
const strongestPeakValue = (0, d3_1.max)(activeData.re);
|
|
27
|
-
const index = activeData.re.findIndex((val) => val === strongestPeakValue);
|
|
28
|
-
return {
|
|
29
|
-
xValue: activeData.x[index],
|
|
30
|
-
yValue: strongestPeakValue,
|
|
31
|
-
index,
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
function checkFilterHasTempData(selectedToolId) {
|
|
36
|
-
return [ToolTypes_1.options.phaseCorrection.id, ToolTypes_1.options.baselineCorrection.id].includes(selectedToolId);
|
|
37
|
-
}
|
|
38
|
-
function setFilterChanges(draft, selectedFilterID) {
|
|
39
|
-
const activeSpectrumId = draft.activeSpectrum?.id;
|
|
40
|
-
// If the user selects the filter from the filters list or selects its tool and has a record in the filter list for preview and edit
|
|
41
|
-
if (checkFilterHasTempData(selectedFilterID)) {
|
|
42
|
-
//return back the spectra data to point of time before applying a specific filter
|
|
43
|
-
const dataSavePoint = (0, FiltersActions_1.resetSpectrumByFilter)(draft, selectedFilterID, {
|
|
44
|
-
updateDomain: false,
|
|
45
|
-
rollback: true,
|
|
46
|
-
searchBy: 'name',
|
|
47
|
-
returnCurrentDatum: true,
|
|
48
|
-
});
|
|
49
|
-
// create a temporary clone of the data
|
|
50
|
-
draft.tempData = (0, immer_1.current)(draft).data;
|
|
51
|
-
if (dataSavePoint) {
|
|
52
|
-
draft.tempData[dataSavePoint?.index] = dataSavePoint?.datum;
|
|
53
|
-
}
|
|
54
|
-
switch (selectedFilterID) {
|
|
55
|
-
case ToolTypes_1.options.phaseCorrection.id: {
|
|
56
|
-
// look for the strongest peak to set it as a pivot
|
|
57
|
-
const { xValue, index } = getStrongestPeak(draft) || {
|
|
58
|
-
xValue: 0,
|
|
59
|
-
index: 0,
|
|
60
|
-
};
|
|
61
|
-
draft.toolOptions.data.pivot = { value: xValue, index };
|
|
62
|
-
break;
|
|
63
|
-
}
|
|
64
|
-
case ToolTypes_1.options.baselineCorrection.id: {
|
|
65
|
-
if (draft.activeSpectrum?.id) {
|
|
66
|
-
const baselineCorrectionFilter = (0, immer_1.current)(draft).data[draft.activeSpectrum.index].filters.find((filter) => filter.name === ToolTypes_1.options.baselineCorrection.id);
|
|
67
|
-
draft.toolOptions.data.baselineCorrection.zones =
|
|
68
|
-
baselineCorrectionFilter
|
|
69
|
-
? baselineCorrectionFilter.value.zones
|
|
70
|
-
: [];
|
|
71
|
-
}
|
|
72
|
-
break;
|
|
73
|
-
}
|
|
74
|
-
default:
|
|
75
|
-
break;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
else if (checkFilterHasTempData(draft.toolOptions.selectedTool)) {
|
|
79
|
-
draft.toolOptions.data.activeFilterID = null;
|
|
80
|
-
const spectrumIndex = draft.data.findIndex((spectrum) => spectrum.id === activeSpectrumId);
|
|
81
|
-
draft.data[spectrumIndex].data = draft.tempData[spectrumIndex].data;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
23
|
function resetTool(draft, setDefaultTool = true) {
|
|
85
24
|
// reset temp range
|
|
86
25
|
setSelectedOptionPanel(draft, null);
|
|
@@ -110,7 +49,18 @@ function setSelectedTool(draft, action) {
|
|
|
110
49
|
if (selectedTool) {
|
|
111
50
|
// start Range edit mode
|
|
112
51
|
if (selectedTool === ToolTypes_1.options.editRange.id) {
|
|
113
|
-
|
|
52
|
+
const activeSpectrum = (0, getActiveSpectrumOrFail_1.getActiveSpectrumOrFail)(draft);
|
|
53
|
+
const range = draft.view.ranges.find((r) => r.spectrumID === activeSpectrum?.id);
|
|
54
|
+
if (range) {
|
|
55
|
+
range.showMultiplicityTrees = true;
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
draft.view.ranges.push({
|
|
59
|
+
spectrumID: activeSpectrum.id,
|
|
60
|
+
...Reducer_1.rangeStateInit,
|
|
61
|
+
showMultiplicityTrees: true,
|
|
62
|
+
});
|
|
63
|
+
}
|
|
114
64
|
}
|
|
115
65
|
if (selectedTool !== draft.toolOptions.selectedTool) {
|
|
116
66
|
resetTool(draft, false);
|
|
@@ -120,7 +70,7 @@ function setSelectedTool(draft, action) {
|
|
|
120
70
|
setSelectedOptionPanel(draft, selectedTool);
|
|
121
71
|
}
|
|
122
72
|
if (ToolTypes_1.options[selectedTool].isFilter) {
|
|
123
|
-
setFilterChanges(draft, selectedTool);
|
|
73
|
+
(0, FiltersActions_1.setFilterChanges)(draft, selectedTool);
|
|
124
74
|
}
|
|
125
75
|
}
|
|
126
76
|
else {
|
|
@@ -135,9 +85,9 @@ function setSelectedOptionPanel(draft, selectedOptionPanel) {
|
|
|
135
85
|
}
|
|
136
86
|
exports.setSelectedOptionPanel = setSelectedOptionPanel;
|
|
137
87
|
function setSpectrumsVerticalAlign(draft) {
|
|
138
|
-
const align = ['stack', '
|
|
139
|
-
? '
|
|
140
|
-
: '
|
|
88
|
+
const align = ['stack', 'bottom'].includes(draft.verticalAlign.align)
|
|
89
|
+
? 'center'
|
|
90
|
+
: 'bottom';
|
|
141
91
|
(0, PreferencesActions_1.changeSpectrumVerticalAlignment)(draft, { align });
|
|
142
92
|
}
|
|
143
93
|
exports.setSpectrumsVerticalAlign = setSpectrumsVerticalAlign;
|
|
@@ -159,7 +109,7 @@ function handleAddBaseLineZone(draft, { from, to }) {
|
|
|
159
109
|
}
|
|
160
110
|
const zones = draft.toolOptions.data.baselineCorrection.zones;
|
|
161
111
|
zones.push({
|
|
162
|
-
id: (0,
|
|
112
|
+
id: (0, uuid_1.v4)(),
|
|
163
113
|
from: zone[0],
|
|
164
114
|
to: zone[1],
|
|
165
115
|
});
|
|
@@ -193,7 +143,7 @@ function handleBrushEnd(draft, action) {
|
|
|
193
143
|
const endY = yScale.invert(action.endY);
|
|
194
144
|
const domainX = startX > endX ? [endX, startX] : [startX, endX];
|
|
195
145
|
const domainY = startY > endY ? [endY, startY] : [startY, endY];
|
|
196
|
-
const brushHistory = (0, ZoomHistoryManager_1.default)(draft.zoom.history, draft.activeTab);
|
|
146
|
+
const brushHistory = (0, ZoomHistoryManager_1.default)(draft.zoom.history, draft.view.spectra.activeTab);
|
|
197
147
|
if (draft.displayerMode === Constants_1.DISPLAYER_MODE.DM_2D) {
|
|
198
148
|
switch (action.trackID) {
|
|
199
149
|
case DimensionLayout_1.LAYOUT.CENTER_2D:
|
|
@@ -222,22 +172,26 @@ function handleBrushEnd(draft, action) {
|
|
|
222
172
|
}
|
|
223
173
|
exports.handleBrushEnd = handleBrushEnd;
|
|
224
174
|
function setVerticalIndicatorXPosition(draft, position) {
|
|
225
|
-
|
|
175
|
+
const activeSpectrum = draft.view.spectra.activeSpectra[draft.view.spectra.activeTab];
|
|
176
|
+
if (activeSpectrum?.id) {
|
|
226
177
|
const scaleX = (0, scale_1.getXScale)(draft);
|
|
227
178
|
const value = scaleX.invert(position);
|
|
228
|
-
const datum = draft.data[
|
|
179
|
+
const datum = draft.data[activeSpectrum.index];
|
|
229
180
|
const index = (0, ml_spectra_processing_1.xFindClosestIndex)(datum.data.x, value);
|
|
230
181
|
draft.toolOptions.data.pivot = { value, index };
|
|
231
182
|
}
|
|
232
183
|
}
|
|
233
184
|
exports.setVerticalIndicatorXPosition = setVerticalIndicatorXPosition;
|
|
234
185
|
function getSpectrumID(draft, index) {
|
|
235
|
-
const spectrum = draft.
|
|
236
|
-
return spectrum?.id
|
|
186
|
+
const spectrum = draft.view.spectra.activeSpectra[draft.view.spectra.activeTab.split(',')[index]];
|
|
187
|
+
return spectrum?.id || null;
|
|
237
188
|
}
|
|
238
189
|
function handleZoom(draft, action) {
|
|
239
190
|
const { event, trackID, selectedTool } = action;
|
|
240
|
-
const {
|
|
191
|
+
const { view: { ranges: rangeState }, displayerMode, } = draft;
|
|
192
|
+
const activeSpectrum = draft.view.spectra.activeSpectra[draft.view.spectra.activeTab];
|
|
193
|
+
const { showRangesIntegrals } = rangeState.find((r) => r.spectrumID === activeSpectrum?.id) ||
|
|
194
|
+
Reducer_1.rangeStateInit;
|
|
241
195
|
if (displayerMode === Constants_1.DISPLAYER_MODE.DM_2D) {
|
|
242
196
|
const index = trackID === DimensionLayout_1.LAYOUT.TOP_1D ? 0 : trackID === DimensionLayout_1.LAYOUT.LEFT_1D ? 1 : null;
|
|
243
197
|
if (index !== null) {
|
|
@@ -270,7 +224,7 @@ exports.handleZoom = handleZoom;
|
|
|
270
224
|
function zoomOut(draft, action) {
|
|
271
225
|
if (draft?.data.length > 0) {
|
|
272
226
|
const { zoomType, trackID } = action;
|
|
273
|
-
const zoomHistory = (0, ZoomHistoryManager_1.default)(draft.zoom.history, draft.activeTab);
|
|
227
|
+
const zoomHistory = (0, ZoomHistoryManager_1.default)(draft.zoom.history, draft.view.spectra.activeTab);
|
|
274
228
|
if (draft.displayerMode === Constants_1.DISPLAYER_MODE.DM_1D) {
|
|
275
229
|
switch (zoomType) {
|
|
276
230
|
case Zoom1DManager_1.ZoomType.HORIZONTAL: {
|
|
@@ -314,14 +268,14 @@ function zoomOut(draft, action) {
|
|
|
314
268
|
}
|
|
315
269
|
exports.zoomOut = zoomOut;
|
|
316
270
|
function hasAcceptedSpectrum(draft, index) {
|
|
317
|
-
const nucleuses = draft.activeTab.split(',');
|
|
318
|
-
const activeSpectrum = draft.
|
|
271
|
+
const nucleuses = draft.view.spectra.activeTab.split(',');
|
|
272
|
+
const activeSpectrum = draft.view.spectra.activeSpectra[nucleuses[index]];
|
|
319
273
|
return (activeSpectrum?.id &&
|
|
320
274
|
!draft.data[activeSpectrum.index].info.isFid);
|
|
321
275
|
}
|
|
322
276
|
function setMargin(draft) {
|
|
323
277
|
if (draft.displayerMode === Constants_1.DISPLAYER_MODE.DM_2D &&
|
|
324
|
-
draft.toolOptions.selectedTool !== ToolTypes_1.options.
|
|
278
|
+
draft.toolOptions.selectedTool !== ToolTypes_1.options.slicing.id) {
|
|
325
279
|
const top = hasAcceptedSpectrum(draft, 0)
|
|
326
280
|
? Constants_1.MARGIN['2D'].top
|
|
327
281
|
: Constants_1.MARGIN['1D'].top;
|
|
@@ -330,7 +284,7 @@ function setMargin(draft) {
|
|
|
330
284
|
: Constants_1.MARGIN['1D'].left;
|
|
331
285
|
draft.margin = { ...Constants_1.MARGIN['2D'], top, left };
|
|
332
286
|
}
|
|
333
|
-
else if (draft.toolOptions.selectedTool === ToolTypes_1.options.
|
|
287
|
+
else if (draft.toolOptions.selectedTool === ToolTypes_1.options.slicing.id) {
|
|
334
288
|
draft.margin = Constants_1.MARGIN['2D'];
|
|
335
289
|
}
|
|
336
290
|
else if (draft.displayerMode === Constants_1.DISPLAYER_MODE.DM_1D) {
|
|
@@ -340,7 +294,7 @@ function setMargin(draft) {
|
|
|
340
294
|
function processing2DData(draft, data) {
|
|
341
295
|
if (draft.displayerMode === Constants_1.DISPLAYER_MODE.DM_2D) {
|
|
342
296
|
let _data = {};
|
|
343
|
-
for (const datum of data[draft.activeTab]) {
|
|
297
|
+
for (const datum of data[draft.view.spectra.activeTab]) {
|
|
344
298
|
_data[datum.id] = datum.processingController.drawContours();
|
|
345
299
|
}
|
|
346
300
|
draft.contours = _data;
|
|
@@ -386,29 +340,26 @@ function setTabActiveSpectrum(draft, dataGroupByTab) {
|
|
|
386
340
|
}
|
|
387
341
|
}
|
|
388
342
|
}
|
|
389
|
-
draft.
|
|
343
|
+
draft.view.spectra.activeSpectra = tabActiveSpectrum;
|
|
390
344
|
return tabs2D;
|
|
391
345
|
}
|
|
392
346
|
function setTab(draft, dataGroupByTab, tab, refresh = false) {
|
|
393
347
|
const groupByTab = Object.keys(dataGroupByTab).sort((a, b) => a.split(',').length > b.split(',').length ? -1 : 1);
|
|
394
348
|
if (JSON.stringify(groupByTab) !==
|
|
395
|
-
JSON.stringify(Object.keys(draft.
|
|
349
|
+
JSON.stringify(Object.keys(draft.view.spectra.activeSpectra)) ||
|
|
396
350
|
refresh) {
|
|
397
351
|
const tabs2D = setTabActiveSpectrum(draft, dataGroupByTab);
|
|
398
352
|
if (tabs2D.length > 0 && tab == null) {
|
|
399
|
-
draft.
|
|
400
|
-
draft.activeTab = tabs2D[0];
|
|
353
|
+
draft.view.spectra.activeTab = tabs2D[0];
|
|
401
354
|
}
|
|
402
355
|
else {
|
|
403
|
-
draft.
|
|
404
|
-
draft.activeTab = tab;
|
|
356
|
+
draft.view.spectra.activeTab = tab;
|
|
405
357
|
}
|
|
406
358
|
}
|
|
407
359
|
else {
|
|
408
|
-
draft.activeTab = tab;
|
|
409
|
-
draft.activeSpectrum = draft.tabActiveSpectrum[tab];
|
|
360
|
+
draft.view.spectra.activeTab = tab;
|
|
410
361
|
}
|
|
411
|
-
setDisplayerMode(draft, dataGroupByTab[draft.activeTab]);
|
|
362
|
+
setDisplayerMode(draft, dataGroupByTab[draft.view.spectra.activeTab]);
|
|
412
363
|
setMargin(draft);
|
|
413
364
|
}
|
|
414
365
|
exports.setTab = setTab;
|
|
@@ -423,7 +374,7 @@ function setActiveTab(draft, options) {
|
|
|
423
374
|
processing2DData(draft, dataGroupByNucleus);
|
|
424
375
|
(0, DomainActions_1.setDomain)(draft, domainOptions);
|
|
425
376
|
(0, DomainActions_1.setIntegralsYDomain)(draft, dataGroupByNucleus[currentTab]);
|
|
426
|
-
const zoomHistory = (0, ZoomHistoryManager_1.default)(draft.zoom.history, draft.activeTab);
|
|
377
|
+
const zoomHistory = (0, ZoomHistoryManager_1.default)(draft.zoom.history, draft.view.spectra.activeTab);
|
|
427
378
|
const zoomValue = zoomHistory.getLast();
|
|
428
379
|
if (zoomValue) {
|
|
429
380
|
draft.xDomain = zoomValue.xDomain;
|
|
@@ -439,9 +390,10 @@ function handelSetActiveTab(draft, tab) {
|
|
|
439
390
|
}
|
|
440
391
|
exports.handelSetActiveTab = handelSetActiveTab;
|
|
441
392
|
function levelChangeHandler(draft, { deltaY, shiftKey }) {
|
|
393
|
+
const activeSpectrum = draft.view.spectra.activeSpectra[draft.view.spectra.activeTab];
|
|
442
394
|
try {
|
|
443
|
-
if (
|
|
444
|
-
const { index, id } =
|
|
395
|
+
if (activeSpectrum?.id) {
|
|
396
|
+
const { index, id } = activeSpectrum;
|
|
445
397
|
const processingController = draft.data[index]
|
|
446
398
|
.processingController;
|
|
447
399
|
if (shiftKey) {
|