nmrium 0.21.0 → 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/NMRium.d.ts +2 -0
- package/lib/component/elements/EditableColumn.d.ts +1 -1
- package/lib/component/header/Header.js +3 -7
- 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 +4 -5
- package/lib/component/hooks/useXScale.d.ts +2 -0
- package/lib/component/hooks/useXScale.js +7 -0
- 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/GeneralSettings.d.ts +1 -2
- package/lib/component/modal/setting/GeneralSettings.js +13 -5
- 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/Panels.d.ts +1 -1
- package/lib/component/panels/Panels.js +10 -14
- package/lib/component/panels/RangesPanel/RangesPanel.js +2 -2
- 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 +1 -1
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +1 -1
- package/lib/component/panels/SummaryPanel/SummaryPanel.js +39 -42
- 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 -4
- package/lib/component/panels/ZonesPanel/ZonesTable.d.ts +3 -2
- package/lib/component/panels/ZonesPanel/ZonesTable.js +5 -2
- package/lib/component/reducer/IgnoreActions.js +2 -1
- package/lib/component/reducer/Reducer.d.ts +9 -23
- package/lib/component/reducer/Reducer.js +7 -8
- 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 +31 -27
- 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/preferencesReducer.d.ts +1 -8
- package/lib/component/reducer/preferencesReducer.js +11 -1
- package/lib/component/reducer/types/Types.d.ts +3 -1
- package/lib/component/reducer/types/Types.js +3 -1
- 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/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/header/Header.js +3 -7
- package/lib-cjs/component/hooks/useIntegralPath.js +56 -0
- package/lib-cjs/component/hooks/useToolsFunctions.js +4 -5
- package/lib-cjs/component/hooks/useXScale.js +11 -0
- 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/GeneralSettings.js +12 -4
- 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/Panels.js +11 -15
- package/lib-cjs/component/panels/RangesPanel/RangesPanel.js +2 -2
- 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 -4
- package/lib-cjs/component/panels/ZonesPanel/ZonesTable.js +5 -2
- 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 +38 -34
- 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/preferencesReducer.js +12 -2
- package/lib-cjs/component/reducer/types/Types.js +6 -4
- 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/versionInfo.js +1 -1
- package/package.json +1 -1
- package/lib/component/1d/utilities/useIntegralPath.js +0 -63
- 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/reducer/actions/Zoom.js +0 -116
|
@@ -10,6 +10,7 @@ const Spectrum1D_1 = require("../../../data/data1d/Spectrum1D");
|
|
|
10
10
|
const SumManager_1 = require("../../../data/data1d/Spectrum1D/SumManager");
|
|
11
11
|
const generateID_1 = __importDefault(require("../../../data/utilities/generateID"));
|
|
12
12
|
const getRange_1 = __importDefault(require("../helper/getRange"));
|
|
13
|
+
const DomainActions_1 = require("./DomainActions");
|
|
13
14
|
function handleChangeIntegralSum(draft, options) {
|
|
14
15
|
const { data, activeSpectrum, activeTab: nucleus } = draft;
|
|
15
16
|
if (activeSpectrum?.id) {
|
|
@@ -43,6 +44,7 @@ function addIntegral(draft, action) {
|
|
|
43
44
|
nucleus,
|
|
44
45
|
});
|
|
45
46
|
(0, Spectrum1D_1.updateIntegralsRelativeValues)(datum);
|
|
47
|
+
(0, DomainActions_1.setIntegralsYDomain)(draft, datum);
|
|
46
48
|
}
|
|
47
49
|
}
|
|
48
50
|
exports.addIntegral = addIntegral;
|
|
@@ -51,9 +51,30 @@ function setData(draft, data) {
|
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
53
|
else {
|
|
54
|
-
|
|
54
|
+
// in case of older NMRium data are imported, convert hybridization string to number array
|
|
55
|
+
// @TODO remove following command to overwrite correlations at some point in future
|
|
56
|
+
draft.correlations =
|
|
57
|
+
convertHybridizationStringValuesInCorrelations(correlations);
|
|
58
|
+
// draft.correlations = correlations // original command without overwriting
|
|
55
59
|
}
|
|
56
60
|
}
|
|
61
|
+
function convertHybridizationStringValuesInCorrelations(correlations) {
|
|
62
|
+
return {
|
|
63
|
+
...correlations,
|
|
64
|
+
values: correlations.values.map((correlation) => {
|
|
65
|
+
if (typeof correlation.hybridization === 'string') {
|
|
66
|
+
let values = [];
|
|
67
|
+
if (correlation.hybridization.length > 0) {
|
|
68
|
+
const hybridizationString = correlation.hybridization.replaceAll('SP', '');
|
|
69
|
+
const value = Number(hybridizationString);
|
|
70
|
+
values.push(value);
|
|
71
|
+
}
|
|
72
|
+
correlation.hybridization = values;
|
|
73
|
+
}
|
|
74
|
+
return correlation;
|
|
75
|
+
}),
|
|
76
|
+
};
|
|
77
|
+
}
|
|
57
78
|
function setPreferences(draft, data) {
|
|
58
79
|
const emptyPreferences = {
|
|
59
80
|
verticalAlign: null,
|
|
@@ -9,7 +9,6 @@ const GroupByInfoKey_1 = __importDefault(require("../../utility/GroupByInfoKey")
|
|
|
9
9
|
const nucleusToString_1 = __importDefault(require("../../utility/nucleusToString"));
|
|
10
10
|
const Constants_1 = require("../core/Constants");
|
|
11
11
|
const DomainActions_1 = require("./DomainActions");
|
|
12
|
-
const Zoom_1 = require("./Zoom");
|
|
13
12
|
function changeSpectrumVerticalAlignment(draft, options) {
|
|
14
13
|
if (draft.data && draft.data.length > 0) {
|
|
15
14
|
let dataPerNucleus = [];
|
|
@@ -117,7 +116,6 @@ function applyKeyPreferencesHandler(draft, keyCode) {
|
|
|
117
116
|
}
|
|
118
117
|
else {
|
|
119
118
|
draft.zoom = preferences.zoom;
|
|
120
|
-
(0, Zoom_1.setZoom)(draft);
|
|
121
119
|
}
|
|
122
120
|
}
|
|
123
121
|
}
|
|
@@ -60,6 +60,7 @@ function handleAutoRangesDetection(draft, options) {
|
|
|
60
60
|
nucleus,
|
|
61
61
|
});
|
|
62
62
|
handleOnChangeRangesData(draft);
|
|
63
|
+
(0, DomainActions_1.setIntegralsYDomain)(draft, datum);
|
|
63
64
|
}
|
|
64
65
|
}
|
|
65
66
|
exports.handleAutoRangesDetection = handleAutoRangesDetection;
|
|
@@ -245,6 +246,7 @@ function handleAddRange(draft, action) {
|
|
|
245
246
|
const [from, to] = range;
|
|
246
247
|
(0, Spectrum1D_1.addRange)(draft.data[index], { from, to, nucleus, molecules });
|
|
247
248
|
handleOnChangeRangesData(draft);
|
|
249
|
+
(0, DomainActions_1.setIntegralsYDomain)(draft, draft.data[index]);
|
|
248
250
|
}
|
|
249
251
|
}
|
|
250
252
|
exports.handleAddRange = handleAddRange;
|
|
@@ -30,10 +30,10 @@ const Spectrum1D_1 = require("../../../data/data1d/Spectrum1D");
|
|
|
30
30
|
const Spectrum2D_1 = require("../../../data/data2d/Spectrum2D");
|
|
31
31
|
const ToolTypes_1 = require("../../toolbar/ToolTypes");
|
|
32
32
|
const GroupByInfoKey_1 = __importDefault(require("../../utility/GroupByInfoKey"));
|
|
33
|
+
const Zoom1DManager_1 = require("../helper/Zoom1DManager");
|
|
33
34
|
const DomainActions_1 = require("./DomainActions");
|
|
34
35
|
const FiltersActions_1 = require("./FiltersActions");
|
|
35
36
|
const ToolsActions_1 = require("./ToolsActions");
|
|
36
|
-
const Zoom_1 = require("./Zoom");
|
|
37
37
|
function checkIsVisible2D(datum) {
|
|
38
38
|
if (datum.display.isPositiveVisible === false &&
|
|
39
39
|
datum.display.isNegativeVisible === false) {
|
|
@@ -215,6 +215,6 @@ function generateSpectrumFromPublicationStringHandler(draft, action) {
|
|
|
215
215
|
const spectrum = (0, Spectrum1D_1.generateSpectrumFromPublicationString)(publicationString, draft.usedColors);
|
|
216
216
|
draft.data.push(spectrum);
|
|
217
217
|
(0, ToolsActions_1.setActiveTab)(draft);
|
|
218
|
-
(0,
|
|
218
|
+
(0, Zoom1DManager_1.setZoom)(draft, { scale: 0.8, spectrumID: spectrum.id });
|
|
219
219
|
}
|
|
220
220
|
exports.generateSpectrumFromPublicationStringHandler = generateSpectrumFromPublicationStringHandler;
|
|
@@ -33,13 +33,13 @@ const DimensionLayout_1 = require("../../2d/utilities/DimensionLayout");
|
|
|
33
33
|
const scale_2 = require("../../2d/utilities/scale");
|
|
34
34
|
const ToolTypes_1 = require("../../toolbar/ToolTypes");
|
|
35
35
|
const GroupByInfoKey_1 = __importDefault(require("../../utility/GroupByInfoKey"));
|
|
36
|
+
const getSpectraByNucleus_1 = require("../../utility/getSpectraByNucleus");
|
|
36
37
|
const Constants_1 = require("../core/Constants");
|
|
37
|
-
const Zoom1DManager_1 =
|
|
38
|
+
const Zoom1DManager_1 = require("../helper/Zoom1DManager");
|
|
38
39
|
const ZoomHistoryManager_1 = __importDefault(require("../helper/ZoomHistoryManager"));
|
|
39
40
|
const DomainActions_1 = require("./DomainActions");
|
|
40
41
|
const FiltersActions_1 = require("./FiltersActions");
|
|
41
42
|
const PreferencesActions_1 = require("./PreferencesActions");
|
|
42
|
-
const Zoom_1 = require("./Zoom");
|
|
43
43
|
function getStrongestPeak(draft) {
|
|
44
44
|
const { activeSpectrum, data } = draft;
|
|
45
45
|
if (activeSpectrum) {
|
|
@@ -239,34 +239,37 @@ function getSpectrumID(draft, index) {
|
|
|
239
239
|
return spectrum?.id ? spectrum.id : null;
|
|
240
240
|
}
|
|
241
241
|
function handleZoom(draft, action) {
|
|
242
|
-
const {
|
|
243
|
-
const { activeSpectrum, toolOptions: { data: { showRangesIntegrals }, }, } = draft;
|
|
244
|
-
if (
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
}
|
|
252
|
-
case DimensionLayout_1.LAYOUT.LEFT_1D: {
|
|
253
|
-
const id = getSpectrumID(draft, 1);
|
|
254
|
-
(0, Zoom_1.wheel)(deltaY, deltaMode, draft, id);
|
|
255
|
-
(0, Zoom_1.setZoom1D)(draft, draft.margin.left, 10, 1);
|
|
256
|
-
break;
|
|
242
|
+
const { event, trackID, selectedTool } = action;
|
|
243
|
+
const { activeSpectrum, toolOptions: { data: { showRangesIntegrals }, }, displayerMode, } = draft;
|
|
244
|
+
if (displayerMode === Constants_1.DISPLAYER_MODE.DM_2D) {
|
|
245
|
+
const index = trackID === DimensionLayout_1.LAYOUT.TOP_1D ? 0 : trackID === DimensionLayout_1.LAYOUT.LEFT_1D ? 1 : null;
|
|
246
|
+
if (index !== null) {
|
|
247
|
+
const id = getSpectrumID(draft, index);
|
|
248
|
+
if (id) {
|
|
249
|
+
const domain = draft.yDomains[id];
|
|
250
|
+
draft.yDomains[id] = (0, Zoom1DManager_1.wheelZoom)(event, domain);
|
|
257
251
|
}
|
|
258
|
-
default:
|
|
259
|
-
break;
|
|
260
252
|
}
|
|
261
253
|
}
|
|
262
|
-
else if (activeSpectrum?.id &&
|
|
263
|
-
shiftKey &&
|
|
264
|
-
(showRangesIntegrals || selectedTool === ToolTypes_1.options.integral.id)) {
|
|
265
|
-
(0, Zoom1DManager_1.default)(draft.zoom.integral).wheel(deltaY, activeSpectrum?.id);
|
|
266
|
-
}
|
|
267
254
|
else {
|
|
268
|
-
(
|
|
269
|
-
|
|
255
|
+
if (activeSpectrum?.id) {
|
|
256
|
+
if ((showRangesIntegrals || selectedTool === ToolTypes_1.options.integral.id) &&
|
|
257
|
+
event.shiftKey) {
|
|
258
|
+
const domain = draft.integralsYDomains[activeSpectrum?.id];
|
|
259
|
+
draft.integralsYDomains[activeSpectrum?.id] = (0, Zoom1DManager_1.wheelZoom)(event, domain);
|
|
260
|
+
}
|
|
261
|
+
else {
|
|
262
|
+
const domain = draft.yDomains[activeSpectrum?.id];
|
|
263
|
+
draft.yDomains[activeSpectrum?.id] = (0, Zoom1DManager_1.wheelZoom)(event, domain);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
else {
|
|
267
|
+
const spectra = (0, getSpectraByNucleus_1.getSpectraByNucleus)(draft.activeTab, draft.data);
|
|
268
|
+
for (const spectrum of spectra) {
|
|
269
|
+
const domain = draft.yDomains[spectrum.id];
|
|
270
|
+
draft.yDomains[spectrum.id] = (0, Zoom1DManager_1.wheelZoom)(event, domain);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
270
273
|
}
|
|
271
274
|
}
|
|
272
275
|
exports.handleZoom = handleZoom;
|
|
@@ -276,25 +279,25 @@ function zoomOut(draft, action) {
|
|
|
276
279
|
const zoomHistory = (0, ZoomHistoryManager_1.default)(draft.zoom.history, draft.activeTab);
|
|
277
280
|
if (draft.displayerMode === Constants_1.DISPLAYER_MODE.DM_1D) {
|
|
278
281
|
switch (zoomType) {
|
|
279
|
-
case
|
|
282
|
+
case Zoom1DManager_1.ZoomType.HORIZONTAL: {
|
|
280
283
|
draft.xDomain = draft.originDomain.xDomain;
|
|
281
284
|
zoomHistory.clear();
|
|
282
285
|
break;
|
|
283
286
|
}
|
|
284
|
-
case
|
|
285
|
-
(0,
|
|
287
|
+
case Zoom1DManager_1.ZoomType.VERTICAL:
|
|
288
|
+
(0, Zoom1DManager_1.setZoom)(draft, { scale: 0.8 });
|
|
286
289
|
break;
|
|
287
|
-
case
|
|
290
|
+
case Zoom1DManager_1.ZoomType.STEP_HORIZONTAL: {
|
|
288
291
|
const zoomValue = zoomHistory.pop();
|
|
289
292
|
draft.xDomain = zoomValue
|
|
290
293
|
? zoomValue.xDomain
|
|
291
294
|
: draft.originDomain.xDomain;
|
|
292
|
-
(0,
|
|
295
|
+
(0, Zoom1DManager_1.setZoom)(draft, { scale: 0.8 });
|
|
293
296
|
break;
|
|
294
297
|
}
|
|
295
298
|
default: {
|
|
296
299
|
draft.xDomain = draft.originDomain.xDomain;
|
|
297
|
-
(0,
|
|
300
|
+
(0, Zoom1DManager_1.setZoom)(draft, { scale: 0.8 });
|
|
298
301
|
break;
|
|
299
302
|
}
|
|
300
303
|
}
|
|
@@ -425,6 +428,7 @@ function setActiveTab(draft, options) {
|
|
|
425
428
|
resetTool(draft);
|
|
426
429
|
Processing2DData(draft, dataGroupByNucleus);
|
|
427
430
|
(0, DomainActions_1.setDomain)(draft, domainOptions);
|
|
431
|
+
(0, DomainActions_1.setIntegralsYDomain)(draft, dataGroupByNucleus[currentTab]);
|
|
428
432
|
const zoomHistory = (0, ZoomHistoryManager_1.default)(draft.zoom.history, draft.activeTab);
|
|
429
433
|
const zoomValue = zoomHistory.getLast();
|
|
430
434
|
if (zoomValue) {
|
|
@@ -465,7 +469,7 @@ exports.levelChangeHandler = levelChangeHandler;
|
|
|
465
469
|
function setSpectraSameTopHandler(draft) {
|
|
466
470
|
if (draft.displayerMode === Constants_1.DISPLAYER_MODE.DM_1D) {
|
|
467
471
|
draft.originDomain.shareYDomain = false;
|
|
468
|
-
(0,
|
|
472
|
+
(0, Zoom1DManager_1.setZoom)(draft, { scale: 0.8 });
|
|
469
473
|
}
|
|
470
474
|
}
|
|
471
475
|
exports.setSpectraSameTopHandler = setSpectraSameTopHandler;
|
|
@@ -473,6 +477,6 @@ function resetSpectraScale(draft) {
|
|
|
473
477
|
draft.originDomain.shareYDomain = true;
|
|
474
478
|
draft.yDomains = draft.originDomain.yDomains;
|
|
475
479
|
draft.yDomain = draft.originDomain.yDomain;
|
|
476
|
-
(0,
|
|
480
|
+
(0, Zoom1DManager_1.setZoom)(draft, { scale: 0.8 });
|
|
477
481
|
}
|
|
478
482
|
exports.resetSpectraScale = resetSpectraScale;
|
|
@@ -22,9 +22,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
22
22
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
23
|
};
|
|
24
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
-
exports.handleAutoSpectraZonesDetection = exports.changeZonesFactorHandler = exports.handleSetDiaIDZone = exports.handleUnlinkZone = exports.handleChangeZoneSignalKind = exports.changeZoneSignalDelta = exports.handleDeleteZone = exports.handleDeleteSignal = exports.handleAutoZonesDetection = exports.add2dZoneHandler = void 0;
|
|
25
|
+
exports.handleAutoSpectraZonesDetection = exports.changeZonesFactorHandler = exports.handleSetSignalPathLength = exports.handleSetDiaIDZone = exports.handleSaveEditedZone = exports.handleUnlinkZone = exports.handleChangeZoneSignalKind = exports.changeZoneSignalDelta = exports.handleDeleteZone = exports.handleDeleteSignal = exports.handleAutoZonesDetection = exports.add2dZoneHandler = void 0;
|
|
26
26
|
const immer_1 = require("immer");
|
|
27
27
|
const cloneDeep_1 = __importDefault(require("lodash/cloneDeep"));
|
|
28
|
+
const nmr_correlation_1 = require("nmr-correlation");
|
|
28
29
|
const Filters = __importStar(require("../../../data/Filters"));
|
|
29
30
|
const FiltersManager = __importStar(require("../../../data/FiltersManager"));
|
|
30
31
|
const SignalsKinds_1 = require("../../../data/constants/SignalsKinds");
|
|
@@ -158,6 +159,22 @@ function handleDeleteSignal(draft, action) {
|
|
|
158
159
|
}
|
|
159
160
|
}
|
|
160
161
|
exports.handleDeleteSignal = handleDeleteSignal;
|
|
162
|
+
function handleSetSignalPathLength(draft, action) {
|
|
163
|
+
const { spectrum, zone, signal, pathLength } = action.payload;
|
|
164
|
+
if (spectrum && zone) {
|
|
165
|
+
const datum2D = draft.data.find((datum) => datum.id === spectrum.id);
|
|
166
|
+
const zoneIndex = datum2D.zones.values.findIndex((_zone) => _zone.id === zone.id);
|
|
167
|
+
const signalIndex = zone.signals.findIndex((_signal) => _signal.id === signal.id);
|
|
168
|
+
const _zone = (0, ZoneUtilities_1.unlink)((0, cloneDeep_1.default)(zone), false, signalIndex, undefined);
|
|
169
|
+
_zone.signals[signalIndex].j = {
|
|
170
|
+
..._zone.signals[signalIndex].j,
|
|
171
|
+
pathLength,
|
|
172
|
+
};
|
|
173
|
+
datum2D.zones.values[zoneIndex] = _zone;
|
|
174
|
+
handleOnChangeZonesData(draft);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
exports.handleSetSignalPathLength = handleSetSignalPathLength;
|
|
161
178
|
function handleUnlinkZone(draft, action) {
|
|
162
179
|
const state = (0, immer_1.original)(draft);
|
|
163
180
|
if (state.activeSpectrum?.id) {
|
|
@@ -197,10 +214,26 @@ function handleSetDiaIDZone(draft, action) {
|
|
|
197
214
|
_zone.signals[signalIndex][axis].diaIDs = diaIDs;
|
|
198
215
|
_zone.signals[signalIndex][axis].nbAtoms = getNbAtoms(nbAtoms, _zone.signals[signalIndex][axis].nbAtoms);
|
|
199
216
|
}
|
|
200
|
-
// _zone[axis].nbAtoms = getNbAtoms(_zone, axis);
|
|
201
217
|
}
|
|
202
218
|
}
|
|
203
219
|
exports.handleSetDiaIDZone = handleSetDiaIDZone;
|
|
220
|
+
function handleSaveEditedZone(draft, action) {
|
|
221
|
+
const state = (0, immer_1.original)(draft);
|
|
222
|
+
if (state.activeSpectrum?.id) {
|
|
223
|
+
const { index } = state.activeSpectrum;
|
|
224
|
+
const { editedRowData } = action.payload;
|
|
225
|
+
delete editedRowData.tableMetaInfo;
|
|
226
|
+
const zoneIndex = getZoneIndex(state, index, editedRowData.id);
|
|
227
|
+
draft.data[index].zones.values[zoneIndex] = editedRowData;
|
|
228
|
+
if (editedRowData.signals) {
|
|
229
|
+
editedRowData.signals.forEach((signal) => {
|
|
230
|
+
(0, nmr_correlation_1.setPathLength)(draft.correlations.values, signal.id, signal.j?.pathLength);
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
handleOnChangeZonesData(draft);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
exports.handleSaveEditedZone = handleSaveEditedZone;
|
|
204
237
|
function handleOnChangeZonesData(draft) {
|
|
205
238
|
(0, CorrelationsActions_1.handleUpdateCorrelations)(draft);
|
|
206
239
|
}
|
|
@@ -1,79 +1,61 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
function prepareGetScale(Zoom1DObject, defaultScale) {
|
|
43
|
-
return (id) => {
|
|
44
|
-
initZoomManager(Zoom1DObject, id, defaultScale);
|
|
45
|
-
return Zoom1DObject.scales[id];
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
function prepareSetScale(Zoom1DObject, defaultScale) {
|
|
49
|
-
return (newScale, spectrumID) => {
|
|
50
|
-
initZoomManager(Zoom1DObject, spectrumID, defaultScale);
|
|
51
|
-
Zoom1DObject.scales[spectrumID] = newScale;
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
function prepareWheel(Zoom1DObject, defaultScale) {
|
|
55
|
-
return (deltaY, id) => {
|
|
56
|
-
initZoomManager(Zoom1DObject, id, defaultScale);
|
|
57
|
-
return wheel(Zoom1DObject, deltaY, id);
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
function wheel(Zoom1DObject, deltaY, id) {
|
|
61
|
-
const { options: { slowZoomStep, fastZoomStep, speedThreshold }, } = Zoom1DObject;
|
|
62
|
-
const deltaYValue = Math.abs(deltaY).toString().length === 1
|
|
63
|
-
? Math.abs(deltaY)
|
|
64
|
-
: Math.abs(deltaY) / 100;
|
|
65
|
-
const LOW_STEP = 0.01 * slowZoomStep;
|
|
66
|
-
const FAST_STEP = 0.05 * fastZoomStep;
|
|
67
|
-
let ZOOM_STEP = deltaYValue <= speedThreshold ? LOW_STEP : FAST_STEP;
|
|
68
|
-
const direction = Math.sign(deltaY);
|
|
69
|
-
const _scale = direction === -1
|
|
70
|
-
? Zoom1DObject.scales[id] + ZOOM_STEP
|
|
71
|
-
: Zoom1DObject.scales[id] - ZOOM_STEP;
|
|
72
|
-
if (_scale >= 0) {
|
|
73
|
-
Zoom1DObject.scales[id] = _scale;
|
|
3
|
+
exports.wheelZoom = exports.setZoom = exports.ZoomType = void 0;
|
|
4
|
+
const d3_1 = require("d3");
|
|
5
|
+
exports.ZoomType = {
|
|
6
|
+
HORIZONTAL: 'HORIZONTAL',
|
|
7
|
+
VERTICAL: 'VERTICAL',
|
|
8
|
+
STEP_HORIZONTAL: 'STEP_HORIZONTAL',
|
|
9
|
+
FULL: 'FULL',
|
|
10
|
+
};
|
|
11
|
+
function wheelZoom(event, domain, zoomOptions = {}) {
|
|
12
|
+
const { factor = 1, invert = false } = zoomOptions;
|
|
13
|
+
const deltaY = Math.abs(event.deltaY) < 100 ? event.deltaY * 100 : event.deltaY;
|
|
14
|
+
const delta = deltaY * (invert ? -0.001 : 0.001) * factor;
|
|
15
|
+
const ratio = delta < 0 ? -1 / (delta - 1) : 1 + delta;
|
|
16
|
+
const [min, max] = domain;
|
|
17
|
+
return [min * ratio, max * ratio];
|
|
18
|
+
}
|
|
19
|
+
exports.wheelZoom = wheelZoom;
|
|
20
|
+
function setZoom(draft, options = {}) {
|
|
21
|
+
const { height, margin, activeSpectrum } = draft;
|
|
22
|
+
const { scale = 1, spectrumID = null } = options;
|
|
23
|
+
if (activeSpectrum === null && spectrumID === null) {
|
|
24
|
+
const { shareYDomain, yDomain, yDomains } = draft.originDomain;
|
|
25
|
+
draft.yDomains = Object.keys(draft.yDomains).reduce((acc, id) => {
|
|
26
|
+
const _scale = (0, d3_1.scaleLinear)(shareYDomain ? yDomain : yDomains[id], [
|
|
27
|
+
height - margin.bottom,
|
|
28
|
+
margin.top,
|
|
29
|
+
]);
|
|
30
|
+
const [min, max] = shareYDomain ? yDomain : yDomains[id];
|
|
31
|
+
const maxPoint = Math.max(Math.abs(max), Math.abs(min));
|
|
32
|
+
const scalePoint = maxPoint === max ? 0 : min;
|
|
33
|
+
const t = d3_1.zoomIdentity
|
|
34
|
+
.translate(0, Math.sign(scalePoint) >= 0 ? _scale(scalePoint) : _scale(scalePoint))
|
|
35
|
+
.scale(scale)
|
|
36
|
+
.translate(0, -_scale(0));
|
|
37
|
+
const newYDomain = t.rescaleY(_scale).domain();
|
|
38
|
+
acc[id] = newYDomain;
|
|
39
|
+
return acc;
|
|
40
|
+
}, {});
|
|
74
41
|
}
|
|
75
42
|
else {
|
|
76
|
-
|
|
43
|
+
const spectrumId = spectrumID || activeSpectrum?.id;
|
|
44
|
+
if (spectrumId) {
|
|
45
|
+
const _scale = (0, d3_1.scaleLinear)(draft.originDomain.yDomains[spectrumId], [
|
|
46
|
+
height - margin.bottom,
|
|
47
|
+
margin.top,
|
|
48
|
+
]);
|
|
49
|
+
const t = d3_1.zoomIdentity
|
|
50
|
+
.translate(0, _scale(0))
|
|
51
|
+
.scale(scale)
|
|
52
|
+
.translate(0, -_scale(0));
|
|
53
|
+
const yDomain = t.rescaleY(_scale).domain();
|
|
54
|
+
draft.yDomains = {
|
|
55
|
+
...draft.yDomains,
|
|
56
|
+
[spectrumId]: yDomain,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
77
59
|
}
|
|
78
|
-
return Zoom1DObject.scales[id];
|
|
79
60
|
}
|
|
61
|
+
exports.setZoom = setZoom;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.preferencesInitialState = exports.SET_PANELS_PREFERENCES = exports.SET_PREFERENCES = exports.INIT_PREFERENCES = void 0;
|
|
6
|
+
exports.preferencesInitialState = exports.SET_PANELS_PREFERENCES = exports.RESET_PREFERENCES = exports.SET_PREFERENCES = exports.INIT_PREFERENCES = void 0;
|
|
7
7
|
const immer_1 = require("immer");
|
|
8
8
|
const merge_1 = __importDefault(require("lodash/merge"));
|
|
9
9
|
const NMRium_1 = require("../NMRium");
|
|
@@ -11,6 +11,7 @@ const LocalStorage_1 = require("../utility/LocalStorage");
|
|
|
11
11
|
const workspaces_1 = __importDefault(require("../workspaces"));
|
|
12
12
|
exports.INIT_PREFERENCES = 'INIT_PREFERENCES';
|
|
13
13
|
exports.SET_PREFERENCES = 'SET_PREFERENCES';
|
|
14
|
+
exports.RESET_PREFERENCES = 'RESET_PREFERENCES';
|
|
14
15
|
exports.SET_PANELS_PREFERENCES = 'SET_PANELS_PREFERENCES';
|
|
15
16
|
const LOCAL_STORAGE_VERSION = 3;
|
|
16
17
|
function getPreferencesByWorkspace(workspace) {
|
|
@@ -27,7 +28,6 @@ exports.preferencesInitialState = {
|
|
|
27
28
|
basePreferences: {},
|
|
28
29
|
display: workspaces_1.default.basic.display,
|
|
29
30
|
controllers: {
|
|
30
|
-
mws: { low: 2, high: 20 },
|
|
31
31
|
dimmedSpectraTransparency: 0.1,
|
|
32
32
|
},
|
|
33
33
|
formatting: {
|
|
@@ -141,6 +141,14 @@ function handleSetPanelsPreferences(draft, action) {
|
|
|
141
141
|
draft.formatting.panels[key] = value;
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
|
+
function handleResetPreferences(draft) {
|
|
145
|
+
let localData = (0, LocalStorage_1.getLocalStorage)('nmr-general-settings');
|
|
146
|
+
const hiddenFeatures = getTruthyObjectValues(draft.basePreferences.display);
|
|
147
|
+
const workSpaceDisplayPreferences = (0, merge_1.default)({}, getPreferencesByWorkspace(draft.workspace).display, hiddenFeatures);
|
|
148
|
+
localData.workspaces[draft.workspace].display = workSpaceDisplayPreferences;
|
|
149
|
+
draft.display = workSpaceDisplayPreferences;
|
|
150
|
+
(0, LocalStorage_1.storeData)('nmr-general-settings', JSON.stringify(localData));
|
|
151
|
+
}
|
|
144
152
|
function innerPreferencesReducer(draft, action) {
|
|
145
153
|
switch (action.type) {
|
|
146
154
|
case exports.INIT_PREFERENCES:
|
|
@@ -149,6 +157,8 @@ function innerPreferencesReducer(draft, action) {
|
|
|
149
157
|
return handleSetPreferences(draft, action);
|
|
150
158
|
case exports.SET_PANELS_PREFERENCES:
|
|
151
159
|
return handleSetPanelsPreferences(draft, action);
|
|
160
|
+
case exports.RESET_PREFERENCES:
|
|
161
|
+
return handleResetPreferences(draft);
|
|
152
162
|
default:
|
|
153
163
|
return draft;
|
|
154
164
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.APPLY_MANUAL_PHASE_CORRECTION_FILTER = exports.CALCULATE_MANUAL_PHASE_CORRECTION_FILTER = exports.APPLY_FFT_FILTER = exports.APPLY_ZERO_FILLING_FILTER = exports.DELETE_SPECTRA_FILTER = exports.DELETE_FILTER = exports.ENABLE_FILTER = exports.RESET_DOMAIN = exports.BRUSH_END = exports.RESIZE_INTEGRAL = exports.CHANGE_SPECTRUM_DISPLAY_VIEW_MODE = exports.DELETE_SPECTRA = exports.SET_CORRELATIONS_TOLERANCE = exports.SET_CORRELATIONS_MF = exports.DELETE_CORRELATION = exports.SET_CORRELATIONS = exports.SET_CORRELATION = exports.DELETE_MOLECULE = exports.SET_MOLECULE = exports.ADD_MOLECULE = exports.
|
|
4
|
-
exports.
|
|
5
|
-
exports.SHOW_J_GRAPH = exports.RESURRECTING_SPECTRUM_FROM_RANGES = exports.GENERATE_SPECTRUM_FROM_PUBLICATION_STRING = exports.AUTO_ZONES_SPECTRA_PICKING = exports.AUTO_RANGES_SPECTRA_PICKING = exports.SHOW_RANGES_INTEGRALS = exports.SHOW_MULTIPLICTY_TREES = exports.CHANGE_TEMP_RANGE = exports.CHANGE_ZONES_NOISE_FACTOR = exports.CHANGE_INTEGRALS_SUM_FLAG = exports.CHANGE_RANGES_SUM_FLAG = exports.DELETE_EXCLUSION_ZONE = exports.ADD_EXCLUSION_ZONE = exports.APPLY_MULTIPLE_SPECTRA_FILTER = exports.SET_MOUSE_OVER_DISPLAYER = void 0;
|
|
3
|
+
exports.APPLY_MANUAL_PHASE_CORRECTION_FILTER = exports.CALCULATE_MANUAL_PHASE_CORRECTION_FILTER = exports.APPLY_FFT_FILTER = exports.APPLY_ZERO_FILLING_FILTER = exports.DELETE_SPECTRA_FILTER = exports.DELETE_FILTER = exports.ENABLE_FILTER = exports.RESET_DOMAIN = exports.BRUSH_END = exports.RESIZE_INTEGRAL = exports.CHANGE_SPECTRUM_DISPLAY_VIEW_MODE = exports.DELETE_SPECTRA = exports.SET_CORRELATIONS_TOLERANCE = exports.SET_CORRELATIONS_MF = exports.DELETE_CORRELATION = exports.SET_CORRELATIONS = exports.SET_CORRELATION = exports.DELETE_MOLECULE = exports.SET_MOLECULE = exports.ADD_MOLECULE = exports.SET_ZOOM = exports.TOGGLE_REAL_IMAGINARY_VISIBILITY = exports.DELETE_INTEGRAL = exports.ADD_INTEGRAL = exports.CHANGE_SPECTRUM_COLOR = exports.CHANGE_ACTIVE_SPECTRUM = exports.CHANGE_PEAKS_MARKERS_VISIBILITY = exports.CHANGE_VISIBILITY = exports.FULL_ZOOM_OUT = exports.CHANGE_SPECTRUM_TYPE = exports.CHANGE_SPECTRUM_SETTING = exports.SET_SELECTED_FILTER = exports.SET_SELECTED_TOOL = exports.SET_DIMENSIONS = exports.SET_WIDTH = exports.SET_ORIGINAL_DOMAIN = exports.SET_Y_DOMAIN = exports.SET_X_DOMAIN = exports.SHIFT_SPECTRUM = exports.DELETE_PEAK_NOTATION = exports.ADD_PEAKS = exports.ADD_PEAK = exports.LOAD_JDF_FILE = exports.LOAD_ZIP_FILE = exports.LOAD_MOL_FILE = exports.LOAD_NMREDATA_FILE = exports.LOAD_JCAMP_FILE = exports.LOAD_JSON_FILE = exports.SAVE_DATA_AS_JSON = exports.INITIATE = void 0;
|
|
4
|
+
exports.PREDICT_SPECTRA = exports.SET_DIAID_ZONE = exports.UNLINK_ZONE = exports.SAVE_EDITED_ZONE = exports.CHANGE_ZONE_SIGNAL_KIND = exports.CHANGE_ZONE_SIGNAL_VALUE = exports.ALIGN_SPECTRA = exports.FILTER_SPECTRA_COLUMN = exports.SET_ANALYZE_SPECTRA_COLUMNS = exports.RESIZE_ANALYZE_SPECTRA_RANGE = exports.DELETE_ANALYZE_SPECTRA_RANGE = exports.ANALYZE_SPECTRA = exports.CHANGE_INTEGRAL_RELATIVE = exports.SET_DIAID_RANGE = exports.UNLINK_RANGE = exports.SAVE_EDITED_RANGE = exports.CHANGE_RANGE_SIGNAL_KIND = exports.CHANGE_RANGE_SIGNAL_VALUE = exports.CHANGE_RANGE_RELATIVE = exports.SET_FILTER_SNAPSHOT = exports.ADD_MISSING_PROJECTION = exports.SET_2D_SIGNAL_PATH_LENGTH = exports.DELETE_2D_SIGNAL = exports.DELETE_2D_ZONE = exports.ADD_2D_ZONE = exports.SET_2D_LEVEL = exports.ADD_RANGE = exports.CHANGE_RANGE_SUM = exports.RESIZE_RANGE = exports.APPLY_KEY_PREFERENCES = exports.SET_KEY_PREFERENCES = exports.APPLY_BASE_LINE_CORRECTION_FILTER = exports.DELETE_BASE_LINE_ZONE = exports.ADD_BASE_LINE_ZONE = exports.CHANGE_INTEGRAL_SUM = exports.SET_ACTIVE_TAB = exports.CHANGE_INTEGRAL_DATA = exports.SAVE_AS_SVG = exports.SET_SPECTRUMS_VERTICAL_ALIGN = exports.RESET_SELECTED_TOOL = exports.SET_LOADING_FLAG = exports.SET_SELECTED_OPTIONS_PANEL = exports.DELETE_1D_SIGNAL = exports.DELETE_RANGE = exports.AUTO_ZONES_DETECTION = exports.AUTO_RANGES_DETECTION = exports.AUTO_PEAK_PICKING = exports.SET_VERTICAL_INDICATOR_X_POSITION = exports.APPLY_ABSOLUTE_FILTER = exports.APPLY_AUTO_PHASE_CORRECTION_FILTER = void 0;
|
|
5
|
+
exports.SHOW_J_GRAPH = exports.RESURRECTING_SPECTRUM_FROM_RANGES = exports.GENERATE_SPECTRUM_FROM_PUBLICATION_STRING = exports.AUTO_ZONES_SPECTRA_PICKING = exports.AUTO_RANGES_SPECTRA_PICKING = exports.SHOW_RANGES_INTEGRALS = exports.SHOW_MULTIPLICTY_TREES = exports.CHANGE_TEMP_RANGE = exports.CHANGE_ZONES_NOISE_FACTOR = exports.CHANGE_INTEGRALS_SUM_FLAG = exports.CHANGE_RANGES_SUM_FLAG = exports.DELETE_EXCLUSION_ZONE = exports.ADD_EXCLUSION_ZONE = exports.APPLY_MULTIPLE_SPECTRA_FILTER = exports.SET_MOUSE_OVER_DISPLAYER = exports.RESET_SPECTRA_SCALE = exports.SET_SPECTRA_SAME_TOP = void 0;
|
|
6
6
|
exports.INITIATE = 'INITIATE';
|
|
7
7
|
exports.SAVE_DATA_AS_JSON = 'SAVE_DATA_AS_JSON';
|
|
8
8
|
exports.LOAD_JSON_FILE = 'LOAD_JSON_FILE';
|
|
@@ -32,7 +32,7 @@ exports.CHANGE_SPECTRUM_COLOR = 'CHANGE_SPECTRUM_COLOR';
|
|
|
32
32
|
exports.ADD_INTEGRAL = 'ADD_INTEGRAL';
|
|
33
33
|
exports.DELETE_INTEGRAL = 'DELETE_INTEGRAL';
|
|
34
34
|
exports.TOGGLE_REAL_IMAGINARY_VISIBILITY = 'TOGGLE_REAL_IMAGINARY_VISIBILITY';
|
|
35
|
-
exports.
|
|
35
|
+
exports.SET_ZOOM = 'SET_ZOOM';
|
|
36
36
|
exports.ADD_MOLECULE = 'ADD_MOLECULE';
|
|
37
37
|
exports.SET_MOLECULE = 'SET_MOLECULE';
|
|
38
38
|
exports.DELETE_MOLECULE = 'DELETE_MOLECULE';
|
|
@@ -81,6 +81,7 @@ exports.SET_2D_LEVEL = 'SET_2D_LEVEL';
|
|
|
81
81
|
exports.ADD_2D_ZONE = 'ADD_2D_ZONE';
|
|
82
82
|
exports.DELETE_2D_ZONE = 'DELETE_2D_ZONE';
|
|
83
83
|
exports.DELETE_2D_SIGNAL = 'DELETE_2D_SIGNAL';
|
|
84
|
+
exports.SET_2D_SIGNAL_PATH_LENGTH = 'SET_2D_SIGNAL_PATH_LENGTH';
|
|
84
85
|
exports.ADD_MISSING_PROJECTION = 'ADD_MISSING_PROJECTION';
|
|
85
86
|
exports.SET_FILTER_SNAPSHOT = 'SET_FILTER_SNAPSHOT';
|
|
86
87
|
exports.CHANGE_RANGE_RELATIVE = 'CHANGE_RANGE_RELATIVE';
|
|
@@ -98,6 +99,7 @@ exports.FILTER_SPECTRA_COLUMN = 'FILTER_SPECTRA_COLUMN';
|
|
|
98
99
|
exports.ALIGN_SPECTRA = 'ALIGN_SPECTRA';
|
|
99
100
|
exports.CHANGE_ZONE_SIGNAL_VALUE = 'CHANGE_ZONE_SIGNAL_VALUE';
|
|
100
101
|
exports.CHANGE_ZONE_SIGNAL_KIND = 'CHANGE_ZONE_SIGNAL_KIND';
|
|
102
|
+
exports.SAVE_EDITED_ZONE = 'SAVE_EDITED_ZONE';
|
|
101
103
|
exports.UNLINK_ZONE = 'UNLINK_ZONE';
|
|
102
104
|
exports.SET_DIAID_ZONE = 'SET_DIAID_ZONE';
|
|
103
105
|
exports.PREDICT_SPECTRA = 'PREDICT_SPECTRA';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const DefaultPathLengths = {
|
|
4
|
+
hmbc: { from: 2, to: 3 },
|
|
5
|
+
cosy: { from: 3, to: 4 },
|
|
6
|
+
hsqc: { from: 1, to: 1 },
|
|
7
|
+
hmqc: { from: 1, to: 1 },
|
|
8
|
+
inadequate: { from: 1, to: 1 },
|
|
9
|
+
};
|
|
10
|
+
exports.default = DefaultPathLengths;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getSpectrumErrorValue = void 0;
|
|
4
|
+
function getSpectrumErrorValue(datum) {
|
|
5
|
+
const { x } = datum.data;
|
|
6
|
+
return (x[x.length - 1] - x[0]) / 10000;
|
|
7
|
+
}
|
|
8
|
+
exports.getSpectrumErrorValue = getSpectrumErrorValue;
|
|
@@ -23,11 +23,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
23
23
|
};
|
|
24
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
25
|
exports.initiateDatum1D = void 0;
|
|
26
|
-
const merge_1 = __importDefault(require("lodash/merge"));
|
|
27
26
|
const FiltersTypes = __importStar(require("../../Filters"));
|
|
28
27
|
const FiltersManager = __importStar(require("../../FiltersManager"));
|
|
29
28
|
const generateID_1 = __importDefault(require("../../utilities/generateID"));
|
|
30
29
|
const getColor_1 = __importDefault(require("../../utilities/getColor"));
|
|
30
|
+
const initiateIntegrals_1 = require("./integrals/initiateIntegrals");
|
|
31
|
+
const initiatePeaks_1 = require("./peaks/initiatePeaks");
|
|
32
|
+
const initiateRanges_1 = require("./ranges/initiateRanges");
|
|
31
33
|
function initiateDatum1D(options, usedColors = {}) {
|
|
32
34
|
const datum = {};
|
|
33
35
|
datum.id = options.id || (0, generateID_1.default)();
|
|
@@ -60,27 +62,13 @@ function initiateDatum1D(options, usedColors = {}) {
|
|
|
60
62
|
im: [],
|
|
61
63
|
}, options.data);
|
|
62
64
|
datum.originalData = datum.data;
|
|
63
|
-
datum.
|
|
65
|
+
datum.filters = Object.assign([], options.filters); //array of object {name: "FilterName", options: FilterOptions = {value | object} }
|
|
66
|
+
datum.peaks = (0, initiatePeaks_1.initiatePeaks)(options, datum);
|
|
64
67
|
// array of object {index: xIndex, xShift}
|
|
65
68
|
// in case the peak does not exactly correspond to the point value
|
|
66
69
|
// we can think about a second attributed `xShift`
|
|
67
|
-
datum.integrals = (0,
|
|
68
|
-
|
|
69
|
-
options: {
|
|
70
|
-
sum: undefined,
|
|
71
|
-
isSumConstant: true,
|
|
72
|
-
sumAuto: true,
|
|
73
|
-
},
|
|
74
|
-
}, options.integrals); // array of object (from: xIndex, to: xIndex)
|
|
75
|
-
datum.filters = Object.assign([], options.filters); //array of object {name: "FilterName", options: FilterOptions = {value | object} }
|
|
76
|
-
datum.ranges = (0, merge_1.default)({
|
|
77
|
-
values: [],
|
|
78
|
-
options: {
|
|
79
|
-
sum: undefined,
|
|
80
|
-
isSumConstant: true,
|
|
81
|
-
sumAuto: true,
|
|
82
|
-
},
|
|
83
|
-
}, options.ranges);
|
|
70
|
+
datum.integrals = (0, initiateIntegrals_1.initiateIntegrals)(options); // array of object (from: xIndex, to: xIndex)
|
|
71
|
+
datum.ranges = (0, initiateRanges_1.initiateRanges)(options, datum);
|
|
84
72
|
//reapply filters after load the original data
|
|
85
73
|
FiltersManager.reapplyFilters(datum);
|
|
86
74
|
preprocessing(datum);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.initiateIntegrals = void 0;
|
|
7
|
+
const merge_1 = __importDefault(require("lodash/merge"));
|
|
8
|
+
function initiateIntegrals(options) {
|
|
9
|
+
return (0, merge_1.default)({
|
|
10
|
+
values: [],
|
|
11
|
+
options: {
|
|
12
|
+
sum: undefined,
|
|
13
|
+
isSumConstant: true,
|
|
14
|
+
sumAuto: true,
|
|
15
|
+
},
|
|
16
|
+
}, options.integrals);
|
|
17
|
+
}
|
|
18
|
+
exports.initiateIntegrals = initiateIntegrals;
|