nmrium 0.38.0 → 0.38.2

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 (442) hide show
  1. package/lib/component/1d/ApodizationLine.js +27 -4
  2. package/lib/component/1d/ExclusionZoneAnnotation.js +1 -1
  3. package/lib/component/1d/ExclusionZonesAnnotations.js +1 -1
  4. package/lib/component/1d/FooterBanner.js +5 -5
  5. package/lib/component/1d/SpectraLegends.js +2 -3
  6. package/lib/component/1d/Viewer1D.js +1 -1
  7. package/lib/component/1d/database/DatabaseSpectrum.js +2 -1
  8. package/lib/component/1d/integral/Integral.d.ts +1 -1
  9. package/lib/component/1d/integral/IntegralResizable.d.ts +1 -1
  10. package/lib/component/1d/jCouplingGraph/JsCouplings.d.ts +1 -1
  11. package/lib/component/1d/multiAnalysis/MultiAnalysisRanges.js +2 -2
  12. package/lib/component/1d/multiplicityTree/LevelNode.d.ts +1 -1
  13. package/lib/component/1d/multiplicityTree/MultiplicityTree.d.ts +1 -1
  14. package/lib/component/1d/multiplicityTree/StringNode.d.ts +1 -1
  15. package/lib/component/1d/multiplicityTree/buildTreeNode.d.ts +1 -1
  16. package/lib/component/1d/peaks/usePeakShapesPath.d.ts +2 -1
  17. package/lib/component/1d/ranges/Range.d.ts +1 -1
  18. package/lib/component/1d/tool/PeakPointer.js +6 -6
  19. package/lib/component/1d/tool/XLabelPointer.js +5 -5
  20. package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.d.ts +1 -1
  21. package/lib/component/1d-2d/components/FloatMoleculeStructures/index.d.ts +1 -1
  22. package/lib/component/1d-2d/tools/BrushX.js +2 -3
  23. package/lib/component/1d-2d/tools/BrushXY.js +2 -3
  24. package/lib/component/1d-2d/tools/CrossLinePointer.js +4 -5
  25. package/lib/component/2d/Chart2D.js +4 -4
  26. package/lib/component/2d/FooterBanner.js +5 -5
  27. package/lib/component/2d/Viewer2D.js +1 -1
  28. package/lib/component/2d/tools/XYLabelPointer.js +5 -5
  29. package/lib/component/2d/zones/Signal.d.ts +1 -1
  30. package/lib/component/2d/zones/SignalCrosshair.d.ts +1 -1
  31. package/lib/component/2d/zones/Zone.d.ts +1 -1
  32. package/lib/component/EventsTrackers/BrushTracker.d.ts +20 -12
  33. package/lib/component/EventsTrackers/BrushTracker.js +35 -22
  34. package/lib/component/EventsTrackers/MouseTracker.d.ts +6 -2
  35. package/lib/component/EventsTrackers/MouseTracker.js +4 -1
  36. package/lib/component/NMRium.d.ts +4 -5
  37. package/lib/component/NMRium.js +11 -14
  38. package/lib/component/assignment/AssignmentsReducer.d.ts +2 -2
  39. package/lib/component/context/PreferencesContext.d.ts +6 -6
  40. package/lib/component/elements/Button.d.ts +13 -11
  41. package/lib/component/elements/Button.js +16 -25
  42. package/lib/component/elements/ColorInput.d.ts +0 -1
  43. package/lib/component/elements/ColorInput.js +2 -2
  44. package/lib/component/elements/EditableColumn.js +5 -2
  45. package/lib/component/elements/Input.js +2 -4
  46. package/lib/component/elements/Label.d.ts +1 -0
  47. package/lib/component/elements/Label.js +2 -2
  48. package/lib/component/elements/MolecularFormulaInput.d.ts +2 -2
  49. package/lib/component/elements/MolecularFormulaInput.js +15 -18
  50. package/lib/component/elements/NextPrev.d.ts +5 -3
  51. package/lib/component/elements/NextPrev.js +26 -8
  52. package/lib/component/elements/NumberInput.js +2 -2
  53. package/lib/component/elements/ReactTable/ReactTable.js +4 -4
  54. package/lib/component/elements/formik/FormikCheckBox.d.ts +2 -1
  55. package/lib/component/elements/formik/FormikCheckBox.js +2 -2
  56. package/lib/component/elements/formik/FormikColumnFormatField.d.ts +4 -0
  57. package/lib/component/elements/formik/FormikColumnFormatField.js +19 -16
  58. package/lib/component/elements/formik/FormikInput.js +10 -6
  59. package/lib/component/elements/formik/FormikSelect.js +1 -1
  60. package/lib/component/header/ApodizationOptionsPanel.js +4 -3
  61. package/lib/component/header/AutoPeakPickingOptionPanel.js +16 -7
  62. package/lib/component/header/BaseLineCorrectionPanel.js +5 -2
  63. package/lib/component/header/PhaseCorrectionPanel.js +5 -2
  64. package/lib/component/header/RangesPickingOptionPanel.js +15 -7
  65. package/lib/component/header/ZeroFillingOptionsPanel.js +1 -1
  66. package/lib/component/highlight/index.d.ts +1 -1
  67. package/lib/component/hooks/useActiveSpectra.d.ts +1 -1
  68. package/lib/component/hooks/useActiveSpectrum.d.ts +1 -1
  69. package/lib/component/hooks/useActiveSpectrumPeaksViewState.d.ts +1 -1
  70. package/lib/component/hooks/useCheckPointsNumberInWindowArea.d.ts +2 -0
  71. package/lib/component/hooks/useCheckPointsNumberInWindowArea.js +17 -0
  72. package/lib/component/hooks/useCheckToolsVisibility.d.ts +2 -2
  73. package/lib/component/hooks/useDatumWithSpectraStatistics.d.ts +3 -2
  74. package/lib/component/hooks/useExport.js +1 -1
  75. package/lib/component/hooks/useFilter.d.ts +2 -1
  76. package/lib/component/hooks/usePanelPreferences.d.ts +3 -3
  77. package/lib/component/hooks/usePanelPreferences.js +4 -0
  78. package/lib/component/hooks/useSaveSettings.d.ts +1 -1
  79. package/lib/component/hooks/useSaveSettings.js +1 -1
  80. package/lib/component/hooks/useVerticalAlign.d.ts +1 -1
  81. package/lib/component/loader/DropZone.js +1 -2
  82. package/lib/component/modal/EditPeakShapeModal.d.ts +2 -2
  83. package/lib/component/modal/LoadJCAMPModal.d.ts +3 -3
  84. package/lib/component/modal/LoadJCAMPModal.js +35 -66
  85. package/lib/component/modal/ModalStyle.js +0 -10
  86. package/lib/component/modal/MoleculeStructureEditorModal.d.ts +2 -1
  87. package/lib/component/modal/MoleculeStructureEditorModal.js +12 -6
  88. package/lib/component/modal/MultipletAnalysisModal.d.ts +2 -2
  89. package/lib/component/modal/PredictSpectraModal.d.ts +4 -2
  90. package/lib/component/modal/PredictSpectraModal.js +43 -105
  91. package/lib/component/modal/SaveAsModal.d.ts +2 -0
  92. package/lib/component/modal/SaveAsModal.js +21 -14
  93. package/lib/component/modal/changeSum/ChangeSumModal.js +25 -38
  94. package/lib/component/modal/editRange/forms/components/AddSignalFormTab.d.ts +1 -1
  95. package/lib/component/modal/editRange/forms/components/DeltaInput.js +2 -0
  96. package/lib/component/modal/editRange/forms/components/SignalsForm.d.ts +2 -2
  97. package/lib/component/modal/metaImportation/MetaImportationModal.js +15 -5
  98. package/lib/component/modal/setting/GeneralSettings.js +1 -6
  99. package/lib/component/modal/setting/settings-tabs/DatabasesTabContent.d.ts +1 -1
  100. package/lib/component/panels/IntegralsPanel/IntegralPanel.d.ts +1 -1
  101. package/lib/component/panels/IntegralsPanel/IntegralTable.d.ts +1 -1
  102. package/lib/component/panels/IntegralsPanel/IntegralsPreferences.js +7 -15
  103. package/lib/component/panels/MoleculesPanel/MoleculeHeader.js +2 -2
  104. package/lib/component/panels/MoleculesPanel/MoleculePanel.d.ts +1 -11
  105. package/lib/component/panels/MoleculesPanel/MoleculePanel.js +20 -25
  106. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.d.ts +6 -11
  107. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +71 -81
  108. package/lib/component/panels/MoleculesPanel/Utilities.d.ts +1 -1
  109. package/lib/component/panels/MoleculesPanel/Utilities.js +3 -1
  110. package/lib/component/panels/MultipleSpectraAnalysisPanel/base/AnalysisColumnHeader.js +6 -6
  111. package/lib/component/panels/MultipleSpectraAnalysisPanel/preferences/AnalysisTablePreferences.js +2 -2
  112. package/lib/component/panels/MultipleSpectraAnalysisPanel/preferences/index.js +2 -2
  113. package/lib/component/panels/PeaksPanel/PeaksPanel.d.ts +1 -1
  114. package/lib/component/panels/RangesPanel/RangesHeader.js +39 -53
  115. package/lib/component/panels/RangesPanel/RangesPreferences.d.ts +1 -1
  116. package/lib/component/panels/RangesPanel/RangesPreferences.js +7 -22
  117. package/lib/component/panels/RangesPanel/RangesTable.d.ts +2 -2
  118. package/lib/component/panels/RangesPanel/RangesTableRow.d.ts +2 -2
  119. package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaHzColumn.d.ts +1 -1
  120. package/lib/component/panels/RangesPanel/hooks/useMapRanges.d.ts +1 -1
  121. package/lib/component/panels/SpectrumsPanel/SpectraTable.js +5 -1
  122. package/lib/component/panels/SpectrumsPanel/base/SpectraColumnsManager.js +10 -4
  123. package/lib/component/panels/SpectrumsPanel/base/setting/processSnapPlot.d.ts +2 -2
  124. package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +1 -1
  125. package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +1 -1
  126. package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/EditPathLength.d.ts +1 -1
  127. package/lib/component/panels/ZonesPanel/hooks/useMapZones.d.ts +1 -1
  128. package/lib/component/panels/databasePanel/DatabasePanel.d.ts +1 -1
  129. package/lib/component/panels/databasePanel/DatabasePanel.js +11 -28
  130. package/lib/component/panels/databasePanel/DatabasePreferences.js +2 -2
  131. package/lib/component/panels/header/DefaultPanelHeader.d.ts +2 -3
  132. package/lib/component/panels/header/DefaultPanelHeader.js +18 -26
  133. package/lib/component/panels/header/PanelHeader.d.ts +7 -0
  134. package/lib/component/panels/header/PanelHeader.js +12 -0
  135. package/lib/component/panels/predictionPanel/PredictionOptionsPanel.d.ts +9 -0
  136. package/lib/component/panels/predictionPanel/PredictionOptionsPanel.js +94 -0
  137. package/lib/component/panels/predictionPanel/PredictionPanel.d.ts +1 -1
  138. package/lib/component/panels/predictionPanel/PredictionPanel.js +107 -37
  139. package/lib/component/panels/predictionPanel/PredictionPreferences.d.ts +3 -0
  140. package/lib/component/panels/predictionPanel/PredictionPreferences.js +24 -0
  141. package/lib/component/panels/predictionPanel/PredictionSimpleOptions.d.ts +2 -0
  142. package/lib/component/panels/predictionPanel/PredictionSimpleOptions.js +44 -0
  143. package/lib/component/reducer/Reducer.d.ts +5 -87
  144. package/lib/component/reducer/Reducer.js +1 -25
  145. package/lib/component/reducer/actions/FiltersActions.d.ts +1 -2
  146. package/lib/component/reducer/actions/FiltersActions.js +47 -52
  147. package/lib/component/reducer/actions/HistoryActions.d.ts +4 -0
  148. package/lib/component/reducer/actions/HistoryActions.js +40 -0
  149. package/lib/component/reducer/actions/IntegralsActions.d.ts +1 -1
  150. package/lib/component/reducer/actions/LoadActions.d.ts +1 -2
  151. package/lib/component/reducer/actions/LoadActions.js +1 -1
  152. package/lib/component/reducer/actions/MoleculeActions.d.ts +7 -4
  153. package/lib/component/reducer/actions/MoleculeActions.js +57 -28
  154. package/lib/component/reducer/actions/PeaksActions.d.ts +1 -2
  155. package/lib/component/reducer/actions/PeaksActions.js +3 -3
  156. package/lib/component/reducer/actions/RangesActions.d.ts +4 -5
  157. package/lib/component/reducer/actions/RangesActions.js +5 -27
  158. package/lib/component/reducer/actions/SpectrumsActions.js +2 -2
  159. package/lib/component/reducer/actions/ToolsActions.d.ts +2 -2
  160. package/lib/component/reducer/actions/ZonesActions.d.ts +2 -1
  161. package/lib/component/reducer/actions/ZonesActions.js +1 -2
  162. package/lib/component/reducer/helper/getActiveSpectra.d.ts +1 -1
  163. package/lib/component/reducer/helper/getActiveSpectrum.d.ts +1 -1
  164. package/lib/component/reducer/helper/getVerticalAlign.d.ts +1 -1
  165. package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.d.ts +1 -1
  166. package/lib/component/reducer/preferences/preferencesReducer.d.ts +1 -1
  167. package/lib/component/reducer/preferences/utilities/getActiveWorkspace.d.ts +1 -1
  168. package/lib/component/reducer/preferences/utilities/getPreferencesByWorkspace.d.ts +2 -3
  169. package/lib/component/reducer/preferences/utilities/initWorkspace.d.ts +1 -1
  170. package/lib/component/reducer/preferences/utilities/mapNucleiFormatting.d.ts +1 -1
  171. package/lib/component/reducer/preferences/utilities/mapWorkspaces.d.ts +1 -1
  172. package/lib/component/toolbar/BasicToolBar.js +6 -11
  173. package/lib/component/toolbar/ToolTypes.d.ts +2 -2
  174. package/lib/component/toolbar/ToolTypes.js +1 -1
  175. package/lib/component/workspaces/assignment.d.ts +1 -1
  176. package/lib/component/workspaces/basic.d.ts +1 -1
  177. package/lib/component/workspaces/embedded.d.ts +1 -1
  178. package/lib/component/workspaces/exercise.d.ts +1 -1
  179. package/lib/component/workspaces/index.d.ts +6 -6
  180. package/lib/component/workspaces/prediction.d.ts +1 -1
  181. package/lib/component/workspaces/prediction.js +193 -0
  182. package/lib/component/workspaces/process1D.d.ts +1 -1
  183. package/lib/component/workspaces/workspaceDefaultProperties.d.ts +1 -1
  184. package/lib/component/workspaces/workspaceDefaultProperties.js +1 -1
  185. package/lib/data/PredictionManager.d.ts +2 -1
  186. package/lib/data/PredictionManager.js +16 -2
  187. package/lib/data/SpectraManager.d.ts +1 -2
  188. package/lib/data/constants/DefaultApodizationOptions.d.ts +2 -0
  189. package/lib/data/constants/DefaultApodizationOptions.js +5 -0
  190. package/lib/data/data1d/Spectrum1D/SumManager.d.ts +1 -1
  191. package/lib/data/data1d/Spectrum1D/convertDataToFloat64Array.d.ts +2 -2
  192. package/lib/data/data1d/Spectrum1D/generateJGraphData.d.ts +1 -1
  193. package/lib/data/data1d/Spectrum1D/index.d.ts +1 -5
  194. package/lib/data/data1d/Spectrum1D/index.js +1 -5
  195. package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +3 -3
  196. package/lib/data/data1d/Spectrum1D/integrals/initiateIntegrals.d.ts +2 -1
  197. package/lib/data/data1d/Spectrum1D/integrals/initiateIntegrals.js +1 -1
  198. package/lib/data/data1d/Spectrum1D/isRangeAssigned.d.ts +1 -1
  199. package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.d.ts +2 -1
  200. package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +1 -2
  201. package/lib/data/data1d/Spectrum1D/peaks/initiatePeaks.d.ts +3 -2
  202. package/lib/data/data1d/Spectrum1D/peaks/initiatePeaks.js +1 -1
  203. package/lib/data/data1d/Spectrum1D/peaks/lookupPeak.d.ts +2 -2
  204. package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.d.ts +2 -1
  205. package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.js +1 -2
  206. package/lib/data/data1d/Spectrum1D/ranges/addRange.d.ts +7 -7
  207. package/lib/data/data1d/Spectrum1D/ranges/addRange.js +5 -24
  208. package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.d.ts +2 -1
  209. package/lib/data/data1d/Spectrum1D/ranges/changeRange.d.ts +2 -1
  210. package/lib/data/data1d/Spectrum1D/ranges/changeRange.js +1 -1
  211. package/lib/data/data1d/Spectrum1D/ranges/checkRangeKind.d.ts +1 -1
  212. package/lib/data/data1d/Spectrum1D/ranges/detectRange.js +1 -1
  213. package/lib/data/data1d/Spectrum1D/ranges/detectRanges.js +1 -2
  214. package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.d.ts +37 -2
  215. package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.js +1 -1
  216. package/lib/data/data1d/database.js +2 -4
  217. package/lib/data/data1d/multipleSpectraAnalysis.d.ts +3 -30
  218. package/lib/data/data1d/multipleSpectraAnalysis.js +4 -15
  219. package/lib/data/data2d/Spectrum2D/getMissingProjection.d.ts +3 -2
  220. package/lib/data/data2d/Spectrum2D/getShift.js +1 -1
  221. package/lib/data/data2d/Spectrum2D/getSlice.d.ts +1 -1
  222. package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +1 -1
  223. package/lib/data/data2d/Spectrum2D/zones/detectZones.d.ts +1 -1
  224. package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.d.ts +1 -1
  225. package/lib/data/data2d/Spectrum2D/zones/initiateZones.d.ts +3 -2
  226. package/lib/data/data2d/Spectrum2D/zones/isZoneExists.d.ts +2 -1
  227. package/lib/data/data2d/Spectrum2D/zones/mapZones.d.ts +3 -2
  228. package/lib/data/getDefaultMatrixFilters.d.ts +1 -1
  229. package/lib/data/types/data1d/ComplexData1D.d.ts +2 -2
  230. package/lib/data/types/data1d/RangeDetectionResult.d.ts +1 -1
  231. package/lib/data/utilities/FindUtilities.d.ts +2 -1
  232. package/lib/data/utilities/RangeUtilities.d.ts +1 -1
  233. package/lib/data/utilities/ZoneUtilities.d.ts +1 -1
  234. package/lib/data/utilities/calculateSanPlot.d.ts +2 -2
  235. package/lib/types/NMRiumDataReturn.d.ts +1 -3
  236. package/lib/versionInfo.js +1 -1
  237. package/lib-cjs/component/1d/ApodizationLine.js +28 -5
  238. package/lib-cjs/component/1d/ExclusionZoneAnnotation.js +3 -26
  239. package/lib-cjs/component/1d/ExclusionZonesAnnotations.js +5 -28
  240. package/lib-cjs/component/1d/FooterBanner.js +2 -2
  241. package/lib-cjs/component/1d/SpectraLegends.js +1 -2
  242. package/lib-cjs/component/1d/database/DatabaseSpectrum.js +2 -1
  243. package/lib-cjs/component/1d/multiAnalysis/MultiAnalysisRanges.js +2 -2
  244. package/lib-cjs/component/1d/tool/PeakPointer.js +3 -3
  245. package/lib-cjs/component/1d/tool/XLabelPointer.js +2 -2
  246. package/lib-cjs/component/1d-2d/tools/BrushX.js +1 -2
  247. package/lib-cjs/component/1d-2d/tools/BrushXY.js +1 -2
  248. package/lib-cjs/component/1d-2d/tools/CrossLinePointer.js +2 -3
  249. package/lib-cjs/component/2d/Chart2D.js +4 -4
  250. package/lib-cjs/component/2d/FooterBanner.js +2 -2
  251. package/lib-cjs/component/2d/tools/XYLabelPointer.js +2 -2
  252. package/lib-cjs/component/EventsTrackers/BrushTracker.js +36 -22
  253. package/lib-cjs/component/EventsTrackers/MouseTracker.js +4 -1
  254. package/lib-cjs/component/NMRium.js +8 -11
  255. package/lib-cjs/component/elements/Button.js +16 -25
  256. package/lib-cjs/component/elements/ColorInput.js +2 -2
  257. package/lib-cjs/component/elements/EditableColumn.js +5 -2
  258. package/lib-cjs/component/elements/Input.js +2 -4
  259. package/lib-cjs/component/elements/Label.js +2 -2
  260. package/lib-cjs/component/elements/MolecularFormulaInput.js +14 -16
  261. package/lib-cjs/component/elements/NextPrev.js +26 -8
  262. package/lib-cjs/component/elements/NumberInput.js +2 -2
  263. package/lib-cjs/component/elements/ReactTable/ReactTable.js +4 -4
  264. package/lib-cjs/component/elements/formik/FormikCheckBox.js +2 -2
  265. package/lib-cjs/component/elements/formik/FormikColumnFormatField.js +20 -16
  266. package/lib-cjs/component/elements/formik/FormikInput.js +10 -6
  267. package/lib-cjs/component/elements/formik/FormikSelect.js +1 -1
  268. package/lib-cjs/component/header/ApodizationOptionsPanel.js +6 -5
  269. package/lib-cjs/component/header/AutoPeakPickingOptionPanel.js +15 -6
  270. package/lib-cjs/component/header/BaseLineCorrectionPanel.js +6 -3
  271. package/lib-cjs/component/header/PhaseCorrectionPanel.js +6 -26
  272. package/lib-cjs/component/header/RangesPickingOptionPanel.js +15 -7
  273. package/lib-cjs/component/header/ZeroFillingOptionsPanel.js +2 -25
  274. package/lib-cjs/component/hooks/useCheckPointsNumberInWindowArea.js +24 -0
  275. package/lib-cjs/component/hooks/useExport.js +1 -1
  276. package/lib-cjs/component/hooks/usePanelPreferences.js +4 -0
  277. package/lib-cjs/component/hooks/useSaveSettings.js +1 -1
  278. package/lib-cjs/component/loader/DropZone.js +1 -2
  279. package/lib-cjs/component/modal/LoadJCAMPModal.js +60 -67
  280. package/lib-cjs/component/modal/ModalStyle.js +0 -10
  281. package/lib-cjs/component/modal/MoleculeStructureEditorModal.js +12 -6
  282. package/lib-cjs/component/modal/PredictSpectraModal.js +43 -126
  283. package/lib-cjs/component/modal/SaveAsModal.js +22 -14
  284. package/lib-cjs/component/modal/changeSum/ChangeSumModal.js +24 -37
  285. package/lib-cjs/component/modal/editRange/forms/components/DeltaInput.js +2 -0
  286. package/lib-cjs/component/modal/metaImportation/MetaImportationModal.js +15 -5
  287. package/lib-cjs/component/modal/setting/GeneralSettings.js +1 -6
  288. package/lib-cjs/component/panels/IntegralsPanel/IntegralsPreferences.js +6 -14
  289. package/lib-cjs/component/panels/MoleculesPanel/MoleculeHeader.js +2 -2
  290. package/lib-cjs/component/panels/MoleculesPanel/MoleculePanel.js +19 -24
  291. package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +76 -86
  292. package/lib-cjs/component/panels/MoleculesPanel/Utilities.js +3 -1
  293. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/base/AnalysisColumnHeader.js +6 -6
  294. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/preferences/AnalysisTablePreferences.js +2 -2
  295. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/preferences/index.js +2 -2
  296. package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +38 -52
  297. package/lib-cjs/component/panels/RangesPanel/RangesPreferences.js +5 -20
  298. package/lib-cjs/component/panels/SpectrumsPanel/SpectraTable.js +5 -1
  299. package/lib-cjs/component/panels/SpectrumsPanel/base/SpectraColumnsManager.js +10 -4
  300. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +1 -1
  301. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +1 -1
  302. package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +11 -28
  303. package/lib-cjs/component/panels/databasePanel/DatabasePreferences.js +25 -2
  304. package/lib-cjs/component/panels/header/DefaultPanelHeader.js +18 -26
  305. package/lib-cjs/component/panels/header/PanelHeader.js +15 -0
  306. package/lib-cjs/component/panels/predictionPanel/PredictionOptionsPanel.js +122 -0
  307. package/lib-cjs/component/panels/predictionPanel/PredictionPanel.js +107 -37
  308. package/lib-cjs/component/panels/predictionPanel/PredictionPreferences.js +29 -0
  309. package/lib-cjs/component/panels/predictionPanel/PredictionSimpleOptions.js +72 -0
  310. package/lib-cjs/component/reducer/Reducer.js +2 -27
  311. package/lib-cjs/component/reducer/actions/FiltersActions.js +66 -94
  312. package/lib-cjs/component/reducer/actions/HistoryActions.js +45 -0
  313. package/lib-cjs/component/reducer/actions/MoleculeActions.js +58 -32
  314. package/lib-cjs/component/reducer/actions/PeaksActions.js +3 -3
  315. package/lib-cjs/component/reducer/actions/RangesActions.js +7 -52
  316. package/lib-cjs/component/reducer/actions/SpectrumsActions.js +4 -27
  317. package/lib-cjs/component/reducer/actions/ZonesActions.js +4 -28
  318. package/lib-cjs/component/toolbar/BasicToolBar.js +5 -10
  319. package/lib-cjs/component/toolbar/ToolTypes.js +9 -32
  320. package/lib-cjs/component/workspaces/prediction.js +193 -0
  321. package/lib-cjs/component/workspaces/workspaceDefaultProperties.js +21 -44
  322. package/lib-cjs/data/PredictionManager.js +16 -2
  323. package/lib-cjs/data/constants/DefaultApodizationOptions.js +8 -0
  324. package/lib-cjs/data/data1d/Spectrum1D/index.js +7 -11
  325. package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +9 -32
  326. package/lib-cjs/data/data1d/Spectrum1D/integrals/initiateIntegrals.js +2 -2
  327. package/lib-cjs/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +1 -2
  328. package/lib-cjs/data/data1d/Spectrum1D/peaks/initiatePeaks.js +2 -2
  329. package/lib-cjs/data/data1d/Spectrum1D/peaks/optimizePeaks.js +1 -2
  330. package/lib-cjs/data/data1d/Spectrum1D/ranges/addRange.js +7 -26
  331. package/lib-cjs/data/data1d/Spectrum1D/ranges/changeRange.js +2 -2
  332. package/lib-cjs/data/data1d/Spectrum1D/ranges/detectRange.js +2 -2
  333. package/lib-cjs/data/data1d/Spectrum1D/ranges/detectRanges.js +3 -4
  334. package/lib-cjs/data/data1d/Spectrum1D/ranges/initiateRanges.js +2 -2
  335. package/lib-cjs/data/data1d/database.js +2 -4
  336. package/lib-cjs/data/data1d/multipleSpectraAnalysis.js +5 -16
  337. package/lib-cjs/data/data2d/Spectrum2D/getShift.js +3 -26
  338. package/lib-cjs/data/data2d/Spectrum2D/initiateDatum2D.js +2 -25
  339. package/lib-cjs/versionInfo.js +1 -1
  340. package/package.json +25 -25
  341. package/lib/component/panels/predictionPanel/PredictionOptions.d.ts +0 -7
  342. package/lib/component/panels/predictionPanel/PredictionOptions.js +0 -74
  343. package/lib/component/workspaces/Workspace.d.ts +0 -188
  344. package/lib/component/workspaces/Workspace.js +0 -1
  345. package/lib/data/Filters.d.ts +0 -12
  346. package/lib/data/Filters.js +0 -12
  347. package/lib/data/FiltersManager.d.ts +0 -30
  348. package/lib/data/FiltersManager.js +0 -175
  349. package/lib/data/data1d/Spectrum1D/getShiftX.d.ts +0 -2
  350. package/lib/data/data1d/Spectrum1D/getShiftX.js +0 -6
  351. package/lib/data/data1d/Spectrum1D/getSpectrumErrorValue.d.ts +0 -2
  352. package/lib/data/data1d/Spectrum1D/getSpectrumErrorValue.js +0 -4
  353. package/lib/data/data1d/Spectrum1D/integrals/checkIntegralKind.d.ts +0 -7
  354. package/lib/data/data1d/Spectrum1D/integrals/checkIntegralKind.js +0 -9
  355. package/lib/data/data1d/Spectrum1D/integrals/mapIntegrals.d.ts +0 -12
  356. package/lib/data/data1d/Spectrum1D/integrals/mapIntegrals.js +0 -36
  357. package/lib/data/data1d/Spectrum1D/integrals/updateIntegrals.d.ts +0 -2
  358. package/lib/data/data1d/Spectrum1D/integrals/updateIntegrals.js +0 -6
  359. package/lib/data/data1d/Spectrum1D/integrals/updateIntegralsRelativeValues.d.ts +0 -2
  360. package/lib/data/data1d/Spectrum1D/integrals/updateIntegralsRelativeValues.js +0 -5
  361. package/lib/data/data1d/Spectrum1D/integrals/updateRelatives.d.ts +0 -2
  362. package/lib/data/data1d/Spectrum1D/integrals/updateRelatives.js +0 -26
  363. package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.d.ts +0 -3
  364. package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.js +0 -45
  365. package/lib/data/data1d/Spectrum1D/peaks/updatePeaks.d.ts +0 -2
  366. package/lib/data/data1d/Spectrum1D/peaks/updatePeaks.js +0 -7
  367. package/lib/data/data1d/Spectrum1D/ranges/mapRanges.d.ts +0 -4
  368. package/lib/data/data1d/Spectrum1D/ranges/mapRanges.js +0 -78
  369. package/lib/data/data1d/Spectrum1D/ranges/updateRanges.d.ts +0 -2
  370. package/lib/data/data1d/Spectrum1D/ranges/updateRanges.js +0 -9
  371. package/lib/data/data1d/Spectrum1D/ranges/updateRangesRelativeValues.d.ts +0 -2
  372. package/lib/data/data1d/Spectrum1D/ranges/updateRangesRelativeValues.js +0 -5
  373. package/lib/data/data1d/filter1d/apodization.d.ts +0 -27
  374. package/lib/data/data1d/filter1d/apodization.js +0 -81
  375. package/lib/data/data1d/filter1d/baselineCorrection.d.ts +0 -33
  376. package/lib/data/data1d/filter1d/baselineCorrection.js +0 -51
  377. package/lib/data/data1d/filter1d/digitalFilter.d.ts +0 -20
  378. package/lib/data/data1d/filter1d/digitalFilter.js +0 -44
  379. package/lib/data/data1d/filter1d/equallySpaced.d.ts +0 -33
  380. package/lib/data/data1d/filter1d/equallySpaced.js +0 -52
  381. package/lib/data/data1d/filter1d/exclusionZones.d.ts +0 -15
  382. package/lib/data/data1d/filter1d/exclusionZones.js +0 -32
  383. package/lib/data/data1d/filter1d/fft.d.ts +0 -18
  384. package/lib/data/data1d/filter1d/fft.js +0 -90
  385. package/lib/data/data1d/filter1d/phaseCorrection.d.ts +0 -26
  386. package/lib/data/data1d/filter1d/phaseCorrection.js +0 -64
  387. package/lib/data/data1d/filter1d/shiftX.d.ts +0 -20
  388. package/lib/data/data1d/filter1d/shiftX.js +0 -26
  389. package/lib/data/data1d/filter1d/signalProcessing.d.ts +0 -26
  390. package/lib/data/data1d/filter1d/signalProcessing.js +0 -65
  391. package/lib/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.d.ts +0 -2
  392. package/lib/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +0 -35
  393. package/lib/data/data1d/filter1d/zeroFilling.d.ts +0 -22
  394. package/lib/data/data1d/filter1d/zeroFilling.js +0 -60
  395. package/lib/data/data2d/filter2d/shiftX.d.ts +0 -18
  396. package/lib/data/data2d/filter2d/shiftX.js +0 -27
  397. package/lib/data/data2d/filter2d/shiftY.d.ts +0 -18
  398. package/lib/data/data2d/filter2d/shiftY.js +0 -27
  399. package/lib/data/types/view-state/PeaksViewState.d.ts +0 -17
  400. package/lib/data/types/view-state/PeaksViewState.js +0 -1
  401. package/lib/types/NMRiumGeneralPreferences.d.ts +0 -7
  402. package/lib/types/NMRiumGeneralPreferences.js +0 -1
  403. package/lib/types/NMRiumPanelPreferences.d.ts +0 -17
  404. package/lib/types/NMRiumPanelPreferences.js +0 -1
  405. package/lib/types/NMRiumToolBarPreferences.d.ts +0 -22
  406. package/lib/types/NMRiumToolBarPreferences.js +0 -1
  407. package/lib/types/PanelPreferencesType.d.ts +0 -4
  408. package/lib/types/PanelPreferencesType.js +0 -1
  409. package/lib-cjs/component/panels/predictionPanel/PredictionOptions.js +0 -102
  410. package/lib-cjs/component/workspaces/Workspace.js +0 -2
  411. package/lib-cjs/data/Filters.js +0 -38
  412. package/lib-cjs/data/FiltersManager.js +0 -206
  413. package/lib-cjs/data/data1d/Spectrum1D/getShiftX.js +0 -33
  414. package/lib-cjs/data/data1d/Spectrum1D/getSpectrumErrorValue.js +0 -8
  415. package/lib-cjs/data/data1d/Spectrum1D/integrals/checkIntegralKind.js +0 -13
  416. package/lib-cjs/data/data1d/Spectrum1D/integrals/mapIntegrals.js +0 -40
  417. package/lib-cjs/data/data1d/Spectrum1D/integrals/updateIntegrals.js +0 -10
  418. package/lib-cjs/data/data1d/Spectrum1D/integrals/updateIntegralsRelativeValues.js +0 -9
  419. package/lib-cjs/data/data1d/Spectrum1D/integrals/updateRelatives.js +0 -30
  420. package/lib-cjs/data/data1d/Spectrum1D/peaks/mapPeaks.js +0 -49
  421. package/lib-cjs/data/data1d/Spectrum1D/peaks/updatePeaks.js +0 -11
  422. package/lib-cjs/data/data1d/Spectrum1D/ranges/mapRanges.js +0 -82
  423. package/lib-cjs/data/data1d/Spectrum1D/ranges/updateRanges.js +0 -13
  424. package/lib-cjs/data/data1d/Spectrum1D/ranges/updateRangesRelativeValues.js +0 -9
  425. package/lib-cjs/data/data1d/filter1d/apodization.js +0 -88
  426. package/lib-cjs/data/data1d/filter1d/baselineCorrection.js +0 -60
  427. package/lib-cjs/data/data1d/filter1d/digitalFilter.js +0 -50
  428. package/lib-cjs/data/data1d/filter1d/equallySpaced.js +0 -61
  429. package/lib-cjs/data/data1d/filter1d/exclusionZones.js +0 -38
  430. package/lib-cjs/data/data1d/filter1d/fft.js +0 -96
  431. package/lib-cjs/data/data1d/filter1d/phaseCorrection.js +0 -70
  432. package/lib-cjs/data/data1d/filter1d/shiftX.js +0 -32
  433. package/lib-cjs/data/data1d/filter1d/signalProcessing.js +0 -95
  434. package/lib-cjs/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +0 -39
  435. package/lib-cjs/data/data1d/filter1d/zeroFilling.js +0 -66
  436. package/lib-cjs/data/data2d/filter2d/shiftX.js +0 -33
  437. package/lib-cjs/data/data2d/filter2d/shiftY.js +0 -33
  438. package/lib-cjs/data/types/view-state/PeaksViewState.js +0 -2
  439. package/lib-cjs/types/NMRiumGeneralPreferences.js +0 -2
  440. package/lib-cjs/types/NMRiumPanelPreferences.js +0 -2
  441. package/lib-cjs/types/NMRiumToolBarPreferences.js +0 -2
  442. package/lib-cjs/types/PanelPreferencesType.js +0 -2
@@ -1,40 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.mapIntegrals = void 0;
4
- const uuid_1 = require("@lukeed/uuid");
5
- const ml_spectra_processing_1 = require("ml-spectra-processing");
6
- const getShiftX_1 = require("../getShiftX");
7
- function getRange(integral, shiftTarget, shift) {
8
- const { originFrom, originTo, from, to } = integral;
9
- if (shiftTarget === 'origin') {
10
- return {
11
- originFrom: from - shift,
12
- originTo: to - shift,
13
- from,
14
- to,
15
- };
16
- }
17
- else {
18
- return {
19
- originFrom,
20
- originTo,
21
- from: originFrom + shift,
22
- to: originTo + shift,
23
- };
24
- }
25
- }
26
- function mapIntegrals(integrals, spectrum, shiftTarget = 'origin') {
27
- const { x, re } = spectrum.data;
28
- const shiftX = (0, getShiftX_1.getShiftX)(spectrum);
29
- return integrals.map((integral) => {
30
- const integralBoundary = getRange(integral, shiftTarget, shiftX);
31
- const absolute = (0, ml_spectra_processing_1.xyIntegration)({ x, y: re }, { from: integralBoundary.from, to: integralBoundary.to, reverse: true });
32
- return {
33
- ...integral,
34
- id: integral.id || (0, uuid_1.v4)(),
35
- ...integralBoundary,
36
- absolute,
37
- };
38
- });
39
- }
40
- exports.mapIntegrals = mapIntegrals;
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.updateIntegrals = void 0;
4
- const mapIntegrals_1 = require("./mapIntegrals");
5
- const updateIntegralsRelativeValues_1 = require("./updateIntegralsRelativeValues");
6
- function updateIntegrals(spectrum) {
7
- spectrum.integrals.values = (0, mapIntegrals_1.mapIntegrals)(spectrum.integrals.values, spectrum, 'current');
8
- (0, updateIntegralsRelativeValues_1.updateIntegralsRelativeValues)(spectrum, true);
9
- }
10
- exports.updateIntegrals = updateIntegrals;
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.updateIntegralsRelativeValues = void 0;
4
- const checkIntegralKind_1 = require("./checkIntegralKind");
5
- const updateRelatives_1 = require("./updateRelatives");
6
- function updateIntegralsRelativeValues(spectrum, forceCalculateIntegral = false) {
7
- (0, updateRelatives_1.updateRelatives)(spectrum.integrals, 'integral', checkIntegralKind_1.checkIntegralKind, forceCalculateIntegral);
8
- }
9
- exports.updateIntegralsRelativeValues = updateIntegralsRelativeValues;
@@ -1,30 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.updateRelatives = void 0;
4
- const getSum_1 = require("../../../utilities/getSum");
5
- function updateRelatives(data, key, check, forceCalculateIntegral = false) {
6
- const { values, options } = data;
7
- const currentSum = (0, getSum_1.getSum)(values, 'absolute', check);
8
- let factor = 0;
9
- if (options?.sum) {
10
- if (options.isSumConstant || forceCalculateIntegral) {
11
- factor = currentSum > 0 ? options.sum / currentSum : 0;
12
- }
13
- else if (values?.[0]) {
14
- const item = values[0];
15
- factor = (item[key] || options.sum) / item.absolute;
16
- }
17
- }
18
- data.values = values.map((value) => {
19
- return {
20
- ...value,
21
- ...(check(value) && {
22
- [key]: value.absolute * factor,
23
- }),
24
- };
25
- });
26
- if (!options.isSumConstant && !forceCalculateIntegral) {
27
- options.sum = (0, getSum_1.getSum)(values, key, check);
28
- }
29
- }
30
- exports.updateRelatives = updateRelatives;
@@ -1,49 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.mapPeaks = void 0;
4
- const uuid_1 = require("@lukeed/uuid");
5
- const getShiftX_1 = require("../getShiftX");
6
- const getSpectrumErrorValue_1 = require("../getSpectrumErrorValue");
7
- function isExists(peak, spectrum, error) {
8
- // check if the Peak is already exists
9
- for (const { x } of spectrum.peaks?.values || []) {
10
- if (Math.abs(peak.x - x) < error) {
11
- return true;
12
- }
13
- }
14
- return false;
15
- }
16
- function getPeakDelta(peak, shiftTarget, shift) {
17
- const { originalX = 0, x } = peak;
18
- if (shiftTarget === 'origin') {
19
- return {
20
- originalX: x - shift,
21
- x,
22
- };
23
- }
24
- else {
25
- return {
26
- originalX,
27
- x: originalX + shift,
28
- };
29
- }
30
- }
31
- function mapPeaks(peaks, spectrum, options = {}) {
32
- const { checkIsExisting = true, shiftTarget = 'origin' } = options;
33
- const shiftX = (0, getShiftX_1.getShiftX)(spectrum);
34
- const error = (0, getSpectrumErrorValue_1.getSpectrumErrorValue)(spectrum);
35
- let newPeaks = [];
36
- for (const peak of peaks) {
37
- const peakDelta = getPeakDelta(peak, shiftTarget, shiftX);
38
- if (!checkIsExisting ||
39
- (checkIsExisting && !isExists(peak, spectrum, error))) {
40
- newPeaks.push({
41
- ...peak,
42
- id: peak?.id || (0, uuid_1.v4)(),
43
- ...peakDelta,
44
- });
45
- }
46
- }
47
- return newPeaks;
48
- }
49
- exports.mapPeaks = mapPeaks;
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.updatePeaks = void 0;
4
- const mapPeaks_1 = require("./mapPeaks");
5
- function updatePeaks(spectrum) {
6
- spectrum.peaks.values = (0, mapPeaks_1.mapPeaks)(spectrum.peaks.values, spectrum, {
7
- checkIsExisting: false,
8
- shiftTarget: 'current',
9
- });
10
- }
11
- exports.updatePeaks = updatePeaks;
@@ -1,82 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.mapRanges = void 0;
4
- const uuid_1 = require("@lukeed/uuid");
5
- const ml_spectra_processing_1 = require("ml-spectra-processing");
6
- const SignalsKinds_1 = require("../../../constants/SignalsKinds");
7
- const getShiftX_1 = require("../getShiftX");
8
- const getSpectrumErrorValue_1 = require("../getSpectrumErrorValue");
9
- function checkRange(range, spectrum, error) {
10
- // check if the range is already exists
11
- for (const { from, to } of spectrum.ranges?.values || []) {
12
- if (Math.abs(range.from - from) < error &&
13
- Math.abs(range.to - to) < error) {
14
- return true;
15
- }
16
- }
17
- }
18
- function getRange(range, shiftTarget, shift) {
19
- const { originFrom, originTo, from, to } = range;
20
- if (shiftTarget === 'origin') {
21
- return {
22
- originFrom: from - shift,
23
- originTo: to - shift,
24
- from,
25
- to,
26
- };
27
- }
28
- else {
29
- return {
30
- originFrom,
31
- originTo,
32
- from: (originFrom || 0) + shift,
33
- to: (originTo || 0) + shift,
34
- };
35
- }
36
- }
37
- function getSignalDelta(signal, shiftTarget, shift) {
38
- const { delta, originDelta } = signal;
39
- if (shiftTarget === 'origin') {
40
- return {
41
- originDelta: delta - shift,
42
- delta,
43
- };
44
- }
45
- else {
46
- return {
47
- originDelta,
48
- delta: (originDelta || 0) + shift,
49
- };
50
- }
51
- }
52
- function mapRanges(ranges, spectrum, options = {}) {
53
- const { checkIsExisting = true, shiftTarget = 'origin' } = options;
54
- const { x, re } = spectrum.data;
55
- const shiftX = (0, getShiftX_1.getShiftX)(spectrum);
56
- const error = (0, getSpectrumErrorValue_1.getSpectrumErrorValue)(spectrum);
57
- if (checkIsExisting) {
58
- ranges = ranges.filter((r) => (checkIsExisting && !checkRange(r, spectrum, error)) || r.id === 'new');
59
- }
60
- return ranges.map((range) => {
61
- const rangeBoundary = getRange(range, shiftTarget, shiftX);
62
- const absolute = (0, ml_spectra_processing_1.xyIntegration)({ x, y: re }, { from: rangeBoundary.from, to: rangeBoundary.to, reverse: true });
63
- const signals = range.signals.map((signal) => {
64
- const { kind = null, id, ...resSignal } = signal;
65
- return {
66
- kind: kind || 'signal',
67
- id: id || (0, uuid_1.v4)(),
68
- ...resSignal,
69
- ...getSignalDelta(signal, shiftTarget, shiftX),
70
- };
71
- });
72
- return {
73
- ...range,
74
- id: range.id || (0, uuid_1.v4)(),
75
- kind: signals?.[0].kind || SignalsKinds_1.DatumKind.signal,
76
- ...rangeBoundary,
77
- absolute,
78
- signals,
79
- };
80
- });
81
- }
82
- exports.mapRanges = mapRanges;
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.updateRanges = void 0;
4
- const mapRanges_1 = require("./mapRanges");
5
- const updateRangesRelativeValues_1 = require("./updateRangesRelativeValues");
6
- function updateRanges(spectrum) {
7
- spectrum.ranges.values = (0, mapRanges_1.mapRanges)(spectrum.ranges.values, spectrum, {
8
- checkIsExisting: false,
9
- shiftTarget: 'current',
10
- });
11
- (0, updateRangesRelativeValues_1.updateRangesRelativeValues)(spectrum, true);
12
- }
13
- exports.updateRanges = updateRanges;
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.updateRangesRelativeValues = void 0;
4
- const updateRelatives_1 = require("../integrals/updateRelatives");
5
- const checkRangeKind_1 = require("./checkRangeKind");
6
- function updateRangesRelativeValues(spectrum, forceCalculateIntegral = false) {
7
- (0, updateRelatives_1.updateRelatives)(spectrum.ranges, 'integration', checkRangeKind_1.checkRangeKind, forceCalculateIntegral);
8
- }
9
- exports.updateRangesRelativeValues = updateRangesRelativeValues;
@@ -1,88 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.apodizationFilter = exports.reduce = exports.isApplicable = exports.apply = exports.defaultApodizationOptions = exports.DOMAIN_UPDATE_RULES = exports.name = exports.id = void 0;
4
- const nmr_processing_1 = require("nmr-processing");
5
- exports.id = 'apodization';
6
- exports.name = 'Apodization';
7
- exports.DOMAIN_UPDATE_RULES = {
8
- updateXDomain: true,
9
- updateYDomain: false,
10
- };
11
- exports.defaultApodizationOptions = {
12
- lineBroadening: 1,
13
- gaussBroadening: 0,
14
- lineBroadeningCenter: 0,
15
- };
16
- function apply(datum1D, options = {}) {
17
- const { lineBroadening = 1, gaussBroadening = 0, lineBroadeningCenter = 0, } = options;
18
- // if no options is set, we add the default value to filter
19
- if (Object.keys(options).length === 0) {
20
- const filter = datum1D.filters.find((filter) => filter.name === exports.id);
21
- if (filter) {
22
- filter.value = { lineBroadening, gaussBroadening, lineBroadeningCenter };
23
- }
24
- }
25
- const newData = apodizationFilter(datum1D, {
26
- lineBroadening,
27
- gaussBroadening,
28
- lineBroadeningCenter,
29
- });
30
- datum1D.data = {
31
- ...datum1D.data,
32
- re: newData.re,
33
- im: newData.im,
34
- };
35
- }
36
- exports.apply = apply;
37
- function isApplicable(datum1D) {
38
- if (datum1D.info.isComplex && datum1D.info.isFid)
39
- return true;
40
- return false;
41
- }
42
- exports.isApplicable = isApplicable;
43
- function reduce(previousValue, newValue) {
44
- return {
45
- once: true,
46
- reduce: newValue,
47
- };
48
- }
49
- exports.reduce = reduce;
50
- function apodizationFilter(datum1D, options = {}) {
51
- const { lineBroadening = 1, gaussBroadening = 0, lineBroadeningCenter = 0, } = options;
52
- let grpdly = datum1D.info?.digitalFilter || 0;
53
- let pointsToShift;
54
- if (grpdly > 0) {
55
- pointsToShift = Math.floor(grpdly);
56
- }
57
- else {
58
- pointsToShift = 0;
59
- }
60
- const data = datum1D.data;
61
- const re = data.re;
62
- const im = data.im;
63
- const t = data.x;
64
- const length = re.length;
65
- const dw = (t[length - 1] - t[0]) / (length - 1); //REPLACE CONSTANT with calculated value... : for this we need AQ or DW to set it right...
66
- return (0, nmr_processing_1.apodization)({ re, im }, {
67
- pointsToShift,
68
- compose: {
69
- length,
70
- shapes: [
71
- {
72
- start: 0,
73
- shape: {
74
- kind: 'lorentzToGauss',
75
- options: {
76
- length,
77
- dw,
78
- exponentialHz: gaussBroadening > 0 ? lineBroadening : -lineBroadening,
79
- gaussianHz: gaussBroadening,
80
- center: lineBroadeningCenter,
81
- },
82
- },
83
- },
84
- ],
85
- },
86
- });
87
- }
88
- exports.apodizationFilter = apodizationFilter;
@@ -1,60 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.reduce = exports.isApplicable = exports.apply = exports.DOMAIN_UPDATE_RULES = exports.name = exports.id = void 0;
7
- const ml_airpls_1 = __importDefault(require("ml-airpls"));
8
- const ml_array_xy_equally_spaced_1 = __importDefault(require("ml-array-xy-equally-spaced"));
9
- const ml_baseline_correction_regression_1 = __importDefault(require("ml-baseline-correction-regression"));
10
- exports.id = 'baselineCorrection';
11
- exports.name = 'Baseline correction';
12
- exports.DOMAIN_UPDATE_RULES = {
13
- updateXDomain: false,
14
- updateYDomain: true,
15
- };
16
- function apply(datum1D, options) {
17
- if (!isApplicable(datum1D)) {
18
- throw new Error('baselineCorrection not applicable on this data');
19
- }
20
- const { algorithm } = options;
21
- let { x, re } = datum1D.data;
22
- let corrected;
23
- switch (algorithm) {
24
- case 'airpls':
25
- corrected = (0, ml_airpls_1.default)(x, re, options).corrected;
26
- break;
27
- case 'polynomial':
28
- {
29
- const { degree, zones } = options;
30
- let reduced = (0, ml_array_xy_equally_spaced_1.default)({ x, y: re }, { numberOfPoints: 4096, zones });
31
- let result = (0, ml_baseline_correction_regression_1.default)(reduced.x, reduced.y, {
32
- regressionOptions: degree,
33
- });
34
- let { regression } = result;
35
- corrected = new Float64Array(x.length);
36
- for (let i = 0; i < re.length; i++) {
37
- corrected[i] = re[i] - regression.predict(x[i]);
38
- }
39
- }
40
- break;
41
- default:
42
- // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
43
- throw new Error(`baselineCorrection: algorithm unknown: ${algorithm}`);
44
- }
45
- Object.assign(datum1D.data, { re: corrected });
46
- }
47
- exports.apply = apply;
48
- function isApplicable(datum1D) {
49
- if (!datum1D.info.isFid)
50
- return true;
51
- return false;
52
- }
53
- exports.isApplicable = isApplicable;
54
- function reduce(previousValue, newValue) {
55
- return {
56
- once: true,
57
- reduce: newValue,
58
- };
59
- }
60
- exports.reduce = reduce;
@@ -1,50 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.reduce = exports.isApplicable = exports.apply = exports.DOMAIN_UPDATE_RULES = exports.name = exports.id = void 0;
4
- exports.id = 'digitalFilter';
5
- exports.name = 'Digital filter';
6
- exports.DOMAIN_UPDATE_RULES = {
7
- updateXDomain: true,
8
- updateYDomain: true,
9
- };
10
- function apply(spectrum, options = {}) {
11
- if (!isApplicable(spectrum)) {
12
- throw new Error('Digital Filter is not applicable on this data');
13
- }
14
- let { digitalFilterValue } = options;
15
- if (!digitalFilterValue) {
16
- digitalFilterValue = spectrum.info.digitalFilter || 0;
17
- const filter = spectrum.filters.find((filter) => filter.name === exports.id);
18
- if (filter) {
19
- filter.value = { digitalFilterValue };
20
- }
21
- }
22
- let re = new Float64Array(spectrum.data.re);
23
- let im = new Float64Array(spectrum.data.im);
24
- let pointsToShift = Math.floor(digitalFilterValue);
25
- const skip = 0;
26
- pointsToShift += 0;
27
- const newRe = new Float64Array(re.length);
28
- const newIm = new Float64Array(im.length);
29
- newRe.set(re.slice(pointsToShift));
30
- newRe.set(re.slice(skip, pointsToShift), re.length - pointsToShift);
31
- newIm.set(im.slice(pointsToShift));
32
- newIm.set(im.slice(skip, pointsToShift), im.length - pointsToShift);
33
- spectrum.data.re = newRe;
34
- spectrum.data.im = newIm;
35
- }
36
- exports.apply = apply;
37
- function isApplicable(spectrum) {
38
- if (spectrum.info.isComplex && spectrum.info.isFid) {
39
- return true;
40
- }
41
- return false;
42
- }
43
- exports.isApplicable = isApplicable;
44
- function reduce() {
45
- return {
46
- once: true,
47
- reduce: undefined,
48
- };
49
- }
50
- exports.reduce = reduce;
@@ -1,61 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.reduce = exports.isApplicable = exports.apply = exports.name = exports.id = void 0;
7
- const ml_array_xy_equally_spaced_1 = __importDefault(require("ml-array-xy-equally-spaced"));
8
- exports.id = 'equallySpaced';
9
- exports.name = 'Equally spaced';
10
- /**
11
- * Equally Spaced
12
- * **
13
- * Function that returns a Number array of equally spaced numberOfPoints
14
- * containing a representation of intensities of the spectra arguments x
15
- * and y.
16
- *
17
- * The options parameter contains an object in the following form:
18
- * from: starting point
19
- * to: last point
20
- * numberOfPoints: number of points between from and to
21
- * variant: "slot" or "smooth" - smooth is the default option
22
- *
23
- * The slot variant consist that each point in the new array is calculated
24
- * averaging the existing points between the slot that belongs to the current
25
- * value. The smooth variant is the same but takes the integral of the range
26
- * of the slot and divide by the step size between two points in the new array.
27
- *
28
- * @param {Spectrum1D} spectrum
29
- * @param {Object} options.from
30
- * @param {number} options.to
31
- * @param {number} options.numberOfPoints
32
- * @param {Array<{from:number;to:number}>} options.exclusions
33
- */
34
- function apply(spectrum, options = {}) {
35
- if (!isApplicable(spectrum)) {
36
- throw new Error('Equally Spaced is not applicable on this data');
37
- }
38
- const { from, to, numberOfPoints, exclusions } = options;
39
- const { x, re, im } = spectrum.data;
40
- const XREdata = (0, ml_array_xy_equally_spaced_1.default)({ x, y: re }, { from, to, numberOfPoints, exclusions });
41
- spectrum.data.x = XREdata.x;
42
- spectrum.data.re = XREdata.y;
43
- if (im) {
44
- const XIMdata = (0, ml_array_xy_equally_spaced_1.default)({ x, y: re }, { from, to, numberOfPoints, exclusions });
45
- spectrum.data.im = XIMdata.y;
46
- }
47
- }
48
- exports.apply = apply;
49
- function isApplicable(spectrum) {
50
- if (spectrum.info.isComplex && !spectrum.info.isFid)
51
- return true;
52
- return false;
53
- }
54
- exports.isApplicable = isApplicable;
55
- function reduce() {
56
- return {
57
- once: false,
58
- reduce: null,
59
- };
60
- }
61
- exports.reduce = reduce;
@@ -1,38 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.reduce = exports.isApplicable = exports.apply = exports.DOMAIN_UPDATE_RULES = exports.name = exports.id = void 0;
4
- const ml_spectra_processing_1 = require("ml-spectra-processing");
5
- exports.id = 'exclusionZones';
6
- exports.name = 'Exclusion zones';
7
- exports.DOMAIN_UPDATE_RULES = {
8
- updateXDomain: false,
9
- updateYDomain: false,
10
- };
11
- /**
12
- *
13
- * @param {Spectrum1D} spectrum
14
- */
15
- function apply(spectrum, zones = []) {
16
- if (!isApplicable(spectrum)) {
17
- throw new Error('Exclusion Zones filter not applicable on this data');
18
- }
19
- const { x, re, im } = spectrum.data;
20
- spectrum.data.re = Float64Array.from((0, ml_spectra_processing_1.xySetYValue)({ x, y: re }, { zones }).y);
21
- spectrum.data.im = im
22
- ? Float64Array.from((0, ml_spectra_processing_1.xySetYValue)({ x, y: re }, { zones }).y)
23
- : im;
24
- }
25
- exports.apply = apply;
26
- function isApplicable(spectrum) {
27
- if (spectrum.info.isFt)
28
- return true;
29
- return false;
30
- }
31
- exports.isApplicable = isApplicable;
32
- function reduce(previousValue, newValue) {
33
- return {
34
- once: true,
35
- reduce: (0, ml_spectra_processing_1.zonesNormalize)(previousValue.concat(newValue)),
36
- };
37
- }
38
- exports.reduce = reduce;
@@ -1,96 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.reduce = exports.isApplicable = exports.apply = exports.DOMAIN_UPDATE_RULES = exports.name = exports.id = void 0;
4
- const ml_spectra_processing_1 = require("ml-spectra-processing");
5
- const padDataToNextPowerOfTwo_1 = require("./utils/padDataToNextPowerOfTwo");
6
- exports.id = 'fft';
7
- exports.name = 'FFT';
8
- exports.DOMAIN_UPDATE_RULES = {
9
- updateXDomain: true,
10
- updateYDomain: true,
11
- };
12
- /**
13
- *
14
- * @param {Spectrum1D} spectrum
15
- */
16
- function apply(spectrum) {
17
- if (!isApplicable(spectrum)) {
18
- throw new Error('fft not applicable on this data');
19
- }
20
- checkSameLength(spectrum);
21
- let digitalFilterApplied = spectrum.filters.some((e) => e.name === 'digitalFilter' && e.flag);
22
- const { info: { aqMod }, } = spectrum;
23
- if (aqMod === 1) {
24
- removeDCOffset(spectrum, digitalFilterApplied);
25
- }
26
- if (!isPowerOfTwo(spectrum.data.x.length)) {
27
- (0, padDataToNextPowerOfTwo_1.padDataToNextPowerOfTwo)(spectrum, digitalFilterApplied);
28
- }
29
- const { data, info } = spectrum;
30
- Object.assign(data, (0, ml_spectra_processing_1.reimFFT)({
31
- re: data.re,
32
- im: data.im,
33
- }, { applyZeroShift: true }));
34
- if (digitalFilterApplied) {
35
- let { digitalFilter = 0 } = info;
36
- let ph1 = (digitalFilter - Math.floor(digitalFilter)) * Math.PI * 2;
37
- Object.assign(data, (0, ml_spectra_processing_1.reimPhaseCorrection)(data, 0, -ph1, { reverse: true }));
38
- }
39
- data.x = generateXAxis(spectrum);
40
- spectrum.info = { ...info, isFid: false, isFt: true };
41
- }
42
- exports.apply = apply;
43
- function isApplicable(spectrum) {
44
- if (spectrum.info.isComplex && spectrum.info.isFid)
45
- return true;
46
- return false;
47
- }
48
- exports.isApplicable = isApplicable;
49
- function reduce() {
50
- return {
51
- once: true,
52
- reduce: undefined,
53
- };
54
- }
55
- exports.reduce = reduce;
56
- function generateXAxis(datum1D) {
57
- const info = datum1D.info;
58
- const baseFrequency = Number.parseFloat(info.baseFrequency);
59
- const frequencyOffset = Number.parseFloat(info.frequencyOffset);
60
- const spectralWidth = Number.parseFloat(info.spectralWidth);
61
- const offset = frequencyOffset / baseFrequency;
62
- let spectralHalfWidth = 0.5 * spectralWidth;
63
- let nbPoints = datum1D.data.x.length;
64
- let firstPoint = offset - spectralHalfWidth;
65
- let dx = spectralWidth / (nbPoints - 1);
66
- const xAxis = new Float64Array(nbPoints);
67
- for (let i = 0; i < nbPoints; i++) {
68
- xAxis[i] = firstPoint;
69
- firstPoint += dx;
70
- }
71
- return xAxis;
72
- }
73
- function isPowerOfTwo(n) {
74
- return n !== 0 && (n & (n - 1)) === 0;
75
- }
76
- function removeDCOffset(spectrum, digitalFilterApplied) {
77
- let { digitalFilter = 0 } = digitalFilterApplied ? spectrum.info : {};
78
- const data = spectrum.data;
79
- const nbPoints = data.re.length;
80
- const newRe = new Float64Array(data.re);
81
- const newIm = new Float64Array(data.im);
82
- const averageRe = (0, ml_spectra_processing_1.xMean)(data.re.slice((nbPoints * 0.75) >> 0, nbPoints - digitalFilter));
83
- const averageIm = (0, ml_spectra_processing_1.xMean)(data.im.slice((nbPoints * 0.75) >> 0, nbPoints - digitalFilter));
84
- for (let i = digitalFilterApplied ? 0 : digitalFilter; i < nbPoints - digitalFilter; i++) {
85
- newRe[i] -= averageRe;
86
- newIm[i] -= averageIm;
87
- }
88
- Object.assign(spectrum.data, { re: newRe, im: newIm });
89
- return spectrum;
90
- }
91
- function checkSameLength(spectrum) {
92
- const { data } = spectrum;
93
- if (data.x.length !== data.re.length || data.x.length !== data.im?.length) {
94
- throw new Error('The length of data should be equal');
95
- }
96
- }