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
@@ -44,8 +44,7 @@ async function getSpectra(file, options = {}, usedColors = {}) {
44
44
  return addBruker({ xy, noContours, keepOriginal }, file.binary, usedColors);
45
45
  default:
46
46
  if (!jcampURL) {
47
- new Error('file extension is not supported');
48
- return;
47
+ throw new Error('file extension is not supported');
49
48
  }
50
49
  }
51
50
  }
@@ -1,2 +1,2 @@
1
- import jszip from 'jszip';
2
- export declare function nmriumToNmredata(state: any, options?: {}): Promise<jszip>;
1
+ import Jszip from 'jszip';
2
+ export declare function nmriumToNmredata(state: any, options?: {}): Promise<Jszip>;
@@ -1,4 +1,4 @@
1
- import jszip from 'jszip';
1
+ import Jszip from 'jszip';
2
2
  import { getGroupedDiastereotopicAtomIDs } from 'openchemlib-utils';
3
3
  import { Molecule as OCLMolecule } from 'openchemlib/full';
4
4
  import { get1DSignals } from './util/nmredata/get1DSignals';
@@ -18,7 +18,7 @@ export async function nmriumToNmredata(state, options = {}) {
18
18
  data: [],
19
19
  molecules: [],
20
20
  };
21
- let nmrRecord = new jszip();
21
+ let nmrRecord = new Jszip();
22
22
  for (const molecule of molecules) {
23
23
  await addNMReDATA(data, nmrRecord, {
24
24
  ...options,
@@ -26,14 +26,14 @@ export async function addSource(nmrRecord, options = {}) {
26
26
  default:
27
27
  if (!jcampURL)
28
28
  break;
29
- void (await fetch(jcampURL).then(async (jcamp) => {
29
+ await fetch(jcampURL).then(async (jcamp) => {
30
30
  if (!jcamp)
31
31
  return;
32
32
  let name = jcampURL.split('/').slice(-1);
33
33
  const path = `jcamp/${dimension}/${name}`;
34
34
  tag += `\nJcamp_Location=file:${path}\\`;
35
35
  nmrRecord.file(path, await jcamp.arrayBuffer());
36
- }));
36
+ });
37
37
  }
38
38
  return tag;
39
39
  }
@@ -50,10 +50,10 @@ export interface DatabasePanelPreferences {
50
50
  showSmiles: boolean;
51
51
  showSolvent: boolean;
52
52
  showNames: boolean;
53
- showRange: boolean;
54
- showDelta: boolean;
53
+ range: ColumnPreferences;
54
+ delta: ColumnPreferences;
55
55
  showAssignment: boolean;
56
- showCoupling: boolean;
56
+ coupling: ColumnPreferences;
57
57
  showMultiplicity: boolean;
58
58
  color: string;
59
59
  marginBottom: number;
@@ -77,16 +77,21 @@ export interface Formatting {
77
77
  panels: Partial<PanelsPreferences>;
78
78
  }
79
79
  export interface Database {
80
+ key: string;
80
81
  label: string;
81
82
  url: string;
82
83
  enabled: boolean;
83
84
  }
85
+ export interface Databases {
86
+ data: Database[];
87
+ defaultDatabase: string;
88
+ }
84
89
  export interface Workspace {
85
90
  version: number;
86
91
  label: string;
87
92
  display: NMRiumPreferences;
88
93
  controllers: Controllers;
89
94
  formatting: Formatting;
90
- databases: Database[];
95
+ databases: Databases;
91
96
  }
92
97
  export {};
@@ -11,7 +11,7 @@ export const basic = {
11
11
  panels: {
12
12
  spectraPanel: { display: true, open: true },
13
13
  informationPanel: { display: true, open: false },
14
- peaksPanel: { display: true, open: false },
14
+ peaksPanel: { display: false, open: false },
15
15
  integralsPanel: { display: true, open: false },
16
16
  rangesPanel: { display: true, open: false },
17
17
  structuresPanel: { display: true, open: false },
@@ -23,6 +23,9 @@ export const basic = {
23
23
  predictionPanel: { display: false, open: false },
24
24
  automaticAssignmentPanel: { display: false, open: false },
25
25
  },
26
+ toolBarButtons: {
27
+ peakTool: false,
28
+ },
26
29
  },
27
30
  controllers: {
28
31
  dimmedSpectraTransparency: 0.1,
@@ -38,11 +41,15 @@ export const basic = {
38
41
  },
39
42
  panels: {},
40
43
  },
41
- databases: [
42
- {
43
- label: 'Toc',
44
- url: 'https://data.cheminfo.org/nmr/database/toc.json',
45
- enabled: true,
46
- },
47
- ],
44
+ databases: {
45
+ defaultDatabase: '',
46
+ data: [
47
+ {
48
+ key: 'toc',
49
+ label: 'Toc',
50
+ url: 'https://data.cheminfo.org/nmr/database/toc.json',
51
+ enabled: true,
52
+ },
53
+ ],
54
+ },
48
55
  };
@@ -36,10 +36,10 @@ export const exercise = {
36
36
  integralTool: true,
37
37
  zonePickingTool: false,
38
38
  slicingTool: false,
39
- autoRangesTool: false,
39
+ rangePickingTool: false,
40
40
  zeroFillingTool: false,
41
41
  phaseCorrectionTool: false,
42
- baseLineCorrectionTool: false,
42
+ baselineCorrectionTool: false,
43
43
  FFTTool: false,
44
44
  multipleSpectraAnalysisTool: false,
45
45
  exclusionZonesTool: false,
@@ -24,7 +24,7 @@ export const process1D = {
24
24
  toolBarButtons: {
25
25
  import: false,
26
26
  exportAs: false,
27
- autoRangesTool: false,
27
+ rangePickingTool: false,
28
28
  multipleSpectraAnalysisTool: false,
29
29
  exclusionZonesTool: false,
30
30
  },
@@ -123,7 +123,7 @@ function addFilter(datum, filter, isDeleteAllow = true) {
123
123
  delete filter.isSnapshot;
124
124
  datum.filters.push({
125
125
  ...filter,
126
- id: id,
126
+ id,
127
127
  flag: true,
128
128
  isDeleteAllow,
129
129
  });
@@ -179,15 +179,13 @@ function calculateFrequency(nucleus, frequency) {
179
179
  if (typeof nucleus === 'string') {
180
180
  return getFrequency(nucleus, { nucleus: '1H', frequency });
181
181
  }
182
+ else if (nucleus[0] === nucleus[1]) {
183
+ return `${frequency},${frequency}`;
184
+ }
182
185
  else {
183
- if (nucleus[0] === nucleus[1]) {
184
- return `${frequency},${frequency}`;
185
- }
186
- else {
187
- return `${frequency},${getFrequency(nucleus[1], {
188
- nucleus: nucleus[0],
189
- frequency,
190
- })}`;
191
- }
186
+ return `${frequency},${getFrequency(nucleus[1], {
187
+ nucleus: nucleus[0],
188
+ frequency,
189
+ })}`;
192
190
  }
193
191
  }
@@ -1,3 +1,4 @@
1
+ import { NMRiumDataReturn } from '../types/NMRiumDataReturn';
1
2
  export declare enum DataExportOptions {
2
3
  ROW_DATA = "ROW_DATA",
3
4
  DATA_SOURCE = "DATA_SOURCE"
@@ -15,15 +16,6 @@ export declare function addJcamps(files: any, usedColors: any): never[];
15
16
  *
16
17
  * @param {object} state
17
18
  */
18
- export declare function toJSON(state: any, dataExportOption?: DataExportOptionsType): {
19
- spectra: any;
20
- molecules: any;
21
- correlations: any;
22
- multipleAnalysis: any;
23
- exclusionZones: any;
24
- version: number;
25
- preferences: {
26
- verticalAlign?: any;
27
- activeTab: any;
28
- };
29
- };
19
+ declare type JSONTarget = 'nmrium' | 'onDataChange';
20
+ export declare function toJSON(state: any, target: JSONTarget, dataExportOption?: DataExportOptionsType): NMRiumDataReturn;
21
+ export {};
@@ -81,7 +81,7 @@ export function addJDF(spectra, jdf, options = {}, usedColors = {}) {
81
81
  spectra.push(Data1DManager.fromCSD(converted, {
82
82
  ...options,
83
83
  display: { ...options.display },
84
- info: info,
84
+ info,
85
85
  meta: metadata,
86
86
  }, usedColors));
87
87
  }
@@ -115,9 +115,9 @@ export async function fromJSON(data = [], usedColors = {}) {
115
115
  export async function addBruker(options, data, usedColors) {
116
116
  const spectra = [];
117
117
  let result = await fromBruker(data, {
118
- xy: true,
119
- noContours: true,
120
- keepOriginal: true,
118
+ converter: {
119
+ xy: true,
120
+ },
121
121
  });
122
122
  let entries = result;
123
123
  for (let entry of entries) {
@@ -131,16 +131,11 @@ export async function addBruker(options, data, usedColors) {
131
131
  }
132
132
  }
133
133
  else if (info.dimension === 2) {
134
- if (info.isFt) {
135
- spectra.push(Data2DManager.fromBruker(entry, {
136
- ...options,
137
- info,
138
- display: { ...options.display },
139
- }, usedColors));
140
- }
141
- else {
142
- // in case of 2D FID spectrum
143
- }
134
+ spectra.push(Data2DManager.fromBruker(entry, {
135
+ ...options,
136
+ info,
137
+ display: { ...options.display },
138
+ }, usedColors));
144
139
  }
145
140
  }
146
141
  return spectra;
@@ -192,17 +187,13 @@ function getPreferences(state) {
192
187
  : {}),
193
188
  };
194
189
  }
195
- /**
196
- *
197
- * @param {object} state
198
- */
199
- export function toJSON(state, dataExportOption = DataExportOptions.DATA_SOURCE) {
200
- const { data, molecules: mols, correlations, multipleAnalysis, toolOptions: { data: { exclusionZones }, }, } = state || {
190
+ export function toJSON(state, target, dataExportOption = DataExportOptions.DATA_SOURCE) {
191
+ const { data, molecules: mols, correlations, multipleAnalysis, actionType, } = state || {
201
192
  data: [],
202
193
  molecules: [],
203
194
  correlations: {},
204
195
  multipleAnalysis: {},
205
- exclusionZones: {},
196
+ actionType: '',
206
197
  };
207
198
  const spectra = data.map((ob) => {
208
199
  return ob.info.dimension === 1
@@ -212,12 +203,12 @@ export function toJSON(state, dataExportOption = DataExportOptions.DATA_SOURCE)
212
203
  const preferences = getPreferences(state);
213
204
  const molecules = mols.map((mol) => Molecule.toJSON(mol));
214
205
  return {
206
+ ...(target === 'onDataChange' ? { actionType } : {}),
207
+ version: CURRENT_EXPORT_VERSION,
215
208
  spectra,
216
209
  molecules,
217
210
  correlations,
218
211
  multipleAnalysis,
219
- exclusionZones,
220
- version: CURRENT_EXPORT_VERSION,
221
212
  preferences,
222
213
  };
223
214
  }
@@ -1,7 +1,14 @@
1
1
  import { initiateDatum1D } from './Spectrum1D';
2
2
  export function fromBruker(result, options = {}, usedColors = {}) {
3
3
  const { dependentVariables, info, meta, source } = result;
4
- let data = getData(dependentVariables[0].components);
4
+ let { data } = dependentVariables[0].components[0];
5
+ const { x, re, im } = data;
6
+ if (x[0] > x[1]) {
7
+ x.reverse();
8
+ re.reverse();
9
+ if (im)
10
+ im.reverse();
11
+ }
5
12
  if (data.im)
6
13
  info.isComplex = true;
7
14
  if (Array.isArray(info.nucleus))
@@ -65,17 +65,15 @@ function createLinks(ranges, jGraphTolerance = 0) {
65
65
  }
66
66
  end++;
67
67
  }
68
+ else if (Math.abs(couplings[end - 1].coupling - nextCoupling.coupling) <
69
+ jGraphTolerance) {
70
+ start = end - 1;
71
+ }
68
72
  else {
69
- if (Math.abs(couplings[end - 1].coupling - nextCoupling.coupling) <
70
- jGraphTolerance) {
71
- start = end - 1;
72
- }
73
- else {
74
- index++;
75
- links[index] = initLink(couplings[end]);
76
- start = end;
77
- end = end + 1;
78
- }
73
+ index++;
74
+ links[index] = initLink(couplings[end]);
75
+ start = end;
76
+ end = end + 1;
79
77
  }
80
78
  }
81
79
  return links;
@@ -16,7 +16,7 @@ import { getRange } from '../../constants/References';
16
16
  export function getReferenceShift(datum1D, options) {
17
17
  let { from, to, nbPeaks, targetX, reference } = options;
18
18
  if (reference) {
19
- let data = getRange({ reference: reference, nucleus: datum1D.nucleus });
19
+ let data = getRange({ reference, nucleus: datum1D.nucleus });
20
20
  from = data.from;
21
21
  to = data.to;
22
22
  nbPeaks = data.nbPeaks;
@@ -7,13 +7,11 @@ export function updateRelatives(data, key, check, forceCalculateIntegral = false
7
7
  if (data.options.isSumConstant || forceCalculateIntegral) {
8
8
  factor = currentSum > 0 ? options.sum / currentSum : 0.0;
9
9
  }
10
- else {
11
- if (data.values?.[0]) {
12
- const item = data.values[0];
13
- factor =
14
- (item[key] ? item[key] : options.sum) /
15
- item.absolute;
16
- }
10
+ else if (data.values?.[0]) {
11
+ const item = data.values[0];
12
+ factor =
13
+ (item[key] ? item[key] : options.sum) /
14
+ item.absolute;
17
15
  }
18
16
  }
19
17
  data.values = data.values.map((value) => {
@@ -13,7 +13,7 @@ export function autoPeakPicking(datum1D, options) {
13
13
  let peaks = xyAutoPeaksPicking({ x, y: re }, {
14
14
  lookNegative,
15
15
  noiseLevel: noise * noiseFactor,
16
- minMaxRatio: minMaxRatio,
16
+ minMaxRatio,
17
17
  realTopDetection: true,
18
18
  smoothY: false,
19
19
  sgOptions: { windowSize: 15, polynomial: 3 },
@@ -1,8 +1,42 @@
1
+ import { Signal1D } from '../../../types/data1d';
1
2
  import { Datum1D } from '../../../types/data1d/Datum1D';
2
3
  import { SumParams } from '../SumManager';
3
- interface AddRangeOptions {
4
+ interface RangeOptions {
4
5
  from: number;
5
6
  to: number;
7
+ id?: string;
6
8
  }
7
- export declare function addRange(datum: Datum1D, options: AddRangeOptions & SumParams): void;
9
+ export declare function createRangeObj({ from, to, absolute, id, signal, }: RangeOptions & {
10
+ signal: Omit<Signal1D, 'id'>;
11
+ absolute: number;
12
+ }): {
13
+ id: string;
14
+ from: number;
15
+ to: number;
16
+ absolute: number;
17
+ signals: {
18
+ peaks?: import("nmr-processing").NMRPeak1D[] | undefined;
19
+ kind?: string | undefined;
20
+ delta: number;
21
+ js?: import("nmr-processing").Jcoupling[] | undefined;
22
+ atoms?: number[] | undefined;
23
+ assignment?: string | undefined;
24
+ multiplicity?: string | undefined;
25
+ diaIDs?: string[] | undefined;
26
+ nbAtoms?: number | undefined;
27
+ integration?: number | undefined;
28
+ statistic?: {
29
+ mean: number;
30
+ sd: number;
31
+ min: number;
32
+ max: number;
33
+ nb: number;
34
+ } | undefined;
35
+ originDelta?: number | undefined;
36
+ id: string;
37
+ }[];
38
+ kind: string;
39
+ integration: number;
40
+ };
41
+ export declare function addRange(datum: Datum1D, options: RangeOptions & SumParams): void;
8
42
  export {};
@@ -5,30 +5,53 @@ import { initSumOptions } from '../SumManager';
5
5
  import detectSignal from './detectSignal';
6
6
  import { mapRanges } from './mapRanges';
7
7
  import { updateRangesRelativeValues } from './updateRangesRelativeValues';
8
+ export function createRangeObj({ from, to, absolute, id, signal, }) {
9
+ return {
10
+ id: id ? id : generateID(),
11
+ from,
12
+ to,
13
+ absolute,
14
+ signals: [{ id: generateID(), ...signal }],
15
+ kind: DatumKind.signal,
16
+ integration: 0,
17
+ };
18
+ }
8
19
  export function addRange(datum, options) {
9
- const { from, to, molecules, nucleus } = options;
20
+ const { from, to, id, molecules, nucleus } = options;
10
21
  const { x, re } = datum.data;
11
22
  const absolute = xyIntegration({ x, y: re }, { from, to, reverse: true });
12
23
  // detectSignal use the advance multiplet-analysis that can crash if too many points
13
24
  const signal = detectSignal(x, re, from, to, datum.info.originFrequency);
14
- if (!signal)
15
- return;
16
- try {
17
- const range = {
18
- id: generateID(),
25
+ let range;
26
+ if (!signal) {
27
+ if (id === 'new') {
28
+ range = createRangeObj({
29
+ from,
30
+ to,
31
+ id,
32
+ absolute,
33
+ signal: { multiplicity: 's', kind: 'signal', delta: 0, js: [] },
34
+ });
35
+ }
36
+ }
37
+ else {
38
+ range = createRangeObj({
19
39
  from,
20
40
  to,
41
+ id,
21
42
  absolute,
22
- signals: [{ id: generateID(), ...signal }],
23
- kind: DatumKind.signal,
24
- integration: 0,
25
- };
26
- datum.ranges.options = initSumOptions(datum.ranges.options, {
27
- molecules,
28
- nucleus,
43
+ signal,
29
44
  });
30
- datum.ranges.values = datum.ranges.values.concat(mapRanges([range], datum));
31
- updateRangesRelativeValues(datum);
45
+ }
46
+ try {
47
+ if (range) {
48
+ datum.ranges.options = initSumOptions(datum.ranges.options, {
49
+ molecules,
50
+ nucleus,
51
+ });
52
+ datum.ranges.values = datum.ranges.values.concat(mapRanges([range], datum));
53
+ updateRangesRelativeValues(datum);
54
+ }
32
55
  }
33
56
  catch (e) {
34
57
  throw new Error('Could not calculate the multiplicity');
@@ -3,8 +3,8 @@ import { analyseMultiplet } from 'multiplet-analysis';
3
3
  export const MAX_LENGTH = 2048;
4
4
  export default function detectSignal(x, re, from, to, frequency) {
5
5
  const { fromIndex, toIndex } = xGetFromToIndex(x, {
6
- from: from,
7
- to: to,
6
+ from,
7
+ to,
8
8
  });
9
9
  if (toIndex - fromIndex <= MAX_LENGTH) {
10
10
  const data = {
@@ -12,7 +12,7 @@ export default function detectSignal(x, re, from, to, frequency) {
12
12
  y: re.subarray(fromIndex, toIndex),
13
13
  };
14
14
  const result = analyseMultiplet(data, {
15
- frequency: frequency,
15
+ frequency,
16
16
  takeBestPartMultiplet: true,
17
17
  symmetrizeEachStep: true,
18
18
  });
@@ -17,7 +17,7 @@ export function mapRanges(ranges, datum) {
17
17
  const shiftX = getShiftX(datum);
18
18
  const error = getSpectrumErrorValue(datum);
19
19
  return ranges.reduce((acc, newRange) => {
20
- if (checkRange(newRange, datum, error))
20
+ if (checkRange(newRange, datum, error) && newRange.id !== 'new')
21
21
  return acc;
22
22
  const absolute = xyIntegration({ x, y: re }, { from: newRange.from, to: newRange.to, reverse: true });
23
23
  const signals = newRange.signals.map((signal) => {
@@ -8,16 +8,18 @@ export interface DataBaseRange {
8
8
  to: number;
9
9
  signals: Array<DataBaseSignal>;
10
10
  }
11
- export declare type DataBase = {
11
+ export declare type LocalDatabase = {
12
+ key: string;
12
13
  label: string;
13
14
  url?: string;
14
15
  value?: Array<DatabaseNMREntry>;
15
- }[];
16
- export declare const databases: DataBase;
16
+ };
17
+ export declare const DATA_BASES: LocalDatabase[];
17
18
  export interface InitiateDatabaseResult {
18
19
  data: DatabaseNMREntry[];
19
20
  getSolvents: () => string[];
20
21
  search: (keywords?: string | string[]) => DatabaseNMREntry[];
22
+ searchByStructure: (idCode: string) => DatabaseNMREntry[];
21
23
  }
22
24
  export declare function initiateDatabase(databases: DatabaseNMREntry[], nucleus: string): InitiateDatabaseResult;
23
25
  export declare type PrepareDataResult = Partial<DataBaseRange | DataBaseSignal | Jcoupling>;
@@ -1,17 +1,29 @@
1
1
  import { protonImpurities, carbonImpurities, } from 'nmr-processing';
2
+ import { MoleculesDB } from 'openchemlib-utils';
3
+ import OCL from 'openchemlib/full';
2
4
  import { filter } from 'smart-array-filter';
3
5
  import generateID from '../utilities/generateID';
4
- export const databases = [
6
+ export const DATA_BASES = [
5
7
  {
8
+ key: 'local_solvent',
6
9
  label: 'Solvent database',
7
10
  value: prepareDataBase([...protonImpurities, ...carbonImpurities]),
8
11
  },
9
12
  ];
10
13
  export function initiateDatabase(databases, nucleus) {
11
14
  const data = databases.filter((datum) => datum.nucleus === nucleus);
15
+ const moleculesDB = prepareMoleculesDB(data);
12
16
  const getSolvents = () => prepareGetSolvents(data);
13
17
  const search = (keywords = []) => filter(data, { keywords });
14
- return { data, getSolvents, search };
18
+ const searchByStructure = (idCode) => processSearchByStructure(moleculesDB, idCode);
19
+ return { searchByStructure, data, getSolvents, search };
20
+ }
21
+ function processSearchByStructure(moleculesDB, idCode) {
22
+ // default format { format: 'idCode' }
23
+ // https://github.com/cheminfo/openchemlib-utils/blob/ef3a9c30be7efe225a24de04ea9cefc9299674aa/src/db/MoleculesDB.js#L102-L115
24
+ // todo: idCode may be null and the current version of search requires a string or molecule. `|| ''` will become useless in next release of openchemlib-util
25
+ const result = moleculesDB.search(idCode || '');
26
+ return result.map((entry) => entry.data, []);
15
27
  }
16
28
  function prepareGetSolvents(data) {
17
29
  const result = [];
@@ -30,6 +42,44 @@ function prepareGetSolvents(data) {
30
42
  // return { id: index, name: label };
31
43
  // });
32
44
  // }
45
+ function prepareMoleculesDB(array) {
46
+ let moleculesDB = new MoleculesDB(OCL);
47
+ for (let entry of array) {
48
+ //@ts-expect-error property will be defined in next release of nmr-processing
49
+ if (entry.ocl) {
50
+ try {
51
+ const molecule = OCL.Molecule.fromIDCode(
52
+ //@ts-expect-error property will be defined in next release of nmr-processing
53
+ entry.ocl.idCode,
54
+ //@ts-expect-error property will be defined in next release of nmr-processing
55
+ entry.ocl.coordinates);
56
+ moleculesDB.pushEntry(molecule, entry, {}, {
57
+ //@ts-expect-error property will be defined in next release of nmr-processing
58
+ idCode: entry.ocl.idCode,
59
+ //@ts-expect-error property will be defined in next release of nmr-processing
60
+ index: entry.ocl.index,
61
+ });
62
+ }
63
+ catch (e) {
64
+ // eslint-disable-next-line no-console
65
+ console.log(`Could not parse idCode: ${JSON.stringify(
66
+ //@ts-expect-error property will be defined in next release of nmr-processing
67
+ entry.ocl)}`, e);
68
+ }
69
+ }
70
+ else if (entry.smiles) {
71
+ try {
72
+ const molecule = OCL.Molecule.fromSmiles(entry.smiles);
73
+ moleculesDB.pushEntry(molecule, entry);
74
+ }
75
+ catch (e) {
76
+ // eslint-disable-next-line no-console
77
+ console.log(`Could not parse smiles: ${entry.smiles}`, e);
78
+ }
79
+ }
80
+ }
81
+ return moleculesDB;
82
+ }
33
83
  function prepareDataBase(array) {
34
84
  return array.map((item) => {
35
85
  item.ranges = item.ranges.map((range) => ({
@@ -70,13 +120,13 @@ export function prepareData(data) {
70
120
  function mapJs(js) {
71
121
  if (js && js.length > 0) {
72
122
  const { coupling, multiplicity } = js.reduce((acc, { coupling, multiplicity }) => {
73
- acc.coupling.push(coupling.toFixed(1));
123
+ acc.coupling.push(coupling);
74
124
  acc.multiplicity += multiplicity;
75
125
  return acc;
76
126
  }, { coupling: [], multiplicity: '' });
77
127
  return { multiplicity, coupling: coupling.join(',') };
78
128
  }
79
129
  else {
80
- return { multiplicity: 's', coupling: '' };
130
+ return { multiplicity: '', coupling: '' };
81
131
  }
82
132
  }
@@ -52,6 +52,6 @@ export function isApplicable(datum1D) {
52
52
  export function reduce(previousValue, newValue) {
53
53
  return {
54
54
  once: true,
55
- reduce: previousValue + newValue,
55
+ reduce: newValue,
56
56
  };
57
57
  }
@@ -100,7 +100,7 @@ export default class Processing2D {
100
100
  contours = this.conrec.drawContour({
101
101
  contourDrawer: 'basic',
102
102
  levels: _range,
103
- timeout: timeout,
103
+ timeout,
104
104
  });
105
105
  }
106
106
  catch (e) {