react-cheminfo 0.65.0 → 0.67.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 (466) hide show
  1. package/README.md +33 -17
  2. package/lib/download/ui/FigureDownloadPanel.d.ts +7 -1
  3. package/lib/download/ui/FigureDownloadPanel.d.ts.map +1 -1
  4. package/lib/download/ui/FigureDownloadPanel.js +2 -2
  5. package/lib/download/ui/FigureDownloadPanel.js.map +1 -1
  6. package/lib/ecosystem/core/sites.js +3 -3
  7. package/lib/ecosystem/core/sites.js.map +1 -1
  8. package/lib/ecosystem/core/types.d.ts +1 -1
  9. package/lib/ecosystem/core/types.d.ts.map +1 -1
  10. package/lib/ecosystem/ui/glyphs.js +1 -1
  11. package/lib/ecosystem/ui/glyphs.js.map +1 -1
  12. package/lib/i18n/core/chromeCatalog.d.ts +1 -1
  13. package/lib/i18n/core/chromeCatalog.d.ts.map +1 -1
  14. package/lib/i18n/core/messageCatalog.d.ts +2 -2
  15. package/lib/i18n/vite/localeCatalog.d.ts +1 -1
  16. package/lib/ir/core/analysisSpectra.d.ts +23 -6
  17. package/lib/ir/core/analysisSpectra.d.ts.map +1 -1
  18. package/lib/ir/core/analysisSpectra.js.map +1 -1
  19. package/lib/ir/core/bandLabelPlan.d.ts.map +1 -1
  20. package/lib/ir/core/bandLabelPlan.js +11 -6
  21. package/lib/ir/core/bandLabelPlan.js.map +1 -1
  22. package/lib/ir/core/index.d.ts +15 -11
  23. package/lib/ir/core/index.d.ts.map +1 -1
  24. package/lib/ir/core/index.js +9 -6
  25. package/lib/ir/core/index.js.map +1 -1
  26. package/lib/ir/core/irBand.d.ts +45 -14
  27. package/lib/ir/core/irBand.d.ts.map +1 -1
  28. package/lib/ir/core/irBand.js +28 -6
  29. package/lib/ir/core/irBand.js.map +1 -1
  30. package/lib/ir/core/irCommands.d.ts +11 -0
  31. package/lib/ir/core/irCommands.d.ts.map +1 -1
  32. package/lib/ir/core/irCommands.js +11 -1
  33. package/lib/ir/core/irCommands.js.map +1 -1
  34. package/lib/ir/core/irDomain.d.ts +4 -3
  35. package/lib/ir/core/irDomain.d.ts.map +1 -1
  36. package/lib/ir/core/irDomain.js +10 -7
  37. package/lib/ir/core/irDomain.js.map +1 -1
  38. package/lib/ir/core/irEditorApi.d.ts +12 -0
  39. package/lib/ir/core/irEditorApi.d.ts.map +1 -1
  40. package/lib/ir/core/irFormat.d.ts +14 -2
  41. package/lib/ir/core/irFormat.d.ts.map +1 -1
  42. package/lib/ir/core/irFormat.js +33 -4
  43. package/lib/ir/core/irFormat.js.map +1 -1
  44. package/lib/ir/core/irMode.d.ts +35 -8
  45. package/lib/ir/core/irMode.d.ts.map +1 -1
  46. package/lib/ir/core/irMode.js +38 -10
  47. package/lib/ir/core/irMode.js.map +1 -1
  48. package/lib/ir/core/irReducer.d.ts +2 -30
  49. package/lib/ir/core/irReducer.d.ts.map +1 -1
  50. package/lib/ir/core/irReducer.js +1 -24
  51. package/lib/ir/core/irReducer.js.map +1 -1
  52. package/lib/ir/core/irSidePanels.d.ts +7 -1
  53. package/lib/ir/core/irSidePanels.d.ts.map +1 -1
  54. package/lib/ir/core/irSpectrum.d.ts +52 -26
  55. package/lib/ir/core/irSpectrum.d.ts.map +1 -1
  56. package/lib/ir/core/irSpectrum.js +21 -15
  57. package/lib/ir/core/irSpectrum.js.map +1 -1
  58. package/lib/ir/core/irState.d.ts +46 -5
  59. package/lib/ir/core/irState.d.ts.map +1 -1
  60. package/lib/ir/core/irState.js +38 -1
  61. package/lib/ir/core/irState.js.map +1 -1
  62. package/lib/ir/core/irTechnique.d.ts +94 -0
  63. package/lib/ir/core/irTechnique.d.ts.map +1 -0
  64. package/lib/ir/core/irTechnique.js +87 -0
  65. package/lib/ir/core/irTechnique.js.map +1 -0
  66. package/lib/ir/core/irTechniqueCommands.d.ts +26 -0
  67. package/lib/ir/core/irTechniqueCommands.d.ts.map +1 -0
  68. package/lib/ir/core/irTechniqueCommands.js +68 -0
  69. package/lib/ir/core/irTechniqueCommands.js.map +1 -0
  70. package/lib/ir/core/pickBands.d.ts +6 -5
  71. package/lib/ir/core/pickBands.d.ts.map +1 -1
  72. package/lib/ir/core/pickBands.js +49 -26
  73. package/lib/ir/core/pickBands.js.map +1 -1
  74. package/lib/ir/core/ramanBands.d.ts +30 -0
  75. package/lib/ir/core/ramanBands.d.ts.map +1 -0
  76. package/lib/ir/core/ramanBands.js +83 -0
  77. package/lib/ir/core/ramanBands.js.map +1 -0
  78. package/lib/ir/core/spectrumJcamp.d.ts +10 -5
  79. package/lib/ir/core/spectrumJcamp.d.ts.map +1 -1
  80. package/lib/ir/core/spectrumJcamp.js +63 -15
  81. package/lib/ir/core/spectrumJcamp.js.map +1 -1
  82. package/lib/ir/core/toIrSpectrum.d.ts.map +1 -1
  83. package/lib/ir/core/toIrSpectrum.js +17 -2
  84. package/lib/ir/core/toIrSpectrum.js.map +1 -1
  85. package/lib/ir/ui/BandRow.d.ts +30 -0
  86. package/lib/ir/ui/BandRow.d.ts.map +1 -0
  87. package/lib/ir/ui/BandRow.js +42 -0
  88. package/lib/ir/ui/BandRow.js.map +1 -0
  89. package/lib/ir/ui/BandsPanel.d.ts +4 -0
  90. package/lib/ir/ui/BandsPanel.d.ts.map +1 -1
  91. package/lib/ir/ui/BandsPanel.js +14 -59
  92. package/lib/ir/ui/BandsPanel.js.map +1 -1
  93. package/lib/ir/ui/IrAboutDialog.d.ts +7 -0
  94. package/lib/ir/ui/IrAboutDialog.d.ts.map +1 -1
  95. package/lib/ir/ui/IrAboutDialog.js +16 -3
  96. package/lib/ir/ui/IrAboutDialog.js.map +1 -1
  97. package/lib/ir/ui/IrCanvas.d.ts +7 -0
  98. package/lib/ir/ui/IrCanvas.d.ts.map +1 -1
  99. package/lib/ir/ui/IrCanvas.js +9 -4
  100. package/lib/ir/ui/IrCanvas.js.map +1 -1
  101. package/lib/ir/ui/IrChart.d.ts +2 -1
  102. package/lib/ir/ui/IrChart.d.ts.map +1 -1
  103. package/lib/ir/ui/IrChart.js +22 -21
  104. package/lib/ir/ui/IrChart.js.map +1 -1
  105. package/lib/ir/ui/IrCommandProvider.d.ts +7 -0
  106. package/lib/ir/ui/IrCommandProvider.d.ts.map +1 -1
  107. package/lib/ir/ui/IrCommandProvider.js +2 -2
  108. package/lib/ir/ui/IrCommandProvider.js.map +1 -1
  109. package/lib/ir/ui/IrCommandTooltip.d.ts +7 -0
  110. package/lib/ir/ui/IrCommandTooltip.d.ts.map +1 -1
  111. package/lib/ir/ui/IrCommandTooltip.js +3 -2
  112. package/lib/ir/ui/IrCommandTooltip.js.map +1 -1
  113. package/lib/ir/ui/IrDocumentationDialog.d.ts +8 -1
  114. package/lib/ir/ui/IrDocumentationDialog.d.ts.map +1 -1
  115. package/lib/ir/ui/IrDocumentationDialog.js +30 -7
  116. package/lib/ir/ui/IrDocumentationDialog.js.map +1 -1
  117. package/lib/ir/ui/IrEditor.d.ts +25 -5
  118. package/lib/ir/ui/IrEditor.d.ts.map +1 -1
  119. package/lib/ir/ui/IrEditor.js +3 -20
  120. package/lib/ir/ui/IrEditor.js.map +1 -1
  121. package/lib/ir/ui/IrHeader.d.ts.map +1 -1
  122. package/lib/ir/ui/IrHeader.js +5 -1
  123. package/lib/ir/ui/IrHeader.js.map +1 -1
  124. package/lib/ir/ui/IrLogo.d.ts +11 -3
  125. package/lib/ir/ui/IrLogo.d.ts.map +1 -1
  126. package/lib/ir/ui/IrLogo.js +14 -5
  127. package/lib/ir/ui/IrLogo.js.map +1 -1
  128. package/lib/ir/ui/IrShell.d.ts +9 -1
  129. package/lib/ir/ui/IrShell.d.ts.map +1 -1
  130. package/lib/ir/ui/IrShell.js +26 -74
  131. package/lib/ir/ui/IrShell.js.map +1 -1
  132. package/lib/ir/ui/IrSidePanel.d.ts +11 -0
  133. package/lib/ir/ui/IrSidePanel.d.ts.map +1 -1
  134. package/lib/ir/ui/IrSidePanel.js +12 -3
  135. package/lib/ir/ui/IrSidePanel.js.map +1 -1
  136. package/lib/ir/ui/IrStatusBar.d.ts +3 -2
  137. package/lib/ir/ui/IrStatusBar.d.ts.map +1 -1
  138. package/lib/ir/ui/IrStatusBar.js +14 -9
  139. package/lib/ir/ui/IrStatusBar.js.map +1 -1
  140. package/lib/ir/ui/IrToolbar.d.ts +3 -0
  141. package/lib/ir/ui/IrToolbar.d.ts.map +1 -1
  142. package/lib/ir/ui/IrToolbar.js +10 -3
  143. package/lib/ir/ui/IrToolbar.js.map +1 -1
  144. package/lib/ir/ui/IrTraces.d.ts +4 -1
  145. package/lib/ir/ui/IrTraces.d.ts.map +1 -1
  146. package/lib/ir/ui/IrTraces.js +2 -0
  147. package/lib/ir/ui/IrTraces.js.map +1 -1
  148. package/lib/ir/ui/RamanEditor.d.ts +64 -0
  149. package/lib/ir/ui/RamanEditor.d.ts.map +1 -0
  150. package/lib/ir/ui/RamanEditor.js +17 -0
  151. package/lib/ir/ui/RamanEditor.js.map +1 -0
  152. package/lib/ir/ui/SpectraPanel.d.ts.map +1 -1
  153. package/lib/ir/ui/SpectraPanel.js +2 -2
  154. package/lib/ir/ui/SpectraPanel.js.map +1 -1
  155. package/lib/ir/ui/SpectrumRow.d.ts +7 -0
  156. package/lib/ir/ui/SpectrumRow.d.ts.map +1 -1
  157. package/lib/ir/ui/SpectrumRow.js +4 -5
  158. package/lib/ir/ui/SpectrumRow.js.map +1 -1
  159. package/lib/ir/ui/VibrationalEditor.d.ts +62 -0
  160. package/lib/ir/ui/VibrationalEditor.d.ts.map +1 -0
  161. package/lib/ir/ui/VibrationalEditor.js +33 -0
  162. package/lib/ir/ui/VibrationalEditor.js.map +1 -0
  163. package/lib/ir/ui/bandsTsv.d.ts +19 -0
  164. package/lib/ir/ui/bandsTsv.d.ts.map +1 -0
  165. package/lib/ir/ui/bandsTsv.js +38 -0
  166. package/lib/ir/ui/bandsTsv.js.map +1 -0
  167. package/lib/ir/ui/index.d.ts +1 -0
  168. package/lib/ir/ui/index.d.ts.map +1 -1
  169. package/lib/ir/ui/index.js.map +1 -1
  170. package/lib/ir/ui/irActions.d.ts +3 -3
  171. package/lib/ir/ui/irActions.d.ts.map +1 -1
  172. package/lib/ir/ui/irChartProps.d.ts +21 -4
  173. package/lib/ir/ui/irChartProps.d.ts.map +1 -1
  174. package/lib/ir/ui/irChartProps.js +3 -2
  175. package/lib/ir/ui/irChartProps.js.map +1 -1
  176. package/lib/ir/ui/irCommandContext.d.ts +8 -0
  177. package/lib/ir/ui/irCommandContext.d.ts.map +1 -1
  178. package/lib/ir/ui/irCommandContext.js +14 -3
  179. package/lib/ir/ui/irCommandContext.js.map +1 -1
  180. package/lib/ir/ui/irHostPanels.d.ts +53 -0
  181. package/lib/ir/ui/irHostPanels.d.ts.map +1 -0
  182. package/lib/ir/ui/irHostPanels.js +41 -0
  183. package/lib/ir/ui/irHostPanels.js.map +1 -0
  184. package/lib/ir/ui/useIrEditor.d.ts +3 -3
  185. package/lib/ir/ui/useIrEditor.d.ts.map +1 -1
  186. package/lib/ir/ui/useIrEditor.js +13 -4
  187. package/lib/ir/ui/useIrEditor.js.map +1 -1
  188. package/lib/ir/ui/useIrHandle.d.ts +14 -0
  189. package/lib/ir/ui/useIrHandle.d.ts.map +1 -0
  190. package/lib/ir/ui/useIrHandle.js +39 -0
  191. package/lib/ir/ui/useIrHandle.js.map +1 -0
  192. package/lib/ir/ui/useIrSide.d.ts +27 -0
  193. package/lib/ir/ui/useIrSide.d.ts.map +1 -0
  194. package/lib/ir/ui/useIrSide.js +42 -0
  195. package/lib/ir/ui/useIrSide.js.map +1 -0
  196. package/lib/ir/ui/useIrText.d.ts +40 -0
  197. package/lib/ir/ui/useIrText.d.ts.map +1 -0
  198. package/lib/ir/ui/useIrText.js +118 -0
  199. package/lib/ir/ui/useIrText.js.map +1 -0
  200. package/lib/ir/ui/useIrZoom.d.ts +15 -0
  201. package/lib/ir/ui/useIrZoom.d.ts.map +1 -1
  202. package/lib/ir/ui/useIrZoom.js +6 -4
  203. package/lib/ir/ui/useIrZoom.js.map +1 -1
  204. package/lib/ir/ui/useValueAxisZoom.d.ts +20 -0
  205. package/lib/ir/ui/useValueAxisZoom.d.ts.map +1 -0
  206. package/lib/ir/ui/useValueAxisZoom.js +54 -0
  207. package/lib/ir/ui/useValueAxisZoom.js.map +1 -0
  208. package/lib/ir.d.ts +3 -0
  209. package/lib/ir.d.ts.map +1 -1
  210. package/lib/ir.js +3 -0
  211. package/lib/ir.js.map +1 -1
  212. package/lib/locales/de.json +29 -2
  213. package/lib/locales/en.json +29 -2
  214. package/lib/locales/es.json +29 -2
  215. package/lib/locales/fr.json +29 -2
  216. package/lib/locales/it.json +29 -2
  217. package/lib/molecule3d/core/animatedPng.d.ts +25 -0
  218. package/lib/molecule3d/core/animatedPng.d.ts.map +1 -0
  219. package/lib/molecule3d/core/animatedPng.js +59 -0
  220. package/lib/molecule3d/core/animatedPng.js.map +1 -0
  221. package/lib/molecule3d/core/file.d.ts +24 -0
  222. package/lib/molecule3d/core/file.d.ts.map +1 -0
  223. package/lib/molecule3d/core/file.js +2 -0
  224. package/lib/molecule3d/core/file.js.map +1 -0
  225. package/lib/molecule3d/core/index.d.ts +4 -1
  226. package/lib/molecule3d/core/index.d.ts.map +1 -1
  227. package/lib/molecule3d/core/index.js +1 -0
  228. package/lib/molecule3d/core/index.js.map +1 -1
  229. package/lib/molecule3d/core/settings.d.ts +0 -7
  230. package/lib/molecule3d/core/settings.d.ts.map +1 -1
  231. package/lib/molecule3d/core/settings.js.map +1 -1
  232. package/lib/molecule3d/ui/Molecule3DExport.d.ts +10 -2
  233. package/lib/molecule3d/ui/Molecule3DExport.d.ts.map +1 -1
  234. package/lib/molecule3d/ui/Molecule3DExport.js +15 -2
  235. package/lib/molecule3d/ui/Molecule3DExport.js.map +1 -1
  236. package/lib/molecule3d/ui/Molecule3DToolbar.js +9 -2
  237. package/lib/molecule3d/ui/Molecule3DToolbar.js.map +1 -1
  238. package/lib/molecule3d/ui/MoleculeCanvas3D.d.ts.map +1 -1
  239. package/lib/molecule3d/ui/MoleculeCanvas3D.js +23 -41
  240. package/lib/molecule3d/ui/MoleculeCanvas3D.js.map +1 -1
  241. package/lib/molecule3d/ui/drawScene.d.ts +2 -1
  242. package/lib/molecule3d/ui/drawScene.d.ts.map +1 -1
  243. package/lib/molecule3d/ui/drawScene.js.map +1 -1
  244. package/lib/molecule3d/ui/exportMoleculeImage.d.ts +15 -1
  245. package/lib/molecule3d/ui/exportMoleculeImage.d.ts.map +1 -1
  246. package/lib/molecule3d/ui/exportMoleculeImage.js +14 -2
  247. package/lib/molecule3d/ui/exportMoleculeImage.js.map +1 -1
  248. package/lib/molecule3d/ui/moleculeFrames.d.ts +47 -0
  249. package/lib/molecule3d/ui/moleculeFrames.d.ts.map +1 -0
  250. package/lib/molecule3d/ui/moleculeFrames.js +65 -0
  251. package/lib/molecule3d/ui/moleculeFrames.js.map +1 -0
  252. package/lib/molecule3d/ui/moleculeViewer3DProps.d.ts +14 -1
  253. package/lib/molecule3d/ui/moleculeViewer3DProps.d.ts.map +1 -1
  254. package/lib/molecule3d/ui/renderMolecule.d.ts +3 -3
  255. package/lib/molecule3d/ui/renderMolecule.d.ts.map +1 -1
  256. package/lib/molecule3d/ui/renderMolecule.js +2 -1
  257. package/lib/molecule3d/ui/renderMolecule.js.map +1 -1
  258. package/lib/molecule3d/ui/sceneDrawer.d.ts +2 -1
  259. package/lib/molecule3d/ui/sceneDrawer.d.ts.map +1 -1
  260. package/lib/molecule3d/ui/sceneDrawer.js +9 -1
  261. package/lib/molecule3d/ui/sceneDrawer.js.map +1 -1
  262. package/lib/molecule3d/ui/useImageExport.d.ts +8 -3
  263. package/lib/molecule3d/ui/useImageExport.d.ts.map +1 -1
  264. package/lib/molecule3d/ui/useImageExport.js +13 -4
  265. package/lib/molecule3d/ui/useImageExport.js.map +1 -1
  266. package/lib/molecule3d/ui/useMoleculeScene.d.ts +2 -1
  267. package/lib/molecule3d/ui/useMoleculeScene.d.ts.map +1 -1
  268. package/lib/molecule3d/ui/useMoleculeScene.js.map +1 -1
  269. package/lib/molecule3d/ui/useMoleculeViewer.d.ts +16 -0
  270. package/lib/molecule3d/ui/useMoleculeViewer.d.ts.map +1 -0
  271. package/lib/molecule3d/ui/useMoleculeViewer.js +37 -0
  272. package/lib/molecule3d/ui/useMoleculeViewer.js.map +1 -0
  273. package/lib/molecule3d/ui/usePolarSurfaceArea.d.ts +3 -3
  274. package/lib/molecule3d/ui/usePolarSurfaceArea.d.ts.map +1 -1
  275. package/lib/molecule3d/ui/usePolarSurfaceArea.js +4 -3
  276. package/lib/molecule3d/ui/usePolarSurfaceArea.js.map +1 -1
  277. package/lib/molecule3d/ui/viewer.d.ts +4 -1
  278. package/lib/molecule3d/ui/viewer.d.ts.map +1 -1
  279. package/lib/molecule3d/ui/viewer.js +21 -19
  280. package/lib/molecule3d/ui/viewer.js.map +1 -1
  281. package/lib/molecule3d/ui/viewerTypes.d.ts +6 -0
  282. package/lib/molecule3d/ui/viewerTypes.d.ts.map +1 -1
  283. package/lib/molstar/core/captureScene.d.ts +19 -1
  284. package/lib/molstar/core/captureScene.d.ts.map +1 -1
  285. package/lib/molstar/core/captureScene.js +57 -2
  286. package/lib/molstar/core/captureScene.js.map +1 -1
  287. package/lib/molstar/core/index.d.ts +5 -2
  288. package/lib/molstar/core/index.d.ts.map +1 -1
  289. package/lib/molstar/core/index.js +4 -2
  290. package/lib/molstar/core/index.js.map +1 -1
  291. package/lib/molstar/core/trajectory.d.ts +56 -0
  292. package/lib/molstar/core/trajectory.d.ts.map +1 -0
  293. package/lib/molstar/core/trajectory.js +96 -0
  294. package/lib/molstar/core/trajectory.js.map +1 -0
  295. package/lib/panel/ui/PanelRail.d.ts.map +1 -1
  296. package/lib/panel/ui/PanelRail.js +1 -1
  297. package/lib/panel/ui/PanelRail.js.map +1 -1
  298. package/lib/raman.d.ts +17 -0
  299. package/lib/raman.d.ts.map +1 -0
  300. package/lib/raman.js +12 -0
  301. package/lib/raman.js.map +1 -0
  302. package/lib/router/core/basePath.d.ts +2 -2
  303. package/lib/router/core/basePath.js +2 -2
  304. package/lib/router/core/siteAddresses.d.ts +1 -1
  305. package/lib/router/core/siteAddresses.js +1 -1
  306. package/lib/seo/core/siteFiles.js +1 -1
  307. package/lib/seo/core/siteFiles.js.map +1 -1
  308. package/lib/server/answerAddresses.d.ts +3 -3
  309. package/lib/server/answerAddresses.js +3 -3
  310. package/lib/structure/core/index.d.ts +2 -0
  311. package/lib/structure/core/index.d.ts.map +1 -1
  312. package/lib/structure/core/index.js +1 -0
  313. package/lib/structure/core/index.js.map +1 -1
  314. package/lib/structure/core/structureTransfer.d.ts +29 -0
  315. package/lib/structure/core/structureTransfer.d.ts.map +1 -0
  316. package/lib/structure/core/structureTransfer.js +26 -0
  317. package/lib/structure/core/structureTransfer.js.map +1 -0
  318. package/lib/structure/ui/EditorImportButton.d.ts +20 -0
  319. package/lib/structure/ui/EditorImportButton.d.ts.map +1 -0
  320. package/lib/structure/ui/EditorImportButton.js +24 -0
  321. package/lib/structure/ui/EditorImportButton.js.map +1 -0
  322. package/lib/structure/ui/EditorImportProblem.d.ts +17 -0
  323. package/lib/structure/ui/EditorImportProblem.d.ts.map +1 -0
  324. package/lib/structure/ui/EditorImportProblem.js +32 -0
  325. package/lib/structure/ui/EditorImportProblem.js.map +1 -0
  326. package/lib/structure/ui/StructureDrop.d.ts +39 -0
  327. package/lib/structure/ui/StructureDrop.d.ts.map +1 -0
  328. package/lib/structure/ui/StructureDrop.js +19 -0
  329. package/lib/structure/ui/StructureDrop.js.map +1 -0
  330. package/lib/structure/ui/StructureDropOverlay.d.ts +16 -0
  331. package/lib/structure/ui/StructureDropOverlay.d.ts.map +1 -0
  332. package/lib/structure/ui/StructureDropOverlay.js +29 -0
  333. package/lib/structure/ui/StructureDropOverlay.js.map +1 -0
  334. package/lib/structure/ui/StructureEditor.d.ts +3 -80
  335. package/lib/structure/ui/StructureEditor.d.ts.map +1 -1
  336. package/lib/structure/ui/StructureEditor.js +21 -33
  337. package/lib/structure/ui/StructureEditor.js.map +1 -1
  338. package/lib/structure/ui/importedStructure.d.ts +25 -0
  339. package/lib/structure/ui/importedStructure.d.ts.map +1 -0
  340. package/lib/structure/ui/importedStructure.js +74 -0
  341. package/lib/structure/ui/importedStructure.js.map +1 -0
  342. package/lib/structure/ui/index.d.ts +2 -0
  343. package/lib/structure/ui/index.d.ts.map +1 -1
  344. package/lib/structure/ui/index.js +1 -0
  345. package/lib/structure/ui/index.js.map +1 -1
  346. package/lib/structure/ui/structureEditorProps.d.ts +98 -0
  347. package/lib/structure/ui/structureEditorProps.d.ts.map +1 -0
  348. package/lib/structure/ui/structureEditorProps.js +2 -0
  349. package/lib/structure/ui/structureEditorProps.js.map +1 -0
  350. package/lib/structure/ui/useDebouncedChange.d.ts +16 -0
  351. package/lib/structure/ui/useDebouncedChange.d.ts.map +1 -0
  352. package/lib/structure/ui/useDebouncedChange.js +30 -0
  353. package/lib/structure/ui/useDebouncedChange.js.map +1 -0
  354. package/lib/structure/ui/useStructureDrop.d.ts +30 -0
  355. package/lib/structure/ui/useStructureDrop.d.ts.map +1 -0
  356. package/lib/structure/ui/useStructureDrop.js +49 -0
  357. package/lib/structure/ui/useStructureDrop.js.map +1 -0
  358. package/lib/structure/ui/useStructureImport.d.ts +45 -0
  359. package/lib/structure/ui/useStructureImport.d.ts.map +1 -0
  360. package/lib/structure/ui/useStructureImport.js +62 -0
  361. package/lib/structure/ui/useStructureImport.js.map +1 -0
  362. package/package.json +5 -1
  363. package/src/download/ui/FigureDownloadPanel.tsx +9 -2
  364. package/src/ecosystem/core/sites.ts +3 -3
  365. package/src/ecosystem/core/types.ts +1 -1
  366. package/src/ecosystem/ui/glyphs.tsx +1 -1
  367. package/src/i18n/core/messageCatalog.ts +2 -2
  368. package/src/i18n/vite/localeCatalog.ts +1 -1
  369. package/src/ir/core/analysisSpectra.ts +26 -10
  370. package/src/ir/core/bandLabelPlan.ts +21 -10
  371. package/src/ir/core/index.ts +31 -7
  372. package/src/ir/core/irBand.ts +52 -14
  373. package/src/ir/core/irCommands.ts +15 -1
  374. package/src/ir/core/irDomain.ts +9 -7
  375. package/src/ir/core/irEditorApi.ts +13 -0
  376. package/src/ir/core/irFormat.ts +39 -6
  377. package/src/ir/core/irMode.ts +42 -10
  378. package/src/ir/core/irReducer.ts +3 -51
  379. package/src/ir/core/irSidePanels.ts +8 -1
  380. package/src/ir/core/irSpectrum.ts +59 -30
  381. package/src/ir/core/irState.ts +73 -5
  382. package/src/ir/core/irTechnique.ts +115 -0
  383. package/src/ir/core/irTechniqueCommands.ts +82 -0
  384. package/src/ir/core/pickBands.ts +63 -28
  385. package/src/ir/core/ramanBands.ts +105 -0
  386. package/src/ir/core/spectrumJcamp.ts +65 -16
  387. package/src/ir/core/toIrSpectrum.ts +20 -2
  388. package/src/ir/ui/BandRow.tsx +107 -0
  389. package/src/ir/ui/BandsPanel.tsx +32 -125
  390. package/src/ir/ui/IrAboutDialog.tsx +69 -28
  391. package/src/ir/ui/IrCanvas.tsx +29 -3
  392. package/src/ir/ui/IrChart.tsx +31 -24
  393. package/src/ir/ui/IrCommandProvider.tsx +10 -3
  394. package/src/ir/ui/IrCommandTooltip.tsx +11 -2
  395. package/src/ir/ui/IrDocumentationDialog.tsx +99 -55
  396. package/src/ir/ui/IrEditor.tsx +27 -40
  397. package/src/ir/ui/IrHeader.tsx +10 -3
  398. package/src/ir/ui/IrLogo.tsx +28 -9
  399. package/src/ir/ui/IrShell.tsx +47 -96
  400. package/src/ir/ui/IrSidePanel.tsx +36 -10
  401. package/src/ir/ui/IrStatusBar.tsx +17 -12
  402. package/src/ir/ui/IrToolbar.tsx +26 -15
  403. package/src/ir/ui/IrTraces.tsx +5 -1
  404. package/src/ir/ui/RamanEditor.tsx +71 -0
  405. package/src/ir/ui/SpectraPanel.tsx +2 -1
  406. package/src/ir/ui/SpectrumRow.tsx +14 -5
  407. package/src/ir/ui/VibrationalEditor.tsx +113 -0
  408. package/src/ir/ui/bandsTsv.ts +46 -0
  409. package/src/ir/ui/index.ts +1 -0
  410. package/src/ir/ui/irActions.ts +3 -3
  411. package/src/ir/ui/irChartProps.ts +21 -4
  412. package/src/ir/ui/irCommandContext.tsx +18 -3
  413. package/src/ir/ui/irHostPanels.ts +76 -0
  414. package/src/ir/ui/useIrEditor.ts +20 -8
  415. package/src/ir/ui/useIrHandle.ts +51 -0
  416. package/src/ir/ui/useIrSide.ts +60 -0
  417. package/src/ir/ui/useIrText.ts +170 -0
  418. package/src/ir/ui/useIrZoom.ts +22 -3
  419. package/src/ir/ui/useValueAxisZoom.ts +67 -0
  420. package/src/ir.ts +3 -0
  421. package/src/locales/de.json +29 -2
  422. package/src/locales/en.json +29 -2
  423. package/src/locales/es.json +29 -2
  424. package/src/locales/fr.json +29 -2
  425. package/src/locales/it.json +29 -2
  426. package/src/molecule3d/core/animatedPng.ts +79 -0
  427. package/src/molecule3d/core/file.ts +23 -0
  428. package/src/molecule3d/core/index.ts +3 -1
  429. package/src/molecule3d/core/settings.ts +0 -8
  430. package/src/molecule3d/ui/Molecule3DExport.tsx +43 -5
  431. package/src/molecule3d/ui/Molecule3DToolbar.tsx +9 -2
  432. package/src/molecule3d/ui/MoleculeCanvas3D.tsx +24 -38
  433. package/src/molecule3d/ui/drawScene.ts +2 -1
  434. package/src/molecule3d/ui/exportMoleculeImage.ts +28 -3
  435. package/src/molecule3d/ui/moleculeFrames.ts +88 -0
  436. package/src/molecule3d/ui/moleculeViewer3DProps.ts +14 -5
  437. package/src/molecule3d/ui/renderMolecule.ts +5 -3
  438. package/src/molecule3d/ui/sceneDrawer.ts +14 -2
  439. package/src/molecule3d/ui/useImageExport.ts +22 -5
  440. package/src/molecule3d/ui/useMoleculeScene.ts +2 -1
  441. package/src/molecule3d/ui/useMoleculeViewer.ts +46 -0
  442. package/src/molecule3d/ui/usePolarSurfaceArea.ts +6 -4
  443. package/src/molecule3d/ui/viewer.ts +34 -27
  444. package/src/molecule3d/ui/viewerTypes.ts +6 -0
  445. package/src/molstar/core/captureScene.ts +85 -2
  446. package/src/molstar/core/index.ts +13 -2
  447. package/src/molstar/core/trajectory.ts +117 -0
  448. package/src/panel/ui/PanelRail.tsx +3 -0
  449. package/src/raman.ts +20 -0
  450. package/src/router/core/basePath.ts +2 -2
  451. package/src/router/core/siteAddresses.ts +1 -1
  452. package/src/seo/core/siteFiles.ts +1 -1
  453. package/src/server/answerAddresses.ts +3 -3
  454. package/src/structure/core/index.ts +8 -0
  455. package/src/structure/core/structureTransfer.ts +37 -0
  456. package/src/structure/ui/EditorImportButton.tsx +59 -0
  457. package/src/structure/ui/EditorImportProblem.tsx +63 -0
  458. package/src/structure/ui/StructureDrop.tsx +66 -0
  459. package/src/structure/ui/StructureDropOverlay.tsx +50 -0
  460. package/src/structure/ui/StructureEditor.tsx +49 -134
  461. package/src/structure/ui/importedStructure.ts +83 -0
  462. package/src/structure/ui/index.ts +2 -0
  463. package/src/structure/ui/structureEditorProps.ts +103 -0
  464. package/src/structure/ui/useDebouncedChange.ts +41 -0
  465. package/src/structure/ui/useStructureDrop.ts +76 -0
  466. package/src/structure/ui/useStructureImport.ts +122 -0
@@ -10,7 +10,8 @@
10
10
  * transmittance and a band points the other way in each, and that a wavenumber
11
11
  * maps to a range of vibrations rather than to one. Nothing here knows what a
12
12
  * glycan is, and nothing should: an infrared spectrum answers for whatever was
13
- * put in the beam.
13
+ * put in the beam. A Raman spectrum is the one other technique held, and what
14
+ * differs for it is in `IR_TECHNIQUE_RULES`.
14
15
  */
15
16
 
16
17
  export type { LoadedIrSpectrum } from './analysisSpectra.ts';
@@ -26,16 +27,22 @@ export { downloadIrSpectra, downloadIrSpectrum } from './downloadSpectra.ts';
26
27
  export type { IrJcampReadOptions } from './fromJcamp.ts';
27
28
  export type { IrSpcReadOptions } from './fromSpc.ts';
28
29
  export type { IrBand, IrBandStrength } from './irBand.ts';
29
- export { sameIrBand } from './irBand.ts';
30
+ export { bandHeight, bandValue, sameIrBand } from './irBand.ts';
30
31
  export type {
31
32
  IrCommand,
32
33
  IrCommandHandlers,
33
34
  IrCommandId,
35
+ IrCommandTable,
34
36
  IrGesture,
35
37
  IrShortcut,
36
38
  RunIrCommand,
37
39
  } from './irCommands.ts';
38
- export { irCommandLabel, irCommands } from './irCommands.ts';
40
+ export {
41
+ irCommandEntryLabel,
42
+ irCommandLabel,
43
+ irCommands,
44
+ } from './irCommands.ts';
45
+ export { irCommandOffered, irCommandsFor } from './irTechniqueCommands.ts';
39
46
  export {
40
47
  LABEL_HEADROOM,
41
48
  X_DOMAIN_PADDING,
@@ -43,12 +50,18 @@ export {
43
50
  fittedTo,
44
51
  fullDomain,
45
52
  } from './irDomain.ts';
46
- export type { IrEditorHandle, ZoomToBandOptions } from './irEditorApi.ts';
53
+ export type {
54
+ IrEditorHandle,
55
+ IrPlotClick,
56
+ ZoomToBandOptions,
57
+ } from './irEditorApi.ts';
47
58
  export {
48
59
  ABSORBANCE_DECIMALS,
60
+ INTENSITY_DIGITS,
49
61
  TRANSMITTANCE_DECIMALS,
50
62
  formatIrValue,
51
63
  formatWavenumber,
64
+ formatWavenumberRange,
52
65
  shortModeLabel,
53
66
  } from './irFormat.ts';
54
67
  export {
@@ -61,8 +74,8 @@ export {
61
74
  yAxisTitle,
62
75
  zoomGestures,
63
76
  } from './irMode.ts';
64
- export type { CreateIrStateOptions, IrAction } from './irReducer.ts';
65
- export { createIrState, irReducer } from './irReducer.ts';
77
+ export type { IrAction } from './irReducer.ts';
78
+ export { irReducer } from './irReducer.ts';
66
79
  export type {
67
80
  IrDomain,
68
81
  IrFormat,
@@ -75,6 +88,7 @@ export type {
75
88
  } from './irSpectrum.ts';
76
89
  export { traceOf } from './irSpectrum.ts';
77
90
  export type {
91
+ CreateIrStateOptions,
78
92
  IrData,
79
93
  IrSettings,
80
94
  IrState,
@@ -89,9 +103,19 @@ export {
89
103
  DEFAULT_SIDE_PANEL,
90
104
  DEFAULT_SIDE_PANELS,
91
105
  MAXIMUM_LABEL_LIMIT,
106
+ createIrState,
92
107
  isIrWindow,
93
108
  mergeIrSettings,
94
109
  } from './irState.ts';
110
+ export type { IrTechnique, IrTechniqueRules } from './irTechnique.ts';
111
+ export {
112
+ IR_TECHNIQUES,
113
+ IR_TECHNIQUE_RULES,
114
+ defaultIrMode,
115
+ irModeFor,
116
+ irModeTechnique,
117
+ offersIrMode,
118
+ } from './irTechnique.ts';
95
119
  export type {
96
120
  LoadIrSpectraOptions,
97
121
  LoadIrSpectraResult,
@@ -109,5 +133,5 @@ export {
109
133
  } from './spectrumJcamp.ts';
110
134
  export type { ToIrSpectrumOptions } from './toIrSpectrum.ts';
111
135
  export { toIrSpectra, toIrSpectrum } from './toIrSpectrum.ts';
112
- export type { IrSidePanelId } from './irSidePanels.ts';
136
+ export type { IrPanelId, IrSidePanelId } from './irSidePanels.ts';
113
137
  export { irSidePanels } from './irSidePanels.ts';
@@ -1,21 +1,24 @@
1
1
  /**
2
2
  * One band picked out of a spectrum.
3
3
  *
4
- * A band is the infrared analogue of a mass spectrum's peak: the thing a chemist
5
- * points at, names, and reads a functional group off. It carries both value axes
6
- * for the same reason the spectrum does — the band a reader sees at 30 percent
7
- * transmittance and the one a table calls strongly absorbing are one band, and
8
- * making the caller convert to find out would be the conversion this package
9
- * does not do.
4
+ * A band is the vibrational analogue of a mass spectrum's peak: the thing a
5
+ * chemist points at, names, and reads a functional group off. An infrared band
6
+ * carries both value axes for the same reason its spectrum does — the band a
7
+ * reader sees at 30 percent transmittance and the one a table calls strongly
8
+ * absorbing are one band, and making the caller convert to find out would be the
9
+ * conversion this package does not do. A Raman band carries its intensity.
10
10
  */
11
11
 
12
+ import type { IrMode } from './irSpectrum.ts';
13
+
12
14
  /**
13
15
  * How strong a band is, in the letters a correlation table uses.
14
16
  *
15
- * `w` weak, `m` medium, `S` strong — `ir-spectrum` decides which from where the
16
- * band sits between the spectrum's own extremes, so the letters are relative to
17
- * the spectrum in hand rather than to an absolute absorbance. That is what a
18
- * printed table means by them too.
17
+ * `w` weak, `m` medium, `S` strong — decided from where the band sits between
18
+ * the spectrum's own extremes, so the letters are relative to the spectrum in
19
+ * hand rather than to an absolute value. That is what a printed table means by
20
+ * them too. `ir-spectrum` decides it for an infrared band from its
21
+ * transmittance, and the same rule is applied to a Raman band's intensity.
19
22
  */
20
23
  export type IrBandStrength = 'w' | 'm' | 'S';
21
24
 
@@ -25,10 +28,21 @@ export interface IrBand {
25
28
  spectrumId: string;
26
29
  /** Where it sits, in cm⁻¹. */
27
30
  wavenumber: number;
28
- /** Its absorbance, which is what it was picked as a maximum of. */
29
- absorbance: number;
30
- /** Its percent transmittance, the same band read the other way up. */
31
- transmittance: number;
31
+ /**
32
+ * Its absorbance, which an infrared band is picked as a maximum of.
33
+ * @default undefined
34
+ */
35
+ absorbance?: number;
36
+ /**
37
+ * Its percent transmittance, the same infrared band read the other way up.
38
+ * @default undefined
39
+ */
40
+ transmittance?: number;
41
+ /**
42
+ * Its intensity, which a Raman band is picked as a maximum of.
43
+ * @default undefined
44
+ */
45
+ intensity?: number;
32
46
  /** How strong it is, relative to the spectrum it came from. */
33
47
  strength: IrBandStrength;
34
48
  }
@@ -55,3 +69,27 @@ export function sameIrBand(
55
69
  current.wavenumber === next.wavenumber
56
70
  );
57
71
  }
72
+
73
+ /**
74
+ * A band's value on the axis being read.
75
+ * @param band - The band.
76
+ * @param mode - Which value axis is being read.
77
+ * @returns The value, or `undefined` when its spectrum carries no such axis.
78
+ */
79
+ export function bandValue(band: IrBand, mode: IrMode): number | undefined {
80
+ return band[mode];
81
+ }
82
+
83
+ /**
84
+ * How tall a band stands, which is what a cut to the strongest bands ranks by.
85
+ *
86
+ * The value it was picked as a maximum of: its absorbance for an infrared band,
87
+ * its intensity for a Raman one. Never its transmittance, in which a stronger
88
+ * band is a smaller number.
89
+ * @param band - The band.
90
+ * @returns The height, or negative infinity for a band carrying neither, so it
91
+ * ranks last.
92
+ */
93
+ export function bandHeight(band: IrBand): number {
94
+ return band.absorbance ?? band.intensity ?? Number.NEGATIVE_INFINITY;
95
+ }
@@ -10,6 +10,9 @@
10
10
  * this one, because a module that exports a component and a constant together
11
11
  * cannot be hot reloaded — `react-refresh/only-export-components` is the rule
12
12
  * that says so, and the split is the fix rather than the exception.
13
+ *
14
+ * This is the infrared table; `irTechniqueCommands.ts` derives the Raman one
15
+ * from it.
13
16
  */
14
17
 
15
18
  /** The key a command answers to. */
@@ -134,6 +137,9 @@ export const irCommands = {
134
137
  /** Identity of one of the commands the viewer offers. */
135
138
  export type IrCommandId = keyof typeof irCommands;
136
139
 
140
+ /** The commands a viewer offers, in the order they are reached for. */
141
+ export type IrCommandTable = Readonly<Partial<Record<IrCommandId, IrCommand>>>;
142
+
137
143
  /** What to do when each command is run, as the shell wires them. */
138
144
  export type IrCommandHandlers = Partial<
139
145
  Record<IrCommandId, (() => void) | undefined>
@@ -148,7 +154,15 @@ export type RunIrCommand = (id: IrCommandId) => void;
148
154
  * @returns The title, and the key in parentheses when it has one.
149
155
  */
150
156
  export function irCommandLabel(id: IrCommandId): string {
151
- const entry = irCommands[id] as IrCommand;
157
+ return irCommandEntryLabel(irCommands[id]);
158
+ }
159
+
160
+ /**
161
+ * A command's title, with its key in parentheses when it has one.
162
+ * @param entry - The command, as a table words it.
163
+ * @returns The label.
164
+ */
165
+ export function irCommandEntryLabel(entry: IrCommand): string {
152
166
  const key = entry.shortcut?.label?.[0] ?? entry.shortcut?.keys[0];
153
167
  return key === undefined ? entry.title : `${entry.title} (${key})`;
154
168
  }
@@ -5,9 +5,10 @@
5
5
  * something usable when it is handed nothing at all — a chart with no data is
6
6
  * still mounted, still measured, and still builds its scales.
7
7
  *
8
- * The x window is in ascending wavenumbers even though the axis is drawn from
9
- * 4000 down to 400: which way round it is read is the chart's business, and
10
- * every piece of arithmetic that moves a window expects its ends in order.
8
+ * The x window is in ascending wavenumbers even though the infrared axis is
9
+ * drawn from 4000 down to 400: which way round it is read is the chart's
10
+ * business, and every piece of arithmetic that moves a window expects its ends
11
+ * in order.
11
12
  */
12
13
 
13
14
  import { xMaxValue, xMinValue } from 'ml-spectra-processing';
@@ -57,9 +58,8 @@ export function fullDomain(
57
58
  const extent =
58
59
  traceExtent(spectra, mode, false) ?? traceExtent(spectra, mode, true);
59
60
  if (extent === null) {
60
- return mode === 'absorbance'
61
- ? { x: [400, 4000], y: [0, 1] }
62
- : { x: [400, 4000], y: [0, 100] };
61
+ // A percentage runs to 100; absorbance and intensity are open at the top.
62
+ return { x: [400, 4000], y: mode === 'transmittance' ? [0, 100] : [0, 1] };
63
63
  }
64
64
 
65
65
  const { xMinimum, xMaximum, yMinimum, yMaximum } = extent;
@@ -135,7 +135,9 @@ function traceExtent(
135
135
  for (const spectrum of spectra) {
136
136
  if (!spectrum.visible) continue;
137
137
  if (!includeExcluded && spectrum.excludeFromDomain) continue;
138
- const { x, y } = traceOf(spectrum, mode);
138
+ const trace = traceOf(spectrum, mode);
139
+ if (trace === undefined) continue;
140
+ const { x, y } = trace;
139
141
  if (x.length === 0 || y.length === 0) continue;
140
142
  // The wavenumber ends are read off the first and last sample rather than
141
143
  // searched for: the array is ascending by construction, so a scan would walk
@@ -42,3 +42,16 @@ export interface IrEditorHandle {
42
42
  /** Point the panels at one spectrum, or at none. */
43
43
  selectSpectrum: (id: string | null) => void;
44
44
  }
45
+
46
+ /**
47
+ * A click on the plot, as the viewer tells its host about it.
48
+ *
49
+ * A click is a press let go over the plot without travelling: the end of a
50
+ * zoom drag is never one, and a click on the axis labels is not reported.
51
+ */
52
+ export interface IrPlotClick {
53
+ /** Where it landed on the horizontal axis, in cm⁻¹ — a Raman shift for Raman. */
54
+ wavenumber: number;
55
+ /** Identity of the spectrum selected when it was made, `null` for none. */
56
+ spectrumId: string | null;
57
+ }
@@ -6,6 +6,8 @@
6
6
  * row that calls it 1714.6 read as two bands.
7
7
  */
8
8
 
9
+ import { formatTrimmed } from '../../format/core/numbers.ts';
10
+
9
11
  import type { IrMode } from './irSpectrum.ts';
10
12
 
11
13
  /** How many decimals an absorbance is written to. */
@@ -14,6 +16,9 @@ export const ABSORBANCE_DECIMALS = 3;
14
16
  /** How many a percent transmittance is written to. */
15
17
  export const TRANSMITTANCE_DECIMALS = 1;
16
18
 
19
+ /** How many significant digits an intensity is written to. */
20
+ export const INTENSITY_DIGITS = 4;
21
+
17
22
  /**
18
23
  * Write a wavenumber the way a chemist quotes one.
19
24
  *
@@ -35,23 +40,51 @@ export function formatWavenumber(wavenumber: number): string {
35
40
  * Three decimals for an absorbance and one for a percent transmittance, which is
36
41
  * roughly the same precision expressed two ways — an absorbance of 0.001 and a
37
42
  * transmittance of 0.2 percent are both about where a real spectrum's noise
38
- * sits.
43
+ * sits. An intensity is counts from one instrument and a fraction of the
44
+ * strongest band from another, so no count of decimals suits it: it keeps
45
+ * `INTENSITY_DIGITS` significant digits instead.
39
46
  * @param value - The value.
40
47
  * @param mode - Which axis it is in.
41
48
  * @returns The number as a string, without its unit.
42
49
  */
43
50
  export function formatIrValue(value: number, mode: IrMode): string {
44
51
  if (!Number.isFinite(value)) return '';
45
- return value.toFixed(
46
- mode === 'absorbance' ? ABSORBANCE_DECIMALS : TRANSMITTANCE_DECIMALS,
47
- );
52
+ const { decimals } = VALUE_FORMATS[mode];
53
+ return decimals === undefined
54
+ ? formatTrimmed(value, { significant: INTENSITY_DIGITS })
55
+ : value.toFixed(decimals);
48
56
  }
49
57
 
50
58
  /**
51
59
  * What the value axis is called where there is room for one word.
52
60
  * @param mode - Which axis is being drawn.
53
- * @returns `A` or `%T`, as a spectrum is annotated by hand.
61
+ * @returns `A`, `%T` or `I`, as a spectrum is annotated by hand.
54
62
  */
55
63
  export function shortModeLabel(mode: IrMode): string {
56
- return mode === 'absorbance' ? 'A' : '%T';
64
+ return VALUE_FORMATS[mode].symbol;
57
65
  }
66
+
67
+ /**
68
+ * The range a spectrum covers, written in the order its axis is read.
69
+ * @param wavenumbers - Its wavenumbers, ascending.
70
+ * @param reversed - Whether the axis runs from high to low, as infrared's does.
71
+ * @returns `4000–400 cm⁻¹` on a reversed axis, `100–3200 cm⁻¹` on one that is
72
+ * not, and an empty string for a spectrum with no point.
73
+ */
74
+ export function formatWavenumberRange(
75
+ wavenumbers: Float64Array,
76
+ reversed: boolean,
77
+ ): string {
78
+ const lowest = wavenumbers[0];
79
+ const highest = wavenumbers.at(-1);
80
+ if (lowest === undefined || highest === undefined) return '';
81
+ const [first, last] = reversed ? [highest, lowest] : [lowest, highest];
82
+ return `${formatWavenumber(first)}–${formatWavenumber(last)} cm⁻¹`;
83
+ }
84
+
85
+ /** How each value axis is written: its symbol, and its count of decimals. */
86
+ const VALUE_FORMATS: Record<IrMode, { symbol: string; decimals?: number }> = {
87
+ transmittance: { symbol: '%T', decimals: TRANSMITTANCE_DECIMALS },
88
+ absorbance: { symbol: 'A', decimals: ABSORBANCE_DECIMALS },
89
+ intensity: { symbol: 'I' },
90
+ };
@@ -1,14 +1,14 @@
1
1
  /**
2
- * Everything that differs between reading a spectrum as absorbance and reading
3
- * it as percent transmittance.
2
+ * Everything that differs between reading a spectrum as absorbance, as percent
3
+ * transmittance, or — for a Raman spectrum — as intensity.
4
4
  *
5
- * The two are the same measurement drawn upside down, and nearly every
5
+ * The first two are the same measurement drawn upside down, and nearly every
6
6
  * difference between them is one of a handful of facts: what the axis is called,
7
7
  * where its baseline is, whether that baseline is held in the window, which way
8
8
  * a band points, and which zoom gestures are worth answering. Gathering them
9
9
  * here is what keeps the switch from being an `if (mode === …)` in the chart,
10
10
  * the tracker, the band marks, the zoom and the fitting separately, where they
11
- * would eventually disagree.
11
+ * would eventually disagree. Intensity is one more entry of the same facts.
12
12
  *
13
13
  * **No conversion happens here, or anywhere in this package.** `ir-spectrum`
14
14
  * adds both an absorbance and a transmittance variable to every spectrum it
@@ -24,9 +24,14 @@ import type {
24
24
  } from '../../chart/core/chartDomain.ts';
25
25
 
26
26
  import type { IrMode } from './irSpectrum.ts';
27
+ import type { IrTechnique } from './irTechnique.ts';
28
+ import { IR_TECHNIQUE_RULES, irModeTechnique } from './irTechnique.ts';
27
29
 
28
- /** The two ways a spectrum is read, in the order a control offers them. */
29
- export const IR_MODES: readonly IrMode[] = ['transmittance', 'absorbance'];
30
+ /**
31
+ * The two ways an infrared spectrum is read, in the order a control offers
32
+ * them.
33
+ */
34
+ export const IR_MODES: readonly IrMode[] = IR_TECHNIQUE_RULES.infrared.modes;
30
35
 
31
36
  /**
32
37
  * How each mode behaves, every fact in one place.
@@ -115,6 +120,22 @@ export const IR_MODE_RULES = {
115
120
  */
116
121
  wheelZoom: true,
117
122
  },
123
+ intensity: {
124
+ title: 'intensity',
125
+ /** No light scattered is a real floor, as no light absorbed is. */
126
+ baseline: 0,
127
+ /** Not held in a dragged window, for the reason absorbance gives. */
128
+ keepBaseline: false,
129
+ /** A Raman band stands up out of the baseline under it. */
130
+ bandsPointDown: false,
131
+ /**
132
+ * Both drags are worth having: intensity is open at the top and its weak
133
+ * bands lie against zero, as absorbance's do.
134
+ */
135
+ boxZoomOnly: false,
136
+ /** The wheel scales the axis about zero, bringing a weak band up. */
137
+ wheelZoom: true,
138
+ },
118
139
  } as const satisfies Record<
119
140
  IrMode,
120
141
  {
@@ -199,10 +220,21 @@ export function bandsPointDown(mode: IrMode): boolean {
199
220
  }
200
221
 
201
222
  /**
202
- * The other mode, for a control that toggles between the two.
223
+ * The next mode, for a control that toggles between them.
224
+ *
225
+ * It never leaves the technique: an infrared viewer goes back and forth
226
+ * between its two axes, and a Raman one, reading intensity alone, stays where
227
+ * it is.
203
228
  * @param mode - The mode in force.
204
- * @returns The one to switch to.
229
+ * @param technique - The technique whose modes are toggled through. Defaults to
230
+ * the one that reads `mode`.
231
+ * @returns The one to switch to: the technique's first when `mode` is not one
232
+ * of its own.
205
233
  */
206
- export function otherIrMode(mode: IrMode): IrMode {
207
- return mode === 'absorbance' ? 'transmittance' : 'absorbance';
234
+ export function otherIrMode(
235
+ mode: IrMode,
236
+ technique: IrTechnique = irModeTechnique(mode),
237
+ ): IrMode {
238
+ const modes: readonly IrMode[] = IR_TECHNIQUE_RULES[technique].modes;
239
+ return modes[(modes.indexOf(mode) + 1) % modes.length] ?? mode;
208
240
  }
@@ -13,15 +13,10 @@
13
13
  * closed.
14
14
  */
15
15
 
16
- import type { IrSidePanelId } from './irSidePanels.ts';
16
+ import type { IrPanelId } from './irSidePanels.ts';
17
17
  import type { IrDomain, IrSpectrum } from './irSpectrum.ts';
18
18
  import type { IrSettings, IrState, IrTool, PartialIrState } from './irState.ts';
19
- import {
20
- DEFAULT_SETTINGS,
21
- DEFAULT_SIDE_PANELS,
22
- isIrWindow,
23
- mergeIrSettings,
24
- } from './irState.ts';
19
+ import { isIrWindow, mergeIrSettings } from './irState.ts';
25
20
 
26
21
  /** Everything that can be asked of the viewer. */
27
22
  export type IrAction =
@@ -35,55 +30,12 @@ export type IrAction =
35
30
  | { type: 'setDomain'; domain: IrDomain }
36
31
  | { type: 'resetDomain' }
37
32
  | { type: 'setTool'; tool: IrTool }
38
- | { type: 'togglePanel'; panelId: IrSidePanelId }
33
+ | { type: 'togglePanel'; panelId: IrPanelId }
39
34
  | { type: 'setError'; error: string | null }
40
35
  | { type: 'setSettings'; settings: Partial<IrSettings> }
41
36
  | { type: 'loadState'; state: PartialIrState }
42
37
  | { type: 'clear' };
43
38
 
44
- /** What a viewer opens on. */
45
- export interface CreateIrStateOptions {
46
- /**
47
- * The spectra to open on.
48
- * @default []
49
- */
50
- spectra?: IrSpectrum[];
51
- /**
52
- * The workspace to open in.
53
- * @default DEFAULT_SETTINGS
54
- */
55
- settings?: Partial<IrSettings>;
56
- /**
57
- * The panels open to begin with.
58
- * @default DEFAULT_SIDE_PANELS
59
- */
60
- panelIds?: IrSidePanelId[];
61
- }
62
-
63
- /**
64
- * The state a viewer opens with.
65
- *
66
- * The panel list is spread rather than stored by reference: a caller's array is
67
- * the caller's to mutate, and a viewer holding it would find its open panels
68
- * changing under it.
69
- * @param options - What it opens on.
70
- * @returns The state.
71
- */
72
- export function createIrState(options: CreateIrStateOptions = {}): IrState {
73
- const { spectra = [], settings, panelIds } = options;
74
- return {
75
- data: { spectra: [...spectra] },
76
- view: {
77
- selectedId: spectra[0]?.id ?? null,
78
- domain: null,
79
- tool: 'read',
80
- openPanelIds: [...(panelIds ?? DEFAULT_SIDE_PANELS)],
81
- error: null,
82
- },
83
- settings: mergeIrSettings(DEFAULT_SETTINGS, settings),
84
- };
85
- }
86
-
87
39
  /**
88
40
  * Fold one action into the state.
89
41
  * @param state - The state in force.
@@ -16,5 +16,12 @@ export const irSidePanels = [
16
16
  icon: ActivityBarItemProps['icon'];
17
17
  }>;
18
18
 
19
- /** Identity of one of the panels the activity bar offers. */
19
+ /** Identity of one of the panels the viewer offers of its own. */
20
20
  export type IrSidePanelId = (typeof irSidePanels)[number]['id'];
21
+
22
+ /**
23
+ * Identity of any panel the side can hold: one of the viewer's own, or one a
24
+ * host added to them. Still a union with the viewer's own ids, so those keep
25
+ * autocompleting where a plain `string` would swallow them.
26
+ */
27
+ export type IrPanelId = IrSidePanelId | (string & Record<never, never>);
@@ -1,17 +1,22 @@
1
1
  /**
2
- * What an infrared spectrum is once it has been read, whatever it was read from.
2
+ * What a vibrational spectrum is once it has been read, whatever it was read
3
+ * from.
3
4
  *
4
- * One acquisition becomes one `IrSpectrum` carrying **both** value axes —
5
- * absorbance and percent transmittance — over one shared array of wavenumbers.
6
- * Both are held rather than one being derived on demand because `ir-spectrum`
7
- * already produces both when it reads a file: it adds an `a` and a `t` variable
8
- * to every spectrum whichever of the two the instrument wrote, so the conversion
9
- * happens once, in the one place that knows what the file's y axis meant. Holding
10
- * the answer means switching what is drawn costs nothing, and means the two
11
- * axes can never drift apart through a round trip.
5
+ * One infrared acquisition becomes one `IrSpectrum` carrying **both** value
6
+ * axes — absorbance and percent transmittance — over one shared array of
7
+ * wavenumbers. Both are held rather than one being derived on demand because
8
+ * `ir-spectrum` already produces both when it reads a file: it adds an `a` and
9
+ * a `t` variable to every spectrum whichever of the two the instrument wrote, so
10
+ * the conversion happens once, in the one place that knows what the file's y
11
+ * axis meant. Holding the answer means switching what is drawn costs nothing,
12
+ * and means the two axes can never drift apart through a round trip.
13
+ *
14
+ * A Raman acquisition carries its intensity instead, over its Raman shifts —
15
+ * also wavenumbers in cm⁻¹ — and neither infrared axis: there is no
16
+ * transmittance of scattered light to convert it to.
12
17
  *
13
18
  * The arrays are `Float64Array` and are replaced on a change, never written
14
- * into, since every consumer holds the same object by reference. An infrared
19
+ * into, since every consumer holds the same object by reference. A vibrational
15
20
  * spectrum is a few thousand points rather than a mass spectrum's few hundred
16
21
  * thousand, so holding two value axes costs nothing worth counting.
17
22
  */
@@ -30,8 +35,11 @@ import type { ChartDomain } from '../../chart/core/chartDomain.ts';
30
35
  */
31
36
  export type IrTrace = DataXY<Float64Array>;
32
37
 
33
- /** The formats a spectrum can have been read from. */
34
- export type IrFormat = 'jcamp' | 'spc' | 'text' | 'calculated';
38
+ /**
39
+ * The formats a spectrum can have been read from. `wdf` is Renishaw's Raman
40
+ * format, which a host reads with its own parser and hands over.
41
+ */
42
+ export type IrFormat = 'jcamp' | 'spc' | 'text' | 'wdf' | 'calculated';
35
43
 
36
44
  /**
37
45
  * Where a spectrum came from, and what the file said about the acquisition.
@@ -87,8 +95,11 @@ export interface IrMeta {
87
95
  fields: IrMetaField[];
88
96
  }
89
97
 
90
- /** Which value axis is being drawn and read. */
91
- export type IrMode = 'absorbance' | 'transmittance';
98
+ /**
99
+ * Which value axis is being drawn and read: absorbance or percent
100
+ * transmittance for an infrared spectrum, intensity for a Raman one.
101
+ */
102
+ export type IrMode = 'absorbance' | 'transmittance' | 'intensity';
92
103
 
93
104
  /** One spectrum as the viewer holds it. */
94
105
  export interface IrSpectrum {
@@ -99,19 +110,33 @@ export interface IrSpectrum {
99
110
  /** The colour it is drawn in. */
100
111
  color: string;
101
112
  /**
102
- * The wavenumbers in cm⁻¹, **ascending**.
113
+ * The wavenumbers in cm⁻¹, **ascending** — of the light absorbed for an
114
+ * infrared spectrum, the Raman shift for a Raman one.
103
115
  *
104
- * Ascending even though the axis is read from 4000 down to 400: which way the
105
- * numbers run on screen is the chart's business, and every binary search and
106
- * every extent taken off index zero downstream wants them in order. Reversing
107
- * the data instead would make the drawing simpler once and everything else
108
- * wrong.
116
+ * Ascending even though the infrared axis is read from 4000 down to 400:
117
+ * which way the numbers run on screen is the chart's business, and every
118
+ * binary search and every extent taken off index zero downstream wants them in
119
+ * order. Reversing the data instead would make the drawing simpler once and
120
+ * everything else wrong.
109
121
  */
110
122
  wavenumber: Float64Array;
111
- /** Absorbance at each wavenumber, as `ir-spectrum` supplied it. */
112
- absorbance: Float64Array;
113
- /** Percent transmittance at each wavenumber, likewise. */
114
- transmittance: Float64Array;
123
+ /**
124
+ * Absorbance at each wavenumber, as `ir-spectrum` supplied it. An infrared
125
+ * spectrum carries it beside `transmittance`.
126
+ * @default undefined
127
+ */
128
+ absorbance?: Float64Array;
129
+ /**
130
+ * Percent transmittance at each wavenumber, likewise.
131
+ * @default undefined
132
+ */
133
+ transmittance?: Float64Array;
134
+ /**
135
+ * Intensity at each Raman shift, which a Raman spectrum carries instead of
136
+ * the two infrared axes.
137
+ * @default undefined
138
+ */
139
+ intensity?: Float64Array;
115
140
  /** What the file said about the acquisition, `null` when it said nothing. */
116
141
  meta: IrMeta | null;
117
142
  /** Where it came from. */
@@ -145,11 +170,15 @@ export type IrDomain = ChartDomain;
145
170
  * render of every spectrum is a copy per frame for no gain.
146
171
  * @param spectrum - The spectrum.
147
172
  * @param mode - Which value axis is being drawn.
148
- * @returns The trace, sharing the spectrum's own arrays.
173
+ * @returns The trace, sharing the spectrum's own arrays, or `undefined` when the
174
+ * spectrum carries no such axis — a Raman spectrum has no absorbance.
149
175
  */
150
- export function traceOf(spectrum: IrSpectrum, mode: IrMode): IrTrace {
151
- return {
152
- x: spectrum.wavenumber,
153
- y: mode === 'absorbance' ? spectrum.absorbance : spectrum.transmittance,
154
- };
176
+ export function traceOf(
177
+ spectrum: IrSpectrum,
178
+ mode: IrMode,
179
+ ): IrTrace | undefined {
180
+ const values = spectrum[mode];
181
+ return values === undefined
182
+ ? undefined
183
+ : { x: spectrum.wavenumber, y: values };
155
184
  }