nmrium 0.40.1 → 0.41.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 (274) hide show
  1. package/lib/component/1d/FooterBanner.js +5 -4
  2. package/lib/component/1d/Viewer1D.js +121 -104
  3. package/lib/component/1d/database/ResurrectedDatabaseRanges.js +1 -1
  4. package/lib/component/1d/jCouplingGraph/JGraphContext.d.ts +1 -1
  5. package/lib/component/1d/jCouplingGraph/JsCouplingLinks.js +1 -1
  6. package/lib/component/1d/multiplicityTree/TreeColors.d.ts +1 -1
  7. package/lib/component/1d/multiplicityTree/TreeColors.js +1 -6
  8. package/lib/component/1d/multiplicityTree/TreeNodes.d.ts +1 -1
  9. package/lib/component/1d/tool/BaseLineZones.d.ts +1 -1
  10. package/lib/component/1d/tool/BaseLineZones.js +7 -4
  11. package/lib/component/1d/tool/PeakPointer.js +1 -1
  12. package/lib/component/1d/utilities/scale.js +1 -3
  13. package/lib/component/1d-2d/components/FloatMoleculeStructures/index.d.ts +1 -1
  14. package/lib/component/1d-2d/tools/BrushXY.js +10 -7
  15. package/lib/component/1d-2d/tools/CrossLinePointer.js +1 -1
  16. package/lib/component/2d/FooterBanner.js +3 -2
  17. package/lib/component/2d/Viewer2D.js +51 -29
  18. package/lib/component/2d/XAxis.js +1 -1
  19. package/lib/component/2d/YAxis.js +1 -1
  20. package/lib/component/2d/utilities/SliceScale.d.ts +2 -2
  21. package/lib/component/2d/utilities/scale.d.ts +5 -5
  22. package/lib/component/2d/zones/Signal.js +1 -2
  23. package/lib/component/EventsTrackers/BrushTracker.d.ts +4 -1
  24. package/lib/component/EventsTrackers/BrushTracker.js +21 -6
  25. package/lib/component/NMRium.d.ts +2 -2
  26. package/lib/component/NMRium.js +39 -26
  27. package/lib/component/assignment/AssignmentsReducer.d.ts +1 -1
  28. package/lib/component/assignment/actions/setActiveAssignment.js +1 -1
  29. package/lib/component/elements/InputRange.js +1 -1
  30. package/lib/component/elements/MenuButton.d.ts +1 -1
  31. package/lib/component/elements/MoleculeSelection.d.ts +1 -1
  32. package/lib/component/elements/ReactTable/ReactTable.d.ts +1 -1
  33. package/lib/component/elements/Tab/DeleteButton.d.ts +1 -1
  34. package/lib/component/elements/ToolbarMenu.d.ts +1 -1
  35. package/lib/component/elements/accordion/Accordion.d.ts +1 -1
  36. package/lib/component/elements/draggable/SVGDraggable.d.ts +1 -1
  37. package/lib/component/elements/draggable/useDraggable.d.ts +1 -1
  38. package/lib/component/elements/dropDownButton/DropDownButton.d.ts +1 -1
  39. package/lib/component/elements/dropDownButton/DropDownList.js +3 -1
  40. package/lib/component/elements/formik/SelectBox.d.ts +1 -1
  41. package/lib/component/elements/popup/Alert/AlertBlock.d.ts +3 -2
  42. package/lib/component/elements/popup/Alert/AlertBlock.js +21 -15
  43. package/lib/component/elements/popup/Alert/Context.d.ts +26 -2
  44. package/lib/component/elements/popup/Alert/Context.js +6 -2
  45. package/lib/component/elements/popup/Alert/Provider.d.ts +4 -3
  46. package/lib/component/elements/popup/Alert/Provider.js +3 -3
  47. package/lib/component/elements/popup/Modal/ConfirmDialog.d.ts +1 -1
  48. package/lib/component/elements/popup/Modal/Provider.js +3 -1
  49. package/lib/component/elements/popup/options.d.ts +22 -19
  50. package/lib/component/elements/resizer/Resizer.d.ts +2 -2
  51. package/lib/component/elements/toggle/ToggleButton.d.ts +2 -2
  52. package/lib/component/elements/toggle/ToggleButton.js +1 -1
  53. package/lib/component/header/ZeroFillingOptionsPanel.js +3 -8
  54. package/lib/component/highlight/index.d.ts +1 -1
  55. package/lib/component/hooks/useCheckToolsVisibility.js +2 -2
  56. package/lib/component/hooks/useExport.js +2 -1
  57. package/lib/component/hooks/useFormatNumberByNucleus.d.ts +1 -1
  58. package/lib/component/hooks/usePanelPreferences.js +2 -2
  59. package/lib/component/hooks/useXScale.d.ts +1 -1
  60. package/lib/component/hooks/useXYReduce.d.ts +2 -2
  61. package/lib/component/modal/AboutSpectrumSimulationModal.d.ts +2 -0
  62. package/lib/component/modal/AboutSpectrumSimulationModal.js +49 -0
  63. package/lib/component/modal/AlignSpectraModal.js +11 -1
  64. package/lib/component/modal/MultipletAnalysisModal.js +2 -1
  65. package/lib/component/modal/PredictSpectraModal.d.ts +1 -2
  66. package/lib/component/modal/PredictSpectraModal.js +25 -28
  67. package/lib/component/modal/changeSum/ChangeSumModal.js +1 -1
  68. package/lib/component/modal/editRange/forms/components/SignalsForm.js +1 -1
  69. package/lib/component/modal/editZone/SignalsForm.js +1 -1
  70. package/lib/component/modal/metaImportation/MetaImportationModal.js +1 -1
  71. package/lib/component/modal/setting/settings-tabs/DisplayTabContent.js +4 -0
  72. package/lib/component/modal/setting/settings-tabs/FormattingTabContent.js +1 -1
  73. package/lib/component/modal/setting/settingsValidation.js +2 -2
  74. package/lib/component/panels/IntegralsPanel/IntegralPanel.d.ts +1 -1
  75. package/lib/component/panels/IntegralsPanel/IntegralTable.d.ts +1 -1
  76. package/lib/component/panels/IntegralsPanel/IntegralTable.js +4 -7
  77. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.d.ts +1 -1
  78. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +2 -4
  79. package/lib/component/panels/MoleculesPanel/Utilities.d.ts +1 -1
  80. package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +3 -5
  81. package/lib/component/panels/Panels.js +13 -0
  82. package/lib/component/panels/PeaksPanel/PeaksTable.js +1 -1
  83. package/lib/component/panels/SpectrumsPanel/SpectraTable.js +1 -1
  84. package/lib/component/panels/SpectrumsPanel/base/setting/SpectrumSetting.js +3 -1
  85. package/lib/component/panels/SpectrumsPanel/base/setting/processSnapPlot.js +2 -2
  86. package/lib/component/panels/SummaryPanel/utilities/Utilities.d.ts +2 -1
  87. package/lib/component/panels/SummaryPanel/utilities/Utilities.js +1 -1
  88. package/lib/component/panels/ZonesPanel/ZonesTable.d.ts +1 -1
  89. package/lib/component/panels/databasePanel/DatabasePanel.d.ts +1 -1
  90. package/lib/component/panels/databasePanel/DatabasePanel.js +1 -1
  91. package/lib/component/panels/databasePanel/DatabaseTable.js +1 -1
  92. package/lib/component/panels/extra/utilities/MultiplicityUtilities.js +2 -2
  93. package/lib/component/panels/extra/utilities/UseToggleStatus.js +1 -1
  94. package/lib/component/panels/filtersPanel/FiltersTable.js +2 -2
  95. package/lib/component/panels/predictionPanel/PredictionOptionsPanel.js +2 -1
  96. package/lib/component/panels/predictionPanel/PredictionPanel.js +3 -2
  97. package/lib/component/panels/predictionPanel/PredictionSimpleOptions.js +2 -2
  98. package/lib/component/panels/spectrumSimulation/SpectrumSimulation.d.ts +1 -0
  99. package/lib/component/panels/spectrumSimulation/SpectrumSimulation.js +88 -0
  100. package/lib/component/panels/spectrumSimulation/SpectrumSimulationPreferences.d.ts +11 -0
  101. package/lib/component/panels/spectrumSimulation/SpectrumSimulationPreferences.js +37 -0
  102. package/lib/component/panels/spectrumSimulation/SpectrumSimulationSimpleOptions.d.ts +4 -0
  103. package/lib/component/panels/spectrumSimulation/SpectrumSimulationSimpleOptions.js +25 -0
  104. package/lib/component/panels/spectrumSimulation/SpinSystemTable.d.ts +5 -0
  105. package/lib/component/panels/spectrumSimulation/SpinSystemTable.js +60 -0
  106. package/lib/component/reducer/Reducer.d.ts +13 -12
  107. package/lib/component/reducer/Reducer.js +251 -239
  108. package/lib/component/reducer/actions/AssignmentsActions.d.ts +1 -1
  109. package/lib/component/reducer/actions/AssignmentsActions.js +1 -1
  110. package/lib/component/reducer/actions/DatabaseActions.js +2 -1
  111. package/lib/component/reducer/actions/DomainActions.d.ts +7 -2
  112. package/lib/component/reducer/actions/DomainActions.js +30 -1
  113. package/lib/component/reducer/actions/FiltersActions.js +4 -4
  114. package/lib/component/reducer/actions/LoadActions.js +1 -1
  115. package/lib/component/reducer/actions/MoleculeActions.d.ts +2 -0
  116. package/lib/component/reducer/actions/MoleculeActions.js +51 -2
  117. package/lib/component/reducer/actions/SpectrumsActions.d.ts +8 -2
  118. package/lib/component/reducer/actions/SpectrumsActions.js +43 -4
  119. package/lib/component/reducer/actions/ToolsActions.js +2 -2
  120. package/lib/component/reducer/actions/ZonesActions.js +1 -1
  121. package/lib/component/reducer/helper/ZoomHistoryManager.d.ts +4 -6
  122. package/lib/component/reducer/preferences/actions/setActiveWorkspace.js +1 -1
  123. package/lib/component/reducer/preferences/actions/setPreferences.js +3 -4
  124. package/lib/component/reducer/preferences/preferencesReducer.d.ts +1 -1
  125. package/lib/component/reducer/preferences/preferencesReducer.js +5 -1
  126. package/lib/component/reducer/preferences/utilities/flatObject.js +1 -1
  127. package/lib/component/toolbar/ToolTypes.d.ts +4 -4
  128. package/lib/component/utility/export.js +9 -9
  129. package/lib/component/utility/getSpectraObjectPaths.js +1 -1
  130. package/lib/component/utility/getUniqueNuclei.js +1 -1
  131. package/lib/component/utility/jpathToArray.js +1 -1
  132. package/lib/component/workspaces/index.d.ts +1 -0
  133. package/lib/component/workspaces/index.js +2 -0
  134. package/lib/component/workspaces/simulation.d.ts +2 -0
  135. package/lib/component/workspaces/simulation.js +68 -0
  136. package/lib/component/workspaces/workspaceDefaultProperties.js +1 -0
  137. package/lib/data/PredictionManager.d.ts +8 -7
  138. package/lib/data/PredictionManager.js +95 -22
  139. package/lib/data/SpectraManager.js +1 -1
  140. package/lib/data/constants/DefaultPathLengths.d.ts +1 -3
  141. package/lib/data/constants/SignalsKinds.d.ts +2 -2
  142. package/lib/data/data1d/Spectrum1D/generateJGraphData.js +3 -3
  143. package/lib/data/data1d/Spectrum1D/getReferenceShift.js +5 -4
  144. package/lib/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.d.ts +1 -1
  145. package/lib/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.js +12 -13
  146. package/lib/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.js +10 -9
  147. package/lib/data/data1d/database.d.ts +5 -5
  148. package/lib/data/data1d/database.js +3 -3
  149. package/lib/data/data1d/multipleSpectraAnalysis.d.ts +1 -1
  150. package/lib/data/data1d/multipleSpectraAnalysis.js +1 -1
  151. package/lib/data/data1d/spectrumSimulation.d.ts +14 -0
  152. package/lib/data/data1d/spectrumSimulation.js +53 -0
  153. package/lib/data/data2d/Spectrum2D/contours.d.ts +8 -4
  154. package/lib/data/data2d/Spectrum2D/contours.js +7 -1
  155. package/lib/data/data2d/Spectrum2D/getMissingProjection.js +6 -6
  156. package/lib/data/data2d/Spectrum2D/getShift.js +1 -1
  157. package/lib/data/data2d/Spectrum2D/getSlice.js +4 -4
  158. package/lib/data/data2d/Spectrum2D/zones/getDetectionZones.js +5 -5
  159. package/lib/data/getDefaultMatrixFilters.d.ts +2 -2
  160. package/lib/data/matrixGeneration.js +1 -1
  161. package/lib/data/molecules/MoleculeManager.d.ts +1 -1
  162. package/lib/data/molecules/MoleculeManager.js +7 -7
  163. package/lib/data/parseMeta/linkMetaWithSpectra.js +2 -1
  164. package/lib/data/types/data1d/MatrixOptions.d.ts +2 -2
  165. package/lib/data/utilities/FindUtilities.js +4 -4
  166. package/lib/data/utilities/RangeUtilities.d.ts +1 -1
  167. package/lib/data/utilities/ZoneUtilities.d.ts +1 -1
  168. package/lib/data/utilities/calculateSanPlot.js +3 -3
  169. package/lib/data/utilities/generateNumbersPowerOfX.js +1 -1
  170. package/lib/utils/clipboard/clipboard.d.ts +1 -1
  171. package/lib/versionInfo.js +1 -1
  172. package/lib-cjs/component/1d/FooterBanner.js +5 -4
  173. package/lib-cjs/component/1d/Viewer1D.js +120 -103
  174. package/lib-cjs/component/1d/database/ResurrectedDatabaseRanges.js +1 -1
  175. package/lib-cjs/component/1d/jCouplingGraph/JsCouplingLinks.js +1 -1
  176. package/lib-cjs/component/1d/multiplicityTree/TreeColors.js +1 -6
  177. package/lib-cjs/component/1d/tool/BaseLineZones.js +6 -3
  178. package/lib-cjs/component/1d/tool/PeakPointer.js +1 -1
  179. package/lib-cjs/component/1d/utilities/scale.js +1 -3
  180. package/lib-cjs/component/1d-2d/tools/BrushXY.js +10 -7
  181. package/lib-cjs/component/1d-2d/tools/CrossLinePointer.js +1 -1
  182. package/lib-cjs/component/2d/FooterBanner.js +3 -2
  183. package/lib-cjs/component/2d/Viewer2D.js +50 -28
  184. package/lib-cjs/component/2d/XAxis.js +1 -1
  185. package/lib-cjs/component/2d/YAxis.js +1 -1
  186. package/lib-cjs/component/2d/zones/Signal.js +1 -2
  187. package/lib-cjs/component/EventsTrackers/BrushTracker.js +21 -6
  188. package/lib-cjs/component/NMRium.js +37 -24
  189. package/lib-cjs/component/assignment/actions/setActiveAssignment.js +1 -1
  190. package/lib-cjs/component/elements/InputRange.js +1 -1
  191. package/lib-cjs/component/elements/dropDownButton/DropDownList.js +3 -1
  192. package/lib-cjs/component/elements/popup/Alert/AlertBlock.js +21 -15
  193. package/lib-cjs/component/elements/popup/Alert/Context.js +6 -2
  194. package/lib-cjs/component/elements/popup/Alert/Provider.js +2 -2
  195. package/lib-cjs/component/elements/popup/Modal/Provider.js +3 -1
  196. package/lib-cjs/component/header/ZeroFillingOptionsPanel.js +3 -8
  197. package/lib-cjs/component/hooks/useCheckToolsVisibility.js +2 -2
  198. package/lib-cjs/component/hooks/useExport.js +2 -1
  199. package/lib-cjs/component/hooks/usePanelPreferences.js +1 -1
  200. package/lib-cjs/component/modal/AboutSpectrumSimulationModal.js +54 -0
  201. package/lib-cjs/component/modal/AlignSpectraModal.js +11 -1
  202. package/lib-cjs/component/modal/MultipletAnalysisModal.js +2 -1
  203. package/lib-cjs/component/modal/PredictSpectraModal.js +24 -27
  204. package/lib-cjs/component/modal/changeSum/ChangeSumModal.js +1 -1
  205. package/lib-cjs/component/modal/editRange/forms/components/SignalsForm.js +1 -1
  206. package/lib-cjs/component/modal/editZone/SignalsForm.js +1 -1
  207. package/lib-cjs/component/modal/metaImportation/MetaImportationModal.js +1 -1
  208. package/lib-cjs/component/modal/setting/settings-tabs/DisplayTabContent.js +4 -0
  209. package/lib-cjs/component/modal/setting/settings-tabs/FormattingTabContent.js +1 -1
  210. package/lib-cjs/component/modal/setting/settingsValidation.js +2 -2
  211. package/lib-cjs/component/panels/IntegralsPanel/IntegralTable.js +4 -7
  212. package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +2 -4
  213. package/lib-cjs/component/panels/MoleculesPanel/useAtomAssignment.js +3 -5
  214. package/lib-cjs/component/panels/Panels.js +13 -0
  215. package/lib-cjs/component/panels/PeaksPanel/PeaksTable.js +1 -1
  216. package/lib-cjs/component/panels/SpectrumsPanel/SpectraTable.js +1 -1
  217. package/lib-cjs/component/panels/SpectrumsPanel/base/setting/SpectrumSetting.js +3 -1
  218. package/lib-cjs/component/panels/SpectrumsPanel/base/setting/processSnapPlot.js +2 -2
  219. package/lib-cjs/component/panels/SummaryPanel/utilities/Utilities.js +1 -1
  220. package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +1 -1
  221. package/lib-cjs/component/panels/databasePanel/DatabaseTable.js +1 -1
  222. package/lib-cjs/component/panels/extra/utilities/MultiplicityUtilities.js +2 -2
  223. package/lib-cjs/component/panels/extra/utilities/UseToggleStatus.js +1 -1
  224. package/lib-cjs/component/panels/filtersPanel/FiltersTable.js +2 -2
  225. package/lib-cjs/component/panels/predictionPanel/PredictionOptionsPanel.js +2 -1
  226. package/lib-cjs/component/panels/predictionPanel/PredictionPanel.js +3 -2
  227. package/lib-cjs/component/panels/predictionPanel/PredictionSimpleOptions.js +1 -1
  228. package/lib-cjs/component/panels/spectrumSimulation/SpectrumSimulation.js +94 -0
  229. package/lib-cjs/component/panels/spectrumSimulation/SpectrumSimulationPreferences.js +42 -0
  230. package/lib-cjs/component/panels/spectrumSimulation/SpectrumSimulationSimpleOptions.js +31 -0
  231. package/lib-cjs/component/panels/spectrumSimulation/SpinSystemTable.js +67 -0
  232. package/lib-cjs/component/reducer/Reducer.js +251 -239
  233. package/lib-cjs/component/reducer/actions/AssignmentsActions.js +1 -1
  234. package/lib-cjs/component/reducer/actions/DatabaseActions.js +2 -1
  235. package/lib-cjs/component/reducer/actions/DomainActions.js +31 -1
  236. package/lib-cjs/component/reducer/actions/FiltersActions.js +4 -4
  237. package/lib-cjs/component/reducer/actions/LoadActions.js +1 -1
  238. package/lib-cjs/component/reducer/actions/MoleculeActions.js +54 -2
  239. package/lib-cjs/component/reducer/actions/SpectrumsActions.js +43 -3
  240. package/lib-cjs/component/reducer/actions/ToolsActions.js +2 -2
  241. package/lib-cjs/component/reducer/actions/ZonesActions.js +1 -1
  242. package/lib-cjs/component/reducer/preferences/actions/setActiveWorkspace.js +1 -1
  243. package/lib-cjs/component/reducer/preferences/actions/setPreferences.js +3 -4
  244. package/lib-cjs/component/reducer/preferences/preferencesReducer.js +5 -1
  245. package/lib-cjs/component/reducer/preferences/utilities/flatObject.js +1 -1
  246. package/lib-cjs/component/utility/export.js +9 -9
  247. package/lib-cjs/component/utility/getSpectraObjectPaths.js +1 -1
  248. package/lib-cjs/component/utility/getUniqueNuclei.js +1 -1
  249. package/lib-cjs/component/utility/jpathToArray.js +1 -1
  250. package/lib-cjs/component/workspaces/index.js +2 -0
  251. package/lib-cjs/component/workspaces/simulation.js +71 -0
  252. package/lib-cjs/component/workspaces/workspaceDefaultProperties.js +1 -0
  253. package/lib-cjs/data/PredictionManager.js +96 -22
  254. package/lib-cjs/data/SpectraManager.js +1 -1
  255. package/lib-cjs/data/data1d/Spectrum1D/generateJGraphData.js +3 -3
  256. package/lib-cjs/data/data1d/Spectrum1D/getReferenceShift.js +5 -4
  257. package/lib-cjs/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.js +12 -13
  258. package/lib-cjs/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.js +10 -9
  259. package/lib-cjs/data/data1d/database.js +3 -3
  260. package/lib-cjs/data/data1d/multipleSpectraAnalysis.js +1 -1
  261. package/lib-cjs/data/data1d/spectrumSimulation.js +58 -0
  262. package/lib-cjs/data/data2d/Spectrum2D/contours.js +7 -1
  263. package/lib-cjs/data/data2d/Spectrum2D/getMissingProjection.js +6 -6
  264. package/lib-cjs/data/data2d/Spectrum2D/getShift.js +1 -1
  265. package/lib-cjs/data/data2d/Spectrum2D/getSlice.js +4 -4
  266. package/lib-cjs/data/data2d/Spectrum2D/zones/getDetectionZones.js +5 -5
  267. package/lib-cjs/data/matrixGeneration.js +1 -1
  268. package/lib-cjs/data/molecules/MoleculeManager.js +7 -7
  269. package/lib-cjs/data/parseMeta/linkMetaWithSpectra.js +2 -1
  270. package/lib-cjs/data/utilities/FindUtilities.js +4 -4
  271. package/lib-cjs/data/utilities/calculateSanPlot.js +3 -3
  272. package/lib-cjs/data/utilities/generateNumbersPowerOfX.js +1 -1
  273. package/lib-cjs/versionInfo.js +1 -1
  274. package/package.json +21 -20
@@ -214,7 +214,7 @@ function handleCalculateZeroFillingFilter(draft, action) {
214
214
  if (activeSpectrum) {
215
215
  const index = activeSpectrum.index;
216
216
  const { data: { x, re, im }, filters, info, } = draft.tempData[index];
217
- let _data = { data: { x, re, im }, filters, info };
217
+ const _data = { data: { x, re, im }, filters, info };
218
218
  zeroFilling.apply(_data, action.payload);
219
219
  const { im: newIm, re: newRe, x: newX } = _data.data;
220
220
  const datum = draft.data[index];
@@ -231,7 +231,7 @@ function handleCalculateApodizationFilter(draft, action) {
231
231
  const index = activeSpectrum.index;
232
232
  const options = action.payload;
233
233
  const { data: { x, re, im }, info, } = draft.tempData[index];
234
- let _data = { data: { x, re, im }, info };
234
+ const _data = { data: { x, re, im }, info };
235
235
  draft.toolOptions.data.apodizationOptions = options;
236
236
  apodization.apply(_data, options);
237
237
  const { im: newIm, re: newRe } = _data.data;
@@ -316,7 +316,7 @@ function handleCalculateManualPhaseCorrection(draft, action) {
316
316
  const { index } = activeSpectrum;
317
317
  const { data: { x, re, im }, info, } = draft.tempData[index];
318
318
  const { ph0, ph1 } = action.payload;
319
- let _data = { data: { x, re, im }, info };
319
+ const _data = { data: { x, re, im }, info };
320
320
  phaseCorrection.apply(_data, { ph0, ph1 });
321
321
  const { im: newIm, re: newRe } = _data.data;
322
322
  const datum = draft.data[index];
@@ -413,7 +413,7 @@ function calculateBaseLineCorrection(draft, baseLineOptions) {
413
413
  const { zones, options } = draft.toolOptions.data.baselineCorrection;
414
414
  const { livePreview, ...filterOptions } = options;
415
415
  if (livePreview) {
416
- let _data = { data: { x, re, im }, info };
416
+ const _data = { data: { x, re, im }, info };
417
417
  baselineCorrection.apply(_data, {
418
418
  zones,
419
419
  ...filterOptions,
@@ -16,7 +16,7 @@ function convertHybridizationStringValuesInCorrelations(correlations) {
16
16
  ...correlations,
17
17
  values: correlations.values.map((correlation) => {
18
18
  if (typeof correlation.hybridization === 'string') {
19
- let values = [];
19
+ const values = [];
20
20
  if (correlation.hybridization.length > 0) {
21
21
  const hybridizationString = correlation.hybridization.replaceAll('SP', '');
22
22
  const value = Number(hybridizationString);
@@ -1,3 +1,4 @@
1
+ import { FifoLogger } from 'fifo-logger';
1
2
  import { Draft } from 'immer';
2
3
  import { PredictedSpectraResult, PredictionOptions } from '../../../data/PredictionManager';
3
4
  import { MoleculeBoundingRect, StateMolecule } from '../../../data/molecules/Molecule';
@@ -15,6 +16,7 @@ type DeleteMoleculeAction = ActionType<'DELETE_MOLECULE', {
15
16
  assignmentData: AssignmentContext;
16
17
  }>;
17
18
  type PredictSpectraFromMoleculeAction = ActionType<'PREDICT_SPECTRA', {
19
+ logger: FifoLogger;
18
20
  options: PredictionOptions;
19
21
  predictedSpectra: PredictedSpectraResult;
20
22
  molecule: StateMolecule;
@@ -1,3 +1,5 @@
1
+ import OCL from 'openchemlib/full';
2
+ import { nbLabileH, getAtoms } from 'openchemlib-utils';
1
3
  import { generateSpectra, } from '../../../data/PredictionManager';
2
4
  import { changeSpectraRelativeSum } from '../../../data/data1d/Spectrum1D/SumManager';
3
5
  import { DRAGGABLE_STRUCTURE_INITIAL_BOUNDING_REACT, } from '../../../data/molecules/Molecule';
@@ -72,10 +74,11 @@ function handleDeleteMolecule(draft, action) {
72
74
  }
73
75
  //action
74
76
  function handlePredictSpectraFromMolecule(draft, action) {
75
- const { predictedSpectra, options, molecule, action: predictionAction = 'save', } = action.payload;
77
+ const { logger, predictedSpectra, options, molecule, action: predictionAction = 'save', } = action.payload;
78
+ checkPredictions(predictedSpectra, options, molecule.molfile, logger);
76
79
  const color = generateColor(false, draft.usedColors['1d']);
77
80
  const spectraIds = [];
78
- for (const spectrum of generateSpectra(predictedSpectra, options, color)) {
81
+ for (const spectrum of generateSpectra(predictedSpectra, options, color, logger)) {
79
82
  draft.data.push(spectrum);
80
83
  spectraIds.push(spectrum.id);
81
84
  }
@@ -100,6 +103,52 @@ function handlePredictSpectraFromMolecule(draft, action) {
100
103
  draft.toolOptions.data.predictionIndex++;
101
104
  setActiveTab(draft, { refreshActiveTab: true, tab: '1H' });
102
105
  }
106
+ function checkPredictions(predictedSpectra, inputOptions, molfile, logger) {
107
+ const { spectra } = inputOptions;
108
+ const missing2DPrediction = [];
109
+ const molecule = OCL.Molecule.fromMolfile(molfile);
110
+ molecule.addImplicitHydrogens();
111
+ const { atoms } = getAtoms(molecule);
112
+ for (const [experiment, required] of Object.entries(spectra)) {
113
+ if (!required || predictedSpectra[experiment])
114
+ continue;
115
+ let message = '';
116
+ switch (experiment) {
117
+ case 'proton': {
118
+ message =
119
+ atoms.H - nbLabileH(molecule) === 0
120
+ ? 'No non-labile hydrogen found in the molecule, the proton spectrum could not be predicted'
121
+ : `Proton was not predicted`;
122
+ break;
123
+ }
124
+ case 'carbon': {
125
+ message = `${experiment} was not predicted. ${!('C' in atoms) ? 'No carbons found in the molecule' : ''}`;
126
+ break;
127
+ }
128
+ case 'cosy':
129
+ message = !predictedSpectra.proton
130
+ ? `Proton prediction is missing, so COSY experiment can not be simulated`
131
+ : `There was a error in ${experiment.toUpperCase()} prediction`;
132
+ break;
133
+ case 'hsqc':
134
+ case 'hmbc':
135
+ if (!predictedSpectra[experiment]) {
136
+ missing2DPrediction.push(experiment);
137
+ }
138
+ break;
139
+ default:
140
+ break;
141
+ }
142
+ if (message.length > 0) {
143
+ logger.warn(message);
144
+ }
145
+ }
146
+ if (missing2DPrediction.length > 0) {
147
+ logger.warn(`Carbon or proton prediction are missing, so ${missing2DPrediction.length > 1
148
+ ? missing2DPrediction.join(' and ')
149
+ : missing2DPrediction[0]} can not be simulated`);
150
+ }
151
+ }
103
152
  function setPredictedSpectraReference(draft, moleculeId, spectraIds) {
104
153
  const predictedSpectraIds = draft.view.predictions?.[moleculeId];
105
154
  // check if the molecule predicted and return and the spectra Ids
@@ -1,5 +1,6 @@
1
1
  import { Draft } from 'immer';
2
2
  import { Spectrum, Display1D, Display2D } from 'nmr-load-save';
3
+ import { SpectrumSimulationOptions } from '../../../data/data1d/spectrumSimulation';
3
4
  import { Nuclei, Nucleus } from '../../../data/types/common/Nucleus';
4
5
  import { State } from '../Reducer';
5
6
  import { ActionType } from '../types/ActionType';
@@ -43,7 +44,11 @@ type RecolorSpectraBasedOnDistinctValueAction = ActionType<'RECOLOR_SPECTRA_COLO
43
44
  type OrderSpectraAction = ActionType<'ORDER_SPECTRA', {
44
45
  data: Spectrum[];
45
46
  }>;
46
- export type SpectrumActions = ActionType<'TOGGLE_SPECTRA_LEGEND'> | ChangeSpectrumVisibilityByIdAction | ChangeSpectraVisibilityByNucleusAction | ChangeActiveSpectrumAction | ChangeSpectrumSettingAction | DeleteSpectraAction | AddMissingProjectionAction | AlignSpectraAction | GenerateSpectrumFromPublicationStringAction | ImportSpectraMetaInfoAction | RecolorSpectraBasedOnDistinctValueAction | OrderSpectraAction;
47
+ type SimulateSpectrumAction = ActionType<'SIMULATE_SPECTRUM', {
48
+ keepSpectrum?: boolean;
49
+ spinSystem: string;
50
+ } & SpectrumSimulationOptions>;
51
+ export type SpectrumActions = ActionType<'TOGGLE_SPECTRA_LEGEND'> | ChangeSpectrumVisibilityByIdAction | ChangeSpectraVisibilityByNucleusAction | ChangeActiveSpectrumAction | ChangeSpectrumSettingAction | DeleteSpectraAction | AddMissingProjectionAction | AlignSpectraAction | GenerateSpectrumFromPublicationStringAction | ImportSpectraMetaInfoAction | RecolorSpectraBasedOnDistinctValueAction | OrderSpectraAction | SimulateSpectrumAction;
47
52
  declare function setSpectraMetaInfo(draft: Draft<State>, spectraMetaInfo: Record<string, Record<string, any>>): void;
48
53
  declare function handleChangeSpectrumVisibilityById(draft: Draft<State>, action: ChangeSpectrumVisibilityByIdAction): void;
49
54
  declare function handleChangeSpectraVisibilityByNucleus(draft: Draft<State>, action: ChangeSpectraVisibilityByNucleusAction): void;
@@ -57,4 +62,5 @@ declare function handleImportSpectraMetaInfo(draft: Draft<State>, action: Import
57
62
  declare function handleToggleSpectraLegend(draft: Draft<State>): void;
58
63
  declare function handleRecolorSpectraBasedOnDistinctValue(draft: Draft<State>, action: RecolorSpectraBasedOnDistinctValueAction): void;
59
64
  declare function handleOrderSpectra(draft: Draft<State>, action: OrderSpectraAction): void;
60
- export { handleChangeSpectrumVisibilityById, handleChangeSpectraVisibilityByNucleus, handleChangeActiveSpectrum, handleChangeSpectrumSetting, handleDeleteSpectra, handleAddMissingProjectionHandler, handleAlignSpectraHandler, handleGenerateSpectrumFromPublicationStringHandler, handleImportSpectraMetaInfo, handleToggleSpectraLegend, handleRecolorSpectraBasedOnDistinctValue, handleOrderSpectra, setSpectraMetaInfo, };
65
+ declare function handleSimulateSpectrum(draft: Draft<State>, simulateSpectrumOptions: SimulateSpectrumAction): void;
66
+ export { handleChangeSpectrumVisibilityById, handleChangeSpectraVisibilityByNucleus, handleChangeActiveSpectrum, handleChangeSpectrumSetting, handleDeleteSpectra, handleAddMissingProjectionHandler, handleAlignSpectraHandler, handleGenerateSpectrumFromPublicationStringHandler, handleImportSpectraMetaInfo, handleToggleSpectraLegend, handleRecolorSpectraBasedOnDistinctValue, handleOrderSpectra, handleSimulateSpectrum, setSpectraMetaInfo, };
@@ -3,7 +3,8 @@ import lodashGet from 'lodash/get';
3
3
  import omitBy from 'lodash/omitBy';
4
4
  import lodashSet from 'lodash/set';
5
5
  import { Filters, FiltersManager } from 'nmr-processing';
6
- import { generateSpectrumFromPublicationString, getReferenceShift, isSpectrum1D, get1DColor, } from '../../../data/data1d/Spectrum1D';
6
+ import { generateSpectrumFromPublicationString, getReferenceShift, isSpectrum1D, get1DColor, initiateDatum1D, } from '../../../data/data1d/Spectrum1D';
7
+ import { simulateSpectrum, } from '../../../data/data1d/spectrumSimulation';
7
8
  import { getMissingProjection, isSpectrum2D, get2DColor, } from '../../../data/data2d/Spectrum2D';
8
9
  import { contoursManager } from '../../../data/data2d/Spectrum2D/contours';
9
10
  import groupByInfoKey from '../../utility/GroupByInfoKey';
@@ -255,7 +256,7 @@ function handleAddMissingProjectionHandler(draft, action) {
255
256
  const { index } = activeSpectrum;
256
257
  const Spectrum2D = state.data[index];
257
258
  const { info, data } = Spectrum2D;
258
- for (let n of nucleus) {
259
+ for (const n of nucleus) {
259
260
  const datum1D = getMissingProjection(info.isFid ? data.re : data.rr, n, info, draft.usedColors);
260
261
  draft.data.push(datum1D);
261
262
  }
@@ -269,7 +270,7 @@ function handleAddMissingProjectionHandler(draft, action) {
269
270
  //action
270
271
  function handleAlignSpectraHandler(draft, action) {
271
272
  if (draft.data && draft.data.length > 0) {
272
- for (let datum of draft.data) {
273
+ for (const datum of draft.data) {
273
274
  if (datum.info?.dimension === 1 &&
274
275
  datum.info.nucleus === draft.view.spectra.activeTab &&
275
276
  !datum.info?.isFid) {
@@ -367,4 +368,42 @@ function handleOrderSpectra(draft, action) {
367
368
  .filter((s) => !sortedSpectraKey[s.id])
368
369
  .concat(sortedSpectra);
369
370
  }
370
- export { handleChangeSpectrumVisibilityById, handleChangeSpectraVisibilityByNucleus, handleChangeActiveSpectrum, handleChangeSpectrumSetting, handleDeleteSpectra, handleAddMissingProjectionHandler, handleAlignSpectraHandler, handleGenerateSpectrumFromPublicationStringHandler, handleImportSpectraMetaInfo, handleToggleSpectraLegend, handleRecolorSpectraBasedOnDistinctValue, handleOrderSpectra, setSpectraMetaInfo, };
371
+ function handleSimulateSpectrum(draft, simulateSpectrumOptions) {
372
+ const { payload: { spinSystem, data, options, keepSpectrum = false }, } = simulateSpectrumOptions;
373
+ const { x, y } = simulateSpectrum(spinSystem, {
374
+ data,
375
+ options,
376
+ });
377
+ let spectrumIndex = -1;
378
+ if (!keepSpectrum && draft.view.currentSimulatedSpectrumKey) {
379
+ spectrumIndex = draft.data.findIndex((s) => s.id === draft.view.currentSimulatedSpectrumKey);
380
+ }
381
+ const { frequency, to, from } = options;
382
+ const info = {
383
+ originFrequency: frequency,
384
+ baseFrequency: frequency,
385
+ name: spinSystem,
386
+ };
387
+ if (spectrumIndex !== -1) {
388
+ const spectrum = draft.data[spectrumIndex];
389
+ spectrum.data = { x, re: y };
390
+ spectrum.info = { ...spectrum.info, ...info };
391
+ const [x1, x2] = draft.originDomain.xDomain;
392
+ const isInXDomain = to - from <= x2 - x1;
393
+ setDomain(draft, { updateYDomain: false, updateXDomain: !isInXDomain });
394
+ }
395
+ else {
396
+ const spectrum = initiateDatum1D({
397
+ data: { x, re: y },
398
+ info: {
399
+ isFt: true,
400
+ nucleus: '1H',
401
+ ...info,
402
+ },
403
+ }, { usedColors: draft.usedColors });
404
+ draft.data.push(spectrum);
405
+ draft.view.currentSimulatedSpectrumKey = spectrum.id;
406
+ setActiveTab(draft);
407
+ }
408
+ }
409
+ export { handleChangeSpectrumVisibilityById, handleChangeSpectraVisibilityByNucleus, handleChangeActiveSpectrum, handleChangeSpectrumSetting, handleDeleteSpectra, handleAddMissingProjectionHandler, handleAlignSpectraHandler, handleGenerateSpectrumFromPublicationStringHandler, handleImportSpectraMetaInfo, handleToggleSpectraLegend, handleRecolorSpectraBasedOnDistinctValue, handleOrderSpectra, handleSimulateSpectrum, setSpectraMetaInfo, };
@@ -307,10 +307,10 @@ function setDisplayerMode(draft, data) {
307
307
  }
308
308
  //utility
309
309
  function setTabActiveSpectrum(draft, dataGroupByTab) {
310
- let tabs2D = [];
310
+ const tabs2D = [];
311
311
  const tabActiveSpectrum = {};
312
312
  const tabkeys = Object.keys(dataGroupByTab).sort((a, b) => a.split(',').length > b.split(',').length ? -1 : 1);
313
- for (let tabKey of tabkeys) {
313
+ for (const tabKey of tabkeys) {
314
314
  const data = dataGroupByTab[tabKey];
315
315
  const nucleusLength = tabKey.split(',').length;
316
316
  if (nucleusLength === 2) {
@@ -72,7 +72,7 @@ function handleChangeZoneSignalDelta(draft, action) {
72
72
  if (activeSpectrum?.id) {
73
73
  const { index } = activeSpectrum;
74
74
  const { xShift, yShift } = changeZoneSignal(draft.data[index], zoneId, signal);
75
- let filters = [];
75
+ const filters = [];
76
76
  if (xShift !== 0) {
77
77
  filters.push({ name: Filters.shift2DX.id, value: { shift: xShift } });
78
78
  }
@@ -2,14 +2,12 @@ import { Draft } from 'immer';
2
2
  import { Layout } from '../../2d/utilities/DimensionLayout';
3
3
  import { State } from '../Reducer';
4
4
  interface HistoryItem {
5
- xDomain: Array<number>;
6
- yDomain: Array<number>;
7
- }
8
- export interface ZoomHistory {
9
- [key: string]: Array<HistoryItem>;
5
+ xDomain: number[];
6
+ yDomain: number[];
10
7
  }
8
+ export type ZoomHistory = Record<string, HistoryItem[]>;
11
9
  interface ZoomHistoryManager {
12
- historyStack: Array<HistoryItem>;
10
+ historyStack: HistoryItem[];
13
11
  push: (value: HistoryItem) => void;
14
12
  pop: () => HistoryItem;
15
13
  getLast: () => HistoryItem;
@@ -2,7 +2,7 @@ import { getLocalStorage, storeData } from '../../../utility/LocalStorage';
2
2
  export function setActiveWorkspace(draft, action) {
3
3
  if (action.payload) {
4
4
  const { workspace } = action.payload;
5
- let localData = getLocalStorage('nmr-general-settings');
5
+ const localData = getLocalStorage('nmr-general-settings');
6
6
  draft.workspace.current = workspace;
7
7
  localData.currentWorkspace = workspace;
8
8
  storeData('nmr-general-settings', JSON.stringify(localData));
@@ -3,15 +3,14 @@ import { getLocalStorage, storeData } from '../../../utility/LocalStorage';
3
3
  import { getActiveWorkspace } from '../utilities/getActiveWorkspace';
4
4
  import { mapNucleiFormatting } from '../utilities/mapNucleiFormatting';
5
5
  export function setPreferences(draft, action) {
6
- let localData = getLocalStorage('nmr-general-settings');
6
+ const localData = getLocalStorage('nmr-general-settings');
7
7
  const currentWorkspacePreferences = getActiveWorkspace(draft);
8
8
  if (action.payload) {
9
- let { formatting, ...restPreferences } = action.payload;
10
- formatting = mapNucleiFormatting(formatting);
9
+ const { formatting, ...restPreferences } = action.payload;
11
10
  draft.workspaces[draft.workspace.current] = {
12
11
  ...currentWorkspacePreferences,
13
12
  ...restPreferences,
14
- formatting,
13
+ formatting: mapNucleiFormatting(formatting),
15
14
  };
16
15
  }
17
16
  if (draft.workspaces[draft.workspace.current].source === 'user') {
@@ -14,7 +14,7 @@ type InitPreferencesAction = ActionType<'INIT_PREFERENCES', {
14
14
  customWorkspaces: Record<string, Workspace>;
15
15
  dispatch: any;
16
16
  }>;
17
- type SetPreferencesAction = ActionType<'SET_PREFERENCES', Partial<Workspace>> | ActionType<'SET_PREFERENCES', void>;
17
+ type SetPreferencesAction = ActionType<'SET_PREFERENCES', Partial<Workspace>> | ActionType<'SET_PREFERENCES'>;
18
18
  type SetPanelsPreferencesAction = ActionType<'SET_PANELS_PREFERENCES', {
19
19
  key: string;
20
20
  value: string;
@@ -43,6 +43,10 @@ export const WORKSPACES = [
43
43
  key: 'embedded',
44
44
  label: Workspaces.embedded.label,
45
45
  },
46
+ {
47
+ key: 'simulation',
48
+ label: Workspaces.simulation.label,
49
+ },
46
50
  ];
47
51
  export const preferencesInitialState = {
48
52
  version: LOCAL_STORAGE_VERSION,
@@ -56,7 +60,7 @@ export const preferencesInitialState = {
56
60
  };
57
61
  export function initPreferencesState(state) {
58
62
  const nmrLocalStorageVersion = getLocalStorage('nmr-local-storage-version', false);
59
- let localData = getLocalStorage('nmr-general-settings');
63
+ const localData = getLocalStorage('nmr-general-settings');
60
64
  // remove old nmr-local-storage-version key
61
65
  if (nmrLocalStorageVersion && localData?.version) {
62
66
  removeData('nmr-local-storage-version');
@@ -1,5 +1,5 @@
1
1
  export function flatObject(data) {
2
- let result = {};
2
+ const result = {};
3
3
  JSON.parse(JSON.stringify(data), (key, value) => {
4
4
  if (value?.hidden !== true && key) {
5
5
  result[key] = result[key]++ || 1;
@@ -6,15 +6,15 @@ export interface ToolOptionItem {
6
6
  id: string;
7
7
  label: string;
8
8
  mode?: DISPLAYER_MODE;
9
- spectraOptions?: ({
10
- info?: {
9
+ spectraOptions?: Array<{
10
+ info?: Array<{
11
11
  key: InfoKey;
12
12
  value: any;
13
- }[];
13
+ }>;
14
14
  active: true;
15
15
  } | {
16
16
  active: false;
17
- })[];
17
+ }>;
18
18
  isToggle: boolean;
19
19
  hasOptionPanel: boolean;
20
20
  isFilter: boolean;
@@ -70,19 +70,19 @@ function exportAsSVG(rootRef, elementID, fileName = 'experiment') {
70
70
  function exportAsPng(rootRef, elementID, fileName = 'experiment') {
71
71
  const { blob, width, height } = getBlob(rootRef, elementID);
72
72
  try {
73
- let canvas = document.createElement('canvas');
73
+ const canvas = document.createElement('canvas');
74
74
  canvas.width = width;
75
75
  canvas.height = height;
76
- let context = canvas.getContext('2d');
76
+ const context = canvas.getContext('2d');
77
77
  if (context) {
78
78
  context.fillStyle = 'white';
79
79
  context.fillRect(0, 0, canvas.width, canvas.height);
80
80
  }
81
- let img = new Image();
82
- let url = URL.createObjectURL(blob);
81
+ const img = new Image();
82
+ const url = URL.createObjectURL(blob);
83
83
  img.addEventListener('load', () => {
84
84
  context?.drawImage(img, 0, 0);
85
- let png = canvas.toDataURL('image/png', 1);
85
+ const png = canvas.toDataURL('image/png', 1);
86
86
  saveAs(png, `${fileName}.png`);
87
87
  URL.revokeObjectURL(png);
88
88
  });
@@ -132,15 +132,15 @@ function copyBlobToClipboard(canvas) {
132
132
  function copyPNGToClipboard(rootRef, elementID) {
133
133
  const { blob, width, height } = getBlob(rootRef, elementID);
134
134
  try {
135
- let canvas = document.createElement('canvas');
135
+ const canvas = document.createElement('canvas');
136
136
  canvas.width = width;
137
137
  canvas.height = height;
138
- let context = canvas.getContext('2d');
138
+ const context = canvas.getContext('2d');
139
139
  if (context) {
140
140
  context.fillStyle = 'white';
141
141
  context.fillRect(0, 0, canvas.width, canvas.height);
142
142
  }
143
- let img = new Image();
143
+ const img = new Image();
144
144
  const url = URL.createObjectURL(blob);
145
145
  img.addEventListener('load', () => {
146
146
  context?.drawImage(img, 0, 0);
@@ -158,7 +158,7 @@ function copyPNGToClipboard(rootRef, elementID) {
158
158
  }
159
159
  }
160
160
  function getBlob(rootRef, elementID) {
161
- let _svg = rootRef.getRootNode()
161
+ const _svg = rootRef.getRootNode()
162
162
  .querySelector(`#${elementID}`)
163
163
  ?.cloneNode(true);
164
164
  const width = Number(_svg?.getAttribute('width').replace('px', ''));
@@ -15,7 +15,7 @@ function lookForObjectsPaths(obj, path, output) {
15
15
  path = [];
16
16
  }
17
17
  else {
18
- for (let key in obj) {
18
+ for (const key in obj) {
19
19
  lookForObjectsPaths(obj[key], [...path.slice(), key], output);
20
20
  }
21
21
  }
@@ -1,5 +1,5 @@
1
1
  export function getUniqueNuclei(nuclei) {
2
- let uniqueNuclei = {};
2
+ const uniqueNuclei = {};
3
3
  for (const nucleus of nuclei) {
4
4
  const _nuclei = nucleus.split(',');
5
5
  for (const _nucleus of _nuclei) {
@@ -1,5 +1,5 @@
1
1
  export function jpathToArray(jpath, separator = '.') {
2
- let keys = [];
2
+ const keys = [];
3
3
  let key = '';
4
4
  let findSeparator = false;
5
5
  const length = jpath.length;
@@ -5,5 +5,6 @@ declare const _default: {
5
5
  prediction: import("nmr-load-save").InnerWorkspace;
6
6
  assignment: import("nmr-load-save").InnerWorkspace;
7
7
  embedded: import("nmr-load-save").InnerWorkspace;
8
+ simulation: import("nmr-load-save").InnerWorkspace;
8
9
  };
9
10
  export default _default;
@@ -4,6 +4,7 @@ import { embedded } from './embedded';
4
4
  import { exercise } from './exercise';
5
5
  import { prediction } from './prediction';
6
6
  import { process1D } from './process1D';
7
+ import { simulation } from './simulation';
7
8
  export default {
8
9
  exercise,
9
10
  default: basic,
@@ -11,4 +12,5 @@ export default {
11
12
  prediction,
12
13
  assignment,
13
14
  embedded,
15
+ simulation,
14
16
  };
@@ -0,0 +1,2 @@
1
+ import { InnerWorkspace } from 'nmr-load-save';
2
+ export declare const simulation: InnerWorkspace;
@@ -0,0 +1,68 @@
1
+ export const simulation = {
2
+ version: 1,
3
+ label: 'Simulation',
4
+ general: {
5
+ dimmedSpectraOpacity: 0.5,
6
+ verticalSplitterPosition: '440px',
7
+ verticalSplitterCloseThreshold: 600,
8
+ spectraRendering: 'auto',
9
+ loggingLevel: 'info',
10
+ },
11
+ display: {
12
+ panels: {
13
+ spectraPanel: { display: true },
14
+ simulationPanel: { display: true, open: true },
15
+ },
16
+ toolBarButtons: {
17
+ exportAs: true,
18
+ import: true,
19
+ spectraCenterAlignments: true,
20
+ spectraStackAlignments: true,
21
+ zoomOut: true,
22
+ zoom: true,
23
+ },
24
+ },
25
+ formatting: {
26
+ nuclei: {},
27
+ panels: {
28
+ spectra: {
29
+ nuclei: {
30
+ '1H': {
31
+ columns: [
32
+ {
33
+ name: 'visible',
34
+ label: '',
35
+ description: 'Show/Hide Spectrum',
36
+ visible: true,
37
+ },
38
+ {
39
+ name: 'name',
40
+ label: 'Spectrum Name',
41
+ description: 'Spectrum Name',
42
+ jpath: ['info', 'name'],
43
+ visible: true,
44
+ },
45
+ {
46
+ label: 'Frequency',
47
+ description: 'frequency',
48
+ jpath: ['info', 'originFrequency'],
49
+ visible: true,
50
+ },
51
+ {
52
+ jpath: ['info', 'nucleus'],
53
+ label: 'Experiment',
54
+ visible: true,
55
+ },
56
+ {
57
+ name: 'color',
58
+ label: '',
59
+ description: 'Spectrum Color',
60
+ visible: true,
61
+ },
62
+ ],
63
+ },
64
+ },
65
+ },
66
+ },
67
+ },
68
+ };
@@ -21,6 +21,7 @@ export const workspaceDefaultProperties = {
21
21
  peaksPanel: { display: false, open: false },
22
22
  predictionPanel: { display: false, open: false },
23
23
  summaryPanel: { display: false, open: false },
24
+ simulationPanel: { display: false, open: false },
24
25
  },
25
26
  toolBarButtons: {
26
27
  baselineCorrection: false,
@@ -1,9 +1,9 @@
1
- import { FifoLogger } from 'fifo-logger';
1
+ import { Logger } from 'cheminfo-types';
2
2
  import { Spectrum } from 'nmr-load-save';
3
- import { PredictedAll } from 'nmr-processing';
3
+ import { PredictedAll, Prediction1D, Prediction2D } from 'nmr-processing';
4
4
  export type Experiment = 'proton' | 'carbon' | 'cosy' | 'hsqc' | 'hmbc';
5
5
  export type SpectraPredictionOptions = Record<Experiment, boolean>;
6
- export type PredictedSpectraResult = Partial<Record<Experiment, Spectrum>>;
6
+ export type PredictedSpectraResult = Partial<Record<Experiment, Prediction1D | Prediction2D>>;
7
7
  export interface PredictionOptions {
8
8
  name: string;
9
9
  frequency: number;
@@ -25,13 +25,14 @@ export interface PredictionOptions {
25
25
  y: number;
26
26
  };
27
27
  };
28
+ autoExtendRange: boolean;
28
29
  spectra: SpectraPredictionOptions;
29
- logger?: FifoLogger;
30
+ logger?: Logger;
30
31
  }
31
- export declare const defaultPredictionOptions: PredictionOptions;
32
+ export declare const getDefaultPredictionOptions: () => PredictionOptions;
32
33
  export declare const FREQUENCIES: Array<{
33
34
  value: number;
34
35
  label: string;
35
36
  }>;
36
- export declare function predictSpectra(molfile: string, logger: FifoLogger): Promise<PredictedAll>;
37
- export declare function generateSpectra(predictedSpectra: PredictedSpectraResult, inputOptions: PredictionOptions, color: string): Spectrum[];
37
+ export declare function predictSpectra(molfile: string): Promise<PredictedAll>;
38
+ export declare function generateSpectra(predictedSpectra: PredictedSpectraResult, inputOptions: PredictionOptions, color: string, logger: Logger): Spectrum[];