nmrium 0.35.1 → 0.36.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 (216) hide show
  1. package/lib/component/1d/ApodizationLine.d.ts +1 -2
  2. package/lib/component/1d/Chart1D.d.ts +1 -2
  3. package/lib/component/1d/ExclusionZonesAnnotations.d.ts +1 -2
  4. package/lib/component/1d/Line.d.ts +1 -1
  5. package/lib/component/1d/LinesSeries.d.ts +1 -2
  6. package/lib/component/1d/SpectraLegends.d.ts +1 -2
  7. package/lib/component/1d/Viewer1D.d.ts +1 -1
  8. package/lib/component/1d/database/DatabaseElements.d.ts +1 -2
  9. package/lib/component/1d/database/DatabaseSpectrum.d.ts +1 -2
  10. package/lib/component/1d/database/ResurrectedDatabaseRanges.d.ts +1 -2
  11. package/lib/component/1d/integral/Integral.d.ts +1 -2
  12. package/lib/component/1d/integral/IntegralIndicator.d.ts +1 -2
  13. package/lib/component/1d/integral/IntegralsSeries.d.ts +1 -2
  14. package/lib/component/1d/jCouplingGraph/JGraph.d.ts +1 -2
  15. package/lib/component/1d/jCouplingGraph/JGraphVerticalAxis.d.ts +1 -2
  16. package/lib/component/1d/jCouplingGraph/JsCoupling.d.ts +1 -2
  17. package/lib/component/1d/jCouplingGraph/JsCouplingLinks.d.ts +1 -2
  18. package/lib/component/1d/jCouplingGraph/JsCouplings.d.ts +1 -2
  19. package/lib/component/1d/multiAnalysis/MultiAnalysisRanges.d.ts +1 -2
  20. package/lib/component/1d/multiplicityTree/LevelNode.d.ts +1 -2
  21. package/lib/component/1d/multiplicityTree/MultiplicityTree.js +2 -1
  22. package/lib/component/1d/multiplicityTree/StringNode.d.ts +1 -1
  23. package/lib/component/1d/multiplicityTree/TreeNodes.d.ts +1 -1
  24. package/lib/component/1d/peaks/PeakAnnotations.d.ts +1 -2
  25. package/lib/component/1d/peaks/PeaksShapes.d.ts +1 -2
  26. package/lib/component/1d/ranges/AssignmentActionsButtons.d.ts +1 -2
  27. package/lib/component/1d/ranges/RangeIntegral.d.ts +1 -2
  28. package/lib/component/1d/ranges/Ranges.d.ts +1 -2
  29. package/lib/component/1d/tool/PeakPointer.d.ts +1 -2
  30. package/lib/component/1d/tool/VerticalIndicator.d.ts +1 -2
  31. package/lib/component/1d/tool/XLabelPointer.d.ts +1 -2
  32. package/lib/component/1d-2d/components/FloatMoleculeStructures/ActionsButton.d.ts +1 -2
  33. package/lib/component/1d-2d/components/FloatMoleculeStructures/index.d.ts +2 -3
  34. package/lib/component/1d-2d/components/SpectrumInfoBlock.d.ts +1 -2
  35. package/lib/component/1d-2d/tools/BrushX.d.ts +1 -2
  36. package/lib/component/1d-2d/tools/BrushXY.d.ts +1 -2
  37. package/lib/component/1d-2d/tools/CrossLinePointer.d.ts +1 -2
  38. package/lib/component/2d/1d-tracer/HorizontalSliceChart.d.ts +1 -1
  39. package/lib/component/2d/1d-tracer/Left1DChart.d.ts +1 -1
  40. package/lib/component/2d/1d-tracer/Top1DChart.d.ts +1 -1
  41. package/lib/component/2d/1d-tracer/VerticalSliceChart.d.ts +1 -1
  42. package/lib/component/2d/Chart2D.d.ts +1 -2
  43. package/lib/component/2d/SlicingView.d.ts +1 -2
  44. package/lib/component/2d/Viewer2D.d.ts +1 -1
  45. package/lib/component/2d/fid/FidCanvas.d.ts +1 -2
  46. package/lib/component/2d/fid/FidContainer.d.ts +1 -2
  47. package/lib/component/2d/ft/Contours.d.ts +1 -2
  48. package/lib/component/2d/ft/FTContainer.d.ts +1 -2
  49. package/lib/component/2d/tools/XYLabelPointer.d.ts +1 -2
  50. package/lib/component/2d/zones/Zones.d.ts +1 -2
  51. package/lib/component/ErrorOverlay.d.ts +1 -2
  52. package/lib/component/EventsTrackers/BrushTracker.d.ts +1 -1
  53. package/lib/component/EventsTrackers/MouseTracker.d.ts +1 -1
  54. package/lib/component/SplitPaneWrapper.d.ts +1 -2
  55. package/lib/component/assignment/index.d.ts +1 -2
  56. package/lib/component/context/LoggerContext.d.ts +1 -1
  57. package/lib/component/elements/ActionButtons.d.ts +1 -1
  58. package/lib/component/elements/ButtonToolTip.d.ts +1 -1
  59. package/lib/component/elements/CheckBoxCell.d.ts +1 -2
  60. package/lib/component/elements/CloseButton.d.ts +1 -1
  61. package/lib/component/elements/ColumnWrapper.d.ts +1 -1
  62. package/lib/component/elements/DeleteButton.d.ts +1 -2
  63. package/lib/component/elements/GroupPane.d.ts +1 -1
  64. package/lib/component/elements/IsotopesViewer.d.ts +1 -1
  65. package/lib/component/elements/Logo.d.ts +1 -2
  66. package/lib/component/elements/Message.d.ts +1 -1
  67. package/lib/component/elements/ReactTable/Elements/EmptyDataRow.d.ts +1 -2
  68. package/lib/component/elements/ReactTable/Elements/ReactTableHeader.d.ts +1 -1
  69. package/lib/component/elements/SVGGroup.d.ts +1 -1
  70. package/lib/component/elements/Table/Table.d.ts +1 -1
  71. package/lib/component/elements/Table/TableBody.d.ts +1 -1
  72. package/lib/component/elements/Table/TableCell.d.ts +1 -1
  73. package/lib/component/elements/Table/TableHead.d.ts +1 -1
  74. package/lib/component/elements/Table/TableRow.d.ts +1 -1
  75. package/lib/component/elements/ToolTip/ToolTip.d.ts +1 -1
  76. package/lib/component/elements/accordion/Accordion.d.ts +1 -1
  77. package/lib/component/elements/accordion/AccordionItem.d.ts +1 -1
  78. package/lib/component/elements/draggable/SVGDraggable.d.ts +1 -1
  79. package/lib/component/elements/formik/ErrorMessage.d.ts +1 -1
  80. package/lib/component/elements/formik/FormikCheckBox.d.ts +1 -1
  81. package/lib/component/elements/formik/FormikColorInput.d.ts +1 -1
  82. package/lib/component/elements/formik/FormikColorPicker.d.ts +1 -1
  83. package/lib/component/elements/formik/FormikColumnFormatField.d.ts +1 -1
  84. package/lib/component/elements/formik/FormikErrorsSummary.d.ts +1 -1
  85. package/lib/component/elements/formik/FormikInput.d.ts +1 -2
  86. package/lib/component/elements/formik/FormikNumberInput.d.ts +1 -2
  87. package/lib/component/elements/formik/FormikSelect.d.ts +1 -2
  88. package/lib/component/elements/formik/FormikSlider.d.ts +1 -2
  89. package/lib/component/elements/formik/FormikTextarea.d.ts +1 -1
  90. package/lib/component/elements/formik/Input.d.ts +1 -2
  91. package/lib/component/elements/linearAxis/LinearVerticalAxis.d.ts +1 -2
  92. package/lib/component/elements/popup/Alert/Provider.d.ts +1 -1
  93. package/lib/component/elements/popup/Modal/Modal.d.ts +1 -1
  94. package/lib/component/elements/popup/Transition.d.ts +1 -1
  95. package/lib/component/elements/popup/Wrapper.d.ts +1 -2
  96. package/lib/component/elements/resizer/Resizer.d.ts +1 -1
  97. package/lib/component/elements/toggle/ToggleButton.d.ts +1 -1
  98. package/lib/component/elements/toggle/ToggleButtonGroup.d.ts +1 -1
  99. package/lib/component/header/ApodizationOptionsPanel.d.ts +1 -2
  100. package/lib/component/header/AutoPeakPickingOptionPanel.d.ts +1 -1
  101. package/lib/component/header/BaseLineCorrectionPanel.d.ts +1 -2
  102. package/lib/component/header/HeaderContainer.d.ts +1 -1
  103. package/lib/component/header/LogsHistory.d.ts +1 -2
  104. package/lib/component/header/PhaseCorrectionPanel.d.ts +1 -2
  105. package/lib/component/header/RangesPickingOptionPanel.d.ts +1 -2
  106. package/lib/component/header/ZeroFillingOptionsPanel.d.ts +1 -2
  107. package/lib/component/header/Zones2DOptionPanel.d.ts +1 -2
  108. package/lib/component/highlight/index.d.ts +1 -1
  109. package/lib/component/hooks/useSaveSettings.d.ts +1 -2
  110. package/lib/component/loader/NoData.d.ts +1 -1
  111. package/lib/component/loader/Spinner.d.ts +1 -1
  112. package/lib/component/loader/SpinnerContext.d.ts +1 -1
  113. package/lib/component/modal/ExportAsJcampModal.d.ts +1 -2
  114. package/lib/component/modal/MultipletAnalysisModal.js +6 -1
  115. package/lib/component/modal/editRange/EditRangeModal.js +3 -2
  116. package/lib/component/modal/editRange/forms/components/AddSignalFormTab.js +1 -1
  117. package/lib/component/modal/editRange/forms/components/CouplingsTable.js +2 -1
  118. package/lib/component/modal/editRange/forms/components/DeltaInput.d.ts +1 -2
  119. package/lib/component/modal/editRange/forms/components/DeltaInput.js +1 -1
  120. package/lib/component/modal/editRange/forms/components/SignalFormInfo.d.ts +1 -2
  121. package/lib/component/modal/editRange/forms/components/SignalFormTab.d.ts +1 -1
  122. package/lib/component/modal/editZone/SignalFormTab.d.ts +1 -2
  123. package/lib/component/modal/setting/WorkspaceItem.d.ts +1 -2
  124. package/lib/component/modal/setting/settings-tabs/DatabasesTabContent.d.ts +1 -2
  125. package/lib/component/modal/setting/settings-tabs/DisplayTabContent.d.ts +1 -2
  126. package/lib/component/modal/setting/settings-tabs/GeneralTabContent.d.ts +1 -2
  127. package/lib/component/modal/setting/settings-tabs/ImportationFiltersTabContent.d.ts +1 -2
  128. package/lib/component/modal/setting/settings-tabs/InfoBlockTabContent.d.ts +1 -2
  129. package/lib/component/modal/setting/settings-tabs/OnLoadProcessingTabContent.d.ts +1 -2
  130. package/lib/component/modal/setting/settings-tabs/ToolsTabContent.d.ts +1 -2
  131. package/lib/component/panels/AutomaticAssignment/AutomaticAssignmentTable.d.ts +1 -1
  132. package/lib/component/panels/InformationPanel.d.ts +1 -2
  133. package/lib/component/panels/IntegralsPanel/IntegralTable.d.ts +1 -1
  134. package/lib/component/panels/MoleculesPanel/MoleculeHeader.d.ts +1 -2
  135. package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.d.ts +1 -2
  136. package/lib/component/panels/MultipleSpectraAnalysisPanel/base/AnalysisCell.d.ts +1 -2
  137. package/lib/component/panels/MultipleSpectraAnalysisPanel/base/AnalysisColumnHeader.d.ts +1 -2
  138. package/lib/component/panels/MultipleSpectraAnalysisPanel/preferences/AnalysisTablePreferences.d.ts +1 -2
  139. package/lib/component/panels/MultipleSpectraAnalysisPanel/preferences/LegendsPreferences.d.ts +1 -2
  140. package/lib/component/panels/PanelNoData.d.ts +1 -2
  141. package/lib/component/panels/Panels.d.ts +1 -2
  142. package/lib/component/panels/PeaksPanel/PeaksTable.d.ts +1 -1
  143. package/lib/component/panels/RangesPanel/TableColumns/AbsoluteColumn.d.ts +1 -2
  144. package/lib/component/panels/RangesPanel/TableColumns/CouplingColumn.d.ts +1 -2
  145. package/lib/component/panels/RangesPanel/TableColumns/RangeColumn.d.ts +1 -2
  146. package/lib/component/panels/RangesPanel/TableColumns/RelativeColumn.d.ts +1 -2
  147. package/lib/component/panels/RangesPanel/TableColumns/RemoveAssignmentsButton.d.ts +1 -2
  148. package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.d.ts +1 -2
  149. package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.js +1 -1
  150. package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaHzColumn.d.ts +1 -2
  151. package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaHzColumn.js +1 -1
  152. package/lib/component/panels/SpectrumsPanel/SpectraPanelHeader.d.ts +1 -2
  153. package/lib/component/panels/SpectrumsPanel/SpectraTable.d.ts +1 -2
  154. package/lib/component/panels/SpectrumsPanel/SpectrumListPanel.d.ts +1 -1
  155. package/lib/component/panels/SpectrumsPanel/base/ColorIndicator.d.ts +1 -1
  156. package/lib/component/panels/SpectrumsPanel/base/ShowHideSpectrumButton.d.ts +1 -2
  157. package/lib/component/panels/SpectrumsPanel/base/SpectraColumnsManager.d.ts +1 -2
  158. package/lib/component/panels/SpectrumsPanel/base/SpectrumName.d.ts +1 -2
  159. package/lib/component/panels/SpectrumsPanel/base/setting/PlotChart.d.ts +1 -2
  160. package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum1DHistogram.d.ts +1 -1
  161. package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum1DSetting.d.ts +1 -2
  162. package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum2DHistogram.d.ts +1 -1
  163. package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.d.ts +1 -2
  164. package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +1 -1
  165. package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.d.ts +1 -2
  166. package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.d.ts +1 -2
  167. package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumn.d.ts +1 -2
  168. package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumns.d.ts +1 -2
  169. package/lib/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.d.ts +1 -2
  170. package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.d.ts +1 -1
  171. package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumns.d.ts +1 -2
  172. package/lib/component/panels/extra/placeholder/NoTableData.d.ts +1 -2
  173. package/lib/component/panels/extra/preferences/NucleusGroup.d.ts +1 -1
  174. package/lib/component/panels/extra/preferences/NucleusPreferences.d.ts +1 -2
  175. package/lib/component/panels/extra/preferences/PreferencesContainer.d.ts +1 -1
  176. package/lib/component/panels/extra/preferences/PreferencesGroup.d.ts +1 -1
  177. package/lib/component/panels/extra/utilities/MultiplicityUtilities.d.ts +2 -5
  178. package/lib/component/panels/extra/utilities/MultiplicityUtilities.js +3 -29
  179. package/lib/component/panels/filtersPanel/FiltersTable.d.ts +1 -2
  180. package/lib/component/panels/header/SpectraAutomaticPickingButton.d.ts +1 -2
  181. package/lib/component/panels/predictionPanel/PredictionPanel.d.ts +1 -2
  182. package/lib/component/toolbar/BasicToolBar.d.ts +1 -2
  183. package/lib/component/toolbar/FunctionToolBar.d.ts +1 -2
  184. package/lib/component/toolbar/HistoryToolBar.d.ts +1 -1
  185. package/lib/component/toolbar/ToolBar.d.ts +1 -2
  186. package/lib/data/constants/Multiplets.js +6 -13
  187. package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +1 -1
  188. package/lib/data/data1d/Spectrum1D/ranges/detectSignal.d.ts +1 -1
  189. package/lib/data/data1d/Spectrum1D/ranges/detectSignal.js +41 -18
  190. package/lib/data/data1d/filter1d/fft.js +5 -7
  191. package/lib/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +2 -2
  192. package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +1 -2
  193. package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.js +12 -0
  194. package/lib/data/data2d/Spectrum2D/zones/getDetectionZones.d.ts +1 -0
  195. package/lib/data/data2d/Spectrum2D/zones/getDetectionZones.js +9 -4
  196. package/lib/versionInfo.js +1 -1
  197. package/lib-cjs/component/1d/multiplicityTree/MultiplicityTree.js +2 -1
  198. package/lib-cjs/component/modal/MultipletAnalysisModal.js +6 -1
  199. package/lib-cjs/component/modal/editRange/EditRangeModal.js +5 -4
  200. package/lib-cjs/component/modal/editRange/forms/components/AddSignalFormTab.js +2 -2
  201. package/lib-cjs/component/modal/editRange/forms/components/CouplingsTable.js +2 -1
  202. package/lib-cjs/component/modal/editRange/forms/components/DeltaInput.js +2 -2
  203. package/lib-cjs/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.js +2 -2
  204. package/lib-cjs/component/panels/RangesPanel/TableColumns/SignalDeltaHzColumn.js +2 -2
  205. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +1 -1
  206. package/lib-cjs/component/panels/extra/utilities/MultiplicityUtilities.js +5 -34
  207. package/lib-cjs/data/constants/Multiplets.js +6 -13
  208. package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +1 -1
  209. package/lib-cjs/data/data1d/Spectrum1D/ranges/detectSignal.js +40 -17
  210. package/lib-cjs/data/data1d/filter1d/fft.js +5 -7
  211. package/lib-cjs/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +2 -2
  212. package/lib-cjs/data/data2d/Spectrum2D/initiateDatum2D.js +1 -2
  213. package/lib-cjs/data/data2d/Spectrum2D/zones/detectZonesManual.js +12 -0
  214. package/lib-cjs/data/data2d/Spectrum2D/zones/getDetectionZones.js +9 -4
  215. package/lib-cjs/versionInfo.js +1 -1
  216. package/package.json +21 -21
@@ -16,7 +16,7 @@ export function apply(spectrum) {
16
16
  }
17
17
  checkSameLength(spectrum);
18
18
  let digitalFilterApplied = spectrum.filters.some((e) => e.name === 'digitalFilter' && e.flag);
19
- const { meta: { AQ_mod: aqMod }, } = spectrum;
19
+ const { info: { aqMod }, } = spectrum;
20
20
  if (aqMod === 1) {
21
21
  removeDCOffset(spectrum, digitalFilterApplied);
22
22
  }
@@ -24,18 +24,16 @@ export function apply(spectrum) {
24
24
  padDataToNextPowerOfTwo(spectrum, digitalFilterApplied);
25
25
  }
26
26
  const { data, info } = spectrum;
27
- Object.assign(data, reimFFT(data, { applyZeroShift: true }));
27
+ Object.assign(data, reimFFT({
28
+ re: data.re,
29
+ im: data.im,
30
+ }, { applyZeroShift: true }));
28
31
  if (digitalFilterApplied) {
29
32
  let { digitalFilter = 0 } = info;
30
33
  let ph1 = (digitalFilter - Math.floor(digitalFilter)) * Math.PI * 2;
31
34
  Object.assign(data, reimPhaseCorrection(data, 0, -ph1, { reverse: true }));
32
35
  }
33
36
  data.x = generateXAxis(spectrum);
34
- if (info?.reverse?.[0]) {
35
- data.re.reverse();
36
- data.im.reverse();
37
- }
38
- // Object.assign(datum1D.data, data);
39
37
  spectrum.info = { ...info, isFid: false, isFt: true };
40
38
  }
41
39
  export function isApplicable(spectrum) {
@@ -5,8 +5,8 @@ export function padDataToNextPowerOfTwo(spectrum, digitalFilterApplied) {
5
5
  let newRE = new Float64Array(size);
6
6
  let newIM = new Float64Array(size);
7
7
  const pointsToShift = getPointsToShift(spectrum);
8
- newRE.set(re.slice(0, length - pointsToShift));
9
- newIM.set(im.slice(0, length - pointsToShift));
8
+ newRE.set(re.slice(0, size - pointsToShift));
9
+ newIM.set(im.slice(0, size - pointsToShift));
10
10
  if (pointsToShift > 0 && digitalFilterApplied) {
11
11
  newRE.set(re.slice(re.length - pointsToShift), size - pointsToShift);
12
12
  newIM.set(im.slice(re.length - pointsToShift), size - pointsToShift);
@@ -5,9 +5,8 @@ import { get2DColor } from './get2DColor';
5
5
  import { initiateZones } from './zones/initiateZones';
6
6
  const defaultMinMax = { z: [], minX: 0, minY: 0, maxX: 0, maxY: 0 };
7
7
  export function initiateDatum2D(spectrum, usedColors = {}) {
8
- const datum = {};
8
+ const datum = { ...spectrum };
9
9
  datum.id = spectrum.id || v4();
10
- datum.selector = spectrum?.selector || {};
11
10
  datum.display = {
12
11
  isPositiveVisible: true,
13
12
  isNegativeVisible: true,
@@ -12,6 +12,18 @@ import { mapZones } from './mapZones';
12
12
  * @param {boolean} options.convolutionByFFT
13
13
  */
14
14
  export function detectZonesManual(datum, options) {
15
+ const { spectralWidth, originFrequency } = datum.info;
16
+ options.tolerances = spectralWidth.map((sw, i) => sw * originFrequency[i]);
15
17
  const zones = getDetectionZones(datum, options);
18
+ let { fromX, fromY, toX, toY } = options.selectedZone;
19
+ if (fromX > toX)
20
+ [fromX, toX] = [toX, fromX];
21
+ if (fromX > toX)
22
+ [fromY, toY] = [toY, fromY];
23
+ zones[0] = {
24
+ ...zones[0],
25
+ x: { from: fromX, to: toX },
26
+ y: { from: fromY, to: toY },
27
+ };
16
28
  return mapZones(zones, datum);
17
29
  }
@@ -7,6 +7,7 @@ export interface DetectionZonesOptions {
7
7
  toY: number;
8
8
  };
9
9
  thresholdFactor: number;
10
+ tolerances?: number[];
10
11
  convolutionByFFT?: boolean;
11
12
  enhanceSymmetry?: boolean;
12
13
  }
@@ -12,20 +12,25 @@ import { xyzAutoZonesPicking } from 'nmr-processing';
12
12
  */
13
13
  export function getDetectionZones(spectrum, options) {
14
14
  let dataMatrix = {};
15
- if (options.selectedZone) {
15
+ const { selectedZone } = options;
16
+ if (selectedZone) {
16
17
  options.enhanceSymmetry = false;
17
- dataMatrix = getSubMatrix(spectrum, options.selectedZone);
18
+ dataMatrix = getSubMatrix(spectrum, selectedZone);
18
19
  }
19
20
  else {
20
21
  dataMatrix = spectrum.data;
21
22
  }
22
- return autoZonesDetection(dataMatrix, { ...options, info: spectrum.info });
23
+ return autoZonesDetection(dataMatrix, {
24
+ ...options,
25
+ info: spectrum.info,
26
+ });
23
27
  }
24
28
  function autoZonesDetection(data, options) {
25
- const { thresholdFactor, clean, maxPercentCutOff, convolutionByFFT, info: { nucleus: nuclei, originFrequency }, } = options;
29
+ const { clean, tolerances, thresholdFactor, maxPercentCutOff, convolutionByFFT, info: { nucleus: nuclei, originFrequency }, } = options;
26
30
  const { enhanceSymmetry = nuclei[0] === nuclei[1] } = options;
27
31
  let zones = xyzAutoZonesPicking(data, {
28
32
  nuclei,
33
+ tolerances,
29
34
  observedFrequencies: originFrequency,
30
35
  thresholdFactor,
31
36
  realTopDetection: true,
@@ -1 +1 @@
1
- export default { version: 'v0.35.1' };
1
+ export default { version: 'v0.36.0' };
@@ -7,6 +7,7 @@ exports.MultiplicityTree = void 0;
7
7
  const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
8
8
  /** @jsxImportSource @emotion/react */
9
9
  const react_1 = require("@emotion/react");
10
+ const nmr_processing_1 = require("nmr-processing");
10
11
  const react_2 = require("react");
11
12
  const AssignmentsContext_1 = require("../../assignment/AssignmentsContext");
12
13
  const ChartContext_1 = require("../../context/ChartContext");
@@ -86,7 +87,7 @@ function getTree(range, spectrum, scale) {
86
87
  const treeResult = [];
87
88
  const { signals = [], ...otherRangeProps } = range;
88
89
  for (const signal of signals) {
89
- const isMassive = !(0, MultiplicityUtilities_1.checkMultiplicity)(signal.multiplicity, ['m']);
90
+ const isMassive = !(0, nmr_processing_1.checkMultiplicity)(signal.multiplicity, ['m']);
90
91
  const length = signal?.multiplicity?.length || 0;
91
92
  let width = 0;
92
93
  let height = 0;
@@ -131,8 +131,13 @@ function MultipletAnalysisModal({ data, activeSpectrum, scaleX, startX, endX, on
131
131
  try {
132
132
  const result = (0, multiplet_analysis_1.analyseMultiplet)(analysesProps, {
133
133
  frequency: info.originFrequency,
134
+ minimalResolution: 0.3,
135
+ maxTestedJ: 17,
134
136
  takeBestPartMultiplet: true,
135
- symmetrizeEachStep: true,
137
+ correctVerticalOffset: true,
138
+ symmetrizeEachStep: false,
139
+ decreasingJvalues: true,
140
+ makeShortCutForSpeed: true,
136
141
  debug: true,
137
142
  });
138
143
  setCalcFinished(true);
@@ -8,6 +8,7 @@ const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
8
8
  const react_1 = require("@emotion/react");
9
9
  const uuid_1 = require("@lukeed/uuid");
10
10
  const formik_1 = require("formik");
11
+ const nmr_processing_1 = require("nmr-processing");
11
12
  const react_2 = require("react");
12
13
  const fa_1 = require("react-icons/fa");
13
14
  const ChartContext_1 = require("../../context/ChartContext");
@@ -74,7 +75,7 @@ function EditRangeModal({ onSaveEditRangeModal = () => null, onCloseEditRangeMod
74
75
  .map((coupling) => {
75
76
  return {
76
77
  ...coupling,
77
- multiplicity: (0, MultiplicityUtilities_1.translateMultiplet)(coupling.multiplicity),
78
+ multiplicity: (0, nmr_processing_1.translateMultiplet)(coupling.multiplicity),
78
79
  };
79
80
  }), []);
80
81
  const getSignals = (0, react_2.useCallback)((signals) => {
@@ -83,7 +84,7 @@ function EditRangeModal({ onSaveEditRangeModal = () => null, onCloseEditRangeMod
83
84
  id: (0, uuid_1.v4)(),
84
85
  ...signal,
85
86
  multiplicity: signal.js
86
- .map((_coupling) => (0, MultiplicityUtilities_1.translateMultiplet)(_coupling.multiplicity))
87
+ .map((_coupling) => (0, nmr_processing_1.translateMultiplet)(_coupling.multiplicity))
87
88
  .join(''),
88
89
  js: getCouplings(signal?.js || []),
89
90
  };
@@ -102,7 +103,7 @@ function EditRangeModal({ onSaveEditRangeModal = () => null, onCloseEditRangeMod
102
103
  let counterJ = 0;
103
104
  const couplings = [];
104
105
  if (signal.multiplicity) {
105
- for (const multiplicity of signal.multiplicity.split('')) {
106
+ for (const multiplicity of (0, nmr_processing_1.splitPatterns)(signal.multiplicity)) {
106
107
  let js = {
107
108
  multiplicity,
108
109
  coupling: '',
@@ -112,7 +113,7 @@ function EditRangeModal({ onSaveEditRangeModal = () => null, onCloseEditRangeMod
112
113
  js.coupling = Number((0, formatNumber_1.formatNumber)(js.coupling, rangesPreferences.coupling.format));
113
114
  counterJ++;
114
115
  }
115
- js.multiplicity = (0, MultiplicityUtilities_1.translateMultiplet)(js.multiplicity || '');
116
+ js.multiplicity = (0, nmr_processing_1.translateMultiplet)(js.multiplicity || '');
116
117
  couplings.push(js);
117
118
  }
118
119
  }
@@ -30,12 +30,12 @@ const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
30
30
  /** @jsxImportSource @emotion/react */
31
31
  const react_1 = require("@emotion/react");
32
32
  const formik_1 = require("formik");
33
+ const nmr_processing_1 = require("nmr-processing");
33
34
  const react_2 = require("react");
34
35
  const fa_1 = require("react-icons/fa");
35
36
  const Yup = __importStar(require("yup"));
36
37
  const Button_1 = __importDefault(require("../../../../elements/Button"));
37
38
  const FormikInput_1 = __importDefault(require("../../../../elements/formik/FormikInput"));
38
- const MultiplicityUtilities_1 = require("../../../../panels/extra/utilities/MultiplicityUtilities");
39
39
  const formatNumber_1 = require("../../../../utility/formatNumber");
40
40
  const styles = {
41
41
  container: (0, react_1.css) `
@@ -69,7 +69,7 @@ function AddSignalFormTab({ onFocus, onBlur, range, preferences }, ref) {
69
69
  multiplicity: 'm',
70
70
  kind: 'signal',
71
71
  delta: Number(val.newSignalDelta),
72
- js: [{ multiplicity: (0, MultiplicityUtilities_1.translateMultiplet)('m'), coupling: '' }],
72
+ js: [{ multiplicity: (0, nmr_processing_1.translateMultiplet)('m'), coupling: '' }],
73
73
  };
74
74
  const _signals = values.signals.slice().concat(newSignal);
75
75
  setFieldValue('signals', _signals);
@@ -8,6 +8,7 @@ const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
8
8
  const react_1 = require("@emotion/react");
9
9
  const formik_1 = require("formik");
10
10
  const get_1 = __importDefault(require("lodash/get"));
11
+ const nmr_processing_1 = require("nmr-processing");
11
12
  const react_2 = require("react");
12
13
  const fa_1 = require("react-icons/fa");
13
14
  const Multiplets_1 = require("../../../../../data/constants/Multiplets");
@@ -48,7 +49,7 @@ function CouplingsTable({ push, remove, onFocus, onBlur, }) {
48
49
  }, [setFieldValue]);
49
50
  const couplingsList = (0, get_1.default)(values, `signals[${values.activeTab}].js`, []);
50
51
  return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)(Button_1.default.Done, { fill: "outline", style: { marginBottom: '10px' }, onClick: () => push({
51
- multiplicity: (0, MultiplicityUtilities_1.translateMultiplet)('m'),
52
+ multiplicity: (0, nmr_processing_1.translateMultiplet)('m'),
52
53
  coupling: '',
53
54
  }), children: [(0, jsx_runtime_1.jsx)(fa_1.FaPlus, { title: "Add new coupling", style: { display: 'inline-block' } }), (0, jsx_runtime_1.jsx)("span", { style: { display: 'inline-block', paddingLeft: '5px' }, children: "Add New Coupling" })] }), (0, jsx_runtime_1.jsx)("table", { css: CouplingsTableStyle, children: (0, jsx_runtime_1.jsxs)("tbody", { children: [(0, jsx_runtime_1.jsxs)("tr", { children: [(0, jsx_runtime_1.jsx)("th", { children: "#" }), (0, jsx_runtime_1.jsx)("th", { children: "Multiplicity" }), (0, jsx_runtime_1.jsx)("th", { children: "J (Hz)" }), (0, jsx_runtime_1.jsx)("th", { children: '' })] }), couplingsList.map((_coupling, i) => ((0, jsx_runtime_1.jsxs)("tr", { children: [(0, jsx_runtime_1.jsx)("td", { children: i + 1 }), (0, jsx_runtime_1.jsx)("td", { children: (0, jsx_runtime_1.jsx)(FormikSelect_1.default, { className: "select-box", name: `signals.${values.activeTab}.js.${i}.multiplicity`, items: Multiplets_1.Multiplets, itemValueField: "label", onChange: (value) => {
54
55
  multiplicityChangeHandler(value, `signals.${values.activeTab}.js.${i}.coupling`);
@@ -4,8 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const jsx_runtime_1 = require("react/jsx-runtime");
7
+ const nmr_processing_1 = require("nmr-processing");
7
8
  const FormikInput_1 = __importDefault(require("../../../../elements/formik/FormikInput"));
8
- const MultiplicityUtilities_1 = require("../../../../panels/extra/utilities/MultiplicityUtilities");
9
9
  const style = {
10
10
  input: {
11
11
  width: '50px',
@@ -16,7 +16,7 @@ const style = {
16
16
  };
17
17
  function DeltaInput({ signal, index, onFocus }) {
18
18
  return ((0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', alignItems: 'center' }, children: [(0, jsx_runtime_1.jsx)("span", { children: "\uD835\uDEC5: " }), (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: `signals.${index}.delta`, type: "number", placeholder: 'J (Hz)', onFocus: onFocus, style: style, checkErrorAfterInputTouched: false }), (0, jsx_runtime_1.jsx)("span", { children: signal.js
19
- .map((_coupling) => (0, MultiplicityUtilities_1.translateMultiplet)(_coupling.multiplicity))
19
+ .map((_coupling) => (0, nmr_processing_1.translateMultiplet)(_coupling.multiplicity))
20
20
  .join('') })] }));
21
21
  }
22
22
  exports.default = DeltaInput;
@@ -4,11 +4,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const jsx_runtime_1 = require("react/jsx-runtime");
7
+ const nmr_processing_1 = require("nmr-processing");
7
8
  const DispatchContext_1 = require("../../../context/DispatchContext");
8
9
  const EditableColumn_1 = __importDefault(require("../../../elements/EditableColumn"));
9
10
  const Types_1 = require("../../../reducer/types/Types");
10
11
  const formatNumber_1 = require("../../../utility/formatNumber");
11
- const MultiplicityUtilities_1 = require("../../extra/utilities/MultiplicityUtilities");
12
12
  function SignalDeltaColumn({ row, onHover, format, rowSpanTags, }) {
13
13
  const dispatch = (0, DispatchContext_1.useDispatch)();
14
14
  const signal = row.tableMetaInfo.signal;
@@ -24,6 +24,6 @@ function SignalDeltaColumn({ row, onHover, format, rowSpanTags, }) {
24
24
  }
25
25
  if (!signal)
26
26
  return (0, jsx_runtime_1.jsx)("td", { children: '' });
27
- return ((0, jsx_runtime_1.jsx)("td", { ...rowSpanTags, ...onHover, children: !(0, MultiplicityUtilities_1.checkMultiplicity)(signal.multiplicity, ['m']) ? (`${(0, formatNumber_1.formatNumber)(row.from, format)} - ${(0, formatNumber_1.formatNumber)(row.to, format)}`) : ((0, jsx_runtime_1.jsx)(EditableColumn_1.default, { value: (0, formatNumber_1.formatNumber)(signal.delta, format), onSave: saveHandler, type: "number", style: { padding: '0.1rem 0.4rem' } })) }));
27
+ return ((0, jsx_runtime_1.jsx)("td", { ...rowSpanTags, ...onHover, children: !(0, nmr_processing_1.checkMultiplicity)(signal.multiplicity, ['m']) ? (`${(0, formatNumber_1.formatNumber)(row.from, format)} - ${(0, formatNumber_1.formatNumber)(row.to, format)}`) : ((0, jsx_runtime_1.jsx)(EditableColumn_1.default, { value: (0, formatNumber_1.formatNumber)(signal.delta, format), onSave: saveHandler, type: "number", style: { padding: '0.1rem 0.4rem' } })) }));
28
28
  }
29
29
  exports.default = SignalDeltaColumn;
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const jsx_runtime_1 = require("react/jsx-runtime");
4
+ const nmr_processing_1 = require("nmr-processing");
4
5
  const formatNumber_1 = require("../../../utility/formatNumber");
5
- const MultiplicityUtilities_1 = require("../../extra/utilities/MultiplicityUtilities");
6
6
  function SignalDeltaHzColumn({ row, onHover, format, info, rowSpanTags, }) {
7
7
  const signal = row.tableMetaInfo.signal;
8
8
  if (!signal)
9
9
  return (0, jsx_runtime_1.jsx)("td", { children: '' });
10
- return ((0, jsx_runtime_1.jsx)("td", { ...rowSpanTags, ...onHover, children: !(0, MultiplicityUtilities_1.checkMultiplicity)(signal.multiplicity, ['m'])
10
+ return ((0, jsx_runtime_1.jsx)("td", { ...rowSpanTags, ...onHover, children: !(0, nmr_processing_1.checkMultiplicity)(signal.multiplicity, ['m'])
11
11
  ? `${(0, formatNumber_1.formatNumber)(row.from * info.originFrequency, format)} - ${(0, formatNumber_1.formatNumber)(row.to * info.originFrequency, format)}`
12
12
  : info?.originFrequency
13
13
  ? (0, formatNumber_1.formatNumber)(signal.delta * info.originFrequency, format)
@@ -149,7 +149,7 @@ function getTitle(commonLinks) {
149
149
  return '';
150
150
  }
151
151
  return [
152
- ...new Set(commonLinks?.link.map((link) => {
152
+ ...new Set(commonLinks?.link?.map((link) => {
153
153
  return link.experimentType.toUpperCase();
154
154
  })),
155
155
  ].join('/');
@@ -1,47 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.translateMultiplet = exports.hasCouplingConstant = exports.getPascal = exports.getMultiplicityNumber = exports.checkMultiplicity = exports.checkMultiplet = void 0;
4
- const Multiplets_1 = require("../../../../data/constants/Multiplets");
3
+ exports.hasCouplingConstant = exports.getPascal = exports.getMultiplicityNumber = void 0;
4
+ const nmr_processing_1 = require("nmr-processing");
5
5
  function getMultiplicityNumber(string) {
6
- const multiplet = Multiplets_1.Multiplets.find((_multiplet) => string === _multiplet.label || string === _multiplet.value);
6
+ const multiplet = (0, nmr_processing_1.findMultiplet)(string);
7
7
  return multiplet ? multiplet.multiplicity : null;
8
8
  }
9
9
  exports.getMultiplicityNumber = getMultiplicityNumber;
10
- function checkMultiplet(multiplet, rejected = []) {
11
- // options to determine whether a massive (m), for example, should be considered as rejected multiplet
12
- if (multiplet === undefined || multiplet.length === 0) {
13
- return false;
14
- }
15
- const _multiplet = Multiplets_1.Multiplets.find((m) => m.value === multiplet || m.label === multiplet);
16
- return (_multiplet &&
17
- !rejected.includes(_multiplet.value) &&
18
- !rejected.includes(_multiplet.label));
19
- }
20
- exports.checkMultiplet = checkMultiplet;
21
- function checkMultiplicity(multiplicity, rejected = []) {
22
- // options to determine whether a massive (m), for example, should be considered as rejected multiplicity
23
- if (multiplicity === undefined || multiplicity.length === 0) {
24
- return false;
25
- }
26
- const isBroad = multiplicity.match(/(?<broad>br s)/);
27
- return (isBroad ||
28
- multiplicity
29
- .split('')
30
- .every((_multiplet) => checkMultiplet(_multiplet, rejected)));
31
- }
32
- exports.checkMultiplicity = checkMultiplicity;
33
- function translateMultiplet(multiplet) {
34
- return multiplet.length === 1
35
- ? Multiplets_1.Multiplets.find((_multiplet) => _multiplet.value === multiplet)?.label
36
- : Multiplets_1.Multiplets.find((_multiplet) => _multiplet.label === multiplet)?.value;
37
- }
38
- exports.translateMultiplet = translateMultiplet;
39
10
  function hasCouplingConstant(multiplet) {
40
11
  if (multiplet.length > 1) {
41
- multiplet = translateMultiplet(multiplet);
12
+ multiplet = (0, nmr_processing_1.translateMultiplet)(multiplet);
42
13
  }
43
14
  // with the pre-set rejected ones, we check the given multiplicity for the need of having a coupling constant (massive and singlet do not)
44
- return checkMultiplicity(multiplet, ['m', 's']);
15
+ return (0, nmr_processing_1.checkMultiplicity)(multiplet, ['m', 's']);
45
16
  }
46
17
  exports.hasCouplingConstant = hasCouplingConstant;
47
18
  function getPascal(n, spin) {
@@ -1,16 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Multiplets = void 0;
4
- exports.Multiplets = [
5
- { label: 'massive (m)', value: 'm', multiplicity: null },
6
- { label: 'singlet (s)', value: 's', multiplicity: 1 },
7
- { label: 'broad singlet (br s)', value: 'br s', multiplicity: 1 },
8
- { label: 'doublet (d)', value: 'd', multiplicity: 2 },
9
- { label: 'triplet (t)', value: 't', multiplicity: 3 },
10
- { label: 'quartet (q)', value: 'q', multiplicity: 4 },
11
- { label: 'quintet (i)', value: 'i', multiplicity: 5 },
12
- { label: 'sextet (x)', value: 'x', multiplicity: 6 },
13
- { label: 'septet (p)', value: 'p', multiplicity: 7 },
14
- { label: 'octet (o)', value: 'o', multiplicity: 8 },
15
- { label: 'nonet (n)', value: 'n', multiplicity: 9 },
16
- ];
4
+ const nmr_processing_1 = require("nmr-processing");
5
+ exports.Multiplets = nmr_processing_1.MultiplicityPatterns.map(({ label, value, acs, multiplicity }) => ({
6
+ label: `${label}`,
7
+ value: acs || value,
8
+ multiplicity,
9
+ }));
@@ -34,7 +34,7 @@ const initiatePeaks_1 = require("./peaks/initiatePeaks");
34
34
  const initiateRanges_1 = require("./ranges/initiateRanges");
35
35
  function initiateDatum1D(spectrum, options = {}) {
36
36
  const { usedColors = {}, filters = [] } = options;
37
- const spectrumObj = {};
37
+ const spectrumObj = { ...spectrum };
38
38
  spectrumObj.id = spectrum.id || (0, uuid_1.v4)();
39
39
  spectrumObj.display = {
40
40
  isVisible: true,
@@ -14,37 +14,60 @@ function detectSignal(data, options) {
14
14
  });
15
15
  if (!checkMaxLength ||
16
16
  (checkMaxLength && toIndex - fromIndex <= exports.MAX_LENGTH)) {
17
- const data = {
17
+ const dataRoi = {
18
18
  x: x.slice(fromIndex, toIndex),
19
19
  y: re.slice(fromIndex, toIndex),
20
20
  };
21
- const result = (0, multiplet_analysis_1.analyseMultiplet)(data, {
21
+ const result = (0, multiplet_analysis_1.analyseMultiplet)(dataRoi, {
22
22
  frequency,
23
+ minimalResolution: 0.3,
24
+ maxTestedJ: 17,
25
+ checkSymmetryFirst: true,
23
26
  takeBestPartMultiplet: true,
24
- symmetrizeEachStep: true,
27
+ correctVerticalOffset: true,
28
+ symmetrizeEachStep: false,
29
+ decreasingJvalues: true,
30
+ makeShortCutForSpeed: true,
25
31
  });
26
32
  if (result && result.chemShift === undefined)
27
33
  return;
28
- const signal = {
29
- multiplicity: result.js.map((j) => j.multiplicity).join(''),
34
+ const { delta, js } = joinCouplings(result);
35
+ let cs = 0;
36
+ let area = 0;
37
+ for (let i = 0; i < dataRoi.x.length; i++) {
38
+ cs += dataRoi.x[i] * dataRoi.y[i];
39
+ area += dataRoi.y[i];
40
+ }
41
+ cs /= area;
42
+ const peakList = js.length === 0 ? (0, nmr_processing_1.xyAutoPeaksPicking)(dataRoi, { frequency }) : [];
43
+ return {
44
+ multiplicity: js.length > 0
45
+ ? js.map((j) => j.multiplicity).join('')
46
+ : Math.abs(cs - delta) / cs < 1e-3
47
+ ? peakList.length === 1
48
+ ? 's'
49
+ : 'm'
50
+ : 'm',
30
51
  kind: 'signal',
31
- delta: result.chemShift,
32
- js: result.js,
52
+ delta: cs,
53
+ js,
33
54
  diaIDs: [],
34
55
  };
35
- if (result.js.length === 0) {
36
- const { x: xData } = data;
37
- const { chemShift: delta } = result;
38
- const peakList = (0, nmr_processing_1.xyAutoPeaksPicking)(data, { frequency });
39
- const deltaX = xData[0] - xData[1];
40
- const peaks = peakList.filter((peak) => peak.x < delta - deltaX && peak.x > delta + deltaX);
41
- if (peaks.length === 1)
42
- signal.multiplicity = 's';
43
- }
44
- return signal;
45
56
  }
46
57
  else {
47
58
  throw new Error(`length of signal should not exceed ${exports.MAX_LENGTH} points`);
48
59
  }
49
60
  }
50
61
  exports.default = detectSignal;
62
+ function joinCouplings(result) {
63
+ const { chemShift: delta, js } = result;
64
+ return {
65
+ delta,
66
+ js: js.length > 1
67
+ ? (0, nmr_processing_1.signalJoinCouplings)({
68
+ delta,
69
+ js,
70
+ }, { tolerance: 0.6, ignoreDiaIDs: true }).js
71
+ : js,
72
+ };
73
+ }
@@ -19,7 +19,7 @@ function apply(spectrum) {
19
19
  }
20
20
  checkSameLength(spectrum);
21
21
  let digitalFilterApplied = spectrum.filters.some((e) => e.name === 'digitalFilter' && e.flag);
22
- const { meta: { AQ_mod: aqMod }, } = spectrum;
22
+ const { info: { aqMod }, } = spectrum;
23
23
  if (aqMod === 1) {
24
24
  removeDCOffset(spectrum, digitalFilterApplied);
25
25
  }
@@ -27,18 +27,16 @@ function apply(spectrum) {
27
27
  (0, padDataToNextPowerOfTwo_1.padDataToNextPowerOfTwo)(spectrum, digitalFilterApplied);
28
28
  }
29
29
  const { data, info } = spectrum;
30
- Object.assign(data, (0, ml_spectra_processing_1.reimFFT)(data, { applyZeroShift: true }));
30
+ Object.assign(data, (0, ml_spectra_processing_1.reimFFT)({
31
+ re: data.re,
32
+ im: data.im,
33
+ }, { applyZeroShift: true }));
31
34
  if (digitalFilterApplied) {
32
35
  let { digitalFilter = 0 } = info;
33
36
  let ph1 = (digitalFilter - Math.floor(digitalFilter)) * Math.PI * 2;
34
37
  Object.assign(data, (0, ml_spectra_processing_1.reimPhaseCorrection)(data, 0, -ph1, { reverse: true }));
35
38
  }
36
39
  data.x = generateXAxis(spectrum);
37
- if (info?.reverse?.[0]) {
38
- data.re.reverse();
39
- data.im.reverse();
40
- }
41
- // Object.assign(datum1D.data, data);
42
40
  spectrum.info = { ...info, isFid: false, isFt: true };
43
41
  }
44
42
  exports.apply = apply;
@@ -8,8 +8,8 @@ function padDataToNextPowerOfTwo(spectrum, digitalFilterApplied) {
8
8
  let newRE = new Float64Array(size);
9
9
  let newIM = new Float64Array(size);
10
10
  const pointsToShift = getPointsToShift(spectrum);
11
- newRE.set(re.slice(0, length - pointsToShift));
12
- newIM.set(im.slice(0, length - pointsToShift));
11
+ newRE.set(re.slice(0, size - pointsToShift));
12
+ newIM.set(im.slice(0, size - pointsToShift));
13
13
  if (pointsToShift > 0 && digitalFilterApplied) {
14
14
  newRE.set(re.slice(re.length - pointsToShift), size - pointsToShift);
15
15
  newIM.set(im.slice(re.length - pointsToShift), size - pointsToShift);
@@ -31,9 +31,8 @@ const get2DColor_1 = require("./get2DColor");
31
31
  const initiateZones_1 = require("./zones/initiateZones");
32
32
  const defaultMinMax = { z: [], minX: 0, minY: 0, maxX: 0, maxY: 0 };
33
33
  function initiateDatum2D(spectrum, usedColors = {}) {
34
- const datum = {};
34
+ const datum = { ...spectrum };
35
35
  datum.id = spectrum.id || (0, uuid_1.v4)();
36
- datum.selector = spectrum?.selector || {};
37
36
  datum.display = {
38
37
  isPositiveVisible: true,
39
38
  isNegativeVisible: true,
@@ -15,7 +15,19 @@ const mapZones_1 = require("./mapZones");
15
15
  * @param {boolean} options.convolutionByFFT
16
16
  */
17
17
  function detectZonesManual(datum, options) {
18
+ const { spectralWidth, originFrequency } = datum.info;
19
+ options.tolerances = spectralWidth.map((sw, i) => sw * originFrequency[i]);
18
20
  const zones = (0, getDetectionZones_1.getDetectionZones)(datum, options);
21
+ let { fromX, fromY, toX, toY } = options.selectedZone;
22
+ if (fromX > toX)
23
+ [fromX, toX] = [toX, fromX];
24
+ if (fromX > toX)
25
+ [fromY, toY] = [toY, fromY];
26
+ zones[0] = {
27
+ ...zones[0],
28
+ x: { from: fromX, to: toX },
29
+ y: { from: fromY, to: toY },
30
+ };
19
31
  return (0, mapZones_1.mapZones)(zones, datum);
20
32
  }
21
33
  exports.detectZonesManual = detectZonesManual;
@@ -15,21 +15,26 @@ const nmr_processing_1 = require("nmr-processing");
15
15
  */
16
16
  function getDetectionZones(spectrum, options) {
17
17
  let dataMatrix = {};
18
- if (options.selectedZone) {
18
+ const { selectedZone } = options;
19
+ if (selectedZone) {
19
20
  options.enhanceSymmetry = false;
20
- dataMatrix = getSubMatrix(spectrum, options.selectedZone);
21
+ dataMatrix = getSubMatrix(spectrum, selectedZone);
21
22
  }
22
23
  else {
23
24
  dataMatrix = spectrum.data;
24
25
  }
25
- return autoZonesDetection(dataMatrix, { ...options, info: spectrum.info });
26
+ return autoZonesDetection(dataMatrix, {
27
+ ...options,
28
+ info: spectrum.info,
29
+ });
26
30
  }
27
31
  exports.getDetectionZones = getDetectionZones;
28
32
  function autoZonesDetection(data, options) {
29
- const { thresholdFactor, clean, maxPercentCutOff, convolutionByFFT, info: { nucleus: nuclei, originFrequency }, } = options;
33
+ const { clean, tolerances, thresholdFactor, maxPercentCutOff, convolutionByFFT, info: { nucleus: nuclei, originFrequency }, } = options;
30
34
  const { enhanceSymmetry = nuclei[0] === nuclei[1] } = options;
31
35
  let zones = (0, nmr_processing_1.xyzAutoZonesPicking)(data, {
32
36
  nuclei,
37
+ tolerances,
33
38
  observedFrequencies: originFrequency,
34
39
  thresholdFactor,
35
40
  realTopDetection: true,
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = { version: 'v0.35.1' };
3
+ exports.default = { version: 'v0.36.0' };