nmrium 0.19.0 → 0.20.2
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 +12 -3
- package/lib/component/NMRium.d.ts +1 -1
- package/lib/component/NMRium.js +28 -25
- package/lib/component/elements/NumberInput.d.ts +1 -2
- package/lib/component/elements/Tab/Tab.js +1 -0
- package/lib/component/hooks/useActiveSpectrumStyleOptions.d.ts +6 -0
- package/lib/component/hooks/useActiveSpectrumStyleOptions.js +15 -0
- package/lib/component/hooks/useXYReduce.d.ts +2 -1
- package/lib/component/loader/DropZone.js +1 -1
- 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/panels/MatrixGenerationPanel/MatrixGenerationPanel.d.ts +2 -0
- package/lib/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +35 -0
- package/lib/component/panels/MoleculesPanel/MoleculePanel.js +49 -51
- 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/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/ZonesTable.js +9 -2
- 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 +1 -30
- package/lib/component/reducer/helper/getRange.d.ts +6 -1
- package/lib/component/reducer/helper/getRange.js +1 -1
- package/lib/component/toolbar/FunctionToolBar.js +2 -5
- 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/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/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 +12 -3
- package/lib-cjs/component/NMRium.js +28 -25
- package/lib-cjs/component/elements/Tab/Tab.js +1 -0
- package/lib-cjs/component/hooks/useActiveSpectrumStyleOptions.js +21 -0
- package/lib-cjs/component/loader/DropZone.js +1 -1
- 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/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +40 -0
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanel.js +49 -51
- 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/SpectrumsPanel/base/setting/Spectrum2DHistogram.js +1 -1
- package/lib-cjs/component/panels/ZonesPanel/ZonesTable.js +8 -1
- 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 +1 -32
- package/lib-cjs/component/reducer/helper/getRange.js +1 -1
- package/lib-cjs/component/toolbar/FunctionToolBar.js +2 -5
- package/lib-cjs/component/utility/PathBuilder.js +21 -0
- package/lib-cjs/component/utility/getSpectraByNucleus.js +11 -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/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-cjs/component/1d/ExclusionZone.js +0 -32
- package/lib-cjs/component/1d/ExclusionZones.js +0 -16
|
@@ -31,7 +31,7 @@ function KeysListenerTracker() {
|
|
|
31
31
|
const allow2DTool = (0, react_1.useMemo)(() => {
|
|
32
32
|
return displayerMode === Constants_1.DISPLAYER_MODE.DM_2D && data && data.length > 0;
|
|
33
33
|
}, [data, displayerMode]);
|
|
34
|
-
const deleteHandler = (0, react_1.useCallback)((sourceData) => {
|
|
34
|
+
const deleteHandler = (0, react_1.useCallback)(async (sourceData) => {
|
|
35
35
|
const { type, extra: { id }, } = sourceData;
|
|
36
36
|
switch (type) {
|
|
37
37
|
case index_1.HighlightedSource.INTEGRAL: {
|
|
@@ -79,12 +79,15 @@ function KeysListenerTracker() {
|
|
|
79
79
|
break;
|
|
80
80
|
}
|
|
81
81
|
case index_1.HighlightedSource.EXCLUSION_ZONE: {
|
|
82
|
+
const hideLoading = await alert.showLoading(`Exclusion filter in progress`);
|
|
82
83
|
dispatch({
|
|
83
84
|
type: Types_1.DELETE_EXCLUSION_ZONE,
|
|
84
85
|
payload: {
|
|
85
86
|
id,
|
|
87
|
+
spectrumID: sourceData.extra.spectrumID,
|
|
86
88
|
},
|
|
87
89
|
});
|
|
90
|
+
hideLoading();
|
|
88
91
|
// remove keys from the highlighted list after delete
|
|
89
92
|
remove();
|
|
90
93
|
break;
|
|
@@ -92,7 +95,7 @@ function KeysListenerTracker() {
|
|
|
92
95
|
default:
|
|
93
96
|
break;
|
|
94
97
|
}
|
|
95
|
-
}, [assignmentData, dispatch, remove]);
|
|
98
|
+
}, [assignmentData, dispatch, remove, alert]);
|
|
96
99
|
const keysPreferencesListenerHandler = (0, react_1.useCallback)((e, num) => {
|
|
97
100
|
if (data && data.length > 0 && num >= 1 && num <= 9) {
|
|
98
101
|
if (e.shiftKey) {
|
|
@@ -164,6 +167,12 @@ function KeysListenerTracker() {
|
|
|
164
167
|
}
|
|
165
168
|
break;
|
|
166
169
|
}
|
|
170
|
+
case 'e': {
|
|
171
|
+
if (allow1DTool) {
|
|
172
|
+
handleChangeOption(ToolTypes_1.options.exclusionZones.id);
|
|
173
|
+
}
|
|
174
|
+
break;
|
|
175
|
+
}
|
|
167
176
|
default:
|
|
168
177
|
}
|
|
169
178
|
}
|
|
@@ -233,7 +242,7 @@ function KeysListenerTracker() {
|
|
|
233
242
|
else {
|
|
234
243
|
if (['Delete', 'Backspace'].includes(e.key) && highlight.sourceData) {
|
|
235
244
|
e.preventDefault();
|
|
236
|
-
deleteHandler(highlight.sourceData);
|
|
245
|
+
void deleteHandler(highlight.sourceData);
|
|
237
246
|
}
|
|
238
247
|
else {
|
|
239
248
|
toolsListenerHandler(e);
|
|
@@ -131,7 +131,10 @@ const defaultPreferences = {};
|
|
|
131
131
|
const defaultData = {
|
|
132
132
|
spectra: [],
|
|
133
133
|
};
|
|
134
|
-
function NMRium(
|
|
134
|
+
function NMRium(props) {
|
|
135
|
+
return ((0, jsx_runtime_1.jsx)(analysis_ui_components_1.RootLayout, { style: { width: '100%' }, children: (0, jsx_runtime_1.jsx)(react_error_boundary_1.ErrorBoundary, { FallbackComponent: ErrorOverlay_1.default, children: (0, jsx_runtime_1.jsx)(InnerNMRium, { ...props }, void 0) }, void 0) }, void 0));
|
|
136
|
+
}
|
|
137
|
+
function InnerNMRium({ data: dataProp = defaultData, mode = NMRiumMode.DEFAULT, preferences = defaultPreferences, getSpinner = SpinnerContext_1.defaultGetSpinner, onDataChange, emptyText, }) {
|
|
135
138
|
const rootRef = (0, react_2.useRef)(null);
|
|
136
139
|
const elementsWraperRef = (0, react_2.useRef)(null);
|
|
137
140
|
const [show, toggle] = (0, react_use_1.useToggle)(false);
|
|
@@ -181,30 +184,30 @@ function NMRium({ data: dataProp = defaultData, mode = NMRiumMode.DEFAULT, prefe
|
|
|
181
184
|
const mouseLeaveHandler = (0, react_2.useCallback)(() => {
|
|
182
185
|
dispatchMiddleWare({ type: Types_1.SET_MOUSE_OVER_DISPLAYER, payload: false });
|
|
183
186
|
}, [dispatchMiddleWare]);
|
|
184
|
-
return ((0, jsx_runtime_1.jsx)(
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
187
|
+
return ((0, jsx_runtime_1.jsx)(GlobalContext_1.GlobalProvider, { value: {
|
|
188
|
+
rootRef: rootRef.current,
|
|
189
|
+
elementsWraperRef: elementsWraperRef.current,
|
|
190
|
+
}, children: (0, jsx_runtime_1.jsx)(PreferencesContext_1.PreferencesProvider, { value: preferencesState, children: (0, jsx_runtime_1.jsx)("div", { onMouseEnter: mouseEnterHandler, onMouseLeave: mouseLeaveHandler, style: { height: '100%', position: 'relative' }, children: (0, jsx_runtime_1.jsx)(Alert_1.AlertProvider, { wrapperRef: elementsWraperRef.current, children: (0, jsx_runtime_1.jsx)(DispatchContext_1.DispatchProvider, { value: dispatchMiddleWare, children: (0, jsx_runtime_1.jsx)(ChartContext_1.ChartDataProvider, { value: state, children: (0, jsx_runtime_1.jsx)(Modal_1.ModalProvider, { wrapperRef: elementsWraperRef.current, children: (0, jsx_runtime_1.jsx)(highlight_1.HighlightProvider, { children: (0, jsx_runtime_1.jsx)(assignment_1.AssignmentProvider, { spectraData: spectraData, children: (0, jsx_runtime_1.jsx)(SpinnerContext_1.SpinnerProvider, { value: getSpinner, children: (0, jsx_runtime_1.jsx)("div", { className: "nmrium-container", ref: rootRef, css: containerStyles, onContextMenu: preventContextMenuHandler, style: { height: '100%', width: '100%' }, children: (0, jsx_runtime_1.jsx)(DropZone_1.default, { children: (0, jsx_runtime_1.jsxs)("div", { style: {
|
|
191
|
+
display: 'flex',
|
|
192
|
+
flexDirection: 'column',
|
|
193
|
+
backgroundColor: 'white',
|
|
194
|
+
width: '100%',
|
|
195
|
+
}, children: [(0, jsx_runtime_1.jsx)(Header_1.default, { isFullscreen: isFullscreen, onMaximize: toggle }, void 0), (0, jsx_runtime_1.jsxs)("div", { style: {
|
|
188
196
|
display: 'flex',
|
|
189
|
-
flexDirection: '
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
left: 0,
|
|
205
|
-
right: 0,
|
|
206
|
-
top: 0,
|
|
207
|
-
bottom: 0,
|
|
208
|
-
} }, String(isFullscreen))] }, void 0)] }, void 0) }, void 0) }, void 0) }, void 0) }, void 0) }, void 0) }, void 0) }, void 0) }, void 0) }, void 0) }, void 0) }, void 0) }, void 0) }, void 0) }, void 0));
|
|
197
|
+
flexDirection: 'row',
|
|
198
|
+
height: '100%',
|
|
199
|
+
}, children: [(0, jsx_runtime_1.jsx)(ToolBar_1.default, {}, void 0), (0, jsx_runtime_1.jsxs)(analysis_ui_components_1.SplitPane, { initialSeparation: "590px", orientation: "horizontal", sideSeparation: "end", children: [(0, jsx_runtime_1.jsxs)("div", { css: viewerContainerStyle, children: [(0, jsx_runtime_1.jsx)(KeysListenerTracker_1.default, {}, void 0), (0, jsx_runtime_1.jsx)("div", { "data-test-id": "viewer", style: {
|
|
200
|
+
width: '100%',
|
|
201
|
+
height: '100%',
|
|
202
|
+
}, children: displayerMode ===
|
|
203
|
+
Constants_1.DISPLAYER_MODE.DM_1D ? ((0, jsx_runtime_1.jsx)(Viewer1D_1.default, { emptyText: emptyText }, void 0)) : ((0, jsx_runtime_1.jsx)(Viewer2D_1.default, { emptyText: emptyText }, void 0)) }, void 0)] }, void 0), (0, jsx_runtime_1.jsx)(Panels_1.default, {}, void 0)] }, void 0), (0, jsx_runtime_1.jsx)("div", { ref: elementsWraperRef, id: "main-wrapper", style: {
|
|
204
|
+
position: 'absolute',
|
|
205
|
+
pointerEvents: 'none',
|
|
206
|
+
zIndex: 0,
|
|
207
|
+
left: 0,
|
|
208
|
+
right: 0,
|
|
209
|
+
top: 0,
|
|
210
|
+
bottom: 0,
|
|
211
|
+
} }, String(isFullscreen))] }, void 0)] }, void 0) }, void 0) }, void 0) }, void 0) }, void 0) }, void 0) }, void 0) }, void 0) }, void 0) }, void 0) }, void 0) }, void 0) }, void 0));
|
|
209
212
|
}
|
|
210
213
|
exports.default = (0, react_2.memo)(NMRium);
|
|
@@ -20,6 +20,7 @@ const styles = (styles) => (0, react_1.css) `
|
|
|
20
20
|
|
|
21
21
|
${styles}
|
|
22
22
|
`;
|
|
23
|
+
/* eslint-enable react/no-unused-prop-types */
|
|
23
24
|
function InternalTab({ tabid, tablabel, isActive, onClick = () => null, canDelete, onDelete = () => null, tabstyles, render, }) {
|
|
24
25
|
let className = 'tab-list-item';
|
|
25
26
|
// use tab identifier if given (higher priority)
|
|
@@ -0,0 +1,21 @@
|
|
|
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 get_1 = __importDefault(require("lodash/get"));
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
const ChartContext_1 = require("../context/ChartContext");
|
|
9
|
+
const PreferencesContext_1 = require("../context/PreferencesContext");
|
|
10
|
+
function useActiveSpectrumStyleOptions(id) {
|
|
11
|
+
const { activeSpectrum } = (0, ChartContext_1.useChartData)();
|
|
12
|
+
const preferences = (0, PreferencesContext_1.usePreferences)();
|
|
13
|
+
return (0, react_1.useMemo)(() => {
|
|
14
|
+
const isActive = activeSpectrum === null ? true : id === activeSpectrum.id ? true : false;
|
|
15
|
+
const opacity = isActive
|
|
16
|
+
? 1
|
|
17
|
+
: (0, get_1.default)(preferences, 'controllers.dimmedSpectraTransparency', 0.1);
|
|
18
|
+
return { isActive, opacity };
|
|
19
|
+
}, [activeSpectrum, id, preferences]);
|
|
20
|
+
}
|
|
21
|
+
exports.default = useActiveSpectrumStyleOptions;
|
|
@@ -204,7 +204,7 @@ function DropZone(props) {
|
|
|
204
204
|
const open = (0, react_2.useCallback)(() => {
|
|
205
205
|
openImportDialog();
|
|
206
206
|
}, [openImportDialog]);
|
|
207
|
-
return ((0, jsx_runtime_1.jsx)(LoaderContext_1.LoaderProvider, { value: open, children: (0, jsx_runtime_1.jsxs)("div", { ...getRootProps(), css: containerStyle, children: [(0, jsx_runtime_1.jsx)("input", { ...getInputProps() }, void 0), isDragActive && ((0, jsx_runtime_1.jsxs)("div", { css: style, style: {
|
|
207
|
+
return ((0, jsx_runtime_1.jsx)(LoaderContext_1.LoaderProvider, { value: open, children: (0, jsx_runtime_1.jsxs)("div", { ...getRootProps(), role: "none", css: containerStyle, children: [(0, jsx_runtime_1.jsx)("input", { "data-test-id": "dropzone-input", ...getInputProps() }, void 0), isDragActive && ((0, jsx_runtime_1.jsxs)("div", { css: style, style: {
|
|
208
208
|
width: `${width}px`,
|
|
209
209
|
height: `${height}px`,
|
|
210
210
|
marginTop: '30px',
|
|
@@ -34,12 +34,15 @@ exports.ModalStyles = (0, react_1.css) `
|
|
|
34
34
|
button:focus {
|
|
35
35
|
outline: none;
|
|
36
36
|
}
|
|
37
|
-
button:hover {
|
|
37
|
+
button:not([disabled]):hover {
|
|
38
38
|
color: #007bff;
|
|
39
39
|
}
|
|
40
|
-
.btn:hover {
|
|
40
|
+
.btn:not([disabled]):hover {
|
|
41
41
|
background-color: #ffffff;
|
|
42
42
|
}
|
|
43
|
+
.btn:disabled {
|
|
44
|
+
opacity: 0.5;
|
|
45
|
+
}
|
|
43
46
|
.btn {
|
|
44
47
|
border: none;
|
|
45
48
|
padding: 0 15px;
|
|
@@ -20,7 +20,8 @@ function MoleculeStructureEditorModal(props) {
|
|
|
20
20
|
}
|
|
21
21
|
}, [selectedMolecule]);
|
|
22
22
|
const cb = (0, react_1.useCallback)((newMolfile) => {
|
|
23
|
-
|
|
23
|
+
const molText = /(?<s>M {2}V30 BEGIN BOND)(?<mol>.*?)(?<e>M {2}V30 END BOND)/gs.exec(newMolfile)?.groups?.mol;
|
|
24
|
+
setMolfile(molText?.trim() ? newMolfile : null);
|
|
24
25
|
}, [setMolfile]);
|
|
25
26
|
const handleClose = (0, react_1.useCallback)(() => {
|
|
26
27
|
onClose();
|
|
@@ -35,6 +36,6 @@ function MoleculeStructureEditorModal(props) {
|
|
|
35
36
|
onClose('new');
|
|
36
37
|
}
|
|
37
38
|
}, [dispatch, selectedMolecule, molfile, onClose]);
|
|
38
|
-
return ((0, jsx_runtime_1.jsxs)("div", { css: ModalStyle_1.ModalStyles, children: [(0, jsx_runtime_1.jsx)(full_1.StructureEditor, { initialMolfile: selectedMolecule?.molfile, svgMenu: true, fragment: false, onChange: cb }, void 0), (0, jsx_runtime_1.jsxs)("div", { className: "footer-container", children: [(0, jsx_runtime_1.jsx)("button", { type: "button", className: "btn", onClick: handleSave, children: "Save" }, void 0), (0, jsx_runtime_1.jsx)("button", { type: "button", className: "btn", onClick: handleClose, children: "Close" }, void 0)] }, void 0)] }, void 0));
|
|
39
|
+
return ((0, jsx_runtime_1.jsxs)("div", { css: ModalStyle_1.ModalStyles, children: [(0, jsx_runtime_1.jsx)(full_1.StructureEditor, { initialMolfile: selectedMolecule?.molfile, svgMenu: true, fragment: false, onChange: cb }, void 0), (0, jsx_runtime_1.jsxs)("div", { className: "footer-container", children: [(0, jsx_runtime_1.jsx)("button", { type: "button", className: "btn", onClick: handleSave, disabled: !molfile, children: "Save" }, void 0), (0, jsx_runtime_1.jsx)("button", { type: "button", className: "btn", onClick: handleClose, children: "Close" }, void 0)] }, void 0)] }, void 0));
|
|
39
40
|
}
|
|
40
41
|
exports.default = MoleculeStructureEditorModal;
|
|
@@ -73,6 +73,15 @@ const styles = (0, react_1.css) `
|
|
|
73
73
|
.container {
|
|
74
74
|
flex: 1;
|
|
75
75
|
}
|
|
76
|
+
|
|
77
|
+
.infoText {
|
|
78
|
+
padding: 10px;
|
|
79
|
+
font-size: 12px;
|
|
80
|
+
text-align: left;
|
|
81
|
+
color: white;
|
|
82
|
+
background-color: #5f5f5f;
|
|
83
|
+
border-radius: 5px;
|
|
84
|
+
}
|
|
76
85
|
`;
|
|
77
86
|
function MultipleSpectraFiltersModal({ onClose = () => null, nucleus = '', }) {
|
|
78
87
|
const refForm = (0, react_2.useRef)();
|
|
@@ -129,6 +138,6 @@ function MultipleSpectraFiltersModal({ onClose = () => null, nucleus = '', }) {
|
|
|
129
138
|
break;
|
|
130
139
|
}
|
|
131
140
|
}, [filter, submitHandler]);
|
|
132
|
-
return ((0, jsx_runtime_1.jsxs)("div", { css: [ModalStyle_1.ModalStyles, styles], children: [(0, jsx_runtime_1.jsxs)("div", { className: "header handle", children: [(0, jsx_runtime_1.jsx)("span", { children: "Apply filters" }, void 0), (0, jsx_runtime_1.jsx)(CloseButton_1.default, { onClick: onClose, className: "close-bt" }, void 0)] }, void 0), (0, jsx_runtime_1.jsxs)("div", { className: "inner-content container", children: [(0, jsx_runtime_1.jsxs)("div", { className: "row margin-10", children: [(0, jsx_runtime_1.jsx)("span", { className: "custom-label", children: "Filter :" }, void 0), (0, jsx_runtime_1.jsx)(Select_1.default, { data: List, style: { width: 275, height: 30, margin: 0 }, onChange: filterChangeHandler }, void 0)] }, void 0), filterOptions] }, void 0), (0, jsx_runtime_1.jsxs)("div", { className: "footer-container", children: [(0, jsx_runtime_1.jsx)("button", { type: "button", onClick: handleSave, className: "btn primary", children: "Apply" }, void 0), (0, jsx_runtime_1.jsx)("button", { type: "button", onClick: onClose, className: "btn", children: "Close" }, void 0)] }, void 0)] }, void 0));
|
|
141
|
+
return ((0, jsx_runtime_1.jsxs)("div", { css: [ModalStyle_1.ModalStyles, styles], children: [(0, jsx_runtime_1.jsxs)("div", { className: "header handle", children: [(0, jsx_runtime_1.jsx)("span", { children: "Apply filters" }, void 0), (0, jsx_runtime_1.jsx)(CloseButton_1.default, { onClick: onClose, className: "close-bt" }, void 0)] }, void 0), (0, jsx_runtime_1.jsxs)("div", { className: "inner-content container", children: [(0, jsx_runtime_1.jsx)("p", { className: "infoText", children: "This filter will use the exclusions zones defined in the first spectrum." }, void 0), (0, jsx_runtime_1.jsxs)("div", { className: "row margin-10", children: [(0, jsx_runtime_1.jsx)("span", { className: "custom-label", children: "Filter :" }, void 0), (0, jsx_runtime_1.jsx)(Select_1.default, { data: List, style: { width: 275, height: 30, margin: 0 }, onChange: filterChangeHandler }, void 0)] }, void 0), filterOptions] }, void 0), (0, jsx_runtime_1.jsxs)("div", { className: "footer-container", children: [(0, jsx_runtime_1.jsx)("button", { type: "button", onClick: handleSave, className: "btn primary", children: "Apply" }, void 0), (0, jsx_runtime_1.jsx)("button", { type: "button", onClick: onClose, className: "btn", children: "Close" }, void 0)] }, void 0)] }, void 0));
|
|
133
142
|
}
|
|
134
143
|
exports.default = MultipleSpectraFiltersModal;
|
|
@@ -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;
|
|
@@ -8,9 +8,9 @@ const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
|
8
8
|
const react_1 = require("@emotion/react");
|
|
9
9
|
const full_1 = __importDefault(require("openchemlib/full"));
|
|
10
10
|
const react_2 = require("react");
|
|
11
|
+
const react_d3_utils_1 = require("react-d3-utils");
|
|
11
12
|
const react_mf_1 = require("react-mf");
|
|
12
13
|
const react_ocl_nmr_1 = __importDefault(require("react-ocl-nmr"));
|
|
13
|
-
const react_use_1 = require("react-use");
|
|
14
14
|
const ChartContext_1 = require("../../context/ChartContext");
|
|
15
15
|
const DispatchContext_1 = require("../../context/DispatchContext");
|
|
16
16
|
const NextPrev_1 = __importDefault(require("../../elements/NextPrev"));
|
|
@@ -20,48 +20,44 @@ 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
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
`;
|
|
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
|
+
};
|
|
63
60
|
function MoleculePanelInner({ zones, ranges, molecules: moleculesProp, activeTab, displayerMode, }) {
|
|
64
|
-
const [refContainer, { width, height }] = (0, react_use_1.useMeasure)();
|
|
65
61
|
const [currentIndex, setCurrentIndex] = (0, react_2.useState)(0);
|
|
66
62
|
const [molecules, setMolecules] = (0, react_2.useState)([]);
|
|
67
63
|
const dispatch = (0, DispatchContext_1.useDispatch)();
|
|
@@ -90,15 +86,17 @@ function MoleculePanelInner({ zones, ranges, molecules: moleculesProp, activeTab
|
|
|
90
86
|
const moleculeIndexHandler = (0, react_2.useCallback)((index) => {
|
|
91
87
|
setCurrentIndex(index);
|
|
92
88
|
}, []);
|
|
93
|
-
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", {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
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", { style: { width: '100%', height: '100%' }, onClick: () => openMoleculeEditorHandler() }, void 0)) }, void 0) }, void 0)] }, void 0));
|
|
102
100
|
}
|
|
103
101
|
const MemoizedMoleculePanel = (0, react_2.memo)(MoleculePanelInner);
|
|
104
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)();
|
|
@@ -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',
|
|
@@ -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;
|
|
@@ -110,7 +110,6 @@ exports.initialState = {
|
|
|
110
110
|
selectedOptionPanel: null,
|
|
111
111
|
data: {
|
|
112
112
|
baseLineZones: [],
|
|
113
|
-
exclusionZones: {},
|
|
114
113
|
pivot: { value: 0, index: 0 },
|
|
115
114
|
zonesNoiseFactor: 1,
|
|
116
115
|
activeFilterID: null,
|
|
@@ -276,6 +275,10 @@ function innerSpectrumReducer(draft, action) {
|
|
|
276
275
|
return FiltersActions.filterSnapshotHandler(draft, action);
|
|
277
276
|
case types.APPLY_MULTIPLE_SPECTRA_FILTER:
|
|
278
277
|
return FiltersActions.handleMultipleSpectraFilter(draft, action);
|
|
278
|
+
case types.ADD_EXCLUSION_ZONE:
|
|
279
|
+
return FiltersActions.handleAddExclusionZone(draft, action);
|
|
280
|
+
case types.DELETE_EXCLUSION_ZONE:
|
|
281
|
+
return FiltersActions.handleDeleteExclusionZone(draft, action);
|
|
279
282
|
case types.CHANGE_VISIBILITY:
|
|
280
283
|
return SpectrumsActions.handleSpectrumVisibility(draft, action);
|
|
281
284
|
case types.CHANGE_PEAKS_MARKERS_VISIBILITY:
|
|
@@ -376,10 +379,6 @@ function innerSpectrumReducer(draft, action) {
|
|
|
376
379
|
return ToolsActions.handleAddBaseLineZone(draft, action.zone);
|
|
377
380
|
case types.DELETE_BASE_LINE_ZONE:
|
|
378
381
|
return ToolsActions.handleDeleteBaseLineZone(draft, action.id);
|
|
379
|
-
case types.ADD_EXCLUSION_ZONE:
|
|
380
|
-
return ToolsActions.handleAddExclusionZone(draft, action);
|
|
381
|
-
case types.DELETE_EXCLUSION_ZONE:
|
|
382
|
-
return ToolsActions.handleDeleteExclusionZone(draft, action);
|
|
383
382
|
case types.APPLY_BASE_LINE_CORRECTION_FILTER:
|
|
384
383
|
return FiltersActions.handleBaseLineCorrectionFilter(draft, action);
|
|
385
384
|
case types.SET_KEY_PREFERENCES:
|