nmrium 1.8.0 → 1.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/component/1d/ApodizationLine.js +1 -1
- package/lib/component/1d/ApodizationLine.js.map +1 -1
- package/lib/component/1d/BrushTracker1D.d.ts.map +1 -1
- package/lib/component/1d/BrushTracker1D.js.map +1 -1
- package/lib/component/1d/FooterBanner.js.map +1 -1
- package/lib/component/1d/LinesSeries.js +2 -2
- package/lib/component/1d/LinesSeries.js.map +1 -1
- package/lib/component/1d/SVGContent1D.d.ts.map +1 -1
- package/lib/component/1d/SVGContent1D.js +2 -1
- package/lib/component/1d/SVGContent1D.js.map +1 -1
- package/lib/component/1d/SimilarityTree.d.ts.map +1 -1
- package/lib/component/1d/SimilarityTree.js.map +1 -1
- package/lib/component/1d/inset/InsetProvider.d.ts.map +1 -1
- package/lib/component/1d/inset/InsetProvider.js.map +1 -1
- package/lib/component/1d/integral/IntegralResizable.d.ts.map +1 -1
- package/lib/component/1d/integral/IntegralResizable.js.map +1 -1
- package/lib/component/1d/matrix/Boxplot.js.map +1 -1
- package/lib/component/1d/multiAnalysis/AnalysisRange.d.ts.map +1 -1
- package/lib/component/1d/multiAnalysis/AnalysisRange.js.map +1 -1
- package/lib/component/1d/multiplicityTree/MultiplicityTree.d.ts.map +1 -1
- package/lib/component/1d/multiplicityTree/MultiplicityTree.js +13 -20
- package/lib/component/1d/multiplicityTree/MultiplicityTree.js.map +1 -1
- package/lib/component/1d/multiplicityTree/generateTreeNodes.d.ts +1 -0
- package/lib/component/1d/multiplicityTree/generateTreeNodes.d.ts.map +1 -1
- package/lib/component/1d/multiplicityTree/generateTreeNodes.js +2 -1
- package/lib/component/1d/multiplicityTree/generateTreeNodes.js.map +1 -1
- package/lib/component/1d/peaks/PeakAnnotationsSpreadMode.d.ts.map +1 -1
- package/lib/component/1d/peaks/PeakAnnotationsSpreadMode.js.map +1 -1
- package/lib/component/1d/peaks/PeakEditionManager.d.ts.map +1 -1
- package/lib/component/1d/peaks/PeakEditionManager.js +2 -2
- package/lib/component/1d/peaks/PeakEditionManager.js.map +1 -1
- package/lib/component/1d/peaks/Peaks.d.ts +4 -1
- package/lib/component/1d/peaks/Peaks.d.ts.map +1 -1
- package/lib/component/1d/peaks/Peaks.js.map +1 -1
- package/lib/component/1d/ranges/AssignmentLabel.d.ts +2 -1
- package/lib/component/1d/ranges/AssignmentLabel.d.ts.map +1 -1
- package/lib/component/1d/ranges/AssignmentLabel.js +6 -4
- package/lib/component/1d/ranges/AssignmentLabel.js.map +1 -1
- package/lib/component/1d/ranges/Atoms.js +2 -2
- package/lib/component/1d/ranges/Atoms.js.map +1 -1
- package/lib/component/1d/ranges/Range.d.ts +2 -1
- package/lib/component/1d/ranges/Range.d.ts.map +1 -1
- package/lib/component/1d/ranges/Range.js +28 -56
- package/lib/component/1d/ranges/Range.js.map +1 -1
- package/lib/component/1d/ranges/Ranges.d.ts.map +1 -1
- package/lib/component/1d/ranges/Ranges.js +19 -13
- package/lib/component/1d/ranges/Ranges.js.map +1 -1
- package/lib/component/1d/ranges/useAssignmentsPopoverActionsButtons.d.ts +14 -0
- package/lib/component/1d/ranges/useAssignmentsPopoverActionsButtons.d.ts.map +1 -0
- package/lib/component/1d/ranges/useAssignmentsPopoverActionsButtons.js +67 -0
- package/lib/component/1d/ranges/useAssignmentsPopoverActionsButtons.js.map +1 -0
- package/lib/component/1d/tool/BaseLineZones.d.ts.map +1 -1
- package/lib/component/1d/tool/BaseLineZones.js.map +1 -1
- package/lib/component/1d/utilities/intersectionResolver.d.ts.map +1 -1
- package/lib/component/1d/utilities/intersectionResolver.js.map +1 -1
- package/lib/component/1d-2d/FieldEdition.d.ts.map +1 -1
- package/lib/component/1d-2d/FieldEdition.js.map +1 -1
- package/lib/component/2d/1d-tracer/VerticalSliceChart.js.map +1 -1
- package/lib/component/2d/1d-tracer/phase-correction-traces/PhaseTraces.js +1 -1
- package/lib/component/2d/1d-tracer/phase-correction-traces/PhaseTraces.js.map +1 -1
- package/lib/component/2d/1d-tracer/phase-correction-traces/SpectrumPhaseTrace.js +1 -1
- package/lib/component/2d/1d-tracer/phase-correction-traces/SpectrumPhaseTrace.js.map +1 -1
- package/lib/component/2d/BrushTracker2D.d.ts.map +1 -1
- package/lib/component/2d/BrushTracker2D.js +41 -46
- package/lib/component/2d/BrushTracker2D.js.map +1 -1
- package/lib/component/2d/FooterBanner.d.ts +2 -2
- package/lib/component/2d/FooterBanner.d.ts.map +1 -1
- package/lib/component/2d/FooterBanner.js +63 -97
- package/lib/component/2d/FooterBanner.js.map +1 -1
- package/lib/component/2d/SVGContent2D.d.ts +2 -2
- package/lib/component/2d/SVGContent2D.d.ts.map +1 -1
- package/lib/component/2d/SVGContent2D.js.map +1 -1
- package/lib/component/2d/SlicingView.js +1 -1
- package/lib/component/2d/SlicingView.js.map +1 -1
- package/lib/component/2d/Viewer2D.js +1 -1
- package/lib/component/2d/Viewer2D.js.map +1 -1
- package/lib/component/2d/ft/FTContainer.d.ts +2 -2
- package/lib/component/2d/ft/FTContainer.d.ts.map +1 -1
- package/lib/component/2d/ft/FTContainer.js +1 -1
- package/lib/component/2d/ft/FTContainer.js.map +1 -1
- package/lib/component/2d/tools/XYLabelPointer.d.ts +2 -2
- package/lib/component/2d/tools/XYLabelPointer.d.ts.map +1 -1
- package/lib/component/2d/tools/XYLabelPointer.js +10 -9
- package/lib/component/2d/tools/XYLabelPointer.js.map +1 -1
- package/lib/component/2d/useTracesSpectra.d.ts +3 -2
- package/lib/component/2d/useTracesSpectra.d.ts.map +1 -1
- package/lib/component/2d/useTracesSpectra.js +17 -9
- package/lib/component/2d/useTracesSpectra.js.map +1 -1
- package/lib/component/2d/utilities/extractSpectrumSignals.js +2 -2
- package/lib/component/2d/utilities/extractSpectrumSignals.js.map +1 -1
- package/lib/component/2d/zones/Signal.js.map +1 -1
- package/lib/component/2d/zones/SignalsGuideLines.d.ts.map +1 -1
- package/lib/component/2d/zones/SignalsGuideLines.js +15 -13
- package/lib/component/2d/zones/SignalsGuideLines.js.map +1 -1
- package/lib/component/2d/zones/ZonesAssignmentsLabels.js +1 -1
- package/lib/component/2d/zones/ZonesAssignmentsLabels.js.map +1 -1
- package/lib/component/EventsTrackers/BrushTracker.d.ts +5 -6
- package/lib/component/EventsTrackers/BrushTracker.d.ts.map +1 -1
- package/lib/component/EventsTrackers/BrushTracker.js +2 -0
- package/lib/component/EventsTrackers/BrushTracker.js.map +1 -1
- package/lib/component/EventsTrackers/KeysListenerTracker.d.ts.map +1 -1
- package/lib/component/EventsTrackers/KeysListenerTracker.js +6 -0
- package/lib/component/EventsTrackers/KeysListenerTracker.js.map +1 -1
- package/lib/component/assignment/utilities/getAssignments.js +1 -2
- package/lib/component/assignment/utilities/getAssignments.js.map +1 -1
- package/lib/component/context/KeyModifierContext.d.ts +3 -2
- package/lib/component/context/KeyModifierContext.d.ts.map +1 -1
- package/lib/component/context/KeyModifierContext.js +7 -4
- package/lib/component/context/KeyModifierContext.js.map +1 -1
- package/lib/component/elements/ActionsButtonsPopover.d.ts.map +1 -1
- package/lib/component/elements/ActionsButtonsPopover.js +17 -3
- package/lib/component/elements/ActionsButtonsPopover.js.map +1 -1
- package/lib/component/elements/AssignmentsCell.d.ts.map +1 -1
- package/lib/component/elements/AssignmentsCell.js.map +1 -1
- package/lib/component/elements/Button.d.ts.map +1 -1
- package/lib/component/elements/Button.js.map +1 -1
- package/lib/component/elements/CheckController.d.ts.map +1 -1
- package/lib/component/elements/CheckController.js.map +1 -1
- package/lib/component/elements/ContextMenuBluePrint.d.ts.map +1 -1
- package/lib/component/elements/ContextMenuBluePrint.js.map +1 -1
- package/lib/component/elements/D3Axis.d.ts.map +1 -1
- package/lib/component/elements/DraggableDialog.d.ts.map +1 -1
- package/lib/component/elements/DraggableDialog.js.map +1 -1
- package/lib/component/elements/Input.d.ts.map +1 -1
- package/lib/component/elements/Input.js.map +1 -1
- package/lib/component/elements/Input2.d.ts.map +1 -1
- package/lib/component/elements/Input2.js.map +1 -1
- package/lib/component/elements/Input2Controller.d.ts.map +1 -1
- package/lib/component/elements/Input2Controller.js.map +1 -1
- package/lib/component/elements/Label.d.ts.map +1 -1
- package/lib/component/elements/Label.js.map +1 -1
- package/lib/component/elements/NumberInput2.d.ts.map +1 -1
- package/lib/component/elements/NumberInput2.js.map +1 -1
- package/lib/component/elements/NumberInput2Controller.d.ts.map +1 -1
- package/lib/component/elements/NumberInput2Controller.js.map +1 -1
- package/lib/component/elements/ReactTable/ReactTable.d.ts.map +1 -1
- package/lib/component/elements/ReactTable/ReactTable.js.map +1 -1
- package/lib/component/elements/ReadOnly.d.ts.map +1 -1
- package/lib/component/elements/ReadOnly.js.map +1 -1
- package/lib/component/elements/Sections.js.map +1 -1
- package/lib/component/elements/Select.d.ts.map +1 -1
- package/lib/component/elements/Select.js.map +1 -1
- package/lib/component/elements/ToolbarPopoverItem.d.ts.map +1 -1
- package/lib/component/elements/export/ExportContent.d.ts.map +1 -1
- package/lib/component/elements/export/ExportContent.js.map +1 -1
- package/lib/component/elements/print/PrintContent.d.ts.map +1 -1
- package/lib/component/elements/print/PrintContent.js.map +1 -1
- package/lib/component/hooks/useActiveSpectrumIntegralsViewState.d.ts.map +1 -1
- package/lib/component/hooks/useActiveSpectrumIntegralsViewState.js +2 -4
- package/lib/component/hooks/useActiveSpectrumIntegralsViewState.js.map +1 -1
- package/lib/component/hooks/useActiveSpectrumPeaksViewState.d.ts.map +1 -1
- package/lib/component/hooks/useActiveSpectrumPeaksViewState.js +2 -4
- package/lib/component/hooks/useActiveSpectrumPeaksViewState.js.map +1 -1
- package/lib/component/hooks/useActiveSpectrumRangesViewState.d.ts.map +1 -1
- package/lib/component/hooks/useActiveSpectrumRangesViewState.js +2 -4
- package/lib/component/hooks/useActiveSpectrumRangesViewState.js.map +1 -1
- package/lib/component/hooks/useActiveSpectrumStyleOptions.js +2 -2
- package/lib/component/hooks/useActiveSpectrumStyleOptions.js.map +1 -1
- package/lib/component/hooks/useActiveSpectrumZonesViewState.d.ts.map +1 -1
- package/lib/component/hooks/useActiveSpectrumZonesViewState.js +2 -4
- package/lib/component/hooks/useActiveSpectrumZonesViewState.js.map +1 -1
- package/lib/component/hooks/useExport.js +1 -1
- package/lib/component/hooks/useExport.js.map +1 -1
- package/lib/component/hooks/useSaveSettings.d.ts.map +1 -1
- package/lib/component/hooks/useSaveSettings.js +28 -47
- package/lib/component/hooks/useSaveSettings.js.map +1 -1
- package/lib/component/hooks/useSetActiveSpectrumAction.d.ts +2 -1
- package/lib/component/hooks/useSetActiveSpectrumAction.d.ts.map +1 -1
- package/lib/component/hooks/useSetActiveSpectrumAction.js +2 -2
- package/lib/component/hooks/useSetActiveSpectrumAction.js.map +1 -1
- package/lib/component/hooks/useSpectrumWithDataSource.js +1 -1
- package/lib/component/hooks/useSpectrumWithDataSource.js.map +1 -1
- package/lib/component/hooks/useWorkspaceAction.d.ts +1 -1
- package/lib/component/hooks/useWorkspaceAction.d.ts.map +1 -1
- package/lib/component/hooks/useWorkspaceAction.js +3 -0
- package/lib/component/hooks/useWorkspaceAction.js.map +1 -1
- package/lib/component/modal/ImportPublicationStringModal.d.ts.map +1 -1
- package/lib/component/modal/ImportPublicationStringModal.js.map +1 -1
- package/lib/component/modal/MultipletAnalysisModal.js +1 -1
- package/lib/component/modal/changeSum/ChangeSumModal.d.ts.map +1 -1
- package/lib/component/modal/changeSum/ChangeSumModal.js.map +1 -1
- package/lib/component/modal/metaImportation/MetaImportationModal.d.ts.map +1 -1
- package/lib/component/modal/metaImportation/MetaImportationModal.js.map +1 -1
- package/lib/component/modal/setting/GeneralSettings.d.ts.map +1 -1
- package/lib/component/modal/setting/GeneralSettings.js +5 -1
- package/lib/component/modal/setting/GeneralSettings.js.map +1 -1
- package/lib/component/modal/setting/settings-tabs/ToolsTabContent.js +1 -1
- package/lib/component/modal/setting/settings-tabs/ToolsTabContent.js.map +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralTable.d.ts.map +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralTable.js.map +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.d.ts +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.d.ts.map +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +16 -14
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js.map +1 -1
- package/lib/component/panels/MoleculesPanel/hooks/useAtomAssignment.d.ts.map +1 -1
- package/lib/component/panels/MoleculesPanel/hooks/useAtomAssignment.js +27 -18
- package/lib/component/panels/MoleculesPanel/hooks/useAtomAssignment.js.map +1 -1
- package/lib/component/panels/MoleculesPanel/utilities/getAssignIds.d.ts.map +1 -1
- package/lib/component/panels/MoleculesPanel/utilities/getAssignIds.js +0 -3
- package/lib/component/panels/MoleculesPanel/utilities/getAssignIds.js.map +1 -1
- package/lib/component/panels/RangesPanel/RangesPanel.js +1 -1
- package/lib/component/panels/RangesPanel/RangesPanel.js.map +1 -1
- package/lib/component/panels/RangesPanel/RangesTable.d.ts.map +1 -1
- package/lib/component/panels/RangesPanel/RangesTable.js +1 -1
- package/lib/component/panels/RangesPanel/RangesTable.js.map +1 -1
- package/lib/component/panels/RangesPanel/RangesTableRow.d.ts.map +1 -1
- package/lib/component/panels/RangesPanel/RangesTableRow.js +5 -20
- package/lib/component/panels/RangesPanel/RangesTableRow.js.map +1 -1
- package/lib/component/panels/RangesPanel/TableColumns/ActionsColumn.d.ts.map +1 -1
- package/lib/component/panels/RangesPanel/TableColumns/ActionsColumn.js.map +1 -1
- package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentColumn.d.ts +9 -0
- package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentColumn.d.ts.map +1 -0
- package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentColumn.js +19 -0
- package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentColumn.js.map +1 -0
- package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.d.ts.map +1 -1
- package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.js.map +1 -1
- package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.js +2 -2
- package/lib/component/panels/SummaryPanel/SummaryPanel.js +6 -6
- package/lib/component/panels/SummaryPanel/SummaryPanel.js.map +1 -1
- package/lib/component/panels/accordionItems.d.ts.map +1 -1
- package/lib/component/panels/accordionItems.js.map +1 -1
- package/lib/component/panels/databasePanel/DatabaseInfo.d.ts +5 -0
- package/lib/component/panels/databasePanel/DatabaseInfo.d.ts.map +1 -0
- package/lib/component/panels/databasePanel/DatabaseInfo.js +29 -0
- package/lib/component/panels/databasePanel/DatabaseInfo.js.map +1 -0
- package/lib/component/panels/databasePanel/DatabaseTable.d.ts.map +1 -1
- package/lib/component/panels/databasePanel/DatabaseTable.js +21 -3
- package/lib/component/panels/databasePanel/DatabaseTable.js.map +1 -1
- package/lib/component/panels/extra/preferences/NucleusPreferences.d.ts.map +1 -1
- package/lib/component/panels/informationPanel/InformationEditionModal.d.ts.map +1 -1
- package/lib/component/panels/informationPanel/InformationEditionModal.js +1 -1
- package/lib/component/panels/informationPanel/InformationEditionModal.js.map +1 -1
- package/lib/component/panels/predictionPanel/PredictionPanel.d.ts.map +1 -1
- package/lib/component/panels/predictionPanel/PredictionPanel.js +13 -9
- package/lib/component/panels/predictionPanel/PredictionPanel.js.map +1 -1
- package/lib/component/reducer/Reducer.js +7 -7
- package/lib/component/reducer/Reducer.js.map +1 -1
- package/lib/component/reducer/actions/AssignmentsActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/AssignmentsActions.js +9 -9
- package/lib/component/reducer/actions/AssignmentsActions.js.map +1 -1
- package/lib/component/reducer/actions/CorrelationsActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/CorrelationsActions.js +21 -21
- package/lib/component/reducer/actions/CorrelationsActions.js.map +1 -1
- package/lib/component/reducer/actions/DatabaseActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/DatabaseActions.js +5 -3
- package/lib/component/reducer/actions/DatabaseActions.js.map +1 -1
- package/lib/component/reducer/actions/DomainActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/DomainActions.js +10 -18
- package/lib/component/reducer/actions/DomainActions.js.map +1 -1
- package/lib/component/reducer/actions/FiltersActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/FiltersActions.js +28 -44
- package/lib/component/reducer/actions/FiltersActions.js.map +1 -1
- package/lib/component/reducer/actions/InsetActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/InsetActions.js +9 -18
- package/lib/component/reducer/actions/InsetActions.js.map +1 -1
- package/lib/component/reducer/actions/IntegralsActions.d.ts +1 -1
- package/lib/component/reducer/actions/IntegralsActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/IntegralsActions.js +43 -48
- package/lib/component/reducer/actions/IntegralsActions.js.map +1 -1
- package/lib/component/reducer/actions/MoleculeActions.d.ts +2 -1
- package/lib/component/reducer/actions/MoleculeActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/MoleculeActions.js +64 -10
- package/lib/component/reducer/actions/MoleculeActions.js.map +1 -1
- package/lib/component/reducer/actions/PeaksActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/PeaksActions.js +110 -121
- package/lib/component/reducer/actions/PeaksActions.js.map +1 -1
- package/lib/component/reducer/actions/PreferencesActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/PreferencesActions.js +2 -1
- package/lib/component/reducer/actions/PreferencesActions.js.map +1 -1
- package/lib/component/reducer/actions/RangesActions.d.ts +18 -18
- package/lib/component/reducer/actions/RangesActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/RangesActions.js +148 -171
- package/lib/component/reducer/actions/RangesActions.js.map +1 -1
- package/lib/component/reducer/actions/SpectraActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/SpectraActions.js +29 -31
- package/lib/component/reducer/actions/SpectraActions.js.map +1 -1
- package/lib/component/reducer/actions/ToolsActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/ToolsActions.js +10 -11
- package/lib/component/reducer/actions/ToolsActions.js.map +1 -1
- package/lib/component/reducer/actions/ZonesActions.d.ts +8 -9
- package/lib/component/reducer/actions/ZonesActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/ZonesActions.js +123 -151
- package/lib/component/reducer/actions/ZonesActions.js.map +1 -1
- package/lib/component/reducer/helper/get2DRange.d.ts +3 -1
- package/lib/component/reducer/helper/get2DRange.d.ts.map +1 -1
- package/lib/component/reducer/helper/get2DRange.js.map +1 -1
- package/lib/component/reducer/helper/getSpectrum.js +1 -1
- package/lib/component/reducer/helper/getSpectrum.js.map +1 -1
- package/lib/component/reducer/helper/setIntegralsViewProperty.js +1 -1
- package/lib/component/reducer/helper/setIntegralsViewProperty.js.map +1 -1
- package/lib/component/reducer/helper/setRangesViewProperty.js +1 -1
- package/lib/component/reducer/helper/setRangesViewProperty.js.map +1 -1
- package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js +1 -1
- package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js.map +1 -1
- package/lib/component/toolbar/ToolBar.d.ts.map +1 -1
- package/lib/component/toolbar/ToolBar.js +5 -1
- package/lib/component/toolbar/ToolBar.js.map +1 -1
- package/lib/component/toolbar/ToolTypes.js +1 -1
- package/lib/component/toolbar/ToolTypes.js.map +1 -1
- package/lib/component/useWatchForm.d.ts.map +1 -1
- package/lib/component/useWatchForm.js.map +1 -1
- package/lib/component/utility/filterDatabaseInfoEntry.d.ts +3 -0
- package/lib/component/utility/filterDatabaseInfoEntry.d.ts.map +1 -0
- package/lib/component/utility/filterDatabaseInfoEntry.js +9 -0
- package/lib/component/utility/filterDatabaseInfoEntry.js.map +1 -0
- package/lib/component/utility/stackOverlappingLabels.d.ts +1 -1
- package/lib/component/utility/stackOverlappingLabels.d.ts.map +1 -1
- package/lib/component/utility/stackOverlappingLabels.js.map +1 -1
- package/lib/component/workspaces/prediction.js +1 -1
- package/lib/component/workspaces/prediction.js.map +1 -1
- package/lib/component/workspaces/simulation.js +1 -1
- package/lib/component/workspaces/simulation.js.map +1 -1
- package/lib/component/workspaces/workspaceDefaultProperties.js +1 -1
- package/lib/component/workspaces/workspaceDefaultProperties.js.map +1 -1
- package/lib/data/SpectraManager.d.ts.map +1 -1
- package/lib/data/SpectraManager.js.map +1 -1
- package/lib/data/data1d/Spectrum1D/isRangeAssigned.d.ts.map +1 -1
- package/lib/data/data1d/Spectrum1D/isRangeAssigned.js +0 -3
- package/lib/data/data1d/Spectrum1D/isRangeAssigned.js.map +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.d.ts +8 -1
- package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.d.ts.map +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.js +1 -2
- package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.js.map +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/changeRangeSignal.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/ranges/changeRangeSignal.js +3 -3
- package/lib/data/data1d/Spectrum1D/ranges/detectRanges.d.ts +4 -14
- package/lib/data/data1d/Spectrum1D/ranges/detectRanges.d.ts.map +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectRanges.js +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectRanges.js.map +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectSignalsByMultipletAnalysis.d.ts.map +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectSignalsByMultipletAnalysis.js +2 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectSignalsByMultipletAnalysis.js.map +1 -1
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.js.map +1 -1
- package/lib/data/data2d/Spectrum2D/zones/changeZoneSignal.d.ts +3 -5
- package/lib/data/data2d/Spectrum2D/zones/changeZoneSignal.d.ts.map +1 -1
- package/lib/data/data2d/Spectrum2D/zones/changeZoneSignal.js +3 -5
- package/lib/data/data2d/Spectrum2D/zones/changeZoneSignal.js.map +1 -1
- package/lib/data/data2d/Spectrum2D/zones/detectZones.d.ts +2 -1
- package/lib/data/data2d/Spectrum2D/zones/detectZones.d.ts.map +1 -1
- package/lib/data/data2d/Spectrum2D/zones/detectZones.js.map +1 -1
- package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.d.ts +7 -63
- package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.d.ts.map +1 -1
- package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.js +9 -14
- package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.js.map +1 -1
- package/lib/data/data2d/Spectrum2D/zones/getDetectionZones.d.ts +2 -10
- package/lib/data/data2d/Spectrum2D/zones/getDetectionZones.d.ts.map +1 -1
- package/lib/data/data2d/Spectrum2D/zones/getDetectionZones.js +23 -43
- package/lib/data/data2d/Spectrum2D/zones/getDetectionZones.js.map +1 -1
- package/lib/data/data2d/Spectrum2D/zones/initiateZones.d.ts +1 -54
- package/lib/data/data2d/Spectrum2D/zones/initiateZones.d.ts.map +1 -1
- package/lib/data/data2d/Spectrum2D/zones/initiateZones.js +1 -1
- package/lib/data/data2d/Spectrum2D/zones/initiateZones.js.map +1 -1
- package/lib/data/molecules/Molecule.d.ts.map +1 -1
- package/lib/data/molecules/Molecule.js.map +1 -1
- package/lib/data/molecules/MoleculeManager.d.ts +2 -1
- package/lib/data/molecules/MoleculeManager.d.ts.map +1 -1
- package/lib/data/molecules/MoleculeManager.js +30 -3
- package/lib/data/molecules/MoleculeManager.js.map +1 -1
- package/lib/data/types/data1d/RangeDetectionResult.d.ts.map +1 -1
- package/lib/data/utilities/FindUtilities.d.ts.map +1 -1
- package/lib/data/utilities/FindUtilities.js +11 -11
- package/lib/data/utilities/FindUtilities.js.map +1 -1
- package/lib/utils/clipboard/clipboardComponents.d.ts.map +1 -1
- package/lib/utils/clipboard/clipboardComponents.js.map +1 -1
- package/lib/utils/clipboard/clipboardHooks.d.ts +2 -2
- package/lib/utils/clipboard/clipboardHooks.d.ts.map +1 -1
- package/lib/utils/clipboard/clipboardHooks.js +8 -2
- package/lib/utils/clipboard/clipboardHooks.js.map +1 -1
- package/lib/versionInfo.d.ts.map +1 -1
- package/lib/versionInfo.js +1 -1
- package/lib/versionInfo.js.map +1 -1
- package/package.json +28 -25
- package/src/component/1d/ApodizationLine.tsx +1 -1
- package/src/component/1d/BrushTracker1D.tsx +10 -10
- package/src/component/1d/FooterBanner.tsx +2 -2
- package/src/component/1d/LinesSeries.tsx +2 -2
- package/src/component/1d/SVGContent1D.tsx +6 -2
- package/src/component/1d/SimilarityTree.tsx +3 -2
- package/src/component/1d/inset/InsetProvider.tsx +4 -2
- package/src/component/1d/integral/IntegralResizable.tsx +2 -1
- package/src/component/1d/matrix/Boxplot.tsx +3 -3
- package/src/component/1d/multiAnalysis/AnalysisRange.tsx +2 -1
- package/src/component/1d/multiplicityTree/MultiplicityTree.tsx +24 -23
- package/src/component/1d/multiplicityTree/generateTreeNodes.ts +10 -1
- package/src/component/1d/peaks/PeakAnnotationsSpreadMode.tsx +4 -2
- package/src/component/1d/peaks/PeakEditionManager.tsx +8 -3
- package/src/component/1d/peaks/Peaks.tsx +5 -1
- package/src/component/1d/ranges/AssignmentLabel.tsx +8 -5
- package/src/component/1d/ranges/Atoms.tsx +2 -2
- package/src/component/1d/ranges/Range.tsx +42 -74
- package/src/component/1d/ranges/Ranges.tsx +33 -28
- package/src/component/1d/ranges/useAssignmentsPopoverActionsButtons.tsx +93 -0
- package/src/component/1d/tool/BaseLineZones.tsx +2 -1
- package/src/component/1d/utilities/intersectionResolver.ts +3 -4
- package/src/component/1d-2d/FieldEdition.tsx +2 -2
- package/src/component/2d/1d-tracer/VerticalSliceChart.tsx +2 -2
- package/src/component/2d/1d-tracer/phase-correction-traces/PhaseTraces.tsx +1 -1
- package/src/component/2d/1d-tracer/phase-correction-traces/SpectrumPhaseTrace.tsx +1 -1
- package/src/component/2d/BrushTracker2D.tsx +50 -55
- package/src/component/2d/FooterBanner.tsx +80 -105
- package/src/component/2d/SVGContent2D.tsx +2 -3
- package/src/component/2d/SlicingView.tsx +1 -1
- package/src/component/2d/Viewer2D.tsx +2 -2
- package/src/component/2d/ft/FTContainer.tsx +4 -5
- package/src/component/2d/tools/XYLabelPointer.tsx +12 -11
- package/src/component/2d/useTracesSpectra.ts +26 -13
- package/src/component/2d/utilities/extractSpectrumSignals.ts +2 -2
- package/src/component/2d/zones/Signal.tsx +1 -1
- package/src/component/2d/zones/SignalsGuideLines.tsx +21 -19
- package/src/component/2d/zones/ZonesAssignmentsLabels.tsx +4 -4
- package/src/component/EventsTrackers/BrushTracker.tsx +24 -17
- package/src/component/EventsTrackers/KeysListenerTracker.tsx +6 -0
- package/src/component/assignment/utilities/getAssignments.ts +1 -2
- package/src/component/context/KeyModifierContext.tsx +13 -5
- package/src/component/elements/ActionsButtonsPopover.tsx +25 -8
- package/src/component/elements/AssignmentsCell.tsx +1 -2
- package/src/component/elements/Button.tsx +3 -2
- package/src/component/elements/CheckController.tsx +2 -1
- package/src/component/elements/ContextMenuBluePrint.tsx +2 -1
- package/src/component/elements/D3Axis.tsx +3 -3
- package/src/component/elements/DraggableDialog.tsx +2 -1
- package/src/component/elements/Input.tsx +4 -2
- package/src/component/elements/Input2.tsx +1 -2
- package/src/component/elements/Input2Controller.tsx +2 -1
- package/src/component/elements/Label.tsx +2 -1
- package/src/component/elements/NumberInput2.tsx +4 -2
- package/src/component/elements/NumberInput2Controller.tsx +3 -1
- package/src/component/elements/ReactTable/ReactTable.tsx +1 -3
- package/src/component/elements/ReadOnly.tsx +4 -2
- package/src/component/elements/Sections.tsx +5 -4
- package/src/component/elements/Select.tsx +4 -2
- package/src/component/elements/ToolbarPopoverItem.tsx +3 -3
- package/src/component/elements/export/ExportContent.tsx +1 -2
- package/src/component/elements/print/PrintContent.tsx +1 -2
- package/src/component/hooks/useActiveSpectrumIntegralsViewState.ts +2 -6
- package/src/component/hooks/useActiveSpectrumPeaksViewState.ts +2 -6
- package/src/component/hooks/useActiveSpectrumRangesViewState.ts +2 -6
- package/src/component/hooks/useActiveSpectrumStyleOptions.ts +2 -2
- package/src/component/hooks/useActiveSpectrumZonesViewState.ts +2 -6
- package/src/component/hooks/useExport.tsx +1 -1
- package/src/component/hooks/useSaveSettings.tsx +68 -81
- package/src/component/hooks/useSetActiveSpectrumAction.ts +3 -2
- package/src/component/hooks/useSpectrumWithDataSource.ts +1 -1
- package/src/component/hooks/useWorkspaceAction.ts +5 -0
- package/src/component/modal/ImportPublicationStringModal.tsx +1 -2
- package/src/component/modal/MultipletAnalysisModal.tsx +1 -1
- package/src/component/modal/changeSum/ChangeSumModal.tsx +4 -2
- package/src/component/modal/metaImportation/MetaImportationModal.tsx +1 -2
- package/src/component/modal/setting/GeneralSettings.tsx +7 -2
- package/src/component/modal/setting/settings-tabs/ToolsTabContent.tsx +1 -1
- package/src/component/panels/IntegralsPanel/IntegralTable.tsx +4 -2
- package/src/component/panels/MoleculesPanel/MoleculePanelHeader.tsx +24 -18
- package/src/component/panels/MoleculesPanel/hooks/useAtomAssignment.tsx +32 -16
- package/src/component/panels/MoleculesPanel/utilities/getAssignIds.ts +0 -4
- package/src/component/panels/RangesPanel/RangesPanel.tsx +1 -1
- package/src/component/panels/RangesPanel/RangesTable.tsx +3 -8
- package/src/component/panels/RangesPanel/RangesTableRow.tsx +14 -47
- package/src/component/panels/RangesPanel/TableColumns/ActionsColumn.tsx +1 -2
- package/src/component/panels/RangesPanel/TableColumns/SignalAssignmentColumn.tsx +40 -0
- package/src/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.tsx +1 -2
- package/src/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.tsx +2 -2
- package/src/component/panels/SummaryPanel/SummaryPanel.tsx +6 -6
- package/src/component/panels/accordionItems.tsx +4 -2
- package/src/component/panels/databasePanel/DatabaseInfo.tsx +43 -0
- package/src/component/panels/databasePanel/DatabaseTable.tsx +33 -1
- package/src/component/panels/extra/preferences/NucleusPreferences.tsx +2 -2
- package/src/component/panels/informationPanel/InformationEditionModal.tsx +6 -2
- package/src/component/panels/predictionPanel/PredictionPanel.tsx +17 -9
- package/src/component/reducer/Reducer.ts +8 -8
- package/src/component/reducer/actions/AssignmentsActions.ts +8 -13
- package/src/component/reducer/actions/CorrelationsActions.ts +21 -22
- package/src/component/reducer/actions/DatabaseActions.ts +5 -3
- package/src/component/reducer/actions/DomainActions.ts +16 -22
- package/src/component/reducer/actions/FiltersActions.ts +34 -58
- package/src/component/reducer/actions/InsetActions.ts +9 -19
- package/src/component/reducer/actions/IntegralsActions.ts +48 -59
- package/src/component/reducer/actions/MoleculeActions.ts +94 -14
- package/src/component/reducer/actions/PeaksActions.ts +112 -136
- package/src/component/reducer/actions/PreferencesActions.ts +4 -3
- package/src/component/reducer/actions/RangesActions.ts +196 -244
- package/src/component/reducer/actions/SpectraActions.ts +40 -45
- package/src/component/reducer/actions/ToolsActions.ts +9 -13
- package/src/component/reducer/actions/ZonesActions.ts +158 -218
- package/src/component/reducer/helper/get2DRange.ts +4 -1
- package/src/component/reducer/helper/getSpectrum.ts +1 -1
- package/src/component/reducer/helper/setIntegralsViewProperty.ts +1 -1
- package/src/component/reducer/helper/setRangesViewProperty.ts +1 -1
- package/src/component/reducer/preferences/panelsPreferencesDefaultValues.ts +1 -1
- package/src/component/toolbar/ToolBar.tsx +6 -1
- package/src/component/toolbar/ToolTypes.ts +1 -1
- package/src/component/useWatchForm.tsx +2 -1
- package/src/component/utility/filterDatabaseInfoEntry.ts +10 -0
- package/src/component/utility/stackOverlappingLabels.ts +4 -1
- package/src/component/workspaces/prediction.ts +1 -1
- package/src/component/workspaces/simulation.ts +1 -1
- package/src/component/workspaces/workspaceDefaultProperties.ts +1 -1
- package/src/data/SpectraManager.ts +0 -2
- package/src/data/data1d/Spectrum1D/isRangeAssigned.ts +0 -4
- package/src/data/data1d/Spectrum1D/ranges/autoRangesDetection.ts +15 -5
- package/src/data/data1d/Spectrum1D/ranges/changeRangeSignal.ts +5 -5
- package/src/data/data1d/Spectrum1D/ranges/detectRanges.ts +5 -14
- package/src/data/data1d/Spectrum1D/ranges/detectSignalsByMultipletAnalysis.ts +2 -1
- package/src/data/data2d/Spectrum2D/initiateDatum2D.ts +2 -2
- package/src/data/data2d/Spectrum2D/zones/changeZoneSignal.ts +3 -5
- package/src/data/data2d/Spectrum2D/zones/detectZones.ts +3 -2
- package/src/data/data2d/Spectrum2D/zones/detectZonesManual.ts +19 -16
- package/src/data/data2d/Spectrum2D/zones/getDetectionZones.ts +35 -56
- package/src/data/data2d/Spectrum2D/zones/initiateZones.ts +1 -1
- package/src/data/molecules/Molecule.ts +2 -1
- package/src/data/molecules/MoleculeManager.ts +40 -4
- package/src/data/types/data1d/RangeDetectionResult.ts +4 -2
- package/src/data/utilities/FindUtilities.ts +9 -8
- package/src/utils/clipboard/clipboardComponents.tsx +2 -1
- package/src/utils/clipboard/clipboardHooks.ts +12 -6
- package/src/versionInfo.ts +1 -1
- package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentColumn.d.ts +0 -8
- package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentColumn.d.ts.map +0 -1
- package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentColumn.js +0 -17
- package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentColumn.js.map +0 -1
- package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.d.ts +0 -17
- package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.d.ts.map +0 -1
- package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +0 -40
- package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js.map +0 -1
- package/src/component/panels/RangesPanel/TableColumns/RangeAssignmentColumn.tsx +0 -36
- package/src/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.tsx +0 -89
|
@@ -3,10 +3,8 @@ import type {
|
|
|
3
3
|
BoundingBox,
|
|
4
4
|
RangesViewState,
|
|
5
5
|
Spectrum1D,
|
|
6
|
-
Spectrum,
|
|
7
6
|
} from '@zakodium/nmrium-core';
|
|
8
7
|
import type { Draft } from 'immer';
|
|
9
|
-
import { original } from 'immer';
|
|
10
8
|
import cloneDeep from 'lodash/cloneDeep.js';
|
|
11
9
|
import { xFindClosestIndex } from 'ml-spectra-processing';
|
|
12
10
|
import { Filters1DManager } from 'nmr-processing';
|
|
@@ -27,13 +25,13 @@ import {
|
|
|
27
25
|
updateRangesRelativeValues,
|
|
28
26
|
} from '../../../data/data1d/Spectrum1D/index.js';
|
|
29
27
|
import type { ChangeRangeRelativeValueProps } from '../../../data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.js';
|
|
28
|
+
import type { DetectRangesOptions } from '../../../data/data1d/Spectrum1D/ranges/detectRanges.ts';
|
|
30
29
|
import { unlink } from '../../../data/utilities/RangeUtilities.js';
|
|
31
30
|
import { isProton } from '../../../data/utilities/isProton.ts';
|
|
32
31
|
import type { TargetAssignKeys } from '../../panels/MoleculesPanel/utilities/getAssignIds.ts';
|
|
33
32
|
import type { RangeData } from '../../panels/RangesPanel/hooks/useMapRanges.js';
|
|
34
33
|
import type { FilterType } from '../../utility/filterType.js';
|
|
35
34
|
import type { State } from '../Reducer.js';
|
|
36
|
-
import { getActiveSpectrum } from '../helper/getActiveSpectrum.js';
|
|
37
35
|
import { getSpectrum } from '../helper/getSpectrum.js';
|
|
38
36
|
import {
|
|
39
37
|
initializeRangeViewObject,
|
|
@@ -76,25 +74,28 @@ type SaveEditedRangeAction = ActionType<
|
|
|
76
74
|
>;
|
|
77
75
|
|
|
78
76
|
interface DeleteSignalProps {
|
|
79
|
-
|
|
77
|
+
spectrumId: string;
|
|
80
78
|
range: Range;
|
|
81
|
-
|
|
79
|
+
signalId: string;
|
|
82
80
|
}
|
|
83
81
|
type DeleteSignalAction = ActionType<'DELETE_1D_SIGNAL', DeleteSignalProps>;
|
|
84
82
|
|
|
85
|
-
interface
|
|
83
|
+
interface UnAssign1DSignalOptions {
|
|
86
84
|
rangeKey?: string;
|
|
87
85
|
spectrumId?: string; // If not specified, the currently active spectrum will be used by default.
|
|
88
86
|
signalIndex?: number;
|
|
89
87
|
}
|
|
90
|
-
type
|
|
88
|
+
type UnAssign1DSignalAction = ActionType<
|
|
89
|
+
'UNASSIGN_1D_SIGNAL',
|
|
90
|
+
UnAssign1DSignalOptions
|
|
91
|
+
>;
|
|
91
92
|
|
|
92
|
-
type
|
|
93
|
-
'
|
|
93
|
+
type Assign1DSignalAction = ActionType<
|
|
94
|
+
'ASSIGN_1D_SIGNAL',
|
|
94
95
|
{
|
|
95
96
|
keys: TargetAssignKeys;
|
|
96
97
|
spectrumId?: string;
|
|
97
|
-
} & Required<Pick<
|
|
98
|
+
} & Required<Pick<Signal1D, 'diaIDs' | 'nbAtoms' | 'assignment'>>
|
|
98
99
|
>;
|
|
99
100
|
type ChangeRangesAssignmentsLabelsByDiaIdsAction = ActionType<
|
|
100
101
|
'CHANGE_ASSIGNMENT_LABEL_BY_DIAIDS',
|
|
@@ -130,7 +131,7 @@ type ChangeRangeRelativeValueAction = ActionType<
|
|
|
130
131
|
>;
|
|
131
132
|
type ChangeRangeSignalValueAction = ActionType<
|
|
132
133
|
'CHANGE_RANGE_SIGNAL_VALUE',
|
|
133
|
-
{
|
|
134
|
+
{ rangeId: string; signalId: string; value: number }
|
|
134
135
|
>;
|
|
135
136
|
type UpdateRangAction = ActionType<'UPDATE_RANGE', { range: Range }>;
|
|
136
137
|
type CutRangAction = ActionType<
|
|
@@ -151,9 +152,9 @@ type DeleteRangePeakAction = ActionType<
|
|
|
151
152
|
'DELETE_RANGE_PEAK',
|
|
152
153
|
{ id: string; spectrumKey: string }
|
|
153
154
|
>;
|
|
154
|
-
type
|
|
155
|
-
'
|
|
156
|
-
{ rangeId: string; value: string; spectrumId?: string }
|
|
155
|
+
type Change1DSignalAssignmentLabelAction = ActionType<
|
|
156
|
+
'CHANGE_1D_SIGNAL_ASSIGNMENT_LABEL',
|
|
157
|
+
{ rangeId: string; signalId?: string; value: string; spectrumId?: string }
|
|
157
158
|
>;
|
|
158
159
|
|
|
159
160
|
type ChangeRangesViewFloatingBoxBoundingAction = ActionType<
|
|
@@ -174,8 +175,8 @@ export type RangesActions =
|
|
|
174
175
|
| ChangeRangeSignalKindAction
|
|
175
176
|
| SaveEditedRangeAction
|
|
176
177
|
| DeleteSignalAction
|
|
177
|
-
|
|
|
178
|
-
|
|
|
178
|
+
| UnAssign1DSignalAction
|
|
179
|
+
| Assign1DSignalAction
|
|
179
180
|
| ResizeRangeAction
|
|
180
181
|
| ChangeRangeSumAction
|
|
181
182
|
| AddRangeAction
|
|
@@ -185,7 +186,7 @@ export type RangesActions =
|
|
|
185
186
|
| CutRangAction
|
|
186
187
|
| ToggleRangesViewAction
|
|
187
188
|
| DeleteRangePeakAction
|
|
188
|
-
|
|
|
189
|
+
| Change1DSignalAssignmentLabelAction
|
|
189
190
|
| ChangeRangesViewFloatingBoxBoundingAction
|
|
190
191
|
| ChangeRangesAssignmentsLabelsByDiaIdsAction
|
|
191
192
|
| ActionType<
|
|
@@ -194,43 +195,31 @@ export type RangesActions =
|
|
|
194
195
|
| 'TOGGLE_RANGES_PEAKS_DISPLAYING_MODE'
|
|
195
196
|
>;
|
|
196
197
|
|
|
197
|
-
function
|
|
198
|
-
|
|
199
|
-
spectrumIndex: any,
|
|
200
|
-
rangeID: any,
|
|
201
|
-
) {
|
|
202
|
-
return (draft.data[spectrumIndex] as Spectrum1D).ranges.values.findIndex(
|
|
203
|
-
(range) => range.id === rangeID,
|
|
204
|
-
);
|
|
198
|
+
function getRangeIndex(spectrum: Spectrum1D, rangeId: string) {
|
|
199
|
+
return spectrum.ranges.values.findIndex((range) => range.id === rangeId);
|
|
205
200
|
}
|
|
206
201
|
|
|
207
|
-
function getRange(spectrum: Spectrum1D, rangeID: string) {
|
|
208
|
-
return spectrum.ranges.values.findIndex((range) => range.id === rangeID);
|
|
209
|
-
}
|
|
210
202
|
//action
|
|
211
203
|
function handleAutoRangesDetection(
|
|
212
204
|
draft: Draft<State>,
|
|
213
205
|
action: AutoRangesDetectionAction,
|
|
214
206
|
) {
|
|
215
|
-
const {
|
|
216
|
-
|
|
217
|
-
const activeSpectrum = getActiveSpectrum(draft);
|
|
207
|
+
const { xDomain, molecules } = draft;
|
|
218
208
|
|
|
219
|
-
|
|
220
|
-
const { index } = activeSpectrum;
|
|
221
|
-
const datum = data[index] as Spectrum1D;
|
|
209
|
+
const spectrum = getSpectrum(draft);
|
|
222
210
|
|
|
211
|
+
if (isSpectrum1D(spectrum)) {
|
|
223
212
|
const [from, to] = xDomain;
|
|
224
|
-
const windowFromIndex = xFindClosestIndex(
|
|
225
|
-
const windowToIndex = xFindClosestIndex(
|
|
213
|
+
const windowFromIndex = xFindClosestIndex(spectrum.data.x, from);
|
|
214
|
+
const windowToIndex = xFindClosestIndex(spectrum.data.x, to);
|
|
226
215
|
|
|
227
216
|
// minMaxRatio default 0.05, lookNegative default false,
|
|
228
217
|
const { minMaxRatio, lookNegative } = action.payload;
|
|
229
218
|
|
|
230
|
-
const nucleus =
|
|
219
|
+
const nucleus = spectrum.info.nucleus;
|
|
231
220
|
const isProtonic = isProton(nucleus);
|
|
232
221
|
|
|
233
|
-
const detectionOptions:
|
|
222
|
+
const detectionOptions: DetectRangesOptions = {
|
|
234
223
|
rangePicking: {
|
|
235
224
|
integrationSum: 100,
|
|
236
225
|
compile: isProtonic,
|
|
@@ -248,7 +237,7 @@ function handleAutoRangesDetection(
|
|
|
248
237
|
direction: lookNegative ? 'both' : 'positive',
|
|
249
238
|
},
|
|
250
239
|
};
|
|
251
|
-
detectRanges(
|
|
240
|
+
detectRanges(spectrum, {
|
|
252
241
|
...detectionOptions,
|
|
253
242
|
windowFromIndex,
|
|
254
243
|
windowToIndex,
|
|
@@ -261,16 +250,16 @@ function handleAutoRangesDetection(
|
|
|
261
250
|
|
|
262
251
|
//action
|
|
263
252
|
function handleAutoSpectraRangesDetection(draft: Draft<State>) {
|
|
264
|
-
const peakPicking = {
|
|
253
|
+
const peakPicking: DetectRangesOptions['peakPicking'] = {
|
|
265
254
|
sensitivity: 100,
|
|
266
255
|
thresholdFactor: 8,
|
|
267
256
|
minMaxRatio: 0.05,
|
|
268
257
|
};
|
|
269
258
|
const { data, molecules } = draft;
|
|
270
259
|
|
|
271
|
-
for (const
|
|
272
|
-
if (
|
|
273
|
-
const nucleus =
|
|
260
|
+
for (const spectrum of data) {
|
|
261
|
+
if (isSpectrum1D(spectrum)) {
|
|
262
|
+
const nucleus = spectrum.info.nucleus;
|
|
274
263
|
const isProtonic = isProton(nucleus);
|
|
275
264
|
const rangePicking = {
|
|
276
265
|
integrationSum: 100,
|
|
@@ -280,7 +269,7 @@ function handleAutoSpectraRangesDetection(draft: Draft<State>) {
|
|
|
280
269
|
keepPeaks: true,
|
|
281
270
|
joinOverlapRanges: isProtonic,
|
|
282
271
|
};
|
|
283
|
-
detectRanges(
|
|
272
|
+
detectRanges(spectrum, {
|
|
284
273
|
peakPicking,
|
|
285
274
|
rangePicking,
|
|
286
275
|
molecules,
|
|
@@ -302,7 +291,7 @@ function handleDeleteRange(draft: Draft<State>, action: DeleteRangeAction) {
|
|
|
302
291
|
}
|
|
303
292
|
|
|
304
293
|
if (id) {
|
|
305
|
-
const rangeIndex =
|
|
294
|
+
const rangeIndex = getRangeIndex(datum, id);
|
|
306
295
|
datum.ranges.values.splice(rangeIndex, 1);
|
|
307
296
|
} else {
|
|
308
297
|
datum.ranges.values = [];
|
|
@@ -319,20 +308,17 @@ function handleChangeRangeSignalKind(
|
|
|
319
308
|
draft: Draft<State>,
|
|
320
309
|
action: ChangeRangeSignalKindAction,
|
|
321
310
|
) {
|
|
322
|
-
const
|
|
323
|
-
|
|
324
|
-
const
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
updateRangesRelativeValues(draft.data[index] as Spectrum1D);
|
|
334
|
-
handleUpdateCorrelations(draft);
|
|
335
|
-
}
|
|
311
|
+
const { range, kind } = action.payload;
|
|
312
|
+
|
|
313
|
+
const spectrum = getSpectrum(draft);
|
|
314
|
+
if (!isSpectrum1D(spectrum)) return;
|
|
315
|
+
|
|
316
|
+
const rangeIndex = getRangeIndex(spectrum, range.id);
|
|
317
|
+
const _range = spectrum.ranges.values[rangeIndex];
|
|
318
|
+
if (_range?.signals) {
|
|
319
|
+
_range.signals[range.tableMetaInfo.signalIndex].kind = kind;
|
|
320
|
+
updateRangesRelativeValues(spectrum);
|
|
321
|
+
handleUpdateCorrelations(draft);
|
|
336
322
|
}
|
|
337
323
|
}
|
|
338
324
|
|
|
@@ -341,62 +327,51 @@ function handleSaveEditedRange(
|
|
|
341
327
|
draft: Draft<State>,
|
|
342
328
|
action: SaveEditedRangeAction,
|
|
343
329
|
) {
|
|
344
|
-
const
|
|
345
|
-
|
|
346
|
-
const activeSpectrum = getActiveSpectrum(state);
|
|
347
|
-
|
|
348
|
-
if (activeSpectrum?.id) {
|
|
349
|
-
const { index } = activeSpectrum;
|
|
350
|
-
const { range } = action.payload;
|
|
351
|
-
|
|
352
|
-
// remove assignments in global state
|
|
330
|
+
const { range } = action.payload;
|
|
353
331
|
|
|
354
|
-
|
|
332
|
+
const spectrum = getSpectrum(draft);
|
|
333
|
+
if (!isSpectrum1D(spectrum)) return;
|
|
355
334
|
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
// remove assignments in assignment hook data
|
|
359
|
-
// for now: clear all assignments for this range because signals or levels to store might have changed
|
|
360
|
-
const rangeIndex = getRangeByIndex(state, index, _editedRowData.id);
|
|
335
|
+
// remove assignments in global state
|
|
336
|
+
const _editedRowData: any = unlink(range);
|
|
361
337
|
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
338
|
+
delete _editedRowData.tableMetaInfo;
|
|
339
|
+
delete _editedRowData.rowKey;
|
|
340
|
+
// remove assignments in assignment hook data
|
|
341
|
+
// for now: clear all assignments for this range because signals or levels to store might have changed
|
|
342
|
+
const rangeIndex = getRangeIndex(spectrum, _editedRowData.id);
|
|
365
343
|
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
1,
|
|
369
|
-
_editedRowData,
|
|
370
|
-
);
|
|
371
|
-
updateRangesRelativeValues(draft.data[index] as Spectrum1D);
|
|
372
|
-
handleUpdateCorrelations(draft);
|
|
373
|
-
resetSelectedTool(draft);
|
|
344
|
+
if (_editedRowData.id === 'new') {
|
|
345
|
+
_editedRowData.id = crypto.randomUUID();
|
|
374
346
|
}
|
|
347
|
+
|
|
348
|
+
spectrum.ranges.values.splice(rangeIndex, 1, _editedRowData);
|
|
349
|
+
updateRangesRelativeValues(spectrum);
|
|
350
|
+
handleUpdateCorrelations(draft);
|
|
351
|
+
resetSelectedTool(draft);
|
|
375
352
|
}
|
|
376
353
|
|
|
377
354
|
function deleteSignal1D(draft: Draft<State>, props: DeleteSignalProps) {
|
|
378
|
-
const {
|
|
355
|
+
const { spectrumId, range, signalId } = props;
|
|
379
356
|
|
|
380
|
-
const
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
const rangeIndex =
|
|
384
|
-
(_range) => _range.id === range.id,
|
|
385
|
-
);
|
|
357
|
+
const spectrum = getSpectrum(draft, spectrumId);
|
|
358
|
+
if (!isSpectrum1D(spectrum)) return;
|
|
359
|
+
|
|
360
|
+
const rangeIndex = getRangeIndex(spectrum, range.id);
|
|
386
361
|
const signalIndex = range.signals.findIndex(
|
|
387
|
-
(_signal) => _signal.id ===
|
|
362
|
+
(_signal) => _signal.id === signalId,
|
|
388
363
|
);
|
|
389
|
-
//
|
|
364
|
+
// Remove assignments for the signal range object in the global state.
|
|
390
365
|
const _range = unlink(cloneDeep(range), {
|
|
391
366
|
unlinkType: 'signal',
|
|
392
367
|
signalIndex,
|
|
393
368
|
});
|
|
394
369
|
|
|
395
370
|
_range.signals.splice(signalIndex, 1);
|
|
396
|
-
|
|
397
|
-
//
|
|
371
|
+
spectrum.ranges.values[rangeIndex] = _range;
|
|
372
|
+
// If no signals are existing in a range any more, then delete this range.
|
|
398
373
|
if (_range.signals.length === 0) {
|
|
399
|
-
|
|
374
|
+
spectrum.ranges.values.splice(rangeIndex, 1);
|
|
400
375
|
}
|
|
401
376
|
|
|
402
377
|
handleUpdateCorrelations(draft);
|
|
@@ -407,17 +382,18 @@ function handleDeleteSignal(draft: Draft<State>, action: DeleteSignalAction) {
|
|
|
407
382
|
deleteSignal1D(draft, action.payload);
|
|
408
383
|
}
|
|
409
384
|
|
|
410
|
-
function
|
|
411
|
-
|
|
412
|
-
|
|
385
|
+
function clearSignalAssignment(
|
|
386
|
+
draft: Draft<State>,
|
|
387
|
+
options: UnAssign1DSignalOptions = {},
|
|
388
|
+
) {
|
|
389
|
+
const { spectrumId, rangeKey, signalIndex = -1 } = options;
|
|
413
390
|
|
|
391
|
+
const spectrum = getSpectrum(draft, spectrumId);
|
|
414
392
|
if (!isSpectrum1D(spectrum)) return;
|
|
415
393
|
|
|
416
|
-
const { rangeKey, signalIndex = -1 } = options || {};
|
|
417
394
|
const ranges = spectrum.ranges.values;
|
|
418
|
-
|
|
419
395
|
if (rangeKey) {
|
|
420
|
-
const rangeIndex =
|
|
396
|
+
const rangeIndex = getRangeIndex(spectrum, rangeKey);
|
|
421
397
|
const unlinkType = signalIndex === -1 ? 'range' : 'signal';
|
|
422
398
|
ranges[rangeIndex] = unlink(ranges[rangeIndex], {
|
|
423
399
|
unlinkType,
|
|
@@ -432,43 +408,41 @@ function unlinkRange(draft: Draft<State>, options: UnlinkRangeProps = {}) {
|
|
|
432
408
|
}
|
|
433
409
|
|
|
434
410
|
//action
|
|
435
|
-
function
|
|
436
|
-
|
|
411
|
+
function handleUnAssign1DSignal(
|
|
412
|
+
draft: Draft<State>,
|
|
413
|
+
action: UnAssign1DSignalAction,
|
|
414
|
+
) {
|
|
415
|
+
clearSignalAssignment(draft, action.payload);
|
|
437
416
|
}
|
|
438
417
|
|
|
439
418
|
//action
|
|
440
|
-
function
|
|
419
|
+
function handleAssign1DSignal(
|
|
420
|
+
draft: Draft<State>,
|
|
421
|
+
action: Assign1DSignalAction,
|
|
422
|
+
) {
|
|
441
423
|
const { keys, diaIDs, nbAtoms, spectrumId, assignment } = action.payload;
|
|
442
424
|
|
|
443
425
|
const spectrum = getSpectrum(draft, spectrumId);
|
|
444
426
|
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
if (keys.length === 1) {
|
|
448
|
-
const [{ index }] = keys;
|
|
449
|
-
const range = spectrum.ranges.values[index];
|
|
450
|
-
|
|
451
|
-
if (!range) return;
|
|
427
|
+
//TODO: Refactor TargetAssignKeys after completing the 2D assignment and remove keys.length !== 2 condition
|
|
428
|
+
if (!isSpectrum1D(spectrum) || keys.length !== 2) return;
|
|
452
429
|
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
if (assignment && !range.assignment) {
|
|
457
|
-
range.assignment = assignment;
|
|
458
|
-
}
|
|
459
|
-
} else {
|
|
460
|
-
const [{ index: rangeIndex }, { index: signalIndex }] = keys;
|
|
461
|
-
const range = spectrum.ranges.values[rangeIndex];
|
|
430
|
+
if (keys.length !== 2) return;
|
|
431
|
+
const [{ index: rangeIndex }, { index: signalIndex }] = keys;
|
|
432
|
+
const range = spectrum.ranges.values[rangeIndex];
|
|
462
433
|
|
|
463
|
-
|
|
434
|
+
if (!range) return;
|
|
464
435
|
|
|
465
|
-
|
|
436
|
+
const signal = range.signals[signalIndex];
|
|
466
437
|
|
|
467
|
-
|
|
438
|
+
if (!signal) return;
|
|
468
439
|
|
|
469
|
-
|
|
470
|
-
signal.
|
|
440
|
+
if (assignment && !signal.assignment) {
|
|
441
|
+
signal.assignment = assignment;
|
|
471
442
|
}
|
|
443
|
+
|
|
444
|
+
signal.diaIDs = diaIDs;
|
|
445
|
+
signal.nbAtoms = nbAtoms + (signal.nbAtoms || 0);
|
|
472
446
|
}
|
|
473
447
|
//action
|
|
474
448
|
function handleChangeRangesAssignmentLabelsByDiaIds(
|
|
@@ -477,30 +451,24 @@ function handleChangeRangesAssignmentLabelsByDiaIds(
|
|
|
477
451
|
) {
|
|
478
452
|
const { diaIDs, assignment, previousAssignment } = action.payload;
|
|
479
453
|
|
|
480
|
-
const uniqueDiaIds = new Set(diaIDs);
|
|
481
|
-
|
|
482
454
|
const spectrum = getSpectrum(draft);
|
|
455
|
+
if (!isSpectrum1D(spectrum)) return;
|
|
483
456
|
|
|
484
|
-
|
|
485
|
-
|
|
457
|
+
const uniqueDiaIds = new Set(diaIDs);
|
|
486
458
|
const {
|
|
487
459
|
ranges: { values },
|
|
488
460
|
} = spectrum;
|
|
489
461
|
|
|
490
462
|
for (const range of values) {
|
|
491
|
-
const {
|
|
492
|
-
|
|
493
|
-
const
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
matchesRange) ||
|
|
501
|
-
matchesSignals
|
|
502
|
-
) {
|
|
503
|
-
range.assignment = assignment;
|
|
463
|
+
const { signals = [] } = range;
|
|
464
|
+
|
|
465
|
+
for (const signal of signals) {
|
|
466
|
+
if (
|
|
467
|
+
previousAssignment === signal.assignment &&
|
|
468
|
+
uniqueDiaIds.has(signal.id)
|
|
469
|
+
) {
|
|
470
|
+
signal.assignment = assignment;
|
|
471
|
+
}
|
|
504
472
|
}
|
|
505
473
|
}
|
|
506
474
|
}
|
|
@@ -509,12 +477,11 @@ function handleResizeRange(draft: Draft<State>, action: ResizeRangeAction) {
|
|
|
509
477
|
const { range, spectrumKey } = action.payload;
|
|
510
478
|
|
|
511
479
|
const spectrum = getSpectrum(draft, spectrumKey);
|
|
480
|
+
if (!isSpectrum1D(spectrum)) return;
|
|
512
481
|
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
const index = spectrum.ranges.values.findIndex((i: any) => i.id === range.id);
|
|
482
|
+
const index = spectrum.ranges.values.findIndex(
|
|
483
|
+
(_range) => _range.id === range.id,
|
|
484
|
+
);
|
|
518
485
|
|
|
519
486
|
spectrum.ranges.values[index] = range;
|
|
520
487
|
updateRangesRelativeValues(spectrum);
|
|
@@ -526,20 +493,12 @@ function handleChangeRangeSum(
|
|
|
526
493
|
action: ChangeRangeSumAction,
|
|
527
494
|
) {
|
|
528
495
|
const { options } = action.payload;
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
const activeSpectrum = getActiveSpectrum(draft);
|
|
537
|
-
if (activeSpectrum?.id) {
|
|
538
|
-
const { index } = activeSpectrum;
|
|
539
|
-
const datum = data[index] as Spectrum1D;
|
|
540
|
-
setSumOptions(datum.ranges, { options, nucleus });
|
|
541
|
-
updateRangesRelativeValues(datum, true);
|
|
542
|
-
}
|
|
496
|
+
|
|
497
|
+
const spectrum = getSpectrum(draft);
|
|
498
|
+
if (!isSpectrum1D(spectrum)) return;
|
|
499
|
+
|
|
500
|
+
setSumOptions(spectrum.ranges, { options, nucleus: spectrum.info.nucleus });
|
|
501
|
+
updateRangesRelativeValues(spectrum, true);
|
|
543
502
|
}
|
|
544
503
|
|
|
545
504
|
function initiateRangeSumOptions(datum: Spectrum1D, options: SumParams) {
|
|
@@ -553,93 +512,80 @@ function initiateRangeSumOptions(datum: Spectrum1D, options: SumParams) {
|
|
|
553
512
|
//action
|
|
554
513
|
function handleAddRange(draft: Draft<State>, action: AddRangeAction) {
|
|
555
514
|
const { range } = action.payload;
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
515
|
+
|
|
516
|
+
const spectrum = getSpectrum(draft);
|
|
517
|
+
if (!isSpectrum1D(spectrum)) return;
|
|
518
|
+
|
|
519
|
+
const { molecules } = draft;
|
|
520
|
+
spectrum.ranges.values.push(range);
|
|
521
|
+
initiateRangeSumOptions(spectrum, {
|
|
522
|
+
nucleus: spectrum.info.nucleus,
|
|
561
523
|
molecules,
|
|
562
|
-
}
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
const datum = data[index] as Spectrum1D;
|
|
567
|
-
datum.ranges.values.push(range);
|
|
568
|
-
initiateRangeSumOptions(datum, {
|
|
569
|
-
nucleus,
|
|
570
|
-
molecules,
|
|
571
|
-
});
|
|
572
|
-
updateRangesRelativeValues(datum);
|
|
573
|
-
handleUpdateCorrelations(draft);
|
|
574
|
-
}
|
|
524
|
+
});
|
|
525
|
+
|
|
526
|
+
updateRangesRelativeValues(spectrum);
|
|
527
|
+
handleUpdateCorrelations(draft);
|
|
575
528
|
}
|
|
576
529
|
|
|
577
530
|
//action
|
|
578
531
|
function handleChangeRangeRelativeValue(
|
|
579
|
-
draft:
|
|
532
|
+
draft: Draft<State>,
|
|
580
533
|
action: ChangeRangeRelativeValueAction,
|
|
581
534
|
) {
|
|
582
|
-
const
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
changeRangeRelativeValue(draft.data[index], data);
|
|
587
|
-
}
|
|
535
|
+
const spectrum = getSpectrum(draft);
|
|
536
|
+
if (!isSpectrum1D(spectrum)) return;
|
|
537
|
+
|
|
538
|
+
changeRangeRelativeValue(spectrum, action.payload);
|
|
588
539
|
}
|
|
589
540
|
|
|
590
541
|
//action
|
|
591
542
|
function handleChangeRangeSignalValue(
|
|
592
|
-
draft:
|
|
543
|
+
draft: Draft<State>,
|
|
593
544
|
action: ChangeRangeSignalValueAction,
|
|
594
545
|
) {
|
|
595
|
-
const {
|
|
596
|
-
const activeSpectrum = getActiveSpectrum(draft);
|
|
546
|
+
const { rangeId, signalId, value } = action.payload;
|
|
597
547
|
|
|
598
|
-
|
|
599
|
-
|
|
548
|
+
const spectrum = getSpectrum(draft);
|
|
549
|
+
if (!isSpectrum1D(spectrum)) return;
|
|
600
550
|
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
551
|
+
const shift = changeRangeSignal(spectrum, {
|
|
552
|
+
rangeId,
|
|
553
|
+
signalId,
|
|
554
|
+
newSignalValue: value,
|
|
555
|
+
});
|
|
556
|
+
rollbackSpectrumByFilter(draft, {
|
|
557
|
+
key: 'shiftX',
|
|
558
|
+
searchBy: 'name',
|
|
559
|
+
applyFilter: false,
|
|
560
|
+
});
|
|
561
|
+
Filters1DManager.applyFilters(spectrum, [
|
|
562
|
+
{ name: 'shiftX', value: { shift } },
|
|
563
|
+
]);
|
|
614
564
|
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
}
|
|
565
|
+
handleUpdateCorrelations(draft);
|
|
566
|
+
setDomain(draft);
|
|
618
567
|
}
|
|
619
568
|
|
|
620
569
|
//action
|
|
621
570
|
function handleChangeRangesSumFlag(draft: Draft<State>) {
|
|
622
|
-
const
|
|
571
|
+
const spectrum = getSpectrum(draft);
|
|
572
|
+
if (!isSpectrum1D(spectrum)) return;
|
|
623
573
|
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
const options = (draft.data[index] as Spectrum1D).ranges.options;
|
|
627
|
-
options.isSumConstant = !options.isSumConstant;
|
|
628
|
-
}
|
|
574
|
+
const options = spectrum.ranges.options;
|
|
575
|
+
options.isSumConstant = !options.isSumConstant;
|
|
629
576
|
}
|
|
630
577
|
|
|
631
578
|
//action
|
|
632
579
|
function handleUpdateRange(draft: Draft<State>, action: UpdateRangAction) {
|
|
633
580
|
const { range } = action.payload;
|
|
634
581
|
|
|
635
|
-
const
|
|
636
|
-
if (
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
}
|
|
582
|
+
const spectrum = getSpectrum(draft);
|
|
583
|
+
if (!isSpectrum1D(spectrum)) return;
|
|
584
|
+
|
|
585
|
+
const index = spectrum.ranges.values.findIndex(
|
|
586
|
+
(_range) => _range.id === range.id,
|
|
587
|
+
);
|
|
588
|
+
spectrum.ranges.values[index] = range;
|
|
643
589
|
}
|
|
644
590
|
|
|
645
591
|
function toggleRangesViewProperty(
|
|
@@ -669,7 +615,10 @@ function handleToggleRangesViewProperty(
|
|
|
669
615
|
|
|
670
616
|
function handleCutRange(draft: Draft<State>, action: CutRangAction) {
|
|
671
617
|
const { ranges: cutRanges } = action.payload;
|
|
672
|
-
|
|
618
|
+
|
|
619
|
+
const spectrum = getSpectrum(draft);
|
|
620
|
+
if (!isSpectrum1D(spectrum)) return;
|
|
621
|
+
|
|
673
622
|
const ranges = spectrum.ranges.values;
|
|
674
623
|
|
|
675
624
|
for (let i = 0; i < ranges.length; i++) {
|
|
@@ -694,40 +643,44 @@ function handleDeleteRangePeak(
|
|
|
694
643
|
action: DeleteRangePeakAction,
|
|
695
644
|
) {
|
|
696
645
|
const { id, spectrumKey } = action.payload;
|
|
697
|
-
|
|
646
|
+
|
|
698
647
|
const spectrum = getSpectrum(draft, spectrumKey);
|
|
699
|
-
if (!spectrum) return;
|
|
648
|
+
if (!isSpectrum1D(spectrum)) return;
|
|
700
649
|
|
|
701
|
-
const
|
|
702
|
-
|
|
703
|
-
);
|
|
704
|
-
const signal = range?.signals.find((singla: any) => singla.id === signalKey);
|
|
650
|
+
const [rangeKey, signalKey, peakKey] = id.split(',');
|
|
651
|
+
const range = spectrum.ranges.values.find((range) => range.id === rangeKey);
|
|
652
|
+
const signal = range?.signals.find((signal) => signal.id === signalKey);
|
|
705
653
|
if (signal) {
|
|
706
|
-
signal.peaks = signal.peaks?.filter((peak
|
|
654
|
+
signal.peaks = signal.peaks?.filter((peak) => peak.id !== peakKey);
|
|
707
655
|
}
|
|
708
656
|
}
|
|
709
657
|
|
|
710
|
-
function
|
|
658
|
+
function handleChange1DSignalAssignmentLabel(
|
|
711
659
|
draft: Draft<State>,
|
|
712
|
-
action:
|
|
660
|
+
action: Change1DSignalAssignmentLabelAction,
|
|
713
661
|
) {
|
|
714
|
-
const { rangeId, value, spectrumId } = action.payload;
|
|
715
|
-
const spectrum = getSpectrum(draft, spectrumId);
|
|
662
|
+
const { rangeId, signalId, value, spectrumId } = action.payload;
|
|
716
663
|
|
|
717
|
-
|
|
664
|
+
const spectrum = getSpectrum(draft, spectrumId);
|
|
665
|
+
if (!isSpectrum1D(spectrum)) return;
|
|
718
666
|
|
|
719
667
|
initializeRangeViewObject(draft, spectrum.id);
|
|
720
668
|
|
|
721
669
|
const rangesView = draft.view.ranges[spectrum.id];
|
|
722
|
-
|
|
723
670
|
if (!rangesView.showAssignmentsLabels) {
|
|
724
671
|
rangesView.showAssignmentsLabels = true;
|
|
725
672
|
}
|
|
726
673
|
|
|
727
674
|
const range = spectrum.ranges.values.find((range) => range.id === rangeId);
|
|
728
|
-
if (range)
|
|
729
|
-
|
|
730
|
-
|
|
675
|
+
if (!range) return;
|
|
676
|
+
|
|
677
|
+
const signal = signalId
|
|
678
|
+
? range.signals.find((s) => s.id === signalId)
|
|
679
|
+
: range.signals[0];
|
|
680
|
+
|
|
681
|
+
if (!signal) return;
|
|
682
|
+
|
|
683
|
+
signal.assignment = value;
|
|
731
684
|
}
|
|
732
685
|
|
|
733
686
|
function handleChangeRangesViewFloatingBoxBounding(
|
|
@@ -749,11 +702,11 @@ function handleChangeRangesViewFloatingBoxBounding(
|
|
|
749
702
|
export {
|
|
750
703
|
deleteSignal1D,
|
|
751
704
|
handleAddRange,
|
|
752
|
-
|
|
705
|
+
handleAssign1DSignal,
|
|
753
706
|
handleAutoRangesDetection,
|
|
754
707
|
handleAutoSpectraRangesDetection,
|
|
708
|
+
handleChange1DSignalAssignmentLabel,
|
|
755
709
|
handleChangePeaksDisplayingMode,
|
|
756
|
-
handleChangeRangeAssignmentLabel,
|
|
757
710
|
handleChangeRangeRelativeValue,
|
|
758
711
|
handleChangeRangeSignalKind,
|
|
759
712
|
handleChangeRangeSignalValue,
|
|
@@ -768,7 +721,6 @@ export {
|
|
|
768
721
|
handleResizeRange,
|
|
769
722
|
handleSaveEditedRange,
|
|
770
723
|
handleToggleRangesViewProperty,
|
|
771
|
-
|
|
724
|
+
handleUnAssign1DSignal,
|
|
772
725
|
handleUpdateRange,
|
|
773
|
-
unlinkRange,
|
|
774
726
|
};
|