nmrium 2.3.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/peaks/PeakEditionManager.d.ts +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/BrushXY.js +6 -6
- package/lib/component/1d-2d/tools/BrushXY.js.map +1 -1
- 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 +7 -2
- package/lib/component/2d/1d-tracer/Left1DChart.js.map +1 -1
- package/lib/component/2d/1d-tracer/Ranges1D.d.ts +9 -0
- package/lib/component/2d/1d-tracer/Ranges1D.d.ts.map +1 -0
- package/lib/component/2d/1d-tracer/Ranges1D.js +20 -0
- package/lib/component/2d/1d-tracer/Ranges1D.js.map +1 -0
- package/lib/component/2d/1d-tracer/Top1DChart.d.ts.map +1 -1
- package/lib/component/2d/1d-tracer/Top1DChart.js +7 -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/2d/ft/FTContainer.d.ts.map +1 -1
- package/lib/component/2d/ft/FTContainer.js.map +1 -1
- package/lib/component/AnchorSVG.d.ts +36 -0
- package/lib/component/AnchorSVG.d.ts.map +1 -0
- package/lib/component/AnchorSVG.js +140 -0
- package/lib/component/AnchorSVG.js.map +1 -0
- package/lib/component/EventsTrackers/BrushTracker.d.ts.map +1 -1
- package/lib/component/EventsTrackers/BrushTracker.js +16 -2
- 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 +2 -0
- package/lib/component/context/KeyModifierContext.d.ts.map +1 -1
- package/lib/component/context/KeyModifierContext.js +26 -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/elements/DraggableDialog.d.ts.map +1 -1
- package/lib/component/elements/DraggableDialog.js +1 -2
- package/lib/component/elements/DraggableDialog.js.map +1 -1
- package/lib/component/elements/Sections.d.ts +3 -3
- package/lib/component/elements/Sections.d.ts.map +1 -1
- package/lib/component/elements/Sections.js +1 -1
- package/lib/component/elements/Sections.js.map +1 -1
- package/lib/component/elements/export/ExportOptionsModal.js +2 -5
- package/lib/component/elements/export/ExportOptionsModal.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/Header.d.ts.map +1 -1
- package/lib/component/header/Header.js +2 -4
- package/lib/component/header/Header.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/useSaveSettings.d.ts.map +1 -1
- package/lib/component/hooks/useSaveSettings.js +3 -6
- package/lib/component/hooks/useSaveSettings.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 +4 -8
- package/lib/component/modal/PublicationStringModal.js.map +1 -1
- package/lib/component/modal/SaveAsModal.js +3 -6
- package/lib/component/modal/SaveAsModal.js.map +1 -1
- package/lib/component/modal/aboutUs/AboutUsModal.d.ts.map +1 -1
- package/lib/component/modal/aboutUs/AboutUsModal.js +2 -4
- package/lib/component/modal/aboutUs/AboutUsModal.js.map +1 -1
- package/lib/component/modal/editRange/forms/components/NewSignalTab.d.ts.map +1 -1
- package/lib/component/modal/editRange/forms/components/NewSignalTab.js +38 -36
- package/lib/component/modal/editRange/forms/components/NewSignalTab.js.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/errors/context.d.ts +142 -24
- 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 +142 -24
- 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.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/general_settings.js +9 -12
- package/lib/component/modal/setting/tanstack_general_settings/general_settings.js.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_body.d.ts +142 -24
- 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 +120 -24
- 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 +120 -24
- 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 +20 -4
- 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 +120 -24
- 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 +120 -24
- 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 +120 -24
- 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 +120 -24
- 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 +120 -24
- 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 +120 -24
- 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 +120 -24
- 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 +120 -24
- 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 +120 -24
- 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 +120 -24
- 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 +120 -24
- 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 +120 -24
- 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 +120 -24
- 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/PeaksPanel/PeaksPanel.d.ts.map +1 -1
- package/lib/component/panels/PeaksPanel/PeaksPanel.js +1 -9
- package/lib/component/panels/PeaksPanel/PeaksPanel.js.map +1 -1
- package/lib/component/panels/PeaksPanel/PeaksPreferences.js +1 -1
- package/lib/component/panels/PeaksPanel/PeaksPreferences.js.map +1 -1
- package/lib/component/panels/PeaksPanel/PeaksTable.d.ts.map +1 -1
- package/lib/component/panels/PeaksPanel/PeaksTable.js +9 -9
- package/lib/component/panels/PeaksPanel/PeaksTable.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/SummaryPanel/SummaryPanel.d.ts.map +1 -1
- package/lib/component/panels/SummaryPanel/SummaryPanel.js +7 -0
- package/lib/component/panels/SummaryPanel/SummaryPanel.js.map +1 -1
- package/lib/component/panels/filtersPanel/FilterPanel.d.ts.map +1 -1
- package/lib/component/panels/filtersPanel/FilterPanel.js +5 -2
- package/lib/component/panels/filtersPanel/FilterPanel.js.map +1 -1
- package/lib/component/panels/filtersPanel/Filters/base/BaseApodizationOptions.js +1 -1
- package/lib/component/panels/filtersPanel/Filters/base/BaseApodizationOptions.js.map +1 -1
- package/lib/component/panels/filtersPanel/processings_sections_panel.d.ts +2 -0
- package/lib/component/panels/filtersPanel/processings_sections_panel.d.ts.map +1 -0
- package/lib/component/panels/filtersPanel/processings_sections_panel.js +134 -0
- package/lib/component/panels/filtersPanel/processings_sections_panel.js.map +1 -0
- 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 +4 -0
- package/lib/component/reducer/Reducer.js.map +1 -1
- package/lib/component/reducer/actions/CorrelationsActions.js +2 -2
- 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/MoleculeActions.d.ts +9 -0
- package/lib/component/reducer/actions/MoleculeActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/RangesActions.d.ts +11 -2
- package/lib/component/reducer/actions/RangesActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/RangesActions.js +36 -29
- 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/actions/ToolsActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/ToolsActions.js +5 -17
- package/lib/component/reducer/actions/ToolsActions.js.map +1 -1
- package/lib/component/reducer/helper/getTraceSpectrumID.d.ts +5 -0
- package/lib/component/reducer/helper/getTraceSpectrumID.d.ts.map +1 -0
- package/lib/component/reducer/helper/getTraceSpectrumID.js +14 -0
- package/lib/component/reducer/helper/getTraceSpectrumID.js.map +1 -0
- 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 +12 -36
- package/lib/component/toolbar/nmr_toolbar.js.map +1 -1
- package/lib/component/utility/CoreSlot.d.ts +27 -0
- package/lib/component/utility/CoreSlot.d.ts.map +1 -0
- package/lib/component/utility/CoreSlot.js +56 -0
- package/lib/component/utility/CoreSlot.js.map +1 -0
- 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/data1d/Spectrum1D/peaks/autoPeakPicking.d.ts.map +1 -1
- package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +1 -0
- package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.js.map +1 -1
- package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.d.ts.map +1 -1
- package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.js +35 -30
- package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.js.map +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectSignalsByMultipletAnalysis.d.ts.map +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectSignalsByMultipletAnalysis.js +1 -0
- package/lib/data/data1d/Spectrum1D/ranges/detectSignalsByMultipletAnalysis.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 +29 -27
- 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/BrushXY.tsx +8 -8
- 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 +26 -1
- package/src/component/2d/1d-tracer/Ranges1D.tsx +38 -0
- package/src/component/2d/1d-tracer/Top1DChart.tsx +31 -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/2d/ft/FTContainer.tsx +1 -0
- package/src/component/AnchorSVG.tsx +369 -0
- package/src/component/EventsTrackers/BrushTracker.tsx +25 -5
- package/src/component/EventsTrackers/MouseTracker.tsx +21 -0
- package/src/component/context/KeyModifierContext.tsx +32 -8
- package/src/component/elements/D3Axis.tsx +31 -9
- package/src/component/elements/DraggableDialog.tsx +1 -2
- package/src/component/elements/Sections.tsx +4 -4
- package/src/component/elements/export/ExportOptionsModal.tsx +22 -31
- package/src/component/header/AutoPeakPickingOptionPanel.tsx +173 -102
- package/src/component/header/Header.tsx +2 -4
- 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/useSaveSettings.tsx +4 -15
- 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 +8 -14
- package/src/component/modal/SaveAsModal.tsx +41 -50
- package/src/component/modal/aboutUs/AboutUsModal.tsx +5 -4
- package/src/component/modal/editRange/forms/components/NewSignalTab.tsx +57 -57
- package/src/component/modal/setting/tanstack_general_settings/general_settings.tsx +23 -29
- 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/PeaksPanel/PeaksPanel.tsx +1 -8
- package/src/component/panels/PeaksPanel/PeaksPreferences.tsx +1 -1
- package/src/component/panels/PeaksPanel/PeaksTable.tsx +11 -9
- 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/SummaryPanel/SummaryPanel.tsx +13 -11
- package/src/component/panels/filtersPanel/FilterPanel.tsx +10 -0
- package/src/component/panels/filtersPanel/Filters/base/BaseApodizationOptions.tsx +1 -0
- package/src/component/panels/filtersPanel/processings_sections_panel.tsx +307 -0
- 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 +4 -0
- package/src/component/reducer/actions/CorrelationsActions.ts +2 -2
- package/src/component/reducer/actions/FiltersActions.ts +1 -1
- package/src/component/reducer/actions/RangesActions.ts +53 -30
- package/src/component/reducer/actions/SpectraActions.ts +20 -1
- package/src/component/reducer/actions/ToolsActions.ts +5 -21
- package/src/component/reducer/helper/getTraceSpectrumID.tsx +25 -0
- 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 +15 -71
- package/src/component/utility/CoreSlot.tsx +126 -0
- package/src/component/workspaces/workspaceDefaultProperties.ts +19 -2
- package/src/data/data1d/Spectrum1D/initiateDatum1D.ts +14 -8
- package/src/data/data1d/Spectrum1D/peaks/autoPeakPicking.ts +1 -0
- package/src/data/data1d/Spectrum1D/peaks/optimizePeaks.ts +35 -30
- package/src/data/data1d/Spectrum1D/ranges/detectSignalsByMultipletAnalysis.ts +1 -0
- 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/utility/renderCoreSlot.d.ts +0 -11
- package/lib/component/utility/renderCoreSlot.d.ts.map +0 -1
- package/lib/component/utility/renderCoreSlot.js +0 -13
- package/lib/component/utility/renderCoreSlot.js.map +0 -1
- package/src/component/1d/integral/IntegralIndicator.tsx +0 -43
- package/src/component/utility/renderCoreSlot.tsx +0 -21
|
@@ -5,7 +5,6 @@ import type {
|
|
|
5
5
|
Spectrum1D,
|
|
6
6
|
} from '@zakodium/nmrium-core';
|
|
7
7
|
import type { Draft } from 'immer';
|
|
8
|
-
import cloneDeep from 'lodash/cloneDeep.js';
|
|
9
8
|
import { xFindClosestIndex } from 'ml-spectra-processing';
|
|
10
9
|
import { Filters1DManager } from 'nmr-processing';
|
|
11
10
|
|
|
@@ -122,6 +121,7 @@ type ChangeRangeSumAction = ActionType<
|
|
|
122
121
|
type AddRangeAction = ActionType<
|
|
123
122
|
'ADD_RANGE',
|
|
124
123
|
{
|
|
124
|
+
spectrumId?: string;
|
|
125
125
|
range: Range;
|
|
126
126
|
}
|
|
127
127
|
>;
|
|
@@ -133,7 +133,14 @@ type ChangeRangeSignalValueAction = ActionType<
|
|
|
133
133
|
'CHANGE_RANGE_SIGNAL_VALUE',
|
|
134
134
|
{ rangeId: string; signalId: string; value: number }
|
|
135
135
|
>;
|
|
136
|
-
type
|
|
136
|
+
type ChangeSignalDeltaAction = ActionType<
|
|
137
|
+
'CHANGE_SIGNAL_DELTA',
|
|
138
|
+
{ spectrumId: string; rangeId: string; signalId: string; value: number }
|
|
139
|
+
>;
|
|
140
|
+
type UpdateRangAction = ActionType<
|
|
141
|
+
'UPDATE_RANGE',
|
|
142
|
+
{ range: Range; spectrumId?: string }
|
|
143
|
+
>;
|
|
137
144
|
type CutRangAction = ActionType<
|
|
138
145
|
'CUT_RANGE',
|
|
139
146
|
{ ranges: Record<string, Range[]> }
|
|
@@ -189,6 +196,7 @@ export type RangesActions =
|
|
|
189
196
|
| Change1DSignalAssignmentLabelAction
|
|
190
197
|
| ChangeRangesViewFloatingBoxBoundingAction
|
|
191
198
|
| ChangeRangesAssignmentsLabelsByDiaIdsAction
|
|
199
|
+
| ChangeSignalDeltaAction
|
|
192
200
|
| ActionType<
|
|
193
201
|
| 'AUTO_RANGES_SPECTRA_PICKING'
|
|
194
202
|
| 'CHANGE_RANGES_SUM_FLAG'
|
|
@@ -234,6 +242,7 @@ function handleAutoRangesDetection(
|
|
|
234
242
|
broadWidth: 0.05,
|
|
235
243
|
thresholdFactor: 8,
|
|
236
244
|
minMaxRatio,
|
|
245
|
+
maxAbsoluteRatio: minMaxRatio,
|
|
237
246
|
direction: lookNegative ? 'both' : 'positive',
|
|
238
247
|
},
|
|
239
248
|
};
|
|
@@ -321,6 +330,29 @@ function handleChangeRangeSignalKind(
|
|
|
321
330
|
handleUpdateCorrelations(draft);
|
|
322
331
|
}
|
|
323
332
|
}
|
|
333
|
+
//action
|
|
334
|
+
function handleChangeSignalDelta(
|
|
335
|
+
draft: Draft<State>,
|
|
336
|
+
action: ChangeSignalDeltaAction,
|
|
337
|
+
) {
|
|
338
|
+
const { spectrumId, rangeId, signalId, value } = action.payload;
|
|
339
|
+
|
|
340
|
+
const spectrum = getSpectrum(draft, spectrumId);
|
|
341
|
+
if (!isSpectrum1D(spectrum)) return;
|
|
342
|
+
|
|
343
|
+
const rangeIndex = getRangeIndex(spectrum, rangeId);
|
|
344
|
+
const range = spectrum.ranges.values[rangeIndex];
|
|
345
|
+
if (range.signals) {
|
|
346
|
+
const signalIndex = range.signals.findIndex(
|
|
347
|
+
(_signal) => _signal.id === signalId,
|
|
348
|
+
);
|
|
349
|
+
if (signalIndex !== -1) {
|
|
350
|
+
range.signals[signalIndex].delta = value;
|
|
351
|
+
}
|
|
352
|
+
updateRangesRelativeValues(spectrum);
|
|
353
|
+
handleUpdateCorrelations(draft);
|
|
354
|
+
}
|
|
355
|
+
}
|
|
324
356
|
|
|
325
357
|
//action
|
|
326
358
|
function handleSaveEditedRange(
|
|
@@ -332,23 +364,19 @@ function handleSaveEditedRange(
|
|
|
332
364
|
const spectrum = getSpectrum(draft);
|
|
333
365
|
if (!isSpectrum1D(spectrum)) return;
|
|
334
366
|
|
|
335
|
-
|
|
336
|
-
const _editedRowData: any = unlink(range);
|
|
337
|
-
|
|
338
|
-
delete _editedRowData.tableMetaInfo;
|
|
339
|
-
delete _editedRowData.rowKey;
|
|
340
|
-
// remove assignments in assignment hook data
|
|
341
|
-
// for now: clear all assignments for this range because signals or levels to store might have changed
|
|
342
|
-
const rangeIndex = getRangeIndex(spectrum, _editedRowData.id);
|
|
367
|
+
const rangeIndex = getRangeIndex(spectrum, range.id);
|
|
343
368
|
if (rangeIndex === -1) {
|
|
344
369
|
throw new Error('unreachable');
|
|
345
370
|
}
|
|
346
371
|
|
|
347
|
-
|
|
348
|
-
|
|
372
|
+
// Remove assignments in global state
|
|
373
|
+
unlink(range, -1);
|
|
374
|
+
|
|
375
|
+
if (range.id === 'new') {
|
|
376
|
+
range.id = crypto.randomUUID();
|
|
349
377
|
}
|
|
350
378
|
|
|
351
|
-
spectrum.ranges.values[rangeIndex] =
|
|
379
|
+
spectrum.ranges.values[rangeIndex] = range;
|
|
352
380
|
updateRangesRelativeValues(spectrum);
|
|
353
381
|
handleUpdateCorrelations(draft);
|
|
354
382
|
resetSelectedTool(draft);
|
|
@@ -367,11 +395,10 @@ function deleteSignal1D(draft: Draft<State>, props: DeleteSignalProps) {
|
|
|
367
395
|
const signalIndex = range.signals.findIndex(
|
|
368
396
|
(_signal) => _signal.id === signalId,
|
|
369
397
|
);
|
|
398
|
+
if (signalIndex === -1) return;
|
|
399
|
+
|
|
370
400
|
// Remove assignments for the signal range object in the global state.
|
|
371
|
-
const _range = unlink(
|
|
372
|
-
unlinkType: 'signal',
|
|
373
|
-
signalIndex,
|
|
374
|
-
});
|
|
401
|
+
const _range = unlink(range, signalIndex);
|
|
375
402
|
|
|
376
403
|
_range.signals.splice(signalIndex, 1);
|
|
377
404
|
spectrum.ranges.values[rangeIndex] = _range;
|
|
@@ -400,16 +427,11 @@ function clearSignalAssignment(
|
|
|
400
427
|
const ranges = spectrum.ranges.values;
|
|
401
428
|
if (rangeKey) {
|
|
402
429
|
const rangeIndex = getRangeIndex(spectrum, rangeKey);
|
|
403
|
-
|
|
404
|
-
ranges[rangeIndex] = unlink(ranges[rangeIndex], {
|
|
405
|
-
unlinkType,
|
|
406
|
-
signalIndex,
|
|
407
|
-
});
|
|
430
|
+
ranges[rangeIndex] = unlink(ranges[rangeIndex], signalIndex);
|
|
408
431
|
} else {
|
|
409
|
-
const
|
|
410
|
-
|
|
411
|
-
}
|
|
412
|
-
spectrum.ranges.values = newRanges;
|
|
432
|
+
for (const range of ranges) {
|
|
433
|
+
unlink(range, -1);
|
|
434
|
+
}
|
|
413
435
|
}
|
|
414
436
|
}
|
|
415
437
|
|
|
@@ -517,9 +539,9 @@ function initiateRangeSumOptions(datum: Spectrum1D, options: SumParams) {
|
|
|
517
539
|
|
|
518
540
|
//action
|
|
519
541
|
function handleAddRange(draft: Draft<State>, action: AddRangeAction) {
|
|
520
|
-
const { range } = action.payload;
|
|
542
|
+
const { range, spectrumId } = action.payload;
|
|
521
543
|
|
|
522
|
-
const spectrum = getSpectrum(draft);
|
|
544
|
+
const spectrum = getSpectrum(draft, spectrumId);
|
|
523
545
|
if (!isSpectrum1D(spectrum)) return;
|
|
524
546
|
|
|
525
547
|
const { molecules } = draft;
|
|
@@ -583,9 +605,9 @@ function handleChangeRangesSumFlag(draft: Draft<State>) {
|
|
|
583
605
|
|
|
584
606
|
//action
|
|
585
607
|
function handleUpdateRange(draft: Draft<State>, action: UpdateRangAction) {
|
|
586
|
-
const { range } = action.payload;
|
|
608
|
+
const { range, spectrumId } = action.payload;
|
|
587
609
|
|
|
588
|
-
const spectrum = getSpectrum(draft);
|
|
610
|
+
const spectrum = getSpectrum(draft, spectrumId);
|
|
589
611
|
if (!isSpectrum1D(spectrum)) return;
|
|
590
612
|
|
|
591
613
|
const index = spectrum.ranges.values.findIndex(
|
|
@@ -720,6 +742,7 @@ export {
|
|
|
720
742
|
handleChangeRangesAssignmentLabelsByDiaIds,
|
|
721
743
|
handleChangeRangesSumFlag,
|
|
722
744
|
handleChangeRangesViewFloatingBoxBounding,
|
|
745
|
+
handleChangeSignalDelta,
|
|
723
746
|
handleCutRange,
|
|
724
747
|
handleDeleteRange,
|
|
725
748
|
handleDeleteRangePeak,
|
|
@@ -163,6 +163,15 @@ type UpdateSpectrumMetaAction = ActionType<
|
|
|
163
163
|
}
|
|
164
164
|
>;
|
|
165
165
|
|
|
166
|
+
type SetSpectrumAction = ActionType<
|
|
167
|
+
'SET_SPECTRUM',
|
|
168
|
+
{
|
|
169
|
+
index: number;
|
|
170
|
+
spectrum: Spectrum;
|
|
171
|
+
onProduce: (draft: Draft<State>, processedSpectrum: Spectrum) => void;
|
|
172
|
+
}
|
|
173
|
+
>;
|
|
174
|
+
|
|
166
175
|
export type SpectrumActions =
|
|
167
176
|
| ActionType<'TOGGLE_SPECTRA_LEGEND'>
|
|
168
177
|
| ChangeSpectrumVisibilityByIdAction
|
|
@@ -176,7 +185,8 @@ export type SpectrumActions =
|
|
|
176
185
|
| ImportSpectraMetaInfoAction
|
|
177
186
|
| ReColorSpectraBasedOnDistinctValueAction
|
|
178
187
|
| SimulateSpectrumAction
|
|
179
|
-
| UpdateSpectrumMetaAction
|
|
188
|
+
| UpdateSpectrumMetaAction
|
|
189
|
+
| SetSpectrumAction;
|
|
180
190
|
|
|
181
191
|
function checkIsVisible2D(datum: Spectrum2D): boolean {
|
|
182
192
|
if (!datum.display.isPositiveVisible && !datum.display.isNegativeVisible) {
|
|
@@ -808,6 +818,14 @@ function handleUpdateSpectrumMeta(
|
|
|
808
818
|
}
|
|
809
819
|
}
|
|
810
820
|
|
|
821
|
+
function setSpectrum(draft: Draft<State>, action: SetSpectrumAction) {
|
|
822
|
+
const { index, spectrum, onProduce } = action.payload;
|
|
823
|
+
|
|
824
|
+
draft.data[index] = spectrum;
|
|
825
|
+
|
|
826
|
+
onProduce(draft, spectrum);
|
|
827
|
+
}
|
|
828
|
+
|
|
811
829
|
export {
|
|
812
830
|
handleAddMissingProjectionHandler,
|
|
813
831
|
handleAlignSpectraHandler,
|
|
@@ -823,4 +841,5 @@ export {
|
|
|
823
841
|
handleToggleSpectraLegend,
|
|
824
842
|
handleUpdateSpectrumMeta,
|
|
825
843
|
setSpectraMetaInfo,
|
|
844
|
+
setSpectrum,
|
|
826
845
|
};
|
|
@@ -6,7 +6,6 @@ import { isSpectrum1D } from '../../../data/data1d/Spectrum1D/index.js';
|
|
|
6
6
|
import { contoursManager } from '../../../data/data2d/Spectrum2D/contours.js';
|
|
7
7
|
import { getXScale } from '../../1d/utilities/scale.js';
|
|
8
8
|
import type { Layout } from '../../2d/utilities/DimensionLayout.js';
|
|
9
|
-
import { LAYOUT } from '../../2d/utilities/DimensionLayout.js';
|
|
10
9
|
import { get2DXScale, get2DYScale } from '../../2d/utilities/scale.js';
|
|
11
10
|
import type {
|
|
12
11
|
BrushAxis,
|
|
@@ -25,6 +24,7 @@ import zoomHistoryManager, {
|
|
|
25
24
|
} from '../helper/ZoomHistoryManager.js';
|
|
26
25
|
import { getActiveSpectra } from '../helper/getActiveSpectra.js';
|
|
27
26
|
import { getSpectrum } from '../helper/getSpectrum.js';
|
|
27
|
+
import { getTraceSpectrumID } from '../helper/getTraceSpectrumID.tsx';
|
|
28
28
|
import { getTwoDimensionPhaseCorrectionOptions } from '../helper/getTwoDimensionPhaseCorrectionOptions.js';
|
|
29
29
|
import { getVerticalAlign } from '../helper/getVerticalAlign.js';
|
|
30
30
|
import { setIntegralsViewProperty } from '../helper/setIntegralsViewProperty.js';
|
|
@@ -173,18 +173,6 @@ function setSelectedTool(draft: Draft<State>, action: SetSelectedToolAction) {
|
|
|
173
173
|
const { selectedTool } = action.payload;
|
|
174
174
|
activateTool(draft, { toolId: selectedTool });
|
|
175
175
|
}
|
|
176
|
-
//utility
|
|
177
|
-
function getSpectrumID(draft: Draft<State>, index: any): string | null {
|
|
178
|
-
const { activeSpectra, activeTab } = draft.view.spectra;
|
|
179
|
-
|
|
180
|
-
const spectra = activeSpectra[activeTab.split(',')[index]];
|
|
181
|
-
|
|
182
|
-
if (spectra?.length === 1) {
|
|
183
|
-
return spectra[0].id;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
return null;
|
|
187
|
-
}
|
|
188
176
|
|
|
189
177
|
function setSpectraVerticalAlign(draft: Draft<State>) {
|
|
190
178
|
const currentVerticalAlign = getVerticalAlign(draft);
|
|
@@ -314,14 +302,10 @@ function handleZoom(draft: Draft<State>, action: ZoomAction) {
|
|
|
314
302
|
}
|
|
315
303
|
} else {
|
|
316
304
|
// change the vertical scale of 1D traces
|
|
317
|
-
const
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
if (id) {
|
|
322
|
-
const domain = yDomains[id];
|
|
323
|
-
yDomains[id] = wheelZoom(options, domain);
|
|
324
|
-
}
|
|
305
|
+
const id = getTraceSpectrumID(draft, trackID);
|
|
306
|
+
if (id) {
|
|
307
|
+
const domain = yDomains[id];
|
|
308
|
+
yDomains[id] = wheelZoom(options, domain);
|
|
325
309
|
}
|
|
326
310
|
}
|
|
327
311
|
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Draft } from 'immer';
|
|
2
|
+
|
|
3
|
+
import type { Layout } from '../../2d/utilities/DimensionLayout.ts';
|
|
4
|
+
import { LAYOUT } from '../../2d/utilities/DimensionLayout.ts';
|
|
5
|
+
import type { State } from '../Reducer.ts';
|
|
6
|
+
|
|
7
|
+
//utility
|
|
8
|
+
export function getTraceSpectrumID(
|
|
9
|
+
draft: Draft<State>,
|
|
10
|
+
trackID: Layout | undefined,
|
|
11
|
+
): string | null {
|
|
12
|
+
const index = trackID === LAYOUT.top ? 0 : trackID === LAYOUT.left ? 1 : null;
|
|
13
|
+
|
|
14
|
+
if (index === null) return null;
|
|
15
|
+
|
|
16
|
+
const { activeSpectra, activeTab } = draft.view.spectra;
|
|
17
|
+
|
|
18
|
+
const spectra = activeSpectra[activeTab.split(',')[index]];
|
|
19
|
+
|
|
20
|
+
if (spectra?.length === 1) {
|
|
21
|
+
return spectra[0].id;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
@@ -1,22 +1,30 @@
|
|
|
1
1
|
import type { Draft } from 'immer';
|
|
2
|
+
import { original } from 'immer';
|
|
2
3
|
import cloneDeep from 'lodash/cloneDeep.js';
|
|
3
4
|
|
|
4
|
-
import type {
|
|
5
|
+
import type {
|
|
6
|
+
PreferencesState,
|
|
7
|
+
SetPreferencesAction,
|
|
8
|
+
WorkspaceWithSource,
|
|
9
|
+
} from '../preferencesReducer.js';
|
|
5
10
|
import { getActiveWorkspace } from '../utilities/getActiveWorkspace.js';
|
|
6
11
|
|
|
7
|
-
export function setPreferences(
|
|
8
|
-
|
|
12
|
+
export function setPreferences(
|
|
13
|
+
draft: Draft<PreferencesState>,
|
|
14
|
+
action: SetPreferencesAction,
|
|
15
|
+
) {
|
|
16
|
+
const currentWorkspacePreferences = getActiveWorkspace(original(draft));
|
|
9
17
|
|
|
10
|
-
if (action
|
|
18
|
+
if ('payload' in action) {
|
|
11
19
|
const preferences = action.payload;
|
|
12
20
|
|
|
13
|
-
draft.workspaces[draft.workspace.current] = {
|
|
21
|
+
draft.workspaces[draft.workspace.current] = cloneDeep({
|
|
14
22
|
...currentWorkspacePreferences,
|
|
15
23
|
...preferences,
|
|
16
|
-
};
|
|
24
|
+
}) as WorkspaceWithSource;
|
|
25
|
+
} else {
|
|
26
|
+
draft.originalWorkspaces[draft.workspace.current] = cloneDeep(
|
|
27
|
+
original(draft.workspaces[draft.workspace.current]),
|
|
28
|
+
);
|
|
17
29
|
}
|
|
18
|
-
|
|
19
|
-
draft.originalWorkspaces[draft.workspace.current] = cloneDeep(
|
|
20
|
-
draft.workspaces[draft.workspace.current],
|
|
21
|
-
);
|
|
22
30
|
}
|
|
@@ -1,12 +1,58 @@
|
|
|
1
1
|
import type { Info1D, Info2D } from '@zakodium/nmr-types';
|
|
2
2
|
import type { NMRiumToolbarPreferences } from '@zakodium/nmrium-core';
|
|
3
|
+
import {
|
|
4
|
+
SvgNmrAlignBottom,
|
|
5
|
+
SvgNmrAlignCenter,
|
|
6
|
+
SvgNmrApodization,
|
|
7
|
+
SvgNmrBaselineCorrection,
|
|
8
|
+
SvgNmrFourierTransform,
|
|
9
|
+
SvgNmrIntegrate,
|
|
10
|
+
SvgNmrMultipleAnalysis,
|
|
11
|
+
SvgNmrOverlay3,
|
|
12
|
+
SvgNmrOverlay3Aligned,
|
|
13
|
+
SvgNmrPeakPicking,
|
|
14
|
+
SvgNmrPhaseCorrection,
|
|
15
|
+
SvgNmrRangePicking,
|
|
16
|
+
SvgNmrRealImag,
|
|
17
|
+
SvgNmrZeroFilling,
|
|
18
|
+
} from 'cheminfo-font';
|
|
3
19
|
import { Filters1D, Filters2D } from 'nmr-processing';
|
|
20
|
+
import type { ComponentType } from 'react';
|
|
21
|
+
import {
|
|
22
|
+
FaDiceFour,
|
|
23
|
+
FaExpand,
|
|
24
|
+
FaFileExport,
|
|
25
|
+
FaFileImport,
|
|
26
|
+
FaICursor,
|
|
27
|
+
} from 'react-icons/fa';
|
|
28
|
+
import { PiKnifeBold, PiSelectionPlusDuotone } from 'react-icons/pi';
|
|
29
|
+
import { TbZoom } from 'react-icons/tb';
|
|
4
30
|
|
|
5
31
|
import type { DisplayerMode } from '../reducer/Reducer.js';
|
|
6
32
|
|
|
7
33
|
type InfoKey = keyof Info1D | keyof Info2D;
|
|
8
34
|
|
|
9
|
-
|
|
35
|
+
interface StaticIcon {
|
|
36
|
+
icon: ToolIconComponent;
|
|
37
|
+
getIcon?: never;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
interface DynamicIcon {
|
|
41
|
+
icon?: never;
|
|
42
|
+
getIcon: (ctx: IconDataContext) => ToolIconComponent;
|
|
43
|
+
}
|
|
44
|
+
export interface IconOptions {
|
|
45
|
+
fontSize?: number;
|
|
46
|
+
strokeWidth?: number;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export type ToolIconComponent = ComponentType<IconOptions>;
|
|
50
|
+
|
|
51
|
+
export interface IconDataContext {
|
|
52
|
+
verticalAlign?: 'bottom' | 'center' | 'stack';
|
|
53
|
+
isRealSpectrumShown?: boolean;
|
|
54
|
+
}
|
|
55
|
+
interface BaseToolOption {
|
|
10
56
|
id: Tool;
|
|
11
57
|
label: string;
|
|
12
58
|
mode?: DisplayerMode;
|
|
@@ -32,6 +78,8 @@ export interface ToolOptionItem {
|
|
|
32
78
|
isExperimental?: true;
|
|
33
79
|
}
|
|
34
80
|
|
|
81
|
+
export type ToolOptionItem = BaseToolOption & (StaticIcon | DynamicIcon);
|
|
82
|
+
|
|
35
83
|
export type MainTool = keyof NMRiumToolbarPreferences;
|
|
36
84
|
|
|
37
85
|
/**
|
|
@@ -47,6 +95,7 @@ export const options: RecordOptions = {
|
|
|
47
95
|
zoom: {
|
|
48
96
|
id: 'zoom',
|
|
49
97
|
label: 'Zoom in / out',
|
|
98
|
+
icon: TbZoom,
|
|
50
99
|
hasOptionPanel: false,
|
|
51
100
|
isFilter: false,
|
|
52
101
|
isToggle: true,
|
|
@@ -54,6 +103,7 @@ export const options: RecordOptions = {
|
|
|
54
103
|
peakPicking: {
|
|
55
104
|
id: 'peakPicking',
|
|
56
105
|
label: 'Peaks picking',
|
|
106
|
+
icon: SvgNmrPeakPicking,
|
|
57
107
|
hasOptionPanel: true,
|
|
58
108
|
isFilter: false,
|
|
59
109
|
mode: '1D',
|
|
@@ -69,6 +119,7 @@ export const options: RecordOptions = {
|
|
|
69
119
|
integral: {
|
|
70
120
|
id: 'integral',
|
|
71
121
|
label: 'Integral Tool',
|
|
122
|
+
icon: SvgNmrIntegrate,
|
|
72
123
|
hasOptionPanel: false,
|
|
73
124
|
isFilter: false,
|
|
74
125
|
mode: '1D',
|
|
@@ -82,6 +133,7 @@ export const options: RecordOptions = {
|
|
|
82
133
|
inset: {
|
|
83
134
|
id: 'inset',
|
|
84
135
|
label: 'Inset Tool',
|
|
136
|
+
icon: PiSelectionPlusDuotone,
|
|
85
137
|
hasOptionPanel: false,
|
|
86
138
|
isFilter: false,
|
|
87
139
|
mode: '1D',
|
|
@@ -95,6 +147,7 @@ export const options: RecordOptions = {
|
|
|
95
147
|
zonePicking: {
|
|
96
148
|
id: 'zonePicking',
|
|
97
149
|
label: 'Zone tool',
|
|
150
|
+
icon: FaDiceFour,
|
|
98
151
|
hasOptionPanel: true,
|
|
99
152
|
isFilter: false,
|
|
100
153
|
mode: '2D',
|
|
@@ -108,6 +161,7 @@ export const options: RecordOptions = {
|
|
|
108
161
|
slicing: {
|
|
109
162
|
id: 'slicing',
|
|
110
163
|
label: 'Slicing tool',
|
|
164
|
+
icon: PiKnifeBold,
|
|
111
165
|
hasOptionPanel: false,
|
|
112
166
|
isFilter: false,
|
|
113
167
|
mode: '2D',
|
|
@@ -121,6 +175,7 @@ export const options: RecordOptions = {
|
|
|
121
175
|
rangePicking: {
|
|
122
176
|
id: 'rangePicking',
|
|
123
177
|
label: 'Range picking and multiplet analysis',
|
|
178
|
+
icon: SvgNmrRangePicking,
|
|
124
179
|
hasOptionPanel: true,
|
|
125
180
|
isFilter: false,
|
|
126
181
|
mode: '1D',
|
|
@@ -134,6 +189,7 @@ export const options: RecordOptions = {
|
|
|
134
189
|
apodization: {
|
|
135
190
|
id: Filters1D.apodization.name,
|
|
136
191
|
label: Filters1D.apodization.label,
|
|
192
|
+
icon: SvgNmrApodization,
|
|
137
193
|
hasOptionPanel: true,
|
|
138
194
|
isFilter: true,
|
|
139
195
|
mode: '1D',
|
|
@@ -150,6 +206,7 @@ export const options: RecordOptions = {
|
|
|
150
206
|
zeroFilling: {
|
|
151
207
|
id: Filters1D.zeroFilling.name,
|
|
152
208
|
label: Filters1D.zeroFilling.label,
|
|
209
|
+
icon: SvgNmrZeroFilling,
|
|
153
210
|
hasOptionPanel: true,
|
|
154
211
|
isFilter: true,
|
|
155
212
|
mode: '1D',
|
|
@@ -166,6 +223,7 @@ export const options: RecordOptions = {
|
|
|
166
223
|
zeroFillingDimension1: {
|
|
167
224
|
id: Filters2D.zeroFillingDimension1.name,
|
|
168
225
|
label: Filters2D.zeroFillingDimension1.label,
|
|
226
|
+
icon: SvgNmrZeroFilling,
|
|
169
227
|
hasOptionPanel: true,
|
|
170
228
|
isFilter: true,
|
|
171
229
|
mode: '2D',
|
|
@@ -182,6 +240,7 @@ export const options: RecordOptions = {
|
|
|
182
240
|
zeroFillingDimension2: {
|
|
183
241
|
id: Filters2D.zeroFillingDimension2.name,
|
|
184
242
|
label: Filters2D.zeroFillingDimension2.label,
|
|
243
|
+
icon: SvgNmrZeroFilling,
|
|
185
244
|
hasOptionPanel: true,
|
|
186
245
|
isFilter: true,
|
|
187
246
|
mode: '2D',
|
|
@@ -199,6 +258,7 @@ export const options: RecordOptions = {
|
|
|
199
258
|
phaseCorrection: {
|
|
200
259
|
id: Filters1D.phaseCorrection.name,
|
|
201
260
|
label: Filters1D.phaseCorrection.label,
|
|
261
|
+
icon: SvgNmrPhaseCorrection,
|
|
202
262
|
hasOptionPanel: true,
|
|
203
263
|
isFilter: true,
|
|
204
264
|
mode: '1D',
|
|
@@ -215,6 +275,7 @@ export const options: RecordOptions = {
|
|
|
215
275
|
baselineCorrection: {
|
|
216
276
|
id: Filters1D.baselineCorrection.name,
|
|
217
277
|
label: Filters1D.baselineCorrection.label,
|
|
278
|
+
icon: SvgNmrBaselineCorrection,
|
|
218
279
|
hasOptionPanel: true,
|
|
219
280
|
isFilter: true,
|
|
220
281
|
mode: '1D',
|
|
@@ -228,6 +289,7 @@ export const options: RecordOptions = {
|
|
|
228
289
|
multipleSpectraAnalysis: {
|
|
229
290
|
id: 'multipleSpectraAnalysis',
|
|
230
291
|
label: 'Multiple spectra integration',
|
|
292
|
+
icon: SvgNmrMultipleAnalysis,
|
|
231
293
|
hasOptionPanel: false,
|
|
232
294
|
isFilter: false,
|
|
233
295
|
mode: '1D',
|
|
@@ -242,6 +304,7 @@ export const options: RecordOptions = {
|
|
|
242
304
|
exclusionZones: {
|
|
243
305
|
id: 'exclusionZones',
|
|
244
306
|
label: 'Exclusion zones',
|
|
307
|
+
icon: SvgNmrMultipleAnalysis,
|
|
245
308
|
hasOptionPanel: false,
|
|
246
309
|
isFilter: true,
|
|
247
310
|
mode: '1D',
|
|
@@ -266,6 +329,7 @@ export const options: RecordOptions = {
|
|
|
266
329
|
],
|
|
267
330
|
selectedSpectra: { min: 0 },
|
|
268
331
|
isToggle: true,
|
|
332
|
+
icon: SvgNmrMultipleAnalysis,
|
|
269
333
|
},
|
|
270
334
|
databaseRangesSelection: {
|
|
271
335
|
id: 'databaseRangesSelection',
|
|
@@ -279,10 +343,12 @@ export const options: RecordOptions = {
|
|
|
279
343
|
},
|
|
280
344
|
],
|
|
281
345
|
isToggle: true,
|
|
346
|
+
icon: FaICursor,
|
|
282
347
|
},
|
|
283
348
|
exportAs: {
|
|
284
349
|
id: 'exportAs',
|
|
285
350
|
label: 'Export as',
|
|
351
|
+
icon: FaFileExport,
|
|
286
352
|
hasOptionPanel: false,
|
|
287
353
|
isFilter: false,
|
|
288
354
|
isToggle: false,
|
|
@@ -290,6 +356,7 @@ export const options: RecordOptions = {
|
|
|
290
356
|
fft: {
|
|
291
357
|
id: 'fft',
|
|
292
358
|
label: 'Fourier transform',
|
|
359
|
+
icon: SvgNmrFourierTransform,
|
|
293
360
|
hasOptionPanel: false,
|
|
294
361
|
isFilter: true,
|
|
295
362
|
mode: '1D',
|
|
@@ -306,6 +373,7 @@ export const options: RecordOptions = {
|
|
|
306
373
|
fftDimension1: {
|
|
307
374
|
id: 'fftDimension1',
|
|
308
375
|
label: 'Fourier transform dimension 1',
|
|
376
|
+
icon: SvgNmrFourierTransform,
|
|
309
377
|
hasOptionPanel: false,
|
|
310
378
|
isFilter: true,
|
|
311
379
|
mode: '2D',
|
|
@@ -322,6 +390,7 @@ export const options: RecordOptions = {
|
|
|
322
390
|
fftDimension2: {
|
|
323
391
|
id: 'fftDimension2',
|
|
324
392
|
label: 'Fourier transform dimension 2',
|
|
393
|
+
icon: SvgNmrFourierTransform,
|
|
325
394
|
hasOptionPanel: false,
|
|
326
395
|
isFilter: true,
|
|
327
396
|
mode: '2D',
|
|
@@ -339,6 +408,7 @@ export const options: RecordOptions = {
|
|
|
339
408
|
phaseCorrectionTwoDimensions: {
|
|
340
409
|
id: 'phaseCorrectionTwoDimensions',
|
|
341
410
|
label: 'Phase correction two dimension',
|
|
411
|
+
icon: SvgNmrPhaseCorrection,
|
|
342
412
|
hasOptionPanel: true,
|
|
343
413
|
isFilter: true,
|
|
344
414
|
mode: '2D',
|
|
@@ -352,6 +422,7 @@ export const options: RecordOptions = {
|
|
|
352
422
|
import: {
|
|
353
423
|
id: 'import',
|
|
354
424
|
label: 'Import',
|
|
425
|
+
icon: FaFileImport,
|
|
355
426
|
hasOptionPanel: false,
|
|
356
427
|
isFilter: false,
|
|
357
428
|
isToggle: false,
|
|
@@ -359,6 +430,7 @@ export const options: RecordOptions = {
|
|
|
359
430
|
realImaginary: {
|
|
360
431
|
id: 'realImaginary',
|
|
361
432
|
label: 'Real / Imaginary',
|
|
433
|
+
icon: SvgNmrRealImag,
|
|
362
434
|
hasOptionPanel: false,
|
|
363
435
|
isFilter: false,
|
|
364
436
|
mode: '1D',
|
|
@@ -372,6 +444,9 @@ export const options: RecordOptions = {
|
|
|
372
444
|
spectraCenterAlignments: {
|
|
373
445
|
id: 'spectraCenterAlignments',
|
|
374
446
|
label: 'Align spectrum',
|
|
447
|
+
// depends on current vertical alignment state
|
|
448
|
+
getIcon: (idc: IconDataContext) =>
|
|
449
|
+
idc.verticalAlign === 'bottom' ? SvgNmrAlignCenter : SvgNmrAlignBottom,
|
|
375
450
|
hasOptionPanel: false,
|
|
376
451
|
isFilter: false,
|
|
377
452
|
mode: '1D',
|
|
@@ -380,6 +455,9 @@ export const options: RecordOptions = {
|
|
|
380
455
|
spectraStackAlignments: {
|
|
381
456
|
id: 'spectraStackAlignments',
|
|
382
457
|
label: 'Stack spectra',
|
|
458
|
+
// depends on current vertical alignment state
|
|
459
|
+
getIcon: (idc: IconDataContext) =>
|
|
460
|
+
idc.verticalAlign === 'stack' ? SvgNmrOverlay3Aligned : SvgNmrOverlay3,
|
|
383
461
|
hasOptionPanel: false,
|
|
384
462
|
isFilter: false,
|
|
385
463
|
mode: '1D',
|
|
@@ -394,6 +472,7 @@ export const options: RecordOptions = {
|
|
|
394
472
|
zoomOut: {
|
|
395
473
|
id: 'zoomOut',
|
|
396
474
|
label: 'Zoom out',
|
|
475
|
+
icon: FaExpand,
|
|
397
476
|
hasOptionPanel: false,
|
|
398
477
|
isFilter: false,
|
|
399
478
|
isToggle: false,
|
|
@@ -404,10 +483,12 @@ export const options: RecordOptions = {
|
|
|
404
483
|
hasOptionPanel: false,
|
|
405
484
|
isFilter: false,
|
|
406
485
|
isToggle: false,
|
|
486
|
+
icon: SvgNmrRangePicking,
|
|
407
487
|
},
|
|
408
488
|
apodizationDimension1: {
|
|
409
489
|
id: Filters2D.apodizationDimension1.name,
|
|
410
490
|
label: Filters2D.apodizationDimension1.label,
|
|
491
|
+
icon: SvgNmrApodization,
|
|
411
492
|
hasOptionPanel: true,
|
|
412
493
|
isFilter: true,
|
|
413
494
|
mode: '2D',
|
|
@@ -421,6 +502,7 @@ export const options: RecordOptions = {
|
|
|
421
502
|
apodizationDimension2: {
|
|
422
503
|
id: Filters2D.apodizationDimension2.name,
|
|
423
504
|
label: Filters2D.apodizationDimension2.label,
|
|
505
|
+
icon: SvgNmrApodization,
|
|
424
506
|
hasOptionPanel: true,
|
|
425
507
|
isFilter: true,
|
|
426
508
|
mode: '2D',
|
|
@@ -436,3 +518,12 @@ export const options: RecordOptions = {
|
|
|
436
518
|
isToggle: true,
|
|
437
519
|
},
|
|
438
520
|
};
|
|
521
|
+
|
|
522
|
+
export function getToolIcon(
|
|
523
|
+
id: Tool,
|
|
524
|
+
idc: IconDataContext = {},
|
|
525
|
+
): ToolIconComponent | undefined {
|
|
526
|
+
const option = options[id];
|
|
527
|
+
|
|
528
|
+
return 'getIcon' in option ? option.getIcon?.(idc) : option.icon;
|
|
529
|
+
}
|