nmrium 0.57.1 → 0.59.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/integral/IntegralResizable.js +2 -2
- package/lib/component/1d/matrix/useMatrix.d.ts +1 -1
- package/lib/component/1d/multiAnalysis/AnalysisRange.js +1 -1
- package/lib/component/1d/ranges/Atoms.js +6 -4
- package/lib/component/1d-2d/components/SpectrumInfoBlock.d.ts +1 -1
- package/lib/component/1d-2d/components/SpectrumInfoBlock.js +114 -7
- package/lib/component/2d/Viewer2D.js +6 -2
- package/lib/component/2d/zones/Zone.js +2 -2
- package/lib/component/EventsTrackers/KeysListenerTracker.js +8 -8
- package/lib/component/context/ChartContext.js +12 -1
- package/lib/component/context/ShareDataContext.d.ts +1 -1
- package/lib/component/context/ShareDataContext.js +2 -4
- package/lib/component/context/ToasterContext.d.ts +1 -0
- package/lib/component/context/ToasterContext.js +12 -3
- package/lib/component/elements/ActionsButtonsPopover.d.ts +7 -1
- package/lib/component/elements/ActionsButtonsPopover.js +7 -6
- package/lib/component/elements/Alert.d.ts +20 -0
- package/lib/component/elements/Alert.js +80 -0
- package/lib/component/elements/ContextMenuBluePrint.d.ts +7 -2
- package/lib/component/elements/ContextMenuBluePrint.js +9 -3
- package/lib/component/elements/Input2.js +2 -2
- package/lib/component/elements/Input2Controller.d.ts +4 -2
- package/lib/component/elements/Input2Controller.js +22 -6
- package/lib/component/elements/MoleculeSelection.js +2 -2
- package/lib/component/elements/NextPrev.d.ts +4 -5
- package/lib/component/elements/NextPrev.js +76 -79
- package/lib/component/elements/ReactTable/Elements/ReactTableRow.js +1 -1
- package/lib/component/elements/ReactTable/ReactTableFlexLayout.d.ts +0 -3
- package/lib/component/elements/ReactTable/ReactTableFlexLayout.js +1 -1
- package/lib/component/elements/Select2.d.ts +12 -7
- package/lib/component/elements/Select2.js +5 -4
- package/lib/component/elements/Select2Controller.d.ts +2 -2
- package/lib/component/elements/Select2Controller.js +5 -5
- package/lib/component/elements/ToolbarPopoverItem.d.ts +7 -6
- package/lib/component/elements/ToolbarPopoverItem.js +13 -5
- package/lib/component/elements/print/PrintContent.d.ts +17 -0
- package/lib/component/elements/print/PrintContent.js +281 -0
- package/lib/component/elements/print/PrintProvider.d.ts +12 -0
- package/lib/component/elements/print/PrintProvider.js +28 -0
- package/lib/component/elements/print/index.d.ts +2 -0
- package/lib/component/elements/print/index.js +2 -0
- package/lib/component/header/ApodizationOptionsPanel.js +14 -7
- package/lib/component/header/BaseLineCorrectionPanel.js +20 -10
- package/lib/component/header/ZeroFillingOptionsPanel.js +17 -10
- package/lib/component/hooks/useSaveSettings.js +43 -26
- package/lib/component/hooks/useToggleSpectraVisibility.d.ts +14 -9
- package/lib/component/hooks/useToggleSpectraVisibility.js +45 -16
- package/lib/component/hooks/useWorkspaceAction.js +12 -14
- package/lib/component/loader/DropZone.js +3 -67
- package/lib/component/loader/useLoadFiles.d.ts +1 -0
- package/lib/component/loader/useLoadFiles.js +78 -0
- package/lib/component/main/InnerNMRium.d.ts +4 -3
- package/lib/component/main/InnerNMRium.js +4 -9
- package/lib/component/main/InnerNMRiumContents.d.ts +3 -2
- package/lib/component/main/InnerNMRiumContents.js +33 -29
- package/lib/component/main/NMRium.d.ts +2 -5
- package/lib/component/main/NMRium.js +1 -1
- package/lib/component/main/NMRiumRefAPI.d.ts +7 -0
- package/lib/component/main/NMRiumRefAPI.js +12 -0
- package/lib/component/main/NMRiumViewer.d.ts +10 -0
- package/lib/component/main/NMRiumViewer.js +35 -0
- package/lib/component/main/index.d.ts +1 -0
- package/lib/component/modal/CopyClipboardModal.d.ts +3 -2
- package/lib/component/modal/CopyClipboardModal.js +18 -32
- package/lib/component/modal/ExportAsJcampModal.d.ts +6 -3
- package/lib/component/modal/ExportAsJcampModal.js +69 -35
- package/lib/component/modal/ImportPublicationStringModal.js +1 -1
- package/lib/component/modal/LoadJCAMPModal.d.ts +3 -1
- package/lib/component/modal/LoadJCAMPModal.js +17 -18
- package/lib/component/modal/SaveAsModal.d.ts +3 -1
- package/lib/component/modal/SaveAsModal.js +20 -30
- package/lib/component/modal/changeSum/ChangeSumModal.js +1 -1
- package/lib/component/modal/changeSum/ChangeSumModalContents.js +35 -47
- package/lib/component/modal/changeSum/SelectMolecule.d.ts +2 -5
- package/lib/component/modal/changeSum/SelectMolecule.js +9 -8
- package/lib/component/modal/setting/GeneralSettings.js +4 -2
- package/lib/component/modal/setting/settings-tabs/ExternalAPIsTabContent.d.ts +1 -0
- package/lib/component/modal/setting/settings-tabs/ExternalAPIsTabContent.js +89 -0
- package/lib/component/modal/setting/settingsValidation.js +15 -1
- package/lib/component/panels/IntegralsPanel/IntegralPanel.js +8 -5
- package/lib/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +5 -1
- package/lib/component/panels/MoleculesPanel/MoleculePanel.js +5 -3
- package/lib/component/panels/Panels.js +15 -15
- package/lib/component/panels/PeaksPanel/PeaksPanel.js +8 -5
- package/lib/component/panels/RangesPanel/RangesHeader.js +52 -12
- package/lib/component/panels/SpectraPanel/SpectraPanelHeader.js +13 -6
- package/lib/component/panels/SpectraPanel/SpectraTable.js +63 -21
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnHeader.js +6 -2
- package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +6 -2
- package/lib/component/panels/SummaryPanel/SummaryPanel.js +4 -0
- package/lib/component/panels/ZonesPanel/ZonesPanel.js +16 -8
- package/lib/component/panels/databasePanel/DatabasePanel.js +7 -8
- package/lib/component/panels/filtersPanel/FilterPanel.js +9 -6
- package/lib/component/panels/filtersPanel/FiltersTable.js +12 -10
- package/lib/component/panels/header/DefaultPanelHeader.d.ts +1 -0
- package/lib/component/panels/header/DefaultPanelHeader.js +2 -2
- package/lib/component/panels/multipleAnalysisPanel/AlignSpectra.js +10 -12
- package/lib/component/panels/predictionPanel/PredictionPanel.js +2 -2
- package/lib/component/reducer/IgnoreActions.js +1 -0
- package/lib/component/reducer/Reducer.js +2 -4
- package/lib/component/reducer/actions/DatabaseActions.d.ts +15 -13
- package/lib/component/reducer/actions/DatabaseActions.js +52 -34
- package/lib/component/reducer/actions/DomainActions.d.ts +2 -2
- package/lib/component/reducer/actions/FiltersActions.js +9 -4
- package/lib/component/reducer/actions/SpectraActions.d.ts +2 -1
- package/lib/component/reducer/actions/SpectraActions.js +53 -43
- package/lib/component/reducer/helper/removeSpectrumRelatedObjectsById.d.ts +3 -0
- package/lib/component/reducer/helper/removeSpectrumRelatedObjectsById.js +16 -0
- package/lib/component/reducer/preferences/actions/changeInformationBlockPosition.d.ts +3 -0
- package/lib/component/reducer/preferences/actions/changeInformationBlockPosition.js +5 -0
- package/lib/component/reducer/preferences/actions/changePrintPageSettings.d.ts +3 -0
- package/lib/component/reducer/preferences/actions/changePrintPageSettings.js +6 -0
- package/lib/component/reducer/preferences/actions/toggleInformationBlock.d.ts +3 -0
- package/lib/component/reducer/preferences/actions/toggleInformationBlock.js +7 -0
- package/lib/component/reducer/preferences/preferencesReducer.d.ts +12 -2
- package/lib/component/reducer/preferences/preferencesReducer.js +9 -0
- package/lib/component/toolbar/ToolBar.js +33 -14
- package/lib/component/workspaces/workspaceDefaultProperties.js +2 -0
- package/lib/data/SpectraManager.d.ts +7 -10
- package/lib/data/SpectraManager.js +51 -30
- package/lib/data/data1d/Spectrum1D/SumManager.d.ts +0 -1
- package/lib/data/data1d/Spectrum1D/SumManager.js +2 -10
- package/lib/data/data1d/Spectrum1D/get1DColor.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/index.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/index.js +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/createRange.d.ts +10 -10
- package/lib/data/data1d/Spectrum1D/ranges/detectSignals.js +2 -1
- package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.d.ts +10 -10
- package/lib/data/data1d/Spectrum1D/ranges/resizeRange.d.ts +10 -10
- package/lib/data/data1d/Spectrum1D/ranges/resurrectSpectrum.d.ts +13 -0
- package/lib/data/data1d/Spectrum1D/ranges/resurrectSpectrum.js +65 -0
- package/lib/data/molecules/MoleculeManager.js +16 -38
- package/lib/data/utilities/getCustomColor.d.ts +1 -1
- package/lib/data/utilities/removeByPaths.d.ts +3 -0
- package/lib/data/utilities/removeByPaths.js +33 -0
- package/lib/versionInfo.js +1 -1
- package/package.json +36 -36
- package/lib/data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges.d.ts +0 -11
- package/lib/data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges.js +0 -29
|
@@ -4,6 +4,7 @@ import { getCorrelationDelta, getLinkDim } from 'nmr-correlation';
|
|
|
4
4
|
import { useCallback, useMemo, useRef } from 'react';
|
|
5
5
|
import { buildID } from '../../../../data/utilities/Concatenation';
|
|
6
6
|
import { findRangeOrZoneID } from '../../../../data/utilities/FindUtilities';
|
|
7
|
+
import { useAlert } from '../../../elements/Alert';
|
|
7
8
|
import ContextMenu from '../../../elements/ContextMenu';
|
|
8
9
|
import { positions, useModal } from '../../../elements/popup/Modal';
|
|
9
10
|
import { useHighlight } from '../../../highlight';
|
|
@@ -13,6 +14,7 @@ import EditLinkModal from './editLink/EditLinkModal';
|
|
|
13
14
|
function AdditionalColumnHeader({ spectraData, correlationsData, correlation, onEdit, }) {
|
|
14
15
|
const contextRef = useRef();
|
|
15
16
|
const modal = useModal();
|
|
17
|
+
const alert = useAlert();
|
|
16
18
|
const highlightIDsAdditionalColumn = useMemo(() => {
|
|
17
19
|
if (correlation.pseudo === true) {
|
|
18
20
|
return [];
|
|
@@ -99,14 +101,15 @@ function AdditionalColumnHeader({ spectraData, correlationsData, correlation, on
|
|
|
99
101
|
{
|
|
100
102
|
label: `delete all (${correlation.label.origin})`,
|
|
101
103
|
onClick: () => {
|
|
102
|
-
|
|
104
|
+
alert.showAlert({
|
|
103
105
|
message: `All signals of ${correlation.label.origin} (${getCorrelationDelta(correlation).toFixed(2)}) will be deleted. Are you sure?`,
|
|
104
106
|
buttons: [
|
|
105
107
|
{
|
|
106
108
|
text: 'Yes',
|
|
107
|
-
|
|
109
|
+
onClick: () => {
|
|
108
110
|
onEdit([correlation], 'removeAll');
|
|
109
111
|
},
|
|
112
|
+
intent: 'danger',
|
|
110
113
|
},
|
|
111
114
|
{ text: 'No' },
|
|
112
115
|
],
|
|
@@ -117,6 +120,7 @@ function AdditionalColumnHeader({ spectraData, correlationsData, correlation, on
|
|
|
117
120
|
])
|
|
118
121
|
: [];
|
|
119
122
|
}, [
|
|
123
|
+
alert,
|
|
120
124
|
correlation,
|
|
121
125
|
correlationsData.values,
|
|
122
126
|
highlightAdditionalColumn,
|
|
@@ -3,6 +3,7 @@ import { buildLink, getCorrelationDelta, getLabel, getLinkDim, } from 'nmr-corre
|
|
|
3
3
|
import { useCallback, useMemo, useRef } from 'react';
|
|
4
4
|
import { buildID } from '../../../../data/utilities/Concatenation';
|
|
5
5
|
import { findRangeOrZoneID } from '../../../../data/utilities/FindUtilities';
|
|
6
|
+
import { useAlert } from '../../../elements/Alert';
|
|
6
7
|
import ContextMenu from '../../../elements/ContextMenu';
|
|
7
8
|
import EditableColumn from '../../../elements/EditableColumn';
|
|
8
9
|
import { positions, useModal } from '../../../elements/popup/Modal';
|
|
@@ -14,6 +15,7 @@ import EditLinkModal from './editLink/EditLinkModal';
|
|
|
14
15
|
function CorrelationTableRow({ additionalColumnData, correlations, correlation, styleRow, styleLabel, onSaveEditEquivalences, onSaveEditNumericValues, onEditCorrelationTableCellHandler, spectraData, }) {
|
|
15
16
|
const contextRef = useRef();
|
|
16
17
|
const modal = useModal();
|
|
18
|
+
const alert = useAlert();
|
|
17
19
|
const highlightIDsRow = useMemo(() => {
|
|
18
20
|
if (correlation.pseudo === true) {
|
|
19
21
|
return [];
|
|
@@ -141,14 +143,15 @@ function CorrelationTableRow({ additionalColumnData, correlations, correlation,
|
|
|
141
143
|
{
|
|
142
144
|
label: `delete ${correlation.label.origin}`,
|
|
143
145
|
onClick: () => {
|
|
144
|
-
|
|
146
|
+
alert.showAlert({
|
|
145
147
|
message: `All signals of ${correlation.label.origin} (${getCorrelationDelta(correlation).toFixed(2)}) will be deleted. Are you sure?`,
|
|
146
148
|
buttons: [
|
|
147
149
|
{
|
|
148
150
|
text: 'Yes',
|
|
149
|
-
|
|
151
|
+
onClick: () => {
|
|
150
152
|
onEditCorrelationTableCellHandler([correlation], 'removeAll');
|
|
151
153
|
},
|
|
154
|
+
intent: 'danger',
|
|
152
155
|
},
|
|
153
156
|
{ text: 'No' },
|
|
154
157
|
],
|
|
@@ -164,6 +167,7 @@ function CorrelationTableRow({ additionalColumnData, correlations, correlation,
|
|
|
164
167
|
modal,
|
|
165
168
|
onEditCorrelationTableCellHandler,
|
|
166
169
|
correlations,
|
|
170
|
+
alert,
|
|
167
171
|
]);
|
|
168
172
|
const contextMenuHandler = useCallback((e) => {
|
|
169
173
|
e.preventDefault();
|
|
@@ -198,6 +198,10 @@ function SummaryPanel() {
|
|
|
198
198
|
});
|
|
199
199
|
}, [dispatch]);
|
|
200
200
|
const deleteCorrelationHandler = useCallback((correlation) => {
|
|
201
|
+
const correlationLinks = correlation?.links;
|
|
202
|
+
if (!(Array.isArray(correlationLinks) && correlationLinks.length > 0)) {
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
201
205
|
dispatch({
|
|
202
206
|
type: 'DELETE_CORRELATION',
|
|
203
207
|
payload: {
|
|
@@ -7,7 +7,7 @@ import { LuSubtitles } from 'react-icons/lu';
|
|
|
7
7
|
import { useAssignmentData } from '../../assignment/AssignmentsContext';
|
|
8
8
|
import { useChartData } from '../../context/ChartContext';
|
|
9
9
|
import { useDispatch } from '../../context/DispatchContext';
|
|
10
|
-
import {
|
|
10
|
+
import { useAlert } from '../../elements/Alert';
|
|
11
11
|
import { useActiveSpectrumZonesViewState } from '../../hooks/useActiveSpectrumZonesViewState';
|
|
12
12
|
import useSpectrum from '../../hooks/useSpectrum';
|
|
13
13
|
import { booleanToString } from '../../utility/booleanToString';
|
|
@@ -20,7 +20,7 @@ function ZonesPanelInner({ zones, activeTab, xDomain, yDomain, info, showZones,
|
|
|
20
20
|
const [filterIsActive, setFilterIsActive] = useState(false);
|
|
21
21
|
const assignmentData = useAssignmentData();
|
|
22
22
|
const dispatch = useDispatch();
|
|
23
|
-
const
|
|
23
|
+
const alert = useAlert();
|
|
24
24
|
const [isFlipped, setFlipStatus] = useState(false);
|
|
25
25
|
const settingRef = useRef();
|
|
26
26
|
const tableData = useMemo(() => {
|
|
@@ -73,25 +73,33 @@ function ZonesPanelInner({ zones, activeTab, xDomain, yDomain, info, showZones,
|
|
|
73
73
|
unlinkZoneHandler();
|
|
74
74
|
}, [unlinkZoneHandler]);
|
|
75
75
|
const handleOnRemoveAssignments = useCallback(() => {
|
|
76
|
-
|
|
76
|
+
alert.showAlert({
|
|
77
77
|
message: 'All assignments will be removed. Are you sure?',
|
|
78
|
-
buttons: [
|
|
78
|
+
buttons: [
|
|
79
|
+
{
|
|
80
|
+
text: 'Yes',
|
|
81
|
+
onClick: removeAssignments,
|
|
82
|
+
intent: 'danger',
|
|
83
|
+
},
|
|
84
|
+
{ text: 'No' },
|
|
85
|
+
],
|
|
79
86
|
});
|
|
80
|
-
}, [removeAssignments,
|
|
87
|
+
}, [removeAssignments, alert]);
|
|
81
88
|
const handleDeleteAll = useCallback(() => {
|
|
82
|
-
|
|
89
|
+
alert.showAlert({
|
|
83
90
|
message: 'All zones will be deleted. Are You sure?',
|
|
84
91
|
buttons: [
|
|
85
92
|
{
|
|
86
93
|
text: 'Yes',
|
|
87
|
-
|
|
94
|
+
onClick: () => {
|
|
88
95
|
dispatch({ type: 'DELETE_2D_ZONE', payload: { assignmentData } });
|
|
89
96
|
},
|
|
97
|
+
intent: 'danger',
|
|
90
98
|
},
|
|
91
99
|
{ text: 'No' },
|
|
92
100
|
],
|
|
93
101
|
});
|
|
94
|
-
}, [assignmentData, dispatch,
|
|
102
|
+
}, [assignmentData, dispatch, alert]);
|
|
95
103
|
const settingsPanelHandler = useCallback(() => {
|
|
96
104
|
setFlipStatus(!isFlipped);
|
|
97
105
|
}, [isFlipped]);
|
|
@@ -177,7 +177,7 @@ function DatabasePanelInner({ nucleus, selectedTool, databases, defaultDatabase,
|
|
|
177
177
|
}, [result.data]);
|
|
178
178
|
const resurrectHandler = useCallback((rowData) => {
|
|
179
179
|
const { index, baseURL, jcampURL: jcampRelativeURL } = rowData;
|
|
180
|
-
const
|
|
180
|
+
const databaseEntry = result.data[index];
|
|
181
181
|
if (jcampRelativeURL) {
|
|
182
182
|
const url = new URL(jcampRelativeURL, baseURL);
|
|
183
183
|
setTimeout(async () => {
|
|
@@ -189,11 +189,10 @@ function DatabasePanelInner({ nucleus, selectedTool, databases, defaultDatabase,
|
|
|
189
189
|
entries: [{ baseURL: url.origin, relativePath: url.pathname }],
|
|
190
190
|
});
|
|
191
191
|
const spectrum = data?.spectra?.[0] || null;
|
|
192
|
-
if (spectrum && isSpectrum1D(spectrum)
|
|
193
|
-
spectrum.id = spectrumID;
|
|
192
|
+
if (spectrum && isSpectrum1D(spectrum)) {
|
|
194
193
|
dispatch({
|
|
195
|
-
type: '
|
|
196
|
-
payload: {
|
|
194
|
+
type: 'RESURRECTING_SPECTRUM',
|
|
195
|
+
payload: { source: 'jcamp', databaseEntry, spectrum },
|
|
197
196
|
});
|
|
198
197
|
}
|
|
199
198
|
}
|
|
@@ -207,11 +206,11 @@ function DatabasePanelInner({ nucleus, selectedTool, databases, defaultDatabase,
|
|
|
207
206
|
}
|
|
208
207
|
else {
|
|
209
208
|
dispatch({
|
|
210
|
-
type: '
|
|
211
|
-
payload: {
|
|
209
|
+
type: 'RESURRECTING_SPECTRUM',
|
|
210
|
+
payload: { source: 'rangesOrSignals', databaseEntry },
|
|
212
211
|
});
|
|
213
212
|
}
|
|
214
|
-
}, [dispatch,
|
|
213
|
+
}, [dispatch, result.data, toaster]);
|
|
215
214
|
const saveHandler = useCallback((row) => {
|
|
216
215
|
if (row?.jcampURL) {
|
|
217
216
|
setTimeout(async () => {
|
|
@@ -1,32 +1,35 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
2
|
import { useDispatch } from '../../context/DispatchContext';
|
|
3
3
|
import { useToaster } from '../../context/ToasterContext';
|
|
4
|
-
import {
|
|
4
|
+
import { useAlert } from '../../elements/Alert';
|
|
5
|
+
import useSpectrum from '../../hooks/useSpectrum';
|
|
5
6
|
import { tablePanelStyle } from '../extra/BasicPanelStyle';
|
|
6
7
|
import DefaultPanelHeader from '../header/DefaultPanelHeader';
|
|
7
8
|
import FiltersTable from './FiltersTable';
|
|
8
9
|
export default function FiltersPanel() {
|
|
9
10
|
const dispatch = useDispatch();
|
|
10
|
-
const modal = useModal();
|
|
11
11
|
const toaster = useToaster();
|
|
12
|
+
const { showAlert } = useAlert();
|
|
13
|
+
const { filters } = useSpectrum({ filters: [] });
|
|
12
14
|
function handelDeleteFilter() {
|
|
13
15
|
const buttons = [
|
|
14
16
|
{
|
|
15
17
|
text: 'Yes',
|
|
16
|
-
|
|
17
|
-
const hideLoading = toaster.
|
|
18
|
+
onClick: async () => {
|
|
19
|
+
const hideLoading = await toaster.showAsyncLoading({
|
|
18
20
|
message: 'Delete filters process in progress',
|
|
19
21
|
});
|
|
20
22
|
dispatch({ type: 'DELETE_FILTER', payload: {} });
|
|
21
23
|
hideLoading();
|
|
22
24
|
},
|
|
25
|
+
intent: 'danger',
|
|
23
26
|
},
|
|
24
27
|
{ text: 'No' },
|
|
25
28
|
];
|
|
26
|
-
|
|
29
|
+
showAlert({
|
|
27
30
|
message: 'You are about to delete all processing steps, Are you sure?',
|
|
28
31
|
buttons,
|
|
29
32
|
});
|
|
30
33
|
}
|
|
31
|
-
return (_jsxs("div", { css: tablePanelStyle, children: [_jsx(DefaultPanelHeader, { deleteToolTip: "Delete all filters", onDelete: handelDeleteFilter }), _jsx("div", { className: "inner-container", children: _jsx(FiltersTable, {}) })] }));
|
|
34
|
+
return (_jsxs("div", { css: tablePanelStyle, children: [_jsx(DefaultPanelHeader, { deleteToolTip: "Delete all filters", onDelete: handelDeleteFilter, total: filters?.length, hideCounter: true }), _jsx("div", { className: "inner-container", children: _jsx(FiltersTable, {}) })] }));
|
|
32
35
|
}
|
|
@@ -6,10 +6,10 @@ import { ObjectInspector } from 'react-inspector';
|
|
|
6
6
|
import { useChartData } from '../../context/ChartContext';
|
|
7
7
|
import { useDispatch } from '../../context/DispatchContext';
|
|
8
8
|
import { useToaster } from '../../context/ToasterContext';
|
|
9
|
+
import { useAlert } from '../../elements/Alert';
|
|
9
10
|
import Button from '../../elements/Button';
|
|
10
11
|
import { ColumnWrapper } from '../../elements/ColumnWrapper';
|
|
11
12
|
import ReactTable from '../../elements/ReactTable/ReactTable';
|
|
12
|
-
import { useModal } from '../../elements/popup/Modal';
|
|
13
13
|
import useSpectraByActiveNucleus from '../../hooks/useSpectraPerNucleus';
|
|
14
14
|
import useSpectrum from '../../hooks/useSpectrum';
|
|
15
15
|
const rowColors = {
|
|
@@ -30,7 +30,7 @@ const rowColors = {
|
|
|
30
30
|
};
|
|
31
31
|
function FiltersTableInner({ filters, spectraCounter, activeFilterID, }) {
|
|
32
32
|
const dispatch = useDispatch();
|
|
33
|
-
const
|
|
33
|
+
const alert = useAlert();
|
|
34
34
|
const toaster = useToaster();
|
|
35
35
|
const selectedFilterIndex = useRef();
|
|
36
36
|
const handelFilterCheck = useCallback((id, event) => {
|
|
@@ -47,21 +47,22 @@ function FiltersTableInner({ filters, spectraCounter, activeFilterID, }) {
|
|
|
47
47
|
const buttons = [
|
|
48
48
|
{
|
|
49
49
|
text: 'Yes',
|
|
50
|
-
|
|
51
|
-
const hideLoading = toaster.
|
|
50
|
+
onClick: async () => {
|
|
51
|
+
const hideLoading = await toaster.showAsyncLoading({
|
|
52
52
|
message: 'Delete filter process in progress',
|
|
53
53
|
});
|
|
54
54
|
dispatch({ type: 'DELETE_FILTER', payload: { id } });
|
|
55
55
|
hideLoading();
|
|
56
56
|
},
|
|
57
|
+
intent: 'danger',
|
|
57
58
|
},
|
|
58
59
|
{ text: 'No' },
|
|
59
60
|
];
|
|
60
61
|
if (spectraCounter > 1) {
|
|
61
62
|
buttons.unshift({
|
|
62
63
|
text: 'Yes, for all spectra',
|
|
63
|
-
|
|
64
|
-
const hideLoading = toaster.
|
|
64
|
+
onClick: async () => {
|
|
65
|
+
const hideLoading = await toaster.showAsyncLoading({
|
|
65
66
|
message: 'Delete all spectra filter process in progress',
|
|
66
67
|
});
|
|
67
68
|
dispatch({
|
|
@@ -70,13 +71,14 @@ function FiltersTableInner({ filters, spectraCounter, activeFilterID, }) {
|
|
|
70
71
|
});
|
|
71
72
|
hideLoading();
|
|
72
73
|
},
|
|
74
|
+
intent: spectraCounter ? 'danger' : 'none',
|
|
73
75
|
});
|
|
74
76
|
}
|
|
75
|
-
|
|
77
|
+
alert.showAlert({
|
|
76
78
|
message: (_jsxs("span", { children: ["You are about to delete this processing step", _jsxs("span", { style: { color: 'black' }, children: [" ", label, " "] }), " , Are you sure?"] })),
|
|
77
79
|
buttons,
|
|
78
|
-
}
|
|
79
|
-
}, [
|
|
80
|
+
});
|
|
81
|
+
}, [alert, dispatch, spectraCounter, toaster]);
|
|
80
82
|
const filterSnapShotHandler = useCallback((filter, index) => {
|
|
81
83
|
selectedFilterIndex.current =
|
|
82
84
|
selectedFilterIndex.current && index === selectedFilterIndex.current
|
|
@@ -134,7 +136,7 @@ function FiltersTableInner({ filters, spectraCounter, activeFilterID, }) {
|
|
|
134
136
|
if (activeFilterID === id) {
|
|
135
137
|
return rowColors.active;
|
|
136
138
|
}
|
|
137
|
-
else if (selectedFilterIndex.current &&
|
|
139
|
+
else if (selectedFilterIndex.current != null &&
|
|
138
140
|
index > selectedFilterIndex.current) {
|
|
139
141
|
return rowColors.deActive;
|
|
140
142
|
}
|
|
@@ -18,6 +18,7 @@ interface DefaultPanelHeaderProps {
|
|
|
18
18
|
className?: string;
|
|
19
19
|
leftButtons?: ToolbarItemProps[];
|
|
20
20
|
rightButtons?: ToolbarItemProps[];
|
|
21
|
+
hideCounter?: boolean;
|
|
21
22
|
}
|
|
22
23
|
export declare function formatCounterLabel(counter?: number, total?: number): string;
|
|
23
24
|
declare function DefaultPanelHeader(props: DefaultPanelHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -29,13 +29,13 @@ export function formatCounterLabel(counter, total) {
|
|
|
29
29
|
return '';
|
|
30
30
|
}
|
|
31
31
|
function DefaultPanelHeader(props) {
|
|
32
|
-
const { total, counter, onDelete, deleteToolTip = 'Delete', onFilter, filterToolTip = '', children, onSettingClick, disableDelete = false, style = {}, className = '', rightButtons = [], leftButtons = [], } = props;
|
|
32
|
+
const { total, counter, onDelete, deleteToolTip = 'Delete', onFilter, filterToolTip = '', children, onSettingClick, disableDelete = false, style = {}, className = '', rightButtons = [], leftButtons = [], hideCounter = false, } = props;
|
|
33
33
|
const [isFiltered, setFilterStatus] = useState(false);
|
|
34
34
|
function handleFilter() {
|
|
35
35
|
setFilterStatus((previousValue) => !previousValue);
|
|
36
36
|
onFilter?.();
|
|
37
37
|
}
|
|
38
|
-
return (_jsxs(PanelHeader, { style, className, children: [_jsxs("div", { style: styles.leftContainer, children: [_jsxs(Toolbar, { children: [onDelete && (_jsx(Toolbar.Item, { id: "delete-button", onClick: onDelete, tooltip: deleteToolTip, icon: _jsx(FaRegTrashAlt, {}), intent: "danger", disabled: !total || disableDelete })), onFilter && (_jsx(Toolbar.Item, { id: "filter-button", onClick: handleFilter, tooltip: filterToolTip, active: isFiltered, icon: _jsx(FaFilter, {}) })), mapToolbarButtons(leftButtons)] }), children] }), _jsx(Toolbar, { children: mapToolbarButtons(rightButtons) }), _jsx(CounterLabel, { value: formatCounterLabel(counter, total) }), onSettingClick && (_jsx(PreferencesButton, { tooltip: "Preferences", onClick: onSettingClick }))] }));
|
|
38
|
+
return (_jsxs(PanelHeader, { style, className, children: [_jsxs("div", { style: styles.leftContainer, children: [_jsxs(Toolbar, { children: [onDelete && (_jsx(Toolbar.Item, { id: "delete-button", onClick: onDelete, tooltip: deleteToolTip, icon: _jsx(FaRegTrashAlt, {}), intent: "danger", disabled: !total || disableDelete })), onFilter && (_jsx(Toolbar.Item, { id: "filter-button", onClick: handleFilter, tooltip: filterToolTip, active: isFiltered, icon: _jsx(FaFilter, {}) })), mapToolbarButtons(leftButtons)] }), children] }), _jsx(Toolbar, { children: mapToolbarButtons(rightButtons) }), !hideCounter && (_jsx(CounterLabel, { value: formatCounterLabel(counter, total) })), onSettingClick && (_jsx(PreferencesButton, { tooltip: "Preferences", onClick: onSettingClick }))] }));
|
|
39
39
|
}
|
|
40
40
|
function mapToolbarButtons(buttons) {
|
|
41
41
|
return buttons.map((props, index) => isCustomToolbarItem(props) ? (
|
|
@@ -3,7 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@emotion/reac
|
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
4
|
import { Formik } from 'formik';
|
|
5
5
|
import { xFindClosestIndex } from 'ml-spectra-processing';
|
|
6
|
-
import {
|
|
6
|
+
import { useState } from 'react';
|
|
7
7
|
import * as Yup from 'yup';
|
|
8
8
|
import { REFERENCES } from '../../../data/constants/References';
|
|
9
9
|
import { useDispatch } from '../../context/DispatchContext';
|
|
@@ -13,7 +13,7 @@ import Message from '../../elements/Message';
|
|
|
13
13
|
import Select from '../../elements/Select';
|
|
14
14
|
import FormikInput from '../../elements/formik/FormikInput';
|
|
15
15
|
import useSpectraByActiveNucleus from '../../hooks/useSpectraPerNucleus';
|
|
16
|
-
import
|
|
16
|
+
import { useEvent } from '../../utility/Events';
|
|
17
17
|
const labelStyle = {
|
|
18
18
|
label: { flex: 4, fontWeight: '500' },
|
|
19
19
|
wrapper: { flex: 8, display: 'flex', alignItems: 'center' },
|
|
@@ -87,16 +87,14 @@ function AlignSpectra({ onClose = () => null, nucleus }) {
|
|
|
87
87
|
setError(message);
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
const [from, to] =
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
};
|
|
99
|
-
}, []);
|
|
90
|
+
useEvent({
|
|
91
|
+
onBrushEnd: (options) => {
|
|
92
|
+
const { range: [from, to], shiftKey, } = options;
|
|
93
|
+
if (shiftKey) {
|
|
94
|
+
setOptions((prevOptions) => ({ ...prevOptions, from, to }));
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
});
|
|
100
98
|
function optionChangeHandler(key) {
|
|
101
99
|
const { delta: targetX = 0, ...otherOptions } = REFERENCES?.[nucleus]?.[key] || {};
|
|
102
100
|
const value = {
|
|
@@ -9,7 +9,7 @@ import { useDispatch } from '../../context/DispatchContext';
|
|
|
9
9
|
import { useLogger } from '../../context/LoggerContext';
|
|
10
10
|
import { useToaster } from '../../context/ToasterContext';
|
|
11
11
|
import Button from '../../elements/Button';
|
|
12
|
-
import NextPrev from '../../elements/NextPrev';
|
|
12
|
+
import { NextPrev } from '../../elements/NextPrev';
|
|
13
13
|
import { usePanelPreferences } from '../../hooks/usePanelPreferences';
|
|
14
14
|
import { useMoleculeEditor } from '../../modal/MoleculeStructureEditorModal';
|
|
15
15
|
import MoleculeHeader from '../MoleculesPanel/MoleculeHeader';
|
|
@@ -115,7 +115,7 @@ export default function PredictionPanel() {
|
|
|
115
115
|
return (_jsx(NextPrev, { onChange: (slideIndex) => {
|
|
116
116
|
setCurrentIndex(slideIndex);
|
|
117
117
|
setMolfile(molecules[slideIndex].molfile);
|
|
118
|
-
},
|
|
118
|
+
}, index: currentIndex, style: {
|
|
119
119
|
arrowContainer: {
|
|
120
120
|
top: '40px',
|
|
121
121
|
padding: '0 10px 0 55px',
|
|
@@ -412,10 +412,8 @@ function innerSpectrumReducer(draft, action) {
|
|
|
412
412
|
return ZonesActions.handleSetZoneAssignmentLabelCoordination(draft, action);
|
|
413
413
|
case 'ORDER_MULTIPLE_SPECTRA_ANALYSIS':
|
|
414
414
|
return SpectraAnalysisActions.handleOrderSpectra(draft, action);
|
|
415
|
-
case '
|
|
416
|
-
return DatabaseActions.
|
|
417
|
-
case 'RESURRECTING_SPECTRUM_FROM_JCAMP':
|
|
418
|
-
return DatabaseActions.handleResurrectSpectrumFromJcamp(draft, action);
|
|
415
|
+
case 'RESURRECTING_SPECTRUM':
|
|
416
|
+
return DatabaseActions.handleResurrectSpectrum(draft, action);
|
|
419
417
|
case 'TOGGLE_SIMILARITY_TREE':
|
|
420
418
|
return DatabaseActions.handleToggleSimilarityTree(draft);
|
|
421
419
|
case 'SET_AUTOMATIC_ASSIGNMENTS':
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import { Draft } from 'immer';
|
|
2
2
|
import { Spectrum1D } from 'nmr-load-save';
|
|
3
|
-
import {
|
|
4
|
-
import { ResurrectSpectrumInfo } from '../../../data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges';
|
|
3
|
+
import { DatabaseNMREntry } from 'nmr-processing';
|
|
5
4
|
import { State } from '../Reducer';
|
|
6
5
|
import { ActionType } from '../types/ActionType';
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
interface BaseResurrectSpectrum {
|
|
7
|
+
databaseEntry: DatabaseNMREntry;
|
|
8
|
+
}
|
|
9
|
+
interface ResurrectSpectrumFromJCAMP extends BaseResurrectSpectrum {
|
|
10
|
+
source: 'jcamp';
|
|
9
11
|
spectrum: Spectrum1D;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
declare function
|
|
12
|
+
}
|
|
13
|
+
interface ResurrectSpectrumFromRangesOrSignals extends BaseResurrectSpectrum {
|
|
14
|
+
source: 'rangesOrSignals';
|
|
15
|
+
}
|
|
16
|
+
type ResurrectSpectrum = ResurrectSpectrumFromJCAMP | ResurrectSpectrumFromRangesOrSignals;
|
|
17
|
+
type ResurrectSpectrumAction = ActionType<'RESURRECTING_SPECTRUM', ResurrectSpectrum>;
|
|
18
|
+
export type DatabaseActions = ActionType<'TOGGLE_SIMILARITY_TREE'> | ResurrectSpectrumAction;
|
|
19
|
+
declare function handleResurrectSpectrum(draft: Draft<State>, action: ResurrectSpectrumAction): void;
|
|
18
20
|
declare function handleToggleSimilarityTree(draft: Draft<State>): void;
|
|
19
|
-
export {
|
|
21
|
+
export { handleResurrectSpectrum, handleToggleSimilarityTree };
|
|
@@ -1,43 +1,61 @@
|
|
|
1
|
-
import { get1DColor, mapRanges } from '../../../data/data1d/Spectrum1D';
|
|
2
|
-
import {
|
|
1
|
+
import { get1DColor, isSpectrum1D, mapRanges, } from '../../../data/data1d/Spectrum1D';
|
|
2
|
+
import { resurrectSpectrumFromRanges, resurrectSpectrumFromSignals, } from '../../../data/data1d/Spectrum1D/ranges/resurrectSpectrum';
|
|
3
3
|
import { setZoom } from '../helper/Zoom1DManager';
|
|
4
4
|
import zoomHistoryManager from '../helper/ZoomHistoryManager';
|
|
5
|
+
import { getSpectrum } from '../helper/getSpectrum';
|
|
5
6
|
import { setDomain } from './DomainActions';
|
|
6
|
-
function
|
|
7
|
-
const {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const zoomHistory = zoomHistoryManager(draft.zoom.history, draft.view.spectra.activeTab);
|
|
26
|
-
const zoomValue = zoomHistory.getLast();
|
|
27
|
-
if (zoomValue) {
|
|
28
|
-
draft.xDomain = zoomValue.xDomain;
|
|
29
|
-
draft.yDomain = zoomValue.yDomain;
|
|
7
|
+
function handleResurrectSpectrum(draft, action) {
|
|
8
|
+
const { spectra: { activeTab: nucleus }, } = draft.view;
|
|
9
|
+
const { databaseEntry, source } = action.payload;
|
|
10
|
+
const { ranges, signals, solvent, names = [], id: spectrumID, } = databaseEntry;
|
|
11
|
+
let resurrectedSpectrum = null;
|
|
12
|
+
if (source === 'jcamp') {
|
|
13
|
+
const { spectrum } = action.payload;
|
|
14
|
+
resurrectedSpectrum = {
|
|
15
|
+
...spectrum,
|
|
16
|
+
id: spectrumID,
|
|
17
|
+
ranges: {
|
|
18
|
+
...spectrum.ranges,
|
|
19
|
+
values: mapRanges(ranges, spectrum),
|
|
20
|
+
},
|
|
21
|
+
display: {
|
|
22
|
+
...spectrum.display,
|
|
23
|
+
...get1DColor(spectrum.display, { usedColors: draft.usedColors }),
|
|
24
|
+
},
|
|
25
|
+
};
|
|
30
26
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
27
|
+
if (source === 'rangesOrSignals') {
|
|
28
|
+
const activeSpectrum = getSpectrum(draft) || draft.data[0];
|
|
29
|
+
let options = {};
|
|
30
|
+
let info = { solvent, name: names[0], nucleus };
|
|
31
|
+
if (activeSpectrum && isSpectrum1D(activeSpectrum)) {
|
|
32
|
+
const { data: { x }, info: spectrumInfo, } = activeSpectrum;
|
|
33
|
+
options = { from: x[0], to: x.at(-1) };
|
|
34
|
+
info = { ...spectrumInfo, ...info };
|
|
35
|
+
}
|
|
36
|
+
if (signals) {
|
|
37
|
+
resurrectedSpectrum = resurrectSpectrumFromSignals(signals, {
|
|
38
|
+
spectrumID,
|
|
39
|
+
info,
|
|
40
|
+
usedColors: draft.usedColors,
|
|
41
|
+
...options,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
else if (ranges) {
|
|
45
|
+
resurrectedSpectrum = resurrectSpectrumFromRanges(ranges, {
|
|
46
|
+
spectrumID,
|
|
47
|
+
info,
|
|
48
|
+
usedColors: draft.usedColors,
|
|
49
|
+
...options,
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
if (!resurrectedSpectrum)
|
|
36
54
|
return;
|
|
37
|
-
draft.data.push(
|
|
55
|
+
draft.data.push(resurrectedSpectrum);
|
|
38
56
|
setDomain(draft, { isYDomainShared: false });
|
|
39
57
|
//rescale the vertical zoom
|
|
40
|
-
setZoom(draft, { scale: 0.8, spectrumID:
|
|
58
|
+
setZoom(draft, { scale: 0.8, spectrumID: resurrectedSpectrum.id });
|
|
41
59
|
//keep the last horizontal zoom
|
|
42
60
|
const zoomHistory = zoomHistoryManager(draft.zoom.history, draft.view.spectra.activeTab);
|
|
43
61
|
const zoomValue = zoomHistory.getLast();
|
|
@@ -50,4 +68,4 @@ function handleToggleSimilarityTree(draft) {
|
|
|
50
68
|
draft.view.spectra.showSimilarityTree =
|
|
51
69
|
!draft.view.spectra.showSimilarityTree;
|
|
52
70
|
}
|
|
53
|
-
export {
|
|
71
|
+
export { handleResurrectSpectrum, handleToggleSimilarityTree };
|
|
@@ -20,8 +20,8 @@ interface GetDomainOptions {
|
|
|
20
20
|
domainSpectraScope?: 'visible' | 'all';
|
|
21
21
|
}
|
|
22
22
|
declare function getDomain(draft: Draft<State>, options?: GetDomainOptions): {
|
|
23
|
-
xDomain: [
|
|
24
|
-
yDomain: [
|
|
23
|
+
xDomain: never[] | [number, number] | [undefined, undefined];
|
|
24
|
+
yDomain: never[] | [number, number] | [undefined, undefined];
|
|
25
25
|
yDomains: Record<string, number[]>;
|
|
26
26
|
xDomains: Record<string, number[]>;
|
|
27
27
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { v4 } from '@lukeed/uuid';
|
|
2
2
|
import { current } from 'immer';
|
|
3
3
|
import { xFindClosestIndex } from 'ml-spectra-processing';
|
|
4
|
-
import { Filters, FiltersManager,
|
|
4
|
+
import { Filters, FiltersManager, getBaselineZonesByDietrich, } from 'nmr-processing';
|
|
5
5
|
import { defaultApodizationOptions } from '../../../data/constants/DefaultApodizationOptions';
|
|
6
6
|
import { isSpectrum1D } from '../../../data/data1d/Spectrum1D';
|
|
7
7
|
import { isSpectrum2D } from '../../../data/data2d/Spectrum2D';
|
|
@@ -21,7 +21,7 @@ import { getTwoDimensionPhaseCorrectionOptions } from '../helper/getTwoDimension
|
|
|
21
21
|
import { setDomain, setMode } from './DomainActions';
|
|
22
22
|
import { changeSpectrumVerticalAlignment } from './PreferencesActions';
|
|
23
23
|
import { activateTool, resetSelectedTool } from './ToolsActions';
|
|
24
|
-
const { fft, fftDimension1, fftDimension2, apodization, baselineCorrection, phaseCorrection, phaseCorrectionTwoDimensions, zeroFilling, shiftX, shift2DX, shift2DY, exclusionZones, signalProcessing, } = Filters;
|
|
24
|
+
const { fft, fftDimension1, fftDimension2, apodization, baselineCorrection, phaseCorrection, phaseCorrectionTwoDimensions, zeroFilling, shiftX, shift2DX, shift2DY, exclusionZones, signalProcessing, digitalFilter, digitalFilter2D, } = Filters;
|
|
25
25
|
function getFilterUpdateDomainRules(filterName, defaultRule) {
|
|
26
26
|
return (Filters[filterName]?.DOMAIN_UPDATE_RULES ||
|
|
27
27
|
defaultRule || {
|
|
@@ -70,7 +70,7 @@ function rollbackSpectrumByFilter(draft, options) {
|
|
|
70
70
|
//set active filter
|
|
71
71
|
draft.toolOptions.data.activeFilterID =
|
|
72
72
|
datum.filters?.[filterIndex]?.id || null;
|
|
73
|
-
const filters = datum.filters.slice(0, filterIndex
|
|
73
|
+
const filters = datum.filters.slice(0, filterIndex);
|
|
74
74
|
updateDomainOptions = getFilterDomain(datum, {
|
|
75
75
|
startIndex: Math.min(activeFilterIndex, filterIndex),
|
|
76
76
|
lastIndex: Math.max(activeFilterIndex, filterIndex),
|
|
@@ -131,6 +131,8 @@ function rollbackSpectrum(draft, options) {
|
|
|
131
131
|
shift2DX.id,
|
|
132
132
|
shift2DY.id,
|
|
133
133
|
signalProcessing.id,
|
|
134
|
+
digitalFilter.id,
|
|
135
|
+
digitalFilter2D.id,
|
|
134
136
|
].includes(filterKey);
|
|
135
137
|
beforeRollback(draft, filterKey);
|
|
136
138
|
rollbackSpectrumByFilter(draft, {
|
|
@@ -233,7 +235,8 @@ function beforeRollback(draft, filterKey) {
|
|
|
233
235
|
if (!baselineCorrectionFilter ||
|
|
234
236
|
(baselineCorrectionFilter &&
|
|
235
237
|
baselineCorrectionFilter.value.zones?.length === 0)) {
|
|
236
|
-
draft.toolOptions.data.baselineCorrection.zones =
|
|
238
|
+
draft.toolOptions.data.baselineCorrection.zones =
|
|
239
|
+
getBaselineZonesByDietrich(datum.data);
|
|
237
240
|
}
|
|
238
241
|
else {
|
|
239
242
|
draft.toolOptions.data.baselineCorrection.zones =
|
|
@@ -773,6 +776,8 @@ function handleSetFilterSnapshotHandler(draft, action) {
|
|
|
773
776
|
activateTool(draft, { toolId: filterKey, reset });
|
|
774
777
|
}
|
|
775
778
|
else {
|
|
779
|
+
draft.toolOptions.selectedOptionPanel = null;
|
|
780
|
+
draft.toolOptions.selectedTool = 'zoom';
|
|
776
781
|
rollbackSpectrum(draft, { filterKey, reset });
|
|
777
782
|
}
|
|
778
783
|
}
|