nmrium 0.20.1 → 0.22.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/ExclusionZonesAnnotations.js +1 -2
- package/lib/component/1d/Integral.js +1 -6
- package/lib/component/1d/Viewer1D.js +4 -4
- package/lib/component/1d/ranges/RangeIntegral.js +2 -6
- package/lib/component/1d/utilities/scale.d.ts +1 -1
- package/lib/component/1d/utilities/scale.js +7 -6
- package/lib/component/2d/Viewer2D.js +5 -5
- package/lib/component/EventsTrackers/KeysListenerTracker.js +98 -81
- package/lib/component/NMRium.d.ts +9 -2
- package/lib/component/NMRium.js +9 -9
- package/lib/component/elements/EditableColumn.d.ts +1 -1
- package/lib/component/elements/NumberInput.d.ts +1 -2
- package/lib/component/elements/Tab/Tab.js +1 -0
- package/lib/component/header/Header.js +13 -10
- package/lib/component/hooks/useCheckExperimentalFeature.js +2 -1
- package/lib/component/hooks/useCheckToolsVisibility.d.ts +1 -0
- package/lib/component/hooks/useCheckToolsVisibility.js +6 -0
- package/lib/component/{1d/utilities → hooks}/useIntegralPath.d.ts +0 -0
- package/lib/component/hooks/useIntegralPath.js +53 -0
- package/lib/component/hooks/useToolsFunctions.js +6 -6
- package/lib/component/hooks/useXScale.d.ts +2 -0
- package/lib/component/hooks/useXScale.js +7 -0
- package/lib/component/loader/DropZone.js +88 -88
- package/lib/component/modal/changeSum/ChangeSumModal.js +4 -2
- package/lib/component/modal/editRange/forms/validation/EditRangeValidation.js +1 -1
- package/lib/component/modal/editZone/EditPathLengthFormik.d.ts +5 -0
- package/lib/component/modal/editZone/EditPathLengthFormik.js +72 -0
- package/lib/component/modal/editZone/EditZoneModal.d.ts +8 -0
- package/lib/component/modal/editZone/EditZoneModal.js +96 -0
- package/lib/component/modal/editZone/SignalFormTab.d.ts +6 -0
- package/lib/component/modal/editZone/SignalFormTab.js +6 -0
- package/lib/component/modal/editZone/SignalsForm.d.ts +2 -0
- package/lib/component/modal/editZone/SignalsForm.js +62 -0
- package/lib/component/modal/editZone/validation/EditZoneValidation.d.ts +534 -0
- package/lib/component/modal/editZone/validation/EditZoneValidation.js +17 -0
- package/lib/component/modal/editZone/validation/isDefaultPathLength.d.ts +3 -0
- package/lib/component/modal/editZone/validation/isDefaultPathLength.js +7 -0
- package/lib/component/modal/setting/ControllersTabContent.js +1 -1
- package/lib/component/modal/setting/DisplayTabContent.js +1 -1
- package/lib/component/modal/setting/GeneralSettings.d.ts +1 -2
- package/lib/component/modal/setting/GeneralSettings.js +13 -9
- package/lib/component/panels/AutomaticAssignment/AutomaticAssignment.d.ts +2 -0
- package/lib/component/panels/AutomaticAssignment/AutomaticAssignment.js +13 -0
- package/lib/component/panels/AutomaticAssignment/AutomaticAssignmentTable.d.ts +7 -0
- package/lib/component/panels/AutomaticAssignment/AutomaticAssignmentTable.js +38 -0
- package/lib/component/panels/IntegralsPanel/IntegralPanel.js +0 -3
- package/lib/component/panels/IntegralsPanel/IntegralsPreferences.js +4 -17
- package/lib/component/panels/MoleculesPanel/MoleculePanel.js +1 -1
- package/lib/component/panels/Panels.d.ts +1 -1
- package/lib/component/panels/Panels.js +10 -14
- package/lib/component/panels/PeaksPanel/PeaksPanel.js +0 -3
- package/lib/component/panels/PeaksPanel/PeaksPreferences.js +5 -14
- package/lib/component/panels/RangesPanel/RangesPanel.js +2 -5
- package/lib/component/panels/RangesPanel/RangesPreferences.js +5 -18
- package/lib/component/panels/SpectrumsPanel/SpectraPanelHeader.js +13 -3
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +7 -2
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnHeader.js +7 -2
- package/lib/component/panels/SummaryPanel/CorrelationTable/Constants.d.ts +1 -6
- package/lib/component/panels/SummaryPanel/CorrelationTable/Constants.js +1 -7
- package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTable.d.ts +2 -3
- package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTable.js +4 -5
- package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.d.ts +2 -3
- package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +21 -25
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/EditLinkModal.js +24 -30
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/EditPathLength.d.ts +8 -0
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/EditPathLength.js +89 -0
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.d.ts +6 -6
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +1 -1
- package/lib/component/panels/SummaryPanel/SummaryPanel.js +40 -43
- package/lib/component/panels/SummaryPanel/utilities/IsInView.d.ts +6 -0
- package/lib/component/panels/SummaryPanel/utilities/IsInView.js +16 -0
- package/lib/component/panels/SummaryPanel/utilities/Utilities.d.ts +29 -0
- package/lib/component/panels/SummaryPanel/{Utilities.js → utilities/Utilities.js} +155 -19
- package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.d.ts +1 -0
- package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +26 -3
- package/lib/component/panels/ZonesPanel/ZonesPanel.js +12 -7
- package/lib/component/panels/ZonesPanel/ZonesPreferences.js +5 -18
- package/lib/component/panels/ZonesPanel/ZonesTable.d.ts +3 -2
- package/lib/component/panels/ZonesPanel/ZonesTable.js +5 -2
- package/lib/component/panels/databasePanel/DatabasePanel.js +0 -3
- package/lib/component/panels/databasePanel/DatabasePreferences.js +4 -17
- package/lib/component/reducer/IgnoreActions.js +2 -1
- package/lib/component/reducer/Reducer.d.ts +20 -34
- package/lib/component/reducer/Reducer.js +7 -8
- package/lib/component/reducer/actions/CorrelationsActions.d.ts +7 -7
- package/lib/component/reducer/actions/CorrelationsActions.js +1 -1
- package/lib/component/reducer/actions/DatabaseActions.js +1 -1
- package/lib/component/reducer/actions/DomainActions.d.ts +3 -1
- package/lib/component/reducer/actions/DomainActions.js +20 -1
- package/lib/component/reducer/actions/IntegralsActions.js +2 -0
- package/lib/component/reducer/actions/LoadActions.js +22 -1
- package/lib/component/reducer/actions/PreferencesActions.js +0 -2
- package/lib/component/reducer/actions/RangesActions.js +3 -1
- package/lib/component/reducer/actions/SpectrumsActions.js +1 -1
- package/lib/component/reducer/actions/ToolsActions.js +43 -56
- package/lib/component/reducer/actions/ZonesActions.d.ts +3 -1
- package/lib/component/reducer/actions/ZonesActions.js +33 -2
- package/lib/component/reducer/helper/Zoom1DManager.d.ts +17 -21
- package/lib/component/reducer/helper/Zoom1DManager.js +53 -69
- package/lib/component/reducer/helper/ZoomHistoryManager.d.ts +1 -0
- package/lib/component/reducer/helper/ZoomHistoryManager.js +2 -1
- package/lib/component/reducer/preferencesReducer.d.ts +3 -8
- package/lib/component/reducer/preferencesReducer.js +87 -37
- package/lib/component/reducer/types/Types.d.ts +3 -1
- package/lib/component/reducer/types/Types.js +3 -1
- package/lib/component/toolbar/FunctionToolBar.js +7 -10
- package/lib/component/toolbar/ToolTypes.js +3 -3
- package/lib/component/workspaces/Workspace.d.ts +6 -0
- package/lib/component/workspaces/Workspace.js +1 -0
- package/lib/component/workspaces/basic.d.ts +2 -0
- package/lib/component/workspaces/basic.js +45 -0
- package/lib/component/workspaces/exercise1D.d.ts +2 -0
- package/lib/component/workspaces/exercise1D.js +45 -0
- package/lib/component/workspaces/index.d.ts +6 -0
- package/lib/component/workspaces/index.js +4 -0
- package/lib/component/workspaces/process1D.d.ts +2 -0
- package/lib/component/workspaces/process1D.js +43 -0
- package/lib/data/constants/DefaultPathLengths.d.ts +6 -0
- package/lib/data/constants/DefaultPathLengths.js +8 -0
- package/lib/data/data1d/Spectrum1D/getSpectrumErrorValue.d.ts +2 -0
- package/lib/data/data1d/Spectrum1D/getSpectrumErrorValue.js +4 -0
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +7 -19
- package/lib/data/data1d/Spectrum1D/integrals/initiateIntegrals.d.ts +11 -0
- package/lib/data/data1d/Spectrum1D/integrals/initiateIntegrals.js +11 -0
- package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +2 -21
- package/lib/data/data1d/Spectrum1D/peaks/initiatePeaks.d.ts +9 -0
- package/lib/data/data1d/Spectrum1D/peaks/initiatePeaks.js +7 -0
- package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.d.ts +2 -0
- package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.js +29 -0
- package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.d.ts +13 -0
- package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.js +14 -0
- package/lib/data/data1d/Spectrum1D/ranges/mapRanges.js +13 -8
- package/lib/data/migration/MigrationManager.js +3 -0
- package/lib/versionInfo.js +1 -1
- package/lib-cjs/component/1d/ExclusionZonesAnnotations.js +1 -2
- package/lib-cjs/component/1d/Integral.js +1 -6
- package/lib-cjs/component/1d/Viewer1D.js +4 -4
- package/lib-cjs/component/1d/ranges/RangeIntegral.js +2 -6
- package/lib-cjs/component/1d/utilities/scale.js +7 -6
- package/lib-cjs/component/2d/Viewer2D.js +4 -4
- package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +98 -81
- package/lib-cjs/component/NMRium.js +10 -10
- package/lib-cjs/component/elements/Tab/Tab.js +1 -0
- package/lib-cjs/component/header/Header.js +13 -10
- package/lib-cjs/component/hooks/useCheckExperimentalFeature.js +5 -1
- package/lib-cjs/component/hooks/useCheckToolsVisibility.js +13 -0
- package/lib-cjs/component/hooks/useIntegralPath.js +56 -0
- package/lib-cjs/component/hooks/useToolsFunctions.js +6 -6
- package/lib-cjs/component/hooks/useXScale.js +11 -0
- package/lib-cjs/component/loader/DropZone.js +88 -88
- package/lib-cjs/component/modal/changeSum/ChangeSumModal.js +4 -2
- package/lib-cjs/component/modal/editRange/forms/validation/EditRangeValidation.js +1 -1
- package/lib-cjs/component/modal/editZone/EditPathLengthFormik.js +77 -0
- package/lib-cjs/component/modal/editZone/EditZoneModal.js +101 -0
- package/lib-cjs/component/modal/editZone/SignalFormTab.js +11 -0
- package/lib-cjs/component/modal/editZone/SignalsForm.js +67 -0
- package/lib-cjs/component/modal/editZone/validation/EditZoneValidation.js +38 -0
- package/lib-cjs/component/modal/editZone/validation/isDefaultPathLength.js +12 -0
- package/lib-cjs/component/modal/setting/ControllersTabContent.js +1 -1
- package/lib-cjs/component/modal/setting/DisplayTabContent.js +1 -1
- package/lib-cjs/component/modal/setting/GeneralSettings.js +12 -8
- package/lib-cjs/component/panels/AutomaticAssignment/AutomaticAssignment.js +18 -0
- package/lib-cjs/component/panels/AutomaticAssignment/AutomaticAssignmentTable.js +43 -0
- package/lib-cjs/component/panels/IntegralsPanel/IntegralPanel.js +0 -3
- package/lib-cjs/component/panels/IntegralsPanel/IntegralsPreferences.js +3 -16
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanel.js +1 -1
- package/lib-cjs/component/panels/Panels.js +11 -15
- package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +0 -3
- package/lib-cjs/component/panels/PeaksPanel/PeaksPreferences.js +4 -13
- package/lib-cjs/component/panels/RangesPanel/RangesPanel.js +2 -5
- package/lib-cjs/component/panels/RangesPanel/RangesPreferences.js +4 -17
- package/lib-cjs/component/panels/SpectrumsPanel/SpectraPanelHeader.js +13 -3
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +7 -2
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnHeader.js +7 -2
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/Constants.js +1 -8
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTable.js +4 -5
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +21 -25
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/editLink/EditLinkModal.js +43 -30
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/editLink/EditPathLength.js +94 -0
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +1 -1
- package/lib-cjs/component/panels/SummaryPanel/SummaryPanel.js +38 -41
- package/lib-cjs/component/panels/SummaryPanel/utilities/IsInView.js +18 -0
- package/lib-cjs/component/panels/SummaryPanel/{Utilities.js → utilities/Utilities.js} +157 -19
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +24 -1
- package/lib-cjs/component/panels/ZonesPanel/ZonesPanel.js +12 -7
- package/lib-cjs/component/panels/ZonesPanel/ZonesPreferences.js +4 -17
- package/lib-cjs/component/panels/ZonesPanel/ZonesTable.js +5 -2
- package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +0 -3
- package/lib-cjs/component/panels/databasePanel/DatabasePreferences.js +3 -16
- package/lib-cjs/component/reducer/IgnoreActions.js +2 -1
- package/lib-cjs/component/reducer/Reducer.js +7 -8
- package/lib-cjs/component/reducer/actions/DatabaseActions.js +2 -2
- package/lib-cjs/component/reducer/actions/DomainActions.js +21 -1
- package/lib-cjs/component/reducer/actions/IntegralsActions.js +2 -0
- package/lib-cjs/component/reducer/actions/LoadActions.js +22 -1
- package/lib-cjs/component/reducer/actions/PreferencesActions.js +0 -2
- package/lib-cjs/component/reducer/actions/RangesActions.js +2 -0
- package/lib-cjs/component/reducer/actions/SpectrumsActions.js +2 -2
- package/lib-cjs/component/reducer/actions/ToolsActions.js +50 -63
- package/lib-cjs/component/reducer/actions/ZonesActions.js +35 -2
- package/lib-cjs/component/reducer/helper/Zoom1DManager.js +55 -73
- package/lib-cjs/component/reducer/helper/ZoomHistoryManager.js +2 -1
- package/lib-cjs/component/reducer/preferencesReducer.js +87 -37
- package/lib-cjs/component/reducer/types/Types.js +6 -4
- package/lib-cjs/component/toolbar/FunctionToolBar.js +7 -10
- package/lib-cjs/component/toolbar/ToolTypes.js +3 -3
- package/lib-cjs/component/workspaces/Workspace.js +2 -0
- package/lib-cjs/component/workspaces/basic.js +48 -0
- package/lib-cjs/component/workspaces/exercise1D.js +48 -0
- package/lib-cjs/component/workspaces/index.js +6 -0
- package/lib-cjs/component/workspaces/process1D.js +46 -0
- package/lib-cjs/data/constants/DefaultPathLengths.js +10 -0
- package/lib-cjs/data/data1d/Spectrum1D/getSpectrumErrorValue.js +8 -0
- package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +7 -19
- package/lib-cjs/data/data1d/Spectrum1D/integrals/initiateIntegrals.js +18 -0
- package/lib-cjs/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +2 -21
- package/lib-cjs/data/data1d/Spectrum1D/peaks/initiatePeaks.js +14 -0
- package/lib-cjs/data/data1d/Spectrum1D/peaks/mapPeaks.js +36 -0
- package/lib-cjs/data/data1d/Spectrum1D/ranges/initiateRanges.js +21 -0
- package/lib-cjs/data/data1d/Spectrum1D/ranges/mapRanges.js +13 -8
- package/lib-cjs/data/migration/MigrationManager.js +3 -0
- package/lib-cjs/versionInfo.js +1 -1
- package/package.json +15 -16
- package/lib/component/1d/utilities/useIntegralPath.js +0 -63
- package/lib/component/nmriumMode/basic.d.ts +0 -38
- package/lib/component/nmriumMode/basic.js +0 -37
- package/lib/component/nmriumMode/exercise1D.d.ts +0 -38
- package/lib/component/nmriumMode/exercise1D.js +0 -37
- package/lib/component/nmriumMode/process1D.d.ts +0 -38
- package/lib/component/nmriumMode/process1D.js +0 -37
- package/lib/component/panels/SummaryPanel/Utilities.d.ts +0 -25
- package/lib/component/reducer/actions/Zoom.d.ts +0 -16
- package/lib/component/reducer/actions/Zoom.js +0 -92
- package/lib-cjs/component/1d/utilities/useIntegralPath.js +0 -66
- package/lib-cjs/component/nmriumMode/basic.js +0 -39
- package/lib-cjs/component/nmriumMode/exercise1D.js +0 -39
- package/lib-cjs/component/nmriumMode/process1D.js +0 -39
- package/lib-cjs/component/reducer/actions/Zoom.js +0 -116
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import {
|
|
2
|
+
import { CorrelationData } from 'nmr-correlation';
|
|
3
3
|
import { SpectraAnalysis } from '../../data/data1d/MultipleAnalysis';
|
|
4
4
|
import { Molecule } from '../../data/molecules/Molecule';
|
|
5
5
|
import { Range } from '../../data/types/data1d';
|
|
@@ -7,7 +7,6 @@ import { Contours } from '../../data/types/data2d/Contours';
|
|
|
7
7
|
import { UsedColors } from '../../types/UsedColors';
|
|
8
8
|
import { Spectra } from '../NMRium';
|
|
9
9
|
import { DISPLAYER_MODE } from './core/Constants';
|
|
10
|
-
import { Zoom1D } from './helper/Zoom1DManager';
|
|
11
10
|
import { ZoomHistory } from './helper/ZoomHistoryManager';
|
|
12
11
|
export interface ActiveSpectrum {
|
|
13
12
|
id: string;
|
|
@@ -79,6 +78,12 @@ export interface State {
|
|
|
79
78
|
yDomains: Record<string, Array<number>>;
|
|
80
79
|
shareYDomain: boolean;
|
|
81
80
|
};
|
|
81
|
+
/**
|
|
82
|
+
* y axis domain per spectrum for integrals
|
|
83
|
+
* value change when vertical scale change for the integrals
|
|
84
|
+
* @default {}
|
|
85
|
+
*/
|
|
86
|
+
integralsYDomains: Record<string, Array<number>>;
|
|
82
87
|
/**
|
|
83
88
|
* current select tab (nucleus)
|
|
84
89
|
* @default null
|
|
@@ -159,15 +164,13 @@ export interface State {
|
|
|
159
164
|
/**
|
|
160
165
|
* Correlation data
|
|
161
166
|
*/
|
|
162
|
-
correlations:
|
|
167
|
+
correlations: CorrelationData;
|
|
163
168
|
/**
|
|
164
169
|
* Zoom Manager for vertical scale for spectra, integral, And undo zoom in per tab (nucleus)
|
|
165
170
|
* @default {history: {},spectra: {},integral: {}}
|
|
166
171
|
*/
|
|
167
172
|
zoom: {
|
|
168
173
|
history: ZoomHistory;
|
|
169
|
-
spectra: Zoom1D;
|
|
170
|
-
integral: Zoom1D;
|
|
171
174
|
};
|
|
172
175
|
/**
|
|
173
176
|
* boolean indicator to check if the mouse over the displayer or not
|
|
@@ -314,9 +317,6 @@ export declare const spectrumReducer: (base: {
|
|
|
314
317
|
readonly id: string;
|
|
315
318
|
readonly originalX: number;
|
|
316
319
|
readonly kind?: string | undefined;
|
|
317
|
-
readonly x: number;
|
|
318
|
-
readonly y: number;
|
|
319
|
-
readonly width: number;
|
|
320
320
|
readonly fwhm?: number | undefined;
|
|
321
321
|
readonly shape?: {
|
|
322
322
|
readonly kind: "gaussian";
|
|
@@ -330,6 +330,9 @@ export declare const spectrumReducer: (base: {
|
|
|
330
330
|
readonly fwhm?: number | undefined;
|
|
331
331
|
readonly mu?: number | undefined;
|
|
332
332
|
} | undefined;
|
|
333
|
+
readonly x: number;
|
|
334
|
+
readonly y: number;
|
|
335
|
+
readonly width: number;
|
|
333
336
|
}[];
|
|
334
337
|
readonly options: any;
|
|
335
338
|
};
|
|
@@ -379,9 +382,6 @@ export declare const spectrumReducer: (base: {
|
|
|
379
382
|
readonly integration?: number | undefined;
|
|
380
383
|
readonly peaks?: readonly {
|
|
381
384
|
readonly kind?: string | undefined;
|
|
382
|
-
readonly x: number;
|
|
383
|
-
readonly y: number;
|
|
384
|
-
readonly width: number;
|
|
385
385
|
readonly fwhm?: number | undefined;
|
|
386
386
|
readonly shape?: {
|
|
387
387
|
readonly kind: "gaussian";
|
|
@@ -395,6 +395,9 @@ export declare const spectrumReducer: (base: {
|
|
|
395
395
|
readonly fwhm?: number | undefined;
|
|
396
396
|
readonly mu?: number | undefined;
|
|
397
397
|
} | undefined;
|
|
398
|
+
readonly x: number;
|
|
399
|
+
readonly y: number;
|
|
400
|
+
readonly width: number;
|
|
398
401
|
}[] | undefined;
|
|
399
402
|
readonly statistic?: {
|
|
400
403
|
readonly mean: number;
|
|
@@ -590,6 +593,9 @@ export declare const spectrumReducer: (base: {
|
|
|
590
593
|
};
|
|
591
594
|
readonly shareYDomain: boolean;
|
|
592
595
|
};
|
|
596
|
+
readonly integralsYDomains: {
|
|
597
|
+
readonly [x: string]: readonly number[];
|
|
598
|
+
};
|
|
593
599
|
readonly activeTab: string;
|
|
594
600
|
readonly width: number;
|
|
595
601
|
readonly height: number;
|
|
@@ -682,26 +688,6 @@ export declare const spectrumReducer: (base: {
|
|
|
682
688
|
readonly yDomain: readonly number[];
|
|
683
689
|
}[];
|
|
684
690
|
};
|
|
685
|
-
readonly spectra: {
|
|
686
|
-
readonly scales: {
|
|
687
|
-
readonly [x: string]: number;
|
|
688
|
-
};
|
|
689
|
-
readonly options: {
|
|
690
|
-
readonly slowZoomStep: number;
|
|
691
|
-
readonly fastZoomStep: number;
|
|
692
|
-
readonly speedThreshold: number;
|
|
693
|
-
};
|
|
694
|
-
};
|
|
695
|
-
readonly integral: {
|
|
696
|
-
readonly scales: {
|
|
697
|
-
readonly [x: string]: number;
|
|
698
|
-
};
|
|
699
|
-
readonly options: {
|
|
700
|
-
readonly slowZoomStep: number;
|
|
701
|
-
readonly fastZoomStep: number;
|
|
702
|
-
readonly speedThreshold: number;
|
|
703
|
-
};
|
|
704
|
-
};
|
|
705
691
|
};
|
|
706
692
|
readonly overDisplayer: boolean;
|
|
707
693
|
readonly toolOptions: {
|
|
@@ -741,9 +727,6 @@ export declare const spectrumReducer: (base: {
|
|
|
741
727
|
readonly integration?: number | undefined;
|
|
742
728
|
readonly peaks?: readonly {
|
|
743
729
|
readonly kind?: string | undefined;
|
|
744
|
-
readonly x: number;
|
|
745
|
-
readonly y: number;
|
|
746
|
-
readonly width: number;
|
|
747
730
|
readonly fwhm?: number | undefined;
|
|
748
731
|
readonly shape?: {
|
|
749
732
|
readonly kind: "gaussian";
|
|
@@ -757,6 +740,9 @@ export declare const spectrumReducer: (base: {
|
|
|
757
740
|
readonly fwhm?: number | undefined;
|
|
758
741
|
readonly mu?: number | undefined;
|
|
759
742
|
} | undefined;
|
|
743
|
+
readonly x: number;
|
|
744
|
+
readonly y: number;
|
|
745
|
+
readonly width: number;
|
|
760
746
|
}[] | undefined;
|
|
761
747
|
readonly statistic?: {
|
|
762
748
|
readonly mean: number;
|
|
@@ -25,7 +25,6 @@ import * as SpectrumsActions from './actions/SpectrumsActions';
|
|
|
25
25
|
import * as ToolsActions from './actions/ToolsActions';
|
|
26
26
|
import * as ZonesActions from './actions/ZonesActions';
|
|
27
27
|
import { DEFAULT_YAXIS_SHIFT_VALUE, DISPLAYER_MODE } from './core/Constants';
|
|
28
|
-
import { initZoom1D } from './helper/Zoom1DManager';
|
|
29
28
|
import { UNDO, REDO, RESET } from './types/HistoryTypes';
|
|
30
29
|
import * as types from './types/Types';
|
|
31
30
|
export const initialState = {
|
|
@@ -44,6 +43,7 @@ export const initialState = {
|
|
|
44
43
|
yDomains: {},
|
|
45
44
|
shareYDomain: false,
|
|
46
45
|
},
|
|
46
|
+
integralsYDomains: {},
|
|
47
47
|
activeTab: '',
|
|
48
48
|
width: 0,
|
|
49
49
|
height: 0,
|
|
@@ -76,8 +76,6 @@ export const initialState = {
|
|
|
76
76
|
displayerKey: '',
|
|
77
77
|
zoom: {
|
|
78
78
|
history: {},
|
|
79
|
-
spectra: {},
|
|
80
|
-
integral: {},
|
|
81
79
|
},
|
|
82
80
|
overDisplayer: false,
|
|
83
81
|
toolOptions: {
|
|
@@ -101,14 +99,11 @@ export function initState(state) {
|
|
|
101
99
|
const correlations = buildCorrelationData([], {
|
|
102
100
|
tolerance: DefaultTolerance,
|
|
103
101
|
});
|
|
104
|
-
const spectra = initZoom1D();
|
|
105
|
-
const integral = initZoom1D();
|
|
106
|
-
const zoom = { spectra, integral, history: {} };
|
|
107
102
|
return {
|
|
108
103
|
...state,
|
|
109
104
|
correlations,
|
|
110
105
|
displayerKey,
|
|
111
|
-
|
|
106
|
+
history: {},
|
|
112
107
|
};
|
|
113
108
|
}
|
|
114
109
|
export function dispatchMiddleware(dispatch) {
|
|
@@ -272,7 +267,7 @@ function innerSpectrumReducer(draft, action) {
|
|
|
272
267
|
return SpectrumsActions.generateSpectrumFromPublicationStringHandler(draft, action);
|
|
273
268
|
case types.TOGGLE_REAL_IMAGINARY_VISIBILITY:
|
|
274
269
|
return ToolsActions.handleToggleRealImaginaryVisibility(draft);
|
|
275
|
-
case types.
|
|
270
|
+
case types.SET_ZOOM:
|
|
276
271
|
return ToolsActions.handleZoom(draft, action);
|
|
277
272
|
case types.SET_SPECTRA_SAME_TOP:
|
|
278
273
|
return ToolsActions.setSpectraSameTopHandler(draft);
|
|
@@ -366,6 +361,8 @@ function innerSpectrumReducer(draft, action) {
|
|
|
366
361
|
return ZonesActions.handleDeleteZone(draft, action);
|
|
367
362
|
case types.DELETE_2D_SIGNAL:
|
|
368
363
|
return ZonesActions.handleDeleteSignal(draft, action);
|
|
364
|
+
case types.SET_2D_SIGNAL_PATH_LENGTH:
|
|
365
|
+
return ZonesActions.handleSetSignalPathLength(draft, action);
|
|
369
366
|
case types.RESET_DOMAIN:
|
|
370
367
|
return DomainActions.handelResetDomain(draft);
|
|
371
368
|
case types.CHANGE_ZONE_SIGNAL_VALUE:
|
|
@@ -378,6 +375,8 @@ function innerSpectrumReducer(draft, action) {
|
|
|
378
375
|
return ZonesActions.handleSetDiaIDZone(draft, action);
|
|
379
376
|
case types.AUTO_ZONES_SPECTRA_PICKING:
|
|
380
377
|
return ZonesActions.handleAutoSpectraZonesDetection(draft);
|
|
378
|
+
case types.SAVE_EDITED_ZONE:
|
|
379
|
+
return ZonesActions.handleSaveEditedZone(draft, action);
|
|
381
380
|
case types.ANALYZE_SPECTRA:
|
|
382
381
|
return SpectraAnalysisActions.analyzeSpectra(draft, action);
|
|
383
382
|
case types.DELETE_ANALYZE_SPECTRA_RANGE:
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import { Draft } from 'immer';
|
|
2
|
-
import {
|
|
2
|
+
import { Tolerance, Options as CorrelationOptions, Correlation, Values as CorrelationValues } from 'nmr-correlation';
|
|
3
3
|
import { State } from '../Reducer';
|
|
4
4
|
declare function handleUpdateCorrelations(draft: Draft<State>): void;
|
|
5
5
|
declare function handleSetMF(draft: Draft<State>, payload: {
|
|
6
6
|
mf: string;
|
|
7
7
|
}): void;
|
|
8
8
|
declare function handleSetTolerance(draft: Draft<State>, payload: {
|
|
9
|
-
tolerance:
|
|
9
|
+
tolerance: Tolerance;
|
|
10
10
|
}): void;
|
|
11
11
|
declare function handleSetCorrelation(draft: Draft<State>, payload: {
|
|
12
12
|
id: string;
|
|
13
|
-
correlation:
|
|
14
|
-
options:
|
|
13
|
+
correlation: Correlation;
|
|
14
|
+
options: CorrelationOptions;
|
|
15
15
|
}): void;
|
|
16
16
|
declare function handleSetCorrelations(draft: Draft<State>, payload: {
|
|
17
|
-
correlations:
|
|
18
|
-
options:
|
|
17
|
+
correlations: CorrelationValues;
|
|
18
|
+
options: CorrelationOptions;
|
|
19
19
|
}): void;
|
|
20
20
|
declare function handleDeleteCorrelation(draft: Draft<State>, payload: {
|
|
21
|
-
correlation:
|
|
21
|
+
correlation: Correlation;
|
|
22
22
|
assignmentData: any;
|
|
23
23
|
}): void;
|
|
24
24
|
export { handleDeleteCorrelation, handleSetCorrelation, handleSetCorrelations, handleSetMF, handleSetTolerance, handleUpdateCorrelations, };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { original } from 'immer';
|
|
2
2
|
import lodashCloneDeep from 'lodash/cloneDeep';
|
|
3
|
-
import { buildCorrelationData, setCorrelation } from 'nmr-correlation';
|
|
3
|
+
import { buildCorrelationData, setCorrelation, } from 'nmr-correlation';
|
|
4
4
|
import { findRange, findSignal1D, findSignal2D, findSpectrum, findZone, } from '../../../data/utilities/FindUtilities';
|
|
5
5
|
import { handleDeleteSignal as handleDeleteSignal1D } from './RangesActions';
|
|
6
6
|
import { handleDeleteSignal as handleDeleteSignal2D } from './ZonesActions';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { generateSpectrumFromRanges } from '../../../data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges';
|
|
2
|
+
import { setZoom } from '../helper/Zoom1DManager';
|
|
2
3
|
import { setDomain } from './DomainActions';
|
|
3
|
-
import { setZoom } from './Zoom';
|
|
4
4
|
function handleRangeResurrecting(draft, action) {
|
|
5
5
|
const { ranges, info } = action.payload;
|
|
6
6
|
const datum = generateSpectrumFromRanges(ranges, info, draft.usedColors);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Draft } from 'immer';
|
|
2
|
+
import { Datum1D } from '../../../data/types/data1d';
|
|
2
3
|
import { State } from '../Reducer';
|
|
3
4
|
declare function getDomain(drfat: Draft<State>): {
|
|
4
5
|
xDomain: [number, number] | [undefined, undefined];
|
|
@@ -13,9 +14,10 @@ export interface SetDomainOptions {
|
|
|
13
14
|
};
|
|
14
15
|
}
|
|
15
16
|
declare function setDomain(draft: Draft<State>, options?: SetDomainOptions): void;
|
|
17
|
+
declare function setIntegralsYDomain(draft: Draft<State>, data: Datum1D[] | Datum1D): void;
|
|
16
18
|
declare function setOriginalDomain(draft: Draft<State>, originDomain: any): void;
|
|
17
19
|
declare function setXDomain(draft: Draft<State>, xDomain: any): void;
|
|
18
20
|
declare function setYDomain(draft: Draft<State>, yDomain: any): void;
|
|
19
21
|
declare function handelResetDomain(draft: Draft<State>): void;
|
|
20
22
|
declare function setMode(draft: Draft<State>): void;
|
|
21
|
-
export { getDomain, setOriginalDomain, setXDomain, setYDomain, handelResetDomain, setDomain, setMode, };
|
|
23
|
+
export { getDomain, setOriginalDomain, setXDomain, setYDomain, handelResetDomain, setDomain, setMode, setIntegralsYDomain, };
|
|
@@ -149,6 +149,25 @@ function setDomain(draft, options) {
|
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
151
|
}
|
|
152
|
+
function getSpectrumIntegralsDomain(datum) {
|
|
153
|
+
const { integrals, ranges } = datum;
|
|
154
|
+
let max = Number.NEGATIVE_INFINITY;
|
|
155
|
+
for (const integral of integrals.values) {
|
|
156
|
+
max = Math.max(max, integral.absolute);
|
|
157
|
+
}
|
|
158
|
+
for (const range of ranges.values) {
|
|
159
|
+
max = Math.max(max, range.absolute);
|
|
160
|
+
}
|
|
161
|
+
return [0, max];
|
|
162
|
+
}
|
|
163
|
+
function setIntegralsYDomain(draft, data) {
|
|
164
|
+
for (const spectrum of Array.isArray(data) ? data : [data]) {
|
|
165
|
+
if (spectrum?.info?.dimension === 1) {
|
|
166
|
+
draft.integralsYDomains[spectrum.id] =
|
|
167
|
+
getSpectrumIntegralsDomain(spectrum);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
152
171
|
function setOriginalDomain(draft, originDomain) {
|
|
153
172
|
draft.originDomain = originDomain;
|
|
154
173
|
}
|
|
@@ -170,4 +189,4 @@ function setMode(draft) {
|
|
|
170
189
|
nucleusToString(datum.info.nucleus) === draft.activeTab);
|
|
171
190
|
draft.mode = data[0]?.info.isFid ? 'LTR' : 'RTL';
|
|
172
191
|
}
|
|
173
|
-
export { getDomain, setOriginalDomain, setXDomain, setYDomain, handelResetDomain, setDomain, setMode, };
|
|
192
|
+
export { getDomain, setOriginalDomain, setXDomain, setYDomain, handelResetDomain, setDomain, setMode, setIntegralsYDomain, };
|
|
@@ -4,6 +4,7 @@ import { updateIntegralsRelativeValues, changeIntegralsRelative, getShiftX, } fr
|
|
|
4
4
|
import { initSumOptions, setSumOptions, } from '../../../data/data1d/Spectrum1D/SumManager';
|
|
5
5
|
import generateID from '../../../data/utilities/generateID';
|
|
6
6
|
import getRange from '../helper/getRange';
|
|
7
|
+
import { setIntegralsYDomain } from './DomainActions';
|
|
7
8
|
function handleChangeIntegralSum(draft, options) {
|
|
8
9
|
const { data, activeSpectrum, activeTab: nucleus } = draft;
|
|
9
10
|
if (activeSpectrum?.id) {
|
|
@@ -36,6 +37,7 @@ function addIntegral(draft, action) {
|
|
|
36
37
|
nucleus,
|
|
37
38
|
});
|
|
38
39
|
updateIntegralsRelativeValues(datum);
|
|
40
|
+
setIntegralsYDomain(draft, datum);
|
|
39
41
|
}
|
|
40
42
|
}
|
|
41
43
|
function deleteIntegral(draft, action) {
|
|
@@ -28,9 +28,30 @@ function setData(draft, data) {
|
|
|
28
28
|
});
|
|
29
29
|
}
|
|
30
30
|
else {
|
|
31
|
-
|
|
31
|
+
// in case of older NMRium data are imported, convert hybridization string to number array
|
|
32
|
+
// @TODO remove following command to overwrite correlations at some point in future
|
|
33
|
+
draft.correlations =
|
|
34
|
+
convertHybridizationStringValuesInCorrelations(correlations);
|
|
35
|
+
// draft.correlations = correlations // original command without overwriting
|
|
32
36
|
}
|
|
33
37
|
}
|
|
38
|
+
function convertHybridizationStringValuesInCorrelations(correlations) {
|
|
39
|
+
return {
|
|
40
|
+
...correlations,
|
|
41
|
+
values: correlations.values.map((correlation) => {
|
|
42
|
+
if (typeof correlation.hybridization === 'string') {
|
|
43
|
+
let values = [];
|
|
44
|
+
if (correlation.hybridization.length > 0) {
|
|
45
|
+
const hybridizationString = correlation.hybridization.replaceAll('SP', '');
|
|
46
|
+
const value = Number(hybridizationString);
|
|
47
|
+
values.push(value);
|
|
48
|
+
}
|
|
49
|
+
correlation.hybridization = values;
|
|
50
|
+
}
|
|
51
|
+
return correlation;
|
|
52
|
+
}),
|
|
53
|
+
};
|
|
54
|
+
}
|
|
34
55
|
function setPreferences(draft, data) {
|
|
35
56
|
const emptyPreferences = {
|
|
36
57
|
verticalAlign: null,
|
|
@@ -3,7 +3,6 @@ import GroupByInfoKey from '../../utility/GroupByInfoKey';
|
|
|
3
3
|
import nucleusToString from '../../utility/nucleusToString';
|
|
4
4
|
import { DEFAULT_YAXIS_SHIFT_VALUE, DISPLAYER_MODE } from '../core/Constants';
|
|
5
5
|
import { setDomain } from './DomainActions';
|
|
6
|
-
import { setZoom } from './Zoom';
|
|
7
6
|
function changeSpectrumVerticalAlignment(draft, options) {
|
|
8
7
|
if (draft.data && draft.data.length > 0) {
|
|
9
8
|
let dataPerNucleus = [];
|
|
@@ -109,7 +108,6 @@ function applyKeyPreferencesHandler(draft, keyCode) {
|
|
|
109
108
|
}
|
|
110
109
|
else {
|
|
111
110
|
draft.zoom = preferences.zoom;
|
|
112
|
-
setZoom(draft);
|
|
113
111
|
}
|
|
114
112
|
}
|
|
115
113
|
}
|
|
@@ -9,7 +9,7 @@ import { setSumOptions } from '../../../data/data1d/Spectrum1D/SumManager';
|
|
|
9
9
|
import { unlink, unlinkInAssignmentData, } from '../../../data/utilities/RangeUtilities';
|
|
10
10
|
import getRange from '../helper/getRange';
|
|
11
11
|
import { handleUpdateCorrelations } from './CorrelationsActions';
|
|
12
|
-
import { setDomain } from './DomainActions';
|
|
12
|
+
import { setDomain, setIntegralsYDomain } from './DomainActions';
|
|
13
13
|
function handleAutoRangesDetection(draft, options) {
|
|
14
14
|
const { activeSpectrum, data, xDomain, molecules, activeTab: nucleus, } = draft;
|
|
15
15
|
if (activeSpectrum?.id) {
|
|
@@ -35,6 +35,7 @@ function handleAutoRangesDetection(draft, options) {
|
|
|
35
35
|
nucleus,
|
|
36
36
|
});
|
|
37
37
|
handleOnChangeRangesData(draft);
|
|
38
|
+
setIntegralsYDomain(draft, datum);
|
|
38
39
|
}
|
|
39
40
|
}
|
|
40
41
|
function handleAutoSpectraRangesDetection(draft) {
|
|
@@ -210,6 +211,7 @@ function handleAddRange(draft, action) {
|
|
|
210
211
|
const [from, to] = range;
|
|
211
212
|
addRange(draft.data[index], { from, to, nucleus, molecules });
|
|
212
213
|
handleOnChangeRangesData(draft);
|
|
214
|
+
setIntegralsYDomain(draft, draft.data[index]);
|
|
213
215
|
}
|
|
214
216
|
}
|
|
215
217
|
function handleChangeRangeRelativeValue(draft, action) {
|
|
@@ -5,10 +5,10 @@ import { generateSpectrumFromPublicationString, getReferenceShift, } from '../..
|
|
|
5
5
|
import { getMissingProjection } from '../../../data/data2d/Spectrum2D';
|
|
6
6
|
import { options } from '../../toolbar/ToolTypes';
|
|
7
7
|
import GroupByInfoKey from '../../utility/GroupByInfoKey';
|
|
8
|
+
import { setZoom } from '../helper/Zoom1DManager';
|
|
8
9
|
import { setDomain, setMode } from './DomainActions';
|
|
9
10
|
import { resetSpectrumByFilter } from './FiltersActions';
|
|
10
11
|
import { setTab, setActiveTab } from './ToolsActions';
|
|
11
|
-
import { setZoom } from './Zoom';
|
|
12
12
|
function checkIsVisible2D(datum) {
|
|
13
13
|
if (datum.display.isPositiveVisible === false &&
|
|
14
14
|
datum.display.isNegativeVisible === false) {
|
|
@@ -8,13 +8,13 @@ import { LAYOUT } from '../../2d/utilities/DimensionLayout';
|
|
|
8
8
|
import { get2DYScale } from '../../2d/utilities/scale';
|
|
9
9
|
import { options } from '../../toolbar/ToolTypes';
|
|
10
10
|
import GroupByInfoKey from '../../utility/GroupByInfoKey';
|
|
11
|
+
import { getSpectraByNucleus } from '../../utility/getSpectraByNucleus';
|
|
11
12
|
import { DISPLAYER_MODE, MARGIN } from '../core/Constants';
|
|
12
|
-
import
|
|
13
|
+
import { setZoom, wheelZoom, ZoomType } from '../helper/Zoom1DManager';
|
|
13
14
|
import zoomHistoryManager from '../helper/ZoomHistoryManager';
|
|
14
|
-
import { setDomain, setMode } from './DomainActions';
|
|
15
|
+
import { setDomain, setIntegralsYDomain, setMode, } from './DomainActions';
|
|
15
16
|
import { resetSpectrumByFilter } from './FiltersActions';
|
|
16
17
|
import { changeSpectrumVerticalAlignment } from './PreferencesActions';
|
|
17
|
-
import { setZoom1D, setZoom, ZoomType, wheel } from './Zoom';
|
|
18
18
|
function getStrongestPeak(draft) {
|
|
19
19
|
const { activeSpectrum, data } = draft;
|
|
20
20
|
if (activeSpectrum) {
|
|
@@ -180,7 +180,7 @@ function handleBrushEnd(draft, action) {
|
|
|
180
180
|
break;
|
|
181
181
|
}
|
|
182
182
|
if (brushHistory) {
|
|
183
|
-
brushHistory.push({ xDomain:
|
|
183
|
+
brushHistory.push({ xDomain: draft.xDomain, yDomain: draft.yDomain });
|
|
184
184
|
}
|
|
185
185
|
}
|
|
186
186
|
else {
|
|
@@ -204,34 +204,37 @@ function getSpectrumID(draft, index) {
|
|
|
204
204
|
return spectrum?.id ? spectrum.id : null;
|
|
205
205
|
}
|
|
206
206
|
function handleZoom(draft, action) {
|
|
207
|
-
const {
|
|
208
|
-
const { activeSpectrum, toolOptions: { data: { showRangesIntegrals }, }, } = draft;
|
|
209
|
-
if (
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
}
|
|
217
|
-
case LAYOUT.LEFT_1D: {
|
|
218
|
-
const id = getSpectrumID(draft, 1);
|
|
219
|
-
wheel(deltaY, deltaMode, draft, id);
|
|
220
|
-
setZoom1D(draft, draft.margin.left, 10, 1);
|
|
221
|
-
break;
|
|
207
|
+
const { event, trackID, selectedTool } = action;
|
|
208
|
+
const { activeSpectrum, toolOptions: { data: { showRangesIntegrals }, }, displayerMode, } = draft;
|
|
209
|
+
if (displayerMode === DISPLAYER_MODE.DM_2D) {
|
|
210
|
+
const index = trackID === LAYOUT.TOP_1D ? 0 : trackID === LAYOUT.LEFT_1D ? 1 : null;
|
|
211
|
+
if (index !== null) {
|
|
212
|
+
const id = getSpectrumID(draft, index);
|
|
213
|
+
if (id) {
|
|
214
|
+
const domain = draft.yDomains[id];
|
|
215
|
+
draft.yDomains[id] = wheelZoom(event, domain);
|
|
222
216
|
}
|
|
223
|
-
default:
|
|
224
|
-
break;
|
|
225
217
|
}
|
|
226
218
|
}
|
|
227
|
-
else if (activeSpectrum?.id &&
|
|
228
|
-
shiftKey &&
|
|
229
|
-
(showRangesIntegrals || selectedTool === options.integral.id)) {
|
|
230
|
-
Zoom1DManager(draft.zoom.integral).wheel(deltaY, activeSpectrum?.id);
|
|
231
|
-
}
|
|
232
219
|
else {
|
|
233
|
-
|
|
234
|
-
|
|
220
|
+
if (activeSpectrum?.id) {
|
|
221
|
+
if ((showRangesIntegrals || selectedTool === options.integral.id) &&
|
|
222
|
+
event.shiftKey) {
|
|
223
|
+
const domain = draft.integralsYDomains[activeSpectrum?.id];
|
|
224
|
+
draft.integralsYDomains[activeSpectrum?.id] = wheelZoom(event, domain);
|
|
225
|
+
}
|
|
226
|
+
else {
|
|
227
|
+
const domain = draft.yDomains[activeSpectrum?.id];
|
|
228
|
+
draft.yDomains[activeSpectrum?.id] = wheelZoom(event, domain);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
else {
|
|
232
|
+
const spectra = getSpectraByNucleus(draft.activeTab, draft.data);
|
|
233
|
+
for (const spectrum of spectra) {
|
|
234
|
+
const domain = draft.yDomains[spectrum.id];
|
|
235
|
+
draft.yDomains[spectrum.id] = wheelZoom(event, domain);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
235
238
|
}
|
|
236
239
|
}
|
|
237
240
|
function zoomOut(draft, action) {
|
|
@@ -242,6 +245,7 @@ function zoomOut(draft, action) {
|
|
|
242
245
|
switch (zoomType) {
|
|
243
246
|
case ZoomType.HORIZONTAL: {
|
|
244
247
|
draft.xDomain = draft.originDomain.xDomain;
|
|
248
|
+
zoomHistory.clear();
|
|
245
249
|
break;
|
|
246
250
|
}
|
|
247
251
|
case ZoomType.VERTICAL:
|
|
@@ -264,34 +268,16 @@ function zoomOut(draft, action) {
|
|
|
264
268
|
}
|
|
265
269
|
else {
|
|
266
270
|
const { xDomain, yDomain, yDomains } = draft.originDomain;
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
const activeSpectrum = draft.tabActiveSpectrum[draft.activeTab.split(',')[1]];
|
|
278
|
-
draft.yDomain = yDomain;
|
|
279
|
-
if (activeSpectrum?.id) {
|
|
280
|
-
draft.yDomains[activeSpectrum.id] = yDomains[activeSpectrum.id];
|
|
281
|
-
}
|
|
282
|
-
break;
|
|
283
|
-
}
|
|
284
|
-
case LAYOUT.CENTER_2D: {
|
|
285
|
-
const zoomValue = zoomHistory.pop();
|
|
286
|
-
draft.xDomain = zoomValue ? zoomValue.xDomain : xDomain;
|
|
287
|
-
draft.yDomain = zoomValue ? zoomValue.yDomain : yDomain;
|
|
288
|
-
break;
|
|
289
|
-
}
|
|
290
|
-
default:
|
|
291
|
-
draft.xDomain = xDomain;
|
|
292
|
-
draft.yDomain = yDomain;
|
|
293
|
-
draft.yDomains = yDomains;
|
|
294
|
-
break;
|
|
271
|
+
if ([LAYOUT.TOP_1D, LAYOUT.LEFT_1D, LAYOUT.CENTER_2D].includes(trackID)) {
|
|
272
|
+
const zoomValue = zoomHistory.pop();
|
|
273
|
+
draft.xDomain = zoomValue ? zoomValue.xDomain : xDomain;
|
|
274
|
+
draft.yDomain = zoomValue ? zoomValue.yDomain : yDomain;
|
|
275
|
+
}
|
|
276
|
+
else {
|
|
277
|
+
zoomHistory.clear();
|
|
278
|
+
draft.xDomain = xDomain;
|
|
279
|
+
draft.yDomain = yDomain;
|
|
280
|
+
draft.yDomains = yDomains;
|
|
295
281
|
}
|
|
296
282
|
}
|
|
297
283
|
}
|
|
@@ -404,6 +390,7 @@ function setActiveTab(draft, options) {
|
|
|
404
390
|
resetTool(draft);
|
|
405
391
|
Processing2DData(draft, dataGroupByNucleus);
|
|
406
392
|
setDomain(draft, domainOptions);
|
|
393
|
+
setIntegralsYDomain(draft, dataGroupByNucleus[currentTab]);
|
|
407
394
|
const zoomHistory = zoomHistoryManager(draft.zoom.history, draft.activeTab);
|
|
408
395
|
const zoomValue = zoomHistory.getLast();
|
|
409
396
|
if (zoomValue) {
|
|
@@ -8,6 +8,8 @@ declare function changeZoneSignalDelta(draft: Draft<State>, action: any): void;
|
|
|
8
8
|
declare function handleChangeZoneSignalKind(draft: Draft<State>, action: any): void;
|
|
9
9
|
declare function handleDeleteZone(draft: Draft<State>, action: any): void;
|
|
10
10
|
declare function handleDeleteSignal(draft: Draft<State>, action: any): void;
|
|
11
|
+
declare function handleSetSignalPathLength(draft: Draft<State>, action: any): void;
|
|
11
12
|
declare function handleUnlinkZone(draft: Draft<State>, action: any): void;
|
|
12
13
|
declare function handleSetDiaIDZone(draft: Draft<State>, action: any): void;
|
|
13
|
-
|
|
14
|
+
declare function handleSaveEditedZone(draft: Draft<State>, action: any): void;
|
|
15
|
+
export { add2dZoneHandler, handleAutoZonesDetection, handleDeleteSignal, handleDeleteZone, changeZoneSignalDelta, handleChangeZoneSignalKind, handleUnlinkZone, handleSaveEditedZone, handleSetDiaIDZone, handleSetSignalPathLength, changeZonesFactorHandler, handleAutoSpectraZonesDetection, };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { original } from 'immer';
|
|
2
2
|
import lodashCloneDeep from 'lodash/cloneDeep';
|
|
3
|
+
import { setPathLength } from 'nmr-correlation';
|
|
3
4
|
import * as Filters from '../../../data/Filters';
|
|
4
5
|
import * as FiltersManager from '../../../data/FiltersManager';
|
|
5
6
|
import { DatumKind, SignalKindsToInclude, } from '../../../data/constants/SignalsKinds';
|
|
@@ -125,6 +126,21 @@ function handleDeleteSignal(draft, action) {
|
|
|
125
126
|
handleOnChangeZonesData(draft);
|
|
126
127
|
}
|
|
127
128
|
}
|
|
129
|
+
function handleSetSignalPathLength(draft, action) {
|
|
130
|
+
const { spectrum, zone, signal, pathLength } = action.payload;
|
|
131
|
+
if (spectrum && zone) {
|
|
132
|
+
const datum2D = draft.data.find((datum) => datum.id === spectrum.id);
|
|
133
|
+
const zoneIndex = datum2D.zones.values.findIndex((_zone) => _zone.id === zone.id);
|
|
134
|
+
const signalIndex = zone.signals.findIndex((_signal) => _signal.id === signal.id);
|
|
135
|
+
const _zone = unlink(lodashCloneDeep(zone), false, signalIndex, undefined);
|
|
136
|
+
_zone.signals[signalIndex].j = {
|
|
137
|
+
..._zone.signals[signalIndex].j,
|
|
138
|
+
pathLength,
|
|
139
|
+
};
|
|
140
|
+
datum2D.zones.values[zoneIndex] = _zone;
|
|
141
|
+
handleOnChangeZonesData(draft);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
128
144
|
function handleUnlinkZone(draft, action) {
|
|
129
145
|
const state = original(draft);
|
|
130
146
|
if (state.activeSpectrum?.id) {
|
|
@@ -163,10 +179,25 @@ function handleSetDiaIDZone(draft, action) {
|
|
|
163
179
|
_zone.signals[signalIndex][axis].diaIDs = diaIDs;
|
|
164
180
|
_zone.signals[signalIndex][axis].nbAtoms = getNbAtoms(nbAtoms, _zone.signals[signalIndex][axis].nbAtoms);
|
|
165
181
|
}
|
|
166
|
-
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
function handleSaveEditedZone(draft, action) {
|
|
185
|
+
const state = original(draft);
|
|
186
|
+
if (state.activeSpectrum?.id) {
|
|
187
|
+
const { index } = state.activeSpectrum;
|
|
188
|
+
const { editedRowData } = action.payload;
|
|
189
|
+
delete editedRowData.tableMetaInfo;
|
|
190
|
+
const zoneIndex = getZoneIndex(state, index, editedRowData.id);
|
|
191
|
+
draft.data[index].zones.values[zoneIndex] = editedRowData;
|
|
192
|
+
if (editedRowData.signals) {
|
|
193
|
+
editedRowData.signals.forEach((signal) => {
|
|
194
|
+
setPathLength(draft.correlations.values, signal.id, signal.j?.pathLength);
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
handleOnChangeZonesData(draft);
|
|
167
198
|
}
|
|
168
199
|
}
|
|
169
200
|
function handleOnChangeZonesData(draft) {
|
|
170
201
|
handleUpdateCorrelations(draft);
|
|
171
202
|
}
|
|
172
|
-
export { add2dZoneHandler, handleAutoZonesDetection, handleDeleteSignal, handleDeleteZone, changeZoneSignalDelta, handleChangeZoneSignalKind, handleUnlinkZone, handleSetDiaIDZone, changeZonesFactorHandler, handleAutoSpectraZonesDetection, };
|
|
203
|
+
export { add2dZoneHandler, handleAutoZonesDetection, handleDeleteSignal, handleDeleteZone, changeZoneSignalDelta, handleChangeZoneSignalKind, handleUnlinkZone, handleSaveEditedZone, handleSetDiaIDZone, handleSetSignalPathLength, changeZonesFactorHandler, handleAutoSpectraZonesDetection, };
|