nmrium 1.9.0 → 1.10.1

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 (472) 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 +19 -12
  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/assignment/utilities/getAssignments.js +1 -2
  102. package/lib/component/assignment/utilities/getAssignments.js.map +1 -1
  103. package/lib/component/context/KeyModifierContext.d.ts +3 -2
  104. package/lib/component/context/KeyModifierContext.d.ts.map +1 -1
  105. package/lib/component/context/KeyModifierContext.js +7 -4
  106. package/lib/component/context/KeyModifierContext.js.map +1 -1
  107. package/lib/component/elements/ActionsButtonsPopover.d.ts.map +1 -1
  108. package/lib/component/elements/ActionsButtonsPopover.js +17 -3
  109. package/lib/component/elements/ActionsButtonsPopover.js.map +1 -1
  110. package/lib/component/elements/AssignmentsCell.d.ts.map +1 -1
  111. package/lib/component/elements/AssignmentsCell.js.map +1 -1
  112. package/lib/component/elements/Button.d.ts.map +1 -1
  113. package/lib/component/elements/Button.js.map +1 -1
  114. package/lib/component/elements/CheckController.d.ts.map +1 -1
  115. package/lib/component/elements/CheckController.js.map +1 -1
  116. package/lib/component/elements/ContextMenuBluePrint.d.ts.map +1 -1
  117. package/lib/component/elements/ContextMenuBluePrint.js.map +1 -1
  118. package/lib/component/elements/D3Axis.d.ts.map +1 -1
  119. package/lib/component/elements/DraggableDialog.d.ts.map +1 -1
  120. package/lib/component/elements/DraggableDialog.js.map +1 -1
  121. package/lib/component/elements/Input.d.ts.map +1 -1
  122. package/lib/component/elements/Input.js.map +1 -1
  123. package/lib/component/elements/Input2.d.ts.map +1 -1
  124. package/lib/component/elements/Input2.js.map +1 -1
  125. package/lib/component/elements/Input2Controller.d.ts.map +1 -1
  126. package/lib/component/elements/Input2Controller.js.map +1 -1
  127. package/lib/component/elements/Label.d.ts.map +1 -1
  128. package/lib/component/elements/Label.js.map +1 -1
  129. package/lib/component/elements/NumberInput2.d.ts.map +1 -1
  130. package/lib/component/elements/NumberInput2.js.map +1 -1
  131. package/lib/component/elements/NumberInput2Controller.d.ts.map +1 -1
  132. package/lib/component/elements/NumberInput2Controller.js.map +1 -1
  133. package/lib/component/elements/ReactTable/ReactTable.d.ts.map +1 -1
  134. package/lib/component/elements/ReactTable/ReactTable.js.map +1 -1
  135. package/lib/component/elements/ReadOnly.d.ts.map +1 -1
  136. package/lib/component/elements/ReadOnly.js.map +1 -1
  137. package/lib/component/elements/Sections.js.map +1 -1
  138. package/lib/component/elements/Select.d.ts.map +1 -1
  139. package/lib/component/elements/Select.js.map +1 -1
  140. package/lib/component/elements/ToolbarPopoverItem.d.ts.map +1 -1
  141. package/lib/component/elements/export/ExportContent.d.ts.map +1 -1
  142. package/lib/component/elements/export/ExportContent.js.map +1 -1
  143. package/lib/component/elements/print/PrintContent.d.ts.map +1 -1
  144. package/lib/component/elements/print/PrintContent.js.map +1 -1
  145. package/lib/component/hooks/useActiveSpectrumIntegralsViewState.d.ts.map +1 -1
  146. package/lib/component/hooks/useActiveSpectrumIntegralsViewState.js +2 -4
  147. package/lib/component/hooks/useActiveSpectrumIntegralsViewState.js.map +1 -1
  148. package/lib/component/hooks/useActiveSpectrumPeaksViewState.d.ts.map +1 -1
  149. package/lib/component/hooks/useActiveSpectrumPeaksViewState.js +2 -4
  150. package/lib/component/hooks/useActiveSpectrumPeaksViewState.js.map +1 -1
  151. package/lib/component/hooks/useActiveSpectrumRangesViewState.d.ts.map +1 -1
  152. package/lib/component/hooks/useActiveSpectrumRangesViewState.js +2 -4
  153. package/lib/component/hooks/useActiveSpectrumRangesViewState.js.map +1 -1
  154. package/lib/component/hooks/useActiveSpectrumStyleOptions.js +2 -2
  155. package/lib/component/hooks/useActiveSpectrumStyleOptions.js.map +1 -1
  156. package/lib/component/hooks/useActiveSpectrumZonesViewState.d.ts.map +1 -1
  157. package/lib/component/hooks/useActiveSpectrumZonesViewState.js +2 -4
  158. package/lib/component/hooks/useActiveSpectrumZonesViewState.js.map +1 -1
  159. package/lib/component/hooks/useExport.js +1 -1
  160. package/lib/component/hooks/useExport.js.map +1 -1
  161. package/lib/component/hooks/useSaveSettings.d.ts.map +1 -1
  162. package/lib/component/hooks/useSaveSettings.js +28 -47
  163. package/lib/component/hooks/useSaveSettings.js.map +1 -1
  164. package/lib/component/hooks/useSetActiveSpectrumAction.d.ts +2 -1
  165. package/lib/component/hooks/useSetActiveSpectrumAction.d.ts.map +1 -1
  166. package/lib/component/hooks/useSetActiveSpectrumAction.js +2 -2
  167. package/lib/component/hooks/useSetActiveSpectrumAction.js.map +1 -1
  168. package/lib/component/hooks/useSpectrumWithDataSource.js +1 -1
  169. package/lib/component/hooks/useSpectrumWithDataSource.js.map +1 -1
  170. package/lib/component/hooks/useWorkspaceAction.d.ts +1 -1
  171. package/lib/component/hooks/useWorkspaceAction.d.ts.map +1 -1
  172. package/lib/component/hooks/useWorkspaceAction.js +3 -0
  173. package/lib/component/hooks/useWorkspaceAction.js.map +1 -1
  174. package/lib/component/modal/ImportPublicationStringModal.d.ts.map +1 -1
  175. package/lib/component/modal/ImportPublicationStringModal.js.map +1 -1
  176. package/lib/component/modal/changeSum/ChangeSumModal.d.ts.map +1 -1
  177. package/lib/component/modal/changeSum/ChangeSumModal.js.map +1 -1
  178. package/lib/component/modal/metaImportation/MetaImportationModal.d.ts.map +1 -1
  179. package/lib/component/modal/metaImportation/MetaImportationModal.js.map +1 -1
  180. package/lib/component/modal/setting/GeneralSettings.d.ts.map +1 -1
  181. package/lib/component/modal/setting/GeneralSettings.js +5 -1
  182. package/lib/component/modal/setting/GeneralSettings.js.map +1 -1
  183. package/lib/component/panels/IntegralsPanel/IntegralTable.d.ts.map +1 -1
  184. package/lib/component/panels/IntegralsPanel/IntegralTable.js.map +1 -1
  185. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.d.ts +1 -1
  186. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.d.ts.map +1 -1
  187. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +14 -10
  188. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js.map +1 -1
  189. package/lib/component/panels/MoleculesPanel/hooks/useAtomAssignment.d.ts.map +1 -1
  190. package/lib/component/panels/MoleculesPanel/hooks/useAtomAssignment.js +17 -17
  191. package/lib/component/panels/MoleculesPanel/hooks/useAtomAssignment.js.map +1 -1
  192. package/lib/component/panels/MoleculesPanel/utilities/getAssignIds.d.ts.map +1 -1
  193. package/lib/component/panels/MoleculesPanel/utilities/getAssignIds.js +0 -3
  194. package/lib/component/panels/MoleculesPanel/utilities/getAssignIds.js.map +1 -1
  195. package/lib/component/panels/RangesPanel/RangesPanel.js +1 -1
  196. package/lib/component/panels/RangesPanel/RangesPanel.js.map +1 -1
  197. package/lib/component/panels/RangesPanel/RangesTable.d.ts.map +1 -1
  198. package/lib/component/panels/RangesPanel/RangesTable.js +1 -1
  199. package/lib/component/panels/RangesPanel/RangesTable.js.map +1 -1
  200. package/lib/component/panels/RangesPanel/RangesTableRow.d.ts.map +1 -1
  201. package/lib/component/panels/RangesPanel/RangesTableRow.js +5 -20
  202. package/lib/component/panels/RangesPanel/RangesTableRow.js.map +1 -1
  203. package/lib/component/panels/RangesPanel/TableColumns/ActionsColumn.d.ts.map +1 -1
  204. package/lib/component/panels/RangesPanel/TableColumns/ActionsColumn.js.map +1 -1
  205. package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentColumn.d.ts +9 -0
  206. package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentColumn.d.ts.map +1 -0
  207. package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentColumn.js +19 -0
  208. package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentColumn.js.map +1 -0
  209. package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.d.ts.map +1 -1
  210. package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.js.map +1 -1
  211. package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.js +2 -2
  212. package/lib/component/panels/SummaryPanel/SummaryPanel.js +6 -6
  213. package/lib/component/panels/SummaryPanel/SummaryPanel.js.map +1 -1
  214. package/lib/component/panels/accordionItems.d.ts.map +1 -1
  215. package/lib/component/panels/accordionItems.js.map +1 -1
  216. package/lib/component/panels/extra/preferences/NucleusPreferences.d.ts.map +1 -1
  217. package/lib/component/panels/informationPanel/InformationEditionModal.d.ts.map +1 -1
  218. package/lib/component/panels/informationPanel/InformationEditionModal.js.map +1 -1
  219. package/lib/component/panels/predictionPanel/PredictionPanel.d.ts.map +1 -1
  220. package/lib/component/panels/predictionPanel/PredictionPanel.js +13 -9
  221. package/lib/component/panels/predictionPanel/PredictionPanel.js.map +1 -1
  222. package/lib/component/reducer/Reducer.js +7 -7
  223. package/lib/component/reducer/Reducer.js.map +1 -1
  224. package/lib/component/reducer/actions/AssignmentsActions.d.ts.map +1 -1
  225. package/lib/component/reducer/actions/AssignmentsActions.js +9 -9
  226. package/lib/component/reducer/actions/AssignmentsActions.js.map +1 -1
  227. package/lib/component/reducer/actions/CorrelationsActions.d.ts.map +1 -1
  228. package/lib/component/reducer/actions/CorrelationsActions.js +21 -21
  229. package/lib/component/reducer/actions/CorrelationsActions.js.map +1 -1
  230. package/lib/component/reducer/actions/DatabaseActions.js +1 -1
  231. package/lib/component/reducer/actions/DatabaseActions.js.map +1 -1
  232. package/lib/component/reducer/actions/DomainActions.d.ts.map +1 -1
  233. package/lib/component/reducer/actions/DomainActions.js +10 -18
  234. package/lib/component/reducer/actions/DomainActions.js.map +1 -1
  235. package/lib/component/reducer/actions/FiltersActions.d.ts.map +1 -1
  236. package/lib/component/reducer/actions/FiltersActions.js +28 -44
  237. package/lib/component/reducer/actions/FiltersActions.js.map +1 -1
  238. package/lib/component/reducer/actions/InsetActions.d.ts.map +1 -1
  239. package/lib/component/reducer/actions/InsetActions.js +9 -18
  240. package/lib/component/reducer/actions/InsetActions.js.map +1 -1
  241. package/lib/component/reducer/actions/IntegralsActions.d.ts +1 -1
  242. package/lib/component/reducer/actions/IntegralsActions.d.ts.map +1 -1
  243. package/lib/component/reducer/actions/IntegralsActions.js +43 -48
  244. package/lib/component/reducer/actions/IntegralsActions.js.map +1 -1
  245. package/lib/component/reducer/actions/MoleculeActions.d.ts +2 -1
  246. package/lib/component/reducer/actions/MoleculeActions.d.ts.map +1 -1
  247. package/lib/component/reducer/actions/MoleculeActions.js +64 -10
  248. package/lib/component/reducer/actions/MoleculeActions.js.map +1 -1
  249. package/lib/component/reducer/actions/PeaksActions.d.ts.map +1 -1
  250. package/lib/component/reducer/actions/PeaksActions.js +110 -121
  251. package/lib/component/reducer/actions/PeaksActions.js.map +1 -1
  252. package/lib/component/reducer/actions/PreferencesActions.d.ts.map +1 -1
  253. package/lib/component/reducer/actions/PreferencesActions.js +2 -1
  254. package/lib/component/reducer/actions/PreferencesActions.js.map +1 -1
  255. package/lib/component/reducer/actions/RangesActions.d.ts +18 -18
  256. package/lib/component/reducer/actions/RangesActions.d.ts.map +1 -1
  257. package/lib/component/reducer/actions/RangesActions.js +148 -171
  258. package/lib/component/reducer/actions/RangesActions.js.map +1 -1
  259. package/lib/component/reducer/actions/SpectraActions.d.ts.map +1 -1
  260. package/lib/component/reducer/actions/SpectraActions.js +29 -31
  261. package/lib/component/reducer/actions/SpectraActions.js.map +1 -1
  262. package/lib/component/reducer/actions/ToolsActions.d.ts.map +1 -1
  263. package/lib/component/reducer/actions/ToolsActions.js +10 -11
  264. package/lib/component/reducer/actions/ToolsActions.js.map +1 -1
  265. package/lib/component/reducer/actions/ZonesActions.d.ts +8 -9
  266. package/lib/component/reducer/actions/ZonesActions.d.ts.map +1 -1
  267. package/lib/component/reducer/actions/ZonesActions.js +123 -151
  268. package/lib/component/reducer/actions/ZonesActions.js.map +1 -1
  269. package/lib/component/reducer/helper/get2DRange.d.ts +3 -1
  270. package/lib/component/reducer/helper/get2DRange.d.ts.map +1 -1
  271. package/lib/component/reducer/helper/get2DRange.js.map +1 -1
  272. package/lib/component/reducer/helper/getSpectrum.js +1 -1
  273. package/lib/component/reducer/helper/getSpectrum.js.map +1 -1
  274. package/lib/component/reducer/helper/setIntegralsViewProperty.js +1 -1
  275. package/lib/component/reducer/helper/setIntegralsViewProperty.js.map +1 -1
  276. package/lib/component/reducer/helper/setRangesViewProperty.js +1 -1
  277. package/lib/component/reducer/helper/setRangesViewProperty.js.map +1 -1
  278. package/lib/component/useWatchForm.d.ts.map +1 -1
  279. package/lib/component/useWatchForm.js.map +1 -1
  280. package/lib/component/utility/stackOverlappingLabels.d.ts +1 -1
  281. package/lib/component/utility/stackOverlappingLabels.d.ts.map +1 -1
  282. package/lib/component/utility/stackOverlappingLabels.js.map +1 -1
  283. package/lib/data/SpectraManager.d.ts.map +1 -1
  284. package/lib/data/SpectraManager.js.map +1 -1
  285. package/lib/data/data1d/Spectrum1D/isRangeAssigned.d.ts.map +1 -1
  286. package/lib/data/data1d/Spectrum1D/isRangeAssigned.js +0 -3
  287. package/lib/data/data1d/Spectrum1D/isRangeAssigned.js.map +1 -1
  288. package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.d.ts +8 -1
  289. package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.d.ts.map +1 -1
  290. package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.js +1 -2
  291. package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.js.map +1 -1
  292. package/lib/data/data1d/Spectrum1D/ranges/changeRangeSignal.d.ts +2 -2
  293. package/lib/data/data1d/Spectrum1D/ranges/changeRangeSignal.js +3 -3
  294. package/lib/data/data1d/Spectrum1D/ranges/detectRanges.d.ts +4 -14
  295. package/lib/data/data1d/Spectrum1D/ranges/detectRanges.d.ts.map +1 -1
  296. package/lib/data/data1d/Spectrum1D/ranges/detectRanges.js +1 -1
  297. package/lib/data/data1d/Spectrum1D/ranges/detectRanges.js.map +1 -1
  298. package/lib/data/data2d/Spectrum2D/initiateDatum2D.js.map +1 -1
  299. package/lib/data/data2d/Spectrum2D/zones/changeZoneSignal.d.ts +3 -5
  300. package/lib/data/data2d/Spectrum2D/zones/changeZoneSignal.d.ts.map +1 -1
  301. package/lib/data/data2d/Spectrum2D/zones/changeZoneSignal.js +3 -5
  302. package/lib/data/data2d/Spectrum2D/zones/changeZoneSignal.js.map +1 -1
  303. package/lib/data/data2d/Spectrum2D/zones/detectZones.d.ts +2 -1
  304. package/lib/data/data2d/Spectrum2D/zones/detectZones.d.ts.map +1 -1
  305. package/lib/data/data2d/Spectrum2D/zones/detectZones.js.map +1 -1
  306. package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.d.ts +7 -63
  307. package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.d.ts.map +1 -1
  308. package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.js +9 -14
  309. package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.js.map +1 -1
  310. package/lib/data/data2d/Spectrum2D/zones/getDetectionZones.d.ts +2 -10
  311. package/lib/data/data2d/Spectrum2D/zones/getDetectionZones.d.ts.map +1 -1
  312. package/lib/data/data2d/Spectrum2D/zones/getDetectionZones.js +23 -43
  313. package/lib/data/data2d/Spectrum2D/zones/getDetectionZones.js.map +1 -1
  314. package/lib/data/data2d/Spectrum2D/zones/initiateZones.d.ts +1 -54
  315. package/lib/data/data2d/Spectrum2D/zones/initiateZones.d.ts.map +1 -1
  316. package/lib/data/data2d/Spectrum2D/zones/initiateZones.js +1 -1
  317. package/lib/data/data2d/Spectrum2D/zones/initiateZones.js.map +1 -1
  318. package/lib/data/molecules/Molecule.d.ts.map +1 -1
  319. package/lib/data/molecules/Molecule.js.map +1 -1
  320. package/lib/data/types/data1d/RangeDetectionResult.d.ts.map +1 -1
  321. package/lib/data/utilities/FindUtilities.d.ts.map +1 -1
  322. package/lib/data/utilities/FindUtilities.js +11 -11
  323. package/lib/data/utilities/FindUtilities.js.map +1 -1
  324. package/lib/utils/clipboard/clipboardComponents.d.ts.map +1 -1
  325. package/lib/utils/clipboard/clipboardComponents.js.map +1 -1
  326. package/lib/utils/clipboard/clipboardHooks.d.ts +2 -2
  327. package/lib/utils/clipboard/clipboardHooks.d.ts.map +1 -1
  328. package/lib/utils/clipboard/clipboardHooks.js +10 -4
  329. package/lib/utils/clipboard/clipboardHooks.js.map +1 -1
  330. package/lib/versionInfo.d.ts.map +1 -1
  331. package/lib/versionInfo.js +1 -1
  332. package/lib/versionInfo.js.map +1 -1
  333. package/package.json +33 -31
  334. package/src/component/1d/ApodizationLine.tsx +1 -1
  335. package/src/component/1d/BrushTracker1D.tsx +10 -10
  336. package/src/component/1d/FooterBanner.tsx +2 -2
  337. package/src/component/1d/LinesSeries.tsx +2 -2
  338. package/src/component/1d/SVGContent1D.tsx +6 -2
  339. package/src/component/1d/SimilarityTree.tsx +3 -2
  340. package/src/component/1d/inset/InsetProvider.tsx +4 -2
  341. package/src/component/1d/integral/IntegralResizable.tsx +2 -1
  342. package/src/component/1d/matrix/Boxplot.tsx +3 -3
  343. package/src/component/1d/multiAnalysis/AnalysisRange.tsx +2 -1
  344. package/src/component/1d/multiplicityTree/MultiplicityTree.tsx +24 -23
  345. package/src/component/1d/multiplicityTree/generateTreeNodes.ts +10 -1
  346. package/src/component/1d/peaks/PeakAnnotationsSpreadMode.tsx +4 -2
  347. package/src/component/1d/peaks/PeakEditionManager.tsx +8 -3
  348. package/src/component/1d/peaks/Peaks.tsx +5 -1
  349. package/src/component/1d/ranges/AssignmentLabel.tsx +8 -5
  350. package/src/component/1d/ranges/Atoms.tsx +2 -2
  351. package/src/component/1d/ranges/Range.tsx +42 -74
  352. package/src/component/1d/ranges/Ranges.tsx +33 -28
  353. package/src/component/1d/ranges/useAssignmentsPopoverActionsButtons.tsx +93 -0
  354. package/src/component/1d/tool/BaseLineZones.tsx +2 -1
  355. package/src/component/1d/utilities/intersectionResolver.ts +3 -4
  356. package/src/component/1d-2d/FieldEdition.tsx +2 -2
  357. package/src/component/2d/1d-tracer/VerticalSliceChart.tsx +2 -2
  358. package/src/component/2d/1d-tracer/phase-correction-traces/PhaseTraces.tsx +1 -1
  359. package/src/component/2d/1d-tracer/phase-correction-traces/SpectrumPhaseTrace.tsx +1 -1
  360. package/src/component/2d/BrushTracker2D.tsx +50 -55
  361. package/src/component/2d/FooterBanner.tsx +80 -105
  362. package/src/component/2d/SVGContent2D.tsx +2 -3
  363. package/src/component/2d/SlicingView.tsx +1 -1
  364. package/src/component/2d/Viewer2D.tsx +2 -2
  365. package/src/component/2d/ft/FTContainer.tsx +4 -5
  366. package/src/component/2d/tools/XYLabelPointer.tsx +12 -11
  367. package/src/component/2d/useTracesSpectra.ts +28 -16
  368. package/src/component/2d/utilities/extractSpectrumSignals.ts +2 -2
  369. package/src/component/2d/zones/Signal.tsx +1 -1
  370. package/src/component/2d/zones/SignalsGuideLines.tsx +21 -19
  371. package/src/component/2d/zones/ZonesAssignmentsLabels.tsx +4 -4
  372. package/src/component/EventsTrackers/BrushTracker.tsx +24 -17
  373. package/src/component/assignment/utilities/getAssignments.ts +1 -2
  374. package/src/component/context/KeyModifierContext.tsx +13 -5
  375. package/src/component/elements/ActionsButtonsPopover.tsx +25 -8
  376. package/src/component/elements/AssignmentsCell.tsx +1 -2
  377. package/src/component/elements/Button.tsx +3 -2
  378. package/src/component/elements/CheckController.tsx +2 -1
  379. package/src/component/elements/ContextMenuBluePrint.tsx +2 -1
  380. package/src/component/elements/D3Axis.tsx +3 -3
  381. package/src/component/elements/DraggableDialog.tsx +2 -1
  382. package/src/component/elements/Input.tsx +4 -2
  383. package/src/component/elements/Input2.tsx +1 -2
  384. package/src/component/elements/Input2Controller.tsx +2 -1
  385. package/src/component/elements/Label.tsx +2 -1
  386. package/src/component/elements/NumberInput2.tsx +4 -2
  387. package/src/component/elements/NumberInput2Controller.tsx +3 -1
  388. package/src/component/elements/ReactTable/ReactTable.tsx +1 -3
  389. package/src/component/elements/ReadOnly.tsx +4 -2
  390. package/src/component/elements/Sections.tsx +5 -4
  391. package/src/component/elements/Select.tsx +4 -2
  392. package/src/component/elements/ToolbarPopoverItem.tsx +3 -3
  393. package/src/component/elements/export/ExportContent.tsx +1 -2
  394. package/src/component/elements/print/PrintContent.tsx +1 -2
  395. package/src/component/hooks/useActiveSpectrumIntegralsViewState.ts +2 -6
  396. package/src/component/hooks/useActiveSpectrumPeaksViewState.ts +2 -6
  397. package/src/component/hooks/useActiveSpectrumRangesViewState.ts +2 -6
  398. package/src/component/hooks/useActiveSpectrumStyleOptions.ts +2 -2
  399. package/src/component/hooks/useActiveSpectrumZonesViewState.ts +2 -6
  400. package/src/component/hooks/useExport.tsx +1 -1
  401. package/src/component/hooks/useSaveSettings.tsx +68 -81
  402. package/src/component/hooks/useSetActiveSpectrumAction.ts +3 -2
  403. package/src/component/hooks/useSpectrumWithDataSource.ts +1 -1
  404. package/src/component/hooks/useWorkspaceAction.ts +5 -0
  405. package/src/component/modal/ImportPublicationStringModal.tsx +1 -2
  406. package/src/component/modal/changeSum/ChangeSumModal.tsx +4 -2
  407. package/src/component/modal/metaImportation/MetaImportationModal.tsx +1 -2
  408. package/src/component/modal/setting/GeneralSettings.tsx +7 -2
  409. package/src/component/panels/IntegralsPanel/IntegralTable.tsx +4 -2
  410. package/src/component/panels/MoleculesPanel/MoleculePanelHeader.tsx +17 -13
  411. package/src/component/panels/MoleculesPanel/hooks/useAtomAssignment.tsx +17 -15
  412. package/src/component/panels/MoleculesPanel/utilities/getAssignIds.ts +0 -4
  413. package/src/component/panels/RangesPanel/RangesPanel.tsx +1 -1
  414. package/src/component/panels/RangesPanel/RangesTable.tsx +3 -8
  415. package/src/component/panels/RangesPanel/RangesTableRow.tsx +14 -47
  416. package/src/component/panels/RangesPanel/TableColumns/ActionsColumn.tsx +1 -2
  417. package/src/component/panels/RangesPanel/TableColumns/SignalAssignmentColumn.tsx +40 -0
  418. package/src/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.tsx +1 -2
  419. package/src/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.tsx +2 -2
  420. package/src/component/panels/SummaryPanel/SummaryPanel.tsx +6 -6
  421. package/src/component/panels/accordionItems.tsx +4 -2
  422. package/src/component/panels/extra/preferences/NucleusPreferences.tsx +2 -2
  423. package/src/component/panels/informationPanel/InformationEditionModal.tsx +4 -2
  424. package/src/component/panels/predictionPanel/PredictionPanel.tsx +17 -9
  425. package/src/component/reducer/Reducer.ts +8 -8
  426. package/src/component/reducer/actions/AssignmentsActions.ts +8 -13
  427. package/src/component/reducer/actions/CorrelationsActions.ts +21 -22
  428. package/src/component/reducer/actions/DatabaseActions.ts +1 -1
  429. package/src/component/reducer/actions/DomainActions.ts +16 -22
  430. package/src/component/reducer/actions/FiltersActions.ts +34 -58
  431. package/src/component/reducer/actions/InsetActions.ts +9 -19
  432. package/src/component/reducer/actions/IntegralsActions.ts +48 -59
  433. package/src/component/reducer/actions/MoleculeActions.ts +94 -14
  434. package/src/component/reducer/actions/PeaksActions.ts +112 -136
  435. package/src/component/reducer/actions/PreferencesActions.ts +4 -3
  436. package/src/component/reducer/actions/RangesActions.ts +196 -244
  437. package/src/component/reducer/actions/SpectraActions.ts +40 -45
  438. package/src/component/reducer/actions/ToolsActions.ts +9 -13
  439. package/src/component/reducer/actions/ZonesActions.ts +158 -218
  440. package/src/component/reducer/helper/get2DRange.ts +4 -1
  441. package/src/component/reducer/helper/getSpectrum.ts +1 -1
  442. package/src/component/reducer/helper/setIntegralsViewProperty.ts +1 -1
  443. package/src/component/reducer/helper/setRangesViewProperty.ts +1 -1
  444. package/src/component/useWatchForm.tsx +2 -1
  445. package/src/component/utility/stackOverlappingLabels.ts +4 -1
  446. package/src/data/SpectraManager.ts +0 -2
  447. package/src/data/data1d/Spectrum1D/isRangeAssigned.ts +0 -4
  448. package/src/data/data1d/Spectrum1D/ranges/autoRangesDetection.ts +15 -5
  449. package/src/data/data1d/Spectrum1D/ranges/changeRangeSignal.ts +5 -5
  450. package/src/data/data1d/Spectrum1D/ranges/detectRanges.ts +5 -14
  451. package/src/data/data2d/Spectrum2D/initiateDatum2D.ts +2 -2
  452. package/src/data/data2d/Spectrum2D/zones/changeZoneSignal.ts +3 -5
  453. package/src/data/data2d/Spectrum2D/zones/detectZones.ts +3 -2
  454. package/src/data/data2d/Spectrum2D/zones/detectZonesManual.ts +19 -16
  455. package/src/data/data2d/Spectrum2D/zones/getDetectionZones.ts +35 -56
  456. package/src/data/data2d/Spectrum2D/zones/initiateZones.ts +1 -1
  457. package/src/data/molecules/Molecule.ts +2 -1
  458. package/src/data/types/data1d/RangeDetectionResult.ts +4 -2
  459. package/src/data/utilities/FindUtilities.ts +9 -8
  460. package/src/utils/clipboard/clipboardComponents.tsx +2 -1
  461. package/src/utils/clipboard/clipboardHooks.ts +14 -8
  462. package/src/versionInfo.ts +1 -1
  463. package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentColumn.d.ts +0 -8
  464. package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentColumn.d.ts.map +0 -1
  465. package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentColumn.js +0 -17
  466. package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentColumn.js.map +0 -1
  467. package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.d.ts +0 -17
  468. package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.d.ts.map +0 -1
  469. package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +0 -40
  470. package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js.map +0 -1
  471. package/src/component/panels/RangesPanel/TableColumns/RangeAssignmentColumn.tsx +0 -36
  472. package/src/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.tsx +0 -89
@@ -76,7 +76,7 @@ export function BrushTracker2D({ children }: Required<PropsWithChildren>) {
76
76
  general: { invertScroll },
77
77
  },
78
78
  } = usePreferences();
79
- function handleBrush(brushData: any) {
79
+ function handleBrush(brushData: BrushTrackerData) {
80
80
  const { startX, endX, startY, endY } = convertToPPM(brushData);
81
81
 
82
82
  if (brushData.mouseButton === 'secondary') {
@@ -92,73 +92,68 @@ export function BrushTracker2D({ children }: Required<PropsWithChildren>) {
92
92
  }
93
93
 
94
94
  const handleBrushEnd = useCallback<OnBrush>(
95
- (brushData) => {
95
+ (brushData: BrushTrackerData) => {
96
96
  const brushDataInPPM = convertToPPM(brushData);
97
97
 
98
98
  //reset the brush start
99
99
  brushStartRef.current = null;
100
100
 
101
- const modifierKey = getModifiersKey(brushData as unknown as MouseEvent);
101
+ const modifierKey = getModifiersKey(brushData);
102
102
  let executeDefaultAction = false;
103
+ const trackID = getLayoutID(DIMENSION, brushData);
103
104
 
104
- if (brushData.mouseButton === 'main') {
105
- const trackID = getLayoutID(DIMENSION, brushData);
106
- if (trackID) {
107
- switch (modifierKey) {
108
- case primaryKeyIdentifier: {
109
- switch (selectedTool) {
110
- case options.zoom.id: {
111
- executeDefaultAction = true;
112
- break;
113
- }
114
- case options.zonePicking.id: {
115
- dispatch({ type: 'ADD_2D_ZONE', payload: brushData });
105
+ if (brushData.mouseButton !== 'main' || !trackID) return;
116
106
 
117
- break;
118
- }
119
- default:
120
- break;
121
- }
107
+ const isPrimaryKeyIdentifier = modifierKey === primaryKeyIdentifier;
122
108
 
123
- break;
124
- }
125
- default: {
126
- executeDefaultAction = true;
127
- break;
128
- }
109
+ if (trackID === 'MAIN' && isPrimaryKeyIdentifier) {
110
+ switch (selectedTool) {
111
+ case options.zoom.id: {
112
+ executeDefaultAction = true;
113
+ break;
129
114
  }
130
- const isNotDistanceMeasurementTool =
131
- selectedTool !== 'zoom' ||
132
- (selectedTool === 'zoom' && !brushData.shiftKey);
115
+ case options.zonePicking.id: {
116
+ dispatch({ type: 'ADD_2D_ZONE', payload: brushData });
133
117
 
134
- if (
135
- executeDefaultAction &&
136
- selectedTool != null &&
137
- isNotDistanceMeasurementTool
138
- ) {
139
- const trackID = getLayoutID(DIMENSION, brushData);
118
+ break;
119
+ }
120
+ default:
121
+ break;
122
+ }
123
+ } else {
124
+ executeDefaultAction = true;
125
+ }
140
126
 
141
- const axisMap: Record<Layout, BrushAxis> = {
142
- MAIN: detectBrushing(brushData, {
143
- width,
144
- height,
145
- ...brushDetectionOptions,
146
- }).type,
147
- LEFT: 'Y',
148
- TOP: 'X',
149
- };
127
+ const isNotDistanceMeasurementTool =
128
+ selectedTool !== 'zoom' ||
129
+ (selectedTool === 'zoom' && !brushData.shiftKey);
150
130
 
151
- const axis: BrushAxis | null = trackID && axisMap[trackID];
131
+ if (
132
+ executeDefaultAction &&
133
+ selectedTool != null &&
134
+ isNotDistanceMeasurementTool
135
+ ) {
136
+ const trackID = getLayoutID(DIMENSION, brushData);
152
137
 
153
- return dispatch({
154
- type: 'BRUSH_END',
155
- payload: {
156
- ...brushDataInPPM,
157
- axis,
158
- },
159
- });
160
- }
161
- }
138
+ const axisMap: Record<Layout, BrushAxis> = {
139
+ MAIN: detectBrushing(brushData, {
140
+ width,
141
+ height,
142
+ ...brushDetectionOptions,
143
+ }).type,
144
+ LEFT: 'Y',
145
+ TOP: 'X',
146
+ };
147
+
148
+ const axis: BrushAxis | null = trackID && axisMap[trackID];
149
+
150
+ return dispatch({
151
+ type: 'BRUSH_END',
152
+ payload: {
153
+ ...brushDataInPPM,
154
+ axis,
155
+ },
156
+ });
162
157
  }
163
158
  },
164
159
  [
@@ -175,7 +170,7 @@ export function BrushTracker2D({ children }: Required<PropsWithChildren>) {
175
170
 
176
171
  const handleOnDoubleClick: OnDoubleClick = useCallback(
177
172
  (event) => {
178
- const keyModifiers = getModifiersKey(event as unknown as MouseEvent);
173
+ const keyModifiers = getModifiersKey(event);
179
174
 
180
175
  if (primaryKeyIdentifier === keyModifiers && !isClickDebounced) return;
181
176
 
@@ -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,11 +56,10 @@ export function useTracesSpectra() {
43
56
  } = useChartData();
44
57
 
45
58
  return useMemo(() => {
46
- if (!activeTab) return [];
47
-
48
- const nuclei = activeTab.split(',');
49
-
50
- if (nuclei.length !== 2) return [];
59
+ const nuclei = activeTab?.split(',');
60
+ if (nuclei?.length !== 2) {
61
+ return { ...defaultEmptyTraces };
62
+ }
51
63
 
52
64
  return getTracesSpectra({ nuclei, spectra, activeSpectra });
53
65
  }, [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 || '');