nmrium 0.50.1 → 0.52.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.
Files changed (219) hide show
  1. package/lib/component/1d/Chart1D.js +1 -1
  2. package/lib/component/1d/LinesSeries.js +2 -2
  3. package/lib/component/1d/Viewer1D.js +6 -11
  4. package/lib/component/1d/database/DatabaseSpectrum.js +3 -3
  5. package/lib/component/2d/1d-tracer/HorizontalSliceChart.js +6 -2
  6. package/lib/component/2d/1d-tracer/VerticalSliceChart.js +8 -1
  7. package/lib/component/2d/1d-tracer/phase-correction-traces/PhaseTraceWithMouse.js +2 -21
  8. package/lib/component/2d/1d-tracer/phase-correction-traces/PhaseTraces.js +1 -1
  9. package/lib/component/2d/1d-tracer/phase-correction-traces/SpectraPhaseTraces.d.ts +1 -1
  10. package/lib/component/2d/1d-tracer/phase-correction-traces/SpectraPhaseTraces.js +6 -17
  11. package/lib/component/2d/1d-tracer/phase-correction-traces/SpectrumPhaseTrace.d.ts +6 -10
  12. package/lib/component/2d/1d-tracer/phase-correction-traces/SpectrumPhaseTrace.js +62 -13
  13. package/lib/component/2d/1d-tracer/phase-correction-traces/useActivePhaseTraces.d.ts +1 -0
  14. package/lib/component/2d/1d-tracer/phase-correction-traces/useActivePhaseTraces.js +2 -1
  15. package/lib/component/2d/Viewer2D.js +16 -15
  16. package/lib/component/2d/ft/Contours.js +6 -3
  17. package/lib/component/2d/utilities/scale.d.ts +2 -1
  18. package/lib/component/2d/utilities/scale.js +12 -2
  19. package/lib/component/EventsTrackers/BrushTracker.d.ts +5 -3
  20. package/lib/component/EventsTrackers/BrushTracker.js +2 -2
  21. package/lib/component/EventsTrackers/KeysListenerTracker.d.ts +1 -1
  22. package/lib/component/EventsTrackers/KeysListenerTracker.js +32 -18
  23. package/lib/component/context/DispatchContext.d.ts +1 -1
  24. package/lib/component/context/ToasterContext.d.ts +13 -0
  25. package/lib/component/context/ToasterContext.js +34 -0
  26. package/lib/component/elements/Label.js +1 -1
  27. package/lib/component/elements/Select.js +2 -2
  28. package/lib/component/elements/ToolbarPopoverItem.js +1 -1
  29. package/lib/component/header/ApodizationOptionsPanel.js +1 -1
  30. package/lib/component/header/AutoPeakPickingOptionPanel.js +7 -4
  31. package/lib/component/header/BaseLineCorrectionPanel.js +2 -2
  32. package/lib/component/header/Header.d.ts +1 -11
  33. package/lib/component/header/Header.js +5 -6
  34. package/lib/component/header/PhaseCorrectionPanel.js +24 -33
  35. package/lib/component/header/PhaseCorrectionTwoDimensionsPanel.d.ts +1 -1
  36. package/lib/component/header/PhaseCorrectionTwoDimensionsPanel.js +96 -42
  37. package/lib/component/header/RangesPickingOptionPanel.js +7 -4
  38. package/lib/component/header/ZeroFillingOptionsPanel.js +1 -1
  39. package/lib/component/header/Zones2DOptionPanel.js +6 -2
  40. package/lib/component/hooks/useDialogToggle.d.ts +5 -0
  41. package/lib/component/hooks/useDialogToggle.js +16 -0
  42. package/lib/component/hooks/useExport.d.ts +9 -1
  43. package/lib/component/hooks/useExport.js +34 -36
  44. package/lib/component/hooks/useSaveSettings.js +6 -3
  45. package/lib/component/hooks/useToolsFunctions.d.ts +1 -1
  46. package/lib/component/hooks/useToolsFunctions.js +9 -7
  47. package/lib/component/loader/DropZone.js +14 -14
  48. package/lib/component/main/InnerNMRium.js +5 -9
  49. package/lib/component/main/InnerNMRiumContents.d.ts +0 -2
  50. package/lib/component/main/InnerNMRiumContents.js +5 -3
  51. package/lib/component/main/NMRium.js +2 -2
  52. package/lib/component/modal/AboutPredictionModal.js +1 -1
  53. package/lib/component/modal/AboutSpectrumSimulationModal.js +1 -1
  54. package/lib/component/modal/EditPeakShapeModal.js +1 -1
  55. package/lib/component/modal/ExportAsJcampModal.js +15 -15
  56. package/lib/component/modal/ImportPublicationStringModal.js +5 -3
  57. package/lib/component/modal/LoadJCAMPModal.js +7 -5
  58. package/lib/component/modal/LogsHistoryModal.js +1 -1
  59. package/lib/component/modal/MultipletAnalysisModal.js +1 -1
  60. package/lib/component/modal/PredictSpectraModal.js +11 -9
  61. package/lib/component/modal/SaveAsModal.d.ts +3 -4
  62. package/lib/component/modal/SaveAsModal.js +27 -27
  63. package/lib/component/modal/editRange/EditRangeModal.js +2 -2
  64. package/lib/component/modal/editRange/forms/components/DeltaInput.d.ts +2 -3
  65. package/lib/component/modal/editRange/forms/components/DeltaInput.js +2 -3
  66. package/lib/component/modal/editRange/forms/components/InfoBlock.d.ts +1 -0
  67. package/lib/component/modal/editRange/forms/components/{SignalFormInfo.js → InfoBlock.js} +2 -2
  68. package/lib/component/modal/editRange/forms/components/NewSignalTab.d.ts +5 -0
  69. package/lib/component/modal/editRange/forms/components/NewSignalTab.js +85 -0
  70. package/lib/component/modal/editRange/forms/components/SignalTab.d.ts +7 -0
  71. package/lib/component/modal/editRange/forms/components/SignalTab.js +24 -0
  72. package/lib/component/modal/editRange/forms/components/SignalsContent.d.ts +8 -0
  73. package/lib/component/modal/editRange/forms/components/SignalsContent.js +57 -0
  74. package/lib/component/modal/editRange/forms/components/signal-tabs/SignalJCouplingsTable.d.ts +5 -0
  75. package/lib/component/modal/editRange/forms/components/signal-tabs/SignalJCouplingsTable.js +133 -0
  76. package/lib/component/modal/editRange/forms/components/signal-tabs/SignalPeaksTable.d.ts +5 -0
  77. package/lib/component/modal/editRange/forms/components/signal-tabs/SignalPeaksTable.js +141 -0
  78. package/lib/component/modal/editZone/EditPathLengthFormik.js +2 -2
  79. package/lib/component/modal/editZone/EditZoneModal.js +1 -1
  80. package/lib/component/modal/metaImportation/MetaImportationModal.d.ts +7 -4
  81. package/lib/component/modal/metaImportation/MetaImportationModal.js +23 -13
  82. package/lib/component/modal/metaImportation/utils/mapColumnToSelectItems.js +1 -1
  83. package/lib/component/modal/setting/GeneralSettings.js +9 -6
  84. package/lib/component/modal/setting/settings-tabs/GeneralTabContent.js +1 -1
  85. package/lib/component/modal/setting/settings-tabs/InfoBlockTabContent.js +1 -1
  86. package/lib/component/modal/setting/settings-tabs/OnLoadProcessingTabContent.js +1 -1
  87. package/lib/component/panels/AutomaticAssignment/useAutoAssignments.js +7 -4
  88. package/lib/component/panels/IntegralsPanel/IntegralsPreferences.js +1 -1
  89. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +13 -7
  90. package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +6 -4
  91. package/lib/component/panels/Panels.js +5 -5
  92. package/lib/component/panels/PeaksPanel/PeaksPanel.js +6 -3
  93. package/lib/component/panels/RangesPanel/RangesHeader.js +3 -3
  94. package/lib/component/panels/RangesPanel/RangesPanel.js +5 -5
  95. package/lib/component/panels/RangesPanel/RangesPreferences.js +1 -1
  96. package/lib/component/panels/SpectraPanel/SpectraPanelHeader.d.ts +5 -0
  97. package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/SpectraPanelHeader.js +11 -11
  98. package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/SpectraTable.js +12 -6
  99. package/lib/component/panels/SpectraPanel/SpectraTabs.d.ts +1 -0
  100. package/lib/component/panels/{SpectrumsPanel/SpectrumsTabs.js → SpectraPanel/SpectraTabs.js} +6 -6
  101. package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/SpectrumListPanel.js +2 -2
  102. package/lib/component/panels/databasePanel/DatabasePanel.js +37 -19
  103. package/lib/component/panels/databasePanel/DatabasePreferences.js +1 -1
  104. package/lib/component/panels/databasePanel/DatabaseSearchOptions.js +1 -1
  105. package/lib/component/panels/filtersPanel/FilterPanel.js +5 -3
  106. package/lib/component/panels/filtersPanel/FiltersTable.js +27 -23
  107. package/lib/component/panels/header/SpectraAutomaticPickingButton.js +7 -5
  108. package/lib/component/panels/multipleAnalysisPanel/AlignSpectra.js +2 -2
  109. package/lib/component/panels/multipleAnalysisPanel/AnalysisChart.js +5 -5
  110. package/lib/component/panels/multipleAnalysisPanel/MultipleSpectraAnalysisPanel.js +6 -6
  111. package/lib/component/panels/multipleAnalysisPanel/preferences/index.js +5 -3
  112. package/lib/component/panels/predictionPanel/PredictionOptionsPanel.js +2 -2
  113. package/lib/component/panels/predictionPanel/PredictionPanel.js +7 -5
  114. package/lib/component/panels/predictionPanel/PredictionSimpleOptions.js +2 -1
  115. package/lib/component/panels/spectrumSimulation/SpectrumSimulationPreferences.js +1 -1
  116. package/lib/component/panels/spectrumSimulation/SpectrumSimulationSimpleOptions.js +1 -1
  117. package/lib/component/reducer/IgnoreActions.js +1 -1
  118. package/lib/component/reducer/Reducer.d.ts +3 -2
  119. package/lib/component/reducer/Reducer.js +40 -32
  120. package/lib/component/reducer/actions/DomainActions.js +3 -3
  121. package/lib/component/reducer/actions/FiltersActions.d.ts +11 -4
  122. package/lib/component/reducer/actions/FiltersActions.js +243 -91
  123. package/lib/component/reducer/actions/IntegralsActions.js +2 -2
  124. package/lib/component/reducer/actions/LoadActions.js +1 -1
  125. package/lib/component/reducer/actions/MoleculeActions.js +0 -1
  126. package/lib/component/reducer/actions/PreferencesActions.js +2 -2
  127. package/lib/component/reducer/actions/RangesActions.js +16 -6
  128. package/lib/component/reducer/actions/ToolsActions.d.ts +6 -6
  129. package/lib/component/reducer/actions/ToolsActions.js +83 -22
  130. package/lib/component/reducer/actions/ZonesActions.d.ts +2 -0
  131. package/lib/component/reducer/actions/ZonesActions.js +5 -1
  132. package/lib/component/reducer/helper/Zoom1DManager.d.ts +4 -3
  133. package/lib/component/reducer/helper/Zoom1DManager.js +4 -4
  134. package/lib/component/reducer/helper/ZoomHistoryManager.js +1 -5
  135. package/lib/component/reducer/helper/findStrongestPeak.d.ts +6 -0
  136. package/lib/component/reducer/helper/findStrongestPeak.js +13 -0
  137. package/lib/component/reducer/helper/getTwoDimensionPhaseCorrectionOptions.d.ts +2 -1
  138. package/lib/component/reducer/helper/getTwoDimensionPhaseCorrectionOptions.js +7 -1
  139. package/lib/component/toolbar/ToolBar.js +32 -27
  140. package/lib/component/toolbar/toolbarMenu.js +4 -4
  141. package/lib/component/utility/Events.d.ts +11 -0
  142. package/lib/component/utility/Events.js +22 -0
  143. package/lib/constants.js +5 -5
  144. package/lib/data/data1d/Spectrum1D/ranges/addRange.d.ts +0 -33
  145. package/lib/data/data1d/Spectrum1D/ranges/addRange.js +5 -15
  146. package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.js +6 -4
  147. package/lib/data/data1d/Spectrum1D/ranges/changeRange.js +1 -1
  148. package/lib/data/data1d/Spectrum1D/ranges/detectRange.js +1 -1
  149. package/lib/data/data1d/Spectrum1D/ranges/detectRanges.d.ts +6 -4
  150. package/lib/data/data1d/Spectrum1D/ranges/detectSignals.d.ts +13 -3
  151. package/lib/data/data1d/Spectrum1D/ranges/detectSignals.js +6 -0
  152. package/lib/data/data1d/Spectrum1D/ranges/detectSignalsByMultipletAnalysis.d.ts +13 -3
  153. package/lib/data/data1d/Spectrum1D/ranges/detectSignalsByMultipletAnalysis.js +78 -18
  154. package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.d.ts +2 -2
  155. package/lib/data/data1d/spectrumSimulation.d.ts +1 -1
  156. package/lib/data/data2d/Spectrum2D/contours.js +3 -3
  157. package/lib/data/data2d/Spectrum2D/getMissingProjection.js +2 -2
  158. package/lib/data/data2d/Spectrum2D/getSlice.js +4 -4
  159. package/lib/data/data2d/Spectrum2D/zones/getDetectionZones.d.ts +1 -0
  160. package/lib/data/getDefaultMatrixFilters.js +2 -2
  161. package/lib/data/matrixGeneration.js +1 -1
  162. package/lib/data/utilities/calculateSanPlot.d.ts +1 -6
  163. package/lib/versionInfo.js +1 -1
  164. package/package.json +32 -30
  165. package/lib/component/elements/popup/Alert/AlertBlock.d.ts +0 -8
  166. package/lib/component/elements/popup/Alert/AlertBlock.js +0 -30
  167. package/lib/component/elements/popup/Alert/Context.d.ts +0 -27
  168. package/lib/component/elements/popup/Alert/Context.js +0 -10
  169. package/lib/component/elements/popup/Alert/ProgressIndicator.d.ts +0 -1
  170. package/lib/component/elements/popup/Alert/ProgressIndicator.js +0 -33
  171. package/lib/component/elements/popup/Alert/Provider.d.ts +0 -19
  172. package/lib/component/elements/popup/Alert/Provider.js +0 -127
  173. package/lib/component/elements/popup/Alert/index.d.ts +0 -3
  174. package/lib/component/elements/popup/Alert/index.js +0 -3
  175. package/lib/component/modal/editRange/forms/components/AddSignalFormTab.d.ts +0 -10
  176. package/lib/component/modal/editRange/forms/components/AddSignalFormTab.js +0 -81
  177. package/lib/component/modal/editRange/forms/components/CouplingsTable.d.ts +0 -13
  178. package/lib/component/modal/editRange/forms/components/CouplingsTable.js +0 -63
  179. package/lib/component/modal/editRange/forms/components/SignalFormInfo.d.ts +0 -1
  180. package/lib/component/modal/editRange/forms/components/SignalFormTab.d.ts +0 -8
  181. package/lib/component/modal/editRange/forms/components/SignalFormTab.js +0 -18
  182. package/lib/component/modal/editRange/forms/components/SignalsForm.d.ts +0 -10
  183. package/lib/component/modal/editRange/forms/components/SignalsForm.js +0 -114
  184. package/lib/component/modal/metaImportation/index.d.ts +0 -2
  185. package/lib/component/modal/metaImportation/index.js +0 -17
  186. package/lib/component/panels/SpectrumsPanel/SpectraPanelHeader.d.ts +0 -5
  187. package/lib/component/panels/SpectrumsPanel/SpectrumsTabs.d.ts +0 -1
  188. package/lib/component/reducer/helper/getStrongestPeak.d.ts +0 -7
  189. package/lib/component/reducer/helper/getStrongestPeak.js +0 -15
  190. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/SpectraPreferences.d.ts +0 -0
  191. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/SpectraPreferences.js +0 -0
  192. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/SpectraTable.d.ts +0 -0
  193. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/SpectrumListPanel.d.ts +0 -0
  194. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/ColorIndicator.d.ts +0 -0
  195. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/ColorIndicator.js +0 -0
  196. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/RenderAsHTML.d.ts +0 -0
  197. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/RenderAsHTML.js +0 -0
  198. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/ShowHideSpectrumButton.d.ts +0 -0
  199. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/ShowHideSpectrumButton.js +0 -0
  200. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/SpectraColumnsManager.d.ts +0 -0
  201. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/SpectraColumnsManager.js +0 -0
  202. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/SpectrumName.d.ts +0 -0
  203. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/SpectrumName.js +0 -0
  204. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/setting/PlotChart.d.ts +0 -0
  205. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/setting/PlotChart.js +0 -0
  206. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/setting/Spectrum1DHistogram.d.ts +0 -0
  207. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/setting/Spectrum1DHistogram.js +0 -0
  208. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/setting/Spectrum1DSetting.d.ts +0 -0
  209. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/setting/Spectrum1DSetting.js +0 -0
  210. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/setting/Spectrum2DHistogram.d.ts +0 -0
  211. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/setting/Spectrum2DHistogram.js +0 -0
  212. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/setting/Spectrum2DSetting.d.ts +0 -0
  213. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/setting/Spectrum2DSetting.js +0 -0
  214. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/setting/SpectrumSetting.d.ts +0 -0
  215. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/setting/SpectrumSetting.js +0 -0
  216. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/setting/processSnapPlot.d.ts +0 -0
  217. /package/lib/component/panels/{SpectrumsPanel → SpectraPanel}/base/setting/processSnapPlot.js +0 -0
  218. /package/lib/component/reducer/actions/{SpectrumsActions.d.ts → SpectraActions.d.ts} +0 -0
  219. /package/lib/component/reducer/actions/{SpectrumsActions.js → SpectraActions.js} +0 -0
@@ -1,4 +1,3 @@
1
- import { NmrData1D } from 'cheminfo-types';
2
1
  import { WebSource as Source } from 'filelist-utils';
3
2
  import { CorrelationData } from 'nmr-correlation';
4
3
  import { Spectrum, ViewState } from 'nmr-load-save';
@@ -25,7 +24,6 @@ export type SpectraDirection = 'RTL' | 'LTR';
25
24
  export type TraceDirection = 'vertical' | 'horizontal';
26
25
  export interface SpectrumTrace {
27
26
  id: string;
28
- data: NmrData1D;
29
27
  x: number;
30
28
  y: number;
31
29
  }
@@ -39,7 +37,9 @@ export interface PhaseCorrectionTraceData {
39
37
  export interface TwoDimensionPhaseCorrection {
40
38
  traces: Record<TraceDirection, PhaseCorrectionTraceData>;
41
39
  activeTraceDirection: TraceDirection;
40
+ addTracesToBothDirections: boolean;
42
41
  }
42
+ export declare const getDefaultTwoDimensionsPhaseCorrectionTraceOptions: () => TwoDimensionPhaseCorrection['traces'];
43
43
  export declare function getDefaultViewState(): ViewState;
44
44
  export declare const getInitialState: () => State;
45
45
  export declare const initialState: State;
@@ -206,6 +206,7 @@ export interface State {
206
206
  */
207
207
  twoDimensionPhaseCorrection: TwoDimensionPhaseCorrection;
208
208
  zonesNoiseFactor: number;
209
+ zonesMinMaxRatio: number;
209
210
  /**
210
211
  * The current active Filter
211
212
  * @default null
@@ -14,10 +14,27 @@ import * as MoleculeActions from './actions/MoleculeActions';
14
14
  import * as PeaksActions from './actions/PeaksActions';
15
15
  import * as PreferencesActions from './actions/PreferencesActions';
16
16
  import * as RangesActions from './actions/RangesActions';
17
+ import * as SpectraActions from './actions/SpectraActions';
17
18
  import * as SpectraAnalysisActions from './actions/SpectraAnalysisAction';
18
- import * as SpectrumsActions from './actions/SpectrumsActions';
19
19
  import * as ToolsActions from './actions/ToolsActions';
20
20
  import * as ZonesActions from './actions/ZonesActions';
21
+ export const getDefaultTwoDimensionsPhaseCorrectionTraceOptions = () => {
22
+ const directions = [
23
+ 'horizontal',
24
+ 'vertical',
25
+ ];
26
+ const result = {};
27
+ for (const direction of directions) {
28
+ result[direction] = {
29
+ ph0: 0,
30
+ ph1: 0,
31
+ pivot: null,
32
+ spectra: [],
33
+ scaleRatio: 1,
34
+ };
35
+ }
36
+ return result;
37
+ };
21
38
  export function getDefaultViewState() {
22
39
  return {
23
40
  molecules: {},
@@ -93,25 +110,12 @@ export const getInitialState = () => ({
93
110
  apodizationOptions: {},
94
111
  twoDimensionPhaseCorrection: {
95
112
  activeTraceDirection: 'horizontal',
96
- traces: {
97
- horizontal: {
98
- ph0: 0,
99
- ph1: 0,
100
- pivot: null,
101
- spectra: [],
102
- scaleRatio: 1,
103
- },
104
- vertical: {
105
- ph0: 0,
106
- ph1: 0,
107
- pivot: null,
108
- spectra: [],
109
- scaleRatio: 1,
110
- },
111
- },
113
+ addTracesToBothDirections: true,
114
+ traces: getDefaultTwoDimensionsPhaseCorrectionTraceOptions(),
112
115
  },
113
116
  pivot: { value: 0, index: 0 },
114
117
  zonesNoiseFactor: 1,
118
+ zonesMinMaxRatio: 0.03,
115
119
  activeFilterID: null,
116
120
  predictionIndex: 0,
117
121
  },
@@ -230,6 +234,8 @@ function innerSpectrumReducer(draft, action) {
230
234
  return FiltersActions.handleAddPhaseCorrectionTrace(draft, action);
231
235
  case 'CHANGE_PHASE_CORRECTION_DIRECTION':
232
236
  return FiltersActions.handleChangePhaseCorrectionDirection(draft, action);
237
+ case 'TOGGLE_ADD_PHASE_CORRECTION_TRACE_TO_BOTH_DIRECTIONS':
238
+ return FiltersActions.handleToggleAddTracesToBothDirections(draft);
233
239
  case 'DELETE_PHASE_CORRECTION_TRACE':
234
240
  return FiltersActions.handleDeletePhaseCorrectionTrace(draft, action);
235
241
  case 'SET_ONE_DIMENSION_PIVOT_POINT':
@@ -238,32 +244,34 @@ function innerSpectrumReducer(draft, action) {
238
244
  return FiltersActions.handleSetTwoDimensionPhaseCorrectionPivotPoint(draft, action);
239
245
  case 'CALCULATE_TOW_DIMENSIONS_MANUAL_PHASE_CORRECTION_FILTER':
240
246
  return FiltersActions.handleCalculateManualTwoDimensionPhaseCorrection(draft, action);
247
+ case 'APPLY_MANUAL_PHASE_CORRECTION_TOW_DIMENSION_FILTER':
248
+ return FiltersActions.handleApplyManualTowDimensionsPhaseCorrectionFilter(draft);
241
249
  case 'CHANGE_SPECTRUM_VISIBILITY':
242
- return SpectrumsActions.handleChangeSpectrumVisibilityById(draft, action);
250
+ return SpectraActions.handleChangeSpectrumVisibilityById(draft, action);
243
251
  case 'CHANGE_SPECTRA_VISIBILITY_BY_NUCLEUS':
244
- return SpectrumsActions.handleChangeSpectraVisibilityByNucleus(draft, action);
252
+ return SpectraActions.handleChangeSpectraVisibilityByNucleus(draft, action);
245
253
  case 'CHANGE_ACTIVE_SPECTRUM':
246
- return SpectrumsActions.handleChangeActiveSpectrum(draft, action);
254
+ return SpectraActions.handleChangeActiveSpectrum(draft, action);
247
255
  case 'CHANGE_SPECTRUM_SETTING':
248
- return SpectrumsActions.handleChangeSpectrumSetting(draft, action);
256
+ return SpectraActions.handleChangeSpectrumSetting(draft, action);
249
257
  case 'ALIGN_SPECTRA':
250
- return SpectrumsActions.handleAlignSpectraHandler(draft, action);
258
+ return SpectraActions.handleAlignSpectraHandler(draft, action);
251
259
  case 'DELETE_SPECTRA':
252
- return SpectrumsActions.handleDeleteSpectra(draft, action);
260
+ return SpectraActions.handleDeleteSpectra(draft, action);
253
261
  case 'ADD_MISSING_PROJECTION':
254
- return SpectrumsActions.handleAddMissingProjectionHandler(draft, action);
262
+ return SpectraActions.handleAddMissingProjectionHandler(draft, action);
255
263
  case 'GENERATE_SPECTRUM_FROM_PUBLICATION_STRING':
256
- return SpectrumsActions.handleGenerateSpectrumFromPublicationStringHandler(draft, action);
264
+ return SpectraActions.handleGenerateSpectrumFromPublicationStringHandler(draft, action);
257
265
  case 'IMPORT_SPECTRA_META_INFO':
258
- return SpectrumsActions.handleImportSpectraMetaInfo(draft, action);
266
+ return SpectraActions.handleImportSpectraMetaInfo(draft, action);
259
267
  case 'TOGGLE_SPECTRA_LEGEND':
260
- return SpectrumsActions.handleToggleSpectraLegend(draft);
268
+ return SpectraActions.handleToggleSpectraLegend(draft);
261
269
  case 'RECOLOR_SPECTRA_COLOR':
262
- return SpectrumsActions.handleRecolorSpectraBasedOnDistinctValue(draft, action);
270
+ return SpectraActions.handleRecolorSpectraBasedOnDistinctValue(draft, action);
263
271
  case 'ORDER_SPECTRA':
264
- return SpectrumsActions.handleOrderSpectra(draft, action);
272
+ return SpectraActions.handleOrderSpectra(draft, action);
265
273
  case 'SIMULATE_SPECTRUM':
266
- return SpectrumsActions.handleSimulateSpectrum(draft, action);
274
+ return SpectraActions.handleSimulateSpectrum(draft, action);
267
275
  case 'SET_SELECTED_TOOL':
268
276
  return ToolsActions.setSelectedTool(draft, action);
269
277
  case 'RESET_SELECTED_TOOL':
@@ -282,8 +290,8 @@ function innerSpectrumReducer(draft, action) {
282
290
  return ToolsActions.handleChangeSpectrumDisplayMode(draft);
283
291
  case 'BRUSH_END':
284
292
  return ToolsActions.handleBrushEnd(draft, action);
285
- case 'SET_SPECTRUMS_VERTICAL_ALIGN':
286
- return ToolsActions.setSpectrumsVerticalAlign(draft);
293
+ case 'SET_SPECTRA_VERTICAL_ALIGN':
294
+ return ToolsActions.setSpectraVerticalAlign(draft);
287
295
  case 'SET_ACTIVE_TAB':
288
296
  return ToolsActions.handelSetActiveTab(draft, action);
289
297
  case 'ADD_BASE_LINE_ZONE':
@@ -87,15 +87,15 @@ function get2DDomain(state) {
87
87
  reportError(error);
88
88
  }
89
89
  }
90
- const spectrumsIDs = new Set();
90
+ const spectraIDs = new Set();
91
91
  for (const n of nucleus) {
92
92
  const spectra = activeSpectra[n];
93
93
  if (spectra?.length === 1) {
94
- spectrumsIDs.add(spectra[0].id);
94
+ spectraIDs.add(spectra[0].id);
95
95
  }
96
96
  }
97
97
  const filteredData = data
98
- .filter((d) => spectrumsIDs.has(d.id) && d.info.dimension === 1)
98
+ .filter((d) => spectraIDs.has(d.id) && d.info.dimension === 1)
99
99
  .map((datum) => {
100
100
  return datum;
101
101
  });
@@ -26,10 +26,15 @@ type ZeroFillingFilterLiveAction = ActionType<'CALCULATE_ZERO_FILLING_FILTER', {
26
26
  };
27
27
  livePreview: boolean;
28
28
  }>;
29
- type ManualPhaseCorrectionFilterAction = ActionType<'APPLY_MANUAL_PHASE_CORRECTION_FILTER' | 'CALCULATE_MANUAL_PHASE_CORRECTION_FILTER' | 'APPLY_MANUAL_PHASE_CORRECTION_TOW_DIMENSION_FILTER' | 'CALCULATE_TOW_DIMENSIONS_MANUAL_PHASE_CORRECTION_FILTER', {
29
+ type ManualPhaseCorrectionFilterAction = ActionType<'APPLY_MANUAL_PHASE_CORRECTION_FILTER' | 'CALCULATE_MANUAL_PHASE_CORRECTION_FILTER', {
30
30
  ph0: number;
31
31
  ph1: number;
32
32
  }>;
33
+ type ManualTwoDimensionsPhaseCorrectionFilterAction = ActionType<'CALCULATE_TOW_DIMENSIONS_MANUAL_PHASE_CORRECTION_FILTER', {
34
+ ph0: number;
35
+ ph1: number;
36
+ applyOn2D?: boolean;
37
+ }>;
33
38
  type BaselineCorrectionFilterOptions = Omit<BaselineCorrectionOptions, 'zones'>;
34
39
  interface BaselineCorrectionFilterProps {
35
40
  options: BaselineCorrectionFilterOptions;
@@ -81,7 +86,7 @@ type SetTwoDimensionPhaseCorrectionPivotPoint = ActionType<'SET_TWO_DIMENSION_PI
81
86
  x: number;
82
87
  y: number;
83
88
  }>;
84
- export type FiltersActions = ShiftSpectrumAlongXAxisAction | ApodizationFilterAction | ApodizationFilterLiveAction | ZeroFillingFilterAction | ZeroFillingFilterLiveAction | ManualPhaseCorrectionFilterAction | BaselineCorrectionFilterAction | BaselineCorrectionFilterLiveAction | EnableFilterAction | DeleteFilterAction | DeleteSpectraFilterAction | SetFilterSnapshotAction | AddExclusionZoneAction | DeleteExclusionZoneAction | ApplySignalProcessingAction | AddPhaseCorrectionTraceAction | ChangePhaseCorrectionDirectionAction | DeletePhaseCorrectionTrace | SetOneDimensionPhaseCorrectionPivotPoint | SetTwoDimensionPhaseCorrectionPivotPoint | ActionType<'APPLY_FFT_FILTER' | 'APPLY_FFT_DIMENSION_1_FILTER' | 'APPLY_FFT_DIMENSION_2_FILTER' | 'APPLY_AUTO_PHASE_CORRECTION_FILTER' | 'APPLY_ABSOLUTE_FILTER'>;
89
+ export type FiltersActions = ShiftSpectrumAlongXAxisAction | ApodizationFilterAction | ApodizationFilterLiveAction | ZeroFillingFilterAction | ZeroFillingFilterLiveAction | ManualPhaseCorrectionFilterAction | BaselineCorrectionFilterAction | BaselineCorrectionFilterLiveAction | EnableFilterAction | DeleteFilterAction | DeleteSpectraFilterAction | SetFilterSnapshotAction | AddExclusionZoneAction | DeleteExclusionZoneAction | ApplySignalProcessingAction | AddPhaseCorrectionTraceAction | ChangePhaseCorrectionDirectionAction | DeletePhaseCorrectionTrace | SetOneDimensionPhaseCorrectionPivotPoint | SetTwoDimensionPhaseCorrectionPivotPoint | ManualTwoDimensionsPhaseCorrectionFilterAction | ActionType<'APPLY_FFT_FILTER' | 'APPLY_FFT_DIMENSION_1_FILTER' | 'APPLY_FFT_DIMENSION_2_FILTER' | 'APPLY_AUTO_PHASE_CORRECTION_FILTER' | 'APPLY_ABSOLUTE_FILTER' | 'APPLY_MANUAL_PHASE_CORRECTION_TOW_DIMENSION_FILTER' | 'TOGGLE_ADD_PHASE_CORRECTION_TRACE_TO_BOTH_DIRECTIONS'>;
85
90
  export interface RollbackSpectrumByFilterOptions {
86
91
  applyFilter?: boolean;
87
92
  reset?: boolean;
@@ -106,6 +111,7 @@ declare function handleApplyFFtDimension1Filter(draft: Draft<State>): void;
106
111
  declare function handleApplyFFtDimension2Filter(draft: Draft<State>): void;
107
112
  declare function handleApplyManualPhaseCorrectionFilter(draft: Draft<State>, action: ManualPhaseCorrectionFilterAction): void;
108
113
  declare function handleAddPhaseCorrectionTrace(draft: Draft<State>, action: AddPhaseCorrectionTraceAction): void;
114
+ declare function handleToggleAddTracesToBothDirections(draft: Draft<State>): void;
109
115
  declare function handleChangePhaseCorrectionDirection(draft: Draft<State>, action: ChangePhaseCorrectionDirectionAction): void;
110
116
  declare function handleDeletePhaseCorrectionTrace(draft: Draft<State>, action: DeletePhaseCorrectionTrace): void;
111
117
  declare function handleCalculateManualPhaseCorrection(draft: Draft<State>, action: ManualPhaseCorrectionFilterAction): void;
@@ -123,5 +129,6 @@ declare function handleAddExclusionZone(draft: Draft<State>, action: AddExclusio
123
129
  declare function handleDeleteExclusionZone(draft: Draft<State>, action: DeleteExclusionZoneAction): void;
124
130
  declare function handleSetOneDimensionPhaseCorrectionPivotPoint(draft: Draft<State>, action: SetOneDimensionPhaseCorrectionPivotPoint): void;
125
131
  declare function handleSetTwoDimensionPhaseCorrectionPivotPoint(draft: Draft<State>, action: SetTwoDimensionPhaseCorrectionPivotPoint): void;
126
- declare function handleCalculateManualTwoDimensionPhaseCorrection(draft: Draft<State>, action: ManualPhaseCorrectionFilterAction): void;
127
- export { handleShiftSpectrumAlongXAxis, handleApplyZeroFillingFilter, handleApplyApodizationFilter, handleApplyFFTFilter, handleApplyFFtDimension1Filter, handleApplyFFtDimension2Filter, handleApplyManualPhaseCorrectionFilter, handleApplyAutoPhaseCorrectionFilter, handleApplyAbsoluteFilter, handleCalculateManualPhaseCorrection, calculateBaseLineCorrection, handleCalculateBaseLineCorrection, handleCalculateApodizationFilter, handleCalculateZeroFillingFilter, handleEnableFilter, handleDeleteFilter, handleDeleteSpectraFilter, handleBaseLineCorrectionFilter, handleSetFilterSnapshotHandler, handleAddExclusionZone, handleDeleteExclusionZone, handleSignalProcessingFilter, rollbackSpectrum, rollbackSpectrumByFilter, handleAddPhaseCorrectionTrace, handleChangePhaseCorrectionDirection, handleDeletePhaseCorrectionTrace, handleSetOneDimensionPhaseCorrectionPivotPoint, handleSetTwoDimensionPhaseCorrectionPivotPoint, handleCalculateManualTwoDimensionPhaseCorrection, };
132
+ declare function handleCalculateManualTwoDimensionPhaseCorrection(draft: Draft<State>, action: ManualTwoDimensionsPhaseCorrectionFilterAction): void;
133
+ declare function handleApplyManualTowDimensionsPhaseCorrectionFilter(draft: Draft<State>): void;
134
+ export { handleShiftSpectrumAlongXAxis, handleApplyZeroFillingFilter, handleApplyApodizationFilter, handleApplyFFTFilter, handleApplyFFtDimension1Filter, handleApplyFFtDimension2Filter, handleApplyManualPhaseCorrectionFilter, handleApplyManualTowDimensionsPhaseCorrectionFilter, handleApplyAutoPhaseCorrectionFilter, handleApplyAbsoluteFilter, handleCalculateManualPhaseCorrection, calculateBaseLineCorrection, handleCalculateBaseLineCorrection, handleCalculateApodizationFilter, handleCalculateZeroFillingFilter, handleEnableFilter, handleDeleteFilter, handleDeleteSpectraFilter, handleBaseLineCorrectionFilter, handleSetFilterSnapshotHandler, handleAddExclusionZone, handleDeleteExclusionZone, handleSignalProcessingFilter, rollbackSpectrum, rollbackSpectrumByFilter, handleAddPhaseCorrectionTrace, handleChangePhaseCorrectionDirection, handleDeletePhaseCorrectionTrace, handleSetOneDimensionPhaseCorrectionPivotPoint, handleSetTwoDimensionPhaseCorrectionPivotPoint, handleCalculateManualTwoDimensionPhaseCorrection, handleToggleAddTracesToBothDirections, };