nmrium 0.20.1 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/component/1d/ExclusionZonesAnnotations.js +1 -2
- package/lib/component/1d/Integral.js +1 -6
- package/lib/component/1d/Viewer1D.js +4 -4
- package/lib/component/1d/ranges/RangeIntegral.js +2 -6
- package/lib/component/1d/utilities/scale.d.ts +1 -1
- package/lib/component/1d/utilities/scale.js +7 -6
- package/lib/component/2d/Viewer2D.js +5 -5
- package/lib/component/EventsTrackers/KeysListenerTracker.js +98 -81
- package/lib/component/NMRium.d.ts +9 -2
- package/lib/component/NMRium.js +9 -9
- package/lib/component/elements/EditableColumn.d.ts +1 -1
- package/lib/component/elements/NumberInput.d.ts +1 -2
- package/lib/component/elements/Tab/Tab.js +1 -0
- package/lib/component/header/Header.js +13 -10
- package/lib/component/hooks/useCheckExperimentalFeature.js +2 -1
- package/lib/component/hooks/useCheckToolsVisibility.d.ts +1 -0
- package/lib/component/hooks/useCheckToolsVisibility.js +6 -0
- package/lib/component/{1d/utilities → hooks}/useIntegralPath.d.ts +0 -0
- package/lib/component/hooks/useIntegralPath.js +53 -0
- package/lib/component/hooks/useToolsFunctions.js +6 -6
- package/lib/component/hooks/useXScale.d.ts +2 -0
- package/lib/component/hooks/useXScale.js +7 -0
- package/lib/component/loader/DropZone.js +88 -88
- package/lib/component/modal/changeSum/ChangeSumModal.js +4 -2
- package/lib/component/modal/editRange/forms/validation/EditRangeValidation.js +1 -1
- package/lib/component/modal/editZone/EditPathLengthFormik.d.ts +5 -0
- package/lib/component/modal/editZone/EditPathLengthFormik.js +72 -0
- package/lib/component/modal/editZone/EditZoneModal.d.ts +8 -0
- package/lib/component/modal/editZone/EditZoneModal.js +96 -0
- package/lib/component/modal/editZone/SignalFormTab.d.ts +6 -0
- package/lib/component/modal/editZone/SignalFormTab.js +6 -0
- package/lib/component/modal/editZone/SignalsForm.d.ts +2 -0
- package/lib/component/modal/editZone/SignalsForm.js +62 -0
- package/lib/component/modal/editZone/validation/EditZoneValidation.d.ts +534 -0
- package/lib/component/modal/editZone/validation/EditZoneValidation.js +17 -0
- package/lib/component/modal/editZone/validation/isDefaultPathLength.d.ts +3 -0
- package/lib/component/modal/editZone/validation/isDefaultPathLength.js +7 -0
- package/lib/component/modal/setting/ControllersTabContent.js +1 -1
- package/lib/component/modal/setting/DisplayTabContent.js +1 -1
- package/lib/component/modal/setting/GeneralSettings.d.ts +1 -2
- package/lib/component/modal/setting/GeneralSettings.js +13 -9
- package/lib/component/panels/AutomaticAssignment/AutomaticAssignment.d.ts +2 -0
- package/lib/component/panels/AutomaticAssignment/AutomaticAssignment.js +13 -0
- package/lib/component/panels/AutomaticAssignment/AutomaticAssignmentTable.d.ts +7 -0
- package/lib/component/panels/AutomaticAssignment/AutomaticAssignmentTable.js +38 -0
- package/lib/component/panels/IntegralsPanel/IntegralPanel.js +0 -3
- package/lib/component/panels/IntegralsPanel/IntegralsPreferences.js +4 -17
- package/lib/component/panels/MoleculesPanel/MoleculePanel.js +1 -1
- package/lib/component/panels/Panels.d.ts +1 -1
- package/lib/component/panels/Panels.js +10 -14
- package/lib/component/panels/PeaksPanel/PeaksPanel.js +0 -3
- package/lib/component/panels/PeaksPanel/PeaksPreferences.js +5 -14
- package/lib/component/panels/RangesPanel/RangesPanel.js +2 -5
- package/lib/component/panels/RangesPanel/RangesPreferences.js +5 -18
- package/lib/component/panels/SpectrumsPanel/SpectraPanelHeader.js +13 -3
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +7 -2
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnHeader.js +7 -2
- package/lib/component/panels/SummaryPanel/CorrelationTable/Constants.d.ts +1 -6
- package/lib/component/panels/SummaryPanel/CorrelationTable/Constants.js +1 -7
- package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTable.d.ts +2 -3
- package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTable.js +4 -5
- package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.d.ts +2 -3
- package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +21 -25
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/EditLinkModal.js +24 -30
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/EditPathLength.d.ts +8 -0
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/EditPathLength.js +89 -0
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.d.ts +6 -6
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +1 -1
- package/lib/component/panels/SummaryPanel/SummaryPanel.js +40 -43
- package/lib/component/panels/SummaryPanel/utilities/IsInView.d.ts +6 -0
- package/lib/component/panels/SummaryPanel/utilities/IsInView.js +16 -0
- package/lib/component/panels/SummaryPanel/utilities/Utilities.d.ts +29 -0
- package/lib/component/panels/SummaryPanel/{Utilities.js → utilities/Utilities.js} +155 -19
- package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.d.ts +1 -0
- package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +26 -3
- package/lib/component/panels/ZonesPanel/ZonesPanel.js +12 -7
- package/lib/component/panels/ZonesPanel/ZonesPreferences.js +5 -18
- package/lib/component/panels/ZonesPanel/ZonesTable.d.ts +3 -2
- package/lib/component/panels/ZonesPanel/ZonesTable.js +5 -2
- package/lib/component/panels/databasePanel/DatabasePanel.js +0 -3
- package/lib/component/panels/databasePanel/DatabasePreferences.js +4 -17
- package/lib/component/reducer/IgnoreActions.js +2 -1
- package/lib/component/reducer/Reducer.d.ts +20 -34
- package/lib/component/reducer/Reducer.js +7 -8
- package/lib/component/reducer/actions/CorrelationsActions.d.ts +7 -7
- package/lib/component/reducer/actions/CorrelationsActions.js +1 -1
- package/lib/component/reducer/actions/DatabaseActions.js +1 -1
- package/lib/component/reducer/actions/DomainActions.d.ts +3 -1
- package/lib/component/reducer/actions/DomainActions.js +20 -1
- package/lib/component/reducer/actions/IntegralsActions.js +2 -0
- package/lib/component/reducer/actions/LoadActions.js +22 -1
- package/lib/component/reducer/actions/PreferencesActions.js +0 -2
- package/lib/component/reducer/actions/RangesActions.js +3 -1
- package/lib/component/reducer/actions/SpectrumsActions.js +1 -1
- package/lib/component/reducer/actions/ToolsActions.js +43 -56
- package/lib/component/reducer/actions/ZonesActions.d.ts +3 -1
- package/lib/component/reducer/actions/ZonesActions.js +33 -2
- package/lib/component/reducer/helper/Zoom1DManager.d.ts +17 -21
- package/lib/component/reducer/helper/Zoom1DManager.js +53 -69
- package/lib/component/reducer/helper/ZoomHistoryManager.d.ts +1 -0
- package/lib/component/reducer/helper/ZoomHistoryManager.js +2 -1
- package/lib/component/reducer/preferencesReducer.d.ts +3 -8
- package/lib/component/reducer/preferencesReducer.js +87 -37
- package/lib/component/reducer/types/Types.d.ts +3 -1
- package/lib/component/reducer/types/Types.js +3 -1
- package/lib/component/toolbar/FunctionToolBar.js +7 -10
- package/lib/component/toolbar/ToolTypes.js +3 -3
- package/lib/component/workspaces/Workspace.d.ts +6 -0
- package/lib/component/workspaces/Workspace.js +1 -0
- package/lib/component/workspaces/basic.d.ts +2 -0
- package/lib/component/workspaces/basic.js +45 -0
- package/lib/component/workspaces/exercise1D.d.ts +2 -0
- package/lib/component/workspaces/exercise1D.js +45 -0
- package/lib/component/workspaces/index.d.ts +6 -0
- package/lib/component/workspaces/index.js +4 -0
- package/lib/component/workspaces/process1D.d.ts +2 -0
- package/lib/component/workspaces/process1D.js +43 -0
- package/lib/data/constants/DefaultPathLengths.d.ts +6 -0
- package/lib/data/constants/DefaultPathLengths.js +8 -0
- package/lib/data/data1d/Spectrum1D/getSpectrumErrorValue.d.ts +2 -0
- package/lib/data/data1d/Spectrum1D/getSpectrumErrorValue.js +4 -0
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +7 -19
- package/lib/data/data1d/Spectrum1D/integrals/initiateIntegrals.d.ts +11 -0
- package/lib/data/data1d/Spectrum1D/integrals/initiateIntegrals.js +11 -0
- package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +2 -21
- package/lib/data/data1d/Spectrum1D/peaks/initiatePeaks.d.ts +9 -0
- package/lib/data/data1d/Spectrum1D/peaks/initiatePeaks.js +7 -0
- package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.d.ts +2 -0
- package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.js +29 -0
- package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.d.ts +13 -0
- package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.js +14 -0
- package/lib/data/data1d/Spectrum1D/ranges/mapRanges.js +13 -8
- package/lib/data/migration/MigrationManager.js +3 -0
- package/lib/versionInfo.js +1 -1
- package/lib-cjs/component/1d/ExclusionZonesAnnotations.js +1 -2
- package/lib-cjs/component/1d/Integral.js +1 -6
- package/lib-cjs/component/1d/Viewer1D.js +4 -4
- package/lib-cjs/component/1d/ranges/RangeIntegral.js +2 -6
- package/lib-cjs/component/1d/utilities/scale.js +7 -6
- package/lib-cjs/component/2d/Viewer2D.js +4 -4
- package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +98 -81
- package/lib-cjs/component/NMRium.js +10 -10
- package/lib-cjs/component/elements/Tab/Tab.js +1 -0
- package/lib-cjs/component/header/Header.js +13 -10
- package/lib-cjs/component/hooks/useCheckExperimentalFeature.js +5 -1
- package/lib-cjs/component/hooks/useCheckToolsVisibility.js +13 -0
- package/lib-cjs/component/hooks/useIntegralPath.js +56 -0
- package/lib-cjs/component/hooks/useToolsFunctions.js +6 -6
- package/lib-cjs/component/hooks/useXScale.js +11 -0
- package/lib-cjs/component/loader/DropZone.js +88 -88
- package/lib-cjs/component/modal/changeSum/ChangeSumModal.js +4 -2
- package/lib-cjs/component/modal/editRange/forms/validation/EditRangeValidation.js +1 -1
- package/lib-cjs/component/modal/editZone/EditPathLengthFormik.js +77 -0
- package/lib-cjs/component/modal/editZone/EditZoneModal.js +101 -0
- package/lib-cjs/component/modal/editZone/SignalFormTab.js +11 -0
- package/lib-cjs/component/modal/editZone/SignalsForm.js +67 -0
- package/lib-cjs/component/modal/editZone/validation/EditZoneValidation.js +38 -0
- package/lib-cjs/component/modal/editZone/validation/isDefaultPathLength.js +12 -0
- package/lib-cjs/component/modal/setting/ControllersTabContent.js +1 -1
- package/lib-cjs/component/modal/setting/DisplayTabContent.js +1 -1
- package/lib-cjs/component/modal/setting/GeneralSettings.js +12 -8
- package/lib-cjs/component/panels/AutomaticAssignment/AutomaticAssignment.js +18 -0
- package/lib-cjs/component/panels/AutomaticAssignment/AutomaticAssignmentTable.js +43 -0
- package/lib-cjs/component/panels/IntegralsPanel/IntegralPanel.js +0 -3
- package/lib-cjs/component/panels/IntegralsPanel/IntegralsPreferences.js +3 -16
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanel.js +1 -1
- package/lib-cjs/component/panels/Panels.js +11 -15
- package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +0 -3
- package/lib-cjs/component/panels/PeaksPanel/PeaksPreferences.js +4 -13
- package/lib-cjs/component/panels/RangesPanel/RangesPanel.js +2 -5
- package/lib-cjs/component/panels/RangesPanel/RangesPreferences.js +4 -17
- package/lib-cjs/component/panels/SpectrumsPanel/SpectraPanelHeader.js +13 -3
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +7 -2
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnHeader.js +7 -2
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/Constants.js +1 -8
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTable.js +4 -5
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +21 -25
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/editLink/EditLinkModal.js +43 -30
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/editLink/EditPathLength.js +94 -0
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +1 -1
- package/lib-cjs/component/panels/SummaryPanel/SummaryPanel.js +38 -41
- package/lib-cjs/component/panels/SummaryPanel/utilities/IsInView.js +18 -0
- package/lib-cjs/component/panels/SummaryPanel/{Utilities.js → utilities/Utilities.js} +157 -19
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +24 -1
- package/lib-cjs/component/panels/ZonesPanel/ZonesPanel.js +12 -7
- package/lib-cjs/component/panels/ZonesPanel/ZonesPreferences.js +4 -17
- package/lib-cjs/component/panels/ZonesPanel/ZonesTable.js +5 -2
- package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +0 -3
- package/lib-cjs/component/panels/databasePanel/DatabasePreferences.js +3 -16
- package/lib-cjs/component/reducer/IgnoreActions.js +2 -1
- package/lib-cjs/component/reducer/Reducer.js +7 -8
- package/lib-cjs/component/reducer/actions/DatabaseActions.js +2 -2
- package/lib-cjs/component/reducer/actions/DomainActions.js +21 -1
- package/lib-cjs/component/reducer/actions/IntegralsActions.js +2 -0
- package/lib-cjs/component/reducer/actions/LoadActions.js +22 -1
- package/lib-cjs/component/reducer/actions/PreferencesActions.js +0 -2
- package/lib-cjs/component/reducer/actions/RangesActions.js +2 -0
- package/lib-cjs/component/reducer/actions/SpectrumsActions.js +2 -2
- package/lib-cjs/component/reducer/actions/ToolsActions.js +50 -63
- package/lib-cjs/component/reducer/actions/ZonesActions.js +35 -2
- package/lib-cjs/component/reducer/helper/Zoom1DManager.js +55 -73
- package/lib-cjs/component/reducer/helper/ZoomHistoryManager.js +2 -1
- package/lib-cjs/component/reducer/preferencesReducer.js +87 -37
- package/lib-cjs/component/reducer/types/Types.js +6 -4
- package/lib-cjs/component/toolbar/FunctionToolBar.js +7 -10
- package/lib-cjs/component/toolbar/ToolTypes.js +3 -3
- package/lib-cjs/component/workspaces/Workspace.js +2 -0
- package/lib-cjs/component/workspaces/basic.js +48 -0
- package/lib-cjs/component/workspaces/exercise1D.js +48 -0
- package/lib-cjs/component/workspaces/index.js +6 -0
- package/lib-cjs/component/workspaces/process1D.js +46 -0
- package/lib-cjs/data/constants/DefaultPathLengths.js +10 -0
- package/lib-cjs/data/data1d/Spectrum1D/getSpectrumErrorValue.js +8 -0
- package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +7 -19
- package/lib-cjs/data/data1d/Spectrum1D/integrals/initiateIntegrals.js +18 -0
- package/lib-cjs/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +2 -21
- package/lib-cjs/data/data1d/Spectrum1D/peaks/initiatePeaks.js +14 -0
- package/lib-cjs/data/data1d/Spectrum1D/peaks/mapPeaks.js +36 -0
- package/lib-cjs/data/data1d/Spectrum1D/ranges/initiateRanges.js +21 -0
- package/lib-cjs/data/data1d/Spectrum1D/ranges/mapRanges.js +13 -8
- package/lib-cjs/data/migration/MigrationManager.js +3 -0
- package/lib-cjs/versionInfo.js +1 -1
- package/package.json +15 -16
- package/lib/component/1d/utilities/useIntegralPath.js +0 -63
- package/lib/component/nmriumMode/basic.d.ts +0 -38
- package/lib/component/nmriumMode/basic.js +0 -37
- package/lib/component/nmriumMode/exercise1D.d.ts +0 -38
- package/lib/component/nmriumMode/exercise1D.js +0 -37
- package/lib/component/nmriumMode/process1D.d.ts +0 -38
- package/lib/component/nmriumMode/process1D.js +0 -37
- package/lib/component/panels/SummaryPanel/Utilities.d.ts +0 -25
- package/lib/component/reducer/actions/Zoom.d.ts +0 -16
- package/lib/component/reducer/actions/Zoom.js +0 -92
- package/lib-cjs/component/1d/utilities/useIntegralPath.js +0 -66
- package/lib-cjs/component/nmriumMode/basic.js +0 -39
- package/lib-cjs/component/nmriumMode/exercise1D.js +0 -39
- package/lib-cjs/component/nmriumMode/process1D.js +0 -39
- package/lib-cjs/component/reducer/actions/Zoom.js +0 -116
|
@@ -1,22 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { Draft } from 'immer';
|
|
2
|
+
import { State } from '../Reducer';
|
|
3
|
+
export declare const ZoomType: {
|
|
4
|
+
HORIZONTAL: string;
|
|
5
|
+
VERTICAL: string;
|
|
6
|
+
STEP_HORIZONTAL: string;
|
|
7
|
+
FULL: string;
|
|
8
|
+
};
|
|
9
|
+
interface ZoomOptions {
|
|
10
|
+
factor?: number;
|
|
11
|
+
invert?: boolean;
|
|
10
12
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
getScale: (id: string) => number;
|
|
18
|
-
}
|
|
19
|
-
export declare function initZoom1D(): Zoom1D;
|
|
20
|
-
export declare function setAllScales(Zoom1DObject: Zoom1D, newScale: number): void;
|
|
21
|
-
export default function zoom1DManager(Zoom1DObject: Zoom1D, defaultScale?: number): Zoom1DManager;
|
|
22
|
-
export {};
|
|
13
|
+
declare function wheelZoom(event: WheelEvent, domain: number[], zoomOptions?: ZoomOptions): number[];
|
|
14
|
+
declare function setZoom(draft: Draft<State>, options?: {
|
|
15
|
+
scale?: number;
|
|
16
|
+
spectrumID?: string;
|
|
17
|
+
}): void;
|
|
18
|
+
export { setZoom, wheelZoom };
|
|
@@ -1,73 +1,57 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
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
|
-
return (id) => {
|
|
38
|
-
initZoomManager(Zoom1DObject, id, defaultScale);
|
|
39
|
-
return Zoom1DObject.scales[id];
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
function prepareSetScale(Zoom1DObject, defaultScale) {
|
|
43
|
-
return (newScale, spectrumID) => {
|
|
44
|
-
initZoomManager(Zoom1DObject, spectrumID, defaultScale);
|
|
45
|
-
Zoom1DObject.scales[spectrumID] = newScale;
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
function prepareWheel(Zoom1DObject, defaultScale) {
|
|
49
|
-
return (deltaY, id) => {
|
|
50
|
-
initZoomManager(Zoom1DObject, id, defaultScale);
|
|
51
|
-
return wheel(Zoom1DObject, deltaY, id);
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
function wheel(Zoom1DObject, deltaY, id) {
|
|
55
|
-
const { options: { slowZoomStep, fastZoomStep, speedThreshold }, } = Zoom1DObject;
|
|
56
|
-
const deltaYValue = Math.abs(deltaY).toString().length === 1
|
|
57
|
-
? Math.abs(deltaY)
|
|
58
|
-
: Math.abs(deltaY) / 100;
|
|
59
|
-
const LOW_STEP = 0.01 * slowZoomStep;
|
|
60
|
-
const FAST_STEP = 0.05 * fastZoomStep;
|
|
61
|
-
let ZOOM_STEP = deltaYValue <= speedThreshold ? LOW_STEP : FAST_STEP;
|
|
62
|
-
const direction = Math.sign(deltaY);
|
|
63
|
-
const _scale = direction === -1
|
|
64
|
-
? Zoom1DObject.scales[id] + ZOOM_STEP
|
|
65
|
-
: Zoom1DObject.scales[id] - ZOOM_STEP;
|
|
66
|
-
if (_scale >= 0) {
|
|
67
|
-
Zoom1DObject.scales[id] = _scale;
|
|
1
|
+
import { zoomIdentity, scaleLinear } from 'd3';
|
|
2
|
+
export const ZoomType = {
|
|
3
|
+
HORIZONTAL: 'HORIZONTAL',
|
|
4
|
+
VERTICAL: 'VERTICAL',
|
|
5
|
+
STEP_HORIZONTAL: 'STEP_HORIZONTAL',
|
|
6
|
+
FULL: 'FULL',
|
|
7
|
+
};
|
|
8
|
+
function wheelZoom(event, domain, zoomOptions = {}) {
|
|
9
|
+
const { factor = 1, invert = false } = zoomOptions;
|
|
10
|
+
const deltaY = Math.abs(event.deltaY) < 100 ? event.deltaY * 100 : event.deltaY;
|
|
11
|
+
const delta = deltaY * (invert ? -0.001 : 0.001) * factor;
|
|
12
|
+
const ratio = delta < 0 ? -1 / (delta - 1) : 1 + delta;
|
|
13
|
+
const [min, max] = domain;
|
|
14
|
+
return [min * ratio, max * ratio];
|
|
15
|
+
}
|
|
16
|
+
function setZoom(draft, options = {}) {
|
|
17
|
+
const { height, margin, activeSpectrum } = draft;
|
|
18
|
+
const { scale = 1, spectrumID = null } = options;
|
|
19
|
+
if (activeSpectrum === null && spectrumID === null) {
|
|
20
|
+
const { shareYDomain, yDomain, yDomains } = draft.originDomain;
|
|
21
|
+
draft.yDomains = Object.keys(draft.yDomains).reduce((acc, id) => {
|
|
22
|
+
const _scale = scaleLinear(shareYDomain ? yDomain : yDomains[id], [
|
|
23
|
+
height - margin.bottom,
|
|
24
|
+
margin.top,
|
|
25
|
+
]);
|
|
26
|
+
const [min, max] = shareYDomain ? yDomain : yDomains[id];
|
|
27
|
+
const maxPoint = Math.max(Math.abs(max), Math.abs(min));
|
|
28
|
+
const scalePoint = maxPoint === max ? 0 : min;
|
|
29
|
+
const t = zoomIdentity
|
|
30
|
+
.translate(0, Math.sign(scalePoint) >= 0 ? _scale(scalePoint) : _scale(scalePoint))
|
|
31
|
+
.scale(scale)
|
|
32
|
+
.translate(0, -_scale(0));
|
|
33
|
+
const newYDomain = t.rescaleY(_scale).domain();
|
|
34
|
+
acc[id] = newYDomain;
|
|
35
|
+
return acc;
|
|
36
|
+
}, {});
|
|
68
37
|
}
|
|
69
38
|
else {
|
|
70
|
-
|
|
39
|
+
const spectrumId = spectrumID || activeSpectrum?.id;
|
|
40
|
+
if (spectrumId) {
|
|
41
|
+
const _scale = scaleLinear(draft.originDomain.yDomains[spectrumId], [
|
|
42
|
+
height - margin.bottom,
|
|
43
|
+
margin.top,
|
|
44
|
+
]);
|
|
45
|
+
const t = zoomIdentity
|
|
46
|
+
.translate(0, _scale(0))
|
|
47
|
+
.scale(scale)
|
|
48
|
+
.translate(0, -_scale(0));
|
|
49
|
+
const yDomain = t.rescaleY(_scale).domain();
|
|
50
|
+
draft.yDomains = {
|
|
51
|
+
...draft.yDomains,
|
|
52
|
+
[spectrumId]: yDomain,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
71
55
|
}
|
|
72
|
-
return Zoom1DObject.scales[id];
|
|
73
56
|
}
|
|
57
|
+
export { setZoom, wheelZoom };
|
|
@@ -10,6 +10,7 @@ interface ZoomHistoryManager {
|
|
|
10
10
|
push: (value: HistoryItem) => void;
|
|
11
11
|
pop: () => HistoryItem;
|
|
12
12
|
getLast: () => HistoryItem;
|
|
13
|
+
clear: () => void;
|
|
13
14
|
}
|
|
14
15
|
export default function zoomHistoryManager(zoomHistory: ZoomHistory, nucleus: string): ZoomHistoryManager;
|
|
15
16
|
export {};
|
|
@@ -5,7 +5,8 @@ export default function zoomHistoryManager(zoomHistory, nucleus) {
|
|
|
5
5
|
const push = preparePush(zoomHistory[nucleus]);
|
|
6
6
|
const pop = preparePop(zoomHistory[nucleus]);
|
|
7
7
|
const getLast = prepareGetLast(zoomHistory[nucleus]);
|
|
8
|
-
|
|
8
|
+
const clear = () => (zoomHistory[nucleus] = []);
|
|
9
|
+
return { historyStack: zoomHistory[nucleus], push, pop, getLast, clear };
|
|
9
10
|
}
|
|
10
11
|
function preparePush(historyStack) {
|
|
11
12
|
return (val) => {
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
export declare const INIT_PREFERENCES = "INIT_PREFERENCES";
|
|
2
2
|
export declare const SET_PREFERENCES = "SET_PREFERENCES";
|
|
3
|
+
export declare const RESET_PREFERENCES = "RESET_PREFERENCES";
|
|
3
4
|
export declare const SET_PANELS_PREFERENCES = "SET_PANELS_PREFERENCES";
|
|
4
5
|
export interface PreferencesState {
|
|
5
6
|
basePreferences: any;
|
|
6
7
|
display: any;
|
|
7
8
|
controllers: {
|
|
8
|
-
mws: {
|
|
9
|
-
low: number;
|
|
10
|
-
high: number;
|
|
11
|
-
};
|
|
12
9
|
dimmedSpectraTransparency: number;
|
|
13
10
|
};
|
|
14
11
|
formatting: {
|
|
@@ -22,16 +19,13 @@ export interface PreferencesState {
|
|
|
22
19
|
panels: any;
|
|
23
20
|
};
|
|
24
21
|
dispatch: any;
|
|
22
|
+
workspace: string;
|
|
25
23
|
}
|
|
26
24
|
export declare const preferencesInitialState: PreferencesState;
|
|
27
25
|
declare const preferencesReducer: (base: {
|
|
28
26
|
readonly basePreferences: any;
|
|
29
27
|
readonly display: any;
|
|
30
28
|
readonly controllers: {
|
|
31
|
-
readonly mws: {
|
|
32
|
-
readonly low: number;
|
|
33
|
-
readonly high: number;
|
|
34
|
-
};
|
|
35
29
|
readonly dimmedSpectraTransparency: number;
|
|
36
30
|
};
|
|
37
31
|
readonly formatting: {
|
|
@@ -45,5 +39,6 @@ declare const preferencesReducer: (base: {
|
|
|
45
39
|
readonly panels: any;
|
|
46
40
|
};
|
|
47
41
|
readonly dispatch: any;
|
|
42
|
+
readonly workspace: string;
|
|
48
43
|
}, action: any) => import("immer/dist/internal").WritableDraft<PreferencesState>;
|
|
49
44
|
export default preferencesReducer;
|
|
@@ -1,29 +1,27 @@
|
|
|
1
1
|
import { produce } from 'immer';
|
|
2
2
|
import lodashMerge from 'lodash/merge';
|
|
3
|
-
import {
|
|
4
|
-
import basic from '../nmriumMode/basic';
|
|
5
|
-
import exercise1D from '../nmriumMode/exercise1D';
|
|
6
|
-
import process1D from '../nmriumMode/process1D';
|
|
3
|
+
import { NMRiumWorkspaces } from '../NMRium';
|
|
7
4
|
import { getLocalStorage, removeData, storeData, } from '../utility/LocalStorage';
|
|
5
|
+
import workspaces from '../workspaces';
|
|
8
6
|
export const INIT_PREFERENCES = 'INIT_PREFERENCES';
|
|
9
7
|
export const SET_PREFERENCES = 'SET_PREFERENCES';
|
|
8
|
+
export const RESET_PREFERENCES = 'RESET_PREFERENCES';
|
|
10
9
|
export const SET_PANELS_PREFERENCES = 'SET_PANELS_PREFERENCES';
|
|
11
|
-
const
|
|
12
|
-
function
|
|
13
|
-
switch (
|
|
14
|
-
case
|
|
15
|
-
return exercise1D;
|
|
16
|
-
case
|
|
17
|
-
return process1D;
|
|
10
|
+
const LOCAL_STORAGE_VERSION = 3;
|
|
11
|
+
function getPreferencesByWorkspace(workspace) {
|
|
12
|
+
switch (workspace) {
|
|
13
|
+
case NMRiumWorkspaces.EXERCISE_1D:
|
|
14
|
+
return workspaces.exercise1D;
|
|
15
|
+
case NMRiumWorkspaces.PROCESS_1D:
|
|
16
|
+
return workspaces.process1D;
|
|
18
17
|
default:
|
|
19
|
-
return basic;
|
|
18
|
+
return workspaces.basic;
|
|
20
19
|
}
|
|
21
20
|
}
|
|
22
21
|
export const preferencesInitialState = {
|
|
23
22
|
basePreferences: {},
|
|
24
|
-
display: basic,
|
|
23
|
+
display: workspaces.basic.display,
|
|
25
24
|
controllers: {
|
|
26
|
-
mws: { low: 2, high: 20 },
|
|
27
25
|
dimmedSpectraTransparency: 0.1,
|
|
28
26
|
},
|
|
29
27
|
formatting: {
|
|
@@ -39,7 +37,15 @@ export const preferencesInitialState = {
|
|
|
39
37
|
panels: {},
|
|
40
38
|
},
|
|
41
39
|
dispatch: null,
|
|
40
|
+
workspace: 'default',
|
|
42
41
|
};
|
|
42
|
+
function getTruthyObjectValues(data) {
|
|
43
|
+
return JSON.parse(JSON.stringify(data), (key, value) => {
|
|
44
|
+
if (value) {
|
|
45
|
+
return value;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
}
|
|
43
49
|
function mapNucleus(draft) {
|
|
44
50
|
if (draft.formatting.nucleus && Array.isArray(draft.formatting.nucleus)) {
|
|
45
51
|
draft.formatting.nucleusByKey = draft.formatting.nucleus.reduce((acc, item) => {
|
|
@@ -50,51 +56,93 @@ function mapNucleus(draft) {
|
|
|
50
56
|
}
|
|
51
57
|
function handleInit(draft, action) {
|
|
52
58
|
const nmrLocalStorageVersion = getLocalStorage('nmr-local-storage-version', false);
|
|
53
|
-
|
|
54
|
-
|
|
59
|
+
let localData = getLocalStorage('nmr-general-settings');
|
|
60
|
+
// remove old nmr-local-storage-version key
|
|
61
|
+
if (nmrLocalStorageVersion && localData?.version) {
|
|
62
|
+
removeData('nmr-local-storage-version');
|
|
63
|
+
}
|
|
64
|
+
if (!localData?.version || localData?.version !== LOCAL_STORAGE_VERSION) {
|
|
55
65
|
removeData('nmr-general-settings');
|
|
56
|
-
storeData('nmr-local-storage-version', LOCAL_STORGAE_VERSION);
|
|
57
66
|
}
|
|
58
|
-
const localData = getLocalStorage('nmr-general-settings');
|
|
59
67
|
if (action.payload) {
|
|
60
|
-
const { dispatch,
|
|
61
|
-
draft.
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
const { dispatch, workspace, ...resProps } = action.payload;
|
|
69
|
+
draft.workspace = workspace;
|
|
70
|
+
const workspacePreferences = getPreferencesByWorkspace(workspace);
|
|
71
|
+
if (!localData ||
|
|
72
|
+
!localData?.workspaces[workspace] ||
|
|
73
|
+
workspacePreferences.version !== localData?.workspaces[workspace]?.version) {
|
|
74
|
+
localData = localData || {};
|
|
75
|
+
localData = {
|
|
76
|
+
version: LOCAL_STORAGE_VERSION,
|
|
77
|
+
workspaces: {
|
|
78
|
+
...localData.workspaces,
|
|
79
|
+
[workspace]: {
|
|
80
|
+
...workspacePreferences,
|
|
81
|
+
controllers: draft.controllers,
|
|
82
|
+
formatting: draft.formatting,
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
};
|
|
86
|
+
storeData('nmr-general-settings', JSON.stringify(localData));
|
|
87
|
+
}
|
|
88
|
+
draft.basePreferences = lodashMerge({}, workspacePreferences, resProps);
|
|
89
|
+
const hiddenModeFeatures = getTruthyObjectValues(draft.basePreferences.display);
|
|
90
|
+
let hiddenLocalStorageFeatures = {};
|
|
70
91
|
draft.dispatch = dispatch;
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
92
|
+
const localStorageModePreferences = localData?.workspaces[workspace] || null;
|
|
93
|
+
if (localStorageModePreferences) {
|
|
94
|
+
Object.entries(localStorageModePreferences).forEach(([k, v]) => {
|
|
95
|
+
if (k === 'display') {
|
|
96
|
+
hiddenLocalStorageFeatures = getTruthyObjectValues(v);
|
|
97
|
+
}
|
|
98
|
+
else if (!['dispatch', 'basePreferences'].includes(k)) {
|
|
74
99
|
draft[k] = lodashMerge({}, resProps[k] ? resProps[k] : {}, v);
|
|
75
100
|
}
|
|
76
101
|
});
|
|
77
102
|
mapNucleus(draft);
|
|
78
103
|
}
|
|
104
|
+
draft.display = lodashMerge({}, getPreferencesByWorkspace(NMRiumWorkspaces.DEFAULT).display, hiddenModeFeatures, hiddenLocalStorageFeatures);
|
|
79
105
|
}
|
|
80
106
|
}
|
|
81
107
|
function handleSetPreferences(draft, action) {
|
|
82
108
|
if (action.payload) {
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
109
|
+
const { controllers, formatting, display } = action.payload;
|
|
110
|
+
let localData = getLocalStorage('nmr-general-settings');
|
|
111
|
+
localData.workspaces = {
|
|
112
|
+
...localData.workspaces,
|
|
113
|
+
[draft.workspace]: {
|
|
114
|
+
...localData.workspaces[draft.workspace],
|
|
115
|
+
controllers,
|
|
116
|
+
formatting,
|
|
117
|
+
display,
|
|
118
|
+
},
|
|
119
|
+
};
|
|
120
|
+
storeData('nmr-general-settings', JSON.stringify(localData));
|
|
121
|
+
draft.controllers = controllers;
|
|
122
|
+
draft.formatting = formatting;
|
|
123
|
+
draft.display.panels = display.panels;
|
|
124
|
+
draft.display.general.hideExperimentalFeatures =
|
|
125
|
+
display.general.hideExperimentalFeatures;
|
|
89
126
|
mapNucleus(draft);
|
|
90
127
|
}
|
|
91
128
|
}
|
|
92
129
|
function handleSetPanelsPreferences(draft, action) {
|
|
93
130
|
if (action.payload) {
|
|
94
131
|
const { key, value } = action.payload;
|
|
132
|
+
let localData = getLocalStorage('nmr-general-settings');
|
|
133
|
+
localData.workspaces[draft.workspace].formatting.panels[key] = value;
|
|
134
|
+
storeData('nmr-general-settings', JSON.stringify(localData));
|
|
95
135
|
draft.formatting.panels[key] = value;
|
|
96
136
|
}
|
|
97
137
|
}
|
|
138
|
+
function handleResetPreferences(draft) {
|
|
139
|
+
let localData = getLocalStorage('nmr-general-settings');
|
|
140
|
+
const hiddenFeatures = getTruthyObjectValues(draft.basePreferences.display);
|
|
141
|
+
const workSpaceDisplayPreferences = lodashMerge({}, getPreferencesByWorkspace(draft.workspace).display, hiddenFeatures);
|
|
142
|
+
localData.workspaces[draft.workspace].display = workSpaceDisplayPreferences;
|
|
143
|
+
draft.display = workSpaceDisplayPreferences;
|
|
144
|
+
storeData('nmr-general-settings', JSON.stringify(localData));
|
|
145
|
+
}
|
|
98
146
|
function innerPreferencesReducer(draft, action) {
|
|
99
147
|
switch (action.type) {
|
|
100
148
|
case INIT_PREFERENCES:
|
|
@@ -103,6 +151,8 @@ function innerPreferencesReducer(draft, action) {
|
|
|
103
151
|
return handleSetPreferences(draft, action);
|
|
104
152
|
case SET_PANELS_PREFERENCES:
|
|
105
153
|
return handleSetPanelsPreferences(draft, action);
|
|
154
|
+
case RESET_PREFERENCES:
|
|
155
|
+
return handleResetPreferences(draft);
|
|
106
156
|
default:
|
|
107
157
|
return draft;
|
|
108
158
|
}
|
|
@@ -27,7 +27,7 @@ export declare const CHANGE_SPECTRUM_COLOR = "CHANGE_SPECTRUM_COLOR";
|
|
|
27
27
|
export declare const ADD_INTEGRAL = "ADD_INTEGRAL";
|
|
28
28
|
export declare const DELETE_INTEGRAL = "DELETE_INTEGRAL";
|
|
29
29
|
export declare const TOGGLE_REAL_IMAGINARY_VISIBILITY = "TOGGLE_REAL_IMAGINARY_VISIBILITY";
|
|
30
|
-
export declare const
|
|
30
|
+
export declare const SET_ZOOM = "SET_ZOOM";
|
|
31
31
|
export declare const ADD_MOLECULE = "ADD_MOLECULE";
|
|
32
32
|
export declare const SET_MOLECULE = "SET_MOLECULE";
|
|
33
33
|
export declare const DELETE_MOLECULE = "DELETE_MOLECULE";
|
|
@@ -76,6 +76,7 @@ export declare const SET_2D_LEVEL = "SET_2D_LEVEL";
|
|
|
76
76
|
export declare const ADD_2D_ZONE = "ADD_2D_ZONE";
|
|
77
77
|
export declare const DELETE_2D_ZONE = "DELETE_2D_ZONE";
|
|
78
78
|
export declare const DELETE_2D_SIGNAL = "DELETE_2D_SIGNAL";
|
|
79
|
+
export declare const SET_2D_SIGNAL_PATH_LENGTH = "SET_2D_SIGNAL_PATH_LENGTH";
|
|
79
80
|
export declare const ADD_MISSING_PROJECTION = "ADD_MISSING_PROJECTION";
|
|
80
81
|
export declare const SET_FILTER_SNAPSHOT = "SET_FILTER_SNAPSHOT";
|
|
81
82
|
export declare const CHANGE_RANGE_RELATIVE = "CHANGE_RANGE_RELATIVE";
|
|
@@ -93,6 +94,7 @@ export declare const FILTER_SPECTRA_COLUMN = "FILTER_SPECTRA_COLUMN";
|
|
|
93
94
|
export declare const ALIGN_SPECTRA = "ALIGN_SPECTRA";
|
|
94
95
|
export declare const CHANGE_ZONE_SIGNAL_VALUE = "CHANGE_ZONE_SIGNAL_VALUE";
|
|
95
96
|
export declare const CHANGE_ZONE_SIGNAL_KIND = "CHANGE_ZONE_SIGNAL_KIND";
|
|
97
|
+
export declare const SAVE_EDITED_ZONE = "SAVE_EDITED_ZONE";
|
|
96
98
|
export declare const UNLINK_ZONE = "UNLINK_ZONE";
|
|
97
99
|
export declare const SET_DIAID_ZONE = "SET_DIAID_ZONE";
|
|
98
100
|
export declare const PREDICT_SPECTRA = "PREDICT_SPECTRA";
|
|
@@ -27,7 +27,7 @@ export const CHANGE_SPECTRUM_COLOR = 'CHANGE_SPECTRUM_COLOR';
|
|
|
27
27
|
export const ADD_INTEGRAL = 'ADD_INTEGRAL';
|
|
28
28
|
export const DELETE_INTEGRAL = 'DELETE_INTEGRAL';
|
|
29
29
|
export const TOGGLE_REAL_IMAGINARY_VISIBILITY = 'TOGGLE_REAL_IMAGINARY_VISIBILITY';
|
|
30
|
-
export const
|
|
30
|
+
export const SET_ZOOM = 'SET_ZOOM';
|
|
31
31
|
export const ADD_MOLECULE = 'ADD_MOLECULE';
|
|
32
32
|
export const SET_MOLECULE = 'SET_MOLECULE';
|
|
33
33
|
export const DELETE_MOLECULE = 'DELETE_MOLECULE';
|
|
@@ -76,6 +76,7 @@ export const SET_2D_LEVEL = 'SET_2D_LEVEL';
|
|
|
76
76
|
export const ADD_2D_ZONE = 'ADD_2D_ZONE';
|
|
77
77
|
export const DELETE_2D_ZONE = 'DELETE_2D_ZONE';
|
|
78
78
|
export const DELETE_2D_SIGNAL = 'DELETE_2D_SIGNAL';
|
|
79
|
+
export const SET_2D_SIGNAL_PATH_LENGTH = 'SET_2D_SIGNAL_PATH_LENGTH';
|
|
79
80
|
export const ADD_MISSING_PROJECTION = 'ADD_MISSING_PROJECTION';
|
|
80
81
|
export const SET_FILTER_SNAPSHOT = 'SET_FILTER_SNAPSHOT';
|
|
81
82
|
export const CHANGE_RANGE_RELATIVE = 'CHANGE_RANGE_RELATIVE';
|
|
@@ -93,6 +94,7 @@ export const FILTER_SPECTRA_COLUMN = 'FILTER_SPECTRA_COLUMN';
|
|
|
93
94
|
export const ALIGN_SPECTRA = 'ALIGN_SPECTRA';
|
|
94
95
|
export const CHANGE_ZONE_SIGNAL_VALUE = 'CHANGE_ZONE_SIGNAL_VALUE';
|
|
95
96
|
export const CHANGE_ZONE_SIGNAL_KIND = 'CHANGE_ZONE_SIGNAL_KIND';
|
|
97
|
+
export const SAVE_EDITED_ZONE = 'SAVE_EDITED_ZONE';
|
|
96
98
|
export const UNLINK_ZONE = 'UNLINK_ZONE';
|
|
97
99
|
export const SET_DIAID_ZONE = 'SET_DIAID_ZONE';
|
|
98
100
|
export const PREDICT_SPECTRA = 'PREDICT_SPECTRA';
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { Toolbar } from 'analysis-ui-components';
|
|
3
3
|
import { SvgNmrBaselineCorrection, SvgNmrFourierTransform, SvgNmrIntegrate, SvgNmrMultipleAnalysis, SvgNmrPeakPicking, SvgNmrPhaseCorrection, SvgNmrRangePicking, SvgNmrZeroFilling, } from 'cheminfo-font';
|
|
4
|
-
import lodashGet from 'lodash/get';
|
|
5
4
|
import { useState, useEffect, useCallback, memo } from 'react';
|
|
6
5
|
import { FaSearchPlus, FaExpand, FaDiceFour } from 'react-icons/fa';
|
|
7
6
|
import * as Filters from '../../data/Filters';
|
|
8
7
|
import { useChartData } from '../context/ChartContext';
|
|
9
8
|
import { useDispatch } from '../context/DispatchContext';
|
|
10
|
-
import { usePreferences } from '../context/PreferencesContext';
|
|
11
9
|
import ToggleButton from '../elements/toggle/ToggleButton';
|
|
12
10
|
import ToggleButtonGroup from '../elements/toggle/ToggleButtonGroup';
|
|
11
|
+
import { useCheckToolsVisibility } from '../hooks/useCheckToolsVisibility';
|
|
13
12
|
import useDatumWithSpectraStatistics from '../hooks/useDatumWithSpectraStatistics';
|
|
14
13
|
import useToolsFunctions from '../hooks/useToolsFunctions';
|
|
15
14
|
import { DISPLAYER_MODE } from '../reducer/core/Constants';
|
|
@@ -17,7 +16,7 @@ import { APPLY_FFT_FILTER, SET_SELECTED_FILTER } from '../reducer/types/Types';
|
|
|
17
16
|
import { options } from './ToolTypes';
|
|
18
17
|
function FunctionToolBarInner({ defaultValue, activeSpectrum, info, datum, displayerMode, ftCounter, mode, }) {
|
|
19
18
|
const [option, setOption] = useState('');
|
|
20
|
-
const
|
|
19
|
+
const isButtonVisible = useCheckToolsVisibility();
|
|
21
20
|
const dispatch = useDispatch();
|
|
22
21
|
const { handleChangeOption, handleFullZoomOut } = useToolsFunctions();
|
|
23
22
|
const handleChange = useCallback((selectedOption) => {
|
|
@@ -34,25 +33,23 @@ function FunctionToolBarInner({ defaultValue, activeSpectrum, info, datum, displ
|
|
|
34
33
|
});
|
|
35
34
|
dispatch({ type: SET_SELECTED_FILTER, selectedFilter: null });
|
|
36
35
|
}, [dispatch]);
|
|
37
|
-
const isButtonVisible = useCallback((toolKey) => {
|
|
38
|
-
return !lodashGet(preferences, `display.toolBarButtons.${toolKey}`);
|
|
39
|
-
}, [preferences]);
|
|
40
36
|
return (_jsxs(_Fragment, { children: [_jsxs(ToggleButtonGroup, { value: option, onChange: handleChange, children: [isButtonVisible('hideZoomTool') && (_jsx(ToggleButton, { value: options.zoom.id, id: "zoomIn", title: `${options.zoom.label} ( Press z )`, children: _jsx("div", { style: { fontSize: 14 }, children: _jsx(FaSearchPlus, {}, void 0) }, void 0) }, options.zoom.id)), isButtonVisible('hideZoomOutTool') && (_jsx(Toolbar.Item, { id: "zoom-out", onClick: handleFullZoomOut, title: "Horizontal zoom out ( Press f ), Horizontal and Vertical zoom out, double click ( Press ff )", children: _jsx("div", { style: { fontSize: 14 }, children: _jsx(FaExpand, {}, void 0) }, void 0) }, void 0)), displayerMode === DISPLAYER_MODE.DM_1D &&
|
|
41
37
|
isButtonVisible('hidePeakTool') && (_jsx(ToggleButton, { value: options.peakPicking.id, title: `${options.peakPicking.label} ( Press p )`, isVisible: activeSpectrum && !info?.isFid ? true : false, id: "peakPicking", children: _jsx(SvgNmrPeakPicking, {}, void 0) }, options.peakPicking.id)), displayerMode === DISPLAYER_MODE.DM_1D &&
|
|
42
38
|
isButtonVisible('hideIntegralTool') && (_jsx(ToggleButton, { value: options.integral.id, isVisible: activeSpectrum && !info?.isFid ? true : false, id: "integralPicking", title: `${options.integral.label} ( Press i )`, children: _jsx(SvgNmrIntegrate, {}, void 0) }, options.integral.id)), displayerMode === DISPLAYER_MODE.DM_2D &&
|
|
43
|
-
isButtonVisible('
|
|
44
|
-
isButtonVisible('
|
|
39
|
+
isButtonVisible('hideZonePickingTool') && (_jsx(ToggleButton, { value: options.zone2D.id, id: "zone2d", isVisible: activeSpectrum && !info?.isFid ? true : false, title: `${options.zone2D.label} ( Press r )`, children: _jsx(FaDiceFour, {}, void 0) }, options.zone2D.id)), displayerMode === DISPLAYER_MODE.DM_2D &&
|
|
40
|
+
isButtonVisible('hideSlicingTool') && (_jsx(ToggleButton, { value: options.slicingTool.id, isVisible: activeSpectrum && !info?.isFid ? true : false, id: "slic", title: `${options.slicingTool.label}`, children: _jsx("p", { children: "Slic" }, void 0) }, options.slicingTool.id)), displayerMode === DISPLAYER_MODE.DM_1D &&
|
|
41
|
+
isButtonVisible('hideAutoRangesTool') && (_jsx(ToggleButton, { value: options.rangesPicking.id, isVisible: activeSpectrum && !info?.isFid ? true : false, title: `${options.rangesPicking.label} ( Press r )`, id: "ranges-pick", children: _jsx(SvgNmrRangePicking, {}, void 0) }, options.rangesPicking.id)), displayerMode === DISPLAYER_MODE.DM_1D &&
|
|
45
42
|
isButtonVisible('hideMultipleSpectraAnalysisTool') &&
|
|
46
43
|
ftCounter > 1 &&
|
|
47
44
|
mode === 'RTL' && (_jsx(ToggleButton, { value: options.multipleSpectraAnalysis.id, id: "multipleSpectraAnalysis", title: options.multipleSpectraAnalysis.label, children: _jsx(SvgNmrMultipleAnalysis, {}, void 0) }, options.multipleSpectraAnalysis.id)), displayerMode === DISPLAYER_MODE.DM_1D &&
|
|
48
45
|
isButtonVisible('hideZeroFillingTool') && (_jsx(ToggleButton, { value: options.zeroFilling.id, isVisible: Filters.zeroFilling.isApplicable({ info }), id: "zeroFilling", title: options.zeroFilling.label, children: _jsx(SvgNmrZeroFilling, {}, void 0) }, options.zeroFilling.id)), displayerMode === DISPLAYER_MODE.DM_1D &&
|
|
49
|
-
isButtonVisible('hidePhaseCorrectionTool') && (_jsx(ToggleButton, { value: options.phaseCorrection.id, id: "phaseCorrection", title: options.phaseCorrection.label
|
|
46
|
+
isButtonVisible('hidePhaseCorrectionTool') && (_jsx(ToggleButton, { value: options.phaseCorrection.id, id: "phaseCorrection", title: `${options.phaseCorrection.label} ( Press a )`, isVisible: activeSpectrum &&
|
|
50
47
|
info &&
|
|
51
48
|
Filters.phaseCorrection.isApplicable({ info }) &&
|
|
52
49
|
datum.im
|
|
53
50
|
? true
|
|
54
51
|
: false, children: _jsx(SvgNmrPhaseCorrection, {}, void 0) }, options.phaseCorrection.id)), displayerMode === DISPLAYER_MODE.DM_1D &&
|
|
55
|
-
isButtonVisible('hideBaseLineCorrectionTool') && (_jsx(ToggleButton, { value: options.baseLineCorrection.id, id: "baseLineCorrection", title: options.baseLineCorrection.label
|
|
52
|
+
isButtonVisible('hideBaseLineCorrectionTool') && (_jsx(ToggleButton, { value: options.baseLineCorrection.id, id: "baseLineCorrection", title: `${options.baseLineCorrection.label} ( Press b )`, isVisible: activeSpectrum &&
|
|
56
53
|
info &&
|
|
57
54
|
Filters.baselineCorrection.isApplicable({ info })
|
|
58
55
|
? true
|
|
@@ -44,7 +44,7 @@ export const options = {
|
|
|
44
44
|
},
|
|
45
45
|
rangesPicking: {
|
|
46
46
|
id: 'rangesPicking',
|
|
47
|
-
label: 'Ranges Picking
|
|
47
|
+
label: 'Ranges Picking',
|
|
48
48
|
hasOptionPanel: true,
|
|
49
49
|
isFilter: false,
|
|
50
50
|
},
|
|
@@ -56,13 +56,13 @@ export const options = {
|
|
|
56
56
|
},
|
|
57
57
|
phaseCorrection: {
|
|
58
58
|
id: Filters.phaseCorrection.id,
|
|
59
|
-
label:
|
|
59
|
+
label: Filters.phaseCorrection.name,
|
|
60
60
|
hasOptionPanel: true,
|
|
61
61
|
isFilter: true,
|
|
62
62
|
},
|
|
63
63
|
baseLineCorrection: {
|
|
64
64
|
id: 'baseLineCorrection',
|
|
65
|
-
label: 'baseline correction
|
|
65
|
+
label: 'baseline correction',
|
|
66
66
|
hasOptionPanel: true,
|
|
67
67
|
isFilter: true,
|
|
68
68
|
},
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export const basic = {
|
|
2
|
+
version: 1,
|
|
3
|
+
label: 'Default Mode',
|
|
4
|
+
display: {
|
|
5
|
+
general: {
|
|
6
|
+
disableMultipletAnalysis: false,
|
|
7
|
+
hideSetSumFromMolecule: false,
|
|
8
|
+
hideGeneralSettings: false,
|
|
9
|
+
hideExperimentalFeatures: false,
|
|
10
|
+
},
|
|
11
|
+
panels: {
|
|
12
|
+
hideSpectraPanel: false,
|
|
13
|
+
hideInformationPanel: false,
|
|
14
|
+
hidePeaksPanel: false,
|
|
15
|
+
hideIntegralsPanel: false,
|
|
16
|
+
hideRangesPanel: false,
|
|
17
|
+
hideStructuresPanel: false,
|
|
18
|
+
hideFiltersPanel: false,
|
|
19
|
+
hideZonesPanel: false,
|
|
20
|
+
hideSummaryPanel: false,
|
|
21
|
+
hideMultipleSpectraAnalysisPanel: false,
|
|
22
|
+
hideDatabasePanel: false,
|
|
23
|
+
},
|
|
24
|
+
toolBarButtons: {
|
|
25
|
+
hideZoomTool: false,
|
|
26
|
+
hideZoomOutTool: false,
|
|
27
|
+
hideImport: false,
|
|
28
|
+
hideExportAs: false,
|
|
29
|
+
hideSpectraStackAlignments: false,
|
|
30
|
+
hideSpectraCenterAlignments: false,
|
|
31
|
+
hideRealImaginary: false,
|
|
32
|
+
hidePeakTool: false,
|
|
33
|
+
hideIntegralTool: false,
|
|
34
|
+
hideZonePickingTool: false,
|
|
35
|
+
hideSlicingTool: false,
|
|
36
|
+
hideAutoRangesTool: false,
|
|
37
|
+
hideZeroFillingTool: false,
|
|
38
|
+
hidePhaseCorrectionTool: false,
|
|
39
|
+
hideBaseLineCorrectionTool: false,
|
|
40
|
+
hideFFTTool: false,
|
|
41
|
+
hideMultipleSpectraAnalysisTool: false,
|
|
42
|
+
hideExclusionZonesTool: false,
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
};
|