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
@@ -19,6 +19,7 @@ export interface TreeNodes {
19
19
  multiplicity?: string;
20
20
  nodes: TreeNode[];
21
21
  diaIDs?: string[];
22
+ assignment?: string;
22
23
  min: number;
23
24
  max: number;
24
25
  }
@@ -78,7 +79,14 @@ export function generateTreeNodes(range: Range, spectrumData: Spectrum1D) {
78
79
  for (const signal of signals || []) {
79
80
  nodes = [];
80
81
 
81
- const { multiplicity, js, delta, id: signalKey, diaIDs } = signal;
82
+ const {
83
+ multiplicity,
84
+ js,
85
+ delta,
86
+ id: signalKey,
87
+ diaIDs,
88
+ assignment,
89
+ } = signal;
82
90
  const minMax = { min: delta, max: delta };
83
91
 
84
92
  nodes.push({
@@ -104,6 +112,7 @@ export function generateTreeNodes(range: Range, spectrumData: Spectrum1D) {
104
112
  rangeKey,
105
113
  signalKey,
106
114
  diaIDs,
115
+ assignment,
107
116
  multiplicity,
108
117
  nodes,
109
118
  ...minMax,
@@ -62,8 +62,10 @@ function usePeaksPosition() {
62
62
  return { marginTop, isDragActive, onPointerDown };
63
63
  }
64
64
 
65
- interface PeakAnnotationsSpreadModeProps
66
- extends Omit<PeaksAnnotationsProps, 'xDomain'> {
65
+ interface PeakAnnotationsSpreadModeProps extends Omit<
66
+ PeaksAnnotationsProps,
67
+ 'xDomain'
68
+ > {
67
69
  height: number;
68
70
  margin: Margin;
69
71
  }
@@ -1,5 +1,10 @@
1
1
  import { yupResolver } from '@hookform/resolvers/yup';
2
- import type { KeyboardEvent, PropsWithChildren, ReactNode } from 'react';
2
+ import type {
3
+ KeyboardEvent,
4
+ MouseEvent,
5
+ PropsWithChildren,
6
+ ReactNode,
7
+ } from 'react';
3
8
  import {
4
9
  createContext,
5
10
  useCallback,
@@ -60,7 +65,7 @@ function usePeaksEditionManager() {
60
65
  return context;
61
66
  }
62
67
 
63
- function stopPropagation(e: any) {
68
+ function stopPropagation(e: MouseEvent) {
64
69
  e.stopPropagation();
65
70
  }
66
71
 
@@ -124,6 +129,7 @@ export function PeakEditionProvider({ children }: Required<PropsWithChildren>) {
124
129
  onContextMenu={() => setPeak(null)}
125
130
  style={{ position: 'relative' }}
126
131
  >
132
+ {children}
127
133
  {peak && (
128
134
  <div
129
135
  style={{
@@ -139,7 +145,6 @@ export function PeakEditionProvider({ children }: Required<PropsWithChildren>) {
139
145
  />
140
146
  </div>
141
147
  )}
142
- {children}
143
148
  </div>
144
149
  </PeaksEditionContext.Provider>
145
150
  );
@@ -170,7 +170,11 @@ const MemoizedPeaksPanel = memo(InnerPeaks);
170
170
 
171
171
  const emptyData = { peaks: {}, ranges: {}, info: {}, display: {} };
172
172
 
173
- export default function Peaks(props: any) {
173
+ interface PeaksProps {
174
+ peaksSource: PeaksSource;
175
+ }
176
+
177
+ export default function Peaks(props: PeaksProps) {
174
178
  const { peaksSource } = props;
175
179
  const {
176
180
  view: {
@@ -1,4 +1,4 @@
1
- import type { Range } from '@zakodium/nmr-types';
1
+ import type { Range, Signal1D } from '@zakodium/nmr-types';
2
2
  import { useRef } from 'react';
3
3
 
4
4
  import { FieldEdition } from '../../1d-2d/FieldEdition.js';
@@ -11,20 +11,22 @@ const marginTop = 15;
11
11
 
12
12
  interface AssignmentLabelProps {
13
13
  range: Range;
14
+ signal: Signal1D;
14
15
  width: number;
15
16
  stackIndex: number;
16
17
  }
17
18
 
18
19
  export function AssignmentLabel(props: AssignmentLabelProps) {
19
- const { range, width, stackIndex } = props;
20
- const { id, assignment } = range;
20
+ const { range, width, stackIndex, signal } = props;
21
+ const { id } = range;
22
+ const { assignment } = signal;
21
23
  const { showAssignmentsLabels } = useActiveSpectrumRangesViewState();
22
24
  const dispatch = useDispatch();
23
25
  const textRef = useRef<SVGTextElement>(null);
24
26
  const { margin } = useChartData();
25
27
  const { isNewAssignment, dismissNewLabel } = useTriggerNewAssignmentLabel(id);
26
28
 
27
- if ((!range.assignment || !showAssignmentsLabels) && !isNewAssignment) {
29
+ if ((!assignment || !showAssignmentsLabels) && !isNewAssignment) {
28
30
  return null;
29
31
  }
30
32
 
@@ -32,10 +34,11 @@ export function AssignmentLabel(props: AssignmentLabelProps) {
32
34
  dismissNewLabel();
33
35
 
34
36
  dispatch({
35
- type: 'CHANGE_RANGE_ASSIGNMENT_LABEL',
37
+ type: 'CHANGE_1D_SIGNAL_ASSIGNMENT_LABEL',
36
38
  payload: {
37
39
  value,
38
40
  rangeId: id,
41
+ signalId: signal.id,
39
42
  },
40
43
  });
41
44
  }
@@ -10,8 +10,8 @@ const fontSize = 12;
10
10
  const marginTop = 45;
11
11
 
12
12
  function getDiaIds(range: Range) {
13
- const { diaIDs = [], signals } = range;
14
- const ids = diaIDs.slice();
13
+ const { signals } = range;
14
+ const ids = [];
15
15
  for (const signal of signals) {
16
16
  if (signal?.diaIDs) {
17
17
  ids.push(...signal.diaIDs);
@@ -1,7 +1,5 @@
1
1
  import type { Range as RangeType } from '@zakodium/nmr-types';
2
2
  import { useRef } from 'react';
3
- import { LuLink, LuUnlink } from 'react-icons/lu';
4
- import { PiTextTBold, PiTextTSlashBold } from 'react-icons/pi';
5
3
 
6
4
  import {
7
5
  isSpectrum1D,
@@ -17,55 +15,48 @@ import { filterAssignedIDs } from '../../assignment/utilities/filterAssignedIDs.
17
15
  import { useChartData } from '../../context/ChartContext.js';
18
16
  import { useDispatch } from '../../context/DispatchContext.js';
19
17
  import { useLogger } from '../../context/LoggerContext.js';
20
- import { useShareData } from '../../context/ShareDataContext.js';
21
- import type { ActionsButtonsPopoverProps } from '../../elements/ActionsButtonsPopover.js';
22
18
  import { ActionsButtonsPopover } from '../../elements/ActionsButtonsPopover.js';
23
19
  import { useDialogData } from '../../elements/DialogManager.js';
24
20
  import { ResizerWithScale } from '../../elements/ResizerWithScale.js';
21
+ import type { Position } from '../../elements/resizer/SVGResizer.tsx';
25
22
  import { useHighlight } from '../../highlight/index.js';
26
23
  import { useActiveSpectrumRangesViewState } from '../../hooks/useActiveSpectrumRangesViewState.js';
27
24
  import { useHighlightColor } from '../../hooks/useHighlightColor.js';
28
25
  import { useResizerStatus } from '../../hooks/useResizerStatus.js';
29
26
  import useSpectrum from '../../hooks/useSpectrum.js';
30
27
  import { EditRangeModal } from '../../modal/editRange/EditRangeModal.js';
28
+ import type { StackOverlappingLabelsMapReturnType } from '../../utility/stackOverlappingLabels.ts';
31
29
  import { useIsInset } from '../inset/InsetProvider.js';
32
30
  import { IntegralIndicator } from '../integral/IntegralIndicator.js';
33
31
  import { useScaleX } from '../utilities/scale.js';
34
32
 
35
- import { AssignmentLabel } from './AssignmentLabel.js';
33
+ import { AssignmentLabel } from './AssignmentLabel.tsx';
36
34
  import { Atoms } from './Atoms.js';
35
+ import { useAssignmentsPopoverActionsButtons } from './useAssignmentsPopoverActionsButtons.tsx';
37
36
 
38
37
  interface RangeProps {
39
38
  selectedTool: string;
40
39
  range: RangeType;
41
- assignmentLabelStackIndex: number;
42
40
  relativeFormat: string;
41
+ signalsStackIndexes: StackOverlappingLabelsMapReturnType;
43
42
  }
44
43
 
45
44
  const minWidth = 10;
46
45
 
47
46
  function Range(options: RangeProps) {
48
- const { range, selectedTool, relativeFormat, assignmentLabelStackIndex } =
49
- options;
50
- const {
51
- id,
52
- integration,
53
- signals,
54
- from,
55
- to,
56
- diaIDs: rangeDiaIDs,
57
- assignment,
58
- } = range;
47
+ const { range, selectedTool, relativeFormat, signalsStackIndexes } = options;
48
+ const { id, integration, signals, from, to } = range;
59
49
  const isInset = useIsInset();
60
50
  const spectrum = useSpectrum();
61
51
  const isAssignBtnTrigged = useRef(false);
62
52
  const { margin } = useChartData();
53
+ const signal = signals?.[0];
63
54
 
64
55
  const highlightColor = useHighlightColor();
65
56
  const assignmentData = useAssignmentContext();
66
- const assignmentRange = useAssignment(id);
57
+ const signalAssignment = useAssignment(signal?.id || '');
67
58
  const highlightRange = useHighlight(
68
- [id].concat(assignmentRange.assignedDiaIds?.x || []).concat(
59
+ [id].concat(signalAssignment.assignedDiaIds?.x || []).concat(
69
60
  filterAssignedIDs(
70
61
  assignmentData.data,
71
62
  signals.map((_signal) => _signal.id),
@@ -86,7 +77,7 @@ function Range(options: RangeProps) {
86
77
 
87
78
  const isBlockedByEditing = selectedTool && isDialogOpen(EditRangeModal);
88
79
 
89
- function handleOnStopResizing(position: any) {
80
+ function handleOnStopResizing(position: Position) {
90
81
  if (!spectrum || !isSpectrum1D(spectrum)) return;
91
82
  const from = scaleX().invert(position.x2);
92
83
  const to = scaleX().invert(position.x1);
@@ -105,80 +96,53 @@ function Range(options: RangeProps) {
105
96
  }
106
97
 
107
98
  function mouseEnterHandler() {
108
- assignmentRange.highlight('x');
99
+ signalAssignment.highlight('x');
109
100
  highlightRange.show();
110
101
  }
111
102
 
112
103
  function mouseLeaveHandler() {
113
- assignmentRange.clearHighlight();
104
+ signalAssignment.clearHighlight();
114
105
  highlightRange.hide();
115
106
  }
116
107
 
117
108
  function assignHandler() {
118
109
  if (!isBlockedByEditing) {
119
110
  isAssignBtnTrigged.current = true;
120
- assignmentRange.activate('x');
111
+ signalAssignment.activate('x');
121
112
  }
122
113
  }
123
114
 
124
- function unAssignHandler(signalIndex = -1) {
115
+ function unAssignHandler() {
125
116
  dispatch({
126
- type: 'UNLINK_RANGE',
117
+ type: 'UNASSIGN_1D_SIGNAL',
127
118
  payload: {
128
119
  rangeKey: range.id,
129
- signalIndex,
120
+ signalIndex: 0,
130
121
  },
131
122
  });
132
123
  }
133
- const isAssignmentActive = assignmentRange.isActive;
124
+ const isAssignmentActive = signalAssignment.isActive;
134
125
  const opacity = getOpacityBasedOnSignalKind(range);
135
126
 
136
127
  const isHighlighted =
137
128
  isBlockedByEditing || highlightRange.isActive || isAssignmentActive;
138
129
 
139
- const isAssigned = isRangeAssigned(range);
130
+ const isSignalAssigned = isRangeAssigned(range);
140
131
  const isResizingActive = useResizerStatus('rangePicking');
141
- const { setData: addNewAssignmentLabel } = useShareData();
142
-
143
- function removeAssignmentLabel() {
144
- dispatch({
145
- type: 'CHANGE_RANGE_ASSIGNMENT_LABEL',
146
- payload: {
147
- value: '',
148
- rangeId: id,
149
- },
150
- });
151
- }
152
-
153
- const actionsButtons: ActionsButtonsPopoverProps['buttons'] = [
154
- {
155
- icon: <LuLink />,
156
- onClick: assignHandler,
157
- intent: 'success',
158
- title: 'Assign range',
159
- },
160
- {
161
- icon: <LuUnlink />,
162
- onClick: () => unAssignHandler(),
163
- intent: 'danger',
164
- title: 'Unassign range',
165
- visible: !!(isAssignmentActive || rangeDiaIDs),
166
- },
167
- {
168
- icon: <PiTextTBold />,
169
- onClick: () => addNewAssignmentLabel(range.id),
170
- intent: 'success',
171
- title: 'Add assignment label',
172
- visible: !assignment,
173
- },
174
- {
175
- icon: <PiTextTSlashBold />,
176
- onClick: removeAssignmentLabel,
177
- intent: 'danger',
178
- title: 'Remove assignment label',
179
- visible: !!assignment,
180
- },
181
- ];
132
+ const hasOnlyOneSignal = signals.length === 1;
133
+ const isAssigned =
134
+ hasOnlyOneSignal && signal.diaIDs ? signal.diaIDs.length > 0 : false;
135
+
136
+ const actionsButtons = useAssignmentsPopoverActionsButtons({
137
+ isToggleMultiplicityTreeButtonVisible: !hasOnlyOneSignal,
138
+ isAssignButtonVisible: hasOnlyOneSignal,
139
+ isUnAssignButtonVisible: isAssignmentActive || isSignalAssigned,
140
+ isAssignLabelButtonVisible: hasOnlyOneSignal && !signal.assignment,
141
+ isUnAssignLabelButtonVisible: hasOnlyOneSignal && !!signal.assignment,
142
+ onAssign: assignHandler,
143
+ onUnAssign: unAssignHandler,
144
+ rangeId: range.id,
145
+ });
182
146
 
183
147
  const isOpen = isAssignBtnTrigged.current ? isAssignmentActive : undefined;
184
148
 
@@ -236,12 +200,16 @@ function Range(options: RangeProps) {
236
200
  fill={isHighlighted || isActive ? '#ff6f0057' : 'transparent'}
237
201
  data-no-export="true"
238
202
  />
203
+ {range.signals.map((signal) => (
204
+ <AssignmentLabel
205
+ key={signal.id}
206
+ stackIndex={signalsStackIndexes?.[signal.id] || 0}
207
+ range={range}
208
+ width={rangeWidth}
209
+ signal={signal}
210
+ />
211
+ ))}
239
212
 
240
- <AssignmentLabel
241
- stackIndex={assignmentLabelStackIndex}
242
- range={range}
243
- width={rangeWidth}
244
- />
245
213
  <Atoms range={range} x={rangeWidth / 2} />
246
214
 
247
215
  {showIntegralsValues && (
@@ -7,7 +7,6 @@ import { memo } from 'react';
7
7
 
8
8
  import { useChartData } from '../../context/ChartContext.js';
9
9
  import { useScaleChecked } from '../../context/ScaleContext.js';
10
- import { ShareDataProvider } from '../../context/ShareDataContext.js';
11
10
  import { usePanelPreferences } from '../../hooks/usePanelPreferences.js';
12
11
  import useSpectrum from '../../hooks/useSpectrum.js';
13
12
  import { useTextMetrics } from '../../hooks/useTextMetrics.ts';
@@ -26,6 +25,8 @@ const labelSize = 14;
26
25
  type ProcessedRange = RangeType & {
27
26
  labelWidth: number;
28
27
  startPosition: number;
28
+ signalId: string;
29
+ assignment: string;
29
30
  };
30
31
 
31
32
  function useStackRangesAssignmentsLabels(ranges: RangeType[]) {
@@ -35,23 +36,32 @@ function useStackRangesAssignmentsLabels(ranges: RangeType[]) {
35
36
 
36
37
  if (ranges.length === 0) return null;
37
38
 
38
- const processedRanges: ProcessedRange[] = ranges.map((range) => {
39
- const { from, assignment = '' } = range;
40
- const labelWidth = getTextWidth(assignment);
39
+ const processedRanges: ProcessedRange[] = [];
41
40
 
42
- return {
43
- ...range,
44
- labelWidth,
45
- startPosition: scaleX()(from),
46
- };
47
- });
48
- processedRanges.sort((a, b) => b.from - a.from);
41
+ for (const range of ranges) {
42
+ const { from, signals } = range;
43
+
44
+ const startPosition = scaleX()(from);
45
+ for (const signal of signals) {
46
+ const { id, assignment = '' } = signal;
47
+ const labelWidth = getTextWidth(assignment);
49
48
 
49
+ processedRanges.push({
50
+ ...range,
51
+ labelWidth,
52
+ startPosition,
53
+ signalId: id,
54
+ assignment,
55
+ });
56
+ }
57
+ }
58
+
59
+ processedRanges.sort((a, b) => b.startPosition - a.startPosition);
50
60
  return stackOverlappingLabelsMap(processedRanges, {
51
61
  startPositionKey: 'startPosition',
52
62
  labelWidthKey: 'labelWidth',
53
63
  padding: 0,
54
- idKey: 'id',
64
+ idKey: 'signalId',
55
65
  });
56
66
  }
57
67
 
@@ -63,23 +73,18 @@ function RangesInner({
63
73
  const assignmentLabelsStackIndexes = useStackRangesAssignmentsLabels(
64
74
  ranges.values,
65
75
  );
66
-
67
76
  return (
68
- <ShareDataProvider>
69
- <g>
70
- {ranges.values.map((range) => (
71
- <Range
72
- key={range.id}
73
- range={range}
74
- selectedTool={selectedTool}
75
- relativeFormat={relativeFormat}
76
- assignmentLabelStackIndex={
77
- assignmentLabelsStackIndexes?.[range.id] || 0
78
- }
79
- />
80
- ))}
81
- </g>
82
- </ShareDataProvider>
77
+ <g>
78
+ {ranges.values.map((range) => (
79
+ <Range
80
+ key={range.id}
81
+ range={range}
82
+ selectedTool={selectedTool}
83
+ relativeFormat={relativeFormat}
84
+ signalsStackIndexes={assignmentLabelsStackIndexes || {}}
85
+ />
86
+ ))}
87
+ </g>
83
88
  );
84
89
  }
85
90
 
@@ -0,0 +1,93 @@
1
+ import { FaSitemap } from 'react-icons/fa';
2
+ import { LuLink, LuUnlink } from 'react-icons/lu';
3
+ import { PiTextTBold, PiTextTSlashBold } from 'react-icons/pi';
4
+
5
+ import { useDispatch } from '../../context/DispatchContext.tsx';
6
+ import { useShareData } from '../../context/ShareDataContext.tsx';
7
+ import type { ActionsButtonsPopoverProps } from '../../elements/ActionsButtonsPopover.tsx';
8
+ import { useActiveSpectrumRangesViewState } from '../../hooks/useActiveSpectrumRangesViewState.ts';
9
+ import { booleanToString } from '../../utility/booleanToString.ts';
10
+
11
+ interface UseAssignmentsPopoverActionsButtonsOptions {
12
+ isAssignButtonVisible?: boolean;
13
+ isUnAssignButtonVisible?: boolean;
14
+ isAssignLabelButtonVisible?: boolean;
15
+ isUnAssignLabelButtonVisible?: boolean;
16
+ isToggleMultiplicityTreeButtonVisible?: boolean;
17
+ onAssign: () => void;
18
+ onUnAssign: () => void;
19
+ rangeId: string;
20
+ }
21
+
22
+ export function useAssignmentsPopoverActionsButtons(
23
+ options: UseAssignmentsPopoverActionsButtonsOptions,
24
+ ): ActionsButtonsPopoverProps['buttons'] {
25
+ const {
26
+ rangeId,
27
+ onAssign,
28
+ onUnAssign,
29
+ isAssignButtonVisible,
30
+ isUnAssignButtonVisible,
31
+ isAssignLabelButtonVisible,
32
+ isUnAssignLabelButtonVisible,
33
+ isToggleMultiplicityTreeButtonVisible = false,
34
+ } = options;
35
+ const dispatch = useDispatch();
36
+ const { setData: addNewAssignmentLabel } = useShareData();
37
+ const { showMultiplicityTrees } = useActiveSpectrumRangesViewState();
38
+ function removeAssignmentLabel() {
39
+ dispatch({
40
+ type: 'CHANGE_1D_SIGNAL_ASSIGNMENT_LABEL',
41
+ payload: {
42
+ value: '',
43
+ rangeId,
44
+ },
45
+ });
46
+ }
47
+
48
+ function handleShowJGraph() {
49
+ dispatch({
50
+ type: 'TOGGLE_RANGES_VIEW_PROPERTY',
51
+ payload: { key: 'showMultiplicityTrees' },
52
+ });
53
+ }
54
+
55
+ const actionsButtons: ActionsButtonsPopoverProps['buttons'] = [
56
+ {
57
+ icon: <FaSitemap />,
58
+ title: `${booleanToString(!showMultiplicityTrees)} J Graph`,
59
+ onClick: handleShowJGraph,
60
+ visible: isToggleMultiplicityTreeButtonVisible && !showMultiplicityTrees,
61
+ },
62
+ {
63
+ icon: <LuLink />,
64
+ onClick: onAssign,
65
+ intent: 'success',
66
+ title: 'Assign multiplet',
67
+ visible: isAssignButtonVisible,
68
+ },
69
+ {
70
+ icon: <LuUnlink />,
71
+ onClick: onUnAssign,
72
+ intent: 'danger',
73
+ title: 'Unassign multiplet',
74
+ visible: isUnAssignButtonVisible,
75
+ },
76
+ {
77
+ icon: <PiTextTBold />,
78
+ onClick: () => addNewAssignmentLabel(rangeId),
79
+ intent: 'success',
80
+ title: 'Add assignment label',
81
+ visible: isAssignLabelButtonVisible,
82
+ },
83
+ {
84
+ icon: <PiTextTSlashBold />,
85
+ onClick: removeAssignmentLabel,
86
+ intent: 'danger',
87
+ title: 'Remove assignment label',
88
+ visible: isUnAssignLabelButtonVisible,
89
+ },
90
+ ];
91
+
92
+ return actionsButtons;
93
+ }
@@ -4,6 +4,7 @@ import { useChartData } from '../../context/ChartContext.js';
4
4
  import { useDispatch } from '../../context/DispatchContext.js';
5
5
  import { useScaleChecked } from '../../context/ScaleContext.js';
6
6
  import { ResizerWithScale } from '../../elements/ResizerWithScale.js';
7
+ import type { Position } from '../../elements/resizer/SVGResizer.tsx';
7
8
  import { useHighlight } from '../../highlight/index.js';
8
9
  import { useResizerStatus } from '../../hooks/useResizerStatus.js';
9
10
  import { useIsInset } from '../inset/InsetProvider.js';
@@ -44,7 +45,7 @@ function BaseLineZone(props: BaselineCorrectionZone) {
44
45
  const { scaleX } = useScaleChecked();
45
46
  const dispatch = useDispatch();
46
47
 
47
- function handleOnStopResizing(position: any) {
48
+ function handleOnStopResizing(position: Position) {
48
49
  dispatch({
49
50
  type: 'RESIZE_BASE_LINE_ZONE',
50
51
  payload: {
@@ -9,8 +9,7 @@ interface GroupDataProps<T> {
9
9
  }
10
10
 
11
11
  interface ResolveIntersectionProps<T>
12
- extends GroupDataProps<T>,
13
- ResolveGroupIntersectionProps {
12
+ extends GroupDataProps<T>, ResolveGroupIntersectionProps {
14
13
  width?: number;
15
14
  margin?: number;
16
15
  }
@@ -51,8 +50,8 @@ function groupData<T>(data: T[], options: Required<GroupDataProps<T>>) {
51
50
  return groups;
52
51
  }
53
52
 
54
- function resolveGroupsIntersection(
55
- groups: any,
53
+ function resolveGroupsIntersection<T>(
54
+ groups: Array<ResolveData<T>>,
56
55
  options: ResolveGroupIntersectionProps,
57
56
  ) {
58
57
  const { maxIteration = 3, groupMargin = 0 } = options;
@@ -2,7 +2,7 @@ import type { PopoverProps } from '@blueprintjs/core';
2
2
  import { Popover } from '@blueprintjs/core';
3
3
  import styled from '@emotion/styled';
4
4
  import { yupResolver } from '@hookform/resolvers/yup';
5
- import type { ReactNode } from 'react';
5
+ import type { MouseEvent, ReactNode } from 'react';
6
6
  import { useState } from 'react';
7
7
  import { useForm } from 'react-hook-form';
8
8
  import * as Yup from 'yup';
@@ -34,7 +34,7 @@ const validationSchema = (inputType: 'number' | 'text') =>
34
34
  value: (inputType === 'number' ? Yup.number() : Yup.string()).required(),
35
35
  });
36
36
 
37
- function stopPropagation(e: any) {
37
+ function stopPropagation(e: MouseEvent) {
38
38
  e.stopPropagation();
39
39
  }
40
40
 
@@ -19,7 +19,7 @@ interface usePathOptions extends BaseProps {
19
19
  width?: number;
20
20
  }
21
21
 
22
- function usePath(data: any, props: usePathOptions) {
22
+ function usePath(data: NmrData1D, props: usePathOptions) {
23
23
  const { reverse, width = 100, horizontalMargin = 10 } = props;
24
24
  const { mode } = useChartData();
25
25
  const scaleX = useScale2DY(reverse);
@@ -37,7 +37,7 @@ function usePath(data: any, props: usePathOptions) {
37
37
 
38
38
  const pathBuilder = new PathBuilder();
39
39
 
40
- pathBuilder.moveTo(scaleY(y.at(-1)), scaleX(x.at(-1)));
40
+ pathBuilder.moveTo(scaleY(y.at(-1) as number), scaleX(x.at(-1) as number));
41
41
 
42
42
  for (let i = x.length - 2; i >= 0; i--) {
43
43
  pathBuilder.lineTo(scaleY(y[i]), scaleX(x[i]));
@@ -8,7 +8,7 @@ export function PhaseTraces() {
8
8
  const { width, height, margin, displayerKey } = useChartData();
9
9
  const activeSpectrum = useActiveSpectrum();
10
10
 
11
- if (!activeSpectrum?.id || !width || !height) return null;
11
+ if (!activeSpectrum || !width || !height) return null;
12
12
 
13
13
  const clipWidth = width - margin.left - margin.right;
14
14
  const clipHeight = height - margin.top - margin.bottom;
@@ -78,7 +78,7 @@ export function SpectrumPhaseTrace(props: SpectrumPhaseTraceProps) {
78
78
  const scale2dY = useScale2DY();
79
79
 
80
80
  const activeSpectrum = useActiveSpectrum();
81
- if (!activeSpectrum?.id) {
81
+ if (!activeSpectrum) {
82
82
  return null;
83
83
  }
84
84