nmrium 0.37.0 → 0.38.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 (371) hide show
  1. package/lib/component/1d/FooterBanner.js +1 -1
  2. package/lib/component/1d/Viewer1D.js +26 -21
  3. package/lib/component/1d/integral/Integral.d.ts +2 -6
  4. package/lib/component/1d/integral/IntegralResizable.d.ts +2 -6
  5. package/lib/component/1d/integral/IntegralResizable.js +2 -3
  6. package/lib/component/1d/multiAnalysis/MultiAnalysisRanges.js +1 -1
  7. package/lib/component/1d/multiplicityTree/MultiplicityTree.js +7 -9
  8. package/lib/component/1d/peaks/PeakAnnotation.js +1 -2
  9. package/lib/component/1d/ranges/Range.js +9 -8
  10. package/lib/component/1d/ranges/Ranges.js +5 -7
  11. package/lib/component/1d/tool/BaseLineZones.js +1 -2
  12. package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.js +4 -5
  13. package/lib/component/1d-2d/components/FloatMoleculeStructures/index.js +13 -17
  14. package/lib/component/2d/1d-tracer/Left1DChart.js +1 -1
  15. package/lib/component/2d/1d-tracer/VerticalSliceChart.js +1 -1
  16. package/lib/component/2d/Chart2D.js +1 -1
  17. package/lib/component/2d/Viewer2D.js +10 -9
  18. package/lib/component/2d/fid/FidCanvas.js +4 -6
  19. package/lib/component/2d/ft/Contours.js +1 -1
  20. package/lib/component/2d/utilities/DimensionLayout.d.ts +9 -24
  21. package/lib/component/2d/utilities/scale.d.ts +2 -1
  22. package/lib/component/2d/utilities/scale.js +1 -1
  23. package/lib/component/2d/zones/Zones.js +1 -1
  24. package/lib/component/EventsTrackers/KeysListenerTracker.js +28 -21
  25. package/lib/component/NMRium.js +15 -7
  26. package/lib/component/assignment/AssignmentsReducer.d.ts +1 -1
  27. package/lib/component/context/DispatchContext.d.ts +23 -3
  28. package/lib/component/context/DispatchContext.js +1 -1
  29. package/lib/component/context/LoggerContext.js +1 -1
  30. package/lib/component/elements/Button.js +7 -9
  31. package/lib/component/elements/IsotopesViewer.js +1 -1
  32. package/lib/component/elements/ReactTable/ReactTable.js +1 -2
  33. package/lib/component/elements/formik/FormikCheckBox.js +1 -1
  34. package/lib/component/elements/formik/FormikColorInput.js +1 -1
  35. package/lib/component/elements/formik/FormikColorPicker.js +1 -1
  36. package/lib/component/elements/formik/FormikColumnFormatField.js +1 -1
  37. package/lib/component/elements/formik/FormikInput.js +1 -1
  38. package/lib/component/elements/formik/FormikSelect.js +2 -2
  39. package/lib/component/elements/formik/FormikSlider.js +1 -1
  40. package/lib/component/elements/formik/FormikTextarea.js +2 -2
  41. package/lib/component/header/ApodizationOptionsPanel.js +4 -5
  42. package/lib/component/header/AutoPeakPickingOptionPanel.js +1 -2
  43. package/lib/component/header/BaseLineCorrectionPanel.js +4 -5
  44. package/lib/component/header/Header.js +4 -6
  45. package/lib/component/header/PhaseCorrectionPanel.js +7 -8
  46. package/lib/component/header/RangesPickingOptionPanel.js +1 -2
  47. package/lib/component/header/ZeroFillingOptionsPanel.js +3 -11
  48. package/lib/component/header/Zones2DOptionPanel.js +5 -6
  49. package/lib/component/hooks/useExport.js +1 -0
  50. package/lib/component/hooks/useToolsFunctions.js +8 -10
  51. package/lib/component/loader/DropZone.js +4 -5
  52. package/lib/component/loader/NoData.js +1 -1
  53. package/lib/component/modal/AlignSpectraModal.js +1 -2
  54. package/lib/component/modal/EditPeakShapeModal.js +1 -2
  55. package/lib/component/modal/ImportPublicationStringModal.js +1 -2
  56. package/lib/component/modal/LoadJCAMPModal.js +2 -3
  57. package/lib/component/modal/MoleculeStructureEditorModal.js +24 -19
  58. package/lib/component/modal/PredictSpectraModal.js +24 -21
  59. package/lib/component/modal/changeSum/SelectMolecule.js +1 -1
  60. package/lib/component/modal/editRange/EditRangeModal.js +3 -4
  61. package/lib/component/modal/editRange/forms/components/AddSignalFormTab.js +2 -2
  62. package/lib/component/modal/editRange/forms/components/CouplingsTable.js +1 -1
  63. package/lib/component/modal/metaImportation/MetaImportationModal.js +2 -3
  64. package/lib/component/modal/setting/settings-tabs/DatabasesTabContent.js +4 -4
  65. package/lib/component/modal/setting/settings-tabs/FormattingTabContent.js +2 -2
  66. package/lib/component/modal/setting/settings-tabs/InfoBlockTabContent.js +2 -2
  67. package/lib/component/panels/AutomaticAssignment/AutomaticAssignmentTable.js +1 -2
  68. package/lib/component/panels/AutomaticAssignment/useAutoAssignments.js +7 -6
  69. package/lib/component/panels/InformationPanel.js +6 -6
  70. package/lib/component/panels/IntegralsPanel/IntegralPanel.js +11 -20
  71. package/lib/component/panels/IntegralsPanel/IntegralTable.js +10 -10
  72. package/lib/component/panels/MatrixGenerationPanel/ExclusionsZonesTable.js +1 -1
  73. package/lib/component/panels/MatrixGenerationPanel/FiltersOptions.js +4 -4
  74. package/lib/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +1 -2
  75. package/lib/component/panels/MoleculesPanel/MoleculeHeader.js +1 -2
  76. package/lib/component/panels/MoleculesPanel/MoleculePanel.js +10 -13
  77. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +4 -5
  78. package/lib/component/panels/MoleculesPanel/Utilities.d.ts +4 -1
  79. package/lib/component/panels/MoleculesPanel/Utilities.js +2 -2
  80. package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +8 -9
  81. package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +3 -4
  82. package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +1 -2
  83. package/lib/component/panels/MultipleSpectraAnalysisPanel/preferences/AnalysisTablePreferences.js +2 -2
  84. package/lib/component/panels/MultipleSpectraAnalysisPanel/preferences/LegendsPreferences.js +2 -2
  85. package/lib/component/panels/MultipleSpectraAnalysisPanel/preferences/MultipleAnalysisCodeEditor.js +1 -1
  86. package/lib/component/panels/Panels.js +1 -1
  87. package/lib/component/panels/PeaksPanel/PeaksPanel.js +4 -5
  88. package/lib/component/panels/PeaksPanel/PeaksTable.js +4 -5
  89. package/lib/component/panels/RangesPanel/RangesHeader.js +12 -15
  90. package/lib/component/panels/RangesPanel/RangesPanel.js +24 -29
  91. package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +1 -1
  92. package/lib/component/panels/RangesPanel/TableColumns/RelativeColumn.js +3 -3
  93. package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.js +1 -2
  94. package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.d.ts +1 -1
  95. package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.js +16 -14
  96. package/lib/component/panels/SpectrumsPanel/SpectraPanelHeader.js +16 -16
  97. package/lib/component/panels/SpectrumsPanel/SpectraTable.js +7 -5
  98. package/lib/component/panels/SpectrumsPanel/SpectrumsTabs.js +4 -5
  99. package/lib/component/panels/SpectrumsPanel/base/ShowHideSpectrumButton.js +3 -7
  100. package/lib/component/panels/SpectrumsPanel/base/setting/SpectrumSetting.js +4 -2
  101. package/lib/component/panels/SpectrumsPanel/base/setting/processSnapPlot.js +2 -2
  102. package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +4 -8
  103. package/lib/component/panels/SummaryPanel/SummaryPanel.js +39 -34
  104. package/lib/component/panels/SummaryPanel/utilities/Utilities.js +1 -1
  105. package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.d.ts +2 -13
  106. package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +22 -20
  107. package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumn.d.ts +2 -2
  108. package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumn.js +1 -1
  109. package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumns.d.ts +2 -2
  110. package/lib/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.d.ts +2 -2
  111. package/lib/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.js +6 -7
  112. package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.d.ts +2 -2
  113. package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.js +1 -1
  114. package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumns.d.ts +2 -2
  115. package/lib/component/panels/ZonesPanel/ZonesPanel.js +15 -18
  116. package/lib/component/panels/ZonesPanel/ZonesTable.js +2 -51
  117. package/lib/component/panels/ZonesPanel/ZonesTableRow.d.ts +3 -3
  118. package/lib/component/panels/ZonesPanel/hooks/useMapZones.d.ts +16 -0
  119. package/lib/component/panels/ZonesPanel/hooks/useMapZones.js +52 -0
  120. package/lib/component/panels/databasePanel/DatabasePanel.js +9 -7
  121. package/lib/component/panels/filtersPanel/FilterPanel.js +1 -2
  122. package/lib/component/panels/filtersPanel/FiltersTable.js +8 -9
  123. package/lib/component/panels/header/DefaultPanelHeader.js +1 -1
  124. package/lib/component/panels/header/SpectraAutomaticPickingButton.js +2 -3
  125. package/lib/component/panels/predictionPanel/PredictionPanel.js +4 -5
  126. package/lib/component/reducer/IgnoreActions.d.ts +2 -1
  127. package/lib/component/reducer/IgnoreActions.js +35 -32
  128. package/lib/component/reducer/Reducer.d.ts +8 -5
  129. package/lib/component/reducer/Reducer.js +199 -221
  130. package/lib/component/reducer/actions/AssignmentsActions.d.ts +7 -6
  131. package/lib/component/reducer/actions/AssignmentsActions.js +2 -2
  132. package/lib/component/reducer/actions/CorrelationsActions.d.ts +21 -13
  133. package/lib/component/reducer/actions/CorrelationsActions.js +25 -20
  134. package/lib/component/reducer/actions/DatabaseActions.d.ts +15 -2
  135. package/lib/component/reducer/actions/DatabaseActions.js +5 -2
  136. package/lib/component/reducer/actions/DimensionsActions.d.ts +8 -3
  137. package/lib/component/reducer/actions/DimensionsActions.js +3 -5
  138. package/lib/component/reducer/actions/DomainActions.d.ts +11 -5
  139. package/lib/component/reducer/actions/DomainActions.js +13 -19
  140. package/lib/component/reducer/actions/FiltersActions.d.ts +70 -23
  141. package/lib/component/reducer/actions/FiltersActions.js +250 -255
  142. package/lib/component/reducer/actions/GlobalActions.d.ts +7 -2
  143. package/lib/component/reducer/actions/GlobalActions.js +3 -3
  144. package/lib/component/reducer/actions/IntegralsActions.d.ts +28 -7
  145. package/lib/component/reducer/actions/IntegralsActions.js +16 -15
  146. package/lib/component/reducer/actions/LoadActions.d.ts +23 -5
  147. package/lib/component/reducer/actions/LoadActions.js +52 -52
  148. package/lib/component/reducer/actions/MoleculeActions.d.ts +38 -9
  149. package/lib/component/reducer/actions/MoleculeActions.js +27 -18
  150. package/lib/component/reducer/actions/PeaksActions.d.ts +39 -8
  151. package/lib/component/reducer/actions/PeaksActions.js +19 -11
  152. package/lib/component/reducer/actions/PreferencesActions.d.ts +8 -3
  153. package/lib/component/reducer/actions/PreferencesActions.js +5 -3
  154. package/lib/component/reducer/actions/RangesActions.d.ts +85 -18
  155. package/lib/component/reducer/actions/RangesActions.js +80 -65
  156. package/lib/component/reducer/actions/SpectraAnalysisAction.d.ts +7 -1
  157. package/lib/component/reducer/actions/SpectrumsActions.d.ts +57 -24
  158. package/lib/component/reducer/actions/SpectrumsActions.js +69 -60
  159. package/lib/component/reducer/actions/ToolsActions.d.ts +59 -21
  160. package/lib/component/reducer/actions/ToolsActions.js +54 -32
  161. package/lib/component/reducer/actions/ZonesActions.d.ts +79 -15
  162. package/lib/component/reducer/actions/ZonesActions.js +68 -49
  163. package/lib/component/reducer/helper/Zoom1DManager.d.ts +6 -5
  164. package/lib/component/reducer/helper/Zoom1DManager.js +1 -1
  165. package/lib/component/reducer/helper/ZoomHistoryManager.js +2 -2
  166. package/lib/component/reducer/helper/get2DRange.d.ts +7 -1
  167. package/lib/component/reducer/preferences/preferencesReducer.d.ts +1 -1
  168. package/lib/component/reducer/types/ActionType.d.ts +6 -0
  169. package/lib/component/reducer/types/ActionType.js +1 -0
  170. package/lib/component/toolbar/BasicToolBar.js +6 -9
  171. package/lib/component/toolbar/FunctionToolBar.js +4 -9
  172. package/lib/component/toolbar/ToolBar.js +1 -1
  173. package/lib/component/toolbar/ToolTypes.d.ts +2 -2
  174. package/lib/component/utility/Events.d.ts +4 -4
  175. package/lib/component/utility/Events.js +2 -2
  176. package/lib/component/utility/GroupByInfoKey.js +1 -1
  177. package/lib/component/utility/getSpectraObjectPaths.js +1 -1
  178. package/lib/data/PredictionManager.d.ts +5 -8
  179. package/lib/data/PredictionManager.js +3 -3
  180. package/lib/data/data1d/Spectrum1D/getSpectrumErrorValue.js +1 -1
  181. package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +1 -1
  182. package/lib/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.d.ts +2 -3
  183. package/lib/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.js +5 -4
  184. package/lib/data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges.d.ts +5 -3
  185. package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.d.ts +1 -35
  186. package/lib/data/data1d/Spectrum1D/ranges/mapRanges.d.ts +2 -35
  187. package/lib/data/data1d/filter1d/baselineCorrection.d.ts +7 -10
  188. package/lib/data/data1d/multipleSpectraAnalysis.d.ts +1 -1
  189. package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +1 -1
  190. package/lib/data/data2d/Spectrum2D/zones/changeZoneSignal.d.ts +5 -1
  191. package/lib/data/data2d/Spectrum2D/zones/changeZoneSignal.js +6 -8
  192. package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.d.ts +2 -0
  193. package/lib/data/data2d/Spectrum2D/zones/initiateZones.d.ts +2 -0
  194. package/lib/data/data2d/Spectrum2D/zones/mapZones.d.ts +2 -0
  195. package/lib/data/matrixGeneration.js +4 -2
  196. package/lib/data/molecules/Molecule.d.ts +3 -3
  197. package/lib/data/molecules/MoleculeManager.d.ts +5 -5
  198. package/lib/data/molecules/MoleculeManager.js +1 -1
  199. package/lib/data/utilities/generateColor.js +1 -1
  200. package/lib/data/utilities/isNumber.d.ts +1 -0
  201. package/lib/data/utilities/isNumber.js +3 -0
  202. package/lib/versionInfo.js +1 -1
  203. package/lib-cjs/component/1d/FooterBanner.js +1 -1
  204. package/lib-cjs/component/1d/Viewer1D.js +25 -20
  205. package/lib-cjs/component/1d/integral/IntegralResizable.js +2 -3
  206. package/lib-cjs/component/1d/multiAnalysis/MultiAnalysisRanges.js +1 -1
  207. package/lib-cjs/component/1d/multiplicityTree/MultiplicityTree.js +7 -9
  208. package/lib-cjs/component/1d/peaks/PeakAnnotation.js +1 -2
  209. package/lib-cjs/component/1d/ranges/Range.js +9 -8
  210. package/lib-cjs/component/1d/ranges/Ranges.js +5 -7
  211. package/lib-cjs/component/1d/tool/BaseLineZones.js +1 -2
  212. package/lib-cjs/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.js +4 -5
  213. package/lib-cjs/component/1d-2d/components/FloatMoleculeStructures/index.js +13 -17
  214. package/lib-cjs/component/2d/1d-tracer/Left1DChart.js +1 -1
  215. package/lib-cjs/component/2d/1d-tracer/VerticalSliceChart.js +1 -1
  216. package/lib-cjs/component/2d/Chart2D.js +1 -1
  217. package/lib-cjs/component/2d/Viewer2D.js +10 -9
  218. package/lib-cjs/component/2d/fid/FidCanvas.js +4 -6
  219. package/lib-cjs/component/2d/ft/Contours.js +1 -1
  220. package/lib-cjs/component/2d/utilities/scale.js +1 -1
  221. package/lib-cjs/component/2d/zones/Zones.js +1 -1
  222. package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +28 -21
  223. package/lib-cjs/component/NMRium.js +15 -7
  224. package/lib-cjs/component/context/DispatchContext.js +1 -1
  225. package/lib-cjs/component/context/LoggerContext.js +1 -1
  226. package/lib-cjs/component/elements/Button.js +7 -9
  227. package/lib-cjs/component/elements/IsotopesViewer.js +1 -1
  228. package/lib-cjs/component/elements/ReactTable/ReactTable.js +1 -2
  229. package/lib-cjs/component/elements/Tab/Tabs.js +1 -1
  230. package/lib-cjs/component/elements/formik/FormikCheckBox.js +1 -1
  231. package/lib-cjs/component/elements/formik/FormikColorInput.js +1 -1
  232. package/lib-cjs/component/elements/formik/FormikColorPicker.js +1 -1
  233. package/lib-cjs/component/elements/formik/FormikColumnFormatField.js +1 -1
  234. package/lib-cjs/component/elements/formik/FormikInput.js +1 -1
  235. package/lib-cjs/component/elements/formik/FormikSelect.js +2 -2
  236. package/lib-cjs/component/elements/formik/FormikSlider.js +1 -1
  237. package/lib-cjs/component/elements/formik/FormikTextarea.js +2 -2
  238. package/lib-cjs/component/header/ApodizationOptionsPanel.js +3 -4
  239. package/lib-cjs/component/header/AutoPeakPickingOptionPanel.js +1 -2
  240. package/lib-cjs/component/header/BaseLineCorrectionPanel.js +4 -5
  241. package/lib-cjs/component/header/Header.js +4 -6
  242. package/lib-cjs/component/header/PhaseCorrectionPanel.js +7 -8
  243. package/lib-cjs/component/header/RangesPickingOptionPanel.js +1 -2
  244. package/lib-cjs/component/header/ZeroFillingOptionsPanel.js +3 -11
  245. package/lib-cjs/component/header/Zones2DOptionPanel.js +5 -6
  246. package/lib-cjs/component/highlight/index.js +1 -1
  247. package/lib-cjs/component/hooks/useExport.js +1 -0
  248. package/lib-cjs/component/hooks/useTableSortBy.js +1 -1
  249. package/lib-cjs/component/hooks/useToolsFunctions.js +8 -10
  250. package/lib-cjs/component/hooks/useXYReduce.js +1 -1
  251. package/lib-cjs/component/loader/DropZone.js +4 -5
  252. package/lib-cjs/component/loader/NoData.js +1 -1
  253. package/lib-cjs/component/modal/AlignSpectraModal.js +1 -2
  254. package/lib-cjs/component/modal/EditPeakShapeModal.js +1 -2
  255. package/lib-cjs/component/modal/ImportPublicationStringModal.js +1 -2
  256. package/lib-cjs/component/modal/LoadJCAMPModal.js +2 -3
  257. package/lib-cjs/component/modal/MoleculeStructureEditorModal.js +24 -19
  258. package/lib-cjs/component/modal/PredictSpectraModal.js +24 -21
  259. package/lib-cjs/component/modal/changeSum/SelectMolecule.js +1 -1
  260. package/lib-cjs/component/modal/editRange/EditRangeModal.js +3 -4
  261. package/lib-cjs/component/modal/editRange/forms/components/AddSignalFormTab.js +2 -2
  262. package/lib-cjs/component/modal/editRange/forms/components/CouplingsTable.js +1 -1
  263. package/lib-cjs/component/modal/metaImportation/MetaImportationModal.js +2 -3
  264. package/lib-cjs/component/modal/setting/settings-tabs/DatabasesTabContent.js +4 -4
  265. package/lib-cjs/component/modal/setting/settings-tabs/FormattingTabContent.js +2 -2
  266. package/lib-cjs/component/modal/setting/settings-tabs/InfoBlockTabContent.js +2 -2
  267. package/lib-cjs/component/panels/AutomaticAssignment/AutomaticAssignmentTable.js +1 -2
  268. package/lib-cjs/component/panels/AutomaticAssignment/useAutoAssignments.js +7 -6
  269. package/lib-cjs/component/panels/InformationPanel.js +6 -6
  270. package/lib-cjs/component/panels/IntegralsPanel/IntegralPanel.js +11 -20
  271. package/lib-cjs/component/panels/IntegralsPanel/IntegralTable.js +10 -10
  272. package/lib-cjs/component/panels/MatrixGenerationPanel/ExclusionsZonesTable.js +1 -1
  273. package/lib-cjs/component/panels/MatrixGenerationPanel/FiltersOptions.js +4 -4
  274. package/lib-cjs/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +1 -2
  275. package/lib-cjs/component/panels/MoleculesPanel/MoleculeHeader.js +1 -2
  276. package/lib-cjs/component/panels/MoleculesPanel/MoleculePanel.js +10 -13
  277. package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +4 -5
  278. package/lib-cjs/component/panels/MoleculesPanel/Utilities.js +2 -2
  279. package/lib-cjs/component/panels/MoleculesPanel/useAtomAssignment.js +8 -9
  280. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +3 -4
  281. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +1 -2
  282. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/preferences/AnalysisTablePreferences.js +2 -2
  283. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/preferences/LegendsPreferences.js +2 -2
  284. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/preferences/MultipleAnalysisCodeEditor.js +1 -1
  285. package/lib-cjs/component/panels/Panels.js +1 -1
  286. package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +4 -5
  287. package/lib-cjs/component/panels/PeaksPanel/PeaksTable.js +4 -5
  288. package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +12 -15
  289. package/lib-cjs/component/panels/RangesPanel/RangesPanel.js +24 -29
  290. package/lib-cjs/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +1 -1
  291. package/lib-cjs/component/panels/RangesPanel/TableColumns/RelativeColumn.js +3 -3
  292. package/lib-cjs/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.js +1 -2
  293. package/lib-cjs/component/panels/RangesPanel/hooks/useEditRangeModal.js +16 -14
  294. package/lib-cjs/component/panels/SpectrumsPanel/SpectraPanelHeader.js +16 -16
  295. package/lib-cjs/component/panels/SpectrumsPanel/SpectraTable.js +7 -5
  296. package/lib-cjs/component/panels/SpectrumsPanel/SpectrumsTabs.js +4 -5
  297. package/lib-cjs/component/panels/SpectrumsPanel/base/ShowHideSpectrumButton.js +3 -7
  298. package/lib-cjs/component/panels/SpectrumsPanel/base/setting/SpectrumSetting.js +4 -2
  299. package/lib-cjs/component/panels/SpectrumsPanel/base/setting/processSnapPlot.js +2 -2
  300. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +4 -8
  301. package/lib-cjs/component/panels/SummaryPanel/SummaryPanel.js +39 -34
  302. package/lib-cjs/component/panels/SummaryPanel/utilities/Utilities.js +1 -1
  303. package/lib-cjs/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +22 -20
  304. package/lib-cjs/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumn.js +1 -1
  305. package/lib-cjs/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.js +6 -7
  306. package/lib-cjs/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.js +1 -1
  307. package/lib-cjs/component/panels/ZonesPanel/ZonesPanel.js +15 -18
  308. package/lib-cjs/component/panels/ZonesPanel/ZonesTable.js +2 -51
  309. package/lib-cjs/component/panels/ZonesPanel/hooks/useMapZones.js +56 -0
  310. package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +8 -6
  311. package/lib-cjs/component/panels/filtersPanel/FilterPanel.js +1 -2
  312. package/lib-cjs/component/panels/filtersPanel/FiltersTable.js +8 -9
  313. package/lib-cjs/component/panels/header/DefaultPanelHeader.js +1 -1
  314. package/lib-cjs/component/panels/header/SpectraAutomaticPickingButton.js +2 -3
  315. package/lib-cjs/component/panels/predictionPanel/PredictionPanel.js +4 -5
  316. package/lib-cjs/component/reducer/IgnoreActions.js +35 -55
  317. package/lib-cjs/component/reducer/Reducer.js +199 -221
  318. package/lib-cjs/component/reducer/actions/AssignmentsActions.js +3 -3
  319. package/lib-cjs/component/reducer/actions/CorrelationsActions.js +23 -18
  320. package/lib-cjs/component/reducer/actions/DatabaseActions.js +4 -1
  321. package/lib-cjs/component/reducer/actions/DimensionsActions.js +3 -6
  322. package/lib-cjs/component/reducer/actions/DomainActions.js +15 -23
  323. package/lib-cjs/component/reducer/actions/FiltersActions.js +267 -272
  324. package/lib-cjs/component/reducer/actions/GlobalActions.js +4 -4
  325. package/lib-cjs/component/reducer/actions/IntegralsActions.js +19 -18
  326. package/lib-cjs/component/reducer/actions/LoadActions.js +55 -55
  327. package/lib-cjs/component/reducer/actions/MoleculeActions.js +31 -22
  328. package/lib-cjs/component/reducer/actions/PeaksActions.js +23 -15
  329. package/lib-cjs/component/reducer/actions/PreferencesActions.js +7 -5
  330. package/lib-cjs/component/reducer/actions/RangesActions.js +81 -64
  331. package/lib-cjs/component/reducer/actions/SpectrumsActions.js +77 -67
  332. package/lib-cjs/component/reducer/actions/ToolsActions.js +54 -31
  333. package/lib-cjs/component/reducer/actions/ZonesActions.js +73 -52
  334. package/lib-cjs/component/reducer/core/Constants.js +1 -1
  335. package/lib-cjs/component/reducer/helper/Zoom1DManager.js +2 -2
  336. package/lib-cjs/component/reducer/helper/ZoomHistoryManager.js +2 -2
  337. package/lib-cjs/component/reducer/types/ActionType.js +2 -0
  338. package/lib-cjs/component/toolbar/BasicToolBar.js +6 -9
  339. package/lib-cjs/component/toolbar/FunctionToolBar.js +4 -9
  340. package/lib-cjs/component/toolbar/ToolBar.js +1 -1
  341. package/lib-cjs/component/utility/GroupByInfoKey.js +1 -1
  342. package/lib-cjs/component/utility/getSpectraObjectPaths.js +1 -1
  343. package/lib-cjs/data/PredictionManager.js +3 -3
  344. package/lib-cjs/data/SpectraManager.js +1 -1
  345. package/lib-cjs/data/data1d/Spectrum1D/getSpectrumErrorValue.js +1 -1
  346. package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +1 -1
  347. package/lib-cjs/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.js +5 -4
  348. package/lib-cjs/data/data1d/multipleSpectraAnalysis.js +2 -2
  349. package/lib-cjs/data/data2d/Spectrum2D/initiateDatum2D.js +1 -1
  350. package/lib-cjs/data/data2d/Spectrum2D/zones/changeZoneSignal.js +6 -8
  351. package/lib-cjs/data/matrixGeneration.js +4 -2
  352. package/lib-cjs/data/molecules/MoleculeManager.js +1 -1
  353. package/lib-cjs/data/utilities/generateColor.js +1 -1
  354. package/lib-cjs/data/utilities/isNumber.js +7 -0
  355. package/lib-cjs/versionInfo.js +1 -1
  356. package/package.json +24 -23
  357. package/lib/component/reducer/actions/HistoryActions.d.ts +0 -4
  358. package/lib/component/reducer/actions/HistoryActions.js +0 -40
  359. package/lib/component/reducer/types/HistoryTypes.d.ts +0 -4
  360. package/lib/component/reducer/types/HistoryTypes.js +0 -4
  361. package/lib/component/reducer/types/Types.d.ts +0 -132
  362. package/lib/component/reducer/types/Types.js +0 -126
  363. package/lib/component/toolbar/HistoryToolBar.d.ts +0 -8
  364. package/lib/component/toolbar/HistoryToolBar.js +0 -30
  365. package/lib/data/utilities/isMolFileEmpty.d.ts +0 -1
  366. package/lib/data/utilities/isMolFileEmpty.js +0 -6
  367. package/lib-cjs/component/reducer/actions/HistoryActions.js +0 -45
  368. package/lib-cjs/component/reducer/types/HistoryTypes.js +0 -7
  369. package/lib-cjs/component/reducer/types/Types.js +0 -131
  370. package/lib-cjs/component/toolbar/HistoryToolBar.js +0 -35
  371. package/lib-cjs/data/utilities/isMolFileEmpty.js +0 -10
@@ -111,5 +111,5 @@ export default function FooterBanner() {
111
111
  const { margin, width, height, view: { spectra: { activeTab }, }, } = useChartData();
112
112
  const activeSpectrum = useActiveSpectrum();
113
113
  const spectrum = useSpectrum(null);
114
- return (_jsx(MemoizedFooterBanner, { ...{ margin, width, height, activeSpectrum, spectrum, activeTab } }));
114
+ return (_jsx(MemoizedFooterBanner, { margin, width, height, activeSpectrum, spectrum, activeTab }));
115
115
  }
@@ -18,10 +18,9 @@ import { useActiveSpectrum } from '../hooks/useActiveSpectrum';
18
18
  import { useVerticalAlign } from '../hooks/useVerticalAlign';
19
19
  import Spinner from '../loader/Spinner';
20
20
  import MultipletAnalysisModal from '../modal/MultipletAnalysisModal';
21
- import { ZoomType } from '../reducer/helper/Zoom1DManager';
21
+ import { ZOOM_TYPES } from '../reducer/helper/Zoom1DManager';
22
22
  import getRange from '../reducer/helper/getRange';
23
23
  import scaleReducer, { scaleInitialState, SET_SCALE, } from '../reducer/scaleReducer';
24
- import { ADD_INTEGRAL, ADD_PEAKS, ADD_BASE_LINE_ZONE, BRUSH_END, FULL_ZOOM_OUT, SET_ZOOM, ADD_PEAK, SET_VERTICAL_INDICATOR_X_POSITION, ADD_RANGE, ADD_EXCLUSION_ZONE, } from '../reducer/types/Types';
25
24
  import { options } from '../toolbar/ToolTypes';
26
25
  import Events from '../utility/Events';
27
26
  import Chart1D from './Chart1D';
@@ -97,8 +96,8 @@ function Viewer1D({ emptyText = undefined }) {
97
96
  switch (selectedTool) {
98
97
  case options.integral.id:
99
98
  dispatch({
100
- type: ADD_INTEGRAL,
101
- ...brushData,
99
+ type: 'ADD_INTEGRAL',
100
+ payload: brushData,
102
101
  });
103
102
  break;
104
103
  case options.rangePicking.id: {
@@ -112,10 +111,8 @@ function Viewer1D({ emptyText = undefined }) {
112
111
  const { fromIndex, toIndex } = xGetFromToIndex(x, { from, to });
113
112
  if (toIndex - fromIndex <= MAX_LENGTH) {
114
113
  dispatch({
115
- type: ADD_RANGE,
116
- payload: {
117
- ...brushData,
118
- },
114
+ type: 'ADD_RANGE',
115
+ payload: brushData,
119
116
  });
120
117
  }
121
118
  else {
@@ -140,20 +137,23 @@ function Viewer1D({ emptyText = undefined }) {
140
137
  break;
141
138
  case options.peakPicking.id:
142
139
  dispatch({
143
- type: ADD_PEAKS,
144
- ...brushData,
140
+ type: 'ADD_PEAKS',
141
+ payload: brushData,
145
142
  });
146
143
  break;
147
144
  case options.baselineCorrection.id:
148
145
  dispatch({
149
- type: ADD_BASE_LINE_ZONE,
150
- zone: { from: brushData.startX, to: brushData.endX },
146
+ type: 'ADD_BASE_LINE_ZONE',
147
+ payload: {
148
+ startX: brushData.startX,
149
+ endX: brushData.endX,
150
+ },
151
151
  });
152
152
  break;
153
153
  case options.exclusionZones.id:
154
154
  dispatch({
155
- type: ADD_EXCLUSION_ZONE,
156
- payload: { from: brushData.startX, to: brushData.endX },
155
+ type: 'ADD_EXCLUSION_ZONE',
156
+ payload: { startX: brushData.startX, endX: brushData.endX },
157
157
  });
158
158
  break;
159
159
  case options.matrixGenerationExclusionZones.id: {
@@ -180,7 +180,7 @@ function Viewer1D({ emptyText = undefined }) {
180
180
  switch (selectedTool) {
181
181
  default:
182
182
  if (selectedTool != null) {
183
- dispatch({ type: BRUSH_END, ...brushData });
183
+ dispatch({ type: 'BRUSH_END', payload: brushData });
184
184
  }
185
185
  break;
186
186
  }
@@ -199,10 +199,13 @@ function Viewer1D({ emptyText = undefined }) {
199
199
  alert,
200
200
  ]);
201
201
  const handelOnDoubleClick = useCallback(() => {
202
- dispatch({ type: FULL_ZOOM_OUT, zoomType: ZoomType.STEP_HORIZONTAL });
202
+ dispatch({
203
+ type: 'FULL_ZOOM_OUT',
204
+ payload: { zoomType: ZOOM_TYPES.STEP_HORIZONTAL },
205
+ });
203
206
  }, [dispatch]);
204
207
  const handleZoom = useCallback((event) => {
205
- dispatch({ type: SET_ZOOM, event, selectedTool });
208
+ dispatch({ type: 'SET_ZOOM', payload: { event, selectedTool } });
206
209
  }, [dispatch, selectedTool]);
207
210
  const mouseClick = useCallback((position) => {
208
211
  const propagateEvent = () => {
@@ -218,8 +221,8 @@ function Viewer1D({ emptyText = undefined }) {
218
221
  switch (selectedTool) {
219
222
  case options.peakPicking.id:
220
223
  dispatch({
221
- type: ADD_PEAK,
222
- mouseCoordinates: position,
224
+ type: 'ADD_PEAK',
225
+ payload: position,
223
226
  });
224
227
  break;
225
228
  case options.editRange.id:
@@ -233,8 +236,10 @@ function Viewer1D({ emptyText = undefined }) {
233
236
  switch (selectedTool) {
234
237
  case options.phaseCorrection.id:
235
238
  dispatch({
236
- type: SET_VERTICAL_INDICATOR_X_POSITION,
237
- position: position.x,
239
+ type: 'SET_VERTICAL_INDICATOR_X_POSITION',
240
+ payload: {
241
+ position: position.x,
242
+ },
238
243
  });
239
244
  break;
240
245
  default:
@@ -1,10 +1,6 @@
1
+ import { Integral as IntegralType } from 'nmr-load-save';
1
2
  interface IntegralProps {
2
- integral: {
3
- id: string;
4
- from: number;
5
- to: number;
6
- integral?: number;
7
- };
3
+ integral: IntegralType;
8
4
  isActive: boolean;
9
5
  nucleus: string;
10
6
  }
@@ -1,10 +1,6 @@
1
+ import { Integral } from 'nmr-load-save';
1
2
  interface IntegralResizableProps {
2
- integralData: {
3
- id: string;
4
- from: number;
5
- to: number;
6
- integral?: number;
7
- };
3
+ integralData: Integral;
8
4
  integralFormat: string;
9
5
  }
10
6
  declare function IntegralResizable({ integralData, integralFormat, }: IntegralResizableProps): import("@emotion/react/jsx-runtime").JSX.Element;
@@ -7,7 +7,6 @@ import { useGlobal } from '../../context/GlobalContext';
7
7
  import { useScaleChecked } from '../../context/ScaleContext';
8
8
  import Resizer from '../../elements/resizer/Resizer';
9
9
  import { HighlightEventSource, useHighlight } from '../../highlight/index';
10
- import { RESIZE_INTEGRAL } from '../../reducer/types/Types';
11
10
  import { options } from '../../toolbar/ToolTypes';
12
11
  import { IntegralIndicator } from './IntegralIndicator';
13
12
  const stylesOnHover = css `
@@ -50,9 +49,9 @@ function IntegralResizable({ integralData, integralFormat, }) {
50
49
  });
51
50
  function handleOnStopResizing(position) {
52
51
  dispatch({
53
- type: RESIZE_INTEGRAL,
52
+ type: 'RESIZE_INTEGRAL',
54
53
  payload: {
55
- data: {
54
+ integral: {
56
55
  ...integralData,
57
56
  from: scaleX().invert(position.x2),
58
57
  to: scaleX().invert(position.x1),
@@ -16,5 +16,5 @@ export default function MultiAnalysisRanges() {
16
16
  const { view: { spectra: { activeTab }, }, displayerKey, } = useChartData();
17
17
  const multipleSpectraAnalysis = usePanelPreferences('multipleSpectraAnalysis', activeTab);
18
18
  const columns = multipleSpectraAnalysis.analysisOptions.columns;
19
- return (_jsx(MemoizedMultiAnalysisRanges, { ...{ columns, displayerKey, activeTab } }));
19
+ return (_jsx(MemoizedMultiAnalysisRanges, { columns, displayerKey, activeTab }));
20
20
  }
@@ -53,15 +53,13 @@ function InnerMultiplicityTree({ labelOptions, onUnlink, data, width: widthProp,
53
53
  onUnlink(index);
54
54
  }
55
55
  const isHighlighted = highlight.isActive || assignment.isActive;
56
- return (_jsxs("g", { style: isHighlighted ? { ...styles, opacity: 1, strokeWidth: 1.5 } : styles, ...{
57
- onMouseEnter: () => {
58
- assignment.show('x');
59
- highlight.show();
60
- },
61
- onMouseLeave: () => {
62
- assignment.hide();
63
- highlight.hide();
64
- },
56
+ return (_jsxs("g", { style: isHighlighted ? { ...styles, opacity: 1, strokeWidth: 1.5 } : styles, onMouseEnter: () => {
57
+ assignment.show('x');
58
+ highlight.show();
59
+ },
60
+ onMouseLeave: () => {
61
+ assignment.hide();
62
+ highlight.hide();
65
63
  }, pointerEvents: "bounding-box", ...(!assignment.isActive && { css: cssStyle }), children: [drawTree(data, { scaleX, labelOptions, showLabels }), _jsx("rect", { x: startX - BOX_PADDING, y: startY - BOX_PADDING, width: width + BOX_PADDING * 2, height: height + BOX_PADDING * 2, fill: isHighlighted ? '#ff6f0057' : 'transparent', "data-no-export": "true" }), _jsx(AssignmentActionsButtons, { className: "signal-target", isActive: !!(assignment.isActive || signal?.diaIDs), y: startY, x: scaleX()(signal.delta) - 30, onAssign: assignHandler, onUnAssign: unAssignHandler, borderRadius: 16 })] }));
66
64
  }
67
65
  export function MultiplicityTree(props) {
@@ -5,7 +5,6 @@ import { useRef, useState, useCallback, useLayoutEffect, useEffect, useMemo, } f
5
5
  import { useDispatch } from '../../context/DispatchContext';
6
6
  import { HighlightEventSource, useHighlight } from '../../highlight';
7
7
  import { usePanelPreferences } from '../../hooks/usePanelPreferences';
8
- import { SHIFT_SPECTRUM } from '../../reducer/types/Types';
9
8
  import { formatNumber } from '../../utility/formatNumber';
10
9
  const styles = css `
11
10
  input {
@@ -53,7 +52,7 @@ value, color, nucleus, }) {
53
52
  extra: { id },
54
53
  });
55
54
  const dispatch = useDispatch();
56
- const handleOnPeakChange = useCallback((e) => dispatch({ type: SHIFT_SPECTRUM, shiftValue: e.shiftValue }), [dispatch]);
55
+ const handleOnPeakChange = useCallback((e) => dispatch({ type: 'SHIFT_SPECTRUM', payload: { shift: e.shiftValue } }), [dispatch]);
57
56
  useLayoutEffect(() => {
58
57
  const textBox = refText.current?.getBBox();
59
58
  setContainerSize({
@@ -10,7 +10,6 @@ import { useGlobal } from '../../context/GlobalContext';
10
10
  import { useScaleChecked } from '../../context/ScaleContext';
11
11
  import Resizer from '../../elements/resizer/Resizer';
12
12
  import { HighlightEventSource, useHighlight } from '../../highlight';
13
- import { RESIZE_RANGE, UNLINK_RANGE } from '../../reducer/types/Types';
14
13
  import { options } from '../../toolbar/ToolTypes';
15
14
  import { IntegralIndicator } from '../integral/IntegralIndicator';
16
15
  import { MultiplicityTree } from '../multiplicityTree/MultiplicityTree';
@@ -37,11 +36,13 @@ function Range({ range, showMultiplicityTrees, selectedTool, relativeFormat, })
37
36
  const isBlockedByEditing = selectedTool && selectedTool === options.editRange.id;
38
37
  function handleOnStopResizing(position) {
39
38
  dispatch({
40
- type: RESIZE_RANGE,
41
- data: {
42
- ...range,
43
- from: scaleX().invert(position.x2),
44
- to: scaleX().invert(position.x1),
39
+ type: 'RESIZE_RANGE',
40
+ payload: {
41
+ range: {
42
+ ...range,
43
+ from: scaleX().invert(position.x2),
44
+ to: scaleX().invert(position.x1),
45
+ },
45
46
  },
46
47
  });
47
48
  }
@@ -55,9 +56,9 @@ function Range({ range, showMultiplicityTrees, selectedTool, relativeFormat, })
55
56
  }
56
57
  function unAssignHandler(signalIndex = -1) {
57
58
  dispatch({
58
- type: UNLINK_RANGE,
59
+ type: 'UNLINK_RANGE',
59
60
  payload: {
60
- rangeData: range,
61
+ range,
61
62
  assignmentData,
62
63
  signalIndex,
63
64
  },
@@ -23,11 +23,9 @@ export default function Ranges() {
23
23
  if (!spectrum?.display?.isVisible) {
24
24
  return null;
25
25
  }
26
- return (_jsx(MemoizedRanges, { ranges: spectrum.ranges, ...{
27
- showMultiplicityTrees,
28
- showRangesIntegrals,
29
- selectedTool,
30
- displayerKey,
31
- relativeFormat: rangesPreferences.relative.format,
32
- } }));
26
+ return (_jsx(MemoizedRanges, { ranges: spectrum.ranges, showMultiplicityTrees,
27
+ showRangesIntegrals,
28
+ selectedTool,
29
+ displayerKey,
30
+ relativeFormat: rangesPreferences.relative.format }));
33
31
  }
@@ -5,7 +5,6 @@ import { useChartData } from '../../context/ChartContext';
5
5
  import { useDispatch } from '../../context/DispatchContext';
6
6
  import { useScaleChecked } from '../../context/ScaleContext';
7
7
  import DeleteButton from '../../elements/DeleteButton';
8
- import { DELETE_BASE_LINE_ZONE } from '../../reducer/types/Types';
9
8
  const styles = css `
10
9
  pointer-events: bounding-box;
11
10
  user-select: 'none';
@@ -31,7 +30,7 @@ function BaseLineZones() {
31
30
  const { scaleX } = useScaleChecked();
32
31
  const dispatch = useDispatch();
33
32
  const deleteRangeHandler = (id) => {
34
- dispatch({ type: DELETE_BASE_LINE_ZONE, id });
33
+ dispatch({ type: 'DELETE_BASE_LINE_ZONE', payload: { id } });
35
34
  };
36
35
  const baseLineZones = toolOptions.data.baselineCorrection.zones;
37
36
  return (_jsx(_Fragment, { children: baseLineZones.length > 0 && (_jsx("g", { children: baseLineZones.map((zone) => (_jsxs("g", { transform: `translate(${scaleX()(zone.to)},0)`, css: styles, children: [_jsx(DeleteButton, { x: -20, y: 10, onDelete: () => deleteRangeHandler(zone.id) }), _jsx("rect", { x: "0", width: `${scaleX()(zone.from) - scaleX()(zone.to)}`, className: "zone-area" })] }, zone.id))) })) }));
@@ -9,7 +9,6 @@ import { useDispatch } from '../../../context/DispatchContext';
9
9
  import { useGlobal } from '../../../context/GlobalContext';
10
10
  import { useMoleculeEditor } from '../../../modal/MoleculeStructureEditorModal';
11
11
  import useAtomAssignment from '../../../panels/MoleculesPanel/useAtomAssignment';
12
- import { CHANGE_FLOAT_MOLECULE_POSITION, FLOAT_MOLECULE_OVER_SPECTRUM, SET_MOLECULE, } from '../../../reducer/types/Types';
13
12
  import ActionsButton from './ActionsButton';
14
13
  const style = css `
15
14
  border: 1px solid transparent;
@@ -40,7 +39,7 @@ export function DraggableStructure(props) {
40
39
  const { currentDiaIDsToHighlight, handleOnAtomHover, handleOnClickAtom, assignedDiaIDsMerged, } = useAtomAssignment({ zones, ranges, activeTab, displayerMode });
41
40
  function floatMoleculeHandler() {
42
41
  dispatch({
43
- type: FLOAT_MOLECULE_OVER_SPECTRUM,
42
+ type: 'FLOAT_MOLECULE_OVER_SPECTRUM',
44
43
  payload: { id: molecule.id },
45
44
  });
46
45
  }
@@ -52,8 +51,8 @@ export function DraggableStructure(props) {
52
51
  bounding.height += height;
53
52
  }
54
53
  dispatch({
55
- type: CHANGE_FLOAT_MOLECULE_POSITION,
56
- payload: { id: molecule.id, bounding },
54
+ type: 'CHANGE_FLOAT_MOLECULE_POSITION',
55
+ payload: { id: molecule.id, bounding: bounding },
57
56
  });
58
57
  }
59
58
  if (!viewerRef)
@@ -65,7 +64,7 @@ export function DraggableStructure(props) {
65
64
  ? currentDiaIDsToHighlight
66
65
  : assignedDiaIDsMerged, setHoverAtom: handleOnAtomHover, setMolfile: (molfile) => {
67
66
  dispatch({
68
- type: SET_MOLECULE,
67
+ type: 'SET_MOLECULE',
69
68
  payload: {
70
69
  molfile,
71
70
  id: molecule.id,
@@ -14,15 +14,13 @@ export function FloatMoleculeStructuresInner(props) {
14
14
  .map(([id, moleculeView], index) => {
15
15
  const molecule = molecules.find((m) => m.id === id);
16
16
  assert(molecule !== undefined, 'molecule should be defined');
17
- return (_jsx(DraggableStructure, { ...{
18
- zones,
19
- ranges,
20
- activeTab,
21
- displayerMode,
22
- moleculeView,
23
- molecule,
24
- index,
25
- } }, id));
17
+ return (_jsx(DraggableStructure, { zones,
18
+ ranges,
19
+ activeTab,
20
+ displayerMode,
21
+ moleculeView,
22
+ molecule,
23
+ index }, id));
26
24
  }) }));
27
25
  }
28
26
  const MemoizedFloatMoleculeStructures = memo(FloatMoleculeStructuresInner);
@@ -32,12 +30,10 @@ export default function FloatMoleculeStructures() {
32
30
  const data = useSpectrum(emptyData);
33
31
  const ranges = data?.ranges || {};
34
32
  const zones = data?.zones || {};
35
- return (_jsx(MemoizedFloatMoleculeStructures, { ...{
36
- moleculesView,
37
- molecules,
38
- displayerMode,
39
- activeTab,
40
- ranges,
41
- zones,
42
- } }));
33
+ return (_jsx(MemoizedFloatMoleculeStructures, { moleculesView,
34
+ molecules,
35
+ displayerMode,
36
+ activeTab,
37
+ ranges,
38
+ zones }));
43
39
  }
@@ -19,7 +19,7 @@ function Left1DChart({ margin: marginValue = 10, data: spectrum, }) {
19
19
  const { x, re: y } = spectrum.data;
20
20
  const pathPoints = xyReduce({ x, y });
21
21
  const pathBuilder = new PathBuilder();
22
- pathBuilder.moveTo(scaleY(pathPoints.y[pathPoints.y.length - 1]), scaleX(pathPoints.x.length - 1));
22
+ pathBuilder.moveTo(scaleY(pathPoints.y.at(-1)), scaleX(pathPoints.x.at(-1)));
23
23
  for (let i = pathPoints.x.length - 2; i >= 0; i--) {
24
24
  pathBuilder.lineTo(scaleY(pathPoints.y[i]), scaleX(pathPoints.x[i]));
25
25
  }
@@ -16,7 +16,7 @@ function VerticalSliceChart({ margin: marginValue = 10, data, reverseScale = fal
16
16
  const scaleY = getYScale(height, y, marginValue);
17
17
  const pathPoints = xyReduce({ x, y });
18
18
  const pathBuilder = new PathBuilder();
19
- pathBuilder.moveTo(scaleY(pathPoints.y[pathPoints.y.length - 1]), scaleX(pathPoints.x.length - 1));
19
+ pathBuilder.moveTo(scaleY(pathPoints.y.at(-1)), scaleX(pathPoints.x.at(-1)));
20
20
  for (let i = pathPoints.x.length - 2; i >= 0; i--) {
21
21
  pathBuilder.lineTo(scaleY(pathPoints.y[i]), scaleX(pathPoints.x[i]));
22
22
  }
@@ -16,5 +16,5 @@ const MemoizedChart2D = memo(chart2DInner);
16
16
  export default function Chart2D({ spectra }) {
17
17
  const { width, height, margin, displayerKey } = useChartData();
18
18
  const { current: { general: { spectraRendering }, }, } = usePreferences();
19
- return (_jsx(MemoizedChart2D, { ...{ spectra, width, height, margin, displayerKey, spectraRendering } }));
19
+ return (_jsx(MemoizedChart2D, { spectra, width, height, margin, displayerKey, spectraRendering }));
20
20
  }
@@ -8,7 +8,6 @@ import { MouseTracker } from '../EventsTrackers/MouseTracker';
8
8
  import { useChartData } from '../context/ChartContext';
9
9
  import { useDispatch } from '../context/DispatchContext';
10
10
  import Spinner from '../loader/Spinner';
11
- import { BRUSH_END, FULL_ZOOM_OUT, SET_DIMENSIONS, SET_2D_LEVEL, SET_ZOOM, ADD_2D_ZONE, } from '../reducer/types/Types';
12
11
  import { options } from '../toolbar/ToolTypes';
13
12
  import { assert } from '../utility/assert';
14
13
  import Chart2D from './Chart2D';
@@ -46,7 +45,7 @@ function Viewer2D({ emptyText = undefined }) {
46
45
  else if (brushData.shiftKey) {
47
46
  switch (selectedTool) {
48
47
  case options.zonePicking.id:
49
- dispatch({ type: ADD_2D_ZONE, ...brushData });
48
+ dispatch({ type: 'ADD_2D_ZONE', payload: brushData });
50
49
  break;
51
50
  default:
52
51
  break;
@@ -57,9 +56,11 @@ function Viewer2D({ emptyText = undefined }) {
57
56
  default:
58
57
  if (selectedTool != null) {
59
58
  return dispatch({
60
- type: BRUSH_END,
61
- ...brushData,
62
- trackID: getLayoutID(DIMENSION, brushData),
59
+ type: 'BRUSH_END',
60
+ payload: {
61
+ ...brushData,
62
+ trackID: getLayoutID(DIMENSION, brushData),
63
+ },
63
64
  });
64
65
  }
65
66
  }
@@ -70,7 +71,7 @@ function Viewer2D({ emptyText = undefined }) {
70
71
  const { x: startX, y: startY } = e;
71
72
  const trackID = getLayoutID(DIMENSION, { startX, startY });
72
73
  if (trackID) {
73
- dispatch({ type: FULL_ZOOM_OUT, trackID });
74
+ dispatch({ type: 'FULL_ZOOM_OUT', payload: { trackID } });
74
75
  }
75
76
  }, [DIMENSION, dispatch]);
76
77
  const handleZoom = (event) => {
@@ -78,10 +79,10 @@ function Viewer2D({ emptyText = undefined }) {
78
79
  const trackID = getLayoutID(DIMENSION, { startX, startY });
79
80
  if (trackID) {
80
81
  if (trackID === 'CENTER_2D') {
81
- dispatch({ type: SET_2D_LEVEL, ...event });
82
+ dispatch({ type: 'SET_2D_LEVEL', payload: event });
82
83
  }
83
84
  else {
84
- dispatch({ type: SET_ZOOM, event, trackID });
85
+ dispatch({ type: 'SET_ZOOM', payload: { event, trackID } });
85
86
  }
86
87
  }
87
88
  };
@@ -105,7 +106,7 @@ export function ViewerResponsiveWrapper(props) {
105
106
  const dispatch = useDispatch();
106
107
  const { width, height, children } = props;
107
108
  useEffect(() => {
108
- dispatch({ type: SET_DIMENSIONS, width, height });
109
+ dispatch({ type: 'SET_DIMENSIONS', payload: { width, height } });
109
110
  }, [width, height, dispatch]);
110
111
  return children;
111
112
  }
@@ -67,12 +67,10 @@ export function FidCanvas() {
67
67
  return null;
68
68
  const w = Math.max(canvasWidth, imageData.width);
69
69
  const h = Math.max(canvasHeight, imageData.height);
70
- return (_jsx("foreignObject", { ...{
71
- width: canvasWidth,
72
- height: canvasHeight,
73
- x: `${left}`,
74
- y: `${top}`,
75
- }, children: _jsx("canvas", { ref: canvasRef, ...{ width: w, height: h }, style: {
70
+ return (_jsx("foreignObject", { width: canvasWidth,
71
+ height: canvasHeight,
72
+ x: `${left}`,
73
+ y: `${top}`, children: _jsx("canvas", { ref: canvasRef, width: w, height: h, style: {
76
74
  backgroundColor: 'white',
77
75
  } }) }));
78
76
  }
@@ -71,5 +71,5 @@ export default function Contours() {
71
71
  const spectra2d = useMemo(() => {
72
72
  return getSpectraByNucleus(activeTab, spectra).filter((datum) => datum.info.isFt);
73
73
  }, [activeTab, spectra]);
74
- return _jsx(MemoizedContours, { ...{ spectra: spectra2d, displayerKey } });
74
+ return _jsx(MemoizedContours, { spectra: spectra2d, displayerKey });
75
75
  }
@@ -1,8 +1,9 @@
1
1
  declare const LAYOUT: {
2
- TOP_1D: string;
3
- LEFT_1D: string;
4
- CENTER_2D: string;
2
+ readonly TOP_1D: "TOP_1D";
3
+ readonly LEFT_1D: "LEFT_1D";
4
+ readonly CENTER_2D: "CENTER_2D";
5
5
  };
6
+ type Layout = keyof typeof LAYOUT;
6
7
  interface MarginProps {
7
8
  top: number;
8
9
  left: number;
@@ -39,25 +40,9 @@ interface StartEndProps {
39
40
  startY: number;
40
41
  endY?: number;
41
42
  }
42
- interface DimensionType {
43
- CENTER_2D: {
44
- startX: number;
45
- startY: number;
46
- endX: number;
47
- endY: number;
48
- };
49
- TOP_1D: {
50
- startX: number;
51
- startY: number;
52
- endX: number;
53
- endY: number;
54
- };
55
- LEFT_1D: {
56
- startX: number;
57
- startY: number;
58
- endX: number;
59
- endY: number;
60
- };
61
- }
62
- declare function getLayoutID(dimension: DimensionType, brushData: StartEndProps): string | null;
43
+ type DimensionType = {
44
+ [key in Layout]: Required<StartEndProps>;
45
+ };
46
+ declare function getLayoutID(dimension: DimensionType, brushData: StartEndProps): Layout | null;
63
47
  export { LAYOUT, get2DDimensionLayout, getLayoutID };
48
+ export type { Layout };
@@ -1,3 +1,4 @@
1
+ import { Layout } from './DimensionLayout';
1
2
  declare function get2DXScale(props: {
2
3
  width: number;
3
4
  margin: {
@@ -30,6 +31,6 @@ interface LeftLayout {
30
31
  };
31
32
  yDomain: Array<number>;
32
33
  }
33
- declare function get1DXScale(props: TopLayout | LeftLayout, layout: string): import("d3-scale").ScaleLinear<number, number, never> | undefined;
34
+ declare function get1DXScale(props: TopLayout | LeftLayout, layout: Layout): import("d3-scale").ScaleLinear<number, number, never> | undefined;
34
35
  declare function get1DYScale(yDomain: Array<number>, height: number, margin?: number): import("d3-scale").ScaleLinear<number, number, never>;
35
36
  export { get2DXScale, get2DYScale, get1DXScale, get1DYScale };
@@ -14,7 +14,7 @@ function get2DYScale(props, reverse = false) {
14
14
  : [margin.top, height - margin.bottom]);
15
15
  }
16
16
  function get1DXScale(props, layout) {
17
- if (![LAYOUT.TOP_1D, LAYOUT.LEFT_1D].includes(layout)) {
17
+ if (!['TOP_1D', 'LEFT_1D'].includes(layout)) {
18
18
  throw new Error(`layout is required and must be ${LAYOUT.TOP_1D} or ${LAYOUT.LEFT_1D} `);
19
19
  }
20
20
  switch (layout) {
@@ -21,5 +21,5 @@ export default function Zones() {
21
21
  peaks: showPeaks,
22
22
  };
23
23
  }, [id, zoneState]);
24
- return _jsx(MemoizedZones, { ...{ zones, display, displayerKey, isVisible } });
24
+ return _jsx(MemoizedZones, { zones, display, displayerKey, isVisible });
25
25
  }