nmrium 1.8.0 → 1.10.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 (525) hide show
  1. package/lib/component/1d/ApodizationLine.js +1 -1
  2. package/lib/component/1d/ApodizationLine.js.map +1 -1
  3. package/lib/component/1d/BrushTracker1D.d.ts.map +1 -1
  4. package/lib/component/1d/BrushTracker1D.js.map +1 -1
  5. package/lib/component/1d/FooterBanner.js.map +1 -1
  6. package/lib/component/1d/LinesSeries.js +2 -2
  7. package/lib/component/1d/LinesSeries.js.map +1 -1
  8. package/lib/component/1d/SVGContent1D.d.ts.map +1 -1
  9. package/lib/component/1d/SVGContent1D.js +2 -1
  10. package/lib/component/1d/SVGContent1D.js.map +1 -1
  11. package/lib/component/1d/SimilarityTree.d.ts.map +1 -1
  12. package/lib/component/1d/SimilarityTree.js.map +1 -1
  13. package/lib/component/1d/inset/InsetProvider.d.ts.map +1 -1
  14. package/lib/component/1d/inset/InsetProvider.js.map +1 -1
  15. package/lib/component/1d/integral/IntegralResizable.d.ts.map +1 -1
  16. package/lib/component/1d/integral/IntegralResizable.js.map +1 -1
  17. package/lib/component/1d/matrix/Boxplot.js.map +1 -1
  18. package/lib/component/1d/multiAnalysis/AnalysisRange.d.ts.map +1 -1
  19. package/lib/component/1d/multiAnalysis/AnalysisRange.js.map +1 -1
  20. package/lib/component/1d/multiplicityTree/MultiplicityTree.d.ts.map +1 -1
  21. package/lib/component/1d/multiplicityTree/MultiplicityTree.js +13 -20
  22. package/lib/component/1d/multiplicityTree/MultiplicityTree.js.map +1 -1
  23. package/lib/component/1d/multiplicityTree/generateTreeNodes.d.ts +1 -0
  24. package/lib/component/1d/multiplicityTree/generateTreeNodes.d.ts.map +1 -1
  25. package/lib/component/1d/multiplicityTree/generateTreeNodes.js +2 -1
  26. package/lib/component/1d/multiplicityTree/generateTreeNodes.js.map +1 -1
  27. package/lib/component/1d/peaks/PeakAnnotationsSpreadMode.d.ts.map +1 -1
  28. package/lib/component/1d/peaks/PeakAnnotationsSpreadMode.js.map +1 -1
  29. package/lib/component/1d/peaks/PeakEditionManager.d.ts.map +1 -1
  30. package/lib/component/1d/peaks/PeakEditionManager.js +2 -2
  31. package/lib/component/1d/peaks/PeakEditionManager.js.map +1 -1
  32. package/lib/component/1d/peaks/Peaks.d.ts +4 -1
  33. package/lib/component/1d/peaks/Peaks.d.ts.map +1 -1
  34. package/lib/component/1d/peaks/Peaks.js.map +1 -1
  35. package/lib/component/1d/ranges/AssignmentLabel.d.ts +2 -1
  36. package/lib/component/1d/ranges/AssignmentLabel.d.ts.map +1 -1
  37. package/lib/component/1d/ranges/AssignmentLabel.js +6 -4
  38. package/lib/component/1d/ranges/AssignmentLabel.js.map +1 -1
  39. package/lib/component/1d/ranges/Atoms.js +2 -2
  40. package/lib/component/1d/ranges/Atoms.js.map +1 -1
  41. package/lib/component/1d/ranges/Range.d.ts +2 -1
  42. package/lib/component/1d/ranges/Range.d.ts.map +1 -1
  43. package/lib/component/1d/ranges/Range.js +28 -56
  44. package/lib/component/1d/ranges/Range.js.map +1 -1
  45. package/lib/component/1d/ranges/Ranges.d.ts.map +1 -1
  46. package/lib/component/1d/ranges/Ranges.js +19 -13
  47. package/lib/component/1d/ranges/Ranges.js.map +1 -1
  48. package/lib/component/1d/ranges/useAssignmentsPopoverActionsButtons.d.ts +14 -0
  49. package/lib/component/1d/ranges/useAssignmentsPopoverActionsButtons.d.ts.map +1 -0
  50. package/lib/component/1d/ranges/useAssignmentsPopoverActionsButtons.js +67 -0
  51. package/lib/component/1d/ranges/useAssignmentsPopoverActionsButtons.js.map +1 -0
  52. package/lib/component/1d/tool/BaseLineZones.d.ts.map +1 -1
  53. package/lib/component/1d/tool/BaseLineZones.js.map +1 -1
  54. package/lib/component/1d/utilities/intersectionResolver.d.ts.map +1 -1
  55. package/lib/component/1d/utilities/intersectionResolver.js.map +1 -1
  56. package/lib/component/1d-2d/FieldEdition.d.ts.map +1 -1
  57. package/lib/component/1d-2d/FieldEdition.js.map +1 -1
  58. package/lib/component/2d/1d-tracer/VerticalSliceChart.js.map +1 -1
  59. package/lib/component/2d/1d-tracer/phase-correction-traces/PhaseTraces.js +1 -1
  60. package/lib/component/2d/1d-tracer/phase-correction-traces/PhaseTraces.js.map +1 -1
  61. package/lib/component/2d/1d-tracer/phase-correction-traces/SpectrumPhaseTrace.js +1 -1
  62. package/lib/component/2d/1d-tracer/phase-correction-traces/SpectrumPhaseTrace.js.map +1 -1
  63. package/lib/component/2d/BrushTracker2D.d.ts.map +1 -1
  64. package/lib/component/2d/BrushTracker2D.js +41 -46
  65. package/lib/component/2d/BrushTracker2D.js.map +1 -1
  66. package/lib/component/2d/FooterBanner.d.ts +2 -2
  67. package/lib/component/2d/FooterBanner.d.ts.map +1 -1
  68. package/lib/component/2d/FooterBanner.js +63 -97
  69. package/lib/component/2d/FooterBanner.js.map +1 -1
  70. package/lib/component/2d/SVGContent2D.d.ts +2 -2
  71. package/lib/component/2d/SVGContent2D.d.ts.map +1 -1
  72. package/lib/component/2d/SVGContent2D.js.map +1 -1
  73. package/lib/component/2d/SlicingView.js +1 -1
  74. package/lib/component/2d/SlicingView.js.map +1 -1
  75. package/lib/component/2d/Viewer2D.js +1 -1
  76. package/lib/component/2d/Viewer2D.js.map +1 -1
  77. package/lib/component/2d/ft/FTContainer.d.ts +2 -2
  78. package/lib/component/2d/ft/FTContainer.d.ts.map +1 -1
  79. package/lib/component/2d/ft/FTContainer.js +1 -1
  80. package/lib/component/2d/ft/FTContainer.js.map +1 -1
  81. package/lib/component/2d/tools/XYLabelPointer.d.ts +2 -2
  82. package/lib/component/2d/tools/XYLabelPointer.d.ts.map +1 -1
  83. package/lib/component/2d/tools/XYLabelPointer.js +10 -9
  84. package/lib/component/2d/tools/XYLabelPointer.js.map +1 -1
  85. package/lib/component/2d/useTracesSpectra.d.ts +3 -2
  86. package/lib/component/2d/useTracesSpectra.d.ts.map +1 -1
  87. package/lib/component/2d/useTracesSpectra.js +17 -9
  88. package/lib/component/2d/useTracesSpectra.js.map +1 -1
  89. package/lib/component/2d/utilities/extractSpectrumSignals.js +2 -2
  90. package/lib/component/2d/utilities/extractSpectrumSignals.js.map +1 -1
  91. package/lib/component/2d/zones/Signal.js.map +1 -1
  92. package/lib/component/2d/zones/SignalsGuideLines.d.ts.map +1 -1
  93. package/lib/component/2d/zones/SignalsGuideLines.js +15 -13
  94. package/lib/component/2d/zones/SignalsGuideLines.js.map +1 -1
  95. package/lib/component/2d/zones/ZonesAssignmentsLabels.js +1 -1
  96. package/lib/component/2d/zones/ZonesAssignmentsLabels.js.map +1 -1
  97. package/lib/component/EventsTrackers/BrushTracker.d.ts +5 -6
  98. package/lib/component/EventsTrackers/BrushTracker.d.ts.map +1 -1
  99. package/lib/component/EventsTrackers/BrushTracker.js +2 -0
  100. package/lib/component/EventsTrackers/BrushTracker.js.map +1 -1
  101. package/lib/component/EventsTrackers/KeysListenerTracker.d.ts.map +1 -1
  102. package/lib/component/EventsTrackers/KeysListenerTracker.js +6 -0
  103. package/lib/component/EventsTrackers/KeysListenerTracker.js.map +1 -1
  104. package/lib/component/assignment/utilities/getAssignments.js +1 -2
  105. package/lib/component/assignment/utilities/getAssignments.js.map +1 -1
  106. package/lib/component/context/KeyModifierContext.d.ts +3 -2
  107. package/lib/component/context/KeyModifierContext.d.ts.map +1 -1
  108. package/lib/component/context/KeyModifierContext.js +7 -4
  109. package/lib/component/context/KeyModifierContext.js.map +1 -1
  110. package/lib/component/elements/ActionsButtonsPopover.d.ts.map +1 -1
  111. package/lib/component/elements/ActionsButtonsPopover.js +17 -3
  112. package/lib/component/elements/ActionsButtonsPopover.js.map +1 -1
  113. package/lib/component/elements/AssignmentsCell.d.ts.map +1 -1
  114. package/lib/component/elements/AssignmentsCell.js.map +1 -1
  115. package/lib/component/elements/Button.d.ts.map +1 -1
  116. package/lib/component/elements/Button.js.map +1 -1
  117. package/lib/component/elements/CheckController.d.ts.map +1 -1
  118. package/lib/component/elements/CheckController.js.map +1 -1
  119. package/lib/component/elements/ContextMenuBluePrint.d.ts.map +1 -1
  120. package/lib/component/elements/ContextMenuBluePrint.js.map +1 -1
  121. package/lib/component/elements/D3Axis.d.ts.map +1 -1
  122. package/lib/component/elements/DraggableDialog.d.ts.map +1 -1
  123. package/lib/component/elements/DraggableDialog.js.map +1 -1
  124. package/lib/component/elements/Input.d.ts.map +1 -1
  125. package/lib/component/elements/Input.js.map +1 -1
  126. package/lib/component/elements/Input2.d.ts.map +1 -1
  127. package/lib/component/elements/Input2.js.map +1 -1
  128. package/lib/component/elements/Input2Controller.d.ts.map +1 -1
  129. package/lib/component/elements/Input2Controller.js.map +1 -1
  130. package/lib/component/elements/Label.d.ts.map +1 -1
  131. package/lib/component/elements/Label.js.map +1 -1
  132. package/lib/component/elements/NumberInput2.d.ts.map +1 -1
  133. package/lib/component/elements/NumberInput2.js.map +1 -1
  134. package/lib/component/elements/NumberInput2Controller.d.ts.map +1 -1
  135. package/lib/component/elements/NumberInput2Controller.js.map +1 -1
  136. package/lib/component/elements/ReactTable/ReactTable.d.ts.map +1 -1
  137. package/lib/component/elements/ReactTable/ReactTable.js.map +1 -1
  138. package/lib/component/elements/ReadOnly.d.ts.map +1 -1
  139. package/lib/component/elements/ReadOnly.js.map +1 -1
  140. package/lib/component/elements/Sections.js.map +1 -1
  141. package/lib/component/elements/Select.d.ts.map +1 -1
  142. package/lib/component/elements/Select.js.map +1 -1
  143. package/lib/component/elements/ToolbarPopoverItem.d.ts.map +1 -1
  144. package/lib/component/elements/export/ExportContent.d.ts.map +1 -1
  145. package/lib/component/elements/export/ExportContent.js.map +1 -1
  146. package/lib/component/elements/print/PrintContent.d.ts.map +1 -1
  147. package/lib/component/elements/print/PrintContent.js.map +1 -1
  148. package/lib/component/hooks/useActiveSpectrumIntegralsViewState.d.ts.map +1 -1
  149. package/lib/component/hooks/useActiveSpectrumIntegralsViewState.js +2 -4
  150. package/lib/component/hooks/useActiveSpectrumIntegralsViewState.js.map +1 -1
  151. package/lib/component/hooks/useActiveSpectrumPeaksViewState.d.ts.map +1 -1
  152. package/lib/component/hooks/useActiveSpectrumPeaksViewState.js +2 -4
  153. package/lib/component/hooks/useActiveSpectrumPeaksViewState.js.map +1 -1
  154. package/lib/component/hooks/useActiveSpectrumRangesViewState.d.ts.map +1 -1
  155. package/lib/component/hooks/useActiveSpectrumRangesViewState.js +2 -4
  156. package/lib/component/hooks/useActiveSpectrumRangesViewState.js.map +1 -1
  157. package/lib/component/hooks/useActiveSpectrumStyleOptions.js +2 -2
  158. package/lib/component/hooks/useActiveSpectrumStyleOptions.js.map +1 -1
  159. package/lib/component/hooks/useActiveSpectrumZonesViewState.d.ts.map +1 -1
  160. package/lib/component/hooks/useActiveSpectrumZonesViewState.js +2 -4
  161. package/lib/component/hooks/useActiveSpectrumZonesViewState.js.map +1 -1
  162. package/lib/component/hooks/useExport.js +1 -1
  163. package/lib/component/hooks/useExport.js.map +1 -1
  164. package/lib/component/hooks/useSaveSettings.d.ts.map +1 -1
  165. package/lib/component/hooks/useSaveSettings.js +28 -47
  166. package/lib/component/hooks/useSaveSettings.js.map +1 -1
  167. package/lib/component/hooks/useSetActiveSpectrumAction.d.ts +2 -1
  168. package/lib/component/hooks/useSetActiveSpectrumAction.d.ts.map +1 -1
  169. package/lib/component/hooks/useSetActiveSpectrumAction.js +2 -2
  170. package/lib/component/hooks/useSetActiveSpectrumAction.js.map +1 -1
  171. package/lib/component/hooks/useSpectrumWithDataSource.js +1 -1
  172. package/lib/component/hooks/useSpectrumWithDataSource.js.map +1 -1
  173. package/lib/component/hooks/useWorkspaceAction.d.ts +1 -1
  174. package/lib/component/hooks/useWorkspaceAction.d.ts.map +1 -1
  175. package/lib/component/hooks/useWorkspaceAction.js +3 -0
  176. package/lib/component/hooks/useWorkspaceAction.js.map +1 -1
  177. package/lib/component/modal/ImportPublicationStringModal.d.ts.map +1 -1
  178. package/lib/component/modal/ImportPublicationStringModal.js.map +1 -1
  179. package/lib/component/modal/MultipletAnalysisModal.js +1 -1
  180. package/lib/component/modal/changeSum/ChangeSumModal.d.ts.map +1 -1
  181. package/lib/component/modal/changeSum/ChangeSumModal.js.map +1 -1
  182. package/lib/component/modal/metaImportation/MetaImportationModal.d.ts.map +1 -1
  183. package/lib/component/modal/metaImportation/MetaImportationModal.js.map +1 -1
  184. package/lib/component/modal/setting/GeneralSettings.d.ts.map +1 -1
  185. package/lib/component/modal/setting/GeneralSettings.js +5 -1
  186. package/lib/component/modal/setting/GeneralSettings.js.map +1 -1
  187. package/lib/component/modal/setting/settings-tabs/ToolsTabContent.js +1 -1
  188. package/lib/component/modal/setting/settings-tabs/ToolsTabContent.js.map +1 -1
  189. package/lib/component/panels/IntegralsPanel/IntegralTable.d.ts.map +1 -1
  190. package/lib/component/panels/IntegralsPanel/IntegralTable.js.map +1 -1
  191. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.d.ts +1 -1
  192. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.d.ts.map +1 -1
  193. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +16 -14
  194. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js.map +1 -1
  195. package/lib/component/panels/MoleculesPanel/hooks/useAtomAssignment.d.ts.map +1 -1
  196. package/lib/component/panels/MoleculesPanel/hooks/useAtomAssignment.js +27 -18
  197. package/lib/component/panels/MoleculesPanel/hooks/useAtomAssignment.js.map +1 -1
  198. package/lib/component/panels/MoleculesPanel/utilities/getAssignIds.d.ts.map +1 -1
  199. package/lib/component/panels/MoleculesPanel/utilities/getAssignIds.js +0 -3
  200. package/lib/component/panels/MoleculesPanel/utilities/getAssignIds.js.map +1 -1
  201. package/lib/component/panels/RangesPanel/RangesPanel.js +1 -1
  202. package/lib/component/panels/RangesPanel/RangesPanel.js.map +1 -1
  203. package/lib/component/panels/RangesPanel/RangesTable.d.ts.map +1 -1
  204. package/lib/component/panels/RangesPanel/RangesTable.js +1 -1
  205. package/lib/component/panels/RangesPanel/RangesTable.js.map +1 -1
  206. package/lib/component/panels/RangesPanel/RangesTableRow.d.ts.map +1 -1
  207. package/lib/component/panels/RangesPanel/RangesTableRow.js +5 -20
  208. package/lib/component/panels/RangesPanel/RangesTableRow.js.map +1 -1
  209. package/lib/component/panels/RangesPanel/TableColumns/ActionsColumn.d.ts.map +1 -1
  210. package/lib/component/panels/RangesPanel/TableColumns/ActionsColumn.js.map +1 -1
  211. package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentColumn.d.ts +9 -0
  212. package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentColumn.d.ts.map +1 -0
  213. package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentColumn.js +19 -0
  214. package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentColumn.js.map +1 -0
  215. package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.d.ts.map +1 -1
  216. package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.js.map +1 -1
  217. package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.js +2 -2
  218. package/lib/component/panels/SummaryPanel/SummaryPanel.js +6 -6
  219. package/lib/component/panels/SummaryPanel/SummaryPanel.js.map +1 -1
  220. package/lib/component/panels/accordionItems.d.ts.map +1 -1
  221. package/lib/component/panels/accordionItems.js.map +1 -1
  222. package/lib/component/panels/databasePanel/DatabaseInfo.d.ts +5 -0
  223. package/lib/component/panels/databasePanel/DatabaseInfo.d.ts.map +1 -0
  224. package/lib/component/panels/databasePanel/DatabaseInfo.js +29 -0
  225. package/lib/component/panels/databasePanel/DatabaseInfo.js.map +1 -0
  226. package/lib/component/panels/databasePanel/DatabaseTable.d.ts.map +1 -1
  227. package/lib/component/panels/databasePanel/DatabaseTable.js +21 -3
  228. package/lib/component/panels/databasePanel/DatabaseTable.js.map +1 -1
  229. package/lib/component/panels/extra/preferences/NucleusPreferences.d.ts.map +1 -1
  230. package/lib/component/panels/informationPanel/InformationEditionModal.d.ts.map +1 -1
  231. package/lib/component/panels/informationPanel/InformationEditionModal.js +1 -1
  232. package/lib/component/panels/informationPanel/InformationEditionModal.js.map +1 -1
  233. package/lib/component/panels/predictionPanel/PredictionPanel.d.ts.map +1 -1
  234. package/lib/component/panels/predictionPanel/PredictionPanel.js +13 -9
  235. package/lib/component/panels/predictionPanel/PredictionPanel.js.map +1 -1
  236. package/lib/component/reducer/Reducer.js +7 -7
  237. package/lib/component/reducer/Reducer.js.map +1 -1
  238. package/lib/component/reducer/actions/AssignmentsActions.d.ts.map +1 -1
  239. package/lib/component/reducer/actions/AssignmentsActions.js +9 -9
  240. package/lib/component/reducer/actions/AssignmentsActions.js.map +1 -1
  241. package/lib/component/reducer/actions/CorrelationsActions.d.ts.map +1 -1
  242. package/lib/component/reducer/actions/CorrelationsActions.js +21 -21
  243. package/lib/component/reducer/actions/CorrelationsActions.js.map +1 -1
  244. package/lib/component/reducer/actions/DatabaseActions.d.ts.map +1 -1
  245. package/lib/component/reducer/actions/DatabaseActions.js +5 -3
  246. package/lib/component/reducer/actions/DatabaseActions.js.map +1 -1
  247. package/lib/component/reducer/actions/DomainActions.d.ts.map +1 -1
  248. package/lib/component/reducer/actions/DomainActions.js +10 -18
  249. package/lib/component/reducer/actions/DomainActions.js.map +1 -1
  250. package/lib/component/reducer/actions/FiltersActions.d.ts.map +1 -1
  251. package/lib/component/reducer/actions/FiltersActions.js +28 -44
  252. package/lib/component/reducer/actions/FiltersActions.js.map +1 -1
  253. package/lib/component/reducer/actions/InsetActions.d.ts.map +1 -1
  254. package/lib/component/reducer/actions/InsetActions.js +9 -18
  255. package/lib/component/reducer/actions/InsetActions.js.map +1 -1
  256. package/lib/component/reducer/actions/IntegralsActions.d.ts +1 -1
  257. package/lib/component/reducer/actions/IntegralsActions.d.ts.map +1 -1
  258. package/lib/component/reducer/actions/IntegralsActions.js +43 -48
  259. package/lib/component/reducer/actions/IntegralsActions.js.map +1 -1
  260. package/lib/component/reducer/actions/MoleculeActions.d.ts +2 -1
  261. package/lib/component/reducer/actions/MoleculeActions.d.ts.map +1 -1
  262. package/lib/component/reducer/actions/MoleculeActions.js +64 -10
  263. package/lib/component/reducer/actions/MoleculeActions.js.map +1 -1
  264. package/lib/component/reducer/actions/PeaksActions.d.ts.map +1 -1
  265. package/lib/component/reducer/actions/PeaksActions.js +110 -121
  266. package/lib/component/reducer/actions/PeaksActions.js.map +1 -1
  267. package/lib/component/reducer/actions/PreferencesActions.d.ts.map +1 -1
  268. package/lib/component/reducer/actions/PreferencesActions.js +2 -1
  269. package/lib/component/reducer/actions/PreferencesActions.js.map +1 -1
  270. package/lib/component/reducer/actions/RangesActions.d.ts +18 -18
  271. package/lib/component/reducer/actions/RangesActions.d.ts.map +1 -1
  272. package/lib/component/reducer/actions/RangesActions.js +148 -171
  273. package/lib/component/reducer/actions/RangesActions.js.map +1 -1
  274. package/lib/component/reducer/actions/SpectraActions.d.ts.map +1 -1
  275. package/lib/component/reducer/actions/SpectraActions.js +29 -31
  276. package/lib/component/reducer/actions/SpectraActions.js.map +1 -1
  277. package/lib/component/reducer/actions/ToolsActions.d.ts.map +1 -1
  278. package/lib/component/reducer/actions/ToolsActions.js +10 -11
  279. package/lib/component/reducer/actions/ToolsActions.js.map +1 -1
  280. package/lib/component/reducer/actions/ZonesActions.d.ts +8 -9
  281. package/lib/component/reducer/actions/ZonesActions.d.ts.map +1 -1
  282. package/lib/component/reducer/actions/ZonesActions.js +123 -151
  283. package/lib/component/reducer/actions/ZonesActions.js.map +1 -1
  284. package/lib/component/reducer/helper/get2DRange.d.ts +3 -1
  285. package/lib/component/reducer/helper/get2DRange.d.ts.map +1 -1
  286. package/lib/component/reducer/helper/get2DRange.js.map +1 -1
  287. package/lib/component/reducer/helper/getSpectrum.js +1 -1
  288. package/lib/component/reducer/helper/getSpectrum.js.map +1 -1
  289. package/lib/component/reducer/helper/setIntegralsViewProperty.js +1 -1
  290. package/lib/component/reducer/helper/setIntegralsViewProperty.js.map +1 -1
  291. package/lib/component/reducer/helper/setRangesViewProperty.js +1 -1
  292. package/lib/component/reducer/helper/setRangesViewProperty.js.map +1 -1
  293. package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js +1 -1
  294. package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js.map +1 -1
  295. package/lib/component/toolbar/ToolBar.d.ts.map +1 -1
  296. package/lib/component/toolbar/ToolBar.js +5 -1
  297. package/lib/component/toolbar/ToolBar.js.map +1 -1
  298. package/lib/component/toolbar/ToolTypes.js +1 -1
  299. package/lib/component/toolbar/ToolTypes.js.map +1 -1
  300. package/lib/component/useWatchForm.d.ts.map +1 -1
  301. package/lib/component/useWatchForm.js.map +1 -1
  302. package/lib/component/utility/filterDatabaseInfoEntry.d.ts +3 -0
  303. package/lib/component/utility/filterDatabaseInfoEntry.d.ts.map +1 -0
  304. package/lib/component/utility/filterDatabaseInfoEntry.js +9 -0
  305. package/lib/component/utility/filterDatabaseInfoEntry.js.map +1 -0
  306. package/lib/component/utility/stackOverlappingLabels.d.ts +1 -1
  307. package/lib/component/utility/stackOverlappingLabels.d.ts.map +1 -1
  308. package/lib/component/utility/stackOverlappingLabels.js.map +1 -1
  309. package/lib/component/workspaces/prediction.js +1 -1
  310. package/lib/component/workspaces/prediction.js.map +1 -1
  311. package/lib/component/workspaces/simulation.js +1 -1
  312. package/lib/component/workspaces/simulation.js.map +1 -1
  313. package/lib/component/workspaces/workspaceDefaultProperties.js +1 -1
  314. package/lib/component/workspaces/workspaceDefaultProperties.js.map +1 -1
  315. package/lib/data/SpectraManager.d.ts.map +1 -1
  316. package/lib/data/SpectraManager.js.map +1 -1
  317. package/lib/data/data1d/Spectrum1D/isRangeAssigned.d.ts.map +1 -1
  318. package/lib/data/data1d/Spectrum1D/isRangeAssigned.js +0 -3
  319. package/lib/data/data1d/Spectrum1D/isRangeAssigned.js.map +1 -1
  320. package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.d.ts +8 -1
  321. package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.d.ts.map +1 -1
  322. package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.js +1 -2
  323. package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.js.map +1 -1
  324. package/lib/data/data1d/Spectrum1D/ranges/changeRangeSignal.d.ts +2 -2
  325. package/lib/data/data1d/Spectrum1D/ranges/changeRangeSignal.js +3 -3
  326. package/lib/data/data1d/Spectrum1D/ranges/detectRanges.d.ts +4 -14
  327. package/lib/data/data1d/Spectrum1D/ranges/detectRanges.d.ts.map +1 -1
  328. package/lib/data/data1d/Spectrum1D/ranges/detectRanges.js +1 -1
  329. package/lib/data/data1d/Spectrum1D/ranges/detectRanges.js.map +1 -1
  330. package/lib/data/data1d/Spectrum1D/ranges/detectSignalsByMultipletAnalysis.d.ts.map +1 -1
  331. package/lib/data/data1d/Spectrum1D/ranges/detectSignalsByMultipletAnalysis.js +2 -1
  332. package/lib/data/data1d/Spectrum1D/ranges/detectSignalsByMultipletAnalysis.js.map +1 -1
  333. package/lib/data/data2d/Spectrum2D/initiateDatum2D.js.map +1 -1
  334. package/lib/data/data2d/Spectrum2D/zones/changeZoneSignal.d.ts +3 -5
  335. package/lib/data/data2d/Spectrum2D/zones/changeZoneSignal.d.ts.map +1 -1
  336. package/lib/data/data2d/Spectrum2D/zones/changeZoneSignal.js +3 -5
  337. package/lib/data/data2d/Spectrum2D/zones/changeZoneSignal.js.map +1 -1
  338. package/lib/data/data2d/Spectrum2D/zones/detectZones.d.ts +2 -1
  339. package/lib/data/data2d/Spectrum2D/zones/detectZones.d.ts.map +1 -1
  340. package/lib/data/data2d/Spectrum2D/zones/detectZones.js.map +1 -1
  341. package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.d.ts +7 -63
  342. package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.d.ts.map +1 -1
  343. package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.js +9 -14
  344. package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.js.map +1 -1
  345. package/lib/data/data2d/Spectrum2D/zones/getDetectionZones.d.ts +2 -10
  346. package/lib/data/data2d/Spectrum2D/zones/getDetectionZones.d.ts.map +1 -1
  347. package/lib/data/data2d/Spectrum2D/zones/getDetectionZones.js +23 -43
  348. package/lib/data/data2d/Spectrum2D/zones/getDetectionZones.js.map +1 -1
  349. package/lib/data/data2d/Spectrum2D/zones/initiateZones.d.ts +1 -54
  350. package/lib/data/data2d/Spectrum2D/zones/initiateZones.d.ts.map +1 -1
  351. package/lib/data/data2d/Spectrum2D/zones/initiateZones.js +1 -1
  352. package/lib/data/data2d/Spectrum2D/zones/initiateZones.js.map +1 -1
  353. package/lib/data/molecules/Molecule.d.ts.map +1 -1
  354. package/lib/data/molecules/Molecule.js.map +1 -1
  355. package/lib/data/molecules/MoleculeManager.d.ts +2 -1
  356. package/lib/data/molecules/MoleculeManager.d.ts.map +1 -1
  357. package/lib/data/molecules/MoleculeManager.js +30 -3
  358. package/lib/data/molecules/MoleculeManager.js.map +1 -1
  359. package/lib/data/types/data1d/RangeDetectionResult.d.ts.map +1 -1
  360. package/lib/data/utilities/FindUtilities.d.ts.map +1 -1
  361. package/lib/data/utilities/FindUtilities.js +11 -11
  362. package/lib/data/utilities/FindUtilities.js.map +1 -1
  363. package/lib/utils/clipboard/clipboardComponents.d.ts.map +1 -1
  364. package/lib/utils/clipboard/clipboardComponents.js.map +1 -1
  365. package/lib/utils/clipboard/clipboardHooks.d.ts +2 -2
  366. package/lib/utils/clipboard/clipboardHooks.d.ts.map +1 -1
  367. package/lib/utils/clipboard/clipboardHooks.js +8 -2
  368. package/lib/utils/clipboard/clipboardHooks.js.map +1 -1
  369. package/lib/versionInfo.d.ts.map +1 -1
  370. package/lib/versionInfo.js +1 -1
  371. package/lib/versionInfo.js.map +1 -1
  372. package/package.json +28 -25
  373. package/src/component/1d/ApodizationLine.tsx +1 -1
  374. package/src/component/1d/BrushTracker1D.tsx +10 -10
  375. package/src/component/1d/FooterBanner.tsx +2 -2
  376. package/src/component/1d/LinesSeries.tsx +2 -2
  377. package/src/component/1d/SVGContent1D.tsx +6 -2
  378. package/src/component/1d/SimilarityTree.tsx +3 -2
  379. package/src/component/1d/inset/InsetProvider.tsx +4 -2
  380. package/src/component/1d/integral/IntegralResizable.tsx +2 -1
  381. package/src/component/1d/matrix/Boxplot.tsx +3 -3
  382. package/src/component/1d/multiAnalysis/AnalysisRange.tsx +2 -1
  383. package/src/component/1d/multiplicityTree/MultiplicityTree.tsx +24 -23
  384. package/src/component/1d/multiplicityTree/generateTreeNodes.ts +10 -1
  385. package/src/component/1d/peaks/PeakAnnotationsSpreadMode.tsx +4 -2
  386. package/src/component/1d/peaks/PeakEditionManager.tsx +8 -3
  387. package/src/component/1d/peaks/Peaks.tsx +5 -1
  388. package/src/component/1d/ranges/AssignmentLabel.tsx +8 -5
  389. package/src/component/1d/ranges/Atoms.tsx +2 -2
  390. package/src/component/1d/ranges/Range.tsx +42 -74
  391. package/src/component/1d/ranges/Ranges.tsx +33 -28
  392. package/src/component/1d/ranges/useAssignmentsPopoverActionsButtons.tsx +93 -0
  393. package/src/component/1d/tool/BaseLineZones.tsx +2 -1
  394. package/src/component/1d/utilities/intersectionResolver.ts +3 -4
  395. package/src/component/1d-2d/FieldEdition.tsx +2 -2
  396. package/src/component/2d/1d-tracer/VerticalSliceChart.tsx +2 -2
  397. package/src/component/2d/1d-tracer/phase-correction-traces/PhaseTraces.tsx +1 -1
  398. package/src/component/2d/1d-tracer/phase-correction-traces/SpectrumPhaseTrace.tsx +1 -1
  399. package/src/component/2d/BrushTracker2D.tsx +50 -55
  400. package/src/component/2d/FooterBanner.tsx +80 -105
  401. package/src/component/2d/SVGContent2D.tsx +2 -3
  402. package/src/component/2d/SlicingView.tsx +1 -1
  403. package/src/component/2d/Viewer2D.tsx +2 -2
  404. package/src/component/2d/ft/FTContainer.tsx +4 -5
  405. package/src/component/2d/tools/XYLabelPointer.tsx +12 -11
  406. package/src/component/2d/useTracesSpectra.ts +26 -13
  407. package/src/component/2d/utilities/extractSpectrumSignals.ts +2 -2
  408. package/src/component/2d/zones/Signal.tsx +1 -1
  409. package/src/component/2d/zones/SignalsGuideLines.tsx +21 -19
  410. package/src/component/2d/zones/ZonesAssignmentsLabels.tsx +4 -4
  411. package/src/component/EventsTrackers/BrushTracker.tsx +24 -17
  412. package/src/component/EventsTrackers/KeysListenerTracker.tsx +6 -0
  413. package/src/component/assignment/utilities/getAssignments.ts +1 -2
  414. package/src/component/context/KeyModifierContext.tsx +13 -5
  415. package/src/component/elements/ActionsButtonsPopover.tsx +25 -8
  416. package/src/component/elements/AssignmentsCell.tsx +1 -2
  417. package/src/component/elements/Button.tsx +3 -2
  418. package/src/component/elements/CheckController.tsx +2 -1
  419. package/src/component/elements/ContextMenuBluePrint.tsx +2 -1
  420. package/src/component/elements/D3Axis.tsx +3 -3
  421. package/src/component/elements/DraggableDialog.tsx +2 -1
  422. package/src/component/elements/Input.tsx +4 -2
  423. package/src/component/elements/Input2.tsx +1 -2
  424. package/src/component/elements/Input2Controller.tsx +2 -1
  425. package/src/component/elements/Label.tsx +2 -1
  426. package/src/component/elements/NumberInput2.tsx +4 -2
  427. package/src/component/elements/NumberInput2Controller.tsx +3 -1
  428. package/src/component/elements/ReactTable/ReactTable.tsx +1 -3
  429. package/src/component/elements/ReadOnly.tsx +4 -2
  430. package/src/component/elements/Sections.tsx +5 -4
  431. package/src/component/elements/Select.tsx +4 -2
  432. package/src/component/elements/ToolbarPopoverItem.tsx +3 -3
  433. package/src/component/elements/export/ExportContent.tsx +1 -2
  434. package/src/component/elements/print/PrintContent.tsx +1 -2
  435. package/src/component/hooks/useActiveSpectrumIntegralsViewState.ts +2 -6
  436. package/src/component/hooks/useActiveSpectrumPeaksViewState.ts +2 -6
  437. package/src/component/hooks/useActiveSpectrumRangesViewState.ts +2 -6
  438. package/src/component/hooks/useActiveSpectrumStyleOptions.ts +2 -2
  439. package/src/component/hooks/useActiveSpectrumZonesViewState.ts +2 -6
  440. package/src/component/hooks/useExport.tsx +1 -1
  441. package/src/component/hooks/useSaveSettings.tsx +68 -81
  442. package/src/component/hooks/useSetActiveSpectrumAction.ts +3 -2
  443. package/src/component/hooks/useSpectrumWithDataSource.ts +1 -1
  444. package/src/component/hooks/useWorkspaceAction.ts +5 -0
  445. package/src/component/modal/ImportPublicationStringModal.tsx +1 -2
  446. package/src/component/modal/MultipletAnalysisModal.tsx +1 -1
  447. package/src/component/modal/changeSum/ChangeSumModal.tsx +4 -2
  448. package/src/component/modal/metaImportation/MetaImportationModal.tsx +1 -2
  449. package/src/component/modal/setting/GeneralSettings.tsx +7 -2
  450. package/src/component/modal/setting/settings-tabs/ToolsTabContent.tsx +1 -1
  451. package/src/component/panels/IntegralsPanel/IntegralTable.tsx +4 -2
  452. package/src/component/panels/MoleculesPanel/MoleculePanelHeader.tsx +24 -18
  453. package/src/component/panels/MoleculesPanel/hooks/useAtomAssignment.tsx +32 -16
  454. package/src/component/panels/MoleculesPanel/utilities/getAssignIds.ts +0 -4
  455. package/src/component/panels/RangesPanel/RangesPanel.tsx +1 -1
  456. package/src/component/panels/RangesPanel/RangesTable.tsx +3 -8
  457. package/src/component/panels/RangesPanel/RangesTableRow.tsx +14 -47
  458. package/src/component/panels/RangesPanel/TableColumns/ActionsColumn.tsx +1 -2
  459. package/src/component/panels/RangesPanel/TableColumns/SignalAssignmentColumn.tsx +40 -0
  460. package/src/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.tsx +1 -2
  461. package/src/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.tsx +2 -2
  462. package/src/component/panels/SummaryPanel/SummaryPanel.tsx +6 -6
  463. package/src/component/panels/accordionItems.tsx +4 -2
  464. package/src/component/panels/databasePanel/DatabaseInfo.tsx +43 -0
  465. package/src/component/panels/databasePanel/DatabaseTable.tsx +33 -1
  466. package/src/component/panels/extra/preferences/NucleusPreferences.tsx +2 -2
  467. package/src/component/panels/informationPanel/InformationEditionModal.tsx +6 -2
  468. package/src/component/panels/predictionPanel/PredictionPanel.tsx +17 -9
  469. package/src/component/reducer/Reducer.ts +8 -8
  470. package/src/component/reducer/actions/AssignmentsActions.ts +8 -13
  471. package/src/component/reducer/actions/CorrelationsActions.ts +21 -22
  472. package/src/component/reducer/actions/DatabaseActions.ts +5 -3
  473. package/src/component/reducer/actions/DomainActions.ts +16 -22
  474. package/src/component/reducer/actions/FiltersActions.ts +34 -58
  475. package/src/component/reducer/actions/InsetActions.ts +9 -19
  476. package/src/component/reducer/actions/IntegralsActions.ts +48 -59
  477. package/src/component/reducer/actions/MoleculeActions.ts +94 -14
  478. package/src/component/reducer/actions/PeaksActions.ts +112 -136
  479. package/src/component/reducer/actions/PreferencesActions.ts +4 -3
  480. package/src/component/reducer/actions/RangesActions.ts +196 -244
  481. package/src/component/reducer/actions/SpectraActions.ts +40 -45
  482. package/src/component/reducer/actions/ToolsActions.ts +9 -13
  483. package/src/component/reducer/actions/ZonesActions.ts +158 -218
  484. package/src/component/reducer/helper/get2DRange.ts +4 -1
  485. package/src/component/reducer/helper/getSpectrum.ts +1 -1
  486. package/src/component/reducer/helper/setIntegralsViewProperty.ts +1 -1
  487. package/src/component/reducer/helper/setRangesViewProperty.ts +1 -1
  488. package/src/component/reducer/preferences/panelsPreferencesDefaultValues.ts +1 -1
  489. package/src/component/toolbar/ToolBar.tsx +6 -1
  490. package/src/component/toolbar/ToolTypes.ts +1 -1
  491. package/src/component/useWatchForm.tsx +2 -1
  492. package/src/component/utility/filterDatabaseInfoEntry.ts +10 -0
  493. package/src/component/utility/stackOverlappingLabels.ts +4 -1
  494. package/src/component/workspaces/prediction.ts +1 -1
  495. package/src/component/workspaces/simulation.ts +1 -1
  496. package/src/component/workspaces/workspaceDefaultProperties.ts +1 -1
  497. package/src/data/SpectraManager.ts +0 -2
  498. package/src/data/data1d/Spectrum1D/isRangeAssigned.ts +0 -4
  499. package/src/data/data1d/Spectrum1D/ranges/autoRangesDetection.ts +15 -5
  500. package/src/data/data1d/Spectrum1D/ranges/changeRangeSignal.ts +5 -5
  501. package/src/data/data1d/Spectrum1D/ranges/detectRanges.ts +5 -14
  502. package/src/data/data1d/Spectrum1D/ranges/detectSignalsByMultipletAnalysis.ts +2 -1
  503. package/src/data/data2d/Spectrum2D/initiateDatum2D.ts +2 -2
  504. package/src/data/data2d/Spectrum2D/zones/changeZoneSignal.ts +3 -5
  505. package/src/data/data2d/Spectrum2D/zones/detectZones.ts +3 -2
  506. package/src/data/data2d/Spectrum2D/zones/detectZonesManual.ts +19 -16
  507. package/src/data/data2d/Spectrum2D/zones/getDetectionZones.ts +35 -56
  508. package/src/data/data2d/Spectrum2D/zones/initiateZones.ts +1 -1
  509. package/src/data/molecules/Molecule.ts +2 -1
  510. package/src/data/molecules/MoleculeManager.ts +40 -4
  511. package/src/data/types/data1d/RangeDetectionResult.ts +4 -2
  512. package/src/data/utilities/FindUtilities.ts +9 -8
  513. package/src/utils/clipboard/clipboardComponents.tsx +2 -1
  514. package/src/utils/clipboard/clipboardHooks.ts +12 -6
  515. package/src/versionInfo.ts +1 -1
  516. package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentColumn.d.ts +0 -8
  517. package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentColumn.d.ts.map +0 -1
  518. package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentColumn.js +0 -17
  519. package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentColumn.js.map +0 -1
  520. package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.d.ts +0 -17
  521. package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.d.ts.map +0 -1
  522. package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +0 -40
  523. package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js.map +0 -1
  524. package/src/component/panels/RangesPanel/TableColumns/RangeAssignmentColumn.tsx +0 -36
  525. package/src/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.tsx +0 -89
@@ -1,4 +1,3 @@
1
- import type { Spectrum1D } from '@zakodium/nmrium-core';
2
1
  import { xFindClosestIndex } from 'ml-spectra-processing';
3
2
  import { Fragment, useMemo } from 'react';
4
3
  import { MF } from 'react-mf';
@@ -16,13 +15,14 @@ import { useActiveSpectrum } from '../hooks/useActiveSpectrum.js';
16
15
  import { useFormatNumberByNucleus } from '../hooks/useFormatNumberByNucleus.js';
17
16
  import { options } from '../toolbar/ToolTypes.js';
18
17
 
18
+ import type { Spectrum1DTraces } from './useTracesSpectra.ts';
19
19
  import type { Get2DDimensionLayoutReturn } from './utilities/DimensionLayout.js';
20
20
  import { LAYOUT, getLayoutID } from './utilities/DimensionLayout.js';
21
21
  import { get1DYScale, get2DXScale, get2DYScale } from './utilities/scale.js';
22
22
 
23
23
  interface FooterBannerProps {
24
24
  layout: Get2DDimensionLayoutReturn;
25
- data1D: Spectrum1D[];
25
+ data1D: Spectrum1DTraces;
26
26
  }
27
27
 
28
28
  export default function FooterBanner(props: FooterBannerProps) {
@@ -54,156 +54,131 @@ export default function FooterBanner(props: FooterBannerProps) {
54
54
 
55
55
  const nuclei = activeTab.split(',');
56
56
  const [formatX, formatY] = useFormatNumberByNucleus(nuclei);
57
+ const hasTraces = data1D.x || data1D.y;
57
58
 
58
59
  const scaleX = useMemo(() => {
59
- if (data1D.length === 0) {
60
- return get2DXScale({ width, margin, xDomain, mode });
60
+ if (selectedTool === options.slicing.id || !trackID) {
61
+ return null;
61
62
  }
62
- if (selectedTool !== options.slicing.id) {
63
- switch (trackID) {
64
- case LAYOUT.top:
65
- case LAYOUT.main: {
66
- return get2DXScale({ width, margin, xDomain, mode });
67
- }
68
- case LAYOUT.left: {
69
- return get2DYScale({ height, margin, yDomain });
70
- }
71
- default:
72
- return null;
73
- }
63
+
64
+ if (!hasTraces || trackID === 'MAIN' || trackID === 'TOP') {
65
+ return get2DXScale({ width, margin, xDomain, mode });
74
66
  }
75
- return null;
67
+
68
+ return get2DYScale({ height, margin, yDomain });
76
69
  }, [
77
- data1D,
78
- height,
79
- margin,
70
+ hasTraces,
80
71
  selectedTool,
81
- trackID,
82
72
  width,
73
+ margin,
83
74
  xDomain,
84
- yDomain,
85
75
  mode,
76
+ trackID,
77
+ height,
78
+ yDomain,
86
79
  ]);
87
80
 
88
81
  const scaleY = useMemo(() => {
89
- if (data1D.length === 0) {
82
+ if (selectedTool === options.slicing.id || !trackID) {
83
+ return null;
84
+ }
85
+
86
+ if (!hasTraces || trackID === 'MAIN') {
90
87
  return get2DYScale({ height, margin, yDomain });
91
88
  }
92
- if (selectedTool !== options.slicing.id) {
93
- switch (trackID) {
94
- case LAYOUT.main: {
95
- return get2DYScale({ height, margin, yDomain });
96
- }
97
- case LAYOUT.top: {
98
- return data1D[0]
99
- ? get1DYScale(yDomains[data1D[0].id], margin.top)
100
- : null;
101
- }
102
- case LAYOUT.left: {
103
- return data1D[1]
104
- ? get1DYScale(yDomains[data1D[1].id], margin.left)
105
- : null;
106
- }
107
- default:
108
- return null;
109
- }
89
+
90
+ if (trackID === 'TOP') {
91
+ return data1D.x ? get1DYScale(yDomains[data1D.x.id], margin.top) : null;
110
92
  }
111
- return null;
112
- }, [data1D, height, margin, selectedTool, trackID, yDomain, yDomains]);
113
93
 
94
+ return data1D.y ? get1DYScale(yDomains[data1D.y.id], margin.left) : null;
95
+ }, [
96
+ data1D.x,
97
+ data1D.y,
98
+ hasTraces,
99
+ height,
100
+ margin,
101
+ selectedTool,
102
+ trackID,
103
+ yDomain,
104
+ yDomains,
105
+ ]);
114
106
  if (
115
107
  !activeSpectrum ||
116
108
  !position ||
117
109
  position.y < 10 ||
118
110
  position.x < 10 ||
119
111
  position.x > width - margin.right ||
120
- position.y > height - margin.bottom ||
121
- !data1D
112
+ position.y > height - margin.bottom
122
113
  ) {
123
114
  return <FooterContainer />;
124
115
  }
125
- const getRealYValue = (coordinate: any) => {
126
- let index: number | null = null;
116
+ const getRealYValue = (coordinate: number) => {
117
+ let axis: 'x' | 'y' | null = null;
127
118
  if (trackID === LAYOUT.top) {
128
- index = 0;
119
+ axis = 'x';
129
120
  } else if (trackID === LAYOUT.left) {
130
- index = 1;
121
+ axis = 'y';
131
122
  }
132
- if (index != null && scaleX != null && data1D[index]) {
133
- const datum = get1DDataXY(data1D[index]);
134
- const xIndex = xFindClosestIndex(datum.x, scaleX.invert(coordinate));
135
- return datum.y[xIndex];
123
+ const spectrum = axis && data1D[axis];
124
+
125
+ if (!scaleX || !spectrum) {
126
+ return 1;
136
127
  }
137
- return 1;
128
+
129
+ const datum = get1DDataXY(spectrum);
130
+ const xIndex = xFindClosestIndex(datum.x, scaleX.invert(coordinate));
131
+ return datum.y[xIndex];
138
132
  };
139
133
 
140
134
  const getXValue = (x: number | null = null) => {
141
- if (scaleX != null) {
142
- switch (trackID) {
143
- case LAYOUT.main:
144
- case LAYOUT.top: {
145
- return scaleX.invert(x || position.x);
146
- }
147
- case LAYOUT.left: {
148
- return scaleX.invert(x || position.y);
149
- }
150
- default:
151
- return 0;
152
- }
135
+ if (!scaleX || !trackID) return 0;
136
+
137
+ if (trackID === 'MAIN') {
138
+ return scaleX.invert(x || position.y);
153
139
  }
154
- return 0;
140
+ // return if the trackID = "MAIN" | "TOP"
141
+ return scaleX.invert(x || position.x);
155
142
  };
156
143
 
157
144
  const getYValue = () => {
158
- if (scaleY != null) {
159
- switch (trackID) {
160
- case LAYOUT.main:
161
- case LAYOUT.top: {
162
- return scaleY.invert(position.y);
163
- }
164
- case LAYOUT.left: {
165
- return scaleY.invert(position.x);
166
- }
167
- default:
168
- return 0;
169
- }
145
+ if (!scaleY || !trackID) return 0;
146
+
147
+ if (trackID === 'LEFT') {
148
+ return scaleY.invert(position.x);
170
149
  }
171
- return 0;
150
+
151
+ return scaleY.invert(position.y);
172
152
  };
173
153
 
174
154
  const getRation = () => {
175
- switch (trackID) {
176
- case LAYOUT.top: {
177
- return (
178
- (getRealYValue(startX) / (getRealYValue(endX) || Number.MIN_VALUE)) *
179
- 100
180
- ).toFixed(2);
181
- }
182
- case LAYOUT.left: {
183
- return (
184
- (getRealYValue(startY) / (getRealYValue(endY) || Number.MIN_VALUE)) *
185
- 100
186
- ).toFixed(2);
187
- }
188
- default:
189
- return 0;
155
+ if (!trackID || trackID === 'MAIN') return 0;
156
+
157
+ if (trackID === 'TOP') {
158
+ return (
159
+ (getRealYValue(startX) / (getRealYValue(endX) || Number.MIN_VALUE)) *
160
+ 100
161
+ ).toFixed(2);
190
162
  }
163
+
164
+ // tracKId = "LEFT"
165
+ return (
166
+ (getRealYValue(startY) / (getRealYValue(endY) || Number.MIN_VALUE)) *
167
+ 100
168
+ ).toFixed(2);
191
169
  };
192
170
 
193
171
  const getDeltaX = () => {
194
- switch (trackID) {
195
- case LAYOUT.top: {
196
- return (getXValue(startX) - getXValue(endX)).toPrecision(6);
197
- }
198
- case LAYOUT.left: {
199
- return (getXValue(startY) - getXValue(endY)).toPrecision(6);
200
- }
201
- default:
202
- return 0;
172
+ if (!trackID || trackID === 'MAIN') return 0;
173
+
174
+ if (trackID === 'TOP') {
175
+ return (getXValue(startX) - getXValue(endX)).toPrecision(6);
203
176
  }
177
+
178
+ return (getXValue(startY) - getXValue(endY)).toPrecision(6);
204
179
  };
205
180
 
206
- const getLabel = (label2d: any, label1d: any, nucleus: any) => {
181
+ const getLabel = (label2d: string, label1d: string, nucleus: string) => {
207
182
  return trackID === LAYOUT.main ? (
208
183
  <Fragment>
209
184
  {label2d} ( <MF mf={nucleus} /> )
@@ -1,5 +1,3 @@
1
- import type { Spectrum1D } from '@zakodium/nmrium-core';
2
-
3
1
  import { ClipPathContainer } from '../1d-2d/components/ClipPathContainer.js';
4
2
  import SpectrumInfoBlock from '../1d-2d/components/SpectrumInfoBlock.js';
5
3
  import { ShareDataProvider } from '../context/ShareDataContext.js';
@@ -8,12 +6,13 @@ import XAxis from './XAxis.js';
8
6
  import YAxis from './YAxis.js';
9
7
  import { FidContainer } from './fid/FidContainer.js';
10
8
  import { FTContainer } from './ft/FTContainer.js';
9
+ import type { Spectrum1DTraces } from './useTracesSpectra.ts';
11
10
  import { SignalsGuideLines } from './zones/SignalsGuideLines.js';
12
11
  import Zones from './zones/Zones.js';
13
12
  import ZonesAssignmentsLabels from './zones/ZonesAssignmentsLabels.js';
14
13
 
15
14
  interface Chart2DProps {
16
- spectra?: Spectrum1D[];
15
+ spectra: Spectrum1DTraces;
17
16
  }
18
17
 
19
18
  export function SVGContent2D({ spectra }: Chart2DProps) {
@@ -16,7 +16,7 @@ function SlicingView() {
16
16
  const scale2dX = useScale2DX();
17
17
  const scale2dY = useScale2DY();
18
18
 
19
- if (!position || !activeSpectrum?.id) {
19
+ if (!position || !activeSpectrum) {
20
20
  return null;
21
21
  }
22
22
 
@@ -65,7 +65,7 @@ function Viewer2D(props: Viewer2DProps) {
65
65
  <XYLabelPointer data1D={spectrumData} layout={DIMENSION} />
66
66
 
67
67
  <>
68
- {spectrumData[0] && (
68
+ {spectrumData.x && (
69
69
  <BrushXY
70
70
  axis="X"
71
71
  dimensionBorder={DIMENSION.TOP}
@@ -73,7 +73,7 @@ function Viewer2D(props: Viewer2DProps) {
73
73
  margin={{ ...margin, top: 0, bottom: 0 }}
74
74
  />
75
75
  )}
76
- {spectrumData[1] && (
76
+ {spectrumData.y && (
77
77
  <BrushXY
78
78
  axis="Y"
79
79
  dimensionBorder={DIMENSION.LEFT}
@@ -1,15 +1,14 @@
1
- import type { Spectrum1D } from '@zakodium/nmrium-core';
2
-
3
1
  import { isFt2DSpectrum } from '../../../data/data2d/Spectrum2D/isSpectrum2D.js';
4
2
  import { ClipPathContainer } from '../../1d-2d/components/ClipPathContainer.js';
5
3
  import useSpectrum from '../../hooks/useSpectrum.js';
6
4
  import Left1DChart from '../1d-tracer/Left1DChart.js';
7
5
  import Top1DChart from '../1d-tracer/Top1DChart.js';
6
+ import type { Spectrum1DTraces } from '../useTracesSpectra.ts';
8
7
 
9
8
  import Contours from './Contours.js';
10
9
 
11
10
  interface FTContainerProps {
12
- spectra?: Spectrum1D[];
11
+ spectra: Spectrum1DTraces;
13
12
  }
14
13
 
15
14
  export function FTContainer(props: FTContainerProps) {
@@ -23,8 +22,8 @@ export function FTContainer(props: FTContainerProps) {
23
22
 
24
23
  return (
25
24
  <>
26
- {spectra?.[0] && <Top1DChart data={spectra[0]} />}
27
- {spectra?.[1] && <Left1DChart data={spectra[1]} />}
25
+ {spectra.x && <Top1DChart data={spectra.x} />}
26
+ {spectra.y && <Left1DChart data={spectra.y} />}
28
27
  <ClipPathContainer>
29
28
  <Contours />
30
29
  </ClipPathContainer>
@@ -1,4 +1,3 @@
1
- import type { Spectrum1D } from '@zakodium/nmrium-core';
2
1
  import type { CSSProperties } from 'react';
3
2
  import { useMemo } from 'react';
4
3
 
@@ -7,6 +6,7 @@ import { useMouseTracker } from '../../EventsTrackers/MouseTracker.js';
7
6
  import { useChartData } from '../../context/ChartContext.js';
8
7
  import { useActiveSpectrum } from '../../hooks/useActiveSpectrum.js';
9
8
  import { useFormatNumberByNucleus } from '../../hooks/useFormatNumberByNucleus.js';
9
+ import type { Spectrum1DTraces } from '../useTracesSpectra.ts';
10
10
  import type { Get2DDimensionLayoutReturn } from '../utilities/DimensionLayout.js';
11
11
  import { LAYOUT, getLayoutID } from '../utilities/DimensionLayout.js';
12
12
  import { get1DYScale, useScale2DX, useScale2DY } from '../utilities/scale.js';
@@ -24,7 +24,7 @@ const style: CSSProperties = {
24
24
 
25
25
  interface XYLabelPointerProps {
26
26
  layout: Get2DDimensionLayoutReturn;
27
- data1D: Spectrum1D[];
27
+ data1D: Spectrum1DTraces;
28
28
  }
29
29
 
30
30
  export default function XYLabelPointer(props: XYLabelPointerProps) {
@@ -53,9 +53,10 @@ export default function XYLabelPointer(props: XYLabelPointerProps) {
53
53
  const [formatX, formatY] = useFormatNumberByNucleus(nuclei);
54
54
  const scale2DX = useScale2DX();
55
55
  const scale2DY = useScale2DY();
56
+ const hasTraces = data1D.x || data1D.y;
56
57
 
57
58
  const scaleX = useMemo(() => {
58
- if (!activeSpectrum || data1D.length === 0) {
59
+ if (!activeSpectrum || !hasTraces) {
59
60
  return scale2DX;
60
61
  }
61
62
 
@@ -70,10 +71,10 @@ export default function XYLabelPointer(props: XYLabelPointerProps) {
70
71
  default:
71
72
  return null;
72
73
  }
73
- }, [activeSpectrum, data1D, scale2DX, scale2DY, trackID]);
74
+ }, [activeSpectrum, hasTraces, scale2DX, scale2DY, trackID]);
74
75
 
75
76
  const scaleY = useMemo(() => {
76
- if (!activeSpectrum || data1D.length === 0) {
77
+ if (!activeSpectrum || !hasTraces) {
77
78
  return scale2DY;
78
79
  }
79
80
  switch (trackID) {
@@ -81,13 +82,11 @@ export default function XYLabelPointer(props: XYLabelPointerProps) {
81
82
  return scale2DY;
82
83
  }
83
84
  case LAYOUT.top: {
84
- return data1D[0]
85
- ? get1DYScale(yDomains[data1D[0].id], margin.top)
86
- : null;
85
+ return data1D.x ? get1DYScale(yDomains[data1D.x.id], margin.top) : null;
87
86
  }
88
87
  case LAYOUT.left: {
89
- return data1D[1]
90
- ? get1DYScale(yDomains[data1D[1].id], margin.left)
88
+ return data1D.y
89
+ ? get1DYScale(yDomains[data1D.y.id], margin.left)
91
90
  : null;
92
91
  }
93
92
  default:
@@ -95,7 +94,9 @@ export default function XYLabelPointer(props: XYLabelPointerProps) {
95
94
  }
96
95
  }, [
97
96
  activeSpectrum,
98
- data1D,
97
+ data1D.x,
98
+ data1D.y,
99
+ hasTraces,
99
100
  margin.left,
100
101
  margin.top,
101
102
  scale2DY,
@@ -5,6 +5,7 @@ import type {
5
5
  } from '@zakodium/nmrium-core';
6
6
  import { useMemo } from 'react';
7
7
 
8
+ import { isFt1DSpectrum } from '../../data/data1d/Spectrum1D/isSpectrum1D.ts';
8
9
  import { useChartData } from '../context/ChartContext.js';
9
10
 
10
11
  export interface GetTracesSpectraOptions {
@@ -13,23 +14,35 @@ export interface GetTracesSpectraOptions {
13
14
  spectra: Spectrum[];
14
15
  }
15
16
 
17
+ export type Spectrum1DTraces = Record<'x' | 'y', Spectrum1D | null>;
18
+
19
+ const defaultEmptyTraces = { x: null, y: null };
20
+
16
21
  export function getTracesSpectra(options: GetTracesSpectraOptions) {
17
22
  const { nuclei, activeSpectra, spectra } = options;
18
23
 
19
- const traces: Spectrum1D[] = [];
24
+ if (nuclei.length !== 2) {
25
+ throw new Error(
26
+ 'Invalid function call: this function should only run in a 2D nucleus context.',
27
+ );
28
+ }
29
+
30
+ const traces: Spectrum1DTraces = { ...defaultEmptyTraces };
31
+ let index = 0;
20
32
  for (const nucleus of nuclei) {
21
33
  const traceSpectra = activeSpectra[nucleus];
22
- if (traceSpectra?.length === 1) {
23
- const id = traceSpectra[0].id;
24
- const spectrum = spectra.find(
25
- (datum) =>
26
- datum.id === id && !datum.info.isFid && datum.info.dimension === 1,
27
- ) as Spectrum1D;
28
-
29
- if (spectrum) {
30
- traces.push(spectrum);
31
- }
34
+
35
+ if (traceSpectra?.length !== 1) {
36
+ index++;
37
+ continue;
32
38
  }
39
+
40
+ const id = traceSpectra[0].id;
41
+ const spectrum = spectra.find((datum) => datum.id === id);
42
+ const key = index === 0 ? 'x' : 'y';
43
+ traces[key] = isFt1DSpectrum(spectrum) ? spectrum : null;
44
+
45
+ index++;
33
46
  }
34
47
  return traces;
35
48
  }
@@ -43,9 +56,9 @@ export function useTracesSpectra() {
43
56
  } = useChartData();
44
57
 
45
58
  return useMemo(() => {
46
- const nuclei = activeTab.split(',');
59
+ if (!activeTab) return { ...defaultEmptyTraces };
47
60
 
48
- if (nuclei.length !== 2) return [];
61
+ const nuclei = activeTab.split(',');
49
62
 
50
63
  return getTracesSpectra({ nuclei, spectra, activeSpectra });
51
64
  }, [activeTab, spectra, activeSpectra]);
@@ -36,14 +36,14 @@ export function extractSpectrumSignals<T extends object = object>(
36
36
 
37
37
  if (!isInRange) continue;
38
38
 
39
- const { assignment, signals = [] } = range;
39
+ const { signals = [] } = range;
40
40
  let index = 0;
41
41
  for (const signal of signals) {
42
42
  const { kind } = signal;
43
43
  if (kind && signalKindsToInclude.has(kind)) {
44
44
  result.push({
45
45
  ...signal,
46
- assignment: index === 0 ? assignment : '',
46
+ assignment: index === 0 ? signal.assignment : '',
47
47
  ...include?.(range),
48
48
  } as ExtractedSignal<T>);
49
49
  index++;
@@ -15,7 +15,7 @@ function Signal({ signal }: SignalProps) {
15
15
  const scaleX = useScale2DX();
16
16
  const scaleY = useScale2DY();
17
17
 
18
- const buildIDs = useCallback((id: any) => {
18
+ const buildIDs = useCallback((id: string) => {
19
19
  return [id].concat(buildID(id, 'X'), buildID(id, 'Y'));
20
20
  }, []);
21
21
  const assignment = useAssignment(signal?.id || '');
@@ -1,5 +1,5 @@
1
1
  import styled from '@emotion/styled';
2
- import type { Range } from '@zakodium/nmr-types';
2
+ import type { Range, Signal1D } from '@zakodium/nmr-types';
3
3
  import type { Spectrum1D } from '@zakodium/nmrium-core';
4
4
  import { useRef } from 'react';
5
5
  import { LuLink, LuUnlink } from 'react-icons/lu';
@@ -157,10 +157,10 @@ interface UseRangeAssignmentOptions {
157
157
  }
158
158
 
159
159
  function useRangeAssignment(options: UseRangeAssignmentOptions) {
160
- const { rangeId, signalsIds, spectrumId } = options;
160
+ const { rangeId, signalsIds, spectrumId, signalId } = options;
161
161
 
162
162
  const assignmentData = useAssignmentContext();
163
- const assignmentContext = useAssignment(rangeId, spectrumId);
163
+ const assignmentContext = useAssignment(signalId, spectrumId);
164
164
  const highlightId = [rangeId]
165
165
  .concat(assignmentContext.assignedDiaIds?.x || [])
166
166
  .concat(filterAssignedIDs(assignmentData.data, signalsIds));
@@ -177,13 +177,15 @@ function isRangeSignalAssigned(
177
177
  options: Pick<IndicationLineProps, 'range' | 'nbAtoms' | 'diaIDs'>,
178
178
  ) {
179
179
  const { range, ...otherProps } = options;
180
- if (isAssigned(range)) {
181
- return true;
182
- }
183
-
184
180
  return isAssigned(otherProps);
185
181
  }
186
182
 
183
+ function hasDiaIds(signals: Signal1D[]) {
184
+ return signals.some(
185
+ (signal) => Array.isArray(signal?.diaIDs) && signal.diaIDs.length > 0,
186
+ );
187
+ }
188
+
187
189
  function IndicationLine(props: IndicationLineProps) {
188
190
  const isAssignBtnTrigged = useRef(false);
189
191
  const {
@@ -197,7 +199,7 @@ function IndicationLine(props: IndicationLineProps) {
197
199
  nbAtoms,
198
200
  id: signalId,
199
201
  } = props;
200
- const { id: rangeId, diaIDs: rangeDiaIDs = [], signals } = range;
202
+ const { id: rangeId, signals } = range;
201
203
  const highlightColor = useHighlightColor();
202
204
  const isSignalAssigned = isRangeSignalAssigned({ range, diaIDs, nbAtoms });
203
205
 
@@ -213,7 +215,7 @@ function IndicationLine(props: IndicationLineProps) {
213
215
  signalId,
214
216
  });
215
217
 
216
- const hasDiaIDs = rangeDiaIDs.length > 0;
218
+ const hasDiaIDs = hasDiaIds(signals);
217
219
  const isAssignmentActive = assignmentContext.isActive;
218
220
  const isHighlighted = highlightContext.isActive || isAssignmentActive;
219
221
 
@@ -237,11 +239,12 @@ function IndicationLine(props: IndicationLineProps) {
237
239
 
238
240
  function removeAssignmentLabel() {
239
241
  dispatch({
240
- type: 'CHANGE_RANGE_ASSIGNMENT_LABEL',
242
+ type: 'CHANGE_1D_SIGNAL_ASSIGNMENT_LABEL',
241
243
  payload: {
242
244
  value: '',
243
245
  rangeId,
244
246
  spectrumId,
247
+ signalId,
245
248
  },
246
249
  });
247
250
  }
@@ -263,7 +266,7 @@ function IndicationLine(props: IndicationLineProps) {
263
266
 
264
267
  function unAssignHandler() {
265
268
  dispatch({
266
- type: 'UNLINK_RANGE',
269
+ type: 'UNASSIGN_1D_SIGNAL',
267
270
  payload: {
268
271
  rangeKey: rangeId,
269
272
  spectrumId,
@@ -341,6 +344,7 @@ function IndicationLine(props: IndicationLineProps) {
341
344
  axis={axis}
342
345
  rangeId={rangeId}
343
346
  spectrumId={spectrumId}
347
+ signalId={signalId}
344
348
  />
345
349
  </g>
346
350
  </ActionsButtonsPopover>
@@ -353,11 +357,12 @@ interface AssignmentLabelProps {
353
357
  x: number;
354
358
  y: number;
355
359
  rangeId: string;
360
+ signalId: string;
356
361
  spectrumId: string;
357
362
  }
358
363
 
359
364
  function AssignmentLabel(props: AssignmentLabelProps) {
360
- const { axis, assignment, x, y, rangeId, spectrumId } = props;
365
+ const { axis, assignment, x, y, rangeId, signalId, spectrumId } = props;
361
366
  const { isNewAssignment, dismissNewLabel } = useTriggerNewAssignmentLabel(
362
367
  getAxisRangeId({ axis, rangeId }),
363
368
  );
@@ -366,11 +371,12 @@ function AssignmentLabel(props: AssignmentLabelProps) {
366
371
  function handleChange(value: string) {
367
372
  dismissNewLabel();
368
373
  dispatch({
369
- type: 'CHANGE_RANGE_ASSIGNMENT_LABEL',
374
+ type: 'CHANGE_1D_SIGNAL_ASSIGNMENT_LABEL',
370
375
  payload: {
371
376
  value,
372
377
  rangeId,
373
378
  spectrumId,
379
+ signalId,
374
380
  },
375
381
  });
376
382
  }
@@ -413,12 +419,8 @@ export function SignalsGuideLines() {
413
419
 
414
420
  return (
415
421
  <ShareDataProvider>
416
- {spectrumData[0] && (
417
- <IndicationLines axis="x" spectrum={spectrumData[0]} />
418
- )}
419
- {spectrumData[0] && (
420
- <IndicationLines axis="y" spectrum={spectrumData[1]} />
421
- )}
422
+ {spectrumData.x && <IndicationLines axis="x" spectrum={spectrumData.x} />}
423
+ {spectrumData.y && <IndicationLines axis="y" spectrum={spectrumData.y} />}
422
424
  </ShareDataProvider>
423
425
  );
424
426
  }
@@ -1,6 +1,6 @@
1
1
  import styled from '@emotion/styled';
2
2
  import type { Signal1D, Zone, Zones as ZonesType } from '@zakodium/nmr-types';
3
- import type { Spectrum2D } from '@zakodium/nmrium-core';
3
+ import type { Spectrum1D, Spectrum2D } from '@zakodium/nmrium-core';
4
4
  import { useEffect, useLayoutEffect, useRef, useState } from 'react';
5
5
  import { PiTextTSlash } from 'react-icons/pi';
6
6
 
@@ -40,7 +40,7 @@ interface TargetBoundary {
40
40
  y2: number;
41
41
  }
42
42
 
43
- function getDistance(x1: any, y1: any, x2: any, y2: any) {
43
+ function getDistance(x1: number, y1: number, x2: number, y2: number) {
44
44
  const deltaX = x2 - x1;
45
45
  const deltaY = y2 - y1;
46
46
  return Math.hypot(deltaX, deltaY);
@@ -249,7 +249,7 @@ function findClosestAssignment(signals: Signal1D[], target: number) {
249
249
  }
250
250
 
251
251
  function getAssignmentLabel(
252
- spectrum: any,
252
+ spectrum: Spectrum1D | null,
253
253
  options: { from: number; to: number; center: number },
254
254
  ) {
255
255
  if (!spectrum) return null;
@@ -264,7 +264,7 @@ function getDefaultAssignmentLabel(options: GetDefaultAssignmentOptions) {
264
264
  const { signals, x, y } = zone;
265
265
  if (signals.length === 0) return '';
266
266
 
267
- const [topSpectrum, leftSpectrum] = getTracesSpectra({
267
+ const { x: topSpectrum, y: leftSpectrum } = getTracesSpectra({
268
268
  activeSpectra,
269
269
  nuclei,
270
270
  spectra,