nmrium 0.20.2 → 0.23.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/FooterBanner.js +1 -1
- 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 +10 -6
- package/lib/component/NMRium.js +3 -9
- package/lib/component/elements/EditableColumn.d.ts +1 -1
- 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 +87 -87
- package/lib/component/modal/PredictSpectraModal.d.ts +0 -28
- package/lib/component/modal/PredictSpectraModal.js +2 -32
- 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 +5 -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.d.ts +10 -1
- package/lib/component/panels/MoleculesPanel/MoleculePanel.js +27 -17
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.d.ts +9 -1
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +2 -2
- package/lib/component/panels/Panels.d.ts +1 -1
- package/lib/component/panels/Panels.js +17 -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 +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 -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/panels/predictionPanel/PredictionOptions.d.ts +6 -0
- package/lib/component/panels/predictionPanel/PredictionOptions.js +88 -0
- package/lib/component/panels/predictionPanel/PredictionPanel.d.ts +2 -0
- package/lib/component/panels/predictionPanel/PredictionPanel.js +33 -0
- 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 +29 -1
- package/lib/component/reducer/actions/MoleculeActions.js +1 -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 +86 -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 +46 -0
- package/lib/component/workspaces/exercise1D.d.ts +2 -0
- package/lib/component/workspaces/exercise1D.js +46 -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 +44 -0
- package/lib/data/PredictionManager.d.ts +35 -3
- package/lib/data/PredictionManager.js +45 -7
- 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/FooterBanner.js +1 -1
- 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 +3 -10
- 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 +87 -87
- package/lib-cjs/component/modal/PredictSpectraModal.js +3 -33
- 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 +5 -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 +27 -17
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +2 -2
- package/lib-cjs/component/panels/Panels.js +18 -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/panels/predictionPanel/PredictionOptions.js +112 -0
- package/lib-cjs/component/panels/predictionPanel/PredictionPanel.js +39 -0
- 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 +29 -1
- package/lib-cjs/component/reducer/actions/MoleculeActions.js +1 -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 -38
- 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 +49 -0
- package/lib-cjs/component/workspaces/exercise1D.js +49 -0
- package/lib-cjs/component/workspaces/index.js +6 -0
- package/lib-cjs/component/workspaces/process1D.js +47 -0
- package/lib-cjs/data/PredictionManager.js +46 -8
- 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 +1 -1
- 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
|
@@ -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) {
|
|
@@ -3,33 +3,30 @@ 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
|
-
const NMRium_1 = require("../NMRium");
|
|
10
|
-
const basic_1 = __importDefault(require("../nmriumMode/basic"));
|
|
11
|
-
const exercise1D_1 = __importDefault(require("../nmriumMode/exercise1D"));
|
|
12
|
-
const process1D_1 = __importDefault(require("../nmriumMode/process1D"));
|
|
13
9
|
const LocalStorage_1 = require("../utility/LocalStorage");
|
|
10
|
+
const workspaces_1 = __importDefault(require("../workspaces"));
|
|
14
11
|
exports.INIT_PREFERENCES = 'INIT_PREFERENCES';
|
|
15
12
|
exports.SET_PREFERENCES = 'SET_PREFERENCES';
|
|
13
|
+
exports.RESET_PREFERENCES = 'RESET_PREFERENCES';
|
|
16
14
|
exports.SET_PANELS_PREFERENCES = 'SET_PANELS_PREFERENCES';
|
|
17
|
-
const
|
|
18
|
-
function
|
|
19
|
-
switch (
|
|
20
|
-
case
|
|
21
|
-
return
|
|
22
|
-
case
|
|
23
|
-
return
|
|
15
|
+
const LOCAL_STORAGE_VERSION = 3;
|
|
16
|
+
function getPreferencesByWorkspace(workspace) {
|
|
17
|
+
switch (workspace) {
|
|
18
|
+
case 'exercise1D':
|
|
19
|
+
return workspaces_1.default.exercise1D;
|
|
20
|
+
case 'process1D':
|
|
21
|
+
return workspaces_1.default.process1D;
|
|
24
22
|
default:
|
|
25
|
-
return
|
|
23
|
+
return workspaces_1.default.basic;
|
|
26
24
|
}
|
|
27
25
|
}
|
|
28
26
|
exports.preferencesInitialState = {
|
|
29
27
|
basePreferences: {},
|
|
30
|
-
display:
|
|
28
|
+
display: workspaces_1.default.basic.display,
|
|
31
29
|
controllers: {
|
|
32
|
-
mws: { low: 2, high: 20 },
|
|
33
30
|
dimmedSpectraTransparency: 0.1,
|
|
34
31
|
},
|
|
35
32
|
formatting: {
|
|
@@ -45,7 +42,15 @@ exports.preferencesInitialState = {
|
|
|
45
42
|
panels: {},
|
|
46
43
|
},
|
|
47
44
|
dispatch: null,
|
|
45
|
+
workspace: 'default',
|
|
48
46
|
};
|
|
47
|
+
function getTruthyObjectValues(data) {
|
|
48
|
+
return JSON.parse(JSON.stringify(data), (key, value) => {
|
|
49
|
+
if (value) {
|
|
50
|
+
return value;
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
}
|
|
49
54
|
function mapNucleus(draft) {
|
|
50
55
|
if (draft.formatting.nucleus && Array.isArray(draft.formatting.nucleus)) {
|
|
51
56
|
draft.formatting.nucleusByKey = draft.formatting.nucleus.reduce((acc, item) => {
|
|
@@ -56,51 +61,93 @@ function mapNucleus(draft) {
|
|
|
56
61
|
}
|
|
57
62
|
function handleInit(draft, action) {
|
|
58
63
|
const nmrLocalStorageVersion = (0, LocalStorage_1.getLocalStorage)('nmr-local-storage-version', false);
|
|
59
|
-
|
|
60
|
-
|
|
64
|
+
let localData = (0, LocalStorage_1.getLocalStorage)('nmr-general-settings');
|
|
65
|
+
// remove old nmr-local-storage-version key
|
|
66
|
+
if (nmrLocalStorageVersion && localData?.version) {
|
|
67
|
+
(0, LocalStorage_1.removeData)('nmr-local-storage-version');
|
|
68
|
+
}
|
|
69
|
+
if (!localData?.version || localData?.version !== LOCAL_STORAGE_VERSION) {
|
|
61
70
|
(0, LocalStorage_1.removeData)('nmr-general-settings');
|
|
62
|
-
(0, LocalStorage_1.storeData)('nmr-local-storage-version', LOCAL_STORGAE_VERSION);
|
|
63
71
|
}
|
|
64
|
-
const localData = (0, LocalStorage_1.getLocalStorage)('nmr-general-settings');
|
|
65
72
|
if (action.payload) {
|
|
66
|
-
const { dispatch,
|
|
67
|
-
draft.
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
const { dispatch, workspace, ...resProps } = action.payload;
|
|
74
|
+
draft.workspace = workspace;
|
|
75
|
+
const workspacePreferences = getPreferencesByWorkspace(workspace);
|
|
76
|
+
if (!localData ||
|
|
77
|
+
!localData?.workspaces[workspace] ||
|
|
78
|
+
workspacePreferences.version !== localData?.workspaces[workspace]?.version) {
|
|
79
|
+
localData = localData || {};
|
|
80
|
+
localData = {
|
|
81
|
+
version: LOCAL_STORAGE_VERSION,
|
|
82
|
+
workspaces: {
|
|
83
|
+
...localData.workspaces,
|
|
84
|
+
[workspace]: {
|
|
85
|
+
...workspacePreferences,
|
|
86
|
+
controllers: draft.controllers,
|
|
87
|
+
formatting: draft.formatting,
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
};
|
|
91
|
+
(0, LocalStorage_1.storeData)('nmr-general-settings', JSON.stringify(localData));
|
|
92
|
+
}
|
|
93
|
+
draft.basePreferences = (0, merge_1.default)({}, workspacePreferences, resProps);
|
|
94
|
+
const hiddenModeFeatures = getTruthyObjectValues(draft.basePreferences.display);
|
|
95
|
+
let hiddenLocalStorageFeatures = {};
|
|
76
96
|
draft.dispatch = dispatch;
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
97
|
+
const localStorageModePreferences = localData?.workspaces[workspace] || null;
|
|
98
|
+
if (localStorageModePreferences) {
|
|
99
|
+
Object.entries(localStorageModePreferences).forEach(([k, v]) => {
|
|
100
|
+
if (k === 'display') {
|
|
101
|
+
hiddenLocalStorageFeatures = getTruthyObjectValues(v);
|
|
102
|
+
}
|
|
103
|
+
else if (!['dispatch', 'basePreferences'].includes(k)) {
|
|
80
104
|
draft[k] = (0, merge_1.default)({}, resProps[k] ? resProps[k] : {}, v);
|
|
81
105
|
}
|
|
82
106
|
});
|
|
83
107
|
mapNucleus(draft);
|
|
84
108
|
}
|
|
109
|
+
draft.display = (0, merge_1.default)({}, getPreferencesByWorkspace('default').display, hiddenModeFeatures, hiddenLocalStorageFeatures);
|
|
85
110
|
}
|
|
86
111
|
}
|
|
87
112
|
function handleSetPreferences(draft, action) {
|
|
88
113
|
if (action.payload) {
|
|
89
|
-
const
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
114
|
+
const { controllers, formatting, display } = action.payload;
|
|
115
|
+
let localData = (0, LocalStorage_1.getLocalStorage)('nmr-general-settings');
|
|
116
|
+
localData.workspaces = {
|
|
117
|
+
...localData.workspaces,
|
|
118
|
+
[draft.workspace]: {
|
|
119
|
+
...localData.workspaces[draft.workspace],
|
|
120
|
+
controllers,
|
|
121
|
+
formatting,
|
|
122
|
+
display,
|
|
123
|
+
},
|
|
124
|
+
};
|
|
125
|
+
(0, LocalStorage_1.storeData)('nmr-general-settings', JSON.stringify(localData));
|
|
126
|
+
draft.controllers = controllers;
|
|
127
|
+
draft.formatting = formatting;
|
|
128
|
+
draft.display.panels = display.panels;
|
|
129
|
+
draft.display.general.hideExperimentalFeatures =
|
|
130
|
+
display.general.hideExperimentalFeatures;
|
|
95
131
|
mapNucleus(draft);
|
|
96
132
|
}
|
|
97
133
|
}
|
|
98
134
|
function handleSetPanelsPreferences(draft, action) {
|
|
99
135
|
if (action.payload) {
|
|
100
136
|
const { key, value } = action.payload;
|
|
137
|
+
let localData = (0, LocalStorage_1.getLocalStorage)('nmr-general-settings');
|
|
138
|
+
localData.workspaces[draft.workspace].formatting.panels[key] = value;
|
|
139
|
+
(0, LocalStorage_1.storeData)('nmr-general-settings', JSON.stringify(localData));
|
|
101
140
|
draft.formatting.panels[key] = value;
|
|
102
141
|
}
|
|
103
142
|
}
|
|
143
|
+
function handleResetPreferences(draft) {
|
|
144
|
+
let localData = (0, LocalStorage_1.getLocalStorage)('nmr-general-settings');
|
|
145
|
+
const hiddenFeatures = getTruthyObjectValues(draft.basePreferences.display);
|
|
146
|
+
const workSpaceDisplayPreferences = (0, merge_1.default)({}, getPreferencesByWorkspace(draft.workspace).display, hiddenFeatures);
|
|
147
|
+
localData.workspaces[draft.workspace].display = workSpaceDisplayPreferences;
|
|
148
|
+
draft.display = workSpaceDisplayPreferences;
|
|
149
|
+
(0, LocalStorage_1.storeData)('nmr-general-settings', JSON.stringify(localData));
|
|
150
|
+
}
|
|
104
151
|
function innerPreferencesReducer(draft, action) {
|
|
105
152
|
switch (action.type) {
|
|
106
153
|
case exports.INIT_PREFERENCES:
|
|
@@ -109,6 +156,8 @@ function innerPreferencesReducer(draft, action) {
|
|
|
109
156
|
return handleSetPreferences(draft, action);
|
|
110
157
|
case exports.SET_PANELS_PREFERENCES:
|
|
111
158
|
return handleSetPanelsPreferences(draft, action);
|
|
159
|
+
case exports.RESET_PREFERENCES:
|
|
160
|
+
return handleResetPreferences(draft);
|
|
112
161
|
default:
|
|
113
162
|
return draft;
|
|
114
163
|
}
|
|
@@ -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';
|
|
@@ -25,15 +25,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
25
25
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
26
26
|
const analysis_ui_components_1 = require("analysis-ui-components");
|
|
27
27
|
const cheminfo_font_1 = require("cheminfo-font");
|
|
28
|
-
const get_1 = __importDefault(require("lodash/get"));
|
|
29
28
|
const react_1 = require("react");
|
|
30
29
|
const fa_1 = require("react-icons/fa");
|
|
31
30
|
const Filters = __importStar(require("../../data/Filters"));
|
|
32
31
|
const ChartContext_1 = require("../context/ChartContext");
|
|
33
32
|
const DispatchContext_1 = require("../context/DispatchContext");
|
|
34
|
-
const PreferencesContext_1 = require("../context/PreferencesContext");
|
|
35
33
|
const ToggleButton_1 = __importDefault(require("../elements/toggle/ToggleButton"));
|
|
36
34
|
const ToggleButtonGroup_1 = __importDefault(require("../elements/toggle/ToggleButtonGroup"));
|
|
35
|
+
const useCheckToolsVisibility_1 = require("../hooks/useCheckToolsVisibility");
|
|
37
36
|
const useDatumWithSpectraStatistics_1 = __importDefault(require("../hooks/useDatumWithSpectraStatistics"));
|
|
38
37
|
const useToolsFunctions_1 = __importDefault(require("../hooks/useToolsFunctions"));
|
|
39
38
|
const Constants_1 = require("../reducer/core/Constants");
|
|
@@ -41,7 +40,7 @@ const Types_1 = require("../reducer/types/Types");
|
|
|
41
40
|
const ToolTypes_1 = require("./ToolTypes");
|
|
42
41
|
function FunctionToolBarInner({ defaultValue, activeSpectrum, info, datum, displayerMode, ftCounter, mode, }) {
|
|
43
42
|
const [option, setOption] = (0, react_1.useState)('');
|
|
44
|
-
const
|
|
43
|
+
const isButtonVisible = (0, useCheckToolsVisibility_1.useCheckToolsVisibility)();
|
|
45
44
|
const dispatch = (0, DispatchContext_1.useDispatch)();
|
|
46
45
|
const { handleChangeOption, handleFullZoomOut } = (0, useToolsFunctions_1.default)();
|
|
47
46
|
const handleChange = (0, react_1.useCallback)((selectedOption) => {
|
|
@@ -58,25 +57,23 @@ function FunctionToolBarInner({ defaultValue, activeSpectrum, info, datum, displ
|
|
|
58
57
|
});
|
|
59
58
|
dispatch({ type: Types_1.SET_SELECTED_FILTER, selectedFilter: null });
|
|
60
59
|
}, [dispatch]);
|
|
61
|
-
const isButtonVisible = (0, react_1.useCallback)((toolKey) => {
|
|
62
|
-
return !(0, get_1.default)(preferences, `display.toolBarButtons.${toolKey}`);
|
|
63
|
-
}, [preferences]);
|
|
64
60
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(ToggleButtonGroup_1.default, { value: option, onChange: handleChange, children: [isButtonVisible('hideZoomTool') && ((0, jsx_runtime_1.jsx)(ToggleButton_1.default, { value: ToolTypes_1.options.zoom.id, id: "zoomIn", title: `${ToolTypes_1.options.zoom.label} ( Press z )`, children: (0, jsx_runtime_1.jsx)("div", { style: { fontSize: 14 }, children: (0, jsx_runtime_1.jsx)(fa_1.FaSearchPlus, {}, void 0) }, void 0) }, ToolTypes_1.options.zoom.id)), isButtonVisible('hideZoomOutTool') && ((0, jsx_runtime_1.jsx)(analysis_ui_components_1.Toolbar.Item, { id: "zoom-out", onClick: handleFullZoomOut, title: "Horizontal zoom out ( Press f ), Horizontal and Vertical zoom out, double click ( Press ff )", children: (0, jsx_runtime_1.jsx)("div", { style: { fontSize: 14 }, children: (0, jsx_runtime_1.jsx)(fa_1.FaExpand, {}, void 0) }, void 0) }, void 0)), displayerMode === Constants_1.DISPLAYER_MODE.DM_1D &&
|
|
65
61
|
isButtonVisible('hidePeakTool') && ((0, jsx_runtime_1.jsx)(ToggleButton_1.default, { value: ToolTypes_1.options.peakPicking.id, title: `${ToolTypes_1.options.peakPicking.label} ( Press p )`, isVisible: activeSpectrum && !info?.isFid ? true : false, id: "peakPicking", children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrPeakPicking, {}, void 0) }, ToolTypes_1.options.peakPicking.id)), displayerMode === Constants_1.DISPLAYER_MODE.DM_1D &&
|
|
66
62
|
isButtonVisible('hideIntegralTool') && ((0, jsx_runtime_1.jsx)(ToggleButton_1.default, { value: ToolTypes_1.options.integral.id, isVisible: activeSpectrum && !info?.isFid ? true : false, id: "integralPicking", title: `${ToolTypes_1.options.integral.label} ( Press i )`, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrIntegrate, {}, void 0) }, ToolTypes_1.options.integral.id)), displayerMode === Constants_1.DISPLAYER_MODE.DM_2D &&
|
|
67
|
-
isButtonVisible('
|
|
68
|
-
isButtonVisible('
|
|
63
|
+
isButtonVisible('hideZonePickingTool') && ((0, jsx_runtime_1.jsx)(ToggleButton_1.default, { value: ToolTypes_1.options.zone2D.id, id: "zone2d", isVisible: activeSpectrum && !info?.isFid ? true : false, title: `${ToolTypes_1.options.zone2D.label} ( Press r )`, children: (0, jsx_runtime_1.jsx)(fa_1.FaDiceFour, {}, void 0) }, ToolTypes_1.options.zone2D.id)), displayerMode === Constants_1.DISPLAYER_MODE.DM_2D &&
|
|
64
|
+
isButtonVisible('hideSlicingTool') && ((0, jsx_runtime_1.jsx)(ToggleButton_1.default, { value: ToolTypes_1.options.slicingTool.id, isVisible: activeSpectrum && !info?.isFid ? true : false, id: "slic", title: `${ToolTypes_1.options.slicingTool.label}`, children: (0, jsx_runtime_1.jsx)("p", { children: "Slic" }, void 0) }, ToolTypes_1.options.slicingTool.id)), displayerMode === Constants_1.DISPLAYER_MODE.DM_1D &&
|
|
65
|
+
isButtonVisible('hideAutoRangesTool') && ((0, jsx_runtime_1.jsx)(ToggleButton_1.default, { value: ToolTypes_1.options.rangesPicking.id, isVisible: activeSpectrum && !info?.isFid ? true : false, title: `${ToolTypes_1.options.rangesPicking.label} ( Press r )`, id: "ranges-pick", children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrRangePicking, {}, void 0) }, ToolTypes_1.options.rangesPicking.id)), displayerMode === Constants_1.DISPLAYER_MODE.DM_1D &&
|
|
69
66
|
isButtonVisible('hideMultipleSpectraAnalysisTool') &&
|
|
70
67
|
ftCounter > 1 &&
|
|
71
68
|
mode === 'RTL' && ((0, jsx_runtime_1.jsx)(ToggleButton_1.default, { value: ToolTypes_1.options.multipleSpectraAnalysis.id, id: "multipleSpectraAnalysis", title: ToolTypes_1.options.multipleSpectraAnalysis.label, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrMultipleAnalysis, {}, void 0) }, ToolTypes_1.options.multipleSpectraAnalysis.id)), displayerMode === Constants_1.DISPLAYER_MODE.DM_1D &&
|
|
72
69
|
isButtonVisible('hideZeroFillingTool') && ((0, jsx_runtime_1.jsx)(ToggleButton_1.default, { value: ToolTypes_1.options.zeroFilling.id, isVisible: Filters.zeroFilling.isApplicable({ info }), id: "zeroFilling", title: ToolTypes_1.options.zeroFilling.label, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrZeroFilling, {}, void 0) }, ToolTypes_1.options.zeroFilling.id)), displayerMode === Constants_1.DISPLAYER_MODE.DM_1D &&
|
|
73
|
-
isButtonVisible('hidePhaseCorrectionTool') && ((0, jsx_runtime_1.jsx)(ToggleButton_1.default, { value: ToolTypes_1.options.phaseCorrection.id, id: "phaseCorrection", title: ToolTypes_1.options.phaseCorrection.label
|
|
70
|
+
isButtonVisible('hidePhaseCorrectionTool') && ((0, jsx_runtime_1.jsx)(ToggleButton_1.default, { value: ToolTypes_1.options.phaseCorrection.id, id: "phaseCorrection", title: `${ToolTypes_1.options.phaseCorrection.label} ( Press a )`, isVisible: activeSpectrum &&
|
|
74
71
|
info &&
|
|
75
72
|
Filters.phaseCorrection.isApplicable({ info }) &&
|
|
76
73
|
datum.im
|
|
77
74
|
? true
|
|
78
75
|
: false, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrPhaseCorrection, {}, void 0) }, ToolTypes_1.options.phaseCorrection.id)), displayerMode === Constants_1.DISPLAYER_MODE.DM_1D &&
|
|
79
|
-
isButtonVisible('hideBaseLineCorrectionTool') && ((0, jsx_runtime_1.jsx)(ToggleButton_1.default, { value: ToolTypes_1.options.baseLineCorrection.id, id: "baseLineCorrection", title: ToolTypes_1.options.baseLineCorrection.label
|
|
76
|
+
isButtonVisible('hideBaseLineCorrectionTool') && ((0, jsx_runtime_1.jsx)(ToggleButton_1.default, { value: ToolTypes_1.options.baseLineCorrection.id, id: "baseLineCorrection", title: `${ToolTypes_1.options.baseLineCorrection.label} ( Press b )`, isVisible: activeSpectrum &&
|
|
80
77
|
info &&
|
|
81
78
|
Filters.baselineCorrection.isApplicable({ info })
|
|
82
79
|
? true
|
|
@@ -66,7 +66,7 @@ exports.options = {
|
|
|
66
66
|
},
|
|
67
67
|
rangesPicking: {
|
|
68
68
|
id: 'rangesPicking',
|
|
69
|
-
label: 'Ranges Picking
|
|
69
|
+
label: 'Ranges Picking',
|
|
70
70
|
hasOptionPanel: true,
|
|
71
71
|
isFilter: false,
|
|
72
72
|
},
|
|
@@ -78,13 +78,13 @@ exports.options = {
|
|
|
78
78
|
},
|
|
79
79
|
phaseCorrection: {
|
|
80
80
|
id: Filters.phaseCorrection.id,
|
|
81
|
-
label:
|
|
81
|
+
label: Filters.phaseCorrection.name,
|
|
82
82
|
hasOptionPanel: true,
|
|
83
83
|
isFilter: true,
|
|
84
84
|
},
|
|
85
85
|
baseLineCorrection: {
|
|
86
86
|
id: 'baseLineCorrection',
|
|
87
|
-
label: 'baseline correction
|
|
87
|
+
label: 'baseline correction',
|
|
88
88
|
hasOptionPanel: true,
|
|
89
89
|
isFilter: true,
|
|
90
90
|
},
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.basic = void 0;
|
|
4
|
+
exports.basic = {
|
|
5
|
+
version: 1,
|
|
6
|
+
label: 'Default Mode',
|
|
7
|
+
display: {
|
|
8
|
+
general: {
|
|
9
|
+
disableMultipletAnalysis: false,
|
|
10
|
+
hideSetSumFromMolecule: false,
|
|
11
|
+
hideGeneralSettings: false,
|
|
12
|
+
hideExperimentalFeatures: false,
|
|
13
|
+
},
|
|
14
|
+
panels: {
|
|
15
|
+
hideSpectraPanel: false,
|
|
16
|
+
hideInformationPanel: false,
|
|
17
|
+
hidePeaksPanel: false,
|
|
18
|
+
hideIntegralsPanel: false,
|
|
19
|
+
hideRangesPanel: false,
|
|
20
|
+
hideStructuresPanel: false,
|
|
21
|
+
hideFiltersPanel: false,
|
|
22
|
+
hideZonesPanel: false,
|
|
23
|
+
hideSummaryPanel: false,
|
|
24
|
+
hideMultipleSpectraAnalysisPanel: false,
|
|
25
|
+
hideDatabasePanel: false,
|
|
26
|
+
hidePredictionPanel: false,
|
|
27
|
+
},
|
|
28
|
+
toolBarButtons: {
|
|
29
|
+
hideZoomTool: false,
|
|
30
|
+
hideZoomOutTool: false,
|
|
31
|
+
hideImport: false,
|
|
32
|
+
hideExportAs: false,
|
|
33
|
+
hideSpectraStackAlignments: false,
|
|
34
|
+
hideSpectraCenterAlignments: false,
|
|
35
|
+
hideRealImaginary: false,
|
|
36
|
+
hidePeakTool: false,
|
|
37
|
+
hideIntegralTool: false,
|
|
38
|
+
hideZonePickingTool: false,
|
|
39
|
+
hideSlicingTool: false,
|
|
40
|
+
hideAutoRangesTool: false,
|
|
41
|
+
hideZeroFillingTool: false,
|
|
42
|
+
hidePhaseCorrectionTool: false,
|
|
43
|
+
hideBaseLineCorrectionTool: false,
|
|
44
|
+
hideFFTTool: false,
|
|
45
|
+
hideMultipleSpectraAnalysisTool: false,
|
|
46
|
+
hideExclusionZonesTool: false,
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.exercise1D = void 0;
|
|
4
|
+
exports.exercise1D = {
|
|
5
|
+
version: 1,
|
|
6
|
+
label: 'Exercise 1D Mode',
|
|
7
|
+
display: {
|
|
8
|
+
general: {
|
|
9
|
+
disableMultipletAnalysis: true,
|
|
10
|
+
hideSetSumFromMolecule: true,
|
|
11
|
+
hideGeneralSettings: true,
|
|
12
|
+
hideExperimentalFeatures: true,
|
|
13
|
+
},
|
|
14
|
+
panels: {
|
|
15
|
+
hideSpectraPanel: false,
|
|
16
|
+
hideInformationPanel: true,
|
|
17
|
+
hidePeaksPanel: true,
|
|
18
|
+
hideIntegralsPanel: false,
|
|
19
|
+
hideRangesPanel: true,
|
|
20
|
+
hideStructuresPanel: true,
|
|
21
|
+
hideFiltersPanel: true,
|
|
22
|
+
hideZonesPanel: true,
|
|
23
|
+
hideSummaryPanel: true,
|
|
24
|
+
hideMultipleSpectraAnalysisPanel: true,
|
|
25
|
+
hideDatabasePanel: true,
|
|
26
|
+
hidePredictionPanel: false,
|
|
27
|
+
},
|
|
28
|
+
toolBarButtons: {
|
|
29
|
+
hideZoomTool: false,
|
|
30
|
+
hideZoomOutTool: false,
|
|
31
|
+
hideImport: true,
|
|
32
|
+
hideExportAs: true,
|
|
33
|
+
hideSpectraStackAlignments: false,
|
|
34
|
+
hideSpectraCenterAlignments: false,
|
|
35
|
+
hideRealImaginary: true,
|
|
36
|
+
hidePeakTool: false,
|
|
37
|
+
hideIntegralTool: false,
|
|
38
|
+
hideZonePickingTool: true,
|
|
39
|
+
hideSlicingTool: true,
|
|
40
|
+
hideAutoRangesTool: true,
|
|
41
|
+
hideZeroFillingTool: true,
|
|
42
|
+
hidePhaseCorrectionTool: true,
|
|
43
|
+
hideBaseLineCorrectionTool: true,
|
|
44
|
+
hideFFTTool: true,
|
|
45
|
+
hideMultipleSpectraAnalysisTool: true,
|
|
46
|
+
hideExclusionZonesTool: true,
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
};
|