nmrium 0.27.0 → 0.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (307) hide show
  1. package/lib/component/1d/ExclusionZonesAnnotations.js +1 -1
  2. package/lib/component/1d/IntegralsSeries.js +2 -6
  3. package/lib/component/1d/PeakAnnotation.js +2 -2
  4. package/lib/component/1d/PeakAnnotations.js +2 -4
  5. package/lib/component/1d/SpectraTracker.js +2 -2
  6. package/lib/component/1d/Viewer1D.js +1 -1
  7. package/lib/component/1d/database/DatabaseSpectrum.js +28 -26
  8. package/lib/component/1d/ranges/Range.d.ts +1 -2
  9. package/lib/component/1d/ranges/Range.js +3 -4
  10. package/lib/component/1d/ranges/Ranges.js +3 -4
  11. package/lib/component/1d/tool/BaseLineZones.js +3 -6
  12. package/lib/component/1d/tool/VerticalIndicator.js +1 -1
  13. package/lib/component/2d/Contours.js +1 -5
  14. package/lib/component/2d/SignalDeltaLine.js +1 -1
  15. package/lib/component/2d/Viewer2D.js +1 -1
  16. package/lib/component/2d/YAxis.js +2 -2
  17. package/lib/component/2d/zones/IndicationLines.js +2 -3
  18. package/lib/component/EventsTrackers/KeysListenerTracker.js +59 -41
  19. package/lib/component/NMRium.d.ts +14 -49
  20. package/lib/component/NMRium.js +14 -6
  21. package/lib/component/SplitPaneWrapper.js +2 -2
  22. package/lib/component/context/PreferencesContext.d.ts +3 -43
  23. package/lib/component/elements/Button.js +1 -1
  24. package/lib/component/elements/Logo.js +1 -1
  25. package/lib/component/elements/ReactTable/Elements/ReactTableRow.js +1 -0
  26. package/lib/component/elements/Tab/Tabs.js +2 -1
  27. package/lib/component/elements/ToggleButton.js +2 -2
  28. package/lib/component/elements/accordion/Accordion.js +2 -6
  29. package/lib/component/elements/formik/Input.js +1 -1
  30. package/lib/component/elements/popup/Modal/Modal.js +1 -1
  31. package/lib/component/elements/popup/Modal/ModalContent.js +1 -1
  32. package/lib/component/elements/toggle/ToggleButtonGroup.js +2 -2
  33. package/lib/component/header/BaseLineCorrectionPanel.js +7 -4
  34. package/lib/component/header/Header.js +2 -2
  35. package/lib/component/header/ZeroFillingOptionsPanel.js +1 -1
  36. package/lib/component/hooks/useActiveSpectrumStyleOptions.js +1 -1
  37. package/lib/component/hooks/useCheckToolsVisibility.d.ts +2 -1
  38. package/lib/component/hooks/useCheckToolsVisibility.js +2 -1
  39. package/lib/component/hooks/useExport.js +2 -2
  40. package/lib/component/hooks/useFormatNumberByNucleus.js +3 -4
  41. package/lib/component/loader/DropZone.js +8 -2
  42. package/lib/component/loader/NoData.d.ts +3 -2
  43. package/lib/component/loader/NoData.js +31 -30
  44. package/lib/component/modal/MoleculeStructureEditorModal.js +2 -2
  45. package/lib/component/modal/editRange/EditRangeModal.d.ts +3 -3
  46. package/lib/component/modal/editRange/EditRangeModal.js +49 -54
  47. package/lib/component/modal/editRange/forms/components/AddSignalFormTab.js +9 -22
  48. package/lib/component/modal/editRange/forms/components/CouplingsTable.js +12 -50
  49. package/lib/component/modal/editRange/forms/components/SignalFormInfo.d.ts +2 -0
  50. package/lib/component/modal/editRange/forms/components/SignalFormInfo.js +34 -0
  51. package/lib/component/modal/editRange/forms/components/SignalFormTab.d.ts +1 -1
  52. package/lib/component/modal/editRange/forms/components/SignalFormTab.js +11 -14
  53. package/lib/component/modal/editRange/forms/components/SignalsForm.d.ts +2 -1
  54. package/lib/component/modal/editRange/forms/components/SignalsForm.js +18 -29
  55. package/lib/component/modal/editZone/SignalsForm.js +1 -1
  56. package/lib/component/modal/setting/DatabasesTabContent.d.ts +2 -1
  57. package/lib/component/modal/setting/DatabasesTabContent.js +28 -30
  58. package/lib/component/modal/setting/settingsValidation.d.ts +150 -42
  59. package/lib/component/modal/setting/settingsValidation.js +6 -4
  60. package/lib/component/panels/IntegralsPanel/IntegralPanel.js +13 -15
  61. package/lib/component/panels/MoleculesPanel/MoleculePanel.js +8 -15
  62. package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +1 -1
  63. package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleAnalysisCodeEditor.js +2 -2
  64. package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPreferences.js +1 -1
  65. package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +2 -2
  66. package/lib/component/panels/Panels.js +1 -1
  67. package/lib/component/panels/PeaksPanel/PeaksPanel.js +1 -1
  68. package/lib/component/panels/RangesPanel/RangesHeader.js +12 -3
  69. package/lib/component/panels/RangesPanel/RangesPanel.js +19 -19
  70. package/lib/component/panels/RangesPanel/TableColumns/ActionsColumn.js +1 -1
  71. package/lib/component/panels/RangesPanel/TableColumns/format.d.ts +1 -1
  72. package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.d.ts +4 -4
  73. package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.js +48 -30
  74. package/lib/component/panels/SpectrumsPanel/SpectrumsTabs.js +3 -3
  75. package/lib/component/panels/SpectrumsPanel/base/ShowHideMarkersButton.js +1 -1
  76. package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +3 -3
  77. package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnHeader.js +2 -2
  78. package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +2 -2
  79. package/lib/component/panels/SummaryPanel/SummaryPanel.js +6 -8
  80. package/lib/component/panels/SummaryPanel/utilities/Utilities.js +6 -8
  81. package/lib/component/panels/SummaryPanel/utilities/{IsInView.d.ts → useInView.d.ts} +2 -2
  82. package/lib/component/panels/SummaryPanel/utilities/{IsInView.js → useInView.js} +2 -2
  83. package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +1 -1
  84. package/lib/component/panels/ZonesPanel/ZonesPanel.js +13 -13
  85. package/lib/component/panels/databasePanel/DatabasePanel.d.ts +4 -0
  86. package/lib/component/panels/databasePanel/DatabasePanel.js +80 -26
  87. package/lib/component/panels/databasePanel/DatabasePreferences.js +1 -1
  88. package/lib/component/panels/databasePanel/DatabaseStructureSearchModal.d.ts +7 -0
  89. package/lib/component/panels/databasePanel/DatabaseStructureSearchModal.js +8 -0
  90. package/lib/component/panels/databasePanel/DatabaseTable.js +14 -9
  91. package/lib/component/panels/extra/preferences/ColumnsHelper.js +2 -4
  92. package/lib/component/panels/header/DefaultPanelHeader.js +1 -3
  93. package/lib/component/panels/header/SpectraAutomaticPickingButton.js +1 -1
  94. package/lib/component/reducer/Reducer.d.ts +8 -66
  95. package/lib/component/reducer/Reducer.js +13 -8
  96. package/lib/component/reducer/actions/DatabaseActions.d.ts +3 -2
  97. package/lib/component/reducer/actions/DatabaseActions.js +21 -3
  98. package/lib/component/reducer/actions/DomainActions.js +1 -1
  99. package/lib/component/reducer/actions/FiltersActions.d.ts +2 -1
  100. package/lib/component/reducer/actions/FiltersActions.js +25 -4
  101. package/lib/component/reducer/actions/PreferencesActions.js +32 -20
  102. package/lib/component/reducer/actions/RangesActions.d.ts +2 -2
  103. package/lib/component/reducer/actions/RangesActions.js +45 -11
  104. package/lib/component/reducer/actions/SpectrumsActions.js +6 -9
  105. package/lib/component/reducer/actions/ToolsActions.js +66 -53
  106. package/lib/component/reducer/helper/getSpectrum.d.ts +5 -0
  107. package/lib/component/reducer/helper/getSpectrum.js +14 -0
  108. package/lib/component/reducer/preferences/actions/initPreferences.js +1 -1
  109. package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js +4 -4
  110. package/lib/component/reducer/preferences/preferencesReducer.d.ts +23 -10
  111. package/lib/component/reducer/preferences/preferencesReducer.js +1 -1
  112. package/lib/component/reducer/types/Types.d.ts +3 -1
  113. package/lib/component/reducer/types/Types.js +3 -1
  114. package/lib/component/tool/BrushX.js +1 -1
  115. package/lib/component/tool/BrushXY.js +1 -1
  116. package/lib/component/tool/CrossLinePointer.js +1 -1
  117. package/lib/component/tool/FloatMoleculeStructures/DraggableStructure.js +4 -3
  118. package/lib/component/toolbar/BasicToolBar.js +0 -1
  119. package/lib/component/toolbar/FunctionToolBar.js +9 -13
  120. package/lib/component/toolbar/ToolTypes.d.ts +1 -1
  121. package/lib/component/toolbar/ToolTypes.js +3 -3
  122. package/lib/component/utility/Export.d.ts +7 -1
  123. package/lib/component/utility/Export.js +3 -3
  124. package/lib/component/utility/formatNumber.d.ts +1 -1
  125. package/lib/component/utility/formatNumber.js +4 -2
  126. package/lib/component/utility/isGoogleDocument.d.ts +1 -0
  127. package/lib/component/utility/isGoogleDocument.js +3 -0
  128. package/lib/component/utility/nmredataToNmrium.js +1 -2
  129. package/lib/component/utility/nmriumToNmredata.d.ts +2 -2
  130. package/lib/component/utility/nmriumToNmredata.js +2 -2
  131. package/lib/component/utility/util/nmredata/addSource.js +2 -2
  132. package/lib/component/workspaces/Workspace.d.ts +9 -4
  133. package/lib/component/workspaces/basic.js +15 -8
  134. package/lib/component/workspaces/exercise.js +2 -2
  135. package/lib/component/workspaces/process1D.js +1 -1
  136. package/lib/data/FiltersManager.js +1 -1
  137. package/lib/data/PredictionManager.js +7 -9
  138. package/lib/data/SpectraManager.d.ts +4 -12
  139. package/lib/data/SpectraManager.js +14 -23
  140. package/lib/data/data1d/Data1DManager.js +8 -1
  141. package/lib/data/data1d/Spectrum1D/generateJGraphData.js +8 -10
  142. package/lib/data/data1d/Spectrum1D/getReferenceShift.js +1 -1
  143. package/lib/data/data1d/Spectrum1D/integrals/updateRelatives.js +5 -7
  144. package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +1 -1
  145. package/lib/data/data1d/Spectrum1D/ranges/addRange.d.ts +36 -2
  146. package/lib/data/data1d/Spectrum1D/ranges/addRange.js +38 -15
  147. package/lib/data/data1d/Spectrum1D/ranges/detectSignal.js +3 -3
  148. package/lib/data/data1d/Spectrum1D/ranges/mapRanges.js +1 -1
  149. package/lib/data/data1d/database.d.ts +5 -3
  150. package/lib/data/data1d/database.js +54 -4
  151. package/lib/data/data1d/filter1d/lineBroadening.js +1 -1
  152. package/lib/data/data2d/Processing2D.js +1 -1
  153. package/lib/data/molecules/Molecule.d.ts +4 -5
  154. package/lib/data/molecules/Molecule.js +3 -1
  155. package/lib/data/utilities/FindUtilities.js +1 -3
  156. package/lib/data/utilities/RangeUtilities.js +5 -6
  157. package/lib/data/utilities/ZoneUtilities.js +1 -1
  158. package/lib/data/utilities/getSum.js +1 -3
  159. package/lib/data/utilities/isMolFileEmpty.d.ts +1 -0
  160. package/lib/data/utilities/isMolFileEmpty.js +6 -0
  161. package/lib/types/NMRiumDataReturn.d.ts +15 -0
  162. package/lib/types/NMRiumDataReturn.js +1 -0
  163. package/lib/types/NMRiumGeneralPreferences.d.ts +10 -0
  164. package/lib/types/NMRiumGeneralPreferences.js +1 -0
  165. package/lib/types/NMRiumPanelPreferences.d.ts +16 -0
  166. package/lib/types/NMRiumPanelPreferences.js +1 -0
  167. package/lib/types/NMRiumToolBarPreferences.d.ts +20 -0
  168. package/lib/types/NMRiumToolBarPreferences.js +1 -0
  169. package/lib/types/Preferences.d.ts +5 -0
  170. package/lib/types/Preferences.js +1 -0
  171. package/lib/versionInfo.js +1 -1
  172. package/lib-cjs/component/1d/ExclusionZonesAnnotations.js +1 -1
  173. package/lib-cjs/component/1d/IntegralsSeries.js +2 -6
  174. package/lib-cjs/component/1d/PeakAnnotation.js +2 -2
  175. package/lib-cjs/component/1d/PeakAnnotations.js +2 -4
  176. package/lib-cjs/component/1d/SpectraTracker.js +2 -2
  177. package/lib-cjs/component/1d/Viewer1D.js +1 -1
  178. package/lib-cjs/component/1d/database/DatabaseSpectrum.js +30 -25
  179. package/lib-cjs/component/1d/ranges/Range.js +3 -4
  180. package/lib-cjs/component/1d/ranges/Ranges.js +3 -4
  181. package/lib-cjs/component/1d/tool/BaseLineZones.js +3 -6
  182. package/lib-cjs/component/1d/tool/VerticalIndicator.js +1 -1
  183. package/lib-cjs/component/2d/Contours.js +1 -5
  184. package/lib-cjs/component/2d/SignalDeltaLine.js +1 -1
  185. package/lib-cjs/component/2d/Viewer2D.js +1 -1
  186. package/lib-cjs/component/2d/YAxis.js +1 -1
  187. package/lib-cjs/component/2d/zones/IndicationLines.js +2 -3
  188. package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +59 -41
  189. package/lib-cjs/component/NMRium.js +13 -5
  190. package/lib-cjs/component/SplitPaneWrapper.js +2 -2
  191. package/lib-cjs/component/elements/Button.js +1 -1
  192. package/lib-cjs/component/elements/Logo.js +1 -1
  193. package/lib-cjs/component/elements/ReactTable/Elements/ReactTableRow.js +1 -0
  194. package/lib-cjs/component/elements/Tab/Tabs.js +2 -1
  195. package/lib-cjs/component/elements/ToggleButton.js +2 -2
  196. package/lib-cjs/component/elements/accordion/Accordion.js +2 -6
  197. package/lib-cjs/component/elements/formik/Input.js +1 -1
  198. package/lib-cjs/component/elements/popup/Modal/Modal.js +1 -1
  199. package/lib-cjs/component/elements/popup/Modal/ModalContent.js +1 -1
  200. package/lib-cjs/component/elements/toggle/ToggleButtonGroup.js +2 -2
  201. package/lib-cjs/component/header/BaseLineCorrectionPanel.js +6 -3
  202. package/lib-cjs/component/header/Header.js +2 -2
  203. package/lib-cjs/component/header/ZeroFillingOptionsPanel.js +1 -1
  204. package/lib-cjs/component/hooks/useActiveSpectrumStyleOptions.js +1 -1
  205. package/lib-cjs/component/hooks/useCheckToolsVisibility.js +2 -1
  206. package/lib-cjs/component/hooks/useExport.js +2 -2
  207. package/lib-cjs/component/hooks/useFormatNumberByNucleus.js +2 -3
  208. package/lib-cjs/component/loader/DropZone.js +8 -2
  209. package/lib-cjs/component/loader/NoData.js +31 -30
  210. package/lib-cjs/component/modal/MoleculeStructureEditorModal.js +2 -2
  211. package/lib-cjs/component/modal/editRange/EditRangeModal.js +47 -52
  212. package/lib-cjs/component/modal/editRange/forms/components/AddSignalFormTab.js +9 -22
  213. package/lib-cjs/component/modal/editRange/forms/components/CouplingsTable.js +12 -50
  214. package/lib-cjs/component/modal/editRange/forms/components/SignalFormInfo.js +38 -0
  215. package/lib-cjs/component/modal/editRange/forms/components/SignalFormTab.js +13 -16
  216. package/lib-cjs/component/modal/editRange/forms/components/SignalsForm.js +18 -29
  217. package/lib-cjs/component/modal/editZone/SignalsForm.js +1 -1
  218. package/lib-cjs/component/modal/setting/DatabasesTabContent.js +31 -33
  219. package/lib-cjs/component/modal/setting/settingsValidation.js +6 -4
  220. package/lib-cjs/component/panels/IntegralsPanel/IntegralPanel.js +12 -14
  221. package/lib-cjs/component/panels/MoleculesPanel/MoleculePanel.js +8 -15
  222. package/lib-cjs/component/panels/MoleculesPanel/useAtomAssignment.js +1 -1
  223. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPreferences.js +1 -1
  224. package/lib-cjs/component/panels/Panels.js +1 -1
  225. package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +1 -1
  226. package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +10 -1
  227. package/lib-cjs/component/panels/RangesPanel/RangesPanel.js +18 -18
  228. package/lib-cjs/component/panels/RangesPanel/TableColumns/ActionsColumn.js +1 -1
  229. package/lib-cjs/component/panels/RangesPanel/hooks/useEditRangeModal.js +47 -29
  230. package/lib-cjs/component/panels/SpectrumsPanel/SpectrumsTabs.js +1 -1
  231. package/lib-cjs/component/panels/SpectrumsPanel/base/ShowHideMarkersButton.js +1 -1
  232. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +3 -3
  233. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnHeader.js +2 -2
  234. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +2 -2
  235. package/lib-cjs/component/panels/SummaryPanel/SummaryPanel.js +6 -8
  236. package/lib-cjs/component/panels/SummaryPanel/utilities/Utilities.js +6 -8
  237. package/lib-cjs/component/panels/SummaryPanel/utilities/{IsInView.js → useInView.js} +2 -2
  238. package/lib-cjs/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +1 -1
  239. package/lib-cjs/component/panels/ZonesPanel/ZonesPanel.js +12 -12
  240. package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +78 -24
  241. package/lib-cjs/component/panels/databasePanel/DatabasePreferences.js +1 -1
  242. package/lib-cjs/component/panels/databasePanel/DatabaseStructureSearchModal.js +15 -0
  243. package/lib-cjs/component/panels/databasePanel/DatabaseTable.js +14 -9
  244. package/lib-cjs/component/panels/extra/preferences/ColumnsHelper.js +2 -4
  245. package/lib-cjs/component/panels/header/DefaultPanelHeader.js +1 -3
  246. package/lib-cjs/component/panels/header/SpectraAutomaticPickingButton.js +1 -1
  247. package/lib-cjs/component/reducer/Reducer.js +13 -8
  248. package/lib-cjs/component/reducer/actions/DatabaseActions.js +22 -3
  249. package/lib-cjs/component/reducer/actions/DomainActions.js +1 -1
  250. package/lib-cjs/component/reducer/actions/FiltersActions.js +26 -4
  251. package/lib-cjs/component/reducer/actions/PreferencesActions.js +30 -18
  252. package/lib-cjs/component/reducer/actions/RangesActions.js +46 -12
  253. package/lib-cjs/component/reducer/actions/SpectrumsActions.js +4 -7
  254. package/lib-cjs/component/reducer/actions/ToolsActions.js +63 -73
  255. package/lib-cjs/component/reducer/helper/getSpectrum.js +18 -0
  256. package/lib-cjs/component/reducer/preferences/actions/initPreferences.js +1 -1
  257. package/lib-cjs/component/reducer/preferences/panelsPreferencesDefaultValues.js +4 -4
  258. package/lib-cjs/component/reducer/preferences/preferencesReducer.js +1 -1
  259. package/lib-cjs/component/reducer/types/Types.js +5 -3
  260. package/lib-cjs/component/tool/BrushX.js +1 -1
  261. package/lib-cjs/component/tool/BrushXY.js +1 -1
  262. package/lib-cjs/component/tool/CrossLinePointer.js +1 -1
  263. package/lib-cjs/component/tool/FloatMoleculeStructures/DraggableStructure.js +3 -2
  264. package/lib-cjs/component/toolbar/BasicToolBar.js +0 -1
  265. package/lib-cjs/component/toolbar/FunctionToolBar.js +9 -13
  266. package/lib-cjs/component/toolbar/ToolTypes.js +3 -3
  267. package/lib-cjs/component/utility/Export.js +4 -3
  268. package/lib-cjs/component/utility/formatNumber.js +3 -1
  269. package/lib-cjs/component/utility/isGoogleDocument.js +7 -0
  270. package/lib-cjs/component/utility/nmredataToNmrium.js +1 -2
  271. package/lib-cjs/component/utility/util/nmredata/addSource.js +2 -2
  272. package/lib-cjs/component/workspaces/basic.js +15 -8
  273. package/lib-cjs/component/workspaces/exercise.js +2 -2
  274. package/lib-cjs/component/workspaces/process1D.js +1 -1
  275. package/lib-cjs/data/FiltersManager.js +1 -1
  276. package/lib-cjs/data/PredictionManager.js +7 -9
  277. package/lib-cjs/data/SpectraManager.js +14 -23
  278. package/lib-cjs/data/data1d/Data1DManager.js +8 -1
  279. package/lib-cjs/data/data1d/Spectrum1D/generateJGraphData.js +8 -10
  280. package/lib-cjs/data/data1d/Spectrum1D/getReferenceShift.js +1 -1
  281. package/lib-cjs/data/data1d/Spectrum1D/integrals/updateRelatives.js +5 -7
  282. package/lib-cjs/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +1 -1
  283. package/lib-cjs/data/data1d/Spectrum1D/ranges/addRange.js +40 -16
  284. package/lib-cjs/data/data1d/Spectrum1D/ranges/detectSignal.js +3 -3
  285. package/lib-cjs/data/data1d/Spectrum1D/ranges/mapRanges.js +1 -1
  286. package/lib-cjs/data/data1d/database.js +55 -5
  287. package/lib-cjs/data/data1d/filter1d/lineBroadening.js +1 -1
  288. package/lib-cjs/data/data2d/Processing2D.js +1 -1
  289. package/lib-cjs/data/molecules/Molecule.js +3 -1
  290. package/lib-cjs/data/utilities/FindUtilities.js +1 -3
  291. package/lib-cjs/data/utilities/RangeUtilities.js +8 -6
  292. package/lib-cjs/data/utilities/ZoneUtilities.js +1 -1
  293. package/lib-cjs/data/utilities/getSum.js +1 -3
  294. package/lib-cjs/data/utilities/isMolFileEmpty.js +10 -0
  295. package/lib-cjs/types/NMRiumDataReturn.js +2 -0
  296. package/lib-cjs/types/NMRiumGeneralPreferences.js +2 -0
  297. package/lib-cjs/types/NMRiumPanelPreferences.js +2 -0
  298. package/lib-cjs/types/NMRiumToolBarPreferences.js +2 -0
  299. package/lib-cjs/types/Preferences.js +2 -0
  300. package/lib-cjs/versionInfo.js +1 -1
  301. package/package.json +31 -31
  302. package/lib/component/1d/multiplicityTree/TempMultiplicityTree.d.ts +0 -2
  303. package/lib/component/1d/multiplicityTree/TempMultiplicityTree.js +0 -14
  304. package/lib/component/panels/databasePanel/useDatabases.d.ts +0 -5
  305. package/lib/component/panels/databasePanel/useDatabases.js +0 -10
  306. package/lib-cjs/component/1d/multiplicityTree/TempMultiplicityTree.js +0 -20
  307. package/lib-cjs/component/panels/databasePanel/useDatabases.js +0 -14
@@ -1,16 +1,15 @@
1
- interface MoleculeInnerProps {
1
+ export interface MoleculeObject {
2
2
  key: string;
3
3
  molfile: string;
4
4
  isFloat: boolean;
5
5
  label: string;
6
6
  }
7
- export interface Molecule extends MoleculeInnerProps {
7
+ export interface Molecule extends MoleculeObject {
8
8
  mf: string;
9
9
  em: number;
10
10
  mw: number;
11
11
  svg: string;
12
12
  atoms: Record<string, number>;
13
13
  }
14
- export declare function initMolecule(options?: Partial<MoleculeInnerProps>): Molecule;
15
- export declare function toJSON(molecule: Molecule): Pick<MoleculeInnerProps, 'molfile' | 'label'>;
16
- export {};
14
+ export declare function initMolecule(options?: Partial<MoleculeObject>): Molecule;
15
+ export declare function toJSON(molecule: Molecule): MoleculeObject;
@@ -21,9 +21,11 @@ export function initMolecule(options = {}) {
21
21
  };
22
22
  }
23
23
  export function toJSON(molecule) {
24
- const { molfile, label } = molecule;
24
+ const { molfile, label, isFloat, key } = molecule;
25
25
  return {
26
26
  molfile,
27
27
  label,
28
+ isFloat,
29
+ key,
28
30
  };
29
31
  }
@@ -1,8 +1,6 @@
1
1
  function findSpectrum(spectraData, spectrumID, checkIsVisible) {
2
2
  const spectrum = spectraData.find((_spectrum) => _spectrum.id === spectrumID);
3
- if (spectrum &&
4
- checkIsVisible === true &&
5
- spectrum.display.isVisible === false) {
3
+ if (spectrum && checkIsVisible && !spectrum.display.isVisible) {
6
4
  return undefined;
7
5
  }
8
6
  return spectrum;
@@ -1,3 +1,4 @@
1
+ import omit from 'lodash/omit';
1
2
  import { DatumKind } from '../constants/SignalsKinds';
2
3
  export function getDiaIDs(range) {
3
4
  return [].concat(range.diaIDs || [], range.signals
@@ -19,13 +20,11 @@ export function setNbAtoms(range, signalIndex) {
19
20
  }
20
21
  }
21
22
  export function resetDiaIDs(range) {
22
- delete range.diaIDs;
23
- delete range.nbAtoms;
24
- range.signals.forEach((_signal) => {
25
- delete _signal.diaIDs;
26
- delete _signal.nbAtoms;
23
+ const deletedKeys = ['diaIDs', 'nbAtoms'];
24
+ range = omit(range, deletedKeys);
25
+ range.signals = range.signals.map((signal) => {
26
+ return omit(signal, deletedKeys);
27
27
  });
28
- delete range.nbAtoms;
29
28
  }
30
29
  /**
31
30
  *
@@ -32,7 +32,7 @@ export function checkSignalKinds(zone, kinds) {
32
32
  }
33
33
  export function unlink(zone, isOnZoneLevel, signalIndex, axis) {
34
34
  if (isOnZoneLevel !== undefined && axis !== undefined) {
35
- if (isOnZoneLevel === true) {
35
+ if (isOnZoneLevel) {
36
36
  delete zone[axis].diaIDs;
37
37
  delete zone[axis].nbAtoms;
38
38
  }
@@ -7,8 +7,6 @@
7
7
  */
8
8
  export function getSum(values, key, check = null) {
9
9
  return values.reduce((sum, current) => {
10
- return check && check(current) === true
11
- ? (sum += Math.abs(current[key]))
12
- : sum;
10
+ return check?.(current) ? (sum += Math.abs(current[key])) : sum;
13
11
  }, 0);
14
12
  }
@@ -0,0 +1 @@
1
+ export declare function isMolFileEmpty(molFile: string): boolean;
@@ -0,0 +1,6 @@
1
+ export function isMolFileEmpty(molFile) {
2
+ if (!molFile)
3
+ return true;
4
+ const molText = /(?<s>M {2}V30 BEGIN BOND)(?<mol>.*?)(?<e>M {2}V30 END BOND)/gs.exec(molFile)?.groups?.mol;
5
+ return !molText?.trim();
6
+ }
@@ -0,0 +1,15 @@
1
+ import { CorrelationData } from 'nmr-correlation';
2
+ import { SpectraAnalysis } from '../data/data1d/MultipleAnalysis';
3
+ import { Molecule } from '../data/molecules/Molecule';
4
+ import { Datum1D } from '../data/types/data1d';
5
+ import { Datum2D } from '../data/types/data2d';
6
+ import { Preferences } from './Preferences';
7
+ export interface NMRiumDataReturn {
8
+ actionType?: string;
9
+ version: number;
10
+ spectra: (Datum1D | Datum2D)[];
11
+ molecules: Molecule[];
12
+ correlations: CorrelationData;
13
+ preferences: Preferences;
14
+ multipleAnalysis: SpectraAnalysis;
15
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,10 @@
1
+ import { InitialSeparation } from 'analysis-ui-components/lib-esm/components/SplitPane';
2
+ import { PanelPreferencesType } from './PanelPreferencesType';
3
+ export interface NMRiumGeneralPreferences {
4
+ disableMultipletAnalysis: boolean;
5
+ hideSetSumFromMolecule: boolean;
6
+ hideGeneralSettings: boolean;
7
+ experimentalFeatures: PanelPreferencesType;
8
+ hidePanelOnLoad: boolean;
9
+ initialPanelWidth?: InitialSeparation;
10
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,16 @@
1
+ import { PanelPreferencesType } from './PanelPreferencesType';
2
+ export interface NMRiumPanelPreferences {
3
+ spectraPanel: PanelPreferencesType;
4
+ informationPanel: PanelPreferencesType;
5
+ peaksPanel: PanelPreferencesType;
6
+ integralsPanel: PanelPreferencesType;
7
+ rangesPanel: PanelPreferencesType;
8
+ structuresPanel: PanelPreferencesType;
9
+ filtersPanel: PanelPreferencesType;
10
+ zonesPanel: PanelPreferencesType;
11
+ summaryPanel: PanelPreferencesType;
12
+ multipleSpectraAnalysisPanel: PanelPreferencesType;
13
+ databasePanel: PanelPreferencesType;
14
+ predictionPanel: PanelPreferencesType;
15
+ automaticAssignmentPanel: PanelPreferencesType;
16
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,20 @@
1
+ export interface NMRiumToolBarPreferences {
2
+ zoomTool: boolean;
3
+ zoomOutTool: boolean;
4
+ import: boolean;
5
+ exportAs: boolean;
6
+ spectraStackAlignments: boolean;
7
+ spectraCenterAlignments: boolean;
8
+ realImaginary: boolean;
9
+ peakTool: boolean;
10
+ integralTool: boolean;
11
+ zonePickingTool: boolean;
12
+ slicingTool: boolean;
13
+ rangePickingTool: boolean;
14
+ zeroFillingTool: boolean;
15
+ phaseCorrectionTool: boolean;
16
+ baselineCorrectionTool: boolean;
17
+ FFTTool: boolean;
18
+ multipleSpectraAnalysisTool: boolean;
19
+ exclusionZonesTool: boolean;
20
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ import { VerticalAlignment } from '../component/reducer/Reducer';
2
+ export interface Preferences {
3
+ activeTab: string;
4
+ verticalAlign?: VerticalAlignment;
5
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1 +1 @@
1
- export default { version: 'v0.27.0' };
1
+ export default { version: 'v0.28.0' };
@@ -36,7 +36,7 @@ const ExclusionZoneAnnotation_1 = __importDefault(require("./ExclusionZoneAnnota
36
36
  const getVerticalShift_1 = __importDefault(require("./utilities/getVerticalShift"));
37
37
  function ExclusionZonesAnnotationsInner({ displayerKey, xDomains, spectra, verticalAlign, }) {
38
38
  return ((0, jsx_runtime_1.jsx)("g", { className: "spectrum-exclusion-zones-group", clipPath: `url(#${displayerKey}clip-chart-1d)`, children: spectra
39
- .filter((d) => d.display.isVisible === true && xDomains[d.id])
39
+ .filter((d) => d.display.isVisible && xDomains[d.id])
40
40
  .map((d, index) => getExclusionZones(d).map((zone) => {
41
41
  return ((0, jsx_runtime_1.jsx)(ExclusionZoneAnnotation_1.default, { spectrumID: d.id, vAlign: (0, getVerticalShift_1.default)(verticalAlign, { index }), zone: zone, color: d.display.color }, zone.id));
42
42
  })) }));
@@ -12,15 +12,11 @@ function IntegralsSeries() {
12
12
  const { xDomains, activeSpectrum, data, displayerKey, activeTab: nucleus, } = (0, ChartContext_1.useChartData)();
13
13
  const Integrals = (0, react_1.useMemo)(() => {
14
14
  const isActive = (id) => {
15
- return activeSpectrum === null
16
- ? true
17
- : id === activeSpectrum.id
18
- ? true
19
- : false;
15
+ return activeSpectrum === null ? true : id === activeSpectrum.id;
20
16
  };
21
17
  return ((0, jsx_runtime_1.jsx)("g", { className: "integrals", children: data?.[0] &&
22
18
  data
23
- .filter((d) => d.display.isVisible === true && xDomains[d.id])
19
+ .filter((d) => d.display.isVisible && xDomains[d.id])
24
20
  .filter(Spectrum1D_1.isSpectrum1D)
25
21
  .map((spectrum) => spectrum.integrals.values.map((integral) => ((0, jsx_runtime_1.jsx)(Integral_1.default, { nucleus: nucleus, integral: integral, isActive: isActive(spectrum.id) }, integral.id)))) }));
26
22
  }, [activeSpectrum, data, nucleus, xDomains]);
@@ -78,7 +78,7 @@ value, color, isActive, nucleus, }) {
78
78
  id,
79
79
  value: newValue,
80
80
  oldValue: value,
81
- shiftValue: shiftValue,
81
+ shiftValue,
82
82
  });
83
83
  event.currentTarget.blur();
84
84
  setIsSelected(false);
@@ -117,7 +117,7 @@ value, color, isActive, nucleus, }) {
117
117
  border: isSelected ? `1px solid ${color}` : `0`,
118
118
  opacity: isActive ? 1 : 0.2,
119
119
  userSelect: 'none',
120
- color: color,
120
+ color,
121
121
  }, value: oldValue, onKeyDown: handleKeyDown, onChange: handleChange, type: "number", disabled: !isActive }) }) })] }));
122
122
  }
123
123
  exports.default = PeakAnnotation;
@@ -32,15 +32,13 @@ function PeakAnnotations() {
32
32
  };
33
33
  return (data &&
34
34
  reSortData()
35
- .filter((d) => d.display.isVisible === true && xDomains[d.id])
35
+ .filter((d) => d.display.isVisible && xDomains[d.id])
36
36
  .filter(Spectrum1D_1.isSpectrum1D)
37
37
  .map((d) => {
38
38
  return (d.peaks?.values &&
39
39
  d.display.isPeaksMarkersVisible && ((0, jsx_runtime_1.jsx)("g", { transform: `translate(0,-${getVerticalAlign(d.id)})`, children: d.peaks.values.map(({ x, y, id }) => ((0, jsx_runtime_1.jsx)(PeakAnnotation_1.default, { x: scaleX()(x), y: scaleY(d.id)(y) - 5, sign: Math.sign(y), id: id, value: x, color: "#730000", nucleus: d.info.nucleus, isActive: activeSpectrum == null
40
40
  ? false
41
- : activeSpectrum.id === d.id
42
- ? true
43
- : false }, id))) }, d.id)));
41
+ : activeSpectrum.id === d.id }, id))) }, d.id)));
44
42
  }));
45
43
  }, [data, verticalAlign, activeSpectrum, xDomains, scaleX, scaleY]);
46
44
  return ((0, jsx_runtime_1.jsx)("g", { className: "peaks", clipPath: `url(#${displayerKey}clip-chart-1d)`, children: Peaks }));
@@ -45,10 +45,10 @@ function YTracker({ datum }) {
45
45
  }
46
46
  function SpectraTracker() {
47
47
  const { data, activeTab, xDomains } = (0, ChartContext_1.useChartData)();
48
- const [isVisible, ToggleVisibility] = (0, react_1.useState)(false);
48
+ const [isVisible, toggleVisibility] = (0, react_1.useState)(false);
49
49
  (0, react_1.useEffect)(() => {
50
50
  function handler(flag) {
51
- ToggleVisibility(flag);
51
+ toggleVisibility(flag);
52
52
  }
53
53
  Events_1.default.on('showYSpectraTrackers', handler);
54
54
  return () => {
@@ -162,7 +162,7 @@ function Viewer1D({ emptyText = undefined }) {
162
162
  ...brushData,
163
163
  });
164
164
  break;
165
- case ToolTypes_1.options.baseLineCorrection.id:
165
+ case ToolTypes_1.options.baselineCorrection.id:
166
166
  dispatch({
167
167
  type: Types_1.ADD_BASE_LINE_ZONE,
168
168
  zone: { from: brushData.startX, to: brushData.endX },
@@ -1,6 +1,10 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  const jsx_runtime_1 = require("react/jsx-runtime");
7
+ const throttle_1 = __importDefault(require("lodash/throttle"));
4
8
  const react_1 = require("react");
5
9
  const SpectraManager_1 = require("../../../data/SpectraManager");
6
10
  const ChartContext_1 = require("../../context/ChartContext");
@@ -22,36 +26,37 @@ function DatabaseSpectrum() {
22
26
  const { jcampURL: jcampRelativeURL, baseURL } = highlight?.sourceData?.extra || [];
23
27
  const getSpinner = (0, react_1.useContext)(SpinnerContext_1.spinnerContext);
24
28
  const scaleY = (0, react_1.useCallback)(() => (0, scale_1.getYScale)({
25
- height: height,
29
+ height,
26
30
  margin: { top: margin.top, bottom: margin.bottom + marginBottom },
27
31
  verticalAlign,
28
32
  yDomain,
29
33
  }), [height, margin, marginBottom, verticalAlign, yDomain]);
30
- (0, react_1.useEffect)(() => {
31
- void (async () => {
32
- try {
33
- setLoading(true);
34
- const jcampURL = new URL(jcampRelativeURL, baseURL);
35
- const result = await (0, FileUtility_1.loadFile)(jcampURL);
36
- const spectra = [];
37
- (0, SpectraManager_1.addJcamp)(spectra, result, {}, {});
38
- setLoading(false);
39
- const spectrum = spectra?.[0] || null;
40
- if (spectrum) {
41
- const { x, re: y } = spectrum?.data;
42
- let path = `M ${scaleX()(x[0])} ${scaleY()(y[0])} `;
43
- path += x.slice(1).reduce((accumulator, point, i) => {
44
- accumulator += ` L ${scaleX()(point)} ${scaleY()(y[i + 1])}`;
45
- return accumulator;
46
- }, '');
47
- setPath(path);
48
- }
49
- }
50
- catch (e) {
51
- alert.error('Failed to Load spectrum');
34
+ const loadSpectrum = (0, react_1.useRef)((0, throttle_1.default)(async (baseURL, jcampRelativeURL) => {
35
+ try {
36
+ setLoading(true);
37
+ const jcampURL = new URL(jcampRelativeURL, baseURL);
38
+ const result = await (0, FileUtility_1.loadFile)(jcampURL);
39
+ const spectra = [];
40
+ (0, SpectraManager_1.addJcamp)(spectra, result, {}, {});
41
+ setLoading(false);
42
+ const spectrum = spectra?.[0] || null;
43
+ if (spectrum) {
44
+ const { x, re: y } = spectrum.data;
45
+ let path = `M ${scaleX()(x[0])} ${scaleY()(y[0])} `;
46
+ path += x.slice(1).reduce((accumulator, point, i) => {
47
+ accumulator += ` L ${scaleX()(point)} ${scaleY()(y[i + 1])}`;
48
+ return accumulator;
49
+ }, '');
50
+ setPath(path);
52
51
  }
53
- })();
54
- }, [alert, baseURL, jcampRelativeURL, scaleX, scaleY]);
52
+ }
53
+ catch (e) {
54
+ alert.error('Failed to Load spectrum');
55
+ }
56
+ }, 250));
57
+ (0, react_1.useEffect)(() => {
58
+ void loadSpectrum.current(baseURL, jcampRelativeURL);
59
+ }, [baseURL, jcampRelativeURL, loadSpectrum]);
55
60
  if (highlight.sourceData?.type !== highlight_1.HighlightedSource.DATABASE) {
56
61
  return null;
57
62
  }
@@ -19,7 +19,6 @@ const Types_1 = require("../../reducer/types/Types");
19
19
  const ToolTypes_1 = require("../../toolbar/ToolTypes");
20
20
  const formatNumber_1 = require("../../utility/formatNumber");
21
21
  const MultiplicityTree_1 = __importDefault(require("../multiplicityTree/MultiplicityTree"));
22
- const TempMultiplicityTree_1 = __importDefault(require("../multiplicityTree/TempMultiplicityTree"));
23
22
  const stylesOnHover = (0, react_1.css) `
24
23
  pointer-events: bounding-box;
25
24
  @-moz-document url-prefix() {
@@ -48,7 +47,7 @@ const stylesHighlighted = (0, react_1.css) `
48
47
  cursor: pointer;
49
48
  }
50
49
  `;
51
- function Range({ rangeData, showMultiplicityTrees, selectedTool, startEditMode, relativeFormat, }) {
50
+ function Range({ rangeData, showMultiplicityTrees, selectedTool, relativeFormat, }) {
52
51
  const { viewerRef } = (0, GlobalContext_1.useGlobal)();
53
52
  const { id, integration, signals } = rangeData;
54
53
  const assignmentData = (0, AssignmentsContext_1.useAssignmentData)();
@@ -111,9 +110,9 @@ function Range({ rangeData, showMultiplicityTrees, selectedTool, startEditMode,
111
110
  ? 1
112
111
  : 0.6, children: integration !== undefined
113
112
  ? (0, formatNumber_1.formatNumber)(integration, relativeFormat)
114
- : '' })] })) }, `${id}_${to}_${from}`), startEditMode ? ((0, jsx_runtime_1.jsx)(TempMultiplicityTree_1.default, {})) : (showMultiplicityTrees &&
113
+ : '' })] })) }, `${id}_${to}_${from}`), showMultiplicityTrees &&
115
114
  signals &&
116
115
  signals.length > 0 &&
117
- signals.map((_signal) => ((0, jsx_runtime_1.jsx)(MultiplicityTree_1.default, { rangeFrom: rangeData.from, rangeTo: rangeData.to, signal: _signal }, _signal.id))))] }, id));
116
+ signals.map((_signal) => ((0, jsx_runtime_1.jsx)(MultiplicityTree_1.default, { rangeFrom: rangeData.from, rangeTo: rangeData.to, signal: _signal }, _signal.id)))] }, id));
118
117
  }
119
118
  exports.default = Range;
@@ -10,13 +10,13 @@ const usePanelPreferences_1 = require("../../hooks/usePanelPreferences");
10
10
  const useSpectrum_1 = __importDefault(require("../../hooks/useSpectrum"));
11
11
  const Range_1 = __importDefault(require("./Range"));
12
12
  const RangeIntegral_1 = __importDefault(require("./RangeIntegral"));
13
- function RangesInner({ ranges, displayerKey, selectedTool, editRangeID, showMultiplicityTrees, showRangesIntegrals, relativeFormat, }) {
14
- return ((0, jsx_runtime_1.jsx)("g", { clipPath: `url(#${displayerKey}clip-chart-1d)`, children: ranges?.values?.map((range) => ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Range_1.default, { rangeData: range, selectedTool: selectedTool, showMultiplicityTrees: showMultiplicityTrees, startEditMode: editRangeID && editRangeID === range.id ? true : false, relativeFormat: relativeFormat }), showRangesIntegrals && (0, jsx_runtime_1.jsx)(RangeIntegral_1.default, { range: range })] }, range.id))) }));
13
+ function RangesInner({ ranges, displayerKey, selectedTool, showMultiplicityTrees, showRangesIntegrals, relativeFormat, }) {
14
+ return ((0, jsx_runtime_1.jsx)("g", { clipPath: `url(#${displayerKey}clip-chart-1d)`, children: ranges?.values?.map((range) => ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Range_1.default, { rangeData: range, selectedTool: selectedTool, showMultiplicityTrees: showMultiplicityTrees, relativeFormat: relativeFormat }), showRangesIntegrals && (0, jsx_runtime_1.jsx)(RangeIntegral_1.default, { range: range })] }, range.id))) }));
15
15
  }
16
16
  const MemoizedRanges = (0, react_1.memo)(RangesInner);
17
17
  const empyData = { ranges: {} };
18
18
  function Ranges() {
19
- const { displayerKey, toolOptions: { selectedTool, data: { tempRange, showMultiplicityTrees, showRangesIntegrals }, }, activeTab, } = (0, ChartContext_1.useChartData)();
19
+ const { displayerKey, toolOptions: { selectedTool, data: { showMultiplicityTrees, showRangesIntegrals }, }, activeTab, } = (0, ChartContext_1.useChartData)();
20
20
  const { ranges } = (0, useSpectrum_1.default)(empyData);
21
21
  const rangesPreferences = (0, usePanelPreferences_1.usePanelPreferences)('ranges', activeTab);
22
22
  return ((0, jsx_runtime_1.jsx)(MemoizedRanges, { ...{
@@ -25,7 +25,6 @@ function Ranges() {
25
25
  showRangesIntegrals,
26
26
  selectedTool,
27
27
  displayerKey,
28
- editRangeID: tempRange?.id || '',
29
28
  relativeFormat: rangesPreferences.relative.format,
30
29
  } }));
31
30
  }
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
7
7
  /** @jsxImportSource @emotion/react */
8
8
  const react_1 = require("@emotion/react");
9
- const react_2 = require("react");
10
9
  const ChartContext_1 = require("../../context/ChartContext");
11
10
  const DispatchContext_1 = require("../../context/DispatchContext");
12
11
  const ScaleContext_1 = require("../../context/ScaleContext");
@@ -35,12 +34,10 @@ function BaseLineZones() {
35
34
  const { toolOptions } = (0, ChartContext_1.useChartData)();
36
35
  const { scaleX } = (0, ScaleContext_1.useScaleChecked)();
37
36
  const dispatch = (0, DispatchContext_1.useDispatch)();
38
- const deleteRangeHandler = (0, react_2.useCallback)((id) => {
37
+ const deleteRangeHandler = (id) => {
39
38
  dispatch({ type: Types_1.DELETE_BASE_LINE_ZONE, id });
40
- }, [dispatch]);
41
- const baseLineZones = (0, react_2.useMemo)(() => {
42
- return toolOptions.data.baseLineZones;
43
- }, [toolOptions]);
39
+ };
40
+ const baseLineZones = toolOptions.data.baselineCorrection.zones;
44
41
  return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: baseLineZones.length > 0 && ((0, jsx_runtime_1.jsx)("g", { children: baseLineZones.map((zone) => ((0, jsx_runtime_1.jsxs)("g", { transform: `translate(${scaleX()(zone.to)},0)`, css: styles, children: [(0, jsx_runtime_1.jsx)(DeleteButton_1.default, { x: -20, y: 10, onDelete: () => deleteRangeHandler(zone.id) }), (0, jsx_runtime_1.jsx)("rect", { x: "0", width: `${scaleX()(zone.from) - scaleX()(zone.to)}`, className: "zone-area" })] }, zone.id))) })) }));
45
42
  }
46
43
  exports.default = BaseLineZones;
@@ -20,7 +20,7 @@ function VerticalIndicator() {
20
20
  return ((0, jsx_runtime_1.jsx)("div", { style: {
21
21
  ...styles,
22
22
  transform: `translate(${scaleX()(pivot.value)}px, 0px)`,
23
- height: height,
23
+ height,
24
24
  } }));
25
25
  }
26
26
  exports.default = VerticalIndicator;
@@ -16,11 +16,7 @@ function ContoursPaths({ id: spectrumID, sign, color, datum, }) {
16
16
  const preferences = (0, PreferencesContext_1.usePreferences)();
17
17
  const { xShift, yShift } = (0, Spectrum2D_1.getShift)(datum);
18
18
  const isActive = (0, react_1.useMemo)(() => {
19
- return activeSpectrum === null
20
- ? true
21
- : spectrumID === activeSpectrum.id
22
- ? true
23
- : false;
19
+ return activeSpectrum === null ? true : spectrumID === activeSpectrum.id;
24
20
  }, [activeSpectrum, spectrumID]);
25
21
  function buildContourPath(data) {
26
22
  const _scaleX = (0, scale_1.get2DXScale)({ margin, width, xDomain });
@@ -16,7 +16,7 @@ function SignalDeltaLine({ delta, axis, show }) {
16
16
  const scaleX = (0, scale_1.get2DXScale)({ margin, width, xDomain });
17
17
  const scaleY = (0, scale_1.get2DYScale)({ margin, height, yDomain });
18
18
  const line = (0, react_2.useMemo)(() => {
19
- return show === true ? (axis === 'X' ? ((0, jsx_runtime_1.jsx)("line", { css: lineStyle, x1: scaleX(delta), x2: scaleX(delta), y1: scaleY(yDomain[0]), y2: scaleY(yDomain[1]) }, `signalLine_${delta}_X`)) : axis === 'Y' ? ((0, jsx_runtime_1.jsx)("line", { css: lineStyle, x1: scaleX(xDomain[0]), x2: scaleX(xDomain[1]), y1: scaleY(delta), y2: scaleY(delta) }, `signalLine_${delta}_Y`)) : null) : null;
19
+ return show ? (axis === 'X' ? ((0, jsx_runtime_1.jsx)("line", { css: lineStyle, x1: scaleX(delta), x2: scaleX(delta), y1: scaleY(yDomain[0]), y2: scaleY(yDomain[1]) }, `signalLine_${delta}_X`)) : axis === 'Y' ? ((0, jsx_runtime_1.jsx)("line", { css: lineStyle, x1: scaleX(xDomain[0]), x2: scaleX(xDomain[1]), y1: scaleY(delta), y2: scaleY(delta) }, `signalLine_${delta}_Y`)) : null) : null;
20
20
  }, [axis, delta, scaleX, scaleY, show, xDomain, yDomain]);
21
21
  return (0, jsx_runtime_1.jsx)("g", { children: line });
22
22
  }
@@ -129,7 +129,7 @@ function Viewer2D({ emptyText = undefined }) {
129
129
  }
130
130
  }, [selectedTool]);
131
131
  if (!isVisible) {
132
- return ((0, jsx_runtime_1.jsx)(NoData_1.default, { emptyText: "Currently FID can not be displayed for 2D spectra", canOpenLoader: false }));
132
+ return ((0, jsx_runtime_1.jsx)(NoData_1.default, { emptyText: "2D FID spectra can not be displayed yet", canOpenLoader: false, style: { outline: 'none' } }));
133
133
  }
134
134
  return ((0, jsx_runtime_1.jsx)(react_d3_utils_1.ResponsiveChart, { children: ({ width, height }) => ((0, jsx_runtime_1.jsxs)(ViewerResponsiveWrapper, { width: width, height: height, children: [(0, jsx_runtime_1.jsx)(Spinner_1.default, { isLoading: isLoading, emptyText: emptyText }), data && data.length > 0 && ((0, jsx_runtime_1.jsx)(BrushTracker_1.BrushTracker, { onBrush: handelBrushEnd, onDoubleClick: handelOnDoubleClick, onClick: mouseClick, onZoom: handleZoom, style: {
135
135
  width: '100%',
@@ -63,6 +63,6 @@ function YAxis(props) {
63
63
  if (!width || !height) {
64
64
  return null;
65
65
  }
66
- return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)("g", { className: "y", css: axisStyles, transform: `translate(${width - marginProps.right})`, ref: refAxis, children: (0, jsx_runtime_1.jsx)("text", { fill: "#000", x: -marginProps.top, y: -(marginProps.right - 5), dy: "0.71em", transform: "rotate(-90)", textAnchor: "end", children: label }) }) }));
66
+ return ((0, jsx_runtime_1.jsx)("g", { className: "y", css: axisStyles, transform: `translate(${width - marginProps.right})`, ref: refAxis, children: (0, jsx_runtime_1.jsx)("text", { fill: "#000", x: -marginProps.top, y: -(marginProps.right - 5), dy: "0.71em", transform: "rotate(-90)", textAnchor: "end", children: label }) }));
67
67
  }
68
68
  exports.default = (0, react_2.memo)(YAxis);
@@ -22,8 +22,7 @@ function IndicationLines({ axis, show }) {
22
22
  const nucleus = axis === 'X' ? split[0] : axis === 'Y' ? split[1] : null;
23
23
  if (nucleus !== null) {
24
24
  const ranges = data
25
- .filter((_datum) => _datum.display.isVisible === true &&
26
- _datum.info.nucleus === nucleus)
25
+ .filter((_datum) => _datum.display.isVisible && _datum.info.nucleus === nucleus)
27
26
  .filter(Spectrum1D_1.isSpectrum1D)
28
27
  .map((_datum) => _datum.ranges.values)
29
28
  .flat();
@@ -39,7 +38,7 @@ function IndicationLines({ axis, show }) {
39
38
  }
40
39
  }, [activeTab, axis, data, displayerMode]);
41
40
  const indicationLines = (0, react_2.useMemo)(() => {
42
- if (show === true && deltas1D.length > 0) {
41
+ if (show && deltas1D.length > 0) {
43
42
  const lines = deltas1D.map((_delta, i) => {
44
43
  return axis === 'X' ? ((0, jsx_runtime_1.jsx)("line", { css: lineStyle, x1: scaleX(_delta), x2: scaleX(_delta), y1: scaleY(yDomain[0]), y2: scaleY(yDomain[1]) }, `indicationLine${axis}${i}`)) : axis === 'Y' ? ((0, jsx_runtime_1.jsx)("line", { css: lineStyle, x1: scaleX(xDomain[0]), x2: scaleX(xDomain[1]), y1: scaleY(_delta), y2: scaleY(_delta) }, `indicationLine${axis}${i}`)) : null;
45
44
  });