nmrium 0.53.0 → 0.54.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/component/1d/Viewer1D.js +48 -17
- package/lib/component/1d/ranges/Range.js +14 -6
- package/lib/component/1d/tool/XLabelPointer.js +4 -12
- package/lib/component/2d/tools/XYLabelPointer.js +3 -9
- package/lib/component/context/LoggerContext.js +11 -4
- package/lib/component/elements/CloseButton.d.ts +1 -1
- package/lib/component/elements/CustomToolTip.d.ts +8 -0
- package/lib/component/elements/CustomToolTip.js +107 -0
- package/lib/component/elements/EditableColumn.js +3 -2
- package/lib/component/elements/SaveButton.d.ts +1 -1
- package/lib/component/elements/formik/FormikError.js +2 -4
- package/lib/component/elements/formik/FormikInput.js +2 -2
- package/lib/component/header/Header.js +1 -1
- package/lib/component/header/PhaseCorrectionTwoDimensionsPanel.js +41 -10
- package/lib/component/main/NMRiumStateProvider.js +11 -1
- package/lib/component/modal/AboutPredictionModal.js +1 -1
- package/lib/component/modal/AboutSpectrumSimulationModal.js +1 -1
- package/lib/component/modal/CopyClipboardModal.js +1 -1
- package/lib/component/modal/EditPeakShapeModal.js +1 -1
- package/lib/component/modal/ImportPublicationStringModal.js +11 -5
- package/lib/component/modal/PredictSpectraModal.js +1 -1
- package/lib/component/modal/aboutUs/AboutUsModal.js +1 -1
- package/lib/component/modal/changeSum/ChangeSumModal.js +1 -1
- package/lib/component/modal/editRange/EditRangeModal.js +1 -1
- package/lib/component/modal/editRange/forms/components/signal-tabs/SignalJCouplingsTable.js +1 -1
- package/lib/component/modal/editRange/forms/components/signal-tabs/SignalPeaksTable.js +1 -1
- package/lib/component/modal/editZone/EditZoneModal.js +1 -1
- package/lib/component/modal/setting/GeneralSettings.js +12 -19
- package/lib/component/panels/AutomaticAssignment/AutomaticAssignment.js +2 -2
- package/lib/component/panels/IntegralsPanel/IntegralPanel.js +2 -2
- package/lib/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +2 -2
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +1 -1
- package/lib/component/panels/PeaksPanel/PeaksPanel.js +5 -5
- package/lib/component/panels/RangesPanel/RangesHeader.js +11 -11
- package/lib/component/panels/RangesPanel/RangesPreferences.js +16 -16
- package/lib/component/panels/RangesPanel/RangesTable.js +1 -1
- package/lib/component/panels/RangesPanel/RangesTableRow.js +2 -2
- package/lib/component/panels/SpectraPanel/SpectraPanelHeader.js +22 -8
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/EditLinkModal.js +1 -1
- package/lib/component/panels/SummaryPanel/SetMolecularFormulaModal.d.ts +5 -5
- package/lib/component/panels/SummaryPanel/SetMolecularFormulaModal.js +79 -89
- package/lib/component/panels/SummaryPanel/SetShiftTolerancesModal.d.ts +5 -4
- package/lib/component/panels/SummaryPanel/SetShiftTolerancesModal.js +66 -98
- package/lib/component/panels/SummaryPanel/SummaryPanel.js +13 -32
- package/lib/component/panels/ZonesPanel/ZonesPanel.js +4 -4
- package/lib/component/panels/databasePanel/DatabaseSearchOptions.js +2 -2
- package/lib/component/panels/header/DefaultPanelHeader.js +2 -2
- package/lib/component/panels/header/PreferencesHeader.js +1 -1
- package/lib/component/panels/header/SpectraAutomaticPickingButton.js +1 -1
- package/lib/component/panels/multipleAnalysisPanel/MultipleSpectraAnalysisPanel.js +4 -4
- package/lib/component/reducer/Reducer.js +2 -0
- package/lib/component/reducer/actions/FiltersActions.d.ts +3 -2
- package/lib/component/reducer/actions/FiltersActions.js +27 -1
- package/lib/component/reducer/actions/MoleculeActions.js +1 -1
- package/lib/component/reducer/actions/RangesActions.d.ts +2 -3
- package/lib/component/reducer/actions/RangesActions.js +16 -20
- package/lib/component/reducer/actions/SpectraActions.d.ts +5 -4
- package/lib/component/reducer/actions/SpectraActions.js +5 -1
- package/lib/component/reducer/preferences/actions/setWorkspace.js +4 -3
- package/lib/component/toolbar/ToolBar.js +111 -25
- package/lib/component/workspaces/workspaceDefaultProperties.js +7 -12
- package/lib/data/data1d/Spectrum1D/get1DColor.d.ts +10 -3
- package/lib/data/data1d/Spectrum1D/get1DColor.js +28 -2
- package/lib/data/data1d/Spectrum1D/index.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/index.js +2 -2
- package/lib/data/data1d/Spectrum1D/ranges/createRange.d.ts +50 -0
- package/lib/data/data1d/Spectrum1D/ranges/createRange.js +51 -0
- package/lib/data/data1d/Spectrum1D/ranges/detectSignals.d.ts +2 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectSignals.js +4 -2
- package/lib/data/data1d/Spectrum1D/ranges/resizeRange.d.ts +52 -0
- package/lib/data/data1d/Spectrum1D/ranges/resizeRange.js +28 -0
- package/lib/data/data2d/Spectrum2D/get2DColor.d.ts +11 -3
- package/lib/data/data2d/Spectrum2D/get2DColor.js +20 -4
- package/lib/data/data2d/Spectrum2D/getSlice.js +1 -1
- package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.d.ts +1 -0
- package/lib/data/data2d/Spectrum2D/zones/initiateZones.d.ts +1 -0
- package/lib/data/utilities/generateColor.d.ts +7 -3
- package/lib/data/utilities/generateColor.js +5 -17
- package/lib/versionInfo.js +1 -1
- package/package.json +20 -20
- package/lib/component/elements/MolecularFormulaInput.d.ts +0 -6
- package/lib/component/elements/MolecularFormulaInput.js +0 -63
- package/lib/data/data1d/Spectrum1D/ranges/addRange.d.ts +0 -7
- package/lib/data/data1d/Spectrum1D/ranges/addRange.js +0 -31
- package/lib/data/data1d/Spectrum1D/ranges/changeRange.d.ts +0 -3
- package/lib/data/data1d/Spectrum1D/ranges/changeRange.js +0 -32
|
@@ -40,6 +40,6 @@ const styles = css `
|
|
|
40
40
|
`;
|
|
41
41
|
function AboutPredictionModal() {
|
|
42
42
|
const [isOpenDialog, openDialog, closeDialog] = useOnOff(false);
|
|
43
|
-
return (_jsxs(_Fragment, { children: [_jsx(Toolbar.Item, { icon: _jsx(FaInfo, {}), onClick: openDialog,
|
|
43
|
+
return (_jsxs(_Fragment, { children: [_jsx(Toolbar.Item, { icon: _jsx(FaInfo, {}), onClick: openDialog, tooltip: "About prediction" }), _jsx(Dialog, { isOpen: isOpenDialog, onClose: closeDialog, title: "About prediction", style: { width: '600px' }, children: _jsxs(DialogBody, { css: styles, children: [_jsx("p", { children: "If you are using our tools please cite us:" }), _jsxs("ul", { children: [_jsxs("li", { children: ["Damiano Banfi and Luc Patiny", ' ', _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" }), ' ', _jsx("i", { children: "Chimia" }), ", ", _jsx("b", { children: "2008" }), ", 62(4), 280-281."] }), _jsxs("li", { children: ["Andr\u00E9s M. Castillo, Luc Patiny and Julien Wist", ' ', _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" }), ' ', _jsx("i", { children: "Journal of Magnetic Resonance" }), " ", _jsx("b", { children: "2011" }), ", 209(2), 123-130."] })] }), _jsxs("p", { children: [_jsx("sup", { children: "1" }), "H NMR prediction is possible thanks to the tool of the FCT-Universidade NOVA de Lisboa developed by Yuri Binev and Joao Aires-de-Sousa:"] }), _jsxs("ul", { children: [_jsxs("li", { children: ["Yuri Binev, Maria M. B. Marques and Jo\u00E3o Aires-de-Sousa", ' ', _jsxs("a", { href: "http://dx.doi.org/10.1021/ci700172n", target: "_blank", rel: "noreferrer", children: ["Prediction of ", _jsx("sup", { children: "1" }), "H NMR coupling constants with associative neural networks trained for chemical shifts"] }), ' ', _jsx("i", { children: "J. Chem. Inf. Model." }), " ", _jsx("b", { children: "2007" }), ", 47(6), 2089-2097."] }), _jsxs("li", { children: ["Jo\u00E3o Aires-de-Sousa, Markus C. Hemmer and Johann Gasteiger", ' ', _jsxs("a", { href: "http://dx.doi.org/10.1021/ac010737m", target: "_blank", rel: "noreferrer", children: ["Prediction of ", _jsx("sup", { children: "1" }), "H NMR Chemical Shifts Using Neural Networks"] }), ", ", _jsx("i", { children: "Analytical Chemistry" }), ", ", _jsx("b", { children: "2002" }), ", 74(1), 80-90."] })] }), _jsxs("p", { children: [_jsx("sup", { children: "13" }), "C NMR prediction was possible thanks to NMRshiftDB:"] }), _jsx("ul", { children: _jsxs("li", { children: ["Steinbeck, Christoph, Stefan Krause, and Stefan Kuhn", ' ', _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" }), ' ', _jsx("i", { children: "Journal of chemical information and computer sciences" }), ",", ' ', _jsx("b", { children: "2003" }), ", 43(6): 1733-1739."] }) })] }) })] }));
|
|
44
44
|
}
|
|
45
45
|
export default AboutPredictionModal;
|
|
@@ -40,6 +40,6 @@ const styles = css `
|
|
|
40
40
|
`;
|
|
41
41
|
function AboutSpectrumSimulationModal() {
|
|
42
42
|
const [isOpenDialog, openDialog, closeDialog] = useOnOff(false);
|
|
43
|
-
return (_jsxs(_Fragment, { children: [_jsx(Toolbar, { children: _jsx(Toolbar.Item, { onClick: openDialog,
|
|
43
|
+
return (_jsxs(_Fragment, { children: [_jsx(Toolbar, { children: _jsx(Toolbar.Item, { onClick: openDialog, tooltip: "About prediction", icon: _jsx(FaInfo, {}) }) }), _jsx(Dialog, { isOpen: isOpenDialog, onClose: closeDialog, title: "About spectrum simulation", style: { width: '600px' }, children: _jsxs(DialogBody, { css: styles, children: [_jsx("p", { children: "If you are using our tools please cite us:" }), _jsx("ul", { children: _jsxs("li", { children: ["Andr\u00E9s M. Castillo, Luc Patiny and Julien Wist", ' ', _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" }), ' ', _jsx("i", { children: "Journal of Magnetic Resonance" }), " ", _jsx("b", { children: "2011" }), ", 209(2), 123-130."] }) })] }) })] }));
|
|
44
44
|
}
|
|
45
45
|
export default AboutSpectrumSimulationModal;
|
|
@@ -32,7 +32,7 @@ const styles = css `
|
|
|
32
32
|
}
|
|
33
33
|
`;
|
|
34
34
|
function CopyClipboardModal({ text, onClose, onCopyClick, }) {
|
|
35
|
-
return (_jsxs("div", { css: styles, children: [_jsxs("div", { className: "main-buttons-container handle", children: [_jsx("button", { type: "button", onClick: () => onCopyClick(text), children: _jsx(FaCopy, {}) }), _jsx(CloseButton, {
|
|
35
|
+
return (_jsxs("div", { css: styles, children: [_jsxs("div", { className: "main-buttons-container handle", children: [_jsx("button", { type: "button", onClick: () => onCopyClick(text), children: _jsx(FaCopy, {}) }), _jsx(CloseButton, { tooltip: "Close", onClick: onClose })] }), _jsx("div", { className: "inner-container",
|
|
36
36
|
// eslint-disable-next-line react/no-danger
|
|
37
37
|
dangerouslySetInnerHTML: { __html: text } })] }));
|
|
38
38
|
}
|
|
@@ -79,6 +79,6 @@ function EditPeakShapeModal({ onClose = () => null, peak, peaksPreferences, }) {
|
|
|
79
79
|
}, [dispatch, onClose, peak.id]);
|
|
80
80
|
const values = getValues(peak, kind);
|
|
81
81
|
const valuePPM = formatNumber(peak.x, peaksPreferences.deltaPPM.format);
|
|
82
|
-
return (_jsxs("div", { css: [ModalStyles, styles], children: [_jsxs("div", { className: "header handle", children: [_jsxs("span", { children: [`Peak Shape Edition ( ${valuePPM} PPM)`, " "] }), _jsx(CloseButton, {
|
|
82
|
+
return (_jsxs("div", { css: [ModalStyles, styles], children: [_jsxs("div", { className: "header handle", children: [_jsxs("span", { children: [`Peak Shape Edition ( ${valuePPM} PPM)`, " "] }), _jsx(CloseButton, { tooltip: "Close", onClick: () => onClose?.(), className: "close-bt" })] }), _jsx("div", { className: "inner-content", children: _jsx(Formik, { enableReinitialize: true, innerRef: refForm, initialValues: values, validationSchema: validation(kind), onSubmit: changePeakShapeHandler, children: _jsxs(_Fragment, { children: [_jsx(Label, { title: "Kind:", style: labelStyle, children: _jsx(Select, { items: KINDS, style: { margin: 0, height: 30 }, value: kind, onChange: (kind) => setKind(kind) }) }), _jsx(Label, { title: "FWHM:", style: labelStyle, children: _jsx(FormikInput, { name: "fwhm", style: inputStyle }) }), kind === 'pseudoVoigt' && (_jsx(Label, { title: "Mu:", style: labelStyle, children: _jsx(FormikInput, { name: "mu", style: inputStyle }) }))] }) }) }), _jsx("div", { className: "footer-container", children: _jsx(ActionButtons, { style: { flexDirection: 'row-reverse', margin: 0 }, onDone: () => refForm.current.submitForm(), doneLabel: "Save", onCancel: () => onClose?.() }) })] }));
|
|
83
83
|
}
|
|
84
84
|
export default EditPeakShapeModal;
|
|
@@ -4,7 +4,7 @@ import { FifoLogger } from 'fifo-logger';
|
|
|
4
4
|
import { Formik } from 'formik';
|
|
5
5
|
import debounce from 'lodash/debounce';
|
|
6
6
|
import { resurrect } from 'nmr-processing';
|
|
7
|
-
import { useMemo, useRef, useState } from 'react';
|
|
7
|
+
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
8
8
|
import * as yup from 'yup';
|
|
9
9
|
import { useDispatch } from '../context/DispatchContext';
|
|
10
10
|
import { useToaster } from '../context/ToasterContext';
|
|
@@ -41,11 +41,17 @@ function InnerImportPublicationStringModal(props) {
|
|
|
41
41
|
const dispatch = useDispatch();
|
|
42
42
|
const toaster = useToaster();
|
|
43
43
|
const [logs, setLogs] = useState([]);
|
|
44
|
-
const loggerRef = useRef(new FifoLogger(
|
|
45
|
-
|
|
44
|
+
const loggerRef = useRef(new FifoLogger());
|
|
45
|
+
useEffect(() => {
|
|
46
|
+
function handleLogs({ detail: { logs } }) {
|
|
46
47
|
setLogs(logs.slice());
|
|
47
|
-
}
|
|
48
|
-
|
|
48
|
+
}
|
|
49
|
+
const loggerInstance = loggerRef.current;
|
|
50
|
+
loggerInstance.addEventListener('change', handleLogs);
|
|
51
|
+
return () => {
|
|
52
|
+
loggerInstance.removeEventListener('change', handleLogs);
|
|
53
|
+
};
|
|
54
|
+
}, []);
|
|
49
55
|
const COLUMNS = useMemo(() => [
|
|
50
56
|
{
|
|
51
57
|
Header: '#',
|
|
@@ -107,7 +107,7 @@ export function PredictSpectraModal({ onClose = () => null, molecule, }) {
|
|
|
107
107
|
dispatch,
|
|
108
108
|
logger,
|
|
109
109
|
]);
|
|
110
|
-
return (_jsxs(_Fragment, { children: [_jsx(Toolbar, { children: _jsx(Toolbar.Item, { icon: _jsx(SvgNmrFt, {}),
|
|
110
|
+
return (_jsxs(_Fragment, { children: [_jsx(Toolbar, { children: _jsx(Toolbar.Item, { icon: _jsx(SvgNmrFt, {}), tooltip: "Predict spectra", onClick: openDialog }) }), _jsxs(Dialog, { isOpen: isOpenDialog, onClose: () => {
|
|
111
111
|
onClose();
|
|
112
112
|
closeDialog();
|
|
113
113
|
}, style: { width: 600, maxWidth: 1000 }, title: "Prediction of NMR spectrum", children: [_jsxs(DialogBody, { css: styles, children: [_jsx(PredictionPreferences, { onSubmit: submitHandler, options: initValues, ref: refForm }), _jsx("p", { className: "warning", children: "In order to predict spectra we are calling an external service and the chemical structure will leave your browser! You should never predict spectra for confidential molecules." }), _jsx("div", { className: "warning-container", children: _jsx(Checkbox, { onChange: (value) => setApproved(value.target.checked), checked: isApproved, label: "I confirm that the chemical structure is not confidential." }) })] }), _jsx(DialogFooter, { className: "footer-container", children: _jsx(Button.Done, { onClick: handleSave, disabled: !isApproved, children: "Predict spectrum" }) })] })] }));
|
|
@@ -70,7 +70,7 @@ const styles = css `
|
|
|
70
70
|
`;
|
|
71
71
|
function AboutUsModal() {
|
|
72
72
|
const [isOpenDialog, openDialog, closeDialog] = useOnOff(false);
|
|
73
|
-
return (_jsxs(_Fragment, { children: [_jsx(Toolbar.Item, { onClick: openDialog, id: "logo",
|
|
73
|
+
return (_jsxs(_Fragment, { children: [_jsx(Toolbar.Item, { onClick: openDialog, id: "logo", tooltip: "About NMRium", icon: _jsx(SvgLogoNmrium, {}) }), _jsx(Dialog, { isOpen: isOpenDialog, onClose: closeDialog, style: {
|
|
74
74
|
maxWidth: 1000,
|
|
75
75
|
width: '40vw',
|
|
76
76
|
minWidth: '500px',
|
|
@@ -6,7 +6,7 @@ import { ChangeSumModalContents, } from './ChangeSumModalContents';
|
|
|
6
6
|
export default function ChangeSumModal(props) {
|
|
7
7
|
const { disabled = false, currentSum, sumType, ...otherProps } = props;
|
|
8
8
|
const [isOpenDialog, openDialog, closeDialog] = useOnOff(false);
|
|
9
|
-
return (_jsxs(_Fragment, { children: [_jsx(Toolbar.Item, { disabled: disabled, icon: _jsx(SvgNmrSum, {}),
|
|
9
|
+
return (_jsxs(_Fragment, { children: [_jsx(Toolbar.Item, { disabled: disabled, icon: _jsx(SvgNmrSum, {}), tooltip: currentSum
|
|
10
10
|
? `Change ${sumType} sum (${currentSum.toFixed(2)})`
|
|
11
11
|
: `Change ${sumType} sum`, onClick: openDialog }), isOpenDialog && (_jsx(Dialog, { isOpen: true, onClose: closeDialog, style: { width: 500, height: 400 }, title: currentSum
|
|
12
12
|
? `Set new ${sumType} sum (Current: ${currentSum.toFixed(2)})`
|
|
@@ -154,7 +154,7 @@ function EditRangeModal({ onSave, onClose, onZoom, onRest, rangeId, }) {
|
|
|
154
154
|
if (!rangesPreferences || !range) {
|
|
155
155
|
return;
|
|
156
156
|
}
|
|
157
|
-
return (_jsxs("div", { css: styles, children: [_jsxs("div", { className: "header handle", children: [_jsx(Button.Action, { onClick: handleOnZoom, fill: "outline", style: { fontSize: '14' }, color: { base: '#5f5f5f', hover: 'white' }, children: _jsx(FaSearchPlus, { title: "Set to default view on range in spectrum" }) }), _jsx("span", { className: "title", children: ` Range and Signal edition: ${formatNumber(range?.from, rangesPreferences.from.format)} ppm to ${formatNumber(range?.to, rangesPreferences.to.format)} ppm` }), _jsx(SaveButton, { onClick: () => formRef.current.submitForm(),
|
|
157
|
+
return (_jsxs("div", { css: styles, children: [_jsxs("div", { className: "header handle", children: [_jsx(Button.Action, { onClick: handleOnZoom, fill: "outline", style: { fontSize: '14' }, color: { base: '#5f5f5f', hover: 'white' }, children: _jsx(FaSearchPlus, { title: "Set to default view on range in spectrum" }) }), _jsx("span", { className: "title", children: ` Range and Signal edition: ${formatNumber(range?.from, rangesPreferences.from.format)} ppm to ${formatNumber(range?.to, rangesPreferences.to.format)} ppm` }), _jsx(SaveButton, { onClick: () => formRef.current.submitForm(), tooltip: "Save and Exit" }), _jsx(CloseButton, { tooltip: "Close", onClick: handleOnClose })] }), _jsx(Formik, { innerRef: formRef, initialValues: data, validationSchema: editRangeFormValidation, onSubmit: handleOnSave, children: _jsxs(_Fragment, { children: [_jsx(SignalsContent, { range: range }), _jsx(FormikOnChange, { onChange: changeHandler })] }) })] }));
|
|
158
158
|
}
|
|
159
159
|
function useRange(rangeId) {
|
|
160
160
|
const { ranges } = useSpectrum({
|
|
@@ -126,7 +126,7 @@ export function SignalJCouplingsTable(props) {
|
|
|
126
126
|
function handleActiveRow(row) {
|
|
127
127
|
return row?.index === lastSelectedCouplingIndex;
|
|
128
128
|
}
|
|
129
|
-
return (_jsxs("div", { style: { display: 'flex', flexDirection: 'column' }, children: [_jsx("div", { style: { padding: '5px 0', display: 'flex' }, children: _jsxs(Toolbar, { children: [_jsx(Toolbar.Item, { icon: _jsx(FaPlus, {}),
|
|
129
|
+
return (_jsxs("div", { style: { display: 'flex', flexDirection: 'column' }, children: [_jsx("div", { style: { padding: '5px 0', display: 'flex' }, children: _jsxs(Toolbar, { children: [_jsx(Toolbar.Item, { icon: _jsx(FaPlus, {}), tooltip: "Add a new J coupling", intent: "success", onClick: () => addHandler(jCouplings) }), _jsx(Toolbar.Item, { icon: _jsx(FaRegTrashAlt, {}), tooltip: "Delete all J couplings", intent: "danger", onClick: deleteAllHandler })] }) }), _jsx("div", { style: {
|
|
130
130
|
maxHeight: '300px',
|
|
131
131
|
overflow: 'auto',
|
|
132
132
|
}, children: _jsx(ReactTable, { data: jCouplings, columns: COLUMNS, onClick: (e, rowData) => selectRowHandler(rowData.index), activeRow: handleActiveRow, emptyDataRowText: "No J Couplings" }) })] }));
|
|
@@ -134,7 +134,7 @@ export function SignalPeaksTable(props) {
|
|
|
134
134
|
function handleActiveRow(row) {
|
|
135
135
|
return row?.index === lastSelectedPeakIndex;
|
|
136
136
|
}
|
|
137
|
-
return (_jsxs("div", { style: { display: 'flex', flexDirection: 'column' }, children: [_jsx("div", { style: { padding: '5px 0', display: 'flex' }, children: _jsxs(Toolbar, { children: [_jsx(Toolbar.Item, { icon: _jsx(FaPlus, {}),
|
|
137
|
+
return (_jsxs("div", { style: { display: 'flex', flexDirection: 'column' }, children: [_jsx("div", { style: { padding: '5px 0', display: 'flex' }, children: _jsxs(Toolbar, { children: [_jsx(Toolbar.Item, { icon: _jsx(FaPlus, {}), tooltip: "Add a new peak", intent: "success", onClick: () => addHandler(peaks) }), _jsx(Toolbar.Item, { icon: _jsx(FaRegTrashAlt, {}), tooltip: "Delete all peaks", intent: "danger", onClick: deleteAllHandler })] }) }), _jsx("div", { style: {
|
|
138
138
|
maxHeight: '300px',
|
|
139
139
|
overflow: 'auto',
|
|
140
140
|
}, children: _jsx(ReactTable, { data: peaks, columns: COLUMNS, onClick: (e, rowData) => selectRowHandler(rowData.index), activeRow: handleActiveRow, emptyDataRowText: "No peaks" }) })] }));
|
|
@@ -96,6 +96,6 @@ function EditZoneModal({ onSaveEditZoneModal = () => null, onCloseEditZoneModal
|
|
|
96
96
|
}),
|
|
97
97
|
};
|
|
98
98
|
}, [rowData.signals, rowData.tableMetaInfo.experiment]);
|
|
99
|
-
return (_jsx("div", { css: styles, children: _jsx(Formik, { innerRef: formRef, initialValues: data, validationSchema: zoneFormValidation, onSubmit: handleOnSave, children: _jsxs(_Fragment, { children: [_jsxs("div", { className: "header handle", children: [_jsx(Button, { onClick: handleOnZoom, className: "zoom-button", children: _jsx(FaSearchPlus, { title: "Set to default view on range in spectrum" }) }), _jsx("span", { children: `Zone and Signal edition` }), _jsx(SaveButton, { onClick: () => formRef.current.submitForm(),
|
|
99
|
+
return (_jsx("div", { css: styles, children: _jsx(Formik, { innerRef: formRef, initialValues: data, validationSchema: zoneFormValidation, onSubmit: handleOnSave, children: _jsxs(_Fragment, { children: [_jsxs("div", { className: "header handle", children: [_jsx(Button, { onClick: handleOnZoom, className: "zoom-button", children: _jsx(FaSearchPlus, { title: "Set to default view on range in spectrum" }) }), _jsx("span", { children: `Zone and Signal edition` }), _jsx(SaveButton, { onClick: () => formRef.current.submitForm(), tooltip: "Save and exit" }), _jsx(CloseButton, { tooltip: "Close", onClick: handleOnClose })] }), _jsx(SignalsForm, {})] }) }) }));
|
|
100
100
|
}
|
|
101
101
|
export default EditZoneModal;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@emotion/react/jsx-runtime";
|
|
2
2
|
/** @jsxImportSource @emotion/react */
|
|
3
|
-
import { Dialog, DialogBody, DialogFooter, Classes } from '@blueprintjs/core';
|
|
3
|
+
import { Dialog, DialogBody, DialogFooter, Classes, Tabs, Tab, } from '@blueprintjs/core';
|
|
4
4
|
import { css } from '@emotion/react';
|
|
5
5
|
import { Formik } from 'formik';
|
|
6
6
|
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
@@ -13,8 +13,6 @@ import { useToaster } from '../../context/ToasterContext';
|
|
|
13
13
|
import ActionButtons from '../../elements/ActionButtons';
|
|
14
14
|
import Button from '../../elements/Button';
|
|
15
15
|
import Label from '../../elements/Label';
|
|
16
|
-
import Tab from '../../elements/Tab/Tab';
|
|
17
|
-
import Tabs, { PositionsEnum } from '../../elements/Tab/Tabs';
|
|
18
16
|
import DropDownButton from '../../elements/dropDownButton/DropDownButton';
|
|
19
17
|
import { useSaveSettings } from '../../hooks/useSaveSettings';
|
|
20
18
|
import { getPreferencesByWorkspace } from '../../reducer/preferences/utilities/getPreferencesByWorkspace';
|
|
@@ -31,10 +29,6 @@ import SpectraColorsTabContent from './settings-tabs/SpectraColorsTabContent';
|
|
|
31
29
|
import ToolsTabContent from './settings-tabs/ToolsTabContent';
|
|
32
30
|
import { validation } from './settingsValidation';
|
|
33
31
|
const styles = css `
|
|
34
|
-
.tab-content {
|
|
35
|
-
width: 100%;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
32
|
.section-header {
|
|
39
33
|
font-size: 13px;
|
|
40
34
|
color: #2ca8ff;
|
|
@@ -64,12 +58,6 @@ const styles = css `
|
|
|
64
58
|
width: 260px;
|
|
65
59
|
}
|
|
66
60
|
}
|
|
67
|
-
|
|
68
|
-
.inner-content {
|
|
69
|
-
padding: 15px 30px;
|
|
70
|
-
width: 100%;
|
|
71
|
-
overflow: auto;
|
|
72
|
-
}
|
|
73
61
|
`;
|
|
74
62
|
function isRestButtonDisable(currentWorkspaceSetting, workspaceName, customWorkspaces) {
|
|
75
63
|
if (!PredefinedWorkspaces[workspaceName] &&
|
|
@@ -83,7 +71,6 @@ function isRestButtonDisable(currentWorkspaceSetting, workspaceName, customWorks
|
|
|
83
71
|
}
|
|
84
72
|
function GeneralSettingsModal({ height }) {
|
|
85
73
|
const [isOpenDialog, openDialog, closeDialog] = useOnOff(false);
|
|
86
|
-
const [activeTab, setActiveTab] = useState('general');
|
|
87
74
|
const { dispatch, current: currentWorkspace, originalWorkspaces, ...preferences } = usePreferences();
|
|
88
75
|
const { saveSettings, SaveSettingsModal } = useSaveSettings();
|
|
89
76
|
const toaster = useToaster();
|
|
@@ -108,9 +95,6 @@ function GeneralSettingsModal({ height }) {
|
|
|
108
95
|
saveSettings(values);
|
|
109
96
|
closeDialog?.();
|
|
110
97
|
}
|
|
111
|
-
const tabChangeHandler = useCallback((tab) => {
|
|
112
|
-
setActiveTab(tab.tabid);
|
|
113
|
-
}, []);
|
|
114
98
|
function addWorkSpaceHandler(name) {
|
|
115
99
|
dispatch({
|
|
116
100
|
type: 'ADD_WORKSPACE',
|
|
@@ -204,7 +188,7 @@ function GeneralSettingsModal({ height }) {
|
|
|
204
188
|
function handlePastWorkspaceAction() {
|
|
205
189
|
void readText().then(handlePastWorkspace);
|
|
206
190
|
}
|
|
207
|
-
return (_jsxs(_Fragment, { children: [_jsx(Toolbar.Item, { id: "general-settings", onClick: openDialog,
|
|
191
|
+
return (_jsxs(_Fragment, { children: [_jsx(Toolbar.Item, { id: "general-settings", onClick: openDialog, tooltip: "General settings", icon: _jsx(FaWrench, {}) }), _jsxs(Dialog, { isOpen: isOpenDialog, onClose: closeDialog, style: { maxWidth: 1000, width: '50vw', minWidth: 800 }, title: "General settings", icon: "cog", children: [_jsx("div", { children: _jsxs("div", { className: Classes.DIALOG_HEADER, style: {
|
|
208
192
|
cursor: 'default',
|
|
209
193
|
paddingTop: '10px',
|
|
210
194
|
boxShadow: 'none',
|
|
@@ -218,7 +202,16 @@ function GeneralSettingsModal({ height }) {
|
|
|
218
202
|
}, children: _jsx(FaPaste, {}) })] }) }), _jsx(DialogBody, { css: css `
|
|
219
203
|
padding: 0;
|
|
220
204
|
background-color: white;
|
|
221
|
-
`, children: _jsx("div", { css: styles, style: { height }, children: _jsx(Formik, { enableReinitialize: true, innerRef: refForm, initialValues: currentWorkspace, validationSchema: validation, onSubmit: submitHandler, validate: handleDisabledRestButton, children: _jsxs(Tabs, {
|
|
205
|
+
`, children: _jsx("div", { css: styles, style: { height }, children: _jsx(Formik, { enableReinitialize: true, innerRef: refForm, initialValues: currentWorkspace, validationSchema: validation, onSubmit: submitHandler, validate: handleDisabledRestButton, children: _jsxs(Tabs, { vertical: true, css: css `
|
|
206
|
+
height: 100%;
|
|
207
|
+
|
|
208
|
+
div[role='tabpanel'] {
|
|
209
|
+
width: 100%;
|
|
210
|
+
padding: 0.8rem;
|
|
211
|
+
overflow: auto;
|
|
212
|
+
max-height: 100%;
|
|
213
|
+
}
|
|
214
|
+
`, fill: true, children: [_jsx(Tab, { title: "General", id: "general", panel: _jsx(GeneralTabContent, {}) }), _jsx(Tab, { title: "Formatting", id: "formatting", panel: _jsx(FormattingTabContent, {}) }), _jsx(Tab, { title: "Panels", id: "display", panel: _jsx(DisplayTabContent, {}) }), _jsx(Tab, { title: "Tools", id: "tools", panel: _jsx(ToolsTabContent, {}) }), _jsx(Tab, { title: "Databases", id: "databases", panel: _jsx(DatabasesTabContent, { currentWorkspace: workspaceName, originalWorkspaces: originalWorkspaces }) }), _jsx(Tab, { title: "Import filters", id: "importation-filters", panel: _jsx(ImportationFiltersTabContent, {}) }), _jsx(Tab, { title: "Title block", id: "title-block", panel: _jsx(InfoBlockTabContent, {}) }), _jsx(Tab, { title: "Auto processing", id: "on-load-processing", panel: _jsx(OnLoadProcessingTabContent, {}) }), _jsx(Tab, { title: "Spectra colors", id: "spectra-colors", panel: _jsx(SpectraColorsTabContent, {}) })] }) }) }) }), _jsx(DialogFooter, { children: _jsxs("div", { style: { display: 'flex', justifyContent: 'flex-end' }, children: [_jsx(ActionButtons, { style: { flexDirection: 'row-reverse', margin: 0 }, onDone: () => refForm.current?.submitForm(), doneLabel: "Apply and Save", onCancel: () => {
|
|
222
215
|
closeDialog?.();
|
|
223
216
|
} }), _jsx(Button.Secondary, { style: { margin: '0 10px' }, onClick: applyPreferencesHandler, children: "Apply" })] }) })] }), _jsx(SaveSettingsModal, {}), _jsx(ClipboardFallbackModal, { mode: shouldFallback, onDismiss: cleanShouldFallback, onReadText: handlePastWorkspace, text: text, label: "Workspace" })] }));
|
|
224
217
|
}
|
|
@@ -27,13 +27,13 @@ function AutomaticAssignment() {
|
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
29
|
icon: _jsx(SvgNmrAssignment2, {}),
|
|
30
|
-
|
|
30
|
+
tooltip: 'Automatic assignment',
|
|
31
31
|
onClick: getAssignments,
|
|
32
32
|
disabled: !enabled,
|
|
33
33
|
},
|
|
34
34
|
{
|
|
35
35
|
icon: _jsx(FaBolt, {}),
|
|
36
|
-
|
|
36
|
+
tooltip: 'Reset assignment',
|
|
37
37
|
onClick: restAssignments,
|
|
38
38
|
},
|
|
39
39
|
] }), _jsx("div", { className: "inner-container", children: _jsx(AutomaticAssignmentTable, { data: assignments }) })] }));
|
|
@@ -94,13 +94,13 @@ function IntegralPanelInner({ integrals, info, activeTab, xDomain, }) {
|
|
|
94
94
|
},
|
|
95
95
|
{
|
|
96
96
|
icon: _jsx(ImLink, {}),
|
|
97
|
-
|
|
97
|
+
tooltip: 'Fixed integration values',
|
|
98
98
|
onClick: toggleConstantSumHandler,
|
|
99
99
|
active: integrals?.options?.isSumConstant || false,
|
|
100
100
|
},
|
|
101
101
|
{
|
|
102
102
|
icon: _jsx(SvgNmrIntegrate, {}),
|
|
103
|
-
|
|
103
|
+
tooltip: `${booleanToString(!showIntegralsValues)} integrals values`,
|
|
104
104
|
onClick: handleShowIntegralsValues,
|
|
105
105
|
active: showIntegralsValues,
|
|
106
106
|
},
|
|
@@ -85,13 +85,13 @@ function MatrixGenerationPanel() {
|
|
|
85
85
|
return (_jsxs("div", { css: tablePanelStyle, children: [_jsx(DefaultPanelHeader, { leftButtons: [
|
|
86
86
|
{
|
|
87
87
|
icon: _jsx(SvgNmrExportAsMatrix, {}),
|
|
88
|
-
|
|
88
|
+
tooltip: 'Export spectra as a matrix',
|
|
89
89
|
onClick: handleExportAsMatrix,
|
|
90
90
|
},
|
|
91
91
|
], rightButtons: [
|
|
92
92
|
{
|
|
93
93
|
onClick: () => formRef.current?.submitForm(),
|
|
94
|
-
|
|
94
|
+
tooltip: 'Signal processing',
|
|
95
95
|
id: 'save-button',
|
|
96
96
|
intent: 'success',
|
|
97
97
|
icon: _jsx(FaCheck, {}),
|
|
@@ -160,5 +160,5 @@ export default function MoleculePanelHeader({ currentIndex, molecules, molecules
|
|
|
160
160
|
});
|
|
161
161
|
}
|
|
162
162
|
const hasMolecules = molecules && molecules.length > 0;
|
|
163
|
-
return (_jsxs(PanelHeader, { children: [_jsxs(Toolbar, { children: [renderSource === 'predictionPanel' && _jsx(AboutPredictionModal, {}), renderSource === 'moleculePanel' && (_jsxs(_Fragment, { children: [_jsx(ToolbarPopoverItem, { options: MOL_EXPORT_MENU, onClick: exportHandler, disabled: !hasMolecules,
|
|
163
|
+
return (_jsxs(PanelHeader, { children: [_jsxs(Toolbar, { children: [renderSource === 'predictionPanel' && _jsx(AboutPredictionModal, {}), renderSource === 'moleculePanel' && (_jsxs(_Fragment, { children: [_jsx(ToolbarPopoverItem, { options: MOL_EXPORT_MENU, onClick: exportHandler, disabled: !hasMolecules, tooltip: "Export As", icon: _jsx(FaFileExport, {}) }), _jsx(Toolbar.Item, { tooltip: "Paste molfile", icon: _jsx(FaPaste, {}), onClick: handlePasteMolfileAction }), _jsx(Toolbar.Item, { tooltip: "Add molecule", icon: _jsx(FaPlus, {}), onClick: onOpenMoleculeEditor })] })), renderSource === 'moleculePanel' && (_jsxs(_Fragment, { children: [_jsx(Toolbar.Item, { tooltip: "Delete molecule", icon: _jsx(FaRegTrashAlt, {}), onClick: handleDelete, disabled: !hasMolecules }), hasMolecules && (_jsx(PredictSpectraModal, { molecule: molecules[currentIndex] }))] })), _jsx(Toolbar.Item, { tooltip: "Float molecule", icon: _jsx(IoOpenOutline, {}), onClick: floatMoleculeHandler, active: moleculesView?.[moleculeKey]?.floating.visible || false, disabled: !hasMolecules }), _jsx(Toolbar.Item, { tooltip: "Show atom number", icon: _jsx("p", { style: styles.atomLabel, children: "#" }), onClick: showAtomNumbersHandler, active: moleculesView?.[moleculeKey]?.showAtomNumber || false, disabled: !hasMolecules })] }), _jsx("div", { style: { flex: 1 }, children: children }), molecules && molecules.length > 0 && (_jsx("p", { style: styles.counter, children: `${+(currentIndex + 1)} / ${molecules.length}` })), onClickPreferences && (_jsx(PreferencesButton, { tooltip: "Preferences", onClick: onClickPreferences })), _jsx(ClipboardFallbackModal, { mode: shouldFallback, onDismiss: cleanShouldFallback, onReadText: handlePasteMolfile, text: text, label: "Molfile" })] }));
|
|
164
164
|
}
|
|
@@ -98,14 +98,14 @@ function PeaksPanelInner({ peaks, info, xDomain, activeTab, peaksViewState, }) {
|
|
|
98
98
|
{
|
|
99
99
|
disabled,
|
|
100
100
|
icon: _jsx(SvgNmrPeaks, {}),
|
|
101
|
-
|
|
101
|
+
tooltip: `${booleanToString(!showPeaks)} peaks`,
|
|
102
102
|
onClick: () => toggleViewProperty('showPeaks'),
|
|
103
103
|
active: showPeaks,
|
|
104
104
|
},
|
|
105
105
|
{
|
|
106
106
|
disabled,
|
|
107
107
|
icon: _jsx(SvgNmrPeaksTopLabels, {}),
|
|
108
|
-
|
|
108
|
+
tooltip: `${displayingMode === 'spread' ? 'Single' : 'Spread'} mode`,
|
|
109
109
|
onClick: toggleDisplayingMode,
|
|
110
110
|
active: displayingMode === 'spread',
|
|
111
111
|
},
|
|
@@ -114,18 +114,18 @@ function PeaksPanelInner({ peaks, info, xDomain, activeTab, peaksViewState, }) {
|
|
|
114
114
|
leftButtons.unshift({
|
|
115
115
|
disabled,
|
|
116
116
|
icon: _jsx(SvgPeaks, {}),
|
|
117
|
-
|
|
117
|
+
tooltip: `${booleanToString(!showPeaksShapes)} peaks shapes`,
|
|
118
118
|
onClick: () => toggleViewProperty('showPeaksShapes'),
|
|
119
119
|
active: showPeaksShapes,
|
|
120
120
|
}, {
|
|
121
121
|
disabled,
|
|
122
122
|
icon: _jsx(SvgNmrFt, {}),
|
|
123
|
-
|
|
123
|
+
tooltip: `${booleanToString(!showPeaksSum)} peaks sum`,
|
|
124
124
|
onClick: () => toggleViewProperty('showPeaksSum'),
|
|
125
125
|
active: showPeaksSum,
|
|
126
126
|
}, {
|
|
127
127
|
icon: _jsx(FaThinkPeaks, {}),
|
|
128
|
-
|
|
128
|
+
tooltip: 'Optimize peaks',
|
|
129
129
|
onClick: optimizePeaksHandler,
|
|
130
130
|
});
|
|
131
131
|
}
|
|
@@ -3,8 +3,8 @@ import { SvgNmrIntegrate, SvgNmrPeaks, SvgNmrPeaksTopLabels, } from 'cheminfo-fo
|
|
|
3
3
|
import lodashGet from 'lodash/get';
|
|
4
4
|
import { rangesToACS } from 'nmr-processing';
|
|
5
5
|
import { FaFileExport, FaUnlink, FaSitemap, FaChartBar } from 'react-icons/fa';
|
|
6
|
-
import { LuSubtitles } from 'react-icons/lu';
|
|
7
6
|
import { ImLink } from 'react-icons/im';
|
|
7
|
+
import { LuSubtitles } from 'react-icons/lu';
|
|
8
8
|
import { ClipboardFallbackModal } from '../../../utils/clipboard/clipboardComponents';
|
|
9
9
|
import { useClipboard } from '../../../utils/clipboard/clipboardHooks';
|
|
10
10
|
import { useAssignmentData } from '../../assignment/AssignmentsContext';
|
|
@@ -118,7 +118,7 @@ function RangesHeader({ ranges, info, onUnlink, onFilterActivated, onSettingClic
|
|
|
118
118
|
{
|
|
119
119
|
disabled: !hasRanges,
|
|
120
120
|
icon: _jsx(FaFileExport, {}),
|
|
121
|
-
|
|
121
|
+
tooltip: 'Preview publication string',
|
|
122
122
|
onClick: saveAsHTMLHandler,
|
|
123
123
|
},
|
|
124
124
|
{
|
|
@@ -126,41 +126,41 @@ function RangesHeader({ ranges, info, onUnlink, onFilterActivated, onSettingClic
|
|
|
126
126
|
},
|
|
127
127
|
{
|
|
128
128
|
icon: _jsx(ImLink, {}),
|
|
129
|
-
|
|
129
|
+
tooltip: 'Fixed integration sum',
|
|
130
130
|
onClick: changeSumConstantFlagHandler,
|
|
131
131
|
active: ranges?.options?.isSumConstant,
|
|
132
132
|
},
|
|
133
133
|
{
|
|
134
134
|
disabled: !hasRanges,
|
|
135
135
|
icon: _jsx(FaUnlink, {}),
|
|
136
|
-
|
|
136
|
+
tooltip: 'Remove all assignments',
|
|
137
137
|
onClick: handleOnRemoveAssignments,
|
|
138
138
|
},
|
|
139
139
|
{
|
|
140
140
|
disabled: !hasRanges,
|
|
141
141
|
icon: _jsx(FaSitemap, {}),
|
|
142
|
-
|
|
142
|
+
tooltip: `${booleanToString(!showMultiplicityTrees)} multiplicity trees in spectrum`,
|
|
143
143
|
onClick: handleSetShowMultiplicityTrees,
|
|
144
144
|
active: showMultiplicityTrees,
|
|
145
145
|
},
|
|
146
146
|
{
|
|
147
147
|
disabled: !hasRanges,
|
|
148
148
|
icon: _jsx(FaChartBar, {}),
|
|
149
|
-
|
|
149
|
+
tooltip: `${booleanToString(!showJGraph)} J Graph`,
|
|
150
150
|
onClick: handleShowJGraph,
|
|
151
151
|
active: showJGraph,
|
|
152
152
|
},
|
|
153
153
|
{
|
|
154
154
|
disabled: !hasRanges,
|
|
155
155
|
icon: _jsx(SvgNmrIntegrate, {}),
|
|
156
|
-
|
|
156
|
+
tooltip: `${booleanToString(!showIntegrals)} integrals`,
|
|
157
157
|
onClick: handleShowIntegrals,
|
|
158
158
|
active: showIntegrals,
|
|
159
159
|
},
|
|
160
160
|
{
|
|
161
161
|
disabled: !hasRanges,
|
|
162
162
|
icon: _jsx(SvgNmrIntegrate, {}),
|
|
163
|
-
|
|
163
|
+
tooltip: `${booleanToString(!showIntegralsValues)} integrals values`,
|
|
164
164
|
onClick: handleShowIntegralsValues,
|
|
165
165
|
active: showIntegralsValues,
|
|
166
166
|
},
|
|
@@ -168,21 +168,21 @@ function RangesHeader({ ranges, info, onUnlink, onFilterActivated, onSettingClic
|
|
|
168
168
|
id: 'ranges-toggle-peaks',
|
|
169
169
|
disabled: !hasRanges,
|
|
170
170
|
icon: _jsx(SvgNmrPeaks, {}),
|
|
171
|
-
|
|
171
|
+
tooltip: `${booleanToString(!showPeaks)} peaks`,
|
|
172
172
|
onClick: () => toggleViewProperty('showPeaks'),
|
|
173
173
|
active: showPeaks,
|
|
174
174
|
},
|
|
175
175
|
{
|
|
176
176
|
disabled: !hasRanges,
|
|
177
177
|
icon: _jsx(SvgNmrPeaksTopLabels, {}),
|
|
178
|
-
|
|
178
|
+
tooltip: `${displayingMode === 'spread' ? 'Single' : 'Spread'} mode`,
|
|
179
179
|
onClick: toggleDisplayingMode,
|
|
180
180
|
active: displayingMode === 'spread',
|
|
181
181
|
},
|
|
182
182
|
{
|
|
183
183
|
disabled: !hasRanges,
|
|
184
184
|
icon: _jsx(LuSubtitles, {}),
|
|
185
|
-
|
|
185
|
+
tooltip: `${booleanToString(!showAssignmentsLabels)} assignments labels`,
|
|
186
186
|
onClick: handleShowAssignmentsLabel,
|
|
187
187
|
active: showAssignmentsLabels,
|
|
188
188
|
},
|
|
@@ -19,68 +19,68 @@ const formatFields = [
|
|
|
19
19
|
},
|
|
20
20
|
{
|
|
21
21
|
id: 2,
|
|
22
|
+
label: 'Assignment label :',
|
|
23
|
+
checkControllerName: 'showAssignmentLabel',
|
|
24
|
+
hideFormatField: true,
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
id: 3,
|
|
22
28
|
label: 'From (ppm) :',
|
|
23
29
|
checkControllerName: 'from.show',
|
|
24
30
|
formatControllerName: 'from.format',
|
|
25
31
|
},
|
|
26
32
|
{
|
|
27
|
-
id:
|
|
33
|
+
id: 4,
|
|
28
34
|
label: 'To (ppm) :',
|
|
29
35
|
checkControllerName: 'to.show',
|
|
30
36
|
formatControllerName: 'to.format',
|
|
31
37
|
},
|
|
32
38
|
{
|
|
33
|
-
id:
|
|
39
|
+
id: 5,
|
|
34
40
|
label: 'Absolute integration :',
|
|
35
41
|
checkControllerName: 'absolute.show',
|
|
36
42
|
formatControllerName: 'absolute.format',
|
|
37
43
|
},
|
|
38
44
|
{
|
|
39
|
-
id:
|
|
45
|
+
id: 6,
|
|
40
46
|
label: 'Relative integration :',
|
|
41
47
|
checkControllerName: 'relative.show',
|
|
42
48
|
formatControllerName: 'relative.format',
|
|
43
49
|
},
|
|
44
50
|
{
|
|
45
|
-
id:
|
|
51
|
+
id: 7,
|
|
46
52
|
label: 'δ (ppm) :',
|
|
47
53
|
checkControllerName: 'deltaPPM.show',
|
|
48
54
|
formatControllerName: 'deltaPPM.format',
|
|
49
55
|
},
|
|
50
56
|
{
|
|
51
|
-
id:
|
|
57
|
+
id: 8,
|
|
52
58
|
label: 'δ (Hz) :',
|
|
53
59
|
checkControllerName: 'deltaHz.show',
|
|
54
60
|
formatControllerName: 'deltaHz.format',
|
|
55
61
|
},
|
|
56
62
|
{
|
|
57
|
-
id:
|
|
63
|
+
id: 9,
|
|
58
64
|
label: 'Coupling (Hz) :',
|
|
59
65
|
checkControllerName: 'coupling.show',
|
|
60
66
|
formatControllerName: 'coupling.format',
|
|
61
67
|
},
|
|
62
68
|
{
|
|
63
|
-
id:
|
|
69
|
+
id: 10,
|
|
64
70
|
label: 'Kind :',
|
|
65
71
|
checkControllerName: 'showKind',
|
|
66
72
|
hideFormatField: true,
|
|
67
73
|
},
|
|
68
74
|
{
|
|
69
|
-
id:
|
|
75
|
+
id: 11,
|
|
70
76
|
label: 'Multiplicity :',
|
|
71
77
|
checkControllerName: 'showMultiplicity',
|
|
72
78
|
hideFormatField: true,
|
|
73
79
|
},
|
|
74
|
-
{
|
|
75
|
-
id: 11,
|
|
76
|
-
label: 'Assignment :',
|
|
77
|
-
checkControllerName: 'showAssignment',
|
|
78
|
-
hideFormatField: true,
|
|
79
|
-
},
|
|
80
80
|
{
|
|
81
81
|
id: 12,
|
|
82
|
-
label: 'Assignment
|
|
83
|
-
checkControllerName: '
|
|
82
|
+
label: 'Assignment links :',
|
|
83
|
+
checkControllerName: 'showAssignment',
|
|
84
84
|
hideFormatField: true,
|
|
85
85
|
},
|
|
86
86
|
{
|
|
@@ -64,7 +64,7 @@ function RangesTable({ tableData, onUnlink, contextMenu = [], onContextMenuSelec
|
|
|
64
64
|
const showActions = preferences.showDeleteAction ||
|
|
65
65
|
preferences.showEditAction ||
|
|
66
66
|
preferences.showZoomAction;
|
|
67
|
-
return (_jsxs("table", { css: tableStyle, children: [_jsx("thead", { children: _jsxs("tr", { children: [preferences.showSerialNumber && _jsx("th", { children: "#" }), preferences.from.show && (_jsxs("th", { id: "from", ...onSort, children: ["From", isSortedDesc('from').content] })), preferences.to.show && (_jsxs("th", { id: "to", ...onSort, children: ["To ", isSortedDesc('to').content] })), preferences.deltaPPM.show && (_jsxs("th", { id: "from", ...onSort, children: ["\u03B4 (ppm) ", isSortedDesc('from').content] })), preferences.deltaHz.show && _jsx("th", { children: "\u03B4 (Hz) " }), preferences.relative.show && (_jsxs("th", { id: "integration", ...onSort, children: ["Rel. ", element, " ", isSortedDesc('integration').content] })), preferences.absolute.show && _jsx("th", { children: "Absolute" }), preferences.showMultiplicity && _jsx("th", { children: "Mult." }), preferences.coupling.show && _jsx("th", { children: "J (Hz)" }), preferences.
|
|
67
|
+
return (_jsxs("table", { css: tableStyle, children: [_jsx("thead", { children: _jsxs("tr", { children: [preferences.showSerialNumber && _jsx("th", { children: "#" }), preferences.showAssignmentLabel && (_jsx("th", { title: "Assignment", children: "Assignment" })), preferences.from.show && (_jsxs("th", { id: "from", ...onSort, children: ["From", isSortedDesc('from').content] })), preferences.to.show && (_jsxs("th", { id: "to", ...onSort, children: ["To ", isSortedDesc('to').content] })), preferences.deltaPPM.show && (_jsxs("th", { id: "from", ...onSort, children: ["\u03B4 (ppm) ", isSortedDesc('from').content] })), preferences.deltaHz.show && _jsx("th", { children: "\u03B4 (Hz) " }), preferences.relative.show && (_jsxs("th", { id: "integration", ...onSort, children: ["Rel. ", element, " ", isSortedDesc('integration').content] })), preferences.absolute.show && _jsx("th", { children: "Absolute" }), preferences.showMultiplicity && _jsx("th", { children: "Mult." }), preferences.coupling.show && _jsx("th", { children: "J (Hz)" }), preferences.showAssignment && (_jsxs(_Fragment, { children: [_jsx("th", { title: "Assign multiplets", children: _jsx(FaLink, { style: { fontSize: 10, margin: 'auto' } }) }), _jsx("th", { title: "Assign ranges", style: { minWidth: '50px' }, children: "\u03A3" })] })), preferences.showKind && _jsx("th", { children: "Kind" }), showActions && _jsx("th", { children: '' })] }) }), _jsx("tbody", { children: data?.map((range) => {
|
|
68
68
|
return (_jsx(RangesTableRow, { rowData: range, onUnlink: onUnlink, preferences: preferences, info: info, contextMenu: contextMenu, onContextMenuSelect: onContextMenuSelect }, range.rowKey));
|
|
69
69
|
}) })] }));
|
|
70
70
|
}
|
|
@@ -104,8 +104,8 @@ function RangesTableRow({ rowData, onUnlink, onContextMenuSelect, contextMenu =
|
|
|
104
104
|
? ConstantlyHighlightedRowStyle
|
|
105
105
|
: null;
|
|
106
106
|
}, [assignmentRange.isActive, highlightRange.isActive, rowData]);
|
|
107
|
-
return (_jsxs(ContextMenu, { options: contextMenu, onSelect: (selected) => onContextMenuSelect?.(selected, rowData), as: "tr", css: trCss, children: [preferences.showSerialNumber && (_jsx("td", { ...rowSpanTags, ...onHoverRange, children: rowData.tableMetaInfo.rowIndex + 1 })), preferences.from.show && (_jsx(RangeColumn, { value: rowData.from, rowSpanTags: rowSpanTags, onHover: onHoverRange, format: preferences.from.format })), preferences.to.show && (_jsx(RangeColumn, { value: rowData.to, rowSpanTags: rowSpanTags, onHover: onHoverRange, format: preferences.to.format })), preferences.deltaPPM.show && (_jsx(SignalDeltaColumn, { row: rowData, rowSpanTags: rowSpanTags, onHover: onHoverSignal, format: preferences.deltaPPM.format })), preferences.deltaHz.show && (_jsx(SignalDeltaHzColumn, { row: rowData, rowSpanTags: rowSpanTags, onHover: onHoverSignal, format: preferences.deltaHz.format, info: info })), preferences.relative.show && (_jsx(RelativeColumn, { row: rowData, rowSpanTags: rowSpanTags, onHover: onHoverRange, format: preferences.relative.format })), preferences.absolute.show && (_jsx(AbsoluteColumn, { row: rowData, rowSpanTags: rowSpanTags, onHover: onHoverRange, format: preferences.absolute.format })), preferences.showMultiplicity && (_jsx("td", { ...onHoverSignal, children: !rowData?.tableMetaInfo?.signal
|
|
107
|
+
return (_jsxs(ContextMenu, { options: contextMenu, onSelect: (selected) => onContextMenuSelect?.(selected, rowData), as: "tr", css: trCss, children: [preferences.showSerialNumber && (_jsx("td", { ...rowSpanTags, ...onHoverRange, children: rowData.tableMetaInfo.rowIndex + 1 })), preferences.showAssignmentLabel && (_jsx(RangeAssignmentColumn, { row: rowData, onHover: onHoverRange, rowSpanTags: rowSpanTags })), preferences.from.show && (_jsx(RangeColumn, { value: rowData.from, rowSpanTags: rowSpanTags, onHover: onHoverRange, format: preferences.from.format })), preferences.to.show && (_jsx(RangeColumn, { value: rowData.to, rowSpanTags: rowSpanTags, onHover: onHoverRange, format: preferences.to.format })), preferences.deltaPPM.show && (_jsx(SignalDeltaColumn, { row: rowData, rowSpanTags: rowSpanTags, onHover: onHoverSignal, format: preferences.deltaPPM.format })), preferences.deltaHz.show && (_jsx(SignalDeltaHzColumn, { row: rowData, rowSpanTags: rowSpanTags, onHover: onHoverSignal, format: preferences.deltaHz.format, info: info })), preferences.relative.show && (_jsx(RelativeColumn, { row: rowData, rowSpanTags: rowSpanTags, onHover: onHoverRange, format: preferences.relative.format })), preferences.absolute.show && (_jsx(AbsoluteColumn, { row: rowData, rowSpanTags: rowSpanTags, onHover: onHoverRange, format: preferences.absolute.format })), preferences.showMultiplicity && (_jsx("td", { ...onHoverSignal, children: !rowData?.tableMetaInfo?.signal
|
|
108
108
|
? 'm'
|
|
109
|
-
: lodashGet(rowData, 'tableMetaInfo.signal.multiplicity', '') })), preferences.coupling.show && (_jsx(CouplingColumn, { row: rowData, onHover: onHoverSignal, format: preferences.coupling.format })), preferences.
|
|
109
|
+
: lodashGet(rowData, 'tableMetaInfo.signal.multiplicity', '') })), preferences.coupling.show && (_jsx(CouplingColumn, { row: rowData, onHover: onHoverSignal, format: preferences.coupling.format })), preferences.showAssignment && (_jsxs(_Fragment, { children: [_jsx(SignalAssignmentsColumn, { row: rowData, assignment: assignmentSignal, highlight: highlightSignal, onHover: onHoverSignal, onLink: linkHandler, onUnlink: unlinkHandler }), _jsx(RangeAssignmentsColumn, { row: rowData, assignment: assignmentRange, highlight: highlightRangeAssignmentsColumn, onHover: onHoverRangeAssignmentsColumn, onLink: linkHandler, onUnlink: unlinkHandler, rowSpanTags: rowSpanTags, highlightData: highlightData })] })), _jsx(ActionsColumn, { row: rowData, onHoverSignal: onHoverSignal, onHoverRange: onHoverRange, rowSpanTags: rowSpanTags, showKind: preferences.showKind, showDeleteAction: preferences.showDeleteAction, showEditAction: preferences.showEditAction, showZoomAction: preferences.showZoomAction })] }));
|
|
110
110
|
}
|
|
111
111
|
export default RangesTableRow;
|