nmrium 0.19.1 → 0.21.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/Chart1D.js +3 -3
- package/lib/component/1d/ExclusionZoneAnnotation.d.ts +11 -0
- package/lib/component/1d/ExclusionZoneAnnotation.js +18 -0
- package/lib/component/1d/ExclusionZonesAnnotations.d.ts +3 -0
- package/lib/component/1d/ExclusionZonesAnnotations.js +28 -0
- package/lib/component/1d/Line.js +11 -23
- package/lib/component/1d/Viewer1D.js +36 -5
- package/lib/component/1d/ranges/Ranges.js +3 -3
- package/lib/component/1d/{BaseLineZones.d.ts → tool/BaseLineZones.d.ts} +0 -0
- package/lib/component/1d/{BaseLineZones.js → tool/BaseLineZones.js} +5 -5
- package/lib/component/1d/utilities/useIntegralPath.js +9 -10
- package/lib/component/2d/Contours.js +12 -11
- package/lib/component/2d/Left1DChart.js +7 -9
- package/lib/component/2d/Top1DChart.js +7 -7
- package/lib/component/2d/tools/slicing/HorizontalSliceChart.js +7 -7
- package/lib/component/2d/tools/slicing/VerticalSliceChart.js +7 -9
- package/lib/component/EventsTrackers/BrushTracker.js +2 -2
- package/lib/component/EventsTrackers/KeysListenerTracker.js +106 -80
- package/lib/component/NMRium.d.ts +8 -3
- package/lib/component/NMRium.js +36 -33
- package/lib/component/elements/NumberInput.d.ts +1 -2
- package/lib/component/elements/Tab/Tab.js +1 -0
- package/lib/component/header/Header.js +10 -3
- package/lib/component/hooks/useActiveSpectrumStyleOptions.d.ts +6 -0
- package/lib/component/hooks/useActiveSpectrumStyleOptions.js +15 -0
- 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/hooks/useToolsFunctions.js +2 -1
- package/lib/component/hooks/useXYReduce.d.ts +2 -1
- package/lib/component/loader/DropZone.js +88 -88
- package/lib/component/modal/ModalStyle.js +5 -2
- package/lib/component/modal/MoleculeStructureEditorModal.js +3 -2
- package/lib/component/modal/MultipleSpectraFiltersModal/index.js +10 -1
- package/lib/component/modal/changeSum/ChangeSumModal.js +4 -2
- package/lib/component/modal/setting/DisplayTabContent.js +1 -1
- package/lib/component/modal/setting/GeneralSettings.js +1 -5
- package/lib/component/panels/IntegralsPanel/IntegralPanel.js +0 -3
- package/lib/component/panels/IntegralsPanel/IntegralsPreferences.js +4 -17
- package/lib/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.d.ts +2 -0
- package/lib/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +35 -0
- package/lib/component/panels/MoleculesPanel/MoleculePanel.js +49 -67
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +3 -8
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +2 -23
- package/lib/component/panels/Panels.js +10 -0
- 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 +0 -3
- package/lib/component/panels/RangesPanel/RangesPreferences.js +5 -18
- package/lib/component/panels/SpectrumsPanel/SpectraPanelHeader.js +13 -3
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum2DHistogram.js +1 -1
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.d.ts +5 -5
- package/lib/component/panels/SummaryPanel/SummaryPanel.js +1 -1
- package/lib/component/panels/SummaryPanel/Utilities.d.ts +7 -7
- package/lib/component/panels/ZonesPanel/ZonesPanel.js +0 -3
- package/lib/component/panels/ZonesPanel/ZonesPreferences.js +5 -18
- package/lib/component/panels/ZonesPanel/ZonesTable.js +9 -2
- package/lib/component/panels/databasePanel/DatabasePanel.js +0 -3
- package/lib/component/panels/databasePanel/DatabasePreferences.js +4 -17
- package/lib/component/reducer/Reducer.d.ts +11 -27
- package/lib/component/reducer/Reducer.js +4 -5
- package/lib/component/reducer/actions/CorrelationsActions.d.ts +7 -7
- package/lib/component/reducer/actions/CorrelationsActions.js +1 -1
- package/lib/component/reducer/actions/FiltersActions.d.ts +3 -1
- package/lib/component/reducer/actions/FiltersActions.js +60 -18
- package/lib/component/reducer/actions/LoadActions.js +2 -3
- package/lib/component/reducer/actions/MoleculeActions.js +2 -2
- package/lib/component/reducer/actions/PreferencesActions.js +4 -7
- package/lib/component/reducer/actions/RangesActions.js +1 -1
- package/lib/component/reducer/actions/ToolsActions.d.ts +1 -3
- package/lib/component/reducer/actions/ToolsActions.js +13 -59
- package/lib/component/reducer/helper/ZoomHistoryManager.d.ts +1 -0
- package/lib/component/reducer/helper/ZoomHistoryManager.js +2 -1
- package/lib/component/reducer/helper/getRange.d.ts +6 -1
- package/lib/component/reducer/helper/getRange.js +1 -1
- package/lib/component/reducer/preferencesReducer.d.ts +2 -0
- package/lib/component/reducer/preferencesReducer.js +76 -36
- package/lib/component/toolbar/FunctionToolBar.js +9 -15
- package/lib/component/toolbar/ToolTypes.js +3 -3
- package/lib/component/utility/PathBuilder.d.ts +7 -0
- package/lib/component/utility/PathBuilder.js +17 -0
- package/lib/component/utility/getSpectraByNucleus.d.ts +3 -0
- package/lib/component/utility/getSpectraByNucleus.js +4 -0
- 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/Filters.d.ts +2 -1
- package/lib/data/Filters.js +2 -1
- package/lib/data/data1d/Spectrum1D/ranges/addRange.js +5 -2
- package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.js +6 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectRange.js +0 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectSignal.d.ts +3 -2
- package/lib/data/data1d/Spectrum1D/ranges/detectSignal.js +23 -15
- package/lib/data/data1d/filter1d/exclusionZones.d.ts +16 -0
- package/lib/data/data1d/filter1d/exclusionZones.js +28 -0
- package/lib/data/migration/MigrationManager.js +3 -0
- package/lib/data/types/data1d/ExclusionZone.d.ts +5 -0
- package/lib/data/types/data1d/ExclusionZone.js +1 -0
- package/lib/versionInfo.js +1 -1
- package/lib-cjs/component/1d/Chart1D.js +3 -3
- package/lib-cjs/component/1d/ExclusionZoneAnnotation.js +23 -0
- package/lib-cjs/component/1d/ExclusionZonesAnnotations.js +52 -0
- package/lib-cjs/component/1d/Line.js +11 -23
- package/lib-cjs/component/1d/Viewer1D.js +36 -5
- package/lib-cjs/component/1d/ranges/Ranges.js +1 -1
- package/lib-cjs/component/1d/{BaseLineZones.js → tool/BaseLineZones.js} +5 -5
- package/lib-cjs/component/1d/utilities/useIntegralPath.js +9 -10
- package/lib-cjs/component/2d/Contours.js +12 -11
- package/lib-cjs/component/2d/Left1DChart.js +7 -9
- package/lib-cjs/component/2d/Top1DChart.js +7 -7
- package/lib-cjs/component/2d/tools/slicing/HorizontalSliceChart.js +7 -7
- package/lib-cjs/component/2d/tools/slicing/VerticalSliceChart.js +7 -9
- package/lib-cjs/component/EventsTrackers/BrushTracker.js +2 -2
- package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +106 -80
- package/lib-cjs/component/NMRium.js +37 -34
- package/lib-cjs/component/elements/Tab/Tab.js +1 -0
- package/lib-cjs/component/header/Header.js +10 -3
- package/lib-cjs/component/hooks/useActiveSpectrumStyleOptions.js +21 -0
- package/lib-cjs/component/hooks/useCheckExperimentalFeature.js +5 -1
- package/lib-cjs/component/hooks/useCheckToolsVisibility.js +13 -0
- package/lib-cjs/component/hooks/useToolsFunctions.js +2 -1
- package/lib-cjs/component/loader/DropZone.js +88 -88
- package/lib-cjs/component/modal/ModalStyle.js +5 -2
- package/lib-cjs/component/modal/MoleculeStructureEditorModal.js +3 -2
- package/lib-cjs/component/modal/MultipleSpectraFiltersModal/index.js +10 -1
- package/lib-cjs/component/modal/changeSum/ChangeSumModal.js +4 -2
- package/lib-cjs/component/modal/setting/DisplayTabContent.js +1 -1
- package/lib-cjs/component/modal/setting/GeneralSettings.js +1 -5
- 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/MatrixGenerationPanel/MatrixGenerationPanel.js +40 -0
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanel.js +48 -66
- package/lib-cjs/component/panels/MoleculesPanel/useAtomAssignment.js +3 -8
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +1 -22
- package/lib-cjs/component/panels/Panels.js +10 -0
- 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 +0 -3
- 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/SpectrumsPanel/base/setting/Spectrum2DHistogram.js +1 -1
- package/lib-cjs/component/panels/ZonesPanel/ZonesPanel.js +0 -3
- package/lib-cjs/component/panels/ZonesPanel/ZonesPreferences.js +4 -17
- package/lib-cjs/component/panels/ZonesPanel/ZonesTable.js +8 -1
- 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/Reducer.js +4 -5
- package/lib-cjs/component/reducer/actions/FiltersActions.js +62 -18
- package/lib-cjs/component/reducer/actions/LoadActions.js +2 -3
- package/lib-cjs/component/reducer/actions/MoleculeActions.js +2 -2
- package/lib-cjs/component/reducer/actions/PreferencesActions.js +4 -7
- package/lib-cjs/component/reducer/actions/RangesActions.js +1 -1
- package/lib-cjs/component/reducer/actions/ToolsActions.js +13 -61
- package/lib-cjs/component/reducer/helper/ZoomHistoryManager.js +2 -1
- package/lib-cjs/component/reducer/helper/getRange.js +1 -1
- package/lib-cjs/component/reducer/preferencesReducer.js +75 -35
- package/lib-cjs/component/toolbar/FunctionToolBar.js +9 -15
- package/lib-cjs/component/toolbar/ToolTypes.js +3 -3
- package/lib-cjs/component/utility/PathBuilder.js +21 -0
- package/lib-cjs/component/utility/getSpectraByNucleus.js +11 -0
- 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/Filters.js +3 -1
- package/lib-cjs/data/data1d/Spectrum1D/ranges/addRange.js +5 -2
- package/lib-cjs/data/data1d/Spectrum1D/ranges/autoRangesDetection.js +6 -1
- package/lib-cjs/data/data1d/Spectrum1D/ranges/detectRange.js +0 -1
- package/lib-cjs/data/data1d/Spectrum1D/ranges/detectSignal.js +24 -15
- package/lib-cjs/data/data1d/filter1d/exclusionZones.js +34 -0
- package/lib-cjs/data/migration/MigrationManager.js +3 -0
- package/lib-cjs/data/types/data1d/ExclusionZone.js +2 -0
- package/lib-cjs/versionInfo.js +1 -1
- package/package.json +28 -29
- package/lib/component/1d/ExclusionZone.d.ts +0 -8
- package/lib/component/1d/ExclusionZone.js +0 -30
- package/lib/component/1d/ExclusionZones.d.ts +0 -2
- package/lib/component/1d/ExclusionZones.js +0 -10
- 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-cjs/component/1d/ExclusionZone.js +0 -32
- package/lib-cjs/component/1d/ExclusionZones.js +0 -16
- 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
|
@@ -66,7 +66,6 @@ const formatFields = [
|
|
|
66
66
|
];
|
|
67
67
|
function IntegralsPreferencesInner({ nucleus, preferences, innerRef, }) {
|
|
68
68
|
const alert = (0, Alert_1.useAlert)();
|
|
69
|
-
const [, setSettingsData] = (0, LocalStorage_1.useStateWithLocalStorage)('nmr-general-settings');
|
|
70
69
|
const formRef = (0, react_1.useRef)();
|
|
71
70
|
const updateValues = (0, react_1.useCallback)(() => {
|
|
72
71
|
if (nucleus) {
|
|
@@ -83,31 +82,19 @@ function IntegralsPreferencesInner({ nucleus, preferences, innerRef, }) {
|
|
|
83
82
|
(0, react_1.useEffect)(() => {
|
|
84
83
|
updateValues();
|
|
85
84
|
}, [updateValues]);
|
|
86
|
-
const
|
|
87
|
-
setSettingsData(values, 'formatting.panels.integrals');
|
|
88
|
-
};
|
|
89
|
-
const saveHandler = (0, react_1.useCallback)((values, showMessage = false) => {
|
|
85
|
+
const saveHandler = (0, react_1.useCallback)((values) => {
|
|
90
86
|
preferences.dispatch({
|
|
91
87
|
type: preferencesReducer_1.SET_PANELS_PREFERENCES,
|
|
92
88
|
payload: { key: 'integrals', value: values },
|
|
93
89
|
});
|
|
94
|
-
|
|
95
|
-
alert.success('Integrals preferences saved successfully');
|
|
96
|
-
}
|
|
90
|
+
alert.success('Integrals preferences saved successfully');
|
|
97
91
|
}, [alert, preferences]);
|
|
98
92
|
(0, react_1.useImperativeHandle)(innerRef, () => ({
|
|
99
93
|
saveSetting: () => {
|
|
100
94
|
formRef.current.submitForm();
|
|
101
95
|
},
|
|
102
|
-
cancelSetting: () => {
|
|
103
|
-
updateValues();
|
|
104
|
-
},
|
|
105
96
|
}));
|
|
106
|
-
|
|
107
|
-
saveHandler(values, true);
|
|
108
|
-
saveToLocalStorgate(values);
|
|
109
|
-
};
|
|
110
|
-
return ((0, jsx_runtime_1.jsx)("div", { style: styles.container, children: (0, jsx_runtime_1.jsxs)(FormikForm_1.default, { onSubmit: handleSubmit, ref: formRef, children: [(0, jsx_runtime_1.jsxs)("div", { style: styles.groupContainer, children: [(0, jsx_runtime_1.jsx)("p", { style: styles.header, children: "General" }, void 0), (0, jsx_runtime_1.jsx)(FormikColorInput_1.default, { name: "color" }, void 0), (0, jsx_runtime_1.jsx)(FormikNumberInput_1.default, { name: "strokeWidth", label: "stroke width :", style: {
|
|
97
|
+
return ((0, jsx_runtime_1.jsx)("div", { style: styles.container, children: (0, jsx_runtime_1.jsxs)(FormikForm_1.default, { onSubmit: saveHandler, ref: formRef, children: [(0, jsx_runtime_1.jsxs)("div", { style: styles.groupContainer, children: [(0, jsx_runtime_1.jsx)("p", { style: styles.header, children: "General" }, void 0), (0, jsx_runtime_1.jsx)(FormikColorInput_1.default, { name: "color" }, void 0), (0, jsx_runtime_1.jsx)(FormikNumberInput_1.default, { name: "strokeWidth", label: "stroke width :", style: {
|
|
111
98
|
label: { fontSize: '11px', fontWeight: 'bold', color: '#232323' },
|
|
112
99
|
input: {
|
|
113
100
|
width: '60%',
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
7
|
+
/** @jsxImportSource @emotion/react */
|
|
8
|
+
const cheminfo_font_1 = require("cheminfo-font");
|
|
9
|
+
const react_1 = require("react");
|
|
10
|
+
const DispatchContext_1 = require("../../context/DispatchContext");
|
|
11
|
+
const ButtonToolTip_1 = __importDefault(require("../../elements/ButtonToolTip"));
|
|
12
|
+
const Modal_1 = require("../../elements/popup/Modal");
|
|
13
|
+
const ExportAsMatrixModal_1 = __importDefault(require("../../modal/ExportAsMatrixModal"));
|
|
14
|
+
const MultipleSpectraFiltersModal_1 = __importDefault(require("../../modal/MultipleSpectraFiltersModal"));
|
|
15
|
+
const Types_1 = require("../../reducer/types/Types");
|
|
16
|
+
const BasicPanelStyle_1 = require("../extra/BasicPanelStyle");
|
|
17
|
+
const DefaultPanelHeader_1 = __importDefault(require("../header/DefaultPanelHeader"));
|
|
18
|
+
function MatrixGenerationPanel() {
|
|
19
|
+
const modal = (0, Modal_1.useModal)();
|
|
20
|
+
const dispatch = (0, DispatchContext_1.useDispatch)();
|
|
21
|
+
const openFiltersModal = (0, react_1.useCallback)(() => {
|
|
22
|
+
dispatch({ type: Types_1.RESET_SELECTED_TOOL });
|
|
23
|
+
modal.show((0, jsx_runtime_1.jsx)(MultipleSpectraFiltersModal_1.default, {}, void 0), {
|
|
24
|
+
isBackgroundBlur: false,
|
|
25
|
+
position: Modal_1.positions.TOP_CENTER,
|
|
26
|
+
width: 550,
|
|
27
|
+
height: 250,
|
|
28
|
+
});
|
|
29
|
+
}, [modal, dispatch]);
|
|
30
|
+
const openExportAsMatrixModal = (0, react_1.useCallback)(() => {
|
|
31
|
+
dispatch({ type: Types_1.RESET_SELECTED_TOOL });
|
|
32
|
+
modal.show((0, jsx_runtime_1.jsx)(ExportAsMatrixModal_1.default, {}, void 0), {
|
|
33
|
+
isBackgroundBlur: false,
|
|
34
|
+
position: Modal_1.positions.TOP_CENTER,
|
|
35
|
+
width: 500,
|
|
36
|
+
});
|
|
37
|
+
}, [modal, dispatch]);
|
|
38
|
+
return ((0, jsx_runtime_1.jsxs)("div", { css: BasicPanelStyle_1.tablePanelStyle, children: [(0, jsx_runtime_1.jsxs)(DefaultPanelHeader_1.default, { deleteToolTip: "Delete All Peaks", showSettingButton: true, canDelete: false, children: [(0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "Add Filter", onClick: openFiltersModal, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrAddFilter, { style: { fontSize: '18px' } }, void 0) }, void 0), (0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "Export spectra as a Matrix", onClick: openExportAsMatrixModal, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrExportAsMatrix, {}, void 0) }, void 0)] }, void 0), (0, jsx_runtime_1.jsx)("div", { className: "inner-container" }, void 0)] }, void 0));
|
|
39
|
+
}
|
|
40
|
+
exports.default = MatrixGenerationPanel;
|
|
@@ -20,61 +20,43 @@ const MoleculeStructureEditorModal_1 = __importDefault(require("../../modal/Mole
|
|
|
20
20
|
const Types_1 = require("../../reducer/types/Types");
|
|
21
21
|
const MoleculePanelHeader_1 = __importDefault(require("./MoleculePanelHeader"));
|
|
22
22
|
const useAtomAssignment_1 = __importDefault(require("./useAtomAssignment"));
|
|
23
|
-
const styles =
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
display:
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
`;
|
|
64
|
-
const toolbarStyle = (0, react_1.css) `
|
|
65
|
-
display: flex;
|
|
66
|
-
flex-direction: row;
|
|
67
|
-
border-bottom: 0.55px solid rgb(240, 240, 240);
|
|
68
|
-
padding: 0px 5px;
|
|
69
|
-
|
|
70
|
-
p {
|
|
71
|
-
margin: 0;
|
|
72
|
-
text-align: right;
|
|
73
|
-
width: 100%;
|
|
74
|
-
line-height: 22px;
|
|
75
|
-
padding: 0px 10px;
|
|
76
|
-
}
|
|
77
|
-
`;
|
|
23
|
+
const styles = {
|
|
24
|
+
panel: (0, react_1.css)({
|
|
25
|
+
display: 'flex',
|
|
26
|
+
flexGrow: 1,
|
|
27
|
+
width: '100%',
|
|
28
|
+
height: '100%',
|
|
29
|
+
flexDirection: 'column',
|
|
30
|
+
}),
|
|
31
|
+
molecule: (0, react_1.css)({
|
|
32
|
+
display: 'flex',
|
|
33
|
+
flex: '1 1 0%',
|
|
34
|
+
flexDirection: 'column',
|
|
35
|
+
minHeight: 0,
|
|
36
|
+
}),
|
|
37
|
+
toolbar: (0, react_1.css)({
|
|
38
|
+
display: 'flex',
|
|
39
|
+
borderBottom: '0.55px solid rgb(240, 240, 240)',
|
|
40
|
+
padding: '0px 10px',
|
|
41
|
+
justifyContent: 'end',
|
|
42
|
+
height: 22,
|
|
43
|
+
}),
|
|
44
|
+
slider: (0, react_1.css)({
|
|
45
|
+
display: 'flex',
|
|
46
|
+
flexDirection: 'column',
|
|
47
|
+
justifyContent: 'center',
|
|
48
|
+
alignItems: 'center',
|
|
49
|
+
flexGrow: 1,
|
|
50
|
+
minHeight: 0,
|
|
51
|
+
}),
|
|
52
|
+
items: (0, react_1.css)({
|
|
53
|
+
display: 'flex',
|
|
54
|
+
flexDirection: 'column',
|
|
55
|
+
flex: '1 1 0%',
|
|
56
|
+
height: '100%',
|
|
57
|
+
minHeight: 0,
|
|
58
|
+
}),
|
|
59
|
+
};
|
|
78
60
|
function MoleculePanelInner({ zones, ranges, molecules: moleculesProp, activeTab, displayerMode, }) {
|
|
79
61
|
const [currentIndex, setCurrentIndex] = (0, react_2.useState)(0);
|
|
80
62
|
const [molecules, setMolecules] = (0, react_2.useState)([]);
|
|
@@ -104,17 +86,17 @@ function MoleculePanelInner({ zones, ranges, molecules: moleculesProp, activeTab
|
|
|
104
86
|
const moleculeIndexHandler = (0, react_2.useCallback)((index) => {
|
|
105
87
|
setCurrentIndex(index);
|
|
106
88
|
}, []);
|
|
107
|
-
return ((0, jsx_runtime_1.jsxs)("div", { css: styles, children: [(0, jsx_runtime_1.jsx)(MoleculePanelHeader_1.default, { currentIndex: currentIndex, molecules: molecules, onOpenMoleculeEditor: () => openMoleculeEditorHandler(), onMoleculeIndexChange: moleculeIndexHandler }, void 0), (0, jsx_runtime_1.jsx)("div", {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
89
|
+
return ((0, jsx_runtime_1.jsxs)("div", { css: styles.panel, children: [(0, jsx_runtime_1.jsx)(MoleculePanelHeader_1.default, { currentIndex: currentIndex, molecules: molecules, onOpenMoleculeEditor: () => openMoleculeEditorHandler(), onMoleculeIndexChange: moleculeIndexHandler }, void 0), (0, jsx_runtime_1.jsx)("div", { css: styles.molecule, children: (0, jsx_runtime_1.jsx)(NextPrev_1.default, { onChange: (slideIndex) => setCurrentIndex(slideIndex), defaultIndex: currentIndex, children: molecules && molecules.length > 0 ? (molecules.map((mol, index) => ((0, jsx_runtime_1.jsxs)("div", { css: styles.items, children: [(0, jsx_runtime_1.jsxs)("span", { css: styles.toolbar, children: [(0, jsx_runtime_1.jsx)(react_mf_1.MF, { mf: mol.mf }, void 0), " - ", mol.mw?.toFixed(2)] }, void 0), (0, jsx_runtime_1.jsx)("div", { css: styles.slider, className: "mol-svg-container", onDoubleClick: () => openMoleculeEditorHandler(mol), style: {
|
|
90
|
+
backgroundColor: (index + 1) % 2 !== 0 ? '#fafafa' : 'white',
|
|
91
|
+
}, children: (0, jsx_runtime_1.jsx)(react_d3_utils_1.ResponsiveChart, { children: ({ height, width }) => {
|
|
92
|
+
return ((0, jsx_runtime_1.jsx)(react_ocl_nmr_1.default, { OCL: full_1.default, id: `molSVG${index}`, width: width, height: height, molfile: mol.molfile || '', setMolfile: (molfile) => handleReplaceMolecule(mol.key, molfile), setSelectedAtom: handleOnClickAtom, atomHighlightColor: currentDiaIDsToHighlight &&
|
|
93
|
+
currentDiaIDsToHighlight.length > 0
|
|
94
|
+
? 'red'
|
|
95
|
+
: '#FFD700', atomHighlightOpacity: 0.35, highlights: currentDiaIDsToHighlight &&
|
|
96
|
+
currentDiaIDsToHighlight.length > 0
|
|
97
|
+
? currentDiaIDsToHighlight
|
|
98
|
+
: assignedDiaIDsMerged, setHoverAtom: handleOnAtomHover }, void 0));
|
|
99
|
+
} }, void 0) }, void 0)] }, mol.key)))) : ((0, jsx_runtime_1.jsx)("div", { css: styles.slider, style: { height: '100%' }, onClick: () => openMoleculeEditorHandler(), children: (0, jsx_runtime_1.jsx)("span", { children: "Click to draw molecule" }, void 0) }, void 0)) }, void 0) }, void 0)] }, void 0));
|
|
118
100
|
}
|
|
119
101
|
const MemoizedMoleculePanel = (0, react_2.memo)(MoleculePanelInner);
|
|
120
102
|
const emptyData = { ranges: {}, zones: {} };
|
|
@@ -103,15 +103,10 @@ function useAtomAssignment({ displayerMode, activeTab, zones, ranges, }) {
|
|
|
103
103
|
return (0, Utilities_1.getCurrentDiaIDsToHighlight)(assignmentData, displayerMode).concat(highlights);
|
|
104
104
|
}, [assignmentData, data, displayerMode, highlightData.highlight]);
|
|
105
105
|
const toggleAssignment = (0, react_1.useCallback)((diaID, atomInformation) => {
|
|
106
|
-
//
|
|
107
|
-
//
|
|
108
|
-
if (assignedDiaIDsMerged.some((_oclID) => atomInformation.oclIDs.includes(_oclID)) &&
|
|
109
|
-
!diaID.some((_oclID) => atomInformation.oclIDs.includes(_oclID))) {
|
|
110
|
-
alert.info('Atom is already assigned to another signal!');
|
|
111
|
-
return diaID;
|
|
112
|
-
}
|
|
106
|
+
// a previous version of the code prevented to assign many time the same atom
|
|
107
|
+
// see revision cc13abc18f77b6787b923e3c4edaef51750d9e90
|
|
113
108
|
return (0, Utilities_1.toggleDiaIDs)(diaID, atomInformation);
|
|
114
|
-
}, [
|
|
109
|
+
}, []);
|
|
115
110
|
const handleOnClickAtom = (0, react_1.useCallback)((atom, event) => {
|
|
116
111
|
if (!(0, checkModifierKeyActivated_1.default)(event)) {
|
|
117
112
|
if (activeAssignment.isActive) {
|
package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js
CHANGED
|
@@ -18,8 +18,6 @@ const ToggleButton_1 = __importDefault(require("../../elements/ToggleButton"));
|
|
|
18
18
|
const Alert_1 = require("../../elements/popup/Alert");
|
|
19
19
|
const Modal_1 = require("../../elements/popup/Modal");
|
|
20
20
|
const AlignSpectraModal_1 = __importDefault(require("../../modal/AlignSpectraModal"));
|
|
21
|
-
const ExportAsMatrixModal_1 = __importDefault(require("../../modal/ExportAsMatrixModal"));
|
|
22
|
-
const MultipleSpectraFiltersModal_1 = __importDefault(require("../../modal/MultipleSpectraFiltersModal"));
|
|
23
21
|
const Types_1 = require("../../reducer/types/Types");
|
|
24
22
|
const Events_1 = __importDefault(require("../../utility/Events"));
|
|
25
23
|
const Export_1 = require("../../utility/Export");
|
|
@@ -61,15 +59,6 @@ function MultipleSpectraAnalysisPanelInner({ activeTab, spectraAnalysis, }) {
|
|
|
61
59
|
width: 500,
|
|
62
60
|
});
|
|
63
61
|
}, [activeTab, modal, dispatch]);
|
|
64
|
-
const openFiltersModal = (0, react_2.useCallback)(() => {
|
|
65
|
-
dispatch({ type: Types_1.RESET_SELECTED_TOOL });
|
|
66
|
-
modal.show((0, jsx_runtime_1.jsx)(MultipleSpectraFiltersModal_1.default, {}, void 0), {
|
|
67
|
-
isBackgroundBlur: false,
|
|
68
|
-
position: Alert_1.positions.TOP_CENTER,
|
|
69
|
-
width: 550,
|
|
70
|
-
height: 250,
|
|
71
|
-
});
|
|
72
|
-
}, [modal, dispatch]);
|
|
73
62
|
const copyToClipboardHandler = (0, react_2.useCallback)(async () => {
|
|
74
63
|
const data = (0, MultipleAnalysis_1.getDataAsString)(spectraAnalysis, activeTab);
|
|
75
64
|
const success = await (0, Export_1.copyTextToClipboard)(data);
|
|
@@ -80,14 +69,6 @@ function MultipleSpectraAnalysisPanelInner({ activeTab, spectraAnalysis, }) {
|
|
|
80
69
|
alert.error('copy to clipboard failed');
|
|
81
70
|
}
|
|
82
71
|
}, [activeTab, alert, spectraAnalysis]);
|
|
83
|
-
const openExportAsMatrixModal = (0, react_2.useCallback)(() => {
|
|
84
|
-
dispatch({ type: Types_1.RESET_SELECTED_TOOL });
|
|
85
|
-
modal.show((0, jsx_runtime_1.jsx)(ExportAsMatrixModal_1.default, {}, void 0), {
|
|
86
|
-
isBackgroundBlur: false,
|
|
87
|
-
position: Alert_1.positions.TOP_CENTER,
|
|
88
|
-
width: 500,
|
|
89
|
-
});
|
|
90
|
-
}, [modal, dispatch]);
|
|
91
72
|
return ((0, jsx_runtime_1.jsxs)("div", { css: [
|
|
92
73
|
BasicPanelStyle_1.tablePanelStyle,
|
|
93
74
|
isFlipped &&
|
|
@@ -100,9 +81,7 @@ function MultipleSpectraAnalysisPanelInner({ activeTab, spectraAnalysis, }) {
|
|
|
100
81
|
// style={styles.button}
|
|
101
82
|
onClick: copyToClipboardHandler, children: (0, jsx_runtime_1.jsx)(fa_1.FaFileExport, {}, void 0) }, void 0), (0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "Spectra calibration",
|
|
102
83
|
// style={styles.button}
|
|
103
|
-
onClick: openAlignSpectra, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrOverlay, { style: { fontSize: '18px' } }, void 0) }, void 0), (0, jsx_runtime_1.jsx)(ToggleButton_1.default, { popupTitle: "Y Spectra Tracker", popupPlacement: "right", onClick: showTrackerHandler, children: (0, jsx_runtime_1.jsx)(io5_1.IoPulseOutline, {}, void 0) }, void 0), (0, jsx_runtime_1.jsx)(
|
|
104
|
-
// style={styles.button}
|
|
105
|
-
onClick: openFiltersModal, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrAddFilter, { style: { fontSize: '18px' } }, void 0) }, void 0), (0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "Export spectra as a Matrix", onClick: openExportAsMatrixModal, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrExportAsMatrix, {}, void 0) }, void 0)] }, void 0)), isFlipped && ((0, jsx_runtime_1.jsx)(PreferencesHeader_1.default, { onSave: saveSettingHandler, onClose: settingsPanelHandler }, void 0)), (0, jsx_runtime_1.jsx)("div", { className: "inner-container", children: !isFlipped ? ((0, jsx_runtime_1.jsx)(MultipleSpectraAnalysisTable_1.default, { data: data, activeTab: activeTab }, void 0)) : ((0, jsx_runtime_1.jsx)(MultipleSpectraAnalysisPreferences_1.default, { data: data, onAfterSave: afterSaveHandler, ref: settingRef }, void 0)) }, void 0)] }, void 0));
|
|
84
|
+
onClick: openAlignSpectra, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrOverlay, { style: { fontSize: '18px' } }, void 0) }, void 0), (0, jsx_runtime_1.jsx)(ToggleButton_1.default, { popupTitle: "Y Spectra Tracker", popupPlacement: "right", onClick: showTrackerHandler, children: (0, jsx_runtime_1.jsx)(io5_1.IoPulseOutline, {}, void 0) }, void 0)] }, void 0)), isFlipped && ((0, jsx_runtime_1.jsx)(PreferencesHeader_1.default, { onSave: saveSettingHandler, onClose: settingsPanelHandler }, void 0)), (0, jsx_runtime_1.jsx)("div", { className: "inner-container", children: !isFlipped ? ((0, jsx_runtime_1.jsx)(MultipleSpectraAnalysisTable_1.default, { data: data, activeTab: activeTab }, void 0)) : ((0, jsx_runtime_1.jsx)(MultipleSpectraAnalysisPreferences_1.default, { data: data, onAfterSave: afterSaveHandler, ref: settingRef }, void 0)) }, void 0)] }, void 0));
|
|
106
85
|
}
|
|
107
86
|
const MemoizedMultipleSpectraAnalysisPanel = (0, react_2.memo)(MultipleSpectraAnalysisPanelInner);
|
|
108
87
|
function MultipleSpectraAnalysisPanel() {
|
|
@@ -15,6 +15,7 @@ const Constants_1 = require("../reducer/core/Constants");
|
|
|
15
15
|
const ToolTypes_1 = require("../toolbar/ToolTypes");
|
|
16
16
|
const InformationPanel_1 = __importDefault(require("./InformationPanel"));
|
|
17
17
|
const IntegralPanel_1 = __importDefault(require("./IntegralsPanel/IntegralPanel"));
|
|
18
|
+
const MatrixGenerationPanel_1 = __importDefault(require("./MatrixGenerationPanel/MatrixGenerationPanel"));
|
|
18
19
|
const MoleculePanel_1 = __importDefault(require("./MoleculesPanel/MoleculePanel"));
|
|
19
20
|
const MultipleSpectraAnalysisPanel_1 = __importDefault(require("./MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel"));
|
|
20
21
|
const PeaksPanel_1 = __importDefault(require("./PeaksPanel/PeaksPanel"));
|
|
@@ -75,6 +76,14 @@ const accordionItems = [
|
|
|
75
76
|
hidePreferenceKey: 'hideMultipleSpectraAnalysisPanel',
|
|
76
77
|
mode: null,
|
|
77
78
|
},
|
|
79
|
+
{
|
|
80
|
+
title: 'Matrix Generation',
|
|
81
|
+
component: (0, jsx_runtime_1.jsx)(MatrixGenerationPanel_1.default, {}, void 0),
|
|
82
|
+
openWhen: [],
|
|
83
|
+
hidePreferenceKey: '',
|
|
84
|
+
mode: null,
|
|
85
|
+
isExperimental: true,
|
|
86
|
+
},
|
|
78
87
|
{
|
|
79
88
|
title: 'Zones',
|
|
80
89
|
component: (0, jsx_runtime_1.jsx)(ZonesPanel_1.default, {}, void 0),
|
|
@@ -109,6 +118,7 @@ exports.PANELS_ACCORDION = {
|
|
|
109
118
|
peakPicking: 'Peaks',
|
|
110
119
|
integral: 'Integrals',
|
|
111
120
|
rangesPicking: 'Ranges',
|
|
121
|
+
zone2D: 'Zones',
|
|
112
122
|
};
|
|
113
123
|
function PanelsInner({ displayerMode }) {
|
|
114
124
|
const preferences = (0, PreferencesContext_1.usePreferences)();
|
|
@@ -37,9 +37,6 @@ function PeaksPanelInner({ peaks, info, xDomain, activeTab, preferences, }) {
|
|
|
37
37
|
}, [modal, yesHandler]);
|
|
38
38
|
const settingsPanelHandler = (0, react_2.useCallback)(() => {
|
|
39
39
|
setFlipStatus(!isFlipped);
|
|
40
|
-
if (!isFlipped) {
|
|
41
|
-
settingRef.current.cancelSetting();
|
|
42
|
-
}
|
|
43
40
|
}, [isFlipped]);
|
|
44
41
|
const saveSettingHandler = (0, react_2.useCallback)(() => {
|
|
45
42
|
settingRef.current.saveSetting();
|
|
@@ -88,7 +88,6 @@ const formatFields = [
|
|
|
88
88
|
];
|
|
89
89
|
function PeaksPreferencesInner({ nucleus, preferences, innerRef, }) {
|
|
90
90
|
const alert = (0, Alert_1.useAlert)();
|
|
91
|
-
const [, setSettingsData] = (0, LocalStorage_1.useStateWithLocalStorage)('nmr-general-settings');
|
|
92
91
|
const formRef = (0, react_1.useRef)(null);
|
|
93
92
|
const updateValues = (0, react_1.useCallback)(() => {
|
|
94
93
|
if (nucleus) {
|
|
@@ -103,27 +102,19 @@ function PeaksPreferencesInner({ nucleus, preferences, innerRef, }) {
|
|
|
103
102
|
(0, react_1.useEffect)(() => {
|
|
104
103
|
updateValues();
|
|
105
104
|
}, [updateValues]);
|
|
106
|
-
const saveHandler = (0, react_1.useCallback)((values
|
|
105
|
+
const saveHandler = (0, react_1.useCallback)((values) => {
|
|
107
106
|
preferences.dispatch({
|
|
108
107
|
type: preferencesReducer_1.SET_PANELS_PREFERENCES,
|
|
109
108
|
payload: { key: 'peaks', value: values },
|
|
110
109
|
});
|
|
111
|
-
|
|
112
|
-
alert.success('Peaks preferences saved successfully');
|
|
110
|
+
alert.success('Peaks preferences saved successfully');
|
|
113
111
|
}, [alert, preferences]);
|
|
114
112
|
(0, react_1.useImperativeHandle)(innerRef, () => ({
|
|
115
113
|
saveSetting: () => {
|
|
116
114
|
formRef.current.submitForm();
|
|
117
115
|
},
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
},
|
|
121
|
-
}), [updateValues]);
|
|
122
|
-
const handleSubmit = (0, react_1.useCallback)((values) => {
|
|
123
|
-
saveHandler(values, true);
|
|
124
|
-
setSettingsData(values, 'formatting.panels.peaks');
|
|
125
|
-
}, [saveHandler, setSettingsData]);
|
|
126
|
-
return ((0, jsx_runtime_1.jsx)("div", { style: styles.container, children: (0, jsx_runtime_1.jsx)(FormikForm_1.default, { onSubmit: handleSubmit, ref: formRef, children: nucleus?.map((nucleusLabel) => ((0, jsx_runtime_1.jsxs)("div", { style: styles.groupContainer, children: [(0, jsx_runtime_1.jsx)(IsotopesViewer_1.default, { style: styles.header, value: nucleusLabel }, void 0), formatFields.map((field) => ((0, jsx_runtime_1.jsx)(FormikColumnFormatField_1.default, { label: field.label, checkControllerName: `${nucleusLabel}.${field.checkController}`, formatControllerName: `${nucleusLabel}.${field.formatController}`, hideFormat: field.formatController === 'deltaPPMFormat' }, field.id)))] }, nucleusLabel))) }, void 0) }, void 0));
|
|
116
|
+
}), []);
|
|
117
|
+
return ((0, jsx_runtime_1.jsx)("div", { style: styles.container, children: (0, jsx_runtime_1.jsx)(FormikForm_1.default, { onSubmit: saveHandler, ref: formRef, children: nucleus?.map((nucleusLabel) => ((0, jsx_runtime_1.jsxs)("div", { style: styles.groupContainer, children: [(0, jsx_runtime_1.jsx)(IsotopesViewer_1.default, { style: styles.header, value: nucleusLabel }, void 0), formatFields.map((field) => ((0, jsx_runtime_1.jsx)(FormikColumnFormatField_1.default, { label: field.label, checkControllerName: `${nucleusLabel}.${field.checkController}`, formatControllerName: `${nucleusLabel}.${field.formatController}`, hideFormat: field.formatController === 'deltaPPMFormat' }, field.id)))] }, nucleusLabel))) }, void 0) }, void 0));
|
|
127
118
|
}
|
|
128
119
|
const MemoizedPeaksPreferences = (0, react_1.memo)(PeaksPreferencesInner);
|
|
129
120
|
// TODO: remove this hacky use of ref.
|
|
@@ -105,9 +105,6 @@ function RangesTablePanelInner({ ranges, data, info, xDomain, preferences, activ
|
|
|
105
105
|
}, [isFilterActive]);
|
|
106
106
|
const settingsPanelHandler = (0, react_2.useCallback)(() => {
|
|
107
107
|
setFlipStatus(!isFlipped);
|
|
108
|
-
if (!isFlipped) {
|
|
109
|
-
settingRef.current.cancelSetting();
|
|
110
|
-
}
|
|
111
108
|
}, [isFlipped]);
|
|
112
109
|
const saveSettingHandler = (0, react_2.useCallback)(() => {
|
|
113
110
|
settingRef.current.saveSetting();
|
|
@@ -76,7 +76,6 @@ const formatFields = [
|
|
|
76
76
|
];
|
|
77
77
|
function RangesPreferencesInner({ nucleus, preferences, innerRef, }) {
|
|
78
78
|
const alert = (0, Alert_1.useAlert)();
|
|
79
|
-
const [, setSettingsData] = (0, LocalStorage_1.useStateWithLocalStorage)('nmr-general-settings');
|
|
80
79
|
const formRef = (0, react_1.useRef)();
|
|
81
80
|
const updateValues = (0, react_1.useCallback)(() => {
|
|
82
81
|
if (nucleus) {
|
|
@@ -91,31 +90,19 @@ function RangesPreferencesInner({ nucleus, preferences, innerRef, }) {
|
|
|
91
90
|
(0, react_1.useEffect)(() => {
|
|
92
91
|
updateValues();
|
|
93
92
|
}, [updateValues]);
|
|
94
|
-
const
|
|
95
|
-
setSettingsData(values, 'formatting.panels.ranges');
|
|
96
|
-
};
|
|
97
|
-
const saveHandler = (0, react_1.useCallback)((values, showMessage = false) => {
|
|
93
|
+
const saveHandler = (0, react_1.useCallback)((values) => {
|
|
98
94
|
preferences.dispatch({
|
|
99
95
|
type: preferencesReducer_1.SET_PANELS_PREFERENCES,
|
|
100
96
|
payload: { key: 'ranges', value: values },
|
|
101
97
|
});
|
|
102
|
-
|
|
103
|
-
alert.success('ranges preferences saved successfully');
|
|
104
|
-
}
|
|
98
|
+
alert.success('ranges preferences saved successfully');
|
|
105
99
|
}, [alert, preferences]);
|
|
106
100
|
(0, react_1.useImperativeHandle)(innerRef, () => ({
|
|
107
101
|
saveSetting: () => {
|
|
108
102
|
formRef.current.submitForm();
|
|
109
103
|
},
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
},
|
|
113
|
-
}), [updateValues]);
|
|
114
|
-
const handleSubmit = (values) => {
|
|
115
|
-
saveHandler(values, true);
|
|
116
|
-
saveToLocalStorgate(values);
|
|
117
|
-
};
|
|
118
|
-
return ((0, jsx_runtime_1.jsx)("div", { style: styles.container, children: (0, jsx_runtime_1.jsx)(FormikForm_1.default, { onSubmit: handleSubmit, ref: formRef, children: nucleus?.map((nucleusLabel) => ((0, jsx_runtime_1.jsxs)("div", { style: styles.groupContainer, children: [(0, jsx_runtime_1.jsx)(IsotopesViewer_1.default, { style: styles.header, value: nucleusLabel }, void 0), formatFields.map((field) => ((0, jsx_runtime_1.jsx)(FormikColumnFormatField_1.default, { label: field.label, checkControllerName: `${nucleusLabel}.${field.checkController}`, formatControllerName: `${nucleusLabel}.${field.formatController}` }, field.id))), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "J Graph tolerance (Hz) :", style: { label: styles.inputLabel, wrapper: styles.inputWrapper }, children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: `${nucleusLabel}.jGraphTolerance`, type: "number" }, void 0) }, void 0)] }, nucleusLabel))) }, void 0) }, void 0));
|
|
104
|
+
}), []);
|
|
105
|
+
return ((0, jsx_runtime_1.jsx)("div", { style: styles.container, children: (0, jsx_runtime_1.jsx)(FormikForm_1.default, { onSubmit: saveHandler, ref: formRef, children: nucleus?.map((nucleusLabel) => ((0, jsx_runtime_1.jsxs)("div", { style: styles.groupContainer, children: [(0, jsx_runtime_1.jsx)(IsotopesViewer_1.default, { style: styles.header, value: nucleusLabel }, void 0), formatFields.map((field) => ((0, jsx_runtime_1.jsx)(FormikColumnFormatField_1.default, { label: field.label, checkControllerName: `${nucleusLabel}.${field.checkController}`, formatControllerName: `${nucleusLabel}.${field.formatController}` }, field.id))), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "J Graph tolerance (Hz) :", style: { label: styles.inputLabel, wrapper: styles.inputWrapper }, children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: `${nucleusLabel}.jGraphTolerance`, type: "number" }, void 0) }, void 0)] }, nucleusLabel))) }, void 0) }, void 0));
|
|
119
106
|
}
|
|
120
107
|
const MemoizedRangesPreferences = (0, react_1.memo)(RangesPreferencesInner);
|
|
121
108
|
// TODO: remove this hacky use of ref.
|
|
@@ -12,10 +12,11 @@ const DispatchContext_1 = require("../../context/DispatchContext");
|
|
|
12
12
|
const ButtonToolTip_1 = __importDefault(require("../../elements/ButtonToolTip"));
|
|
13
13
|
const Alert_1 = require("../../elements/popup/Alert");
|
|
14
14
|
const Modal_1 = require("../../elements/popup/Modal");
|
|
15
|
+
const useCheckToolsVisibility_1 = require("../../hooks/useCheckToolsVisibility");
|
|
15
16
|
const Constants_1 = require("../../reducer/core/Constants");
|
|
16
17
|
const Types_1 = require("../../reducer/types/Types");
|
|
17
18
|
const DefaultPanelHeader_1 = __importDefault(require("../header/DefaultPanelHeader"));
|
|
18
|
-
function SpectraPanelHeaderInner({ data, activeSpectrum, activeTab, displayerMode, spectrums, }) {
|
|
19
|
+
function SpectraPanelHeaderInner({ data, activeSpectrum, activeTab, displayerMode, spectrums, isAutomaticPickingVisible, }) {
|
|
19
20
|
const modal = (0, Modal_1.useModal)();
|
|
20
21
|
const alert = (0, Alert_1.useAlert)();
|
|
21
22
|
const dispatch = (0, DispatchContext_1.useDispatch)();
|
|
@@ -77,11 +78,20 @@ function SpectraPanelHeaderInner({ data, activeSpectrum, activeTab, displayerMod
|
|
|
77
78
|
hideLoading();
|
|
78
79
|
}, 0);
|
|
79
80
|
}, [dispatch, alert]);
|
|
80
|
-
return ((0, jsx_runtime_1.jsxs)(DefaultPanelHeader_1.default, { onDelete: handleDelete, counter: spectrums?.length, deleteToolTip: "Delete all spectra", children: [(0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "Hide all spectra", onClick: hideAllSpectrumsHandler, children: (0, jsx_runtime_1.jsx)(fa_1.FaEyeSlash, {}, void 0) }, void 0), (0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "Show all spectra", onClick: showAllSpectrumsHandler, children: (0, jsx_runtime_1.jsx)(fa_1.FaEye, {}, void 0) }, void 0), activeSpectrum && activeTab && activeTab.split(',').length > 1 && ((0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "Add missing projection", onClick: addMissingProjectionHandler, children: (0, jsx_runtime_1.jsx)(fa_1.FaCreativeCommonsSamplingPlus, {}, void 0) }, void 0)), displayerMode === Constants_1.DISPLAYER_MODE.DM_1D && spectrums.length > 1 && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "Reset Scale", onClick: resetScaleHandler, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrResetScale, {}, void 0) }, void 0), (0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "Same Top", onClick: setSameTopHandler, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrSameTop, {}, void 0) }, void 0)] }, void 0)), data && data.length > 0 && ((0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "Automatic Ranges/Zones picking for all spectra", onClick: automaticPickingHandler, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrRangePicking, {}, void 0) }, void 0))] }, void 0));
|
|
81
|
+
return ((0, jsx_runtime_1.jsxs)(DefaultPanelHeader_1.default, { onDelete: handleDelete, counter: spectrums?.length, deleteToolTip: "Delete all spectra", children: [(0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "Hide all spectra", onClick: hideAllSpectrumsHandler, children: (0, jsx_runtime_1.jsx)(fa_1.FaEyeSlash, {}, void 0) }, void 0), (0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "Show all spectra", onClick: showAllSpectrumsHandler, children: (0, jsx_runtime_1.jsx)(fa_1.FaEye, {}, void 0) }, void 0), activeSpectrum && activeTab && activeTab.split(',').length > 1 && ((0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "Add missing projection", onClick: addMissingProjectionHandler, children: (0, jsx_runtime_1.jsx)(fa_1.FaCreativeCommonsSamplingPlus, {}, void 0) }, void 0)), displayerMode === Constants_1.DISPLAYER_MODE.DM_1D && spectrums.length > 1 && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "Reset Scale", onClick: resetScaleHandler, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrResetScale, {}, void 0) }, void 0), (0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "Same Top", onClick: setSameTopHandler, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrSameTop, {}, void 0) }, void 0)] }, void 0)), data && data.length > 0 && isAutomaticPickingVisible && ((0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "Automatic Ranges/Zones picking for all spectra", onClick: automaticPickingHandler, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrRangePicking, {}, void 0) }, void 0))] }, void 0));
|
|
81
82
|
}
|
|
82
83
|
const MemoizedSpectraPanelHeader = (0, react_1.memo)(SpectraPanelHeaderInner);
|
|
83
84
|
function SpectrumsTabs({ spectrums }) {
|
|
84
85
|
const { data, activeSpectrum, activeTab, displayerMode } = (0, ChartContext_1.useChartData)();
|
|
85
|
-
|
|
86
|
+
const isToolVisible = (0, useCheckToolsVisibility_1.useCheckToolsVisibility)();
|
|
87
|
+
const isAutomaticPickingVisible = isToolVisible('hideAutoRangesTool');
|
|
88
|
+
return ((0, jsx_runtime_1.jsx)(MemoizedSpectraPanelHeader, { ...{
|
|
89
|
+
data,
|
|
90
|
+
activeSpectrum,
|
|
91
|
+
activeTab,
|
|
92
|
+
displayerMode,
|
|
93
|
+
spectrums,
|
|
94
|
+
isAutomaticPickingVisible,
|
|
95
|
+
} }, void 0));
|
|
86
96
|
}
|
|
87
97
|
exports.default = SpectrumsTabs;
|
|
@@ -44,7 +44,7 @@ function Spectrum2DHistogram({ color = 'red', data, options = {}, }) {
|
|
|
44
44
|
}
|
|
45
45
|
return { sanPlot, lines };
|
|
46
46
|
}, [data.z, options, yLogBase]);
|
|
47
|
-
return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("
|
|
47
|
+
return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { style: { textAlign: 'center', paddingBottom: 5, paddingTop: 5 }, children: "San Plot" }, void 0), (0, jsx_runtime_1.jsxs)("div", { style: {
|
|
48
48
|
borderTop: '1px solid #ededed',
|
|
49
49
|
marginTop: '10px',
|
|
50
50
|
paddingTop: '10px',
|
|
@@ -123,9 +123,6 @@ function ZonesPanelInner({ zones, activeTab, xDomain, yDomain }) {
|
|
|
123
123
|
}, [assignmentData, dispatch, modal]);
|
|
124
124
|
const settingsPanelHandler = (0, react_2.useCallback)(() => {
|
|
125
125
|
setFlipStatus(!isFlipped);
|
|
126
|
-
if (!isFlipped) {
|
|
127
|
-
settingRef.current.cancelSetting();
|
|
128
|
-
}
|
|
129
126
|
}, [isFlipped]);
|
|
130
127
|
const saveSettingHandler = (0, react_2.useCallback)(() => {
|
|
131
128
|
settingRef.current.saveSetting();
|
|
@@ -76,7 +76,6 @@ const formatFields = [
|
|
|
76
76
|
];
|
|
77
77
|
function ZonesPreferencesInner({ nucleus, innerRef, }) {
|
|
78
78
|
const alert = (0, Alert_1.useAlert)();
|
|
79
|
-
const [, setSettingsData] = (0, LocalStorage_1.useStateWithLocalStorage)('nmr-general-settings');
|
|
80
79
|
const preferences = (0, PreferencesContext_1.usePreferences)();
|
|
81
80
|
const formRef = (0, react_1.useRef)();
|
|
82
81
|
const updateValues = (0, react_1.useCallback)(() => {
|
|
@@ -92,31 +91,19 @@ function ZonesPreferencesInner({ nucleus, innerRef, }) {
|
|
|
92
91
|
(0, react_1.useEffect)(() => {
|
|
93
92
|
updateValues();
|
|
94
93
|
}, [updateValues]);
|
|
95
|
-
const
|
|
96
|
-
setSettingsData(values, 'formatting.panels.ranges');
|
|
97
|
-
};
|
|
98
|
-
const saveHandler = (0, react_1.useCallback)((values, showMessage = false) => {
|
|
94
|
+
const saveHandler = (0, react_1.useCallback)((values) => {
|
|
99
95
|
preferences.dispatch({
|
|
100
96
|
type: preferencesReducer_1.SET_PANELS_PREFERENCES,
|
|
101
97
|
payload: { key: 'zones', value: values },
|
|
102
98
|
});
|
|
103
|
-
|
|
104
|
-
alert.success('zones preferences saved successfully');
|
|
105
|
-
}
|
|
99
|
+
alert.success('zones preferences saved successfully');
|
|
106
100
|
}, [alert, preferences]);
|
|
107
101
|
(0, react_1.useImperativeHandle)(innerRef, () => ({
|
|
108
102
|
saveSetting: () => {
|
|
109
103
|
formRef.current.submitForm();
|
|
110
104
|
},
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
},
|
|
114
|
-
}), [updateValues]);
|
|
115
|
-
const handleSubmit = (values) => {
|
|
116
|
-
saveHandler(values, true);
|
|
117
|
-
saveToLocalStorgate(values);
|
|
118
|
-
};
|
|
119
|
-
return ((0, jsx_runtime_1.jsx)("div", { style: styles.container, children: (0, jsx_runtime_1.jsx)(FormikForm_1.default, { onSubmit: handleSubmit, ref: formRef, children: nucleus?.map((nucleusLabel) => ((0, jsx_runtime_1.jsxs)("div", { style: styles.groupContainer, children: [(0, jsx_runtime_1.jsx)(IsotopesViewer_1.default, { style: styles.header, value: nucleusLabel }, void 0), formatFields.map((field) => ((0, jsx_runtime_1.jsx)(FormikColumnFormatField_1.default, { label: field.label, checkControllerName: `${nucleusLabel}.${field.checkController}`, formatControllerName: `${nucleusLabel}.${field.formatController}` }, field.id)))] }, nucleusLabel))) }, void 0) }, void 0));
|
|
105
|
+
}), []);
|
|
106
|
+
return ((0, jsx_runtime_1.jsx)("div", { style: styles.container, children: (0, jsx_runtime_1.jsx)(FormikForm_1.default, { onSubmit: saveHandler, ref: formRef, children: nucleus?.map((nucleusLabel) => ((0, jsx_runtime_1.jsxs)("div", { style: styles.groupContainer, children: [(0, jsx_runtime_1.jsx)(IsotopesViewer_1.default, { style: styles.header, value: nucleusLabel }, void 0), formatFields.map((field) => ((0, jsx_runtime_1.jsx)(FormikColumnFormatField_1.default, { label: field.label, checkControllerName: `${nucleusLabel}.${field.checkController}`, formatControllerName: `${nucleusLabel}.${field.formatController}` }, field.id)))] }, nucleusLabel))) }, void 0) }, void 0));
|
|
120
107
|
}
|
|
121
108
|
const MemoizedZonesPreferences = (0, react_1.memo)(ZonesPreferencesInner);
|
|
122
109
|
// TODO: remove this hacky use of ref.
|
|
@@ -114,6 +114,13 @@ function ZonesTable({ tableData, onUnlink, context, nuclei }) {
|
|
|
114
114
|
}, [tableData]);
|
|
115
115
|
const { items: sortedData, isSortedDesc, onSort } = (0, useTableSortBy_1.default)(data);
|
|
116
116
|
const rows = (0, react_2.useMemo)(() => sortedData.map((rowData, index) => ((0, jsx_runtime_1.jsx)(ZonesTableRow_1.default, { rowIndex: index, rowData: rowData, onUnlink: onUnlink, onContextMenu: (e, rowData) => contextMenuHandler(e, rowData) }, `${rowData.tableMetaInfo.id}`))), [contextMenuHandler, sortedData, onUnlink]);
|
|
117
|
-
return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("table", { css: tableStyle, children: [(0, jsx_runtime_1.jsxs)("thead", { children: [(0, jsx_runtime_1.jsxs)("tr", { children: [(0, jsx_runtime_1.jsx)("th", { rowSpan: 2, children: "#" }, void 0), (0, jsx_runtime_1.jsx)("th", { colSpan: 2, children: "\u03B4 (ppm)" }, void 0), (0, jsx_runtime_1.jsx)("th", { colSpan: 2, children: (0, jsx_runtime_1.jsx)(fa_1.FaLink, {}, void 0) }, void 0), (0, jsx_runtime_1.jsx)("th", { colSpan: 2, children: "\u03A3" }, void 0), (0, jsx_runtime_1.jsx)("th", { rowSpan: 2, children: "Kind" }, void 0), (0, jsx_runtime_1.jsx)("th", { rowSpan: 2, children: '' }, void 0)] }, void 0), (0, jsx_runtime_1.jsxs)("tr", { children: [(0, jsx_runtime_1.
|
|
117
|
+
return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("table", { css: tableStyle, children: [(0, jsx_runtime_1.jsxs)("thead", { children: [(0, jsx_runtime_1.jsxs)("tr", { children: [(0, jsx_runtime_1.jsx)("th", { rowSpan: 2, children: "#" }, void 0), (0, jsx_runtime_1.jsx)("th", { colSpan: 2, children: "\u03B4 (ppm)" }, void 0), (0, jsx_runtime_1.jsx)("th", { colSpan: 2, children: (0, jsx_runtime_1.jsx)(fa_1.FaLink, {}, void 0) }, void 0), (0, jsx_runtime_1.jsx)("th", { colSpan: 2, children: "\u03A3" }, void 0), (0, jsx_runtime_1.jsx)("th", { rowSpan: 2, children: "Kind" }, void 0), (0, jsx_runtime_1.jsx)("th", { rowSpan: 2, children: '' }, void 0)] }, void 0), (0, jsx_runtime_1.jsxs)("tr", { children: [(0, jsx_runtime_1.jsx)("th", { id: "tableMetaInfo.signal.x.delta", ...onSort, children: (0, jsx_runtime_1.jsxs)(SurroundedText, { text: "F2", children: [nuclei[0], ' ', isSortedDesc('tableMetaInfo.signal.x.delta').content] }, void 0) }, void 0), (0, jsx_runtime_1.jsx)("th", { id: "tableMetaInfo.signal.y.delta", ...onSort, children: (0, jsx_runtime_1.jsxs)(SurroundedText, { text: "F1", children: [nuclei[1], ' ', isSortedDesc('tableMetaInfo.signal.y.delta').content] }, void 0) }, void 0), (0, jsx_runtime_1.jsx)("th", { children: (0, jsx_runtime_1.jsx)(SurroundedText, { text: "F2", children: nuclei[0] }, void 0) }, void 0), (0, jsx_runtime_1.jsx)("th", { children: (0, jsx_runtime_1.jsx)(SurroundedText, { text: "F1", children: nuclei[1] }, void 0) }, void 0), (0, jsx_runtime_1.jsx)("th", { children: (0, jsx_runtime_1.jsx)(SurroundedText, { text: "F2", children: nuclei[0] }, void 0) }, void 0), (0, jsx_runtime_1.jsx)("th", { children: (0, jsx_runtime_1.jsx)(SurroundedText, { text: "F1", children: nuclei[1] }, void 0) }, void 0)] }, void 0)] }, void 0), (0, jsx_runtime_1.jsx)("tbody", { children: rows }, void 0)] }, void 0), (0, jsx_runtime_1.jsx)(ContextMenu_1.default, { ref: contextRef, context: context }, void 0)] }, void 0));
|
|
118
|
+
}
|
|
119
|
+
function SurroundedText(props) {
|
|
120
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { style: {
|
|
121
|
+
position: 'absolute',
|
|
122
|
+
fontSize: 8,
|
|
123
|
+
color: '#3539E6',
|
|
124
|
+
}, children: props.text }, void 0), (0, jsx_runtime_1.jsx)("div", { style: { marginLeft: 5 }, children: props.children }, void 0)] }, void 0));
|
|
118
125
|
}
|
|
119
126
|
exports.default = ZonesTable;
|
|
@@ -66,9 +66,6 @@ function DatabasePanelInner({ nucleus, selectedTool }) {
|
|
|
66
66
|
const { item } = (0, analysis_ui_components_1.useAccordionContext)('Database');
|
|
67
67
|
const settingsPanelHandler = (0, react_2.useCallback)(() => {
|
|
68
68
|
setFlipStatus(!isFlipped);
|
|
69
|
-
if (!isFlipped) {
|
|
70
|
-
settingRef.current.cancelSetting();
|
|
71
|
-
}
|
|
72
69
|
}, [isFlipped]);
|
|
73
70
|
const saveSettingHandler = (0, react_2.useCallback)(() => {
|
|
74
71
|
settingRef.current.saveSetting();
|