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
|
@@ -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) {
|
|
@@ -213,7 +213,7 @@ function handleBrushEnd(draft, action) {
|
|
|
213
213
|
break;
|
|
214
214
|
}
|
|
215
215
|
if (brushHistory) {
|
|
216
|
-
brushHistory.push({ xDomain:
|
|
216
|
+
brushHistory.push({ xDomain: draft.xDomain, yDomain: draft.yDomain });
|
|
217
217
|
}
|
|
218
218
|
}
|
|
219
219
|
else {
|
|
@@ -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,58 +279,41 @@ 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;
|
|
284
|
+
zoomHistory.clear();
|
|
281
285
|
break;
|
|
282
286
|
}
|
|
283
|
-
case
|
|
284
|
-
(0,
|
|
287
|
+
case Zoom1DManager_1.ZoomType.VERTICAL:
|
|
288
|
+
(0, Zoom1DManager_1.setZoom)(draft, { scale: 0.8 });
|
|
285
289
|
break;
|
|
286
|
-
case
|
|
290
|
+
case Zoom1DManager_1.ZoomType.STEP_HORIZONTAL: {
|
|
287
291
|
const zoomValue = zoomHistory.pop();
|
|
288
292
|
draft.xDomain = zoomValue
|
|
289
293
|
? zoomValue.xDomain
|
|
290
294
|
: draft.originDomain.xDomain;
|
|
291
|
-
(0,
|
|
295
|
+
(0, Zoom1DManager_1.setZoom)(draft, { scale: 0.8 });
|
|
292
296
|
break;
|
|
293
297
|
}
|
|
294
298
|
default: {
|
|
295
299
|
draft.xDomain = draft.originDomain.xDomain;
|
|
296
|
-
(0,
|
|
300
|
+
(0, Zoom1DManager_1.setZoom)(draft, { scale: 0.8 });
|
|
297
301
|
break;
|
|
298
302
|
}
|
|
299
303
|
}
|
|
300
304
|
}
|
|
301
305
|
else {
|
|
302
306
|
const { xDomain, yDomain, yDomains } = draft.originDomain;
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
const activeSpectrum = draft.tabActiveSpectrum[draft.activeTab.split(',')[1]];
|
|
314
|
-
draft.yDomain = yDomain;
|
|
315
|
-
if (activeSpectrum?.id) {
|
|
316
|
-
draft.yDomains[activeSpectrum.id] = yDomains[activeSpectrum.id];
|
|
317
|
-
}
|
|
318
|
-
break;
|
|
319
|
-
}
|
|
320
|
-
case DimensionLayout_1.LAYOUT.CENTER_2D: {
|
|
321
|
-
const zoomValue = zoomHistory.pop();
|
|
322
|
-
draft.xDomain = zoomValue ? zoomValue.xDomain : xDomain;
|
|
323
|
-
draft.yDomain = zoomValue ? zoomValue.yDomain : yDomain;
|
|
324
|
-
break;
|
|
325
|
-
}
|
|
326
|
-
default:
|
|
327
|
-
draft.xDomain = xDomain;
|
|
328
|
-
draft.yDomain = yDomain;
|
|
329
|
-
draft.yDomains = yDomains;
|
|
330
|
-
break;
|
|
307
|
+
if ([DimensionLayout_1.LAYOUT.TOP_1D, DimensionLayout_1.LAYOUT.LEFT_1D, DimensionLayout_1.LAYOUT.CENTER_2D].includes(trackID)) {
|
|
308
|
+
const zoomValue = zoomHistory.pop();
|
|
309
|
+
draft.xDomain = zoomValue ? zoomValue.xDomain : xDomain;
|
|
310
|
+
draft.yDomain = zoomValue ? zoomValue.yDomain : yDomain;
|
|
311
|
+
}
|
|
312
|
+
else {
|
|
313
|
+
zoomHistory.clear();
|
|
314
|
+
draft.xDomain = xDomain;
|
|
315
|
+
draft.yDomain = yDomain;
|
|
316
|
+
draft.yDomains = yDomains;
|
|
331
317
|
}
|
|
332
318
|
}
|
|
333
319
|
}
|
|
@@ -442,6 +428,7 @@ function setActiveTab(draft, options) {
|
|
|
442
428
|
resetTool(draft);
|
|
443
429
|
Processing2DData(draft, dataGroupByNucleus);
|
|
444
430
|
(0, DomainActions_1.setDomain)(draft, domainOptions);
|
|
431
|
+
(0, DomainActions_1.setIntegralsYDomain)(draft, dataGroupByNucleus[currentTab]);
|
|
445
432
|
const zoomHistory = (0, ZoomHistoryManager_1.default)(draft.zoom.history, draft.activeTab);
|
|
446
433
|
const zoomValue = zoomHistory.getLast();
|
|
447
434
|
if (zoomValue) {
|
|
@@ -482,7 +469,7 @@ exports.levelChangeHandler = levelChangeHandler;
|
|
|
482
469
|
function setSpectraSameTopHandler(draft) {
|
|
483
470
|
if (draft.displayerMode === Constants_1.DISPLAYER_MODE.DM_1D) {
|
|
484
471
|
draft.originDomain.shareYDomain = false;
|
|
485
|
-
(0,
|
|
472
|
+
(0, Zoom1DManager_1.setZoom)(draft, { scale: 0.8 });
|
|
486
473
|
}
|
|
487
474
|
}
|
|
488
475
|
exports.setSpectraSameTopHandler = setSpectraSameTopHandler;
|
|
@@ -490,6 +477,6 @@ function resetSpectraScale(draft) {
|
|
|
490
477
|
draft.originDomain.shareYDomain = true;
|
|
491
478
|
draft.yDomains = draft.originDomain.yDomains;
|
|
492
479
|
draft.yDomain = draft.originDomain.yDomain;
|
|
493
|
-
(0,
|
|
480
|
+
(0, Zoom1DManager_1.setZoom)(draft, { scale: 0.8 });
|
|
494
481
|
}
|
|
495
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;
|
|
@@ -7,7 +7,8 @@ function zoomHistoryManager(zoomHistory, nucleus) {
|
|
|
7
7
|
const push = preparePush(zoomHistory[nucleus]);
|
|
8
8
|
const pop = preparePop(zoomHistory[nucleus]);
|
|
9
9
|
const getLast = prepareGetLast(zoomHistory[nucleus]);
|
|
10
|
-
|
|
10
|
+
const clear = () => (zoomHistory[nucleus] = []);
|
|
11
|
+
return { historyStack: zoomHistory[nucleus], push, pop, getLast, clear };
|
|
11
12
|
}
|
|
12
13
|
exports.default = zoomHistoryManager;
|
|
13
14
|
function preparePush(historyStack) {
|