nmrium 0.54.0 → 0.55.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/XAxis.js +1 -1
- package/lib/component/1d/integral/IntegralsSeries.js +2 -2
- package/lib/component/1d/integral/Integration.d.ts +3 -1
- package/lib/component/1d/integral/Integration.js +3 -2
- package/lib/component/1d/peaks/PeakEditionManager.js +5 -3
- package/lib/component/1d/ranges/AssignmentActionsButtons.d.ts +1 -0
- package/lib/component/1d/ranges/AssignmentActionsButtons.js +3 -3
- package/lib/component/1d/ranges/AssignmentLabel.d.ts +1 -1
- package/lib/component/1d/ranges/AssignmentLabel.js +31 -4
- package/lib/component/1d/ranges/Atoms.js +4 -5
- package/lib/component/1d/ranges/Range.js +48 -6
- package/lib/component/1d/ranges/Ranges.js +2 -1
- package/lib/component/1d/ranges/RangesIntegrals.js +11 -4
- package/lib/component/1d-2d/FieldEdition.d.ts +13 -0
- package/lib/component/1d-2d/FieldEdition.js +42 -0
- package/lib/component/2d/Chart2D.js +5 -3
- package/lib/component/2d/zones/Zone.js +18 -2
- package/lib/component/2d/zones/ZonesAssignmentsLabels.d.ts +7 -0
- package/lib/component/2d/zones/ZonesAssignmentsLabels.js +286 -0
- package/lib/component/EventsTrackers/KeysListenerTracker.js +14 -1
- package/lib/component/context/ShareDataContext.d.ts +10 -0
- package/lib/component/context/ShareDataContext.js +22 -0
- package/lib/component/elements/ActionsButtonsPopover.d.ts +10 -0
- package/lib/component/elements/ActionsButtonsPopover.js +22 -0
- package/lib/component/elements/ReactTable/Elements/ReactTableRow.js +7 -5
- package/lib/component/elements/ReactTable/ReactTable.d.ts +2 -2
- package/lib/component/elements/SVGButton.d.ts +14 -0
- package/lib/component/elements/SVGButton.js +6 -0
- package/lib/component/elements/SVGGroup.js +15 -13
- package/lib/component/elements/SVGText.d.ts +8 -0
- package/lib/component/elements/SVGText.js +24 -0
- package/lib/component/elements/draggable/SVGDraggable.d.ts +2 -2
- package/lib/component/elements/formik/FormikInput.d.ts +2 -1
- package/lib/component/elements/formik/FormikInput.js +4 -3
- package/lib/component/header/Header.js +7 -10
- package/lib/component/hooks/useActiveSpectrumZonesViewState.js +1 -0
- package/lib/component/hooks/useCheckPointsNumberInWindowArea.d.ts +1 -1
- package/lib/component/hooks/useFormatNumberByNucleus.d.ts +1 -1
- package/lib/component/hooks/useFormatNumberByNucleus.js +8 -7
- package/lib/component/hooks/useIntegralPath.d.ts +2 -0
- package/lib/component/hooks/useIntegralPath.js +3 -1
- package/lib/component/hooks/usePanelPreferences.js +1 -2
- package/lib/component/hooks/useSaveSettings.js +7 -14
- package/lib/component/hooks/useTriggerNewAssignmentLabel.d.ts +4 -0
- package/lib/component/hooks/useTriggerNewAssignmentLabel.js +8 -0
- package/lib/component/hooks/useWorkspaceAction.d.ts +7 -0
- package/lib/component/hooks/useWorkspaceAction.js +89 -0
- package/lib/component/loader/DropZone.js +0 -3
- package/lib/component/main/InnerNMRium.js +3 -1
- package/lib/component/main/InnerNMRiumContents.js +14 -2
- package/lib/component/main/NMRiumStateProvider.js +4 -2
- package/lib/component/modal/editRange/forms/components/DeltaInput.js +3 -3
- package/lib/component/modal/editRange/forms/components/NewSignalTab.js +17 -12
- package/lib/component/modal/editRange/forms/components/signal-tabs/SignalJCouplingsTable.js +30 -13
- package/lib/component/modal/editRange/forms/components/signal-tabs/SignalPeaksTable.js +26 -16
- package/lib/component/modal/setting/GeneralSettings.js +7 -21
- package/lib/component/modal/setting/WorkspaceItem.js +1 -1
- package/lib/component/modal/setting/settings-tabs/NucleiTabContent.d.ts +2 -0
- package/lib/component/modal/setting/settings-tabs/NucleiTabContent.js +99 -0
- package/lib/component/modal/setting/settingsValidation.js +36 -40
- package/lib/component/panels/SpectraPanel/SpectraPreferences.js +13 -1
- package/lib/component/panels/SpectraPanel/base/setting/PlotChart.js +1 -1
- package/lib/component/panels/SpectraPanel/base/setting/Spectrum2DHistogram.js +1 -1
- package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentLabelColumn.d.ts +6 -0
- package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentLabelColumn.js +16 -0
- package/lib/component/panels/ZonesPanel/ZonesPanel.js +18 -2
- package/lib/component/panels/ZonesPanel/ZonesPreferences.js +15 -9
- package/lib/component/panels/ZonesPanel/ZonesTable.js +2 -2
- package/lib/component/panels/ZonesPanel/ZonesTableRow.js +3 -2
- package/lib/component/panels/multipleAnalysisPanel/preferences/index.js +1 -1
- package/lib/component/reducer/IgnoreActions.js +1 -0
- package/lib/component/reducer/Reducer.js +6 -0
- package/lib/component/reducer/actions/DomainActions.d.ts +7 -2
- package/lib/component/reducer/actions/DomainActions.js +29 -1
- package/lib/component/reducer/actions/RangesActions.js +12 -6
- package/lib/component/reducer/actions/ZonesActions.d.ts +15 -2
- package/lib/component/reducer/actions/ZonesActions.js +47 -13
- package/lib/component/reducer/helper/setRangesViewProperty.d.ts +1 -0
- package/lib/component/reducer/helper/setRangesViewProperty.js +11 -11
- package/lib/component/reducer/preferences/actions/addWorkspace.js +4 -23
- package/lib/component/reducer/preferences/actions/analyzeSpectra.js +4 -4
- package/lib/component/reducer/preferences/actions/initPreferences.js +2 -4
- package/lib/component/reducer/preferences/actions/matrixGeneration.js +3 -3
- package/lib/component/reducer/preferences/actions/removeWorkspace.js +0 -5
- package/lib/component/reducer/preferences/actions/setActiveWorkspace.js +0 -4
- package/lib/component/reducer/preferences/actions/setPanelsPreferences.js +1 -1
- package/lib/component/reducer/preferences/actions/setPreferences.js +2 -16
- package/lib/component/reducer/preferences/preferencesReducer.d.ts +7 -0
- package/lib/component/reducer/preferences/preferencesReducer.js +21 -18
- package/lib/component/toolbar/ToolBar.js +18 -14
- package/lib/component/utility/PreferencesHelper.js +5 -4
- package/lib/component/utility/export.js +4 -0
- package/lib/component/workspaces/assignment.js +0 -1
- package/lib/component/workspaces/basic.js +0 -1
- package/lib/component/workspaces/embedded.js +0 -1
- package/lib/component/workspaces/exercise.js +26 -29
- package/lib/component/workspaces/prediction.js +171 -174
- package/lib/component/workspaces/process1D.js +0 -1
- package/lib/component/workspaces/simulation.js +35 -38
- package/lib/component/workspaces/workspaceDefaultProperties.js +9 -11
- package/lib/versionInfo.js +1 -1
- package/package.json +31 -31
- package/lib/component/modal/setting/settings-tabs/FormattingTabContent.d.ts +0 -2
- package/lib/component/modal/setting/settings-tabs/FormattingTabContent.js +0 -80
- package/lib/component/reducer/preferences/utilities/mapNucleiFormatting.d.ts +0 -2
- package/lib/component/reducer/preferences/utilities/mapNucleiFormatting.js +0 -10
|
@@ -15,15 +15,16 @@ import Button from '../../elements/Button';
|
|
|
15
15
|
import Label from '../../elements/Label';
|
|
16
16
|
import DropDownButton from '../../elements/dropDownButton/DropDownButton';
|
|
17
17
|
import { useSaveSettings } from '../../hooks/useSaveSettings';
|
|
18
|
+
import { useWorkspaceAction } from '../../hooks/useWorkspaceAction';
|
|
18
19
|
import { getPreferencesByWorkspace } from '../../reducer/preferences/utilities/getPreferencesByWorkspace';
|
|
19
20
|
import PredefinedWorkspaces from '../../workspaces';
|
|
20
21
|
import WorkspaceItem from './WorkspaceItem';
|
|
21
22
|
import DatabasesTabContent from './settings-tabs/DatabasesTabContent';
|
|
22
23
|
import DisplayTabContent from './settings-tabs/DisplayTabContent';
|
|
23
|
-
import FormattingTabContent from './settings-tabs/FormattingTabContent';
|
|
24
24
|
import GeneralTabContent from './settings-tabs/GeneralTabContent';
|
|
25
25
|
import ImportationFiltersTabContent from './settings-tabs/ImportationFiltersTabContent';
|
|
26
26
|
import InfoBlockTabContent from './settings-tabs/InfoBlockTabContent';
|
|
27
|
+
import NucleiTabContent from './settings-tabs/NucleiTabContent';
|
|
27
28
|
import OnLoadProcessingTabContent from './settings-tabs/OnLoadProcessingTabContent';
|
|
28
29
|
import SpectraColorsTabContent from './settings-tabs/SpectraColorsTabContent';
|
|
29
30
|
import ToolsTabContent from './settings-tabs/ToolsTabContent';
|
|
@@ -72,6 +73,7 @@ function isRestButtonDisable(currentWorkspaceSetting, workspaceName, customWorks
|
|
|
72
73
|
function GeneralSettingsModal({ height }) {
|
|
73
74
|
const [isOpenDialog, openDialog, closeDialog] = useOnOff(false);
|
|
74
75
|
const { dispatch, current: currentWorkspace, originalWorkspaces, ...preferences } = usePreferences();
|
|
76
|
+
const { addNewWorkspace, removeWorkspace, setActiveWorkspace } = useWorkspaceAction();
|
|
75
77
|
const { saveSettings, SaveSettingsModal } = useSaveSettings();
|
|
76
78
|
const toaster = useToaster();
|
|
77
79
|
const refForm = useRef(null);
|
|
@@ -96,13 +98,7 @@ function GeneralSettingsModal({ height }) {
|
|
|
96
98
|
closeDialog?.();
|
|
97
99
|
}
|
|
98
100
|
function addWorkSpaceHandler(name) {
|
|
99
|
-
|
|
100
|
-
type: 'ADD_WORKSPACE',
|
|
101
|
-
payload: {
|
|
102
|
-
workspaceKey: name,
|
|
103
|
-
data: refForm.current?.values,
|
|
104
|
-
},
|
|
105
|
-
});
|
|
101
|
+
addNewWorkspace(name, refForm.current?.values);
|
|
106
102
|
}
|
|
107
103
|
async function applyPreferencesHandler() {
|
|
108
104
|
const errors = await refForm.current?.validateForm();
|
|
@@ -120,20 +116,10 @@ function GeneralSettingsModal({ height }) {
|
|
|
120
116
|
}
|
|
121
117
|
}
|
|
122
118
|
function deleteWorkSpaceHandler(key) {
|
|
123
|
-
|
|
124
|
-
type: 'REMOVE_WORKSPACE',
|
|
125
|
-
payload: {
|
|
126
|
-
workspace: key,
|
|
127
|
-
},
|
|
128
|
-
});
|
|
119
|
+
removeWorkspace(key);
|
|
129
120
|
}
|
|
130
121
|
function ChangeWorkspaceHandler(option) {
|
|
131
|
-
|
|
132
|
-
type: 'SET_ACTIVE_WORKSPACE',
|
|
133
|
-
payload: {
|
|
134
|
-
workspace: option.key,
|
|
135
|
-
},
|
|
136
|
-
});
|
|
122
|
+
setActiveWorkspace(option.key);
|
|
137
123
|
}
|
|
138
124
|
function renderItem(item) {
|
|
139
125
|
return (_jsx(WorkspaceItem, { item: item, onSave: addWorkSpaceHandler, onDelete: deleteWorkSpaceHandler }));
|
|
@@ -211,7 +197,7 @@ function GeneralSettingsModal({ height }) {
|
|
|
211
197
|
overflow: auto;
|
|
212
198
|
max-height: 100%;
|
|
213
199
|
}
|
|
214
|
-
`, fill: true, children: [_jsx(Tab, { title: "General", id: "general", panel: _jsx(GeneralTabContent, {}) }), _jsx(Tab, { title: "
|
|
200
|
+
`, fill: true, children: [_jsx(Tab, { title: "General", id: "general", panel: _jsx(GeneralTabContent, {}) }), _jsx(Tab, { title: "Nuclei", id: "nuclei", panel: _jsx(NucleiTabContent, {}) }), _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: () => {
|
|
215
201
|
closeDialog?.();
|
|
216
202
|
} }), _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" })] }));
|
|
217
203
|
}
|
|
@@ -54,7 +54,7 @@ function WorkspaceItem({ item, onSave, onDelete }) {
|
|
|
54
54
|
function onTextChange(e) {
|
|
55
55
|
setName(e.target.value);
|
|
56
56
|
}
|
|
57
|
-
return (_jsx("div", { children: item.key === 'new' ? (_jsxs("div", { style: styles.newContainer, children: [_jsx("input", { style: styles.input, value: name, placeholder: "Custom workspace", onClick: (e) => e.stopPropagation(), onChange: onTextChange }), _jsx(Button.Done, { onClick: addHandler, disabled: !name, style: { fontSize: '11px' }, children: "Save" })] })) : (_jsxs("div", { style: styles.container, children: [_jsx(WorkSpaceIndicator, { source: item.source }), _jsx("span", { style: styles.workspaceName, children: item.label }), item.source !== 'user' && (_jsx("span", { style: styles.readOnly, children: "Read Only" })), item.source === 'user' && onDelete && (_jsx(Button.Danger, { onClick: deleteHandler, size: "xSmall", fill: "clear", children: _jsx(FaTimes, {}) }))
|
|
57
|
+
return (_jsx("div", { children: item.key === 'new' ? (_jsxs("div", { style: styles.newContainer, children: [_jsx("input", { style: styles.input, value: name, placeholder: "Custom workspace", onClick: (e) => e.stopPropagation(), onChange: onTextChange }), _jsx(Button.Done, { onClick: addHandler, disabled: !name, style: { fontSize: '11px' }, children: "Save" })] })) : (_jsxs("div", { style: styles.container, children: [_jsx(WorkSpaceIndicator, { source: item.source }), _jsx("span", { style: styles.workspaceName, children: item.label }), item.source !== 'user' && (_jsx("span", { style: styles.readOnly, children: "Read Only" })), item.source === 'user' && onDelete && (_jsx(Button.Danger, { onClick: deleteHandler, size: "xSmall", fill: "clear", children: _jsx(FaTimes, {}) }))] })) }));
|
|
58
58
|
}
|
|
59
59
|
const style = {
|
|
60
60
|
width: '20px',
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useFormikContext } from 'formik';
|
|
3
|
+
import { useCallback, useMemo } from 'react';
|
|
4
|
+
import { FaPlus, FaTimes } from 'react-icons/fa';
|
|
5
|
+
import Button from '../../../elements/Button';
|
|
6
|
+
import { GroupPane } from '../../../elements/GroupPane';
|
|
7
|
+
import ReactTable from '../../../elements/ReactTable/ReactTable';
|
|
8
|
+
import FormikInput from '../../../elements/formik/FormikInput';
|
|
9
|
+
const styles = {
|
|
10
|
+
input: {
|
|
11
|
+
width: '100%',
|
|
12
|
+
},
|
|
13
|
+
column: {
|
|
14
|
+
padding: '2px',
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
function NucleiTabContent() {
|
|
18
|
+
const { values, setFieldValue } = useFormikContext();
|
|
19
|
+
const fields = values?.nuclei || [];
|
|
20
|
+
const addHandler = useCallback((data, index) => {
|
|
21
|
+
let columns = [];
|
|
22
|
+
const emptyField = {
|
|
23
|
+
nucleus: '',
|
|
24
|
+
ppmFormat: '0.00',
|
|
25
|
+
hzFormat: '0.00',
|
|
26
|
+
};
|
|
27
|
+
if (data && Array.isArray(data)) {
|
|
28
|
+
columns = [...data.slice(0, index), emptyField, ...data.slice(index)];
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
columns.push(emptyField);
|
|
32
|
+
}
|
|
33
|
+
void setFieldValue('nuclei', columns);
|
|
34
|
+
}, [setFieldValue]);
|
|
35
|
+
const deleteHandler = useCallback((data, index) => {
|
|
36
|
+
const _fields = data.filter((_, columnIndex) => columnIndex !== index);
|
|
37
|
+
void setFieldValue('nuclei', _fields);
|
|
38
|
+
}, [setFieldValue]);
|
|
39
|
+
const COLUMNS = useMemo(() => [
|
|
40
|
+
{
|
|
41
|
+
Header: '#',
|
|
42
|
+
style: { width: '25px', ...styles.column },
|
|
43
|
+
accessor: (_, index) => index + 1,
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
Header: 'Nucleus',
|
|
47
|
+
style: { padding: 0, ...styles.column },
|
|
48
|
+
Cell: ({ row }) => {
|
|
49
|
+
return (_jsx(FormikInput, { name: `nuclei.${row.index}.nucleus`, style: { input: styles.input } }));
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
Header: 'δ (ppm)',
|
|
54
|
+
style: { padding: 0, ...styles.column },
|
|
55
|
+
Cell: ({ row }) => {
|
|
56
|
+
return (_jsx(FormikInput, { name: `nuclei.${row.index}.ppmFormat`, style: { input: styles.input } }));
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
Header: 'Coupling (Hz)',
|
|
61
|
+
style: { padding: 0, ...styles.column },
|
|
62
|
+
Cell: ({ row }) => {
|
|
63
|
+
return (_jsx(FormikInput, { name: `nuclei.${row.index}.hzFormat`, style: { input: styles.input } }));
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
Header: 'Axis from',
|
|
68
|
+
style: { padding: 0, ...styles.column },
|
|
69
|
+
Cell: ({ row }) => {
|
|
70
|
+
return (_jsx(FormikInput, { name: `nuclei.${row.index}.axisFrom`, style: { input: styles.input }, type: "number" }));
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
Header: 'Axis to',
|
|
75
|
+
style: { padding: 0, ...styles.column },
|
|
76
|
+
Cell: ({ row }) => {
|
|
77
|
+
return (_jsx(FormikInput, { name: `nuclei.${row.index}.axisTo`, style: { input: styles.input }, type: "number" }));
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
Header: '',
|
|
82
|
+
style: { width: '70px', ...styles.column },
|
|
83
|
+
id: 'add-button',
|
|
84
|
+
Cell: ({ data, row }) => {
|
|
85
|
+
return (_jsxs("div", { style: { display: 'flex', justifyContent: 'space-around' }, children: [_jsx(Button.Done, { fill: "outline", onClick: () => addHandler(data, row.index + 1), children: _jsx(FaPlus, {}) }), _jsx(Button.Danger, { fill: "outline", onClick: () => deleteHandler(data, row.index), children: _jsx(FaTimes, {}) })] }));
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
], [addHandler, deleteHandler]);
|
|
89
|
+
return (_jsx("div", { children: _jsx(GroupPane, { text: "Number formatting for crosshair and info line and axis domain", renderHeader: (text) => {
|
|
90
|
+
return (_jsx(FieldsBlockHeader, { text: text, onAdd: () => addHandler(fields, 0) }));
|
|
91
|
+
}, children: _jsx(ReactTable, { style: {
|
|
92
|
+
'table, table td, table th': { border: 'none' },
|
|
93
|
+
'table thead': { borderBottom: '1px solid #f9f9f9' },
|
|
94
|
+
}, data: fields, columns: COLUMNS, emptyDataRowText: "No Nucleus" }) }) }));
|
|
95
|
+
}
|
|
96
|
+
function FieldsBlockHeader({ onAdd, text }) {
|
|
97
|
+
return (_jsxs("div", { className: "section-header", style: { display: 'flex' }, children: [_jsx("p", { style: { flex: 1 }, children: text }), _jsx(Button.Done, { fill: "outline", size: "xSmall", onClick: onAdd, children: "Add nuclei preferences" })] }));
|
|
98
|
+
}
|
|
99
|
+
export default NucleiTabContent;
|
|
@@ -1,44 +1,40 @@
|
|
|
1
|
-
import { array,
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
.
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
nucleusFrequencies[_key].fields.push(key);
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
nucleusFrequencies[_key] = { value: 1, fields: [key] };
|
|
26
|
-
}
|
|
1
|
+
import { array, object, string, ValidationError, number } from 'yup';
|
|
2
|
+
const nucleiValidation = array()
|
|
3
|
+
.of(object().shape({
|
|
4
|
+
nucleus: string().trim().required('Nucleus is a required field'),
|
|
5
|
+
ppmFormat: string().trim().required('PPM format is a required field'),
|
|
6
|
+
hzFormat: string().trim().required('Hz format is a required field'),
|
|
7
|
+
}))
|
|
8
|
+
.test('Unique', 'Nuclei need te be unique', function check(nuclei) {
|
|
9
|
+
if (!nuclei)
|
|
10
|
+
return true;
|
|
11
|
+
const nucleusFrequencies = {};
|
|
12
|
+
let index = 0;
|
|
13
|
+
for (const nucleiPreferences of nuclei) {
|
|
14
|
+
const key = nucleiPreferences.nucleus?.toLowerCase() || '';
|
|
15
|
+
if (key) {
|
|
16
|
+
if (nucleusFrequencies[key]) {
|
|
17
|
+
++nucleusFrequencies[key].value;
|
|
18
|
+
nucleusFrequencies[key].fieldsIndexes.push(index);
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
nucleusFrequencies[key] = { value: 1, fieldsIndexes: [index] };
|
|
27
22
|
}
|
|
28
23
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
24
|
+
index++;
|
|
25
|
+
}
|
|
26
|
+
const errors = [];
|
|
27
|
+
for (const key in nucleusFrequencies) {
|
|
28
|
+
const { value, fieldsIndexes } = nucleusFrequencies[key];
|
|
29
|
+
if (value > 1) {
|
|
30
|
+
for (const index of fieldsIndexes) {
|
|
31
|
+
errors.push(new ValidationError(`${key} nucleus must te be unique`, nuclei[index].nucleus,
|
|
32
|
+
// eslint-disable-next-line no-invalid-this
|
|
33
|
+
`${this.path}.${index}.name`));
|
|
38
34
|
}
|
|
39
35
|
}
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
}
|
|
37
|
+
return new ValidationError(errors);
|
|
42
38
|
});
|
|
43
39
|
const databasesValidation = object().shape({
|
|
44
40
|
data: array().of(object().shape({
|
|
@@ -65,10 +61,10 @@ const spectraColorsSchemaValidation = object({
|
|
|
65
61
|
const generalValidation = object({
|
|
66
62
|
dimmedSpectraOpacity: number().required(),
|
|
67
63
|
});
|
|
68
|
-
export const validation =
|
|
69
|
-
|
|
64
|
+
export const validation = object().shape({
|
|
65
|
+
nuclei: nucleiValidation,
|
|
70
66
|
databases: databasesValidation,
|
|
71
67
|
infoBlock: infoBlockValidation,
|
|
72
68
|
general: generalValidation,
|
|
73
69
|
spectraColors: spectraColorsSchemaValidation,
|
|
74
|
-
})
|
|
70
|
+
});
|
|
@@ -4,6 +4,7 @@ import { useImperativeHandle, useRef, memo, forwardRef, useCallback, useMemo, }
|
|
|
4
4
|
import * as Yup from 'yup';
|
|
5
5
|
import { useChartData } from '../../context/ChartContext';
|
|
6
6
|
import { usePreferences } from '../../context/PreferencesContext';
|
|
7
|
+
import { GroupPane } from '../../elements/GroupPane';
|
|
7
8
|
import { Scroller } from '../../elements/Scroller';
|
|
8
9
|
import useNucleus from '../../hooks/useNucleus';
|
|
9
10
|
import { usePanelPreferencesByNuclei } from '../../hooks/usePanelPreferences';
|
|
@@ -12,6 +13,17 @@ import { getSpectraObjectPaths } from '../../utility/getSpectraObjectPaths';
|
|
|
12
13
|
import { NucleusGroup } from '../extra/preferences/NucleusGroup';
|
|
13
14
|
import { PreferencesContainer } from '../extra/preferences/PreferencesContainer';
|
|
14
15
|
import { SpectraColumnsManager } from './base/SpectraColumnsManager';
|
|
16
|
+
const groupPaneStyle = {
|
|
17
|
+
header: {
|
|
18
|
+
color: 'black',
|
|
19
|
+
fontSize: '12px',
|
|
20
|
+
padding: '5px',
|
|
21
|
+
backgroundColor: '#f8f8f8',
|
|
22
|
+
},
|
|
23
|
+
container: {
|
|
24
|
+
paddingBottom: '10px',
|
|
25
|
+
},
|
|
26
|
+
};
|
|
15
27
|
function validationColumns(obj) {
|
|
16
28
|
const validationObject = {};
|
|
17
29
|
for (const key of Object.keys(obj.nuclei)) {
|
|
@@ -102,6 +114,6 @@ function SpectraPreferences(props, ref) {
|
|
|
102
114
|
return key || ' ';
|
|
103
115
|
}, [paths]);
|
|
104
116
|
const mapValue = useCallback((value) => convertPathArrayToString(value), []);
|
|
105
|
-
return (_jsx(PreferencesContainer, { children: _jsx(Formik, { innerRef: formRef, onSubmit: saveHandler, initialValues: preferencesByNuclei, validationSchema: spectraPreferencesValidation, children: _jsx(Scroller, { scrollTo: activeTab, children: nuclei?.map((n) => (_jsx(Scroller.Item, { elementKey: n, children: _jsx(NucleusGroup, { nucleus: n, children: _jsx(SpectraColumnsManager, { nucleus: n, onAdd: handleAdd, onDelete: handleDelete, mapOnChangeValue: mapOnChangeValueHandler, mapValue: mapValue, datalist: datalist }) }) }, n))) }) }) }));
|
|
117
|
+
return (_jsx(PreferencesContainer, { children: _jsx(Formik, { innerRef: formRef, onSubmit: saveHandler, initialValues: preferencesByNuclei, validationSchema: spectraPreferencesValidation, children: _jsx(Scroller, { scrollTo: activeTab, children: nuclei?.map((n) => (_jsx(Scroller.Item, { elementKey: n, children: _jsx(NucleusGroup, { nucleus: n, children: _jsx(GroupPane, { text: "General", style: groupPaneStyle, children: _jsx(SpectraColumnsManager, { nucleus: n, onAdd: handleAdd, onDelete: handleDelete, mapOnChangeValue: mapOnChangeValueHandler, mapValue: mapValue, datalist: datalist }) }) }) }, n))) }) }) }));
|
|
106
118
|
}
|
|
107
119
|
export default memo(forwardRef(SpectraPreferences));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Axis, Heading, Legend, LineSeries, Plot, } from 'react-plot';
|
|
3
3
|
export default function PlotChart({ data, sign, color, yLogBase, hideHeading = false, }) {
|
|
4
|
-
return (_jsxs(Plot, { width: 180, height: 220, children: [!hideHeading && _jsx(Heading, { title: "
|
|
4
|
+
return (_jsxs(Plot, { width: 180, height: 220, children: [!hideHeading && _jsx(Heading, { title: "SAN plot" }), _jsx(LineSeries, { data: data.sanPlot?.[sign] || [], xAxis: "x", yAxis: "y", label: sign, lineStyle: {
|
|
5
5
|
stroke: color,
|
|
6
6
|
strokeWidth: 1.2,
|
|
7
7
|
}, markerStyle: {
|
|
@@ -7,7 +7,7 @@ function Spectrum2DHistogram({ color = 'red', data, }) {
|
|
|
7
7
|
const processedData = useMemo(() => {
|
|
8
8
|
return processSnapPlot('2D', data.rr, yLogBase);
|
|
9
9
|
}, [data]);
|
|
10
|
-
return (_jsxs("div", { children: [_jsx("div", { style: { textAlign: 'center', paddingBottom: 5, paddingTop: 5 }, children: "
|
|
10
|
+
return (_jsxs("div", { children: [_jsx("div", { style: { textAlign: 'center', paddingBottom: 5, paddingTop: 5 }, children: "SAN plot" }), _jsxs("div", { style: {
|
|
11
11
|
borderTop: '1px solid #ededed',
|
|
12
12
|
marginTop: '10px',
|
|
13
13
|
paddingTop: '10px',
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ZoneData } from '../hooks/useMapZones';
|
|
2
|
+
interface ZoneAssignmentLabelColumnProps {
|
|
3
|
+
rowData: ZoneData;
|
|
4
|
+
}
|
|
5
|
+
export declare function ZoneAssignmentLabelColumn({ rowData, }: ZoneAssignmentLabelColumnProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
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 ZoneAssignmentLabelColumn({ rowData, }) {
|
|
5
|
+
const dispatch = useDispatch();
|
|
6
|
+
function saveHandler(event) {
|
|
7
|
+
dispatch({
|
|
8
|
+
type: 'CHANGE_ZONE_ASSIGNMENT_LABEL',
|
|
9
|
+
payload: {
|
|
10
|
+
value: event.target.value,
|
|
11
|
+
zoneID: rowData.id,
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
return (_jsx("td", { children: _jsx(EditableColumn, { value: rowData?.assignment || '', onSave: saveHandler, style: { padding: '0.1rem 0.4rem' } }) }));
|
|
16
|
+
}
|
|
@@ -3,18 +3,20 @@ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
4
|
import { useState, useMemo, useCallback, useRef, memo } from 'react';
|
|
5
5
|
import { FaUnlink } from 'react-icons/fa';
|
|
6
|
+
import { LuSubtitles } from 'react-icons/lu';
|
|
6
7
|
import { useAssignmentData } from '../../assignment/AssignmentsContext';
|
|
7
8
|
import { useChartData } from '../../context/ChartContext';
|
|
8
9
|
import { useDispatch } from '../../context/DispatchContext';
|
|
9
10
|
import { useModal } from '../../elements/popup/Modal';
|
|
10
11
|
import { useActiveSpectrumZonesViewState } from '../../hooks/useActiveSpectrumZonesViewState';
|
|
11
12
|
import useSpectrum from '../../hooks/useSpectrum';
|
|
13
|
+
import { booleanToString } from '../../utility/booleanToString';
|
|
12
14
|
import { tablePanelStyle } from '../extra/BasicPanelStyle';
|
|
13
15
|
import DefaultPanelHeader from '../header/DefaultPanelHeader';
|
|
14
16
|
import PreferencesHeader from '../header/PreferencesHeader';
|
|
15
17
|
import ZonesPreferences from './ZonesPreferences';
|
|
16
18
|
import ZonesTable from './ZonesTable';
|
|
17
|
-
function ZonesPanelInner({ zones, activeTab, xDomain, yDomain, info, showZones, showSignals, showPeaks, }) {
|
|
19
|
+
function ZonesPanelInner({ zones, activeTab, xDomain, yDomain, info, showZones, showSignals, showPeaks, showAssignmentsLabels, }) {
|
|
18
20
|
const [filterIsActive, setFilterIsActive] = useState(false);
|
|
19
21
|
const assignmentData = useAssignmentData();
|
|
20
22
|
const dispatch = useDispatch();
|
|
@@ -115,7 +117,14 @@ function ZonesPanelInner({ zones, activeTab, xDomain, yDomain, info, showZones,
|
|
|
115
117
|
payload: { key: 'showPeaks' },
|
|
116
118
|
});
|
|
117
119
|
};
|
|
120
|
+
function handleShowAssignmentsLabel() {
|
|
121
|
+
dispatch({
|
|
122
|
+
type: 'TOGGLE_ZONES_VIEW_PROPERTY',
|
|
123
|
+
payload: { key: 'showAssignmentsLabels' },
|
|
124
|
+
});
|
|
125
|
+
}
|
|
118
126
|
const total = zones?.values?.length || 0;
|
|
127
|
+
const hasZones = zones?.values && zones.values.length > 0;
|
|
119
128
|
return (_jsxs("div", { css: [
|
|
120
129
|
tablePanelStyle,
|
|
121
130
|
isFlipped &&
|
|
@@ -126,7 +135,7 @@ function ZonesPanelInner({ zones, activeTab, xDomain, yDomain, info, showZones,
|
|
|
126
135
|
`,
|
|
127
136
|
], children: [!isFlipped && (_jsx(DefaultPanelHeader, { total: total, counter: tableData?.length, onDelete: handleDeleteAll, deleteToolTip: "Delete All Zones", onFilter: handleOnFilter, filterToolTip: filterIsActive ? 'Show all zones' : 'Hide zones out of view', onSettingClick: settingsPanelHandler, leftButtons: [
|
|
128
137
|
{
|
|
129
|
-
disabled: !
|
|
138
|
+
disabled: !hasZones,
|
|
130
139
|
icon: _jsx(FaUnlink, {}),
|
|
131
140
|
tooltip: 'Remove all assignments',
|
|
132
141
|
onClick: handleOnRemoveAssignments,
|
|
@@ -149,6 +158,13 @@ function ZonesPanelInner({ zones, activeTab, xDomain, yDomain, info, showZones,
|
|
|
149
158
|
active: showPeaks,
|
|
150
159
|
onClick: handleSetShowPeaks,
|
|
151
160
|
},
|
|
161
|
+
{
|
|
162
|
+
disabled: !hasZones,
|
|
163
|
+
icon: _jsx(LuSubtitles, {}),
|
|
164
|
+
tooltip: `${booleanToString(!showAssignmentsLabels)} assignments labels`,
|
|
165
|
+
onClick: handleShowAssignmentsLabel,
|
|
166
|
+
active: showAssignmentsLabels,
|
|
167
|
+
},
|
|
152
168
|
] })), isFlipped && (_jsx(PreferencesHeader, { onSave: saveSettingHandler, onClose: settingsPanelHandler })), _jsx("div", { className: "inner-container", children: !isFlipped ? (_jsx("div", { className: "table-container", children: _jsx(ZonesTable, { tableData: tableData, onUnlink: unlinkZoneHandler, nucleus: activeTab, info: info }) })) : (_jsx(ZonesPreferences, { ref: settingRef })) })] }));
|
|
153
169
|
}
|
|
154
170
|
const MemoizedZonesPanel = memo(ZonesPanelInner);
|
|
@@ -19,36 +19,42 @@ const preferences1DFields = [
|
|
|
19
19
|
const preferences2DFields = [
|
|
20
20
|
{
|
|
21
21
|
id: 1,
|
|
22
|
-
label: 'Serial number
|
|
22
|
+
label: 'Serial number:',
|
|
23
23
|
checkControllerName: 'showSerialNumber',
|
|
24
24
|
hideFormatField: true,
|
|
25
25
|
},
|
|
26
26
|
{
|
|
27
27
|
id: 2,
|
|
28
|
-
label: '
|
|
29
|
-
checkControllerName: '
|
|
28
|
+
label: 'Assignment label:',
|
|
29
|
+
checkControllerName: 'showAssignmentLabel',
|
|
30
30
|
hideFormatField: true,
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
33
|
id: 3,
|
|
34
|
-
label: '
|
|
35
|
-
checkControllerName: '
|
|
34
|
+
label: 'Kind:',
|
|
35
|
+
checkControllerName: 'showKind',
|
|
36
36
|
hideFormatField: true,
|
|
37
37
|
},
|
|
38
38
|
{
|
|
39
39
|
id: 4,
|
|
40
|
-
label: '
|
|
41
|
-
checkControllerName: '
|
|
40
|
+
label: 'Assignment links:',
|
|
41
|
+
checkControllerName: 'showAssignment',
|
|
42
42
|
hideFormatField: true,
|
|
43
43
|
},
|
|
44
44
|
{
|
|
45
45
|
id: 5,
|
|
46
|
-
label: '
|
|
47
|
-
checkControllerName: '
|
|
46
|
+
label: 'Delete action:',
|
|
47
|
+
checkControllerName: 'showDeleteAction',
|
|
48
48
|
hideFormatField: true,
|
|
49
49
|
},
|
|
50
50
|
{
|
|
51
51
|
id: 6,
|
|
52
|
+
label: 'Zoom action:',
|
|
53
|
+
checkControllerName: 'showZoomAction',
|
|
54
|
+
hideFormatField: true,
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
id: 7,
|
|
52
58
|
label: 'Edit action :',
|
|
53
59
|
checkControllerName: 'showEditAction',
|
|
54
60
|
hideFormatField: true,
|
|
@@ -67,7 +67,7 @@ function ZonesTable({ tableData, onUnlink, nucleus, info }) {
|
|
|
67
67
|
const { items: sortedData, isSortedDesc, onSort } = useTableSortBy(data);
|
|
68
68
|
const { deltaPPM: deltaX } = usePanelPreferences('zones', nuclei?.[0]);
|
|
69
69
|
const { deltaPPM: deltaY } = usePanelPreferences('zones', nuclei?.[1]);
|
|
70
|
-
const { showSerialNumber, showAssignment, showKind, showDeleteAction, showEditAction, showZoomAction, } = usePanelPreferences('zones', nucleus);
|
|
70
|
+
const { showSerialNumber, showAssignment, showKind, showDeleteAction, showEditAction, showZoomAction, showAssignmentLabel, } = usePanelPreferences('zones', nucleus);
|
|
71
71
|
const showActions = showDeleteAction || showEditAction || showZoomAction;
|
|
72
72
|
if (isFid) {
|
|
73
73
|
return _jsx(NoDataForFid, {});
|
|
@@ -75,7 +75,7 @@ function ZonesTable({ tableData, onUnlink, nucleus, info }) {
|
|
|
75
75
|
if (!tableData || tableData.length === 0) {
|
|
76
76
|
return _jsx(NoTableData, {});
|
|
77
77
|
}
|
|
78
|
-
return (_jsx("div", { children: _jsxs("table", { css: tableStyle, children: [_jsxs("thead", { children: [_jsxs("tr", { children: [showSerialNumber && _jsx("th", { rowSpan: 2, children: "#" }), (deltaX.show || deltaX.show) && _jsx("th", { colSpan: 2, children: "\u03B4 (ppm)" }), showAssignment && (_jsxs(_Fragment, { children: [_jsx("th", { colSpan: 2, children: _jsx(FaLink, {}) }), _jsx("th", { colSpan: 2, children: "\u03A3" })] })), showKind && _jsx("th", { rowSpan: 2, children: "Kind" }), showActions && _jsx("th", { rowSpan: 2, children: '' })] }), _jsxs("tr", { children: [deltaX.show && (_jsx("th", { id: "tableMetaInfo.signal.x.delta", ...onSort, children: _jsxs(SurroundedText, { text: "F2", children: [nuclei[0], ' ', isSortedDesc('tableMetaInfo.signal.x.delta').content] }) })), deltaY.show && (_jsx("th", { id: "tableMetaInfo.signal.y.delta", ...onSort, children: _jsxs(SurroundedText, { text: "F1", children: [nuclei[1], ' ', isSortedDesc('tableMetaInfo.signal.y.delta').content] }) })), showAssignment && (_jsxs(_Fragment, { children: [_jsx("th", { children: _jsx(SurroundedText, { text: "F2", children: nuclei[0] }) }), _jsx("th", { children: _jsx(SurroundedText, { text: "F1", children: nuclei[1] }) }), _jsx("th", { children: _jsx(SurroundedText, { text: "F2", children: nuclei[0] }) }), _jsx("th", { children: _jsx(SurroundedText, { text: "F1", children: nuclei[1] }) })] }))] })] }), _jsx("tbody", { children: sortedData.map((rowData, index) => (_jsx(ZonesTableRow, { rowIndex: index, rowData: rowData, onUnlink: onUnlink, nucleus: nucleus }, `${rowData.tableMetaInfo.id}`))) })] }) }));
|
|
78
|
+
return (_jsx("div", { children: _jsxs("table", { css: tableStyle, children: [_jsxs("thead", { children: [_jsxs("tr", { children: [showSerialNumber && _jsx("th", { rowSpan: 2, children: "#" }), showAssignmentLabel && _jsx("th", { rowSpan: 2, children: "Assignment" }), (deltaX.show || deltaX.show) && _jsx("th", { colSpan: 2, children: "\u03B4 (ppm)" }), showAssignment && (_jsxs(_Fragment, { children: [_jsx("th", { colSpan: 2, children: _jsx(FaLink, {}) }), _jsx("th", { colSpan: 2, children: "\u03A3" })] })), showKind && _jsx("th", { rowSpan: 2, children: "Kind" }), showActions && _jsx("th", { rowSpan: 2, children: '' })] }), _jsxs("tr", { children: [deltaX.show && (_jsx("th", { id: "tableMetaInfo.signal.x.delta", ...onSort, children: _jsxs(SurroundedText, { text: "F2", children: [nuclei[0], ' ', isSortedDesc('tableMetaInfo.signal.x.delta').content] }) })), deltaY.show && (_jsx("th", { id: "tableMetaInfo.signal.y.delta", ...onSort, children: _jsxs(SurroundedText, { text: "F1", children: [nuclei[1], ' ', isSortedDesc('tableMetaInfo.signal.y.delta').content] }) })), showAssignment && (_jsxs(_Fragment, { children: [_jsx("th", { children: _jsx(SurroundedText, { text: "F2", children: nuclei[0] }) }), _jsx("th", { children: _jsx(SurroundedText, { text: "F1", children: nuclei[1] }) }), _jsx("th", { children: _jsx(SurroundedText, { text: "F2", children: nuclei[0] }) }), _jsx("th", { children: _jsx(SurroundedText, { text: "F1", children: nuclei[1] }) })] }))] })] }), _jsx("tbody", { children: sortedData.map((rowData, index) => (_jsx(ZonesTableRow, { rowIndex: index, rowData: rowData, onUnlink: onUnlink, nucleus: nucleus }, `${rowData.tableMetaInfo.id}`))) })] }) }));
|
|
79
79
|
}
|
|
80
80
|
function SurroundedText(props) {
|
|
81
81
|
return (_jsxs(_Fragment, { children: [_jsx("div", { style: {
|
|
@@ -10,6 +10,7 @@ import { usePanelPreferences } from '../../hooks/usePanelPreferences';
|
|
|
10
10
|
import ActionsColumn from './TableColumns/ActionsColumn';
|
|
11
11
|
import SignalAssignmentsColumns from './TableColumns/SignalAssignmentsColumns';
|
|
12
12
|
import SignalDeltaColumn from './TableColumns/SignalDeltaColumn';
|
|
13
|
+
import { ZoneAssignmentLabelColumn } from './TableColumns/ZoneAssignmentLabelColumn';
|
|
13
14
|
import ZoneAssignmentsColumns from './TableColumns/ZoneAssignmentsColumns';
|
|
14
15
|
const HighlightedRowStyle = { backgroundColor: '#ff6f0057' };
|
|
15
16
|
const ConstantlyHighlightedRowStyle = { backgroundColor: '#f5f5dc' };
|
|
@@ -21,7 +22,7 @@ function ZonesTableRow({ rowData, onUnlink, contextMenu = [], onContextMenuSelec
|
|
|
21
22
|
const assignmentSignal = useAssignment(rowData.tableMetaInfo.id);
|
|
22
23
|
const highlightSignalX = useHighlight([buildID(assignmentSignal.id, 'X')].concat(assignmentSignal.assigned?.x || [], buildID(assignmentSignal.id, 'Crosshair')));
|
|
23
24
|
const highlightSignalY = useHighlight([buildID(assignmentSignal.id, 'Y')].concat(assignmentSignal.assigned?.y || [], buildID(assignmentSignal.id, 'Crosshair')));
|
|
24
|
-
const { showSerialNumber, showAssignment, showKind, showDeleteAction, showEditAction, showZoomAction, } = usePanelPreferences('zones', nucleus);
|
|
25
|
+
const { showSerialNumber, showAssignment, showKind, showDeleteAction, showEditAction, showZoomAction, showAssignmentLabel, } = usePanelPreferences('zones', nucleus);
|
|
25
26
|
const rowSpanTags = useMemo(() => {
|
|
26
27
|
return {
|
|
27
28
|
rowSpan: rowData.tableMetaInfo.rowSpan,
|
|
@@ -119,6 +120,6 @@ function ZonesTableRow({ rowData, onUnlink, contextMenu = [], onContextMenuSelec
|
|
|
119
120
|
? HighlightedRowStyle
|
|
120
121
|
: lodashGet(rowData, 'tableMetaInfo.isConstantlyHighlighted', false)
|
|
121
122
|
? ConstantlyHighlightedRowStyle
|
|
122
|
-
: null, ...highlightZone.onHover, children: [showSerialNumber && _jsx("td", { ...rowSpanTags, children: rowIndex + 1 }), _jsx(SignalDeltaColumn, { rowData: rowData, onHoverSignalX: onHoverSignalX, onHoverSignalY: onHoverSignalY, nucleus: nucleus }), showAssignment && (_jsxs(_Fragment, { children: [_jsx(SignalAssignmentsColumns, { rowData: rowData, assignmentSignal: assignmentSignal, onHoverSignalX: onHoverSignalX, onHoverSignalY: onHoverSignalY, onClick: clickHandler, onUnlink: unlinkHandler, highlightSignalX: highlightSignalX, highlightSignalY: highlightSignalY }), _jsx(ZoneAssignmentsColumns, { rowData: rowData, assignmentZone: assignmentZone, onHoverZoneX: onHoverZoneX, onHoverZoneY: onHoverZoneY, rowSpanTags: rowSpanTags, onClick: clickHandler, onUnlink: unlinkHandler, highlightZoneX: highlightZoneX, highlightZoneY: highlightZoneY })] })), _jsx(ActionsColumn, { rowData: rowData, rowSpanTags: rowSpanTags, showKind, showDeleteAction, showEditAction, showZoomAction })] }));
|
|
123
|
+
: null, ...highlightZone.onHover, children: [showSerialNumber && _jsx("td", { ...rowSpanTags, children: rowIndex + 1 }), showAssignmentLabel && _jsx(ZoneAssignmentLabelColumn, { rowData: rowData }), _jsx(SignalDeltaColumn, { rowData: rowData, onHoverSignalX: onHoverSignalX, onHoverSignalY: onHoverSignalY, nucleus: nucleus }), showAssignment && (_jsxs(_Fragment, { children: [_jsx(SignalAssignmentsColumns, { rowData: rowData, assignmentSignal: assignmentSignal, onHoverSignalX: onHoverSignalX, onHoverSignalY: onHoverSignalY, onClick: clickHandler, onUnlink: unlinkHandler, highlightSignalX: highlightSignalX, highlightSignalY: highlightSignalY }), _jsx(ZoneAssignmentsColumns, { rowData: rowData, assignmentZone: assignmentZone, onHoverZoneX: onHoverZoneX, onHoverZoneY: onHoverZoneY, rowSpanTags: rowSpanTags, onClick: clickHandler, onUnlink: unlinkHandler, highlightZoneX: highlightZoneX, highlightZoneY: highlightZoneY })] })), _jsx(ActionsColumn, { rowData: rowData, rowSpanTags: rowSpanTags, showKind, showDeleteAction, showEditAction, showZoomAction })] }));
|
|
123
124
|
}
|
|
124
125
|
export default ZonesTableRow;
|
|
@@ -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: "
|
|
60
|
+
}, children: _jsx(Label, { title: "Sort spectra when sorting columns", children: _jsx(FormikCheckBox, { name: "analysisOptions.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: {
|
|
@@ -180,6 +180,8 @@ function innerSpectrumReducer(draft, action) {
|
|
|
180
180
|
return IntegralsActions.handleCutIntegral(draft, action);
|
|
181
181
|
case 'TOGGLE_INTEGRALS_VIEW_PROPERTY':
|
|
182
182
|
return IntegralsActions.handleToggleIntegralsViewProperty(draft, action);
|
|
183
|
+
case 'SET_AXIS_DOMAIN':
|
|
184
|
+
return DomainActions.handleSetAxisDomain(draft, action);
|
|
183
185
|
case 'SET_X_DOMAIN':
|
|
184
186
|
return DomainActions.handleSetXDomain(draft, action);
|
|
185
187
|
case 'SET_Y_DOMAIN':
|
|
@@ -402,6 +404,10 @@ function innerSpectrumReducer(draft, action) {
|
|
|
402
404
|
return ZonesActions.handleToggleZonesViewProperty(draft, action);
|
|
403
405
|
case 'SAVE_EDITED_ZONE':
|
|
404
406
|
return ZonesActions.handleSaveEditedZone(draft, action);
|
|
407
|
+
case 'CHANGE_ZONE_ASSIGNMENT_LABEL':
|
|
408
|
+
return ZonesActions.handleChangeZoneAssignmentLabel(draft, action);
|
|
409
|
+
case 'SET_ZONE_ASSIGNMENT_LABEL_COORDINATION':
|
|
410
|
+
return ZonesActions.handleSetZoneAssignmentLabelCoordination(draft, action);
|
|
405
411
|
case 'ORDER_MULTIPLE_SPECTRA_ANALYSIS':
|
|
406
412
|
return SpectraAnalysisActions.handleOrderSpectra(draft, action);
|
|
407
413
|
case 'RESURRECTING_SPECTRUM_FROM_RANGES':
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { Draft } from 'immer';
|
|
2
|
+
import { NucleiPreferences } from 'nmr-load-save';
|
|
2
3
|
import { State } from '../Reducer';
|
|
3
4
|
import { ActionType } from '../types/ActionType';
|
|
5
|
+
type SetAxisDomainAction = ActionType<'SET_AXIS_DOMAIN', {
|
|
6
|
+
nucleiPreferences: NucleiPreferences[];
|
|
7
|
+
}>;
|
|
4
8
|
type SetXDomainAction = ActionType<'SET_X_DOMAIN', {
|
|
5
9
|
xDomain: [number, number];
|
|
6
10
|
}>;
|
|
@@ -11,7 +15,7 @@ type MoveXAxisAction = ActionType<'MOVE', {
|
|
|
11
15
|
shiftX: number;
|
|
12
16
|
shiftY: number;
|
|
13
17
|
}>;
|
|
14
|
-
export type DomainActions = SetXDomainAction | SetYDomainAction | MoveXAxisAction;
|
|
18
|
+
export type DomainActions = SetXDomainAction | SetYDomainAction | SetAxisDomainAction | MoveXAxisAction;
|
|
15
19
|
declare function getDomain(draft: Draft<State>): {
|
|
16
20
|
xDomain: [number, number] | never[] | [undefined, undefined];
|
|
17
21
|
yDomain: [number, number] | never[] | [undefined, undefined];
|
|
@@ -27,5 +31,6 @@ declare function setDomain(draft: Draft<State>, options?: SetDomainOptions): voi
|
|
|
27
31
|
declare function setMode(draft: Draft<State>): void;
|
|
28
32
|
declare function handleSetXDomain(draft: Draft<State>, action: SetXDomainAction): void;
|
|
29
33
|
declare function handleSetYDomain(draft: Draft<State>, action: SetYDomainAction): void;
|
|
34
|
+
declare function handleSetAxisDomain(draft: Draft<State>, action: SetAxisDomainAction): void;
|
|
30
35
|
declare function handleMoveOverXAxis(draft: Draft<State>, action: MoveXAxisAction): void;
|
|
31
|
-
export { getDomain, setDomain, setMode, handleSetXDomain, handleSetYDomain, handleMoveOverXAxis, };
|
|
36
|
+
export { getDomain, setDomain, setMode, handleSetXDomain, handleSetYDomain, handleMoveOverXAxis, handleSetAxisDomain, };
|