nmrium 0.36.0 → 0.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/component/2d/ft/Contours.js +0 -6
- package/lib/component/NMRium.d.ts +2 -0
- package/lib/component/NMRium.js +7 -8
- package/lib/component/elements/RemoveAssignmentsButton.d.ts +4 -0
- package/lib/component/{panels/RangesPanel/TableColumns → elements}/RemoveAssignmentsButton.js +14 -1
- package/lib/component/header/Header.js +1 -1
- package/lib/component/modal/AboutPredictionModal.d.ts +2 -0
- package/lib/component/modal/AboutPredictionModal.js +49 -0
- package/lib/component/panels/IntegralsPanel/IntegralTable.js +17 -13
- package/lib/component/panels/IntegralsPanel/IntegralsPreferences.js +8 -5
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.d.ts +1 -0
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +3 -2
- package/lib/component/panels/RangesPanel/RangesTableRow.d.ts +0 -1
- package/lib/component/panels/RangesPanel/RangesTableRow.js +0 -11
- package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +2 -3
- package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.js +2 -3
- package/lib/component/panels/SpectrumsPanel/SpectraPreferences.js +2 -2
- package/lib/component/panels/SpectrumsPanel/base/SpectraColumnsManager.js +1 -1
- package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.d.ts +2 -10
- package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumn.d.ts +2 -3
- package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumn.js +12 -16
- package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumns.d.ts +1 -5
- package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumns.js +2 -2
- package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.d.ts +2 -3
- package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.js +27 -19
- package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumns.d.ts +1 -5
- package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumns.js +2 -2
- package/lib/component/panels/ZonesPanel/ZonesTableRow.js +2 -22
- package/lib/component/panels/predictionPanel/PredictionPanel.js +6 -1
- package/lib/component/reducer/actions/LoadActions.js +14 -6
- package/lib/component/reducer/actions/MoleculeActions.js +26 -2
- package/lib/component/reducer/actions/PreferencesActions.js +17 -4
- package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js +1 -0
- package/lib/component/workspaces/Workspace.d.ts +2 -1
- package/lib/component/workspaces/exercise.js +31 -0
- package/lib/component/workspaces/workspaceDefaultProperties.js +1 -0
- package/lib/data/data2d/Processing2D.d.ts +3 -3
- package/lib/data/data2d/Spectrum2D/contours.d.ts +1 -4
- package/lib/data/data2d/Spectrum2D/contours.js +0 -1
- package/lib/data/utilities/ZoneUtilities.js +0 -1
- package/lib/types/NMRiumGeneralPreferences.d.ts +1 -0
- package/lib/versionInfo.js +1 -1
- package/lib-cjs/component/2d/ft/Contours.js +0 -6
- package/lib-cjs/component/NMRium.js +4 -5
- package/lib-cjs/component/{panels/RangesPanel/TableColumns → elements}/RemoveAssignmentsButton.js +15 -2
- package/lib-cjs/component/header/Header.js +1 -1
- package/lib-cjs/component/modal/AboutPredictionModal.js +54 -0
- package/lib-cjs/component/panels/IntegralsPanel/IntegralTable.js +17 -13
- package/lib-cjs/component/panels/IntegralsPanel/IntegralsPreferences.js +7 -4
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +3 -2
- package/lib-cjs/component/panels/RangesPanel/RangesTableRow.js +0 -12
- package/lib-cjs/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +2 -3
- package/lib-cjs/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.js +2 -3
- package/lib-cjs/component/panels/SpectrumsPanel/SpectraPreferences.js +2 -2
- package/lib-cjs/component/panels/SpectrumsPanel/base/SpectraColumnsManager.js +1 -1
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumn.js +12 -19
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumns.js +2 -2
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.js +27 -22
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumns.js +2 -2
- package/lib-cjs/component/panels/ZonesPanel/ZonesTableRow.js +1 -21
- package/lib-cjs/component/panels/predictionPanel/PredictionPanel.js +6 -1
- package/lib-cjs/component/reducer/actions/LoadActions.js +14 -6
- package/lib-cjs/component/reducer/actions/MoleculeActions.js +25 -1
- package/lib-cjs/component/reducer/actions/PreferencesActions.js +17 -4
- package/lib-cjs/component/reducer/preferences/panelsPreferencesDefaultValues.js +1 -0
- package/lib-cjs/component/workspaces/exercise.js +31 -0
- package/lib-cjs/component/workspaces/workspaceDefaultProperties.js +1 -0
- package/lib-cjs/data/data2d/Spectrum2D/contours.js +0 -1
- package/lib-cjs/data/utilities/ZoneUtilities.js +0 -1
- package/lib-cjs/versionInfo.js +1 -1
- package/package.json +21 -21
- package/lib/component/panels/RangesPanel/TableColumns/RemoveAssignmentsButton.d.ts +0 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
2
|
/** @jsxImportSource @emotion/react */
|
|
3
3
|
import lodashGet from 'lodash/get';
|
|
4
|
-
import { useMemo, useCallback
|
|
4
|
+
import { useMemo, useCallback } from 'react';
|
|
5
5
|
import { DropdownMenu } from 'react-science/ui';
|
|
6
6
|
import { buildID } from '../../../data/utilities/Concatenation';
|
|
7
7
|
import { useAssignment, } from '../../assignment/AssignmentsContext';
|
|
@@ -20,10 +20,6 @@ function ZonesTableRow({ rowData, onUnlink, contextMenu = [], onContextMenuSelec
|
|
|
20
20
|
const assignmentSignal = useAssignment(rowData.tableMetaInfo.id);
|
|
21
21
|
const highlightSignalX = useHighlight([buildID(assignmentSignal.id, 'X')].concat(assignmentSignal.assigned?.x || [], buildID(assignmentSignal.id, 'Crosshair')));
|
|
22
22
|
const highlightSignalY = useHighlight([buildID(assignmentSignal.id, 'Y')].concat(assignmentSignal.assigned?.y || [], buildID(assignmentSignal.id, 'Crosshair')));
|
|
23
|
-
const [showUnlinkButtonZoneX, setShowUnlinkButtonZoneX] = useState(false);
|
|
24
|
-
const [showUnlinkButtonZoneY, setShowUnlinkButtonZoneY] = useState(false);
|
|
25
|
-
const [showUnlinkButtonSignalX, setShowUnlinkButtonSignalX] = useState(false);
|
|
26
|
-
const [showUnlinkButtonSignalY, setShowUnlinkButtonSignalY] = useState(false);
|
|
27
23
|
const rowSpanTags = useMemo(() => {
|
|
28
24
|
return {
|
|
29
25
|
rowSpan: rowData.tableMetaInfo.rowSpan,
|
|
@@ -41,43 +37,27 @@ function ZonesTableRow({ rowData, onUnlink, contextMenu = [], onContextMenuSelec
|
|
|
41
37
|
if (axis === 'x') {
|
|
42
38
|
if (isOnZoneLevel !== undefined) {
|
|
43
39
|
if (isOnZoneLevel) {
|
|
44
|
-
setShowUnlinkButtonZoneX(false);
|
|
45
40
|
assignmentZone.removeAll('x');
|
|
46
41
|
}
|
|
47
42
|
else {
|
|
48
|
-
setShowUnlinkButtonSignalX(false);
|
|
49
43
|
assignmentSignal.removeAll('x');
|
|
50
44
|
}
|
|
51
45
|
}
|
|
52
|
-
else {
|
|
53
|
-
setShowUnlinkButtonZoneX(false);
|
|
54
|
-
setShowUnlinkButtonSignalX(false);
|
|
55
|
-
}
|
|
56
46
|
}
|
|
57
47
|
else if (axis === 'y') {
|
|
58
48
|
if (isOnZoneLevel !== undefined) {
|
|
59
49
|
if (isOnZoneLevel) {
|
|
60
|
-
setShowUnlinkButtonZoneY(false);
|
|
61
50
|
assignmentZone.removeAll('y');
|
|
62
51
|
}
|
|
63
52
|
else {
|
|
64
|
-
setShowUnlinkButtonSignalY(false);
|
|
65
53
|
assignmentSignal.removeAll('y');
|
|
66
54
|
}
|
|
67
55
|
}
|
|
68
|
-
else {
|
|
69
|
-
setShowUnlinkButtonZoneY(false);
|
|
70
|
-
setShowUnlinkButtonSignalY(false);
|
|
71
|
-
}
|
|
72
56
|
}
|
|
73
57
|
else {
|
|
74
|
-
setShowUnlinkButtonZoneX(false);
|
|
75
58
|
assignmentZone.removeAll('x');
|
|
76
|
-
setShowUnlinkButtonSignalX(false);
|
|
77
59
|
assignmentSignal.removeAll('x');
|
|
78
|
-
setShowUnlinkButtonZoneY(false);
|
|
79
60
|
assignmentZone.removeAll('y');
|
|
80
|
-
setShowUnlinkButtonSignalY(false);
|
|
81
61
|
assignmentSignal.removeAll('y');
|
|
82
62
|
}
|
|
83
63
|
}, [assignmentSignal, assignmentZone, onUnlink, rowData]);
|
|
@@ -137,6 +117,6 @@ function ZonesTableRow({ rowData, onUnlink, contextMenu = [], onContextMenuSelec
|
|
|
137
117
|
? HighlightedRowStyle
|
|
138
118
|
: lodashGet(rowData, 'tableMetaInfo.isConstantlyHighlighted', false)
|
|
139
119
|
? ConstantlyHighlightedRowStyle
|
|
140
|
-
: null, ...highlightZone.onHover, children: [_jsx("td", { ...rowSpanTags, children: rowIndex + 1 }), _jsx(SignalDeltaColumn, { rowData: rowData, onHoverSignalX: onHoverSignalX, onHoverSignalY: onHoverSignalY, format: format }), _jsx(SignalAssignmentsColumns, { rowData: rowData, assignmentSignal: assignmentSignal, onHoverSignalX: onHoverSignalX, onHoverSignalY: onHoverSignalY,
|
|
120
|
+
: null, ...highlightZone.onHover, children: [_jsx("td", { ...rowSpanTags, children: rowIndex + 1 }), _jsx(SignalDeltaColumn, { rowData: rowData, onHoverSignalX: onHoverSignalX, onHoverSignalY: onHoverSignalY, format: format }), _jsx(SignalAssignmentsColumns, { rowData: rowData, assignmentSignal: assignmentSignal, onHoverSignalX: onHoverSignalX, onHoverSignalY: onHoverSignalY, onClick: clickHandler, onUnlink: unlinkHandler, highlightSignalX: highlightSignalX, highlightSignalY: highlightSignalY }), _jsx(ZoneAssignmentsColumns, { rowData: rowData, assignmentZone: assignmentZone, onHoverZoneX: onHoverZoneX, onHoverZoneY: onHoverZoneY, rowSpanTags: rowSpanTags, onClick: clickHandler, onUnlink: unlinkHandler, highlightZoneX: highlightZoneX, highlightZoneY: highlightZoneY }), _jsx(ActionsColumn, { rowData: rowData, rowSpanTags: rowSpanTags })] }));
|
|
141
121
|
}
|
|
142
122
|
export default ZonesTableRow;
|
|
@@ -38,7 +38,12 @@ export default function PredictionPane() {
|
|
|
38
38
|
}
|
|
39
39
|
})();
|
|
40
40
|
};
|
|
41
|
-
return (_jsx(MoleculePanel, { onMoleculeChange: changeHandler, actionsOptions: {
|
|
41
|
+
return (_jsx(MoleculePanel, { onMoleculeChange: changeHandler, actionsOptions: {
|
|
42
|
+
hidePredict: true,
|
|
43
|
+
hideDelete: true,
|
|
44
|
+
hideExport: true,
|
|
45
|
+
showAboutPredict: true,
|
|
46
|
+
}, emptyTextStyle: {
|
|
42
47
|
padding: '0.25rem 0.5rem',
|
|
43
48
|
borderRadius: '0.2rem',
|
|
44
49
|
backgroundColor: '#2dd36f',
|
|
@@ -47,11 +47,12 @@ function initSpectra(inputSpectra, options) {
|
|
|
47
47
|
}
|
|
48
48
|
return spectra;
|
|
49
49
|
}
|
|
50
|
-
function setData(draft, input) {
|
|
50
|
+
function setData(draft, input, options = {}) {
|
|
51
51
|
const { data, usedColors, view, onLoadProcessing = {}, parseMetaFileResult = null, } = input || {
|
|
52
52
|
data: { spectra: [], molecules: [], correlations: {} },
|
|
53
53
|
multipleAnalysis: {},
|
|
54
54
|
};
|
|
55
|
+
const { autoOnLoadProcessing = true } = options;
|
|
55
56
|
const { source, spectra = [], molecules = [], correlations = {}, } = data || {};
|
|
56
57
|
if (view) {
|
|
57
58
|
const defaultViewState = getDefaultViewState();
|
|
@@ -66,7 +67,10 @@ function setData(draft, input) {
|
|
|
66
67
|
});
|
|
67
68
|
}
|
|
68
69
|
draft.molecules = draft.molecules.concat(MoleculeManager.fromJSON(molecules, draft.molecules));
|
|
69
|
-
draft.data = draft.data.concat(initSpectra(spectra, {
|
|
70
|
+
draft.data = draft.data.concat(initSpectra(spectra, {
|
|
71
|
+
usedColors,
|
|
72
|
+
onLoadProcessing: autoOnLoadProcessing ? onLoadProcessing : {},
|
|
73
|
+
}));
|
|
70
74
|
setCorrelation(draft, correlations);
|
|
71
75
|
if (parseMetaFileResult) {
|
|
72
76
|
const { matches } = linkMetaWithSpectra({
|
|
@@ -108,11 +112,12 @@ function setPreferences(draft, data) {
|
|
|
108
112
|
changeSpectrumVerticalAlignment(draft, { verticalAlign: 'auto-check' });
|
|
109
113
|
}
|
|
110
114
|
}
|
|
111
|
-
function initData(draft, action,
|
|
115
|
+
function initData(draft, action, options = {}) {
|
|
116
|
+
const { forceInitialize = false, autoOnLoadProcessing = true } = options;
|
|
112
117
|
const { data, view } = action.payload;
|
|
113
118
|
if (data?.spectra?.length || forceInitialize) {
|
|
114
119
|
const state = getInitialState();
|
|
115
|
-
setData(state, action.payload);
|
|
120
|
+
setData(state, action.payload, { autoOnLoadProcessing });
|
|
116
121
|
setActiveTab(state, { tab: data?.view?.activeTab || '' });
|
|
117
122
|
state.width = draft.width;
|
|
118
123
|
state.height = draft.height;
|
|
@@ -131,13 +136,16 @@ function initData(draft, action, forceInitialize = false) {
|
|
|
131
136
|
}
|
|
132
137
|
}
|
|
133
138
|
function initiate(draft, action) {
|
|
134
|
-
return initData(draft, action,
|
|
139
|
+
return initData(draft, action, {
|
|
140
|
+
forceInitialize: true,
|
|
141
|
+
autoOnLoadProcessing: false,
|
|
142
|
+
});
|
|
135
143
|
}
|
|
136
144
|
function loadDropFiles(draft, action) {
|
|
137
145
|
const { payload, type } = action;
|
|
138
146
|
const { data: { spectra = [] }, containsNmrium = false, resetSourceObject = true, } = payload;
|
|
139
147
|
if (containsNmrium) {
|
|
140
|
-
return initData(draft, action);
|
|
148
|
+
return initData(draft, action, { autoOnLoadProcessing: false });
|
|
141
149
|
}
|
|
142
150
|
else {
|
|
143
151
|
setData(draft, payload);
|
|
@@ -4,7 +4,7 @@ import { DRAGGABLE_STRUCTURE_INITIAL_BOUNDING_REACT } from '../../../data/molecu
|
|
|
4
4
|
import * as MoleculeManager from '../../../data/molecules/MoleculeManager';
|
|
5
5
|
import { generateColor } from '../../../data/utilities/generateColor';
|
|
6
6
|
import nucleusToString from '../../utility/nucleusToString';
|
|
7
|
-
import { DISPLAYER_MODE } from '../core/Constants';
|
|
7
|
+
import { DISPLAYER_MODE, MARGIN } from '../core/Constants';
|
|
8
8
|
import { handleUnlinkRange } from './RangesActions';
|
|
9
9
|
import { setActiveTab } from './ToolsActions';
|
|
10
10
|
import { handleUnlinkZone } from './ZonesActions';
|
|
@@ -82,10 +82,14 @@ function predictSpectraFromMoleculeHandler(draft, action) {
|
|
|
82
82
|
function initMoleculeViewProperties(id, draft) {
|
|
83
83
|
// check if the molecule is exists in the view object otherwise add it with the default value
|
|
84
84
|
if (!draft.view.molecules[id]) {
|
|
85
|
+
const position = getFloatingMoleculeInitialPosition(id, draft);
|
|
85
86
|
draft.view.molecules[id] = {
|
|
86
87
|
floating: {
|
|
87
88
|
visible: false,
|
|
88
|
-
bounding:
|
|
89
|
+
bounding: {
|
|
90
|
+
...DRAGGABLE_STRUCTURE_INITIAL_BOUNDING_REACT,
|
|
91
|
+
...position,
|
|
92
|
+
},
|
|
89
93
|
},
|
|
90
94
|
showAtomNumber: false,
|
|
91
95
|
};
|
|
@@ -94,6 +98,26 @@ function initMoleculeViewProperties(id, draft) {
|
|
|
94
98
|
function getMoleculeViewObject(id, draft) {
|
|
95
99
|
return draft.view.molecules[id] || null;
|
|
96
100
|
}
|
|
101
|
+
function getFloatingMoleculeInitialPosition(id, draft) {
|
|
102
|
+
const { view: { molecules }, width: displayerWidth, height: displayerHeight, } = draft;
|
|
103
|
+
const { top, left } = MARGIN['2D'];
|
|
104
|
+
const { width: baseWidth, height: baseHeight } = DRAGGABLE_STRUCTURE_INITIAL_BOUNDING_REACT;
|
|
105
|
+
const width = displayerWidth - left;
|
|
106
|
+
const height = displayerHeight - top;
|
|
107
|
+
const columns = Math.floor(width / baseWidth);
|
|
108
|
+
const rows = Math.floor(height / baseHeight);
|
|
109
|
+
const moleculeKeys = Object.keys(molecules);
|
|
110
|
+
let index = 0;
|
|
111
|
+
if (!molecules[id]) {
|
|
112
|
+
index = moleculeKeys.length - 1;
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
index = moleculeKeys.indexOf(id);
|
|
116
|
+
}
|
|
117
|
+
const x = ((index + 1) % columns) * (width / columns) + left;
|
|
118
|
+
const y = Math.floor(moleculeKeys.length / columns) * (height / rows) + top;
|
|
119
|
+
return { x, y };
|
|
120
|
+
}
|
|
97
121
|
function floatMoleculeOverSpectrum(draft, action) {
|
|
98
122
|
const { id } = action.payload;
|
|
99
123
|
initMoleculeViewProperties(id, draft);
|
|
@@ -18,11 +18,24 @@ function changeSpectrumVerticalAlignment(draft, options) {
|
|
|
18
18
|
if (isFid) {
|
|
19
19
|
draft.view.verticalAlign[nucleus] = 'center';
|
|
20
20
|
}
|
|
21
|
-
else if (dataPerNucleus.length > 1) {
|
|
22
|
-
draft.view.verticalAlign[nucleus] = 'stack';
|
|
23
|
-
}
|
|
24
21
|
else {
|
|
25
|
-
|
|
22
|
+
let hasMoreThanOnFt = false;
|
|
23
|
+
let count = 1;
|
|
24
|
+
for (const spectrum of dataPerNucleus) {
|
|
25
|
+
if (count > 1) {
|
|
26
|
+
hasMoreThanOnFt = true;
|
|
27
|
+
break;
|
|
28
|
+
}
|
|
29
|
+
if (spectrum.info.isFt) {
|
|
30
|
+
count++;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
if (hasMoreThanOnFt) {
|
|
34
|
+
draft.view.verticalAlign[nucleus] = 'stack';
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
draft.view.verticalAlign[nucleus] = 'bottom';
|
|
38
|
+
}
|
|
26
39
|
}
|
|
27
40
|
}
|
|
28
41
|
else {
|
|
@@ -30,6 +30,7 @@ interface IntegralsNucleusPreferences {
|
|
|
30
30
|
relative: ColumnPreferences;
|
|
31
31
|
color: string;
|
|
32
32
|
strokeWidth: number;
|
|
33
|
+
showKind: boolean;
|
|
33
34
|
}
|
|
34
35
|
interface ZonesNucleusPreferences {
|
|
35
36
|
deltaPPM: ColumnPreferences;
|
|
@@ -39,7 +40,7 @@ interface ZonesGeneralPanelPreferences {
|
|
|
39
40
|
relative: ColumnPreferences;
|
|
40
41
|
}
|
|
41
42
|
interface NucleusPreferences<T> {
|
|
42
|
-
nuclei: Record<
|
|
43
|
+
nuclei: Partial<Record<Nucleus, T>>;
|
|
43
44
|
}
|
|
44
45
|
interface BasicColumnPreferences {
|
|
45
46
|
visible: boolean;
|
|
@@ -4,6 +4,7 @@ export const exercise = {
|
|
|
4
4
|
display: {
|
|
5
5
|
general: {
|
|
6
6
|
hideGeneralSettings: true,
|
|
7
|
+
hideLogs: true,
|
|
7
8
|
},
|
|
8
9
|
panels: {
|
|
9
10
|
spectraPanel: { display: true, open: true },
|
|
@@ -23,4 +24,34 @@ export const exercise = {
|
|
|
23
24
|
spectraStackAlignments: true,
|
|
24
25
|
},
|
|
25
26
|
},
|
|
27
|
+
general: {
|
|
28
|
+
dimmedSpectraOpacity: 0.1,
|
|
29
|
+
verticalSplitterPosition: '440px',
|
|
30
|
+
verticalSplitterCloseThreshold: 600,
|
|
31
|
+
spectraRendering: 'auto',
|
|
32
|
+
loggingLevel: 'info',
|
|
33
|
+
},
|
|
34
|
+
formatting: {
|
|
35
|
+
nuclei: {},
|
|
36
|
+
panels: {
|
|
37
|
+
integrals: {
|
|
38
|
+
nuclei: {
|
|
39
|
+
'1H': {
|
|
40
|
+
relative: { show: true, format: '0.00' },
|
|
41
|
+
absolute: { show: false, format: '0.00' },
|
|
42
|
+
color: 'black',
|
|
43
|
+
strokeWidth: 1,
|
|
44
|
+
showKind: false,
|
|
45
|
+
},
|
|
46
|
+
'13C': {
|
|
47
|
+
relative: { show: true, format: '0.00' },
|
|
48
|
+
absolute: { show: false, format: '0.00' },
|
|
49
|
+
color: 'black',
|
|
50
|
+
strokeWidth: 1,
|
|
51
|
+
showKind: false,
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
},
|
|
26
57
|
};
|
|
@@ -25,8 +25,8 @@ export default class Processing2D {
|
|
|
25
25
|
wheel(value: any): void;
|
|
26
26
|
shiftWheel(value: any): never[] | undefined;
|
|
27
27
|
drawContours(): {
|
|
28
|
-
positive:
|
|
29
|
-
negative:
|
|
28
|
+
positive: Readonly<import("ml-conrec").DrawContourResult<"basic">>;
|
|
29
|
+
negative: Readonly<import("ml-conrec").DrawContourResult<"basic">>;
|
|
30
30
|
};
|
|
31
|
-
getContours(zoomLevel: any, options?: any):
|
|
31
|
+
getContours(zoomLevel: any, options?: any): Readonly<import("ml-conrec").DrawContourResult<"basic">>;
|
|
32
32
|
}
|
|
@@ -32,9 +32,6 @@ interface ReturnContoursManager {
|
|
|
32
32
|
}
|
|
33
33
|
declare function getDefaultContoursLevel(options: ContourOptions): Level;
|
|
34
34
|
declare function contoursManager(spectrumID: string, state: ContoursLevels, options: ContourOptions): ReturnContoursManager;
|
|
35
|
-
declare function drawContours(level: number, spectrum: Spectrum2D, negative?: boolean, quadrant?: string):
|
|
36
|
-
contours: any;
|
|
37
|
-
timeout: boolean;
|
|
38
|
-
};
|
|
35
|
+
declare function drawContours(level: number, spectrum: Spectrum2D, negative?: boolean, quadrant?: string): import("ml-conrec").DrawContourResult<"basic">;
|
|
39
36
|
export { drawContours, contoursManager, getDefaultContoursLevel, DEFAULT_CONTOURS_OPTIONS, };
|
|
40
37
|
export type { ContoursLevels, ReturnContoursManager, Level, LevelSign };
|
|
@@ -115,7 +115,6 @@ function getContours(zoomLevel, options) {
|
|
|
115
115
|
const { negative = false, timeout = 2000, nbLevels, data } = options;
|
|
116
116
|
const xs = getRange(data.minX, data.maxX, data.z[0].length);
|
|
117
117
|
const ys = getRange(data.minY, data.maxY, data.z.length);
|
|
118
|
-
// @ts-expect-error refactor Conrect class to accept Float32Array Array instead of an array of number
|
|
119
118
|
const conrec = new Conrec(data.z, { xs, ys, swapAxes: false });
|
|
120
119
|
const sanResult = calculateSanPlot('2D', data);
|
|
121
120
|
const median = sanResult.positive;
|
|
@@ -46,7 +46,6 @@ export function unlink(zone, isOnZoneLevel, signalIndex, axis) {
|
|
|
46
46
|
delete zone.signals[signalIndex][axis].diaIDs;
|
|
47
47
|
delete zone.signals[signalIndex][axis].nbAtoms;
|
|
48
48
|
}
|
|
49
|
-
setNbAtoms(zone, axis);
|
|
50
49
|
}
|
|
51
50
|
else if (axis !== undefined) {
|
|
52
51
|
resetDiaIDs(zone, axis);
|
package/lib/versionInfo.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default { version: 'v0.
|
|
1
|
+
export default { version: 'v0.37.0' };
|
|
@@ -32,12 +32,6 @@ function usePath(spectrum, contours) {
|
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
else {
|
|
36
|
-
pathBuilder.moveTo(_scaleX(element[0].x + shift.x), _scaleY(element[0].y + shift.y));
|
|
37
|
-
for (let j = 1; j < element.length; j++) {
|
|
38
|
-
pathBuilder.lineTo(_scaleX(element[j].x + shift.x), _scaleY(element[j].y + shift.y));
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
35
|
}
|
|
42
36
|
pathBuilder.closePath();
|
|
43
37
|
return pathBuilder.toString();
|
|
@@ -110,21 +110,20 @@ const defaultData = {
|
|
|
110
110
|
spectra: [],
|
|
111
111
|
};
|
|
112
112
|
const NMRium = (0, react_2.forwardRef)(function NMRium(props, ref) {
|
|
113
|
-
|
|
113
|
+
const { onError, ...otherProps } = props;
|
|
114
|
+
return ((0, jsx_runtime_1.jsx)(ui_1.RootLayout, { style: { width: '100%' }, children: (0, jsx_runtime_1.jsx)(react_error_boundary_1.ErrorBoundary, { FallbackComponent: ErrorOverlay_1.default, onError: onError, children: (0, jsx_runtime_1.jsx)(InnerNMRium, { ...otherProps, innerRef: ref }) }) }));
|
|
114
115
|
});
|
|
115
116
|
function InnerNMRium({ data: dataProp = defaultData, workspace, customWorkspaces, preferences, getSpinner = SpinnerContext_1.defaultGetSpinner, onChange, emptyText, innerRef, }) {
|
|
116
117
|
const rootRef = (0, react_2.useRef)(null);
|
|
117
118
|
const elementsWrapperRef = (0, react_2.useRef)(null);
|
|
118
119
|
const viewerRef = (0, react_2.useRef)(null);
|
|
119
|
-
const [show, toggle] = (0,
|
|
120
|
+
const [show, , setOff, toggle] = (0, ui_1.useOnOff)(false);
|
|
120
121
|
const handleChange = (0, react_2.useRef)(onChange);
|
|
121
122
|
(0, react_2.useEffect)(() => {
|
|
122
123
|
handleChange.current = onChange;
|
|
123
124
|
}, [onChange]);
|
|
124
125
|
const isFullscreen = (0, react_use_1.useFullscreen)(rootRef, show, {
|
|
125
|
-
onClose:
|
|
126
|
-
toggle(false);
|
|
127
|
-
},
|
|
126
|
+
onClose: setOff,
|
|
128
127
|
});
|
|
129
128
|
const [state, dispatch] = (0, react_2.useReducer)(Reducer_1.spectrumReducer, Reducer_1.initialState, Reducer_1.initState);
|
|
130
129
|
const [preferencesState, dispatchPreferences] = (0, react_2.useReducer)(preferencesReducer_1.default, preferencesReducer_1.preferencesInitialState, preferencesReducer_1.initPreferencesState);
|
package/lib-cjs/component/{panels/RangesPanel/TableColumns → elements}/RemoveAssignmentsButton.js
RENAMED
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RemoveAssignmentsButton = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
3
|
+
exports.RemoveAssignmentsButton = exports.removeAssignmentCssStyle = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
|
+
/** @jsxImportSource @emotion/react */
|
|
6
|
+
const react_1 = require("@emotion/react");
|
|
5
7
|
const fa_1 = require("react-icons/fa");
|
|
8
|
+
exports.removeAssignmentCssStyle = (0, react_1.css) `
|
|
9
|
+
.remove-assignment {
|
|
10
|
+
visibility: hidden;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
&:hover {
|
|
14
|
+
.remove-assignment {
|
|
15
|
+
visibility: visible;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
`;
|
|
6
19
|
function RemoveAssignmentsButton({ onClick }) {
|
|
7
20
|
return ((0, jsx_runtime_1.jsx)("sup", { className: "remove-assignment", children: (0, jsx_runtime_1.jsx)("button", { type: "button", style: {
|
|
8
21
|
padding: 0,
|
|
@@ -106,7 +106,7 @@ function HeaderInner(props) {
|
|
|
106
106
|
alignItems: 'center',
|
|
107
107
|
}, children: [(0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(ui_1.Toolbar, { orientation: "horizontal", children: (0, jsx_runtime_1.jsx)(AboutUsModal_1.default, {}) }) }), (0, jsx_runtime_1.jsx)("div", { className: "toolOptionsPanel", style: { flex: 1 }, children: selectedPanel })] }), (0, jsx_runtime_1.jsxs)(HeaderContainer_1.HeaderContainer, { style: {
|
|
108
108
|
alignItems: 'center',
|
|
109
|
-
}, children: [!hideGeneralSettings && ((0, jsx_runtime_1.jsx)(DropDownButton_1.default, { data: workspacesList, selectedKey: workspace.current, onSelect: changeWorkspaceHandler, renderItem: renderItem })
|
|
109
|
+
}, children: [!hideGeneralSettings && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(DropDownButton_1.default, { data: workspacesList, selectedKey: workspace.current, onSelect: changeWorkspaceHandler, renderItem: renderItem }), (0, jsx_runtime_1.jsx)(SaveButton, {})] })), !general?.hideLogs && (0, jsx_runtime_1.jsx)(LogsHistory_1.LogsHistory, {}), (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsxs)(ui_1.Toolbar, { orientation: "horizontal", children: [(0, jsx_runtime_1.jsx)(ui_1.Toolbar.Item, { id: "user-manual", title: "User manual", onClick: () => window.open(constants_1.docsBaseUrl, '_blank'), children: (0, jsx_runtime_1.jsx)(fa_1.FaQuestionCircle, {}) }), !hideGeneralSettings && ((0, jsx_runtime_1.jsx)(GeneralSettings_1.default, { height: height / 2 })), !isFullscreen && ((0, jsx_runtime_1.jsx)(ui_1.Toolbar.Item, { id: "full-screen", onClick: onMaximize, title: "Full Screen", className: "windowButton", children: (0, jsx_runtime_1.jsx)(fa_1.FaRegWindowMaximize, {}) }))] }) })] })] }) }));
|
|
110
110
|
}
|
|
111
111
|
function SaveButton() {
|
|
112
112
|
const { workspace, workspaces, originalWorkspaces } = (0, PreferencesContext_1.usePreferences)();
|
|
@@ -0,0 +1,54 @@
|
|
|
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 react_1 = require("@emotion/react");
|
|
9
|
+
const fa_1 = require("react-icons/fa");
|
|
10
|
+
const ui_1 = require("react-science/ui");
|
|
11
|
+
const Button_1 = __importDefault(require("../elements/Button"));
|
|
12
|
+
const styles = (0, react_1.css) `
|
|
13
|
+
width: 600px;
|
|
14
|
+
|
|
15
|
+
.content {
|
|
16
|
+
padding: 2em;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
ul {
|
|
20
|
+
list-style-type: disc;
|
|
21
|
+
margin-left: 25px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
p,
|
|
25
|
+
li {
|
|
26
|
+
user-select: text;
|
|
27
|
+
font-size: 1.1em;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
a {
|
|
31
|
+
color: #00bcd4;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
a:hover,
|
|
35
|
+
a:focus {
|
|
36
|
+
text-decoration: underline;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.header span {
|
|
40
|
+
color: #464646;
|
|
41
|
+
font-size: 15px;
|
|
42
|
+
flex: 1;
|
|
43
|
+
user-select: none;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
p {
|
|
47
|
+
padding: 0.8em 0;
|
|
48
|
+
}
|
|
49
|
+
`;
|
|
50
|
+
function AboutPredictionModal() {
|
|
51
|
+
const [isOpenDialog, openDialog, closeDialog] = (0, ui_1.useOnOff)(false);
|
|
52
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Button_1.default.BarButton, { onClick: openDialog, tooltipOrientation: "horizontal", toolTip: "About Prediction", children: (0, jsx_runtime_1.jsx)(fa_1.FaInfo, {}) }), (0, jsx_runtime_1.jsx)(ui_1.Modal, { hasCloseButton: true, isOpen: isOpenDialog, onRequestClose: closeDialog, children: (0, jsx_runtime_1.jsxs)("div", { css: styles, children: [(0, jsx_runtime_1.jsx)(ui_1.Modal.Header, { children: (0, jsx_runtime_1.jsx)("div", { className: "header", children: (0, jsx_runtime_1.jsx)("span", { children: "About Prediction" }) }) }), (0, jsx_runtime_1.jsx)(ui_1.Modal.Body, { children: (0, jsx_runtime_1.jsxs)("div", { className: "content", children: [(0, jsx_runtime_1.jsx)("p", { children: "If you are using our tools please cite us:" }), (0, jsx_runtime_1.jsxs)("ul", { children: [(0, jsx_runtime_1.jsxs)("li", { children: ["Banfi, D.; Patiny, L.", ' ', (0, jsx_runtime_1.jsx)("a", { href: "http://dx.doi.org/10.2533/chimia.2008.280", target: "_blank", rel: "noreferrer", children: "www.nmrdb.org: Resurrecting and processing NMR spectra on-line" }), ' ', "Chimia, 2008, 62(4), 280-281."] }), (0, jsx_runtime_1.jsxs)("li", { children: ["Andr\u00E9s M. Castillo, Luc Patiny and Julien Wist.", ' ', (0, jsx_runtime_1.jsx)("a", { href: "http://dx.doi.org/10.1016/j.jmr.2010.12.008", target: "_blank", rel: "noreferrer", children: "Fast and Accurate Algorithm for the Simulation of NMR spectra of Large Spin Systems" }), ". Journal of Magnetic Resonance 2011."] })] }), (0, jsx_runtime_1.jsx)("p", { children: "1H NMR prediction was possible thanks to the tool of the FCT-Universidade NOVA de Lisboa developed by Yuri Binev and Joao Aires-de-Sousa:" }), (0, jsx_runtime_1.jsxs)("ul", { children: [(0, jsx_runtime_1.jsxs)("li", { children: ["Y. Binev, M.M. Marques, J. Aires-de-Sousa,", ' ', (0, jsx_runtime_1.jsx)("a", { href: "http://dx.doi.org/10.1021/ci700172n", target: "_blank", rel: "noreferrer", children: "Prediction of 1H NMR coupling constants with associative neural networks trained for chemical shifts" }), ' ', "J. Chem. Inf. Model. 2007, 47/(6), 2089-2097."] }), (0, jsx_runtime_1.jsxs)("li", { children: ["Aires-de-Sousa, M. Hemmer, J. Gasteiger,", ' ', (0, jsx_runtime_1.jsx)("a", { href: "http://dx.doi.org/10.1021/ac010737m", target: "_blank", rel: "noreferrer", children: "\u201C Prediction of 1H NMR Chemical Shifts Using Neural Networks\u201D" }), ", Analytical Chemistry, 2002, 74(1), 80-90."] })] }), (0, jsx_runtime_1.jsx)("p", { children: "13 NMR prediction was possible thanks to NMRshiftDB:" }), (0, jsx_runtime_1.jsx)("ul", { children: (0, jsx_runtime_1.jsxs)("li", { children: ["Steinbeck, Christoph, Stefan Krause, and Stefan Kuhn.", ' ', (0, jsx_runtime_1.jsx)("a", { href: "http://dx.doi.org/10.1021/ci0341363", target: "_blank", rel: "noreferrer", children: "NMRShiftDB Constructing a Free Chemical Information System with Open-Source Components." }), ' ', "Journal of chemical information and computer sciences, 2003, 43(6): 1733-1739."] }) })] }) })] }) })] }));
|
|
53
|
+
}
|
|
54
|
+
exports.default = AboutPredictionModal;
|
|
@@ -42,37 +42,27 @@ function IntegralTable({ activeTab, data }) {
|
|
|
42
42
|
index: 1,
|
|
43
43
|
Header: '#',
|
|
44
44
|
accessor: (_, index) => index + 1,
|
|
45
|
-
width:
|
|
45
|
+
style: { width: '30px', maxWidth: '30px' },
|
|
46
46
|
},
|
|
47
47
|
{
|
|
48
48
|
index: 2,
|
|
49
49
|
Header: 'From',
|
|
50
50
|
sortType: 'basic',
|
|
51
|
-
resizable: true,
|
|
52
51
|
accessor: (row) => row.from.toFixed(2),
|
|
53
52
|
},
|
|
54
53
|
{
|
|
55
54
|
index: 3,
|
|
56
55
|
Header: 'To',
|
|
57
56
|
sortType: 'basic',
|
|
58
|
-
resizable: true,
|
|
59
57
|
accessor: (row) => row.to.toFixed(2),
|
|
60
58
|
},
|
|
61
|
-
{
|
|
62
|
-
index: 6,
|
|
63
|
-
Header: 'Kind',
|
|
64
|
-
sortType: 'basic',
|
|
65
|
-
resizable: true,
|
|
66
|
-
accessor: 'kind',
|
|
67
|
-
Cell: ({ row }) => ((0, jsx_runtime_1.jsx)(Select_1.default, { onChange: (value) => changeIntegralDataHandler(value, row), items: SignalsKinds_1.SignalKinds, style: selectStyle, defaultValue: row.original.kind })),
|
|
68
|
-
},
|
|
69
59
|
{
|
|
70
60
|
index: 7,
|
|
71
61
|
style: { width: '1%', maxWidth: '24px', minWidth: '24px' },
|
|
72
62
|
id: 'delete-button',
|
|
73
63
|
Cell: ({ row }) => ((0, jsx_runtime_1.jsx)("button", { type: "button", className: "delete-button", onClick: (e) => deleteIntegralHandler(e, row), children: (0, jsx_runtime_1.jsx)(fa_1.FaRegTrashAlt, {}) })),
|
|
74
64
|
},
|
|
75
|
-
], [
|
|
65
|
+
], [deleteIntegralHandler]);
|
|
76
66
|
const saveRelativeHandler = (0, react_1.useCallback)((event, row) => {
|
|
77
67
|
const data = { value: event.target.value, id: row.id };
|
|
78
68
|
dispatch({
|
|
@@ -108,7 +98,21 @@ function IntegralTable({ activeTab, data }) {
|
|
|
108
98
|
return ((0, jsx_runtime_1.jsx)(EditableColumn_1.default, { value: integral, onSave: (event) => saveRelativeHandler(event, row.original), type: "number" }));
|
|
109
99
|
},
|
|
110
100
|
},
|
|
111
|
-
|
|
101
|
+
{
|
|
102
|
+
index: 6,
|
|
103
|
+
Header: 'Kind',
|
|
104
|
+
sortType: 'basic',
|
|
105
|
+
resizable: true,
|
|
106
|
+
accessor: 'kind',
|
|
107
|
+
showWhen: 'showKind',
|
|
108
|
+
Cell: ({ row }) => ((0, jsx_runtime_1.jsx)(Select_1.default, { onChange: (value) => changeIntegralDataHandler(value, row), items: SignalsKinds_1.SignalKinds, style: selectStyle, defaultValue: row.original.kind })),
|
|
109
|
+
},
|
|
110
|
+
], [
|
|
111
|
+
activeTab,
|
|
112
|
+
changeIntegralDataHandler,
|
|
113
|
+
integralsPreferences,
|
|
114
|
+
saveRelativeHandler,
|
|
115
|
+
]);
|
|
112
116
|
const tableColumns = (0, react_1.useMemo)(() => {
|
|
113
117
|
let columns = [...initialColumns];
|
|
114
118
|
for (const col of COLUMNS) {
|
|
@@ -28,6 +28,12 @@ const formatFields = [
|
|
|
28
28
|
checkControllerName: 'relative.show',
|
|
29
29
|
formatControllerName: 'relative.format',
|
|
30
30
|
},
|
|
31
|
+
{
|
|
32
|
+
id: 3,
|
|
33
|
+
label: 'Kind :',
|
|
34
|
+
checkControllerName: 'showKind',
|
|
35
|
+
hideFormatField: true,
|
|
36
|
+
},
|
|
31
37
|
];
|
|
32
38
|
function IntegralsPreferences(props, ref) {
|
|
33
39
|
const preferences = (0, PreferencesContext_1.usePreferences)();
|
|
@@ -35,9 +41,6 @@ function IntegralsPreferences(props, ref) {
|
|
|
35
41
|
const nuclei = (0, react_1.useMemo)(() => (0, getUniqueNuclei_1.getUniqueNuclei)(nucleus), [nucleus]);
|
|
36
42
|
const preferencesByNuclei = (0, usePanelPreferences_1.usePanelPreferencesByNuclei)('integrals', nuclei);
|
|
37
43
|
const formRef = (0, react_1.useRef)();
|
|
38
|
-
(0, react_1.useEffect)(() => {
|
|
39
|
-
formRef.current.setValues(preferencesByNuclei);
|
|
40
|
-
}, [preferencesByNuclei]);
|
|
41
44
|
const saveHandler = (0, react_1.useCallback)((values) => {
|
|
42
45
|
preferences.dispatch({
|
|
43
46
|
type: 'SET_PANELS_PREFERENCES',
|
|
@@ -49,7 +52,7 @@ function IntegralsPreferences(props, ref) {
|
|
|
49
52
|
formRef.current.submitForm();
|
|
50
53
|
},
|
|
51
54
|
}));
|
|
52
|
-
return ((0, jsx_runtime_1.jsx)(PreferencesContainer_1.PreferencesContainer, { children: (0, jsx_runtime_1.jsx)(formik_1.Formik, { initialValues:
|
|
55
|
+
return ((0, jsx_runtime_1.jsx)(PreferencesContainer_1.PreferencesContainer, { children: (0, jsx_runtime_1.jsx)(formik_1.Formik, { initialValues: preferencesByNuclei, onSubmit: saveHandler, innerRef: formRef, children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: nuclei?.map((n) => ((0, jsx_runtime_1.jsx)(NucleusPreferences_1.NucleusPreferences, { nucleus: n, fields: formatFields, renderTop: () => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(FormikColorInput_1.default, { name: `nuclei.${n}.color` }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "stroke width :", style: {
|
|
53
56
|
label: {
|
|
54
57
|
fontSize: '11px',
|
|
55
58
|
fontWeight: 'bold',
|
|
@@ -20,6 +20,7 @@ const MenuButton_1 = __importDefault(require("../../elements/MenuButton"));
|
|
|
20
20
|
const ToolTip_1 = __importDefault(require("../../elements/ToolTip/ToolTip"));
|
|
21
21
|
const Alert_1 = require("../../elements/popup/Alert");
|
|
22
22
|
const Modal_1 = require("../../elements/popup/Modal");
|
|
23
|
+
const AboutPredictionModal_1 = __importDefault(require("../../modal/AboutPredictionModal"));
|
|
23
24
|
const PredictSpectraModal_1 = __importDefault(require("../../modal/PredictSpectraModal"));
|
|
24
25
|
const Types_1 = require("../../reducer/types/Types");
|
|
25
26
|
const export_1 = require("../../utility/export");
|
|
@@ -27,7 +28,7 @@ const toolbarStyle = (0, react_1.css) `
|
|
|
27
28
|
display: flex;
|
|
28
29
|
flex-direction: row;
|
|
29
30
|
border-bottom: 0.55px solid rgb(240 240 240);
|
|
30
|
-
padding:
|
|
31
|
+
padding: 2px 5px;
|
|
31
32
|
|
|
32
33
|
button svg {
|
|
33
34
|
fill: #4e4e4e;
|
|
@@ -173,7 +174,7 @@ function MoleculePanelHeader({ currentIndex, molecules, moleculesView, onMolecul
|
|
|
173
174
|
});
|
|
174
175
|
}
|
|
175
176
|
const hasMolecules = molecules && molecules.length > 0;
|
|
176
|
-
return ((0, jsx_runtime_1.jsxs)("div", { css: toolbarStyle, children: [!actionsOptions.hideExport && ((0, jsx_runtime_1.jsx)(MenuButton_1.default, { component: (0, jsx_runtime_1.jsx)(fa_1.FaFileExport, {}), toolTip: "Export As", items: MOL_EXPORT_MENU, onClick: exportHandler })), !actionsOptions.hidePast && ((0, jsx_runtime_1.jsx)(ToolTip_1.default, { title: "Paste molfile", popupPlacement: "left", children: (0, jsx_runtime_1.jsx)("button", { className: "bar-button", type: "button", onClick: handlePaste, children: (0, jsx_runtime_1.jsx)(fa_1.FaPaste, {}) }) })), !actionsOptions.hideAdd && ((0, jsx_runtime_1.jsx)(ToolTip_1.default, { title: "Add molecule", popupPlacement: "left", children: (0, jsx_runtime_1.jsx)("button", { className: "bar-button", type: "button", onClick: onOpenMoleculeEditor, children: (0, jsx_runtime_1.jsx)(fa_1.FaPlus, {}) }) })), !actionsOptions.hideDelete && ((0, jsx_runtime_1.jsx)(ToolTip_1.default, { title: "Delete molecule", popupPlacement: "left", children: (0, jsx_runtime_1.jsx)("button", { className: "bar-button", type: "button", onClick: handleDelete, children: (0, jsx_runtime_1.jsx)(fa_1.FaRegTrashAlt, {}) }) })), !actionsOptions.hidePredict && hasMolecules && ((0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "Predict spectra", popupPlacement: "left", onClick: openPredictSpectraModal, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrFt, {}) })), (0, jsx_runtime_1.jsx)(ActiveButton_1.default, { value: moleculesView?.[moleculeKey]?.floating.visible || false, popupTitle: "Float molecule", popupPlacement: "left", onClick: floatMoleculeHandler, disabled: !hasMolecules, children: (0, jsx_runtime_1.jsx)(io5_1.IoOpenOutline, {}) }), (0, jsx_runtime_1.jsx)(ActiveButton_1.default, { style: { marginLeft: '2px' }, value: moleculesView?.[moleculeKey]?.showAtomNumber || false, popupTitle: "Show atom number", popupPlacement: "left", onClick: showAtomNumbersHandler, disabled: !hasMolecules, children: (0, jsx_runtime_1.jsx)("p", { style: atomLabelStyle, children: "#" }) }), (0, jsx_runtime_1.jsxs)("p", { children: [molecules &&
|
|
177
|
+
return ((0, jsx_runtime_1.jsxs)("div", { css: toolbarStyle, children: [actionsOptions?.showAboutPredict && (0, jsx_runtime_1.jsx)(AboutPredictionModal_1.default, {}), !actionsOptions.hideExport && ((0, jsx_runtime_1.jsx)(MenuButton_1.default, { component: (0, jsx_runtime_1.jsx)(fa_1.FaFileExport, {}), toolTip: "Export As", items: MOL_EXPORT_MENU, onClick: exportHandler })), !actionsOptions.hidePast && ((0, jsx_runtime_1.jsx)(ToolTip_1.default, { title: "Paste molfile", popupPlacement: "left", children: (0, jsx_runtime_1.jsx)("button", { className: "bar-button", type: "button", onClick: handlePaste, children: (0, jsx_runtime_1.jsx)(fa_1.FaPaste, {}) }) })), !actionsOptions.hideAdd && ((0, jsx_runtime_1.jsx)(ToolTip_1.default, { title: "Add molecule", popupPlacement: "left", children: (0, jsx_runtime_1.jsx)("button", { className: "bar-button", type: "button", onClick: onOpenMoleculeEditor, children: (0, jsx_runtime_1.jsx)(fa_1.FaPlus, {}) }) })), !actionsOptions.hideDelete && ((0, jsx_runtime_1.jsx)(ToolTip_1.default, { title: "Delete molecule", popupPlacement: "left", children: (0, jsx_runtime_1.jsx)("button", { className: "bar-button", type: "button", onClick: handleDelete, children: (0, jsx_runtime_1.jsx)(fa_1.FaRegTrashAlt, {}) }) })), !actionsOptions.hidePredict && hasMolecules && ((0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "Predict spectra", popupPlacement: "left", onClick: openPredictSpectraModal, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrFt, {}) })), (0, jsx_runtime_1.jsx)(ActiveButton_1.default, { value: moleculesView?.[moleculeKey]?.floating.visible || false, popupTitle: "Float molecule", popupPlacement: "left", onClick: floatMoleculeHandler, disabled: !hasMolecules, children: (0, jsx_runtime_1.jsx)(io5_1.IoOpenOutline, {}) }), (0, jsx_runtime_1.jsx)(ActiveButton_1.default, { style: { marginLeft: '2px' }, value: moleculesView?.[moleculeKey]?.showAtomNumber || false, popupTitle: "Show atom number", popupPlacement: "left", onClick: showAtomNumbersHandler, disabled: !hasMolecules, children: (0, jsx_runtime_1.jsx)("p", { style: atomLabelStyle, children: "#" }) }), (0, jsx_runtime_1.jsxs)("p", { children: [molecules &&
|
|
177
178
|
molecules.length > 0 &&
|
|
178
179
|
`${+(currentIndex + 1)} / ${molecules.length}`, ' '] })] }));
|
|
179
180
|
}
|