nmrium 0.26.0 → 0.27.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 (425) hide show
  1. package/lib/component/1d/Chart1D.js +3 -2
  2. package/lib/component/1d/FooterBanner.js +1 -1
  3. package/lib/component/1d/Integral.d.ts +2 -1
  4. package/lib/component/1d/Integral.js +5 -12
  5. package/lib/component/1d/IntegralResizable.d.ts +2 -1
  6. package/lib/component/1d/IntegralResizable.js +10 -5
  7. package/lib/component/1d/IntegralsSeries.js +3 -3
  8. package/lib/component/1d/Line.d.ts +2 -2
  9. package/lib/component/1d/PeakAnnotation.js +5 -4
  10. package/lib/component/1d/database/DatabaseElements.d.ts +3 -0
  11. package/lib/component/1d/database/DatabaseElements.js +18 -0
  12. package/lib/component/1d/database/DatabaseSpectrum.d.ts +3 -0
  13. package/lib/component/1d/database/DatabaseSpectrum.js +58 -0
  14. package/lib/component/1d/{ResurrectedDatabaseRanges.d.ts → database/ResurrectedDatabaseRanges.d.ts} +0 -0
  15. package/lib/component/1d/{ResurrectedDatabaseRanges.js → database/ResurrectedDatabaseRanges.js} +9 -6
  16. package/lib/component/1d/jCouplingGraph/JGraph.js +4 -10
  17. package/lib/component/1d/multiAnalysis/AnalysisRange.js +10 -5
  18. package/lib/component/1d/ranges/Range.d.ts +2 -1
  19. package/lib/component/1d/ranges/Range.js +17 -9
  20. package/lib/component/1d/ranges/Ranges.js +6 -3
  21. package/lib/component/1d/tool/XLabelPointer.js +1 -1
  22. package/lib/component/2d/Chart2D.js +2 -1
  23. package/lib/component/2d/Contours.js +4 -1
  24. package/lib/component/2d/FooterBanner.js +1 -1
  25. package/lib/component/2d/tools/XYLabelPointer.js +1 -1
  26. package/lib/component/2d/tools/slicing/HorizontalSliceChart.d.ts +2 -2
  27. package/lib/component/2d/tools/slicing/SliceScale.d.ts +1 -1
  28. package/lib/component/2d/tools/slicing/VerticalSliceChart.d.ts +2 -2
  29. package/lib/component/EventsTrackers/KeysListenerTracker.js +10 -4
  30. package/lib/component/NMRium.d.ts +5 -1
  31. package/lib/component/NMRium.js +6 -3
  32. package/lib/component/SplitPaneWrapper.d.ts +4 -0
  33. package/lib/component/SplitPaneWrapper.js +8 -0
  34. package/lib/component/context/GlobalContext.d.ts +3 -0
  35. package/lib/component/context/GlobalContext.js +1 -1
  36. package/lib/component/context/PreferencesContext.d.ts +15 -12
  37. package/lib/component/context/PreferencesContext.js +1 -1
  38. package/lib/component/elements/Button.js +1 -1
  39. package/lib/component/elements/ColorInput.js +2 -2
  40. package/lib/component/elements/ContextMenu.d.ts +8 -3
  41. package/lib/component/elements/EditableColumn.d.ts +3 -2
  42. package/lib/component/elements/EditableColumn.js +27 -20
  43. package/lib/component/elements/Input.d.ts +9 -1
  44. package/lib/component/elements/Input.js +18 -5
  45. package/lib/component/elements/Select.d.ts +1 -0
  46. package/lib/component/elements/Select.js +21 -15
  47. package/lib/component/elements/ToggleButton.d.ts +2 -1
  48. package/lib/component/elements/ToggleButton.js +2 -2
  49. package/lib/component/elements/draggble/SVGDraggable.d.ts +17 -0
  50. package/lib/component/elements/draggble/SVGDraggable.js +33 -0
  51. package/lib/component/elements/{resizer → draggble}/useDraggable.d.ts +9 -6
  52. package/lib/component/elements/draggble/useDraggable.js +70 -0
  53. package/lib/component/elements/formik/FormikColorPicker.d.ts +1 -0
  54. package/lib/component/elements/formik/FormikColorPicker.js +10 -7
  55. package/lib/component/elements/formik/FormikColumnFormatField.d.ts +5 -4
  56. package/lib/component/elements/formik/FormikColumnFormatField.js +2 -2
  57. package/lib/component/elements/formik/FormikInput.d.ts +1 -0
  58. package/lib/component/elements/formik/FormikInput.js +6 -3
  59. package/lib/component/elements/formik/FormikSlider.d.ts +1 -0
  60. package/lib/component/elements/formik/FormikSlider.js +6 -3
  61. package/lib/component/elements/popup/Alert/Provider.js +1 -1
  62. package/lib/component/elements/resizer/DivResizer.js +17 -62
  63. package/lib/component/elements/resizer/Resizer.d.ts +3 -1
  64. package/lib/component/elements/resizer/SVGResizer.js +24 -53
  65. package/lib/component/elements/resizer/useResizer.d.ts +11 -0
  66. package/lib/component/elements/resizer/useResizer.js +65 -0
  67. package/lib/component/hooks/useExport.d.ts +1 -1
  68. package/lib/component/hooks/useFormatNumberByNucleus.d.ts +3 -0
  69. package/lib/component/{utility/FormatNumber.js → hooks/useFormatNumberByNucleus.js} +0 -9
  70. package/lib/component/hooks/usePanelPreferences.d.ts +7 -0
  71. package/lib/component/hooks/usePanelPreferences.js +54 -0
  72. package/lib/component/hooks/useXYReduce.d.ts +2 -2
  73. package/lib/component/loader/DefaultSpinnerComponent.d.ts +3 -1
  74. package/lib/component/loader/DefaultSpinnerComponent.js +2 -2
  75. package/lib/component/loader/SpinnerContext.d.ts +3 -3
  76. package/lib/component/loader/SpinnerContext.js +2 -2
  77. package/lib/component/modal/MoleculeStructureEditorModal.d.ts +3 -4
  78. package/lib/component/modal/MoleculeStructureEditorModal.js +22 -1
  79. package/lib/component/modal/editRange/EditRangeModal.js +6 -5
  80. package/lib/component/modal/editRange/forms/components/AddSignalFormTab.d.ts +2 -0
  81. package/lib/component/modal/editRange/forms/components/AddSignalFormTab.js +3 -6
  82. package/lib/component/modal/editRange/forms/components/SignalsForm.d.ts +3 -1
  83. package/lib/component/modal/editRange/forms/components/SignalsForm.js +12 -9
  84. package/lib/component/modal/setting/DatabasesTabContent.d.ts +6 -0
  85. package/lib/component/modal/setting/DatabasesTabContent.js +75 -0
  86. package/lib/component/modal/setting/DisplayTabContent.js +11 -7
  87. package/lib/component/modal/setting/FormattingTabContent.js +5 -5
  88. package/lib/component/modal/setting/GeneralSettings.js +2 -1
  89. package/lib/component/modal/setting/settingsValidation.d.ts +48 -0
  90. package/lib/component/modal/setting/settingsValidation.js +33 -27
  91. package/lib/component/panels/AutomaticAssignment/useAutoAssignments.js +10 -5
  92. package/lib/component/panels/IntegralsPanel/IntegralPanel.d.ts +0 -1
  93. package/lib/component/panels/IntegralsPanel/IntegralPanel.js +2 -5
  94. package/lib/component/panels/IntegralsPanel/IntegralTable.d.ts +2 -2
  95. package/lib/component/panels/IntegralsPanel/IntegralTable.js +10 -11
  96. package/lib/component/panels/IntegralsPanel/IntegralsPreferences.d.ts +1 -1
  97. package/lib/component/panels/IntegralsPanel/IntegralsPreferences.js +26 -74
  98. package/lib/component/panels/MoleculesPanel/MoleculeHeader.d.ts +8 -0
  99. package/lib/component/panels/MoleculesPanel/MoleculeHeader.js +38 -0
  100. package/lib/component/panels/MoleculesPanel/MoleculePanel.js +12 -23
  101. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +10 -2
  102. package/lib/component/panels/MoleculesPanel/Utilities.d.ts +12 -1
  103. package/lib/component/panels/MoleculesPanel/Utilities.js +11 -0
  104. package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +1 -1
  105. package/lib/component/panels/Panels.js +2 -3
  106. package/lib/component/panels/PeaksPanel/PeaksPanel.js +3 -3
  107. package/lib/component/panels/PeaksPanel/PeaksPreferences.d.ts +1 -1
  108. package/lib/component/panels/PeaksPanel/PeaksPreferences.js +29 -82
  109. package/lib/component/panels/PeaksPanel/PeaksTable.d.ts +1 -5
  110. package/lib/component/panels/PeaksPanel/PeaksTable.js +18 -25
  111. package/lib/component/panels/RangesPanel/RangesHeader.d.ts +2 -1
  112. package/lib/component/panels/RangesPanel/RangesHeader.js +15 -9
  113. package/lib/component/panels/RangesPanel/RangesPanel.js +4 -10
  114. package/lib/component/panels/RangesPanel/RangesPreferences.d.ts +1 -1
  115. package/lib/component/panels/RangesPanel/RangesPreferences.js +55 -66
  116. package/lib/component/panels/RangesPanel/RangesTable.d.ts +11 -6
  117. package/lib/component/panels/RangesPanel/RangesTable.js +3 -7
  118. package/lib/component/panels/RangesPanel/RangesTableRow.d.ts +5 -2
  119. package/lib/component/panels/RangesPanel/RangesTableRow.js +3 -3
  120. package/lib/component/panels/RangesPanel/TableColumns/AbsoluteColumn.js +2 -2
  121. package/lib/component/panels/RangesPanel/TableColumns/ActionsColumn.d.ts +2 -1
  122. package/lib/component/panels/RangesPanel/TableColumns/ActionsColumn.js +2 -2
  123. package/lib/component/panels/RangesPanel/TableColumns/CouplingColumn.d.ts +2 -1
  124. package/lib/component/panels/RangesPanel/TableColumns/CouplingColumn.js +5 -2
  125. package/lib/component/panels/RangesPanel/TableColumns/RangeColumn.js +2 -2
  126. package/lib/component/panels/RangesPanel/TableColumns/RelativeColumn.js +2 -2
  127. package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.d.ts +2 -2
  128. package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.js +3 -4
  129. package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaHzColumn.d.ts +13 -0
  130. package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaHzColumn.js +14 -0
  131. package/lib/component/panels/RangesPanel/TableColumns/format.js +2 -2
  132. package/lib/component/panels/SpectrumsPanel/base/setting/PlotChart.d.ts +18 -0
  133. package/lib/component/panels/SpectrumsPanel/base/setting/PlotChart.js +18 -0
  134. package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum1DHistogram.d.ts +1 -2
  135. package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum1DHistogram.js +7 -68
  136. package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum1DSetting.js +1 -8
  137. package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum2DHistogram.d.ts +1 -2
  138. package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum2DHistogram.js +7 -68
  139. package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum2DSetting.js +8 -21
  140. package/lib/component/panels/SpectrumsPanel/base/setting/SpectrumSetting.js +2 -2
  141. package/lib/component/panels/SpectrumsPanel/base/setting/processSnapPlot.d.ts +6 -0
  142. package/lib/component/panels/SpectrumsPanel/base/setting/processSnapPlot.js +51 -0
  143. package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +1 -1
  144. package/lib/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.d.ts +5 -1
  145. package/lib/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.js +3 -2
  146. package/lib/component/panels/ZonesPanel/ZonesPreferences.d.ts +1 -1
  147. package/lib/component/panels/ZonesPanel/ZonesPreferences.js +20 -84
  148. package/lib/component/panels/ZonesPanel/ZonesTable.js +4 -1
  149. package/lib/component/panels/ZonesPanel/ZonesTableRow.d.ts +5 -1
  150. package/lib/component/panels/ZonesPanel/ZonesTableRow.js +2 -2
  151. package/lib/component/panels/databasePanel/DatabasePanel.js +73 -40
  152. package/lib/component/panels/databasePanel/DatabasePreferences.js +10 -42
  153. package/lib/component/panels/databasePanel/DatabaseTable.js +23 -11
  154. package/lib/component/panels/databasePanel/useDatabases.d.ts +5 -0
  155. package/lib/component/panels/databasePanel/useDatabases.js +10 -0
  156. package/lib/component/panels/extra/placeholder/NoTableData.d.ts +3 -1
  157. package/lib/component/panels/extra/placeholder/NoTableData.js +2 -2
  158. package/lib/component/panels/extra/preferences/ColumnsHelper.js +3 -3
  159. package/lib/component/panels/extra/preferences/NucleusPreferences.d.ts +13 -0
  160. package/lib/component/panels/extra/preferences/NucleusPreferences.js +22 -0
  161. package/lib/component/panels/extra/preferences/PreferencesContainer.d.ts +6 -0
  162. package/lib/component/panels/extra/preferences/PreferencesContainer.js +10 -0
  163. package/lib/component/panels/extra/preferences/PreferencesGroup.d.ts +7 -0
  164. package/lib/component/panels/extra/preferences/PreferencesGroup.js +21 -0
  165. package/lib/component/reducer/Reducer.d.ts +358 -45
  166. package/lib/component/reducer/Reducer.js +5 -1
  167. package/lib/component/reducer/actions/LoadActions.js +2 -2
  168. package/lib/component/reducer/actions/MoleculeActions.d.ts +4 -2
  169. package/lib/component/reducer/actions/MoleculeActions.js +15 -3
  170. package/lib/component/reducer/actions/PreferencesActions.js +1 -1
  171. package/lib/component/reducer/actions/ToolsActions.js +1 -1
  172. package/lib/component/reducer/preferences/actions/addWorkspace.d.ts +3 -0
  173. package/lib/component/reducer/preferences/actions/addWorkspace.js +19 -0
  174. package/lib/component/reducer/preferences/actions/initPreferences.d.ts +3 -0
  175. package/lib/component/reducer/preferences/actions/initPreferences.js +60 -0
  176. package/lib/component/reducer/preferences/actions/removeWorkspace.d.ts +3 -0
  177. package/lib/component/reducer/preferences/actions/removeWorkspace.js +20 -0
  178. package/lib/component/reducer/preferences/actions/resetPreferences.d.ts +3 -0
  179. package/lib/component/reducer/preferences/actions/resetPreferences.js +14 -0
  180. package/lib/component/reducer/preferences/actions/setPanelsPreferences.d.ts +3 -0
  181. package/lib/component/reducer/preferences/actions/setPanelsPreferences.js +13 -0
  182. package/lib/component/reducer/preferences/actions/setPreferences.d.ts +3 -0
  183. package/lib/component/reducer/preferences/actions/setPreferences.js +34 -0
  184. package/lib/component/reducer/preferences/actions/setWorkspace.d.ts +3 -0
  185. package/lib/component/reducer/preferences/actions/setWorkspace.js +8 -0
  186. package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.d.ts +7 -0
  187. package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js +55 -0
  188. package/lib/component/reducer/{preferencesReducer.d.ts → preferences/preferencesReducer.d.ts} +131 -7
  189. package/lib/component/reducer/preferences/preferencesReducer.js +80 -0
  190. package/lib/component/reducer/preferences/utilites/checkKeysExists.d.ts +1 -0
  191. package/lib/component/reducer/preferences/utilites/checkKeysExists.js +14 -0
  192. package/lib/component/reducer/preferences/utilites/filterObject.d.ts +1 -0
  193. package/lib/component/reducer/preferences/utilites/filterObject.js +7 -0
  194. package/lib/component/reducer/preferences/utilites/flatObject.d.ts +1 -0
  195. package/lib/component/reducer/preferences/utilites/flatObject.js +9 -0
  196. package/lib/component/reducer/preferences/utilites/getActiveWorkspace.d.ts +3 -0
  197. package/lib/component/reducer/preferences/utilites/getActiveWorkspace.js +3 -0
  198. package/lib/component/reducer/preferences/utilites/getPreferencesByWorkspace.d.ts +2 -0
  199. package/lib/component/reducer/preferences/utilites/getPreferencesByWorkspace.js +4 -0
  200. package/lib/component/reducer/preferences/utilites/mapNucleiFormatting.d.ts +5 -0
  201. package/lib/component/reducer/preferences/utilites/mapNucleiFormatting.js +8 -0
  202. package/lib/component/reducer/types/Types.d.ts +2 -0
  203. package/lib/component/reducer/types/Types.js +2 -0
  204. package/lib/component/tool/FloatMoleculeStructures/ActionsButton.d.ts +4 -0
  205. package/lib/component/tool/FloatMoleculeStructures/ActionsButton.js +7 -0
  206. package/lib/component/tool/FloatMoleculeStructures/DraggableStructure.d.ts +14 -0
  207. package/lib/component/tool/FloatMoleculeStructures/DraggableStructure.js +43 -0
  208. package/lib/component/tool/FloatMoleculeStructures/index.d.ts +15 -0
  209. package/lib/component/tool/FloatMoleculeStructures/index.js +28 -0
  210. package/lib/component/utility/Export.js +6 -0
  211. package/lib/component/utility/PathBuilder.js +2 -1
  212. package/lib/component/utility/formatNumber.d.ts +3 -0
  213. package/lib/component/utility/formatNumber.js +10 -0
  214. package/lib/component/utility/getUniqueNuclei.d.ts +1 -0
  215. package/lib/component/utility/getUniqueNuclei.js +10 -0
  216. package/lib/component/workspaces/Workspace.d.ts +72 -1
  217. package/lib/component/workspaces/basic.js +9 -1
  218. package/lib/component/workspaces/embedded.d.ts +2 -0
  219. package/lib/component/workspaces/embedded.js +32 -0
  220. package/lib/component/workspaces/exercise.js +2 -0
  221. package/lib/component/workspaces/index.d.ts +1 -0
  222. package/lib/component/workspaces/index.js +2 -1
  223. package/lib/component/workspaces/prediction.js +2 -0
  224. package/lib/component/workspaces/process1D.js +2 -0
  225. package/lib/data/data1d/Data1DManager.js +4 -0
  226. package/lib/data/data1d/Spectrum1D/convertDataToFloat64Array.d.ts +2 -0
  227. package/lib/data/data1d/Spectrum1D/convertDataToFloat64Array.js +10 -0
  228. package/lib/data/data1d/Spectrum1D/get1DDataXY.d.ts +2 -2
  229. package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +2 -1
  230. package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.js +1 -1
  231. package/lib/data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges.js +2 -1
  232. package/lib/data/data1d/database.d.ts +8 -13
  233. package/lib/data/data1d/database.js +14 -19
  234. package/lib/data/data1d/filter1d/absolute.d.ts +3 -2
  235. package/lib/data/data1d/filter1d/autoPhaseCorrection.d.ts +3 -2
  236. package/lib/data/data1d/filter1d/baselineCorrection.d.ts +3 -2
  237. package/lib/data/data1d/filter1d/centerMean.d.ts +3 -2
  238. package/lib/data/data1d/filter1d/digitalFilter.d.ts +3 -2
  239. package/lib/data/data1d/filter1d/equallySpaced.d.ts +3 -2
  240. package/lib/data/data1d/filter1d/exclusionZones.js +4 -4
  241. package/lib/data/data1d/filter1d/fft.d.ts +3 -2
  242. package/lib/data/data1d/filter1d/fft.js +2 -2
  243. package/lib/data/data1d/filter1d/fromTo.d.ts +3 -2
  244. package/lib/data/data1d/filter1d/lineBroadening.d.ts +3 -2
  245. package/lib/data/data1d/filter1d/lineBroadening.js +1 -1
  246. package/lib/data/data1d/filter1d/pareto.d.ts +3 -2
  247. package/lib/data/data1d/filter1d/pareto.js +2 -2
  248. package/lib/data/data1d/filter1d/phaseCorrection.d.ts +3 -2
  249. package/lib/data/data1d/filter1d/shiftX.d.ts +2 -1
  250. package/lib/data/data1d/filter1d/standardDeviation.d.ts +3 -2
  251. package/lib/data/data1d/filter1d/zeroFilling.d.ts +3 -2
  252. package/lib/data/data1d/filter1d/zeroFilling.js +1 -1
  253. package/lib/data/data2d/Data2DManager.js +4 -0
  254. package/lib/data/data2d/filter2d/shiftX.d.ts +4 -3
  255. package/lib/data/data2d/filter2d/shiftX.js +2 -2
  256. package/lib/data/data2d/filter2d/shiftY.d.ts +4 -3
  257. package/lib/data/data2d/filter2d/shiftY.js +2 -2
  258. package/lib/data/molecules/Molecule.d.ts +3 -3
  259. package/lib/data/molecules/Molecule.js +7 -1
  260. package/lib/data/molecules/MoleculeManager.d.ts +4 -1
  261. package/lib/data/molecules/MoleculeManager.js +33 -2
  262. package/lib/data/types/data1d/Data1D.d.ts +3 -3
  263. package/lib/data/types/data1d/Info1D.d.ts +1 -0
  264. package/lib/data/types/data2d/Signal2DAxisData.d.ts +1 -1
  265. package/lib/versionInfo.js +1 -1
  266. package/lib-cjs/component/1d/Chart1D.js +3 -2
  267. package/lib-cjs/component/1d/FooterBanner.js +2 -2
  268. package/lib-cjs/component/1d/Integral.js +5 -12
  269. package/lib-cjs/component/1d/IntegralResizable.js +10 -5
  270. package/lib-cjs/component/1d/IntegralsSeries.js +3 -3
  271. package/lib-cjs/component/1d/PeakAnnotation.js +5 -4
  272. package/lib-cjs/component/1d/database/DatabaseElements.js +23 -0
  273. package/lib-cjs/component/1d/database/DatabaseSpectrum.js +60 -0
  274. package/lib-cjs/component/1d/{ResurrectedDatabaseRanges.js → database/ResurrectedDatabaseRanges.js} +9 -6
  275. package/lib-cjs/component/1d/jCouplingGraph/JGraph.js +4 -10
  276. package/lib-cjs/component/1d/multiAnalysis/AnalysisRange.js +10 -5
  277. package/lib-cjs/component/1d/ranges/Range.js +17 -9
  278. package/lib-cjs/component/1d/ranges/Ranges.js +6 -3
  279. package/lib-cjs/component/1d/tool/XLabelPointer.js +2 -2
  280. package/lib-cjs/component/2d/Chart2D.js +2 -1
  281. package/lib-cjs/component/2d/Contours.js +4 -1
  282. package/lib-cjs/component/2d/FooterBanner.js +2 -2
  283. package/lib-cjs/component/2d/tools/XYLabelPointer.js +2 -2
  284. package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +10 -4
  285. package/lib-cjs/component/NMRium.js +5 -2
  286. package/lib-cjs/component/SplitPaneWrapper.js +12 -0
  287. package/lib-cjs/component/context/GlobalContext.js +1 -1
  288. package/lib-cjs/component/context/PreferencesContext.js +1 -1
  289. package/lib-cjs/component/elements/Button.js +1 -1
  290. package/lib-cjs/component/elements/ColorInput.js +2 -2
  291. package/lib-cjs/component/elements/EditableColumn.js +27 -20
  292. package/lib-cjs/component/elements/Input.js +18 -5
  293. package/lib-cjs/component/elements/Select.js +20 -14
  294. package/lib-cjs/component/elements/ToggleButton.js +2 -2
  295. package/lib-cjs/component/elements/draggble/SVGDraggable.js +39 -0
  296. package/lib-cjs/component/elements/draggble/useDraggable.js +73 -0
  297. package/lib-cjs/component/elements/formik/FormikColorPicker.js +10 -7
  298. package/lib-cjs/component/elements/formik/FormikColumnFormatField.js +2 -2
  299. package/lib-cjs/component/elements/formik/FormikInput.js +6 -3
  300. package/lib-cjs/component/elements/formik/FormikSlider.js +6 -3
  301. package/lib-cjs/component/elements/popup/Alert/Provider.js +1 -1
  302. package/lib-cjs/component/elements/resizer/DivResizer.js +17 -62
  303. package/lib-cjs/component/elements/resizer/SVGResizer.js +24 -53
  304. package/lib-cjs/component/elements/resizer/useResizer.js +71 -0
  305. package/lib-cjs/component/{utility/FormatNumber.js → hooks/useFormatNumberByNucleus.js} +1 -11
  306. package/lib-cjs/component/hooks/usePanelPreferences.js +62 -0
  307. package/lib-cjs/component/loader/DefaultSpinnerComponent.js +2 -2
  308. package/lib-cjs/component/loader/SpinnerContext.js +2 -2
  309. package/lib-cjs/component/modal/MoleculeStructureEditorModal.js +24 -1
  310. package/lib-cjs/component/modal/editRange/EditRangeModal.js +6 -5
  311. package/lib-cjs/component/modal/editRange/forms/components/AddSignalFormTab.js +3 -6
  312. package/lib-cjs/component/modal/editRange/forms/components/SignalsForm.js +12 -9
  313. package/lib-cjs/component/modal/setting/DatabasesTabContent.js +80 -0
  314. package/lib-cjs/component/modal/setting/DisplayTabContent.js +11 -7
  315. package/lib-cjs/component/modal/setting/FormattingTabContent.js +4 -4
  316. package/lib-cjs/component/modal/setting/GeneralSettings.js +2 -1
  317. package/lib-cjs/component/modal/setting/settingsValidation.js +33 -27
  318. package/lib-cjs/component/panels/AutomaticAssignment/useAutoAssignments.js +10 -5
  319. package/lib-cjs/component/panels/IntegralsPanel/IntegralPanel.js +2 -5
  320. package/lib-cjs/component/panels/IntegralsPanel/IntegralTable.js +10 -11
  321. package/lib-cjs/component/panels/IntegralsPanel/IntegralsPreferences.js +24 -72
  322. package/lib-cjs/component/panels/MoleculesPanel/MoleculeHeader.js +44 -0
  323. package/lib-cjs/component/panels/MoleculesPanel/MoleculePanel.js +12 -23
  324. package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +9 -1
  325. package/lib-cjs/component/panels/MoleculesPanel/Utilities.js +11 -0
  326. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +2 -2
  327. package/lib-cjs/component/panels/Panels.js +2 -3
  328. package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +4 -4
  329. package/lib-cjs/component/panels/PeaksPanel/PeaksPreferences.js +27 -80
  330. package/lib-cjs/component/panels/PeaksPanel/PeaksTable.js +18 -48
  331. package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +15 -9
  332. package/lib-cjs/component/panels/RangesPanel/RangesPanel.js +4 -10
  333. package/lib-cjs/component/panels/RangesPanel/RangesPreferences.js +53 -64
  334. package/lib-cjs/component/panels/RangesPanel/RangesTable.js +3 -7
  335. package/lib-cjs/component/panels/RangesPanel/RangesTableRow.js +3 -3
  336. package/lib-cjs/component/panels/RangesPanel/TableColumns/AbsoluteColumn.js +2 -5
  337. package/lib-cjs/component/panels/RangesPanel/TableColumns/ActionsColumn.js +2 -2
  338. package/lib-cjs/component/panels/RangesPanel/TableColumns/CouplingColumn.js +5 -2
  339. package/lib-cjs/component/panels/RangesPanel/TableColumns/RangeColumn.js +2 -5
  340. package/lib-cjs/component/panels/RangesPanel/TableColumns/RelativeColumn.js +2 -2
  341. package/lib-cjs/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.js +3 -4
  342. package/lib-cjs/component/panels/RangesPanel/TableColumns/SignalDeltaHzColumn.js +16 -0
  343. package/lib-cjs/component/panels/RangesPanel/TableColumns/format.js +2 -2
  344. package/lib-cjs/component/panels/SpectrumsPanel/base/setting/PlotChart.js +21 -0
  345. package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum1DHistogram.js +10 -68
  346. package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum1DSetting.js +1 -8
  347. package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum2DHistogram.js +10 -68
  348. package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum2DSetting.js +8 -21
  349. package/lib-cjs/component/panels/SpectrumsPanel/base/setting/SpectrumSetting.js +2 -2
  350. package/lib-cjs/component/panels/SpectrumsPanel/base/setting/processSnapPlot.js +55 -0
  351. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +1 -1
  352. package/lib-cjs/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.js +3 -2
  353. package/lib-cjs/component/panels/ZonesPanel/ZonesPreferences.js +18 -82
  354. package/lib-cjs/component/panels/ZonesPanel/ZonesTable.js +4 -1
  355. package/lib-cjs/component/panels/ZonesPanel/ZonesTableRow.js +2 -2
  356. package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +72 -39
  357. package/lib-cjs/component/panels/databasePanel/DatabasePreferences.js +10 -42
  358. package/lib-cjs/component/panels/databasePanel/DatabaseTable.js +22 -10
  359. package/lib-cjs/component/panels/databasePanel/useDatabases.js +14 -0
  360. package/lib-cjs/component/panels/extra/placeholder/NoTableData.js +2 -2
  361. package/lib-cjs/component/panels/extra/preferences/ColumnsHelper.js +3 -3
  362. package/lib-cjs/component/panels/extra/preferences/NucleusPreferences.js +29 -0
  363. package/lib-cjs/component/panels/extra/preferences/PreferencesContainer.js +14 -0
  364. package/lib-cjs/component/panels/extra/preferences/PreferencesGroup.js +25 -0
  365. package/lib-cjs/component/reducer/Reducer.js +5 -1
  366. package/lib-cjs/component/reducer/actions/LoadActions.js +2 -2
  367. package/lib-cjs/component/reducer/actions/MoleculeActions.js +17 -3
  368. package/lib-cjs/component/reducer/actions/PreferencesActions.js +1 -1
  369. package/lib-cjs/component/reducer/actions/ToolsActions.js +1 -1
  370. package/lib-cjs/component/reducer/preferences/actions/addWorkspace.js +26 -0
  371. package/lib-cjs/component/reducer/preferences/actions/initPreferences.js +67 -0
  372. package/lib-cjs/component/reducer/preferences/actions/removeWorkspace.js +24 -0
  373. package/lib-cjs/component/reducer/preferences/actions/resetPreferences.js +18 -0
  374. package/lib-cjs/component/reducer/preferences/actions/setPanelsPreferences.js +17 -0
  375. package/lib-cjs/component/reducer/preferences/actions/setPreferences.js +38 -0
  376. package/lib-cjs/component/reducer/preferences/actions/setWorkspace.js +12 -0
  377. package/lib-cjs/component/reducer/preferences/panelsPreferencesDefaultValues.js +62 -0
  378. package/lib-cjs/component/reducer/preferences/preferencesReducer.js +87 -0
  379. package/lib-cjs/component/reducer/preferences/utilites/checkKeysExists.js +18 -0
  380. package/lib-cjs/component/reducer/preferences/utilites/filterObject.js +11 -0
  381. package/lib-cjs/component/reducer/preferences/utilites/flatObject.js +13 -0
  382. package/lib-cjs/component/reducer/preferences/utilites/getActiveWorkspace.js +7 -0
  383. package/lib-cjs/component/reducer/preferences/utilites/getPreferencesByWorkspace.js +11 -0
  384. package/lib-cjs/component/reducer/preferences/utilites/mapNucleiFormatting.js +12 -0
  385. package/lib-cjs/component/reducer/types/Types.js +5 -3
  386. package/lib-cjs/component/tool/FloatMoleculeStructures/ActionsButton.js +13 -0
  387. package/lib-cjs/component/tool/FloatMoleculeStructures/DraggableStructure.js +50 -0
  388. package/lib-cjs/component/tool/FloatMoleculeStructures/index.js +36 -0
  389. package/lib-cjs/component/utility/Export.js +6 -0
  390. package/lib-cjs/component/utility/PathBuilder.js +2 -1
  391. package/lib-cjs/component/utility/formatNumber.js +17 -0
  392. package/lib-cjs/component/utility/getUniqueNuclei.js +14 -0
  393. package/lib-cjs/component/workspaces/basic.js +9 -1
  394. package/lib-cjs/component/workspaces/embedded.js +35 -0
  395. package/lib-cjs/component/workspaces/exercise.js +2 -0
  396. package/lib-cjs/component/workspaces/index.js +2 -1
  397. package/lib-cjs/component/workspaces/prediction.js +2 -0
  398. package/lib-cjs/component/workspaces/process1D.js +2 -0
  399. package/lib-cjs/data/data1d/Data1DManager.js +4 -0
  400. package/lib-cjs/data/data1d/Spectrum1D/convertDataToFloat64Array.js +14 -0
  401. package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +2 -1
  402. package/lib-cjs/data/data1d/Spectrum1D/peaks/mapPeaks.js +1 -1
  403. package/lib-cjs/data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges.js +2 -1
  404. package/lib-cjs/data/data1d/database.js +15 -21
  405. package/lib-cjs/data/data1d/filter1d/exclusionZones.js +4 -4
  406. package/lib-cjs/data/data1d/filter1d/fft.js +2 -2
  407. package/lib-cjs/data/data1d/filter1d/lineBroadening.js +1 -1
  408. package/lib-cjs/data/data1d/filter1d/pareto.js +2 -2
  409. package/lib-cjs/data/data1d/filter1d/shiftX.js +2 -2
  410. package/lib-cjs/data/data1d/filter1d/zeroFilling.js +1 -1
  411. package/lib-cjs/data/data2d/Data2DManager.js +4 -0
  412. package/lib-cjs/data/data2d/filter2d/shiftX.js +4 -4
  413. package/lib-cjs/data/data2d/filter2d/shiftY.js +4 -4
  414. package/lib-cjs/data/molecules/Molecule.js +7 -1
  415. package/lib-cjs/data/molecules/MoleculeManager.js +37 -3
  416. package/lib-cjs/versionInfo.js +1 -1
  417. package/package.json +42 -40
  418. package/lib/component/elements/resizer/useDraggable.js +0 -52
  419. package/lib/component/panels/extra/preferences/defaultValues.d.ts +0 -54
  420. package/lib/component/panels/extra/preferences/defaultValues.js +0 -54
  421. package/lib/component/reducer/preferencesReducer.js +0 -269
  422. package/lib/component/utility/FormatNumber.d.ts +0 -6
  423. package/lib-cjs/component/elements/resizer/useDraggable.js +0 -55
  424. package/lib-cjs/component/panels/extra/preferences/defaultValues.js +0 -61
  425. package/lib-cjs/component/reducer/preferencesReducer.js +0 -276
@@ -9,7 +9,7 @@ const Spectrum1D_1 = require("../../data/data1d/Spectrum1D");
9
9
  const ChartContext_1 = require("../context/ChartContext");
10
10
  const Integral_1 = __importDefault(require("./Integral"));
11
11
  function IntegralsSeries() {
12
- const { xDomains, activeSpectrum, data, displayerKey } = (0, ChartContext_1.useChartData)();
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
15
  return activeSpectrum === null
@@ -22,8 +22,8 @@ function IntegralsSeries() {
22
22
  data
23
23
  .filter((d) => d.display.isVisible === true && xDomains[d.id])
24
24
  .filter(Spectrum1D_1.isSpectrum1D)
25
- .map((spectrum) => spectrum.integrals.values.map((integral) => ((0, jsx_runtime_1.jsx)(Integral_1.default, { integral: integral, isActive: isActive(spectrum.id) }, integral.id)))) }));
26
- }, [activeSpectrum, data, xDomains]);
25
+ .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
+ }, [activeSpectrum, data, nucleus, xDomains]);
27
27
  return (0, jsx_runtime_1.jsx)("g", { clipPath: `url(#${displayerKey}clip-chart-1d)`, children: Integrals });
28
28
  }
29
29
  exports.default = IntegralsSeries;
@@ -6,8 +6,9 @@ const react_1 = require("@emotion/react");
6
6
  const react_2 = require("react");
7
7
  const DispatchContext_1 = require("../context/DispatchContext");
8
8
  const highlight_1 = require("../highlight");
9
+ const usePanelPreferences_1 = require("../hooks/usePanelPreferences");
9
10
  const Types_1 = require("../reducer/types/Types");
10
- const FormatNumber_1 = require("../utility/FormatNumber");
11
+ const formatNumber_1 = require("../utility/formatNumber");
11
12
  const styles = (0, react_1.css) `
12
13
  input {
13
14
  -webkit-user-select: text; /* Safari 3.1+ */
@@ -51,7 +52,7 @@ value, color, isActive, nucleus, }) {
51
52
  const [isSelected, setIsSelected] = (0, react_2.useState)(false);
52
53
  const [_value, setValue] = (0, react_2.useState)(value);
53
54
  const [containerSize, setContainerSize] = (0, react_2.useState)({ width: 0, height: 0 });
54
- const format = (0, FormatNumber_1.useFormatNumberByNucleus)(nucleus);
55
+ const { deltaPPM } = (0, usePanelPreferences_1.usePanelPreferences)('peaks', nucleus);
55
56
  const highlight = (0, highlight_1.useHighlight)([id], {
56
57
  type: highlight_1.HighlightedSource.PEAK,
57
58
  extra: { id },
@@ -103,8 +104,8 @@ value, color, isActive, nucleus, }) {
103
104
  const handleOnMouseLeaveNotation = (0, react_2.useCallback)(() => {
104
105
  highlight.hide();
105
106
  }, [highlight]);
106
- const newValue = (0, react_2.useMemo)(() => (isSelected ? value : format(value)), [format, isSelected, value]);
107
- const oldValue = (0, react_2.useMemo)(() => (isSelected ? _value : format(_value)), [_value, format, isSelected]);
107
+ const newValue = (0, react_2.useMemo)(() => (isSelected ? value : (0, formatNumber_1.formatNumber)(value, deltaPPM.format)), [deltaPPM.format, isSelected, value]);
108
+ const oldValue = (0, react_2.useMemo)(() => (isSelected ? _value : (0, formatNumber_1.formatNumber)(_value, deltaPPM.format)), [_value, deltaPPM.format, isSelected]);
108
109
  return ((0, jsx_runtime_1.jsxs)("g", { css: styles, id: id, style: { outline: 'none' }, transform: `translate(${x}, ${y})`, onMouseEnter: handleOnEnterNotation, onMouseLeave: handleOnMouseLeaveNotation, children: [(0, jsx_runtime_1.jsx)("line", { x1: "0", x2: "0", y1: sign === -1 ? 10 : 0, y2: sign === -1 ? 28 : -18, stroke: color, strokeWidth: highlight.isActive ? '7px' : '1px' }), (0, jsx_runtime_1.jsx)("text", { ref: refText, className: "peaks-text", x: "0", y: sign === -1 ? 28 : -12, dy: "0", dx: "0.35em", fill: "transparent", fontSize: "10px", fontWeight: "100", style: {
109
110
  position: 'absolute',
110
111
  }, children: newValue }), (0, jsx_runtime_1.jsx)("foreignObject", { x: "0", y: sign === -1 ? 16 : -22, dy: "0.1em", dx: "0.35em", width: containerSize.width + 20, height: "40px", "data-no-export": "true", children: (0, jsx_runtime_1.jsx)("div", { style: {
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const jsx_runtime_1 = require("react/jsx-runtime");
7
+ const highlight_1 = require("../../highlight");
8
+ const usePanelPreferences_1 = require("../../hooks/usePanelPreferences");
9
+ const DatabaseSpectrum_1 = __importDefault(require("./DatabaseSpectrum"));
10
+ const ResurrectedDatabaseRanges_1 = __importDefault(require("./ResurrectedDatabaseRanges"));
11
+ function DatabaseElements() {
12
+ const { highlight } = (0, highlight_1.useHighlightData)();
13
+ const { previewJcamp } = (0, usePanelPreferences_1.usePanelPreferences)('database');
14
+ const { jcampURL } = highlight?.sourceData?.extra || {};
15
+ if (highlight.sourceData?.type !== highlight_1.HighlightedSource.DATABASE) {
16
+ return null;
17
+ }
18
+ if (previewJcamp && jcampURL) {
19
+ return (0, jsx_runtime_1.jsx)(DatabaseSpectrum_1.default, {});
20
+ }
21
+ return (0, jsx_runtime_1.jsx)(ResurrectedDatabaseRanges_1.default, {});
22
+ }
23
+ exports.default = DatabaseElements;
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const jsx_runtime_1 = require("react/jsx-runtime");
4
+ const react_1 = require("react");
5
+ const SpectraManager_1 = require("../../../data/SpectraManager");
6
+ const ChartContext_1 = require("../../context/ChartContext");
7
+ const ScaleContext_1 = require("../../context/ScaleContext");
8
+ const Alert_1 = require("../../elements/popup/Alert");
9
+ const highlight_1 = require("../../highlight");
10
+ const usePanelPreferences_1 = require("../../hooks/usePanelPreferences");
11
+ const SpinnerContext_1 = require("../../loader/SpinnerContext");
12
+ const FileUtility_1 = require("../../utility/FileUtility");
13
+ const scale_1 = require("../utilities/scale");
14
+ function DatabaseSpectrum() {
15
+ const { displayerKey, height, verticalAlign, yDomain, margin } = (0, ChartContext_1.useChartData)();
16
+ const [path, setPath] = (0, react_1.useState)();
17
+ const [isLoading, setLoading] = (0, react_1.useState)(false);
18
+ const { highlight } = (0, highlight_1.useHighlightData)();
19
+ const { scaleX } = (0, ScaleContext_1.useScaleChecked)();
20
+ const alert = (0, Alert_1.useAlert)();
21
+ const { color, marginBottom } = (0, usePanelPreferences_1.usePanelPreferences)('database');
22
+ const { jcampURL: jcampRelativeURL, baseURL } = highlight?.sourceData?.extra || [];
23
+ const getSpinner = (0, react_1.useContext)(SpinnerContext_1.spinnerContext);
24
+ const scaleY = (0, react_1.useCallback)(() => (0, scale_1.getYScale)({
25
+ height: height,
26
+ margin: { top: margin.top, bottom: margin.bottom + marginBottom },
27
+ verticalAlign,
28
+ yDomain,
29
+ }), [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');
52
+ }
53
+ })();
54
+ }, [alert, baseURL, jcampRelativeURL, scaleX, scaleY]);
55
+ if (highlight.sourceData?.type !== highlight_1.HighlightedSource.DATABASE) {
56
+ return null;
57
+ }
58
+ return isLoading ? ((0, jsx_runtime_1.jsx)("foreignObject", { width: "100%", height: "100%", children: getSpinner('Load Jcamp ....') })) : ((0, jsx_runtime_1.jsx)("g", { clipPath: `url(#${displayerKey}clip-chart-1d)`, className: "database-spectrum", children: (0, jsx_runtime_1.jsx)("path", { stroke: color, fill: "none", d: path }) }));
59
+ }
60
+ exports.default = DatabaseSpectrum;
@@ -6,22 +6,25 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const jsx_runtime_1 = require("react/jsx-runtime");
7
7
  const d3_1 = require("d3");
8
8
  const nmr_processing_1 = require("nmr-processing");
9
- const ChartContext_1 = require("../context/ChartContext");
10
- const ScaleContext_1 = require("../context/ScaleContext");
11
- const highlight_1 = require("../highlight");
12
- const useSpectrum_1 = __importDefault(require("../hooks/useSpectrum"));
13
- const scale_1 = require("./utilities/scale");
9
+ const ChartContext_1 = require("../../context/ChartContext");
10
+ const ScaleContext_1 = require("../../context/ScaleContext");
11
+ const highlight_1 = require("../../highlight");
12
+ const usePanelPreferences_1 = require("../../hooks/usePanelPreferences");
13
+ const useSpectrum_1 = __importDefault(require("../../hooks/useSpectrum"));
14
+ const scale_1 = require("../utilities/scale");
14
15
  const emptyData = { info: { originFrequency: 400 } };
15
16
  function ResurrectedDatabaseRanges() {
16
17
  const { displayerKey, verticalAlign, height, margin } = (0, ChartContext_1.useChartData)();
17
18
  const { info } = (0, useSpectrum_1.default)(emptyData);
18
19
  const { highlight } = (0, highlight_1.useHighlightData)();
19
20
  const { scaleX } = (0, ScaleContext_1.useScaleChecked)();
21
+ const { color, marginBottom } = (0, usePanelPreferences_1.usePanelPreferences)('database');
20
22
  if (highlight.sourceData?.type !== highlight_1.HighlightedSource.DATABASE) {
21
23
  return null;
22
24
  }
23
25
  const fullHeight = height - margin.bottom;
24
26
  const blockHight = fullHeight / 4;
27
+ const translateY = fullHeight - blockHight - marginBottom;
25
28
  const { ranges } = highlight.sourceData.extra || [];
26
29
  let yDomain = [0, 0];
27
30
  const spectra = ranges.map((range) => {
@@ -57,6 +60,6 @@ function ResurrectedDatabaseRanges() {
57
60
  }, []);
58
61
  return ((0, jsx_runtime_1.jsx)("g", { clipPath: `url(#${displayerKey}clip-chart-1d)`, className: "resurrected-database-ranges", width: "100%", height: "100%", children: paths.map(({ path, from, to }, index) => (
59
62
  // eslint-disable-next-line react/no-array-index-key
60
- (0, jsx_runtime_1.jsxs)("g", { children: [(0, jsx_runtime_1.jsx)("g", { transform: `translate(${scaleX()(to)},0)`, children: (0, jsx_runtime_1.jsx)("rect", { x: "0", width: Math.abs(scaleX()(to) - scaleX()(from)), height: "100%", fill: "#ff6f0057" }) }), (0, jsx_runtime_1.jsx)("path", { transform: `translate(0,${fullHeight - blockHight * 2})`, stroke: "black", fill: "none", d: path })] }, `${index}`))) }));
63
+ (0, jsx_runtime_1.jsxs)("g", { children: [(0, jsx_runtime_1.jsx)("g", { transform: `translate(${scaleX()(to)},0)`, children: (0, jsx_runtime_1.jsx)("rect", { x: "0", width: Math.abs(scaleX()(to) - scaleX()(from)), height: "100%", fill: "#ff6f0057" }) }), (0, jsx_runtime_1.jsx)("path", { transform: `translate(0,${translateY})`, stroke: color, fill: "none", d: path })] }, `${index}`))) }));
61
64
  }
62
65
  exports.default = ResurrectedDatabaseRanges;
@@ -5,13 +5,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const jsx_runtime_1 = require("react/jsx-runtime");
7
7
  const d3_1 = require("d3");
8
- const get_1 = __importDefault(require("lodash/get"));
9
8
  const react_1 = require("react");
10
9
  const generateJGraphData_1 = __importDefault(require("../../../data/data1d/Spectrum1D/generateJGraphData"));
11
10
  const ChartContext_1 = require("../../context/ChartContext");
12
- const PreferencesContext_1 = require("../../context/PreferencesContext");
11
+ const usePanelPreferences_1 = require("../../hooks/usePanelPreferences");
13
12
  const useSpectrum_1 = __importDefault(require("../../hooks/useSpectrum"));
14
- const defaultValues_1 = require("../../panels/extra/preferences/defaultValues");
15
13
  const JGraphContext_1 = require("./JGraphContext");
16
14
  const JGraphVerticalAxis_1 = require("./JGraphVerticalAxis");
17
15
  const JsCouplingLinks_1 = __importDefault(require("./JsCouplingLinks"));
@@ -24,19 +22,15 @@ function InnerJGraph(props) {
24
22
  const emptyData = { ranges: {} };
25
23
  const MemoizedJGraph = (0, react_1.memo)(InnerJGraph);
26
24
  function JGraph() {
27
- const preferences = (0, PreferencesContext_1.usePreferences)();
28
25
  const { height, toolOptions: { data: { showJGraph }, }, activeTab, } = (0, ChartContext_1.useChartData)();
26
+ const rangesPreferences = (0, usePanelPreferences_1.usePanelPreferences)('ranges', activeTab);
29
27
  const graphHeight = height / 4;
30
28
  const { ranges } = (0, useSpectrum_1.default)(emptyData);
31
- const jGraphTolerance = (0, react_1.useMemo)(() => {
32
- const _preferences = (0, get_1.default)(preferences.current, `formatting.panels.ranges.[${activeTab}]`) || (0, defaultValues_1.getRangeDefaultValues)(activeTab);
33
- return _preferences.jGraphTolerance;
34
- }, [activeTab, preferences]);
35
- const { signals, jCouplingMax: maxValue, links, } = (0, react_1.useMemo)(() => (0, generateJGraphData_1.default)(ranges.values, jGraphTolerance) || {
29
+ const { signals, jCouplingMax: maxValue, links, } = (0, react_1.useMemo)(() => (0, generateJGraphData_1.default)(ranges.values, rangesPreferences.jGraphTolerance) || {
36
30
  signals: [],
37
31
  jCouplingMax: 0,
38
32
  links: [],
39
- }, [jGraphTolerance, ranges.values]);
33
+ }, [rangesPreferences.jGraphTolerance, ranges.values]);
40
34
  const scaleY = (0, react_1.useMemo)(() => {
41
35
  const maxRange = maxValue + maxValue * 0.1;
42
36
  return (0, d3_1.scaleLinear)().range([graphHeight, 0]).domain([0, maxRange]);
@@ -8,6 +8,7 @@ const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
8
8
  const react_1 = require("@emotion/react");
9
9
  const react_2 = require("react");
10
10
  const DispatchContext_1 = require("../../context/DispatchContext");
11
+ const GlobalContext_1 = require("../../context/GlobalContext");
11
12
  const ScaleContext_1 = require("../../context/ScaleContext");
12
13
  const DeleteButton_1 = __importDefault(require("../../elements/DeleteButton"));
13
14
  const Resizer_1 = __importDefault(require("../../elements/resizer/Resizer"));
@@ -38,10 +39,10 @@ const styles = {
38
39
  `,
39
40
  };
40
41
  function AnalysisRange({ rangeData, columnKey }) {
41
- const { from, to } = rangeData;
42
42
  const highlight = (0, highlight_1.useHighlight)([columnKey]);
43
43
  const { scaleX } = (0, ScaleContext_1.useScaleChecked)();
44
44
  const dispatch = (0, DispatchContext_1.useDispatch)();
45
+ const { viewerRef } = (0, GlobalContext_1.useGlobal)();
45
46
  const deleteHandler = (0, react_2.useCallback)(() => {
46
47
  dispatch({ type: Types_1.DELETE_ANALYZE_SPECTRA_RANGE, colKey: columnKey });
47
48
  }, [columnKey, dispatch]);
@@ -51,9 +52,13 @@ function AnalysisRange({ rangeData, columnKey }) {
51
52
  payload: { ...rangeData, ...resized, columnKey },
52
53
  });
53
54
  }, [columnKey, dispatch, rangeData]);
54
- return ((0, jsx_runtime_1.jsx)("g", { ...highlight.onHover, css: [
55
- styles.common,
56
- highlight.isActive ? styles.Highlighted : styles.hover,
57
- ], children: (0, jsx_runtime_1.jsx)(Resizer_1.default, { tag: "svg", onEnd: resizeEndHandler, initialPosition: { x2: scaleX()(from), x1: scaleX()(to) }, children: (x1, x2) => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("g", { transform: `translate(0,25)`, children: [(0, jsx_runtime_1.jsx)("rect", { x: "0", width: x2 - x1, height: "6", className: "range-area", fill: "green" }), (0, jsx_runtime_1.jsx)("text", { textAnchor: "middle", x: (x2 - x1) / 2, y: "-5", fontSize: "12", fill: "red", fontWeight: "bolder", fillOpacity: highlight.isActive ? 1 : 0.6, children: columnKey })] }), (0, jsx_runtime_1.jsx)(DeleteButton_1.default, { x: -20, y: 10, onDelete: deleteHandler })] })) }) }));
55
+ const from = scaleX()(rangeData.from);
56
+ const to = scaleX()(rangeData.to);
57
+ return ((0, jsx_runtime_1.jsx)("g", { ...highlight.onHover, children: (0, jsx_runtime_1.jsx)(Resizer_1.default, { tag: "svg", onEnd: resizeEndHandler, initialPosition: { x2: from, x1: to }, parentElement: viewerRef, children: ({ x1, x2 }, isActive) => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("g", { transform: `translate(0,25)`, css: [
58
+ styles.common,
59
+ highlight.isActive || isActive
60
+ ? styles.Highlighted
61
+ : styles.hover,
62
+ ], children: [(0, jsx_runtime_1.jsx)("rect", { x: "0", width: x2 - x1, height: "6", className: "range-area", fill: "green" }), (0, jsx_runtime_1.jsx)("text", { textAnchor: "middle", x: (x2 - x1) / 2, y: "-5", fontSize: "12", fill: "red", fontWeight: "bolder", fillOpacity: highlight.isActive ? 1 : 0.6, children: columnKey })] }), (0, jsx_runtime_1.jsx)(DeleteButton_1.default, { x: -20, y: 10, onDelete: deleteHandler })] })) }, `${columnKey}_${to}_${from}`) }));
58
63
  }
59
64
  exports.default = AnalysisRange;
@@ -11,11 +11,13 @@ const RangeUtilities_1 = require("../../../data/utilities/RangeUtilities");
11
11
  const AssignmentsContext_1 = require("../../assignment/AssignmentsContext");
12
12
  const filterForIDsWithAssignment_1 = require("../../assignment/utilities/filterForIDsWithAssignment");
13
13
  const DispatchContext_1 = require("../../context/DispatchContext");
14
+ const GlobalContext_1 = require("../../context/GlobalContext");
14
15
  const ScaleContext_1 = require("../../context/ScaleContext");
15
16
  const Resizer_1 = __importDefault(require("../../elements/resizer/Resizer"));
16
17
  const highlight_1 = require("../../highlight");
17
18
  const Types_1 = require("../../reducer/types/Types");
18
19
  const ToolTypes_1 = require("../../toolbar/ToolTypes");
20
+ const formatNumber_1 = require("../../utility/formatNumber");
19
21
  const MultiplicityTree_1 = __importDefault(require("../multiplicityTree/MultiplicityTree"));
20
22
  const TempMultiplicityTree_1 = __importDefault(require("../multiplicityTree/TempMultiplicityTree"));
21
23
  const stylesOnHover = (0, react_1.css) `
@@ -46,8 +48,9 @@ const stylesHighlighted = (0, react_1.css) `
46
48
  cursor: pointer;
47
49
  }
48
50
  `;
49
- function Range({ rangeData, showMultiplicityTrees, selectedTool, startEditMode, }) {
50
- const { id, from, to, integration, signals } = rangeData;
51
+ function Range({ rangeData, showMultiplicityTrees, selectedTool, startEditMode, relativeFormat, }) {
52
+ const { viewerRef } = (0, GlobalContext_1.useGlobal)();
53
+ const { id, integration, signals } = rangeData;
51
54
  const assignmentData = (0, AssignmentsContext_1.useAssignmentData)();
52
55
  const assignmentRange = (0, AssignmentsContext_1.useAssignment)(id);
53
56
  const highlightRange = (0, highlight_1.useHighlight)([assignmentRange.id].concat(assignmentRange.assigned?.x || []).concat((0, filterForIDsWithAssignment_1.filterForIDsWithAssignment)(assignmentData, signals.map((_signal) => _signal.id))), { type: highlight_1.HighlightedSource.RANGE, extra: { id } });
@@ -91,11 +94,14 @@ function Range({ rangeData, showMultiplicityTrees, selectedTool, startEditMode,
91
94
  assignmentRange.setActive('x');
92
95
  }
93
96
  }, [assignmentRange, isBlockedByEditing, selectedTool]);
94
- return ((0, jsx_runtime_1.jsxs)("g", { "data-test-id": "range", style: { outline: 'none' }, css: isBlockedByEditing ||
95
- highlightRange.isActive ||
96
- assignmentRange.isActive
97
- ? stylesHighlighted
98
- : stylesOnHover, onMouseEnter: mouseEnterHandler, onMouseLeave: mouseLeaveHandler, onClick: assignHandler, children: [(0, jsx_runtime_1.jsx)(Resizer_1.default, { tag: "svg", initialPosition: { x1: scaleX()(to), x2: scaleX()(from) }, onEnd: handleOnStopResizing, children: (x1, x2) => ((0, jsx_runtime_1.jsxs)("g", { transform: `translate(0,10)`, children: [(0, jsx_runtime_1.jsx)("rect", { "data-no-export": "true", x: "0", width: x2 - x1, height: "6", className: "range-area", fill: "green", fillOpacity: !reduceOpacity ||
97
+ const from = scaleX()(rangeData.from);
98
+ const to = scaleX()(rangeData.to);
99
+ return ((0, jsx_runtime_1.jsxs)("g", { "data-test-id": "range", style: { outline: 'none' }, onMouseEnter: mouseEnterHandler, onMouseLeave: mouseLeaveHandler, onClick: assignHandler, children: [(0, jsx_runtime_1.jsx)(Resizer_1.default, { tag: "svg", initialPosition: { x1: to, x2: from }, onEnd: handleOnStopResizing, parentElement: viewerRef, children: ({ x1, x2 }, isActive) => ((0, jsx_runtime_1.jsxs)("g", { transform: `translate(0,10)`, css: isBlockedByEditing ||
100
+ highlightRange.isActive ||
101
+ assignmentRange.isActive ||
102
+ isActive
103
+ ? stylesHighlighted
104
+ : stylesOnHover, children: [(0, jsx_runtime_1.jsx)("rect", { x: "0", width: x2 - x1, height: "6", className: "range-area", fill: "green", fillOpacity: !reduceOpacity ||
99
105
  highlightRange.isActive ||
100
106
  assignmentRange.isActive
101
107
  ? 1
@@ -103,9 +109,11 @@ function Range({ rangeData, showMultiplicityTrees, selectedTool, startEditMode,
103
109
  highlightRange.isActive ||
104
110
  assignmentRange.isActive
105
111
  ? 1
106
- : 0.6, children: integration !== undefined ? integration.toFixed(2) : '' })] })) }), startEditMode ? ((0, jsx_runtime_1.jsx)(TempMultiplicityTree_1.default, {})) : (showMultiplicityTrees &&
112
+ : 0.6, children: integration !== undefined
113
+ ? (0, formatNumber_1.formatNumber)(integration, relativeFormat)
114
+ : '' })] })) }, `${id}_${to}_${from}`), startEditMode ? ((0, jsx_runtime_1.jsx)(TempMultiplicityTree_1.default, {})) : (showMultiplicityTrees &&
107
115
  signals &&
108
116
  signals.length > 0 &&
109
- signals.map((_signal) => ((0, jsx_runtime_1.jsx)(MultiplicityTree_1.default, { rangeFrom: from, rangeTo: to, signal: _signal }, _signal.id))))] }, id));
117
+ signals.map((_signal) => ((0, jsx_runtime_1.jsx)(MultiplicityTree_1.default, { rangeFrom: rangeData.from, rangeTo: rangeData.to, signal: _signal }, _signal.id))))] }, id));
110
118
  }
111
119
  exports.default = Range;
@@ -6,17 +6,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const jsx_runtime_1 = require("react/jsx-runtime");
7
7
  const react_1 = require("react");
8
8
  const ChartContext_1 = require("../../context/ChartContext");
9
+ const usePanelPreferences_1 = require("../../hooks/usePanelPreferences");
9
10
  const useSpectrum_1 = __importDefault(require("../../hooks/useSpectrum"));
10
11
  const Range_1 = __importDefault(require("./Range"));
11
12
  const RangeIntegral_1 = __importDefault(require("./RangeIntegral"));
12
- function RangesInner({ ranges, displayerKey, selectedTool, editRangeID, showMultiplicityTrees, showRangesIntegrals, }) {
13
- 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 }), showRangesIntegrals && (0, jsx_runtime_1.jsx)(RangeIntegral_1.default, { range: range })] }, range.id))) }));
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))) }));
14
15
  }
15
16
  const MemoizedRanges = (0, react_1.memo)(RangesInner);
16
17
  const empyData = { ranges: {} };
17
18
  function Ranges() {
18
- const { displayerKey, toolOptions: { selectedTool, data: { tempRange, showMultiplicityTrees, showRangesIntegrals }, }, } = (0, ChartContext_1.useChartData)();
19
+ const { displayerKey, toolOptions: { selectedTool, data: { tempRange, showMultiplicityTrees, showRangesIntegrals }, }, activeTab, } = (0, ChartContext_1.useChartData)();
19
20
  const { ranges } = (0, useSpectrum_1.default)(empyData);
21
+ const rangesPreferences = (0, usePanelPreferences_1.usePanelPreferences)('ranges', activeTab);
20
22
  return ((0, jsx_runtime_1.jsx)(MemoizedRanges, { ...{
21
23
  ranges,
22
24
  showMultiplicityTrees,
@@ -24,6 +26,7 @@ function Ranges() {
24
26
  selectedTool,
25
27
  displayerKey,
26
28
  editRangeID: tempRange?.id || '',
29
+ relativeFormat: rangesPreferences.relative.format,
27
30
  } }));
28
31
  }
29
32
  exports.default = Ranges;
@@ -6,7 +6,7 @@ const BrushTracker_1 = require("../../EventsTrackers/BrushTracker");
6
6
  const MouseTracker_1 = require("../../EventsTrackers/MouseTracker");
7
7
  const ChartContext_1 = require("../../context/ChartContext");
8
8
  const ScaleContext_1 = require("../../context/ScaleContext");
9
- const FormatNumber_1 = require("../../utility/FormatNumber");
9
+ const useFormatNumberByNucleus_1 = require("../../hooks/useFormatNumberByNucleus");
10
10
  const style = {
11
11
  cursor: 'crosshair',
12
12
  transformOrigin: 'bottom right',
@@ -28,7 +28,7 @@ function XLabelPointer() {
28
28
  : null;
29
29
  return spectrumData;
30
30
  }, [activeSpectrum, data]);
31
- const format = (0, FormatNumber_1.useFormatNumberByNucleus)(activeSpectrumData?.info.nucleus);
31
+ const format = (0, useFormatNumberByNucleus_1.useFormatNumberByNucleus)(activeSpectrumData?.info.nucleus);
32
32
  const getXValue = (0, react_1.useCallback)((xVal) => {
33
33
  if (activeSpectrumData) {
34
34
  const xInvert = scaleX().invert(xVal);
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const jsx_runtime_1 = require("react/jsx-runtime");
7
7
  const react_1 = require("react");
8
8
  const ChartContext_1 = require("../context/ChartContext");
9
+ const FloatMoleculeStructures_1 = __importDefault(require("../tool/FloatMoleculeStructures"));
9
10
  const Contours_1 = __importDefault(require("./Contours"));
10
11
  const Left1DChart_1 = __importDefault(require("./Left1DChart"));
11
12
  const Top1DChart_1 = __importDefault(require("./Top1DChart"));
@@ -14,7 +15,7 @@ const YAxis_1 = __importDefault(require("./YAxis"));
14
15
  const IndicationLines_1 = __importDefault(require("./zones/IndicationLines"));
15
16
  const Zones_1 = __importDefault(require("./zones/Zones"));
16
17
  function chart2DInner({ spectra, width, height, margin, displayerKey, }) {
17
- return ((0, jsx_runtime_1.jsxs)("svg", { viewBox: `0 0 ${width} ${height}`, width: width, height: height, id: "nmrSVG", children: [(0, jsx_runtime_1.jsx)("defs", { children: (0, jsx_runtime_1.jsx)("clipPath", { id: `${displayerKey}clip-chart-2d`, children: (0, jsx_runtime_1.jsx)("rect", { width: width - margin.left - margin.right, height: height - margin.top - margin.bottom, x: margin.left, y: margin.top }) }) }), (0, jsx_runtime_1.jsx)("rect", { width: width - margin.left - margin.right, height: height - margin.top - margin.bottom, x: margin.left, y: margin.top, stroke: "black", strokeWidth: "1", fill: "transparent" }), spectra?.[0] && (0, jsx_runtime_1.jsx)(Top1DChart_1.default, { data: spectra[0] }), spectra?.[1] && (0, jsx_runtime_1.jsx)(Left1DChart_1.default, { data: spectra[1] }), (0, jsx_runtime_1.jsx)(Contours_1.default, {}), (0, jsx_runtime_1.jsx)(Zones_1.default, {}), (0, jsx_runtime_1.jsx)(IndicationLines_1.default, { axis: "X", show: true }), (0, jsx_runtime_1.jsx)(IndicationLines_1.default, { axis: "Y", show: true }), (0, jsx_runtime_1.jsxs)("g", { className: "container", style: { pointerEvents: 'none' }, children: [(0, jsx_runtime_1.jsx)(XAxis_1.default, {}), (0, jsx_runtime_1.jsx)(YAxis_1.default, {})] })] }));
18
+ return ((0, jsx_runtime_1.jsxs)("svg", { viewBox: `0 0 ${width} ${height}`, width: width, height: height, id: "nmrSVG", children: [(0, jsx_runtime_1.jsx)("defs", { children: (0, jsx_runtime_1.jsx)("clipPath", { id: `${displayerKey}clip-chart-2d`, children: (0, jsx_runtime_1.jsx)("rect", { width: width - margin.left - margin.right, height: height - margin.top - margin.bottom, x: margin.left, y: margin.top }) }) }), (0, jsx_runtime_1.jsx)("rect", { width: width - margin.left - margin.right, height: height - margin.top - margin.bottom, x: margin.left, y: margin.top, stroke: "black", strokeWidth: "1", fill: "transparent" }), spectra?.[0] && (0, jsx_runtime_1.jsx)(Top1DChart_1.default, { data: spectra[0] }), spectra?.[1] && (0, jsx_runtime_1.jsx)(Left1DChart_1.default, { data: spectra[1] }), (0, jsx_runtime_1.jsx)(Contours_1.default, {}), (0, jsx_runtime_1.jsx)(Zones_1.default, {}), (0, jsx_runtime_1.jsx)(IndicationLines_1.default, { axis: "X", show: true }), (0, jsx_runtime_1.jsx)(IndicationLines_1.default, { axis: "Y", show: true }), (0, jsx_runtime_1.jsxs)("g", { className: "container", style: { pointerEvents: 'none' }, children: [(0, jsx_runtime_1.jsx)(XAxis_1.default, {}), (0, jsx_runtime_1.jsx)(YAxis_1.default, {})] }), (0, jsx_runtime_1.jsx)(FloatMoleculeStructures_1.default, {})] }));
18
19
  }
19
20
  const MemoizedChart2D = (0, react_1.memo)(chart2DInner);
20
21
  function Chart2D({ spectra }) {
@@ -49,11 +49,14 @@ function ContoursPaths({ id: spectrumID, sign, color, datum, }) {
49
49
  const data = (0, react_1.useMemo)(() => {
50
50
  return (0, get_1.default)(contours, `${spectrumID}.${sign}`, []);
51
51
  }, [contours, sign, spectrumID]);
52
+ const path = buildContourPath(data);
53
+ if (!path)
54
+ return null;
52
55
  return ((0, jsx_runtime_1.jsx)("path", { fill: "none", "data-test-id": "spectrum-line", stroke: color, strokeWidth: "1", style: {
53
56
  opacity: isActive
54
57
  ? 1
55
58
  : (0, get_1.default)(preferences.current, 'controllers.dimmedSpectraTransparency', 0.1),
56
- }, d: buildContourPath(data) }));
59
+ }, d: path }));
57
60
  }
58
61
  function ContoursInner({ data, displayerKey }) {
59
62
  return ((0, jsx_runtime_1.jsx)("g", { clipPath: `url(#${displayerKey}clip-chart-2d)`, className: "contours", children: data?.map((datum, index) => ((0, jsx_runtime_1.jsxs)("g", { children: [datum.display.isPositiveVisible && ((0, jsx_runtime_1.jsx)(ContoursPaths, { id: datum.id, sign: "positive", datum: datum, color: datum.display.positiveColor })), datum.display.isNegativeVisible && ((0, jsx_runtime_1.jsx)(ContoursPaths, { id: datum.id, sign: "negative", datum: datum, color: datum.display.negativeColor }))] }, `${datum.id + index}`))) }));
@@ -10,8 +10,8 @@ const get1DDataXY_1 = require("../../data/data1d/Spectrum1D/get1DDataXY");
10
10
  const BrushTracker_1 = require("../EventsTrackers/BrushTracker");
11
11
  const MouseTracker_1 = require("../EventsTrackers/MouseTracker");
12
12
  const ChartContext_1 = require("../context/ChartContext");
13
+ const useFormatNumberByNucleus_1 = require("../hooks/useFormatNumberByNucleus");
13
14
  const ToolTypes_1 = require("../toolbar/ToolTypes");
14
- const FormatNumber_1 = require("../utility/FormatNumber");
15
15
  const DimensionLayout_1 = require("./utilities/DimensionLayout");
16
16
  const scale_1 = require("./utilities/scale");
17
17
  const styles = (0, react_1.css) `
@@ -58,7 +58,7 @@ function FooterBanner({ layout, data1D }) {
58
58
  startY: position.y,
59
59
  });
60
60
  const nucleuses = activeTab.split(',');
61
- const [formatX, formatY] = (0, FormatNumber_1.useFormatNumberByNucleus)(nucleuses);
61
+ const [formatX, formatY] = (0, useFormatNumberByNucleus_1.useFormatNumberByNucleus)(nucleuses);
62
62
  const scaleX = (0, react_2.useMemo)(() => {
63
63
  if (!data1D || data1D.length === 0) {
64
64
  return (0, scale_1.get2DXScale)({ width, margin, xDomain });
@@ -5,7 +5,7 @@ const react_1 = require("react");
5
5
  const BrushTracker_1 = require("../../EventsTrackers/BrushTracker");
6
6
  const MouseTracker_1 = require("../../EventsTrackers/MouseTracker");
7
7
  const ChartContext_1 = require("../../context/ChartContext");
8
- const FormatNumber_1 = require("../../utility/FormatNumber");
8
+ const useFormatNumberByNucleus_1 = require("../../hooks/useFormatNumberByNucleus");
9
9
  const DimensionLayout_1 = require("../utilities/DimensionLayout");
10
10
  const scale_1 = require("../utilities/scale");
11
11
  const style = {
@@ -31,7 +31,7 @@ function XYLabelPointer({ layout, data1D }) {
31
31
  startY: position.y,
32
32
  });
33
33
  const nucleuses = activeTab.split(',');
34
- const [formatX, formatY] = (0, FormatNumber_1.useFormatNumberByNucleus)(nucleuses);
34
+ const [formatX, formatY] = (0, useFormatNumberByNucleus_1.useFormatNumberByNucleus)(nucleuses);
35
35
  const scaleX = (0, react_1.useMemo)(() => {
36
36
  if (!activeSpectrum || !data1D || data1D.length === 0) {
37
37
  return (0, scale_1.get2DXScale)({ width, margin, xDomain });
@@ -249,9 +249,15 @@ function KeysListenerTracker() {
249
249
  saveAsJSONHandler,
250
250
  saveToClipboardHandler,
251
251
  ]);
252
+ function checkNotInputField(e) {
253
+ const tags = ['input', 'textarea'];
254
+ const tagName = e.composedPath()[0].tagName.toLowerCase();
255
+ if (!tags.includes(tagName))
256
+ return true;
257
+ return false;
258
+ }
252
259
  const handleOnKeyDown = (0, react_1.useCallback)((e) => {
253
- if (!['input', 'textarea'].includes(e.target.localName) &&
254
- overDisplayer) {
260
+ if (checkNotInputField(e) && overDisplayer) {
255
261
  const num = Number(e.code.substr(e.code.length - 1)) || 0;
256
262
  if (num > 0) {
257
263
  keysPreferencesListenerHandler(e, num);
@@ -274,8 +280,8 @@ function KeysListenerTracker() {
274
280
  toolsListenerHandler,
275
281
  ]);
276
282
  (0, react_1.useEffect)(() => {
277
- document.addEventListener('keydown', handleOnKeyDown, true);
278
- return () => document.removeEventListener('keydown', handleOnKeyDown, true);
283
+ document.addEventListener('keydown', handleOnKeyDown);
284
+ return () => document.removeEventListener('keydown', handleOnKeyDown);
279
285
  }, [handleOnKeyDown]);
280
286
  return null;
281
287
  }
@@ -38,6 +38,7 @@ const Viewer1D_1 = __importDefault(require("./1d/Viewer1D"));
38
38
  const Viewer2D_1 = __importDefault(require("./2d/Viewer2D"));
39
39
  const ErrorOverlay_1 = __importDefault(require("./ErrorOverlay"));
40
40
  const KeysListenerTracker_1 = __importDefault(require("./EventsTrackers/KeysListenerTracker"));
41
+ const SplitPaneWrapper_1 = require("./SplitPaneWrapper");
41
42
  const assignment_1 = require("./assignment");
42
43
  const ChartContext_1 = require("./context/ChartContext");
43
44
  const DispatchContext_1 = require("./context/DispatchContext");
@@ -53,7 +54,7 @@ const Panels_1 = __importDefault(require("./panels/Panels"));
53
54
  const IgnoreActions_1 = __importDefault(require("./reducer/IgnoreActions"));
54
55
  const Reducer_1 = require("./reducer/Reducer");
55
56
  const Constants_1 = require("./reducer/core/Constants");
56
- const preferencesReducer_1 = __importStar(require("./reducer/preferencesReducer"));
57
+ const preferencesReducer_1 = __importStar(require("./reducer/preferences/preferencesReducer"));
57
58
  const Types_1 = require("./reducer/types/Types");
58
59
  const ToolBar_1 = __importDefault(require("./toolbar/ToolBar"));
59
60
  const viewerContainerStyle = (0, react_1.css) `
@@ -114,6 +115,7 @@ function NMRium(props) {
114
115
  function InnerNMRium({ data: dataProp = defaultData, workspace, preferences = defaultPreferences, getSpinner = SpinnerContext_1.defaultGetSpinner, onDataChange, emptyText, }) {
115
116
  const rootRef = (0, react_2.useRef)(null);
116
117
  const elementsWrapperRef = (0, react_2.useRef)(null);
118
+ const viewerRef = (0, react_2.useRef)(null);
117
119
  const [show, toggle] = (0, react_use_1.useToggle)(false);
118
120
  const isFullscreen = (0, react_use_1.useFullscreen)(rootRef, show, {
119
121
  onClose: () => {
@@ -177,6 +179,7 @@ function InnerNMRium({ data: dataProp = defaultData, workspace, preferences = de
177
179
  return ((0, jsx_runtime_1.jsx)(GlobalContext_1.GlobalProvider, { value: {
178
180
  rootRef: rootRef.current,
179
181
  elementsWrapperRef: elementsWrapperRef.current,
182
+ viewerRef: viewerRef.current,
180
183
  }, children: (0, jsx_runtime_1.jsx)(PreferencesContext_1.PreferencesProvider, { value: preferencesState, children: (0, jsx_runtime_1.jsx)("div", { ref: mainDivRef, style: { height: '100%', position: 'relative' }, children: (0, jsx_runtime_1.jsx)(Alert_1.AlertProvider, { wrapperRef: elementsWrapperRef.current, children: (0, jsx_runtime_1.jsx)(DispatchContext_1.DispatchProvider, { value: dispatchMiddleWare, children: (0, jsx_runtime_1.jsx)(ChartContext_1.ChartDataProvider, { value: state, children: (0, jsx_runtime_1.jsx)(Modal_1.ModalProvider, { wrapperRef: elementsWrapperRef.current, children: (0, jsx_runtime_1.jsx)(highlight_1.HighlightProvider, { children: (0, jsx_runtime_1.jsx)(assignment_1.AssignmentProvider, { spectraData: spectraData, children: (0, jsx_runtime_1.jsx)(SpinnerContext_1.SpinnerProvider, { value: getSpinner, children: (0, jsx_runtime_1.jsx)("div", { className: "nmrium-container", ref: rootRef, css: containerStyles, onContextMenu: preventContextMenuHandler, style: { height: '100%', width: '100%' }, children: (0, jsx_runtime_1.jsx)(DropZone_1.default, { children: (0, jsx_runtime_1.jsxs)("div", { style: {
181
184
  display: 'flex',
182
185
  flexDirection: 'column',
@@ -186,7 +189,7 @@ function InnerNMRium({ data: dataProp = defaultData, workspace, preferences = de
186
189
  display: 'flex',
187
190
  flexDirection: 'row',
188
191
  height: '100%',
189
- }, children: [(0, jsx_runtime_1.jsx)(ToolBar_1.default, {}), (0, jsx_runtime_1.jsxs)(analysis_ui_components_1.SplitPane, { initialSeparation: "590px", orientation: "horizontal", sideSeparation: "end", children: [(0, jsx_runtime_1.jsxs)("div", { css: viewerContainerStyle, children: [(0, jsx_runtime_1.jsx)(KeysListenerTracker_1.default, {}), (0, jsx_runtime_1.jsx)("div", { "data-test-id": "viewer", style: {
192
+ }, children: [(0, jsx_runtime_1.jsx)(ToolBar_1.default, {}), (0, jsx_runtime_1.jsxs)(SplitPaneWrapper_1.SplitPaneWrapper, { children: [(0, jsx_runtime_1.jsxs)("div", { css: viewerContainerStyle, children: [(0, jsx_runtime_1.jsx)(KeysListenerTracker_1.default, {}), (0, jsx_runtime_1.jsx)("div", { "data-test-id": "viewer", ref: viewerRef, style: {
190
193
  width: '100%',
191
194
  height: '100%',
192
195
  }, children: displayerMode ===
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SplitPaneWrapper = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const analysis_ui_components_1 = require("analysis-ui-components");
6
+ const PreferencesContext_1 = require("./context/PreferencesContext");
7
+ function SplitPaneWrapper({ children }) {
8
+ const { current } = (0, PreferencesContext_1.usePreferences)();
9
+ const general = current?.display?.general || {};
10
+ return ((0, jsx_runtime_1.jsx)(analysis_ui_components_1.SplitPane, { initialSeparation: general?.initialPanelWidth || '560px', orientation: "horizontal", sideSeparation: "end", initialClosed: general?.hidePanelOnLoad || false, children: children }));
11
+ }
12
+ exports.SplitPaneWrapper = SplitPaneWrapper;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useGlobal = exports.GlobalProvider = exports.GlobalConetxt = void 0;
4
4
  const react_1 = require("react");
5
- exports.GlobalConetxt = (0, react_1.createContext)({ rootRef: null, elementsWrapperRef: null });
5
+ exports.GlobalConetxt = (0, react_1.createContext)({ rootRef: null, elementsWrapperRef: null, viewerRef: null });
6
6
  exports.GlobalProvider = exports.GlobalConetxt.Provider;
7
7
  function useGlobal() {
8
8
  return (0, react_1.useContext)(exports.GlobalConetxt);
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.useWorkspacesList = exports.usePreferences = exports.PreferencesProvider = exports.PreferencesContext = void 0;
7
7
  const react_1 = require("react");
8
- const preferencesReducer_1 = require("../reducer/preferencesReducer");
8
+ const preferencesReducer_1 = require("../reducer/preferences/preferencesReducer");
9
9
  const workspaces_1 = __importDefault(require("../workspaces"));
10
10
  exports.PreferencesContext = (0, react_1.createContext)(preferencesReducer_1.preferencesInitialState);
11
11
  exports.PreferencesProvider = exports.PreferencesContext.Provider;
@@ -130,7 +130,7 @@ const Button = (props) => {
130
130
  borderRadius,
131
131
  }),
132
132
  style,
133
- ], ...restProps, children: (0, jsx_runtime_1.jsxs)("span", { style: { flex: 1 }, children: [" ", props.children] }) }));
133
+ ], ...restProps, children: (0, jsx_runtime_1.jsxs)("span", { style: { flex: 1, pointerEvents: 'none' }, children: [" ", props.children] }) }));
134
134
  };
135
135
  function ThemeButton(props) {
136
136
  const { colorTheme, ...buttonProps } = props;
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
4
4
  /** @jsxImportSource @emotion/react */
5
5
  const react_1 = require("@emotion/react");
6
+ const analysis_ui_components_1 = require("analysis-ui-components");
6
7
  const react_2 = require("react");
7
- const react_color_1 = require("react-color");
8
8
  const style = (0, react_1.css) `
9
9
  display: flex;
10
10
  margin: 5px 0px;
@@ -85,6 +85,6 @@ function ColorInput(props) {
85
85
  setColor(hex);
86
86
  onColorChange({ ...colorEvent, hex, name });
87
87
  }, [name, onColorChange]);
88
- return ((0, jsx_runtime_1.jsxs)("div", { css: style, children: [(0, jsx_runtime_1.jsx)("span", { className: "inputLabel", children: label }), (0, jsx_runtime_1.jsxs)("div", { style: { flex: 4 }, children: [(0, jsx_runtime_1.jsxs)("div", { className: "swatch", onClick: handleClick, children: [(0, jsx_runtime_1.jsx)("div", { className: "color", style: { backgroundColor: selectedColor } }), (0, jsx_runtime_1.jsx)("input", { type: "hidden", value: selectedColor, name: name })] }), displayColorPicker ? ((0, jsx_runtime_1.jsxs)("div", { className: "color-popover", children: [(0, jsx_runtime_1.jsx)("div", { className: "cover", onClick: handleClose }), (0, jsx_runtime_1.jsx)(react_color_1.ChromePicker, { color: { hex: selectedColor }, onChangeComplete: handleOnColorChanged })] })) : null] })] }));
88
+ return ((0, jsx_runtime_1.jsxs)("div", { css: style, children: [(0, jsx_runtime_1.jsx)("span", { className: "inputLabel", children: label }), (0, jsx_runtime_1.jsxs)("div", { style: { flex: 4 }, children: [(0, jsx_runtime_1.jsxs)("div", { className: "swatch", onClick: handleClick, children: [(0, jsx_runtime_1.jsx)("div", { className: "color", style: { backgroundColor: selectedColor } }), (0, jsx_runtime_1.jsx)("input", { type: "hidden", value: selectedColor, name: name })] }), displayColorPicker ? ((0, jsx_runtime_1.jsxs)("div", { className: "color-popover", children: [(0, jsx_runtime_1.jsx)("div", { className: "cover", onClick: handleClose }), (0, jsx_runtime_1.jsx)(analysis_ui_components_1.ColorPicker, { color: { hex: selectedColor }, onChangeComplete: handleOnColorChanged })] })) : null] })] }));
89
89
  }
90
90
  exports.default = (0, react_2.memo)(ColorInput);