nmrium 2.4.0 → 2.5.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/HorizontalAxis1D.d.ts.map +1 -1
- package/lib/component/1d/HorizontalAxis1D.js +4 -1
- package/lib/component/1d/HorizontalAxis1D.js.map +1 -1
- package/lib/component/1d/SVGContent1D.d.ts.map +1 -1
- package/lib/component/1d/SVGContent1D.js +2 -1
- package/lib/component/1d/SVGContent1D.js.map +1 -1
- package/lib/component/1d/Viewer1D.d.ts.map +1 -1
- package/lib/component/1d/Viewer1D.js +2 -1
- package/lib/component/1d/Viewer1D.js.map +1 -1
- package/lib/component/1d/integral/IntegralResizable.d.ts.map +1 -1
- package/lib/component/1d/integral/IntegralResizable.js +4 -4
- package/lib/component/1d/integral/IntegralResizable.js.map +1 -1
- package/lib/component/1d/ranges/Range.d.ts.map +1 -1
- package/lib/component/1d/ranges/Range.js +3 -3
- package/lib/component/1d/ranges/Range.js.map +1 -1
- package/lib/component/1d/ranges/Signals.d.ts +2 -0
- package/lib/component/1d/ranges/Signals.d.ts.map +1 -0
- package/lib/component/1d/ranges/Signals.js +16 -0
- package/lib/component/1d/ranges/Signals.js.map +1 -0
- package/lib/component/1d-2d/components/RangeIndicator.d.ts +13 -0
- package/lib/component/1d-2d/components/RangeIndicator.d.ts.map +1 -0
- package/lib/component/1d-2d/components/RangeIndicator.js +52 -0
- package/lib/component/1d-2d/components/RangeIndicator.js.map +1 -0
- package/lib/component/1d-2d/components/Signals1D.d.ts +19 -0
- package/lib/component/1d-2d/components/Signals1D.d.ts.map +1 -0
- package/lib/component/1d-2d/components/Signals1D.js +155 -0
- package/lib/component/1d-2d/components/Signals1D.js.map +1 -0
- package/lib/component/1d-2d/tools/CrossLinePointer.d.ts +16 -1
- package/lib/component/1d-2d/tools/CrossLinePointer.d.ts.map +1 -1
- package/lib/component/1d-2d/tools/CrossLinePointer.js +25 -15
- package/lib/component/1d-2d/tools/CrossLinePointer.js.map +1 -1
- package/lib/component/1d-2d/tools/CursorToolIcon.d.ts +9 -0
- package/lib/component/1d-2d/tools/CursorToolIcon.d.ts.map +1 -0
- package/lib/component/1d-2d/tools/CursorToolIcon.js +58 -0
- package/lib/component/1d-2d/tools/CursorToolIcon.js.map +1 -0
- package/lib/component/2d/1d-tracer/Left1DChart.d.ts.map +1 -1
- package/lib/component/2d/1d-tracer/Left1DChart.js +3 -2
- package/lib/component/2d/1d-tracer/Left1DChart.js.map +1 -1
- package/lib/component/2d/1d-tracer/Ranges1D.d.ts.map +1 -1
- package/lib/component/2d/1d-tracer/Ranges1D.js +4 -60
- package/lib/component/2d/1d-tracer/Ranges1D.js.map +1 -1
- package/lib/component/2d/1d-tracer/Top1DChart.d.ts.map +1 -1
- package/lib/component/2d/1d-tracer/Top1DChart.js +3 -2
- package/lib/component/2d/1d-tracer/Top1DChart.js.map +1 -1
- package/lib/component/2d/DirectAxis2D.d.ts.map +1 -1
- package/lib/component/2d/DirectAxis2D.js +4 -1
- package/lib/component/2d/DirectAxis2D.js.map +1 -1
- package/lib/component/2d/IndirectAxis2D.d.ts.map +1 -1
- package/lib/component/2d/IndirectAxis2D.js +5 -2
- package/lib/component/2d/IndirectAxis2D.js.map +1 -1
- package/lib/component/2d/Viewer2D.d.ts.map +1 -1
- package/lib/component/2d/Viewer2D.js +2 -1
- package/lib/component/2d/Viewer2D.js.map +1 -1
- package/lib/component/AnchorSVG.d.ts +5 -6
- package/lib/component/AnchorSVG.d.ts.map +1 -1
- package/lib/component/AnchorSVG.js +9 -6
- package/lib/component/AnchorSVG.js.map +1 -1
- package/lib/component/EventsTrackers/BrushTracker.d.ts.map +1 -1
- package/lib/component/EventsTrackers/BrushTracker.js +14 -4
- package/lib/component/EventsTrackers/BrushTracker.js.map +1 -1
- package/lib/component/EventsTrackers/MouseTracker.d.ts +3 -0
- package/lib/component/EventsTrackers/MouseTracker.d.ts.map +1 -1
- package/lib/component/EventsTrackers/MouseTracker.js +15 -0
- package/lib/component/EventsTrackers/MouseTracker.js.map +1 -1
- package/lib/component/context/KeyModifierContext.d.ts +1 -0
- package/lib/component/context/KeyModifierContext.d.ts.map +1 -1
- package/lib/component/context/KeyModifierContext.js +22 -6
- package/lib/component/context/KeyModifierContext.js.map +1 -1
- package/lib/component/elements/D3Axis.d.ts.map +1 -1
- package/lib/component/elements/D3Axis.js +4 -3
- package/lib/component/elements/D3Axis.js.map +1 -1
- package/lib/component/header/AutoPeakPickingOptionPanel.d.ts.map +1 -1
- package/lib/component/header/AutoPeakPickingOptionPanel.js +59 -31
- package/lib/component/header/AutoPeakPickingOptionPanel.js.map +1 -1
- package/lib/component/header/RangesPickingOptionPanel.d.ts.map +1 -1
- package/lib/component/header/RangesPickingOptionPanel.js +34 -19
- package/lib/component/header/RangesPickingOptionPanel.js.map +1 -1
- package/lib/component/hooks/useAddMultipletSignal.d.ts +7 -0
- package/lib/component/hooks/useAddMultipletSignal.d.ts.map +1 -0
- package/lib/component/hooks/useAddMultipletSignal.js +28 -0
- package/lib/component/hooks/useAddMultipletSignal.js.map +1 -0
- package/lib/component/hooks/useFilter.d.ts.map +1 -1
- package/lib/component/hooks/useFilter.js.map +1 -1
- package/lib/component/hooks/useSpectrum.d.ts +3 -1
- package/lib/component/hooks/useSpectrum.d.ts.map +1 -1
- package/lib/component/hooks/useSpectrum.js +1 -1
- package/lib/component/hooks/useSpectrum.js.map +1 -1
- package/lib/component/hooks/useSpectrumWithDataSource.d.ts +1 -1
- package/lib/component/hooks/useSpectrumWithDataSource.d.ts.map +1 -1
- package/lib/component/hooks/useSpectrumWithDataSource.js.map +1 -1
- package/lib/component/hooks/useTempSpectrum.d.ts +1 -1
- package/lib/component/hooks/useTempSpectrum.d.ts.map +1 -1
- package/lib/component/hooks/use_ticks_config.d.ts +1 -4
- package/lib/component/hooks/use_ticks_config.d.ts.map +1 -1
- package/lib/component/hooks/use_ticks_config.js +1 -6
- package/lib/component/hooks/use_ticks_config.js.map +1 -1
- package/lib/component/modal/PublicationStringModal.d.ts +1 -1
- package/lib/component/modal/PublicationStringModal.d.ts.map +1 -1
- package/lib/component/modal/PublicationStringModal.js +2 -2
- package/lib/component/modal/PublicationStringModal.js.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/errors/context.d.ts +118 -0
- package/lib/component/modal/setting/tanstack_general_settings/errors/context.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/errors/renderer.d.ts +118 -0
- package/lib/component/modal/setting/tanstack_general_settings/errors/renderer.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_body.d.ts +118 -0
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_body.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_footer.d.ts +96 -0
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_footer.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_header.d.ts +96 -0
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_header.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/hooks/use_safe_workspace.d.ts +16 -0
- package/lib/component/modal/setting/tanstack_general_settings/hooks/use_safe_workspace.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/tabs/auto_processing_tab.d.ts +96 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/auto_processing_tab.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/tabs/axis_tab.d.ts +96 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/axis_tab.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/tabs/axis_tab.js +12 -1
- package/lib/component/modal/setting/tanstack_general_settings/tabs/axis_tab.js.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/tabs/database_tab.d.ts +96 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/database_tab.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/tabs/export_tab.d.ts +96 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/export_tab.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/tabs/external_api_tab.d.ts +96 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/external_api_tab.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/tabs/general_tab.d.ts +96 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/general_tab.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/tabs/import_filters_tab.d.ts +96 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/import_filters_tab.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/tabs/nuclei_tab.d.ts +96 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/nuclei_tab.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/tabs/panels_tab.d.ts +96 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/panels_tab.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/tabs/spectra_colors_tab.d.ts +96 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/spectra_colors_tab.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/tabs/spectra_label_tab.d.ts +96 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/spectra_label_tab.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/tabs/title_block_tab.d.ts +96 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/title_block_tab.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/tabs/tools_tab.d.ts +96 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/tools_tab.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/validation/axis_tab_validation.d.ts +22 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/axis_tab_validation.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/validation/axis_tab_validation.js +15 -2
- package/lib/component/modal/setting/tanstack_general_settings/validation/axis_tab_validation.js.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/validation.d.ts +22 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation.d.ts.map +1 -1
- package/lib/component/panels/MoleculesPanel/hooks/useAtomAssignment.js +1 -1
- package/lib/component/panels/MoleculesPanel/hooks/useAtomAssignment.js.map +1 -1
- package/lib/component/panels/RangesPanel/RangesPanel.d.ts.map +1 -1
- package/lib/component/panels/RangesPanel/RangesPanel.js +1 -3
- package/lib/component/panels/RangesPanel/RangesPanel.js.map +1 -1
- package/lib/component/panels/RangesPanel/RangesTableRow.d.ts.map +1 -1
- package/lib/component/panels/RangesPanel/RangesTableRow.js +10 -12
- package/lib/component/panels/RangesPanel/RangesTableRow.js.map +1 -1
- package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.d.ts +1 -1
- package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.d.ts.map +1 -1
- package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.js +1 -1
- package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.js.map +1 -1
- package/lib/component/panels/filtersPanel/processings_sections_panel.d.ts.map +1 -1
- package/lib/component/panels/filtersPanel/processings_sections_panel.js +13 -23
- package/lib/component/panels/filtersPanel/processings_sections_panel.js.map +1 -1
- package/lib/component/panels/hooks/use_processings_mutation.d.ts +10 -0
- package/lib/component/panels/hooks/use_processings_mutation.d.ts.map +1 -0
- package/lib/component/panels/hooks/use_processings_mutation.js +130 -0
- package/lib/component/panels/hooks/use_processings_mutation.js.map +1 -0
- package/lib/component/panels/informationPanel/InformationPanel.js +1 -1
- package/lib/component/panels/informationPanel/InformationPanel.js.map +1 -1
- package/lib/component/reducer/Reducer.d.ts.map +1 -1
- package/lib/component/reducer/Reducer.js +2 -0
- package/lib/component/reducer/Reducer.js.map +1 -1
- package/lib/component/reducer/actions/CorrelationsActions.js +1 -1
- package/lib/component/reducer/actions/CorrelationsActions.js.map +1 -1
- package/lib/component/reducer/actions/FiltersActions.d.ts +2 -0
- package/lib/component/reducer/actions/FiltersActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/FiltersActions.js +1 -1
- package/lib/component/reducer/actions/FiltersActions.js.map +1 -1
- package/lib/component/reducer/actions/RangesActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/RangesActions.js +13 -24
- package/lib/component/reducer/actions/RangesActions.js.map +1 -1
- package/lib/component/reducer/actions/SpectraActions.d.ts +8 -2
- package/lib/component/reducer/actions/SpectraActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/SpectraActions.js +6 -1
- package/lib/component/reducer/actions/SpectraActions.js.map +1 -1
- package/lib/component/reducer/preferences/actions/setPreferences.d.ts +2 -2
- package/lib/component/reducer/preferences/actions/setPreferences.d.ts.map +1 -1
- package/lib/component/reducer/preferences/actions/setPreferences.js +8 -5
- package/lib/component/reducer/preferences/actions/setPreferences.js.map +1 -1
- package/lib/component/reducer/preferences/preferencesReducer.d.ts +1 -1
- package/lib/component/reducer/preferences/preferencesReducer.d.ts.map +1 -1
- package/lib/component/toolbar/ToolTypes.d.ts +21 -1
- package/lib/component/toolbar/ToolTypes.d.ts.map +1 -1
- package/lib/component/toolbar/ToolTypes.js +40 -0
- package/lib/component/toolbar/ToolTypes.js.map +1 -1
- package/lib/component/toolbar/nmr_toolbar.d.ts.map +1 -1
- package/lib/component/toolbar/nmr_toolbar.js +9 -35
- package/lib/component/toolbar/nmr_toolbar.js.map +1 -1
- package/lib/component/workspaces/workspaceDefaultProperties.d.ts.map +1 -1
- package/lib/component/workspaces/workspaceDefaultProperties.js +19 -2
- package/lib/component/workspaces/workspaceDefaultProperties.js.map +1 -1
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.d.ts.map +1 -1
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +13 -5
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.js.map +1 -1
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.d.ts.map +1 -1
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +12 -4
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.js.map +1 -1
- package/lib/data/data2d/Spectrum2D/isSpectrum2D.d.ts +1 -1
- package/lib/data/data2d/Spectrum2D/isSpectrum2D.d.ts.map +1 -1
- package/lib/data/data2d/Spectrum2D/isSpectrum2D.js.map +1 -1
- package/lib/data/utilities/RangeUtilities.d.ts +1 -6
- package/lib/data/utilities/RangeUtilities.d.ts.map +1 -1
- package/lib/data/utilities/RangeUtilities.js +10 -27
- package/lib/data/utilities/RangeUtilities.js.map +1 -1
- package/lib/versionInfo.js +1 -1
- package/package.json +15 -14
- package/src/component/1d/HorizontalAxis1D.tsx +12 -2
- package/src/component/1d/SVGContent1D.tsx +2 -0
- package/src/component/1d/Viewer1D.tsx +2 -0
- package/src/component/1d/integral/IntegralResizable.tsx +6 -6
- package/src/component/1d/ranges/Range.tsx +6 -6
- package/src/component/1d/ranges/Signals.tsx +28 -0
- package/src/component/1d-2d/components/RangeIndicator.tsx +106 -0
- package/src/component/1d-2d/components/Signals1D.tsx +306 -0
- package/src/component/1d-2d/tools/CrossLinePointer.tsx +75 -32
- package/src/component/1d-2d/tools/CursorToolIcon.tsx +110 -0
- package/src/component/2d/1d-tracer/Left1DChart.tsx +4 -2
- package/src/component/2d/1d-tracer/Ranges1D.tsx +4 -100
- package/src/component/2d/1d-tracer/Top1DChart.tsx +4 -2
- package/src/component/2d/DirectAxis2D.tsx +12 -3
- package/src/component/2d/IndirectAxis2D.tsx +9 -5
- package/src/component/2d/Viewer2D.tsx +5 -2
- package/src/component/AnchorSVG.tsx +27 -28
- package/src/component/EventsTrackers/BrushTracker.tsx +21 -7
- package/src/component/EventsTrackers/MouseTracker.tsx +21 -0
- package/src/component/context/KeyModifierContext.tsx +27 -8
- package/src/component/elements/D3Axis.tsx +31 -9
- package/src/component/header/AutoPeakPickingOptionPanel.tsx +173 -102
- package/src/component/header/RangesPickingOptionPanel.tsx +72 -59
- package/src/component/hooks/useAddMultipletSignal.tsx +32 -0
- package/src/component/hooks/useFilter.ts +2 -1
- package/src/component/hooks/useSpectrum.ts +7 -1
- package/src/component/hooks/useSpectrumWithDataSource.ts +16 -8
- package/src/component/hooks/use_ticks_config.ts +1 -7
- package/src/component/modal/PublicationStringModal.tsx +3 -3
- package/src/component/modal/setting/tanstack_general_settings/tabs/axis_tab.tsx +76 -12
- package/src/component/modal/setting/tanstack_general_settings/validation/axis_tab_validation.ts +16 -2
- package/src/component/panels/MoleculesPanel/hooks/useAtomAssignment.tsx +1 -1
- package/src/component/panels/RangesPanel/RangesPanel.tsx +1 -3
- package/src/component/panels/RangesPanel/RangesTableRow.tsx +10 -12
- package/src/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.tsx +2 -2
- package/src/component/panels/filtersPanel/processings_sections_panel.tsx +27 -44
- package/src/component/panels/hooks/use_processings_mutation.ts +171 -0
- package/src/component/panels/informationPanel/InformationPanel.tsx +1 -1
- package/src/component/reducer/Reducer.ts +2 -0
- package/src/component/reducer/actions/CorrelationsActions.ts +1 -1
- package/src/component/reducer/actions/FiltersActions.ts +1 -1
- package/src/component/reducer/actions/RangesActions.ts +14 -25
- package/src/component/reducer/actions/SpectraActions.ts +20 -1
- package/src/component/reducer/preferences/actions/setPreferences.ts +18 -10
- package/src/component/reducer/preferences/preferencesReducer.ts +1 -1
- package/src/component/toolbar/ToolTypes.ts +92 -1
- package/src/component/toolbar/nmr_toolbar.tsx +12 -69
- package/src/component/workspaces/workspaceDefaultProperties.ts +19 -2
- package/src/data/data1d/Spectrum1D/initiateDatum1D.ts +14 -8
- package/src/data/data2d/Spectrum2D/initiateDatum2D.ts +12 -4
- package/src/data/data2d/Spectrum2D/isSpectrum2D.ts +1 -1
- package/src/data/utilities/RangeUtilities.ts +12 -36
- package/src/versionInfo.ts +1 -1
- package/lib/component/1d/integral/IntegralIndicator.d.ts +0 -9
- package/lib/component/1d/integral/IntegralIndicator.d.ts.map +0 -1
- package/lib/component/1d/integral/IntegralIndicator.js +0 -22
- package/lib/component/1d/integral/IntegralIndicator.js.map +0 -1
- package/lib/component/2d/1d-tracer/Signals1D.d.ts +0 -11
- package/lib/component/2d/1d-tracer/Signals1D.d.ts.map +0 -1
- package/lib/component/2d/1d-tracer/Signals1D.js +0 -90
- package/lib/component/2d/1d-tracer/Signals1D.js.map +0 -1
- package/src/component/1d/integral/IntegralIndicator.tsx +0 -43
- package/src/component/2d/1d-tracer/Signals1D.tsx +0 -145
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
1
|
+
import { Classes, FormGroup, MenuItem, NumericInput } from '@blueprintjs/core';
|
|
2
|
+
import type { ItemRenderer } from '@blueprintjs/select';
|
|
3
|
+
import { Select } from '@blueprintjs/select';
|
|
4
|
+
import styled from '@emotion/styled';
|
|
5
|
+
import { revalidateLogic } from '@tanstack/react-form';
|
|
6
|
+
import { AppForm, Button, TooltipHelpContent, useForm } from 'react-science/ui';
|
|
7
|
+
import { z } from 'zod/v4';
|
|
5
8
|
|
|
6
9
|
import { useDispatch } from '../context/DispatchContext.js';
|
|
7
10
|
import { useToaster } from '../context/ToasterContext.js';
|
|
8
|
-
import Label from '../elements/Label.js';
|
|
9
|
-
import { NumberInput2Controller } from '../elements/NumberInput2Controller.js';
|
|
10
|
-
import { Select2Controller } from '../elements/Select2Controller.js';
|
|
11
11
|
import { useActiveNucleusTab } from '../hooks/useActiveNucleusTab.ts';
|
|
12
12
|
import { useActiveSpectra } from '../hooks/useActiveSpectra.ts';
|
|
13
13
|
import {
|
|
@@ -16,12 +16,14 @@ import {
|
|
|
16
16
|
} from '../hooks/useCheckPointsNumberInWindowArea.js';
|
|
17
17
|
import { usePanelPreferences } from '../hooks/usePanelPreferences.ts';
|
|
18
18
|
|
|
19
|
-
import { headerLabelStyle } from './Header.js';
|
|
20
|
-
import { HeaderWrapper } from './HeaderWrapper.js';
|
|
21
|
-
|
|
22
19
|
type Direction = 'positive' | 'negative' | 'both';
|
|
23
20
|
|
|
24
|
-
|
|
21
|
+
interface Item {
|
|
22
|
+
label: string;
|
|
23
|
+
value: Direction;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const LookFor: Item[] = [
|
|
25
27
|
{
|
|
26
28
|
label: 'Positive',
|
|
27
29
|
value: 'positive',
|
|
@@ -36,48 +38,78 @@ const LookFor: Array<{ label: string; value: Direction }> = [
|
|
|
36
38
|
},
|
|
37
39
|
];
|
|
38
40
|
|
|
39
|
-
|
|
40
|
-
maxNumberOfPeaks: number
|
|
41
|
-
minMaxRatio: number
|
|
42
|
-
noiseFactor: number
|
|
43
|
-
direction:
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
const validationSchema = Yup.object().shape({
|
|
47
|
-
maxNumberOfPeaks: Yup.number().min(1).required(),
|
|
48
|
-
minMaxRatio: Yup.number().min(0).required(),
|
|
49
|
-
noiseFactor: Yup.number().min(0).required(),
|
|
50
|
-
direction: Yup.mixed<Direction>()
|
|
51
|
-
.oneOf(['both', 'negative', 'positive'])
|
|
52
|
-
.required(),
|
|
41
|
+
const validationSchema = z.object({
|
|
42
|
+
maxNumberOfPeaks: z.coerce.number<string>().min(1),
|
|
43
|
+
minMaxRatio: z.coerce.number<string>().min(0),
|
|
44
|
+
noiseFactor: z.coerce.number<string>().min(0),
|
|
45
|
+
direction: z.enum(['both', 'negative', 'positive']),
|
|
53
46
|
});
|
|
54
47
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
48
|
+
type AutoPeakPickingOptionsInput = z.input<typeof validationSchema>;
|
|
49
|
+
type AutoPeakPickingOptions = z.output<typeof validationSchema>;
|
|
50
|
+
|
|
51
|
+
const defaultValues: AutoPeakPickingOptionsInput = {
|
|
52
|
+
maxNumberOfPeaks: '50',
|
|
53
|
+
minMaxRatio: '0.05',
|
|
54
|
+
noiseFactor: '3',
|
|
59
55
|
direction: 'both',
|
|
60
56
|
};
|
|
61
57
|
|
|
58
|
+
const AppFormContainer = styled(AppForm)`
|
|
59
|
+
display: flex;
|
|
60
|
+
flex-direction: row;
|
|
61
|
+
gap: 10px;
|
|
62
|
+
align-items: center;
|
|
63
|
+
|
|
64
|
+
.${Classes.FORM_GROUP} {
|
|
65
|
+
margin-bottom: 0;
|
|
66
|
+
}
|
|
67
|
+
`;
|
|
68
|
+
|
|
69
|
+
const renderDirection: ItemRenderer<Item> = (
|
|
70
|
+
direction,
|
|
71
|
+
{ handleClick, handleFocus, modifiers },
|
|
72
|
+
) => {
|
|
73
|
+
if (!modifiers.matchesPredicate) {
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return (
|
|
78
|
+
<MenuItem
|
|
79
|
+
active={modifiers.active}
|
|
80
|
+
disabled={modifiers.disabled}
|
|
81
|
+
key={direction.value}
|
|
82
|
+
label={direction.label}
|
|
83
|
+
onClick={handleClick}
|
|
84
|
+
onFocus={handleFocus}
|
|
85
|
+
roleStructure="listoption"
|
|
86
|
+
text={direction.label}
|
|
87
|
+
/>
|
|
88
|
+
);
|
|
89
|
+
};
|
|
90
|
+
|
|
62
91
|
export function AutoPeakPickingOptionPanel() {
|
|
63
92
|
const dispatch = useDispatch();
|
|
64
93
|
const hasEnoughPoints = useCheckPointsNumberInSelectedSpectra();
|
|
65
94
|
const toaster = useToaster();
|
|
66
95
|
const nucleus = useActiveNucleusTab();
|
|
67
96
|
const activeSpectra = useActiveSpectra();
|
|
68
|
-
|
|
69
97
|
const { defaultPeakShape } = usePanelPreferences('peaks', nucleus);
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
98
|
+
const isSpectraSelected = activeSpectra && activeSpectra.length > 0;
|
|
99
|
+
|
|
100
|
+
const form = useForm({
|
|
101
|
+
defaultValues,
|
|
102
|
+
validationLogic: revalidateLogic({ modeAfterSubmission: 'change' }),
|
|
103
|
+
onSubmit: ({ value }) => {
|
|
104
|
+
const parsedValues = validationSchema.parse(value);
|
|
105
|
+
handlePeakPicking(parsedValues);
|
|
106
|
+
},
|
|
107
|
+
validators: {
|
|
108
|
+
onDynamic: validationSchema,
|
|
109
|
+
},
|
|
78
110
|
});
|
|
79
111
|
|
|
80
|
-
function handlePeakPicking(values:
|
|
112
|
+
function handlePeakPicking(values: AutoPeakPickingOptions) {
|
|
81
113
|
if (hasEnoughPoints) {
|
|
82
114
|
dispatch({
|
|
83
115
|
type: 'AUTO_PEAK_PICKING',
|
|
@@ -94,69 +126,108 @@ export function AutoPeakPickingOptionPanel() {
|
|
|
94
126
|
}
|
|
95
127
|
}
|
|
96
128
|
|
|
97
|
-
const isSpectraSelected = activeSpectra && activeSpectra.length > 0;
|
|
98
129
|
return (
|
|
99
|
-
<
|
|
100
|
-
<
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
</
|
|
160
|
-
|
|
130
|
+
<AppFormContainer form={form}>
|
|
131
|
+
<form.AppField name="direction">
|
|
132
|
+
{(field) => {
|
|
133
|
+
const activeItem = LookFor.find(
|
|
134
|
+
(item) => item.value === field.state.value,
|
|
135
|
+
);
|
|
136
|
+
|
|
137
|
+
return (
|
|
138
|
+
<FormGroup label="Direction:" inline>
|
|
139
|
+
<Select<Item>
|
|
140
|
+
filterable={false}
|
|
141
|
+
items={LookFor}
|
|
142
|
+
itemRenderer={renderDirection}
|
|
143
|
+
activeItem={activeItem}
|
|
144
|
+
onItemSelect={(element) => {
|
|
145
|
+
field.handleChange(element.value);
|
|
146
|
+
}}
|
|
147
|
+
>
|
|
148
|
+
<Button
|
|
149
|
+
text={activeItem?.label}
|
|
150
|
+
endIcon="double-caret-vertical"
|
|
151
|
+
/>
|
|
152
|
+
</Select>
|
|
153
|
+
</FormGroup>
|
|
154
|
+
);
|
|
155
|
+
}}
|
|
156
|
+
</form.AppField>
|
|
157
|
+
|
|
158
|
+
<form.AppField name="maxNumberOfPeaks">
|
|
159
|
+
{(field) => (
|
|
160
|
+
<FormGroup label="Max peaks:" inline>
|
|
161
|
+
<NumericInput
|
|
162
|
+
value={field.state.value ?? ''}
|
|
163
|
+
onBlur={field.handleBlur}
|
|
164
|
+
min={1}
|
|
165
|
+
style={{ width: '60px' }}
|
|
166
|
+
stepSize={1}
|
|
167
|
+
onValueChange={(_, valueAsString) => {
|
|
168
|
+
field.handleChange(valueAsString);
|
|
169
|
+
}}
|
|
170
|
+
/>
|
|
171
|
+
</FormGroup>
|
|
172
|
+
)}
|
|
173
|
+
</form.AppField>
|
|
174
|
+
|
|
175
|
+
<form.AppField name="noiseFactor">
|
|
176
|
+
{(field) => (
|
|
177
|
+
<FormGroup label="Noise:" inline>
|
|
178
|
+
<NumericInput
|
|
179
|
+
value={field.state.value ?? ''}
|
|
180
|
+
onBlur={field.handleBlur}
|
|
181
|
+
min={1}
|
|
182
|
+
style={{ width: '60px' }}
|
|
183
|
+
stepSize={1}
|
|
184
|
+
onValueChange={(_, valueAsString) => {
|
|
185
|
+
field.handleChange(valueAsString);
|
|
186
|
+
}}
|
|
187
|
+
/>
|
|
188
|
+
</FormGroup>
|
|
189
|
+
)}
|
|
190
|
+
</form.AppField>
|
|
191
|
+
|
|
192
|
+
<form.AppField name="minMaxRatio">
|
|
193
|
+
{(field) => (
|
|
194
|
+
<FormGroup label="Ratio:" inline>
|
|
195
|
+
<NumericInput
|
|
196
|
+
value={field.state.value ?? ''}
|
|
197
|
+
onBlur={field.handleBlur}
|
|
198
|
+
style={{ width: '60px' }}
|
|
199
|
+
min={0}
|
|
200
|
+
stepSize={0.01}
|
|
201
|
+
majorStepSize={0.01}
|
|
202
|
+
minorStepSize={0.01}
|
|
203
|
+
onValueChange={(_, valueAsString) => {
|
|
204
|
+
field.handleChange(valueAsString);
|
|
205
|
+
}}
|
|
206
|
+
/>
|
|
207
|
+
</FormGroup>
|
|
208
|
+
)}
|
|
209
|
+
</form.AppField>
|
|
210
|
+
|
|
211
|
+
<div>
|
|
212
|
+
<form.SubmitButton
|
|
213
|
+
tooltipProps={
|
|
214
|
+
!isSpectraSelected
|
|
215
|
+
? {
|
|
216
|
+
intent: 'danger',
|
|
217
|
+
content: (
|
|
218
|
+
<TooltipHelpContent
|
|
219
|
+
title="Auto peak picking"
|
|
220
|
+
description="Select a one or more spectra to enable auto peak picking"
|
|
221
|
+
/>
|
|
222
|
+
),
|
|
223
|
+
}
|
|
224
|
+
: undefined
|
|
225
|
+
}
|
|
226
|
+
intent={isSpectraSelected ? 'success' : 'danger'}
|
|
227
|
+
>
|
|
228
|
+
Apply to {activeSpectra?.length} spectra
|
|
229
|
+
</form.SubmitButton>
|
|
230
|
+
</div>
|
|
231
|
+
</AppFormContainer>
|
|
161
232
|
);
|
|
162
233
|
}
|
|
@@ -1,51 +1,47 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
1
|
+
import { Checkbox, Classes, FormGroup, NumericInput } from '@blueprintjs/core';
|
|
2
|
+
import styled from '@emotion/styled';
|
|
3
|
+
import { revalidateLogic } from '@tanstack/react-form';
|
|
4
|
+
import { AppForm, useForm } from 'react-science/ui';
|
|
5
|
+
import { z } from 'zod';
|
|
5
6
|
|
|
6
7
|
import { useDispatch } from '../context/DispatchContext.js';
|
|
7
8
|
import { useToaster } from '../context/ToasterContext.js';
|
|
8
|
-
import Label from '../elements/Label.js';
|
|
9
|
-
import { NumberInput2Controller } from '../elements/NumberInput2Controller.js';
|
|
10
9
|
import {
|
|
11
10
|
MIN_AREA_POINTS,
|
|
12
11
|
useCheckPointsNumberInWindowArea,
|
|
13
12
|
} from '../hooks/useCheckPointsNumberInWindowArea.js';
|
|
14
13
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
interface AutoRangesOptions {
|
|
19
|
-
minMaxRatio: number;
|
|
20
|
-
lookNegative: boolean;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
const validationSchema = Yup.object().shape({
|
|
24
|
-
minMaxRatio: Yup.number().min(0).required(),
|
|
25
|
-
lookNegative: Yup.boolean().required(),
|
|
14
|
+
const validationZodSchema = z.object({
|
|
15
|
+
minMaxRatio: z.coerce.number<string>().min(0),
|
|
16
|
+
lookNegative: z.boolean(),
|
|
26
17
|
});
|
|
27
18
|
|
|
28
|
-
const
|
|
29
|
-
minMaxRatio: 0.05,
|
|
19
|
+
const defaultValues: AutoRangesOptionsInput = {
|
|
20
|
+
minMaxRatio: '0.05',
|
|
30
21
|
lookNegative: false,
|
|
31
22
|
};
|
|
32
23
|
|
|
24
|
+
const AppFormContainer = styled(AppForm)`
|
|
25
|
+
display: flex;
|
|
26
|
+
flex-direction: row;
|
|
27
|
+
gap: 10px;
|
|
28
|
+
align-items: center;
|
|
29
|
+
|
|
30
|
+
.${Classes.CHECKBOX}, .${Classes.FORM_GROUP} {
|
|
31
|
+
margin-bottom: 0;
|
|
32
|
+
}
|
|
33
|
+
`;
|
|
34
|
+
|
|
35
|
+
type AutoRangesOptionsInput = z.input<typeof validationZodSchema>;
|
|
36
|
+
type AutoRangesOptions = z.output<typeof validationZodSchema>;
|
|
37
|
+
|
|
33
38
|
function RangesPickingOptionPanel() {
|
|
34
39
|
const dispatch = useDispatch();
|
|
35
|
-
|
|
36
|
-
handleSubmit,
|
|
37
|
-
register,
|
|
38
|
-
control,
|
|
39
|
-
formState: { isValid },
|
|
40
|
-
} = useForm<AutoRangesOptions>({
|
|
41
|
-
defaultValues: initialValues,
|
|
42
|
-
resolver: yupResolver(validationSchema),
|
|
43
|
-
mode: 'onChange',
|
|
44
|
-
});
|
|
40
|
+
|
|
45
41
|
const hasEnoughPoints = useCheckPointsNumberInWindowArea();
|
|
46
42
|
const toaster = useToaster();
|
|
47
43
|
|
|
48
|
-
function handleRangesPicking(values:
|
|
44
|
+
function handleRangesPicking(values: AutoRangesOptions) {
|
|
49
45
|
if (hasEnoughPoints) {
|
|
50
46
|
dispatch({
|
|
51
47
|
type: 'AUTO_RANGES_DETECTION',
|
|
@@ -59,37 +55,54 @@ function RangesPickingOptionPanel() {
|
|
|
59
55
|
}
|
|
60
56
|
}
|
|
61
57
|
|
|
58
|
+
const form = useForm({
|
|
59
|
+
defaultValues,
|
|
60
|
+
validationLogic: revalidateLogic({ modeAfterSubmission: 'change' }),
|
|
61
|
+
validators: {
|
|
62
|
+
onDynamic: validationZodSchema,
|
|
63
|
+
},
|
|
64
|
+
onSubmit: ({ value }) => {
|
|
65
|
+
const parsedValues = validationZodSchema.parse(value);
|
|
66
|
+
handleRangesPicking(parsedValues);
|
|
67
|
+
},
|
|
68
|
+
});
|
|
69
|
+
|
|
62
70
|
return (
|
|
63
|
-
<
|
|
64
|
-
<
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
71
|
+
<AppFormContainer form={form}>
|
|
72
|
+
<form.AppField name="lookNegative">
|
|
73
|
+
{(field) => (
|
|
74
|
+
<Checkbox
|
|
75
|
+
label="Detect negative"
|
|
76
|
+
checked={field.state.value}
|
|
77
|
+
onBlur={field.handleBlur}
|
|
78
|
+
onChange={({ target: { checked } }) => field.handleChange(checked)}
|
|
79
|
+
/>
|
|
80
|
+
)}
|
|
81
|
+
</form.AppField>
|
|
82
|
+
|
|
83
|
+
<form.AppField name="minMaxRatio">
|
|
84
|
+
{(field) => (
|
|
85
|
+
<FormGroup label="Min/max ratio:" inline>
|
|
86
|
+
<NumericInput
|
|
87
|
+
value={field.state.value ?? ''}
|
|
88
|
+
onBlur={field.handleBlur}
|
|
89
|
+
min={0}
|
|
90
|
+
stepSize={0.01}
|
|
91
|
+
minorStepSize={0.01}
|
|
92
|
+
onValueChange={(_, valueAsString) => {
|
|
93
|
+
field.handleChange(valueAsString);
|
|
94
|
+
}}
|
|
95
|
+
/>
|
|
96
|
+
</FormGroup>
|
|
97
|
+
)}
|
|
98
|
+
</form.AppField>
|
|
83
99
|
|
|
84
|
-
<
|
|
85
|
-
intent="success"
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
Auto ranges picking
|
|
91
|
-
</Button>
|
|
92
|
-
</HeaderWrapper>
|
|
100
|
+
<div>
|
|
101
|
+
<form.SubmitButton intent="success">
|
|
102
|
+
Auto ranges picking
|
|
103
|
+
</form.SubmitButton>
|
|
104
|
+
</div>
|
|
105
|
+
</AppFormContainer>
|
|
93
106
|
);
|
|
94
107
|
}
|
|
95
108
|
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { Jcoupling, Range, Signal1D } from '@zakodium/nmr-types';
|
|
2
|
+
|
|
3
|
+
import { useDispatch } from '../context/DispatchContext.tsx';
|
|
4
|
+
|
|
5
|
+
export function useAddMultipletSignal() {
|
|
6
|
+
const dispatch = useDispatch();
|
|
7
|
+
|
|
8
|
+
return (options: { range: Range; spectrumId?: string; delta: number }) => {
|
|
9
|
+
const { range, delta, spectrumId } = options;
|
|
10
|
+
const updatedRange = structuredClone(range);
|
|
11
|
+
const signal: Signal1D = {
|
|
12
|
+
id: crypto.randomUUID(),
|
|
13
|
+
delta,
|
|
14
|
+
js: [
|
|
15
|
+
{
|
|
16
|
+
multiplicity: 'm',
|
|
17
|
+
} as Jcoupling,
|
|
18
|
+
],
|
|
19
|
+
kind: 'signal',
|
|
20
|
+
multiplicity: 'm',
|
|
21
|
+
};
|
|
22
|
+
updatedRange.signals.push(signal);
|
|
23
|
+
|
|
24
|
+
dispatch({
|
|
25
|
+
type: 'UPDATE_RANGE',
|
|
26
|
+
payload: {
|
|
27
|
+
range: updatedRange,
|
|
28
|
+
spectrumId,
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Filter1DEntry, Filter2DEntry } from '@zakodium/nmr-types';
|
|
2
|
+
import type { Spectrum } from '@zakodium/nmrium-core';
|
|
2
3
|
import { useMemo } from 'react';
|
|
3
4
|
|
|
4
5
|
import type { ExtractFilterEntry } from '../../data/types/common/ExtractFilterEntry.js';
|
|
@@ -6,7 +7,7 @@ import type { FilterEntry } from '../../data/types/common/FilterEntry.js';
|
|
|
6
7
|
|
|
7
8
|
import useSpectrum from './useSpectrum.js';
|
|
8
9
|
|
|
9
|
-
const emptyData = { filters: [] };
|
|
10
|
+
const emptyData: Pick<Spectrum, 'filters'> = { filters: [] };
|
|
10
11
|
type FilterReturnType<T> = T extends Filter1DEntry['name']
|
|
11
12
|
? ExtractFilterEntry<T>
|
|
12
13
|
: T extends Filter2DEntry['name']
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
+
import type { Spectrum } from '@zakodium/nmrium-core';
|
|
2
|
+
|
|
1
3
|
import { useChartData } from '../context/ChartContext.js';
|
|
2
4
|
|
|
3
5
|
import { useSpectrumWithDataSource } from './useSpectrumWithDataSource.js';
|
|
4
6
|
|
|
5
|
-
export default function useSpectrum(
|
|
7
|
+
export default function useSpectrum<Default>(
|
|
8
|
+
defaultValue: Default,
|
|
9
|
+
): Spectrum | Default;
|
|
10
|
+
export default function useSpectrum(): Spectrum | undefined;
|
|
11
|
+
export default function useSpectrum<Default>(defaultValue?: Default) {
|
|
6
12
|
const { data } = useChartData();
|
|
7
13
|
return useSpectrumWithDataSource(data, defaultValue);
|
|
8
14
|
}
|
|
@@ -5,30 +5,38 @@ import { useInsetOptions } from '../1d/inset/InsetProvider.js';
|
|
|
5
5
|
|
|
6
6
|
import { useActiveSpectrum } from './useActiveSpectrum.js';
|
|
7
7
|
|
|
8
|
-
function getSpectrum(
|
|
8
|
+
function getSpectrum<Default>(
|
|
9
9
|
data: Spectrum[],
|
|
10
10
|
spectrumKey: string,
|
|
11
|
-
defaultValue
|
|
11
|
+
defaultValue: Default,
|
|
12
12
|
) {
|
|
13
13
|
return data.find((datum) => datum.id === spectrumKey) || defaultValue;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
export function useSpectrumWithDataSource(
|
|
17
|
-
dataSource:
|
|
18
|
-
defaultValue:
|
|
16
|
+
export function useSpectrumWithDataSource<Default = Spectrum>(
|
|
17
|
+
dataSource: Spectrum[],
|
|
18
|
+
defaultValue: Default | null = null,
|
|
19
19
|
) {
|
|
20
20
|
const activeSpectrum = useActiveSpectrum();
|
|
21
21
|
const inset = useInsetOptions();
|
|
22
22
|
|
|
23
|
-
return useMemo<Spectrum>(() => {
|
|
23
|
+
return useMemo<Spectrum | Default | null>(() => {
|
|
24
24
|
if (!dataSource) return defaultValue;
|
|
25
25
|
|
|
26
26
|
if (inset) {
|
|
27
|
-
return getSpectrum
|
|
27
|
+
return getSpectrum<Default | null>(
|
|
28
|
+
dataSource,
|
|
29
|
+
inset.spectrumKey,
|
|
30
|
+
defaultValue,
|
|
31
|
+
);
|
|
28
32
|
}
|
|
29
33
|
|
|
30
34
|
if (dataSource && activeSpectrum?.selected) {
|
|
31
|
-
return getSpectrum
|
|
35
|
+
return getSpectrum<Default | null>(
|
|
36
|
+
dataSource,
|
|
37
|
+
activeSpectrum.id,
|
|
38
|
+
defaultValue,
|
|
39
|
+
);
|
|
32
40
|
}
|
|
33
41
|
|
|
34
42
|
return defaultValue;
|
|
@@ -5,11 +5,5 @@ export function useTicksConfig() {
|
|
|
5
5
|
const { current } = usePreferences();
|
|
6
6
|
const axis = current.axis ?? workspaceDefaultProperties.axis;
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
const { enabled } = axis.secondaryTicks;
|
|
10
|
-
|
|
11
|
-
return {
|
|
12
|
-
textStyle,
|
|
13
|
-
isSecondaryEnabled: enabled,
|
|
14
|
-
};
|
|
8
|
+
return axis;
|
|
15
9
|
}
|
|
@@ -91,7 +91,7 @@ interface InnerPublicationStringModalProps {
|
|
|
91
91
|
onClose: () => void;
|
|
92
92
|
|
|
93
93
|
acsExportOptions: ACSExportOptions;
|
|
94
|
-
spectrum: Spectrum;
|
|
94
|
+
spectrum: Spectrum | undefined;
|
|
95
95
|
publicationStringVisibility?: {
|
|
96
96
|
isShown: boolean;
|
|
97
97
|
toggle: () => void;
|
|
@@ -150,7 +150,7 @@ function InnerPublicationStringModal(props: InnerPublicationStringModalProps) {
|
|
|
150
150
|
defaultValues,
|
|
151
151
|
validators: { onChange: validationSchema },
|
|
152
152
|
onSubmit: ({ value, formApi }) => {
|
|
153
|
-
assert(
|
|
153
|
+
assert(isSpectrum1D(spectrum));
|
|
154
154
|
const nucleus = spectrum.info.nucleus;
|
|
155
155
|
|
|
156
156
|
const parsedValues = validationSchema.parse(value);
|
|
@@ -188,7 +188,7 @@ function InnerPublicationStringModal(props: InnerPublicationStringModalProps) {
|
|
|
188
188
|
},
|
|
189
189
|
});
|
|
190
190
|
|
|
191
|
-
if (!
|
|
191
|
+
if (!isSpectrum1D(spectrum)) return null;
|
|
192
192
|
|
|
193
193
|
return (
|
|
194
194
|
<>
|