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
@@ -5,7 +5,6 @@ import type {
5
5
  Spectrum1D,
6
6
  } from '@zakodium/nmrium-core';
7
7
  import type { Draft } from 'immer';
8
- import cloneDeep from 'lodash/cloneDeep.js';
9
8
  import { xFindClosestIndex } from 'ml-spectra-processing';
10
9
  import { Filters1DManager } from 'nmr-processing';
11
10
 
@@ -122,6 +121,7 @@ type ChangeRangeSumAction = ActionType<
122
121
  type AddRangeAction = ActionType<
123
122
  'ADD_RANGE',
124
123
  {
124
+ spectrumId?: string;
125
125
  range: Range;
126
126
  }
127
127
  >;
@@ -133,7 +133,14 @@ type ChangeRangeSignalValueAction = ActionType<
133
133
  'CHANGE_RANGE_SIGNAL_VALUE',
134
134
  { rangeId: string; signalId: string; value: number }
135
135
  >;
136
- type UpdateRangAction = ActionType<'UPDATE_RANGE', { range: Range }>;
136
+ type ChangeSignalDeltaAction = ActionType<
137
+ 'CHANGE_SIGNAL_DELTA',
138
+ { spectrumId: string; rangeId: string; signalId: string; value: number }
139
+ >;
140
+ type UpdateRangAction = ActionType<
141
+ 'UPDATE_RANGE',
142
+ { range: Range; spectrumId?: string }
143
+ >;
137
144
  type CutRangAction = ActionType<
138
145
  'CUT_RANGE',
139
146
  { ranges: Record<string, Range[]> }
@@ -189,6 +196,7 @@ export type RangesActions =
189
196
  | Change1DSignalAssignmentLabelAction
190
197
  | ChangeRangesViewFloatingBoxBoundingAction
191
198
  | ChangeRangesAssignmentsLabelsByDiaIdsAction
199
+ | ChangeSignalDeltaAction
192
200
  | ActionType<
193
201
  | 'AUTO_RANGES_SPECTRA_PICKING'
194
202
  | 'CHANGE_RANGES_SUM_FLAG'
@@ -234,6 +242,7 @@ function handleAutoRangesDetection(
234
242
  broadWidth: 0.05,
235
243
  thresholdFactor: 8,
236
244
  minMaxRatio,
245
+ maxAbsoluteRatio: minMaxRatio,
237
246
  direction: lookNegative ? 'both' : 'positive',
238
247
  },
239
248
  };
@@ -321,6 +330,29 @@ function handleChangeRangeSignalKind(
321
330
  handleUpdateCorrelations(draft);
322
331
  }
323
332
  }
333
+ //action
334
+ function handleChangeSignalDelta(
335
+ draft: Draft<State>,
336
+ action: ChangeSignalDeltaAction,
337
+ ) {
338
+ const { spectrumId, rangeId, signalId, value } = action.payload;
339
+
340
+ const spectrum = getSpectrum(draft, spectrumId);
341
+ if (!isSpectrum1D(spectrum)) return;
342
+
343
+ const rangeIndex = getRangeIndex(spectrum, rangeId);
344
+ const range = spectrum.ranges.values[rangeIndex];
345
+ if (range.signals) {
346
+ const signalIndex = range.signals.findIndex(
347
+ (_signal) => _signal.id === signalId,
348
+ );
349
+ if (signalIndex !== -1) {
350
+ range.signals[signalIndex].delta = value;
351
+ }
352
+ updateRangesRelativeValues(spectrum);
353
+ handleUpdateCorrelations(draft);
354
+ }
355
+ }
324
356
 
325
357
  //action
326
358
  function handleSaveEditedRange(
@@ -332,23 +364,19 @@ function handleSaveEditedRange(
332
364
  const spectrum = getSpectrum(draft);
333
365
  if (!isSpectrum1D(spectrum)) return;
334
366
 
335
- // remove assignments in global state
336
- const _editedRowData: any = unlink(range);
337
-
338
- delete _editedRowData.tableMetaInfo;
339
- delete _editedRowData.rowKey;
340
- // remove assignments in assignment hook data
341
- // for now: clear all assignments for this range because signals or levels to store might have changed
342
- const rangeIndex = getRangeIndex(spectrum, _editedRowData.id);
367
+ const rangeIndex = getRangeIndex(spectrum, range.id);
343
368
  if (rangeIndex === -1) {
344
369
  throw new Error('unreachable');
345
370
  }
346
371
 
347
- if (_editedRowData.id === 'new') {
348
- _editedRowData.id = crypto.randomUUID();
372
+ // Remove assignments in global state
373
+ unlink(range, -1);
374
+
375
+ if (range.id === 'new') {
376
+ range.id = crypto.randomUUID();
349
377
  }
350
378
 
351
- spectrum.ranges.values[rangeIndex] = _editedRowData;
379
+ spectrum.ranges.values[rangeIndex] = range;
352
380
  updateRangesRelativeValues(spectrum);
353
381
  handleUpdateCorrelations(draft);
354
382
  resetSelectedTool(draft);
@@ -367,11 +395,10 @@ function deleteSignal1D(draft: Draft<State>, props: DeleteSignalProps) {
367
395
  const signalIndex = range.signals.findIndex(
368
396
  (_signal) => _signal.id === signalId,
369
397
  );
398
+ if (signalIndex === -1) return;
399
+
370
400
  // Remove assignments for the signal range object in the global state.
371
- const _range = unlink(cloneDeep(range), {
372
- unlinkType: 'signal',
373
- signalIndex,
374
- });
401
+ const _range = unlink(range, signalIndex);
375
402
 
376
403
  _range.signals.splice(signalIndex, 1);
377
404
  spectrum.ranges.values[rangeIndex] = _range;
@@ -400,16 +427,11 @@ function clearSignalAssignment(
400
427
  const ranges = spectrum.ranges.values;
401
428
  if (rangeKey) {
402
429
  const rangeIndex = getRangeIndex(spectrum, rangeKey);
403
- const unlinkType = signalIndex === -1 ? 'range' : 'signal';
404
- ranges[rangeIndex] = unlink(ranges[rangeIndex], {
405
- unlinkType,
406
- signalIndex,
407
- });
430
+ ranges[rangeIndex] = unlink(ranges[rangeIndex], signalIndex);
408
431
  } else {
409
- const newRanges = ranges.map((range) => {
410
- return unlink(range);
411
- });
412
- spectrum.ranges.values = newRanges;
432
+ for (const range of ranges) {
433
+ unlink(range, -1);
434
+ }
413
435
  }
414
436
  }
415
437
 
@@ -517,9 +539,9 @@ function initiateRangeSumOptions(datum: Spectrum1D, options: SumParams) {
517
539
 
518
540
  //action
519
541
  function handleAddRange(draft: Draft<State>, action: AddRangeAction) {
520
- const { range } = action.payload;
542
+ const { range, spectrumId } = action.payload;
521
543
 
522
- const spectrum = getSpectrum(draft);
544
+ const spectrum = getSpectrum(draft, spectrumId);
523
545
  if (!isSpectrum1D(spectrum)) return;
524
546
 
525
547
  const { molecules } = draft;
@@ -583,9 +605,9 @@ function handleChangeRangesSumFlag(draft: Draft<State>) {
583
605
 
584
606
  //action
585
607
  function handleUpdateRange(draft: Draft<State>, action: UpdateRangAction) {
586
- const { range } = action.payload;
608
+ const { range, spectrumId } = action.payload;
587
609
 
588
- const spectrum = getSpectrum(draft);
610
+ const spectrum = getSpectrum(draft, spectrumId);
589
611
  if (!isSpectrum1D(spectrum)) return;
590
612
 
591
613
  const index = spectrum.ranges.values.findIndex(
@@ -720,6 +742,7 @@ export {
720
742
  handleChangeRangesAssignmentLabelsByDiaIds,
721
743
  handleChangeRangesSumFlag,
722
744
  handleChangeRangesViewFloatingBoxBounding,
745
+ handleChangeSignalDelta,
723
746
  handleCutRange,
724
747
  handleDeleteRange,
725
748
  handleDeleteRangePeak,
@@ -163,6 +163,15 @@ type UpdateSpectrumMetaAction = ActionType<
163
163
  }
164
164
  >;
165
165
 
166
+ type SetSpectrumAction = ActionType<
167
+ 'SET_SPECTRUM',
168
+ {
169
+ index: number;
170
+ spectrum: Spectrum;
171
+ onProduce: (draft: Draft<State>, processedSpectrum: Spectrum) => void;
172
+ }
173
+ >;
174
+
166
175
  export type SpectrumActions =
167
176
  | ActionType<'TOGGLE_SPECTRA_LEGEND'>
168
177
  | ChangeSpectrumVisibilityByIdAction
@@ -176,7 +185,8 @@ export type SpectrumActions =
176
185
  | ImportSpectraMetaInfoAction
177
186
  | ReColorSpectraBasedOnDistinctValueAction
178
187
  | SimulateSpectrumAction
179
- | UpdateSpectrumMetaAction;
188
+ | UpdateSpectrumMetaAction
189
+ | SetSpectrumAction;
180
190
 
181
191
  function checkIsVisible2D(datum: Spectrum2D): boolean {
182
192
  if (!datum.display.isPositiveVisible && !datum.display.isNegativeVisible) {
@@ -808,6 +818,14 @@ function handleUpdateSpectrumMeta(
808
818
  }
809
819
  }
810
820
 
821
+ function setSpectrum(draft: Draft<State>, action: SetSpectrumAction) {
822
+ const { index, spectrum, onProduce } = action.payload;
823
+
824
+ draft.data[index] = spectrum;
825
+
826
+ onProduce(draft, spectrum);
827
+ }
828
+
811
829
  export {
812
830
  handleAddMissingProjectionHandler,
813
831
  handleAlignSpectraHandler,
@@ -823,4 +841,5 @@ export {
823
841
  handleToggleSpectraLegend,
824
842
  handleUpdateSpectrumMeta,
825
843
  setSpectraMetaInfo,
844
+ setSpectrum,
826
845
  };
@@ -6,7 +6,6 @@ import { isSpectrum1D } from '../../../data/data1d/Spectrum1D/index.js';
6
6
  import { contoursManager } from '../../../data/data2d/Spectrum2D/contours.js';
7
7
  import { getXScale } from '../../1d/utilities/scale.js';
8
8
  import type { Layout } from '../../2d/utilities/DimensionLayout.js';
9
- import { LAYOUT } from '../../2d/utilities/DimensionLayout.js';
10
9
  import { get2DXScale, get2DYScale } from '../../2d/utilities/scale.js';
11
10
  import type {
12
11
  BrushAxis,
@@ -25,6 +24,7 @@ import zoomHistoryManager, {
25
24
  } from '../helper/ZoomHistoryManager.js';
26
25
  import { getActiveSpectra } from '../helper/getActiveSpectra.js';
27
26
  import { getSpectrum } from '../helper/getSpectrum.js';
27
+ import { getTraceSpectrumID } from '../helper/getTraceSpectrumID.tsx';
28
28
  import { getTwoDimensionPhaseCorrectionOptions } from '../helper/getTwoDimensionPhaseCorrectionOptions.js';
29
29
  import { getVerticalAlign } from '../helper/getVerticalAlign.js';
30
30
  import { setIntegralsViewProperty } from '../helper/setIntegralsViewProperty.js';
@@ -173,18 +173,6 @@ function setSelectedTool(draft: Draft<State>, action: SetSelectedToolAction) {
173
173
  const { selectedTool } = action.payload;
174
174
  activateTool(draft, { toolId: selectedTool });
175
175
  }
176
- //utility
177
- function getSpectrumID(draft: Draft<State>, index: any): string | null {
178
- const { activeSpectra, activeTab } = draft.view.spectra;
179
-
180
- const spectra = activeSpectra[activeTab.split(',')[index]];
181
-
182
- if (spectra?.length === 1) {
183
- return spectra[0].id;
184
- }
185
-
186
- return null;
187
- }
188
176
 
189
177
  function setSpectraVerticalAlign(draft: Draft<State>) {
190
178
  const currentVerticalAlign = getVerticalAlign(draft);
@@ -314,14 +302,10 @@ function handleZoom(draft: Draft<State>, action: ZoomAction) {
314
302
  }
315
303
  } else {
316
304
  // change the vertical scale of 1D traces
317
- const index =
318
- trackID === LAYOUT.top ? 0 : trackID === LAYOUT.left ? 1 : null;
319
- if (index !== null) {
320
- const id = getSpectrumID(draft, index);
321
- if (id) {
322
- const domain = yDomains[id];
323
- yDomains[id] = wheelZoom(options, domain);
324
- }
305
+ const id = getTraceSpectrumID(draft, trackID);
306
+ if (id) {
307
+ const domain = yDomains[id];
308
+ yDomains[id] = wheelZoom(options, domain);
325
309
  }
326
310
  }
327
311
 
@@ -0,0 +1,25 @@
1
+ import type { Draft } from 'immer';
2
+
3
+ import type { Layout } from '../../2d/utilities/DimensionLayout.ts';
4
+ import { LAYOUT } from '../../2d/utilities/DimensionLayout.ts';
5
+ import type { State } from '../Reducer.ts';
6
+
7
+ //utility
8
+ export function getTraceSpectrumID(
9
+ draft: Draft<State>,
10
+ trackID: Layout | undefined,
11
+ ): string | null {
12
+ const index = trackID === LAYOUT.top ? 0 : trackID === LAYOUT.left ? 1 : null;
13
+
14
+ if (index === null) return null;
15
+
16
+ const { activeSpectra, activeTab } = draft.view.spectra;
17
+
18
+ const spectra = activeSpectra[activeTab.split(',')[index]];
19
+
20
+ if (spectra?.length === 1) {
21
+ return spectra[0].id;
22
+ }
23
+
24
+ return null;
25
+ }
@@ -1,22 +1,30 @@
1
1
  import type { Draft } from 'immer';
2
+ import { original } from 'immer';
2
3
  import cloneDeep from 'lodash/cloneDeep.js';
3
4
 
4
- import type { PreferencesState } from '../preferencesReducer.js';
5
+ import type {
6
+ PreferencesState,
7
+ SetPreferencesAction,
8
+ WorkspaceWithSource,
9
+ } from '../preferencesReducer.js';
5
10
  import { getActiveWorkspace } from '../utilities/getActiveWorkspace.js';
6
11
 
7
- export function setPreferences(draft: Draft<PreferencesState>, action: any) {
8
- const currentWorkspacePreferences = getActiveWorkspace(draft);
12
+ export function setPreferences(
13
+ draft: Draft<PreferencesState>,
14
+ action: SetPreferencesAction,
15
+ ) {
16
+ const currentWorkspacePreferences = getActiveWorkspace(original(draft));
9
17
 
10
- if (action.payload) {
18
+ if ('payload' in action) {
11
19
  const preferences = action.payload;
12
20
 
13
- draft.workspaces[draft.workspace.current] = {
21
+ draft.workspaces[draft.workspace.current] = cloneDeep({
14
22
  ...currentWorkspacePreferences,
15
23
  ...preferences,
16
- };
24
+ }) as WorkspaceWithSource;
25
+ } else {
26
+ draft.originalWorkspaces[draft.workspace.current] = cloneDeep(
27
+ original(draft.workspaces[draft.workspace.current]),
28
+ );
17
29
  }
18
-
19
- draft.originalWorkspaces[draft.workspace.current] = cloneDeep(
20
- draft.workspaces[draft.workspace.current],
21
- );
22
30
  }
@@ -84,7 +84,7 @@ type InitPreferencesAction = ActionType<
84
84
  }
85
85
  >;
86
86
 
87
- type SetPreferencesAction =
87
+ export type SetPreferencesAction =
88
88
  | ActionType<'SET_PREFERENCES', Partial<Workspace>>
89
89
  | ActionType<'SET_PREFERENCES'>;
90
90
 
@@ -1,12 +1,58 @@
1
1
  import type { Info1D, Info2D } from '@zakodium/nmr-types';
2
2
  import type { NMRiumToolbarPreferences } from '@zakodium/nmrium-core';
3
+ import {
4
+ SvgNmrAlignBottom,
5
+ SvgNmrAlignCenter,
6
+ SvgNmrApodization,
7
+ SvgNmrBaselineCorrection,
8
+ SvgNmrFourierTransform,
9
+ SvgNmrIntegrate,
10
+ SvgNmrMultipleAnalysis,
11
+ SvgNmrOverlay3,
12
+ SvgNmrOverlay3Aligned,
13
+ SvgNmrPeakPicking,
14
+ SvgNmrPhaseCorrection,
15
+ SvgNmrRangePicking,
16
+ SvgNmrRealImag,
17
+ SvgNmrZeroFilling,
18
+ } from 'cheminfo-font';
3
19
  import { Filters1D, Filters2D } from 'nmr-processing';
20
+ import type { ComponentType } from 'react';
21
+ import {
22
+ FaDiceFour,
23
+ FaExpand,
24
+ FaFileExport,
25
+ FaFileImport,
26
+ FaICursor,
27
+ } from 'react-icons/fa';
28
+ import { PiKnifeBold, PiSelectionPlusDuotone } from 'react-icons/pi';
29
+ import { TbZoom } from 'react-icons/tb';
4
30
 
5
31
  import type { DisplayerMode } from '../reducer/Reducer.js';
6
32
 
7
33
  type InfoKey = keyof Info1D | keyof Info2D;
8
34
 
9
- export interface ToolOptionItem {
35
+ interface StaticIcon {
36
+ icon: ToolIconComponent;
37
+ getIcon?: never;
38
+ }
39
+
40
+ interface DynamicIcon {
41
+ icon?: never;
42
+ getIcon: (ctx: IconDataContext) => ToolIconComponent;
43
+ }
44
+ export interface IconOptions {
45
+ fontSize?: number;
46
+ strokeWidth?: number;
47
+ }
48
+
49
+ export type ToolIconComponent = ComponentType<IconOptions>;
50
+
51
+ export interface IconDataContext {
52
+ verticalAlign?: 'bottom' | 'center' | 'stack';
53
+ isRealSpectrumShown?: boolean;
54
+ }
55
+ interface BaseToolOption {
10
56
  id: Tool;
11
57
  label: string;
12
58
  mode?: DisplayerMode;
@@ -32,6 +78,8 @@ export interface ToolOptionItem {
32
78
  isExperimental?: true;
33
79
  }
34
80
 
81
+ export type ToolOptionItem = BaseToolOption & (StaticIcon | DynamicIcon);
82
+
35
83
  export type MainTool = keyof NMRiumToolbarPreferences;
36
84
 
37
85
  /**
@@ -47,6 +95,7 @@ export const options: RecordOptions = {
47
95
  zoom: {
48
96
  id: 'zoom',
49
97
  label: 'Zoom in / out',
98
+ icon: TbZoom,
50
99
  hasOptionPanel: false,
51
100
  isFilter: false,
52
101
  isToggle: true,
@@ -54,6 +103,7 @@ export const options: RecordOptions = {
54
103
  peakPicking: {
55
104
  id: 'peakPicking',
56
105
  label: 'Peaks picking',
106
+ icon: SvgNmrPeakPicking,
57
107
  hasOptionPanel: true,
58
108
  isFilter: false,
59
109
  mode: '1D',
@@ -69,6 +119,7 @@ export const options: RecordOptions = {
69
119
  integral: {
70
120
  id: 'integral',
71
121
  label: 'Integral Tool',
122
+ icon: SvgNmrIntegrate,
72
123
  hasOptionPanel: false,
73
124
  isFilter: false,
74
125
  mode: '1D',
@@ -82,6 +133,7 @@ export const options: RecordOptions = {
82
133
  inset: {
83
134
  id: 'inset',
84
135
  label: 'Inset Tool',
136
+ icon: PiSelectionPlusDuotone,
85
137
  hasOptionPanel: false,
86
138
  isFilter: false,
87
139
  mode: '1D',
@@ -95,6 +147,7 @@ export const options: RecordOptions = {
95
147
  zonePicking: {
96
148
  id: 'zonePicking',
97
149
  label: 'Zone tool',
150
+ icon: FaDiceFour,
98
151
  hasOptionPanel: true,
99
152
  isFilter: false,
100
153
  mode: '2D',
@@ -108,6 +161,7 @@ export const options: RecordOptions = {
108
161
  slicing: {
109
162
  id: 'slicing',
110
163
  label: 'Slicing tool',
164
+ icon: PiKnifeBold,
111
165
  hasOptionPanel: false,
112
166
  isFilter: false,
113
167
  mode: '2D',
@@ -121,6 +175,7 @@ export const options: RecordOptions = {
121
175
  rangePicking: {
122
176
  id: 'rangePicking',
123
177
  label: 'Range picking and multiplet analysis',
178
+ icon: SvgNmrRangePicking,
124
179
  hasOptionPanel: true,
125
180
  isFilter: false,
126
181
  mode: '1D',
@@ -134,6 +189,7 @@ export const options: RecordOptions = {
134
189
  apodization: {
135
190
  id: Filters1D.apodization.name,
136
191
  label: Filters1D.apodization.label,
192
+ icon: SvgNmrApodization,
137
193
  hasOptionPanel: true,
138
194
  isFilter: true,
139
195
  mode: '1D',
@@ -150,6 +206,7 @@ export const options: RecordOptions = {
150
206
  zeroFilling: {
151
207
  id: Filters1D.zeroFilling.name,
152
208
  label: Filters1D.zeroFilling.label,
209
+ icon: SvgNmrZeroFilling,
153
210
  hasOptionPanel: true,
154
211
  isFilter: true,
155
212
  mode: '1D',
@@ -166,6 +223,7 @@ export const options: RecordOptions = {
166
223
  zeroFillingDimension1: {
167
224
  id: Filters2D.zeroFillingDimension1.name,
168
225
  label: Filters2D.zeroFillingDimension1.label,
226
+ icon: SvgNmrZeroFilling,
169
227
  hasOptionPanel: true,
170
228
  isFilter: true,
171
229
  mode: '2D',
@@ -182,6 +240,7 @@ export const options: RecordOptions = {
182
240
  zeroFillingDimension2: {
183
241
  id: Filters2D.zeroFillingDimension2.name,
184
242
  label: Filters2D.zeroFillingDimension2.label,
243
+ icon: SvgNmrZeroFilling,
185
244
  hasOptionPanel: true,
186
245
  isFilter: true,
187
246
  mode: '2D',
@@ -199,6 +258,7 @@ export const options: RecordOptions = {
199
258
  phaseCorrection: {
200
259
  id: Filters1D.phaseCorrection.name,
201
260
  label: Filters1D.phaseCorrection.label,
261
+ icon: SvgNmrPhaseCorrection,
202
262
  hasOptionPanel: true,
203
263
  isFilter: true,
204
264
  mode: '1D',
@@ -215,6 +275,7 @@ export const options: RecordOptions = {
215
275
  baselineCorrection: {
216
276
  id: Filters1D.baselineCorrection.name,
217
277
  label: Filters1D.baselineCorrection.label,
278
+ icon: SvgNmrBaselineCorrection,
218
279
  hasOptionPanel: true,
219
280
  isFilter: true,
220
281
  mode: '1D',
@@ -228,6 +289,7 @@ export const options: RecordOptions = {
228
289
  multipleSpectraAnalysis: {
229
290
  id: 'multipleSpectraAnalysis',
230
291
  label: 'Multiple spectra integration',
292
+ icon: SvgNmrMultipleAnalysis,
231
293
  hasOptionPanel: false,
232
294
  isFilter: false,
233
295
  mode: '1D',
@@ -242,6 +304,7 @@ export const options: RecordOptions = {
242
304
  exclusionZones: {
243
305
  id: 'exclusionZones',
244
306
  label: 'Exclusion zones',
307
+ icon: SvgNmrMultipleAnalysis,
245
308
  hasOptionPanel: false,
246
309
  isFilter: true,
247
310
  mode: '1D',
@@ -266,6 +329,7 @@ export const options: RecordOptions = {
266
329
  ],
267
330
  selectedSpectra: { min: 0 },
268
331
  isToggle: true,
332
+ icon: SvgNmrMultipleAnalysis,
269
333
  },
270
334
  databaseRangesSelection: {
271
335
  id: 'databaseRangesSelection',
@@ -279,10 +343,12 @@ export const options: RecordOptions = {
279
343
  },
280
344
  ],
281
345
  isToggle: true,
346
+ icon: FaICursor,
282
347
  },
283
348
  exportAs: {
284
349
  id: 'exportAs',
285
350
  label: 'Export as',
351
+ icon: FaFileExport,
286
352
  hasOptionPanel: false,
287
353
  isFilter: false,
288
354
  isToggle: false,
@@ -290,6 +356,7 @@ export const options: RecordOptions = {
290
356
  fft: {
291
357
  id: 'fft',
292
358
  label: 'Fourier transform',
359
+ icon: SvgNmrFourierTransform,
293
360
  hasOptionPanel: false,
294
361
  isFilter: true,
295
362
  mode: '1D',
@@ -306,6 +373,7 @@ export const options: RecordOptions = {
306
373
  fftDimension1: {
307
374
  id: 'fftDimension1',
308
375
  label: 'Fourier transform dimension 1',
376
+ icon: SvgNmrFourierTransform,
309
377
  hasOptionPanel: false,
310
378
  isFilter: true,
311
379
  mode: '2D',
@@ -322,6 +390,7 @@ export const options: RecordOptions = {
322
390
  fftDimension2: {
323
391
  id: 'fftDimension2',
324
392
  label: 'Fourier transform dimension 2',
393
+ icon: SvgNmrFourierTransform,
325
394
  hasOptionPanel: false,
326
395
  isFilter: true,
327
396
  mode: '2D',
@@ -339,6 +408,7 @@ export const options: RecordOptions = {
339
408
  phaseCorrectionTwoDimensions: {
340
409
  id: 'phaseCorrectionTwoDimensions',
341
410
  label: 'Phase correction two dimension',
411
+ icon: SvgNmrPhaseCorrection,
342
412
  hasOptionPanel: true,
343
413
  isFilter: true,
344
414
  mode: '2D',
@@ -352,6 +422,7 @@ export const options: RecordOptions = {
352
422
  import: {
353
423
  id: 'import',
354
424
  label: 'Import',
425
+ icon: FaFileImport,
355
426
  hasOptionPanel: false,
356
427
  isFilter: false,
357
428
  isToggle: false,
@@ -359,6 +430,7 @@ export const options: RecordOptions = {
359
430
  realImaginary: {
360
431
  id: 'realImaginary',
361
432
  label: 'Real / Imaginary',
433
+ icon: SvgNmrRealImag,
362
434
  hasOptionPanel: false,
363
435
  isFilter: false,
364
436
  mode: '1D',
@@ -372,6 +444,9 @@ export const options: RecordOptions = {
372
444
  spectraCenterAlignments: {
373
445
  id: 'spectraCenterAlignments',
374
446
  label: 'Align spectrum',
447
+ // depends on current vertical alignment state
448
+ getIcon: (idc: IconDataContext) =>
449
+ idc.verticalAlign === 'bottom' ? SvgNmrAlignCenter : SvgNmrAlignBottom,
375
450
  hasOptionPanel: false,
376
451
  isFilter: false,
377
452
  mode: '1D',
@@ -380,6 +455,9 @@ export const options: RecordOptions = {
380
455
  spectraStackAlignments: {
381
456
  id: 'spectraStackAlignments',
382
457
  label: 'Stack spectra',
458
+ // depends on current vertical alignment state
459
+ getIcon: (idc: IconDataContext) =>
460
+ idc.verticalAlign === 'stack' ? SvgNmrOverlay3Aligned : SvgNmrOverlay3,
383
461
  hasOptionPanel: false,
384
462
  isFilter: false,
385
463
  mode: '1D',
@@ -394,6 +472,7 @@ export const options: RecordOptions = {
394
472
  zoomOut: {
395
473
  id: 'zoomOut',
396
474
  label: 'Zoom out',
475
+ icon: FaExpand,
397
476
  hasOptionPanel: false,
398
477
  isFilter: false,
399
478
  isToggle: false,
@@ -404,10 +483,12 @@ export const options: RecordOptions = {
404
483
  hasOptionPanel: false,
405
484
  isFilter: false,
406
485
  isToggle: false,
486
+ icon: SvgNmrRangePicking,
407
487
  },
408
488
  apodizationDimension1: {
409
489
  id: Filters2D.apodizationDimension1.name,
410
490
  label: Filters2D.apodizationDimension1.label,
491
+ icon: SvgNmrApodization,
411
492
  hasOptionPanel: true,
412
493
  isFilter: true,
413
494
  mode: '2D',
@@ -421,6 +502,7 @@ export const options: RecordOptions = {
421
502
  apodizationDimension2: {
422
503
  id: Filters2D.apodizationDimension2.name,
423
504
  label: Filters2D.apodizationDimension2.label,
505
+ icon: SvgNmrApodization,
424
506
  hasOptionPanel: true,
425
507
  isFilter: true,
426
508
  mode: '2D',
@@ -436,3 +518,12 @@ export const options: RecordOptions = {
436
518
  isToggle: true,
437
519
  },
438
520
  };
521
+
522
+ export function getToolIcon(
523
+ id: Tool,
524
+ idc: IconDataContext = {},
525
+ ): ToolIconComponent | undefined {
526
+ const option = options[id];
527
+
528
+ return 'getIcon' in option ? option.getIcon?.(idc) : option.icon;
529
+ }