diff --git a/src/component/1d/FooterBanner.tsx b/src/component/1d/FooterBanner.tsx index 3254e48ad..9abf605c6 100644 --- a/src/component/1d/FooterBanner.tsx +++ b/src/component/1d/FooterBanner.tsx @@ -1,7 +1,7 @@ /** @jsxImportSource @emotion/react */ import { css } from '@emotion/react'; import { xFindClosestIndex } from 'ml-spectra-processing'; -import { Spectrum1D } from 'nmr-load-save'; +import { ActiveSpectrum, Spectrum1D } from 'nmr-load-save'; import { memo } from 'react'; import { BsCursor } from 'react-icons/bs'; import { IoPulseSharp } from 'react-icons/io5'; @@ -14,7 +14,6 @@ import { useScaleChecked } from '../context/ScaleContext'; import { useActiveSpectrum } from '../hooks/useActiveSpectrum'; import { useFormatNumberByNucleus } from '../hooks/useFormatNumberByNucleus'; import useSpectrum from '../hooks/useSpectrum'; -import { ActiveSpectrum } from '../reducer/Reducer'; const styles = css` display: flex; diff --git a/src/component/modal/MultipletAnalysisModal.tsx b/src/component/modal/MultipletAnalysisModal.tsx index a072fa200..99e6aa03c 100644 --- a/src/component/modal/MultipletAnalysisModal.tsx +++ b/src/component/modal/MultipletAnalysisModal.tsx @@ -2,13 +2,12 @@ import { css } from '@emotion/react'; import { xGetFromToIndex, xyToXYObject } from 'ml-spectra-processing'; import { analyseMultiplet } from 'multiplet-analysis'; -import { Spectrum } from 'nmr-load-save'; +import { ActiveSpectrum, Spectrum } from 'nmr-load-save'; import { useState, useEffect } from 'react'; import { Plot, LineSeries, Axis } from 'react-plot'; import { Modal } from 'react-science/ui'; import { isSpectrum2D } from '../../data/data2d/Spectrum2D'; -import { ActiveSpectrum } from '../reducer/Reducer'; const styles = css` button:focus { diff --git a/src/component/panels/SpectrumsPanel/SpectraPanelHeader.tsx b/src/component/panels/SpectrumsPanel/SpectraPanelHeader.tsx index 7b30e596f..f00e17236 100644 --- a/src/component/panels/SpectrumsPanel/SpectraPanelHeader.tsx +++ b/src/component/panels/SpectrumsPanel/SpectraPanelHeader.tsx @@ -1,5 +1,5 @@ import { SvgNmrSameTop, SvgNmrResetScale } from 'cheminfo-font'; -import { Spectrum, Spectrum2D } from 'nmr-load-save'; +import { ActiveSpectrum, Spectrum, Spectrum2D } from 'nmr-load-save'; import { memo, useCallback } from 'react'; import { FaCreativeCommonsSamplingPlus, @@ -15,7 +15,7 @@ import { useAlert } from '../../elements/popup/Alert'; import { useModal } from '../../elements/popup/Modal'; import { useActiveSpectra } from '../../hooks/useActiveSpectra'; import useSpectrum from '../../hooks/useSpectrum'; -import { ActiveSpectrum, DisplayerMode } from '../../reducer/Reducer'; +import { DisplayerMode } from '../../reducer/Reducer'; import { getSpectraByNucleus } from '../../utility/getSpectraByNucleus'; import DefaultPanelHeader from '../header/DefaultPanelHeader'; import { SpectraAutomaticPickingButton } from '../header/SpectraAutomaticPickingButton'; diff --git a/src/component/panels/SpectrumsPanel/SpectraTable.tsx b/src/component/panels/SpectrumsPanel/SpectraTable.tsx index c51e6826a..93e2a310b 100644 --- a/src/component/panels/SpectrumsPanel/SpectraTable.tsx +++ b/src/component/panels/SpectrumsPanel/SpectraTable.tsx @@ -1,5 +1,6 @@ import lodashGet from 'lodash/get'; import { + ActiveSpectrum, JpathTableColumn, PredefinedSpectraColumn, PredefinedTableColumn, @@ -18,7 +19,6 @@ import ReactTable, { Column } from '../../elements/ReactTable/ReactTable'; import { useAlert } from '../../elements/popup/Alert'; import { usePanelPreferences } from '../../hooks/usePanelPreferences'; import ExportAsJcampModal from '../../modal/ExportAsJcampModal'; -import { ActiveSpectrum } from '../../reducer/Reducer'; import ColorIndicator from './base/ColorIndicator'; import ShowHideSpectrumButton, { diff --git a/src/component/panels/SpectrumsPanel/SpectrumsTabs.tsx b/src/component/panels/SpectrumsPanel/SpectrumsTabs.tsx index 257c5f746..2349f5364 100644 --- a/src/component/panels/SpectrumsPanel/SpectrumsTabs.tsx +++ b/src/component/panels/SpectrumsPanel/SpectrumsTabs.tsx @@ -1,6 +1,6 @@ /** @jsxImportSource @emotion/react */ import { css } from '@emotion/react'; -import { Spectrum } from 'nmr-load-save'; +import { ActiveSpectrum, Spectrum } from 'nmr-load-save'; import { useState, useMemo, memo, useCallback } from 'react'; import { useChartData } from '../../context/ChartContext'; @@ -9,7 +9,6 @@ import { getModifiers } from '../../context/KeyModifierContext'; import IsotopesViewer from '../../elements/IsotopesViewer'; import Tab from '../../elements/Tab/Tab'; import Tabs from '../../elements/Tab/Tabs'; -import { ActiveSpectrum } from '../../reducer/Reducer'; import groupByInfoKey from '../../utility/GroupByInfoKey'; import { SpectraTable } from './SpectraTable'; diff --git a/src/component/panels/SummaryPanel/utilities/Utilities.ts b/src/component/panels/SummaryPanel/utilities/Utilities.ts index 5dc1b3f0a..6d92fc9bc 100644 --- a/src/component/panels/SummaryPanel/utilities/Utilities.ts +++ b/src/component/panels/SummaryPanel/utilities/Utilities.ts @@ -11,7 +11,7 @@ import { Correlation, Link, } from 'nmr-correlation'; -import { Spectrum2D, Spectrum } from 'nmr-load-save'; +import { Spectrum2D, Spectrum, ActiveSpectrum } from 'nmr-load-save'; import DefaultPathLengths from '../../../../data/constants/DefaultPathLengths'; import { @@ -19,7 +19,7 @@ import { findSpectrum, } from '../../../../data/utilities/FindUtilities'; import isDefaultPathLength from '../../../modal/editZone/validation/isDefaultPathLength'; -import { ActiveSpectrum, DisplayerMode } from '../../../reducer/Reducer'; +import { DisplayerMode } from '../../../reducer/Reducer'; import { ErrorColors } from '../CorrelationTable/Constants'; function getAtomType(nucleus: string): string { diff --git a/src/component/reducer/Reducer.ts b/src/component/reducer/Reducer.ts index 1560d9fea..7fe280e94 100644 --- a/src/component/reducer/Reducer.ts +++ b/src/component/reducer/Reducer.ts @@ -31,12 +31,6 @@ import * as ToolsActions from './actions/ToolsActions'; import * as ZonesActions from './actions/ZonesActions'; import { ZoomHistory } from './helper/ZoomHistoryManager'; -export interface ActiveSpectrum { - id: string; - index: number; - selected: boolean; -} - export type DisplayerMode = '1D' | '2D'; export interface Pivot { diff --git a/src/component/reducer/actions/FiltersActions.ts b/src/component/reducer/actions/FiltersActions.ts index cd490bcc8..f7ec3828e 100644 --- a/src/component/reducer/actions/FiltersActions.ts +++ b/src/component/reducer/actions/FiltersActions.ts @@ -2,7 +2,12 @@ import { v4 } from '@lukeed/uuid'; import { NmrData2DFt } from 'cheminfo-types'; import { current, Draft } from 'immer'; import { xFindClosestIndex } from 'ml-spectra-processing'; -import { Spectrum, Spectrum1D, Spectrum2D } from 'nmr-load-save'; +import { + ActiveSpectrum, + Spectrum, + Spectrum1D, + Spectrum2D, +} from 'nmr-load-save'; import { Filters, FiltersManager, @@ -20,12 +25,7 @@ import { get2DXScale, get2DYScale } from '../../2d/utilities/scale'; import { options as Tools } from '../../toolbar/ToolTypes'; import { getSpectraByNucleus } from '../../utility/getSpectraByNucleus'; import nucleusToString from '../../utility/nucleusToString'; -import { - ActiveSpectrum, - getInitialState, - State, - TraceDirection, -} from '../Reducer'; +import { getInitialState, State, TraceDirection } from '../Reducer'; import zoomHistoryManager from '../helper/ZoomHistoryManager'; import { getActiveSpectrum } from '../helper/getActiveSpectrum'; import getRange from '../helper/getRange';