nmrium 2.3.0 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (372) hide show
  1. package/lib/component/1d/HorizontalAxis1D.d.ts.map +1 -1
  2. package/lib/component/1d/HorizontalAxis1D.js +4 -1
  3. package/lib/component/1d/HorizontalAxis1D.js.map +1 -1
  4. package/lib/component/1d/SVGContent1D.d.ts.map +1 -1
  5. package/lib/component/1d/SVGContent1D.js +2 -1
  6. package/lib/component/1d/SVGContent1D.js.map +1 -1
  7. package/lib/component/1d/Viewer1D.d.ts.map +1 -1
  8. package/lib/component/1d/Viewer1D.js +2 -1
  9. package/lib/component/1d/Viewer1D.js.map +1 -1
  10. package/lib/component/1d/integral/IntegralResizable.d.ts.map +1 -1
  11. package/lib/component/1d/integral/IntegralResizable.js +4 -4
  12. package/lib/component/1d/integral/IntegralResizable.js.map +1 -1
  13. package/lib/component/1d/peaks/PeakEditionManager.d.ts +1 -1
  14. package/lib/component/1d/ranges/Range.d.ts.map +1 -1
  15. package/lib/component/1d/ranges/Range.js +3 -3
  16. package/lib/component/1d/ranges/Range.js.map +1 -1
  17. package/lib/component/1d/ranges/Signals.d.ts +2 -0
  18. package/lib/component/1d/ranges/Signals.d.ts.map +1 -0
  19. package/lib/component/1d/ranges/Signals.js +16 -0
  20. package/lib/component/1d/ranges/Signals.js.map +1 -0
  21. package/lib/component/1d-2d/components/RangeIndicator.d.ts +13 -0
  22. package/lib/component/1d-2d/components/RangeIndicator.d.ts.map +1 -0
  23. package/lib/component/1d-2d/components/RangeIndicator.js +52 -0
  24. package/lib/component/1d-2d/components/RangeIndicator.js.map +1 -0
  25. package/lib/component/1d-2d/components/Signals1D.d.ts +19 -0
  26. package/lib/component/1d-2d/components/Signals1D.d.ts.map +1 -0
  27. package/lib/component/1d-2d/components/Signals1D.js +155 -0
  28. package/lib/component/1d-2d/components/Signals1D.js.map +1 -0
  29. package/lib/component/1d-2d/tools/BrushXY.js +6 -6
  30. package/lib/component/1d-2d/tools/BrushXY.js.map +1 -1
  31. package/lib/component/1d-2d/tools/CrossLinePointer.d.ts +16 -1
  32. package/lib/component/1d-2d/tools/CrossLinePointer.d.ts.map +1 -1
  33. package/lib/component/1d-2d/tools/CrossLinePointer.js +25 -15
  34. package/lib/component/1d-2d/tools/CrossLinePointer.js.map +1 -1
  35. package/lib/component/1d-2d/tools/CursorToolIcon.d.ts +9 -0
  36. package/lib/component/1d-2d/tools/CursorToolIcon.d.ts.map +1 -0
  37. package/lib/component/1d-2d/tools/CursorToolIcon.js +58 -0
  38. package/lib/component/1d-2d/tools/CursorToolIcon.js.map +1 -0
  39. package/lib/component/2d/1d-tracer/Left1DChart.d.ts.map +1 -1
  40. package/lib/component/2d/1d-tracer/Left1DChart.js +7 -2
  41. package/lib/component/2d/1d-tracer/Left1DChart.js.map +1 -1
  42. package/lib/component/2d/1d-tracer/Ranges1D.d.ts +9 -0
  43. package/lib/component/2d/1d-tracer/Ranges1D.d.ts.map +1 -0
  44. package/lib/component/2d/1d-tracer/Ranges1D.js +20 -0
  45. package/lib/component/2d/1d-tracer/Ranges1D.js.map +1 -0
  46. package/lib/component/2d/1d-tracer/Top1DChart.d.ts.map +1 -1
  47. package/lib/component/2d/1d-tracer/Top1DChart.js +7 -2
  48. package/lib/component/2d/1d-tracer/Top1DChart.js.map +1 -1
  49. package/lib/component/2d/DirectAxis2D.d.ts.map +1 -1
  50. package/lib/component/2d/DirectAxis2D.js +4 -1
  51. package/lib/component/2d/DirectAxis2D.js.map +1 -1
  52. package/lib/component/2d/IndirectAxis2D.d.ts.map +1 -1
  53. package/lib/component/2d/IndirectAxis2D.js +5 -2
  54. package/lib/component/2d/IndirectAxis2D.js.map +1 -1
  55. package/lib/component/2d/Viewer2D.d.ts.map +1 -1
  56. package/lib/component/2d/Viewer2D.js +2 -1
  57. package/lib/component/2d/Viewer2D.js.map +1 -1
  58. package/lib/component/2d/ft/FTContainer.d.ts.map +1 -1
  59. package/lib/component/2d/ft/FTContainer.js.map +1 -1
  60. package/lib/component/AnchorSVG.d.ts +36 -0
  61. package/lib/component/AnchorSVG.d.ts.map +1 -0
  62. package/lib/component/AnchorSVG.js +140 -0
  63. package/lib/component/AnchorSVG.js.map +1 -0
  64. package/lib/component/EventsTrackers/BrushTracker.d.ts.map +1 -1
  65. package/lib/component/EventsTrackers/BrushTracker.js +16 -2
  66. package/lib/component/EventsTrackers/BrushTracker.js.map +1 -1
  67. package/lib/component/EventsTrackers/MouseTracker.d.ts +3 -0
  68. package/lib/component/EventsTrackers/MouseTracker.d.ts.map +1 -1
  69. package/lib/component/EventsTrackers/MouseTracker.js +15 -0
  70. package/lib/component/EventsTrackers/MouseTracker.js.map +1 -1
  71. package/lib/component/context/KeyModifierContext.d.ts +2 -0
  72. package/lib/component/context/KeyModifierContext.d.ts.map +1 -1
  73. package/lib/component/context/KeyModifierContext.js +26 -6
  74. package/lib/component/context/KeyModifierContext.js.map +1 -1
  75. package/lib/component/elements/D3Axis.d.ts.map +1 -1
  76. package/lib/component/elements/D3Axis.js +4 -3
  77. package/lib/component/elements/D3Axis.js.map +1 -1
  78. package/lib/component/elements/DraggableDialog.d.ts.map +1 -1
  79. package/lib/component/elements/DraggableDialog.js +1 -2
  80. package/lib/component/elements/DraggableDialog.js.map +1 -1
  81. package/lib/component/elements/Sections.d.ts +3 -3
  82. package/lib/component/elements/Sections.d.ts.map +1 -1
  83. package/lib/component/elements/Sections.js +1 -1
  84. package/lib/component/elements/Sections.js.map +1 -1
  85. package/lib/component/elements/export/ExportOptionsModal.js +2 -5
  86. package/lib/component/elements/export/ExportOptionsModal.js.map +1 -1
  87. package/lib/component/header/AutoPeakPickingOptionPanel.d.ts.map +1 -1
  88. package/lib/component/header/AutoPeakPickingOptionPanel.js +59 -31
  89. package/lib/component/header/AutoPeakPickingOptionPanel.js.map +1 -1
  90. package/lib/component/header/Header.d.ts.map +1 -1
  91. package/lib/component/header/Header.js +2 -4
  92. package/lib/component/header/Header.js.map +1 -1
  93. package/lib/component/header/RangesPickingOptionPanel.d.ts.map +1 -1
  94. package/lib/component/header/RangesPickingOptionPanel.js +34 -19
  95. package/lib/component/header/RangesPickingOptionPanel.js.map +1 -1
  96. package/lib/component/hooks/useAddMultipletSignal.d.ts +7 -0
  97. package/lib/component/hooks/useAddMultipletSignal.d.ts.map +1 -0
  98. package/lib/component/hooks/useAddMultipletSignal.js +28 -0
  99. package/lib/component/hooks/useAddMultipletSignal.js.map +1 -0
  100. package/lib/component/hooks/useFilter.d.ts.map +1 -1
  101. package/lib/component/hooks/useFilter.js.map +1 -1
  102. package/lib/component/hooks/useSaveSettings.d.ts.map +1 -1
  103. package/lib/component/hooks/useSaveSettings.js +3 -6
  104. package/lib/component/hooks/useSaveSettings.js.map +1 -1
  105. package/lib/component/hooks/useSpectrum.d.ts +3 -1
  106. package/lib/component/hooks/useSpectrum.d.ts.map +1 -1
  107. package/lib/component/hooks/useSpectrum.js +1 -1
  108. package/lib/component/hooks/useSpectrum.js.map +1 -1
  109. package/lib/component/hooks/useSpectrumWithDataSource.d.ts +1 -1
  110. package/lib/component/hooks/useSpectrumWithDataSource.d.ts.map +1 -1
  111. package/lib/component/hooks/useSpectrumWithDataSource.js.map +1 -1
  112. package/lib/component/hooks/useTempSpectrum.d.ts +1 -1
  113. package/lib/component/hooks/useTempSpectrum.d.ts.map +1 -1
  114. package/lib/component/hooks/use_ticks_config.d.ts +1 -4
  115. package/lib/component/hooks/use_ticks_config.d.ts.map +1 -1
  116. package/lib/component/hooks/use_ticks_config.js +1 -6
  117. package/lib/component/hooks/use_ticks_config.js.map +1 -1
  118. package/lib/component/modal/PublicationStringModal.d.ts +1 -1
  119. package/lib/component/modal/PublicationStringModal.d.ts.map +1 -1
  120. package/lib/component/modal/PublicationStringModal.js +4 -8
  121. package/lib/component/modal/PublicationStringModal.js.map +1 -1
  122. package/lib/component/modal/SaveAsModal.js +3 -6
  123. package/lib/component/modal/SaveAsModal.js.map +1 -1
  124. package/lib/component/modal/aboutUs/AboutUsModal.d.ts.map +1 -1
  125. package/lib/component/modal/aboutUs/AboutUsModal.js +2 -4
  126. package/lib/component/modal/aboutUs/AboutUsModal.js.map +1 -1
  127. package/lib/component/modal/editRange/forms/components/NewSignalTab.d.ts.map +1 -1
  128. package/lib/component/modal/editRange/forms/components/NewSignalTab.js +38 -36
  129. package/lib/component/modal/editRange/forms/components/NewSignalTab.js.map +1 -1
  130. package/lib/component/modal/setting/tanstack_general_settings/errors/context.d.ts +142 -24
  131. package/lib/component/modal/setting/tanstack_general_settings/errors/context.d.ts.map +1 -1
  132. package/lib/component/modal/setting/tanstack_general_settings/errors/renderer.d.ts +142 -24
  133. package/lib/component/modal/setting/tanstack_general_settings/errors/renderer.d.ts.map +1 -1
  134. package/lib/component/modal/setting/tanstack_general_settings/general_settings.d.ts.map +1 -1
  135. package/lib/component/modal/setting/tanstack_general_settings/general_settings.js +9 -12
  136. package/lib/component/modal/setting/tanstack_general_settings/general_settings.js.map +1 -1
  137. package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_body.d.ts +142 -24
  138. package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_body.d.ts.map +1 -1
  139. package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_footer.d.ts +120 -24
  140. package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_footer.d.ts.map +1 -1
  141. package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_header.d.ts +120 -24
  142. package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_header.d.ts.map +1 -1
  143. package/lib/component/modal/setting/tanstack_general_settings/hooks/use_safe_workspace.d.ts +20 -4
  144. package/lib/component/modal/setting/tanstack_general_settings/hooks/use_safe_workspace.d.ts.map +1 -1
  145. package/lib/component/modal/setting/tanstack_general_settings/tabs/auto_processing_tab.d.ts +120 -24
  146. package/lib/component/modal/setting/tanstack_general_settings/tabs/auto_processing_tab.d.ts.map +1 -1
  147. package/lib/component/modal/setting/tanstack_general_settings/tabs/axis_tab.d.ts +120 -24
  148. package/lib/component/modal/setting/tanstack_general_settings/tabs/axis_tab.d.ts.map +1 -1
  149. package/lib/component/modal/setting/tanstack_general_settings/tabs/axis_tab.js +12 -1
  150. package/lib/component/modal/setting/tanstack_general_settings/tabs/axis_tab.js.map +1 -1
  151. package/lib/component/modal/setting/tanstack_general_settings/tabs/database_tab.d.ts +120 -24
  152. package/lib/component/modal/setting/tanstack_general_settings/tabs/database_tab.d.ts.map +1 -1
  153. package/lib/component/modal/setting/tanstack_general_settings/tabs/export_tab.d.ts +120 -24
  154. package/lib/component/modal/setting/tanstack_general_settings/tabs/export_tab.d.ts.map +1 -1
  155. package/lib/component/modal/setting/tanstack_general_settings/tabs/external_api_tab.d.ts +120 -24
  156. package/lib/component/modal/setting/tanstack_general_settings/tabs/external_api_tab.d.ts.map +1 -1
  157. package/lib/component/modal/setting/tanstack_general_settings/tabs/general_tab.d.ts +120 -24
  158. package/lib/component/modal/setting/tanstack_general_settings/tabs/general_tab.d.ts.map +1 -1
  159. package/lib/component/modal/setting/tanstack_general_settings/tabs/import_filters_tab.d.ts +120 -24
  160. package/lib/component/modal/setting/tanstack_general_settings/tabs/import_filters_tab.d.ts.map +1 -1
  161. package/lib/component/modal/setting/tanstack_general_settings/tabs/nuclei_tab.d.ts +120 -24
  162. package/lib/component/modal/setting/tanstack_general_settings/tabs/nuclei_tab.d.ts.map +1 -1
  163. package/lib/component/modal/setting/tanstack_general_settings/tabs/panels_tab.d.ts +120 -24
  164. package/lib/component/modal/setting/tanstack_general_settings/tabs/panels_tab.d.ts.map +1 -1
  165. package/lib/component/modal/setting/tanstack_general_settings/tabs/spectra_colors_tab.d.ts +120 -24
  166. package/lib/component/modal/setting/tanstack_general_settings/tabs/spectra_colors_tab.d.ts.map +1 -1
  167. package/lib/component/modal/setting/tanstack_general_settings/tabs/spectra_label_tab.d.ts +120 -24
  168. package/lib/component/modal/setting/tanstack_general_settings/tabs/spectra_label_tab.d.ts.map +1 -1
  169. package/lib/component/modal/setting/tanstack_general_settings/tabs/title_block_tab.d.ts +120 -24
  170. package/lib/component/modal/setting/tanstack_general_settings/tabs/title_block_tab.d.ts.map +1 -1
  171. package/lib/component/modal/setting/tanstack_general_settings/tabs/tools_tab.d.ts +120 -24
  172. package/lib/component/modal/setting/tanstack_general_settings/tabs/tools_tab.d.ts.map +1 -1
  173. package/lib/component/modal/setting/tanstack_general_settings/validation/axis_tab_validation.d.ts +22 -0
  174. package/lib/component/modal/setting/tanstack_general_settings/validation/axis_tab_validation.d.ts.map +1 -1
  175. package/lib/component/modal/setting/tanstack_general_settings/validation/axis_tab_validation.js +15 -2
  176. package/lib/component/modal/setting/tanstack_general_settings/validation/axis_tab_validation.js.map +1 -1
  177. package/lib/component/modal/setting/tanstack_general_settings/validation.d.ts +22 -0
  178. package/lib/component/modal/setting/tanstack_general_settings/validation.d.ts.map +1 -1
  179. package/lib/component/panels/MoleculesPanel/hooks/useAtomAssignment.js +1 -1
  180. package/lib/component/panels/MoleculesPanel/hooks/useAtomAssignment.js.map +1 -1
  181. package/lib/component/panels/PeaksPanel/PeaksPanel.d.ts.map +1 -1
  182. package/lib/component/panels/PeaksPanel/PeaksPanel.js +1 -9
  183. package/lib/component/panels/PeaksPanel/PeaksPanel.js.map +1 -1
  184. package/lib/component/panels/PeaksPanel/PeaksPreferences.js +1 -1
  185. package/lib/component/panels/PeaksPanel/PeaksPreferences.js.map +1 -1
  186. package/lib/component/panels/PeaksPanel/PeaksTable.d.ts.map +1 -1
  187. package/lib/component/panels/PeaksPanel/PeaksTable.js +9 -9
  188. package/lib/component/panels/PeaksPanel/PeaksTable.js.map +1 -1
  189. package/lib/component/panels/RangesPanel/RangesPanel.d.ts.map +1 -1
  190. package/lib/component/panels/RangesPanel/RangesPanel.js +1 -3
  191. package/lib/component/panels/RangesPanel/RangesPanel.js.map +1 -1
  192. package/lib/component/panels/RangesPanel/RangesTableRow.d.ts.map +1 -1
  193. package/lib/component/panels/RangesPanel/RangesTableRow.js +10 -12
  194. package/lib/component/panels/RangesPanel/RangesTableRow.js.map +1 -1
  195. package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.d.ts +1 -1
  196. package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.d.ts.map +1 -1
  197. package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.js +1 -1
  198. package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.js.map +1 -1
  199. package/lib/component/panels/SummaryPanel/SummaryPanel.d.ts.map +1 -1
  200. package/lib/component/panels/SummaryPanel/SummaryPanel.js +7 -0
  201. package/lib/component/panels/SummaryPanel/SummaryPanel.js.map +1 -1
  202. package/lib/component/panels/filtersPanel/FilterPanel.d.ts.map +1 -1
  203. package/lib/component/panels/filtersPanel/FilterPanel.js +5 -2
  204. package/lib/component/panels/filtersPanel/FilterPanel.js.map +1 -1
  205. package/lib/component/panels/filtersPanel/Filters/base/BaseApodizationOptions.js +1 -1
  206. package/lib/component/panels/filtersPanel/Filters/base/BaseApodizationOptions.js.map +1 -1
  207. package/lib/component/panels/filtersPanel/processings_sections_panel.d.ts +2 -0
  208. package/lib/component/panels/filtersPanel/processings_sections_panel.d.ts.map +1 -0
  209. package/lib/component/panels/filtersPanel/processings_sections_panel.js +134 -0
  210. package/lib/component/panels/filtersPanel/processings_sections_panel.js.map +1 -0
  211. package/lib/component/panels/hooks/use_processings_mutation.d.ts +10 -0
  212. package/lib/component/panels/hooks/use_processings_mutation.d.ts.map +1 -0
  213. package/lib/component/panels/hooks/use_processings_mutation.js +130 -0
  214. package/lib/component/panels/hooks/use_processings_mutation.js.map +1 -0
  215. package/lib/component/panels/informationPanel/InformationPanel.js +1 -1
  216. package/lib/component/panels/informationPanel/InformationPanel.js.map +1 -1
  217. package/lib/component/reducer/Reducer.d.ts.map +1 -1
  218. package/lib/component/reducer/Reducer.js +4 -0
  219. package/lib/component/reducer/Reducer.js.map +1 -1
  220. package/lib/component/reducer/actions/CorrelationsActions.js +2 -2
  221. package/lib/component/reducer/actions/CorrelationsActions.js.map +1 -1
  222. package/lib/component/reducer/actions/FiltersActions.d.ts +2 -0
  223. package/lib/component/reducer/actions/FiltersActions.d.ts.map +1 -1
  224. package/lib/component/reducer/actions/FiltersActions.js +1 -1
  225. package/lib/component/reducer/actions/FiltersActions.js.map +1 -1
  226. package/lib/component/reducer/actions/MoleculeActions.d.ts +9 -0
  227. package/lib/component/reducer/actions/MoleculeActions.d.ts.map +1 -1
  228. package/lib/component/reducer/actions/RangesActions.d.ts +11 -2
  229. package/lib/component/reducer/actions/RangesActions.d.ts.map +1 -1
  230. package/lib/component/reducer/actions/RangesActions.js +36 -29
  231. package/lib/component/reducer/actions/RangesActions.js.map +1 -1
  232. package/lib/component/reducer/actions/SpectraActions.d.ts +8 -2
  233. package/lib/component/reducer/actions/SpectraActions.d.ts.map +1 -1
  234. package/lib/component/reducer/actions/SpectraActions.js +6 -1
  235. package/lib/component/reducer/actions/SpectraActions.js.map +1 -1
  236. package/lib/component/reducer/actions/ToolsActions.d.ts.map +1 -1
  237. package/lib/component/reducer/actions/ToolsActions.js +5 -17
  238. package/lib/component/reducer/actions/ToolsActions.js.map +1 -1
  239. package/lib/component/reducer/helper/getTraceSpectrumID.d.ts +5 -0
  240. package/lib/component/reducer/helper/getTraceSpectrumID.d.ts.map +1 -0
  241. package/lib/component/reducer/helper/getTraceSpectrumID.js +14 -0
  242. package/lib/component/reducer/helper/getTraceSpectrumID.js.map +1 -0
  243. package/lib/component/reducer/preferences/actions/setPreferences.d.ts +2 -2
  244. package/lib/component/reducer/preferences/actions/setPreferences.d.ts.map +1 -1
  245. package/lib/component/reducer/preferences/actions/setPreferences.js +8 -5
  246. package/lib/component/reducer/preferences/actions/setPreferences.js.map +1 -1
  247. package/lib/component/reducer/preferences/preferencesReducer.d.ts +1 -1
  248. package/lib/component/reducer/preferences/preferencesReducer.d.ts.map +1 -1
  249. package/lib/component/toolbar/ToolTypes.d.ts +21 -1
  250. package/lib/component/toolbar/ToolTypes.d.ts.map +1 -1
  251. package/lib/component/toolbar/ToolTypes.js +40 -0
  252. package/lib/component/toolbar/ToolTypes.js.map +1 -1
  253. package/lib/component/toolbar/nmr_toolbar.d.ts.map +1 -1
  254. package/lib/component/toolbar/nmr_toolbar.js +12 -36
  255. package/lib/component/toolbar/nmr_toolbar.js.map +1 -1
  256. package/lib/component/utility/CoreSlot.d.ts +27 -0
  257. package/lib/component/utility/CoreSlot.d.ts.map +1 -0
  258. package/lib/component/utility/CoreSlot.js +56 -0
  259. package/lib/component/utility/CoreSlot.js.map +1 -0
  260. package/lib/component/workspaces/workspaceDefaultProperties.d.ts.map +1 -1
  261. package/lib/component/workspaces/workspaceDefaultProperties.js +19 -2
  262. package/lib/component/workspaces/workspaceDefaultProperties.js.map +1 -1
  263. package/lib/data/data1d/Spectrum1D/initiateDatum1D.d.ts.map +1 -1
  264. package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +13 -5
  265. package/lib/data/data1d/Spectrum1D/initiateDatum1D.js.map +1 -1
  266. package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.d.ts.map +1 -1
  267. package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +1 -0
  268. package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.js.map +1 -1
  269. package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.d.ts.map +1 -1
  270. package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.js +35 -30
  271. package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.js.map +1 -1
  272. package/lib/data/data1d/Spectrum1D/ranges/detectSignalsByMultipletAnalysis.d.ts.map +1 -1
  273. package/lib/data/data1d/Spectrum1D/ranges/detectSignalsByMultipletAnalysis.js +1 -0
  274. package/lib/data/data1d/Spectrum1D/ranges/detectSignalsByMultipletAnalysis.js.map +1 -1
  275. package/lib/data/data2d/Spectrum2D/initiateDatum2D.d.ts.map +1 -1
  276. package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +12 -4
  277. package/lib/data/data2d/Spectrum2D/initiateDatum2D.js.map +1 -1
  278. package/lib/data/data2d/Spectrum2D/isSpectrum2D.d.ts +1 -1
  279. package/lib/data/data2d/Spectrum2D/isSpectrum2D.d.ts.map +1 -1
  280. package/lib/data/data2d/Spectrum2D/isSpectrum2D.js.map +1 -1
  281. package/lib/data/utilities/RangeUtilities.d.ts +1 -6
  282. package/lib/data/utilities/RangeUtilities.d.ts.map +1 -1
  283. package/lib/data/utilities/RangeUtilities.js +10 -27
  284. package/lib/data/utilities/RangeUtilities.js.map +1 -1
  285. package/lib/versionInfo.js +1 -1
  286. package/package.json +29 -27
  287. package/src/component/1d/HorizontalAxis1D.tsx +12 -2
  288. package/src/component/1d/SVGContent1D.tsx +2 -0
  289. package/src/component/1d/Viewer1D.tsx +2 -0
  290. package/src/component/1d/integral/IntegralResizable.tsx +6 -6
  291. package/src/component/1d/ranges/Range.tsx +6 -6
  292. package/src/component/1d/ranges/Signals.tsx +28 -0
  293. package/src/component/1d-2d/components/RangeIndicator.tsx +106 -0
  294. package/src/component/1d-2d/components/Signals1D.tsx +306 -0
  295. package/src/component/1d-2d/tools/BrushXY.tsx +8 -8
  296. package/src/component/1d-2d/tools/CrossLinePointer.tsx +75 -32
  297. package/src/component/1d-2d/tools/CursorToolIcon.tsx +110 -0
  298. package/src/component/2d/1d-tracer/Left1DChart.tsx +26 -1
  299. package/src/component/2d/1d-tracer/Ranges1D.tsx +38 -0
  300. package/src/component/2d/1d-tracer/Top1DChart.tsx +31 -2
  301. package/src/component/2d/DirectAxis2D.tsx +12 -3
  302. package/src/component/2d/IndirectAxis2D.tsx +9 -5
  303. package/src/component/2d/Viewer2D.tsx +5 -2
  304. package/src/component/2d/ft/FTContainer.tsx +1 -0
  305. package/src/component/AnchorSVG.tsx +369 -0
  306. package/src/component/EventsTrackers/BrushTracker.tsx +25 -5
  307. package/src/component/EventsTrackers/MouseTracker.tsx +21 -0
  308. package/src/component/context/KeyModifierContext.tsx +32 -8
  309. package/src/component/elements/D3Axis.tsx +31 -9
  310. package/src/component/elements/DraggableDialog.tsx +1 -2
  311. package/src/component/elements/Sections.tsx +4 -4
  312. package/src/component/elements/export/ExportOptionsModal.tsx +22 -31
  313. package/src/component/header/AutoPeakPickingOptionPanel.tsx +173 -102
  314. package/src/component/header/Header.tsx +2 -4
  315. package/src/component/header/RangesPickingOptionPanel.tsx +72 -59
  316. package/src/component/hooks/useAddMultipletSignal.tsx +32 -0
  317. package/src/component/hooks/useFilter.ts +2 -1
  318. package/src/component/hooks/useSaveSettings.tsx +4 -15
  319. package/src/component/hooks/useSpectrum.ts +7 -1
  320. package/src/component/hooks/useSpectrumWithDataSource.ts +16 -8
  321. package/src/component/hooks/use_ticks_config.ts +1 -7
  322. package/src/component/modal/PublicationStringModal.tsx +8 -14
  323. package/src/component/modal/SaveAsModal.tsx +41 -50
  324. package/src/component/modal/aboutUs/AboutUsModal.tsx +5 -4
  325. package/src/component/modal/editRange/forms/components/NewSignalTab.tsx +57 -57
  326. package/src/component/modal/setting/tanstack_general_settings/general_settings.tsx +23 -29
  327. package/src/component/modal/setting/tanstack_general_settings/tabs/axis_tab.tsx +76 -12
  328. package/src/component/modal/setting/tanstack_general_settings/validation/axis_tab_validation.ts +16 -2
  329. package/src/component/panels/MoleculesPanel/hooks/useAtomAssignment.tsx +1 -1
  330. package/src/component/panels/PeaksPanel/PeaksPanel.tsx +1 -8
  331. package/src/component/panels/PeaksPanel/PeaksPreferences.tsx +1 -1
  332. package/src/component/panels/PeaksPanel/PeaksTable.tsx +11 -9
  333. package/src/component/panels/RangesPanel/RangesPanel.tsx +1 -3
  334. package/src/component/panels/RangesPanel/RangesTableRow.tsx +10 -12
  335. package/src/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.tsx +2 -2
  336. package/src/component/panels/SummaryPanel/SummaryPanel.tsx +13 -11
  337. package/src/component/panels/filtersPanel/FilterPanel.tsx +10 -0
  338. package/src/component/panels/filtersPanel/Filters/base/BaseApodizationOptions.tsx +1 -0
  339. package/src/component/panels/filtersPanel/processings_sections_panel.tsx +307 -0
  340. package/src/component/panels/hooks/use_processings_mutation.ts +171 -0
  341. package/src/component/panels/informationPanel/InformationPanel.tsx +1 -1
  342. package/src/component/reducer/Reducer.ts +4 -0
  343. package/src/component/reducer/actions/CorrelationsActions.ts +2 -2
  344. package/src/component/reducer/actions/FiltersActions.ts +1 -1
  345. package/src/component/reducer/actions/RangesActions.ts +53 -30
  346. package/src/component/reducer/actions/SpectraActions.ts +20 -1
  347. package/src/component/reducer/actions/ToolsActions.ts +5 -21
  348. package/src/component/reducer/helper/getTraceSpectrumID.tsx +25 -0
  349. package/src/component/reducer/preferences/actions/setPreferences.ts +18 -10
  350. package/src/component/reducer/preferences/preferencesReducer.ts +1 -1
  351. package/src/component/toolbar/ToolTypes.ts +92 -1
  352. package/src/component/toolbar/nmr_toolbar.tsx +15 -71
  353. package/src/component/utility/CoreSlot.tsx +126 -0
  354. package/src/component/workspaces/workspaceDefaultProperties.ts +19 -2
  355. package/src/data/data1d/Spectrum1D/initiateDatum1D.ts +14 -8
  356. package/src/data/data1d/Spectrum1D/peaks/autoPeakPicking.ts +1 -0
  357. package/src/data/data1d/Spectrum1D/peaks/optimizePeaks.ts +35 -30
  358. package/src/data/data1d/Spectrum1D/ranges/detectSignalsByMultipletAnalysis.ts +1 -0
  359. package/src/data/data2d/Spectrum2D/initiateDatum2D.ts +12 -4
  360. package/src/data/data2d/Spectrum2D/isSpectrum2D.ts +1 -1
  361. package/src/data/utilities/RangeUtilities.ts +12 -36
  362. package/src/versionInfo.ts +1 -1
  363. package/lib/component/1d/integral/IntegralIndicator.d.ts +0 -9
  364. package/lib/component/1d/integral/IntegralIndicator.d.ts.map +0 -1
  365. package/lib/component/1d/integral/IntegralIndicator.js +0 -22
  366. package/lib/component/1d/integral/IntegralIndicator.js.map +0 -1
  367. package/lib/component/utility/renderCoreSlot.d.ts +0 -11
  368. package/lib/component/utility/renderCoreSlot.d.ts.map +0 -1
  369. package/lib/component/utility/renderCoreSlot.js +0 -13
  370. package/lib/component/utility/renderCoreSlot.js.map +0 -1
  371. package/src/component/1d/integral/IntegralIndicator.tsx +0 -43
  372. package/src/component/utility/renderCoreSlot.tsx +0 -21
@@ -1,35 +1,12 @@
1
- import {
2
- SvgNmrAlignBottom,
3
- SvgNmrAlignCenter,
4
- SvgNmrApodization,
5
- SvgNmrBaselineCorrection,
6
- SvgNmrFourierTransform,
7
- SvgNmrIntegrate,
8
- SvgNmrMultipleAnalysis,
9
- SvgNmrOverlay3,
10
- SvgNmrOverlay3Aligned,
11
- SvgNmrPeakPicking,
12
- SvgNmrPhaseCorrection,
13
- SvgNmrRangePicking,
14
- SvgNmrRealImag,
15
- SvgNmrZeroFilling,
16
- } from 'cheminfo-font';
17
1
  import { useCallback } from 'react';
18
- import {
19
- FaDiceFour,
20
- FaDownload,
21
- FaExpand,
22
- FaFileExport,
23
- FaFileImport,
24
- } from 'react-icons/fa';
25
- import { PiKnifeBold, PiSelectionPlusDuotone } from 'react-icons/pi';
26
- import { TbZoom } from 'react-icons/tb';
2
+ import { FaDownload } from 'react-icons/fa';
27
3
  import type { ToolbarItemProps, TooltipItem } from 'react-science/ui';
28
4
  import { Toolbar, TooltipHelpContent } from 'react-science/ui';
29
5
 
30
6
  import { isQuadrants2DSpectrum } from '../../data/data2d/Spectrum2D/isSpectrum2D.js';
31
7
  import { useChartData } from '../context/ChartContext.js';
32
8
  import { useDispatch } from '../context/DispatchContext.js';
9
+ import { useIsPrimaryKeyActivated } from '../context/KeyModifierContext.tsx';
33
10
  import { useLoader } from '../context/LoaderContext.js';
34
11
  import { usePreferences } from '../context/PreferencesContext.js';
35
12
  import type { ToolbarPopoverMenuItem } from '../elements/ToolbarPopoverItem.js';
@@ -50,14 +27,15 @@ import { LoadJCAMPModal } from '../modal/LoadJCAMPModal.js';
50
27
  import SaveAsModal from '../modal/SaveAsModal.js';
51
28
  import { MetaImportationModal } from '../modal/metaImportation/MetaImportationModal.js';
52
29
 
53
- import type { MainTool } from './ToolTypes.js';
54
- import { options } from './ToolTypes.js';
30
+ import type { IconOptions, MainTool } from './ToolTypes.js';
31
+ import { getToolIcon, options } from './ToolTypes.js';
55
32
  import type { ExportMenuItems } from './toolbarMenu.js';
56
33
  import { EXPORT_MENU, IMPORT_MENU } from './toolbarMenu.js';
57
34
 
58
- interface BaseToolItem extends Pick<ToolbarItemProps, 'icon' | 'disabled'> {
35
+ interface BaseToolItem extends Pick<ToolbarItemProps, 'disabled'> {
59
36
  id: MainTool;
60
37
  isVisible?: boolean;
38
+ iconProps?: IconOptions;
61
39
  }
62
40
  interface ToolItem extends BaseToolItem {
63
41
  onClick?: () => void;
@@ -99,6 +77,7 @@ export default function NMRToolbar() {
99
77
  const isButtonVisible = useCheckToolsVisibility();
100
78
  const dispatch = useDispatch();
101
79
  const spectrum = useSpectrum();
80
+ const isPrimaryKeyActivated = useIsPrimaryKeyActivated();
102
81
 
103
82
  const {
104
83
  isRealSpectrumShown,
@@ -224,7 +203,9 @@ export default function NMRToolbar() {
224
203
  ],
225
204
  style: { minWidth: '300px' },
226
205
  },
227
- icon: <TbZoom strokeWidth={3} />,
206
+ iconProps: {
207
+ strokeWidth: 3,
208
+ },
228
209
  },
229
210
  {
230
211
  id: 'zoomOut',
@@ -234,12 +215,10 @@ export default function NMRToolbar() {
234
215
  { title: 'Horizontal', shortcuts: ['f'] },
235
216
  { title: 'Horizontal and Vertical', shortcuts: ['f', 'f'] },
236
217
  ],
237
- description:
238
- 'Zoom out by double-clicking the left mouse button, and fully zoom out horizontally by pressing the key "f". Alternatively, press the key "ff" to fit the spectra horizontally and vertically.',
218
+ description: `Zoom out by ${isPrimaryKeyActivated ? 'Shift + ' : ''}double-clicking the left mouse button, and fully zoom out horizontally by pressing the key "f". Alternatively, press the key "ff" to fit the spectra horizontally and vertically.`,
239
219
  link: 'https://docs.nmrium.org/help/zoom-and-scale',
240
220
  },
241
221
  onClick: handleFullZoomOut,
242
- icon: <FaExpand />,
243
222
  },
244
223
  {
245
224
  id: 'peakPicking',
@@ -249,8 +228,6 @@ export default function NMRToolbar() {
249
228
  description: 'Detect peaks manually or automatically in the spectrum.',
250
229
  link: 'https://docs.nmrium.org/help/peaks',
251
230
  },
252
-
253
- icon: <SvgNmrPeakPicking />,
254
231
  },
255
232
  {
256
233
  id: 'integral',
@@ -260,7 +237,6 @@ export default function NMRToolbar() {
260
237
  description: `Manually integrate the spectrum. Click, drag, and release ${!invert ? 'while holding SHIFT' : ''} to draw the integral. Resize the integrals by moving the edges. Cut an integral with ${!invert ? 'SHIFT +' : ''} click.`,
261
238
  link: 'https://docs.nmrium.org/help/integrations',
262
239
  },
263
- icon: <SvgNmrIntegrate />,
264
240
  },
265
241
  {
266
242
  id: 'zonePicking',
@@ -270,7 +246,6 @@ export default function NMRToolbar() {
270
246
  description: `Draw 2D zones by clicking, dragging, and releasing${!invert ? 'while holding SHIFT' : ''}. Alternatively, detect zones automatically.`,
271
247
  link: 'https://docs.nmrium.org/30_2d-spectra/zones',
272
248
  },
273
- icon: <FaDiceFour />,
274
249
  },
275
250
  {
276
251
  id: 'slicing',
@@ -280,7 +255,6 @@ export default function NMRToolbar() {
280
255
  'Display the horizontal and vertical slices of the selected 2D spectrum at the level of the pointer.',
281
256
  link: 'https://docs.nmrium.org/30_2d-spectra/slicing',
282
257
  },
283
- icon: <PiKnifeBold />,
284
258
  },
285
259
  {
286
260
  id: 'rangePicking',
@@ -290,7 +264,6 @@ export default function NMRToolbar() {
290
264
  description: `Define ranges and analyse multiplet automatically or manually. Click, drag, and release ${!invert ? 'while holding SHIFT' : ''} to draw the range. Ranges can be resized by moving the edges.`,
291
265
  link: 'https://docs.nmrium.org/help/ranges',
292
266
  },
293
- icon: <SvgNmrRangePicking />,
294
267
  },
295
268
  {
296
269
  id: 'multipleSpectraAnalysis',
@@ -300,7 +273,6 @@ export default function NMRToolbar() {
300
273
  description:
301
274
  'Integrate multiple spectra at once and adjust integration zones by dragging their edges.',
302
275
  },
303
- icon: <SvgNmrMultipleAnalysis />,
304
276
  isVisible: ftCounter > 0,
305
277
  },
306
278
  {
@@ -312,21 +284,18 @@ export default function NMRToolbar() {
312
284
  'Apply mathematical function that the FID is multiplied by before Fourier Transform.',
313
285
  link: 'https://docs.nmrium.org/help/apodization',
314
286
  },
315
- icon: <SvgNmrApodization />,
316
287
  },
317
288
  {
318
289
  id: 'apodizationDimension1',
319
290
  tooltip: {
320
291
  title: options.apodizationDimension1.label,
321
292
  },
322
- icon: <SvgNmrApodization />,
323
293
  },
324
294
  {
325
295
  id: 'apodizationDimension2',
326
296
  tooltip: {
327
297
  title: options.apodizationDimension2.label,
328
298
  },
329
- icon: <SvgNmrApodization />,
330
299
  },
331
300
  {
332
301
  id: 'zeroFilling',
@@ -337,7 +306,6 @@ export default function NMRToolbar() {
337
306
  'Improve spectrum quality by increasing the number of points. By default, the number of points is twice as many as in the original FID.',
338
307
  link: 'https://docs.nmrium.org/help/zero-filling',
339
308
  },
340
- icon: <SvgNmrZeroFilling />,
341
309
  },
342
310
  {
343
311
  id: 'zeroFillingDimension1',
@@ -346,7 +314,6 @@ export default function NMRToolbar() {
346
314
  description:
347
315
  'Improve spectrum quality by increasing the number of points',
348
316
  },
349
- icon: <SvgNmrZeroFilling />,
350
317
  },
351
318
  {
352
319
  id: 'zeroFillingDimension2',
@@ -355,7 +322,6 @@ export default function NMRToolbar() {
355
322
  description:
356
323
  'Improve spectrum quality by increasing the number of points.',
357
324
  },
358
- icon: <SvgNmrZeroFilling />,
359
325
  },
360
326
  {
361
327
  id: 'phaseCorrection',
@@ -365,7 +331,6 @@ export default function NMRToolbar() {
365
331
  description: `Correct the spectrum phase manually or automatically. For manual phase correction, define the pivot${!invert ? ' using SHIFT +' : ''} click, then press the PH0 and PH1 button, and move the mouse horizontally.`,
366
332
  link: 'https://docs.nmrium.org/help/phase',
367
333
  },
368
- icon: <SvgNmrPhaseCorrection />,
369
334
  },
370
335
  {
371
336
  id: 'phaseCorrectionTwoDimensions',
@@ -374,7 +339,6 @@ export default function NMRToolbar() {
374
339
  shortcuts: ['a'],
375
340
  description: 'To phase the spectrum after the FFT.',
376
341
  },
377
- icon: <SvgNmrPhaseCorrection />,
378
342
  isVisible: isQuadrants2DSpectrum(spectrum),
379
343
  },
380
344
  {
@@ -385,7 +349,6 @@ export default function NMRToolbar() {
385
349
  description: `Correct the baseline of the spectrum. You should draw zones corresponding to the noise using click, drag, release${!invert ? 'while holding SHIFT' : ''}.`,
386
350
  link: 'https://docs.nmrium.org/help/baseline',
387
351
  },
388
- icon: <SvgNmrBaselineCorrection />,
389
352
  },
390
353
  {
391
354
  id: 'exclusionZones',
@@ -394,7 +357,6 @@ export default function NMRToolbar() {
394
357
  shortcuts: ['e'],
395
358
  description: `Define exclusion zones by clicking, dragging, releasing${!invert ? ' while holding SHIFT' : ''}. This option is practical for excluding large peaks like solvents.`,
396
359
  },
397
- icon: <SvgNmrMultipleAnalysis />,
398
360
  isVisible: ftCounter > 0,
399
361
  },
400
362
  {
@@ -406,31 +368,26 @@ export default function NMRToolbar() {
406
368
  link: 'https://docs.nmrium.org/help/ft',
407
369
  },
408
370
  onClick: handleOnFFTFilter,
409
- icon: <SvgNmrFourierTransform />,
410
371
  },
411
372
  {
412
373
  id: 'fftDimension1',
413
374
  tooltip: options.fftDimension1.label,
414
375
  onClick: handleFFtDimension1Filter,
415
- icon: <SvgNmrFourierTransform />,
416
376
  },
417
377
  {
418
378
  id: 'fftDimension2',
419
379
  tooltip: options.fftDimension2.label,
420
380
  onClick: handleFFtDimension2Filter,
421
- icon: <SvgNmrFourierTransform />,
422
381
  },
423
382
  {
424
383
  id: 'import',
425
384
  tooltip: options.import.label,
426
- icon: <FaFileImport />,
427
385
  menuItems: importMenu,
428
386
  onClick: importHandler,
429
387
  },
430
388
  {
431
389
  id: 'exportAs',
432
390
  tooltip: options.exportAs.label,
433
- icon: <FaFileExport />,
434
391
  menuItems: exportMenu,
435
392
  onClick: exportHandler,
436
393
  },
@@ -442,12 +399,6 @@ export default function NMRToolbar() {
442
399
  description:
443
400
  'Toggle between stack mode and all the spectra aligned at the bottom.',
444
401
  },
445
- icon:
446
- verticalAlign === 'stack' ? (
447
- <SvgNmrOverlay3Aligned />
448
- ) : (
449
- <SvgNmrOverlay3 />
450
- ),
451
402
  isVisible: ftCounter > 1,
452
403
  onClick: changeDisplayViewModeHandler,
453
404
  },
@@ -458,7 +409,6 @@ export default function NMRToolbar() {
458
409
  description:
459
410
  'Toggle between the imaginary and real parts of the spectrum.',
460
411
  },
461
- icon: <SvgNmrRealImag />,
462
412
  onClick: changeSpectrumViewHandler,
463
413
  },
464
414
  {
@@ -469,12 +419,6 @@ export default function NMRToolbar() {
469
419
  description:
470
420
  'Toggle between alignment of the spectra in the center or at the bottom of the display.',
471
421
  },
472
- icon:
473
- verticalAlign === 'bottom' ? (
474
- <SvgNmrAlignCenter />
475
- ) : (
476
- <SvgNmrAlignBottom />
477
- ),
478
422
  isVisible: ftCounter > 0 || fidCounter > 0,
479
423
  onClick: alignSpectraVerticallyHandler,
480
424
  },
@@ -486,7 +430,6 @@ export default function NMRToolbar() {
486
430
  description:
487
431
  'Drag a rectangle over the spectrum region to create an inset.',
488
432
  },
489
- icon: <PiSelectionPlusDuotone />,
490
433
  },
491
434
  ];
492
435
  return (
@@ -506,7 +449,8 @@ export default function NMRToolbar() {
506
449
  <SaveAsModal isOpen={dialog.saveAs} onCloseDialog={closeDialog} />
507
450
  <Toolbar vertical>
508
451
  {toolItems.map((item) => {
509
- const { id, icon, tooltip, disabled, isVisible } = item;
452
+ const { id, tooltip, disabled, isVisible, iconProps } = item;
453
+ const Icon = getToolIcon(id, { verticalAlign, isRealSpectrumShown });
510
454
  const isToolVisible =
511
455
  isButtonVisible(id) && (isVisible === undefined || isVisible);
512
456
 
@@ -530,7 +474,7 @@ export default function NMRToolbar() {
530
474
  }}
531
475
  id={id}
532
476
  active={selectedTool === id}
533
- icon={icon}
477
+ icon={Icon && <Icon {...iconProps} />}
534
478
  onClick={onClick}
535
479
  disabled={disabled}
536
480
  />
@@ -555,7 +499,7 @@ export default function NMRToolbar() {
555
499
  }}
556
500
  id={id}
557
501
  active={selectedTool === id}
558
- icon={icon}
502
+ icon={Icon && <Icon {...iconProps} />}
559
503
  disabled={disabled}
560
504
  />
561
505
  );
@@ -0,0 +1,126 @@
1
+ import styled from '@emotion/styled';
2
+ import type {
3
+ PluginUIComponentProps,
4
+ ProcessingOperatorId,
5
+ ProcessingOperatorUIExpandedProps,
6
+ SupportedUISlot,
7
+ } from '@zakodium/nmrium-core';
8
+ import { castSlotProps } from '@zakodium/nmrium-core';
9
+ import type { ReactNode } from 'react';
10
+ import type { FallbackProps } from 'react-error-boundary';
11
+ import { ErrorBoundary } from 'react-error-boundary';
12
+
13
+ import { useCore } from '../context/CoreContext.tsx';
14
+
15
+ type SlotProps<Slot extends SupportedUISlot> =
16
+ Omit<Extract<PluginUIComponentProps, { slot: Slot }>, 'slot'> extends Record<
17
+ string,
18
+ never
19
+ >
20
+ ? object
21
+ : Omit<Extract<PluginUIComponentProps, { slot: Slot }>, 'slot'>;
22
+
23
+ interface CoreSlotProps<Slot extends SupportedUISlot> {
24
+ slot: Slot;
25
+ fallback?: ReactNode;
26
+ }
27
+
28
+ /**
29
+ * Render all components registered in the given slot.
30
+ */
31
+ export function CoreSlot<Slot extends SupportedUISlot>(
32
+ props: CoreSlotProps<Slot> & SlotProps<Slot>,
33
+ ) {
34
+ const { slot, fallback, ...slotProps } = props;
35
+ castSlotProps(slotProps, slot);
36
+
37
+ const core = useCore();
38
+
39
+ const jsx = Array.from(core.slot(slot), ([key, Component]) => (
40
+ <Component key={key} {...slotProps} slot={slot} />
41
+ ));
42
+
43
+ return jsx.length > 0 ? jsx : fallback;
44
+ }
45
+
46
+ interface CoreOperatorNameProps<Id extends ProcessingOperatorId> {
47
+ id: Id;
48
+ fallback?: ReactNode;
49
+ }
50
+
51
+ export function CoreOperatorName<Id extends ProcessingOperatorId>(
52
+ props: CoreOperatorNameProps<Id>,
53
+ ) {
54
+ const { id, fallback } = props;
55
+ const core = useCore();
56
+
57
+ const operator = core.slotOperator(id);
58
+ if (!operator) return fallback;
59
+
60
+ return operator.name;
61
+ }
62
+
63
+ interface CoreOperatorExtendedProps<Id extends ProcessingOperatorId> {
64
+ id: Id;
65
+ fallback?: ReactNode;
66
+ }
67
+
68
+ export function CoreOperatorExpanded<Id extends ProcessingOperatorId>(
69
+ props: CoreOperatorExtendedProps<Id> & ProcessingOperatorUIExpandedProps<Id>,
70
+ ) {
71
+ const { id, fallback, ...operatorProps } = props;
72
+ const core = useCore();
73
+
74
+ const operator = core.slotOperator(id);
75
+ const Expanded = operator?.Expanded;
76
+ if (!Expanded) return fallback;
77
+
78
+ return (
79
+ <ErrorBoundary
80
+ fallbackRender={(props) => (
81
+ <>
82
+ <ErrorOverlay {...props} />
83
+ {fallback}
84
+ </>
85
+ )}
86
+ >
87
+ <Expanded {...operatorProps} />
88
+ </ErrorBoundary>
89
+ );
90
+ }
91
+
92
+ function ErrorOverlay(props: FallbackProps) {
93
+ const error = props.error;
94
+ const message =
95
+ error && typeof error === 'object' && 'message' in error
96
+ ? error.message
97
+ : null;
98
+ const stack =
99
+ error && typeof error === 'object' && 'stack' in error ? error.stack : null;
100
+
101
+ return (
102
+ <ErrorOverlayStyled>
103
+ <p>Something went wrong.</p>
104
+ <details>
105
+ <summary>{message as ReactNode}</summary>
106
+ {stack as ReactNode}
107
+ </details>
108
+ </ErrorOverlayStyled>
109
+ );
110
+ }
111
+
112
+ const ErrorOverlayStyled = styled.div`
113
+ background: white;
114
+ padding-block: 10px;
115
+
116
+ > p {
117
+ margin: 0;
118
+ text-align: center;
119
+ font-size: 20px;
120
+ }
121
+
122
+ details {
123
+ color: red;
124
+ white-space: pre-wrap;
125
+ }
126
+ `;
@@ -77,8 +77,25 @@ export const workspaceDefaultProperties: RequiredWorkspacePreferences = {
77
77
  } satisfies Required<WorkspacePreferences['display']>,
78
78
 
79
79
  axis: {
80
- secondaryTicks: { enabled: true },
81
- primaryTicks: { textStyle: { fontSize: 10 } },
80
+ labelStyle: {
81
+ fontSize: 10,
82
+ },
83
+ secondaryTicks: {
84
+ enabled: true,
85
+ tickStyle: {
86
+ strokeWidth: 1,
87
+ strokeOpacity: 1,
88
+ stroke: '#000000',
89
+ },
90
+ },
91
+ primaryTicks: {
92
+ textStyle: { fontSize: 10 },
93
+ tickStyle: {
94
+ strokeWidth: 1,
95
+ strokeOpacity: 1,
96
+ stroke: '#000000',
97
+ },
98
+ },
82
99
  gridlines1D: {
83
100
  primary: {
84
101
  enabled: true,
@@ -2,6 +2,7 @@ import type {
2
2
  Spectrum1D,
3
3
  SpectrumOneDimensionColor,
4
4
  } from '@zakodium/nmrium-core';
5
+ import { sliceData1D } from '@zakodium/nmrium-core';
5
6
  import { Filters1DManager } from 'nmr-processing';
6
7
 
7
8
  import type { UsedColors } from '../../../types/UsedColors.js';
@@ -46,15 +47,18 @@ export function initiateDatum1D(
46
47
  },
47
48
  };
48
49
 
49
- spectrumObj.originalInfo = spectrumObj.info;
50
-
51
- spectrumObj.meta = { ...spectrum.meta };
52
-
53
- spectrumObj.customInfo = { ...spectrum.customInfo };
50
+ // Now, processings can happen before loading in component
51
+ if (!spectrumObj.originalInfo) {
52
+ spectrumObj.originalInfo = structuredClone(spectrumObj.info);
53
+ }
54
54
 
55
55
  spectrumObj.data = convertDataToFloat64Array(spectrum.data);
56
+ if (!spectrumObj.originalData) {
57
+ spectrumObj.originalData = sliceData1D(spectrumObj.data);
58
+ }
56
59
 
57
- spectrumObj.originalData = spectrumObj.data;
60
+ spectrumObj.meta = { ...spectrum.meta };
61
+ spectrumObj.customInfo = { ...spectrum.customInfo };
58
62
 
59
63
  spectrumObj.filters = initiateFilters(spectrum?.filters); //array of object {name: "FilterName", options: FilterOptions = {value | object} }
60
64
 
@@ -81,8 +85,10 @@ export function initiateDatum1D(
81
85
  });
82
86
  spectrumObj.ranges = initiateRanges(spectrum, spectrumObj, rangesOptions);
83
87
 
84
- //reapply filters after load the original data
85
- Filters1DManager.reapplyFilters(spectrumObj);
88
+ if (!spectrumObj.processings) {
89
+ //reapply filters after load the original data
90
+ Filters1DManager.reapplyFilters(spectrumObj);
91
+ }
86
92
 
87
93
  return spectrumObj;
88
94
  }
@@ -48,6 +48,7 @@ export function autoPeakPicking(
48
48
  sensitivity: 100,
49
49
  shape: defaultPeakShape,
50
50
  noiseLevel: noise * noiseFactor,
51
+ maxAbsoluteRatio: minMaxRatio, // Threshold to determine if a given peak should be considered as a noise
51
52
  minMaxRatio, // Threshold to determine if a given peak should be considered as a noise
52
53
  realTopDetection: true,
53
54
  smoothY: false,
@@ -36,6 +36,9 @@ export function optimizePeaks(
36
36
  groupingFactor: 10,
37
37
  stages: [
38
38
  {
39
+ // Stage 1: local stabilization
40
+ factorLimits: 2,
41
+ maxNumberOfPeaks: 40,
39
42
  optimization: {
40
43
  kind: 'lm',
41
44
  options: { maxIterations: 20, errorTolerance: 1e-3 },
@@ -43,98 +46,100 @@ export function optimizePeaks(
43
46
  parameters: {
44
47
  fwhm: {
45
48
  optimize: true,
46
- min: (peak: any) => (peak.shape?.fwhm ?? 0) / 2,
49
+ min: (peak: any) => (peak.shape?.fwhm ?? 0) * 0.5,
47
50
  max: (peak: any) => (peak.shape?.fwhm ?? 0) * 2,
48
51
  },
49
52
  mu: { optimize: false },
50
53
  x: { optimize: false },
51
54
  y: {
52
55
  optimize: true,
53
- init: (peak: any) => peak.y * 0.8,
56
+ init: (peak: any) => peak.y,
54
57
  },
55
58
  },
56
59
  },
57
60
  {
61
+ factorLimits: 2,
62
+ maxNumberOfPeaks: 40,
58
63
  optimization: {
59
64
  kind: 'lm',
60
- options: { maxIterations: 20, errorTolerance: 5e-4 },
65
+ options: { maxIterations: 20, errorTolerance: 1e-3 },
61
66
  },
62
67
  parameters: {
63
68
  fwhm: {
64
69
  optimize: true,
65
- min: (peak: any) => (peak.shape?.fwhm ?? 0) / 2,
70
+ min: (peak: any) => (peak.shape?.fwhm ?? 0) * 0.5,
66
71
  max: (peak: any) => (peak.shape?.fwhm ?? 0) * 2,
67
72
  },
68
73
  mu: { optimize: false },
69
74
  x: { optimize: false },
70
75
  y: {
71
76
  optimize: true,
77
+ init: (peak: any) => peak.y,
72
78
  },
73
79
  },
74
80
  },
75
81
  {
82
+ // Stage 2: regroup into the real overlapping cluster
83
+ factorLimits: 2,
84
+ maxNumberOfPeaks: 40,
76
85
  optimization: {
77
86
  kind: 'lm',
78
- options: { maxIterations: 20, errorTolerance: 1e-5 },
87
+ options: { maxIterations: 25, errorTolerance: 1e-4 },
79
88
  },
80
89
  parameters: {
81
90
  fwhm: {
82
91
  optimize: true,
83
- min: (peak: any) => (peak.shape?.fwhm ?? 0) / 2,
92
+ min: (peak: any) => (peak.shape?.fwhm ?? 0) * 0.5,
84
93
  max: (peak: any) => (peak.shape?.fwhm ?? 0) * 2,
85
94
  },
86
95
  mu: { optimize: true },
87
96
  x: { optimize: false },
88
- y: {
89
- optimize: true,
90
- },
97
+ y: { optimize: true },
91
98
  },
92
99
  },
93
100
  {
101
+ // Stage 3: final polish
102
+ factorLimits: 2,
103
+ maxNumberOfPeaks: 40,
94
104
  optimization: {
95
105
  kind: 'lm',
96
- options: { maxIterations: 20, errorTolerance: 5e-4 },
106
+ options: { maxIterations: 30, errorTolerance: 1e-5 },
97
107
  },
98
108
  parameters: {
99
109
  fwhm: {
100
110
  optimize: true,
101
- min: (peak: any) => (peak.shape?.fwhm ?? 0) / 3,
102
- max: (peak: any) => (peak.shape?.fwhm ?? 0) * 3,
111
+ min: (peak: any) => (peak.shape?.fwhm ?? 0) * 0.5,
112
+ max: (peak: any) => (peak.shape?.fwhm ?? 0) * 2,
103
113
  },
104
114
  mu: { optimize: true },
105
- x: { optimize: true },
106
- y: { optimize: true },
107
- },
108
- },
109
- {
110
- optimization: {
111
- kind: 'lm',
112
- options: { maxIterations: 20, errorTolerance: 1e-4 },
113
- },
114
- parameters: {
115
- fwhm: {
115
+ x: {
116
116
  optimize: true,
117
- min: (peak: any) => (peak.shape?.fwhm ?? 0) / 2,
118
- max: (peak: any) => (peak.shape?.fwhm ?? 0) * 2,
117
+ min: (peak: any) => peak.x - (peak.shape?.fwhm ?? 0) / 4,
118
+ max: (peak: any) => peak.x + (peak.shape?.fwhm ?? 0) / 4,
119
119
  },
120
- mu: { optimize: false },
121
- x: { optimize: true },
122
120
  y: { optimize: true },
123
121
  },
124
122
  },
125
123
  {
124
+ // Stage 3: final polish
125
+ factorLimits: 2,
126
+ maxNumberOfPeaks: 40,
126
127
  optimization: {
127
128
  kind: 'lm',
128
- options: { maxIterations: 20, errorTolerance: 1e-8 },
129
+ options: { maxIterations: 30, errorTolerance: 1e-5 },
129
130
  },
130
131
  parameters: {
131
132
  fwhm: {
132
133
  optimize: true,
133
- min: (peak: any) => (peak.shape?.fwhm ?? 0) / 2,
134
+ min: (peak: any) => (peak.shape?.fwhm ?? 0) * 0.5,
134
135
  max: (peak: any) => (peak.shape?.fwhm ?? 0) * 2,
135
136
  },
136
137
  mu: { optimize: true },
137
- x: { optimize: true },
138
+ x: {
139
+ optimize: true,
140
+ min: (peak: any) => peak.x - (peak.shape?.fwhm ?? 0) / 4,
141
+ max: (peak: any) => peak.x + (peak.shape?.fwhm ?? 0) / 4,
142
+ },
138
143
  y: { optimize: true },
139
144
  },
140
145
  },
@@ -35,6 +35,7 @@ export function detectSignalsByMultipletAnalysis(
35
35
  to,
36
36
  frequency,
37
37
  minMaxRatio: 0.1,
38
+ maxAbsoluteRatio: 0.1,
38
39
  broadWidth: 0.25,
39
40
  broadRatio: 0.0025,
40
41
  optimize: true,