react-cheminfo 0.69.0 → 0.71.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 (616) hide show
  1. package/README.md +70 -2
  2. package/lib/about/core/providers.d.ts +6 -0
  3. package/lib/about/core/providers.d.ts.map +1 -1
  4. package/lib/about/core/providers.js +7 -0
  5. package/lib/about/core/providers.js.map +1 -1
  6. package/lib/about/ui/AboutProvidedBy.js +34 -0
  7. package/lib/about/ui/AboutProvidedBy.js.map +1 -1
  8. package/lib/chart/ui/useChartPointer.d.ts +9 -1
  9. package/lib/chart/ui/useChartPointer.d.ts.map +1 -1
  10. package/lib/chart/ui/useChartPointer.js +11 -3
  11. package/lib/chart/ui/useChartPointer.js.map +1 -1
  12. package/lib/credits/core/credits.d.ts +41 -0
  13. package/lib/credits/core/credits.d.ts.map +1 -1
  14. package/lib/credits/core/credits.js +50 -0
  15. package/lib/credits/core/credits.js.map +1 -1
  16. package/lib/download/core/drawingMarkup.d.ts +8 -1
  17. package/lib/download/core/drawingMarkup.d.ts.map +1 -1
  18. package/lib/download/core/drawingMarkup.js +13 -1
  19. package/lib/download/core/drawingMarkup.js.map +1 -1
  20. package/lib/download/core/figurePng.d.ts +14 -0
  21. package/lib/download/core/figurePng.d.ts.map +1 -1
  22. package/lib/download/core/figurePng.js +21 -6
  23. package/lib/download/core/figurePng.js.map +1 -1
  24. package/lib/download/core/figureSvg.d.ts.map +1 -1
  25. package/lib/download/core/figureSvg.js +5 -3
  26. package/lib/download/core/figureSvg.js.map +1 -1
  27. package/lib/download/core/figureTarget.d.ts +13 -0
  28. package/lib/download/core/figureTarget.d.ts.map +1 -1
  29. package/lib/download/core/figureTarget.js +25 -5
  30. package/lib/download/core/figureTarget.js.map +1 -1
  31. package/lib/download/core/svgBounds.d.ts +15 -0
  32. package/lib/download/core/svgBounds.d.ts.map +1 -1
  33. package/lib/download/core/svgBounds.js +20 -0
  34. package/lib/download/core/svgBounds.js.map +1 -1
  35. package/lib/download/core/svgToPng.d.ts.map +1 -1
  36. package/lib/download/core/svgToPng.js +4 -2
  37. package/lib/download/core/svgToPng.js.map +1 -1
  38. package/lib/format/core/relativeTime.d.ts +8 -3
  39. package/lib/format/core/relativeTime.d.ts.map +1 -1
  40. package/lib/format/core/relativeTime.js +19 -7
  41. package/lib/format/core/relativeTime.js.map +1 -1
  42. package/lib/host/core/connectHost.d.ts +25 -34
  43. package/lib/host/core/connectHost.d.ts.map +1 -1
  44. package/lib/host/core/connectHost.js +43 -89
  45. package/lib/host/core/connectHost.js.map +1 -1
  46. package/lib/host/core/hostOutputs.d.ts +58 -0
  47. package/lib/host/core/hostOutputs.d.ts.map +1 -0
  48. package/lib/host/core/hostOutputs.js +151 -0
  49. package/lib/host/core/hostOutputs.js.map +1 -0
  50. package/lib/host/core/index.d.ts +9 -3
  51. package/lib/host/core/index.d.ts.map +1 -1
  52. package/lib/host/core/index.js +4 -1
  53. package/lib/host/core/index.js.map +1 -1
  54. package/lib/host/core/irKinds.d.ts +124 -0
  55. package/lib/host/core/irKinds.d.ts.map +1 -0
  56. package/lib/host/core/irKinds.js +46 -0
  57. package/lib/host/core/irKinds.js.map +1 -0
  58. package/lib/host/core/kinds.d.ts +13 -5
  59. package/lib/host/core/kinds.d.ts.map +1 -1
  60. package/lib/host/core/kinds.js +11 -5
  61. package/lib/host/core/kinds.js.map +1 -1
  62. package/lib/host/core/protocol.d.ts +50 -7
  63. package/lib/host/core/protocol.d.ts.map +1 -1
  64. package/lib/host/core/protocol.js +10 -6
  65. package/lib/host/core/protocol.js.map +1 -1
  66. package/lib/host/core/selectInputs.d.ts +37 -0
  67. package/lib/host/core/selectInputs.d.ts.map +1 -0
  68. package/lib/host/core/selectInputs.js +110 -0
  69. package/lib/host/core/selectInputs.js.map +1 -0
  70. package/lib/host/testing/sciPeaks.d.ts +31 -0
  71. package/lib/host/testing/sciPeaks.d.ts.map +1 -1
  72. package/lib/host/testing/sciPeaks.js +73 -0
  73. package/lib/host/testing/sciPeaks.js.map +1 -1
  74. package/lib/host/testing/standInHost.d.ts +9 -1
  75. package/lib/host/testing/standInHost.d.ts.map +1 -1
  76. package/lib/host/testing/standInHost.js +19 -1
  77. package/lib/host/testing/standInHost.js.map +1 -1
  78. package/lib/host/ui/useHostConnection.d.ts +13 -5
  79. package/lib/host/ui/useHostConnection.d.ts.map +1 -1
  80. package/lib/host/ui/useHostConnection.js +4 -3
  81. package/lib/host/ui/useHostConnection.js.map +1 -1
  82. package/lib/host-testing.d.ts +2 -2
  83. package/lib/host-testing.d.ts.map +1 -1
  84. package/lib/host-testing.js +2 -2
  85. package/lib/host-testing.js.map +1 -1
  86. package/lib/i18n/core/chromeCatalog.d.ts +1 -1
  87. package/lib/i18n/core/chromeCatalog.d.ts.map +1 -1
  88. package/lib/ir/core/handPicking.d.ts +58 -0
  89. package/lib/ir/core/handPicking.d.ts.map +1 -0
  90. package/lib/ir/core/handPicking.js +130 -0
  91. package/lib/ir/core/handPicking.js.map +1 -0
  92. package/lib/ir/core/index.d.ts +3 -0
  93. package/lib/ir/core/index.d.ts.map +1 -1
  94. package/lib/ir/core/index.js +3 -0
  95. package/lib/ir/core/index.js.map +1 -1
  96. package/lib/ir/core/irBandState.d.ts +57 -0
  97. package/lib/ir/core/irBandState.d.ts.map +1 -0
  98. package/lib/ir/core/irBandState.js +119 -0
  99. package/lib/ir/core/irBandState.js.map +1 -0
  100. package/lib/ir/core/irCommands.d.ts +11 -0
  101. package/lib/ir/core/irCommands.d.ts.map +1 -1
  102. package/lib/ir/core/irCommands.js +6 -0
  103. package/lib/ir/core/irCommands.js.map +1 -1
  104. package/lib/ir/core/irPeaks.d.ts +28 -0
  105. package/lib/ir/core/irPeaks.d.ts.map +1 -0
  106. package/lib/ir/core/irPeaks.js +66 -0
  107. package/lib/ir/core/irPeaks.js.map +1 -0
  108. package/lib/ir/core/irReducer.d.ts +8 -0
  109. package/lib/ir/core/irReducer.d.ts.map +1 -1
  110. package/lib/ir/core/irReducer.js +15 -32
  111. package/lib/ir/core/irReducer.js.map +1 -1
  112. package/lib/ir/core/irSpectrum.d.ts +15 -0
  113. package/lib/ir/core/irSpectrum.d.ts.map +1 -1
  114. package/lib/ir/core/irSpectrum.js.map +1 -1
  115. package/lib/ir/core/irState.d.ts +9 -6
  116. package/lib/ir/core/irState.d.ts.map +1 -1
  117. package/lib/ir/core/irState.js +10 -6
  118. package/lib/ir/core/irState.js.map +1 -1
  119. package/lib/ir/core/pickBands.d.ts +14 -0
  120. package/lib/ir/core/pickBands.d.ts.map +1 -1
  121. package/lib/ir/core/pickBands.js +39 -33
  122. package/lib/ir/core/pickBands.js.map +1 -1
  123. package/lib/ir/core/ramanBands.d.ts +9 -1
  124. package/lib/ir/core/ramanBands.d.ts.map +1 -1
  125. package/lib/ir/core/ramanBands.js +2 -2
  126. package/lib/ir/core/ramanBands.js.map +1 -1
  127. package/lib/ir/core/spectrumBands.d.ts +46 -0
  128. package/lib/ir/core/spectrumBands.d.ts.map +1 -0
  129. package/lib/ir/core/spectrumBands.js +98 -0
  130. package/lib/ir/core/spectrumBands.js.map +1 -0
  131. package/lib/ir/ui/BandRow.d.ts +5 -0
  132. package/lib/ir/ui/BandRow.d.ts.map +1 -1
  133. package/lib/ir/ui/BandRow.js +4 -3
  134. package/lib/ir/ui/BandRow.js.map +1 -1
  135. package/lib/ir/ui/BandsPanel.d.ts +5 -0
  136. package/lib/ir/ui/BandsPanel.d.ts.map +1 -1
  137. package/lib/ir/ui/BandsPanel.js +36 -16
  138. package/lib/ir/ui/BandsPanel.js.map +1 -1
  139. package/lib/ir/ui/BandsToolbar.d.ts +9 -0
  140. package/lib/ir/ui/BandsToolbar.d.ts.map +1 -0
  141. package/lib/ir/ui/BandsToolbar.js +61 -0
  142. package/lib/ir/ui/BandsToolbar.js.map +1 -0
  143. package/lib/ir/ui/IrCanvas.d.ts +2 -1
  144. package/lib/ir/ui/IrCanvas.d.ts.map +1 -1
  145. package/lib/ir/ui/IrCanvas.js +19 -5
  146. package/lib/ir/ui/IrCanvas.js.map +1 -1
  147. package/lib/ir/ui/IrChart.d.ts.map +1 -1
  148. package/lib/ir/ui/IrChart.js +8 -1
  149. package/lib/ir/ui/IrChart.js.map +1 -1
  150. package/lib/ir/ui/IrDocumentationDialog.js +1 -1
  151. package/lib/ir/ui/IrDocumentationDialog.js.map +1 -1
  152. package/lib/ir/ui/IrEditor.d.ts +4 -2
  153. package/lib/ir/ui/IrEditor.d.ts.map +1 -1
  154. package/lib/ir/ui/IrEditor.js.map +1 -1
  155. package/lib/ir/ui/IrShell.d.ts.map +1 -1
  156. package/lib/ir/ui/IrShell.js +6 -0
  157. package/lib/ir/ui/IrShell.js.map +1 -1
  158. package/lib/ir/ui/IrStatusBar.d.ts.map +1 -1
  159. package/lib/ir/ui/IrStatusBar.js +1 -1
  160. package/lib/ir/ui/IrStatusBar.js.map +1 -1
  161. package/lib/ir/ui/IrToolbar.d.ts +4 -3
  162. package/lib/ir/ui/IrToolbar.d.ts.map +1 -1
  163. package/lib/ir/ui/IrToolbar.js +5 -4
  164. package/lib/ir/ui/IrToolbar.js.map +1 -1
  165. package/lib/ir/ui/VibrationalEditor.d.ts +2 -1
  166. package/lib/ir/ui/VibrationalEditor.d.ts.map +1 -1
  167. package/lib/ir/ui/VibrationalEditor.js.map +1 -1
  168. package/lib/ir/ui/irActions.d.ts +5 -0
  169. package/lib/ir/ui/irActions.d.ts.map +1 -1
  170. package/lib/ir/ui/irActions.js +6 -0
  171. package/lib/ir/ui/irActions.js.map +1 -1
  172. package/lib/ir/ui/irChartProps.d.ts +4 -1
  173. package/lib/ir/ui/irChartProps.d.ts.map +1 -1
  174. package/lib/ir/ui/useIrEditor.d.ts +5 -11
  175. package/lib/ir/ui/useIrEditor.d.ts.map +1 -1
  176. package/lib/ir/ui/useIrEditor.js +17 -18
  177. package/lib/ir/ui/useIrEditor.js.map +1 -1
  178. package/lib/locales/de.json +63 -0
  179. package/lib/locales/en.json +63 -0
  180. package/lib/locales/es.json +63 -0
  181. package/lib/locales/fr.json +63 -0
  182. package/lib/locales/it.json +63 -0
  183. package/lib/mass/core/analyseSpectrum.d.ts +85 -0
  184. package/lib/mass/core/analyseSpectrum.d.ts.map +1 -0
  185. package/lib/mass/core/analyseSpectrum.js +101 -0
  186. package/lib/mass/core/analyseSpectrum.js.map +1 -0
  187. package/lib/mass/core/ascendingTrace.d.ts +24 -0
  188. package/lib/mass/core/ascendingTrace.d.ts.map +1 -0
  189. package/lib/mass/core/ascendingTrace.js +57 -0
  190. package/lib/mass/core/ascendingTrace.js.map +1 -0
  191. package/lib/mass/core/centroidPeaks.d.ts +77 -0
  192. package/lib/mass/core/centroidPeaks.d.ts.map +1 -0
  193. package/lib/mass/core/centroidPeaks.js +62 -0
  194. package/lib/mass/core/centroidPeaks.js.map +1 -0
  195. package/lib/mass/core/detectMassFormat.d.ts +24 -0
  196. package/lib/mass/core/detectMassFormat.d.ts.map +1 -0
  197. package/lib/mass/core/detectMassFormat.js +105 -0
  198. package/lib/mass/core/detectMassFormat.js.map +1 -0
  199. package/lib/mass/core/downloadSpectra.d.ts +24 -0
  200. package/lib/mass/core/downloadSpectra.d.ts.map +1 -0
  201. package/lib/mass/core/downloadSpectra.js +35 -0
  202. package/lib/mass/core/downloadSpectra.js.map +1 -0
  203. package/lib/mass/core/fromJcamp.d.ts +46 -0
  204. package/lib/mass/core/fromJcamp.d.ts.map +1 -0
  205. package/lib/mass/core/fromJcamp.js +123 -0
  206. package/lib/mass/core/fromJcamp.js.map +1 -0
  207. package/lib/mass/core/fromText.d.ts +30 -0
  208. package/lib/mass/core/fromText.d.ts.map +1 -0
  209. package/lib/mass/core/fromText.js +39 -0
  210. package/lib/mass/core/fromText.js.map +1 -0
  211. package/lib/mass/core/index.d.ts +70 -0
  212. package/lib/mass/core/index.d.ts.map +1 -0
  213. package/lib/mass/core/index.js +42 -0
  214. package/lib/mass/core/index.js.map +1 -0
  215. package/lib/mass/core/jcampTechnique.d.ts +38 -0
  216. package/lib/mass/core/jcampTechnique.d.ts.map +1 -0
  217. package/lib/mass/core/jcampTechnique.js +70 -0
  218. package/lib/mass/core/jcampTechnique.js.map +1 -0
  219. package/lib/mass/core/labelStackBox.d.ts +49 -0
  220. package/lib/mass/core/labelStackBox.d.ts.map +1 -0
  221. package/lib/mass/core/labelStackBox.js +44 -0
  222. package/lib/mass/core/labelStackBox.js.map +1 -0
  223. package/lib/mass/core/labelledPeaks.d.ts +79 -0
  224. package/lib/mass/core/labelledPeaks.d.ts.map +1 -0
  225. package/lib/mass/core/labelledPeaks.js +74 -0
  226. package/lib/mass/core/labelledPeaks.js.map +1 -0
  227. package/lib/mass/core/loadMassSpectra.d.ts +57 -0
  228. package/lib/mass/core/loadMassSpectra.d.ts.map +1 -0
  229. package/lib/mass/core/loadMassSpectra.js +45 -0
  230. package/lib/mass/core/loadMassSpectra.js.map +1 -0
  231. package/lib/mass/core/loadedMassSpectrum.d.ts +42 -0
  232. package/lib/mass/core/loadedMassSpectrum.d.ts.map +1 -0
  233. package/lib/mass/core/loadedMassSpectrum.js +15 -0
  234. package/lib/mass/core/loadedMassSpectrum.js.map +1 -0
  235. package/lib/mass/core/massCommands.d.ts +170 -0
  236. package/lib/mass/core/massCommands.d.ts.map +1 -0
  237. package/lib/mass/core/massCommands.js +95 -0
  238. package/lib/mass/core/massCommands.js.map +1 -0
  239. package/lib/mass/core/massDomain.d.ts +121 -0
  240. package/lib/mass/core/massDomain.d.ts.map +1 -0
  241. package/lib/mass/core/massDomain.js +179 -0
  242. package/lib/mass/core/massDomain.js.map +1 -0
  243. package/lib/mass/core/massEditorApi.d.ts +65 -0
  244. package/lib/mass/core/massEditorApi.d.ts.map +1 -0
  245. package/lib/mass/core/massEditorApi.js +10 -0
  246. package/lib/mass/core/massEditorApi.js.map +1 -0
  247. package/lib/mass/core/massFormat.d.ts +78 -0
  248. package/lib/mass/core/massFormat.d.ts.map +1 -0
  249. package/lib/mass/core/massFormat.js +168 -0
  250. package/lib/mass/core/massFormat.js.map +1 -0
  251. package/lib/mass/core/massMeta.d.ts +85 -0
  252. package/lib/mass/core/massMeta.d.ts.map +1 -0
  253. package/lib/mass/core/massMeta.js +182 -0
  254. package/lib/mass/core/massMeta.js.map +1 -0
  255. package/lib/mass/core/massReducer.d.ts +82 -0
  256. package/lib/mass/core/massReducer.d.ts.map +1 -0
  257. package/lib/mass/core/massReducer.js +163 -0
  258. package/lib/mass/core/massReducer.js.map +1 -0
  259. package/lib/mass/core/massResolution.d.ts +92 -0
  260. package/lib/mass/core/massResolution.d.ts.map +1 -0
  261. package/lib/mass/core/massResolution.js +126 -0
  262. package/lib/mass/core/massResolution.js.map +1 -0
  263. package/lib/mass/core/massSidePanels.d.ts +28 -0
  264. package/lib/mass/core/massSidePanels.d.ts.map +1 -0
  265. package/lib/mass/core/massSidePanels.js +12 -0
  266. package/lib/mass/core/massSidePanels.js.map +1 -0
  267. package/lib/mass/core/massSpectrum.d.ts +206 -0
  268. package/lib/mass/core/massSpectrum.d.ts.map +1 -0
  269. package/lib/mass/core/massSpectrum.js +41 -0
  270. package/lib/mass/core/massSpectrum.js.map +1 -0
  271. package/lib/mass/core/massState.d.ts +145 -0
  272. package/lib/mass/core/massState.d.ts.map +1 -0
  273. package/lib/mass/core/massState.js +102 -0
  274. package/lib/mass/core/massState.js.map +1 -0
  275. package/lib/mass/core/massStateEdits.d.ts +51 -0
  276. package/lib/mass/core/massStateEdits.d.ts.map +1 -0
  277. package/lib/mass/core/massStateEdits.js +90 -0
  278. package/lib/mass/core/massStateEdits.js.map +1 -0
  279. package/lib/mass/core/massSummary.d.ts +77 -0
  280. package/lib/mass/core/massSummary.d.ts.map +1 -0
  281. package/lib/mass/core/massSummary.js +174 -0
  282. package/lib/mass/core/massSummary.js.map +1 -0
  283. package/lib/mass/core/mzDecimalsSetting.d.ts +36 -0
  284. package/lib/mass/core/mzDecimalsSetting.d.ts.map +1 -0
  285. package/lib/mass/core/mzDecimalsSetting.js +42 -0
  286. package/lib/mass/core/mzDecimalsSetting.js.map +1 -0
  287. package/lib/mass/core/nearestPeak.d.ts +75 -0
  288. package/lib/mass/core/nearestPeak.d.ts.map +1 -0
  289. package/lib/mass/core/nearestPeak.js +99 -0
  290. package/lib/mass/core/nearestPeak.js.map +1 -0
  291. package/lib/mass/core/peakLabelLines.d.ts +77 -0
  292. package/lib/mass/core/peakLabelLines.d.ts.map +1 -0
  293. package/lib/mass/core/peakLabelLines.js +54 -0
  294. package/lib/mass/core/peakLabelLines.js.map +1 -0
  295. package/lib/mass/core/peakLabelPlan.d.ts +109 -0
  296. package/lib/mass/core/peakLabelPlan.d.ts.map +1 -0
  297. package/lib/mass/core/peakLabelPlan.js +143 -0
  298. package/lib/mass/core/peakLabelPlan.js.map +1 -0
  299. package/lib/mass/core/peakTable.d.ts +54 -0
  300. package/lib/mass/core/peakTable.d.ts.map +1 -0
  301. package/lib/mass/core/peakTable.js +53 -0
  302. package/lib/mass/core/peakTable.js.map +1 -0
  303. package/lib/mass/core/resolutionOf.d.ts +60 -0
  304. package/lib/mass/core/resolutionOf.d.ts.map +1 -0
  305. package/lib/mass/core/resolutionOf.js +84 -0
  306. package/lib/mass/core/resolutionOf.js.map +1 -0
  307. package/lib/mass/core/scanFilter.d.ts +25 -0
  308. package/lib/mass/core/scanFilter.d.ts.map +1 -0
  309. package/lib/mass/core/scanFilter.js +107 -0
  310. package/lib/mass/core/scanFilter.js.map +1 -0
  311. package/lib/mass/core/spectrumJcamp.d.ts +47 -0
  312. package/lib/mass/core/spectrumJcamp.d.ts.map +1 -0
  313. package/lib/mass/core/spectrumJcamp.js +167 -0
  314. package/lib/mass/core/spectrumJcamp.js.map +1 -0
  315. package/lib/mass/core/toMassSpectrum.d.ts +67 -0
  316. package/lib/mass/core/toMassSpectrum.d.ts.map +1 -0
  317. package/lib/mass/core/toMassSpectrum.js +78 -0
  318. package/lib/mass/core/toMassSpectrum.js.map +1 -0
  319. package/lib/mass/core/traceIcon.d.ts +82 -0
  320. package/lib/mass/core/traceIcon.d.ts.map +1 -0
  321. package/lib/mass/core/traceIcon.js +66 -0
  322. package/lib/mass/core/traceIcon.js.map +1 -0
  323. package/lib/mass/core/writtenResolution.d.ts +40 -0
  324. package/lib/mass/core/writtenResolution.d.ts.map +1 -0
  325. package/lib/mass/core/writtenResolution.js +77 -0
  326. package/lib/mass/core/writtenResolution.js.map +1 -0
  327. package/lib/mass/ui/MassAboutDialog.d.ts +16 -0
  328. package/lib/mass/ui/MassAboutDialog.d.ts.map +1 -0
  329. package/lib/mass/ui/MassAboutDialog.js +44 -0
  330. package/lib/mass/ui/MassAboutDialog.js.map +1 -0
  331. package/lib/mass/ui/MassCanvas.d.ts +46 -0
  332. package/lib/mass/ui/MassCanvas.d.ts.map +1 -0
  333. package/lib/mass/ui/MassCanvas.js +84 -0
  334. package/lib/mass/ui/MassCanvas.js.map +1 -0
  335. package/lib/mass/ui/MassChart.d.ts +21 -0
  336. package/lib/mass/ui/MassChart.d.ts.map +1 -0
  337. package/lib/mass/ui/MassChart.js +139 -0
  338. package/lib/mass/ui/MassChart.js.map +1 -0
  339. package/lib/mass/ui/MassCommandProvider.d.ts +15 -0
  340. package/lib/mass/ui/MassCommandProvider.d.ts.map +1 -0
  341. package/lib/mass/ui/MassCommandProvider.js +14 -0
  342. package/lib/mass/ui/MassCommandProvider.js.map +1 -0
  343. package/lib/mass/ui/MassCommandTooltip.d.ts +16 -0
  344. package/lib/mass/ui/MassCommandTooltip.d.ts.map +1 -0
  345. package/lib/mass/ui/MassCommandTooltip.js +22 -0
  346. package/lib/mass/ui/MassCommandTooltip.js.map +1 -0
  347. package/lib/mass/ui/MassDocumentationDialog.d.ts +18 -0
  348. package/lib/mass/ui/MassDocumentationDialog.d.ts.map +1 -0
  349. package/lib/mass/ui/MassDocumentationDialog.js +70 -0
  350. package/lib/mass/ui/MassDocumentationDialog.js.map +1 -0
  351. package/lib/mass/ui/MassEditor.d.ts +78 -0
  352. package/lib/mass/ui/MassEditor.d.ts.map +1 -0
  353. package/lib/mass/ui/MassEditor.js +42 -0
  354. package/lib/mass/ui/MassEditor.js.map +1 -0
  355. package/lib/mass/ui/MassHeader.d.ts +12 -0
  356. package/lib/mass/ui/MassHeader.d.ts.map +1 -0
  357. package/lib/mass/ui/MassHeader.js +20 -0
  358. package/lib/mass/ui/MassHeader.js.map +1 -0
  359. package/lib/mass/ui/MassLogo.d.ts +21 -0
  360. package/lib/mass/ui/MassLogo.d.ts.map +1 -0
  361. package/lib/mass/ui/MassLogo.js +36 -0
  362. package/lib/mass/ui/MassLogo.js.map +1 -0
  363. package/lib/mass/ui/MassPointerTracker.d.ts +44 -0
  364. package/lib/mass/ui/MassPointerTracker.d.ts.map +1 -0
  365. package/lib/mass/ui/MassPointerTracker.js +29 -0
  366. package/lib/mass/ui/MassPointerTracker.js.map +1 -0
  367. package/lib/mass/ui/MassShell.d.ts +29 -0
  368. package/lib/mass/ui/MassShell.d.ts.map +1 -0
  369. package/lib/mass/ui/MassShell.js +133 -0
  370. package/lib/mass/ui/MassShell.js.map +1 -0
  371. package/lib/mass/ui/MassSidePanel.d.ts +32 -0
  372. package/lib/mass/ui/MassSidePanel.d.ts.map +1 -0
  373. package/lib/mass/ui/MassSidePanel.js +44 -0
  374. package/lib/mass/ui/MassSidePanel.js.map +1 -0
  375. package/lib/mass/ui/MassStateProvider.d.ts +19 -0
  376. package/lib/mass/ui/MassStateProvider.d.ts.map +1 -0
  377. package/lib/mass/ui/MassStateProvider.js +16 -0
  378. package/lib/mass/ui/MassStateProvider.js.map +1 -0
  379. package/lib/mass/ui/MassStatusBar.d.ts +15 -0
  380. package/lib/mass/ui/MassStatusBar.d.ts.map +1 -0
  381. package/lib/mass/ui/MassStatusBar.js +50 -0
  382. package/lib/mass/ui/MassStatusBar.js.map +1 -0
  383. package/lib/mass/ui/MassToolbar.d.ts +24 -0
  384. package/lib/mass/ui/MassToolbar.d.ts.map +1 -0
  385. package/lib/mass/ui/MassToolbar.js +36 -0
  386. package/lib/mass/ui/MassToolbar.js.map +1 -0
  387. package/lib/mass/ui/MetadataPanel.d.ts +35 -0
  388. package/lib/mass/ui/MetadataPanel.d.ts.map +1 -0
  389. package/lib/mass/ui/MetadataPanel.js +100 -0
  390. package/lib/mass/ui/MetadataPanel.js.map +1 -0
  391. package/lib/mass/ui/MzDecimalsMenu.d.ts +28 -0
  392. package/lib/mass/ui/MzDecimalsMenu.d.ts.map +1 -0
  393. package/lib/mass/ui/MzDecimalsMenu.js +40 -0
  394. package/lib/mass/ui/MzDecimalsMenu.js.map +1 -0
  395. package/lib/mass/ui/PeakLabels.d.ts +93 -0
  396. package/lib/mass/ui/PeakLabels.d.ts.map +1 -0
  397. package/lib/mass/ui/PeakLabels.js +91 -0
  398. package/lib/mass/ui/PeakLabels.js.map +1 -0
  399. package/lib/mass/ui/PeakTable.d.ts +34 -0
  400. package/lib/mass/ui/PeakTable.d.ts.map +1 -0
  401. package/lib/mass/ui/PeakTable.js +49 -0
  402. package/lib/mass/ui/PeakTable.js.map +1 -0
  403. package/lib/mass/ui/PeaksPanel.d.ts +31 -0
  404. package/lib/mass/ui/PeaksPanel.d.ts.map +1 -0
  405. package/lib/mass/ui/PeaksPanel.js +53 -0
  406. package/lib/mass/ui/PeaksPanel.js.map +1 -0
  407. package/lib/mass/ui/SpectraPanel.d.ts +17 -0
  408. package/lib/mass/ui/SpectraPanel.d.ts.map +1 -0
  409. package/lib/mass/ui/SpectraPanel.js +76 -0
  410. package/lib/mass/ui/SpectraPanel.js.map +1 -0
  411. package/lib/mass/ui/SpectrumRow.d.ts +26 -0
  412. package/lib/mass/ui/SpectrumRow.d.ts.map +1 -0
  413. package/lib/mass/ui/SpectrumRow.js +141 -0
  414. package/lib/mass/ui/SpectrumRow.js.map +1 -0
  415. package/lib/mass/ui/SpectrumTrace.d.ts +46 -0
  416. package/lib/mass/ui/SpectrumTrace.d.ts.map +1 -0
  417. package/lib/mass/ui/SpectrumTrace.js +68 -0
  418. package/lib/mass/ui/SpectrumTrace.js.map +1 -0
  419. package/lib/mass/ui/index.d.ts +69 -0
  420. package/lib/mass/ui/index.d.ts.map +1 -0
  421. package/lib/mass/ui/index.js +42 -0
  422. package/lib/mass/ui/index.js.map +1 -0
  423. package/lib/mass/ui/massActions.d.ts +52 -0
  424. package/lib/mass/ui/massActions.d.ts.map +1 -0
  425. package/lib/mass/ui/massActions.js +62 -0
  426. package/lib/mass/ui/massActions.js.map +1 -0
  427. package/lib/mass/ui/massChartProps.d.ts +128 -0
  428. package/lib/mass/ui/massChartProps.d.ts.map +1 -0
  429. package/lib/mass/ui/massChartProps.js +14 -0
  430. package/lib/mass/ui/massChartProps.js.map +1 -0
  431. package/lib/mass/ui/massCommandContext.d.ts +36 -0
  432. package/lib/mass/ui/massCommandContext.d.ts.map +1 -0
  433. package/lib/mass/ui/massCommandContext.js +45 -0
  434. package/lib/mass/ui/massCommandContext.js.map +1 -0
  435. package/lib/mass/ui/massHostPanels.d.ts +48 -0
  436. package/lib/mass/ui/massHostPanels.d.ts.map +1 -0
  437. package/lib/mass/ui/massHostPanels.js +41 -0
  438. package/lib/mass/ui/massHostPanels.js.map +1 -0
  439. package/lib/mass/ui/massStateContext.d.ts +26 -0
  440. package/lib/mass/ui/massStateContext.d.ts.map +1 -0
  441. package/lib/mass/ui/massStateContext.js +37 -0
  442. package/lib/mass/ui/massStateContext.js.map +1 -0
  443. package/lib/mass/ui/useIntensityZoom.d.ts +20 -0
  444. package/lib/mass/ui/useIntensityZoom.d.ts.map +1 -0
  445. package/lib/mass/ui/useIntensityZoom.js +42 -0
  446. package/lib/mass/ui/useIntensityZoom.js.map +1 -0
  447. package/lib/mass/ui/useMassEditor.d.ts +52 -0
  448. package/lib/mass/ui/useMassEditor.d.ts.map +1 -0
  449. package/lib/mass/ui/useMassEditor.js +93 -0
  450. package/lib/mass/ui/useMassEditor.js.map +1 -0
  451. package/lib/mass/ui/useMassFiles.d.ts +22 -0
  452. package/lib/mass/ui/useMassFiles.d.ts.map +1 -0
  453. package/lib/mass/ui/useMassFiles.js +71 -0
  454. package/lib/mass/ui/useMassFiles.js.map +1 -0
  455. package/lib/mass/ui/useMassHandle.d.ts +15 -0
  456. package/lib/mass/ui/useMassHandle.d.ts.map +1 -0
  457. package/lib/mass/ui/useMassHandle.js +35 -0
  458. package/lib/mass/ui/useMassHandle.js.map +1 -0
  459. package/lib/mass/ui/useMassPointer.d.ts +70 -0
  460. package/lib/mass/ui/useMassPointer.d.ts.map +1 -0
  461. package/lib/mass/ui/useMassPointer.js +57 -0
  462. package/lib/mass/ui/useMassPointer.js.map +1 -0
  463. package/lib/mass/ui/useMassShortcuts.d.ts +21 -0
  464. package/lib/mass/ui/useMassShortcuts.d.ts.map +1 -0
  465. package/lib/mass/ui/useMassShortcuts.js +66 -0
  466. package/lib/mass/ui/useMassShortcuts.js.map +1 -0
  467. package/lib/mass/ui/useMassSide.d.ts +27 -0
  468. package/lib/mass/ui/useMassSide.d.ts.map +1 -0
  469. package/lib/mass/ui/useMassSide.js +45 -0
  470. package/lib/mass/ui/useMassSide.js.map +1 -0
  471. package/lib/mass/ui/useMassZoom.d.ts +92 -0
  472. package/lib/mass/ui/useMassZoom.d.ts.map +1 -0
  473. package/lib/mass/ui/useMassZoom.js +65 -0
  474. package/lib/mass/ui/useMassZoom.js.map +1 -0
  475. package/lib/mass.d.ts +16 -0
  476. package/lib/mass.d.ts.map +1 -0
  477. package/lib/mass.js +16 -0
  478. package/lib/mass.js.map +1 -0
  479. package/lib/panel/ui/PanelRail.d.ts.map +1 -1
  480. package/lib/panel/ui/PanelRail.js +6 -1
  481. package/lib/panel/ui/PanelRail.js.map +1 -1
  482. package/lib/slides/ui/slideSanitizeSchema.d.ts +3 -2
  483. package/lib/slides/ui/slideSanitizeSchema.d.ts.map +1 -1
  484. package/lib/slides/ui/slideSanitizeSchema.js +82 -2
  485. package/lib/slides/ui/slideSanitizeSchema.js.map +1 -1
  486. package/package.json +6 -1
  487. package/src/about/core/providers.ts +7 -0
  488. package/src/about/ui/AboutProvidedBy.tsx +49 -0
  489. package/src/chart/ui/useChartPointer.ts +18 -4
  490. package/src/credits/core/credits.ts +53 -0
  491. package/src/download/core/drawingMarkup.ts +18 -1
  492. package/src/download/core/figurePng.ts +21 -8
  493. package/src/download/core/figureSvg.ts +5 -2
  494. package/src/download/core/figureTarget.ts +28 -3
  495. package/src/download/core/svgBounds.ts +21 -0
  496. package/src/download/core/svgToPng.ts +3 -4
  497. package/src/format/core/relativeTime.ts +29 -7
  498. package/src/host/core/connectHost.ts +77 -120
  499. package/src/host/core/hostOutputs.ts +197 -0
  500. package/src/host/core/index.ts +13 -7
  501. package/src/host/core/irKinds.ts +92 -0
  502. package/src/host/core/kinds.ts +16 -6
  503. package/src/host/core/protocol.ts +50 -8
  504. package/src/host/core/selectInputs.ts +145 -0
  505. package/src/host/testing/sciPeaks.ts +140 -0
  506. package/src/host/testing/standInHost.ts +30 -5
  507. package/src/host/ui/useHostConnection.ts +17 -8
  508. package/src/host-testing.ts +4 -0
  509. package/src/ir/core/handPicking.ts +154 -0
  510. package/src/ir/core/index.ts +14 -0
  511. package/src/ir/core/irBandState.ts +155 -0
  512. package/src/ir/core/irCommands.ts +7 -0
  513. package/src/ir/core/irPeaks.ts +79 -0
  514. package/src/ir/core/irReducer.ts +27 -34
  515. package/src/ir/core/irSpectrum.ts +16 -0
  516. package/src/ir/core/irState.ts +15 -8
  517. package/src/ir/core/pickBands.ts +46 -39
  518. package/src/ir/core/ramanBands.ts +2 -2
  519. package/src/ir/core/spectrumBands.ts +113 -0
  520. package/src/ir/ui/BandRow.tsx +20 -2
  521. package/src/ir/ui/BandsPanel.tsx +46 -88
  522. package/src/ir/ui/BandsToolbar.tsx +152 -0
  523. package/src/ir/ui/IrCanvas.tsx +22 -11
  524. package/src/ir/ui/IrChart.tsx +10 -1
  525. package/src/ir/ui/IrDocumentationDialog.tsx +7 -0
  526. package/src/ir/ui/IrEditor.tsx +4 -2
  527. package/src/ir/ui/IrShell.tsx +5 -0
  528. package/src/ir/ui/IrStatusBar.tsx +4 -1
  529. package/src/ir/ui/IrToolbar.tsx +14 -5
  530. package/src/ir/ui/VibrationalEditor.tsx +2 -1
  531. package/src/ir/ui/irActions.ts +11 -0
  532. package/src/ir/ui/irChartProps.ts +4 -1
  533. package/src/ir/ui/useIrEditor.ts +21 -21
  534. package/src/locales/de.json +63 -0
  535. package/src/locales/en.json +63 -0
  536. package/src/locales/es.json +63 -0
  537. package/src/locales/fr.json +63 -0
  538. package/src/locales/it.json +63 -0
  539. package/src/mass/core/analyseSpectrum.ts +191 -0
  540. package/src/mass/core/ascendingTrace.ts +62 -0
  541. package/src/mass/core/centroidPeaks.ts +114 -0
  542. package/src/mass/core/detectMassFormat.ts +113 -0
  543. package/src/mass/core/downloadSpectra.ts +52 -0
  544. package/src/mass/core/fromJcamp.ts +151 -0
  545. package/src/mass/core/fromText.ts +58 -0
  546. package/src/mass/core/index.ts +194 -0
  547. package/src/mass/core/jcampTechnique.ts +87 -0
  548. package/src/mass/core/labelStackBox.ts +75 -0
  549. package/src/mass/core/labelledPeaks.ts +135 -0
  550. package/src/mass/core/loadMassSpectra.ts +86 -0
  551. package/src/mass/core/loadedMassSpectrum.ts +43 -0
  552. package/src/mass/core/massCommands.ts +156 -0
  553. package/src/mass/core/massDomain.ts +229 -0
  554. package/src/mass/core/massEditorApi.ts +68 -0
  555. package/src/mass/core/massFormat.ts +187 -0
  556. package/src/mass/core/massMeta.ts +239 -0
  557. package/src/mass/core/massReducer.ts +232 -0
  558. package/src/mass/core/massResolution.ts +169 -0
  559. package/src/mass/core/massSidePanels.ts +27 -0
  560. package/src/mass/core/massSpectrum.ts +220 -0
  561. package/src/mass/core/massState.ts +206 -0
  562. package/src/mass/core/massStateEdits.ts +104 -0
  563. package/src/mass/core/massSummary.ts +213 -0
  564. package/src/mass/core/mzDecimalsSetting.ts +52 -0
  565. package/src/mass/core/nearestPeak.ts +130 -0
  566. package/src/mass/core/peakLabelLines.ts +112 -0
  567. package/src/mass/core/peakLabelPlan.ts +246 -0
  568. package/src/mass/core/peakTable.ts +82 -0
  569. package/src/mass/core/resolutionOf.ts +100 -0
  570. package/src/mass/core/scanFilter.ts +119 -0
  571. package/src/mass/core/spectrumJcamp.ts +186 -0
  572. package/src/mass/core/toMassSpectrum.ts +126 -0
  573. package/src/mass/core/traceIcon.ts +105 -0
  574. package/src/mass/core/writtenResolution.ts +81 -0
  575. package/src/mass/ui/MassAboutDialog.tsx +89 -0
  576. package/src/mass/ui/MassCanvas.tsx +170 -0
  577. package/src/mass/ui/MassChart.tsx +266 -0
  578. package/src/mass/ui/MassCommandProvider.tsx +34 -0
  579. package/src/mass/ui/MassCommandTooltip.tsx +36 -0
  580. package/src/mass/ui/MassDocumentationDialog.tsx +136 -0
  581. package/src/mass/ui/MassEditor.tsx +130 -0
  582. package/src/mass/ui/MassHeader.tsx +38 -0
  583. package/src/mass/ui/MassLogo.tsx +84 -0
  584. package/src/mass/ui/MassPointerTracker.tsx +72 -0
  585. package/src/mass/ui/MassShell.tsx +237 -0
  586. package/src/mass/ui/MassSidePanel.tsx +107 -0
  587. package/src/mass/ui/MassStateProvider.tsx +32 -0
  588. package/src/mass/ui/MassStatusBar.tsx +108 -0
  589. package/src/mass/ui/MassToolbar.tsx +120 -0
  590. package/src/mass/ui/MetadataPanel.tsx +201 -0
  591. package/src/mass/ui/MzDecimalsMenu.tsx +86 -0
  592. package/src/mass/ui/PeakLabels.tsx +242 -0
  593. package/src/mass/ui/PeakTable.tsx +199 -0
  594. package/src/mass/ui/PeaksPanel.tsx +182 -0
  595. package/src/mass/ui/SpectraPanel.tsx +153 -0
  596. package/src/mass/ui/SpectrumRow.tsx +246 -0
  597. package/src/mass/ui/SpectrumTrace.tsx +119 -0
  598. package/src/mass/ui/index.ts +69 -0
  599. package/src/mass/ui/massActions.ts +109 -0
  600. package/src/mass/ui/massChartProps.ts +130 -0
  601. package/src/mass/ui/massCommandContext.tsx +65 -0
  602. package/src/mass/ui/massHostPanels.ts +71 -0
  603. package/src/mass/ui/massStateContext.ts +48 -0
  604. package/src/mass/ui/useIntensityZoom.ts +55 -0
  605. package/src/mass/ui/useMassEditor.ts +156 -0
  606. package/src/mass/ui/useMassFiles.ts +91 -0
  607. package/src/mass/ui/useMassHandle.ts +58 -0
  608. package/src/mass/ui/useMassPointer.ts +120 -0
  609. package/src/mass/ui/useMassShortcuts.ts +85 -0
  610. package/src/mass/ui/useMassSide.ts +63 -0
  611. package/src/mass/ui/useMassZoom.ts +157 -0
  612. package/src/mass.ts +16 -0
  613. package/src/panel/ui/PanelRail.tsx +5 -1
  614. package/src/slides/ui/slideSanitizeSchema.ts +86 -2
  615. package/styles/chrome.css +7 -0
  616. package/styles/slides.css +47 -0
@@ -0,0 +1,78 @@
1
+ /**
2
+ * Turning what a reader produced into what the viewer holds.
3
+ *
4
+ * A reader answers about a file and knows nothing about the session it is being
5
+ * read into — which spectra are already open, what colours they took, what this
6
+ * one should be called. That is the gap this closes: the peaks are picked here,
7
+ * the resolution decided, and it is the only place an identity or a colour is
8
+ * invented.
9
+ */
10
+ import { nextSpectrumColor } from "../../chart/core/spectrumColor.js";
11
+ import { analyseSpectrum } from "./analyseSpectrum.js";
12
+ import { decideResolution } from "./resolutionOf.js";
13
+ /**
14
+ * Make a held spectrum out of a read one.
15
+ *
16
+ * The resolution is the strongest verdict there is evidence for, as
17
+ * `decideResolution` weighs it: measured on the peak widths when the trace is a
18
+ * profile, otherwise what the file says the instrument was, and only failing
19
+ * both what the decimals of the masses imply.
20
+ * @param loaded - What the reader produced.
21
+ * @param options - The identity, colour and name to give it.
22
+ * @returns The spectrum as the viewer holds it, its peaks picked.
23
+ * @throws {Error} Whatever the peak picking refuses the trace with.
24
+ */
25
+ export function toMassSpectrum(loaded, options = {}) {
26
+ const { id = crypto.randomUUID(), color, taken = [], name, analysis, } = options;
27
+ const analysed = analyseSpectrum(loaded.trace, {
28
+ ...analysis,
29
+ ...(loaded.continuous === undefined
30
+ ? {}
31
+ : { continuous: loaded.continuous }),
32
+ });
33
+ const resolution = decideResolution({
34
+ measured: analysed.resolution,
35
+ meta: loaded.meta,
36
+ masses: analysed.centroid.x,
37
+ });
38
+ return {
39
+ id,
40
+ name: name ?? loaded.name ?? loaded.origin.fileName ?? 'Spectrum',
41
+ color: color ?? nextSpectrumColor(taken),
42
+ profile: analysed.profile,
43
+ centroid: analysed.centroid,
44
+ meta: loaded.meta,
45
+ origin: loaded.origin,
46
+ // One trace or the other, never both: sticks standing inside the peak
47
+ // shapes they were picked from read as a second spectrum over the first.
48
+ showProfile: analysed.profile !== null,
49
+ showCentroid: analysed.profile === null,
50
+ resolution,
51
+ };
52
+ }
53
+ /**
54
+ * Make held spectra out of everything one file held.
55
+ *
56
+ * The colours are handed out one at a time against a growing list, so a file
57
+ * carrying three scans gives three spectra of three colours rather than three
58
+ * of the same — `nextSpectrumColor` can only answer that if it is told what the
59
+ * previous call took.
60
+ * @param loaded - What the reader produced, in file order.
61
+ * @param options - The colours already taken, and how the peaks are picked.
62
+ * @returns The spectra, in the same order.
63
+ */
64
+ export function toMassSpectra(loaded, options = {}) {
65
+ const { taken = [], analysis } = options;
66
+ const colors = [...taken];
67
+ const spectra = [];
68
+ for (const entry of loaded) {
69
+ const spectrum = toMassSpectrum(entry, {
70
+ taken: colors,
71
+ ...(analysis === undefined ? {} : { analysis }),
72
+ });
73
+ colors.push(spectrum.color);
74
+ spectra.push(spectrum);
75
+ }
76
+ return spectra;
77
+ }
78
+ //# sourceMappingURL=toMassSpectrum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toMassSpectrum.js","sourceRoot":"","sources":["../../../src/mass/core/toMassSpectrum.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAGtE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAGvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAgCrD;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,cAAc,CAC5B,MAA0B,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AM,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC;IAC1B,MAAM,OAAO,GAAmB,EAAE,CAAC;IACnC,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,MAAM,QAAQ,GAAG,cAAc,CAAC,KAAK,EAAE;YACrC,KAAK,EAAE,MAAM;YACb,GAAG,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC;SAChD,CAAC,CAAC;QACH,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAC5B,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACzB,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -0,0 +1,82 @@
1
+ /**
2
+ * The three things one trace icon has to say, and what a click on it asks for.
3
+ *
4
+ * A spectrum row carries two of these icons, one for the continuous trace and
5
+ * one for the centroid sticks, and each of them answers two questions at once:
6
+ * is this trace on the chart, and is this the spectrum everything else is
7
+ * about. The second is not decoration — the selected spectrum is the one the
8
+ * peak labels are written on, the one the acquisition table describes and the
9
+ * one the peak list holds — so a plain visibility checkbox would either lose it
10
+ * or need a second control beside it in a row that has no room for one.
11
+ *
12
+ * The two icons are an **either/or**, not two checkboxes: a spectrum is drawn as
13
+ * its profile or as its sticks and never as both. Drawn together, the sticks
14
+ * stand inside the very peak shapes they were picked from, and the pair reads as
15
+ * two spectra laid over each other — a peak top that says one thing in the
16
+ * outline and another in the stick beside it. Which peaks the picking found is
17
+ * asked of the label toggle instead, which marks their tops over whichever trace
18
+ * is on screen.
19
+ *
20
+ * Hence the cycle: a hidden trace comes back drawn *and* selected and takes the
21
+ * other trace off, a trace drawn beside somebody else's selection takes the
22
+ * selection over, and only a click on a trace that already has both takes the
23
+ * spectrum off the chart. The rule lives here rather than in the row so it can
24
+ * be read in one place and tested without mounting anything.
25
+ */
26
+ import type { SpectrumVisibility } from './massReducer.ts';
27
+ /** Which of a spectrum's two traces an icon stands for. */
28
+ export type MassTraceKind = 'profile' | 'centroid';
29
+ /**
30
+ * What one trace icon currently says.
31
+ *
32
+ * `drawn` is the state a plain checkbox cannot tell from `selected`: the trace
33
+ * is on the chart, but the labels, the acquisition table and the peak list are
34
+ * about some other spectrum.
35
+ */
36
+ export type TraceIconState = 'hidden' | 'drawn' | 'selected';
37
+ /** What a click on a trace icon asks the viewer for. */
38
+ export interface TraceIconClick {
39
+ /**
40
+ * The visibility to ask of the spectrum. It names **both** traces every time,
41
+ * because they are an either/or: picking one is also the gesture that puts the
42
+ * other away, and a change that mentioned only the trace clicked would leave
43
+ * the two drawn together for exactly as long as nobody clicked the other.
44
+ */
45
+ visibility: SpectrumVisibility;
46
+ /**
47
+ * Whether the spectrum becomes the one the panels act on. `false` means the
48
+ * selection is left exactly as it is rather than cleared: a spectrum whose
49
+ * last trace has just been hidden is still the one being worked on, and its
50
+ * acquisition table has no business emptying itself because of a click on an
51
+ * eye.
52
+ */
53
+ select: boolean;
54
+ }
55
+ /**
56
+ * What a click on a trace icon asks for, given what the icon was saying.
57
+ *
58
+ * The click that hides a trace is the same click that would otherwise select
59
+ * it, which is why `select` and the visibility asked for always agree: any
60
+ * click leaving the spectrum on the chart also makes it the one being looked at,
61
+ * and the only click that takes it off is one on a trace that already had the
62
+ * selection.
63
+ * @param kind - The trace the icon stands for.
64
+ * @param state - What the icon was saying before the click.
65
+ * @returns The visibility to ask for, and whether to take the selection.
66
+ * @example
67
+ * nextTraceIconClick('centroid', 'drawn'); // { visibility: { showProfile: false, showCentroid: true }, select: true }
68
+ */
69
+ export declare function nextTraceIconClick(kind: MassTraceKind, state: TraceIconState): TraceIconClick;
70
+ /**
71
+ * What a trace icon says about a spectrum as it stands.
72
+ *
73
+ * Selection belongs to the spectrum rather than to either trace, so the icon of
74
+ * the drawn trace of the selected spectrum says `selected` while the other says
75
+ * `hidden` — which is the honest picture: it is that spectrum, not one of its
76
+ * traces, that the rest of the viewer is about.
77
+ * @param shown - Whether that trace is drawn.
78
+ * @param isSelected - Whether the spectrum is the one the panels act on.
79
+ * @returns The state the icon draws itself in.
80
+ */
81
+ export declare function traceIconState(shown: boolean, isSelected: boolean): TraceIconState;
82
+ //# sourceMappingURL=traceIcon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"traceIcon.d.ts","sourceRoot":"","sources":["../../../src/mass/core/traceIcon.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAE3D,2DAA2D;AAC3D,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,UAAU,CAAC;AAEnD;;;;;;GAMG;AACH,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,OAAO,GAAG,UAAU,CAAC;AAE7D,wDAAwD;AACxD,MAAM,WAAW,cAAc;IAC7B;;;;;OAKG;IACH,UAAU,EAAE,kBAAkB,CAAC;IAC/B;;;;;;OAMG;IACH,MAAM,EAAE,OAAO,CAAC;CACjB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,aAAa,EACnB,KAAK,EAAE,cAAc,GACpB,cAAc,CAShB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,OAAO,EACd,UAAU,EAAE,OAAO,GAClB,cAAc,CAGhB"}
@@ -0,0 +1,66 @@
1
+ /**
2
+ * The three things one trace icon has to say, and what a click on it asks for.
3
+ *
4
+ * A spectrum row carries two of these icons, one for the continuous trace and
5
+ * one for the centroid sticks, and each of them answers two questions at once:
6
+ * is this trace on the chart, and is this the spectrum everything else is
7
+ * about. The second is not decoration — the selected spectrum is the one the
8
+ * peak labels are written on, the one the acquisition table describes and the
9
+ * one the peak list holds — so a plain visibility checkbox would either lose it
10
+ * or need a second control beside it in a row that has no room for one.
11
+ *
12
+ * The two icons are an **either/or**, not two checkboxes: a spectrum is drawn as
13
+ * its profile or as its sticks and never as both. Drawn together, the sticks
14
+ * stand inside the very peak shapes they were picked from, and the pair reads as
15
+ * two spectra laid over each other — a peak top that says one thing in the
16
+ * outline and another in the stick beside it. Which peaks the picking found is
17
+ * asked of the label toggle instead, which marks their tops over whichever trace
18
+ * is on screen.
19
+ *
20
+ * Hence the cycle: a hidden trace comes back drawn *and* selected and takes the
21
+ * other trace off, a trace drawn beside somebody else's selection takes the
22
+ * selection over, and only a click on a trace that already has both takes the
23
+ * spectrum off the chart. The rule lives here rather than in the row so it can
24
+ * be read in one place and tested without mounting anything.
25
+ */
26
+ /**
27
+ * What a click on a trace icon asks for, given what the icon was saying.
28
+ *
29
+ * The click that hides a trace is the same click that would otherwise select
30
+ * it, which is why `select` and the visibility asked for always agree: any
31
+ * click leaving the spectrum on the chart also makes it the one being looked at,
32
+ * and the only click that takes it off is one on a trace that already had the
33
+ * selection.
34
+ * @param kind - The trace the icon stands for.
35
+ * @param state - What the icon was saying before the click.
36
+ * @returns The visibility to ask for, and whether to take the selection.
37
+ * @example
38
+ * nextTraceIconClick('centroid', 'drawn'); // { visibility: { showProfile: false, showCentroid: true }, select: true }
39
+ */
40
+ export function nextTraceIconClick(kind, state) {
41
+ const show = state !== 'selected';
42
+ return {
43
+ visibility: {
44
+ showProfile: show && kind === 'profile',
45
+ showCentroid: show && kind === 'centroid',
46
+ },
47
+ select: show,
48
+ };
49
+ }
50
+ /**
51
+ * What a trace icon says about a spectrum as it stands.
52
+ *
53
+ * Selection belongs to the spectrum rather than to either trace, so the icon of
54
+ * the drawn trace of the selected spectrum says `selected` while the other says
55
+ * `hidden` — which is the honest picture: it is that spectrum, not one of its
56
+ * traces, that the rest of the viewer is about.
57
+ * @param shown - Whether that trace is drawn.
58
+ * @param isSelected - Whether the spectrum is the one the panels act on.
59
+ * @returns The state the icon draws itself in.
60
+ */
61
+ export function traceIconState(shown, isSelected) {
62
+ if (!shown)
63
+ return 'hidden';
64
+ return isSelected ? 'selected' : 'drawn';
65
+ }
66
+ //# sourceMappingURL=traceIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"traceIcon.js","sourceRoot":"","sources":["../../../src/mass/core/traceIcon.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAmCH;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,kBAAkB,CAChC,IAAmB,EACnB,KAAqB;IAErB,MAAM,IAAI,GAAG,KAAK,KAAK,UAAU,CAAC;IAClC,OAAO;QACL,UAAU,EAAE;YACV,WAAW,EAAE,IAAI,IAAI,IAAI,KAAK,SAAS;YACvC,YAAY,EAAE,IAAI,IAAI,IAAI,KAAK,UAAU;SAC1C;QACD,MAAM,EAAE,IAAI;KACb,CAAC;AACJ,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,cAAc,CAC5B,KAAc,EACd,UAAmB;IAEnB,IAAI,CAAC,KAAK;QAAE,OAAO,QAAQ,CAAC;IAC5B,OAAO,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC;AAC3C,CAAC"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * The weakest evidence of resolution, and the only one a bare peak table has:
3
+ * how many decimals its masses were written with.
4
+ *
5
+ * Weak because the decimals say what the exporter wrote rather than what the
6
+ * instrument resolved — an ion trap that exports four decimals is read as high
7
+ * resolution by it, and nothing in the numbers can tell that apart. Whole
8
+ * numbers are the case it is sure of: a table of them is a nominal-mass table
9
+ * whatever wrote it.
10
+ */
11
+ import type { MassResolution } from './massResolution.ts';
12
+ /**
13
+ * The most decimals a written mass is looked at for.
14
+ *
15
+ * Beyond six the digits are the noise of a binary fraction rather than anything
16
+ * an exporter wrote, and every mass computed rather than typed reaches it.
17
+ */
18
+ export declare const MAXIMUM_WRITTEN_DECIMALS = 6;
19
+ /**
20
+ * The resolution the written masses imply.
21
+ *
22
+ * Whole numbers are a nominal-mass table; one or two decimals are a coarse
23
+ * measurement; three or more are taken for a resolved one. The decimals the
24
+ * masses were written with are also how many they are shown with, up to four.
25
+ * @param masses - The m/z of every peak, as they were read.
26
+ * @returns The verdict, `nominal` for a spectrum holding no peak at all.
27
+ */
28
+ export declare function writtenResolution(masses: Float64Array): MassResolution;
29
+ /**
30
+ * How many decimals the masses were written with, the most any of them needs.
31
+ *
32
+ * Tested against a tolerance rather than for equality, because a JCAMP scales
33
+ * every value by its `##XFACTOR=` on the way in and `1631 × 0.1` is
34
+ * `163.10000000000002` — one decimal written, sixteen in the double. The count
35
+ * only ever grows, so each mass is tested from the decimals already found.
36
+ * @param masses - The m/z of every peak.
37
+ * @returns The decimals, from 0 to `MAXIMUM_WRITTEN_DECIMALS`.
38
+ */
39
+ export declare function writtenDecimals(masses: Float64Array): number;
40
+ //# sourceMappingURL=writtenResolution.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"writtenResolution.d.ts","sourceRoot":"","sources":["../../../src/mass/core/writtenResolution.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAG1D;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,IAAI,CAAC;AAE1C;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,YAAY,GAAG,cAAc,CAStE;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAU5D"}
@@ -0,0 +1,77 @@
1
+ /**
2
+ * The weakest evidence of resolution, and the only one a bare peak table has:
3
+ * how many decimals its masses were written with.
4
+ *
5
+ * Weak because the decimals say what the exporter wrote rather than what the
6
+ * instrument resolved — an ion trap that exports four decimals is read as high
7
+ * resolution by it, and nothing in the numbers can tell that apart. Whole
8
+ * numbers are the case it is sure of: a table of them is a nominal-mass table
9
+ * whatever wrote it.
10
+ */
11
+ import { MZ_DECIMALS } from "./massResolution.js";
12
+ /**
13
+ * The most decimals a written mass is looked at for.
14
+ *
15
+ * Beyond six the digits are the noise of a binary fraction rather than anything
16
+ * an exporter wrote, and every mass computed rather than typed reaches it.
17
+ */
18
+ export const MAXIMUM_WRITTEN_DECIMALS = 6;
19
+ /**
20
+ * The resolution the written masses imply.
21
+ *
22
+ * Whole numbers are a nominal-mass table; one or two decimals are a coarse
23
+ * measurement; three or more are taken for a resolved one. The decimals the
24
+ * masses were written with are also how many they are shown with, up to four.
25
+ * @param masses - The m/z of every peak, as they were read.
26
+ * @returns The verdict, `nominal` for a spectrum holding no peak at all.
27
+ */
28
+ export function writtenResolution(masses) {
29
+ const written = writtenDecimals(masses);
30
+ const kind = written === 0 ? 'nominal' : written < 3 ? 'low' : 'high';
31
+ return {
32
+ kind,
33
+ resolvingPower: null,
34
+ basis: 'decimals',
35
+ decimals: Math.min(written, MZ_DECIMALS.high),
36
+ };
37
+ }
38
+ /**
39
+ * How many decimals the masses were written with, the most any of them needs.
40
+ *
41
+ * Tested against a tolerance rather than for equality, because a JCAMP scales
42
+ * every value by its `##XFACTOR=` on the way in and `1631 × 0.1` is
43
+ * `163.10000000000002` — one decimal written, sixteen in the double. The count
44
+ * only ever grows, so each mass is tested from the decimals already found.
45
+ * @param masses - The m/z of every peak.
46
+ * @returns The decimals, from 0 to `MAXIMUM_WRITTEN_DECIMALS`.
47
+ */
48
+ export function writtenDecimals(masses) {
49
+ let most = 0;
50
+ for (const mass of masses) {
51
+ if (!Number.isFinite(mass))
52
+ continue;
53
+ while (most < MAXIMUM_WRITTEN_DECIMALS && !isWrittenWith(mass, most)) {
54
+ most++;
55
+ }
56
+ if (most === MAXIMUM_WRITTEN_DECIMALS)
57
+ break;
58
+ }
59
+ return most;
60
+ }
61
+ /**
62
+ * Whether a mass was written with no more than so many decimals.
63
+ * @param mass - The mass.
64
+ * @param decimals - How many decimals.
65
+ * @returns Whether rounding it there changes nothing an exporter wrote.
66
+ */
67
+ function isWrittenWith(mass, decimals) {
68
+ return Math.abs(mass - Number(mass.toFixed(decimals))) <= DECIMAL_EPSILON;
69
+ }
70
+ /**
71
+ * How far a mass may sit from its rounding and still be written that way.
72
+ *
73
+ * Far below the smallest step tested, a millionth, and far above the error a
74
+ * scaling by `##XFACTOR=` leaves in a double, which is around 1e-13 at m/z 1000.
75
+ */
76
+ const DECIMAL_EPSILON = 1e-8;
77
+ //# sourceMappingURL=writtenResolution.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"writtenResolution.js","sourceRoot":"","sources":["../../../src/mass/core/writtenResolution.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC;AAE1C;;;;;;;;GAQG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAAoB;IACpD,MAAM,OAAO,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;IACxC,MAAM,IAAI,GAAG,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC;IACtE,OAAO;QACL,IAAI;QACJ,cAAc,EAAE,IAAI;QACpB,KAAK,EAAE,UAAU;QACjB,QAAQ,EAAE,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,WAAW,CAAC,IAAI,CAAC;KAC9C,CAAC;AACJ,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,eAAe,CAAC,MAAoB;IAClD,IAAI,IAAI,GAAG,CAAC,CAAC;IACb,KAAK,MAAM,IAAI,IAAI,MAAM,EAAE,CAAC;QAC1B,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;YAAE,SAAS;QACrC,OAAO,IAAI,GAAG,wBAAwB,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC;YACrE,IAAI,EAAE,CAAC;QACT,CAAC;QACD,IAAI,IAAI,KAAK,wBAAwB;YAAE,MAAM;IAC/C,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;GAKG;AACH,SAAS,aAAa,CAAC,IAAY,EAAE,QAAgB;IACnD,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,eAAe,CAAC;AAC5E,CAAC;AAED;;;;;GAKG;AACH,MAAM,eAAe,GAAG,IAAI,CAAC"}
@@ -0,0 +1,16 @@
1
+ export interface MassAboutDialogProps {
2
+ /** Whether the dialog is open. */
3
+ isOpen: boolean;
4
+ /** Close it. */
5
+ onClose: () => void;
6
+ }
7
+ /**
8
+ * What the viewer is, what it stands on, and who is owed for it.
9
+ *
10
+ * The credits are read from the shared registry rather than written here, so
11
+ * every page of the family names each work the same way, licence included.
12
+ * @param props - Component props.
13
+ * @returns The dialog.
14
+ */
15
+ export declare function MassAboutDialog(props: MassAboutDialogProps): import("react").JSX.Element;
16
+ //# sourceMappingURL=MassAboutDialog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MassAboutDialog.d.ts","sourceRoot":"","sources":["../../../src/mass/ui/MassAboutDialog.tsx"],"names":[],"mappings":"AAQA,MAAM,WAAW,oBAAoB;IACnC,kCAAkC;IAClC,MAAM,EAAE,OAAO,CAAC;IAChB,gBAAgB;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,+BAkC1D"}
@@ -0,0 +1,44 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Dialog, DialogBody } from '@blueprintjs/core';
3
+ import { credits } from "../../credits/core/credits.js";
4
+ import { CreditsList } from "../../credits/ui/CreditsList.js";
5
+ import { massCommands } from "../core/massCommands.js";
6
+ import { MassLogo } from "./MassLogo.js";
7
+ /**
8
+ * What the viewer is, what it stands on, and who is owed for it.
9
+ *
10
+ * The credits are read from the shared registry rather than written here, so
11
+ * every page of the family names each work the same way, licence included.
12
+ * @param props - Component props.
13
+ * @returns The dialog.
14
+ */
15
+ export function MassAboutDialog(props) {
16
+ const { isOpen, onClose } = props;
17
+ return (_jsx(Dialog, { isOpen: isOpen, onClose: onClose, title: massCommands.about.title, icon: _jsx(MassLogo, { size: 20 }), style: dialogStyle, children: _jsxs(DialogBody, { children: [_jsxs("div", { style: brandStyle, children: [_jsx(MassLogo, { size: 64 }), _jsxs("div", { children: [_jsx("p", { style: leadStyle, children: "react-cheminfo/mass" }), _jsx("p", { style: paragraphStyle, children: "Draws mass spectra read from JCAMP-DX and text files, picks the peaks of a profile, labels them as you zoom, and says whether each spectrum is high resolution." })] })] }), _jsx("h4", { style: headingStyle, children: "Built on" }), _jsx(CreditsList, { entries: MASS_CREDITS }), _jsxs("p", { style: paragraphStyle, children: ["The ", _jsx("strong", { children: "colours" }), " are Okabe and Ito's colour-universal palette, so two traces stay distinguishable for a reader with a colour vision deficiency."] })] }) }));
18
+ }
19
+ /** Every work the viewer borrows, in the order it reads a file through them. */
20
+ const MASS_CREDITS = credits([
21
+ 'jcampconverter',
22
+ 'xy-parser',
23
+ 'ms-spectrum',
24
+ 'ml-gsd',
25
+ 'ml-spectra-processing',
26
+ 'convert-to-jcamp',
27
+ 'react-mf',
28
+ 'react-science',
29
+ 'blueprint',
30
+ ]);
31
+ const dialogStyle = { width: 'min(680px, 92vw)' };
32
+ const brandStyle = {
33
+ display: 'flex',
34
+ alignItems: 'flex-start',
35
+ gap: 16,
36
+ };
37
+ const leadStyle = {
38
+ margin: '0 0 4px',
39
+ fontWeight: 600,
40
+ fontSize: 16,
41
+ };
42
+ const paragraphStyle = { margin: '0 0 6px' };
43
+ const headingStyle = { margin: '14px 0 4px' };
44
+ //# sourceMappingURL=MassAboutDialog.js.map
@@ -0,0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C;AAEH,MAAM,WAAW,GAAG,EAAE,KAAK,EAAE,kBAAkB,EAAW,CAAC;AAE3D,MAAM,UAAU,GAAG;IACjB,OAAO,EAAE,MAAM;IACf,UAAU,EAAE,YAAY;IACxB,GAAG,EAAE,EAAE;CACC,CAAC;AAEX,MAAM,SAAS,GAAG;IAChB,MAAM,EAAE,SAAS;IACjB,UAAU,EAAE,GAAG;IACf,QAAQ,EAAE,EAAE;CACJ,CAAC;AAEX,MAAM,cAAc,GAAG,EAAE,MAAM,EAAE,SAAS,EAAW,CAAC;AAEtD,MAAM,YAAY,GAAG,EAAE,MAAM,EAAE,YAAY,EAAW,CAAC"}
@@ -0,0 +1,46 @@
1
+ import type { MassPlotClick } from '../core/massEditorApi.ts';
2
+ export interface MassCanvasProps {
3
+ /**
4
+ * The m/z of the peak the pointer is resting on, wherever it was hovered —
5
+ * the chart or the peak table.
6
+ * @default null
7
+ */
8
+ highlightMz?: number | null;
9
+ /**
10
+ * Told which peak the pointer has come to rest on over the chart.
11
+ * @default undefined
12
+ */
13
+ onHighlight?: (mz: number | null) => void;
14
+ /**
15
+ * The `id` put on the box the chart is drawn in, which the "Save figure"
16
+ * panel is pointed at.
17
+ * @default undefined
18
+ */
19
+ chartId?: string;
20
+ /**
21
+ * Told of a click on the plot, with the spectrum selected at that moment.
22
+ * @default undefined
23
+ */
24
+ onPlotClick?: (click: MassPlotClick) => void;
25
+ /**
26
+ * Read files dropped on the chart.
27
+ * @default undefined — a drop is left to the page
28
+ */
29
+ onDropFiles?: (files: File[]) => void;
30
+ }
31
+ /**
32
+ * The chart, and the status bar under it.
33
+ *
34
+ * This is where the state meets the drawing: the chart holds nothing, so
35
+ * everything it draws is read out of the state here and every gesture it reports
36
+ * is written back. The window in particular goes **both** ways — the chart is
37
+ * told what to show and reports what it arrives at — which is what lets a toolbar
38
+ * button, a row of the peak table and a drag all move it.
39
+ *
40
+ * The chart is also where files are dropped, because that is where a chemist
41
+ * expects the spectrum to land; the box is outlined while one is held over it.
42
+ * @param props - Component props.
43
+ * @returns The canvas.
44
+ */
45
+ export declare function MassCanvas(props: MassCanvasProps): import("react").JSX.Element;
46
+ //# sourceMappingURL=MassCanvas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MassCanvas.d.ts","sourceRoot":"","sources":["../../../src/mass/ui/MassCanvas.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAQ9D,MAAM,WAAW,eAAe;IAC9B;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC1C;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IAC7C;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,IAAI,CAAC;CACvC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,+BA4FhD"}
@@ -0,0 +1,84 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useCallback, useMemo, useState } from 'react';
3
+ import { MassChart } from "./MassChart.js";
4
+ import { MassStatusBar } from "./MassStatusBar.js";
5
+ import { useMassActions, useMassEditorState } from "./massStateContext.js";
6
+ /**
7
+ * The chart, and the status bar under it.
8
+ *
9
+ * This is where the state meets the drawing: the chart holds nothing, so
10
+ * everything it draws is read out of the state here and every gesture it reports
11
+ * is written back. The window in particular goes **both** ways — the chart is
12
+ * told what to show and reports what it arrives at — which is what lets a toolbar
13
+ * button, a row of the peak table and a drag all move it.
14
+ *
15
+ * The chart is also where files are dropped, because that is where a chemist
16
+ * expects the spectrum to land; the box is outlined while one is held over it.
17
+ * @param props - Component props.
18
+ * @returns The canvas.
19
+ */
20
+ export function MassCanvas(props) {
21
+ const { highlightMz = null, onHighlight, chartId, onPlotClick, onDropFiles, } = props;
22
+ const { state, visibleSpectra } = useMassEditorState();
23
+ const actions = useMassActions();
24
+ const { domain, tool, selectedId } = state.view;
25
+ const { showLabels, labelLimit, showCharges, mzDecimals } = state.settings;
26
+ const [isDropping, setIsDropping] = useState(false);
27
+ const onDomainChange = useCallback((next) => actions.setDomain(next), [actions]);
28
+ const onPeakHover = useMemo(() => onHighlight === undefined
29
+ ? undefined
30
+ : (peak) => onHighlight(peak?.mz ?? null), [onHighlight]);
31
+ // Which spectrum was selected is the viewer's to say, not the chart's: the
32
+ // chart only knows where the press landed.
33
+ const onClick = useMemo(() => onPlotClick === undefined
34
+ ? undefined
35
+ : (mz, peak) => onPlotClick({
36
+ mz,
37
+ peakMz: peak?.mz ?? null,
38
+ spectrumId: selectedId,
39
+ }), [onPlotClick, selectedId]);
40
+ const drop = onDropFiles === undefined
41
+ ? {}
42
+ : {
43
+ onDragOver: (event) => {
44
+ if (!event.dataTransfer.types.includes('Files'))
45
+ return;
46
+ // Without this the browser opens the file in place of the page.
47
+ event.preventDefault();
48
+ event.dataTransfer.dropEffect = 'copy';
49
+ if (!isDropping)
50
+ setIsDropping(true);
51
+ },
52
+ onDragLeave: () => setIsDropping(false),
53
+ onDrop: (event) => {
54
+ event.preventDefault();
55
+ setIsDropping(false);
56
+ const files = [...event.dataTransfer.files];
57
+ if (files.length > 0)
58
+ onDropFiles(files);
59
+ },
60
+ };
61
+ return (_jsxs("div", { style: rootStyle, children: [_jsx("div", { id: chartId, style: isDropping ? droppingChartStyle : chartStyle, ...drop, children: _jsx(MassChart, { spectra: visibleSpectra, labelledId: selectedId, showLabels: showLabels, labelLimit: labelLimit, showCharges: showCharges, ...(mzDecimals === 'auto' ? {} : { mzDecimals }), highlightMz: highlightMz, domain: domain, onDomainChange: onDomainChange, drag: tool === 'box' ? 'box' : 'xAxis',
62
+ // The shell runs `f` through its command table, where it is listed.
63
+ answersKeys: false, emphasisedId: visibleSpectra.length > 1 ? selectedId : null, ...(onPeakHover === undefined ? {} : { onPeakHover }), ...(onClick === undefined ? {} : { onPlotClick: onClick }) }) }), _jsx(MassStatusBar, {})] }));
64
+ }
65
+ const rootStyle = {
66
+ display: 'flex',
67
+ flexDirection: 'column',
68
+ flex: '1 1 1px',
69
+ minWidth: 0,
70
+ minHeight: 0,
71
+ };
72
+ /** The chart takes what the status bar does not. */
73
+ const chartStyle = {
74
+ flex: '1 1 1px',
75
+ minHeight: 0,
76
+ outline: '2px dashed transparent',
77
+ outlineOffset: -4,
78
+ };
79
+ /** The same box while a file is held over it, saying where it will land. */
80
+ const droppingChartStyle = {
81
+ ...chartStyle,
82
+ outlineColor: 'var(--accent, currentColor)',
83
+ };
84
+ //# sourceMappingURL=MassCanvas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MassCanvas.js","sourceRoot":"","sources":["../../../src/mass/ui/MassCanvas.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAMvD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAiB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAqB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAgC3E;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,UAAU,CAAC,KAAsB;IAC/C,MAAM,EACJ,WAAW,GAAG,IAAI,EAClB,WAAW,EACX,OAAO,EACP,WAAW,EACX,WAAW,GACZ,GAAG,KAAK,CAAC;IACV,MAAM,EAAE,KAAK,EAAE,cAAc,EAAE,GAAG,kBAAkB,EAAE,CAAC;IACvD,MAAM,OAAO,GAAG,cAAc,EAAE,CAAC;IACjC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG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AC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,OAAO,EAAE,CAAC,GAC3D,GACE,EACN,KAAC,aAAa,KAAG,IACb,CACP,CAAC;AACJ,CAAC;AAED,MAAM,SAAS,GAAG;IAChB,OAAO,EAAE,MAAM;IACf,aAAa,EAAE,QAAQ;IACvB,IAAI,EAAE,SAAS;IACf,QAAQ,EAAE,CAAC;IACX,SAAS,EAAE,CAAC;CACJ,CAAC;AAEX,oDAAoD;AACpD,MAAM,UAAU,GAAG;IACjB,IAAI,EAAE,SAAS;IACf,SAAS,EAAE,CAAC;IACZ,OAAO,EAAE,wBAAwB;IACjC,aAAa,EAAE,CAAC,CAAC;CACT,CAAC;AAEX,4EAA4E;AAC5E,MAAM,kBAAkB,GAAG;IACzB,GAAG,UAAU;IACb,YAAY,EAAE,6BAA6B;CACnC,CAAC"}
@@ -0,0 +1,21 @@
1
+ import type { ReactElement } from 'react';
2
+ import type { MassChartProps } from './massChartProps.ts';
3
+ /**
4
+ * The chart: every layer of a mass spectrum, in one SVG.
5
+ *
6
+ * The axes go under the data, so a grid line is never read as a peak. Only the
7
+ * data band is clipped, so a zoomed trace stops at the plot edge while the
8
+ * labels over the tallest peaks are allowed out over the margin — clip those and
9
+ * the base peak of every spectrum loses its label. The guide, the drag rectangle
10
+ * and the crosshair go over everything, because each answers a question being
11
+ * asked right now.
12
+ *
13
+ * Nothing is held here. The spectra, what is labelled, what is being looked at
14
+ * and the window are all props, and every gesture comes back out as a callback
15
+ * — so one component draws an editor's chart, a report page's single spectrum
16
+ * and a test.
17
+ * @param props - Component props.
18
+ * @returns The chart.
19
+ */
20
+ export declare function MassChart(props: MassChartProps): ReactElement;
21
+ //# sourceMappingURL=MassChart.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MassChart.d.ts","sourceRoot":"","sources":["../../../src/mass/ui/MassChart.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAiB1C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAI1D;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,GAAG,YAAY,CA8K7D"}