nmrium 0.31.0 → 0.33.0-pre.1667632695

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 (492) hide show
  1. package/lib/component/1d/Chart1D.js +1 -1
  2. package/lib/component/1d/FooterBanner.js +17 -10
  3. package/lib/component/1d/LinesSeries.js +1 -1
  4. package/lib/component/1d/SpectraTracker.js +1 -1
  5. package/lib/component/1d/Viewer1D.js +1 -1
  6. package/lib/component/1d/XAxis.js +1 -1
  7. package/lib/component/1d/database/DatabaseSpectrum.js +2 -1
  8. package/lib/component/1d/database/ResurrectedDatabaseRanges.js +2 -2
  9. package/lib/component/1d/{Integral.d.ts → integral/Integral.d.ts} +0 -0
  10. package/lib/component/1d/{Integral.js → integral/Integral.js} +2 -2
  11. package/lib/component/1d/integral/IntegralIndicator.d.ts +9 -0
  12. package/lib/component/1d/integral/IntegralIndicator.js +27 -0
  13. package/lib/component/1d/{IntegralResizable.d.ts → integral/IntegralResizable.d.ts} +0 -0
  14. package/lib/component/1d/integral/IntegralResizable.js +69 -0
  15. package/lib/component/1d/{IntegralsSeries.d.ts → integral/IntegralsSeries.d.ts} +0 -0
  16. package/lib/component/1d/{IntegralsSeries.js → integral/IntegralsSeries.js} +4 -4
  17. package/lib/component/1d/multiAnalysis/MultiAnalysisRanges.js +1 -1
  18. package/lib/component/1d/multiplicityTree/MultiplicityTree.js +4 -4
  19. package/lib/component/1d/multiplicityTree/buildTreeNode.js +3 -3
  20. package/lib/component/1d/peaks/PeakAnnotation.js +1 -1
  21. package/lib/component/1d/peaks/usePeakShapesPath.js +10 -6
  22. package/lib/component/1d/ranges/Range.js +27 -50
  23. package/lib/component/1d/tool/PeakPointer.js +1 -1
  24. package/lib/component/1d/utilities/scale.js +2 -2
  25. package/lib/component/2d/Contours.js +61 -42
  26. package/lib/component/2d/FooterBanner.js +2 -2
  27. package/lib/component/2d/Left1DChart.js +1 -1
  28. package/lib/component/2d/Top1DChart.js +1 -1
  29. package/lib/component/2d/Viewer2D.js +11 -14
  30. package/lib/component/2d/tools/XYLabelPointer.js +2 -2
  31. package/lib/component/2d/tools/slicing/VerticalSliceChart.js +1 -1
  32. package/lib/component/2d/zones/IndicationLines.js +5 -8
  33. package/lib/component/EventsTrackers/BrushTracker.js +30 -21
  34. package/lib/component/EventsTrackers/KeysListenerTracker.js +14 -15
  35. package/lib/component/NMRium.d.ts +1 -1
  36. package/lib/component/NMRium.js +6 -6
  37. package/lib/component/SplitPaneWrapper.js +1 -1
  38. package/lib/component/assignment/actions/initAssignment.js +17 -17
  39. package/lib/component/assignment/index.js +2 -2
  40. package/lib/component/context/PreferencesContext.js +3 -6
  41. package/lib/component/elements/Button.js +1 -1
  42. package/lib/component/elements/CheckBoxCell.js +1 -1
  43. package/lib/component/elements/ContextMenu.js +2 -2
  44. package/lib/component/elements/EditableColumn.d.ts +3 -1
  45. package/lib/component/elements/EditableColumn.js +21 -8
  46. package/lib/component/elements/GroupPane.d.ts +12 -0
  47. package/lib/component/elements/GroupPane.js +14 -0
  48. package/lib/component/elements/Input.js +7 -4
  49. package/lib/component/elements/IsotopesViewer.js +1 -1
  50. package/lib/component/elements/Label.js +1 -2
  51. package/lib/component/elements/MolecularFormulaInput.js +2 -0
  52. package/lib/component/elements/NumberInput.js +2 -2
  53. package/lib/component/elements/ReactTable/Elements/ReactTableRow.js +1 -1
  54. package/lib/component/elements/ReactTable/ReactTable.d.ts +2 -1
  55. package/lib/component/elements/ReactTable/ReactTable.js +72 -38
  56. package/lib/component/elements/ReactTable/ReactTableFlexLayout.d.ts +3 -2
  57. package/lib/component/elements/ReactTable/ReactTableFlexLayout.js +2 -2
  58. package/lib/component/elements/ReactTable/utility/addCustomColumn.js +3 -3
  59. package/lib/component/elements/ReactTable/utility/useRowSpan.js +3 -7
  60. package/lib/component/elements/accordion/Accordion.js +2 -2
  61. package/lib/component/elements/draggble/useDraggable.js +1 -3
  62. package/lib/component/elements/dropDownButton/DropDownList.js +1 -2
  63. package/lib/component/elements/formik/FormikCheckBox.js +1 -1
  64. package/lib/component/elements/formik/FormikColorPicker.d.ts +0 -1
  65. package/lib/component/elements/formik/FormikColorPicker.js +5 -8
  66. package/lib/component/elements/formik/FormikErrorsSummary.js +2 -2
  67. package/lib/component/elements/formik/FormikForm.js +2 -2
  68. package/lib/component/elements/formik/FormikInput.d.ts +0 -1
  69. package/lib/component/elements/formik/FormikInput.js +12 -20
  70. package/lib/component/elements/formik/FormikOnChange.d.ts +1 -1
  71. package/lib/component/elements/formik/FormikOnChange.js +13 -10
  72. package/lib/component/elements/formik/FormikSelect.js +1 -1
  73. package/lib/component/elements/formik/FormikSlider.d.ts +2 -4
  74. package/lib/component/elements/formik/FormikSlider.js +8 -11
  75. package/lib/component/elements/formik/FormikTextarea.js +1 -1
  76. package/lib/component/elements/linearAxis/LinearVerticalAxis.js +2 -2
  77. package/lib/component/elements/popup/Alert/Provider.js +7 -7
  78. package/lib/component/elements/popup/Alert/index.d.ts +3 -4
  79. package/lib/component/elements/popup/Alert/index.js +3 -4
  80. package/lib/component/elements/popup/Modal/ModalContent.js +3 -1
  81. package/lib/component/elements/popup/Modal/Provider.js +16 -31
  82. package/lib/component/elements/popup/Modal/index.d.ts +4 -5
  83. package/lib/component/elements/popup/Modal/index.js +4 -5
  84. package/lib/component/header/Header.js +1 -1
  85. package/lib/component/hooks/useActiveSpectrumStyleOptions.js +1 -1
  86. package/lib/component/hooks/useCombinedRefs.js +2 -2
  87. package/lib/component/hooks/useExport.d.ts +1 -1
  88. package/lib/component/hooks/useExport.js +9 -6
  89. package/lib/component/hooks/useFormatNumberByNucleus.js +1 -1
  90. package/lib/component/hooks/usePanelPreferences.js +9 -7
  91. package/lib/component/loader/DropZone.js +10 -2
  92. package/lib/component/modal/AlignSpectraModal.js +1 -1
  93. package/lib/component/modal/ExportAsMatrixModal.js +1 -1
  94. package/lib/component/modal/LoadJCAMPModal.js +2 -2
  95. package/lib/component/modal/MultipleSpectraFiltersModal/index.js +1 -1
  96. package/lib/component/modal/MultipletAnalysisModal.js +3 -3
  97. package/lib/component/modal/PredictSpectraModal.js +5 -5
  98. package/lib/component/modal/editRange/EditRangeModal.js +4 -4
  99. package/lib/component/modal/editRange/forms/components/SignalFormInfo.js +1 -1
  100. package/lib/component/modal/editRange/forms/validation/EditRangeValidation.js +2 -2
  101. package/lib/component/modal/setting/DatabasesTabContent.js +25 -20
  102. package/lib/component/modal/setting/DisplayTabContent.js +21 -27
  103. package/lib/component/modal/setting/FormattingTabContent.js +10 -10
  104. package/lib/component/modal/setting/GeneralSettings.js +11 -14
  105. package/lib/component/modal/setting/GeneralTabContent.js +3 -1
  106. package/lib/component/modal/setting/ToolsTabContent.js +18 -19
  107. package/lib/component/modal/setting/WorkspaceItem.d.ts +2 -1
  108. package/lib/component/modal/setting/WorkspaceItem.js +36 -48
  109. package/lib/component/modal/setting/settingsValidation.d.ts +58 -57
  110. package/lib/component/modal/setting/settingsValidation.js +14 -12
  111. package/lib/component/panels/AutomaticAssignment/useAutoAssignments.js +8 -7
  112. package/lib/component/panels/InformationPanel.js +52 -56
  113. package/lib/component/panels/IntegralsPanel/IntegralTable.js +1 -1
  114. package/lib/component/panels/MoleculesPanel/MoleculeHeader.js +1 -1
  115. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +1 -1
  116. package/lib/component/panels/MoleculesPanel/Utilities.js +6 -6
  117. package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +16 -17
  118. package/lib/component/panels/MultipleSpectraAnalysisPanel/ColumnHeader.js +1 -1
  119. package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleAnalysisCodeEditor.js +1 -1
  120. package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +1 -1
  121. package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPreferences.js +18 -17
  122. package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +2 -2
  123. package/lib/component/panels/PeaksPanel/PeaksPanel.js +1 -1
  124. package/lib/component/panels/PeaksPanel/PeaksTable.js +2 -2
  125. package/lib/component/panels/RangesPanel/RangesHeader.js +1 -1
  126. package/lib/component/panels/RangesPanel/RangesPanel.js +1 -1
  127. package/lib/component/panels/RangesPanel/RangesTable.js +1 -1
  128. package/lib/component/panels/RangesPanel/RangesTableRow.js +1 -3
  129. package/lib/component/panels/RangesPanel/TableColumns/CouplingColumn.js +1 -1
  130. package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.js +2 -2
  131. package/lib/component/panels/RangesPanel/hooks/useMapRanges.js +8 -8
  132. package/lib/component/panels/SpectrumsPanel/SpectrumListItem.js +6 -6
  133. package/lib/component/panels/SpectrumsPanel/SpectrumListPanel.js +3 -3
  134. package/lib/component/panels/SpectrumsPanel/SpectrumsTabs.js +5 -5
  135. package/lib/component/panels/SpectrumsPanel/base/ColorIndicator.js +2 -2
  136. package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum1DSetting.d.ts +1 -1
  137. package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum1DSetting.js +2 -1
  138. package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum2DSetting.d.ts +1 -1
  139. package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum2DSetting.js +2 -1
  140. package/lib/component/panels/SpectrumsPanel/base/setting/processSnapPlot.js +3 -26
  141. package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +13 -17
  142. package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnHeader.js +16 -17
  143. package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +20 -21
  144. package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +12 -12
  145. package/lib/component/panels/SummaryPanel/SetShiftTolerancesModal.js +1 -5
  146. package/lib/component/panels/SummaryPanel/utilities/Utilities.js +105 -94
  147. package/lib/component/panels/ZonesPanel/ZonesTable.js +8 -8
  148. package/lib/component/panels/databasePanel/DatabasePanel.js +5 -4
  149. package/lib/component/panels/databasePanel/DatabaseTable.d.ts +2 -1
  150. package/lib/component/panels/databasePanel/DatabaseTable.js +20 -5
  151. package/lib/component/panels/extra/preferences/ColumnsHelper.js +5 -2
  152. package/lib/component/panels/extra/utilities/MultiplicityUtilities.d.ts +2 -2
  153. package/lib/component/panels/extra/utilities/MultiplicityUtilities.js +2 -2
  154. package/lib/component/panels/filtersPanel/FiltersTable.js +1 -1
  155. package/lib/component/reducer/IgnoreActions.js +3 -3
  156. package/lib/component/reducer/Reducer.d.ts +26 -45
  157. package/lib/component/reducer/Reducer.js +13 -12
  158. package/lib/component/reducer/actions/CorrelationsActions.js +4 -4
  159. package/lib/component/reducer/actions/DomainActions.d.ts +2 -2
  160. package/lib/component/reducer/actions/DomainActions.js +52 -69
  161. package/lib/component/reducer/actions/FiltersActions.js +15 -6
  162. package/lib/component/reducer/actions/HistoryActions.js +5 -5
  163. package/lib/component/reducer/actions/IntegralsActions.js +6 -5
  164. package/lib/component/reducer/actions/LoadActions.js +12 -0
  165. package/lib/component/reducer/actions/PeaksActions.js +7 -6
  166. package/lib/component/reducer/actions/PreferencesActions.js +20 -38
  167. package/lib/component/reducer/actions/RangesActions.d.ts +1 -1
  168. package/lib/component/reducer/actions/RangesActions.js +28 -24
  169. package/lib/component/reducer/actions/SpectrumsActions.js +13 -6
  170. package/lib/component/reducer/actions/ToolsActions.d.ts +1 -1
  171. package/lib/component/reducer/actions/ToolsActions.js +28 -41
  172. package/lib/component/reducer/actions/ZonesActions.js +11 -10
  173. package/lib/component/reducer/core/Constants.js +1 -1
  174. package/lib/component/reducer/helper/GetClosestNumber.js +2 -1
  175. package/lib/component/reducer/helper/Zoom1DManager.js +11 -10
  176. package/lib/component/reducer/helper/getActiveSpectrum.d.ts +3 -0
  177. package/lib/component/reducer/helper/getActiveSpectrum.js +4 -0
  178. package/lib/component/reducer/helper/getSpectrum.js +3 -5
  179. package/lib/component/reducer/helper/getStrongestPeak.d.ts +1 -1
  180. package/lib/component/reducer/helper/getStrongestPeak.js +2 -3
  181. package/lib/component/reducer/preferences/actions/removeWorkspace.js +3 -10
  182. package/lib/component/reducer/preferences/actions/setPreferences.js +5 -6
  183. package/lib/component/reducer/preferences/preferencesReducer.d.ts +2 -2
  184. package/lib/component/reducer/preferences/utilities/mapNucleiFormatting.d.ts +1 -4
  185. package/lib/component/reducer/preferences/utilities/mapNucleiFormatting.js +7 -5
  186. package/lib/component/tool/BrushX.js +3 -3
  187. package/lib/component/tool/BrushXY.js +5 -5
  188. package/lib/component/tool/CrossLinePointer.js +3 -3
  189. package/lib/component/toolbar/BasicToolBar.js +9 -8
  190. package/lib/component/utility/Evaluate.js +2 -2
  191. package/lib/component/utility/FileUtility.d.ts +2 -9
  192. package/lib/component/utility/FileUtility.js +11 -28
  193. package/lib/component/utility/GroupByInfoKey.d.ts +1 -1
  194. package/lib/component/utility/GroupByInfoKey.js +11 -13
  195. package/lib/component/utility/PathBuilder.js +1 -1
  196. package/lib/component/utility/PreferencesHelper.js +2 -3
  197. package/lib/component/utility/{Export.d.ts → export.d.ts} +0 -0
  198. package/lib/component/utility/{Export.js → export.js} +54 -73
  199. package/lib/component/utility/formatNumber.d.ts +6 -1
  200. package/lib/component/utility/formatNumber.js +5 -4
  201. package/lib/component/workspaces/Workspace.d.ts +1 -1
  202. package/lib/component/workspaces/exercise.js +4 -4
  203. package/lib/component/workspaces/workspaceDefaultProperties.js +1 -1
  204. package/lib/data/Filters.d.ts +16 -18
  205. package/lib/data/Filters.js +16 -18
  206. package/lib/data/FiltersManager.js +4 -3
  207. package/lib/data/PredictionManager.js +8 -10
  208. package/lib/data/SpectraManager.d.ts +1 -2
  209. package/lib/data/SpectraManager.js +25 -60
  210. package/lib/data/data1d/MultipleAnalysis.js +74 -70
  211. package/lib/data/data1d/Spectrum1D/SumManager.js +1 -1
  212. package/lib/data/data1d/Spectrum1D/generateJGraphData.js +1 -1
  213. package/lib/data/data1d/Spectrum1D/index.d.ts +24 -25
  214. package/lib/data/data1d/Spectrum1D/index.js +24 -25
  215. package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +1 -1
  216. package/lib/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.js +6 -5
  217. package/lib/data/data1d/Spectrum1D/integrals/updateRelatives.js +8 -10
  218. package/lib/data/data1d/Spectrum1D/peaks/lookupPeak.js +1 -1
  219. package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.js +2 -2
  220. package/lib/data/data1d/Spectrum1D/ranges/addRange.js +3 -2
  221. package/lib/data/data1d/Spectrum1D/ranges/changeRange.js +2 -2
  222. package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.d.ts +35 -1
  223. package/lib/data/data1d/Spectrum1D/ranges/mapRanges.d.ts +35 -1
  224. package/lib/data/data1d/Spectrum1D/ranges/mapRanges.js +6 -7
  225. package/lib/data/data1d/database.js +45 -28
  226. package/lib/data/data1d/filter1d/apodization.js +2 -1
  227. package/lib/data/data1d/filter1d/fft.js +24 -7
  228. package/lib/data/data1d/filter1d/phaseCorrection.js +11 -5
  229. package/lib/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +1 -1
  230. package/lib/data/data1d/filter1d/zeroFilling.js +1 -1
  231. package/lib/data/data2d/Processing2D.d.ts +3 -3
  232. package/lib/data/data2d/Processing2D.js +10 -20
  233. package/lib/data/data2d/Spectrum2D/contours.d.ts +40 -0
  234. package/lib/data/data2d/Spectrum2D/contours.js +132 -0
  235. package/lib/data/data2d/Spectrum2D/index.d.ts +10 -11
  236. package/lib/data/data2d/Spectrum2D/index.js +10 -11
  237. package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +3 -4
  238. package/lib/data/data2d/Spectrum2D/shift/getShift.js +4 -5
  239. package/lib/data/data2d/Spectrum2D/zones/detectZones.js +11 -8
  240. package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.js +1 -1
  241. package/lib/data/data2d/Spectrum2D/zones/getDetectionZones.js +1 -2
  242. package/lib/data/molecules/MoleculeManager.js +1 -1
  243. package/lib/data/types/common/Source.d.ts +1 -0
  244. package/lib/data/types/data1d/index.d.ts +12 -13
  245. package/lib/data/types/data2d/Data2D.d.ts +2 -0
  246. package/lib/data/types/data2d/Datum2D.d.ts +0 -1
  247. package/lib/data/types/data2d/index.d.ts +8 -9
  248. package/lib/data/utilities/RangeUtilities.js +13 -9
  249. package/lib/data/utilities/ZoneUtilities.js +17 -13
  250. package/lib/data/utilities/calculateSanPlot.d.ts +8 -0
  251. package/lib/data/utilities/calculateSanPlot.js +31 -0
  252. package/lib/data/utilities/checkModifierKeyActivated.js +1 -2
  253. package/lib/data/utilities/generateChar.js +8 -6
  254. package/lib/data/utilities/getAtom.js +1 -1
  255. package/lib/data/utilities/getAtomsFromMF.js +2 -2
  256. package/lib/data/utilities/getColor.js +3 -3
  257. package/lib/data/utilities/getSum.js +6 -3
  258. package/lib/types/NMRiumGeneralPreferences.d.ts +2 -2
  259. package/lib/versionInfo.js +1 -1
  260. package/lib-cjs/component/1d/Chart1D.js +1 -1
  261. package/lib-cjs/component/1d/FooterBanner.js +16 -9
  262. package/lib-cjs/component/1d/LinesSeries.js +1 -1
  263. package/lib-cjs/component/1d/SpectraTracker.js +1 -1
  264. package/lib-cjs/component/1d/Viewer1D.js +1 -1
  265. package/lib-cjs/component/1d/XAxis.js +1 -1
  266. package/lib-cjs/component/1d/database/DatabaseSpectrum.js +2 -1
  267. package/lib-cjs/component/1d/database/ResurrectedDatabaseRanges.js +2 -2
  268. package/lib-cjs/component/1d/{Integral.js → integral/Integral.js} +2 -2
  269. package/lib-cjs/component/1d/integral/IntegralIndicator.js +31 -0
  270. package/lib-cjs/component/1d/integral/IntegralResizable.js +74 -0
  271. package/lib-cjs/component/1d/{IntegralsSeries.js → integral/IntegralsSeries.js} +4 -4
  272. package/lib-cjs/component/1d/multiAnalysis/MultiAnalysisRanges.js +1 -1
  273. package/lib-cjs/component/1d/multiplicityTree/MultiplicityTree.js +4 -4
  274. package/lib-cjs/component/1d/multiplicityTree/buildTreeNode.js +3 -3
  275. package/lib-cjs/component/1d/peaks/PeakAnnotation.js +1 -1
  276. package/lib-cjs/component/1d/peaks/usePeakShapesPath.js +10 -6
  277. package/lib-cjs/component/1d/ranges/Range.js +27 -50
  278. package/lib-cjs/component/1d/tool/PeakPointer.js +1 -1
  279. package/lib-cjs/component/1d/utilities/scale.js +2 -2
  280. package/lib-cjs/component/2d/Contours.js +60 -41
  281. package/lib-cjs/component/2d/FooterBanner.js +2 -2
  282. package/lib-cjs/component/2d/Left1DChart.js +1 -1
  283. package/lib-cjs/component/2d/Top1DChart.js +1 -1
  284. package/lib-cjs/component/2d/Viewer2D.js +11 -14
  285. package/lib-cjs/component/2d/tools/XYLabelPointer.js +2 -2
  286. package/lib-cjs/component/2d/tools/slicing/VerticalSliceChart.js +1 -1
  287. package/lib-cjs/component/2d/zones/IndicationLines.js +5 -8
  288. package/lib-cjs/component/EventsTrackers/BrushTracker.js +30 -21
  289. package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +14 -15
  290. package/lib-cjs/component/NMRium.js +7 -7
  291. package/lib-cjs/component/SplitPaneWrapper.js +1 -1
  292. package/lib-cjs/component/assignment/actions/initAssignment.js +17 -17
  293. package/lib-cjs/component/assignment/index.js +2 -2
  294. package/lib-cjs/component/context/PreferencesContext.js +3 -6
  295. package/lib-cjs/component/elements/Button.js +1 -1
  296. package/lib-cjs/component/elements/CheckBoxCell.js +1 -1
  297. package/lib-cjs/component/elements/ContextMenu.js +2 -2
  298. package/lib-cjs/component/elements/EditableColumn.js +21 -8
  299. package/lib-cjs/component/elements/GroupPane.js +18 -0
  300. package/lib-cjs/component/elements/Input.js +7 -4
  301. package/lib-cjs/component/elements/IsotopesViewer.js +1 -1
  302. package/lib-cjs/component/elements/Label.js +1 -2
  303. package/lib-cjs/component/elements/MolecularFormulaInput.js +2 -0
  304. package/lib-cjs/component/elements/NumberInput.js +2 -2
  305. package/lib-cjs/component/elements/ReactTable/Elements/ReactTableRow.js +1 -1
  306. package/lib-cjs/component/elements/ReactTable/ReactTable.js +71 -37
  307. package/lib-cjs/component/elements/ReactTable/ReactTableFlexLayout.js +2 -2
  308. package/lib-cjs/component/elements/ReactTable/utility/addCustomColumn.js +3 -3
  309. package/lib-cjs/component/elements/ReactTable/utility/useRowSpan.js +3 -7
  310. package/lib-cjs/component/elements/accordion/Accordion.js +2 -2
  311. package/lib-cjs/component/elements/draggble/useDraggable.js +1 -3
  312. package/lib-cjs/component/elements/dropDownButton/DropDownList.js +1 -2
  313. package/lib-cjs/component/elements/formik/FormikCheckBox.js +1 -1
  314. package/lib-cjs/component/elements/formik/FormikColorPicker.js +4 -7
  315. package/lib-cjs/component/elements/formik/FormikErrorsSummary.js +2 -2
  316. package/lib-cjs/component/elements/formik/FormikForm.js +2 -2
  317. package/lib-cjs/component/elements/formik/FormikInput.js +12 -20
  318. package/lib-cjs/component/elements/formik/FormikOnChange.js +13 -10
  319. package/lib-cjs/component/elements/formik/FormikSelect.js +1 -1
  320. package/lib-cjs/component/elements/formik/FormikSlider.js +7 -10
  321. package/lib-cjs/component/elements/formik/FormikTextarea.js +1 -1
  322. package/lib-cjs/component/elements/linearAxis/LinearVerticalAxis.js +2 -2
  323. package/lib-cjs/component/elements/popup/Alert/Provider.js +8 -8
  324. package/lib-cjs/component/elements/popup/Alert/index.js +5 -5
  325. package/lib-cjs/component/elements/popup/Modal/ModalContent.js +3 -1
  326. package/lib-cjs/component/elements/popup/Modal/Provider.js +16 -31
  327. package/lib-cjs/component/elements/popup/Modal/index.js +7 -7
  328. package/lib-cjs/component/header/Header.js +1 -1
  329. package/lib-cjs/component/hooks/useActiveSpectrumStyleOptions.js +1 -1
  330. package/lib-cjs/component/hooks/useCombinedRefs.js +2 -2
  331. package/lib-cjs/component/hooks/useExport.js +14 -11
  332. package/lib-cjs/component/hooks/useFormatNumberByNucleus.js +1 -1
  333. package/lib-cjs/component/hooks/usePanelPreferences.js +9 -7
  334. package/lib-cjs/component/loader/DropZone.js +10 -2
  335. package/lib-cjs/component/modal/AlignSpectraModal.js +1 -1
  336. package/lib-cjs/component/modal/ExportAsMatrixModal.js +2 -2
  337. package/lib-cjs/component/modal/LoadJCAMPModal.js +2 -2
  338. package/lib-cjs/component/modal/MultipleSpectraFiltersModal/index.js +1 -1
  339. package/lib-cjs/component/modal/MultipletAnalysisModal.js +3 -3
  340. package/lib-cjs/component/modal/PredictSpectraModal.js +5 -5
  341. package/lib-cjs/component/modal/editRange/EditRangeModal.js +4 -4
  342. package/lib-cjs/component/modal/editRange/forms/components/SignalFormInfo.js +1 -1
  343. package/lib-cjs/component/modal/editRange/forms/validation/EditRangeValidation.js +2 -2
  344. package/lib-cjs/component/modal/setting/DatabasesTabContent.js +25 -20
  345. package/lib-cjs/component/modal/setting/DisplayTabContent.js +21 -27
  346. package/lib-cjs/component/modal/setting/FormattingTabContent.js +10 -10
  347. package/lib-cjs/component/modal/setting/GeneralSettings.js +11 -14
  348. package/lib-cjs/component/modal/setting/GeneralTabContent.js +3 -1
  349. package/lib-cjs/component/modal/setting/ToolsTabContent.js +18 -19
  350. package/lib-cjs/component/modal/setting/WorkspaceItem.js +37 -49
  351. package/lib-cjs/component/modal/setting/settingsValidation.js +14 -12
  352. package/lib-cjs/component/panels/AutomaticAssignment/useAutoAssignments.js +8 -7
  353. package/lib-cjs/component/panels/InformationPanel.js +51 -55
  354. package/lib-cjs/component/panels/IntegralsPanel/IntegralTable.js +1 -1
  355. package/lib-cjs/component/panels/MoleculesPanel/MoleculeHeader.js +1 -1
  356. package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +4 -4
  357. package/lib-cjs/component/panels/MoleculesPanel/Utilities.js +6 -6
  358. package/lib-cjs/component/panels/MoleculesPanel/useAtomAssignment.js +16 -17
  359. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/ColumnHeader.js +1 -1
  360. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleAnalysisCodeEditor.js +1 -1
  361. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +2 -2
  362. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPreferences.js +18 -17
  363. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +2 -2
  364. package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +1 -1
  365. package/lib-cjs/component/panels/PeaksPanel/PeaksTable.js +2 -2
  366. package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +2 -2
  367. package/lib-cjs/component/panels/RangesPanel/RangesPanel.js +2 -2
  368. package/lib-cjs/component/panels/RangesPanel/RangesTable.js +1 -1
  369. package/lib-cjs/component/panels/RangesPanel/RangesTableRow.js +1 -3
  370. package/lib-cjs/component/panels/RangesPanel/TableColumns/CouplingColumn.js +1 -1
  371. package/lib-cjs/component/panels/RangesPanel/hooks/useEditRangeModal.js +2 -2
  372. package/lib-cjs/component/panels/RangesPanel/hooks/useMapRanges.js +8 -8
  373. package/lib-cjs/component/panels/SpectrumsPanel/SpectrumListItem.js +6 -6
  374. package/lib-cjs/component/panels/SpectrumsPanel/SpectrumListPanel.js +3 -3
  375. package/lib-cjs/component/panels/SpectrumsPanel/SpectrumsTabs.js +6 -6
  376. package/lib-cjs/component/panels/SpectrumsPanel/base/ColorIndicator.js +2 -2
  377. package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum1DSetting.js +2 -1
  378. package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum2DSetting.js +2 -1
  379. package/lib-cjs/component/panels/SpectrumsPanel/base/setting/processSnapPlot.js +2 -25
  380. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +13 -17
  381. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnHeader.js +16 -17
  382. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +20 -21
  383. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +12 -12
  384. package/lib-cjs/component/panels/SummaryPanel/SetShiftTolerancesModal.js +1 -5
  385. package/lib-cjs/component/panels/SummaryPanel/utilities/Utilities.js +105 -94
  386. package/lib-cjs/component/panels/ZonesPanel/ZonesTable.js +8 -8
  387. package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +5 -4
  388. package/lib-cjs/component/panels/databasePanel/DatabaseTable.js +20 -5
  389. package/lib-cjs/component/panels/extra/preferences/ColumnsHelper.js +5 -2
  390. package/lib-cjs/component/panels/extra/utilities/MultiplicityUtilities.js +2 -2
  391. package/lib-cjs/component/panels/filtersPanel/FiltersTable.js +1 -1
  392. package/lib-cjs/component/reducer/IgnoreActions.js +3 -3
  393. package/lib-cjs/component/reducer/Reducer.js +12 -11
  394. package/lib-cjs/component/reducer/actions/CorrelationsActions.js +4 -4
  395. package/lib-cjs/component/reducer/actions/DomainActions.js +52 -69
  396. package/lib-cjs/component/reducer/actions/FiltersActions.js +15 -6
  397. package/lib-cjs/component/reducer/actions/HistoryActions.js +5 -5
  398. package/lib-cjs/component/reducer/actions/IntegralsActions.js +6 -5
  399. package/lib-cjs/component/reducer/actions/LoadActions.js +12 -0
  400. package/lib-cjs/component/reducer/actions/PeaksActions.js +7 -6
  401. package/lib-cjs/component/reducer/actions/PreferencesActions.js +20 -38
  402. package/lib-cjs/component/reducer/actions/RangesActions.js +28 -24
  403. package/lib-cjs/component/reducer/actions/SpectrumsActions.js +12 -5
  404. package/lib-cjs/component/reducer/actions/ToolsActions.js +28 -41
  405. package/lib-cjs/component/reducer/actions/ZonesActions.js +11 -10
  406. package/lib-cjs/component/reducer/core/Constants.js +1 -1
  407. package/lib-cjs/component/reducer/helper/GetClosestNumber.js +2 -1
  408. package/lib-cjs/component/reducer/helper/Zoom1DManager.js +11 -10
  409. package/lib-cjs/component/reducer/helper/getActiveSpectrum.js +8 -0
  410. package/lib-cjs/component/reducer/helper/getSpectrum.js +3 -5
  411. package/lib-cjs/component/reducer/helper/getStrongestPeak.js +2 -3
  412. package/lib-cjs/component/reducer/preferences/actions/removeWorkspace.js +3 -10
  413. package/lib-cjs/component/reducer/preferences/actions/setPreferences.js +5 -9
  414. package/lib-cjs/component/reducer/preferences/utilities/mapNucleiFormatting.js +7 -5
  415. package/lib-cjs/component/tool/BrushX.js +3 -3
  416. package/lib-cjs/component/tool/BrushXY.js +5 -5
  417. package/lib-cjs/component/tool/CrossLinePointer.js +3 -3
  418. package/lib-cjs/component/toolbar/BasicToolBar.js +8 -7
  419. package/lib-cjs/component/utility/Evaluate.js +2 -2
  420. package/lib-cjs/component/utility/FileUtility.js +11 -29
  421. package/lib-cjs/component/utility/GroupByInfoKey.js +11 -13
  422. package/lib-cjs/component/utility/PathBuilder.js +1 -1
  423. package/lib-cjs/component/utility/PreferencesHelper.js +2 -3
  424. package/lib-cjs/component/utility/{Export.js → export.js} +78 -74
  425. package/lib-cjs/component/utility/formatNumber.js +5 -4
  426. package/lib-cjs/component/workspaces/exercise.js +4 -4
  427. package/lib-cjs/component/workspaces/workspaceDefaultProperties.js +1 -1
  428. package/lib-cjs/data/Filters.js +17 -35
  429. package/lib-cjs/data/FiltersManager.js +4 -3
  430. package/lib-cjs/data/PredictionManager.js +8 -10
  431. package/lib-cjs/data/SpectraManager.js +26 -62
  432. package/lib-cjs/data/data1d/MultipleAnalysis.js +74 -70
  433. package/lib-cjs/data/data1d/Spectrum1D/SumManager.js +1 -1
  434. package/lib-cjs/data/data1d/Spectrum1D/generateJGraphData.js +1 -1
  435. package/lib-cjs/data/data1d/Spectrum1D/index.js +25 -25
  436. package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +1 -1
  437. package/lib-cjs/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.js +6 -5
  438. package/lib-cjs/data/data1d/Spectrum1D/integrals/updateRelatives.js +8 -10
  439. package/lib-cjs/data/data1d/Spectrum1D/peaks/lookupPeak.js +1 -1
  440. package/lib-cjs/data/data1d/Spectrum1D/peaks/optimizePeaks.js +2 -2
  441. package/lib-cjs/data/data1d/Spectrum1D/ranges/addRange.js +3 -2
  442. package/lib-cjs/data/data1d/Spectrum1D/ranges/changeRange.js +2 -2
  443. package/lib-cjs/data/data1d/Spectrum1D/ranges/mapRanges.js +6 -7
  444. package/lib-cjs/data/data1d/database.js +45 -28
  445. package/lib-cjs/data/data1d/filter1d/apodization.js +2 -1
  446. package/lib-cjs/data/data1d/filter1d/fft.js +23 -6
  447. package/lib-cjs/data/data1d/filter1d/phaseCorrection.js +10 -4
  448. package/lib-cjs/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +1 -1
  449. package/lib-cjs/data/data1d/filter1d/zeroFilling.js +1 -1
  450. package/lib-cjs/data/data2d/Processing2D.js +10 -20
  451. package/lib-cjs/data/data2d/Spectrum2D/contours.js +138 -0
  452. package/lib-cjs/data/data2d/Spectrum2D/index.js +11 -11
  453. package/lib-cjs/data/data2d/Spectrum2D/initiateDatum2D.js +3 -4
  454. package/lib-cjs/data/data2d/Spectrum2D/shift/getShift.js +4 -5
  455. package/lib-cjs/data/data2d/Spectrum2D/zones/detectZones.js +11 -8
  456. package/lib-cjs/data/data2d/Spectrum2D/zones/detectZonesManual.js +1 -1
  457. package/lib-cjs/data/data2d/Spectrum2D/zones/getDetectionZones.js +1 -2
  458. package/lib-cjs/data/molecules/MoleculeManager.js +1 -1
  459. package/lib-cjs/data/utilities/RangeUtilities.js +13 -9
  460. package/lib-cjs/data/utilities/ZoneUtilities.js +17 -13
  461. package/lib-cjs/data/utilities/calculateSanPlot.js +35 -0
  462. package/lib-cjs/data/utilities/checkModifierKeyActivated.js +1 -2
  463. package/lib-cjs/data/utilities/generateChar.js +8 -6
  464. package/lib-cjs/data/utilities/getAtom.js +1 -1
  465. package/lib-cjs/data/utilities/getAtomsFromMF.js +2 -2
  466. package/lib-cjs/data/utilities/getColor.js +3 -3
  467. package/lib-cjs/data/utilities/getSum.js +6 -3
  468. package/lib-cjs/versionInfo.js +1 -1
  469. package/package.json +36 -31
  470. package/lib/component/1d/IntegralResizable.js +0 -72
  471. package/lib/component/elements/popup/helpers.d.ts +0 -1
  472. package/lib/component/elements/popup/helpers.js +0 -9
  473. package/lib/component/panels/RangesPanel/TableColumns/format.d.ts +0 -1
  474. package/lib/component/panels/RangesPanel/TableColumns/format.js +0 -8
  475. package/lib/data/data1d/Data1DManager.d.ts +0 -3
  476. package/lib/data/data1d/Data1DManager.js +0 -98
  477. package/lib/data/data1d/filter1d/absolute.d.ts +0 -13
  478. package/lib/data/data1d/filter1d/absolute.js +0 -26
  479. package/lib/data/data2d/Data2DManager.d.ts +0 -3
  480. package/lib/data/data2d/Data2DManager.js +0 -34
  481. package/lib/data/types/data2d/Contour.d.ts +0 -4
  482. package/lib/data/types/data2d/Contour.js +0 -1
  483. package/lib/data/types/data2d/Contours.d.ts +0 -2
  484. package/lib/data/types/data2d/Contours.js +0 -1
  485. package/lib-cjs/component/1d/IntegralResizable.js +0 -77
  486. package/lib-cjs/component/elements/popup/helpers.js +0 -13
  487. package/lib-cjs/component/panels/RangesPanel/TableColumns/format.js +0 -14
  488. package/lib-cjs/data/data1d/Data1DManager.js +0 -104
  489. package/lib-cjs/data/data1d/filter1d/absolute.js +0 -32
  490. package/lib-cjs/data/data2d/Data2DManager.js +0 -40
  491. package/lib-cjs/data/types/data2d/Contour.js +0 -2
  492. package/lib-cjs/data/types/data2d/Contours.js +0 -2
@@ -2,10 +2,10 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import FloatMoleculeStructures from '../tool/FloatMoleculeStructures';
3
3
  import ApdoizationLine from './ApodizationLine';
4
4
  import ExclusionZonesAnnotations from './ExclusionZonesAnnotations';
5
- import IntegralsSeries from './IntegralsSeries';
6
5
  import LinesSeries from './LinesSeries';
7
6
  import XAxis from './XAxis';
8
7
  import DatabaseElements from './database/DatabaseElements';
8
+ import IntegralsSeries from './integral/IntegralsSeries';
9
9
  import JGraph from './jCouplingGraph/JGraph';
10
10
  import MultiAnalysisRanges from './multiAnalysis/MultiAnalysisRanges';
11
11
  import PeakAnnotations from './peaks/PeakAnnotations';
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@emotion/reac
2
2
  /** @jsxImportSource @emotion/react */
3
3
  import { css } from '@emotion/react';
4
4
  import { xFindClosestIndex } from 'ml-spectra-processing';
5
- import { useContext, useCallback, Fragment, memo } from 'react';
5
+ import { useContext, Fragment, memo } from 'react';
6
6
  import { BsCursor } from 'react-icons/bs';
7
7
  import { IoPulseSharp } from 'react-icons/io5';
8
8
  import { get1DDataXY } from '../../data/data1d/Spectrum1D/get1DDataXY';
@@ -67,14 +67,6 @@ function FooterBannerInner({ margin, width, height, activeSpectrum, spectrum, ac
67
67
  const { startX, endX, step } = useContext(BrushContext);
68
68
  const { scaleX } = useScaleChecked();
69
69
  const format = useFormatNumberByNucleus(activeTab);
70
- const getYValue = useCallback((xPosition) => {
71
- if (spectrum) {
72
- const data = get1DDataXY(spectrum);
73
- const xIndex = xFindClosestIndex(data.x, scaleX().invert(xPosition));
74
- return data.y[xIndex];
75
- }
76
- return 1;
77
- }, [spectrum, scaleX]);
78
70
  if (!position ||
79
71
  position.y < margin.top ||
80
72
  position.x < margin.left ||
@@ -82,7 +74,22 @@ function FooterBannerInner({ margin, width, height, activeSpectrum, spectrum, ac
82
74
  position.y > height - margin.bottom) {
83
75
  return _jsx("div", { css: styles });
84
76
  }
85
- return (_jsxs("div", { css: styles, children: [_jsx(BsCursor, {}), _jsxs("div", { children: [_jsx("span", { className: "label", children: " \uD835\uDEC5: " }), _jsx("span", { className: "value", children: format(scaleX().invert(position.x)) }), _jsx("span", { className: "unit", children: "ppm" }), activeSpectrum && spectrum?.info?.originFrequency && (_jsxs(_Fragment, { children: [_jsxs("span", { className: "value", children: ["\u00A0(", format(scaleX().invert(position.x) * spectrum?.info?.originFrequency, 'hz')] }), _jsx("span", { className: "unit", children: "Hz" }), _jsx("span", { className: "value", children: ") " })] }))] }), step === 'brushing' && (_jsxs("div", { children: [_jsx("span", { className: "label", children: " \u0394ppm: " }), _jsx("span", { className: "value", children: (scaleX().invert(startX) - scaleX().invert(endX)).toPrecision(6) })] })), activeSpectrum && (_jsxs(Fragment, { children: [spectrum?.info?.originFrequency && step === 'brushing' && (_jsxs("div", { children: [_jsx("span", { className: "label", children: " \u0394Hz: " }), _jsx("span", { className: "value", children: ((scaleX().invert(startX) - scaleX().invert(endX)) *
77
+ function getXIndex(xPosition) {
78
+ if (spectrum) {
79
+ const data = get1DDataXY(spectrum);
80
+ return xFindClosestIndex(data.x, scaleX().invert(xPosition));
81
+ }
82
+ return 0;
83
+ }
84
+ function getYValue(xPosition) {
85
+ if (spectrum) {
86
+ const data = get1DDataXY(spectrum);
87
+ const xIndex = getXIndex(xPosition);
88
+ return data.y[xIndex];
89
+ }
90
+ return 1;
91
+ }
92
+ return (_jsxs("div", { css: styles, children: [_jsx(BsCursor, {}), _jsxs("div", { children: [_jsx("span", { className: "label", children: " \uD835\uDEC5: " }), _jsx("span", { className: "value", children: format(scaleX().invert(position.x)) }), _jsx("span", { className: "unit", children: "ppm" }), activeSpectrum && spectrum?.info?.originFrequency && (_jsxs(_Fragment, { children: [_jsxs("span", { className: "value", children: ["\u00A0(", format(scaleX().invert(position.x) * spectrum?.info?.originFrequency, 'hz')] }), _jsx("span", { className: "unit", children: "Hz" }), _jsx("span", { className: "value", children: ") " }), _jsx("span", { children: "," }), _jsx("span", { className: "label", children: " Index: " }), _jsx("span", { className: "value", children: getXIndex(position.x) })] }))] }), step === 'brushing' && (_jsxs("div", { children: [_jsx("span", { className: "label", children: " \u0394ppm: " }), _jsx("span", { className: "value", children: (scaleX().invert(startX) - scaleX().invert(endX)).toPrecision(6) })] })), activeSpectrum && (_jsxs(Fragment, { children: [spectrum?.info?.originFrequency && step === 'brushing' && (_jsxs("div", { children: [_jsx("span", { className: "label", children: " \u0394Hz: " }), _jsx("span", { className: "value", children: ((scaleX().invert(startX) - scaleX().invert(endX)) *
86
93
  spectrum?.info?.originFrequency).toPrecision(5) })] })), step === 'brushing' && (_jsxs("div", { children: [_jsx("span", { className: "label", children: " ratio :" }), _jsxs("span", { className: "value", children: [((getYValue(startX) / (getYValue(endX) || Number.MIN_VALUE)) *
87
94
  100).toFixed(2), "%"] })] }))] })), activeSpectrum && (_jsxs(Fragment, { children: [_jsx("div", { className: "separator" }), _jsx(IoPulseSharp, {}), _jsxs("div", { children: [_jsx("span", { className: "label", children: "Intensity: " }), _jsx("span", { className: "value yvalue", children: format(getYValue(position.x)) })] })] }))] }));
88
95
  }
@@ -6,7 +6,7 @@ import Line from './Line';
6
6
  function LinesSeries() {
7
7
  const { data, tempData, displayerKey, xDomains } = useChartData();
8
8
  const activeSpectrum = useActiveSpectrum();
9
- let _data = tempData ? tempData : data;
9
+ let _data = tempData || data;
10
10
  return (_jsxs("g", { clipPath: `url(#${displayerKey}clip-chart-1d)`, className: "spectrums", children: [_data
11
11
  ?.filter((d) => d.display.isVisible === true && xDomains[d.id])
12
12
  .map((d, i) => (_jsx("g", { id: d.id, children: _jsx(Line, { display: d.display, id: d.id, data: get1DDataXY(d), index: i }) }, d.id))), activeSpectrum?.id && _jsx("use", { href: `#${activeSpectrum?.id}` })] }));
@@ -57,7 +57,7 @@ function SpectraTracker() {
57
57
  spectrum.info.nucleus === activeTab && (_jsxs("div", { style: { display: 'block' }, children: [_jsx("span", { style: {
58
58
  ...styles.colorIndicator,
59
59
  borderColor: spectrum.display.color,
60
- } }), _jsx(YTracker, { datum: get1DDataXY(spectrum) }), _jsx("span", { style: styles.value, children: spectrum.display.name })] }, spectrum.id)), []));
60
+ } }), _jsx(YTracker, { datum: get1DDataXY(spectrum) }), _jsx("span", { style: styles.value, children: spectrum.display.name })] }, spectrum.id))));
61
61
  }, [activeTab, data, isVisible, xDomains]);
62
62
  if (!isVisible)
63
63
  return null;
@@ -105,7 +105,7 @@ function Viewer1D({ emptyText = undefined }) {
105
105
  });
106
106
  if (!activeSpectrum)
107
107
  break;
108
- const { data: { x }, } = state.data[activeSpectrum.index];
108
+ const { data: { x }, } = data[activeSpectrum.index];
109
109
  const { fromIndex, toIndex } = xGetFromToIndex(x, { from, to });
110
110
  if (toIndex - fromIndex <= MAX_LENGTH) {
111
111
  dispatch({
@@ -39,7 +39,7 @@ function XAxis(props) {
39
39
  const { scaleX } = useScale();
40
40
  const refAxis = useRef(null);
41
41
  const refGrid = useRef(null);
42
- const label = labelProp ? labelProp : mode === 'RTL' ? 'δ [ppm]' : 'time [s]';
42
+ const label = labelProp || (mode === 'RTL' ? 'δ [ppm]' : 'time [s]');
43
43
  useEffect(() => {
44
44
  if (!show || !scaleX)
45
45
  return;
@@ -48,7 +48,8 @@ function DatabaseSpectrum() {
48
48
  setPath(pathBuilder.toString());
49
49
  }
50
50
  }
51
- catch (e) {
51
+ catch (error) {
52
+ reportError(error);
52
53
  alert.error('Failed to Load spectrum');
53
54
  }
54
55
  }, 250));
@@ -39,7 +39,7 @@ function ResurrectedDatabaseRanges() {
39
39
  yDomain[0] = domain[0] < yDomain[0] ? domain[0] : yDomain[0];
40
40
  yDomain[1] = domain[1] > yDomain[1] ? domain[1] : yDomain[1];
41
41
  return { data, from: newForm, to: newTo };
42
- }, []);
42
+ });
43
43
  const scaleY = getYScale({
44
44
  height: blockHight,
45
45
  margin: { top: 0, bottom: 0 },
@@ -54,7 +54,7 @@ function ResurrectedDatabaseRanges() {
54
54
  pathBuilder.lineTo(finalScaleX(x[i]), scaleY(y[i]));
55
55
  }
56
56
  return { path: pathBuilder.toString(), from, to };
57
- }, []);
57
+ });
58
58
  return (_jsx("g", { clipPath: `url(#${displayerKey}clip-chart-1d)`, className: "resurrected-database-ranges", width: "100%", height: "100%", children: paths.map(({ path, from, to }, index) => (
59
59
  // eslint-disable-next-line react/no-array-index-key
60
60
  _jsxs("g", { children: [_jsx("g", { transform: `translate(${scaleX()(to)},0)`, children: _jsx("rect", { x: "0", width: Math.abs(scaleX()(to) - scaleX()(from)), height: "100%", fill: "#ff6f0057" }) }), _jsx("path", { transform: `translate(0,${translateY})`, stroke: color, fill: "none", d: path })] }, `${index}`))) }));
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import useIntegralPath from '../hooks/useIntegralPath';
3
- import { usePanelPreferences } from '../hooks/usePanelPreferences';
2
+ import useIntegralPath from '../../hooks/useIntegralPath';
3
+ import { usePanelPreferences } from '../../hooks/usePanelPreferences';
4
4
  import IntegralResizable from './IntegralResizable';
5
5
  function Integral({ integral, isActive, nucleus }) {
6
6
  const path = useIntegralPath(integral);
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ interface IntegralIndicatorProps {
3
+ value: number | undefined;
4
+ format: string;
5
+ width: number;
6
+ opacity?: number;
7
+ }
8
+ export declare function IntegralIndicator(props: IntegralIndicatorProps): JSX.Element;
9
+ export {};
@@ -0,0 +1,27 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useChartData } from '../../context/ChartContext';
3
+ import { formatNumber } from '../../utility/formatNumber';
4
+ const styles = {
5
+ text: {
6
+ fontSize: '11px',
7
+ textAnchor: 'middle',
8
+ dominantBaseline: 'middle',
9
+ writingMode: 'vertical-rl',
10
+ fill: 'black',
11
+ },
12
+ path: {
13
+ fill: 'none',
14
+ strokeWidth: '1px',
15
+ shapeRendering: 'crispEdges',
16
+ stroke: 'black',
17
+ },
18
+ };
19
+ export function IntegralIndicator(props) {
20
+ const { value, width, format, opacity = 1 } = props;
21
+ const { height, margin } = useChartData();
22
+ const bottom = height - margin.bottom;
23
+ return (_jsxs("g", { style: { transform: `translate(0,${bottom - 10}px) `, opacity }, children: [_jsx("text", { style: {
24
+ ...styles.text,
25
+ transform: `translate(${width / 2}px,-12px) scale(-1)`,
26
+ }, children: value ? formatNumber(value, format) : '' }), _jsx("path", { style: styles.path, d: `M0 0 L0 5 L${width} 5 L${width} 0 ` })] }));
27
+ }
@@ -0,0 +1,69 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
2
+ /** @jsxImportSource @emotion/react */
3
+ import { css } from '@emotion/react';
4
+ import { useChartData } from '../../context/ChartContext';
5
+ import { useDispatch } from '../../context/DispatchContext';
6
+ import { useGlobal } from '../../context/GlobalContext';
7
+ import { useScaleChecked } from '../../context/ScaleContext';
8
+ import Resizer from '../../elements/resizer/Resizer';
9
+ import { HighlightEventSource, useHighlight } from '../../highlight/index';
10
+ import { RESIZE_INTEGRAL } from '../../reducer/types/Types';
11
+ import { options } from '../../toolbar/ToolTypes';
12
+ import { IntegralIndicator } from './IntegralIndicator';
13
+ const stylesOnHover = css `
14
+ pointer-events: bounding-box;
15
+ @-moz-document url-prefix() {
16
+ pointer-events: fill;
17
+ }
18
+ .highlight {
19
+ fill: transparent;
20
+ }
21
+ .target {
22
+ visibility: hidden;
23
+ }
24
+ `;
25
+ const stylesHighlighted = css `
26
+ pointer-events: bounding-box;
27
+
28
+ @-moz-document url-prefix() {
29
+ pointer-events: fill;
30
+ }
31
+ fill: #ff6f0057;
32
+
33
+ .target {
34
+ visibility: visible;
35
+ }
36
+ `;
37
+ function IntegralResizable({ integralData, integralFormat, }) {
38
+ const { height, margin, toolOptions: { selectedTool }, } = useChartData();
39
+ const { viewerRef } = useGlobal();
40
+ const { scaleX } = useScaleChecked();
41
+ const dispatch = useDispatch();
42
+ const { id, integral } = integralData;
43
+ const highlight = useHighlight([id], {
44
+ type: HighlightEventSource.INTEGRAL,
45
+ extra: { id },
46
+ });
47
+ function handleOnStopResizing(position) {
48
+ dispatch({
49
+ type: RESIZE_INTEGRAL,
50
+ payload: {
51
+ data: {
52
+ ...integralData,
53
+ from: scaleX().invert(position.x2),
54
+ to: scaleX().invert(position.x1),
55
+ },
56
+ },
57
+ });
58
+ }
59
+ const from = integralData.from ? scaleX()(integralData.from) : 0;
60
+ const to = integralData.to ? scaleX()(integralData.to) : 0;
61
+ const bottom = height - margin.bottom;
62
+ return (_jsx("g", { onMouseEnter: () => highlight.show(), onMouseLeave: () => highlight.hide(), children: _jsx(Resizer, { tag: "svg", initialPosition: { x1: to, x2: from }, onEnd: handleOnStopResizing, parentElement: viewerRef, disabled: selectedTool !== options.integral.id, children: ({ x1, x2 }, isActive) => {
63
+ const width = x2 - x1;
64
+ return (_jsxs("g", { css: highlight.isActive || isActive
65
+ ? stylesHighlighted
66
+ : stylesOnHover, children: [_jsx("rect", { width: width, height: bottom, className: "highlight", "data-no-export": "true" }), _jsx(IntegralIndicator, { value: integral, format: integralFormat, width: width })] }));
67
+ } }, `${id}_${to}_${from}`) }));
68
+ }
69
+ export default IntegralResizable;
@@ -1,8 +1,8 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useMemo } from 'react';
3
- import { isSpectrum1D } from '../../data/data1d/Spectrum1D';
4
- import { useChartData } from '../context/ChartContext';
5
- import { useActiveSpectrum } from '../reducer/Reducer';
3
+ import { isSpectrum1D } from '../../../data/data1d/Spectrum1D';
4
+ import { useChartData } from '../../context/ChartContext';
5
+ import { useActiveSpectrum } from '../../reducer/Reducer';
6
6
  import Integral from './Integral';
7
7
  function IntegralsSeries() {
8
8
  const { xDomains, data, displayerKey, view: { spectra: { activeTab: nucleus }, }, } = useChartData();
@@ -14,7 +14,7 @@ function IntegralsSeries() {
14
14
  return (_jsx("g", { className: "integrals", children: data?.[0] &&
15
15
  data
16
16
  .filter((d) => d.display.isVisible && xDomains[d.id])
17
- .filter(isSpectrum1D)
17
+ .filter((element) => isSpectrum1D(element))
18
18
  .map((spectrum) => spectrum.integrals.values.map((integral) => (_jsx(Integral, { nucleus: nucleus, integral: integral, isActive: isActive(spectrum.id) }, integral.id)))) }));
19
19
  }, [activeSpectrum, data, nucleus, xDomains]);
20
20
  return _jsx("g", { clipPath: `url(#${displayerKey}clip-chart-1d)`, children: Integrals });
@@ -10,7 +10,7 @@ function MultiAnalysisRangesInner({ activeTab, spectraAnalysis, displayerKey, })
10
10
  return columns;
11
11
  }, [activeTab, spectraAnalysis]);
12
12
  const ranges = useMemo(() => {
13
- return Object.keys(columns).map((key) => key, []);
13
+ return Object.keys(columns).map((key) => key);
14
14
  }, [columns]);
15
15
  if (!ranges || ranges.length === 0) {
16
16
  return null;
@@ -79,13 +79,13 @@ function MultiplicityTree({ rangeFrom, rangeTo, signal, labelOptions = {
79
79
  }, [treeProps.width, width]);
80
80
  const startY = useMemo(() => {
81
81
  let yMax;
82
- spectrumData.data.x.forEach((_x, i) => {
82
+ for (const [i, _x] of spectrumData.data.x.entries()) {
83
83
  if (_x >= rangeFrom &&
84
84
  _x <= rangeTo &&
85
85
  (!yMax || spectrumData.data.re[i] > yMax)) {
86
86
  yMax = spectrumData.data.re[i];
87
87
  }
88
- });
88
+ }
89
89
  return scaleY(spectrumData.id)(yMax) - treeProps.height - 30;
90
90
  }, [
91
91
  spectrumData.data.x,
@@ -113,7 +113,7 @@ function MultiplicityTree({ rangeFrom, rangeTo, signal, labelOptions = {
113
113
  }
114
114
  else {
115
115
  const _xRange = { x1: signal.delta, x2: signal.delta };
116
- treeNodesData.forEach((_treeNodeData) => {
116
+ for (const _treeNodeData of treeNodesData) {
117
117
  if (_treeNodeData.startX < _xRange.x1) {
118
118
  _xRange.x1 = _treeNodeData.startX;
119
119
  }
@@ -126,7 +126,7 @@ function MultiplicityTree({ rangeFrom, rangeTo, signal, labelOptions = {
126
126
  if (_treeNodeData._startX > _xRange.x2) {
127
127
  _xRange.x2 = _treeNodeData._startX;
128
128
  }
129
- });
129
+ }
130
130
  setXRange(_xRange);
131
131
  }
132
132
  }, [
@@ -11,7 +11,7 @@ function createTreeNodes(signal, spectrumData) {
11
11
  }
12
12
  // re-use colors if needed
13
13
  const color = TREE_LEVEL_COLORS[multiplicityIndex % TREE_LEVEL_COLORS.length];
14
- const jIndex = jIndices.findIndex((_jIndex) => _jIndex === multiplicityIndex);
14
+ const jIndex = jIndices.indexOf(multiplicityIndex);
15
15
  const frequency = lodashGet(spectrumData, 'info.originFrequency', 0);
16
16
  const coupling = jIndex >= 0 && frequency > 0 && signal?.js?.[jIndex]
17
17
  ? signal.js[jIndex].coupling / frequency // convert to ppm
@@ -35,7 +35,7 @@ function createTreeNodes(signal, spectrumData) {
35
35
  let _startX = pascal.length % 2 === 0
36
36
  ? startX - (pascal.length / 2) * coupling + coupling / 2 // in case of even number of nodes
37
37
  : startX - (pascal.length / 2 - 0.5) * coupling; // in case of odd number of nodes
38
- pascal.forEach((ratio, k) => {
38
+ for (const [k, ratio] of pascal.entries()) {
39
39
  if (k > 0) {
40
40
  _startX += coupling;
41
41
  }
@@ -48,7 +48,7 @@ function createTreeNodes(signal, spectrumData) {
48
48
  });
49
49
  // go to next multiplet in multiplicity string
50
50
  buildTreeNodesData(multiplicityIndex + 1, jIndices, treeNodesData, _startX);
51
- });
51
+ }
52
52
  }
53
53
  return treeNodesData;
54
54
  }
@@ -70,7 +70,7 @@ value, color, nucleus, }) {
70
70
  const handleKeyDown = useCallback((event) => {
71
71
  if (event.key === 'Enter') {
72
72
  const newValue = event.currentTarget.valueAsNumber;
73
- if (!isNaN(newValue)) {
73
+ if (!Number.isNaN(newValue)) {
74
74
  const shiftValue = newValue - value;
75
75
  handleOnPeakChange({
76
76
  id,
@@ -10,22 +10,26 @@ export function usePeakShapesPath(spectrum) {
10
10
  const frequency = spectrum.info.originFrequency;
11
11
  let pathSeries = null;
12
12
  switch (target) {
13
- case 'peakShape':
14
- pathSeries = peakToXY(options.peak, {
13
+ case 'peakShape': {
14
+ const { peak } = options;
15
+ pathSeries = peakToXY(peak, {
15
16
  frequency,
16
17
  nbPoints: 1024,
17
- from: options.peak.x - (options.peak.width / frequency) * 9,
18
- to: options.peak.x + (options.peak.width / frequency) * 9,
18
+ from: peak.x - (peak.width / frequency) * 9,
19
+ to: peak.x + (peak.width / frequency) * 9,
19
20
  });
20
21
  break;
21
- case 'peaksSum':
22
- pathSeries = peaksToXY(options.peaks, {
22
+ }
23
+ case 'peaksSum': {
24
+ const { peaks } = options;
25
+ pathSeries = peaksToXY(peaks, {
23
26
  frequency,
24
27
  nbPoints: width,
25
28
  from: xDomain[0],
26
29
  to: xDomain[1],
27
30
  });
28
31
  break;
32
+ }
29
33
  default:
30
34
  break;
31
35
  }
@@ -1,7 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
2
2
  /** @jsxImportSource @emotion/react */
3
3
  import { css } from '@emotion/react';
4
- import { useCallback, useState, useEffect } from 'react';
5
4
  import { checkRangeKind } from '../../../data/utilities/RangeUtilities';
6
5
  import { useAssignment, useAssignmentData, } from '../../assignment/AssignmentsContext';
7
6
  import { filterForIDsWithAssignment } from '../../assignment/utilities/filterForIDsWithAssignment';
@@ -12,18 +11,17 @@ import Resizer from '../../elements/resizer/Resizer';
12
11
  import { HighlightEventSource, useHighlight } from '../../highlight';
13
12
  import { RESIZE_RANGE } from '../../reducer/types/Types';
14
13
  import { options } from '../../toolbar/ToolTypes';
15
- import { formatNumber } from '../../utility/formatNumber';
14
+ import { IntegralIndicator } from '../integral/IntegralIndicator';
16
15
  import MultiplicityTree from '../multiplicityTree/MultiplicityTree';
17
16
  const stylesOnHover = css `
18
17
  pointer-events: bounding-box;
19
18
  @-moz-document url-prefix() {
20
19
  pointer-events: fill;
21
20
  }
22
- user-select: 'none';
23
- -webkit-user-select: none; /* Chrome all / Safari all */
24
- -moz-user-select: none; /* Firefox all */
25
-
26
- .delete-button {
21
+ .highlight {
22
+ fill: transparent;
23
+ }
24
+ .target {
27
25
  visibility: hidden;
28
26
  }
29
27
  `;
@@ -33,13 +31,10 @@ const stylesHighlighted = css `
33
31
  @-moz-document url-prefix() {
34
32
  pointer-events: fill;
35
33
  }
36
- .range-area {
37
- height: 100%;
38
- fill: #ff6f0057;
39
- }
40
- .delete-button {
34
+ fill: #ff6f0057;
35
+
36
+ .target {
41
37
  visibility: visible;
42
- cursor: pointer;
43
38
  }
44
39
  `;
45
40
  function Range({ rangeData, showMultiplicityTrees, selectedTool, relativeFormat, }) {
@@ -50,20 +45,8 @@ function Range({ rangeData, showMultiplicityTrees, selectedTool, relativeFormat,
50
45
  const highlightRange = useHighlight([assignmentRange.id].concat(assignmentRange.assigned?.x || []).concat(filterForIDsWithAssignment(assignmentData, signals.map((_signal) => _signal.id))), { type: HighlightEventSource.RANGE, extra: { id } });
51
46
  const { scaleX } = useScaleChecked();
52
47
  const dispatch = useDispatch();
53
- const [reduceOpacity, setReduceOpacity] = useState(false);
54
- const [isBlockedByEditing, setIsBlockedByEditing] = useState(false);
55
- useEffect(() => {
56
- if (selectedTool && selectedTool === options.editRange.id) {
57
- setIsBlockedByEditing(true);
58
- }
59
- else {
60
- setIsBlockedByEditing(false);
61
- }
62
- }, [selectedTool]);
63
- useEffect(() => {
64
- setReduceOpacity(!checkRangeKind(rangeData));
65
- }, [rangeData]);
66
- const handleOnStopResizing = useCallback((position) => {
48
+ const isBlockedByEditing = selectedTool && selectedTool === options.editRange.id;
49
+ function handleOnStopResizing(position) {
67
50
  dispatch({
68
51
  type: RESIZE_RANGE,
69
52
  data: {
@@ -72,40 +55,34 @@ function Range({ rangeData, showMultiplicityTrees, selectedTool, relativeFormat,
72
55
  to: scaleX().invert(position.x1),
73
56
  },
74
57
  });
75
- }, [dispatch, rangeData, scaleX]);
76
- const mouseEnterHandler = useCallback(() => {
58
+ }
59
+ function mouseEnterHandler() {
77
60
  assignmentRange.show('x');
78
61
  highlightRange.show();
79
- }, [assignmentRange, highlightRange]);
80
- const mouseLeaveHandler = useCallback(() => {
62
+ }
63
+ function mouseLeaveHandler() {
81
64
  assignmentRange.hide();
82
65
  highlightRange.hide();
83
- }, [assignmentRange, highlightRange]);
84
- const assignHandler = useCallback((e) => {
66
+ }
67
+ function assignHandler(e) {
85
68
  if (selectedTool === options.rangePicking.id &&
86
69
  e.shiftKey &&
87
70
  !isBlockedByEditing) {
88
71
  assignmentRange.setActive('x');
89
72
  }
90
- }, [assignmentRange, isBlockedByEditing, selectedTool]);
73
+ }
91
74
  const from = scaleX()(rangeData.from);
92
75
  const to = scaleX()(rangeData.to);
93
- return (_jsxs("g", { "data-test-id": "range", style: { outline: 'none' }, onMouseEnter: mouseEnterHandler, onMouseLeave: mouseLeaveHandler, onClick: assignHandler, children: [_jsx(Resizer, { tag: "svg", initialPosition: { x1: to, x2: from }, onEnd: handleOnStopResizing, parentElement: viewerRef, disabled: selectedTool !== options.rangePicking.id, children: ({ x1, x2 }, isActive) => (_jsxs("g", { transform: `translate(0,10)`, css: isBlockedByEditing ||
94
- highlightRange.isActive ||
95
- assignmentRange.isActive ||
96
- isActive
97
- ? stylesHighlighted
98
- : stylesOnHover, children: [_jsx("rect", { x: "0", width: x2 - x1, height: "6", className: "range-area", fill: "green", fillOpacity: !reduceOpacity ||
99
- highlightRange.isActive ||
100
- assignmentRange.isActive
101
- ? 1
102
- : 0.4 }), _jsx("text", { textAnchor: "middle", x: (x2 - x1) / 2, y: "20", fontSize: "10", fill: "red", fillOpacity: !reduceOpacity ||
103
- highlightRange.isActive ||
104
- assignmentRange.isActive
105
- ? 1
106
- : 0.6, children: integration !== undefined
107
- ? formatNumber(integration, relativeFormat)
108
- : '' })] })) }, `${id}_${to}_${from}`), showMultiplicityTrees &&
76
+ const isNotSignal = !checkRangeKind(rangeData);
77
+ return (_jsxs("g", { "data-test-id": "range", style: { outline: 'none' }, onMouseEnter: mouseEnterHandler, onMouseLeave: mouseLeaveHandler, onClick: assignHandler, children: [_jsx(Resizer, { tag: "svg", initialPosition: { x1: to, x2: from }, onEnd: handleOnStopResizing, parentElement: viewerRef, disabled: selectedTool !== options.rangePicking.id, children: ({ x1, x2 }, isActive) => {
78
+ const width = x2 - x1;
79
+ return (_jsxs("g", { css: isBlockedByEditing ||
80
+ highlightRange.isActive ||
81
+ assignmentRange.isActive ||
82
+ isActive
83
+ ? stylesHighlighted
84
+ : stylesOnHover, children: [_jsx("rect", { width: width, height: "100%", className: "highlight", "data-no-export": "true" }), _jsx(IntegralIndicator, { value: integration, format: relativeFormat, width: width, opacity: isNotSignal ? 0.5 : 1 })] }));
85
+ } }, `${id}_${to}_${from}`), showMultiplicityTrees &&
109
86
  signals &&
110
87
  signals.length > 0 &&
111
88
  signals.map((_signal) => (_jsx(MultiplicityTree, { rangeFrom: rangeData.from, rangeTo: rangeData.to, signal: _signal }, _signal.id)))] }, id));
@@ -50,7 +50,7 @@ function PeakPointer() {
50
50
  const yDataRange = datum.y.slice(minIndex, maxIndex);
51
51
  if (yDataRange && yDataRange.length > 0) {
52
52
  const yValue = max(yDataRange);
53
- const xIndex = yDataRange.findIndex((value) => value === yValue);
53
+ const xIndex = yDataRange.indexOf(yValue);
54
54
  const xValue = datum.x[minIndex + xIndex];
55
55
  return {
56
56
  x: scaleX()(xValue),
@@ -9,8 +9,8 @@ function getXScale(state, spectrumId = null) {
9
9
  function getYScale(state, spectrumId = null) {
10
10
  const { height, margin, verticalAlign, yDomain, yDomains } = state;
11
11
  const _height = verticalAlign.align === 'center'
12
- ? (height - 30) / 2
13
- : height - margin.bottom - 30;
12
+ ? (height - 40) / 2
13
+ : height - margin.bottom - 40;
14
14
  let domainY = [];
15
15
  if (spectrumId === null || yDomains[spectrumId] === undefined) {
16
16
  domainY = [0, yDomain[1]];