nmrium 0.43.0 → 0.43.1-pre.1692874523
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/component/1d/ExclusionZonesAnnotations.js +1 -2
- package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.d.ts +2 -2
- package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.js +16 -16
- package/lib/component/1d-2d/components/FloatMoleculeStructures/index.d.ts +2 -2
- package/lib/component/2d/Viewer2D.js +1 -3
- package/lib/component/EventsTrackers/KeysListenerTracker.js +1 -2
- package/lib/component/context/DispatchContext.d.ts +3 -1
- package/lib/component/elements/CounterLabel.d.ts +7 -0
- package/lib/component/elements/CounterLabel.js +12 -0
- package/lib/component/elements/EditableColumn.js +12 -6
- package/lib/component/elements/Input.d.ts +3 -12
- package/lib/component/elements/Input.js +24 -76
- package/lib/component/elements/Message.js +0 -1
- package/lib/component/elements/PreferencesButton.d.ts +4 -0
- package/lib/component/elements/PreferencesButton.js +6 -0
- package/lib/component/elements/formik/FormikInput.d.ts +2 -2
- package/lib/component/elements/formik/FormikInput.js +3 -6
- package/lib/component/header/Header.js +1 -1
- package/lib/component/header/ZeroFillingOptionsPanel.js +4 -4
- package/lib/component/main/InnerNMRiumContents.js +1 -2
- package/lib/component/modal/AlignSpectraModal.js +78 -29
- package/lib/component/modal/MoleculeStructureEditorModal.d.ts +5 -1
- package/lib/component/modal/MoleculeStructureEditorModal.js +12 -15
- package/lib/component/modal/MultipletAnalysisModal.js +1 -1
- package/lib/component/modal/{AboutUsModal.js → aboutUs/AboutUsModal.js} +4 -3
- package/lib/component/modal/aboutUs/AboutUsZakodium.d.ts +1 -0
- package/lib/component/modal/aboutUs/AboutUsZakodium.js +33 -0
- package/lib/component/modal/changeSum/ChangeSumModalContents.js +1 -1
- package/lib/component/modal/metaImportation/MetaImportationModal.js +1 -1
- package/lib/component/modal/setting/settings-tabs/GeneralTabContent.js +1 -1
- package/lib/component/modal/setting/settings-tabs/ImportationFiltersTabContent.js +1 -1
- package/lib/component/modal/setting/settingsValidation.js +5 -1
- package/lib/component/panels/InformationPanel.js +9 -100
- package/lib/component/panels/IntegralsPanel/IntegralTable.js +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculePanel.js +2 -2
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.d.ts +10 -6
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +4 -5
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +5 -5
- package/lib/component/panels/Panels.js +6 -7
- package/lib/component/panels/PeaksPanel/PeaksTable.js +1 -1
- package/lib/component/panels/RangesPanel/TableColumns/RelativeColumn.js +1 -1
- package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.js +1 -1
- package/lib/component/panels/SpectrumsPanel/SpectraPanelHeader.js +1 -2
- package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +2 -2
- package/lib/component/panels/SummaryPanel/SummaryPanel.js +2 -3
- package/lib/component/panels/SummaryPanel/utilities/Utilities.d.ts +2 -3
- package/lib/component/panels/SummaryPanel/utilities/Utilities.js +2 -3
- package/lib/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.js +8 -9
- package/lib/component/panels/databasePanel/DatabasePanel.d.ts +18 -1
- package/lib/component/panels/databasePanel/DatabasePanel.js +3 -40
- package/lib/component/panels/databasePanel/DatabaseSearchOptions.d.ts +18 -0
- package/lib/component/panels/databasePanel/DatabaseSearchOptions.js +53 -0
- package/lib/component/panels/header/DefaultPanelHeader.js +4 -10
- package/lib/component/panels/predictionPanel/PredictionPanel.js +2 -2
- package/lib/component/reducer/IgnoreActions.js +1 -0
- package/lib/component/reducer/Reducer.d.ts +2 -2
- package/lib/component/reducer/Reducer.js +4 -2
- package/lib/component/reducer/actions/DomainActions.js +2 -3
- package/lib/component/reducer/actions/MoleculeActions.js +3 -3
- package/lib/component/reducer/actions/PreferencesActions.js +1 -2
- package/lib/component/reducer/actions/ToolsActions.js +10 -10
- package/lib/component/reducer/core/Constants.d.ts +0 -4
- package/lib/component/reducer/core/Constants.js +0 -5
- package/lib/component/reducer/helper/ZoomHistoryManager.js +1 -2
- package/lib/component/toolbar/ToolTypes.d.ts +2 -2
- package/lib/component/toolbar/ToolTypes.js +23 -24
- package/lib/data/constants/References.d.ts +5 -3
- package/lib/data/data1d/Spectrum1D/getReferenceShift.d.ts +10 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectSignal.js +1 -1
- package/lib/versionInfo.js +1 -1
- package/lib-cjs/component/1d/ExclusionZonesAnnotations.js +1 -2
- package/lib-cjs/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.js +16 -16
- package/lib-cjs/component/2d/Viewer2D.js +1 -3
- package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +1 -2
- package/lib-cjs/component/elements/CounterLabel.js +16 -0
- package/lib-cjs/component/elements/EditableColumn.js +12 -6
- package/lib-cjs/component/elements/Input.js +23 -75
- package/lib-cjs/component/elements/Message.js +0 -1
- package/lib-cjs/component/elements/PreferencesButton.js +13 -0
- package/lib-cjs/component/elements/formik/FormikInput.js +3 -6
- package/lib-cjs/component/header/Header.js +1 -1
- package/lib-cjs/component/header/ZeroFillingOptionsPanel.js +4 -4
- package/lib-cjs/component/main/InnerNMRiumContents.js +1 -2
- package/lib-cjs/component/modal/AlignSpectraModal.js +100 -28
- package/lib-cjs/component/modal/MoleculeStructureEditorModal.js +11 -17
- package/lib-cjs/component/modal/MultipletAnalysisModal.js +1 -1
- package/lib-cjs/component/modal/{AboutUsModal.js → aboutUs/AboutUsModal.js} +4 -3
- package/lib-cjs/component/modal/aboutUs/AboutUsZakodium.js +39 -0
- package/lib-cjs/component/modal/changeSum/ChangeSumModalContents.js +1 -1
- package/lib-cjs/component/modal/metaImportation/MetaImportationModal.js +1 -1
- package/lib-cjs/component/modal/setting/settings-tabs/GeneralTabContent.js +1 -1
- package/lib-cjs/component/modal/setting/settings-tabs/ImportationFiltersTabContent.js +1 -1
- package/lib-cjs/component/modal/setting/settingsValidation.js +4 -0
- package/lib-cjs/component/panels/InformationPanel.js +7 -98
- package/lib-cjs/component/panels/IntegralsPanel/IntegralTable.js +1 -1
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanel.js +2 -2
- package/lib-cjs/component/panels/MoleculesPanel/useAtomAssignment.js +4 -5
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +4 -4
- package/lib-cjs/component/panels/Panels.js +6 -7
- package/lib-cjs/component/panels/PeaksPanel/PeaksTable.js +1 -1
- package/lib-cjs/component/panels/RangesPanel/TableColumns/RelativeColumn.js +1 -1
- package/lib-cjs/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.js +1 -1
- package/lib-cjs/component/panels/SpectrumsPanel/SpectraPanelHeader.js +1 -2
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +2 -2
- package/lib-cjs/component/panels/SummaryPanel/SummaryPanel.js +2 -3
- package/lib-cjs/component/panels/SummaryPanel/utilities/Utilities.js +4 -5
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.js +7 -8
- package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +3 -40
- package/lib-cjs/component/panels/databasePanel/DatabaseSearchOptions.js +60 -0
- package/lib-cjs/component/panels/header/DefaultPanelHeader.js +3 -9
- package/lib-cjs/component/panels/predictionPanel/PredictionPanel.js +2 -2
- package/lib-cjs/component/reducer/IgnoreActions.js +1 -0
- package/lib-cjs/component/reducer/Reducer.js +4 -2
- package/lib-cjs/component/reducer/actions/DomainActions.js +2 -3
- package/lib-cjs/component/reducer/actions/MoleculeActions.js +2 -2
- package/lib-cjs/component/reducer/actions/PreferencesActions.js +1 -2
- package/lib-cjs/component/reducer/actions/ToolsActions.js +9 -9
- package/lib-cjs/component/reducer/core/Constants.js +1 -6
- package/lib-cjs/component/reducer/helper/ZoomHistoryManager.js +1 -2
- package/lib-cjs/component/toolbar/ToolTypes.js +23 -24
- package/lib-cjs/data/data1d/Spectrum1D/ranges/detectSignal.js +1 -1
- package/lib-cjs/versionInfo.js +1 -1
- package/package.json +3 -3
- /package/lib/component/modal/{AboutUsModal.d.ts → aboutUs/AboutUsModal.d.ts} +0 -0
|
@@ -5,107 +5,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
7
|
const react_1 = require("react");
|
|
8
|
-
const
|
|
9
|
-
const ReactTableFlexLayout_1 = __importDefault(require("../elements/ReactTable/ReactTableFlexLayout"));
|
|
8
|
+
const ui_1 = require("react-science/ui");
|
|
10
9
|
const useSpectrum_1 = __importDefault(require("../hooks/useSpectrum"));
|
|
11
|
-
const styles = {
|
|
12
|
-
container: {
|
|
13
|
-
height: '100%',
|
|
14
|
-
flexDirection: 'column',
|
|
15
|
-
display: 'flex',
|
|
16
|
-
width: '100%',
|
|
17
|
-
},
|
|
18
|
-
tableContainer: {
|
|
19
|
-
overflow: 'auto',
|
|
20
|
-
display: 'block',
|
|
21
|
-
},
|
|
22
|
-
tableHeader: {
|
|
23
|
-
padding: ' 5px 10px',
|
|
24
|
-
backgroundColor: ' #f8f8f8',
|
|
25
|
-
borderBottom: '1px solid gray',
|
|
26
|
-
fontSize: '1em',
|
|
27
|
-
cursor: 'pointer',
|
|
28
|
-
},
|
|
29
|
-
};
|
|
30
|
-
function Arrow(props) {
|
|
31
|
-
const { isOpen = true } = props;
|
|
32
|
-
return ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
33
|
-
fontSize: '1.3em',
|
|
34
|
-
transform: `rotate(${isOpen ? 90 : 0}deg)`,
|
|
35
|
-
transformOrigin: '50% 50%',
|
|
36
|
-
display: 'inline-block',
|
|
37
|
-
lineHeight: 1,
|
|
38
|
-
padding: isOpen ? '5px 0 0 0' : '0 5px 0 0',
|
|
39
|
-
verticalAlign: 'middle',
|
|
40
|
-
}, children: "\u2023" }));
|
|
41
|
-
}
|
|
42
|
-
function InformationTable(props) {
|
|
43
|
-
const { data, columns, title, onClick, isOpen = true } = props;
|
|
44
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { style: styles.tableHeader, onClick: onClick, children: [(0, jsx_runtime_1.jsx)(Arrow, { isOpen: isOpen }), (0, jsx_runtime_1.jsx)("span", { style: { verticalAlign: 'middle', display: 'inline-block' }, children: title })] }), isOpen && ((0, jsx_runtime_1.jsx)(ReactTableFlexLayout_1.default, { data: data, columns: columns, style: { height: 'auto' } }))] }));
|
|
45
|
-
}
|
|
46
|
-
function filter(searchKey, data) {
|
|
47
|
-
const result = [];
|
|
48
|
-
for (const key in data) {
|
|
49
|
-
if (!searchKey || key.toLowerCase().includes(searchKey)) {
|
|
50
|
-
result.push({ key, value: data[key] });
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
return result;
|
|
54
|
-
}
|
|
55
|
-
const columns = [
|
|
56
|
-
{
|
|
57
|
-
Header: 'Parameter',
|
|
58
|
-
sortType: 'basic',
|
|
59
|
-
minWidth: 100,
|
|
60
|
-
width: 20,
|
|
61
|
-
maxWidth: 20,
|
|
62
|
-
accessor: 'key',
|
|
63
|
-
Cell: ({ row }) => ((0, jsx_runtime_1.jsx)("p", { style: { padding: '5px', backgroundColor: 'white' }, children: row.original.key })),
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
Header: 'Value',
|
|
67
|
-
sortType: 'basic',
|
|
68
|
-
resizable: true,
|
|
69
|
-
accessor: 'value',
|
|
70
|
-
Cell: ({ row }) => ((0, jsx_runtime_1.jsx)("p", { style: {
|
|
71
|
-
backgroundColor: '#efefef',
|
|
72
|
-
height: '100%',
|
|
73
|
-
padding: '5px',
|
|
74
|
-
fontFamily: 'monospace',
|
|
75
|
-
whiteSpace: 'pre',
|
|
76
|
-
overflow: 'hidden',
|
|
77
|
-
}, children: `${row.original.value}` })),
|
|
78
|
-
},
|
|
79
|
-
];
|
|
80
|
-
function InformationPanelInner({ info, meta, customInfo, }) {
|
|
81
|
-
const [searchKey, setSearchKey] = (0, react_1.useState)();
|
|
82
|
-
const [panelsStatus, openPanel] = (0, react_1.useState)({
|
|
83
|
-
info: true,
|
|
84
|
-
meta: true,
|
|
85
|
-
customInfo: true,
|
|
86
|
-
});
|
|
87
|
-
function handleSearch(e) {
|
|
88
|
-
const searchKey = e.target.value.toLowerCase();
|
|
89
|
-
setSearchKey(searchKey);
|
|
90
|
-
}
|
|
91
|
-
const matchesInfo = filter(searchKey, info);
|
|
92
|
-
const matchesMeta = filter(searchKey, meta);
|
|
93
|
-
const matchesMetaInfo = filter(searchKey, customInfo);
|
|
94
|
-
function handleOpen(key) {
|
|
95
|
-
openPanel((prevPanelsStatus) => ({
|
|
96
|
-
...prevPanelsStatus,
|
|
97
|
-
[key]: !prevPanelsStatus[key],
|
|
98
|
-
}));
|
|
99
|
-
}
|
|
100
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: styles.container, children: [(0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(Input_1.default, { placeholder: "Search for parameter...", onChange: handleSearch, debounceTime: 250, style: {
|
|
101
|
-
inputWrapper: { width: '100%' },
|
|
102
|
-
input: { textAlign: 'left', padding: '5px' },
|
|
103
|
-
} }) }), (0, jsx_runtime_1.jsxs)("div", { style: styles.tableContainer, children: [(0, jsx_runtime_1.jsx)(InformationTable, { data: matchesMetaInfo, columns: columns, title: "Custom information", onClick: () => handleOpen('customInfo'), isOpen: panelsStatus.customInfo }), (0, jsx_runtime_1.jsx)(InformationTable, { data: matchesInfo, columns: columns, title: "Spectrum information", onClick: () => handleOpen('info'), isOpen: panelsStatus.info }), (0, jsx_runtime_1.jsx)(InformationTable, { data: matchesMeta, columns: columns, title: "Other spectrum parameters", onClick: () => handleOpen('meta'), isOpen: panelsStatus.meta })] })] }));
|
|
104
|
-
}
|
|
105
|
-
const MemoizedInformationPanel = (0, react_1.memo)(InformationPanelInner);
|
|
106
10
|
const emptyData = { info: {}, meta: {} };
|
|
107
11
|
function InformationPanel() {
|
|
108
12
|
const { info, meta, customInfo } = (0, useSpectrum_1.default)(emptyData);
|
|
109
|
-
|
|
13
|
+
const data = (0, react_1.useMemo)(() => [
|
|
14
|
+
{ description: 'Custom information', data: customInfo || {} },
|
|
15
|
+
{ description: 'Spectrum information', data: info || {} },
|
|
16
|
+
{ description: 'Other spectrum parameters', data: meta || {} },
|
|
17
|
+
], [customInfo, info, meta]);
|
|
18
|
+
return (0, jsx_runtime_1.jsx)(ui_1.InfoPanel, { data: data, title: "" });
|
|
110
19
|
}
|
|
111
20
|
exports.default = InformationPanel;
|
|
@@ -92,7 +92,7 @@ function IntegralTable({ activeTab, data }) {
|
|
|
92
92
|
const value = (0, formatNumber_1.formatNumber)(row.original.integral || 0, integralsPreferences.relative.format);
|
|
93
93
|
const flag = (0, Spectrum1D_1.checkIntegralKind)(row.original);
|
|
94
94
|
const integral = flag ? value : `[ ${value} ]`;
|
|
95
|
-
return ((0, jsx_runtime_1.jsx)(EditableColumn_1.default, { value: integral, onSave: (event) => saveRelativeHandler(event, row.original), type: "number" }));
|
|
95
|
+
return ((0, jsx_runtime_1.jsx)(EditableColumn_1.default, { value: integral, onSave: (event) => saveRelativeHandler(event, row.original), type: "number", validate: (val) => val !== '' }));
|
|
96
96
|
},
|
|
97
97
|
},
|
|
98
98
|
{
|
|
@@ -52,7 +52,7 @@ function MoleculePanelInner(props) {
|
|
|
52
52
|
const [currentIndex, setCurrentIndex] = (0, react_2.useState)(0);
|
|
53
53
|
const [molecules, setMolecules] = (0, react_2.useState)([]);
|
|
54
54
|
const dispatch = (0, DispatchContext_1.useDispatch)();
|
|
55
|
-
const openMoleculeEditor = (0, MoleculeStructureEditorModal_1.useMoleculeEditor)();
|
|
55
|
+
const { modal, openMoleculeEditor } = (0, MoleculeStructureEditorModal_1.useMoleculeEditor)();
|
|
56
56
|
const { currentDiaIDsToHighlight, handleOnAtomHover, handleOnClickAtom, assignedDiaIDsMerged, } = (0, useAtomAssignment_1.default)({ zones, ranges, activeTab, displayerMode });
|
|
57
57
|
(0, react_2.useEffect)(() => {
|
|
58
58
|
if (moleculesProp) {
|
|
@@ -84,7 +84,7 @@ function MoleculePanelInner(props) {
|
|
|
84
84
|
currentDiaIDsToHighlight.length > 0
|
|
85
85
|
? currentDiaIDsToHighlight
|
|
86
86
|
: assignedDiaIDsMerged, setHoverAtom: handleOnAtomHover, showAtomNumber: moleculesView?.[mol.id]?.showAtomNumber || false }) })] }, mol.id)))) : ((0, jsx_runtime_1.jsx)("div", { css: styles.slider, style: { height: '100%' }, onClick: () => openMoleculeEditor(), children: (0, jsx_runtime_1.jsx)("span", { children: "Click to draw molecule" }) })) }));
|
|
87
|
-
} }) }) })] }));
|
|
87
|
+
} }) }) }), modal] }));
|
|
88
88
|
}
|
|
89
89
|
const MemoizedMoleculePanel = (0, react_2.memo)(MoleculePanelInner);
|
|
90
90
|
const emptyData = { ranges: {}, zones: {} };
|
|
@@ -11,7 +11,6 @@ const filterForIDsWithAssignment_1 = require("../../assignment/utilities/filterF
|
|
|
11
11
|
const DispatchContext_1 = require("../../context/DispatchContext");
|
|
12
12
|
const Alert_1 = require("../../elements/popup/Alert");
|
|
13
13
|
const highlight_1 = require("../../highlight");
|
|
14
|
-
const Constants_1 = require("../../reducer/core/Constants");
|
|
15
14
|
const Utilities_1 = require("./Utilities");
|
|
16
15
|
function useAtomAssignment({ displayerMode, activeTab: nucleus, zones, ranges, }) {
|
|
17
16
|
const alert = (0, Alert_1.useAlert)();
|
|
@@ -46,10 +45,10 @@ function useAtomAssignment({ displayerMode, activeTab: nucleus, zones, ranges, }
|
|
|
46
45
|
}, [onAtomHoverAction, onAtomHoverHighlights, highlightData]);
|
|
47
46
|
const data = (0, react_1.useMemo)(() => {
|
|
48
47
|
if (zones || ranges) {
|
|
49
|
-
if (displayerMode ===
|
|
48
|
+
if (displayerMode === '1D' && ranges?.values) {
|
|
50
49
|
return ranges.values;
|
|
51
50
|
}
|
|
52
|
-
else if (displayerMode ===
|
|
51
|
+
else if (displayerMode === '2D' && zones?.values) {
|
|
53
52
|
return zones.values;
|
|
54
53
|
}
|
|
55
54
|
}
|
|
@@ -112,7 +111,7 @@ function useAtomAssignment({ displayerMode, activeTab: nucleus, zones, ranges, }
|
|
|
112
111
|
const atomInformation = (0, Utilities_1.extractFromAtom)(diaIDAndInfo, nucleus, axis);
|
|
113
112
|
if (atomInformation.nbAtoms > 0) {
|
|
114
113
|
// save assignment in assignment hook
|
|
115
|
-
const dimension = displayerMode ===
|
|
114
|
+
const dimension = displayerMode === '1D' ? '1D' : '2D';
|
|
116
115
|
activeAssignment.toggle(atomInformation.oclIDs, dimension);
|
|
117
116
|
// save assignment (diaIDs) in range/zone data
|
|
118
117
|
const { datum, signalIndex } = (0, Utilities_1.findDatumAndSignalIndex)(data, activeAssignment.id);
|
|
@@ -120,7 +119,7 @@ function useAtomAssignment({ displayerMode, activeTab: nucleus, zones, ranges, }
|
|
|
120
119
|
// determine the level of setting the diaIDs array (range vs. signal level) and save there
|
|
121
120
|
// let nbAtoms = 0;
|
|
122
121
|
// on range/zone level
|
|
123
|
-
if (displayerMode ===
|
|
122
|
+
if (displayerMode === '1D') {
|
|
124
123
|
const range = datum;
|
|
125
124
|
let _diaIDs = [];
|
|
126
125
|
if (signalIndex === undefined) {
|
package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js
CHANGED
|
@@ -27,7 +27,7 @@ const DefaultPanelHeader_1 = __importDefault(require("../header/DefaultPanelHead
|
|
|
27
27
|
const PreferencesHeader_1 = __importDefault(require("../header/PreferencesHeader"));
|
|
28
28
|
const MultipleSpectraAnalysisTable_1 = __importDefault(require("./MultipleSpectraAnalysisTable"));
|
|
29
29
|
const preferences_1 = __importDefault(require("./preferences"));
|
|
30
|
-
function MultipleSpectraAnalysisPanelInner({ activeTab, spectra, showLegend, }) {
|
|
30
|
+
function MultipleSpectraAnalysisPanelInner({ activeTab, spectra, showLegend, displayerMode, }) {
|
|
31
31
|
const [isFlipped, setFlipStatus] = (0, react_2.useState)(false);
|
|
32
32
|
const spectraPreferences = (0, usePanelPreferences_1.usePanelPreferences)('spectra', activeTab);
|
|
33
33
|
const preferences = (0, usePanelPreferences_1.usePanelPreferences)('multipleSpectraAnalysis', activeTab);
|
|
@@ -71,15 +71,15 @@ function MultipleSpectraAnalysisPanelInner({ activeTab, spectra, showLegend, })
|
|
|
71
71
|
position: relative;
|
|
72
72
|
}
|
|
73
73
|
`,
|
|
74
|
-
], children: [!isFlipped && ((0, jsx_runtime_1.jsxs)(DefaultPanelHeader_1.default, { deleteToolTip: "Delete All Peaks", showSettingButton: true, canDelete: false, onSettingClick: settingsPanelHandler, children: [(0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "Copy To Clipboard", onClick: copyToClipboardHandler, children: (0, jsx_runtime_1.jsx)(fa_1.FaFileExport, {}) }), (0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "Spectra calibration", onClick: openAlignSpectra, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrOverlay, { style: { fontSize: '18px' } }) }), (0, jsx_runtime_1.jsx)(ToggleButton_1.default, { popupTitle: "Y spectra tracker", popupPlacement: "right", onClick: showTrackerHandler, defaultValue: showLegend, children: (0, jsx_runtime_1.jsx)(io5_1.IoPulseOutline, {}) }, `${showLegend}`)] })), isFlipped && ((0, jsx_runtime_1.jsx)(PreferencesHeader_1.default, { onSave: saveSettingHandler, onClose: settingsPanelHandler })), (0, jsx_runtime_1.jsx)("div", { className: "inner-container", children: !isFlipped ? ((0, jsx_runtime_1.jsx)(MultipleSpectraAnalysisTable_1.default, { data: spectraAnalysis, resortSpectra: preferences.analysisOptions.resortSpectra, activeTab: activeTab })) : ((0, jsx_runtime_1.jsx)(preferences_1.default, { data: spectraAnalysis, activeTab: activeTab, onAfterSave: afterSaveHandler, ref: settingRef })) }), (0, jsx_runtime_1.jsx)(clipboardComponents_1.ClipboardFallbackModal, { mode: shouldFallback, onDismiss: cleanShouldFallback, text: text, label: "Spectra Analysis" })] }));
|
|
74
|
+
], children: [!isFlipped && ((0, jsx_runtime_1.jsxs)(DefaultPanelHeader_1.default, { deleteToolTip: "Delete All Peaks", showSettingButton: true, canDelete: false, onSettingClick: settingsPanelHandler, children: [(0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "Copy To Clipboard", onClick: copyToClipboardHandler, children: (0, jsx_runtime_1.jsx)(fa_1.FaFileExport, {}) }), displayerMode === '1D' && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "Spectra calibration", onClick: openAlignSpectra, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrOverlay, { style: { fontSize: '18px' } }) }), (0, jsx_runtime_1.jsx)(ToggleButton_1.default, { popupTitle: "Y spectra tracker", popupPlacement: "right", onClick: showTrackerHandler, defaultValue: showLegend, children: (0, jsx_runtime_1.jsx)(io5_1.IoPulseOutline, {}) }, `${showLegend}`)] }))] })), isFlipped && ((0, jsx_runtime_1.jsx)(PreferencesHeader_1.default, { onSave: saveSettingHandler, onClose: settingsPanelHandler })), (0, jsx_runtime_1.jsx)("div", { className: "inner-container", children: !isFlipped ? ((0, jsx_runtime_1.jsx)(MultipleSpectraAnalysisTable_1.default, { data: spectraAnalysis, resortSpectra: preferences.analysisOptions.resortSpectra, activeTab: activeTab })) : ((0, jsx_runtime_1.jsx)(preferences_1.default, { data: spectraAnalysis, activeTab: activeTab, onAfterSave: afterSaveHandler, ref: settingRef })) }), (0, jsx_runtime_1.jsx)(clipboardComponents_1.ClipboardFallbackModal, { mode: shouldFallback, onDismiss: cleanShouldFallback, text: text, label: "Spectra Analysis" })] }));
|
|
75
75
|
}
|
|
76
76
|
const MemoizedMultipleSpectraAnalysisPanel = (0, react_2.memo)(MultipleSpectraAnalysisPanelInner);
|
|
77
77
|
function MultipleSpectraAnalysisPanel() {
|
|
78
|
-
const { data, view: { spectra: { activeTab, showLegend }, }, displayerKey, } = (0, ChartContext_1.useChartData)();
|
|
78
|
+
const { data, view: { spectra: { activeTab, showLegend }, }, displayerKey, displayerMode, } = (0, ChartContext_1.useChartData)();
|
|
79
79
|
const spectra = (0, getSpectraByNucleus_1.getSpectraByNucleus)(activeTab, data);
|
|
80
80
|
if (!activeTab) {
|
|
81
81
|
return (0, jsx_runtime_1.jsx)("div", {});
|
|
82
82
|
}
|
|
83
|
-
return ((0, jsx_runtime_1.jsx)(MemoizedMultipleSpectraAnalysisPanel, { activeTab, displayerKey, spectra, showLegend }));
|
|
83
|
+
return ((0, jsx_runtime_1.jsx)(MemoizedMultipleSpectraAnalysisPanel, { activeTab, displayerMode, displayerKey, spectra, showLegend }));
|
|
84
84
|
}
|
|
85
85
|
exports.default = MultipleSpectraAnalysisPanel;
|
|
@@ -11,7 +11,6 @@ const ui_1 = require("react-science/ui");
|
|
|
11
11
|
const ChartContext_1 = require("../context/ChartContext");
|
|
12
12
|
const PreferencesContext_1 = require("../context/PreferencesContext");
|
|
13
13
|
const useCheckExperimentalFeature_1 = __importDefault(require("../hooks/useCheckExperimentalFeature"));
|
|
14
|
-
const Constants_1 = require("../reducer/core/Constants");
|
|
15
14
|
const AutomaticAssignment_1 = __importDefault(require("./AutomaticAssignment/AutomaticAssignment"));
|
|
16
15
|
const InformationPanel_1 = __importDefault(require("./InformationPanel"));
|
|
17
16
|
const IntegralPanel_1 = __importDefault(require("./IntegralsPanel/IntegralPanel"));
|
|
@@ -45,7 +44,7 @@ const accordionItems = [
|
|
|
45
44
|
title: 'Peaks',
|
|
46
45
|
component: (0, jsx_runtime_1.jsx)(PeaksPanel_1.default, {}),
|
|
47
46
|
hidePreferenceKey: 'peaksPanel',
|
|
48
|
-
mode:
|
|
47
|
+
mode: '1D',
|
|
49
48
|
},
|
|
50
49
|
{
|
|
51
50
|
title: 'Processings',
|
|
@@ -57,13 +56,13 @@ const accordionItems = [
|
|
|
57
56
|
title: 'Integrals',
|
|
58
57
|
component: (0, jsx_runtime_1.jsx)(IntegralPanel_1.default, {}),
|
|
59
58
|
hidePreferenceKey: 'integralsPanel',
|
|
60
|
-
mode:
|
|
59
|
+
mode: '1D',
|
|
61
60
|
},
|
|
62
61
|
{
|
|
63
62
|
title: 'Ranges',
|
|
64
63
|
component: (0, jsx_runtime_1.jsx)(RangesPanel_1.default, {}),
|
|
65
64
|
hidePreferenceKey: 'rangesPanel',
|
|
66
|
-
mode:
|
|
65
|
+
mode: '1D',
|
|
67
66
|
},
|
|
68
67
|
{
|
|
69
68
|
title: 'Multiple Spectra Analysis',
|
|
@@ -75,13 +74,13 @@ const accordionItems = [
|
|
|
75
74
|
title: 'Matrix Generation',
|
|
76
75
|
component: (0, jsx_runtime_1.jsx)(MatrixGenerationPanel_1.default, {}),
|
|
77
76
|
hidePreferenceKey: 'matrixGenerationPanel',
|
|
78
|
-
mode:
|
|
77
|
+
mode: '1D',
|
|
79
78
|
},
|
|
80
79
|
{
|
|
81
80
|
title: 'Zones',
|
|
82
81
|
component: (0, jsx_runtime_1.jsx)(ZonesPanel_1.default, {}),
|
|
83
82
|
hidePreferenceKey: 'zonesPanel',
|
|
84
|
-
mode:
|
|
83
|
+
mode: '2D',
|
|
85
84
|
},
|
|
86
85
|
{
|
|
87
86
|
title: 'Summary',
|
|
@@ -117,7 +116,7 @@ const accordionItems = [
|
|
|
117
116
|
title: 'Spectrum Simulation',
|
|
118
117
|
component: (0, jsx_runtime_1.jsx)(SpectrumSimulation_1.default, {}),
|
|
119
118
|
hidePreferenceKey: 'simulationPanel',
|
|
120
|
-
mode:
|
|
119
|
+
mode: '1D',
|
|
121
120
|
},
|
|
122
121
|
];
|
|
123
122
|
exports.TOOLS_PANELS_ACCORDION = {
|
|
@@ -59,7 +59,7 @@ function PeaksTable({ activeTab, data }) {
|
|
|
59
59
|
index: 3,
|
|
60
60
|
Header: 'δ (ppm)',
|
|
61
61
|
accessor: 'x',
|
|
62
|
-
Cell: ({ row }) => ((0, jsx_runtime_1.jsx)(EditableColumn_1.default, { value: (0, formatNumber_1.formatNumber)(row.original.x, peaksPreferences.deltaPPM.format), onSave: (event) => saveDeltaPPMRefsHandler(event, row.original), type: "number" })),
|
|
62
|
+
Cell: ({ row }) => ((0, jsx_runtime_1.jsx)(EditableColumn_1.default, { value: (0, formatNumber_1.formatNumber)(row.original.x, peaksPreferences.deltaPPM.format), onSave: (event) => saveDeltaPPMRefsHandler(event, row.original), type: "number", validate: (val) => val !== '' })),
|
|
63
63
|
},
|
|
64
64
|
{
|
|
65
65
|
showWhen: 'deltaHz.show',
|
|
@@ -22,6 +22,6 @@ function RelativeColumn({ row, rowSpanTags, onHover, format, }) {
|
|
|
22
22
|
},
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
|
-
return ((0, jsx_runtime_1.jsx)("td", { ...rowSpanTags, ...onHover, children: (0, jsx_runtime_1.jsx)(EditableColumn_1.default, { value: integralVal, onSave: saveHandler, type: "number", style: { padding: '0.1rem 0.4rem' } }) }));
|
|
25
|
+
return ((0, jsx_runtime_1.jsx)("td", { ...rowSpanTags, ...onHover, children: (0, jsx_runtime_1.jsx)(EditableColumn_1.default, { value: integralVal, onSave: saveHandler, validate: (val) => val !== '', type: "number", style: { padding: '0.1rem 0.4rem' } }) }));
|
|
26
26
|
}
|
|
27
27
|
exports.default = RelativeColumn;
|
|
@@ -23,6 +23,6 @@ function SignalDeltaColumn({ row, onHover, format, rowSpanTags, }) {
|
|
|
23
23
|
}
|
|
24
24
|
if (!signal)
|
|
25
25
|
return (0, jsx_runtime_1.jsx)("td", { children: '' });
|
|
26
|
-
return ((0, jsx_runtime_1.jsx)("td", { ...rowSpanTags, ...onHover, children: !(0, nmr_processing_1.checkMultiplicity)(signal.multiplicity, ['m']) ? (`${(0, formatNumber_1.formatNumber)(row.from, format)} - ${(0, formatNumber_1.formatNumber)(row.to, format)}`) : ((0, jsx_runtime_1.jsx)(EditableColumn_1.default, { value: (0, formatNumber_1.formatNumber)(signal.delta, format), onSave: saveHandler, type: "number", style: { padding: '0.1rem 0.4rem' } })) }));
|
|
26
|
+
return ((0, jsx_runtime_1.jsx)("td", { ...rowSpanTags, ...onHover, children: !(0, nmr_processing_1.checkMultiplicity)(signal.multiplicity, ['m']) ? (`${(0, formatNumber_1.formatNumber)(row.from, format)} - ${(0, formatNumber_1.formatNumber)(row.to, format)}`) : ((0, jsx_runtime_1.jsx)(EditableColumn_1.default, { value: (0, formatNumber_1.formatNumber)(signal.delta, format), onSave: saveHandler, type: "number", style: { padding: '0.1rem 0.4rem' }, validate: (val) => val !== '' })) }));
|
|
27
27
|
}
|
|
28
28
|
exports.default = SignalDeltaColumn;
|
|
@@ -15,7 +15,6 @@ const Alert_1 = require("../../elements/popup/Alert");
|
|
|
15
15
|
const Modal_1 = require("../../elements/popup/Modal");
|
|
16
16
|
const useActiveSpectra_1 = require("../../hooks/useActiveSpectra");
|
|
17
17
|
const useSpectrum_1 = __importDefault(require("../../hooks/useSpectrum"));
|
|
18
|
-
const Constants_1 = require("../../reducer/core/Constants");
|
|
19
18
|
const getSpectraByNucleus_1 = require("../../utility/getSpectraByNucleus");
|
|
20
19
|
const DefaultPanelHeader_1 = __importDefault(require("../header/DefaultPanelHeader"));
|
|
21
20
|
const SpectraAutomaticPickingButton_1 = require("../header/SpectraAutomaticPickingButton");
|
|
@@ -87,7 +86,7 @@ function SpectraPanelHeaderInner({ data, activeSpectrum, activeSpectra, activeTa
|
|
|
87
86
|
});
|
|
88
87
|
}
|
|
89
88
|
const hasActiveSpectra = activeSpectra && activeSpectra?.length > 0;
|
|
90
|
-
return ((0, jsx_runtime_1.jsxs)(DefaultPanelHeader_1.default, { onDelete: handleDelete, counter: spectra?.length, deleteToolTip: "Delete selected spectra", disableDelete: !hasActiveSpectra, showSettingButton: true, onSettingClick: onSettingClick, children: [(0, jsx_runtime_1.jsx)(Button_1.default.BarButton, { toolTip: "Hide selected spectra", onClick: hideAllSpectrumsHandler, tooltipOrientation: "horizontal", disabled: !hasActiveSpectra, children: (0, jsx_runtime_1.jsx)(fa_1.FaEyeSlash, {}) }), (0, jsx_runtime_1.jsx)(Button_1.default.BarButton, { onClick: showAllSpectrumsHandler, toolTip: "Show selected spectra", tooltipOrientation: "horizontal", disabled: !hasActiveSpectra, children: (0, jsx_runtime_1.jsx)(fa_1.FaEye, {}) }), displayerMode ===
|
|
89
|
+
return ((0, jsx_runtime_1.jsxs)(DefaultPanelHeader_1.default, { onDelete: handleDelete, counter: spectra?.length, deleteToolTip: "Delete selected spectra", disableDelete: !hasActiveSpectra, showSettingButton: true, onSettingClick: onSettingClick, children: [(0, jsx_runtime_1.jsx)(Button_1.default.BarButton, { toolTip: "Hide selected spectra", onClick: hideAllSpectrumsHandler, tooltipOrientation: "horizontal", disabled: !hasActiveSpectra, children: (0, jsx_runtime_1.jsx)(fa_1.FaEyeSlash, {}) }), (0, jsx_runtime_1.jsx)(Button_1.default.BarButton, { onClick: showAllSpectrumsHandler, toolTip: "Show selected spectra", tooltipOrientation: "horizontal", disabled: !hasActiveSpectra, children: (0, jsx_runtime_1.jsx)(fa_1.FaEye, {}) }), displayerMode === '2D' && activeSpectrum?.info.isFt && ((0, jsx_runtime_1.jsx)(Button_1.default.BarButton, { toolTip: "Add missing projection", tooltipOrientation: "horizontal", onClick: addMissingProjectionHandler, children: (0, jsx_runtime_1.jsx)(fa_1.FaCreativeCommonsSamplingPlus, {}) })), displayerMode === '1D' && spectra.length > 1 && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Button_1.default.BarButton, { tooltipOrientation: "horizontal", toolTip: "Reset scale", onClick: resetScaleHandler, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrResetScale, {}) }), (0, jsx_runtime_1.jsx)(Button_1.default.BarButton, { tooltipOrientation: "horizontal", toolTip: "Same top", onClick: setSameTopHandler, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrSameTop, {}) })] })), (0, jsx_runtime_1.jsx)(SpectraAutomaticPickingButton_1.SpectraAutomaticPickingButton, {}), (0, jsx_runtime_1.jsx)(Button_1.default.BarButton, { tooltipOrientation: "horizontal", toolTip: "Recolor spectra", onClick: recolorSpectraHandler, children: (0, jsx_runtime_1.jsx)(io5_1.IoColorPaletteOutline, {}) })] }));
|
|
91
90
|
}
|
|
92
91
|
const MemoizedSpectraPanelHeader = (0, react_1.memo)(SpectraPanelHeaderInner);
|
|
93
92
|
function SpectrumsTabs({ onSettingClick, }) {
|
|
@@ -183,9 +183,9 @@ function CorrelationTableRow({ additionalColumnData, correlations, correlation,
|
|
|
183
183
|
}
|
|
184
184
|
}, children: [(0, nmr_correlation_1.getLabel)(correlations, correlation), (0, jsx_runtime_1.jsx)(ContextMenu_1.default, { ref: contextRef, context: contextMenu })] }), (0, jsx_runtime_1.jsx)("td", { title: t, ...otherTableDataProps, children: (0, nmr_correlation_1.getCorrelationDelta)(correlation)
|
|
185
185
|
? (0, nmr_correlation_1.getCorrelationDelta)(correlation)?.toFixed(2)
|
|
186
|
-
: '' }), (0, jsx_runtime_1.jsx)("td", { title: t, ...otherTableDataProps, children: correlation.atomType !== 'H' ? ((0, jsx_runtime_1.jsx)(EditableColumn_1.default, { type: "number", value: correlation.equivalence, style: equivalenceCellStyle, onSave: onSaveEquivalencesHandler })) : ((0, jsx_runtime_1.jsx)("span", { style: equivalenceCellStyle, children: correlation.equivalence })) }), (0, jsx_runtime_1.jsx)("td", { title: t, ...otherTableDataProps, children: correlation.atomType !== 'H' ? ((0, jsx_runtime_1.jsx)(EditableColumn_1.default, { type: "text", value: correlation.protonsCount.join(','), style: correlation.edited.protonsCount ? { color: 'blue' } : {}, onSave: (e) => onSaveEditNumericValuesHandler(e, 'protonsCount') })) : ('') }), (0, jsx_runtime_1.jsx)("td", { title: t, ...otherTableDataProps,
|
|
186
|
+
: '' }), (0, jsx_runtime_1.jsx)("td", { title: t, ...otherTableDataProps, children: correlation.atomType !== 'H' ? ((0, jsx_runtime_1.jsx)(EditableColumn_1.default, { type: "number", value: correlation.equivalence, style: equivalenceCellStyle, onSave: onSaveEquivalencesHandler, validate: (val) => val !== '' })) : ((0, jsx_runtime_1.jsx)("span", { style: equivalenceCellStyle, children: correlation.equivalence })) }), (0, jsx_runtime_1.jsx)("td", { title: t, ...otherTableDataProps, children: correlation.atomType !== 'H' ? ((0, jsx_runtime_1.jsx)(EditableColumn_1.default, { type: "text", value: correlation.protonsCount.join(','), style: correlation.edited.protonsCount ? { color: 'blue' } : {}, onSave: (e) => onSaveEditNumericValuesHandler(e, 'protonsCount'), validate: (val) => val !== '' })) : ('') }), (0, jsx_runtime_1.jsx)("td", { title: t, ...otherTableDataProps,
|
|
187
187
|
style: { ...tableDataProps.style, borderRight: '1px solid' }, children: correlation.atomType !== 'H' ? ((0, jsx_runtime_1.jsx)(EditableColumn_1.default, { type: "text", value: correlation.hybridization
|
|
188
188
|
.map((hybrid) => `sp${hybrid}`)
|
|
189
|
-
.join(','), style: correlation.edited.hybridization ? { color: 'blue' } : {}, onSave: (e) => onSaveEditNumericValuesHandler(e, 'hybridization') })) : ('') }), additionalColumnFields] }));
|
|
189
|
+
.join(','), style: correlation.edited.hybridization ? { color: 'blue' } : {}, onSave: (e) => onSaveEditNumericValuesHandler(e, 'hybridization'), validate: (val) => val !== '' })) : ('') }), additionalColumnFields] }));
|
|
190
190
|
}
|
|
191
191
|
exports.default = CorrelationTableRow;
|
|
@@ -39,7 +39,6 @@ const DispatchContext_1 = require("../../context/DispatchContext");
|
|
|
39
39
|
const Select_1 = __importDefault(require("../../elements/Select"));
|
|
40
40
|
const ToolTip_1 = __importDefault(require("../../elements/ToolTip/ToolTip"));
|
|
41
41
|
const Modal_1 = require("../../elements/popup/Modal");
|
|
42
|
-
const Constants_1 = require("../../reducer/core/Constants");
|
|
43
42
|
const DefaultPanelHeader_1 = __importStar(require("../header/DefaultPanelHeader"));
|
|
44
43
|
const CorrelationTable_1 = __importDefault(require("./CorrelationTable/CorrelationTable"));
|
|
45
44
|
const Overview_1 = __importDefault(require("./Overview"));
|
|
@@ -100,7 +99,7 @@ function SummaryPanel() {
|
|
|
100
99
|
const xDomain1 = xDomain[1] * factor;
|
|
101
100
|
const yDomain0 = yDomain[0] * factor;
|
|
102
101
|
const yDomain1 = yDomain[1] * factor;
|
|
103
|
-
if (displayerMode ===
|
|
102
|
+
if (displayerMode === '1D') {
|
|
104
103
|
const firstLink1D = correlation.link.find((link) => (0, nmr_correlation_1.getLinkDim)(link) === 1);
|
|
105
104
|
if (!firstLink1D) {
|
|
106
105
|
return false;
|
|
@@ -125,7 +124,7 @@ function SummaryPanel() {
|
|
|
125
124
|
return true;
|
|
126
125
|
}
|
|
127
126
|
}
|
|
128
|
-
else if (displayerMode ===
|
|
127
|
+
else if (displayerMode === '2D') {
|
|
129
128
|
if (!atomTypesInView.includes(correlation.atomType)) {
|
|
130
129
|
return false;
|
|
131
130
|
}
|
|
@@ -10,8 +10,7 @@ const nmr_correlation_1 = require("nmr-correlation");
|
|
|
10
10
|
const DefaultPathLengths_1 = __importDefault(require("../../../../data/constants/DefaultPathLengths"));
|
|
11
11
|
const FindUtilities_1 = require("../../../../data/utilities/FindUtilities");
|
|
12
12
|
const isDefaultPathLength_1 = __importDefault(require("../../../modal/editZone/validation/isDefaultPathLength"));
|
|
13
|
-
const Constants_1 = require("
|
|
14
|
-
const Constants_2 = require("../CorrelationTable/Constants");
|
|
13
|
+
const Constants_1 = require("../CorrelationTable/Constants");
|
|
15
14
|
function getAtomType(nucleus) {
|
|
16
15
|
return nucleus.split(/\d+/)[1];
|
|
17
16
|
}
|
|
@@ -19,7 +18,7 @@ exports.getAtomType = getAtomType;
|
|
|
19
18
|
function getLabelColor(correlationData, correlation) {
|
|
20
19
|
const error = (0, get_1.default)(correlationData, `state.${correlation.atomType}.error`, null);
|
|
21
20
|
if (error) {
|
|
22
|
-
for (const { key, color } of
|
|
21
|
+
for (const { key, color } of Constants_1.ErrorColors) {
|
|
23
22
|
if (key !== 'incomplete' && // do not consider this for a single atom type
|
|
24
23
|
(key === 'notAttached' || key === 'ambiguousAttachment') &&
|
|
25
24
|
(0, get_1.default)(error, `${key}`, []).some((index) => correlationData.values[index].id === correlation.id)) {
|
|
@@ -303,7 +302,7 @@ function isInView(spectraData, activeTab, activeSpectrum, xDomain, yDomain, disp
|
|
|
303
302
|
const xDomain1 = xDomain[1] * factor;
|
|
304
303
|
const yDomain0 = yDomain[0] * factor;
|
|
305
304
|
const yDomain1 = yDomain[1] * factor;
|
|
306
|
-
if (displayerMode ===
|
|
305
|
+
if (displayerMode === '1D') {
|
|
307
306
|
const firstLink1D = correlation.link.find((link) => (0, nmr_correlation_1.getLinkDim)(link) === 1);
|
|
308
307
|
if (!firstLink1D) {
|
|
309
308
|
return false;
|
|
@@ -328,7 +327,7 @@ function isInView(spectraData, activeTab, activeSpectrum, xDomain, yDomain, disp
|
|
|
328
327
|
return true;
|
|
329
328
|
}
|
|
330
329
|
}
|
|
331
|
-
else if (displayerMode ===
|
|
330
|
+
else if (displayerMode === '2D') {
|
|
332
331
|
if (!atomTypesInView.includes(correlation.atomType)) {
|
|
333
332
|
return false;
|
|
334
333
|
}
|
|
@@ -5,7 +5,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
7
|
const get_1 = __importDefault(require("lodash/get"));
|
|
8
|
-
const react_1 = require("react");
|
|
9
8
|
const DispatchContext_1 = require("../../../context/DispatchContext");
|
|
10
9
|
const EditableColumn_1 = __importDefault(require("../../../elements/EditableColumn"));
|
|
11
10
|
const formatNumber_1 = require("../../../utility/formatNumber");
|
|
@@ -14,8 +13,8 @@ function SignalDeltaColumn({ rowData, onHoverSignalX, onHoverSignalY, format, })
|
|
|
14
13
|
const signalDeltaX = (0, get_1.default)(rowData, 'tableMetaInfo.signal.x.delta', null);
|
|
15
14
|
const signalDeltaY = (0, get_1.default)(rowData, 'tableMetaInfo.signal.y.delta', null);
|
|
16
15
|
const id = (0, get_1.default)(rowData, 'tableMetaInfo.signal.id', undefined);
|
|
17
|
-
|
|
18
|
-
const value = event.target.value;
|
|
16
|
+
function saveXHandler(event) {
|
|
17
|
+
const value = Number(event.target.value);
|
|
19
18
|
dispatch({
|
|
20
19
|
type: 'CHANGE_ZONE_SIGNAL_VALUE',
|
|
21
20
|
payload: {
|
|
@@ -23,9 +22,9 @@ function SignalDeltaColumn({ rowData, onHoverSignalX, onHoverSignalY, format, })
|
|
|
23
22
|
signal: { id, deltaX: value },
|
|
24
23
|
},
|
|
25
24
|
});
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
const value = event.target.value;
|
|
25
|
+
}
|
|
26
|
+
function saveYHandler(event) {
|
|
27
|
+
const value = Number(event.target.value);
|
|
29
28
|
dispatch({
|
|
30
29
|
type: 'CHANGE_ZONE_SIGNAL_VALUE',
|
|
31
30
|
payload: {
|
|
@@ -33,7 +32,7 @@ function SignalDeltaColumn({ rowData, onHoverSignalX, onHoverSignalY, format, })
|
|
|
33
32
|
signal: { id, deltaY: value },
|
|
34
33
|
},
|
|
35
34
|
});
|
|
36
|
-
}
|
|
37
|
-
return ((0, jsx_runtime_1.jsxs)(
|
|
35
|
+
}
|
|
36
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("td", { ...onHoverSignalX, children: signalDeltaX !== null ? ((0, jsx_runtime_1.jsx)(EditableColumn_1.default, { value: (0, formatNumber_1.formatNumber)(signalDeltaX, format.x), onSave: saveXHandler, type: "number", style: { padding: '0.1rem 0.4rem' }, validate: (val) => val !== '' })) : ('') }), (0, jsx_runtime_1.jsx)("td", { ...onHoverSignalY, children: signalDeltaY !== null ? ((0, jsx_runtime_1.jsx)(EditableColumn_1.default, { value: (0, formatNumber_1.formatNumber)(signalDeltaY, format.y), onSave: saveYHandler, type: "number", style: { padding: '0.1rem 0.4rem' }, validate: (val) => val !== '' })) : ('') })] }));
|
|
38
37
|
}
|
|
39
38
|
exports.default = SignalDeltaColumn;
|
|
@@ -10,9 +10,6 @@ const nmr_load_save_1 = require("nmr-load-save");
|
|
|
10
10
|
const nmr_processing_1 = require("nmr-processing");
|
|
11
11
|
const full_1 = __importDefault(require("openchemlib/full"));
|
|
12
12
|
const react_2 = require("react");
|
|
13
|
-
const bs_1 = require("react-icons/bs");
|
|
14
|
-
const fa_1 = require("react-icons/fa");
|
|
15
|
-
const io5_1 = require("react-icons/io5");
|
|
16
13
|
const ui_1 = require("react-science/ui");
|
|
17
14
|
const Spectrum1D_1 = require("../../../data/data1d/Spectrum1D");
|
|
18
15
|
const SumManager_1 = require("../../../data/data1d/Spectrum1D/SumManager");
|
|
@@ -20,15 +17,9 @@ const database_1 = require("../../../data/data1d/database");
|
|
|
20
17
|
const ChartContext_1 = require("../../context/ChartContext");
|
|
21
18
|
const DispatchContext_1 = require("../../context/DispatchContext");
|
|
22
19
|
const PreferencesContext_1 = require("../../context/PreferencesContext");
|
|
23
|
-
const Button_1 = __importDefault(require("../../elements/Button"));
|
|
24
|
-
const Input_1 = __importDefault(require("../../elements/Input"));
|
|
25
|
-
const Select_1 = __importDefault(require("../../elements/Select"));
|
|
26
|
-
const ToggleButton_1 = __importDefault(require("../../elements/ToggleButton"));
|
|
27
20
|
const Alert_1 = require("../../elements/popup/Alert");
|
|
28
21
|
const Modal_1 = require("../../elements/popup/Modal");
|
|
29
22
|
const useFormatNumberByNucleus_1 = require("../../hooks/useFormatNumberByNucleus");
|
|
30
|
-
const useToolsFunctions_1 = __importDefault(require("../../hooks/useToolsFunctions"));
|
|
31
|
-
const Constants_1 = require("../../reducer/core/Constants");
|
|
32
23
|
const ToolTypes_1 = require("../../toolbar/ToolTypes");
|
|
33
24
|
const Events_1 = __importDefault(require("../../utility/Events"));
|
|
34
25
|
const export_1 = require("../../utility/export");
|
|
@@ -36,11 +27,11 @@ const nucleusToString_1 = __importDefault(require("../../utility/nucleusToString
|
|
|
36
27
|
const PanelNoData_1 = require("../PanelNoData");
|
|
37
28
|
const BasicPanelStyle_1 = require("../extra/BasicPanelStyle");
|
|
38
29
|
const NoTableData_1 = __importDefault(require("../extra/placeholder/NoTableData"));
|
|
39
|
-
const DefaultPanelHeader_1 = __importDefault(require("../header/DefaultPanelHeader"));
|
|
40
30
|
const PreferencesHeader_1 = __importDefault(require("../header/PreferencesHeader"));
|
|
41
31
|
const DatabasePreferences_1 = __importDefault(require("./DatabasePreferences"));
|
|
42
32
|
const DatabaseStructureSearchModal_1 = require("./DatabaseStructureSearchModal");
|
|
43
33
|
const DatabaseTable_1 = __importDefault(require("./DatabaseTable"));
|
|
34
|
+
const DatabaseSearchOptions_1 = require("./DatabaseSearchOptions");
|
|
44
35
|
const emptyKeywords = {
|
|
45
36
|
solvent: '-1',
|
|
46
37
|
searchKeywords: '',
|
|
@@ -57,7 +48,6 @@ function DatabasePanelInner({ nucleus, selectedTool, databases, defaultDatabase,
|
|
|
57
48
|
const alert = (0, Alert_1.useAlert)();
|
|
58
49
|
const modal = (0, Modal_1.useModal)();
|
|
59
50
|
const { item } = (0, ui_1.useAccordionContext)('Databases');
|
|
60
|
-
const { handleChangeOption } = (0, useToolsFunctions_1.default)();
|
|
61
51
|
const format = (0, useFormatNumberByNucleus_1.useFormatNumberByNucleus)(nucleus);
|
|
62
52
|
const [isFlipped, setFlipStatus] = (0, react_2.useState)(false);
|
|
63
53
|
const settingRef = (0, react_2.useRef)();
|
|
@@ -77,18 +67,6 @@ function DatabasePanelInner({ nucleus, selectedTool, databases, defaultDatabase,
|
|
|
77
67
|
settingRef.current.saveSetting();
|
|
78
68
|
setFlipStatus(false);
|
|
79
69
|
}, []);
|
|
80
|
-
const handleSearch = (0, react_2.useCallback)((input) => {
|
|
81
|
-
if (typeof input === 'string' || input === -1) {
|
|
82
|
-
const solvent = String(input);
|
|
83
|
-
setKeywords((prevState) => ({ ...prevState, solvent }));
|
|
84
|
-
}
|
|
85
|
-
else {
|
|
86
|
-
setKeywords((prevState) => ({
|
|
87
|
-
...prevState,
|
|
88
|
-
searchKeywords: input.target.value,
|
|
89
|
-
}));
|
|
90
|
-
}
|
|
91
|
-
}, []);
|
|
92
70
|
const search = (0, react_2.useCallback)((solvents) => {
|
|
93
71
|
const { solvent, searchKeywords } = keywords;
|
|
94
72
|
if (databaseInstance.current) {
|
|
@@ -241,13 +219,6 @@ function DatabasePanelInner({ nucleus, selectedTool, databases, defaultDatabase,
|
|
|
241
219
|
alert.error(`No jcamp file to save`);
|
|
242
220
|
}
|
|
243
221
|
}, [alert, result]);
|
|
244
|
-
const clearHandler = (0, react_2.useCallback)(() => {
|
|
245
|
-
setKeywords((prevState) => ({ ...prevState, searchKeywords: '' }));
|
|
246
|
-
}, []);
|
|
247
|
-
const enableFilterHandler = (0, react_2.useCallback)((flag) => {
|
|
248
|
-
const tool = !flag ? ToolTypes_1.options.zoom.id : ToolTypes_1.options.databaseRangesSelection.id;
|
|
249
|
-
handleChangeOption(tool);
|
|
250
|
-
}, [handleChangeOption]);
|
|
251
222
|
const searchByStructureHandler = (idCodeValue) => {
|
|
252
223
|
setIdCode(idCodeValue);
|
|
253
224
|
};
|
|
@@ -269,15 +240,7 @@ function DatabasePanelInner({ nucleus, selectedTool, databases, defaultDatabase,
|
|
|
269
240
|
}
|
|
270
241
|
}
|
|
271
242
|
`,
|
|
272
|
-
], children: [!isFlipped && ((0, jsx_runtime_1.
|
|
273
|
-
pointerEvents: 'none',
|
|
274
|
-
fontSize: '12px',
|
|
275
|
-
transform: 'rotate(90deg)',
|
|
276
|
-
} }) }, `${selectedTool}`), (0, jsx_runtime_1.jsx)(Select_1.default, { style: { flex: 2, marginLeft: '5px' }, items: databases, itemTextField: "label", itemValueField: "key", onChange: handleChangeDatabase, placeholder: "Select database", defaultValue: defaultDatabase }), (0, jsx_runtime_1.jsx)(Select_1.default, { style: { flex: 1, margin: '0px 5px' }, items: result.solvents, placeholder: "Solvent", onChange: handleSearch, value: keywords.solvent }), (0, jsx_runtime_1.jsx)(Input_1.default, { value: keywords.searchKeywords, renderIcon: () => (0, jsx_runtime_1.jsx)(io5_1.IoSearchOutline, {}), style: { inputWrapper: { flex: 3 } }, className: "search-input", type: "text", debounceTime: 250, placeholder: "Search for parameter...", onChange: handleSearch, onClear: clearHandler, canClear: true }), (0, jsx_runtime_1.jsx)(Button_1.default.Done, { fill: "clear", onClick: openSearchByStructure, style: { marginLeft: '5px' }, children: !idCode ? ((0, jsx_runtime_1.jsx)(bs_1.BsHexagon, { style: {
|
|
277
|
-
fontSize: '14px',
|
|
278
|
-
} })) : ((0, jsx_runtime_1.jsx)(bs_1.BsHexagonFill, { style: {
|
|
279
|
-
fontSize: '14px',
|
|
280
|
-
} })) })] })), isFlipped && ((0, jsx_runtime_1.jsx)(PreferencesHeader_1.default, { onSave: saveSettingHandler, onClose: settingsPanelHandler })), (0, jsx_runtime_1.jsx)("div", { className: "inner-container", children: !isFlipped ? (tableData && tableData.length > 0 ? ((0, jsx_runtime_1.jsx)(DatabaseTable_1.default, { data: tableData, totalCount: result.data.length, onAdd: resurrectHandler, onSave: saveHandler })) : ((0, jsx_runtime_1.jsx)(NoTableData_1.default, { text: databases && databases?.length > 0
|
|
243
|
+
], children: [!isFlipped && ((0, jsx_runtime_1.jsx)(DatabaseSearchOptions_1.DatabaseSearchOptions, { databases: databases, defaultDatabase: defaultDatabase, idCode: idCode, keywords: keywords, result: result, selectedTool: selectedTool, total: databaseInstance.current?.data.length || 0, onKeywordsChange: (options) => setKeywords((prevKeywords) => ({ ...prevKeywords, ...options })), onSettingClick: settingsPanelHandler, onStructureClick: openSearchByStructure, onDatabaseChange: handleChangeDatabase })), isFlipped && ((0, jsx_runtime_1.jsx)(PreferencesHeader_1.default, { onSave: saveSettingHandler, onClose: settingsPanelHandler })), (0, jsx_runtime_1.jsx)("div", { className: "inner-container", children: !isFlipped ? (tableData && tableData.length > 0 ? ((0, jsx_runtime_1.jsx)(DatabaseTable_1.default, { data: tableData, totalCount: result.data.length, onAdd: resurrectHandler, onSave: saveHandler })) : ((0, jsx_runtime_1.jsx)(NoTableData_1.default, { text: databases && databases?.length > 0
|
|
281
244
|
? 'Please select a database'
|
|
282
245
|
: 'Please add databases URL in the general preferences' }))) : ((0, jsx_runtime_1.jsx)(DatabasePreferences_1.default, { ref: settingRef })) })] }));
|
|
283
246
|
}
|
|
@@ -287,7 +250,7 @@ function PeaksPanel() {
|
|
|
287
250
|
const { current } = (0, PreferencesContext_1.usePreferences)();
|
|
288
251
|
const { data, defaultDatabase } = current.databases;
|
|
289
252
|
const databases = database_1.DATA_BASES.concat(data.filter((datum) => datum.enabled));
|
|
290
|
-
if (!activeTab || displayerMode !==
|
|
253
|
+
if (!activeTab || displayerMode !== '1D') {
|
|
291
254
|
return ((0, jsx_runtime_1.jsx)(PanelNoData_1.PanelNoData, { children: "Databases are only available when 1D experimental spectrum is displayed. It will automatically select the corresponding nucleus" }));
|
|
292
255
|
}
|
|
293
256
|
return ((0, jsx_runtime_1.jsx)(MemoizedDatabasePanel, { nucleus: activeTab, selectedTool: selectedTool, databases: databases, defaultDatabase: defaultDatabase }));
|