nmrium 0.51.0 → 0.53.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/LinesSeries.js +1 -1
- package/lib/component/1d/ranges/AssignmentLabel.d.ts +7 -0
- package/lib/component/1d/ranges/AssignmentLabel.js +10 -0
- package/lib/component/1d/ranges/Range.js +2 -1
- package/lib/component/EventsTrackers/KeysListenerTracker.js +3 -3
- package/lib/component/context/DispatchContext.d.ts +1 -1
- package/lib/component/elements/EditableColumn.js +3 -3
- package/lib/component/elements/Label.js +1 -1
- package/lib/component/header/ApodizationOptionsPanel.js +1 -1
- package/lib/component/header/AutoPeakPickingOptionPanel.js +1 -1
- package/lib/component/header/BaseLineCorrectionPanel.js +2 -2
- package/lib/component/header/Header.js +1 -1
- package/lib/component/header/PhaseCorrectionPanel.js +1 -1
- package/lib/component/header/PhaseCorrectionTwoDimensionsPanel.js +2 -2
- package/lib/component/header/RangesPickingOptionPanel.js +1 -1
- package/lib/component/header/ZeroFillingOptionsPanel.js +1 -1
- package/lib/component/header/Zones2DOptionPanel.js +6 -2
- package/lib/component/hooks/useActiveSpectrumRangesViewState.js +1 -0
- package/lib/component/hooks/useActiveSpectrumZonesViewState.js +1 -0
- package/lib/component/hooks/useToolsFunctions.d.ts +1 -1
- package/lib/component/hooks/useToolsFunctions.js +10 -4
- package/lib/component/main/NMRiumStateProvider.js +1 -1
- package/lib/component/modal/AboutPredictionModal.js +1 -1
- package/lib/component/modal/AboutSpectrumSimulationModal.js +1 -1
- package/lib/component/modal/EditPeakShapeModal.js +1 -1
- package/lib/component/modal/ImportPublicationStringModal.d.ts +5 -3
- package/lib/component/modal/ImportPublicationStringModal.js +7 -4
- package/lib/component/modal/LoadJCAMPModal.js +1 -1
- package/lib/component/modal/LogsHistoryModal.js +1 -1
- package/lib/component/modal/MultipletAnalysisModal.js +1 -1
- package/lib/component/modal/SaveAsModal.js +2 -2
- package/lib/component/modal/editZone/EditPathLengthFormik.js +2 -2
- package/lib/component/modal/editZone/EditZoneModal.js +1 -1
- package/lib/component/modal/metaImportation/MetaImportationModal.js +1 -1
- package/lib/component/modal/setting/GeneralSettings.js +2 -2
- package/lib/component/modal/setting/settings-tabs/GeneralTabContent.js +1 -1
- package/lib/component/modal/setting/settings-tabs/InfoBlockTabContent.js +1 -1
- package/lib/component/modal/setting/settings-tabs/OnLoadProcessingTabContent.js +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralsPreferences.js +1 -1
- package/lib/component/panels/Panels.js +5 -5
- package/lib/component/panels/RangesPanel/RangesHeader.js +21 -7
- package/lib/component/panels/RangesPanel/RangesPanel.js +1 -1
- package/lib/component/panels/RangesPanel/RangesPreferences.js +9 -3
- package/lib/component/panels/RangesPanel/RangesTable.js +1 -1
- package/lib/component/panels/RangesPanel/RangesTableRow.js +2 -1
- package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentColumn.d.ts +7 -0
- package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentColumn.js +16 -0
- package/lib/component/panels/SpectraPanel/SpectraPanelHeader.d.ts +5 -0
- package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/SpectraPanelHeader.js +8 -8
- package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/SpectraTable.js +1 -1
- package/lib/component/panels/SpectraPanel/SpectraTabs.d.ts +1 -0
- package/lib/component/panels/{SpectrumsPanel/SpectrumsTabs.js → SpectraPanel/SpectraTabs.js} +6 -6
- package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/SpectrumListPanel.js +2 -2
- package/lib/component/panels/databasePanel/DatabasePreferences.js +1 -1
- package/lib/component/panels/header/SpectraAutomaticPickingButton.js +1 -1
- package/lib/component/panels/multipleAnalysisPanel/AlignSpectra.js +1 -1
- package/lib/component/panels/multipleAnalysisPanel/AnalysisChart.js +2 -2
- package/lib/component/panels/multipleAnalysisPanel/MultipleSpectraAnalysisPanel.js +1 -1
- package/lib/component/panels/multipleAnalysisPanel/preferences/index.js +1 -1
- package/lib/component/panels/predictionPanel/PredictionOptionsPanel.js +2 -2
- package/lib/component/panels/predictionPanel/PredictionSimpleOptions.js +1 -1
- package/lib/component/panels/spectrumSimulation/SpectrumSimulation.js +8 -1
- package/lib/component/panels/spectrumSimulation/SpectrumSimulationPreferences.js +1 -1
- package/lib/component/panels/spectrumSimulation/SpectrumSimulationSimpleOptions.js +2 -2
- package/lib/component/panels/spectrumSimulation/SpinSystemTable.js +1 -1
- package/lib/component/reducer/IgnoreActions.js +1 -1
- package/lib/component/reducer/Reducer.d.ts +1 -0
- package/lib/component/reducer/Reducer.js +19 -16
- package/lib/component/reducer/actions/DomainActions.js +3 -3
- package/lib/component/reducer/actions/FiltersActions.js +337 -317
- package/lib/component/reducer/actions/LoadActions.js +1 -1
- package/lib/component/reducer/actions/PreferencesActions.js +2 -2
- package/lib/component/reducer/actions/RangesActions.d.ts +7 -2
- package/lib/component/reducer/actions/RangesActions.js +16 -2
- package/lib/component/reducer/actions/ToolsActions.d.ts +3 -3
- package/lib/component/reducer/actions/ToolsActions.js +21 -28
- package/lib/component/reducer/actions/ZonesActions.d.ts +2 -0
- package/lib/component/reducer/actions/ZonesActions.js +5 -1
- package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js +6 -4
- package/lib/component/toolbar/ToolBar.js +16 -16
- package/lib/component/toolbar/toolbarMenu.js +4 -4
- package/lib/component/utility/export.js +1 -1
- package/lib/constants.js +5 -5
- package/lib/data/data2d/Spectrum2D/getSlice.js +1 -1
- package/lib/data/data2d/Spectrum2D/zones/getDetectionZones.d.ts +1 -0
- package/lib/versionInfo.js +1 -1
- package/package.json +16 -15
- package/lib/component/panels/SpectrumsPanel/SpectraPanelHeader.d.ts +0 -5
- package/lib/component/panels/SpectrumsPanel/SpectrumsTabs.d.ts +0 -1
- /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/SpectraPreferences.d.ts +0 -0
- /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/SpectraPreferences.js +0 -0
- /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/SpectraTable.d.ts +0 -0
- /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/SpectrumListPanel.d.ts +0 -0
- /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/ColorIndicator.d.ts +0 -0
- /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/ColorIndicator.js +0 -0
- /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/RenderAsHTML.d.ts +0 -0
- /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/RenderAsHTML.js +0 -0
- /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/ShowHideSpectrumButton.d.ts +0 -0
- /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/ShowHideSpectrumButton.js +0 -0
- /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/SpectraColumnsManager.d.ts +0 -0
- /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/SpectraColumnsManager.js +0 -0
- /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/SpectrumName.d.ts +0 -0
- /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/SpectrumName.js +0 -0
- /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/setting/PlotChart.d.ts +0 -0
- /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/setting/PlotChart.js +0 -0
- /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/setting/Spectrum1DHistogram.d.ts +0 -0
- /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/setting/Spectrum1DHistogram.js +0 -0
- /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/setting/Spectrum1DSetting.d.ts +0 -0
- /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/setting/Spectrum1DSetting.js +0 -0
- /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/setting/Spectrum2DHistogram.d.ts +0 -0
- /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/setting/Spectrum2DHistogram.js +0 -0
- /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/setting/Spectrum2DSetting.d.ts +0 -0
- /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/setting/Spectrum2DSetting.js +0 -0
- /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/setting/SpectrumSetting.d.ts +0 -0
- /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/setting/SpectrumSetting.js +0 -0
- /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/setting/processSnapPlot.d.ts +0 -0
- /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/setting/processSnapPlot.js +0 -0
- /package/lib/component/reducer/actions/{SpectrumsActions.d.ts → SpectraActions.d.ts} +0 -0
- /package/lib/component/reducer/actions/{SpectrumsActions.js → SpectraActions.js} +0 -0
|
@@ -86,7 +86,7 @@ function InfoBlockTabContent() {
|
|
|
86
86
|
},
|
|
87
87
|
},
|
|
88
88
|
], [addHandler, datalist, deleteHandler, paths]);
|
|
89
|
-
return (_jsxs("div", { children: [_jsx(Label, { title: "Display spectrum info block",
|
|
89
|
+
return (_jsxs("div", { children: [_jsx(Label, { title: "Display spectrum info block", style: { wrapper: { padding: '10px 0' } }, children: _jsx(FormikCheckBox, { name: "infoBlock.visible" }) }), _jsx(GroupPane, { text: "Fields", renderHeader: (text) => {
|
|
90
90
|
return (_jsx(FieldsBlockHeader, { text: text, onAdd: () => addHandler(fields, 0) }));
|
|
91
91
|
}, children: _jsx(ReactTable, { style: {
|
|
92
92
|
'table, table td, table th': { border: 'none' },
|
|
@@ -9,7 +9,7 @@ import FormikCheckBox from '../../../elements/formik/FormikCheckBox';
|
|
|
9
9
|
function OnLoadProcessingTabContent() {
|
|
10
10
|
const { values } = useFormikContext();
|
|
11
11
|
const isExperimentalFeatures = values.display?.general?.experimentalFeatures?.display || false;
|
|
12
|
-
return (_jsxs("div", { children: [_jsx(Label, { title: "Enable auto processing
|
|
12
|
+
return (_jsxs("div", { children: [_jsx(Label, { title: "Enable auto processing on load", style: { wrapper: { padding: '10px 0' } }, children: _jsx(FormikCheckBox, { name: "onLoadProcessing.autoProcessing" }) }), isExperimentalFeatures && _jsx(AutoProcessingFilters, {})] }));
|
|
13
13
|
}
|
|
14
14
|
function AutoProcessingFilters() {
|
|
15
15
|
const { values } = useFormikContext();
|
|
@@ -72,7 +72,7 @@ function IntegralsPreferences(props, ref) {
|
|
|
72
72
|
formRef.current.submitForm();
|
|
73
73
|
},
|
|
74
74
|
}));
|
|
75
|
-
return (_jsx(PreferencesContainer, { children: _jsx(Formik, { initialValues: preferencesByNuclei, onSubmit: saveHandler, innerRef: formRef, children: _jsx(_Fragment, { children: nuclei?.map((n) => (_jsx(NucleusPreferences, { nucleus: n, fields: formatFields, renderTop: () => (_jsxs(_Fragment, { children: [_jsx(Label, { title: "Color", style: formatFieldLabelStyle, children: _jsxs("div", { style: { display: 'flex', padding: '2px 0' }, children: [_jsx("div", { style: { width: '23px' } }), _jsx(FormikColorPickerDropdown, { name: `nuclei.${n}.color` })] }) }), _jsx(Label, { title: "
|
|
75
|
+
return (_jsx(PreferencesContainer, { children: _jsx(Formik, { initialValues: preferencesByNuclei, onSubmit: saveHandler, innerRef: formRef, children: _jsx(_Fragment, { children: nuclei?.map((n) => (_jsx(NucleusPreferences, { nucleus: n, fields: formatFields, renderTop: () => (_jsxs(_Fragment, { children: [_jsx(Label, { title: "Color", style: formatFieldLabelStyle, children: _jsxs("div", { style: { display: 'flex', padding: '2px 0' }, children: [_jsx("div", { style: { width: '23px' } }), _jsx(FormikColorPickerDropdown, { name: `nuclei.${n}.color` })] }) }), _jsx(Label, { title: "Stroke width:", style: formatFieldLabelStyle, children: _jsxs("div", { style: { display: 'flex', padding: '2px 0' }, children: [_jsx("div", { style: { width: '23px' } }), _jsx(FormikInput, { name: `nuclei.${n}.strokeWidth`, type: "number", style: {
|
|
76
76
|
input: {
|
|
77
77
|
textAlign: 'center',
|
|
78
78
|
padding: '2px',
|
|
@@ -12,7 +12,7 @@ import MatrixGenerationPanel from './MatrixGenerationPanel/MatrixGenerationPanel
|
|
|
12
12
|
import MoleculePanel from './MoleculesPanel/MoleculePanel';
|
|
13
13
|
import PeaksPanel from './PeaksPanel/PeaksPanel';
|
|
14
14
|
import RangesPanel from './RangesPanel/RangesPanel';
|
|
15
|
-
import SpectrumListPanel from './
|
|
15
|
+
import SpectrumListPanel from './SpectraPanel/SpectrumListPanel';
|
|
16
16
|
import SummaryPanel from './SummaryPanel/SummaryPanel';
|
|
17
17
|
import ZonesPanel from './ZonesPanel/ZonesPanel';
|
|
18
18
|
import DatabasePanel from './databasePanel/DatabasePanel';
|
|
@@ -59,13 +59,13 @@ const accordionItems = [
|
|
|
59
59
|
mode: '1D',
|
|
60
60
|
},
|
|
61
61
|
{
|
|
62
|
-
title: 'Multiple
|
|
62
|
+
title: 'Multiple spectra analysis',
|
|
63
63
|
component: _jsx(MultipleSpectraAnalysisPanel, {}),
|
|
64
64
|
hidePreferenceKey: 'multipleSpectraAnalysisPanel',
|
|
65
65
|
mode: null,
|
|
66
66
|
},
|
|
67
67
|
{
|
|
68
|
-
title: 'Matrix
|
|
68
|
+
title: 'Matrix generation',
|
|
69
69
|
component: _jsx(MatrixGenerationPanel, {}),
|
|
70
70
|
hidePreferenceKey: 'matrixGenerationPanel',
|
|
71
71
|
mode: '1D',
|
|
@@ -95,7 +95,7 @@ const accordionItems = [
|
|
|
95
95
|
mode: null,
|
|
96
96
|
},
|
|
97
97
|
{
|
|
98
|
-
title: 'Automatic
|
|
98
|
+
title: 'Automatic assignment',
|
|
99
99
|
component: _jsx(AutomaticAssignment, {}),
|
|
100
100
|
hidePreferenceKey: 'automaticAssignmentPanel',
|
|
101
101
|
mode: null,
|
|
@@ -107,7 +107,7 @@ const accordionItems = [
|
|
|
107
107
|
mode: null,
|
|
108
108
|
},
|
|
109
109
|
{
|
|
110
|
-
title: 'Spectrum
|
|
110
|
+
title: 'Spectrum simulation',
|
|
111
111
|
component: _jsx(SpectrumSimulation, {}),
|
|
112
112
|
hidePreferenceKey: 'simulationPanel',
|
|
113
113
|
mode: '1D',
|
|
@@ -3,6 +3,7 @@ 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';
|
|
6
7
|
import { ImLink } from 'react-icons/im';
|
|
7
8
|
import { ClipboardFallbackModal } from '../../../utils/clipboard/clipboardComponents';
|
|
8
9
|
import { useClipboard } from '../../../utils/clipboard/clipboardHooks';
|
|
@@ -23,7 +24,7 @@ function RangesHeader({ ranges, info, onUnlink, onFilterActivated, onSettingClic
|
|
|
23
24
|
const assignmentData = useAssignmentData();
|
|
24
25
|
const currentSum = lodashGet(ranges, 'options.sum', null);
|
|
25
26
|
const rangesPreferences = usePanelPreferences('ranges', activeTab);
|
|
26
|
-
const { showMultiplicityTrees, showJGraph, showIntegrals, showIntegralsValues, showPeaks, displayingMode, } = useActiveSpectrumRangesViewState();
|
|
27
|
+
const { showMultiplicityTrees, showJGraph, showIntegrals, showIntegralsValues, showPeaks, displayingMode, showAssignmentsLabels, } = useActiveSpectrumRangesViewState();
|
|
27
28
|
function changeRangesSumHandler(options) {
|
|
28
29
|
dispatch({ type: 'CHANGE_RANGE_SUM', payload: { options } });
|
|
29
30
|
modal.close();
|
|
@@ -78,6 +79,12 @@ function RangesHeader({ ranges, info, onUnlink, onFilterActivated, onSettingClic
|
|
|
78
79
|
payload: { key: 'showJGraph' },
|
|
79
80
|
});
|
|
80
81
|
}
|
|
82
|
+
function handleShowAssignmentsLabel() {
|
|
83
|
+
dispatch({
|
|
84
|
+
type: 'TOGGLE_RANGES_VIEW_PROPERTY',
|
|
85
|
+
payload: { key: 'showAssignmentsLabels' },
|
|
86
|
+
});
|
|
87
|
+
}
|
|
81
88
|
const { rawWriteWithType, shouldFallback, cleanShouldFallback, text } = useClipboard();
|
|
82
89
|
function saveToClipboardHandler(value) {
|
|
83
90
|
void rawWriteWithType(value, 'text/html').then(() => toaster.show({ message: 'Data copied to clipboard', intent: 'success' }));
|
|
@@ -117,6 +124,12 @@ function RangesHeader({ ranges, info, onUnlink, onFilterActivated, onSettingClic
|
|
|
117
124
|
{
|
|
118
125
|
component: (_jsx(ChangeSumModal, { onSave: changeRangesSumHandler, sumType: "ranges", currentSum: currentSum, sumOptions: ranges?.options })),
|
|
119
126
|
},
|
|
127
|
+
{
|
|
128
|
+
icon: _jsx(ImLink, {}),
|
|
129
|
+
title: 'Fixed integration sum',
|
|
130
|
+
onClick: changeSumConstantFlagHandler,
|
|
131
|
+
active: ranges?.options?.isSumConstant,
|
|
132
|
+
},
|
|
120
133
|
{
|
|
121
134
|
disabled: !hasRanges,
|
|
122
135
|
icon: _jsx(FaUnlink, {}),
|
|
@@ -151,12 +164,6 @@ function RangesHeader({ ranges, info, onUnlink, onFilterActivated, onSettingClic
|
|
|
151
164
|
onClick: handleShowIntegralsValues,
|
|
152
165
|
active: showIntegralsValues,
|
|
153
166
|
},
|
|
154
|
-
{
|
|
155
|
-
icon: _jsx(ImLink, {}),
|
|
156
|
-
title: 'Fixed integration sum',
|
|
157
|
-
onClick: changeSumConstantFlagHandler,
|
|
158
|
-
active: ranges?.options?.isSumConstant,
|
|
159
|
-
},
|
|
160
167
|
{
|
|
161
168
|
id: 'ranges-toggle-peaks',
|
|
162
169
|
disabled: !hasRanges,
|
|
@@ -172,6 +179,13 @@ function RangesHeader({ ranges, info, onUnlink, onFilterActivated, onSettingClic
|
|
|
172
179
|
onClick: toggleDisplayingMode,
|
|
173
180
|
active: displayingMode === 'spread',
|
|
174
181
|
},
|
|
182
|
+
{
|
|
183
|
+
disabled: !hasRanges,
|
|
184
|
+
icon: _jsx(LuSubtitles, {}),
|
|
185
|
+
title: `${booleanToString(!showAssignmentsLabels)} assignments labels`,
|
|
186
|
+
onClick: handleShowAssignmentsLabel,
|
|
187
|
+
active: showAssignmentsLabels,
|
|
188
|
+
},
|
|
175
189
|
] }), _jsx(ClipboardFallbackModal, { mode: shouldFallback, onDismiss: cleanShouldFallback, text: text, label: "Preview publication string" })] }));
|
|
176
190
|
}
|
|
177
191
|
export default RangesHeader;
|
|
@@ -79,18 +79,24 @@ const formatFields = [
|
|
|
79
79
|
},
|
|
80
80
|
{
|
|
81
81
|
id: 12,
|
|
82
|
+
label: 'Assignment label :',
|
|
83
|
+
checkControllerName: 'showAssignmentLabel',
|
|
84
|
+
hideFormatField: true,
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
id: 13,
|
|
82
88
|
label: 'Delete action :',
|
|
83
89
|
checkControllerName: 'showDeleteAction',
|
|
84
90
|
hideFormatField: true,
|
|
85
91
|
},
|
|
86
92
|
{
|
|
87
|
-
id:
|
|
93
|
+
id: 14,
|
|
88
94
|
label: 'Zoom action :',
|
|
89
95
|
checkControllerName: 'showZoomAction',
|
|
90
96
|
hideFormatField: true,
|
|
91
97
|
},
|
|
92
98
|
{
|
|
93
|
-
id:
|
|
99
|
+
id: 15,
|
|
94
100
|
label: 'Edit action :',
|
|
95
101
|
checkControllerName: 'showEditAction',
|
|
96
102
|
hideFormatField: true,
|
|
@@ -113,6 +119,6 @@ function RangesPreferences(props, ref) {
|
|
|
113
119
|
formRef.current.submitForm();
|
|
114
120
|
},
|
|
115
121
|
}), []);
|
|
116
|
-
return (_jsx(PreferencesContainer, { children: _jsx(Formik, { initialValues: preferencesByNuclei, enableReinitialize: true, onSubmit: saveHandler, innerRef: formRef, children: _jsx(_Fragment, { children: nuclei?.map((n) => (_jsx(NucleusPreferences, { nucleus: n, fields: formatFields, renderBottom: () => (_jsx(Label, { title: "J
|
|
122
|
+
return (_jsx(PreferencesContainer, { children: _jsx(Formik, { initialValues: preferencesByNuclei, enableReinitialize: true, onSubmit: saveHandler, innerRef: formRef, children: _jsx(_Fragment, { children: nuclei?.map((n) => (_jsx(NucleusPreferences, { nucleus: n, fields: formatFields, renderBottom: () => (_jsx(Label, { title: "J graph tolerance (Hz):", style: formatFieldLabelStyle, children: _jsxs("div", { style: { display: 'flex' }, children: [_jsx("div", { style: { width: '23px' } }), _jsx(FormikInput, { name: `nuclei.${n}.jGraphTolerance`, type: "number", style: formatFieldInputStyle })] }) })) }, n))) }) }) }));
|
|
117
123
|
}
|
|
118
124
|
export default forwardRef(RangesPreferences);
|
|
@@ -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.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) => {
|
|
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.showAssignmentLabel && (_jsx("th", { title: "Assignment", children: "Assignment" })), 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
|
}
|
|
@@ -10,6 +10,7 @@ import { HighlightEventSource, useHighlight, useHighlightData, } from '../../hig
|
|
|
10
10
|
import AbsoluteColumn from './TableColumns/AbsoluteColumn';
|
|
11
11
|
import ActionsColumn from './TableColumns/ActionsColumn';
|
|
12
12
|
import CouplingColumn from './TableColumns/CouplingColumn';
|
|
13
|
+
import { RangeAssignmentColumn } from './TableColumns/RangeAssignmentColumn';
|
|
13
14
|
import RangeAssignmentsColumn from './TableColumns/RangeAssignmentsColumn';
|
|
14
15
|
import RangeColumn from './TableColumns/RangeColumn';
|
|
15
16
|
import RelativeColumn from './TableColumns/RelativeColumn';
|
|
@@ -105,6 +106,6 @@ function RangesTableRow({ rowData, onUnlink, onContextMenuSelect, contextMenu =
|
|
|
105
106
|
}, [assignmentRange.isActive, highlightRange.isActive, rowData]);
|
|
106
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
108
|
? 'm'
|
|
108
|
-
: 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 })] }));
|
|
109
|
+
: lodashGet(rowData, 'tableMetaInfo.signal.multiplicity', '') })), preferences.coupling.show && (_jsx(CouplingColumn, { row: rowData, onHover: onHoverSignal, format: preferences.coupling.format })), preferences.showAssignmentLabel && (_jsx(RangeAssignmentColumn, { row: rowData, onHover: onHoverSignal, rowSpanTags: rowSpanTags })), 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 })] }));
|
|
109
110
|
}
|
|
110
111
|
export default RangesTableRow;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { OnHoverEvent, RowSpanTags } from '../RangesTableRow';
|
|
2
|
+
import { RangeData } from '../hooks/useMapRanges';
|
|
3
|
+
type RangeAssignmentColumnProps = OnHoverEvent & RowSpanTags & {
|
|
4
|
+
row: RangeData;
|
|
5
|
+
};
|
|
6
|
+
export declare function RangeAssignmentColumn({ row, onHover, rowSpanTags, }: RangeAssignmentColumnProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useDispatch } from '../../../context/DispatchContext';
|
|
3
|
+
import EditableColumn from '../../../elements/EditableColumn';
|
|
4
|
+
export function RangeAssignmentColumn({ row, onHover, rowSpanTags, }) {
|
|
5
|
+
const dispatch = useDispatch();
|
|
6
|
+
function saveHandler(event) {
|
|
7
|
+
dispatch({
|
|
8
|
+
type: 'CHANGE_RANGE_ASSIGNMENT_LABEL',
|
|
9
|
+
payload: {
|
|
10
|
+
value: event.target.value,
|
|
11
|
+
rangeID: row.id,
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
return (_jsx("td", { ...rowSpanTags, ...onHover, children: _jsx(EditableColumn, { value: row?.assignment || '', onSave: saveHandler, style: { padding: '0.1rem 0.4rem' } }) }));
|
|
16
|
+
}
|
|
@@ -12,13 +12,13 @@ import useSpectrum from '../../hooks/useSpectrum';
|
|
|
12
12
|
import { getSpectraByNucleus } from '../../utility/getSpectraByNucleus';
|
|
13
13
|
import DefaultPanelHeader from '../header/DefaultPanelHeader';
|
|
14
14
|
import { SpectraAutomaticPickingButton } from '../header/SpectraAutomaticPickingButton';
|
|
15
|
-
function getMissingProjection(
|
|
15
|
+
function getMissingProjection(spectraData, activeTab) {
|
|
16
16
|
let nucleus = activeTab.split(',');
|
|
17
17
|
nucleus = nucleus[0] === nucleus[1] ? [nucleus[0]] : nucleus;
|
|
18
18
|
const missingNucleus = [];
|
|
19
19
|
for (const n of nucleus) {
|
|
20
|
-
const
|
|
21
|
-
if (!
|
|
20
|
+
const hasSpectra = spectraData.some((d) => d.info.nucleus === n);
|
|
21
|
+
if (!hasSpectra) {
|
|
22
22
|
missingNucleus.push(n);
|
|
23
23
|
}
|
|
24
24
|
}
|
|
@@ -42,13 +42,13 @@ function SpectraPanelHeaderInner({ data, activeSpectrum, activeSpectra, activeTa
|
|
|
42
42
|
],
|
|
43
43
|
});
|
|
44
44
|
}, [activeSpectra?.length, dispatch, modal]);
|
|
45
|
-
function
|
|
45
|
+
function showAllSpectraHandler() {
|
|
46
46
|
dispatch({
|
|
47
47
|
type: 'CHANGE_SPECTRA_VISIBILITY_BY_NUCLEUS',
|
|
48
48
|
payload: { nucleus: activeTab, flag: true },
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
|
-
function
|
|
51
|
+
function hideAllSpectraHandler() {
|
|
52
52
|
dispatch({
|
|
53
53
|
type: 'CHANGE_SPECTRA_VISIBILITY_BY_NUCLEUS',
|
|
54
54
|
payload: { nucleus: activeTab, flag: false },
|
|
@@ -85,13 +85,13 @@ function SpectraPanelHeaderInner({ data, activeSpectrum, activeSpectra, activeTa
|
|
|
85
85
|
disabled: !hasActiveSpectra,
|
|
86
86
|
icon: _jsx(FaEyeSlash, {}),
|
|
87
87
|
title: 'Hide selected spectra',
|
|
88
|
-
onClick:
|
|
88
|
+
onClick: hideAllSpectraHandler,
|
|
89
89
|
},
|
|
90
90
|
{
|
|
91
91
|
disabled: !hasActiveSpectra,
|
|
92
92
|
icon: _jsx(FaEye, {}),
|
|
93
93
|
title: 'Show selected spectra',
|
|
94
|
-
onClick:
|
|
94
|
+
onClick: showAllSpectraHandler,
|
|
95
95
|
},
|
|
96
96
|
];
|
|
97
97
|
if (displayerMode === '2D' && activeSpectrum?.info.isFt) {
|
|
@@ -125,7 +125,7 @@ function SpectraPanelHeaderInner({ data, activeSpectrum, activeSpectra, activeTa
|
|
|
125
125
|
return (_jsx(DefaultPanelHeader, { onDelete: handleDelete, total: data?.length, counter: spectraLengthPerTab, deleteToolTip: "Delete selected spectra", disableDelete: !hasActiveSpectra, onSettingClick: onSettingClick, leftButtons: leftButtons }));
|
|
126
126
|
}
|
|
127
127
|
const MemoizedSpectraPanelHeader = memo(SpectraPanelHeaderInner);
|
|
128
|
-
export default function
|
|
128
|
+
export default function SpectraTabs({ onSettingClick, }) {
|
|
129
129
|
const { data, view: { spectra: { activeTab }, }, displayerMode, } = useChartData();
|
|
130
130
|
const spectrum = useSpectrum();
|
|
131
131
|
const activeSpectra = useActiveSpectra();
|
|
@@ -49,7 +49,7 @@ var SpectraContextMenuOptionsKeys;
|
|
|
49
49
|
})(SpectraContextMenuOptionsKeys || (SpectraContextMenuOptionsKeys = {}));
|
|
50
50
|
const Spectra2DContextMenuOptions = [
|
|
51
51
|
{
|
|
52
|
-
text: 'Copy to
|
|
52
|
+
text: 'Copy to clipboard',
|
|
53
53
|
icon: _jsx(FaCopy, {}),
|
|
54
54
|
data: { id: SpectraContextMenuOptionsKeys.CopyToClipboard },
|
|
55
55
|
},
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function SpectraTabs(): import("@emotion/react/jsx-runtime").JSX.Element;
|
package/lib/component/panels/{SpectrumsPanel/SpectrumsTabs.js → SpectraPanel/SpectraTabs.js}
RENAMED
|
@@ -11,12 +11,12 @@ import { useSetActiveSpectrumAction } from '../../hooks/useSetActiveSpectrumActi
|
|
|
11
11
|
import groupByInfoKey from '../../utility/GroupByInfoKey';
|
|
12
12
|
import { SpectraTable } from './SpectraTable';
|
|
13
13
|
import SpectrumSetting from './base/setting/SpectrumSetting';
|
|
14
|
-
function
|
|
14
|
+
function SpectraTabsInner({ data, activeSpectra, activeTab, }) {
|
|
15
15
|
const [selectedSpectrumData, setSelectedSpectrum] = useState(null);
|
|
16
16
|
const [settingModalPosition, setSettingModalPosition] = useState(null);
|
|
17
17
|
const [isSettingModalDisplayed, setIsSettingModalDisplayed] = useState(false);
|
|
18
18
|
const dispatch = useDispatch();
|
|
19
|
-
const
|
|
19
|
+
const spectraGroupByNucleus = useMemo(() => {
|
|
20
20
|
if (!data)
|
|
21
21
|
return [];
|
|
22
22
|
const groupByNucleus = groupByInfoKey('nucleus');
|
|
@@ -54,11 +54,11 @@ function SpectrumsTabsInner({ data, activeSpectra, activeTab, }) {
|
|
|
54
54
|
tbody tr {
|
|
55
55
|
height: 20px;
|
|
56
56
|
}
|
|
57
|
-
`, children: [_jsx(Tabs, { activeTab: activeTab, onClick: onTabChangeHandler, children:
|
|
58
|
-
Object.keys(
|
|
57
|
+
`, children: [_jsx(Tabs, { activeTab: activeTab, onClick: onTabChangeHandler, children: spectraGroupByNucleus &&
|
|
58
|
+
Object.keys(spectraGroupByNucleus).map((nucleus) => (_jsx(Tab, { render: ({ title }) => _jsx(IsotopesViewer, { value: title }), title: nucleus, tabid: nucleus, children: _jsx(SpectraTable, { nucleus: nucleus, data: spectraGroupByNucleus[nucleus], activeSpectra: activeSpectra?.[nucleus] || null, onChangeVisibility: handleChangeVisibility, onChangeActiveSpectrum: handleChangeActiveSpectrum, onOpenSettingModal: openSettingHandler }) }, nucleus))) }, activeTab), isSettingModalDisplayed ? (_jsx(SpectrumSetting, { onClose: mouseLeaveHandler, data: selectedSpectrumData, position: settingModalPosition })) : null] }));
|
|
59
59
|
}
|
|
60
|
-
const MemoizedSpectra = memo(
|
|
61
|
-
export default function
|
|
60
|
+
const MemoizedSpectra = memo(SpectraTabsInner);
|
|
61
|
+
export default function SpectraTabs() {
|
|
62
62
|
const { data, view: { spectra: { activeTab, activeSpectra }, }, } = useChartData();
|
|
63
63
|
return _jsx(MemoizedSpectra, { data, activeSpectra, activeTab });
|
|
64
64
|
}
|
|
@@ -3,7 +3,7 @@ import { memo, useState, useRef } from 'react';
|
|
|
3
3
|
import PreferencesHeader from '../header/PreferencesHeader';
|
|
4
4
|
import SpectraPanelHeader from './SpectraPanelHeader';
|
|
5
5
|
import SpectraPreferences from './SpectraPreferences';
|
|
6
|
-
import
|
|
6
|
+
import SpectraTabs from './SpectraTabs';
|
|
7
7
|
const styles = {
|
|
8
8
|
overflow: 'hidden',
|
|
9
9
|
height: '100%',
|
|
@@ -23,6 +23,6 @@ function SpectrumListPanel() {
|
|
|
23
23
|
setFlipStatus(!isFlipped);
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
return (_jsx("div", { style: styles, children: isFlipped ? (_jsxs(_Fragment, { children: [_jsx(PreferencesHeader, { onSave: saveSettingHandler, onClose: settingsPanelHandler }), _jsx(SpectraPreferences, { ref: settingsRef })] })) : (_jsxs(_Fragment, { children: [_jsx(SpectraPanelHeader, { onSettingClick: settingsPanelHandler }), _jsx(
|
|
26
|
+
return (_jsx("div", { style: styles, children: isFlipped ? (_jsxs(_Fragment, { children: [_jsx(PreferencesHeader, { onSave: saveSettingHandler, onClose: settingsPanelHandler }), _jsx(SpectraPreferences, { ref: settingsRef })] })) : (_jsxs(_Fragment, { children: [_jsx(SpectraPanelHeader, { onSettingClick: settingsPanelHandler }), _jsx(SpectraTabs, {})] })) }));
|
|
27
27
|
}
|
|
28
28
|
export default memo(SpectrumListPanel);
|
|
@@ -27,6 +27,6 @@ function DatabasePreferences(props, ref) {
|
|
|
27
27
|
formRef.current.submitForm();
|
|
28
28
|
},
|
|
29
29
|
}));
|
|
30
|
-
return (_jsx(PreferencesContainer, { children: _jsx(Formik, { initialValues: {}, onSubmit: saveHandler, innerRef: formRef, children: _jsxs(_Fragment, { children: [_jsxs(PreferencesGroup, { children: [_jsx(FormikColumnFormatField, { label: "Preview jcamp", checkControllerName: "previewJcamp", hideFormatField: true }), _jsx(Label, { title: "Color", style: formatFieldLabelStyle, children: _jsx(FormikColorPickerDropdown, { name: "color" }) }), _jsx(Label, { title: "Margin bottom (px)
|
|
30
|
+
return (_jsx(PreferencesContainer, { children: _jsx(Formik, { initialValues: {}, onSubmit: saveHandler, innerRef: formRef, children: _jsxs(_Fragment, { children: [_jsxs(PreferencesGroup, { children: [_jsx(FormikColumnFormatField, { label: "Preview jcamp", checkControllerName: "previewJcamp", hideFormatField: true }), _jsx(Label, { title: "Color", style: formatFieldLabelStyle, children: _jsx(FormikColorPickerDropdown, { name: "color" }) }), _jsx(Label, { title: "Margin bottom (px):", style: formatFieldLabelStyle, children: _jsx(FormikInput, { name: "marginBottom", type: "number", style: formatFieldInputStyle }) })] }), _jsxs(PreferencesGroup, { header: "Table Preferences", children: [_jsx(FormikColumnFormatField, { label: "Structure", checkControllerName: "showSmiles", hideFormatField: true }), _jsx(FormikColumnFormatField, { label: "Solvent", checkControllerName: "showSolvent", hideFormatField: true }), _jsx(FormikColumnFormatField, { label: "Names", checkControllerName: "showNames", hideFormatField: true }), _jsx(FormikColumnFormatField, { label: "Range", checkControllerName: "range.show", formatControllerName: "range.format" }), _jsx(FormikColumnFormatField, { label: "\u03B4 (ppm)", checkControllerName: "delta.show", formatControllerName: "delta.format" }), _jsx(FormikColumnFormatField, { label: "Assignment", checkControllerName: "showAssignment", hideFormatField: true }), _jsx(FormikColumnFormatField, { label: "J (Hz)", checkControllerName: "coupling.show", formatControllerName: "coupling.format" }), _jsx(FormikColumnFormatField, { label: "Multiplicity", checkControllerName: "showMultiplicity", hideFormatField: true }), _jsx(FormikColumnFormatField, { label: "Save as nmrium", checkControllerName: "allowSaveAsNMRium", hideFormatField: true })] })] }) }) }));
|
|
31
31
|
}
|
|
32
32
|
export default forwardRef(DatabasePreferences);
|
|
@@ -27,5 +27,5 @@ export function SpectraAutomaticPickingButton() {
|
|
|
27
27
|
!isToolVisible('autoRangeAndZonePicking')) {
|
|
28
28
|
return null;
|
|
29
29
|
}
|
|
30
|
-
return (_jsx(Toolbar.Item, { icon: _jsx(SvgNmrRangePicking, {}), title: "Automatic
|
|
30
|
+
return (_jsx(Toolbar.Item, { icon: _jsx(SvgNmrRangePicking, {}), title: "Automatic ranges/zones picking for all spectra", onClick: automaticPickingHandler }));
|
|
31
31
|
}
|
|
@@ -131,6 +131,6 @@ function AlignSpectra({ onClose = () => null, nucleus }) {
|
|
|
131
131
|
padding-top: 5px;
|
|
132
132
|
}
|
|
133
133
|
`;
|
|
134
|
-
return (_jsx("div", { css: styles, children: _jsx(Formik, { initialValues: options, enableReinitialize: true, onSubmit: submitHandler, validationSchema: schemaValidation, validate: () => setError(''), children: ({ submitForm }) => (_jsxs(_Fragment, { children: [_jsxs("div", { className: "body", style: { flex: 1 }, children: [_jsx("div", { className: "header", children: _jsx("span", { children: "Spectra calibration" }) }), error && _jsx(Message, { type: "error", children: error }), _jsx(Label, { title: "Options", style: labelStyle, children: _jsx(Select, { items: List, style: { width: '100%', height: 30 }, onChange: optionChangeHandler }) }), _jsxs(Label, { title: "Range", style: labelStyle, children: [_jsx(Label, { title: "From", children: _jsx(FormikInput, { name: "from", type: "number", style: inputStyle }) }), _jsx(Label, { title: "To", style: { label: { padding: '0 10px' } }, children: _jsx(FormikInput, { name: "to", type: "number", style: inputStyle }) })] }), _jsx(Label, { title: "Number of
|
|
134
|
+
return (_jsx("div", { css: styles, children: _jsx(Formik, { initialValues: options, enableReinitialize: true, onSubmit: submitHandler, validationSchema: schemaValidation, validate: () => setError(''), children: ({ submitForm }) => (_jsxs(_Fragment, { children: [_jsxs("div", { className: "body", style: { flex: 1 }, children: [_jsx("div", { className: "header", children: _jsx("span", { children: "Spectra calibration" }) }), error && _jsx(Message, { type: "error", children: error }), _jsx(Label, { title: "Options", style: labelStyle, children: _jsx(Select, { items: List, style: { width: '100%', height: 30 }, onChange: optionChangeHandler }) }), _jsxs(Label, { title: "Range", style: labelStyle, children: [_jsx(Label, { title: "From", children: _jsx(FormikInput, { name: "from", type: "number", style: inputStyle }) }), _jsx(Label, { title: "To", style: { label: { padding: '0 10px' } }, children: _jsx(FormikInput, { name: "to", type: "number", style: inputStyle }) })] }), _jsx(Label, { title: "Number of peaks", style: labelStyle, children: _jsx(FormikInput, { name: "nbPeaks", type: "number", style: inputStyle }) }), _jsx(Label, { title: "Target PPM", style: labelStyle, children: _jsx(FormikInput, { name: "targetX", type: "number", style: inputStyle }) })] }), _jsx("div", { className: "footer", children: _jsx(ActionButtons, { onDone: submitForm, onCancel: onClose }) })] })) }) }));
|
|
135
135
|
}
|
|
136
136
|
export default AlignSpectra;
|
|
@@ -100,9 +100,9 @@ export default function AnalysisChart(props) {
|
|
|
100
100
|
const plotData = usePlotData(spectraAnalysisData, { ...plotOptions, paths });
|
|
101
101
|
const xLabel = paths?.[plotOptions.xPath]?.at(-1) || '';
|
|
102
102
|
const yLabel = paths?.[plotOptions.yPath]?.at(-1) || '';
|
|
103
|
-
return (_jsxs("div", { children: [_jsxs("div", { style: { display: 'flex', padding: '5px' }, children: [_jsx(Label, { title: "X
|
|
103
|
+
return (_jsxs("div", { children: [_jsxs("div", { style: { display: 'flex', padding: '5px' }, children: [_jsx(Label, { title: "X", children: _jsx(Input, { name: "xPath", style: {
|
|
104
104
|
input: { padding: '5px' },
|
|
105
|
-
}, value: plotOptions.xPath, datalist: datalist, onChange: handleChangeKey }) }), _jsx(Label, { title: "Y
|
|
105
|
+
}, value: plotOptions.xPath, datalist: datalist, onChange: handleChangeKey }) }), _jsx(Label, { title: "Y", style: { container: { paddingLeft: '5px' } }, children: _jsx(Input, { name: "yPath", style: {
|
|
106
106
|
input: { padding: '5px' },
|
|
107
107
|
}, value: plotOptions.yPath, datalist: datalist, onChange: handleChangeKey }) }), _jsx(Button.BarButton, { toolTip: "Copy chart to clipboard", onClick: handleCopy, children: _jsx(FaFileExport, {}) })] }), _jsx("div", { style: {
|
|
108
108
|
width: '100%',
|
|
@@ -57,7 +57,7 @@ function MultipleSpectraAnalysisPreferences({ data, activeTab, onAfterSave }, re
|
|
|
57
57
|
}, children: _jsx(LegendsPreferences, {}) }), _jsx(GroupPane, { text: "General", style: {
|
|
58
58
|
header: { color: 'black' },
|
|
59
59
|
container: { padding: '5px' },
|
|
60
|
-
}, children: _jsx(Label, { title: "Enable resort spectra",
|
|
60
|
+
}, children: _jsx(Label, { title: "Enable resort spectra", children: _jsx(FormikCheckBox, { name: "resortSpectra" }) }) }), _jsx(GroupPane, { text: "Columns Settings ", style: {
|
|
61
61
|
header: { color: 'black' },
|
|
62
62
|
container: { padding: '5px' },
|
|
63
63
|
}, children: _jsx(AnalysisTablePreferences, {}) }), isExperimental && (_jsx(GroupPane, { text: "Execute code ", style: {
|
|
@@ -79,9 +79,9 @@ function PredictionOptionsPanel(props, ref) {
|
|
|
79
79
|
const { options, onSubmit, hideName = false } = props;
|
|
80
80
|
return (_jsx(Formik, { initialValues: options, validationSchema: predictionFormValidation, enableReinitialize: true, onSubmit: onSubmit, innerRef: ref, children: _jsxs(_Fragment, { children: [_jsx(FormikErrorsSummary, {}), !hideName && (_jsx(Label, { title: "Name", style: labelStyle, children: _jsx(FormikInput, { name: "name", style: inputStyle }) })), _jsx(Label, { title: "Frequency", style: labelStyle, children: _jsx(FormikSelect, { items: FREQUENCIES, style: styles.select, name: "frequency" }) }), _jsxs(GroupPane, { text: "1D Options", style: {
|
|
81
81
|
header: styles.groupHeader,
|
|
82
|
-
}, children: [_jsx(Label, { title: "Auto extend range", style: labelStyle, children: _jsx(FormikCheckBox, { name: "autoExtendRange" }) }), _jsxs(Label, { title: "1H", renderTitle: (title) => (_jsx(IsotopesViewer, { value: title, className: "custom-label" })), style: labelStyle, children: [_jsx(Label, { title: "From", children: _jsx(FormikInput, { name: "1d.1H.from", type: "number", style: inputStyle }) }), _jsx(Label, { title: "To", style: { label: { padding: '0 10px' } }, children: _jsx(FormikInput, { name: "1d.1H.to", type: "number", style: inputStyle }) })] }), _jsxs(Label, { title: "13C", renderTitle: (title) => (_jsx(IsotopesViewer, { value: title, className: "custom-label" })), style: labelStyle, children: [_jsx(Label, { title: "From", children: _jsx(FormikInput, { name: "1d.13C.from", type: "number", style: inputStyle }) }), _jsx(Label, { title: "To", style: { label: { padding: '0 10px' } }, children: _jsx(FormikInput, { name: "1d.13C.to", type: "number", style: inputStyle }) })] }), _jsxs(Label, { title: "Line
|
|
82
|
+
}, children: [_jsx(Label, { title: "Auto extend range", style: labelStyle, children: _jsx(FormikCheckBox, { name: "autoExtendRange" }) }), _jsxs(Label, { title: "1H", renderTitle: (title) => (_jsx(IsotopesViewer, { value: title, className: "custom-label" })), style: labelStyle, children: [_jsx(Label, { title: "From", children: _jsx(FormikInput, { name: "1d.1H.from", type: "number", style: inputStyle }) }), _jsx(Label, { title: "To", style: { label: { padding: '0 10px' } }, children: _jsx(FormikInput, { name: "1d.1H.to", type: "number", style: inputStyle }) })] }), _jsxs(Label, { title: "13C", renderTitle: (title) => (_jsx(IsotopesViewer, { value: title, className: "custom-label" })), style: labelStyle, children: [_jsx(Label, { title: "From", children: _jsx(FormikInput, { name: "1d.13C.from", type: "number", style: inputStyle }) }), _jsx(Label, { title: "To", style: { label: { padding: '0 10px' } }, children: _jsx(FormikInput, { name: "1d.13C.to", type: "number", style: inputStyle }) })] }), _jsxs(Label, { title: "Line width", style: labelStyle, children: [_jsx(FormikInput, { name: "1d.lineWidth", type: "number", style: inputStyle }), _jsx("span", { style: { paddingLeft: '0.4rem' }, children: " Hz " })] }), _jsx(Label, { title: "Number of points", style: labelStyle, children: _jsx(FormikSelect, { items: NUMBER_OF_POINTS_1D, name: "1d.nbPoints", style: styles.select }) })] }), _jsx(GroupPane, { text: "2D Options", style: {
|
|
83
83
|
header: styles.groupHeader,
|
|
84
|
-
}, children: _jsxs(Label, { title: "Number of
|
|
84
|
+
}, children: _jsxs(Label, { title: "Number of points", style: labelStyle, children: [_jsx(FormikSelect, { items: NUMBER_OF_POINTS_2D, name: "2d.nbPoints.x", style: { margin: 0, height: 30 } }), _jsx("span", { style: { padding: '0 10px' }, children: " X " }), _jsx(FormikSelect, { items: NUMBER_OF_POINTS_2D, name: "2d.nbPoints.y", style: { margin: 0, height: 30 } })] }) }), _jsx(GroupPane, { text: "Spectra", style: {
|
|
85
85
|
header: styles.groupHeader,
|
|
86
86
|
}, children: _jsxs("div", { style: { display: 'flex', justifyContent: 'space-around' }, children: [_jsx(IsotopesOption, { title: "1H", name: "spectra.proton" }), _jsx(IsotopesOption, { title: "13C", name: "spectra.carbon" }), _jsx(IsotopesOption, { title: "COSY", name: "spectra.cosy" }), _jsx(IsotopesOption, { title: "HSQC", name: "spectra.hsqc" }), _jsx(IsotopesOption, { title: "HMBC", name: "spectra.hmbc" })] }) })] }) }));
|
|
87
87
|
}
|
|
@@ -39,6 +39,6 @@ function PredictionSimpleOptions() {
|
|
|
39
39
|
justifyContent: 'flex-end',
|
|
40
40
|
flex: '1',
|
|
41
41
|
height: '100%',
|
|
42
|
-
}, children: [_jsx(Label, { title: "Frequency", style: labelStyle, children: _jsx(FormikSelect, { items: FREQUENCIES, style: selectStyles, name: "frequency" }) }), _jsxs(Label, { title: "Line
|
|
42
|
+
}, children: [_jsx(Label, { title: "Frequency", style: labelStyle, children: _jsx(FormikSelect, { items: FREQUENCIES, style: selectStyles, name: "frequency" }) }), _jsxs(Label, { title: "Line width", style: labelStyle, children: [_jsx(FormikInput, { name: "1d.lineWidth", type: "number", style: { input: { width: '40px', textAlign: 'center' } } }), _jsx("span", { style: { padding: '0 5px' }, children: "Hz" })] }), _jsx(FormikOnChange, { enableValidation: true, onChange: optionsChangeHandler })] }) }));
|
|
43
43
|
}
|
|
44
44
|
export default PredictionSimpleOptions;
|
|
@@ -15,6 +15,12 @@ import PreferencesHeader from '../header/PreferencesHeader';
|
|
|
15
15
|
import SpectrumSimulationPreferences from './SpectrumSimulationPreferences';
|
|
16
16
|
import SpectrumSimulationSimpleOptions from './SpectrumSimulationSimpleOptions';
|
|
17
17
|
import { SpinSystemTable } from './SpinSystemTable';
|
|
18
|
+
const optionsSchema = Yup.object({
|
|
19
|
+
lineWidth: Yup.number().min(0.1).required(),
|
|
20
|
+
});
|
|
21
|
+
const optionsValidationSchema = Yup.object({
|
|
22
|
+
options: optionsSchema,
|
|
23
|
+
});
|
|
18
24
|
const validationSchema = Yup.object({
|
|
19
25
|
data: Yup.array().of(Yup.array().of(Yup.lazy((value) => {
|
|
20
26
|
if (value === null) {
|
|
@@ -22,6 +28,7 @@ const validationSchema = Yup.object({
|
|
|
22
28
|
}
|
|
23
29
|
return Yup.number().required();
|
|
24
30
|
}))),
|
|
31
|
+
options: optionsSchema,
|
|
25
32
|
});
|
|
26
33
|
export default function SpectrumSimulation() {
|
|
27
34
|
const dispatch = useDispatch();
|
|
@@ -79,7 +86,7 @@ export default function SpectrumSimulation() {
|
|
|
79
86
|
}
|
|
80
87
|
return (_jsx(Formik, { initialValues: { ...defaultSimulationOptions, data }, enableReinitialize: true,
|
|
81
88
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
82
|
-
onSubmit: () => { }, innerRef: formRef, children: ({ values }) => (_jsxs(_Fragment, { children: [_jsxs("div", { css: [
|
|
89
|
+
onSubmit: () => { }, innerRef: formRef, validationSchema: optionsValidationSchema, children: ({ values }) => (_jsxs(_Fragment, { children: [_jsxs("div", { css: [
|
|
83
90
|
tablePanelStyle,
|
|
84
91
|
isFlipped &&
|
|
85
92
|
css `
|
|
@@ -32,6 +32,6 @@ function SpectrumSimulationPreferences({ options, onSave }, ref) {
|
|
|
32
32
|
void formRef.current?.submitForm();
|
|
33
33
|
},
|
|
34
34
|
}), []);
|
|
35
|
-
return (_jsx(PreferencesContainer, { style: { backgroundColor: 'white' }, children: _jsx(Formik, { initialValues: options, onSubmit: onSave, innerRef: formRef, children: _jsxs(_Fragment, { children: [_jsx(Label, { title: "Frequency", style: labelStyle, children: _jsx(FormikSelect, { items: FREQUENCIES, style: selectStyles, name: "options.frequency" }) }), _jsx(Label, { title: "Number of
|
|
35
|
+
return (_jsx(PreferencesContainer, { style: { backgroundColor: 'white' }, children: _jsx(Formik, { initialValues: options, onSubmit: onSave, innerRef: formRef, children: _jsxs(_Fragment, { children: [_jsx(Label, { title: "Frequency", style: labelStyle, children: _jsx(FormikSelect, { items: FREQUENCIES, style: selectStyles, name: "options.frequency" }) }), _jsx(Label, { title: "Number of points", style: labelStyle, children: _jsx(FormikSelect, { items: SIMULATION_NUMBER_OF_POINTS, name: "options.nbPoints", style: selectStyles }) }), _jsxs(Label, { title: "Range", style: labelStyle, children: [_jsx(Label, { title: "From", children: _jsx(FormikInput, { name: "options.from", type: "number", style: inputStyle }) }), _jsx(Label, { title: "To", style: { label: { padding: '0 10px' } }, children: _jsx(FormikInput, { name: "options.to", type: "number", style: inputStyle }) })] }), _jsxs(Label, { title: "Line width", style: labelStyle, children: [_jsx(FormikInput, { name: "options.lineWidth", type: "number", style: inputStyle }), _jsx("span", { style: { paddingLeft: '0.4rem' }, children: " Hz " })] })] }) }) }));
|
|
36
36
|
}
|
|
37
37
|
export default forwardRef(SpectrumSimulationPreferences);
|
|
@@ -20,10 +20,10 @@ export default function SpectrumSimulationSimpleOptions({ onSpinSystemChange, sp
|
|
|
20
20
|
display: 'flex',
|
|
21
21
|
justifyContent: 'flex-end',
|
|
22
22
|
flex: '1',
|
|
23
|
-
}, children: [_jsx(Label, { title: "", style: labelStyle, children: _jsx(Select, { items: SPIN_SYSTEMS, style: selectStyles, onChange: onSpinSystemChange, value: spinSystem }) }), _jsx(Label, { title: "Frequency", style: labelStyle, children: _jsx(FormikSelect, { items: FREQUENCIES, style: selectStyles, name: "options.frequency" }) }), _jsxs(Label, { title: "Line
|
|
23
|
+
}, children: [_jsx(Label, { title: "", style: labelStyle, children: _jsx(Select, { items: SPIN_SYSTEMS, style: selectStyles, onChange: onSpinSystemChange, value: spinSystem }) }), _jsx(Label, { title: "Frequency", style: labelStyle, children: _jsx(FormikSelect, { items: FREQUENCIES, style: selectStyles, name: "options.frequency" }) }), _jsxs(Label, { title: "Line width", style: labelStyle, children: [_jsx(FormikInput, { name: "options.lineWidth", type: "number", style: {
|
|
24
24
|
input: {
|
|
25
25
|
width: '40px',
|
|
26
26
|
textAlign: 'center',
|
|
27
27
|
},
|
|
28
|
-
} }), _jsx("span", { style: { padding: '0 5px' }, children: "Hz" })] })] }));
|
|
28
|
+
}, step: 0.1, min: 0.1 }), _jsx("span", { style: { padding: '0 5px' }, children: "Hz" })] })] }));
|
|
29
29
|
}
|
|
@@ -47,7 +47,7 @@ export function SpinSystemTable(props) {
|
|
|
47
47
|
}
|
|
48
48
|
return _jsx("div", {});
|
|
49
49
|
},
|
|
50
|
-
Header: () => (_jsxs("span", { children: ["J", _jsxs("sub", { children: [label, "-"] }), "(Hz)"] })),
|
|
50
|
+
Header: () => (_jsxs("span", { children: ["J", _jsxs("sub", { children: [label, "-X"] }), "(Hz)"] })),
|
|
51
51
|
});
|
|
52
52
|
i++;
|
|
53
53
|
}
|