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
@@ -1,6 +1,7 @@
1
- import { useCallback } from 'react';
1
+ import { useCallback, useMemo } from 'react';
2
2
 
3
3
  import type { IrBand } from '../core/irBand.ts';
4
+ import type { IrPlotClick } from '../core/irEditorApi.ts';
4
5
  import type { IrDomain } from '../core/irSpectrum.ts';
5
6
 
6
7
  import { IrChart } from './IrChart.tsx';
@@ -32,6 +33,12 @@ export interface IrCanvasProps {
32
33
  * @default undefined
33
34
  */
34
35
  chartId?: string;
36
+ /**
37
+ * Told of a click on the plot — a press let go without travelling, never the
38
+ * end of a drag — with the spectrum selected at that moment.
39
+ * @default undefined
40
+ */
41
+ onPlotClick?: (click: IrPlotClick) => void;
35
42
  }
36
43
 
37
44
  /**
@@ -50,11 +57,17 @@ export interface IrCanvasProps {
50
57
  * @returns The canvas.
51
58
  */
52
59
  export function IrCanvas(props: IrCanvasProps) {
53
- const { highlight = null, onHighlight, attachChart, chartId } = props;
60
+ const {
61
+ highlight = null,
62
+ onHighlight,
63
+ attachChart,
64
+ chartId,
65
+ onPlotClick,
66
+ } = props;
54
67
  const { state, visibleSpectra, assigned } = useIrEditorState();
55
68
  const actions = useIrActions();
56
69
  const { domain, tool, selectedId } = state.view;
57
- const { mode, showAssignments, labelLimit } = state.settings;
70
+ const { technique, mode, showAssignments, labelLimit } = state.settings;
58
71
 
59
72
  const onDomainChange = useCallback(
60
73
  (next: IrDomain) => {
@@ -63,11 +76,23 @@ export function IrCanvas(props: IrCanvasProps) {
63
76
  [actions],
64
77
  );
65
78
 
79
+ // Which spectrum was selected is the viewer's to say, not the chart's: the
80
+ // chart only knows where the press landed.
81
+ const onClickAt = useMemo(
82
+ () =>
83
+ onPlotClick === undefined
84
+ ? undefined
85
+ : (wavenumber: number) =>
86
+ onPlotClick({ wavenumber, spectrumId: selectedId }),
87
+ [onPlotClick, selectedId],
88
+ );
89
+
66
90
  return (
67
91
  <div style={rootStyle}>
68
92
  <div ref={attachChart} id={chartId} style={chartStyle}>
69
93
  <IrChart
70
94
  spectra={visibleSpectra}
95
+ technique={technique}
71
96
  mode={mode}
72
97
  assigned={assigned}
73
98
  showAssignments={showAssignments}
@@ -78,6 +103,7 @@ export function IrCanvas(props: IrCanvasProps) {
78
103
  onDomainChange={onDomainChange}
79
104
  drag={tool === 'box' ? 'box' : 'xAxis'}
80
105
  emphasisedId={selectedId}
106
+ onPlotClick={onClickAt}
81
107
  />
82
108
  </div>
83
109
  <IrStatusBar />
@@ -3,20 +3,21 @@ import { useCallback, useId, useLayoutEffect, useMemo, useRef } from 'react';
3
3
 
4
4
  import { sameChartDomain } from '../../chart/core/chartDomain.ts';
5
5
  import { MARGIN, plotRect } from '../../chart/core/chartGeometry.ts';
6
+ import type { ChartPoint } from '../../chart/core/svgPoint.ts';
6
7
  import { Axes } from '../../chart/ui/Axes.tsx';
7
8
  import { SelectionRect } from '../../chart/ui/SelectionRect.tsx';
8
9
  import { chartSurfaceStyle } from '../../chart/ui/chartSurface.ts';
9
10
  import { useChartSize } from '../../chart/ui/useChartSize.ts';
10
11
  import type { AssignedBand } from '../core/assignBands.ts';
11
12
  import type { IrBand } from '../core/irBand.ts';
12
- import { boxZoomOnly, yAxisTitle } from '../core/irMode.ts';
13
- import type { IrMode } from '../core/irSpectrum.ts';
13
+ import { irModeFor } from '../core/irTechnique.ts';
14
14
 
15
15
  import { BandMarks } from './BandMarks.tsx';
16
16
  import { IrPointerTracker } from './IrPointerTracker.tsx';
17
17
  import { IrTraces } from './IrTraces.tsx';
18
18
  import type { IrChartProps } from './irChartProps.ts';
19
19
  import { useIrPointer } from './useIrPointer.ts';
20
+ import { useIrText } from './useIrText.ts';
20
21
  import { useIrZoom } from './useIrZoom.ts';
21
22
 
22
23
  /**
@@ -28,7 +29,8 @@ import { useIrZoom } from './useIrZoom.ts';
28
29
  * building the scale onto a reversed pixel range and nothing else: the data stays
29
30
  * in ascending wavenumbers, every window stays low end first, and no other piece
30
31
  * of arithmetic in either package has to know. That is the whole reason
31
- * `createScale` takes its range rather than deriving it.
32
+ * `createScale` takes its range rather than deriving it. A Raman spectrum is
33
+ * drawn the other way, low shifts at the left, by the same means.
32
34
  *
33
35
  * The axes go under the data, so a grid line is never read as a band. Only the
34
36
  * data band is clipped, so a zoomed trace stops at the plot edge while the
@@ -46,7 +48,8 @@ import { useIrZoom } from './useIrZoom.ts';
46
48
  export function IrChart(props: IrChartProps): ReactElement {
47
49
  const {
48
50
  spectra,
49
- mode = 'transmittance',
51
+ technique = 'infrared',
52
+ mode: asked,
50
53
  assigned = NO_BANDS,
51
54
  showAssignments = false,
52
55
  labelLimit,
@@ -54,6 +57,7 @@ export function IrChart(props: IrChartProps): ReactElement {
54
57
  onHighlight,
55
58
  domain = null,
56
59
  onDomainChange,
60
+ onPlotClick,
57
61
  drag = 'xAxis',
58
62
  emphasisedId = null,
59
63
  width,
@@ -61,6 +65,8 @@ export function IrChart(props: IrChartProps): ReactElement {
61
65
  children,
62
66
  } = props;
63
67
 
68
+ const mode = irModeFor(technique, asked);
69
+ const text = useIrText(technique);
64
70
  const [containerRef, measured] = useChartSize<HTMLDivElement>();
65
71
  const svgRef = useRef<SVGSVGElement | null>(null);
66
72
 
@@ -77,9 +83,26 @@ export function IrChart(props: IrChartProps): ReactElement {
77
83
  const frameWidth = plot.right + MARGIN.right;
78
84
  const frameHeight = plot.bottom + MARGIN.bottom;
79
85
 
86
+ const onClick = useMemo(
87
+ () =>
88
+ onPlotClick === undefined
89
+ ? undefined
90
+ : (point: ChartPoint) => onPlotClick(point.x),
91
+ [onPlotClick],
92
+ );
93
+
80
94
  // The host's window goes *into* the zoom rather than over it, so a drag is
81
95
  // always measured against what is on screen.
82
- const zoom = useIrZoom({ spectra, mode, svgRef, plot, domain, drag });
96
+ const zoom = useIrZoom({
97
+ spectra,
98
+ technique,
99
+ mode,
100
+ svgRef,
101
+ plot,
102
+ domain,
103
+ drag,
104
+ onClick,
105
+ });
83
106
 
84
107
  // The scales the zoom measured its gestures against — the x one running right
85
108
  // to left. Taken from the hook rather than built here, because two scales over
@@ -128,7 +151,7 @@ export function IrChart(props: IrChartProps): ReactElement {
128
151
  <svg
129
152
  ref={svgRef}
130
153
  role="img"
131
- aria-label={chartLabel(mode)}
154
+ aria-label={text.chart(mode)}
132
155
  width={frameWidth}
133
156
  height={frameHeight}
134
157
  viewBox={`0 0 ${frameWidth} ${frameHeight}`}
@@ -154,8 +177,8 @@ export function IrChart(props: IrChartProps): ReactElement {
154
177
  yDomain={shown.y}
155
178
  xScale={xScale}
156
179
  yScale={yScale}
157
- xTitle="wavenumber (cm⁻¹)"
158
- yTitle={yAxisTitle(mode)}
180
+ xTitle={text.xTitle}
181
+ yTitle={text.yTitle(mode)}
159
182
  />
160
183
 
161
184
  <g clipPath={`url(#${clipId})`}>
@@ -192,22 +215,6 @@ export function IrChart(props: IrChartProps): ReactElement {
192
215
  );
193
216
  }
194
217
 
195
- /**
196
- * What the chart is, and what can be done to it, for whoever cannot see it.
197
- *
198
- * The gestures differ by mode, so the sentence does too — a label promising the
199
- * wheel to a reader who cannot watch it fail to do anything is worse than no
200
- * label at all.
201
- * @param mode - Which value axis is being drawn.
202
- * @returns The label.
203
- */
204
- function chartLabel(mode: IrMode): string {
205
- const axis = `Infrared spectrum read as ${yAxisTitle(mode)}, wavenumber running from high at the left to low at the right.`;
206
- return boxZoomOnly(mode)
207
- ? `${axis} Drag a rectangle over it to zoom to that rectangle, and double click to fit everything again.`
208
- : `${axis} Drag across it to zoom the wavenumber axis, drag past the baseline to take the value axis with it, turn the wheel to scale the value axis, and double click to fit everything again.`;
209
- }
210
-
211
218
  /** What a chart nobody has picked any bands for marks. */
212
219
  const NO_BANDS: readonly AssignedBand[] = Object.freeze([]);
213
220
 
@@ -2,6 +2,7 @@ import type { ReactNode } from 'react';
2
2
  import { useMemo } from 'react';
3
3
 
4
4
  import type { IrCommandHandlers } from '../core/irCommands.ts';
5
+ import type { IrTechnique } from '../core/irTechnique.ts';
5
6
 
6
7
  import type { IrCommandContextValue } from './irCommandContext.tsx';
7
8
  import { commandContext } from './irCommandContext.tsx';
@@ -9,6 +10,12 @@ import { commandContext } from './irCommandContext.tsx';
9
10
  export interface IrCommandProviderProps {
10
11
  /** What each command does. */
11
12
  handlers: IrCommandHandlers;
13
+ /**
14
+ * What the spectra were measured with, which decides how each command is
15
+ * worded in its tooltip and its label.
16
+ * @default 'infrared'
17
+ */
18
+ technique?: IrTechnique;
12
19
  /** The viewer. */
13
20
  children: ReactNode;
14
21
  }
@@ -19,11 +26,11 @@ export interface IrCommandProviderProps {
19
26
  * @returns The provider.
20
27
  */
21
28
  export function IrCommandProvider(props: IrCommandProviderProps) {
22
- const { handlers, children } = props;
29
+ const { handlers, technique = 'infrared', children } = props;
23
30
 
24
31
  const value = useMemo<IrCommandContextValue>(
25
- () => ({ handlers, run: (id) => handlers[id]?.() }),
26
- [handlers],
32
+ () => ({ handlers, technique, run: (id) => handlers[id]?.() }),
33
+ [handlers, technique],
27
34
  );
28
35
 
29
36
  return (
@@ -2,10 +2,19 @@ import { TooltipHelpContent } from 'react-science/ui';
2
2
 
3
3
  import type { IrCommand, IrCommandId } from '../core/irCommands.ts';
4
4
  import { irCommands } from '../core/irCommands.ts';
5
+ import type { IrTechnique } from '../core/irTechnique.ts';
6
+
7
+ import { useIrText } from './useIrText.ts';
5
8
 
6
9
  export interface IrCommandTooltipProps {
7
10
  /** Which command the tooltip is about. */
8
11
  id: IrCommandId;
12
+ /**
13
+ * What the spectra were measured with, which decides how the command is
14
+ * worded.
15
+ * @default 'infrared'
16
+ */
17
+ technique?: IrTechnique;
9
18
  }
10
19
 
11
20
  /**
@@ -18,8 +27,8 @@ export interface IrCommandTooltipProps {
18
27
  * @returns The tooltip's content.
19
28
  */
20
29
  export function IrCommandTooltip(props: IrCommandTooltipProps) {
21
- const { id } = props;
22
- const entry = irCommands[id] as IrCommand;
30
+ const { id, technique = 'infrared' } = props;
31
+ const entry: IrCommand = useIrText(technique).command(id) ?? irCommands[id];
23
32
  const shortcuts = entry.shortcut?.label ?? entry.shortcut?.keys;
24
33
 
25
34
  return (
@@ -1,17 +1,27 @@
1
1
  import { Dialog, DialogBody } from '@blueprintjs/core';
2
2
 
3
+ import { Prose } from '../../i18n/ui/Prose.tsx';
4
+ import { useChromeT } from '../../i18n/ui/useT.ts';
3
5
  import { TOKEN } from '../../tokens/core/familyTokens.ts';
4
6
  import type { IrCommand, IrCommandId } from '../core/irCommands.ts';
5
- import { irCommands } from '../core/irCommands.ts';
6
7
  import { IR_MODE_RULES } from '../core/irMode.ts';
8
+ import type { IrTechnique } from '../core/irTechnique.ts';
9
+ import { irCommandsFor } from '../core/irTechniqueCommands.ts';
7
10
 
8
11
  import { IrLogo } from './IrLogo.tsx';
12
+ import { useIrText } from './useIrText.ts';
9
13
 
10
14
  export interface IrDocumentationDialogProps {
11
15
  /** Whether the dialog is open. */
12
16
  isOpen: boolean;
13
17
  /** Close it. */
14
18
  onClose: () => void;
19
+ /**
20
+ * What the spectra were measured with, which decides what the guide says:
21
+ * only what is true of the technique, and only the commands it offers.
22
+ * @default 'infrared'
23
+ */
24
+ technique?: IrTechnique;
15
25
  }
16
26
 
17
27
  /**
@@ -19,73 +29,36 @@ export interface IrDocumentationDialogProps {
19
29
  *
20
30
  * In the component rather than on a site, so there is nowhere to leave for and
21
31
  * nothing to keep in step: every key in the table below is read out of the same
22
- * `irCommands` the toolbar and the key handler read, so a shortcut cannot be
32
+ * command table the toolbar and the key handler read, so a shortcut cannot be
23
33
  * documented as one thing and bound as another.
24
34
  * @param props - Component props.
25
35
  * @returns The dialog.
26
36
  */
27
37
  export function IrDocumentationDialog(props: IrDocumentationDialogProps) {
28
- const { isOpen, onClose } = props;
38
+ const { isOpen, onClose, technique = 'infrared' } = props;
39
+ const text = useIrText(technique);
40
+ const ids = Object.keys(irCommandsFor(technique)) as IrCommandId[];
29
41
 
30
42
  return (
31
43
  <Dialog
32
44
  isOpen={isOpen}
33
45
  onClose={onClose}
34
- title="Using the infrared viewer"
35
- icon={<IrLogo size={20} />}
46
+ title={text.documentation}
47
+ icon={<IrLogo size={20} technique={technique} />}
36
48
  style={dialogStyle}
37
49
  >
38
50
  <DialogBody>
39
- <h4 style={headingStyle}>Opening a spectrum</h4>
40
- <p style={paragraphStyle}>
41
- JCAMP-DX (<code>.jdx</code>, <code>.dx</code>) and Thermo Galactic SPC
42
- (<code>.spc</code>) are read. A file holding several blocks — a sample
43
- beside its background, or an infrared spectrum beside a Raman one —
44
- gives one spectrum per infrared block; the others are left to their
45
- own viewers. Two columns of numbers are not read yet.
46
- </p>
47
-
48
- <h4 style={headingStyle}>The axis runs backwards</h4>
49
- <p style={paragraphStyle}>
50
- Wavenumber decreases to the right, from 4000 cm⁻¹ down to 400, which
51
- is how infrared spectra have been printed since the instruments
52
- scanned that way. Every window is still stated low end first.
53
- </p>
54
-
55
- <h4 style={headingStyle}>Absorbance or transmittance</h4>
56
- <p style={paragraphStyle}>
57
- The same measurement, read the other way up — the file carries both,
58
- whichever it was written in. In{' '}
59
- <strong>{IR_MODE_RULES.transmittance.title}</strong> the bands hang
60
- down from a baseline near 100; in{' '}
61
- <strong>{IR_MODE_RULES.absorbance.title}</strong> they stand up out of
62
- zero. The labels and the marks follow, so the pair reads the same way
63
- up in either.
64
- </p>
65
-
66
- <h4 style={headingStyle}>Reading the bands</h4>
67
- <p style={paragraphStyle}>
68
- The bands of the <em>selected</em> spectrum are picked, marked on the
69
- chart, and listed in the bands panel with{' '}
70
- <strong>every vibration whose range contains them</strong> — narrowest
71
- claim first. That is deliberate: a band at 1715 cm⁻¹ really is a
72
- ketone, an aldehyde and a carboxylic acid until something else decides
73
- between them, and the note on each candidate is what tells them apart.
74
- Hovering a row marks the band on the chart, and hovering the chart
75
- lights the row.
76
- </p>
77
- <p style={paragraphStyle}>
78
- A band is reported at the sampled point it peaked on, so on a 4 cm⁻¹
79
- grid a carbonyl centred at 1710 reads 1708 or 1712. Do not quote one
80
- as though it were measured to the wavenumber.
81
- </p>
51
+ {technique === 'raman' ? <RamanGuide /> : <InfraredGuide />}
82
52
 
83
53
  <h4 style={headingStyle}>Gestures and keys</h4>
84
54
  <table style={tableStyle}>
85
55
  <tbody>
86
- {(Object.keys(irCommands) as IrCommandId[]).map((id) => (
87
- <CommandRow key={id} id={id} />
88
- ))}
56
+ {ids.map((id) => {
57
+ const entry = text.command(id);
58
+ return entry === undefined ? null : (
59
+ <CommandRow key={id} entry={entry} />
60
+ );
61
+ })}
89
62
  </tbody>
90
63
  </table>
91
64
  </DialogBody>
@@ -93,9 +66,81 @@ export function IrDocumentationDialog(props: IrDocumentationDialogProps) {
93
66
  );
94
67
  }
95
68
 
69
+ /**
70
+ * What is true of reading an infrared spectrum here.
71
+ * @returns The sections.
72
+ */
73
+ function InfraredGuide() {
74
+ return (
75
+ <>
76
+ <h4 style={headingStyle}>Opening a spectrum</h4>
77
+ <p style={paragraphStyle}>
78
+ JCAMP-DX (<code>.jdx</code>, <code>.dx</code>) and Thermo Galactic SPC (
79
+ <code>.spc</code>) are read. A file holding several blocks — a sample
80
+ beside its background, or an infrared spectrum beside a Raman one —
81
+ gives one spectrum per infrared block; the others are left to their own
82
+ viewers. Two columns of numbers are not read yet.
83
+ </p>
84
+
85
+ <h4 style={headingStyle}>The axis runs backwards</h4>
86
+ <p style={paragraphStyle}>
87
+ Wavenumber decreases to the right, from 4000 cm⁻¹ down to 400, which is
88
+ how infrared spectra have been printed since the instruments scanned
89
+ that way. Every window is still stated low end first.
90
+ </p>
91
+
92
+ <h4 style={headingStyle}>Absorbance or transmittance</h4>
93
+ <p style={paragraphStyle}>
94
+ The same measurement, read the other way up — the file carries both,
95
+ whichever it was written in. In{' '}
96
+ <strong>{IR_MODE_RULES.transmittance.title}</strong> the bands hang down
97
+ from a baseline near 100; in{' '}
98
+ <strong>{IR_MODE_RULES.absorbance.title}</strong> they stand up out of
99
+ zero. The labels and the marks follow, so the pair reads the same way up
100
+ in either.
101
+ </p>
102
+
103
+ <h4 style={headingStyle}>Reading the bands</h4>
104
+ <p style={paragraphStyle}>
105
+ The bands of the <em>selected</em> spectrum are picked, marked on the
106
+ chart, and listed in the bands panel with{' '}
107
+ <strong>every vibration whose range contains them</strong> — narrowest
108
+ claim first. That is deliberate: a band at 1715 cm⁻¹ really is a ketone,
109
+ an aldehyde and a carboxylic acid until something else decides between
110
+ them, and the note on each candidate is what tells them apart. Hovering
111
+ a row marks the band on the chart, and hovering the chart lights the
112
+ row.
113
+ </p>
114
+ <p style={paragraphStyle}>
115
+ A band is reported at the sampled point it peaked on, so on a 4 cm⁻¹
116
+ grid a carbonyl centred at 1710 reads 1708 or 1712. Do not quote one as
117
+ though it were measured to the wavenumber.
118
+ </p>
119
+ </>
120
+ );
121
+ }
122
+
123
+ /**
124
+ * What is true of reading a Raman spectrum here: only the bands, since it has
125
+ * one value axis, runs the usual way, and is not assigned.
126
+ * @returns The section.
127
+ */
128
+ function RamanGuide() {
129
+ const t = useChromeT();
130
+ return (
131
+ <>
132
+ <h4 style={headingStyle}>Reading the bands</h4>
133
+ <p style={paragraphStyle}>
134
+ <Prose text={t('ir.raman.doc.bands')} />
135
+ </p>
136
+ <p style={paragraphStyle}>{t('ir.raman.doc.sampled')}</p>
137
+ </>
138
+ );
139
+ }
140
+
96
141
  interface CommandRowProps {
97
- /** Which command the row is about. */
98
- id: IrCommandId;
142
+ /** The command, as the viewer words it. */
143
+ entry: IrCommand;
99
144
  }
100
145
 
101
146
  /**
@@ -104,8 +149,7 @@ interface CommandRowProps {
104
149
  * @returns The row.
105
150
  */
106
151
  function CommandRow(props: CommandRowProps) {
107
- const { id } = props;
108
- const entry = irCommands[id] as IrCommand;
152
+ const { entry } = props;
109
153
  const keys = entry.shortcut?.label ?? entry.shortcut?.keys;
110
154
 
111
155
  return (
@@ -1,13 +1,11 @@
1
1
  import type { Ref } from 'react';
2
- import { RootLayout } from 'react-science/ui';
3
2
 
4
- import type { IrEditorHandle } from '../core/irEditorApi.ts';
5
- import type { IrSidePanelId } from '../core/irSidePanels.ts';
3
+ import type { IrEditorHandle, IrPlotClick } from '../core/irEditorApi.ts';
4
+ import type { IrPanelId } from '../core/irSidePanels.ts';
6
5
  import type { IrMode, IrSpectrum } from '../core/irSpectrum.ts';
7
6
 
8
- import { IrShell } from './IrShell.tsx';
9
- import { IrStateProvider } from './IrStateProvider.tsx';
10
- import { useIrEditor } from './useIrEditor.ts';
7
+ import { VibrationalEditor } from './VibrationalEditor.tsx';
8
+ import type { IrHostPanel } from './irHostPanels.ts';
11
9
 
12
10
  export interface IrEditorProps {
13
11
  /**
@@ -29,15 +27,33 @@ export interface IrEditorProps {
29
27
  */
30
28
  onChange?: (spectra: IrSpectrum[]) => void;
31
29
  /**
32
- * Which value axis to open in.
30
+ * Which value axis to open in: transmittance or absorbance. Intensity, which
31
+ * infrared does not offer, opens transmittance instead.
33
32
  * @default 'transmittance'
34
33
  */
35
34
  mode?: IrMode;
36
35
  /**
37
- * The side panels open to begin with.
36
+ * The side panels open to begin with: the viewer's own — `'spectra'`,
37
+ * `'bands'`, `'metadata'` — or the id of one of `panels`. An id no panel
38
+ * answers to is ignored.
38
39
  * @default DEFAULT_SIDE_PANELS
39
40
  */
40
- defaultPanelIds?: IrSidePanelId[];
41
+ defaultPanelIds?: readonly IrPanelId[];
42
+ /**
43
+ * Panels the host adds to the viewer's own — a structure to predict a
44
+ * spectrum from, say. Their icons come first in the activity bar, in the
45
+ * order given, and each then behaves as a built-in panel does: toggled on its
46
+ * own, stacked in the same column with a share of its height, folded and
47
+ * closed from its header.
48
+ * @default []
49
+ */
50
+ panels?: readonly IrHostPanel[];
51
+ /**
52
+ * The plot was clicked at this wavenumber (a press that did not travel, i.e.
53
+ * not a zoom drag), with the spectrum selected at that moment.
54
+ * @default undefined
55
+ */
56
+ onPlotClick?: (click: IrPlotClick) => void;
41
57
  /**
42
58
  * The handle a host drives the viewer through: take these spectra, frame this
43
59
  * wavenumber, select that one.
@@ -49,6 +65,7 @@ export interface IrEditorProps {
49
65
  /**
50
66
  * An infrared spectrum viewer: a header across the top, the chart in the middle,
51
67
  * the tools down the left, and the panels that interrogate it down the right.
68
+ * `RamanEditor`, from `react-cheminfo/raman`, is the same viewer for Raman.
52
69
  *
53
70
  * The same shape as the mass viewer, deliberately — a page may well hold both,
54
71
  * and a chemist who has learned one should not have to learn the other. The chart
@@ -65,35 +82,5 @@ export interface IrEditorProps {
65
82
  * @returns The viewer.
66
83
  */
67
84
  export function IrEditor(props: IrEditorProps) {
68
- const { data = NO_SPECTRA, onChange, mode, defaultPanelIds, ref } = props;
69
-
70
- const editor = useIrEditor({
71
- spectra: data,
72
- settings: mode === undefined ? undefined : { mode },
73
- panelIds: defaultPanelIds,
74
- onChange,
75
- });
76
-
77
- return (
78
- <IrStateProvider editor={editor}>
79
- {/* `react-science`'s own root: it holds the element the browser is asked
80
- to show full screen, points Blueprint's portals at that element so
81
- dialogs and tooltips are not left behind in `document.body`, and paints
82
- the backdrop white. Above the shell rather than inside it, so the shell
83
- can ask whether it is full screen and offer the way out. */}
84
- <RootLayout style={rootLayoutStyle}>
85
- <IrShell handle={ref} />
86
- </RootLayout>
87
- </IrStateProvider>
88
- );
85
+ return <VibrationalEditor technique="infrared" {...props} />;
89
86
  }
90
-
91
- /**
92
- * The viewer fills what it is given, and its own children scroll rather than
93
- * push: `react-science` lays its root out as a column of full width and height,
94
- * and a flex column with no `minHeight` grows past its parent instead.
95
- */
96
- const rootLayoutStyle = { minHeight: 0 } as const;
97
-
98
- /** What a viewer opens on when it is handed nothing, kept stable for the memo. */
99
- const NO_SPECTRA: IrSpectrum[] = [];
@@ -2,6 +2,8 @@ import { Header, Toolbar, useFullscreen } from 'react-science/ui';
2
2
 
3
3
  import { IrLogo } from './IrLogo.tsx';
4
4
  import { useIrCommandProps } from './irCommandContext.tsx';
5
+ import { useIrEditorState } from './irStateContext.ts';
6
+ import { useIrText } from './useIrText.ts';
5
7
 
6
8
  /**
7
9
  * The bar across the top: the mark on the left, the viewer on the right.
@@ -17,13 +19,18 @@ import { useIrCommandProps } from './irCommandContext.tsx';
17
19
  export function IrHeader() {
18
20
  const command = useIrCommandProps();
19
21
  const { isFullScreen } = useFullscreen();
22
+ const { technique } = useIrEditorState().state.settings;
23
+ const text = useIrText(technique);
20
24
 
21
25
  return (
22
26
  <Header>
23
- <Toolbar aria-label="Infrared spectrum viewer">
24
- <Toolbar.Item icon={<IrLogo size={16} />} {...command('about')} />
27
+ <Toolbar aria-label={text.viewer}>
28
+ <Toolbar.Item
29
+ icon={<IrLogo size={16} technique={technique} />}
30
+ {...command('about')}
31
+ />
25
32
  </Toolbar>
26
- <Toolbar aria-label="Infrared spectrum viewer help">
33
+ <Toolbar aria-label={text.viewerHelp}>
27
34
  <Toolbar.Item icon="help" {...command('documentation')} />
28
35
  {/* Always the last thing in the bar, hard against the right edge: the
29
36
  corner a window is made bigger from is the corner it is looked for